diff --git a/.buildkite/ftr_oblt_stateful_configs.yml b/.buildkite/ftr_oblt_stateful_configs.yml index 1a2797795828e..3211c35f29e7a 100644 --- a/.buildkite/ftr_oblt_stateful_configs.yml +++ b/.buildkite/ftr_oblt_stateful_configs.yml @@ -20,7 +20,7 @@ disabled: - x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/synthetics_run.ts - x-pack/solutions/observability/plugins/exploratory_view/e2e/synthetics_run.ts - x-pack/solutions/observability/plugins/ux/e2e/synthetics_run.ts - - x-pack/plugins/observability_solution/slo/e2e/synthetics_run.ts + - x-pack/solutions/observability/plugins/slo/e2e/synthetics_run.ts defaultQueue: 'n2-4-spot' enabled: diff --git a/.buildkite/pipelines/pull_request/renovate.yml b/.buildkite/pipelines/pull_request/renovate.yml new file mode 100644 index 0000000000000..98302a8d7912f --- /dev/null +++ b/.buildkite/pipelines/pull_request/renovate.yml @@ -0,0 +1,12 @@ +steps: + - command: .buildkite/scripts/steps/renovate.sh + label: 'Renovate validation' + agents: + machineType: n2-highcpu-8 + preemptible: true + key: renovate_validation + timeout_in_minutes: 60 + retry: + automatic: + - exit_status: '-1' + limit: 3 diff --git a/.buildkite/pipelines/pull_request/slo_plugin_e2e.yml b/.buildkite/pipelines/pull_request/slo_plugin_e2e.yml index 2cf1126cf1f5d..8e6ad5734d703 100644 --- a/.buildkite/pipelines/pull_request/slo_plugin_e2e.yml +++ b/.buildkite/pipelines/pull_request/slo_plugin_e2e.yml @@ -14,7 +14,7 @@ steps: - check_oas_snapshot timeout_in_minutes: 30 artifact_paths: - - 'x-pack/plugins/observability_solution/slo/e2e/.journeys/**/*' + - 'x-pack/solutions/observability/plugins/slo/e2e/.journeys/**/*' retry: automatic: - exit_status: '-1' diff --git a/.buildkite/scripts/packer_cache.sh b/.buildkite/scripts/packer_cache.sh index 57118b242d3e7..758dcfa502e71 100755 --- a/.buildkite/scripts/packer_cache.sh +++ b/.buildkite/scripts/packer_cache.sh @@ -15,5 +15,5 @@ for version in $(cat versions.json | jq -r '.versions[].version'); do done for version in $(cat versions.json | jq -r '.versions[].version'); do - node x-pack/plugins/security_solution/scripts/endpoint/agent_downloader --version "$version" + node x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_downloader --version "$version" done diff --git a/.buildkite/scripts/pipelines/pull_request/pipeline.ts b/.buildkite/scripts/pipelines/pull_request/pipeline.ts index 0f015a98c76e7..51587280c4ed5 100644 --- a/.buildkite/scripts/pipelines/pull_request/pipeline.ts +++ b/.buildkite/scripts/pipelines/pull_request/pipeline.ts @@ -40,6 +40,15 @@ const getPipeline = (filename: string, removeSteps = true) => { } pipeline.push(getAgentImageConfig({ returnYaml: true })); + + const onlyRunQuickChecks = await areChangesSkippable([/^renovate\.json$/], REQUIRED_PATHS); + if (onlyRunQuickChecks) { + pipeline.push(getPipeline('.buildkite/pipelines/pull_request/renovate.yml', false)); + + console.log([...new Set(pipeline)].join('\n')); + return; + } + pipeline.push(getPipeline('.buildkite/pipelines/pull_request/base.yml', false)); if (await doAnyChangesMatch([/^packages\/kbn-handlebars/])) { @@ -224,7 +233,7 @@ const getPipeline = (filename: string, removeSteps = true) => { if ( (await doAnyChangesMatch([ /^packages\/kbn-securitysolution-.*/, - /^x-pack\/plugins\/security_solution/, + /^x-pack\/solutions\/security\/plugins\/security_solution/, /^x-pack\/test\/defend_workflows_cypress/, /^x-pack\/test\/security_solution_cypress/, /^fleet_packages\.json/, @@ -242,11 +251,11 @@ const getPipeline = (filename: string, removeSteps = true) => { /^packages\/kbn-securitysolution-.*/, /^x-pack\/plugins\/alerting/, /^x-pack\/plugins\/data_views\/common/, - /^x-pack\/plugins\/lists/, + /^x-pack\/solutions\/security\/plugins\/lists/, /^x-pack\/plugins\/rule_registry\/common/, - /^x-pack\/plugins\/security_solution/, - /^x-pack\/plugins\/security_solution_ess/, - /^x-pack\/plugins\/security_solution_serverless/, + /^x-pack\/solutions\/security\/plugins\/security_solution/, + /^x-pack\/solutions\/security\/plugins\/security_solution_ess/, + /^x-pack\/solutions\/security\/plugins\/security_solution_serverless/, /^x-pack\/plugins\/task_manager/, /^x-pack\/solutions\/security\/plugins\/timelines/, /^x-pack\/plugins\/triggers_actions_ui\/public\/application\/sections\/action_connector_form/, @@ -255,7 +264,7 @@ const getPipeline = (filename: string, removeSteps = true) => { /^x-pack\/plugins\/triggers_actions_ui\/server\/connector_types\/bedrock/, /^x-pack\/plugins\/usage_collection\/public/, /^x-pack\/solutions\/security\/plugins\/elastic_assistant/, - /^x-pack\/packages\/security-solution/, + /^x-pack\/solutions\/security\/packages/, /^x-pack\/platform\/packages\/shared\/kbn-elastic-assistant/, /^x-pack\/platform\/packages\/shared\/kbn-elastic-assistant-common/, /^x-pack\/test\/functional\/es_archives\/security_solution/, @@ -290,7 +299,6 @@ const getPipeline = (filename: string, removeSteps = true) => { /^packages\/kbn-es-query/, /^packages\/kbn-i18n/, /^packages\/kbn-i18n-react/, - /^x-pack\/solutions\/security\/packages\/expandable-flyout/, /^packages\/kbn-grouping/, /^packages\/kbn-resizable-layout/, /^packages\/kbn-rison/, @@ -299,10 +307,10 @@ const getPipeline = (filename: string, removeSteps = true) => { /^packages\/kbn-search-types/, /^packages\/kbn-securitysolution-.*/, /^src\/platform\/packages\/shared\/kbn-securitysolution-ecs/, - /^packages\/kbn-securitysolution-io-ts-alerting-types/, - /^packages\/kbn-securitysolution-io-ts-list-types/, - /^packages\/kbn-securitysolution-list-hooks/, - /^packages\/kbn-securitysolution-t-grid/, + /^x-pack\/solutions\/security\/packages\/kbn-securitysolution-io-ts-alerting-types/, + /^x-pack\/solutions\/security\/packages\/kbn-securitysolution-io-ts-list-types/, + /^x-pack\/solutions\/security\/packages\/kbn-securitysolution-list-hooks/, + /^x-pack\/solutions\/security\/packages\/kbn-securitysolution-t-grid/, /^packages\/kbn-ui-theme/, /^packages\/kbn-utility-types/, /^packages\/react/, @@ -323,16 +331,16 @@ const getPipeline = (filename: string, removeSteps = true) => { /^src\/plugins\/unified_search/, /^x-pack\/platform\/packages\/shared\/kbn-elastic-assistant/, /^x-pack\/platform\/packages\/shared\/kbn-elastic-assistant-common/, - /^x-pack\/packages\/security-solution/, + /^x-pack\/solutions\/security\/packages/, /^x-pack\/plugins\/alerting/, /^x-pack\/plugins\/cases/, /^x-pack\/plugins\/data_views\/common/, /^x-pack\/solutions\/security\/plugins\/elastic_assistant/, - /^x-pack\/plugins\/lists/, + /^x-pack\/solutions\/security\/plugins\/lists/, /^x-pack\/plugins\/rule_registry\/common/, - /^x-pack\/plugins\/security_solution/, - /^x-pack\/plugins\/security_solution_ess/, - /^x-pack\/plugins\/security_solution_serverless/, + /^x-pack\/solutions\/security\/plugins\/security_solution/, + /^x-pack\/solutions\/security\/plugins\/security_solution_ess/, + /^x-pack\/solutions\/security\/plugins\/security_solution_serverless/, /^x-pack\/plugins\/task_manager/, /^x-pack\/solutions\/security\/plugins\/threat_intelligence/, /^x-pack\/solutions\/security\/plugins\/timelines/, @@ -352,7 +360,7 @@ const getPipeline = (filename: string, removeSteps = true) => { ((await doAnyChangesMatch([ /^x-pack\/platform\/plugins\/shared\/osquery/, /^x-pack\/test\/osquery_cypress/, - /^x-pack\/plugins\/security_solution/, + /^x-pack\/solutions\/security\/plugins\/security_solution/, ])) || GITHUB_PR_LABELS.includes('ci:all-cypress-suites')) && !GITHUB_PR_LABELS.includes('ci:skip-cypress-osquery') @@ -365,8 +373,8 @@ const getPipeline = (filename: string, removeSteps = true) => { if ( (await doAnyChangesMatch([ /^x-pack\/packages\/kbn-cloud-security-posture/, - /^x-pack\/plugins\/cloud_security_posture/, - /^x-pack\/plugins\/security_solution/, + /^x-pack\/solutions\/security\/plugins\/cloud_security_posture/, + /^x-pack\/solutions\/security\/plugins\/security_solution/, /^x-pack\/test\/security_solution_cypress/, ])) || GITHUB_PR_LABELS.includes('ci:all-cypress-suites') diff --git a/.buildkite/scripts/pipelines/security_solution_quality_gate/edr_workflows/mki_security_solution_defend_workflows.sh b/.buildkite/scripts/pipelines/security_solution_quality_gate/edr_workflows/mki_security_solution_defend_workflows.sh index e076e8661d9eb..3ea061b4a9555 100755 --- a/.buildkite/scripts/pipelines/security_solution_quality_gate/edr_workflows/mki_security_solution_defend_workflows.sh +++ b/.buildkite/scripts/pipelines/security_solution_quality_gate/edr_workflows/mki_security_solution_defend_workflows.sh @@ -18,7 +18,7 @@ buildkite-agent meta-data set "${BUILDKITE_JOB_ID}_is_test_execution_step" "true source .buildkite/scripts/pipelines/security_solution_quality_gate/prepare_vault_entries.sh -cd x-pack/plugins/security_solution +cd x-pack/solutions/security/plugins/security_solution set +e export BK_ANALYTICS_API_KEY=$(vault_get security-solution-quality-gate serverless-cypress-defend-workflows) diff --git a/.buildkite/scripts/steps/code_generation/security_solution_codegen.sh b/.buildkite/scripts/steps/code_generation/security_solution_codegen.sh index 59651402c9d83..5f140efc5db8d 100755 --- a/.buildkite/scripts/steps/code_generation/security_solution_codegen.sh +++ b/.buildkite/scripts/steps/code_generation/security_solution_codegen.sh @@ -7,18 +7,18 @@ source .buildkite/scripts/common/util.sh echo --- Security Solution OpenAPI Code Generation echo -e "\n[Security Solution OpenAPI Code Generation] OpenAPI Common Package\n" -(cd packages/kbn-openapi-common && yarn openapi:generate) +(cd src/platform/packages/shared/kbn-openapi-common && yarn openapi:generate) echo -e "\n[Security Solution OpenAPI Code Generation] Lists Common Package\n" -(cd packages/kbn-securitysolution-lists-common && yarn openapi:generate) +(cd x-pack/solutions/security/packages/kbn-securitysolution-lists-common && yarn openapi:generate) echo -e "\n[Security Solution OpenAPI Code Generation] Exceptions Common Package\n" -(cd packages/kbn-securitysolution-exceptions-common && yarn openapi:generate) +(cd x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common && yarn openapi:generate) echo -e "\n[Security Solution OpenAPI Code Generation] Endpoint Exceptions Common Package\n" -(cd packages/kbn-securitysolution-endpoint-exceptions-common && yarn openapi:generate) +(cd x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common && yarn openapi:generate) echo -e "\n[Security Solution OpenAPI Code Generation] Security Solution Plugin\n" -(cd x-pack/plugins/security_solution && yarn openapi:generate) +(cd x-pack/solutions/security/plugins/security_solution && yarn openapi:generate) check_for_changed_files "yarn openapi:generate" true \ No newline at end of file diff --git a/.buildkite/scripts/steps/functional/defend_workflows.sh b/.buildkite/scripts/steps/functional/defend_workflows.sh index 80a58683af6fb..11ea4f5b82c05 100755 --- a/.buildkite/scripts/steps/functional/defend_workflows.sh +++ b/.buildkite/scripts/steps/functional/defend_workflows.sh @@ -9,7 +9,7 @@ export KIBANA_INSTALL_DIR=${KIBANA_BUILD_LOCATION} echo "--- Defend Workflows Cypress tests" -cd x-pack/plugins/security_solution +cd x-pack/solutions/security/plugins/security_solution set +e BK_ANALYTICS_API_KEY=$(vault_get security-solution-ci defend-workflows-bk-api-key) diff --git a/.buildkite/scripts/steps/functional/defend_workflows_burn.sh b/.buildkite/scripts/steps/functional/defend_workflows_burn.sh index 44d87ba4a6635..bbe55b02ca4cb 100644 --- a/.buildkite/scripts/steps/functional/defend_workflows_burn.sh +++ b/.buildkite/scripts/steps/functional/defend_workflows_burn.sh @@ -11,4 +11,4 @@ buildkite-agent meta-data set "${BUILDKITE_JOB_ID}_is_test_execution_step" 'fals echo "--- Defend Workflows Cypress tests, burning changed specs (Chrome)" -yarn --cwd x-pack/plugins/security_solution cypress:changed-specs-only +yarn --cwd x-pack/solutions/security/plugins/security_solution cypress:changed-specs-only diff --git a/.buildkite/scripts/steps/functional/defend_workflows_serverless.sh b/.buildkite/scripts/steps/functional/defend_workflows_serverless.sh index fb1ef50bdfa1d..2f3523575e580 100755 --- a/.buildkite/scripts/steps/functional/defend_workflows_serverless.sh +++ b/.buildkite/scripts/steps/functional/defend_workflows_serverless.sh @@ -9,7 +9,7 @@ export KIBANA_INSTALL_DIR=${KIBANA_BUILD_LOCATION} echo "--- Defend Workflows Cypress tests on Serverless" -cd x-pack/plugins/security_solution +cd x-pack/solutions/security/plugins/security_solution set +e BK_ANALYTICS_API_KEY=$(vault_get security-solution-ci defend-workflows-bk-api-key) diff --git a/.buildkite/scripts/steps/functional/defend_workflows_serverless_burn.sh b/.buildkite/scripts/steps/functional/defend_workflows_serverless_burn.sh index a092ffbd4186b..bb6770c109300 100644 --- a/.buildkite/scripts/steps/functional/defend_workflows_serverless_burn.sh +++ b/.buildkite/scripts/steps/functional/defend_workflows_serverless_burn.sh @@ -11,4 +11,4 @@ buildkite-agent meta-data set "${BUILDKITE_JOB_ID}_is_test_execution_step" 'fals echo "--- Defend Workflows Cypress tests, burning changed specs (Chrome)" -yarn --cwd x-pack/plugins/security_solution cypress:dw:serverless:changed-specs-only +yarn --cwd x-pack/solutions/security/plugins/security_solution cypress:dw:serverless:changed-specs-only diff --git a/.buildkite/scripts/steps/functional/slo_plugin_e2e.sh b/.buildkite/scripts/steps/functional/slo_plugin_e2e.sh index 0492e41ae7041..b9cdebe6e89ab 100755 --- a/.buildkite/scripts/steps/functional/slo_plugin_e2e.sh +++ b/.buildkite/scripts/steps/functional/slo_plugin_e2e.sh @@ -14,4 +14,4 @@ echo "--- SLO @elastic/synthetics Tests" cd "$XPACK_DIR" -node plugins/observability_solution/slo/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} +node solutions/observability/plugins/slo/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} diff --git a/.buildkite/scripts/steps/openapi_bundling/security_solution_openapi_bundling.sh b/.buildkite/scripts/steps/openapi_bundling/security_solution_openapi_bundling.sh index 50a1de855d035..4dd23435e351d 100755 --- a/.buildkite/scripts/steps/openapi_bundling/security_solution_openapi_bundling.sh +++ b/.buildkite/scripts/steps/openapi_bundling/security_solution_openapi_bundling.sh @@ -7,25 +7,25 @@ source .buildkite/scripts/common/util.sh echo --- Security Solution OpenAPI Bundling echo -e "\n[Security Solution OpenAPI Bundling] Detections API\n" -(cd x-pack/plugins/security_solution && yarn openapi:bundle:detections) +(cd x-pack/solutions/security/plugins/security_solution && yarn openapi:bundle:detections) echo -e "\n[Security Solution OpenAPI Bundling] Timeline API\n" -(cd x-pack/plugins/security_solution && yarn openapi:bundle:timeline) +(cd x-pack/solutions/security/plugins/security_solution && yarn openapi:bundle:timeline) echo -e "\n[Security Solution OpenAPI Bundling] Entity Analytics API\n" -(cd x-pack/plugins/security_solution && yarn openapi:bundle:entity-analytics) +(cd x-pack/solutions/security/plugins/security_solution && yarn openapi:bundle:entity-analytics) echo -e "\n[Security Solution OpenAPI Bundling] Lists API\n" -(cd packages/kbn-securitysolution-lists-common && yarn openapi:bundle) +(cd x-pack/solutions/security/packages/kbn-securitysolution-lists-common && yarn openapi:bundle) echo -e "\n[Security Solution OpenAPI Bundling] Exceptions API\n" -(cd packages/kbn-securitysolution-exceptions-common && yarn openapi:bundle) +(cd x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common && yarn openapi:bundle) echo -e "\n[Security Solution OpenAPI Bundling] Endpoint Exceptions API\n" -(cd packages/kbn-securitysolution-endpoint-exceptions-common && yarn openapi:bundle) +(cd x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common && yarn openapi:bundle) echo -e "\n[Security Solution OpenAPI Bundling] Endpoint Management API\n" -(cd x-pack/plugins/security_solution && yarn openapi:bundle:endpoint-management) +(cd x-pack/solutions/security/plugins/security_solution && yarn openapi:bundle:endpoint-management) echo -e "\n[Security Solution OpenAPI Bundling] Elastic Assistant API\n" (cd x-pack/platform/packages/shared/kbn-elastic-assistant-common && yarn openapi:bundle) diff --git a/.buildkite/scripts/steps/renovate.sh b/.buildkite/scripts/steps/renovate.sh new file mode 100755 index 0000000000000..cc4583e3da216 --- /dev/null +++ b/.buildkite/scripts/steps/renovate.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -euo pipefail + +echo '--- Renovate: validation' +.buildkite/scripts/steps/checks/renovate.sh diff --git a/.eslintrc.js b/.eslintrc.js index 89896ff74a2e2..93e3dabf3b861 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -917,7 +917,7 @@ module.exports = { 'x-pack/solutions/observability/plugins/observability/**/*.{js,mjs,ts,tsx}', 'x-pack/solutions/observability/plugins/exploratory_view/**/*.{js,mjs,ts,tsx}', 'x-pack/solutions/observability/plugins/ux/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/observability_solution/slo/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/observability/plugins/slo/**/*.{js,mjs,ts,tsx}', 'x-pack/packages/observability/**/*.{js,mjs,ts,tsx}', ], rules: { @@ -937,7 +937,7 @@ module.exports = { 'x-pack/plugins/observability_solution/apm/**/*.stories.*', 'x-pack/solutions/observability/plugins/observability/**/*.stories.*', 'x-pack/solutions/observability/plugins/exploratory_view/**/*.stories.*', - 'x-pack/plugins/observability_solution/slo/**/*.stories.*', + 'x-pack/solutions/observability/plugins/slo/**/*.stories.*', 'x-pack/packages/observability/**/*.{js,mjs,ts,tsx}', ], rules: { @@ -1102,12 +1102,12 @@ module.exports = { 'x-pack/platform/packages/shared/kbn-elastic-assistant/**/*.{js,mjs,ts,tsx}', 'x-pack/platform/packages/shared/kbn-elastic-assistant-common/**/*.{js,mjs,ts,tsx}', 'x-pack/solutions/security/packages/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/security_solution/public/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/security_solution_ess/public/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/security_solution_serverless/public/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/security_solution/common/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/security_solution_ess/common/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/security_solution_serverless/common/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution/public/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution_ess/public/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution_serverless/public/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution/common/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution_ess/common/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution_serverless/common/**/*.{js,mjs,ts,tsx}', 'x-pack/solutions/security/plugins/timelines/public/**/*.{js,mjs,ts,tsx}', 'x-pack/solutions/security/plugins/timelines/common/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/cases/public/**/*.{js,mjs,ts,tsx}', @@ -1140,9 +1140,9 @@ module.exports = { 'x-pack/platform/packages/shared/kbn-elastic-assistant-common/**/*.{ts,tsx}', 'x-pack/platform/packages/shared/kbn-langchain/**/*.{ts,tsx}', 'x-pack/solutions/security/packages/**/*.{ts,tsx}', - 'x-pack/plugins/security_solution/**/*.{ts,tsx}', - 'x-pack/plugins/security_solution_ess/**/*.{ts,tsx}', - 'x-pack/plugins/security_solution_serverless/**/*.{ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution/**/*.{ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution_ess/**/*.{ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution_serverless/**/*.{ts,tsx}', 'x-pack/solutions/security/plugins/timelines/**/*.{ts,tsx}', 'x-pack/plugins/cases/**/*.{ts,tsx}', 'src/platform/packages/shared/kbn-cell-actions/**/*.{js,mjs,ts,tsx}', @@ -1155,9 +1155,9 @@ module.exports = { 'x-pack/platform/packages/shared/kbn-elastic-assistant-common/**/*.{test,mock,test_helper}.{ts,tsx}', 'x-pack/platform/packages/shared/kbn-langchain/**/*.{test,mock,test_helper}.{ts,tsx}', 'x-pack/solutions/security/packages/**/*.{test,mock,test_helper}.{ts,tsx}', - 'x-pack/plugins/security_solution/**/*.{test,mock,test_helper}.{ts,tsx}', - 'x-pack/plugins/security_solution_ess/**/*.{test,mock,test_helper}.{ts,tsx}', - 'x-pack/plugins/security_solution_serverless/**/*.{test,mock,test_helper}.{ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution/**/*.{test,mock,test_helper}.{ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution_ess/**/*.{test,mock,test_helper}.{ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution_serverless/**/*.{test,mock,test_helper}.{ts,tsx}', 'x-pack/solutions/security/plugins/timelines/**/*.{test,mock,test_helper}.{ts,tsx}', 'x-pack/plugins/cases/**/*.{test,mock,test_helper}.{ts,tsx}', 'src/platform/packages/shared/kbn-cell-actions/**/*.{test,mock,test_helper}.{ts,tsx}', @@ -1176,9 +1176,9 @@ module.exports = { 'x-pack/platform/packages/shared/kbn-elastic-assistant-common/**/*.{ts,tsx}', 'x-pack/platform/packages/shared/kbn-langchain/**/*.{ts,tsx}', 'x-pack/solutions/security/packages/**/*.{ts,tsx}', - 'x-pack/plugins/security_solution/**/*.{ts,tsx}', - 'x-pack/plugins/security_solution_ess/**/*.{ts,tsx}', - 'x-pack/plugins/security_solution_serverless/**/*.{ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution/**/*.{ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution_ess/**/*.{ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution_serverless/**/*.{ts,tsx}', 'x-pack/solutions/security/plugins/timelines/**/*.{ts,tsx}', 'x-pack/plugins/cases/**/*.{ts,tsx}', 'src/platform/packages/shared/kbn-cell-actions/**/*.{ts,tsx}', @@ -1210,9 +1210,9 @@ module.exports = { 'x-pack/platform/packages/shared/kbn-elastic-assistant-common/**/*.{js,mjs,ts,tsx}', 'x-pack/platform/packages/shared/kbn-langchain/**/*.{js,mjs,ts,tsx}', 'x-pack/solutions/security/packages/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/security_solution/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/security_solution_ess/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/security_solution_serverless/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution_ess/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution_serverless/**/*.{js,mjs,ts,tsx}', 'x-pack/solutions/security/plugins/timelines/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/cases/**/*.{js,mjs,ts,tsx}', 'x-pack/solutions/security/packages/data-stream-adapter/**/*.{js,mjs,ts,tsx}', @@ -1310,9 +1310,9 @@ module.exports = { files: [ 'x-pack/plugins/cases/**/*.{js,mjs,ts,tsx}', 'x-pack/solutions/security/plugins/ecs_data_quality_dashboard/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/security_solution/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/security_solution_ess/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/security_solution_serverless/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution_ess/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/plugins/security_solution_serverless/**/*.{js,mjs,ts,tsx}', 'x-pack/solutions/security/packages/data-stream-adapter/**/*.{js,mjs,ts,tsx}', 'x-pack/solutions/security/packages/features/**/*.{js,mjs,ts,tsx}', 'x-pack/solutions/security/packages/navigation/**/*.{js,mjs,ts,tsx}', @@ -1343,8 +1343,8 @@ module.exports = { { // front end and common typescript and javascript files only files: [ - 'x-pack/plugins/lists/public/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/lists/common/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/plugins/lists/public/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/plugins/lists/common/**/*.{js,mjs,ts,tsx}', ], rules: { 'import/no-nodejs-modules': 'error', @@ -1360,14 +1360,20 @@ module.exports = { }, { // typescript for /public and /common - files: ['x-pack/plugins/lists/public/*.{ts,tsx}', 'x-pack/plugins/lists/common/*.{ts,tsx}'], + files: [ + 'x-pack/solutions/security/plugins/lists/public/*.{ts,tsx}', + 'x-pack/solutions/security/plugins/lists/common/*.{ts,tsx}', + ], rules: { '@typescript-eslint/no-for-in-array': 'error', }, }, { // typescript for /public and /common - files: ['x-pack/plugins/lists/public/*.{ts,tsx}', 'x-pack/plugins/lists/common/*.{ts,tsx}'], + files: [ + 'x-pack/solutions/security/plugins/lists/public/*.{ts,tsx}', + 'x-pack/solutions/security/plugins/lists/common/*.{ts,tsx}', + ], plugins: ['react'], env: { jest: true, @@ -1425,7 +1431,7 @@ module.exports = { }, }, { - files: ['x-pack/plugins/lists/public/**/!(*.test).{js,mjs,ts,tsx}'], + files: ['x-pack/solutions/security/plugins/lists/public/**/!(*.test).{js,mjs,ts,tsx}'], plugins: ['react-perf'], rules: { 'react-perf/jsx-no-new-object-as-prop': 'error', @@ -1436,7 +1442,7 @@ module.exports = { }, { // typescript and javascript for front and back - files: ['x-pack/plugins/lists/**/*.{js,mjs,ts,tsx}'], + files: ['x-pack/solutions/security/plugins/lists/**/*.{js,mjs,ts,tsx}'], plugins: ['eslint-plugin-node'], env: { jest: true, @@ -1965,7 +1971,7 @@ module.exports = { * Cloud Security Team overrides */ { - files: ['x-pack/plugins/cloud_security_posture/**/*.{js,mjs,ts,tsx}'], + files: ['x-pack/solutions/security/plugins/cloud_security_posture/**/*.{js,mjs,ts,tsx}'], plugins: ['testing-library'], rules: { 'testing-library/await-async-utils': 'error', @@ -1997,9 +2003,6 @@ module.exports = { }, { files: [ - // logsShared depends on o11y/private plugins, but platform plugins depend on it - 'x-pack/plugins/observability_solution/logs_shared/**', - // TODO @kibana/operations 'scripts/create_observability_rules.js', // is importing "@kbn/observability-alerting-test-data" (observability/private) 'src/cli_setup/**', // is importing "@kbn/interactive-setup-plugin" (platform/private) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8f658aef3ac14..4943b4279c39a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -5,7 +5,6 @@ ## `node scripts/generate codeowners`. #### -examples/bfetch_explorer @elastic/appex-sharedux examples/content_management_examples @elastic/appex-sharedux examples/controls_example @elastic/kibana-presentation examples/data_view_field_editor_example @elastic/kibana-data-discovery @@ -264,7 +263,6 @@ packages/core/user-settings/core-user-settings-server-mocks @elastic/kibana-secu packages/deeplinks/analytics @elastic/kibana-data-discovery @elastic/kibana-presentation @elastic/kibana-visualizations packages/deeplinks/fleet @elastic/fleet packages/deeplinks/search @elastic/search-kibana -packages/deeplinks/security @elastic/security-solution packages/deeplinks/shared @elastic/appex-sharedux packages/default-nav/analytics @elastic/kibana-data-discovery @elastic/kibana-presentation @elastic/kibana-visualizations packages/home/sample_data_card @elastic/appex-sharedux @@ -397,7 +395,6 @@ packages/kbn-monaco @elastic/appex-sharedux packages/kbn-object-versioning @elastic/appex-sharedux packages/kbn-object-versioning-utils @elastic/appex-sharedux packages/kbn-openapi-bundler @elastic/security-detection-rule-management -packages/kbn-openapi-common @elastic/security-detection-rule-management packages/kbn-openapi-generator @elastic/security-detection-rule-management packages/kbn-optimizer @elastic/kibana-operations packages/kbn-optimizer-webpack-helpers @elastic/kibana-operations @@ -456,24 +453,6 @@ packages/kbn-search-index-documents @elastic/search-kibana packages/kbn-search-response-warnings @elastic/kibana-data-discovery packages/kbn-search-types @elastic/kibana-data-discovery packages/kbn-security-hardening @elastic/kibana-security -packages/kbn-securitysolution-autocomplete @elastic/security-detection-engine -packages/kbn-securitysolution-endpoint-exceptions-common @elastic/security-detection-engine -packages/kbn-securitysolution-es-utils @elastic/security-detection-engine -packages/kbn-securitysolution-exception-list-components @elastic/security-detection-engine -packages/kbn-securitysolution-exceptions-common @elastic/security-detection-engine -packages/kbn-securitysolution-hook-utils @elastic/security-detection-engine -packages/kbn-securitysolution-io-ts-alerting-types @elastic/security-detection-engine -packages/kbn-securitysolution-io-ts-list-types @elastic/security-detection-engine -packages/kbn-securitysolution-io-ts-types @elastic/security-detection-engine -packages/kbn-securitysolution-io-ts-utils @elastic/security-detection-engine -packages/kbn-securitysolution-list-api @elastic/security-detection-engine -packages/kbn-securitysolution-list-constants @elastic/security-detection-engine -packages/kbn-securitysolution-list-hooks @elastic/security-detection-engine -packages/kbn-securitysolution-list-utils @elastic/security-detection-engine -packages/kbn-securitysolution-lists-common @elastic/security-detection-engine -packages/kbn-securitysolution-rules @elastic/security-detection-engine -packages/kbn-securitysolution-t-grid @elastic/security-detection-engine -packages/kbn-securitysolution-utils @elastic/security-detection-engine packages/kbn-server-http-tools @elastic/kibana-core packages/kbn-set-map @elastic/kibana-operations packages/kbn-shared-svg @elastic/obs-ux-infra_services-team @@ -519,7 +498,6 @@ packages/kbn-whereis-pkg-cli @elastic/kibana-operations packages/kbn-xstate-utils @elastic/obs-ux-logs-team packages/kbn-yarn-lock-validator @elastic/kibana-operations packages/kbn-zod @elastic/kibana-core -packages/kbn-zod-helpers @elastic/security-detection-rule-management packages/presentation/presentation_containers @elastic/kibana-presentation packages/presentation/presentation_publishing @elastic/kibana-presentation packages/react/kibana_context/common @elastic/appex-sharedux @@ -535,7 +513,6 @@ packages/serverless/project_switcher @elastic/appex-sharedux packages/serverless/settings/common @elastic/appex-sharedux @elastic/kibana-management packages/serverless/settings/observability_project @elastic/appex-sharedux @elastic/kibana-management @elastic/obs-ux-management-team packages/serverless/settings/search_project @elastic/search-kibana @elastic/kibana-management -packages/serverless/settings/security_project @elastic/security-solution @elastic/kibana-management packages/serverless/storybook/config @elastic/appex-sharedux packages/serverless/types @elastic/appex-sharedux packages/shared-ux/avatar/solution @elastic/appex-sharedux @@ -602,6 +579,7 @@ src/platform/packages/shared/deeplinks/devtools @elastic/kibana-management src/platform/packages/shared/deeplinks/management @elastic/kibana-management src/platform/packages/shared/deeplinks/ml @elastic/ml-ui src/platform/packages/shared/deeplinks/observability @elastic/obs-ux-management-team +src/platform/packages/shared/deeplinks/security @elastic/security-solution src/platform/packages/shared/kbn-avc-banner @elastic/security-defend-workflows src/platform/packages/shared/kbn-cell-actions @elastic/security-threat-hunting-explore src/platform/packages/shared/kbn-doc-links @elastic/docs @@ -615,8 +593,13 @@ src/platform/packages/shared/kbn-management/settings/components/field_row @elast src/platform/packages/shared/kbn-management/settings/field_definition @elastic/kibana-management src/platform/packages/shared/kbn-management/settings/types @elastic/kibana-management src/platform/packages/shared/kbn-management/settings/utilities @elastic/kibana-management +src/platform/packages/shared/kbn-openapi-common @elastic/security-detection-rule-management src/platform/packages/shared/kbn-osquery-io-ts-types @elastic/security-asset-management src/platform/packages/shared/kbn-securitysolution-ecs @elastic/security-threat-hunting-explore +src/platform/packages/shared/kbn-securitysolution-es-utils @elastic/security-detection-engine +src/platform/packages/shared/kbn-securitysolution-io-ts-types @elastic/security-detection-engine +src/platform/packages/shared/kbn-securitysolution-io-ts-utils @elastic/security-detection-engine +src/platform/packages/shared/kbn-securitysolution-rules @elastic/security-detection-engine src/platform/packages/shared/kbn-server-route-repository @elastic/obs-knowledge-team src/platform/packages/shared/kbn-server-route-repository-client @elastic/obs-knowledge-team src/platform/packages/shared/kbn-server-route-repository-utils @elastic/obs-knowledge-team @@ -625,6 +608,8 @@ src/platform/packages/shared/kbn-sse-utils-client @elastic/obs-knowledge-team src/platform/packages/shared/kbn-sse-utils-server @elastic/obs-knowledge-team src/platform/packages/shared/kbn-typed-react-router-config @elastic/obs-knowledge-team @elastic/obs-ux-infra_services-team src/platform/packages/shared/kbn-unsaved-changes-prompt @elastic/kibana-management +src/platform/packages/shared/kbn-zod-helpers @elastic/security-detection-rule-management +src/platform/packages/shared/serverless/settings/security_project @elastic/security-solution @elastic/kibana-management src/platform/plugins/shared/ai_assistant_management/selection @elastic/obs-ai-assistant src/platform/plugins/shared/console @elastic/kibana-management src/platform/plugins/shared/dev_tools @elastic/kibana-management @@ -779,9 +764,6 @@ x-pack/packages/ai-infra/product-doc-artifact-builder @elastic/appex-ai-infra x-pack/packages/kbn-ai-assistant @elastic/search-kibana x-pack/packages/kbn-alerting-comparators @elastic/response-ops x-pack/packages/kbn-alerting-state-types @elastic/response-ops -x-pack/packages/kbn-cloud-security-posture/common @elastic/kibana-cloud-security-posture -x-pack/packages/kbn-cloud-security-posture/graph @elastic/kibana-cloud-security-posture -x-pack/packages/kbn-cloud-security-posture/public @elastic/kibana-cloud-security-posture x-pack/packages/kbn-random-sampling @elastic/kibana-visualizations x-pack/packages/kbn-synthetics-private-location @elastic/obs-ux-management-team x-pack/packages/maps/vector_tile_utils @elastic/kibana-presentation @@ -838,6 +820,7 @@ x-pack/platform/packages/shared/ai-infra/inference-common @elastic/appex-ai-infr x-pack/platform/packages/shared/ai-infra/product-doc-common @elastic/appex-ai-infra x-pack/platform/packages/shared/index-lifecycle-management/index_lifecycle_management_common_shared @elastic/kibana-management x-pack/platform/packages/shared/index-management/index_management_shared_types @elastic/kibana-management +x-pack/platform/packages/shared/kbn-cloud-security-posture/common @elastic/kibana-cloud-security-posture x-pack/platform/packages/shared/kbn-data-forge @elastic/obs-ux-management-team x-pack/platform/packages/shared/kbn-elastic-assistant @elastic/security-generative-ai x-pack/platform/packages/shared/kbn-elastic-assistant-common @elastic/security-generative-ai @@ -875,25 +858,24 @@ x-pack/platform/plugins/shared/ai_infra/product_doc_base @elastic/appex-ai-infra x-pack/platform/plugins/shared/aiops @elastic/ml-ui x-pack/platform/plugins/shared/entity_manager @elastic/obs-entities x-pack/platform/plugins/shared/inference @elastic/appex-ai-infra +x-pack/platform/plugins/shared/ingest_pipelines @elastic/kibana-management x-pack/platform/plugins/shared/integration_assistant @elastic/security-scalability x-pack/platform/plugins/shared/license_management @elastic/kibana-management x-pack/platform/plugins/shared/ml @elastic/ml-ui x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant @elastic/obs-ai-assistant x-pack/platform/plugins/shared/osquery @elastic/security-defend-workflows +x-pack/platform/plugins/shared/screenshotting @elastic/kibana-reporting-services x-pack/platform/plugins/shared/searchprofiler @elastic/kibana-management x-pack/plugins/actions @elastic/response-ops x-pack/plugins/alerting @elastic/response-ops -x-pack/plugins/asset_inventory @elastic/kibana-cloud-security-posture x-pack/plugins/banners @elastic/appex-sharedux x-pack/plugins/canvas @elastic/kibana-presentation x-pack/plugins/cases @elastic/response-ops x-pack/plugins/cloud @elastic/kibana-core -x-pack/plugins/cloud_defend @elastic/kibana-cloud-security-posture x-pack/plugins/cloud_integrations/cloud_chat @elastic/kibana-core x-pack/plugins/cloud_integrations/cloud_experiments @elastic/kibana-core x-pack/plugins/cloud_integrations/cloud_full_story @elastic/kibana-core x-pack/plugins/cloud_integrations/cloud_links @elastic/kibana-core -x-pack/plugins/cloud_security_posture @elastic/kibana-cloud-security-posture x-pack/plugins/custom_branding @elastic/appex-sharedux x-pack/plugins/dashboard_enhanced @elastic/kibana-presentation x-pack/plugins/data_quality @elastic/obs-ux-logs-team @@ -912,11 +894,8 @@ x-pack/plugins/global_search_bar @elastic/appex-sharedux x-pack/plugins/global_search_providers @elastic/appex-sharedux x-pack/plugins/graph @elastic/kibana-visualizations x-pack/plugins/index_management @elastic/kibana-management -x-pack/plugins/ingest_pipelines @elastic/kibana-management -x-pack/plugins/kubernetes_security @elastic/kibana-cloud-security-posture x-pack/plugins/lens @elastic/kibana-visualizations x-pack/plugins/licensing @elastic/kibana-core -x-pack/plugins/lists @elastic/security-detection-engine x-pack/plugins/logstash @elastic/logstash x-pack/plugins/maps @elastic/kibana-presentation x-pack/plugins/monitoring @elastic/stack-monitoring @@ -939,11 +918,9 @@ x-pack/plugins/observability_solution/observability_onboarding/e2e @elastic/obs- x-pack/plugins/observability_solution/observability_shared @elastic/observability-ui x-pack/plugins/observability_solution/profiling @elastic/obs-ux-infra_services-team x-pack/plugins/observability_solution/profiling_data_access @elastic/obs-ux-infra_services-team -x-pack/plugins/observability_solution/slo @elastic/obs-ux-management-team x-pack/plugins/reporting @elastic/appex-sharedux x-pack/plugins/rule_registry @elastic/response-ops @elastic/obs-ux-management-team x-pack/plugins/saved_objects_tagging @elastic/appex-sharedux -x-pack/plugins/screenshotting @elastic/kibana-reporting-services x-pack/plugins/search_assistant @elastic/search-kibana x-pack/plugins/search_connectors @elastic/search-kibana x-pack/plugins/search_homepage @elastic/search-kibana @@ -953,19 +930,15 @@ x-pack/plugins/search_notebooks @elastic/search-kibana x-pack/plugins/search_playground @elastic/search-kibana x-pack/plugins/search_solution/search_navigation @elastic/search-kibana x-pack/plugins/security @elastic/kibana-security -x-pack/plugins/security_solution @elastic/security-solution -x-pack/plugins/security_solution_ess @elastic/security-solution -x-pack/plugins/security_solution_serverless @elastic/security-solution x-pack/plugins/serverless @elastic/appex-sharedux x-pack/plugins/serverless_search @elastic/search-kibana -x-pack/plugins/session_view @elastic/kibana-cloud-security-posture x-pack/plugins/spaces @elastic/kibana-security x-pack/plugins/stack_alerts @elastic/response-ops x-pack/plugins/stack_connectors @elastic/response-ops x-pack/plugins/task_manager @elastic/response-ops x-pack/plugins/telemetry_collection_xpack @elastic/kibana-core x-pack/plugins/triggers_actions_ui @elastic/response-ops -x-pack/plugins/upgrade_assistant @elastic/kibana-management +x-pack/plugins/upgrade_assistant @elastic/kibana-core x-pack/solutions/observability/packages/alert_details @elastic/obs-ux-management-team x-pack/solutions/observability/packages/alerting_test_data @elastic/obs-ux-management-team x-pack/solutions/observability/packages/get_padded_alert_time_range_util @elastic/obs-ux-management-team @@ -982,6 +955,7 @@ x-pack/solutions/observability/plugins/observability_ai_assistant_management @el x-pack/solutions/observability/plugins/observability_solution/entities_data_access @elastic/obs-entities x-pack/solutions/observability/plugins/observability_solution/entity_manager_app @elastic/obs-entities x-pack/solutions/observability/plugins/serverless_observability @elastic/obs-ux-management-team +x-pack/solutions/observability/plugins/slo @elastic/obs-ux-management-team x-pack/solutions/observability/plugins/streams @elastic/streams-program-team x-pack/solutions/observability/plugins/streams_app @elastic/streams-program-team x-pack/solutions/observability/plugins/synthetics @elastic/obs-ux-management-team @@ -995,12 +969,37 @@ x-pack/solutions/security/packages/ecs_data_quality_dashboard @elastic/security- x-pack/solutions/security/packages/expandable-flyout @elastic/security-threat-hunting-investigations x-pack/solutions/security/packages/features @elastic/security-threat-hunting-explore x-pack/solutions/security/packages/index-adapter @elastic/security-threat-hunting +x-pack/solutions/security/packages/kbn-cloud-security-posture/graph @elastic/kibana-cloud-security-posture +x-pack/solutions/security/packages/kbn-cloud-security-posture/public @elastic/kibana-cloud-security-posture +x-pack/solutions/security/packages/kbn-securitysolution-autocomplete @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-hook-utils @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-list-api @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-list-constants @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-list-hooks @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-list-utils @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-lists-common @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-t-grid @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-utils @elastic/security-detection-engine x-pack/solutions/security/packages/navigation @elastic/security-threat-hunting-explore x-pack/solutions/security/packages/side_nav @elastic/security-threat-hunting-explore x-pack/solutions/security/packages/storybook/config @elastic/security-threat-hunting-explore x-pack/solutions/security/packages/upselling @elastic/security-threat-hunting-explore +x-pack/solutions/security/plugins/asset_inventory @elastic/kibana-cloud-security-posture +x-pack/solutions/security/plugins/cloud_defend @elastic/kibana-cloud-security-posture +x-pack/solutions/security/plugins/cloud_security_posture @elastic/kibana-cloud-security-posture x-pack/solutions/security/plugins/ecs_data_quality_dashboard @elastic/security-threat-hunting-explore x-pack/solutions/security/plugins/elastic_assistant @elastic/security-generative-ai +x-pack/solutions/security/plugins/kubernetes_security @elastic/kibana-cloud-security-posture +x-pack/solutions/security/plugins/lists @elastic/security-detection-engine +x-pack/solutions/security/plugins/security_solution @elastic/security-solution +x-pack/solutions/security/plugins/security_solution_ess @elastic/security-solution +x-pack/solutions/security/plugins/security_solution_serverless @elastic/security-solution +x-pack/solutions/security/plugins/session_view @elastic/kibana-cloud-security-posture x-pack/solutions/security/plugins/threat_intelligence @elastic/security-threat-hunting-investigations x-pack/solutions/security/plugins/timelines @elastic/security-threat-hunting-investigations x-pack/test @@ -1247,7 +1246,7 @@ packages/kbn-monaco/src/esql @elastic/kibana-esql #CC# /src/plugins/home/server/services/ @elastic/appex-sharedux #CC# /src/plugins/home/ @elastic/appex-sharedux #CC# /x-pack/plugins/reporting/ @elastic/appex-sharedux -#CC# /x-pack/plugins/security_solution_serverless/ @elastic/appex-sharedux +#CC# /x-pack/solutions/security/plugins/security_solution_serverless/ @elastic/appex-sharedux # Observability UI @@ -1833,7 +1832,7 @@ packages/kbn-monaco/src/esql @elastic/kibana-esql #CC# /x-pack/plugins/global_search_providers/ @elastic/kibana-core # AppEx AI Infra -/x-pack/plugins/inference @elastic/appex-ai-infra @elastic/obs-ai-assistant @elastic/security-generative-ai +/x-pack/platform/plugins/shared/inference @elastic/appex-ai-infra @elastic/obs-ai-assistant @elastic/security-generative-ai /x-pack/test/functional_gen_ai/inference @elastic/appex-ai-infra # AppEx Platform Services Security @@ -2138,32 +2137,32 @@ x-pack/test_serverless/functional/test_suites/security/index.mki_only.ts @elasti /x-pack/test_serverless/functional/test_suites/security/index.feature_flags.ts @elastic/security-solution /x-pack/test_serverless/functional/test_suites/security/index.ts @elastic/security-solution -#CC# /x-pack/plugins/security_solution/ @elastic/security-solution +#CC# /x-pack/solutions/security/plugins/security_solution/ @elastic/security-solution /x-pack/test/functional/es_archives/cases/signals/duplicate_ids @elastic/response-ops # Security Solution OpenAPI bundles -/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_detections_api_* @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_endpoint_management_api_* @elastic/security-defend-workflows -/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_entity_analytics_api_* @elastic/security-entity-analytics -/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_timeline_api_* @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_detections_api_* @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_endpoint_management_api_* @elastic/security-defend-workflows -/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_entity_analytics_api_* @elastic/security-entity-analytics -/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_timeline_api_* @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/docs/openapi/serverless/security_solution_detections_api_* @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/docs/openapi/serverless/security_solution_endpoint_management_api_* @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/docs/openapi/serverless/security_solution_entity_analytics_api_* @elastic/security-entity-analytics +/x-pack/solutions/security/plugins/security_solution/docs/openapi/serverless/security_solution_timeline_api_* @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/docs/openapi/ess/security_solution_detections_api_* @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/docs/openapi/ess/security_solution_endpoint_management_api_* @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/docs/openapi/ess/security_solution_entity_analytics_api_* @elastic/security-entity-analytics +/x-pack/solutions/security/plugins/security_solution/docs/openapi/ess/security_solution_timeline_api_* @elastic/security-threat-hunting-investigations # Security Solution Offering plugins # TODO: assign sub directories to sub teams -/x-pack/plugins/security_solution_ess/ @elastic/security-solution -/x-pack/plugins/security_solution_serverless/ @elastic/security-solution -/x-pack/plugins/security_solution/public/app/404.tsx @elastic/security-solution -/x-pack/plugins/security_solution/public/app/app.tsx @elastic/security-solution -/x-pack/plugins/security_solution/public/app/home @elastic/security-solution +/x-pack/solutions/security/plugins/security_solution_ess/ @elastic/security-solution +/x-pack/solutions/security/plugins/security_solution_serverless/ @elastic/security-solution +/x-pack/solutions/security/plugins/security_solution/public/app/404.tsx @elastic/security-solution +/x-pack/solutions/security/plugins/security_solution/public/app/app.tsx @elastic/security-solution +/x-pack/solutions/security/plugins/security_solution/public/app/home @elastic/security-solution # GenAI in Security Solution -/x-pack/plugins/security_solution/public/assistant @elastic/security-generative-ai -/x-pack/plugins/security_solution/public/attack_discovery @elastic/security-generative-ai +/x-pack/solutions/security/plugins/security_solution/public/assistant @elastic/security-generative-ai +/x-pack/solutions/security/plugins/security_solution/public/attack_discovery @elastic/security-generative-ai /x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant @elastic/security-generative-ai -/x-pack/plugins/security_solution_ess/public/upselling/pages/attack_discovery @elastic/security-generative-ai +/x-pack/solutions/security/plugins/security_solution_ess/public/upselling/pages/attack_discovery @elastic/security-generative-ai /x-pack/test/security_solution_cypress/cypress/e2e/automatic_import @elastic/security-scalability # Security Solution cross teams ownership @@ -2175,16 +2174,16 @@ x-pack/test_serverless/functional/test_suites/security/index.mki_only.ts @elasti /x-pack/test/security_solution_cypress/cypress/support @elastic/security-detections-response @elastic/security-threat-hunting /x-pack/test/security_solution_cypress/cypress/urls @elastic/security-threat-hunting-investigations @elastic/security-detection-engine -/x-pack/plugins/security_solution/common/ecs @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/common/test @elastic/security-detections-response @elastic/security-threat-hunting +/x-pack/solutions/security/plugins/security_solution/common/ecs @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/common/test @elastic/security-detections-response @elastic/security-threat-hunting -/x-pack/plugins/security_solution/public/common/components/callouts @elastic/security-detections-response -/x-pack/plugins/security_solution/public/common/components/hover_actions @elastic/security-threat-hunting-explore @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/common/components/formatted_date/index.tsx @elastic/security-threat-hunting-explore @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/common/components/formatted_number/index.tsx @elastic/security-threat-hunting-explore @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/common/components/callouts @elastic/security-detections-response +/x-pack/solutions/security/plugins/security_solution/public/common/components/hover_actions @elastic/security-threat-hunting-explore @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_date/index.tsx @elastic/security-threat-hunting-explore @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_number/index.tsx @elastic/security-threat-hunting-explore @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/server/routes @elastic/security-detections-response @elastic/security-threat-hunting -/x-pack/plugins/security_solution/server/utils @elastic/security-detections-response @elastic/security-threat-hunting +/x-pack/solutions/security/plugins/security_solution/server/routes @elastic/security-detections-response @elastic/security-threat-hunting +/x-pack/solutions/security/plugins/security_solution/server/utils @elastic/security-detections-response @elastic/security-threat-hunting x-pack/test/security_solution_api_integration/test_suites/detections_response/utils @elastic/security-detections-response x-pack/test/security_solution_api_integration/test_suites/detections_response/telemetry @elastic/security-detections-response x-pack/test/security_solution_api_integration/test_suites/detections_response/user_roles @elastic/security-detections-response @@ -2205,20 +2204,20 @@ x-pack/test/security_solution_api_integration/test_suites/sources @elastic/secur /x-pack/test/security_solution_cypress/cypress/tasks/login.ts @elastic/security-engineering-productivity /x-pack/test/security_solution_cypress/es_archives @elastic/security-engineering-productivity /x-pack/test/security_solution_playwright @elastic/security-engineering-productivity -/x-pack/plugins/security_solution/scripts/run_cypress @MadameSheema @patrykkopycinski @maximpn @banderror +/x-pack/solutions/security/plugins/security_solution/scripts/run_cypress @MadameSheema @patrykkopycinski @maximpn @banderror ## Security Solution sub teams - Threat Hunting -/x-pack/plugins/security_solution/server/lib/siem_migrations @elastic/security-threat-hunting -/x-pack/plugins/security_solution/common/siem_migrations @elastic/security-threat-hunting -/x-pack/plugins/security_solution/public/siem_migrations @elastic/security-threat-hunting -/x-pack/plugins/security_solution/public/common/components/control_columns @elastic/security-threat-hunting +/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations @elastic/security-threat-hunting +/x-pack/solutions/security/plugins/security_solution/common/siem_migrations @elastic/security-threat-hunting +/x-pack/solutions/security/plugins/security_solution/public/siem_migrations @elastic/security-threat-hunting +/x-pack/solutions/security/plugins/security_solution/public/common/components/control_columns @elastic/security-threat-hunting ## Security Solution Threat Hunting areas - Threat Hunting Investigations -/x-pack/plugins/security_solution/common/api/timeline @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/common/search_strategy/timeline @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/common/types/timeline @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/common/api/timeline @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/common/search_strategy/timeline @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/common/types/timeline @elastic/security-threat-hunting-investigations /x-pack/test/security_solution_cypress/cypress/e2e/investigations @elastic/security-threat-hunting-investigations /x-pack/test/security_solution_cypress/cypress/e2e/sourcerer/sourcerer_timeline.cy.ts @elastic/security-threat-hunting-investigations @@ -2226,46 +2225,46 @@ x-pack/test/security_solution_api_integration/test_suites/sources @elastic/secur x-pack/test/security_solution_cypress/cypress/screens/expandable_flyout @elastic/security-threat-hunting-investigations x-pack/test/security_solution_cypress/cypress/tasks/expandable_flyout @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/common/timelines @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/common/components/alerts_viewer @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_action @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/common/components/event_details @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/common/components/events_viewer @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/common/components/markdown_editor @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/detections/components/alerts_kpis @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/detections/components/alerts_table @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/detections/components/alerts_info @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/flyout/document_details @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/flyout/shared @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/notes @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/resolver @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/threat_intelligence @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/timelines @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/common/components/header_actions @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/common/types/header_actions @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/flyout/network_details @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/flyout/rule_details @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/investigations @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/detections/configurations/security_solution_detections @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/detections/pages/detection_engine/detection_engine.tsx @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/common/hooks/use_resolve_conflict.tsx @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/common/components/drag_and_drop @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/common/components/draggables @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/common/components/events_tab @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution_serverless/public/upselling/pages/threat_intelligence_paywall.tsx @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/common/mock/mock_timeline_control_columns.tsx @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/common/components/exit_full_screen @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/app/home/template_wrapper/timeline @elastic/security-threat-hunting-investigations - -/x-pack/plugins/security_solution/server/lib/timeline @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/common/timelines @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/common/components/alerts_viewer @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_action @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/common/components/event_details @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_info @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/flyout/shared @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/notes @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/resolver @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/threat_intelligence @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/timelines @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/common/types/header_actions @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/flyout/network_details @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/investigations @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/detections/configurations/security_solution_detections @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/detection_engine.tsx @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_resolve_conflict.tsx @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/common/components/draggables @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/common/components/events_tab @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/pages/threat_intelligence_paywall.tsx @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_timeline_control_columns.tsx @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/common/components/exit_full_screen @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/app/home/template_wrapper/timeline @elastic/security-threat-hunting-investigations + +/x-pack/solutions/security/plugins/security_solution/server/lib/timeline @elastic/security-threat-hunting-investigations /x-pack/test_serverless/functional/test_suites/security/config.context_awareness.ts @elastic/security-threat-hunting-investigations ## Security Solution Threat Hunting areas - Threat Hunting Explore -/x-pack/plugins/security_solution/common/api/tags @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 -/x-pack/plugins/security_solution/common/search_strategy/security_solution/user @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/common/api/tags @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/hosts @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/matrix_histogram @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/user @elastic/security-threat-hunting-explore /x-pack/test/security_solution_cypress/cypress/e2e/explore @elastic/security-threat-hunting-explore /x-pack/test/security_solution_cypress/cypress/screens/hosts @elastic/security-threat-hunting-explore @@ -2273,46 +2272,46 @@ x-pack/test/security_solution_cypress/cypress/tasks/expandable_flyout @elastic/ /x-pack/test/security_solution_cypress/cypress/tasks/hosts @elastic/security-threat-hunting-explore /x-pack/test/security_solution_cypress/cypress/tasks/network @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/app/actions @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/assets @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/app/solution_navigation/links @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/lib/clipboard @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/visualization_actions @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/accessibility @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/first_last_seen/first_last_seen.tsx @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/alert_count_by_status @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/charts @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/header_page @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/header_section @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/inspect @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/last_event_time @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/links @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/matrix_histogram @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/navigation @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/news_feed @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/overview_description_list @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/page @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/sidebar_header @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/tables @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/top_n @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/with_hover_actions @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/containers/matrix_histogram @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/lib/cell_actions @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/hooks/use_form_with_warn @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/public/cases @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/explore @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/overview @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/dashboards @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/onboarding @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/empty_page @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/public/common/components/empty_prompt @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution_serverless/public/components/dashboards_landing_callout @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network @elastic/security-threat-hunting-explore -/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/app/actions @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/assets @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/lib/clipboard @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/accessibility @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/first_last_seen/first_last_seen.tsx @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/charts @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/header_page @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/header_section @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/inspect @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/last_event_time @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/links @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/matrix_histogram @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/news_feed @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/overview_description_list @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/page @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/sidebar_header @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/tables @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/top_n @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/with_hover_actions @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/containers/matrix_histogram @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/lib/cell_actions @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_form_with_warn @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/public/cases @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/explore @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/overview @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/dashboards @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/onboarding @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_page @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_prompt @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution_serverless/public/components/dashboards_landing_callout @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users @elastic/security-threat-hunting-explore /x-pack/test/functional/es_archives/auditbeat/overview @elastic/security-threat-hunting-explore /x-pack/test/functional/es_archives/auditbeat/users @elastic/security-threat-hunting-explore @@ -2347,81 +2346,81 @@ x-pack/test/security_solution_cypress/cypress/tasks/expandable_flyout @elastic/ /x-pack/plugins/stack_connectors/common/crowdstrike @elastic/security-defend-workflows ## Security Solution shared OAS schemas -/x-pack/plugins/security_solution/common/api/model @elastic/security-detection-rule-management @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/common/api/model @elastic/security-detection-rule-management @elastic/security-detection-engine ## Security Solution sub teams - Detection Rule Management -/x-pack/plugins/security_solution/common/api/detection_engine/fleet_integrations @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema @elastic/security-detection-rule-management @elastic/security-detection-engine -/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/common/api/detection_engine/rule_management @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/common/detection_engine/rule_management @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/fleet_integrations @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema @elastic/security-detection-rule-management @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/common/detection_engine/rule_management @elastic/security-detection-rule-management /x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/docs/rfcs/detection_response @elastic/security-detection-rule-management @elastic/security-detection-engine -/x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/docs/rfcs/detection_response @elastic/security-detection-rule-management @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management @elastic/security-detection-rule-management /x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/public/common/components/health_truncate_text @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/public/common/components/links_to_docs @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/public/common/components/ml_popover @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/public/common/components/popover_items @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/public/detection_engine/fleet_integrations @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/public/detection_engine/endpoint_exceptions @elastic/security-defend-workflows -/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/public/detection_engine/rule_management @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/public/detections/components/callouts @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/public/detections/components/rules @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/public/detections/components/rules/rule_preview @elastic/security-detection-engine -/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/public/detections/mitre @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/public/rules @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions @elastic/security-detection-rule-management - -/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring @elastic/security-detection-rule-management -/x-pack/plugins/security_solution/server/lib/detection_engine/rule_schema @elastic/security-detection-rule-management @elastic/security-detection-engine - -/x-pack/plugins/security_solution/scripts/openapi @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/public/common/components/health_truncate_text @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/public/common/components/links_to_docs @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/public/common/components/popover_items @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/public/detection_engine/fleet_integrations @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/public/detection_engine/endpoint_exceptions @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_preview @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/rules @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/public/detections/mitre @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/rules @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/public/rules @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions @elastic/security-detection-rule-management + +/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring @elastic/security-detection-rule-management +/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_schema @elastic/security-detection-rule-management @elastic/security-detection-engine + +/x-pack/solutions/security/plugins/security_solution/scripts/openapi @elastic/security-detection-rule-management ## Security Solution sub teams - Detection Engine -/x-pack/plugins/security_solution/common/api/detection_engine/alert_tags @elastic/security-detection-engine -/x-pack/plugins/security_solution/common/api/detection_engine/index_management @elastic/security-detection-engine -/x-pack/plugins/security_solution/common/api/detection_engine/model/alerts @elastic/security-detection-engine -/x-pack/plugins/security_solution/common/api/detection_engine/rule_exceptions @elastic/security-detection-engine -/x-pack/plugins/security_solution/common/api/detection_engine/rule_preview @elastic/security-detection-engine -/x-pack/plugins/security_solution/common/api/detection_engine/signals @elastic/security-detection-engine -/x-pack/plugins/security_solution/common/api/detection_engine/signals_migration @elastic/security-detection-engine -/x-pack/plugins/security_solution/common/cti @elastic/security-detection-engine -/x-pack/plugins/security_solution/common/field_maps @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_tags @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_exceptions @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_preview @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/common/cti @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/common/field_maps @elastic/security-detection-engine /x-pack/test/functional/es_archives/entity/risks @elastic/security-detection-engine /x-pack/test/functional/es_archives/entity/host_risk @elastic/security-detection-engine /x-pack/test/api_integration/apis/lists @elastic/security-detection-engine -/x-pack/plugins/security_solution/public/value_list @elastic/security-detection-engine -/x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout @elastic/security-detection-engine - -/x-pack/plugins/security_solution/public/sourcerer @elastic/security-threat-hunting-investigations -/x-pack/plugins/security_solution/public/detection_engine/rule_creation @elastic/security-detection-engine -/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui @elastic/security-detection-engine -/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions @elastic/security-detection-engine -/x-pack/plugins/security_solution/public/detection_engine/rule_gaps @elastic/security-detection-engine -/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists @elastic/security-detection-engine -/x-pack/plugins/security_solution/public/detections/pages/alerts @elastic/security-detection-engine -/x-pack/plugins/security_solution/public/exceptions @elastic/security-detection-engine - -/x-pack/plugins/security_solution/server/lib/detection_engine/migrations @elastic/security-detection-engine -/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy @elastic/security-detection-engine -/x-pack/plugins/security_solution/server/lib/detection_engine/rule_exceptions @elastic/security-detection-engine -/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview @elastic/security-detection-engine -/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types @elastic/security-detection-engine -/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index @elastic/security-detection-engine -/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/public/value_list @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout @elastic/security-detection-engine + +/x-pack/solutions/security/plugins/security_solution/public/sourcerer @elastic/security-threat-hunting-investigations +/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/lists @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/public/detections/pages/alerts @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/public/exceptions @elastic/security-detection-engine + +/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_exceptions @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals @elastic/security-detection-engine /x-pack/test/security_solution_cypress/cypress/e2e/detection_response/detection_engine @elastic/security-detection-engine @@ -2431,52 +2430,52 @@ x-pack/test/security_solution_cypress/cypress/tasks/expandable_flyout @elastic/ /x-pack/test/functional/es_archives/asset_criticality @elastic/security-detection-engine ## Security Threat Intelligence - Under Security Platform -/x-pack/plugins/security_solution/public/common/components/threat_match @elastic/security-detection-engine +/x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match @elastic/security-detection-engine ## Security Solution sub teams - security-defend-workflows /x-pack/test/defend_workflows_cypress @elastic/security-defend-workflows /x-pack/test/api_integration/apis/osquery @elastic/security-defend-workflows -/x-pack/plugins/security_solution/public/management/ @elastic/security-defend-workflows -/x-pack/plugins/security_solution/public/common/lib/endpoint/ @elastic/security-defend-workflows -/x-pack/plugins/security_solution/public/common/components/endpoint/ @elastic/security-defend-workflows -/x-pack/plugins/security_solution/public/common/hooks/endpoint/ @elastic/security-defend-workflows -/x-pack/plugins/security_solution/public/common/mock/endpoint @elastic/security-defend-workflows -/x-pack/plugins/security_solution/public/flyout/document_details/isolate_host/ @elastic/security-defend-workflows -/x-pack/plugins/security_solution/common/endpoint/ @elastic/security-defend-workflows -/x-pack/plugins/security_solution/common/api/endpoint/ @elastic/security-defend-workflows -x-pack/plugins/security_solution/server/assistant/tools/defend_insights @elastic/security-defend-workflows -/x-pack/plugins/security_solution/server/endpoint/ @elastic/security-defend-workflows -/x-pack/plugins/security_solution/server/lists_integration/endpoint/ @elastic/security-defend-workflows -/x-pack/plugins/security_solution/server/lib/license/ @elastic/security-defend-workflows -/x-pack/plugins/security_solution/server/fleet_integration/ @elastic/security-defend-workflows -/x-pack/plugins/security_solution/scripts/endpoint/ @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/public/management/ @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/ @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/ @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/public/common/hooks/endpoint/ @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/public/common/mock/endpoint @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/isolate_host/ @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/common/endpoint/ @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/ @elastic/security-defend-workflows +x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/server/endpoint/ @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/ @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/server/lib/license/ @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/ @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/ @elastic/security-defend-workflows /x-pack/test/security_solution_endpoint/ @elastic/security-defend-workflows /x-pack/test/security_solution_api_integration/test_suites/edr_workflows/ @elastic/security-defend-workflows /x-pack/test_serverless/shared/lib/security/kibana_roles/ @elastic/security-defend-workflows -/x-pack/plugins/security_solution_serverless/public/upselling/sections/endpoint_management @elastic/security-defend-workflows -/x-pack/plugins/security_solution_serverless/public/upselling/pages/endpoint_management @elastic/security-defend-workflows -/x-pack/plugins/security_solution_serverless/server/endpoint @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/endpoint_management @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/pages/endpoint_management @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution_serverless/server/endpoint @elastic/security-defend-workflows x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/defend_insights @elastic/security-defend-workflows x-pack/plugins/elastic_assistant/server/__mocks__/defend_insights_schema.mock.ts @elastic/security-defend-workflows x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/defend_insights @elastic/security-defend-workflows x-pack/plugins/elastic_assistant/server/routes/defend_insights @elastic/security-defend-workflows -/x-pack/plugins/security_solution/public/common/components/response_actions @elastic/security-defend-workflows -/x-pack/plugins/security_solution_serverless/public/upselling/pages/osquery_automated_response_actions.tsx @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/public/common/components/response_actions @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/pages/osquery_automated_response_actions.tsx @elastic/security-defend-workflows ## Security Solution sub teams - security-telemetry (Data Engineering) -x-pack/plugins/security_solution/server/usage/ @elastic/security-data-analytics -x-pack/plugins/security_solution/server/lib/telemetry/ @elastic/security-data-analytics +x-pack/solutions/security/plugins/security_solution/server/usage/ @elastic/security-data-analytics +x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/ @elastic/security-data-analytics ## Security Solution sub teams - Entity Analytics -x-pack/plugins/security_solution/common/entity_analytics @elastic/security-entity-analytics -x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score @elastic/security-entity-analytics -x-pack/plugins/security_solution/public/entity_analytics @elastic/security-entity-analytics -x-pack/plugins/security_solution/server/lib/entity_analytics @elastic/security-entity-analytics -x-pack/plugins/security_solution/server/lib/risk_score @elastic/security-entity-analytics +x-pack/solutions/security/plugins/security_solution/common/entity_analytics @elastic/security-entity-analytics +x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/risk_score @elastic/security-entity-analytics +x-pack/solutions/security/plugins/security_solution/public/entity_analytics @elastic/security-entity-analytics +x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics @elastic/security-entity-analytics +x-pack/solutions/security/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/test/security_solution_cypress/cypress/e2e/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/entity_analytics @elastic/security-entity-analytics +x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details @elastic/security-entity-analytics +x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics @elastic/security-entity-analytics ## Security Solution sub teams - GenAI x-pack/test/security_solution_api_integration/test_suites/genai @elastic/security-generative-ai @@ -2487,10 +2486,10 @@ x-pack/test/automatic_import_api_integration @elastic/security-scalability # Security Defend Workflows - OSQuery Ownership /x-pack/test/osquery_cypress @elastic/security-defend-workflows /x-pack/plugins/osquery @elastic/security-defend-workflows -/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_response_actions @elastic/security-defend-workflows -/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions @elastic/security-defend-workflows -/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions @elastic/security-defend-workflows -/x-pack/plugins/security_solution/public/detections/components/osquery @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_response_actions @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_response_actions @elastic/security-defend-workflows +/x-pack/solutions/security/plugins/security_solution/public/detections/components/osquery @elastic/security-defend-workflows # Cloud Security Posture team @@ -2503,10 +2502,10 @@ x-pack/plugins/cloud_security_posture @elastic/kibana-cloud-security-posture x-pack/plugins/kubernetes_security @elastic/kibana-cloud-security-posture x-pack/plugins/session_view @elastic/kibana-cloud-security-posture ## Security Solution sub teams -x-pack/plugins/security_solution/public/common/components/sessions_viewer @elastic/kibana-cloud-security-posture -x-pack/plugins/security_solution/public/cloud_defend @elastic/kibana-cloud-security-posture -x-pack/plugins/security_solution/public/cloud_security_posture @elastic/kibana-cloud-security-posture -x-pack/plugins/security_solution/public/kubernetes @elastic/kibana-cloud-security-posture +x-pack/solutions/security/plugins/security_solution/public/common/components/sessions_viewer @elastic/kibana-cloud-security-posture +x-pack/solutions/security/plugins/security_solution/public/cloud_defend @elastic/kibana-cloud-security-posture +x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture @elastic/kibana-cloud-security-posture +x-pack/solutions/security/plugins/security_solution/public/kubernetes @elastic/kibana-cloud-security-posture ## Fleet plugin (co-owned with Fleet team) x-pack/plugins/fleet/public/components/cloud_security_posture @elastic/fleet @elastic/kibana-cloud-security-posture x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/components/cloud_security_posture @elastic/fleet @elastic/kibana-cloud-security-posture @@ -2531,13 +2530,13 @@ x-pack/test/security_solution_cypress/cypress/e2e/cloud_security_posture/misconf x-pack/test/security_solution_cypress/cypress/e2e/cloud_security_posture/vulnerabilities_contextual_flyout.cy.ts @elastic/kibana-cloud-security-posture # Security Solution onboarding tour -/x-pack/plugins/security_solution/public/common/components/guided_onboarding @elastic/security-threat-hunting-explore +/x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding @elastic/security-threat-hunting-explore # Security Service Integrations -x-pack/plugins/security_solution/common/security_integrations @elastic/security-service-integrations -x-pack/plugins/security_solution/public/security_integrations @elastic/security-service-integrations -x-pack/plugins/security_solution/server/security_integrations @elastic/security-service-integrations -x-pack/plugins/security_solution/server/lib/security_integrations @elastic/security-service-integrations +x-pack/solutions/security/plugins/security_solution/common/security_integrations @elastic/security-service-integrations +x-pack/solutions/security/plugins/security_solution/public/security_integrations @elastic/security-service-integrations +x-pack/solutions/security/plugins/security_solution/server/security_integrations @elastic/security-service-integrations +x-pack/solutions/security/plugins/security_solution/server/lib/security_integrations @elastic/security-service-integrations # Kibana design # scss overrides should be below this line for specificity @@ -2553,9 +2552,9 @@ x-pack/plugins/security_solution/server/lib/security_integrations @elastic/secur # Security design /x-pack/plugins/endpoint/**/*.scss @elastic/security-design -/x-pack/plugins/security_solution/**/*.scss @elastic/security-design -/x-pack/plugins/security_solution_ess/**/*.scss @elastic/security-design -/x-pack/plugins/security_solution_serverless/**/*.scss @elastic/security-design +/x-pack/solutions/security/plugins/security_solution/**/*.scss @elastic/security-design +/x-pack/solutions/security/plugins/security_solution_ess/**/*.scss @elastic/security-design +/x-pack/solutions/security/plugins/security_solution_serverless/**/*.scss @elastic/security-design # Logstash /x-pack/test/functional/es_archives/logstash/example_pipelines @elastic/logstash @@ -2617,7 +2616,6 @@ x-pack/plugins/observability_solution/observability_shared/public/components/pro /test/examples/state_sync/*.ts @elastic/appex-sharedux /test/examples/error_boundary/index.ts @elastic/appex-sharedux /test/examples/content_management/*.ts @elastic/appex-sharedux -/test/examples/bfetch_explorer/*.ts @elastic/appex-sharedux /test/api_integration/apis/guided_onboarding @elastic/appex-sharedux /x-pack/test/banners_functional @elastic/appex-sharedux /x-pack/test/custom_branding @elastic/appex-sharedux @@ -2640,7 +2638,14 @@ oas_docs/kibana.info.yaml @elastic/platform-docs # Plugin manifests /src/plugins/**/kibana.jsonc @elastic/kibana-core +/src/platform/plugins/shared/**/kibana.jsonc @elastic/kibana-core +/src/platform/plugins/private/**/kibana.jsonc @elastic/kibana-core /x-pack/plugins/**/kibana.jsonc @elastic/kibana-core +/x-pack/platform/plugins/shared/**/kibana.jsonc @elastic/kibana-core +/x-pack/platform/plugins/private/**/kibana.jsonc @elastic/kibana-core +/x-pack//solutions/observability/plugins/**/kibana.jsonc @elastic/kibana-core +/x-pack//solutions/search/plugins/**/kibana.jsonc @elastic/kibana-core +/x-pack//solutions/security/plugins/**/kibana.jsonc @elastic/kibana-core # Temporary Encrypted Saved Objects (ESO) guarding # This additional code-ownership is meant to be a temporary precaution to notify the Kibana platform security team @@ -3356,20 +3361,20 @@ x-pack/solutions/security/packages/kbn-cloud-security-posture/public @elastic/ki x-pack/solutions/security/packages/data-stream-adapter @elastic/security-threat-hunting x-pack/solutions/security/packages/expandable-flyout @elastic/security-threat-hunting-investigations x-pack/solutions/security/packages/index-adapter @elastic/security-threat-hunting -x-pack/solutions/security/packages/kbn-securitysolution-autocomplete @elastic/security-detection-engine -x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common @elastic/security-detection-engine -x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components @elastic/security-detection-engine -x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common @elastic/security-detection-engine -x-pack/solutions/security/packages/kbn-securitysolution-hook-utils @elastic/security-detection-engine -x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types @elastic/security-detection-engine -x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types @elastic/security-detection-engine -x-pack/solutions/security/packages/kbn-securitysolution-list-api @elastic/security-detection-engine -x-pack/solutions/security/packages/kbn-securitysolution-list-constants @elastic/security-detection-engine -x-pack/solutions/security/packages/kbn-securitysolution-list-hooks @elastic/security-detection-engine -x-pack/solutions/security/packages/kbn-securitysolution-list-utils @elastic/security-detection-engine -x-pack/solutions/security/packages/kbn-securitysolution-lists-common @elastic/security-detection-engine -x-pack/solutions/security/packages/kbn-securitysolution-t-grid @elastic/security-detection-engine -x-pack/solutions/security/packages/kbn-securitysolution-utils @elastic/security-detection-engine +x-pack/solutions/security/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete @elastic/security-detection-engine +x-pack/solutions/security/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common @elastic/security-detection-engine +x-pack/solutions/security/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components @elastic/security-detection-engine +x-pack/solutions/security/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common @elastic/security-detection-engine +x-pack/solutions/security/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils @elastic/security-detection-engine +x-pack/solutions/security/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types @elastic/security-detection-engine +x-pack/solutions/security/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types @elastic/security-detection-engine +x-pack/solutions/security/x-pack/solutions/security/packages/kbn-securitysolution-list-api @elastic/security-detection-engine +x-pack/solutions/security/x-pack/solutions/security/packages/kbn-securitysolution-list-constants @elastic/security-detection-engine +x-pack/solutions/security/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks @elastic/security-detection-engine +x-pack/solutions/security/x-pack/solutions/security/packages/kbn-securitysolution-list-utils @elastic/security-detection-engine +x-pack/solutions/security/x-pack/solutions/security/packages/kbn-securitysolution-lists-common @elastic/security-detection-engine +x-pack/solutions/security/x-pack/solutions/security/packages/kbn-securitysolution-t-grid @elastic/security-detection-engine +x-pack/solutions/security/x-pack/solutions/security/packages/kbn-securitysolution-utils @elastic/security-detection-engine x-pack/solutions/security/packages/navigation @elastic/security-threat-hunting-explore x-pack/solutions/security/packages/side_nav @elastic/security-threat-hunting-explore x-pack/solutions/security/packages/upselling @elastic/security-threat-hunting-explore @@ -3379,10 +3384,10 @@ x-pack/solutions/security/plugins/cloud_security_posture @elastic/kibana-cloud-s x-pack/solutions/security/plugins/ecs_data_quality_dashboard @elastic/security-threat-hunting-explore x-pack/solutions/security/plugins/elastic_assistant @elastic/security-generative-ai x-pack/solutions/security/plugins/kubernetes_security @elastic/kibana-cloud-security-posture -x-pack/solutions/security/plugins/lists @elastic/security-detection-engine -x-pack/solutions/security/plugins/security_solution @elastic/security-solution -x-pack/solutions/security/plugins/security_solution_ess @elastic/security-solution -x-pack/solutions/security/plugins/security_solution_serverless @elastic/security-solution +x-pack/solutions/security/solutions/security/plugins/lists @elastic/security-detection-engine +x-pack/solutions/security/solutions/security/plugins/security_solution @elastic/security-solution +x-pack/solutions/security/solutions/security/plugins/security_solution_ess @elastic/security-solution +x-pack/solutions/security/solutions/security/plugins/security_solution_serverless @elastic/security-solution x-pack/solutions/security/plugins/session_view @elastic/kibana-cloud-security-posture x-pack/solutions/security/plugins/threat_intelligence @elastic/security-threat-hunting-investigations x-pack/solutions/security/plugins/timelines @elastic/security-threat-hunting-investigations diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml index b8fcb71c67a06..3077ac0f51674 100644 --- a/.github/codeql/codeql-config.yml +++ b/.github/codeql/codeql-config.yml @@ -74,16 +74,16 @@ paths-ignore: - scripts - test - x-pack/plugins/canvas/scripts - - x-pack/plugins/cloud_security_posture/common/scripts + - x-pack/solutions/security/plugins/cloud_security_posture/common/scripts - x-pack/solutions/security/plugins/elastic_assistant/scripts - x-pack/plugins/event_log/scripts - x-pack/plugins/fleet/scripts - - x-pack/plugins/lists/scripts - - x-pack/plugins/lists/server/scripts + - x-pack/solutions/security/plugins/lists/scripts + - x-pack/solutions/security/plugins/lists/server/scripts - x-pack/plugins/observability_solution/*/scripts - x-pack/platform/plugins/shared/osquery/scripts - x-pack/plugins/rule_registry/scripts - - x-pack/plugins/security_solution/scripts + - x-pack/solutions/security/plugins/security_solution/scripts - x-pack/solutions/security/plugins/threat_intelligence/scripts - x-pack/scripts - x-pack/test diff --git a/.github/paths-labeller.yml b/.github/paths-labeller.yml index 43e9445b5767b..bc67d3a6f6d93 100644 --- a/.github/paths-labeller.yml +++ b/.github/paths-labeller.yml @@ -20,7 +20,7 @@ - 'x-pack/test/fleet_api_integration/**/*.*' - 'Team:obs-ux-management': - 'x-pack/solutions/observability/plugins/observability/**/*.*' - - 'x-pack/plugins/observability_solution/slo/**/*.*' + - 'x-pack/solutions/observability/plugins/slo/**/*.*' - 'x-pack/solutions/observability/plugins/synthetics/**/*.*' - 'x-pack/solutions/observability/plugins/exploratory_view/**/*.*' - 'Team:Obs AI Assistant': diff --git a/.gitignore b/.gitignore index fa77bd6f44919..18382409725a1 100644 --- a/.gitignore +++ b/.gitignore @@ -102,10 +102,10 @@ x-pack/platform/plugins/shared/osquery/cypress.config.d.ts x-pack/platform/plugins/shared/osquery/cypress.config.js x-pack/plugins/enterprise_search/cypress.config.d.ts x-pack/plugins/enterprise_search/cypress.config.js -x-pack/plugins/security_solution/public/management/cypress.config.d.ts -x-pack/plugins/security_solution/public/management/cypress.config.js -x-pack/plugins/security_solution/public/management/cypress_endpoint.config.d.ts -x-pack/plugins/security_solution/public/management/cypress_endpoint.config.js +x-pack/solutions/security/plugins/security_solution/public/management/cypress.config.d.ts +x-pack/solutions/security/plugins/security_solution/public/management/cypress.config.js +x-pack/solutions/security/plugins/security_solution/public/management/cypress_endpoint.config.d.ts +x-pack/solutions/security/plugins/security_solution/public/management/cypress_endpoint.config.js # release notes script output report.csv diff --git a/.i18nrc.json b/.i18nrc.json index 1ef582708b2cd..0e167c2b08b54 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -6,7 +6,7 @@ "alertsUIShared": "packages/kbn-alerts-ui-shared/src", "alertingTypes": "packages/kbn-alerting-types", "apmOss": "src/plugins/apm_oss", - "autocomplete": "packages/kbn-securitysolution-autocomplete/src", + "autocomplete": "x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src", "avcBanner": "src/platform/packages/shared/kbn-avc-banner/src", "bfetch": "src/plugins/bfetch", "bfetchError": "packages/kbn-bfetch-error", @@ -25,12 +25,13 @@ "data": "src/plugins/data", "observabilityAlertDetails": "x-pack/solutions/observability/packages/alert_details", "dataViews": "src/plugins/data_views", - "defaultNavigation": [ - "packages/default-nav", - "src/platform/packages/private/default-nav" - ], + "defaultNavigation": ["packages/default-nav", "src/platform/packages/private/default-nav"], "devTools": "src/platform/plugins/shared/dev_tools", - "discover": ["src/plugins/discover", "packages/kbn-discover-utils", "packages/kbn-discover-contextual-components"], + "discover": [ + "src/plugins/discover", + "packages/kbn-discover-utils", + "packages/kbn-discover-contextual-components" + ], "savedSearch": "src/plugins/saved_search", "embeddableApi": "src/plugins/embeddable", "presentationPanel": "src/plugins/presentation_panel", @@ -87,8 +88,8 @@ "kibana-react": "src/plugins/kibana_react", "kibanaOverview": "src/plugins/kibana_overview", "lensFormulaDocs": "packages/kbn-lens-formula-docs", - "lists": "packages/kbn-securitysolution-list-utils/src", - "exceptionList-components": "packages/kbn-securitysolution-exception-list-components/src", + "lists": "x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src", + "exceptionList-components": "x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src", "management": [ "src/platform/plugins/shared/management", "src/platform/packages/private/kbn-management", @@ -119,7 +120,16 @@ "searchIndexDocuments": "packages/kbn-search-index-documents", "searchResponseWarnings": "packages/kbn-search-response-warnings", "searchTypes": "packages/kbn-search-types", - "securitySolutionPackages": "x-pack/solutions/security/packages", + "securitySolutionPackages": [ + "x-pack/solutions/security/packages/data_table", + "x-pack/solutions/security/packages/ecs_data_quality_dashboard", + "x-pack/solutions/security/packages/features", + "x-pack/solutions/security/packages/kbn-cloud-security-posture", + "x-pack/solutions/security/packages/navigation", + "x-pack/solutions/security/packages/side_nav", + "x-pack/solutions/security/packages/upselling" + ], + "sharedPlatformPackages": ["x-pack/platform/packages/shared/kbn-cloud-security-posture"], "serverlessPackages": "packages/serverless", "sse": ["src/platform/packages/shared/kbn-sse-utils"], "coloring": "packages/kbn-coloring/src", @@ -135,7 +145,7 @@ "uiActionsExamples": "examples/ui_action_examples", "usageCollection": "src/plugins/usage_collection", "userProfileComponents": "packages/kbn-user-profile-components", - "utils": "packages/kbn-securitysolution-utils/src", + "utils": "x-pack/solutions/security/packages/kbn-securitysolution-utils/src", "visDefaultEditor": "src/plugins/vis_default_editor", "visTypeGauge": "src/plugins/vis_types/gauge", "visTypeHeatmap": "src/plugins/vis_types/heatmap", diff --git a/api_docs/actions.mdx b/api_docs/actions.mdx index 5d10232dc66dd..bcb86b74994c0 100644 --- a/api_docs/actions.mdx +++ b/api_docs/actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/actions title: "actions" image: https://source.unsplash.com/400x175/?github description: API docs for the actions plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions'] --- import actionsObj from './actions.devdocs.json'; diff --git a/api_docs/advanced_settings.mdx b/api_docs/advanced_settings.mdx index 48a2f18161cba..513be6bf82820 100644 --- a/api_docs/advanced_settings.mdx +++ b/api_docs/advanced_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/advancedSettings title: "advancedSettings" image: https://source.unsplash.com/400x175/?github description: API docs for the advancedSettings plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings'] --- import advancedSettingsObj from './advanced_settings.devdocs.json'; diff --git a/api_docs/ai_assistant_management_selection.mdx b/api_docs/ai_assistant_management_selection.mdx index 83e9b50c60b8a..1ed43790e70c7 100644 --- a/api_docs/ai_assistant_management_selection.mdx +++ b/api_docs/ai_assistant_management_selection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/aiAssistantManagementSelection title: "aiAssistantManagementSelection" image: https://source.unsplash.com/400x175/?github description: API docs for the aiAssistantManagementSelection plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiAssistantManagementSelection'] --- import aiAssistantManagementSelectionObj from './ai_assistant_management_selection.devdocs.json'; diff --git a/api_docs/aiops.mdx b/api_docs/aiops.mdx index b5290f86f5c8a..145279523795f 100644 --- a/api_docs/aiops.mdx +++ b/api_docs/aiops.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/aiops title: "aiops" image: https://source.unsplash.com/400x175/?github description: API docs for the aiops plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiops'] --- import aiopsObj from './aiops.devdocs.json'; diff --git a/api_docs/alerting.devdocs.json b/api_docs/alerting.devdocs.json index 3ace46ceaf2aa..8ca11a439e4cd 100644 --- a/api_docs/alerting.devdocs.json +++ b/api_docs/alerting.devdocs.json @@ -3506,17 +3506,17 @@ "plugin": "ruleRegistry", "path": "x-pack/plugins/rule_registry/server/utils/create_persistence_rule_type_wrapper.ts" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts" - }, { "plugin": "ruleRegistry", "path": "x-pack/plugins/rule_registry/server/utils/rule_executor.test_helpers.ts" }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts" + }, { "plugin": "slo", - "path": "x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/executor.test.ts" + "path": "x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/executor.test.ts" } ] }, diff --git a/api_docs/alerting.mdx b/api_docs/alerting.mdx index 50c416a9a7c56..e3df30b070b52 100644 --- a/api_docs/alerting.mdx +++ b/api_docs/alerting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/alerting title: "alerting" image: https://source.unsplash.com/400x175/?github description: API docs for the alerting plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting'] --- import alertingObj from './alerting.devdocs.json'; diff --git a/api_docs/apm.mdx b/api_docs/apm.mdx index de8db0b212429..4c4758d3f7b47 100644 --- a/api_docs/apm.mdx +++ b/api_docs/apm.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/apm title: "apm" image: https://source.unsplash.com/400x175/?github description: API docs for the apm plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apm'] --- import apmObj from './apm.devdocs.json'; diff --git a/api_docs/apm_data_access.mdx b/api_docs/apm_data_access.mdx index c829ad8cae1a7..72f338684a29b 100644 --- a/api_docs/apm_data_access.mdx +++ b/api_docs/apm_data_access.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/apmDataAccess title: "apmDataAccess" image: https://source.unsplash.com/400x175/?github description: API docs for the apmDataAccess plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apmDataAccess'] --- import apmDataAccessObj from './apm_data_access.devdocs.json'; diff --git a/api_docs/asset_inventory.devdocs.json b/api_docs/asset_inventory.devdocs.json index 6fdfe95fc2c1e..9816fc76f5fa7 100644 --- a/api_docs/asset_inventory.devdocs.json +++ b/api_docs/asset_inventory.devdocs.json @@ -14,7 +14,7 @@ "tags": [], "label": "AssetInventoryPluginSetup", "description": [], - "path": "x-pack/plugins/asset_inventory/public/types.ts", + "path": "x-pack/solutions/security/plugins/asset_inventory/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -28,7 +28,7 @@ "tags": [], "label": "AssetInventoryPluginStart", "description": [], - "path": "x-pack/plugins/asset_inventory/public/types.ts", + "path": "x-pack/solutions/security/plugins/asset_inventory/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -50,7 +50,7 @@ "tags": [], "label": "AssetInventoryPluginSetup", "description": [], - "path": "x-pack/plugins/asset_inventory/server/types.ts", + "path": "x-pack/solutions/security/plugins/asset_inventory/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -64,7 +64,7 @@ "tags": [], "label": "AssetInventoryPluginStart", "description": [], - "path": "x-pack/plugins/asset_inventory/server/types.ts", + "path": "x-pack/solutions/security/plugins/asset_inventory/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -88,7 +88,7 @@ "signature": [ "\"assetInventory\"" ], - "path": "x-pack/plugins/asset_inventory/common/index.ts", + "path": "x-pack/solutions/security/plugins/asset_inventory/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -103,7 +103,7 @@ "signature": [ "\"assetInventory\"" ], - "path": "x-pack/plugins/asset_inventory/common/index.ts", + "path": "x-pack/solutions/security/plugins/asset_inventory/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/asset_inventory.mdx b/api_docs/asset_inventory.mdx index 91018fbb459f1..c6d477e46e290 100644 --- a/api_docs/asset_inventory.mdx +++ b/api_docs/asset_inventory.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/assetInventory title: "assetInventory" image: https://source.unsplash.com/400x175/?github description: API docs for the assetInventory plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'assetInventory'] --- import assetInventoryObj from './asset_inventory.devdocs.json'; diff --git a/api_docs/banners.mdx b/api_docs/banners.mdx index 62570889f4ddc..8daa47d075c4a 100644 --- a/api_docs/banners.mdx +++ b/api_docs/banners.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/banners title: "banners" image: https://source.unsplash.com/400x175/?github description: API docs for the banners plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'banners'] --- import bannersObj from './banners.devdocs.json'; diff --git a/api_docs/bfetch.mdx b/api_docs/bfetch.mdx index 926fa2a7d8649..4d7e8aa701dd2 100644 --- a/api_docs/bfetch.mdx +++ b/api_docs/bfetch.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/bfetch title: "bfetch" image: https://source.unsplash.com/400x175/?github description: API docs for the bfetch plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'bfetch'] --- import bfetchObj from './bfetch.devdocs.json'; diff --git a/api_docs/canvas.mdx b/api_docs/canvas.mdx index b1a4b664d62dd..22a941347e2e3 100644 --- a/api_docs/canvas.mdx +++ b/api_docs/canvas.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/canvas title: "canvas" image: https://source.unsplash.com/400x175/?github description: API docs for the canvas plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'canvas'] --- import canvasObj from './canvas.devdocs.json'; diff --git a/api_docs/cases.mdx b/api_docs/cases.mdx index 0c4b5b1a87dc9..5c8eb5d97bb8f 100644 --- a/api_docs/cases.mdx +++ b/api_docs/cases.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cases title: "cases" image: https://source.unsplash.com/400x175/?github description: API docs for the cases plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cases'] --- import casesObj from './cases.devdocs.json'; diff --git a/api_docs/charts.mdx b/api_docs/charts.mdx index 0f0660c03565f..0eb04773307ee 100644 --- a/api_docs/charts.mdx +++ b/api_docs/charts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/charts title: "charts" image: https://source.unsplash.com/400x175/?github description: API docs for the charts plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'charts'] --- import chartsObj from './charts.devdocs.json'; diff --git a/api_docs/cloud.mdx b/api_docs/cloud.mdx index e36a2362262cb..cfe3aa0ad7718 100644 --- a/api_docs/cloud.mdx +++ b/api_docs/cloud.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloud title: "cloud" image: https://source.unsplash.com/400x175/?github description: API docs for the cloud plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloud'] --- import cloudObj from './cloud.devdocs.json'; diff --git a/api_docs/cloud_data_migration.mdx b/api_docs/cloud_data_migration.mdx index 862c2a1dba990..f1cb89f489de9 100644 --- a/api_docs/cloud_data_migration.mdx +++ b/api_docs/cloud_data_migration.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudDataMigration title: "cloudDataMigration" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudDataMigration plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudDataMigration'] --- import cloudDataMigrationObj from './cloud_data_migration.devdocs.json'; diff --git a/api_docs/cloud_defend.devdocs.json b/api_docs/cloud_defend.devdocs.json index 4e6084a486171..57434d1618989 100644 --- a/api_docs/cloud_defend.devdocs.json +++ b/api_docs/cloud_defend.devdocs.json @@ -25,7 +25,7 @@ "CloudDefendPage", ") => CloudDefendLinkItem" ], - "path": "x-pack/plugins/cloud_defend/public/common/navigation/security_solution_links.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/public/common/navigation/security_solution_links.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -41,7 +41,7 @@ "signature": [ "CloudDefendPage" ], - "path": "x-pack/plugins/cloud_defend/public/common/navigation/security_solution_links.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/public/common/navigation/security_solution_links.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -59,7 +59,7 @@ "tags": [], "label": "CloudDefendSecuritySolutionContext", "description": [], - "path": "x-pack/plugins/cloud_defend/public/types.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -75,7 +75,7 @@ "signature": [ "() => React.ComponentType<{ children: React.ReactNode; }>" ], - "path": "x-pack/plugins/cloud_defend/public/types.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -101,7 +101,7 @@ }, "; state?: Record | undefined; }>" ], - "path": "x-pack/plugins/cloud_defend/public/types.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -125,7 +125,7 @@ "signature": [ "\"/cloud_defend\"" ], - "path": "x-pack/plugins/cloud_defend/public/common/navigation/constants.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/public/common/navigation/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -137,12 +137,12 @@ "tags": [], "label": "CloudDefendPageId", "description": [ - "\nAll the IDs for the cloud defend pages.\nThis needs to match the cloud defend page entries in `SecurityPageName` in `x-pack/plugins/security_solution/common/constants.ts`." + "\nAll the IDs for the cloud defend pages.\nThis needs to match the cloud defend page entries in `SecurityPageName` in `x-pack/solutions/security/plugins/security_solution/common/constants.ts`." ], "signature": [ "\"cloud_defend-policies\" | \"kubernetes_security-dashboard\"" ], - "path": "x-pack/plugins/cloud_defend/public/common/navigation/types.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/public/common/navigation/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -158,7 +158,7 @@ "description": [ "\ncloud_defend plugin types" ], - "path": "x-pack/plugins/cloud_defend/public/types.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -172,7 +172,7 @@ "tags": [], "label": "CloudDefendPluginStart", "description": [], - "path": "x-pack/plugins/cloud_defend/public/types.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -190,7 +190,7 @@ "CloudDefendRouterProps", ">" ], - "path": "x-pack/plugins/cloud_defend/public/types.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -215,7 +215,7 @@ "tags": [], "label": "CloudDefendPluginSetup", "description": [], - "path": "x-pack/plugins/cloud_defend/server/types.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -229,7 +229,7 @@ "tags": [], "label": "CloudDefendPluginStart", "description": [], - "path": "x-pack/plugins/cloud_defend/server/types.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -248,7 +248,7 @@ "tags": [], "label": "CloudDefendPolicy", "description": [], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -268,7 +268,7 @@ "text": "PackagePolicy" } ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -290,7 +290,7 @@ }, ", \"id\" | \"name\"> & { agents: number; }" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false } @@ -304,7 +304,7 @@ "tags": [], "label": "IndexDetails", "description": [], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -315,7 +315,7 @@ "tags": [], "label": "index", "description": [], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -329,7 +329,7 @@ "signature": [ "\"empty\" | \"not-empty\" | \"unprivileged\"" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false } @@ -343,7 +343,7 @@ "tags": [], "label": "Response", "description": [], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -357,7 +357,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -371,7 +371,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -392,7 +392,7 @@ }, "[] | undefined" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -406,7 +406,7 @@ "signature": [ "\"process\" | \"file\"" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -420,7 +420,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false } @@ -434,7 +434,7 @@ "tags": [], "label": "Selector", "description": [], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -445,7 +445,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -459,7 +459,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -473,7 +473,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -487,7 +487,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -501,7 +501,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -515,7 +515,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -529,7 +529,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -543,7 +543,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -557,7 +557,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -571,7 +571,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -585,7 +585,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -599,7 +599,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -613,7 +613,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -627,7 +627,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -641,7 +641,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -655,7 +655,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -669,7 +669,7 @@ "signature": [ "\"process\" | \"file\"" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -683,7 +683,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false } @@ -711,7 +711,7 @@ }, ", \"id\" | \"name\"> & { agents: number; }" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -726,7 +726,7 @@ "signature": [ "CloudDefendSetupInstalledStatus | CloudDefendSetupNotInstalledStatus" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -741,7 +741,7 @@ "signature": [ "\"indexed\" | \"unprivileged\" | \"indexing\" | \"index-timeout\" | \"not-deployed\" | \"not-installed\"" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -756,7 +756,7 @@ "signature": [ "\"empty\" | \"not-empty\" | \"unprivileged\"" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -771,7 +771,7 @@ "signature": [ "{ readonly policy_name?: string | undefined; readonly per_page: number; readonly page: number; readonly sort_field: \"package_policy.id\" | \"package_policy.name\" | \"package_policy.policy_id\" | \"package_policy.namespace\" | \"package_policy.updated_at\" | \"package_policy.updated_by\" | \"package_policy.created_at\" | \"package_policy.created_by\" | \"package_policy.package.name\" | \"package_policy.package.title\"; readonly sort_order: \"asc\" | \"desc\"; }" ], - "path": "x-pack/plugins/cloud_defend/common/schemas/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/schemas/v1.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -786,7 +786,7 @@ "signature": [ "\"log\" | \"alert\" | \"block\"" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -801,7 +801,7 @@ "signature": [ "\"operation\" | \"containerImageFullName\" | \"containerImageName\" | \"containerImageTag\" | \"kubernetesClusterId\" | \"kubernetesClusterName\" | \"kubernetesNamespace\" | \"kubernetesPodLabel\" | \"kubernetesPodName\" | \"targetFilePath\" | \"ignoreVolumeFiles\" | \"ignoreVolumeMounts\" | \"processExecutable\" | \"processName\" | \"sessionLeaderInteractive\"" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -818,7 +818,7 @@ "signature": [ "\"process\" | \"file\"" ], - "path": "x-pack/plugins/cloud_defend/common/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/v1.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -882,7 +882,7 @@ }, "; }>" ], - "path": "x-pack/plugins/cloud_defend/common/schemas/v1.ts", + "path": "x-pack/solutions/security/plugins/cloud_defend/common/schemas/v1.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/cloud_defend.mdx b/api_docs/cloud_defend.mdx index a8344496f94d0..7098002a74672 100644 --- a/api_docs/cloud_defend.mdx +++ b/api_docs/cloud_defend.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudDefend title: "cloudDefend" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudDefend plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudDefend'] --- import cloudDefendObj from './cloud_defend.devdocs.json'; diff --git a/api_docs/cloud_security_posture.devdocs.json b/api_docs/cloud_security_posture.devdocs.json index dacad0d7725a2..6933160a5ff65 100644 --- a/api_docs/cloud_security_posture.devdocs.json +++ b/api_docs/cloud_security_posture.devdocs.json @@ -25,7 +25,7 @@ "CspPage", ") => CloudSecurityPostureLinkItem" ], - "path": "x-pack/plugins/cloud_security_posture/public/common/navigation/security_solution_links.ts", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/security_solution_links.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -41,7 +41,7 @@ "signature": [ "CspPage" ], - "path": "x-pack/plugins/cloud_security_posture/public/common/navigation/security_solution_links.ts", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/security_solution_links.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -61,7 +61,7 @@ "description": [ "\nMethods exposed from the security solution to the cloud security posture application." ], - "path": "x-pack/plugins/cloud_security_posture/public/types.ts", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -77,7 +77,7 @@ "signature": [ "() => React.ComponentType<{ children: React.ReactNode; }>" ], - "path": "x-pack/plugins/cloud_security_posture/public/types.ts", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -103,7 +103,7 @@ }, "; state?: Record | undefined; }>" ], - "path": "x-pack/plugins/cloud_security_posture/public/types.ts", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -122,12 +122,12 @@ "tags": [], "label": "CloudSecurityPosturePageId", "description": [ - "\nAll the IDs for the cloud security posture pages.\nThis needs to match the cloud security posture page entries in `SecurityPageName` in `x-pack/plugins/security_solution/common/constants.ts`." + "\nAll the IDs for the cloud security posture pages.\nThis needs to match the cloud security posture page entries in `SecurityPageName` in `x-pack/solutions/security/plugins/security_solution/common/constants.ts`." ], "signature": [ "\"cloud_security_posture-dashboard\" | \"cloud_security_posture-cspm-dashboard\" | \"cloud_security_posture-kspm-dashboard\" | \"cloud_security_posture-vulnerability_dashboard\" | \"cloud_security_posture-findings\" | \"cloud_security_posture-benchmarks\" | \"cloud_security_posture-benchmarks-rules\"" ], - "path": "x-pack/plugins/cloud_security_posture/public/common/navigation/types.ts", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -143,7 +143,7 @@ "description": [ "\nThe cloud security posture's public plugin setup interface." ], - "path": "x-pack/plugins/cloud_security_posture/public/types.ts", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -159,7 +159,7 @@ "description": [ "\nThe cloud security posture's public plugin start interface." ], - "path": "x-pack/plugins/cloud_security_posture/public/types.ts", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -177,7 +177,7 @@ "CspRouterProps", ">" ], - "path": "x-pack/plugins/cloud_security_posture/public/types.ts", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -202,7 +202,7 @@ "tags": [], "label": "CspServerPluginSetup", "description": [], - "path": "x-pack/plugins/cloud_security_posture/server/types.ts", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -216,7 +216,7 @@ "tags": [], "label": "CspServerPluginStart", "description": [], - "path": "x-pack/plugins/cloud_security_posture/server/types.ts", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -242,7 +242,7 @@ "signature": [ "\"csp\"" ], - "path": "x-pack/plugins/cloud_security_posture/common/index.ts", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -259,7 +259,7 @@ "signature": [ "\"Cloud Security\"" ], - "path": "x-pack/plugins/cloud_security_posture/common/index.ts", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/cloud_security_posture.mdx b/api_docs/cloud_security_posture.mdx index aed53331c3eea..0567a7555e732 100644 --- a/api_docs/cloud_security_posture.mdx +++ b/api_docs/cloud_security_posture.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/cloudSecurityPosture title: "cloudSecurityPosture" image: https://source.unsplash.com/400x175/?github description: API docs for the cloudSecurityPosture plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudSecurityPosture'] --- import cloudSecurityPostureObj from './cloud_security_posture.devdocs.json'; diff --git a/api_docs/console.mdx b/api_docs/console.mdx index 2e8e1badd20bb..a69070204816e 100644 --- a/api_docs/console.mdx +++ b/api_docs/console.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/console title: "console" image: https://source.unsplash.com/400x175/?github description: API docs for the console plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'console'] --- import consoleObj from './console.devdocs.json'; diff --git a/api_docs/content_management.mdx b/api_docs/content_management.mdx index 2249f4a752b5f..d58cdc2fa35ae 100644 --- a/api_docs/content_management.mdx +++ b/api_docs/content_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/contentManagement title: "contentManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the contentManagement plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'contentManagement'] --- import contentManagementObj from './content_management.devdocs.json'; diff --git a/api_docs/controls.mdx b/api_docs/controls.mdx index 9b955996eaab4..e15035f2d1389 100644 --- a/api_docs/controls.mdx +++ b/api_docs/controls.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/controls title: "controls" image: https://source.unsplash.com/400x175/?github description: API docs for the controls plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'controls'] --- import controlsObj from './controls.devdocs.json'; diff --git a/api_docs/custom_integrations.mdx b/api_docs/custom_integrations.mdx index 0505bb4033662..8bb230c94f2ea 100644 --- a/api_docs/custom_integrations.mdx +++ b/api_docs/custom_integrations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/customIntegrations title: "customIntegrations" image: https://source.unsplash.com/400x175/?github description: API docs for the customIntegrations plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'customIntegrations'] --- import customIntegrationsObj from './custom_integrations.devdocs.json'; diff --git a/api_docs/dashboard.devdocs.json b/api_docs/dashboard.devdocs.json index 932fe862f8717..f490c18dc04c1 100644 --- a/api_docs/dashboard.devdocs.json +++ b/api_docs/dashboard.devdocs.json @@ -1075,7 +1075,7 @@ "text": "PublishingSubject" }, "; forceRefresh: () => void; getSettings: () => ", - "DashboardStateFromSettingsFlyout", + "DashboardSettings", "; getDashboardPanelFromId: (id: string) => ", { "pluginId": "dashboard", @@ -1183,7 +1183,7 @@ "text": "Query" }, " | undefined) => void; setScrollToPanelId: (id: string | undefined) => void; setSettings: (settings: ", - "DashboardStateFromSettingsFlyout", + "DashboardSettings", ") => void; setTags: (tags: string[]) => void; setTimeRange: (timeRange?: ", { "pluginId": "@kbn/es-query", diff --git a/api_docs/dashboard.mdx b/api_docs/dashboard.mdx index 1c03351d4fe03..6b65760f7bbe7 100644 --- a/api_docs/dashboard.mdx +++ b/api_docs/dashboard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dashboard title: "dashboard" image: https://source.unsplash.com/400x175/?github description: API docs for the dashboard plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboard'] --- import dashboardObj from './dashboard.devdocs.json'; diff --git a/api_docs/dashboard_enhanced.mdx b/api_docs/dashboard_enhanced.mdx index 7da94e79e6856..b78d72c4c3a65 100644 --- a/api_docs/dashboard_enhanced.mdx +++ b/api_docs/dashboard_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dashboardEnhanced title: "dashboardEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the dashboardEnhanced plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboardEnhanced'] --- import dashboardEnhancedObj from './dashboard_enhanced.devdocs.json'; diff --git a/api_docs/data.devdocs.json b/api_docs/data.devdocs.json index fdb5f4a97c49f..a059bb6a0127e 100644 --- a/api_docs/data.devdocs.json +++ b/api_docs/data.devdocs.json @@ -3575,7 +3575,7 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.ts" } ], "children": [], @@ -3901,19 +3901,19 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts" }, { "plugin": "inputControlVis", @@ -8118,136 +8118,136 @@ "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" }, { - "plugin": "osquery", - "path": "x-pack/platform/plugins/shared/osquery/server/routes/pack/read_pack_route.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "osquery", + "path": "x-pack/platform/plugins/shared/osquery/server/routes/pack/read_pack_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/usage/detections/rules/get_metrics.mocks.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/get_metrics.mocks.ts" } ] }, @@ -11730,7 +11730,7 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/mock/endpoint/dependencies_start_mock.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/mock/endpoint/dependencies_start_mock.ts" } ] }, @@ -24655,136 +24655,136 @@ "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" }, { - "plugin": "osquery", - "path": "x-pack/platform/plugins/shared/osquery/server/routes/pack/read_pack_route.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "osquery", + "path": "x-pack/platform/plugins/shared/osquery/server/routes/pack/read_pack_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/usage/detections/rules/get_metrics.mocks.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/get_metrics.mocks.ts" } ] }, diff --git a/api_docs/data.mdx b/api_docs/data.mdx index f2af526a98564..e498487538049 100644 --- a/api_docs/data.mdx +++ b/api_docs/data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data title: "data" image: https://source.unsplash.com/400x175/?github description: API docs for the data plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data'] --- import dataObj from './data.devdocs.json'; diff --git a/api_docs/data_quality.mdx b/api_docs/data_quality.mdx index 67603cc0c63cb..06467d1fcbfa3 100644 --- a/api_docs/data_quality.mdx +++ b/api_docs/data_quality.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataQuality title: "dataQuality" image: https://source.unsplash.com/400x175/?github description: API docs for the dataQuality plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataQuality'] --- import dataQualityObj from './data_quality.devdocs.json'; diff --git a/api_docs/data_query.mdx b/api_docs/data_query.mdx index f73bc0bcd7a2d..9d8e620a1b701 100644 --- a/api_docs/data_query.mdx +++ b/api_docs/data_query.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data-query title: "data.query" image: https://source.unsplash.com/400x175/?github description: API docs for the data.query plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.query'] --- import dataQueryObj from './data_query.devdocs.json'; diff --git a/api_docs/data_search.devdocs.json b/api_docs/data_search.devdocs.json index 53f23d2699064..3c8f70ebd85b5 100644 --- a/api_docs/data_search.devdocs.json +++ b/api_docs/data_search.devdocs.json @@ -10095,7 +10095,7 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.ts" } ], "children": [], @@ -10421,19 +10421,19 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts" }, { "plugin": "inputControlVis", @@ -26835,7 +26835,7 @@ "references": [ { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/hooks/eql/api.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/hooks/eql/api.ts" } ] } diff --git a/api_docs/data_search.mdx b/api_docs/data_search.mdx index 27b81cbbd602e..13f0a1d8623f5 100644 --- a/api_docs/data_search.mdx +++ b/api_docs/data_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/data-search title: "data.search" image: https://source.unsplash.com/400x175/?github description: API docs for the data.search plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.search'] --- import dataSearchObj from './data_search.devdocs.json'; diff --git a/api_docs/data_usage.mdx b/api_docs/data_usage.mdx index e76086b4ba95f..8644670594112 100644 --- a/api_docs/data_usage.mdx +++ b/api_docs/data_usage.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataUsage title: "dataUsage" image: https://source.unsplash.com/400x175/?github description: API docs for the dataUsage plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataUsage'] --- import dataUsageObj from './data_usage.devdocs.json'; diff --git a/api_docs/data_view_editor.mdx b/api_docs/data_view_editor.mdx index e6fd61c1dfa74..4d8369fee10f7 100644 --- a/api_docs/data_view_editor.mdx +++ b/api_docs/data_view_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewEditor title: "dataViewEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewEditor plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewEditor'] --- import dataViewEditorObj from './data_view_editor.devdocs.json'; diff --git a/api_docs/data_view_field_editor.mdx b/api_docs/data_view_field_editor.mdx index 662fb686dfdfc..e469e0b95b9c4 100644 --- a/api_docs/data_view_field_editor.mdx +++ b/api_docs/data_view_field_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewFieldEditor title: "dataViewFieldEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewFieldEditor plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewFieldEditor'] --- import dataViewFieldEditorObj from './data_view_field_editor.devdocs.json'; diff --git a/api_docs/data_view_management.mdx b/api_docs/data_view_management.mdx index 4580952d877e4..f1257c9e73713 100644 --- a/api_docs/data_view_management.mdx +++ b/api_docs/data_view_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViewManagement title: "dataViewManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViewManagement plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViewManagement'] --- import dataViewManagementObj from './data_view_management.devdocs.json'; diff --git a/api_docs/data_views.devdocs.json b/api_docs/data_views.devdocs.json index 98259db97e551..6c503c66a2cf6 100644 --- a/api_docs/data_views.devdocs.json +++ b/api_docs/data_views.devdocs.json @@ -14158,22 +14158,6 @@ "plugin": "graph", "path": "x-pack/plugins/graph/public/state_management/persistence.ts" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts" - }, - { - "plugin": "timelines", - "path": "x-pack/solutions/security/plugins/timelines/server/search_strategy/index_fields/index.ts" - }, { "plugin": "stackAlerts", "path": "x-pack/plugins/stack_alerts/public/rule_types/geo_containment/rule_form/boundary_form.tsx" @@ -14238,6 +14222,22 @@ "plugin": "transform", "path": "x-pack/platform/plugins/private/transform/public/app/hooks/use_data_view_exists.ts" }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts" + }, + { + "plugin": "timelines", + "path": "x-pack/solutions/security/plugins/timelines/server/search_strategy/index_fields/index.ts" + }, { "plugin": "ml", "path": "x-pack/platform/plugins/shared/ml/public/application/services/new_job_capabilities/remove_nested_field_children.test.ts" @@ -26073,136 +26073,136 @@ "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" }, { - "plugin": "osquery", - "path": "x-pack/platform/plugins/shared/osquery/server/routes/pack/read_pack_route.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "osquery", + "path": "x-pack/platform/plugins/shared/osquery/server/routes/pack/read_pack_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/usage/detections/rules/get_metrics.mocks.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/get_metrics.mocks.ts" } ] }, diff --git a/api_docs/data_views.mdx b/api_docs/data_views.mdx index 36d5ad50d67b7..1df3e7b114dc7 100644 --- a/api_docs/data_views.mdx +++ b/api_docs/data_views.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataViews title: "dataViews" image: https://source.unsplash.com/400x175/?github description: API docs for the dataViews plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataViews'] --- import dataViewsObj from './data_views.devdocs.json'; diff --git a/api_docs/data_visualizer.mdx b/api_docs/data_visualizer.mdx index 15387a56a9ea7..d177382f1b72c 100644 --- a/api_docs/data_visualizer.mdx +++ b/api_docs/data_visualizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataVisualizer title: "dataVisualizer" image: https://source.unsplash.com/400x175/?github description: API docs for the dataVisualizer plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataVisualizer'] --- import dataVisualizerObj from './data_visualizer.devdocs.json'; diff --git a/api_docs/dataset_quality.mdx b/api_docs/dataset_quality.mdx index d6140d000f869..36d824d28139f 100644 --- a/api_docs/dataset_quality.mdx +++ b/api_docs/dataset_quality.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/datasetQuality title: "datasetQuality" image: https://source.unsplash.com/400x175/?github description: API docs for the datasetQuality plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'datasetQuality'] --- import datasetQualityObj from './dataset_quality.devdocs.json'; diff --git a/api_docs/deprecations_by_api.mdx b/api_docs/deprecations_by_api.mdx index 6649e35430ec7..5b9105996625a 100644 --- a/api_docs/deprecations_by_api.mdx +++ b/api_docs/deprecations_by_api.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsByApi slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-api title: Deprecated API usage by API description: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -17,13 +17,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Referencing plugin(s) | Remove By | | ---------------|-----------|-----------| | | ml, stackAlerts | - | -| | data, @kbn/search-errors, savedObjectsManagement, unifiedSearch, @kbn/unified-field-list, controls, lens, @kbn/lens-embeddable-utils, triggersActionsUi, dataVisualizer, canvas, fleet, ml, enterpriseSearch, @kbn/ml-data-view-utils, graph, securitySolution, timelines, stackAlerts, upgradeAssistant, exploratoryView, visTypeTimeseries, maps, transform, uptime, ux, dataViewManagement, eventAnnotationListing, inputControlVis, visDefaultEditor, visTypeTimelion, visTypeVega | - | +| | data, @kbn/search-errors, savedObjectsManagement, unifiedSearch, @kbn/unified-field-list, controls, lens, @kbn/lens-embeddable-utils, triggersActionsUi, dataVisualizer, canvas, fleet, ml, enterpriseSearch, @kbn/ml-data-view-utils, graph, stackAlerts, upgradeAssistant, exploratoryView, visTypeTimeseries, maps, transform, securitySolution, timelines, uptime, ux, dataViewManagement, eventAnnotationListing, inputControlVis, visDefaultEditor, visTypeTimelion, visTypeVega | - | | | ml, securitySolution | - | | | actions, savedObjectsTagging, ml, enterpriseSearch | - | -| | @kbn/core-http-router-server-internal, @kbn/core-http-server-internal, @kbn/core-metrics-server-internal, @kbn/core-status-server-internal, @kbn/core-i18n-server-internal, @kbn/core-rendering-server-internal, @kbn/core-capabilities-server-internal, @kbn/core-apps-server-internal, usageCollection, taskManager, security, monitoringCollection, files, banners, telemetry, securitySolution, cloudFullStory, customBranding, enterpriseSearch, @kbn/test-suites-xpack, interactiveSetup, mockIdpPlugin, spaces, ml | - | +| | @kbn/core-http-router-server-internal, @kbn/core-http-server-internal, @kbn/core-metrics-server-internal, @kbn/core-status-server-internal, @kbn/core-i18n-server-internal, @kbn/core-rendering-server-internal, @kbn/core-capabilities-server-internal, @kbn/core-apps-server-internal, usageCollection, taskManager, security, monitoringCollection, files, banners, telemetry, cloudFullStory, customBranding, enterpriseSearch, securitySolution, @kbn/test-suites-xpack, interactiveSetup, mockIdpPlugin, spaces, ml | - | | | @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-browser-mocks, @kbn/core, visualizations, aiops, dataVisualizer, dashboardEnhanced, ml, graph, lens, securitySolution, eventAnnotation | - | | | @kbn/core, embeddable, savedObjects, visualizations, canvas, graph, ml | - | -| | @kbn/core-saved-objects-base-server-internal, @kbn/core-saved-objects-migration-server-internal, @kbn/core-saved-objects-server-internal, @kbn/core-ui-settings-server-internal, @kbn/core-usage-data-server-internal, taskManager, dataViews, spaces, share, actions, data, alerting, dashboard, @kbn/core-saved-objects-migration-server-mocks, savedSearch, canvas, lens, cases, fleet, cloudSecurityPosture, ml, graph, lists, maps, securitySolution, apmDataAccess, apm, visualizations, infra, slo, synthetics, uptime, eventAnnotation, links, savedObjectsManagement, @kbn/core-test-helpers-so-type-serializer, @kbn/core-saved-objects-api-server-internal | - | +| | @kbn/core-saved-objects-base-server-internal, @kbn/core-saved-objects-migration-server-internal, @kbn/core-saved-objects-server-internal, @kbn/core-ui-settings-server-internal, @kbn/core-usage-data-server-internal, taskManager, dataViews, spaces, share, actions, data, alerting, dashboard, @kbn/core-saved-objects-migration-server-mocks, savedSearch, canvas, lens, cases, fleet, ml, graph, lists, maps, apmDataAccess, apm, visualizations, infra, slo, securitySolution, synthetics, uptime, cloudSecurityPosture, eventAnnotation, links, savedObjectsManagement, @kbn/core-test-helpers-so-type-serializer, @kbn/core-saved-objects-api-server-internal | - | | | stackAlerts, alerting, securitySolution, inputControlVis | - | | | graph, stackAlerts, inputControlVis, securitySolution | - | | | dataVisualizer, stackAlerts, expressionPartitionVis | - | @@ -34,12 +34,12 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | ruleRegistry, securitySolution, slo | - | | | security, actions, alerting, ruleRegistry, files, cases, fleet, securitySolution | - | | | alerting, securitySolution | - | -| | @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-browser-mocks, @kbn/core-saved-objects-api-server-internal, @kbn/core-saved-objects-import-export-server-internal, @kbn/core-saved-objects-server-internal, fleet, graph, lists, osquery, securitySolution, alerting | - | -| | @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-browser-mocks, @kbn/core-saved-objects-api-server-internal, @kbn/core-saved-objects-import-export-server-internal, @kbn/core-saved-objects-server-internal, fleet, graph, lists, osquery, securitySolution, alerting | - | +| | @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-browser-mocks, @kbn/core-saved-objects-api-server-internal, @kbn/core-saved-objects-import-export-server-internal, @kbn/core-saved-objects-server-internal, fleet, graph, lists, alerting, osquery, securitySolution | - | +| | @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-browser-mocks, @kbn/core-saved-objects-api-server-internal, @kbn/core-saved-objects-import-export-server-internal, @kbn/core-saved-objects-server-internal, fleet, graph, lists, alerting, osquery, securitySolution | - | | | alerting, securitySolution | - | | | securitySolution | - | -| | cloudDefend, securitySolution, synthetics | - | -| | cloudDefend, securitySolution, synthetics | - | +| | securitySolution, synthetics, cloudDefend | - | +| | securitySolution, synthetics, cloudDefend | - | | | cases, securitySolution, security | - | | | @kbn/securitysolution-data-table, securitySolution | - | | | @kbn/securitysolution-data-table, securitySolution | - | @@ -47,12 +47,12 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | @kbn/securitysolution-data-table, securitySolution | - | | | securitySolution | - | | | securitySolution | - | -| | @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-browser-mocks, @kbn/core-saved-objects-api-server-internal, @kbn/core-saved-objects-import-export-server-internal, @kbn/core-saved-objects-server-internal, fleet, graph, lists, osquery, securitySolution, alerting | - | -| | @kbn/core-saved-objects-common, @kbn/core-saved-objects-server, @kbn/core, @kbn/alerting-types, alerting, actions, savedSearch, canvas, enterpriseSearch, securitySolution, taskManager, @kbn/core-saved-objects-server-internal, @kbn/core-saved-objects-api-server | - | -| | @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-api-server, @kbn/core-saved-objects-browser-mocks, @kbn/core, savedObjectsTagging, home, canvas, savedObjectsTaggingOss, lists, securitySolution, upgradeAssistant, savedObjectsManagement, @kbn/core-saved-objects-import-export-server-internal, @kbn/core-ui-settings-server-internal | - | -| | @kbn/core-saved-objects-migration-server-internal, dataViews, actions, data, alerting, dashboard, savedSearch, canvas, lens, cases, savedObjectsTagging, graph, lists, maps, securitySolution, visualizations, @kbn/core-test-helpers-so-type-serializer | - | -| | integrationAssistant, securitySolution, @kbn/ecs-data-quality-dashboard, @kbn/ai-assistant, searchAssistant, observabilityAIAssistantApp | - | -| | security, securitySolution, cloudLinks, cases | - | +| | @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-browser-mocks, @kbn/core-saved-objects-api-server-internal, @kbn/core-saved-objects-import-export-server-internal, @kbn/core-saved-objects-server-internal, fleet, graph, lists, alerting, osquery, securitySolution | - | +| | @kbn/core-saved-objects-common, @kbn/core-saved-objects-server, @kbn/core, @kbn/alerting-types, alerting, actions, savedSearch, canvas, enterpriseSearch, taskManager, securitySolution, @kbn/core-saved-objects-server-internal, @kbn/core-saved-objects-api-server | - | +| | @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-api-server, @kbn/core-saved-objects-browser-mocks, @kbn/core, savedObjectsTagging, home, canvas, savedObjectsTaggingOss, lists, upgradeAssistant, securitySolution, savedObjectsManagement, @kbn/core-saved-objects-import-export-server-internal, @kbn/core-ui-settings-server-internal | - | +| | @kbn/core-saved-objects-migration-server-internal, dataViews, actions, data, alerting, dashboard, savedSearch, canvas, lens, cases, savedObjectsTagging, graph, lists, maps, visualizations, securitySolution, @kbn/core-test-helpers-so-type-serializer | - | +| | integrationAssistant, @kbn/ecs-data-quality-dashboard, securitySolution, @kbn/ai-assistant, searchAssistant, observabilityAIAssistantApp | - | +| | security, cloudLinks, securitySolution, cases | - | | | security, cases, searchPlayground, securitySolution | - | | | lists, securitySolution, @kbn/securitysolution-io-ts-list-types | - | | | lists, securitySolution, @kbn/securitysolution-io-ts-list-types | - | @@ -60,7 +60,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | securitySolution | - | | | securitySolution | - | | | securitySolution | - | -| | securitySolution, lists | - | +| | lists, securitySolution | - | | | securitySolution | - | | | securitySolution | - | | | securitySolution | - | @@ -68,7 +68,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | securitySolution | - | | | @kbn/monaco, securitySolution | - | | | cloudSecurityPosture, securitySolution | - | -| | alerting, observabilityAIAssistant, fleet, cloudSecurityPosture, serverlessSearch, upgradeAssistant, apm, entityManager, transform, synthetics, security | - | +| | alerting, observabilityAIAssistant, fleet, serverlessSearch, upgradeAssistant, apm, entityManager, transform, synthetics, cloudSecurityPosture, security | - | | | actions, alerting | - | | | monitoring | - | | | observabilityShared, monitoring | - | @@ -105,15 +105,15 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | @kbn/core-saved-objects-api-server-internal | - | | | @kbn/core-saved-objects-api-server-internal | - | | | @kbn/core-saved-objects-api-server-internal, canvas | - | -| | @kbn/core-saved-objects-api-server-internal, @kbn/core-saved-objects-migration-server-internal, spaces, data, dashboard, savedSearch, cloudSecurityPosture, visualizations, @kbn/core-test-helpers-so-type-serializer | - | -| | fleet, osquery, exploratoryView, synthetics | - | +| | @kbn/core-saved-objects-api-server-internal, @kbn/core-saved-objects-migration-server-internal, spaces, data, dashboard, savedSearch, visualizations, cloudSecurityPosture, @kbn/core-test-helpers-so-type-serializer | - | +| | fleet, exploratoryView, osquery, synthetics | - | | | @kbn/security-plugin-types-server, telemetry, fleet, profiling, @kbn/security-authorization-core, security | - | -| | @kbn/core-application-browser-internal, @kbn/core-application-browser-mocks, management, assetInventory, fleet, security, kibanaOverview, @kbn/core | - | +| | @kbn/core-application-browser-internal, @kbn/core-application-browser-mocks, management, fleet, security, assetInventory, kibanaOverview, @kbn/core | - | | | graph, visTypeTimeseries, dataViewManagement, dataViews | - | | | graph, visTypeTimeseries, dataViewManagement, dataViews | - | | | graph, visTypeTimeseries, dataViewManagement | - | | | visualizations, graph | - | -| | kubernetesSecurity, threatIntelligence, osquery | - | +| | kubernetesSecurity, osquery, threatIntelligence | - | | | @kbn/core-plugins-browser-internal, @kbn/core-root-browser-internal, home, unifiedSearch, visualizations, fileUpload, dashboardEnhanced, transform, discover, dataVisualizer | - | | | dataViews, maps | - | | | dataViews, dataViewManagement | - | @@ -171,7 +171,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | reporting | - | | | @kbn/reporting-export-types-pdf | - | | | security, aiops, licenseManagement, ml, logstash, slo, crossClusterReplication, painlessLab, watcher, searchprofiler | 8.8.0 | -| | spaces, security, actions, alerting, ml, graph, osquery, securitySolution, upgradeAssistant, remoteClusters, indexLifecycleManagement, painlessLab, rollup, snapshotRestore, transform, aiops, searchprofiler | 8.8.0 | +| | spaces, security, actions, alerting, ml, graph, upgradeAssistant, remoteClusters, indexLifecycleManagement, painlessLab, rollup, snapshotRestore, transform, aiops, osquery, securitySolution, searchprofiler | 8.8.0 | | | fleet, apm, security, securitySolution | 8.8.0 | | | fleet, apm, security, securitySolution | 8.8.0 | | | spaces, @kbn/security-authorization-core, security, alerting, cases, @kbn/security-role-management-model | 8.8.0 | @@ -203,7 +203,6 @@ Safe to remove. | | data | | | data | | | data | -| | embeddable | | | embeddable | | | embeddable | | | embeddable | diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index 9b1e083e6ff32..a355cc4a6df23 100644 --- a/api_docs/deprecations_by_plugin.mdx +++ b/api_docs/deprecations_by_plugin.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsByPlugin slug: /kibana-dev-docs/api-meta/deprecated-api-list-by-plugin title: Deprecated API usage by plugin description: A list of deprecated APIs, which plugins are still referencing them, and when they need to be removed by. -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -645,7 +645,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [application.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/asset_inventory/public/application.tsx#:~:text=appBasePath) | - | +| | [application.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/asset_inventory/public/application.tsx#:~:text=appBasePath) | - | @@ -703,8 +703,8 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [installation_stats_collector.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud_defend/server/lib/telemetry/collectors/installation_stats_collector.ts#:~:text=policy_id), [mocks.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud_defend/public/test/mocks.ts#:~:text=policy_id), [mocks.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud_defend/public/test/mocks.ts#:~:text=policy_id) | - | -| | [installation_stats_collector.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud_defend/server/lib/telemetry/collectors/installation_stats_collector.ts#:~:text=policy_id), [mocks.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud_defend/public/test/mocks.ts#:~:text=policy_id), [mocks.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud_defend/public/test/mocks.ts#:~:text=policy_id) | - | +| | [installation_stats_collector.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/installation_stats_collector.ts#:~:text=policy_id), [mocks.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/cloud_defend/public/test/mocks.ts#:~:text=policy_id), [mocks.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/cloud_defend/public/test/mocks.ts#:~:text=policy_id) | - | +| | [installation_stats_collector.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/installation_stats_collector.ts#:~:text=policy_id), [mocks.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/cloud_defend/public/test/mocks.ts#:~:text=policy_id), [mocks.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/cloud_defend/public/test/mocks.ts#:~:text=policy_id) | - | @@ -728,10 +728,10 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [setup_routes.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud_security_posture/server/routes/setup_routes.ts#:~:text=authc), [setup_routes.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud_security_posture/server/routes/setup_routes.ts#:~:text=authc) | - | -| | [csp_benchmark_rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud_security_posture/server/saved_objects/csp_benchmark_rule.ts#:~:text=migrations) | - | -| | [csp_benchmark_rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud_security_posture/server/saved_objects/csp_benchmark_rule.ts#:~:text=schemas), [csp_settings.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud_security_posture/server/saved_objects/csp_settings.ts#:~:text=schemas) | - | -| | [cloud_security_data_table.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.tsx#:~:text=externalControlColumns) | - | +| | [setup_routes.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/setup_routes.ts#:~:text=authc), [setup_routes.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/setup_routes.ts#:~:text=authc) | - | +| | [csp_benchmark_rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/cloud_security_posture/server/saved_objects/csp_benchmark_rule.ts#:~:text=migrations) | - | +| | [csp_benchmark_rule.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/cloud_security_posture/server/saved_objects/csp_benchmark_rule.ts#:~:text=schemas), [csp_settings.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/cloud_security_posture/server/saved_objects/csp_settings.ts#:~:text=schemas) | - | +| | [cloud_security_data_table.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.tsx#:~:text=externalControlColumns) | - | @@ -1117,7 +1117,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [use_filter.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/kubernetes_security/public/hooks/use_filter.ts#:~:text=getHoverActions) | - | +| | [use_filter.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/kubernetes_security/public/hooks/use_filter.ts#:~:text=getHoverActions) | - | @@ -1259,7 +1259,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_callout/index.tsx#:~:text=AssistantAvatar), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_callout/index.tsx#:~:text=AssistantAvatar), [ai_assistant.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/rule_connector/ai_assistant.tsx#:~:text=AssistantAvatar), [ai_assistant.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/rule_connector/ai_assistant.tsx#:~:text=AssistantAvatar), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/nav_control/index.tsx#:~:text=AssistantAvatar), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/nav_control/index.tsx#:~:text=AssistantAvatar), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/nav_control/index.tsx#:~:text=AssistantAvatar) | - | +| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_callout/index.tsx#:~:text=AssistantAvatar), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_callout/index.tsx#:~:text=AssistantAvatar) | - | @@ -1472,54 +1472,54 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [route.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts#:~:text=alertFactory) | - | -| | [wrap_search_source_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.ts#:~:text=create) | - | -| | [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch) | - | -| | [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion)+ 12 more | - | -| | [dependencies_start_mock.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/mock/endpoint/dependencies_start_mock.ts#:~:text=indexPatterns) | - | -| | [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion)+ 34 more | - | -| | [wrap_search_source_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.ts#:~:text=create) | - | -| | [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch) | - | -| | [api.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/hooks/eql/api.ts#:~:text=options) | - | -| | [create_sourcerer_data_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts#:~:text=title), [create_sourcerer_data_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts#:~:text=title), [create_sourcerer_data_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts#:~:text=title) | - | -| | [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [endpoint_metadata_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts#:~:text=policy_id), [endpoint_package_policies.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts#:~:text=policy_id), [index.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts#:~:text=policy_id) | - | -| | [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [endpoint_metadata_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts#:~:text=policy_id), [endpoint_package_policies.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts#:~:text=policy_id), [index.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts#:~:text=policy_id) | - | -| | [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode)+ 7 more | 8.8.0 | -| | [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode)+ 7 more | 8.8.0 | -| | [get_is_alert_suppression_active.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.ts#:~:text=license%24), [create_threat_signals.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/create_threat_signals.ts#:~:text=license%24), [query.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/query.ts#:~:text=license%24), [threshold.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/threshold.ts#:~:text=license%24), [get_is_alert_suppression_active.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts#:~:text=license%24), [get_is_alert_suppression_active.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts#:~:text=license%24), [get_is_alert_suppression_active.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts#:~:text=license%24) | 8.8.0 | -| | [route.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts#:~:text=authc) | - | -| | [suggest_user_profiles_route.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.ts#:~:text=userProfiles), [get_notes.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.ts#:~:text=userProfiles), [suggest_user_profiles_route.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.ts#:~:text=userProfiles), [get_notes.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.ts#:~:text=userProfiles) | - | -| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx#:~:text=DeprecatedCellValueElementProps), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx#:~:text=DeprecatedCellValueElementProps) | - | -| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx#:~:text=DeprecatedRowRenderer), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx#:~:text=DeprecatedRowRenderer) | - | -| | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=BeatFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=BeatFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=BeatFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=BeatFields) | - | -| | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/types/timeline/cells/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/types/timeline/cells/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/types/header_actions/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/types/header_actions/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields)+ 70 more | - | -| | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=IndexFieldsStrategyRequest), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyRequest), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyRequest), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyRequest), [middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#:~:text=IndexFieldsStrategyRequest), [middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#:~:text=IndexFieldsStrategyRequest) | - | -| | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=IndexFieldsStrategyResponse), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyResponse), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyResponse), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyResponse), [middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#:~:text=IndexFieldsStrategyResponse), [middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#:~:text=IndexFieldsStrategyResponse) | - | -| | [agent_status_handler.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/agent/agent_status_handler.ts#:~:text=authRequired), [resolver.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts#:~:text=authRequired), [resolver.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts#:~:text=authRequired), [resolver.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts#:~:text=authRequired), [update_insight.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/update_insight.ts#:~:text=authRequired), [get_insights.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/get_insights.ts#:~:text=authRequired), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts#:~:text=authRequired), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts#:~:text=authRequired), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts#:~:text=authRequired), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/policy/index.ts#:~:text=authRequired)+ 19 more | - | -| | [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/hooks/types.ts#:~:text=SimpleSavedObject), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/hooks/types.ts#:~:text=SimpleSavedObject) | - | -| | [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion)+ 34 more | - | -| | [legacy_types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts#:~:text=SavedObjectAttributes), [legacy_types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts#:~:text=SavedObjectAttributes), [legacy_migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts#:~:text=SavedObjectAttributes), [legacy_migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts#:~:text=SavedObjectAttributes), [legacy_types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts#:~:text=SavedObjectAttributes), [legacy_types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts#:~:text=SavedObjectAttributes), [legacy_migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts#:~:text=SavedObjectAttributes), [legacy_migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts#:~:text=SavedObjectAttributes) | - | -| | [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=SavedObject), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=SavedObject), [user_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts#:~:text=SavedObject), [user_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts#:~:text=SavedObject) | - | -| | [timelines.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts#:~:text=migrations), [notes.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/notes.ts#:~:text=migrations), [pinned_events.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/pinned_events.ts#:~:text=migrations), [legacy_saved_object_mappings.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_saved_object_mappings.ts#:~:text=migrations), [saved_object_mappings.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/saved_object_mappings.ts#:~:text=migrations) | - | -| | [timelines.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts#:~:text=convertToMultiNamespaceTypeVersion), [notes.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/notes.ts#:~:text=convertToMultiNamespaceTypeVersion), [pinned_events.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/pinned_events.ts#:~:text=convertToMultiNamespaceTypeVersion), [legacy_saved_object_mappings.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_saved_object_mappings.ts#:~:text=convertToMultiNamespaceTypeVersion) | - | -| | [workflow_insights_scan.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/insights/workflow_insights_scan.tsx#:~:text=AssistantAvatar), [workflow_insights_scan.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/insights/workflow_insights_scan.tsx#:~:text=AssistantAvatar), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/assistant/get_comments/index.tsx#:~:text=AssistantAvatar), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/assistant/get_comments/index.tsx#:~:text=AssistantAvatar), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/assistant/get_comments/index.tsx#:~:text=AssistantAvatar), [header_link.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/assistant/header_link.tsx#:~:text=AssistantAvatar), [header_link.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/assistant/header_link.tsx#:~:text=AssistantAvatar), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/index.tsx#:~:text=AssistantAvatar), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/index.tsx#:~:text=AssistantAvatar), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/title/index.tsx#:~:text=AssistantAvatar)+ 17 more | - | -| | [links.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/links.ts#:~:text=authc), [hooks.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/lib/kibana/hooks.ts#:~:text=authc) | - | -| | [use_bulk_get_user_profiles.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/components/user_profiles/use_bulk_get_user_profiles.tsx#:~:text=userProfiles), [use_get_current_user_profile.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/common/components/user_profiles/use_get_current_user_profile.tsx#:~:text=userProfiles) | - | -| | [request_context_factory.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/request_context_factory.ts#:~:text=audit), [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/plugin.ts#:~:text=audit), [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/plugin.ts#:~:text=audit) | - | -| | [lists.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_ID), [lists.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_ID), [policy_hooks.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_ID), [policy_hooks.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_ID), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/trusted_apps/constants.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_ID), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/trusted_apps/constants.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_ID), [trusted_apps_http_mocks.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/mocks/trusted_apps_http_mocks.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_ID), [trusted_apps_http_mocks.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/mocks/trusted_apps_http_mocks.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_ID), [trusted_apps_http_mocks.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/mocks/trusted_apps_http_mocks.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_ID), [mappers.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/mappers.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_ID)+ 18 more | - | -| | [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/trusted_apps/constants.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_NAME), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/trusted_apps/constants.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_NAME), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_NAME), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_NAME) | - | -| | [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/trusted_apps/constants.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_DESCRIPTION), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/trusted_apps/constants.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_DESCRIPTION), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_DESCRIPTION), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_DESCRIPTION) | - | -| | [lists.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_ID), [lists.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_ID), [create_event_filters.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_ID), [create_event_filters.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_ID), [create_event_filters.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_ID), [event_filter_validator.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/event_filter_validator.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_ID), [event_filter_validator.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/event_filter_validator.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_ID), [policy_hooks.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_ID), [policy_hooks.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_ID), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/event_filters/constants.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_ID)+ 19 more | - | -| | [create_event_filters.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_NAME), [create_event_filters.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_NAME), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/event_filters/constants.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_NAME), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/event_filters/constants.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_NAME), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_NAME), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_NAME) | - | -| | [create_event_filters.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_DESCRIPTION), [create_event_filters.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_DESCRIPTION), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/event_filters/constants.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_DESCRIPTION), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/event_filters/constants.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_DESCRIPTION), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_DESCRIPTION), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_DESCRIPTION) | - | -| | [lists.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID), [lists.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID), [host_isolation_exceptions_validator.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/host_isolation_exceptions_validator.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID), [host_isolation_exceptions_validator.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/host_isolation_exceptions_validator.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID), [host_isolation_exception_generator.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/endpoint/data_generators/host_isolation_exception_generator.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID), [host_isolation_exception_generator.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/endpoint/data_generators/host_isolation_exception_generator.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID)+ 3 more | - | -| | [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_NAME), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_NAME), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_NAME), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_NAME) | - | -| | [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_DESCRIPTION), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_DESCRIPTION), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_DESCRIPTION), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_DESCRIPTION) | - | -| | [lists.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_ID), [lists.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_ID), [policy_hooks.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_ID), [policy_hooks.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_ID), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/blocklist/constants.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_ID), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/blocklist/constants.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_ID), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/blocklists/index.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_ID), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/blocklists/index.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_ID), [lists.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_ID), [lists.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_ID)+ 1 more | - | -| | [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/blocklist/constants.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_NAME), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/blocklist/constants.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_NAME), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/blocklists/index.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_NAME), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/blocklists/index.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_NAME) | - | -| | [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/blocklist/constants.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_DESCRIPTION), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/management/pages/blocklist/constants.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_DESCRIPTION), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/blocklists/index.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_DESCRIPTION), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/scripts/endpoint/blocklists/index.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_DESCRIPTION) | - | -| | [use_colors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/resolver/view/use_colors.ts#:~:text=darkMode), [use_colors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/resolver/view/use_colors.ts#:~:text=darkMode), [use_colors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/resolver/view/use_colors.ts#:~:text=darkMode), [use_colors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/resolver/view/use_colors.ts#:~:text=darkMode), [use_colors.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/resolver/view/use_colors.ts#:~:text=darkMode) | - | -| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/index.tsx#:~:text=externalControlColumns) | - | +| | [route.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts#:~:text=alertFactory) | - | +| | [wrap_search_source_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.ts#:~:text=create) | - | +| | [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch) | - | +| | [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion)+ 12 more | - | +| | [dependencies_start_mock.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/common/mock/endpoint/dependencies_start_mock.ts#:~:text=indexPatterns) | - | +| | [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion)+ 34 more | - | +| | [wrap_search_source_client.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.ts#:~:text=create) | - | +| | [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch), [wrap_search_source_client.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts#:~:text=fetch) | - | +| | [api.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/common/hooks/eql/api.ts#:~:text=options) | - | +| | [create_sourcerer_data_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts#:~:text=title), [create_sourcerer_data_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts#:~:text=title), [create_sourcerer_data_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts#:~:text=title) | - | +| | [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [endpoint_metadata_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts#:~:text=policy_id), [endpoint_package_policies.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts#:~:text=policy_id), [index.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts#:~:text=policy_id) | - | +| | [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [fleet_services.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/fleet_services.ts#:~:text=policy_id), [endpoint_metadata_service.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts#:~:text=policy_id), [endpoint_package_policies.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts#:~:text=policy_id), [index.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts#:~:text=policy_id) | - | +| | [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode)+ 7 more | 8.8.0 | +| | [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode)+ 7 more | 8.8.0 | +| | [get_is_alert_suppression_active.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.ts#:~:text=license%24), [create_threat_signals.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/create_threat_signals.ts#:~:text=license%24), [query.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/query.ts#:~:text=license%24), [threshold.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/threshold.ts#:~:text=license%24), [get_is_alert_suppression_active.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts#:~:text=license%24), [get_is_alert_suppression_active.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts#:~:text=license%24), [get_is_alert_suppression_active.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts#:~:text=license%24) | 8.8.0 | +| | [route.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts#:~:text=authc) | - | +| | [suggest_user_profiles_route.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.ts#:~:text=userProfiles), [get_notes.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.ts#:~:text=userProfiles), [suggest_user_profiles_route.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.ts#:~:text=userProfiles), [get_notes.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.ts#:~:text=userProfiles) | - | +| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/index.tsx#:~:text=DeprecatedCellValueElementProps), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/index.tsx#:~:text=DeprecatedCellValueElementProps) | - | +| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/index.tsx#:~:text=DeprecatedRowRenderer), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/index.tsx#:~:text=DeprecatedRowRenderer) | - | +| | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=BeatFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=BeatFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=BeatFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=BeatFields) | - | +| | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/types/timeline/cells/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/types/timeline/cells/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/types/header_actions/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/types/header_actions/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/common/lib/kuery/index.ts#:~:text=BrowserFields)+ 70 more | - | +| | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=IndexFieldsStrategyRequest), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyRequest), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyRequest), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyRequest), [middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#:~:text=IndexFieldsStrategyRequest), [middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#:~:text=IndexFieldsStrategyRequest) | - | +| | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/search_strategy/index_fields/index.ts#:~:text=IndexFieldsStrategyResponse), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyResponse), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyResponse), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts#:~:text=IndexFieldsStrategyResponse), [middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#:~:text=IndexFieldsStrategyResponse), [middleware.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts#:~:text=IndexFieldsStrategyResponse) | - | +| | [agent_status_handler.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/agent/agent_status_handler.ts#:~:text=authRequired), [resolver.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver.ts#:~:text=authRequired), [resolver.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver.ts#:~:text=authRequired), [resolver.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver.ts#:~:text=authRequired), [update_insight.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/workflow_insights/update_insight.ts#:~:text=authRequired), [get_insights.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/workflow_insights/get_insights.ts#:~:text=authRequired), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/index.ts#:~:text=authRequired), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/index.ts#:~:text=authRequired), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/index.ts#:~:text=authRequired), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/policy/index.ts#:~:text=authRequired)+ 19 more | - | +| | [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/common/hooks/types.ts#:~:text=SimpleSavedObject), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/common/hooks/types.ts#:~:text=SimpleSavedObject) | - | +| | [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion)+ 34 more | - | +| | [legacy_types.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts#:~:text=SavedObjectAttributes), [legacy_types.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts#:~:text=SavedObjectAttributes), [legacy_migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts#:~:text=SavedObjectAttributes), [legacy_migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts#:~:text=SavedObjectAttributes), [legacy_types.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts#:~:text=SavedObjectAttributes), [legacy_types.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts#:~:text=SavedObjectAttributes), [legacy_migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts#:~:text=SavedObjectAttributes), [legacy_migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts#:~:text=SavedObjectAttributes) | - | +| | [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=SavedObject), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=SavedObject), [user_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts#:~:text=SavedObject), [user_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts#:~:text=SavedObject) | - | +| | [timelines.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts#:~:text=migrations), [notes.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/notes.ts#:~:text=migrations), [pinned_events.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/pinned_events.ts#:~:text=migrations), [legacy_saved_object_mappings.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_saved_object_mappings.ts#:~:text=migrations), [saved_object_mappings.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/saved_object_mappings.ts#:~:text=migrations) | - | +| | [timelines.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts#:~:text=convertToMultiNamespaceTypeVersion), [notes.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/notes.ts#:~:text=convertToMultiNamespaceTypeVersion), [pinned_events.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/pinned_events.ts#:~:text=convertToMultiNamespaceTypeVersion), [legacy_saved_object_mappings.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_saved_object_mappings.ts#:~:text=convertToMultiNamespaceTypeVersion) | - | +| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/index.tsx#:~:text=AssistantAvatar), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/index.tsx#:~:text=AssistantAvatar), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/index.tsx#:~:text=AssistantAvatar), [header_link.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/assistant/header_link.tsx#:~:text=AssistantAvatar), [header_link.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/assistant/header_link.tsx#:~:text=AssistantAvatar), [workflow_insights_scan.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/insights/workflow_insights_scan.tsx#:~:text=AssistantAvatar), [workflow_insights_scan.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/insights/workflow_insights_scan.tsx#:~:text=AssistantAvatar), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/index.tsx#:~:text=AssistantAvatar), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/index.tsx#:~:text=AssistantAvatar), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/title/index.tsx#:~:text=AssistantAvatar)+ 17 more | - | +| | [links.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/links.ts#:~:text=authc), [hooks.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/common/lib/kibana/hooks.ts#:~:text=authc) | - | +| | [use_bulk_get_user_profiles.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/use_bulk_get_user_profiles.tsx#:~:text=userProfiles), [use_get_current_user_profile.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/use_get_current_user_profile.tsx#:~:text=userProfiles) | - | +| | [request_context_factory.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/request_context_factory.ts#:~:text=audit), [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/plugin.ts#:~:text=audit), [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/plugin.ts#:~:text=audit) | - | +| | [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/constants.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_ID), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/constants.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_ID), [policy_hooks.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_ID), [policy_hooks.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_ID), [lists.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_ID), [lists.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_ID), [trusted_apps_http_mocks.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/mocks/trusted_apps_http_mocks.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_ID), [trusted_apps_http_mocks.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/mocks/trusted_apps_http_mocks.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_ID), [trusted_apps_http_mocks.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/mocks/trusted_apps_http_mocks.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_ID), [mappers.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/service/mappers.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_ID)+ 18 more | - | +| | [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/constants.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_NAME), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/constants.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_NAME), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_NAME), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_NAME) | - | +| | [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/constants.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_DESCRIPTION), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/constants.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_DESCRIPTION), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_DESCRIPTION), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts#:~:text=ENDPOINT_TRUSTED_APPS_LIST_DESCRIPTION) | - | +| | [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/constants.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_ID), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/constants.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_ID), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/constants.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_ID), [form.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/components/form.tsx#:~:text=ENDPOINT_EVENT_FILTERS_LIST_ID), [form.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/components/form.tsx#:~:text=ENDPOINT_EVENT_FILTERS_LIST_ID), [utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/utils.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_ID), [utils.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/utils.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_ID), [service_actions.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/service/service_actions.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_ID), [service_actions.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/service/service_actions.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_ID), [service_actions.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/service/service_actions.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_ID)+ 19 more | - | +| | [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/constants.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_NAME), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/constants.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_NAME), [create_event_filters.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_NAME), [create_event_filters.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_NAME), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/event_filters/index.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_NAME), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/event_filters/index.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_NAME) | - | +| | [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/constants.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_DESCRIPTION), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/constants.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_DESCRIPTION), [create_event_filters.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_DESCRIPTION), [create_event_filters.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_DESCRIPTION), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/event_filters/index.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_DESCRIPTION), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/event_filters/index.ts#:~:text=ENDPOINT_EVENT_FILTERS_LIST_DESCRIPTION) | - | +| | [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID), [lists.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID), [lists.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID), [host_isolation_exceptions_validator.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/host_isolation_exceptions_validator.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID), [host_isolation_exceptions_validator.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/host_isolation_exceptions_validator.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID), [host_isolation_exception_generator.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/host_isolation_exception_generator.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID), [host_isolation_exception_generator.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/host_isolation_exception_generator.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID)+ 3 more | - | +| | [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_NAME), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_NAME), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_NAME), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_NAME) | - | +| | [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_DESCRIPTION), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_DESCRIPTION), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_DESCRIPTION), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts#:~:text=ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_DESCRIPTION) | - | +| | [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/constants.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_ID), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/constants.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_ID), [policy_hooks.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_ID), [policy_hooks.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_ID), [lists.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_ID), [lists.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_ID), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/blocklists/index.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_ID), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/blocklists/index.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_ID), [lists.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_ID), [lists.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_ID)+ 1 more | - | +| | [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/constants.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_NAME), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/constants.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_NAME), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/blocklists/index.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_NAME), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/blocklists/index.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_NAME) | - | +| | [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/constants.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_DESCRIPTION), [constants.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/constants.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_DESCRIPTION), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/blocklists/index.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_DESCRIPTION), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/blocklists/index.ts#:~:text=ENDPOINT_BLOCKLISTS_LIST_DESCRIPTION) | - | +| | [use_colors.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_colors.ts#:~:text=darkMode), [use_colors.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_colors.ts#:~:text=darkMode), [use_colors.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_colors.ts#:~:text=darkMode), [use_colors.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_colors.ts#:~:text=darkMode), [use_colors.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_colors.ts#:~:text=darkMode) | - | +| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/index.tsx#:~:text=externalControlColumns) | - | @@ -1543,9 +1543,9 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [executor.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/executor.test.ts#:~:text=alertFactory) | - | -| | [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/slo/public/plugin.ts#:~:text=license%24) | 8.8.0 | -| | [slo.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/slo/server/saved_objects/slo.ts#:~:text=migrations) | - | +| | [executor.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/executor.test.ts#:~:text=alertFactory) | - | +| | [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/slo/public/plugin.ts#:~:text=license%24) | 8.8.0 | +| | [slo.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/slo/server/saved_objects/slo.ts#:~:text=migrations) | - | @@ -1767,7 +1767,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [search_selection.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/wizard/search_selection/search_selection.tsx#:~:text=includeFields), [visualize_embeddable_factory.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable_factory.tsx#:~:text=includeFields) | - | +| | [search_selection.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/wizard/search_selection/search_selection.tsx#:~:text=includeFields) | - | | | [attribute_service.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/legacy/embeddable/attribute_service.tsx#:~:text=SavedObjectSaveModal), [attribute_service.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/legacy/embeddable/attribute_service.tsx#:~:text=SavedObjectSaveModal) | 8.8.0 | | | [plugin.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/plugin.ts#:~:text=savedObjects), [visualize_listing.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/visualize_app/components/visualize_listing.tsx#:~:text=savedObjects) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/plugin.ts#:~:text=SavedObjectsClientContract), [plugin.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/plugin.ts#:~:text=SavedObjectsClientContract) | - | @@ -1777,8 +1777,8 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | | [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/types.ts#:~:text=ResolvedSimpleSavedObject), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/types.ts#:~:text=ResolvedSimpleSavedObject), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/types.ts#:~:text=ResolvedSimpleSavedObject), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/types.ts#:~:text=ResolvedSimpleSavedObject) | - | | | [services.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/services.ts#:~:text=SavedObjectsStart), [services.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/services.ts#:~:text=SavedObjectsStart) | - | | | [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectAttribute), [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectAttribute) | - | -| | [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectAttributes), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectAttributes), [visualize_embeddable.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable.tsx#:~:text=SavedObjectAttributes), [visualize_embeddable.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable.tsx#:~:text=SavedObjectAttributes), [visualize_embeddable_factory.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable_factory.tsx#:~:text=SavedObjectAttributes), [visualize_embeddable_factory.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable_factory.tsx#:~:text=SavedObjectAttributes) | - | -| | [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectReference), [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectReference), [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectReference), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectReference), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectReference), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectReference), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectReference), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectReference), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectReference), [visualize_embeddable_factory.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable_factory.tsx#:~:text=SavedObjectReference)+ 10 more | - | +| | [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectAttributes), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectAttributes), [visualize_embeddable.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable.tsx#:~:text=SavedObjectAttributes), [visualize_embeddable.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable.tsx#:~:text=SavedObjectAttributes) | - | +| | [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectReference), [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectReference), [saved_visualization_references.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualization_references/saved_visualization_references.ts#:~:text=SavedObjectReference), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectReference), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectReference), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectReference), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectReference), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectReference), [saved_visualize_utils.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/utils/saved_visualize_utils.ts#:~:text=SavedObjectReference), [visualize_listing.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/visualize_app/components/visualize_listing.tsx#:~:text=SavedObjectReference)+ 8 more | - | | | [visualization.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/server/saved_objects/visualization.ts#:~:text=migrations) | - | | | [visualization.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/server/saved_objects/visualization.ts#:~:text=schemas) | - | | | [visualization.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/server/saved_objects/visualization.ts#:~:text=convertToMultiNamespaceTypeVersion) | - | diff --git a/api_docs/deprecations_by_team.mdx b/api_docs/deprecations_by_team.mdx index bed9cebf8cb24..a9c697d635ec5 100644 --- a/api_docs/deprecations_by_team.mdx +++ b/api_docs/deprecations_by_team.mdx @@ -7,7 +7,7 @@ id: kibDevDocsDeprecationsDueByTeam slug: /kibana-dev-docs/api-meta/deprecations-due-by-team title: Deprecated APIs due to be removed, by team description: Lists the teams that are referencing deprecated APIs with a remove by date. -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -106,7 +106,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Plugin | Deprecated API | Reference location(s) | Remove By | | --------|-------|-----------|-----------| -| slo | | [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/slo/public/plugin.ts#:~:text=license%24) | 8.8.0 | +| slo | | [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/slo/public/plugin.ts#:~:text=license%24) | 8.8.0 | @@ -131,6 +131,6 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Plugin | Deprecated API | Reference location(s) | Remove By | | --------|-------|-----------|-----------| -| securitySolution | | [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode)+ 7 more | 8.8.0 | -| securitySolution | | [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode)+ 7 more | 8.8.0 | -| securitySolution | | [get_is_alert_suppression_active.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.ts#:~:text=license%24), [create_threat_signals.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/create_threat_signals.ts#:~:text=license%24), [query.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/query.ts#:~:text=license%24), [threshold.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/threshold.ts#:~:text=license%24), [get_is_alert_suppression_active.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts#:~:text=license%24), [get_is_alert_suppression_active.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts#:~:text=license%24), [get_is_alert_suppression_active.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts#:~:text=license%24) | 8.8.0 | \ No newline at end of file +| securitySolution | | [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode)+ 7 more | 8.8.0 | +| securitySolution | | [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [policy_config.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/common/license/policy_config.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [fleet_integration.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [create_default_policy.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode), [license_watch.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts#:~:text=mode)+ 7 more | 8.8.0 | +| securitySolution | | [get_is_alert_suppression_active.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.ts#:~:text=license%24), [create_threat_signals.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/create_threat_signals.ts#:~:text=license%24), [query.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/query.ts#:~:text=license%24), [threshold.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/threshold.ts#:~:text=license%24), [get_is_alert_suppression_active.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts#:~:text=license%24), [get_is_alert_suppression_active.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts#:~:text=license%24), [get_is_alert_suppression_active.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts#:~:text=license%24) | 8.8.0 | \ No newline at end of file diff --git a/api_docs/dev_tools.mdx b/api_docs/dev_tools.mdx index d2a815bb8d709..26217b55f670d 100644 --- a/api_docs/dev_tools.mdx +++ b/api_docs/dev_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/devTools title: "devTools" image: https://source.unsplash.com/400x175/?github description: API docs for the devTools plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'devTools'] --- import devToolsObj from './dev_tools.devdocs.json'; diff --git a/api_docs/discover.devdocs.json b/api_docs/discover.devdocs.json index 20681bf23e2e7..fe9734b3de457 100644 --- a/api_docs/discover.devdocs.json +++ b/api_docs/discover.devdocs.json @@ -4734,6 +4734,10 @@ "plugin": "fleet", "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/hooks/use_get_logs_discover_link.tsx" }, + { + "plugin": "exploratoryView", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_discover_link.tsx" + }, { "plugin": "osquery", "path": "x-pack/platform/plugins/shared/osquery/public/packs/pack_queries_status_table.tsx" @@ -4746,10 +4750,6 @@ "plugin": "osquery", "path": "x-pack/platform/plugins/shared/osquery/public/common/hooks/use_discover_link.tsx" }, - { - "plugin": "exploratoryView", - "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_discover_link.tsx" - }, { "plugin": "synthetics", "path": "x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/stderr_logs.tsx" diff --git a/api_docs/discover.mdx b/api_docs/discover.mdx index b9b48468e2d54..64c326cc42c45 100644 --- a/api_docs/discover.mdx +++ b/api_docs/discover.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discover title: "discover" image: https://source.unsplash.com/400x175/?github description: API docs for the discover plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discover'] --- import discoverObj from './discover.devdocs.json'; diff --git a/api_docs/discover_enhanced.mdx b/api_docs/discover_enhanced.mdx index 2e9af75d5e295..a9bcef7185276 100644 --- a/api_docs/discover_enhanced.mdx +++ b/api_docs/discover_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discoverEnhanced title: "discoverEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the discoverEnhanced plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discoverEnhanced'] --- import discoverEnhancedObj from './discover_enhanced.devdocs.json'; diff --git a/api_docs/discover_shared.mdx b/api_docs/discover_shared.mdx index db575f4df003d..a4febedc24e44 100644 --- a/api_docs/discover_shared.mdx +++ b/api_docs/discover_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/discoverShared title: "discoverShared" image: https://source.unsplash.com/400x175/?github description: API docs for the discoverShared plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'discoverShared'] --- import discoverSharedObj from './discover_shared.devdocs.json'; diff --git a/api_docs/ecs_data_quality_dashboard.mdx b/api_docs/ecs_data_quality_dashboard.mdx index 7167700ed3f66..b9d89669002c0 100644 --- a/api_docs/ecs_data_quality_dashboard.mdx +++ b/api_docs/ecs_data_quality_dashboard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ecsDataQualityDashboard title: "ecsDataQualityDashboard" image: https://source.unsplash.com/400x175/?github description: API docs for the ecsDataQualityDashboard plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ecsDataQualityDashboard'] --- import ecsDataQualityDashboardObj from './ecs_data_quality_dashboard.devdocs.json'; diff --git a/api_docs/elastic_assistant.mdx b/api_docs/elastic_assistant.mdx index cdeb6e62a593a..c22e2f3724007 100644 --- a/api_docs/elastic_assistant.mdx +++ b/api_docs/elastic_assistant.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/elasticAssistant title: "elasticAssistant" image: https://source.unsplash.com/400x175/?github description: API docs for the elasticAssistant plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'elasticAssistant'] --- import elasticAssistantObj from './elastic_assistant.devdocs.json'; diff --git a/api_docs/embeddable.devdocs.json b/api_docs/embeddable.devdocs.json index 4e5cef1a2d21b..a3f56540a9592 100644 --- a/api_docs/embeddable.devdocs.json +++ b/api_docs/embeddable.devdocs.json @@ -4,20 +4,12 @@ "classes": [ { "parentPluginId": "embeddable", - "id": "def-public.Container", + "id": "def-public.Embeddable", "type": "Class", "tags": [], - "label": "Container", + "label": "Embeddable", "description": [], "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.Container", - "text": "Container" - }, - " extends ", { "pluginId": "embeddable", "scope": "public", @@ -25,56 +17,151 @@ "section": "def-public.Embeddable", "text": "Embeddable" }, - " implements ", + " implements ", { "pluginId": "embeddable", "scope": "public", "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" + "section": "def-public.IEmbeddable", + "text": "IEmbeddable" }, - ",", - { - "pluginId": "@kbn/presentation-containers", - "scope": "public", - "docId": "kibKbnPresentationContainersPluginApi", - "section": "def-public.PresentationContainer", - "text": "PresentationContainer" - } + "" ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", + "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "embeddable", - "id": "def-public.Container.isContainer", + "id": "def-public.Embeddable.runtimeId", + "type": "number", + "tags": [], + "label": "runtimeId", + "description": [], + "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "embeddable", + "id": "def-public.Embeddable.runtimeId", + "type": "number", + "tags": [], + "label": "runtimeId", + "description": [], + "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "embeddable", + "id": "def-public.Embeddable.deferEmbeddableLoad", "type": "boolean", "tags": [], - "label": "isContainer", + "label": "deferEmbeddableLoad", + "description": [], + "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "embeddable", + "id": "def-public.Embeddable.type", + "type": "string", + "tags": [], + "label": "type", + "description": [], + "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "embeddable", + "id": "def-public.Embeddable.id", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "embeddable", + "id": "def-public.Embeddable.fatalError", + "type": "Object", + "tags": [], + "label": "fatalError", + "description": [], + "signature": [ + "Error | undefined" + ], + "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "embeddable", + "id": "def-public.Embeddable.output", + "type": "Uncategorized", + "tags": [], + "label": "output", + "description": [], + "signature": [ + "TEmbeddableOutput" + ], + "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "embeddable", + "id": "def-public.Embeddable.input", + "type": "Uncategorized", + "tags": [], + "label": "input", "description": [], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", + "signature": [ + "TEmbeddableInput" + ], + "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "embeddable", - "id": "def-public.Container.children$", + "id": "def-public.Embeddable.renderComplete", "type": "Object", "tags": [], - "label": "children$", + "label": "renderComplete", "description": [], "signature": [ - "BehaviorSubject", - "<{ [key: string]: unknown; }>" + { + "pluginId": "kibanaUtils", + "scope": "public", + "docId": "kibKibanaUtilsPluginApi", + "section": "def-public.RenderCompleteDispatcher", + "text": "RenderCompleteDispatcher" + } ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", + "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "embeddable", + "id": "def-public.Embeddable.destroyed", + "type": "boolean", + "tags": [], + "label": "destroyed", + "description": [], + "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "embeddable", - "id": "def-public.Container.Unnamed", + "id": "def-public.Embeddable.Unnamed", "type": "Function", "tags": [], "label": "Constructor", @@ -82,1890 +169,196 @@ "signature": [ "any" ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", + "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "embeddable", - "id": "def-public.Container.Unnamed.$1", + "id": "def-public.Embeddable.Unnamed.$1", "type": "Uncategorized", "tags": [], "label": "input", "description": [], "signature": [ - "TContainerInput" + "TEmbeddableInput" ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", + "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true }, { "parentPluginId": "embeddable", - "id": "def-public.Container.Unnamed.$2", + "id": "def-public.Embeddable.Unnamed.$2", "type": "Uncategorized", "tags": [], "label": "output", "description": [], "signature": [ - "TContainerOutput" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.Unnamed.$3", - "type": "Function", - "tags": [], - "label": "getFactory", - "description": [], - "signature": [ - " = ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IEmbeddable", - "text": "IEmbeddable" - }, - ">(embeddableFactoryId: string) => ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableFactory", - "text": "EmbeddableFactory" - }, - " | undefined" + "TEmbeddableOutput" ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", + "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.Unnamed.$4", - "type": "Object", - "tags": [], - "label": "parent", - "description": [], - "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - "> | undefined" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.Unnamed.$5", - "type": "Object", - "tags": [], - "label": "settings", - "description": [], - "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableContainerSettings", - "text": "EmbeddableContainerSettings" - }, - " | undefined" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false } ], "returnComment": [] }, { "parentPluginId": "embeddable", - "id": "def-public.Container.getPanelCount", - "type": "Function", + "id": "def-public.Embeddable.uuid", + "type": "string", "tags": [], - "label": "getPanelCount", + "label": "uuid", "description": [], - "signature": [ - "() => number" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", + "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] + "trackAdoption": false }, { "parentPluginId": "embeddable", - "id": "def-public.Container.removePanel", - "type": "Function", + "id": "def-public.Embeddable.disableTriggers", + "type": "boolean", "tags": [], - "label": "removePanel", + "label": "disableTriggers", "description": [], - "signature": [ - "(id: string) => void" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", + "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.Container.removePanel.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] + "trackAdoption": false }, { "parentPluginId": "embeddable", - "id": "def-public.Container.addNewPanel", + "id": "def-public.Embeddable.onEdit", "type": "Function", "tags": [], - "label": "addNewPanel", + "label": "onEdit", "description": [], "signature": [ - "(panelPackage: ", - { - "pluginId": "@kbn/presentation-containers", - "scope": "public", - "docId": "kibKbnPresentationContainersPluginApi", - "section": "def-public.PanelPackage", - "text": "PanelPackage" - }, - ") => Promise" + "() => Promise" ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", + "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", "deprecated": false, "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.Container.addNewPanel.$1", - "type": "Object", - "tags": [], - "label": "panelPackage", - "description": [], - "signature": [ - { - "pluginId": "@kbn/presentation-containers", - "scope": "public", - "docId": "kibKbnPresentationContainersPluginApi", - "section": "def-public.PanelPackage", - "text": "PanelPackage" - }, - "" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] + "returnComment": [], + "children": [] }, { "parentPluginId": "embeddable", - "id": "def-public.Container.replacePanel", - "type": "Function", + "id": "def-public.Embeddable.viewMode", + "type": "Object", "tags": [], - "label": "replacePanel", + "label": "viewMode", "description": [], "signature": [ - "(idToRemove: string, { panelType, initialState }: ", + "{ source: ", + "Observable", + " | undefined; readonly value: ", { - "pluginId": "@kbn/presentation-containers", + "pluginId": "@kbn/presentation-publishing", "scope": "public", - "docId": "kibKbnPresentationContainersPluginApi", - "section": "def-public.PanelPackage", - "text": "PanelPackage" + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.ViewMode", + "text": "ViewMode" }, - ") => Promise" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ + "; error: (err: any) => void; forEach: { (next: (value: ", { - "parentPluginId": "embeddable", - "id": "def-public.Container.replacePanel.$1", - "type": "string", - "tags": [], - "label": "idToRemove", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.ViewMode", + "text": "ViewMode" }, + ") => void): Promise; (next: (value: ", { - "parentPluginId": "embeddable", - "id": "def-public.Container.replacePanel.$2", - "type": "Object", - "tags": [], - "label": "{ panelType, initialState }", - "description": [], - "signature": [ - { - "pluginId": "@kbn/presentation-containers", - "scope": "public", - "docId": "kibKbnPresentationContainersPluginApi", - "section": "def-public.PanelPackage", - "text": "PanelPackage" - }, - "" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.setChildLoaded", - "type": "Function", - "tags": [], - "label": "setChildLoaded", - "description": [], - "signature": [ - "(embeddable: ", + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.ViewMode", + "text": "ViewMode" + }, + ") => void, promiseCtor: PromiseConstructorLike): Promise; }; complete: () => void; getValue: () => ", { - "pluginId": "embeddable", + "pluginId": "@kbn/presentation-publishing", "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IEmbeddable", - "text": "IEmbeddable" + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.ViewMode", + "text": "ViewMode" }, + "; closed: boolean; pipe: { (): ", + "Observable", "<", { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.ViewMode", + "text": "ViewMode" }, - ", ", + ">; (op1: ", + "OperatorFunction", + "<", { - "pluginId": "embeddable", + "pluginId": "@kbn/presentation-publishing", "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.ViewMode", + "text": "ViewMode" }, - ", any>) => void" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.Container.setChildLoaded.$1", - "type": "Object", - "tags": [], - "label": "embeddable", - "description": [], - "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IEmbeddable", - "text": "IEmbeddable" - }, - "<", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" - }, - ", ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" - }, - ", any>" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.updateInputForChild", - "type": "Function", - "tags": [], - "label": "updateInputForChild", - "description": [], - "signature": [ - "): ", + "Observable", + "; (op1: ", + "OperatorFunction", + "<", { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.ViewMode", + "text": "ViewMode" }, - " = ", + ", A>, op2: ", + "OperatorFunction", + "): ", + "Observable", + "; (op1: ", + "OperatorFunction", + "<", { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.ViewMode", + "text": "ViewMode" }, - ">(id: string, changes: Partial) => void" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ + ", A>, op2: ", + "OperatorFunction", + ", op3: ", + "OperatorFunction", + "): ", + "Observable", + "; (op1: ", + "OperatorFunction", + "<", { - "parentPluginId": "embeddable", - "id": "def-public.Container.updateInputForChild.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.ViewMode", + "text": "ViewMode" }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.updateInputForChild.$2", - "type": "Object", - "tags": [], - "label": "changes", - "description": [], - "signature": [ - "Partial" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.reload", - "type": "Function", - "tags": [], - "label": "reload", - "description": [], - "signature": [ - "() => void" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.addNewEmbeddable", - "type": "Function", - "tags": [], - "label": "addNewEmbeddable", - "description": [], - "signature": [ - " = ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IEmbeddable", - "text": "IEmbeddable" - }, - ">(type: string, explicitInput: Partial, attributes?: unknown) => Promise<", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ErrorEmbeddable", - "text": "ErrorEmbeddable" - }, - " | E>" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.Container.addNewEmbeddable.$1", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.addNewEmbeddable.$2", - "type": "Object", - "tags": [], - "label": "explicitInput", - "description": [], - "signature": [ - "Partial" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.addNewEmbeddable.$3", - "type": "Unknown", - "tags": [], - "label": "attributes", - "description": [], - "signature": [ - "unknown" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.replaceEmbeddable", - "type": "Function", - "tags": [], - "label": "replaceEmbeddable", - "description": [], - "signature": [ - " = ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IEmbeddable", - "text": "IEmbeddable" - }, - ">(id: string, newExplicitInput: Partial, newType?: string | undefined, generateNewId?: boolean | undefined) => Promise" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.Container.replaceEmbeddable.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.replaceEmbeddable.$2", - "type": "Object", - "tags": [], - "label": "newExplicitInput", - "description": [], - "signature": [ - "Partial" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.replaceEmbeddable.$3", - "type": "string", - "tags": [], - "label": "newType", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.replaceEmbeddable.$4", - "type": "CompoundType", - "tags": [], - "label": "generateNewId", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.removeEmbeddable", - "type": "Function", - "tags": [], - "label": "removeEmbeddable", - "description": [], - "signature": [ - "(embeddableId: string) => void" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.Container.removeEmbeddable.$1", - "type": "string", - "tags": [], - "label": "embeddableId", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.onRemoveEmbeddable", - "type": "Function", - "tags": [], - "label": "onRemoveEmbeddable", - "description": [ - "\nControl the panels that are pushed to the input stream when an embeddable is\nremoved. This can be used if removing one embeddable has knock-on effects, like\nre-ordering embeddables that come after it." - ], - "signature": [ - "(embeddableId: string) => { [key: string]: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.PanelState", - "text": "PanelState" - }, - "<", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" - }, - " & { id: string; }>; }" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.Container.onRemoveEmbeddable.$1", - "type": "string", - "tags": [], - "label": "embeddableId", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.getChildIds", - "type": "Function", - "tags": [], - "label": "getChildIds", - "description": [], - "signature": [ - "() => string[]" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.getChild", - "type": "Function", - "tags": [], - "label": "getChild", - "description": [], - "signature": [ - ">(id: string) => E" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.Container.getChild.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.getInputForChild", - "type": "Function", - "tags": [], - "label": "getInputForChild", - "description": [], - "signature": [ - "(embeddableId: string) => TEmbeddableInput" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.Container.getInputForChild.$1", - "type": "string", - "tags": [], - "label": "embeddableId", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.getAnyChildOutputChange$", - "type": "Function", - "tags": [], - "label": "getAnyChildOutputChange$", - "description": [], - "signature": [ - "() => ", - "Observable", - "" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.destroy", - "type": "Function", - "tags": [], - "label": "destroy", - "description": [], - "signature": [ - "() => void" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.untilEmbeddableLoaded", - "type": "Function", - "tags": [], - "label": "untilEmbeddableLoaded", - "description": [], - "signature": [ - ">(id: string) => Promise<", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ErrorEmbeddable", - "text": "ErrorEmbeddable" - }, - " | TEmbeddable>" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.Container.untilEmbeddableLoaded.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.untilReactEmbeddableLoaded", - "type": "Function", - "tags": [], - "label": "untilReactEmbeddableLoaded", - "description": [], - "signature": [ - "(id: string) => Promise" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.Container.untilReactEmbeddableLoaded.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.getExplicitInputIsEqual", - "type": "Function", - "tags": [], - "label": "getExplicitInputIsEqual", - "description": [], - "signature": [ - "(lastInput: TContainerInput) => Promise" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.Container.getExplicitInputIsEqual.$1", - "type": "Uncategorized", - "tags": [], - "label": "lastInput", - "description": [], - "signature": [ - "TContainerInput" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.createNewPanelState", - "type": "Function", - "tags": [], - "label": "createNewPanelState", - "description": [], - "signature": [ - ">(factory: ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableFactory", - "text": "EmbeddableFactory" - }, - ", partial?: Partial, attributes?: unknown) => { newPanel: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.PanelState", - "text": "PanelState" - }, - "; otherPanels: TContainerInput[\"panels\"]; }" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.Container.createNewPanelState.$1", - "type": "Object", - "tags": [], - "label": "factory", - "description": [], - "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableFactory", - "text": "EmbeddableFactory" - }, - "" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.createNewPanelState.$2", - "type": "Object", - "tags": [], - "label": "partial", - "description": [], - "signature": [ - "Partial" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.createNewPanelState.$3", - "type": "Unknown", - "tags": [], - "label": "attributes", - "description": [], - "signature": [ - "unknown" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.getPanelState", - "type": "Function", - "tags": [], - "label": "getPanelState", - "description": [], - "signature": [ - "(embeddableId: string) => ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.PanelState", - "text": "PanelState" - }, - "" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.Container.getPanelState.$1", - "type": "string", - "tags": [], - "label": "embeddableId", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.getInheritedInput", - "type": "Function", - "tags": [], - "label": "getInheritedInput", - "description": [ - "\nReturn state that comes from the container and is passed down to the child. For instance, time range and\nfilters are common inherited input state. Note that state stored in `this.input.panels[embeddableId].explicitInput`\nwill override inherited input." - ], - "signature": [ - "(id: string) => TChildInput" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.Container.getInheritedInput.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.createAndSaveEmbeddable", - "type": "Function", - "tags": [], - "label": "createAndSaveEmbeddable", - "description": [], - "signature": [ - " = ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IEmbeddable", - "text": "IEmbeddable" - }, - ">(type: string, panelState: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.PanelState", - "text": "PanelState" - }, - "<{ id: string; version?: string | undefined; }>, otherPanels: TContainerInput[\"panels\"]) => Promise<", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ErrorEmbeddable", - "text": "ErrorEmbeddable" - }, - " | TEmbeddable>" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.Container.createAndSaveEmbeddable.$1", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.createAndSaveEmbeddable.$2", - "type": "Object", - "tags": [], - "label": "panelState", - "description": [], - "signature": [ - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.PanelState", - "text": "PanelState" - }, - "<{ id: string; version?: string | undefined; }>" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Container.createAndSaveEmbeddable.$3", - "type": "Uncategorized", - "tags": [], - "label": "otherPanels", - "description": [], - "signature": [ - "TContainerInput[\"panels\"]" - ], - "path": "src/plugins/embeddable/public/lib/containers/container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable", - "type": "Class", - "tags": [], - "label": "Embeddable", - "description": [], - "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.Embeddable", - "text": "Embeddable" - }, - " implements ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IEmbeddable", - "text": "IEmbeddable" - }, - "" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.runtimeId", - "type": "number", - "tags": [], - "label": "runtimeId", - "description": [], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.runtimeId", - "type": "number", - "tags": [], - "label": "runtimeId", - "description": [], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.parent", - "type": "Object", - "tags": [], - "label": "parent", - "description": [], - "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - "> | undefined" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.isContainer", - "type": "boolean", - "tags": [], - "label": "isContainer", - "description": [], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.deferEmbeddableLoad", - "type": "boolean", - "tags": [], - "label": "deferEmbeddableLoad", - "description": [], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.fatalError", - "type": "Object", - "tags": [], - "label": "fatalError", - "description": [], - "signature": [ - "Error | undefined" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.output", - "type": "Uncategorized", - "tags": [], - "label": "output", - "description": [], - "signature": [ - "TEmbeddableOutput" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.input", - "type": "Uncategorized", - "tags": [], - "label": "input", - "description": [], - "signature": [ - "TEmbeddableInput" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.renderComplete", - "type": "Object", - "tags": [], - "label": "renderComplete", - "description": [], - "signature": [ - { - "pluginId": "kibanaUtils", - "scope": "public", - "docId": "kibKibanaUtilsPluginApi", - "section": "def-public.RenderCompleteDispatcher", - "text": "RenderCompleteDispatcher" - } - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.destroyed", - "type": "boolean", - "tags": [], - "label": "destroyed", - "description": [], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.Unnamed", - "type": "Function", - "tags": [], - "label": "Constructor", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.Unnamed.$1", - "type": "Uncategorized", - "tags": [], - "label": "input", - "description": [], - "signature": [ - "TEmbeddableInput" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.Unnamed.$2", - "type": "Uncategorized", - "tags": [], - "label": "output", - "description": [], - "signature": [ - "TEmbeddableOutput" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.Unnamed.$3", - "type": "Object", - "tags": [], - "label": "parent", - "description": [], - "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - "> | undefined" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.uuid", - "type": "string", - "tags": [], - "label": "uuid", - "description": [], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.disableTriggers", - "type": "boolean", - "tags": [], - "label": "disableTriggers", - "description": [], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.onEdit", - "type": "Function", - "tags": [], - "label": "onEdit", - "description": [], - "signature": [ - "() => Promise" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.viewMode", - "type": "Object", - "tags": [], - "label": "viewMode", - "description": [], - "signature": [ - "{ source: ", - "Observable", - " | undefined; readonly value: ", - { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.ViewMode", - "text": "ViewMode" - }, - "; error: (err: any) => void; forEach: { (next: (value: ", - { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.ViewMode", - "text": "ViewMode" - }, - ") => void): Promise; (next: (value: ", - { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.ViewMode", - "text": "ViewMode" - }, - ") => void, promiseCtor: PromiseConstructorLike): Promise; }; complete: () => void; getValue: () => ", - { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.ViewMode", - "text": "ViewMode" - }, - "; closed: boolean; pipe: { (): ", - "Observable", - "<", - { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.ViewMode", - "text": "ViewMode" - }, - ">; (op1: ", - "OperatorFunction", - "<", - { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.ViewMode", - "text": "ViewMode" - }, - ", A>): ", - "Observable", - "; (op1: ", - "OperatorFunction", - "<", - { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.ViewMode", - "text": "ViewMode" - }, - ", A>, op2: ", - "OperatorFunction", - "): ", - "Observable", - "; (op1: ", - "OperatorFunction", - "<", - { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.ViewMode", - "text": "ViewMode" - }, - ", A>, op2: ", - "OperatorFunction", - ", op3: ", - "OperatorFunction", - "): ", - "Observable", - "; (op1: ", - "OperatorFunction", - "<", - { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.ViewMode", - "text": "ViewMode" - }, - ", A>, op2: ", - "OperatorFunction", - ", op3: ", - "OperatorFunction", - ", op4: ", - "OperatorFunction", - "): ", - "Observable", - "; (op1: ", - "OperatorFunction", - "<", + ", A>, op2: ", + "OperatorFunction", + ", op3: ", + "OperatorFunction", + ", op4: ", + "OperatorFunction", + "): ", + "Observable", + "; (op1: ", + "OperatorFunction", + "<", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -2215,44 +608,6 @@ "deprecated": false, "trackAdoption": false }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.parentApi", - "type": "CompoundType", - "tags": [], - "label": "parentApi", - "description": [], - "signature": [ - "(", - { - "pluginId": "@kbn/presentation-containers", - "scope": "public", - "docId": "kibKbnPresentationContainersPluginApi", - "section": "def-public.PresentationContainer", - "text": "PresentationContainer" - }, - " & Partial & ", - { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.PublishesViewMode", - "text": "PublishesViewMode" - }, - ">) | undefined" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false - }, { "parentPluginId": "embeddable", "id": "def-public.Embeddable.dataViews", @@ -5943,30 +4298,6 @@ "children": [], "returnComment": [] }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.getAppContext", - "type": "Function", - "tags": [], - "label": "getAppContext", - "description": [], - "signature": [ - "() => ", - { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.EmbeddableAppContext", - "text": "EmbeddableAppContext" - }, - " | undefined" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, { "parentPluginId": "embeddable", "id": "def-public.Embeddable.reportsEmbeddableLoad", @@ -5983,62 +4314,6 @@ "children": [], "returnComment": [] }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.refreshInputFromParent", - "type": "Function", - "tags": [], - "label": "refreshInputFromParent", - "description": [], - "signature": [ - "() => void" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.getIsContainer", - "type": "Function", - "tags": [], - "label": "getIsContainer", - "description": [], - "signature": [ - "() => this is ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - ">" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, { "parentPluginId": "embeddable", "id": "def-public.Embeddable.reload", @@ -6169,7 +4444,7 @@ "label": "getExplicitInput", "description": [], "signature": [ - "() => TEmbeddableInput" + "() => Readonly" ], "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", "deprecated": false, @@ -6185,7 +4460,7 @@ "label": "getPersistableInput", "description": [], "signature": [ - "() => TEmbeddableInput" + "() => Readonly" ], "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", "deprecated": false, @@ -6241,72 +4516,6 @@ "children": [], "returnComment": [] }, - { - "parentPluginId": "embeddable", - "id": "def-public.Embeddable.getRoot", - "type": "Function", - "tags": [], - "label": "getRoot", - "description": [ - "\nReturns the top most parent embeddable, or itself if this embeddable\nis not within a parent." - ], - "signature": [ - "() => ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IEmbeddable", - "text": "IEmbeddable" - }, - "<", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" - }, - ", ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" - }, - ", any> | ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - ">" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, { "parentPluginId": "embeddable", "id": "def-public.Embeddable.updateInput", @@ -7257,44 +5466,6 @@ "deprecated": false, "trackAdoption": false, "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.ErrorEmbeddable.Unnamed.$3", - "type": "Object", - "tags": [], - "label": "parent", - "description": [], - "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - "> | undefined" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/error_embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": false } ], "returnComment": [] @@ -7767,70 +5938,32 @@ "section": "def-public.IEmbeddable", "text": "IEmbeddable" }, - "<", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" - }, - ", LegacyOutput, any>" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/compatibility/embeddable_compatibility_utils.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.embeddableOutputToSubject.$3", - "type": "Uncategorized", - "tags": [], - "label": "key", - "description": [], - "signature": [ - "keyof LegacyOutput" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/compatibility/embeddable_compatibility_utils.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddablePanel", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "EmbeddablePanel", - "description": [], - "signature": [ - "(props: ", - "EmbeddablePanelProps", - ") => React.JSX.Element" - ], - "path": "src/plugins/embeddable/public/embeddable_panel/embeddable_panel.tsx", - "deprecated": true, - "trackAdoption": false, - "references": [], - "children": [ + "<", + { + "pluginId": "embeddable", + "scope": "common", + "docId": "kibEmbeddablePluginApi", + "section": "def-common.EmbeddableInput", + "text": "EmbeddableInput" + }, + ", LegacyOutput, any>" + ], + "path": "src/plugins/embeddable/public/lib/embeddables/compatibility/embeddable_compatibility_utils.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, { "parentPluginId": "embeddable", - "id": "def-public.EmbeddablePanel.$1", - "type": "CompoundType", + "id": "def-public.embeddableOutputToSubject.$3", + "type": "Uncategorized", "tags": [], - "label": "props", + "label": "key", "description": [], "signature": [ - "EmbeddablePanelProps" + "keyof LegacyOutput" ], - "path": "src/plugins/embeddable/public/embeddable_panel/embeddable_panel.tsx", + "path": "src/plugins/embeddable/public/lib/embeddables/compatibility/embeddable_compatibility_utils.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -9202,126 +7335,6 @@ ], "initialIsOpen": false }, - { - "parentPluginId": "embeddable", - "id": "def-public.ContainerInput", - "type": "Interface", - "tags": [], - "label": "ContainerInput", - "description": [], - "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - " extends ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" - } - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.ContainerInput.hidePanelTitles", - "type": "CompoundType", - "tags": [], - "label": "hidePanelTitles", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.ContainerInput.panels", - "type": "Object", - "tags": [], - "label": "panels", - "description": [], - "signature": [ - "{ [key: string]: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.PanelState", - "text": "PanelState" - }, - "; }" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.ContainerOutput", - "type": "Interface", - "tags": [], - "label": "ContainerOutput", - "description": [], - "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - " extends ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" - } - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.ContainerOutput.embeddableLoaded", - "type": "Object", - "tags": [], - "label": "embeddableLoaded", - "description": [], - "signature": [ - "{ [key: string]: boolean; }" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, { "parentPluginId": "embeddable", "id": "def-public.DefaultEmbeddableApi", @@ -9389,68 +7402,6 @@ "children": [], "initialIsOpen": false }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableContainerSettings", - "type": "Interface", - "tags": [], - "label": "EmbeddableContainerSettings", - "description": [], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableContainerSettings.initializeSequentially", - "type": "CompoundType", - "tags": [], - "label": "initializeSequentially", - "description": [ - "\nIf true, the container will wait for each embeddable to load after creation before loading the next embeddable." - ], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableContainerSettings.childIdInitializeOrder", - "type": "Array", - "tags": [], - "label": "childIdInitializeOrder", - "description": [ - "\nInitialise children in the order specified. If an ID does not match it will be skipped and if a child is not included it will be initialized in the default order after the list of provided IDs." - ], - "signature": [ - "string[] | undefined" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableContainerSettings.untilContainerInitialized", - "type": "Function", - "tags": [], - "label": "untilContainerInitialized", - "description": [], - "signature": [ - "(() => Promise) | undefined" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - } - ], - "initialIsOpen": false - }, { "parentPluginId": "embeddable", "id": "def-public.EmbeddableContext", @@ -9834,31 +7785,7 @@ "\nCan be used to request explicit input from the user, to be passed in to `EmbeddableFactory:create`.\nExplicit input is stored on the parent container for this embeddable. It overrides all inherited\ninput passed down from the parent container.\n\nCan be used to edit an embeddable by re-requesting explicit input. Initial input can be provided to allow the editor to show the current state.\n\nIf saved object information is needed for creation use-cases, getExplicitInput can also return an unknown typed attributes object which will be passed\ninto the container's addNewEmbeddable function." ], "signature": [ - "(initialInput?: Partial | undefined, parent?: ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - "> | undefined) => Promise<", + "(initialInput?: Partial | undefined, parent?: unknown) => Promise<", "ExplicitInputWithAttributes", " | Partial>" ], @@ -9884,40 +7811,17 @@ { "parentPluginId": "embeddable", "id": "def-public.EmbeddableFactory.getExplicitInput.$2", - "type": "Object", + "type": "Unknown", "tags": [], "label": "parent", "description": [], "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - "> | undefined" + "unknown" ], "path": "src/plugins/embeddable/public/lib/embeddables/embeddable_factory.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true } ], "returnComment": [] @@ -9932,31 +7836,7 @@ "\nCreates a new embeddable instance based off the saved object id." ], "signature": [ - "(savedObjectId: string, input: Partial, parent?: ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - "> | undefined) => Promise<", + "(savedObjectId: string, input: Partial, parent?: unknown) => Promise<", { "pluginId": "embeddable", "scope": "public", @@ -10005,40 +7885,17 @@ { "parentPluginId": "embeddable", "id": "def-public.EmbeddableFactory.createFromSavedObject.$3", - "type": "Object", + "type": "Unknown", "tags": [], "label": "parent", "description": [], "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - "> | undefined" + "unknown" ], "path": "src/plugins/embeddable/public/lib/embeddables/embeddable_factory.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true } ], "returnComment": [] @@ -10046,38 +7903,14 @@ { "parentPluginId": "embeddable", "id": "def-public.EmbeddableFactory.create", - "type": "Function", - "tags": [], - "label": "create", - "description": [ - "\nCreates an Embeddable instance, running the inital input through all registered migrations. Resolves to undefined if a new Embeddable\ncannot be directly created and the user will instead be redirected elsewhere." - ], - "signature": [ - "(initialInput: TEmbeddableInput, parent?: ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - "> | undefined) => Promise<", + "type": "Function", + "tags": [], + "label": "create", + "description": [ + "\nCreates an Embeddable instance, running the inital input through all registered migrations. Resolves to undefined if a new Embeddable\ncannot be directly created and the user will instead be redirected elsewhere." + ], + "signature": [ + "(initialInput: TEmbeddableInput, parent?: unknown) => Promise<", { "pluginId": "embeddable", "scope": "public", @@ -10109,40 +7942,17 @@ { "parentPluginId": "embeddable", "id": "def-public.EmbeddableFactory.create.$2", - "type": "Object", + "type": "Unknown", "tags": [], "label": "parent", "description": [], "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - "> | undefined" + "unknown" ], "path": "src/plugins/embeddable/public/lib/embeddables/embeddable_factory.ts", "deprecated": false, "trackAdoption": false, - "isRequired": false + "isRequired": true } ], "returnComment": [] @@ -10294,519 +8104,126 @@ { "parentPluginId": "embeddable", "id": "def-public.EmbeddableOutput.editPath", - "type": "string", - "tags": [], - "label": "editPath", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableOutput.defaultTitle", - "type": "string", - "tags": [], - "label": "defaultTitle", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableOutput.defaultDescription", - "type": "string", - "tags": [], - "label": "defaultDescription", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableOutput.title", - "type": "string", - "tags": [], - "label": "title", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableOutput.description", - "type": "string", - "tags": [], - "label": "description", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableOutput.editable", - "type": "CompoundType", - "tags": [], - "label": "editable", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableOutput.inlineEditable", - "type": "CompoundType", - "tags": [], - "label": "inlineEditable", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableOutput.editableWithExplicitInput", - "type": "CompoundType", - "tags": [], - "label": "editableWithExplicitInput", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableOutput.savedObjectId", - "type": "string", - "tags": [], - "label": "savedObjectId", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddablePackageState", - "type": "Interface", - "tags": [], - "label": "EmbeddablePackageState", - "description": [ - "\nA state package that contains all fields necessary to create or update an embeddable by reference or by value in a container." - ], - "path": "src/plugins/embeddable/public/lib/state_transfer/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddablePackageState.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "path": "src/plugins/embeddable/public/lib/state_transfer/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddablePackageState.input", - "type": "Uncategorized", - "tags": [], - "label": "input", - "description": [ - "\nFor react embeddables, this input must be runtime state." - ], - "signature": [ - "object" - ], - "path": "src/plugins/embeddable/public/lib/state_transfer/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddablePackageState.embeddableId", - "type": "string", - "tags": [], - "label": "embeddableId", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/embeddable/public/lib/state_transfer/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddablePackageState.size", - "type": "Object", - "tags": [], - "label": "size", - "description": [], - "signature": [ - "{ width?: number | undefined; height?: number | undefined; } | undefined" - ], - "path": "src/plugins/embeddable/public/lib/state_transfer/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddablePackageState.searchSessionId", - "type": "string", - "tags": [], - "label": "searchSessionId", - "description": [ - "\nPass current search session id when navigating to an editor,\nEditors could use it continue previous search session" - ], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/embeddable/public/lib/state_transfer/types.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableSetupDependencies", - "type": "Interface", - "tags": [], - "label": "EmbeddableSetupDependencies", - "description": [], - "path": "src/plugins/embeddable/public/plugin.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableSetupDependencies.uiActions", - "type": "Object", + "type": "string", "tags": [], - "label": "uiActions", + "label": "editPath", "description": [], "signature": [ - "{ readonly registerTrigger: (trigger: ", - { - "pluginId": "@kbn/ui-actions-browser", - "scope": "common", - "docId": "kibKbnUiActionsBrowserPluginApi", - "section": "def-common.Trigger", - "text": "Trigger" - }, - ") => void; readonly registerAction: (definition: ", - { - "pluginId": "uiActions", - "scope": "public", - "docId": "kibUiActionsPluginApi", - "section": "def-public.ActionDefinition", - "text": "ActionDefinition" - }, - ") => ", - { - "pluginId": "uiActions", - "scope": "public", - "docId": "kibUiActionsPluginApi", - "section": "def-public.Action", - "text": "Action" - }, - "; readonly unregisterAction: (actionId: string) => void; readonly attachAction: (triggerId: string, actionId: string) => void; readonly detachAction: (triggerId: string, actionId: string) => void; readonly addTriggerAction: (triggerId: string, action: ", - { - "pluginId": "uiActions", - "scope": "public", - "docId": "kibUiActionsPluginApi", - "section": "def-public.ActionDefinition", - "text": "ActionDefinition" - }, - ") => void; }" + "string | undefined" ], - "path": "src/plugins/embeddable/public/plugin.tsx", + "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", "deprecated": false, "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableStartDependencies", - "type": "Interface", - "tags": [], - "label": "EmbeddableStartDependencies", - "description": [], - "path": "src/plugins/embeddable/public/plugin.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ + }, { "parentPluginId": "embeddable", - "id": "def-public.EmbeddableStartDependencies.uiActions", - "type": "Object", + "id": "def-public.EmbeddableOutput.defaultTitle", + "type": "string", "tags": [], - "label": "uiActions", + "label": "defaultTitle", "description": [], "signature": [ - "{ readonly registerTrigger: (trigger: ", - { - "pluginId": "@kbn/ui-actions-browser", - "scope": "common", - "docId": "kibKbnUiActionsBrowserPluginApi", - "section": "def-common.Trigger", - "text": "Trigger" - }, - ") => void; readonly hasTrigger: (triggerId: string) => boolean; readonly getTrigger: (triggerId: string) => ", - "TriggerContract", - "; readonly registerAction: (definition: ", - { - "pluginId": "uiActions", - "scope": "public", - "docId": "kibUiActionsPluginApi", - "section": "def-public.ActionDefinition", - "text": "ActionDefinition" - }, - ") => ", - { - "pluginId": "uiActions", - "scope": "public", - "docId": "kibUiActionsPluginApi", - "section": "def-public.Action", - "text": "Action" - }, - "; readonly unregisterAction: (actionId: string) => void; readonly hasAction: (actionId: string) => boolean; readonly attachAction: (triggerId: string, actionId: string) => void; readonly detachAction: (triggerId: string, actionId: string) => void; readonly addTriggerAction: (triggerId: string, action: ", - { - "pluginId": "uiActions", - "scope": "public", - "docId": "kibUiActionsPluginApi", - "section": "def-public.ActionDefinition", - "text": "ActionDefinition" - }, - ") => void; readonly getAction: (id: string) => ", - { - "pluginId": "uiActions", - "scope": "public", - "docId": "kibUiActionsPluginApi", - "section": "def-public.Action", - "text": "Action" - }, - "; readonly getTriggerActions: (triggerId: string) => ", - { - "pluginId": "uiActions", - "scope": "public", - "docId": "kibUiActionsPluginApi", - "section": "def-public.Action", - "text": "Action" - }, - "[]; readonly getTriggerCompatibleActions: (triggerId: string, context: object) => Promise<", - { - "pluginId": "uiActions", - "scope": "public", - "docId": "kibUiActionsPluginApi", - "section": "def-public.Action", - "text": "Action" - }, - "[]>; readonly getFrequentlyChangingActionsForTrigger: (triggerId: string, context: object) => ", - { - "pluginId": "uiActions", - "scope": "public", - "docId": "kibUiActionsPluginApi", - "section": "def-public.FrequentCompatibilityChangeAction", - "text": "FrequentCompatibilityChangeAction" - }, - "[]; readonly executeTriggerActions: (triggerId: string, context: object) => Promise; readonly clear: () => void; readonly fork: () => ", - { - "pluginId": "uiActions", - "scope": "public", - "docId": "kibUiActionsPluginApi", - "section": "def-public.UiActionsService", - "text": "UiActionsService" - }, - "; }" + "string | undefined" ], - "path": "src/plugins/embeddable/public/plugin.tsx", + "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "embeddable", - "id": "def-public.EmbeddableStartDependencies.inspector", - "type": "Object", + "id": "def-public.EmbeddableOutput.defaultDescription", + "type": "string", "tags": [], - "label": "inspector", + "label": "defaultDescription", "description": [], "signature": [ - { - "pluginId": "inspector", - "scope": "public", - "docId": "kibInspectorPluginApi", - "section": "def-public.Start", - "text": "Start" - } + "string | undefined" ], - "path": "src/plugins/embeddable/public/plugin.tsx", + "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "embeddable", - "id": "def-public.EmbeddableStartDependencies.usageCollection", - "type": "Object", + "id": "def-public.EmbeddableOutput.title", + "type": "string", "tags": [], - "label": "usageCollection", + "label": "title", "description": [], "signature": [ - { - "pluginId": "usageCollection", - "scope": "public", - "docId": "kibUsageCollectionPluginApi", - "section": "def-public.UsageCollectionStart", - "text": "UsageCollectionStart" - } + "string | undefined" ], - "path": "src/plugins/embeddable/public/plugin.tsx", + "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "embeddable", - "id": "def-public.EmbeddableStartDependencies.contentManagement", - "type": "Object", + "id": "def-public.EmbeddableOutput.description", + "type": "string", "tags": [], - "label": "contentManagement", + "label": "description", "description": [], "signature": [ - { - "pluginId": "contentManagement", - "scope": "public", - "docId": "kibContentManagementPluginApi", - "section": "def-public.ContentManagementPublicStart", - "text": "ContentManagementPublicStart" - } + "string | undefined" ], - "path": "src/plugins/embeddable/public/plugin.tsx", + "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "embeddable", - "id": "def-public.EmbeddableStartDependencies.savedObjectsManagement", - "type": "Object", + "id": "def-public.EmbeddableOutput.editable", + "type": "CompoundType", "tags": [], - "label": "savedObjectsManagement", + "label": "editable", "description": [], "signature": [ - { - "pluginId": "savedObjectsManagement", - "scope": "public", - "docId": "kibSavedObjectsManagementPluginApi", - "section": "def-public.SavedObjectsManagementPluginStart", - "text": "SavedObjectsManagementPluginStart" - } + "boolean | undefined" ], - "path": "src/plugins/embeddable/public/plugin.tsx", + "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "embeddable", - "id": "def-public.EmbeddableStartDependencies.savedObjectsTaggingOss", - "type": "Object", + "id": "def-public.EmbeddableOutput.inlineEditable", + "type": "CompoundType", "tags": [], - "label": "savedObjectsTaggingOss", + "label": "inlineEditable", "description": [], "signature": [ - { - "pluginId": "savedObjectsTaggingOss", - "scope": "public", - "docId": "kibSavedObjectsTaggingOssPluginApi", - "section": "def-public.SavedObjectTaggingOssPluginStart", - "text": "SavedObjectTaggingOssPluginStart" - }, - " | undefined" + "boolean | undefined" ], - "path": "src/plugins/embeddable/public/plugin.tsx", + "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", "deprecated": false, "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EnhancementRegistryDefinition", - "type": "Interface", - "tags": [], - "label": "EnhancementRegistryDefinition", - "description": [], - "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EnhancementRegistryDefinition", - "text": "EnhancementRegistryDefinition" }, - "

extends Partial<", { - "pluginId": "kibanaUtils", - "scope": "common", - "docId": "kibKibanaUtilsPluginApi", - "section": "def-common.PersistableState", - "text": "PersistableState" + "parentPluginId": "embeddable", + "id": "def-public.EmbeddableOutput.editableWithExplicitInput", + "type": "CompoundType", + "tags": [], + "label": "editableWithExplicitInput", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", + "deprecated": false, + "trackAdoption": false }, - "

>" - ], - "path": "src/plugins/embeddable/public/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ { "parentPluginId": "embeddable", - "id": "def-public.EnhancementRegistryDefinition.id", + "id": "def-public.EmbeddableOutput.savedObjectId", "type": "string", "tags": [], - "label": "id", + "label": "savedObjectId", "description": [], - "path": "src/plugins/embeddable/public/types.ts", + "signature": [ + "string | undefined" + ], + "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", "deprecated": false, "trackAdoption": false } @@ -10815,717 +8232,468 @@ }, { "parentPluginId": "embeddable", - "id": "def-public.FilterableEmbeddable", + "id": "def-public.EmbeddablePackageState", "type": "Interface", "tags": [], - "label": "FilterableEmbeddable", + "label": "EmbeddablePackageState", "description": [ - "\nAll embeddables that implement this interface should support being filtered\nand/or queried via the top navigation bar." + "\nA state package that contains all fields necessary to create or update an embeddable by reference or by value in a container." ], - "path": "src/plugins/embeddable/public/lib/filterable_embeddable/types.ts", + "path": "src/plugins/embeddable/public/lib/state_transfer/types.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "embeddable", - "id": "def-public.FilterableEmbeddable.getFilters", - "type": "Function", + "id": "def-public.EmbeddablePackageState.type", + "type": "string", "tags": [], - "label": "getFilters", - "description": [ - "\nGets the embeddable's local filters" - ], - "signature": [ - "() => ", - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Filter", - "text": "Filter" - }, - "[]" - ], - "path": "src/plugins/embeddable/public/lib/filterable_embeddable/types.ts", + "label": "type", + "description": [], + "path": "src/plugins/embeddable/public/lib/state_transfer/types.ts", "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] + "trackAdoption": false }, { "parentPluginId": "embeddable", - "id": "def-public.FilterableEmbeddable.getQuery", - "type": "Function", + "id": "def-public.EmbeddablePackageState.input", + "type": "Uncategorized", "tags": [], - "label": "getQuery", + "label": "input", "description": [ - "\nGets the embeddable's local query" + "\nFor react embeddables, this input must be runtime state." ], "signature": [ - "() => ", - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Query", - "text": "Query" - }, - " | ", - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.AggregateQuery", - "text": "AggregateQuery" - }, - " | undefined" + "object" ], - "path": "src/plugins/embeddable/public/lib/filterable_embeddable/types.ts", + "path": "src/plugins/embeddable/public/lib/state_transfer/types.ts", "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.IContainer", - "type": "Interface", - "tags": [], - "label": "IContainer", - "description": [], - "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - " extends ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IEmbeddable", - "text": "IEmbeddable" + "trackAdoption": false }, - "" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ { "parentPluginId": "embeddable", - "id": "def-public.IContainer.untilEmbeddableLoaded", - "type": "Function", + "id": "def-public.EmbeddablePackageState.embeddableId", + "type": "string", "tags": [], - "label": "untilEmbeddableLoaded", - "description": [ - "\nCall if you want to wait until an embeddable with that id has finished loading." - ], + "label": "embeddableId", + "description": [], "signature": [ - ">(id: string) => Promise<", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ErrorEmbeddable", - "text": "ErrorEmbeddable" - }, - " | TEmbeddable>" + "string | undefined" ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", + "path": "src/plugins/embeddable/public/lib/state_transfer/types.ts", "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.IContainer.untilEmbeddableLoaded.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] + "trackAdoption": false }, { "parentPluginId": "embeddable", - "id": "def-public.IContainer.getInputForChild", - "type": "Function", + "id": "def-public.EmbeddablePackageState.size", + "type": "Object", "tags": [], - "label": "getInputForChild", - "description": [ - "\nReturns the input for the given child. Uses a combination of explicit input\nfor the child stored on the parent and derived/inherited input taken from the\ncontainer itself." - ], + "label": "size", + "description": [], "signature": [ - "(id: string) => EEI" + "{ width?: number | undefined; height?: number | undefined; } | undefined" ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", + "path": "src/plugins/embeddable/public/lib/state_transfer/types.ts", "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.IContainer.getInputForChild.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] + "trackAdoption": false }, { "parentPluginId": "embeddable", - "id": "def-public.IContainer.updateInputForChild", - "type": "Function", + "id": "def-public.EmbeddablePackageState.searchSessionId", + "type": "string", "tags": [], - "label": "updateInputForChild", + "label": "searchSessionId", "description": [ - "\nChanges the input for a given child. Note, this will override all inherited state taken from\nthe container itself." + "\nPass current search session id when navigating to an editor,\nEditors could use it continue previous search session" ], "signature": [ - "(id: string, changes: Partial) => void" + "string | undefined" ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", + "path": "src/plugins/embeddable/public/lib/state_transfer/types.ts", "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.IContainer.updateInputForChild.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.IContainer.updateInputForChild.$2", - "type": "Object", - "tags": [], - "label": "changes", - "description": [], - "signature": [ - "Partial" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "embeddable", + "id": "def-public.EmbeddableSetupDependencies", + "type": "Interface", + "tags": [], + "label": "EmbeddableSetupDependencies", + "description": [], + "path": "src/plugins/embeddable/public/plugin.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "embeddable", - "id": "def-public.IContainer.getChild", - "type": "Function", + "id": "def-public.EmbeddableSetupDependencies.uiActions", + "type": "Object", "tags": [], - "label": "getChild", - "description": [ - "\nReturns the child embeddable with the given id." - ], + "label": "uiActions", + "description": [], "signature": [ - " void; readonly registerAction: (definition: ", { - "pluginId": "embeddable", + "pluginId": "uiActions", "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" + "docId": "kibUiActionsPluginApi", + "section": "def-public.ActionDefinition", + "text": "ActionDefinition" }, - ", any> = ", + ") => ", { - "pluginId": "embeddable", + "pluginId": "uiActions", "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.Embeddable", - "text": "Embeddable" - }, - "<", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" + "docId": "kibUiActionsPluginApi", + "section": "def-public.Action", + "text": "Action" }, - ", ", + "; readonly unregisterAction: (actionId: string) => void; readonly attachAction: (triggerId: string, actionId: string) => void; readonly detachAction: (triggerId: string, actionId: string) => void; readonly addTriggerAction: (triggerId: string, action: ", { - "pluginId": "embeddable", + "pluginId": "uiActions", "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" + "docId": "kibUiActionsPluginApi", + "section": "def-public.ActionDefinition", + "text": "ActionDefinition" }, - ", any>>(id: string) => E" + ") => void; }" ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", + "path": "src/plugins/embeddable/public/plugin.tsx", "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.IContainer.getChild.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "embeddable", + "id": "def-public.EmbeddableStartDependencies", + "type": "Interface", + "tags": [], + "label": "EmbeddableStartDependencies", + "description": [], + "path": "src/plugins/embeddable/public/plugin.tsx", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "embeddable", - "id": "def-public.IContainer.setChildLoaded", - "type": "Function", + "id": "def-public.EmbeddableStartDependencies.uiActions", + "type": "Object", "tags": [], - "label": "setChildLoaded", - "description": [ - "\nEmbeddables which have deferEmbeddableLoad set to true need to manually call setChildLoaded\non their parent container to communicate when they have finished loading." - ], + "label": "uiActions", + "description": [], "signature": [ - " void; readonly hasTrigger: (triggerId: string) => boolean; readonly getTrigger: (triggerId: string) => ", + "TriggerContract", + "; readonly registerAction: (definition: ", + { + "pluginId": "uiActions", "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IEmbeddable", - "text": "IEmbeddable" + "docId": "kibUiActionsPluginApi", + "section": "def-public.ActionDefinition", + "text": "ActionDefinition" }, - "<", + ") => ", { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" + "pluginId": "uiActions", + "scope": "public", + "docId": "kibUiActionsPluginApi", + "section": "def-public.Action", + "text": "Action" }, - ", ", + "; readonly unregisterAction: (actionId: string) => void; readonly hasAction: (actionId: string) => boolean; readonly attachAction: (triggerId: string, actionId: string) => void; readonly detachAction: (triggerId: string, actionId: string) => void; readonly addTriggerAction: (triggerId: string, action: ", { - "pluginId": "embeddable", + "pluginId": "uiActions", "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" + "docId": "kibUiActionsPluginApi", + "section": "def-public.ActionDefinition", + "text": "ActionDefinition" }, - ", any> = ", + ") => void; readonly getAction: (id: string) => ", { - "pluginId": "embeddable", + "pluginId": "uiActions", "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IEmbeddable", - "text": "IEmbeddable" + "docId": "kibUiActionsPluginApi", + "section": "def-public.Action", + "text": "Action" }, - "<", + "; readonly getTriggerActions: (triggerId: string) => ", { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" + "pluginId": "uiActions", + "scope": "public", + "docId": "kibUiActionsPluginApi", + "section": "def-public.Action", + "text": "Action" }, - ", ", + "[]; readonly getTriggerCompatibleActions: (triggerId: string, context: object) => Promise<", { - "pluginId": "embeddable", + "pluginId": "uiActions", "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" + "docId": "kibUiActionsPluginApi", + "section": "def-public.Action", + "text": "Action" + }, + "[]>; readonly getFrequentlyChangingActionsForTrigger: (triggerId: string, context: object) => ", + { + "pluginId": "uiActions", + "scope": "public", + "docId": "kibUiActionsPluginApi", + "section": "def-public.FrequentCompatibilityChangeAction", + "text": "FrequentCompatibilityChangeAction" + }, + "[]; readonly executeTriggerActions: (triggerId: string, context: object) => Promise; readonly clear: () => void; readonly fork: () => ", + { + "pluginId": "uiActions", + "scope": "public", + "docId": "kibUiActionsPluginApi", + "section": "def-public.UiActionsService", + "text": "UiActionsService" }, - ", any>>(embeddable: E) => void" + "; }" ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", + "path": "src/plugins/embeddable/public/plugin.tsx", "deprecated": false, - "trackAdoption": false, - "children": [ + "trackAdoption": false + }, + { + "parentPluginId": "embeddable", + "id": "def-public.EmbeddableStartDependencies.inspector", + "type": "Object", + "tags": [], + "label": "inspector", + "description": [], + "signature": [ { - "parentPluginId": "embeddable", - "id": "def-public.IContainer.setChildLoaded.$1", - "type": "Uncategorized", - "tags": [], - "label": "embeddable", - "description": [ - "- the embeddable to set" - ], - "signature": [ - "E" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true + "pluginId": "inspector", + "scope": "public", + "docId": "kibInspectorPluginApi", + "section": "def-public.Start", + "text": "Start" } ], - "returnComment": [] + "path": "src/plugins/embeddable/public/plugin.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "embeddable", + "id": "def-public.EmbeddableStartDependencies.usageCollection", + "type": "Object", + "tags": [], + "label": "usageCollection", + "description": [], + "signature": [ + { + "pluginId": "usageCollection", + "scope": "public", + "docId": "kibUsageCollectionPluginApi", + "section": "def-public.UsageCollectionStart", + "text": "UsageCollectionStart" + } + ], + "path": "src/plugins/embeddable/public/plugin.tsx", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "embeddable", + "id": "def-public.EmbeddableStartDependencies.contentManagement", + "type": "Object", + "tags": [], + "label": "contentManagement", + "description": [], + "signature": [ + { + "pluginId": "contentManagement", + "scope": "public", + "docId": "kibContentManagementPluginApi", + "section": "def-public.ContentManagementPublicStart", + "text": "ContentManagementPublicStart" + } + ], + "path": "src/plugins/embeddable/public/plugin.tsx", + "deprecated": false, + "trackAdoption": false }, { "parentPluginId": "embeddable", - "id": "def-public.IContainer.removeEmbeddable", - "type": "Function", + "id": "def-public.EmbeddableStartDependencies.savedObjectsManagement", + "type": "Object", "tags": [], - "label": "removeEmbeddable", - "description": [ - "\nRemoves the embeddable with the given id." - ], + "label": "savedObjectsManagement", + "description": [], "signature": [ - "(embeddableId: string) => void" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ { - "parentPluginId": "embeddable", - "id": "def-public.IContainer.removeEmbeddable.$1", - "type": "string", - "tags": [], - "label": "embeddableId", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true + "pluginId": "savedObjectsManagement", + "scope": "public", + "docId": "kibSavedObjectsManagementPluginApi", + "section": "def-public.SavedObjectsManagementPluginStart", + "text": "SavedObjectsManagementPluginStart" } ], - "returnComment": [] + "path": "src/plugins/embeddable/public/plugin.tsx", + "deprecated": false, + "trackAdoption": false }, { "parentPluginId": "embeddable", - "id": "def-public.IContainer.addNewEmbeddable", - "type": "Function", + "id": "def-public.EmbeddableStartDependencies.savedObjectsTaggingOss", + "type": "Object", "tags": [], - "label": "addNewEmbeddable", - "description": [ - "\nAdds a new embeddable to the container. `explicitInput` may partially specify the required embeddable input,\nbut the remainder must come from inherited container state." - ], + "label": "savedObjectsTaggingOss", + "description": [], "signature": [ - " = ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.Embeddable", - "text": "Embeddable" - }, - ">(type: string, explicitInput: Partial, attributes?: unknown) => Promise<", { - "pluginId": "embeddable", + "pluginId": "savedObjectsTaggingOss", "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ErrorEmbeddable", - "text": "ErrorEmbeddable" + "docId": "kibSavedObjectsTaggingOssPluginApi", + "section": "def-public.SavedObjectTaggingOssPluginStart", + "text": "SavedObjectTaggingOssPluginStart" }, - " | E>" + " | undefined" ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", + "path": "src/plugins/embeddable/public/plugin.tsx", "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.IContainer.addNewEmbeddable.$1", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.IContainer.addNewEmbeddable.$2", - "type": "Object", - "tags": [], - "label": "explicitInput", - "description": [], - "signature": [ - "Partial" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.IContainer.addNewEmbeddable.$3", - "type": "Unknown", - "tags": [], - "label": "attributes", - "description": [], - "signature": [ - "unknown" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "embeddable", + "id": "def-public.EnhancementRegistryDefinition", + "type": "Interface", + "tags": [], + "label": "EnhancementRegistryDefinition", + "description": [], + "signature": [ + { + "pluginId": "embeddable", + "scope": "public", + "docId": "kibEmbeddablePluginApi", + "section": "def-public.EnhancementRegistryDefinition", + "text": "EnhancementRegistryDefinition" + }, + "

extends Partial<", + { + "pluginId": "kibanaUtils", + "scope": "common", + "docId": "kibKibanaUtilsPluginApi", + "section": "def-common.PersistableState", + "text": "PersistableState" }, + "

>" + ], + "path": "src/plugins/embeddable/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ { "parentPluginId": "embeddable", - "id": "def-public.IContainer.replaceEmbeddable", - "type": "Function", + "id": "def-public.EnhancementRegistryDefinition.id", + "type": "string", "tags": [], - "label": "replaceEmbeddable", + "label": "id", "description": [], + "path": "src/plugins/embeddable/public/types.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "embeddable", + "id": "def-public.FilterableEmbeddable", + "type": "Interface", + "tags": [], + "label": "FilterableEmbeddable", + "description": [ + "\nAll embeddables that implement this interface should support being filtered\nand/or queried via the top navigation bar." + ], + "path": "src/plugins/embeddable/public/lib/filterable_embeddable/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "embeddable", + "id": "def-public.FilterableEmbeddable.getFilters", + "type": "Function", + "tags": [], + "label": "getFilters", + "description": [ + "\nGets the embeddable's local filters" + ], "signature": [ - " ", { - "pluginId": "embeddable", + "pluginId": "@kbn/es-query", "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" - }, - ", EEO extends ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" - }, - " = ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" - }, - ", E extends ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.Embeddable", - "text": "Embeddable" - }, - " = ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.Embeddable", - "text": "Embeddable" + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" }, - ">(id: string, newExplicitInput: Partial, newType?: string | undefined, generateNewId?: boolean | undefined) => Promise" + "[]" ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", + "path": "src/plugins/embeddable/public/lib/filterable_embeddable/types.ts", "deprecated": false, "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.IContainer.replaceEmbeddable.$1", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "embeddable", + "id": "def-public.FilterableEmbeddable.getQuery", + "type": "Function", + "tags": [], + "label": "getQuery", + "description": [ + "\nGets the embeddable's local query" + ], + "signature": [ + "() => ", { - "parentPluginId": "embeddable", - "id": "def-public.IContainer.replaceEmbeddable.$2", - "type": "Object", - "tags": [], - "label": "newExplicitInput", - "description": [], - "signature": [ - "Partial" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Query", + "text": "Query" }, + " | ", { - "parentPluginId": "embeddable", - "id": "def-public.IContainer.replaceEmbeddable.$3", - "type": "string", - "tags": [], - "label": "newType", - "description": [], - "signature": [ - "string | undefined" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.AggregateQuery", + "text": "AggregateQuery" }, - { - "parentPluginId": "embeddable", - "id": "def-public.IContainer.replaceEmbeddable.$4", - "type": "CompoundType", - "tags": [], - "label": "generateNewId", - "description": [], - "signature": [ - "boolean | undefined" - ], - "path": "src/plugins/embeddable/public/lib/containers/i_container.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - } + " | undefined" ], + "path": "src/plugins/embeddable/public/lib/filterable_embeddable/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], "returnComment": [] } ], @@ -11553,58 +8721,6 @@ "deprecated": false, "trackAdoption": false, "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.IEmbeddable.isContainer", - "type": "boolean", - "tags": [], - "label": "isContainer", - "description": [ - "\nIs this embeddable an instance of a Container class, can it contain\nnested embeddables?" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.IEmbeddable.parent", - "type": "Object", - "tags": [], - "label": "parent", - "description": [ - "\nIf this embeddable is nested inside a container, this will contain\na reference to its parent." - ], - "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - "> | undefined" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", - "deprecated": false, - "trackAdoption": false - }, { "parentPluginId": "embeddable", "id": "def-public.IEmbeddable.type", @@ -11710,48 +8826,6 @@ "children": [], "returnComment": [] }, - { - "parentPluginId": "embeddable", - "id": "def-public.IEmbeddable.getIsContainer", - "type": "Function", - "tags": [], - "label": "getIsContainer", - "description": [ - "\nA functional representation of the isContainer variable, but helpful for typescript to\nknow the shape if this returns true" - ], - "signature": [ - "() => this is ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - ">" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, { "parentPluginId": "embeddable", "id": "def-public.IEmbeddable.getInput", @@ -11968,98 +9042,6 @@ "children": [], "returnComment": [] }, - { - "parentPluginId": "embeddable", - "id": "def-public.IEmbeddable.getRoot", - "type": "Function", - "tags": [], - "label": "getRoot", - "description": [ - "\nReturns the top most parent embeddable, or itself if this embeddable\nis not within a parent." - ], - "signature": [ - "() => ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IEmbeddable", - "text": "IEmbeddable" - }, - "<", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" - }, - ", ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" - }, - ", any> | ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - ">" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.IEmbeddable.getAppContext", - "type": "Function", - "tags": [], - "label": "getAppContext", - "description": [ - "\nReturns the context of this embeddable's container, or undefined." - ], - "signature": [ - "() => ", - { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.EmbeddableAppContext", - "text": "EmbeddableAppContext" - }, - " | undefined" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, { "parentPluginId": "embeddable", "id": "def-public.IEmbeddable.render", @@ -12279,22 +9261,6 @@ ], "returnComment": [] }, - { - "parentPluginId": "embeddable", - "id": "def-public.IEmbeddable.refreshInputFromParent", - "type": "Function", - "tags": [], - "label": "refreshInputFromParent", - "description": [], - "signature": [ - "() => void" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, { "parentPluginId": "embeddable", "id": "def-public.IEmbeddable.untilInitializationFinished", @@ -12349,55 +9315,6 @@ ], "initialIsOpen": false }, - { - "parentPluginId": "embeddable", - "id": "def-public.PanelState", - "type": "Interface", - "tags": [], - "label": "PanelState", - "description": [], - "signature": [ - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.PanelState", - "text": "PanelState" - }, - "" - ], - "path": "src/plugins/embeddable/common/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.PanelState.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "path": "src/plugins/embeddable/common/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.PanelState.explicitInput", - "type": "CompoundType", - "tags": [], - "label": "explicitInput", - "description": [], - "signature": [ - "Partial & { id: string; }" - ], - "path": "src/plugins/embeddable/common/types.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, { "parentPluginId": "embeddable", "id": "def-public.PropertySpec", diff --git a/api_docs/embeddable.mdx b/api_docs/embeddable.mdx index 0f2fb753635a4..3cc6e936a3da4 100644 --- a/api_docs/embeddable.mdx +++ b/api_docs/embeddable.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/embeddable title: "embeddable" image: https://source.unsplash.com/400x175/?github description: API docs for the embeddable plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddable'] --- import embeddableObj from './embeddable.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kib | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 537 | 1 | 433 | 6 | +| 424 | 1 | 338 | 5 | ## Client diff --git a/api_docs/embeddable_enhanced.mdx b/api_docs/embeddable_enhanced.mdx index 137b156f36101..f4595abd70200 100644 --- a/api_docs/embeddable_enhanced.mdx +++ b/api_docs/embeddable_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/embeddableEnhanced title: "embeddableEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the embeddableEnhanced plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddableEnhanced'] --- import embeddableEnhancedObj from './embeddable_enhanced.devdocs.json'; diff --git a/api_docs/encrypted_saved_objects.mdx b/api_docs/encrypted_saved_objects.mdx index 8fca78ccf8a37..7c0105c577cb7 100644 --- a/api_docs/encrypted_saved_objects.mdx +++ b/api_docs/encrypted_saved_objects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/encryptedSavedObjects title: "encryptedSavedObjects" image: https://source.unsplash.com/400x175/?github description: API docs for the encryptedSavedObjects plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'encryptedSavedObjects'] --- import encryptedSavedObjectsObj from './encrypted_saved_objects.devdocs.json'; diff --git a/api_docs/enterprise_search.mdx b/api_docs/enterprise_search.mdx index 6f4d5c7434713..9c6e1f4fddb56 100644 --- a/api_docs/enterprise_search.mdx +++ b/api_docs/enterprise_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/enterpriseSearch title: "enterpriseSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the enterpriseSearch plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'enterpriseSearch'] --- import enterpriseSearchObj from './enterprise_search.devdocs.json'; diff --git a/api_docs/entities_data_access.mdx b/api_docs/entities_data_access.mdx index 3c6613b0de680..099680703bb4c 100644 --- a/api_docs/entities_data_access.mdx +++ b/api_docs/entities_data_access.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/entitiesDataAccess title: "entitiesDataAccess" image: https://source.unsplash.com/400x175/?github description: API docs for the entitiesDataAccess plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'entitiesDataAccess'] --- import entitiesDataAccessObj from './entities_data_access.devdocs.json'; diff --git a/api_docs/entity_manager.mdx b/api_docs/entity_manager.mdx index 2951c9b82af8e..2a280ffd278cb 100644 --- a/api_docs/entity_manager.mdx +++ b/api_docs/entity_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/entityManager title: "entityManager" image: https://source.unsplash.com/400x175/?github description: API docs for the entityManager plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'entityManager'] --- import entityManagerObj from './entity_manager.devdocs.json'; diff --git a/api_docs/es_ui_shared.mdx b/api_docs/es_ui_shared.mdx index 1046334f68870..5a18bc3b3e862 100644 --- a/api_docs/es_ui_shared.mdx +++ b/api_docs/es_ui_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/esUiShared title: "esUiShared" image: https://source.unsplash.com/400x175/?github description: API docs for the esUiShared plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esUiShared'] --- import esUiSharedObj from './es_ui_shared.devdocs.json'; diff --git a/api_docs/esql.mdx b/api_docs/esql.mdx index add769b87b47c..ca72280960b27 100644 --- a/api_docs/esql.mdx +++ b/api_docs/esql.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/esql title: "esql" image: https://source.unsplash.com/400x175/?github description: API docs for the esql plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esql'] --- import esqlObj from './esql.devdocs.json'; diff --git a/api_docs/esql_data_grid.mdx b/api_docs/esql_data_grid.mdx index f29fe2c4f42d3..55078d4efbb03 100644 --- a/api_docs/esql_data_grid.mdx +++ b/api_docs/esql_data_grid.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/esqlDataGrid title: "esqlDataGrid" image: https://source.unsplash.com/400x175/?github description: API docs for the esqlDataGrid plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esqlDataGrid'] --- import esqlDataGridObj from './esql_data_grid.devdocs.json'; diff --git a/api_docs/event_annotation.mdx b/api_docs/event_annotation.mdx index 85d95b75fffc7..b2a70729e8e5e 100644 --- a/api_docs/event_annotation.mdx +++ b/api_docs/event_annotation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventAnnotation title: "eventAnnotation" image: https://source.unsplash.com/400x175/?github description: API docs for the eventAnnotation plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventAnnotation'] --- import eventAnnotationObj from './event_annotation.devdocs.json'; diff --git a/api_docs/event_annotation_listing.mdx b/api_docs/event_annotation_listing.mdx index 55f1787d13014..04f489a4ad73d 100644 --- a/api_docs/event_annotation_listing.mdx +++ b/api_docs/event_annotation_listing.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventAnnotationListing title: "eventAnnotationListing" image: https://source.unsplash.com/400x175/?github description: API docs for the eventAnnotationListing plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventAnnotationListing'] --- import eventAnnotationListingObj from './event_annotation_listing.devdocs.json'; diff --git a/api_docs/event_log.mdx b/api_docs/event_log.mdx index 7b7c0f6918ddf..e46b55e6125f3 100644 --- a/api_docs/event_log.mdx +++ b/api_docs/event_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/eventLog title: "eventLog" image: https://source.unsplash.com/400x175/?github description: API docs for the eventLog plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventLog'] --- import eventLogObj from './event_log.devdocs.json'; diff --git a/api_docs/exploratory_view.mdx b/api_docs/exploratory_view.mdx index da1e74b9fff3b..c8434605c639f 100644 --- a/api_docs/exploratory_view.mdx +++ b/api_docs/exploratory_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/exploratoryView title: "exploratoryView" image: https://source.unsplash.com/400x175/?github description: API docs for the exploratoryView plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'exploratoryView'] --- import exploratoryViewObj from './exploratory_view.devdocs.json'; diff --git a/api_docs/expression_error.mdx b/api_docs/expression_error.mdx index e716898f42d44..d4da404bb9d33 100644 --- a/api_docs/expression_error.mdx +++ b/api_docs/expression_error.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionError title: "expressionError" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionError plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionError'] --- import expressionErrorObj from './expression_error.devdocs.json'; diff --git a/api_docs/expression_gauge.mdx b/api_docs/expression_gauge.mdx index a79744ee20c35..3b786fe7ef88e 100644 --- a/api_docs/expression_gauge.mdx +++ b/api_docs/expression_gauge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionGauge title: "expressionGauge" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionGauge plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionGauge'] --- import expressionGaugeObj from './expression_gauge.devdocs.json'; diff --git a/api_docs/expression_heatmap.mdx b/api_docs/expression_heatmap.mdx index aacf202bf22fd..4dbac1bef33c9 100644 --- a/api_docs/expression_heatmap.mdx +++ b/api_docs/expression_heatmap.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionHeatmap title: "expressionHeatmap" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionHeatmap plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionHeatmap'] --- import expressionHeatmapObj from './expression_heatmap.devdocs.json'; diff --git a/api_docs/expression_image.mdx b/api_docs/expression_image.mdx index 414ec6525fbae..7817849362790 100644 --- a/api_docs/expression_image.mdx +++ b/api_docs/expression_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionImage title: "expressionImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionImage plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionImage'] --- import expressionImageObj from './expression_image.devdocs.json'; diff --git a/api_docs/expression_legacy_metric_vis.mdx b/api_docs/expression_legacy_metric_vis.mdx index 6de78982c3c5c..77e998d0b775e 100644 --- a/api_docs/expression_legacy_metric_vis.mdx +++ b/api_docs/expression_legacy_metric_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionLegacyMetricVis title: "expressionLegacyMetricVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionLegacyMetricVis plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionLegacyMetricVis'] --- import expressionLegacyMetricVisObj from './expression_legacy_metric_vis.devdocs.json'; diff --git a/api_docs/expression_metric.mdx b/api_docs/expression_metric.mdx index 47bb96a1d969d..fa52bfc687d74 100644 --- a/api_docs/expression_metric.mdx +++ b/api_docs/expression_metric.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionMetric title: "expressionMetric" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionMetric plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetric'] --- import expressionMetricObj from './expression_metric.devdocs.json'; diff --git a/api_docs/expression_metric_vis.mdx b/api_docs/expression_metric_vis.mdx index 3cf2085bb7c5e..d076a70787c17 100644 --- a/api_docs/expression_metric_vis.mdx +++ b/api_docs/expression_metric_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionMetricVis title: "expressionMetricVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionMetricVis plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetricVis'] --- import expressionMetricVisObj from './expression_metric_vis.devdocs.json'; diff --git a/api_docs/expression_partition_vis.mdx b/api_docs/expression_partition_vis.mdx index 02223bfbbb73c..303172c4daac8 100644 --- a/api_docs/expression_partition_vis.mdx +++ b/api_docs/expression_partition_vis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionPartitionVis title: "expressionPartitionVis" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionPartitionVis plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionPartitionVis'] --- import expressionPartitionVisObj from './expression_partition_vis.devdocs.json'; diff --git a/api_docs/expression_repeat_image.mdx b/api_docs/expression_repeat_image.mdx index 37315e0cfe455..9bddffc83a47b 100644 --- a/api_docs/expression_repeat_image.mdx +++ b/api_docs/expression_repeat_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionRepeatImage title: "expressionRepeatImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionRepeatImage plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRepeatImage'] --- import expressionRepeatImageObj from './expression_repeat_image.devdocs.json'; diff --git a/api_docs/expression_reveal_image.mdx b/api_docs/expression_reveal_image.mdx index 42cefbfb88902..7a4532da0500b 100644 --- a/api_docs/expression_reveal_image.mdx +++ b/api_docs/expression_reveal_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionRevealImage title: "expressionRevealImage" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionRevealImage plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRevealImage'] --- import expressionRevealImageObj from './expression_reveal_image.devdocs.json'; diff --git a/api_docs/expression_shape.mdx b/api_docs/expression_shape.mdx index 5be97921f52b5..f88a764e35eb9 100644 --- a/api_docs/expression_shape.mdx +++ b/api_docs/expression_shape.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionShape title: "expressionShape" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionShape plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionShape'] --- import expressionShapeObj from './expression_shape.devdocs.json'; diff --git a/api_docs/expression_tagcloud.mdx b/api_docs/expression_tagcloud.mdx index 87d933b0b8212..b8c73b5caacd5 100644 --- a/api_docs/expression_tagcloud.mdx +++ b/api_docs/expression_tagcloud.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionTagcloud title: "expressionTagcloud" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionTagcloud plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionTagcloud'] --- import expressionTagcloudObj from './expression_tagcloud.devdocs.json'; diff --git a/api_docs/expression_x_y.mdx b/api_docs/expression_x_y.mdx index ef05c970881e2..6d01b972dc9b2 100644 --- a/api_docs/expression_x_y.mdx +++ b/api_docs/expression_x_y.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressionXY title: "expressionXY" image: https://source.unsplash.com/400x175/?github description: API docs for the expressionXY plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionXY'] --- import expressionXYObj from './expression_x_y.devdocs.json'; diff --git a/api_docs/expressions.mdx b/api_docs/expressions.mdx index 21da09fe8de04..26649c8f7069b 100644 --- a/api_docs/expressions.mdx +++ b/api_docs/expressions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/expressions title: "expressions" image: https://source.unsplash.com/400x175/?github description: API docs for the expressions plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressions'] --- import expressionsObj from './expressions.devdocs.json'; diff --git a/api_docs/features.mdx b/api_docs/features.mdx index 25d518204a23f..102fed53fb710 100644 --- a/api_docs/features.mdx +++ b/api_docs/features.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/features title: "features" image: https://source.unsplash.com/400x175/?github description: API docs for the features plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'features'] --- import featuresObj from './features.devdocs.json'; diff --git a/api_docs/field_formats.mdx b/api_docs/field_formats.mdx index 5167226c9ec26..4a6d195f75e75 100644 --- a/api_docs/field_formats.mdx +++ b/api_docs/field_formats.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fieldFormats title: "fieldFormats" image: https://source.unsplash.com/400x175/?github description: API docs for the fieldFormats plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fieldFormats'] --- import fieldFormatsObj from './field_formats.devdocs.json'; diff --git a/api_docs/fields_metadata.mdx b/api_docs/fields_metadata.mdx index df7a940812a0d..3c8071fb3705e 100644 --- a/api_docs/fields_metadata.mdx +++ b/api_docs/fields_metadata.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fieldsMetadata title: "fieldsMetadata" image: https://source.unsplash.com/400x175/?github description: API docs for the fieldsMetadata plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fieldsMetadata'] --- import fieldsMetadataObj from './fields_metadata.devdocs.json'; diff --git a/api_docs/file_upload.mdx b/api_docs/file_upload.mdx index 8e2a964579b61..a414ec2753b72 100644 --- a/api_docs/file_upload.mdx +++ b/api_docs/file_upload.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fileUpload title: "fileUpload" image: https://source.unsplash.com/400x175/?github description: API docs for the fileUpload plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fileUpload'] --- import fileUploadObj from './file_upload.devdocs.json'; diff --git a/api_docs/files.mdx b/api_docs/files.mdx index 0ac472a752a4d..cdc8ad140dc80 100644 --- a/api_docs/files.mdx +++ b/api_docs/files.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/files title: "files" image: https://source.unsplash.com/400x175/?github description: API docs for the files plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'files'] --- import filesObj from './files.devdocs.json'; diff --git a/api_docs/files_management.mdx b/api_docs/files_management.mdx index ee96658f5f783..b0c433b062fb0 100644 --- a/api_docs/files_management.mdx +++ b/api_docs/files_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/filesManagement title: "filesManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the filesManagement plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'filesManagement'] --- import filesManagementObj from './files_management.devdocs.json'; diff --git a/api_docs/fleet.devdocs.json b/api_docs/fleet.devdocs.json index 58e86a05e7d91..2f0eca2ba5609 100644 --- a/api_docs/fleet.devdocs.json +++ b/api_docs/fleet.devdocs.json @@ -1685,40 +1685,40 @@ "trackAdoption": false, "references": [ { - "plugin": "cloudDefend", - "path": "x-pack/plugins/cloud_defend/server/lib/telemetry/collectors/installation_stats_collector.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/fleet_services.ts" }, { - "plugin": "cloudDefend", - "path": "x-pack/plugins/cloud_defend/public/test/mocks.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/fleet_services.ts" }, { - "plugin": "cloudDefend", - "path": "x-pack/plugins/cloud_defend/public/test/mocks.ts" + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/private_location/synthetics_private_location.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts" + "plugin": "cloudDefend", + "path": "x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/installation_stats_collector.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts" + "plugin": "cloudDefend", + "path": "x-pack/solutions/security/plugins/cloud_defend/public/test/mocks.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts" + "plugin": "cloudDefend", + "path": "x-pack/solutions/security/plugins/cloud_defend/public/test/mocks.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts" }, { - "plugin": "synthetics", - "path": "x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/private_location/synthetics_private_location.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts" } ] }, @@ -24573,40 +24573,40 @@ "trackAdoption": false, "references": [ { - "plugin": "cloudDefend", - "path": "x-pack/plugins/cloud_defend/server/lib/telemetry/collectors/installation_stats_collector.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/fleet_services.ts" }, { - "plugin": "cloudDefend", - "path": "x-pack/plugins/cloud_defend/public/test/mocks.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/fleet_services.ts" }, { - "plugin": "cloudDefend", - "path": "x-pack/plugins/cloud_defend/public/test/mocks.ts" + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/private_location/synthetics_private_location.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts" + "plugin": "cloudDefend", + "path": "x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/installation_stats_collector.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts" + "plugin": "cloudDefend", + "path": "x-pack/solutions/security/plugins/cloud_defend/public/test/mocks.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts" + "plugin": "cloudDefend", + "path": "x-pack/solutions/security/plugins/cloud_defend/public/test/mocks.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts" }, { - "plugin": "synthetics", - "path": "x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/private_location/synthetics_private_location.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts" } ] }, diff --git a/api_docs/fleet.mdx b/api_docs/fleet.mdx index 9c825890f014d..d70229007aff6 100644 --- a/api_docs/fleet.mdx +++ b/api_docs/fleet.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/fleet title: "fleet" image: https://source.unsplash.com/400x175/?github description: API docs for the fleet plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fleet'] --- import fleetObj from './fleet.devdocs.json'; diff --git a/api_docs/global_search.mdx b/api_docs/global_search.mdx index 462785cfdb208..18ccbce9be88b 100644 --- a/api_docs/global_search.mdx +++ b/api_docs/global_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/globalSearch title: "globalSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the globalSearch plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'globalSearch'] --- import globalSearchObj from './global_search.devdocs.json'; diff --git a/api_docs/guided_onboarding.mdx b/api_docs/guided_onboarding.mdx index 049950858a65a..37a649bb491e1 100644 --- a/api_docs/guided_onboarding.mdx +++ b/api_docs/guided_onboarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/guidedOnboarding title: "guidedOnboarding" image: https://source.unsplash.com/400x175/?github description: API docs for the guidedOnboarding plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'guidedOnboarding'] --- import guidedOnboardingObj from './guided_onboarding.devdocs.json'; diff --git a/api_docs/home.mdx b/api_docs/home.mdx index d79aa8a7eda91..a3942b1fc2f50 100644 --- a/api_docs/home.mdx +++ b/api_docs/home.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/home title: "home" image: https://source.unsplash.com/400x175/?github description: API docs for the home plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'home'] --- import homeObj from './home.devdocs.json'; diff --git a/api_docs/image_embeddable.mdx b/api_docs/image_embeddable.mdx index 690dcfce3b1d6..9411d59d344ba 100644 --- a/api_docs/image_embeddable.mdx +++ b/api_docs/image_embeddable.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/imageEmbeddable title: "imageEmbeddable" image: https://source.unsplash.com/400x175/?github description: API docs for the imageEmbeddable plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'imageEmbeddable'] --- import imageEmbeddableObj from './image_embeddable.devdocs.json'; diff --git a/api_docs/index_lifecycle_management.mdx b/api_docs/index_lifecycle_management.mdx index 3e5ab7c50749b..66bad61311fae 100644 --- a/api_docs/index_lifecycle_management.mdx +++ b/api_docs/index_lifecycle_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/indexLifecycleManagement title: "indexLifecycleManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the indexLifecycleManagement plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexLifecycleManagement'] --- import indexLifecycleManagementObj from './index_lifecycle_management.devdocs.json'; diff --git a/api_docs/index_management.mdx b/api_docs/index_management.mdx index b291f1d379467..d911559597f2d 100644 --- a/api_docs/index_management.mdx +++ b/api_docs/index_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/indexManagement title: "indexManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the indexManagement plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexManagement'] --- import indexManagementObj from './index_management.devdocs.json'; diff --git a/api_docs/inference.mdx b/api_docs/inference.mdx index 2c79138073216..249f0333a5894 100644 --- a/api_docs/inference.mdx +++ b/api_docs/inference.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/inference title: "inference" image: https://source.unsplash.com/400x175/?github description: API docs for the inference plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inference'] --- import inferenceObj from './inference.devdocs.json'; diff --git a/api_docs/infra.mdx b/api_docs/infra.mdx index 15bf29b145514..3fa4d0dedf914 100644 --- a/api_docs/infra.mdx +++ b/api_docs/infra.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/infra title: "infra" image: https://source.unsplash.com/400x175/?github description: API docs for the infra plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'infra'] --- import infraObj from './infra.devdocs.json'; diff --git a/api_docs/ingest_pipelines.devdocs.json b/api_docs/ingest_pipelines.devdocs.json index 98a227c237655..b5fc71af8d167 100644 --- a/api_docs/ingest_pipelines.devdocs.json +++ b/api_docs/ingest_pipelines.devdocs.json @@ -21,7 +21,7 @@ }, " extends Partial" ], - "path": "x-pack/plugins/ingest_pipelines/public/locator.ts", + "path": "x-pack/platform/plugins/shared/ingest_pipelines/public/locator.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -42,7 +42,7 @@ }, ".LIST" ], - "path": "x-pack/plugins/ingest_pipelines/public/locator.ts", + "path": "x-pack/platform/plugins/shared/ingest_pipelines/public/locator.ts", "deprecated": false, "trackAdoption": false } @@ -58,7 +58,7 @@ "tags": [], "label": "INGEST_PIPELINES_PAGES", "description": [], - "path": "x-pack/plugins/ingest_pipelines/public/locator.ts", + "path": "x-pack/platform/plugins/shared/ingest_pipelines/public/locator.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -75,7 +75,7 @@ "signature": [ "\"INGEST_PIPELINES_APP_LOCATOR\"" ], - "path": "x-pack/plugins/ingest_pipelines/public/locator.ts", + "path": "x-pack/platform/plugins/shared/ingest_pipelines/public/locator.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/ingest_pipelines.mdx b/api_docs/ingest_pipelines.mdx index a119fba659215..44e85e4a85c85 100644 --- a/api_docs/ingest_pipelines.mdx +++ b/api_docs/ingest_pipelines.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ingestPipelines title: "ingestPipelines" image: https://source.unsplash.com/400x175/?github description: API docs for the ingestPipelines plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ingestPipelines'] --- import ingestPipelinesObj from './ingest_pipelines.devdocs.json'; diff --git a/api_docs/inspector.mdx b/api_docs/inspector.mdx index 84ba2edfa152d..33f2916a0c07a 100644 --- a/api_docs/inspector.mdx +++ b/api_docs/inspector.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/inspector title: "inspector" image: https://source.unsplash.com/400x175/?github description: API docs for the inspector plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inspector'] --- import inspectorObj from './inspector.devdocs.json'; diff --git a/api_docs/integration_assistant.mdx b/api_docs/integration_assistant.mdx index a61e4f0ded1b0..9597d43c6a87e 100644 --- a/api_docs/integration_assistant.mdx +++ b/api_docs/integration_assistant.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/integrationAssistant title: "integrationAssistant" image: https://source.unsplash.com/400x175/?github description: API docs for the integrationAssistant plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'integrationAssistant'] --- import integrationAssistantObj from './integration_assistant.devdocs.json'; diff --git a/api_docs/interactive_setup.mdx b/api_docs/interactive_setup.mdx index 3cf04a06c07d1..0dbd9fc8558f1 100644 --- a/api_docs/interactive_setup.mdx +++ b/api_docs/interactive_setup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/interactiveSetup title: "interactiveSetup" image: https://source.unsplash.com/400x175/?github description: API docs for the interactiveSetup plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'interactiveSetup'] --- import interactiveSetupObj from './interactive_setup.devdocs.json'; diff --git a/api_docs/inventory.mdx b/api_docs/inventory.mdx index 1237677dcd400..3fbe008768848 100644 --- a/api_docs/inventory.mdx +++ b/api_docs/inventory.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/inventory title: "inventory" image: https://source.unsplash.com/400x175/?github description: API docs for the inventory plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inventory'] --- import inventoryObj from './inventory.devdocs.json'; diff --git a/api_docs/investigate.mdx b/api_docs/investigate.mdx index f01672ef9126b..6381a96751ddd 100644 --- a/api_docs/investigate.mdx +++ b/api_docs/investigate.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/investigate title: "investigate" image: https://source.unsplash.com/400x175/?github description: API docs for the investigate plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'investigate'] --- import investigateObj from './investigate.devdocs.json'; diff --git a/api_docs/investigate_app.mdx b/api_docs/investigate_app.mdx index 9d60ba0e93e7b..77b791ad995e0 100644 --- a/api_docs/investigate_app.mdx +++ b/api_docs/investigate_app.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/investigateApp title: "investigateApp" image: https://source.unsplash.com/400x175/?github description: API docs for the investigateApp plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'investigateApp'] --- import investigateAppObj from './investigate_app.devdocs.json'; diff --git a/api_docs/kbn_actions_types.mdx b/api_docs/kbn_actions_types.mdx index f6ce988ba5664..f2e76324f1748 100644 --- a/api_docs/kbn_actions_types.mdx +++ b/api_docs/kbn_actions_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-actions-types title: "@kbn/actions-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/actions-types plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/actions-types'] --- import kbnActionsTypesObj from './kbn_actions_types.devdocs.json'; diff --git a/api_docs/kbn_ai_assistant.mdx b/api_docs/kbn_ai_assistant.mdx index 169f7ce56ca52..947c8d26141f8 100644 --- a/api_docs/kbn_ai_assistant.mdx +++ b/api_docs/kbn_ai_assistant.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ai-assistant title: "@kbn/ai-assistant" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ai-assistant plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ai-assistant'] --- import kbnAiAssistantObj from './kbn_ai_assistant.devdocs.json'; diff --git a/api_docs/kbn_ai_assistant_common.mdx b/api_docs/kbn_ai_assistant_common.mdx index a461c57479138..92174506c11c1 100644 --- a/api_docs/kbn_ai_assistant_common.mdx +++ b/api_docs/kbn_ai_assistant_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ai-assistant-common title: "@kbn/ai-assistant-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ai-assistant-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ai-assistant-common'] --- import kbnAiAssistantCommonObj from './kbn_ai_assistant_common.devdocs.json'; diff --git a/api_docs/kbn_ai_assistant_icon.mdx b/api_docs/kbn_ai_assistant_icon.mdx index 7e242c21262c0..e49d5b0914ce1 100644 --- a/api_docs/kbn_ai_assistant_icon.mdx +++ b/api_docs/kbn_ai_assistant_icon.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ai-assistant-icon title: "@kbn/ai-assistant-icon" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ai-assistant-icon plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ai-assistant-icon'] --- import kbnAiAssistantIconObj from './kbn_ai_assistant_icon.devdocs.json'; diff --git a/api_docs/kbn_aiops_components.mdx b/api_docs/kbn_aiops_components.mdx index af807860528cb..61975f9205ba6 100644 --- a/api_docs/kbn_aiops_components.mdx +++ b/api_docs/kbn_aiops_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-components title: "@kbn/aiops-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-components plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-components'] --- import kbnAiopsComponentsObj from './kbn_aiops_components.devdocs.json'; diff --git a/api_docs/kbn_aiops_log_pattern_analysis.mdx b/api_docs/kbn_aiops_log_pattern_analysis.mdx index 5f68936186d76..5913050965be2 100644 --- a/api_docs/kbn_aiops_log_pattern_analysis.mdx +++ b/api_docs/kbn_aiops_log_pattern_analysis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-log-pattern-analysis title: "@kbn/aiops-log-pattern-analysis" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-log-pattern-analysis plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-log-pattern-analysis'] --- import kbnAiopsLogPatternAnalysisObj from './kbn_aiops_log_pattern_analysis.devdocs.json'; diff --git a/api_docs/kbn_aiops_log_rate_analysis.mdx b/api_docs/kbn_aiops_log_rate_analysis.mdx index 19db4c1e8d735..dd7907fced0ba 100644 --- a/api_docs/kbn_aiops_log_rate_analysis.mdx +++ b/api_docs/kbn_aiops_log_rate_analysis.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-aiops-log-rate-analysis title: "@kbn/aiops-log-rate-analysis" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/aiops-log-rate-analysis plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/aiops-log-rate-analysis'] --- import kbnAiopsLogRateAnalysisObj from './kbn_aiops_log_rate_analysis.devdocs.json'; diff --git a/api_docs/kbn_alerting_api_integration_helpers.mdx b/api_docs/kbn_alerting_api_integration_helpers.mdx index d80413915b97c..e529ecebd2980 100644 --- a/api_docs/kbn_alerting_api_integration_helpers.mdx +++ b/api_docs/kbn_alerting_api_integration_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerting-api-integration-helpers title: "@kbn/alerting-api-integration-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerting-api-integration-helpers plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerting-api-integration-helpers'] --- import kbnAlertingApiIntegrationHelpersObj from './kbn_alerting_api_integration_helpers.devdocs.json'; diff --git a/api_docs/kbn_alerting_comparators.mdx b/api_docs/kbn_alerting_comparators.mdx index 7eac1c83d7403..f6a43ae34b45f 100644 --- a/api_docs/kbn_alerting_comparators.mdx +++ b/api_docs/kbn_alerting_comparators.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerting-comparators title: "@kbn/alerting-comparators" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerting-comparators plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerting-comparators'] --- import kbnAlertingComparatorsObj from './kbn_alerting_comparators.devdocs.json'; diff --git a/api_docs/kbn_alerting_state_types.mdx b/api_docs/kbn_alerting_state_types.mdx index 7cd503df3a825..d7eb6c4907913 100644 --- a/api_docs/kbn_alerting_state_types.mdx +++ b/api_docs/kbn_alerting_state_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerting-state-types title: "@kbn/alerting-state-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerting-state-types plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerting-state-types'] --- import kbnAlertingStateTypesObj from './kbn_alerting_state_types.devdocs.json'; diff --git a/api_docs/kbn_alerting_types.mdx b/api_docs/kbn_alerting_types.mdx index 34dc79c4fe9fe..6dc693f6a2398 100644 --- a/api_docs/kbn_alerting_types.mdx +++ b/api_docs/kbn_alerting_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerting-types title: "@kbn/alerting-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerting-types plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerting-types'] --- import kbnAlertingTypesObj from './kbn_alerting_types.devdocs.json'; diff --git a/api_docs/kbn_alerts_as_data_utils.mdx b/api_docs/kbn_alerts_as_data_utils.mdx index 34daf60c0dd43..d7ea7e08cb959 100644 --- a/api_docs/kbn_alerts_as_data_utils.mdx +++ b/api_docs/kbn_alerts_as_data_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerts-as-data-utils title: "@kbn/alerts-as-data-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerts-as-data-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts-as-data-utils'] --- import kbnAlertsAsDataUtilsObj from './kbn_alerts_as_data_utils.devdocs.json'; diff --git a/api_docs/kbn_alerts_grouping.mdx b/api_docs/kbn_alerts_grouping.mdx index f8632f53b3208..bf72bd4003879 100644 --- a/api_docs/kbn_alerts_grouping.mdx +++ b/api_docs/kbn_alerts_grouping.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerts-grouping title: "@kbn/alerts-grouping" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerts-grouping plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts-grouping'] --- import kbnAlertsGroupingObj from './kbn_alerts_grouping.devdocs.json'; diff --git a/api_docs/kbn_alerts_ui_shared.mdx b/api_docs/kbn_alerts_ui_shared.mdx index 973e2a610b790..2f2d24eae1f7f 100644 --- a/api_docs/kbn_alerts_ui_shared.mdx +++ b/api_docs/kbn_alerts_ui_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-alerts-ui-shared title: "@kbn/alerts-ui-shared" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/alerts-ui-shared plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts-ui-shared'] --- import kbnAlertsUiSharedObj from './kbn_alerts_ui_shared.devdocs.json'; diff --git a/api_docs/kbn_analytics.mdx b/api_docs/kbn_analytics.mdx index dd85160ed904e..0aa681fee29b7 100644 --- a/api_docs/kbn_analytics.mdx +++ b/api_docs/kbn_analytics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics title: "@kbn/analytics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics'] --- import kbnAnalyticsObj from './kbn_analytics.devdocs.json'; diff --git a/api_docs/kbn_analytics_collection_utils.mdx b/api_docs/kbn_analytics_collection_utils.mdx index 1c0117df7a795..f7813f9508cdf 100644 --- a/api_docs/kbn_analytics_collection_utils.mdx +++ b/api_docs/kbn_analytics_collection_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-analytics-collection-utils title: "@kbn/analytics-collection-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/analytics-collection-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/analytics-collection-utils'] --- import kbnAnalyticsCollectionUtilsObj from './kbn_analytics_collection_utils.devdocs.json'; diff --git a/api_docs/kbn_apm_config_loader.mdx b/api_docs/kbn_apm_config_loader.mdx index 911253ed0ef10..a42fd8b31a3da 100644 --- a/api_docs/kbn_apm_config_loader.mdx +++ b/api_docs/kbn_apm_config_loader.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-config-loader title: "@kbn/apm-config-loader" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-config-loader plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-config-loader'] --- import kbnApmConfigLoaderObj from './kbn_apm_config_loader.devdocs.json'; diff --git a/api_docs/kbn_apm_data_view.mdx b/api_docs/kbn_apm_data_view.mdx index bfe66abac2e57..84ffd6ab7078a 100644 --- a/api_docs/kbn_apm_data_view.mdx +++ b/api_docs/kbn_apm_data_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-data-view title: "@kbn/apm-data-view" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-data-view plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-data-view'] --- import kbnApmDataViewObj from './kbn_apm_data_view.devdocs.json'; diff --git a/api_docs/kbn_apm_synthtrace.mdx b/api_docs/kbn_apm_synthtrace.mdx index d50e6cd5d966a..62ebc243212c8 100644 --- a/api_docs/kbn_apm_synthtrace.mdx +++ b/api_docs/kbn_apm_synthtrace.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-synthtrace title: "@kbn/apm-synthtrace" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-synthtrace plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-synthtrace'] --- import kbnApmSynthtraceObj from './kbn_apm_synthtrace.devdocs.json'; diff --git a/api_docs/kbn_apm_synthtrace_client.mdx b/api_docs/kbn_apm_synthtrace_client.mdx index 78861f2f2f7e4..a3012b8a6752c 100644 --- a/api_docs/kbn_apm_synthtrace_client.mdx +++ b/api_docs/kbn_apm_synthtrace_client.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-synthtrace-client title: "@kbn/apm-synthtrace-client" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-synthtrace-client plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-synthtrace-client'] --- import kbnApmSynthtraceClientObj from './kbn_apm_synthtrace_client.devdocs.json'; diff --git a/api_docs/kbn_apm_types.mdx b/api_docs/kbn_apm_types.mdx index 0bd878f410f1b..d3f089cf38b41 100644 --- a/api_docs/kbn_apm_types.mdx +++ b/api_docs/kbn_apm_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-types title: "@kbn/apm-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-types plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-types'] --- import kbnApmTypesObj from './kbn_apm_types.devdocs.json'; diff --git a/api_docs/kbn_apm_utils.mdx b/api_docs/kbn_apm_utils.mdx index 4b8b2aa6d8a8d..d8be060d57d5d 100644 --- a/api_docs/kbn_apm_utils.mdx +++ b/api_docs/kbn_apm_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-apm-utils title: "@kbn/apm-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/apm-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-utils'] --- import kbnApmUtilsObj from './kbn_apm_utils.devdocs.json'; diff --git a/api_docs/kbn_avc_banner.mdx b/api_docs/kbn_avc_banner.mdx index 0b069c8ac566e..cc1a609a2d76d 100644 --- a/api_docs/kbn_avc_banner.mdx +++ b/api_docs/kbn_avc_banner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-avc-banner title: "@kbn/avc-banner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/avc-banner plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/avc-banner'] --- import kbnAvcBannerObj from './kbn_avc_banner.devdocs.json'; diff --git a/api_docs/kbn_axe_config.mdx b/api_docs/kbn_axe_config.mdx index 6c215270ce7a6..d2593e5b50277 100644 --- a/api_docs/kbn_axe_config.mdx +++ b/api_docs/kbn_axe_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-axe-config title: "@kbn/axe-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/axe-config plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/axe-config'] --- import kbnAxeConfigObj from './kbn_axe_config.devdocs.json'; diff --git a/api_docs/kbn_bfetch_error.mdx b/api_docs/kbn_bfetch_error.mdx index c4ad5a41fb140..437e601f520d0 100644 --- a/api_docs/kbn_bfetch_error.mdx +++ b/api_docs/kbn_bfetch_error.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-bfetch-error title: "@kbn/bfetch-error" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/bfetch-error plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/bfetch-error'] --- import kbnBfetchErrorObj from './kbn_bfetch_error.devdocs.json'; diff --git a/api_docs/kbn_calculate_auto.mdx b/api_docs/kbn_calculate_auto.mdx index 2328483bc4db0..b2491fb330839 100644 --- a/api_docs/kbn_calculate_auto.mdx +++ b/api_docs/kbn_calculate_auto.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-calculate-auto title: "@kbn/calculate-auto" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/calculate-auto plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/calculate-auto'] --- import kbnCalculateAutoObj from './kbn_calculate_auto.devdocs.json'; diff --git a/api_docs/kbn_calculate_width_from_char_count.mdx b/api_docs/kbn_calculate_width_from_char_count.mdx index 96d88048c4ecb..2bb4332e80074 100644 --- a/api_docs/kbn_calculate_width_from_char_count.mdx +++ b/api_docs/kbn_calculate_width_from_char_count.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-calculate-width-from-char-count title: "@kbn/calculate-width-from-char-count" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/calculate-width-from-char-count plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/calculate-width-from-char-count'] --- import kbnCalculateWidthFromCharCountObj from './kbn_calculate_width_from_char_count.devdocs.json'; diff --git a/api_docs/kbn_cases_components.mdx b/api_docs/kbn_cases_components.mdx index 5ccb645147b76..34a92188ecbad 100644 --- a/api_docs/kbn_cases_components.mdx +++ b/api_docs/kbn_cases_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cases-components title: "@kbn/cases-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cases-components plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cases-components'] --- import kbnCasesComponentsObj from './kbn_cases_components.devdocs.json'; diff --git a/api_docs/kbn_cbor.mdx b/api_docs/kbn_cbor.mdx index 2809fc65aa399..1df9937b6a831 100644 --- a/api_docs/kbn_cbor.mdx +++ b/api_docs/kbn_cbor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cbor title: "@kbn/cbor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cbor plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cbor'] --- import kbnCborObj from './kbn_cbor.devdocs.json'; diff --git a/api_docs/kbn_cell_actions.mdx b/api_docs/kbn_cell_actions.mdx index 412495c1cbd8e..69c9257a9b71a 100644 --- a/api_docs/kbn_cell_actions.mdx +++ b/api_docs/kbn_cell_actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cell-actions title: "@kbn/cell-actions" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cell-actions plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cell-actions'] --- import kbnCellActionsObj from './kbn_cell_actions.devdocs.json'; diff --git a/api_docs/kbn_chart_expressions_common.mdx b/api_docs/kbn_chart_expressions_common.mdx index cc6add38559fb..ea7a911e6a2f1 100644 --- a/api_docs/kbn_chart_expressions_common.mdx +++ b/api_docs/kbn_chart_expressions_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-chart-expressions-common title: "@kbn/chart-expressions-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/chart-expressions-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/chart-expressions-common'] --- import kbnChartExpressionsCommonObj from './kbn_chart_expressions_common.devdocs.json'; diff --git a/api_docs/kbn_chart_icons.mdx b/api_docs/kbn_chart_icons.mdx index af70514e5c759..a3f4770a15f49 100644 --- a/api_docs/kbn_chart_icons.mdx +++ b/api_docs/kbn_chart_icons.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-chart-icons title: "@kbn/chart-icons" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/chart-icons plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/chart-icons'] --- import kbnChartIconsObj from './kbn_chart_icons.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_core.mdx b/api_docs/kbn_ci_stats_core.mdx index 96013e731d512..4944d674a7b9d 100644 --- a/api_docs/kbn_ci_stats_core.mdx +++ b/api_docs/kbn_ci_stats_core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-core title: "@kbn/ci-stats-core" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-core plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-core'] --- import kbnCiStatsCoreObj from './kbn_ci_stats_core.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_performance_metrics.mdx b/api_docs/kbn_ci_stats_performance_metrics.mdx index a78134a064518..85c87cf30cafc 100644 --- a/api_docs/kbn_ci_stats_performance_metrics.mdx +++ b/api_docs/kbn_ci_stats_performance_metrics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-performance-metrics title: "@kbn/ci-stats-performance-metrics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-performance-metrics plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-performance-metrics'] --- import kbnCiStatsPerformanceMetricsObj from './kbn_ci_stats_performance_metrics.devdocs.json'; diff --git a/api_docs/kbn_ci_stats_reporter.mdx b/api_docs/kbn_ci_stats_reporter.mdx index 974689993ea26..fbd3668a91bd6 100644 --- a/api_docs/kbn_ci_stats_reporter.mdx +++ b/api_docs/kbn_ci_stats_reporter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ci-stats-reporter title: "@kbn/ci-stats-reporter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ci-stats-reporter plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ci-stats-reporter'] --- import kbnCiStatsReporterObj from './kbn_ci_stats_reporter.devdocs.json'; diff --git a/api_docs/kbn_cli_dev_mode.mdx b/api_docs/kbn_cli_dev_mode.mdx index ef79cd2088aa2..41130c1827079 100644 --- a/api_docs/kbn_cli_dev_mode.mdx +++ b/api_docs/kbn_cli_dev_mode.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cli-dev-mode title: "@kbn/cli-dev-mode" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cli-dev-mode plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cli-dev-mode'] --- import kbnCliDevModeObj from './kbn_cli_dev_mode.devdocs.json'; diff --git a/api_docs/kbn_cloud_security_posture.devdocs.json b/api_docs/kbn_cloud_security_posture.devdocs.json index 62f5fce1db937..c0a6a4ef885f1 100644 --- a/api_docs/kbn_cloud_security_posture.devdocs.json +++ b/api_docs/kbn_cloud_security_posture.devdocs.json @@ -13,7 +13,7 @@ "signature": [ "({ type }: Props) => React.JSX.Element" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/components/csp_evaluation_badge.tsx", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/components/csp_evaluation_badge.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -27,7 +27,7 @@ "signature": [ "Props" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/components/csp_evaluation_badge.tsx", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/components/csp_evaluation_badge.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -46,7 +46,7 @@ "signature": [ "({ score, version }: CVSScoreBadgeProps) => React.JSX.Element | null" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/components/vulnerability_badges.tsx", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/components/vulnerability_badges.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -60,7 +60,7 @@ "signature": [ "CVSScoreBadgeProps" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/components/vulnerability_badges.tsx", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/components/vulnerability_badges.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -79,7 +79,7 @@ "signature": [ "(search?: string | undefined) => Partial | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/utils/query_utils.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/query_utils.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -93,7 +93,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/utils/query_utils.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/query_utils.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -112,7 +112,7 @@ "signature": [ "(query: any) => string | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/utils/query_utils.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/query_utils.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -126,7 +126,7 @@ "signature": [ "any" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/utils/query_utils.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/query_utils.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -145,7 +145,7 @@ "signature": [ "(score: number) => string | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_colors.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_colors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -159,7 +159,7 @@ "signature": [ "number" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_colors.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_colors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -186,7 +186,7 @@ }, ") => string" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_colors.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_colors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -206,7 +206,7 @@ "text": "VulnSeverity" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_colors.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_colors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -233,7 +233,7 @@ }, ") => string" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_text.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_text.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -253,7 +253,7 @@ "text": "VulnSeverity" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_text.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_text.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -272,7 +272,7 @@ "signature": [ "(counts: VulnerabilityCounts, filterFunction?: ((filter: string) => void) | undefined, currentFilter?: string | undefined) => VulnerabilitiesDistributionBarProps[]" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -286,7 +286,7 @@ "signature": [ "VulnerabilityCounts" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -301,7 +301,7 @@ "signature": [ "((filter: string) => void) | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -316,7 +316,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -335,7 +335,7 @@ "signature": [ "(counts: VulnerabilityCounts) => boolean" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -349,7 +349,7 @@ "signature": [ "VulnerabilityCounts" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -368,7 +368,7 @@ "signature": [ "({ severity }: SeverityStatusBadgeProps) => React.JSX.Element | null" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/components/vulnerability_badges.tsx", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/components/vulnerability_badges.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -382,7 +382,7 @@ "signature": [ "SeverityStatusBadgeProps" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/components/vulnerability_badges.tsx", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/components/vulnerability_badges.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -409,7 +409,7 @@ }, ", error: unknown) => void" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/utils/show_error_toast.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/show_error_toast.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -429,7 +429,7 @@ "text": "IToasts" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/utils/show_error_toast.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/show_error_toast.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -444,7 +444,7 @@ "signature": [ "unknown" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/utils/show_error_toast.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/show_error_toast.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -462,7 +462,7 @@ "tags": [], "label": "CspBaseEsQuery", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -478,7 +478,7 @@ "QueryDslQueryContainer", " | undefined)[] | undefined; }; } | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -492,7 +492,7 @@ "tags": [], "label": "CspClientPluginStartDeps", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -512,7 +512,7 @@ "text": "DataPublicPluginStart" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -532,7 +532,7 @@ "text": "DataViewsServicePublic" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -552,7 +552,7 @@ "text": "PluginStart" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -572,7 +572,7 @@ "text": "UnifiedSearchPublicPluginStart" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -660,7 +660,7 @@ }, "; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -690,7 +690,7 @@ }, "; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -710,7 +710,7 @@ "text": "IToasts" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -733,7 +733,7 @@ "ActiveCursor", "; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -753,7 +753,7 @@ "text": "DiscoverStart" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -773,7 +773,7 @@ "text": "FleetStart" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -793,7 +793,7 @@ "text": "LicensingPluginStart" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -833,7 +833,7 @@ }, ">): void; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -853,7 +853,7 @@ "text": "Storage" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -873,7 +873,7 @@ "text": "SpacesApi" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -893,7 +893,7 @@ "text": "CloudSetup" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -914,7 +914,7 @@ }, " | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -928,7 +928,7 @@ "tags": [], "label": "FindingsAggs", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -945,7 +945,7 @@ "AggregationsStringRareTermsBucketKeys", ">" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -959,7 +959,7 @@ "tags": [], "label": "FindingsBaseEsQuery", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -981,7 +981,7 @@ }, "; } | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -1012,7 +1012,7 @@ "text": "CspBaseEsQuery" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1026,7 +1026,7 @@ "signature": [ "string[][]" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1037,7 +1037,7 @@ "tags": [], "label": "enabled", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1048,7 +1048,7 @@ "tags": [], "label": "pageSize", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1062,7 +1062,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -1082,7 +1082,7 @@ "signature": [ "\"host.name\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1106,7 +1106,7 @@ "SearchRequest", ">" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1146,7 +1146,7 @@ }, ">>" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1161,7 +1161,7 @@ "signature": [ "{ [x: string]: FilterValue; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/utils/query_utils.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/query_utils.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1176,7 +1176,7 @@ "signature": [ "\"user.name\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1190,7 +1190,7 @@ "tags": [], "label": "findingsNavigation", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1201,7 +1201,7 @@ "tags": [], "label": "findings_default", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1212,7 +1212,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false }, @@ -1223,7 +1223,7 @@ "tags": [], "label": "path", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false }, @@ -1234,7 +1234,7 @@ "tags": [], "label": "id", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false } @@ -1247,7 +1247,7 @@ "tags": [], "label": "findings_by_resource", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1258,7 +1258,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false }, @@ -1269,7 +1269,7 @@ "tags": [], "label": "path", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false }, @@ -1280,7 +1280,7 @@ "tags": [], "label": "id", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false } @@ -1293,7 +1293,7 @@ "tags": [], "label": "resource_findings", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1304,7 +1304,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false }, @@ -1315,7 +1315,7 @@ "tags": [], "label": "path", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false }, @@ -1326,7 +1326,7 @@ "tags": [], "label": "id", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false } @@ -1339,7 +1339,7 @@ "tags": [], "label": "vulnerabilities", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1350,7 +1350,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false }, @@ -1361,7 +1361,7 @@ "tags": [], "label": "path", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false }, @@ -1372,7 +1372,7 @@ "tags": [], "label": "id", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false } @@ -1385,7 +1385,7 @@ "tags": [], "label": "vulnerabilities_by_resource", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1396,7 +1396,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false }, @@ -1407,7 +1407,7 @@ "tags": [], "label": "path", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false }, @@ -1418,7 +1418,7 @@ "tags": [], "label": "id", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false } @@ -1431,7 +1431,7 @@ "tags": [], "label": "resource_vulnerabilities", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1442,7 +1442,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false }, @@ -1453,7 +1453,7 @@ "tags": [], "label": "path", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false }, @@ -1464,7 +1464,7 @@ "tags": [], "label": "id", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false } @@ -1480,7 +1480,7 @@ "tags": [], "label": "NAV_ITEMS_NAMES", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1491,7 +1491,7 @@ "tags": [], "label": "DASHBOARD", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false }, @@ -1502,7 +1502,7 @@ "tags": [], "label": "VULNERABILITY_DASHBOARD", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false }, @@ -1513,7 +1513,7 @@ "tags": [], "label": "FINDINGS", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false }, @@ -1524,7 +1524,7 @@ "tags": [], "label": "BENCHMARKS", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false }, @@ -1535,7 +1535,7 @@ "tags": [], "label": "RULES", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts", "deprecated": false, "trackAdoption": false } @@ -1549,7 +1549,7 @@ "tags": [], "label": "statusColors", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1560,7 +1560,7 @@ "tags": [], "label": "passed", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts", "deprecated": false, "trackAdoption": false }, @@ -1571,7 +1571,7 @@ "tags": [], "label": "failed", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts", "deprecated": false, "trackAdoption": false }, @@ -1582,7 +1582,7 @@ "tags": [], "label": "unknown", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/kbn_cloud_security_posture.mdx b/api_docs/kbn_cloud_security_posture.mdx index 8cfcf693ab5d6..1393e03664337 100644 --- a/api_docs/kbn_cloud_security_posture.mdx +++ b/api_docs/kbn_cloud_security_posture.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cloud-security-posture title: "@kbn/cloud-security-posture" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cloud-security-posture plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cloud-security-posture'] --- import kbnCloudSecurityPostureObj from './kbn_cloud_security_posture.devdocs.json'; diff --git a/api_docs/kbn_cloud_security_posture_common.devdocs.json b/api_docs/kbn_cloud_security_posture_common.devdocs.json index 5e993b4e3c1f3..3fb9874365e62 100644 --- a/api_docs/kbn_cloud_security_posture_common.devdocs.json +++ b/api_docs/kbn_cloud_security_posture_common.devdocs.json @@ -25,7 +25,7 @@ "tags": [], "label": "UiMetricService", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/ui_metrics.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/ui_metrics.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -47,7 +47,7 @@ }, ") => void" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/ui_metrics.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/ui_metrics.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -67,7 +67,7 @@ "text": "UsageCollectionSetup" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/ui_metrics.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/ui_metrics.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -85,7 +85,7 @@ "signature": [ "(metricType: string, eventName: string) => void" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/ui_metrics.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/ui_metrics.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -99,7 +99,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/ui_metrics.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/ui_metrics.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -114,7 +114,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/ui_metrics.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/ui_metrics.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -137,7 +137,7 @@ "signature": [ "(field: string, queryValue?: string | undefined, status?: string | undefined, queryField?: string | undefined) => { bool: { filter: ({ bool: { should: { term: { [x: string]: string; }; }[]; minimum_should_match: number; }; } | undefined)[]; }; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -151,7 +151,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -166,7 +166,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -181,7 +181,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -196,7 +196,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -215,7 +215,7 @@ "signature": [ "(field: string, queryValue?: string | undefined, status?: string | undefined) => { bool: { filter: ({ bool: { should: { term: { [x: string]: string; }; }[]; minimum_should_match: number; }; } | undefined)[]; }; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -229,7 +229,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -244,7 +244,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -259,7 +259,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -280,7 +280,7 @@ "QueryDslQueryContainer", "[]" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -294,7 +294,7 @@ "signature": [ "Record>" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -313,7 +313,7 @@ "signature": [ "(field: string, queryValue?: string | undefined, status?: string | undefined) => { bool: { filter: ({ bool: { should: { term: { [x: string]: string; }; }[]; minimum_should_match: number; }; } | undefined)[]; }; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -327,7 +327,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -342,7 +342,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -357,7 +357,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -376,7 +376,7 @@ "signature": [ "(e: unknown, fallbackMessage?: string | undefined) => string" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -390,7 +390,7 @@ "signature": [ "unknown" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -405,7 +405,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -426,7 +426,7 @@ "signature": [ "(value: number) => string | number" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/get_abbreviated_number.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/get_abbreviated_number.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -440,7 +440,7 @@ "signature": [ "number" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/utils/get_abbreviated_number.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/get_abbreviated_number.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -458,7 +458,7 @@ "tags": [], "label": "BaseCspSetupBothPolicy", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/status.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -472,7 +472,7 @@ "signature": [ "\"indexed\" | \"unprivileged\" | \"indexing\" | \"index-timeout\" | \"not-deployed\" | \"not-installed\" | \"waiting_for_results\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/status.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -483,7 +483,7 @@ "tags": [], "label": "installedPackagePolicies", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/status.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -494,7 +494,7 @@ "tags": [], "label": "healthyAgents", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/status.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts", "deprecated": false, "trackAdoption": false } @@ -508,7 +508,7 @@ "tags": [], "label": "BaseCspSetupStatus", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/status.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -529,7 +529,7 @@ }, "[]" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/status.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -540,7 +540,7 @@ "tags": [], "label": "latestPackageVersion", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/status.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -560,7 +560,7 @@ "text": "BaseCspSetupBothPolicy" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/status.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -580,7 +580,7 @@ "text": "BaseCspSetupBothPolicy" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/status.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -600,7 +600,7 @@ "text": "BaseCspSetupBothPolicy" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/status.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -611,7 +611,7 @@ "tags": [], "label": "isPluginInitialized", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/status.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -625,7 +625,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/status.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -639,7 +639,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/status.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -653,7 +653,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/status.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts", "deprecated": false, "trackAdoption": false } @@ -667,7 +667,7 @@ "tags": [], "label": "CspFinding", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/findings.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/findings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -678,7 +678,7 @@ "tags": [], "label": "'@timestamp'", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/findings.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -692,7 +692,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/findings.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -706,7 +706,7 @@ "signature": [ "CspFindingOrchestrator | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/findings.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -720,7 +720,7 @@ "signature": [ "CspFindingCloud | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/findings.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -740,7 +740,7 @@ "text": "CspFindingResult" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/findings.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -754,7 +754,7 @@ "signature": [ "CspFindingResource" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/findings.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -768,7 +768,7 @@ "signature": [ "{ readonly references?: string | undefined; readonly impact?: string | undefined; readonly reference?: string | undefined; readonly default_value?: string | undefined; readonly id: string; readonly version: string; readonly name: string; readonly tags: string[]; readonly description: string; readonly section: string; readonly audit: string; readonly benchmark: Readonly<{ posture_type?: \"kspm\" | \"cspm\" | undefined; rule_number?: string | undefined; } & { id: string; version: string; name: string; }>; readonly profile_applicability: string; readonly rationale: string; readonly rego_rule_id: string; readonly remediation: string; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/findings.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -782,7 +782,7 @@ "signature": [ "CspFindingHost" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/findings.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -796,7 +796,7 @@ "signature": [ "EcsEvent" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/findings.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -810,7 +810,7 @@ "signature": [ "EcsDataStream" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/findings.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -824,7 +824,7 @@ "signature": [ "EcsObserver" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/findings.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -838,7 +838,7 @@ "signature": [ "CspFindingAgent" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/findings.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -852,7 +852,7 @@ "signature": [ "{ version: string; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/findings.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/findings.ts", "deprecated": false, "trackAdoption": false } @@ -866,7 +866,7 @@ "tags": [], "label": "CspFindingResult", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/findings.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/findings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -880,7 +880,7 @@ "signature": [ "\"failed\" | \"passed\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/findings.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -894,7 +894,7 @@ "signature": [ "Record | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/findings.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/findings.ts", "deprecated": false, "trackAdoption": false }, @@ -908,7 +908,7 @@ "signature": [ "{ [x: string]: unknown; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/findings.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/findings.ts", "deprecated": false, "trackAdoption": false } @@ -922,7 +922,7 @@ "tags": [], "label": "CspVulnerabilityFinding", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -933,7 +933,7 @@ "tags": [], "label": "'@timestamp'", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -947,7 +947,7 @@ "signature": [ "{ id: string; name: string; } | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -961,7 +961,7 @@ "signature": [ "EcsEvent" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -981,7 +981,7 @@ "text": "Vulnerability" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -995,7 +995,7 @@ "signature": [ "{ version: string; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -1009,7 +1009,7 @@ "signature": [ "{ os: { name: string; kernel: string; codename: string; type: string; platform: string; version: string; family: string; }; id: string; name: string; containerized: boolean; ip: string[]; mac: string[]; hostname: string; architecture: string; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -1023,7 +1023,7 @@ "signature": [ "{ ephemeral_id: string; id: string; name: string; type: string; version: string; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -1037,7 +1037,7 @@ "signature": [ "{ image?: { id: string; } | undefined; provider?: string | undefined; instance?: { id: string; } | undefined; machine?: { type: string; } | undefined; region: string; availability_zone?: string | undefined; service?: { name: string; } | undefined; account?: { id: string; } | undefined; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -1051,7 +1051,7 @@ "signature": [ "{ version: string; commit_sha: string; commit_time: string; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -1065,7 +1065,7 @@ "signature": [ "{ version?: string | undefined; name?: string | undefined; fixed_version?: string | undefined; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -1079,7 +1079,7 @@ "signature": [ "EcsDataStream" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -1093,7 +1093,7 @@ "signature": [ "EcsObserver" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false } @@ -1107,7 +1107,7 @@ "tags": [], "label": "IndexDetails", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/status.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1118,7 +1118,7 @@ "tags": [], "label": "index", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/status.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts", "deprecated": false, "trackAdoption": false }, @@ -1132,7 +1132,7 @@ "signature": [ "\"empty\" | \"not-empty\" | \"unprivileged\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/status.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts", "deprecated": false, "trackAdoption": false } @@ -1146,7 +1146,7 @@ "tags": [], "label": "Vulnerability", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1160,7 +1160,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -1174,7 +1174,7 @@ "signature": [ "{ version?: string | undefined; base?: number | undefined; } | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -1188,7 +1188,7 @@ "signature": [ "string[]" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -1199,7 +1199,7 @@ "tags": [], "label": "id", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -1210,7 +1210,7 @@ "tags": [], "label": "title", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -1221,7 +1221,7 @@ "tags": [], "label": "reference", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -1242,7 +1242,7 @@ }, " | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -1262,7 +1262,7 @@ "VectorScoreBase", " | undefined; } | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -1276,7 +1276,7 @@ "signature": [ "{ ID: string; Name: string; URL: string; } | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -1287,7 +1287,7 @@ "tags": [], "label": "enumeration", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -1298,7 +1298,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -1309,7 +1309,7 @@ "tags": [], "label": "classification", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false }, @@ -1323,7 +1323,7 @@ "signature": [ "{ vendor: string; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts", "deprecated": false, "trackAdoption": false } @@ -1343,7 +1343,7 @@ "signature": [ "\"cis_k8s\" | \"cis_azure\" | \"cis_aws\" | \"cis_eks\" | \"cis_gcp\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/benchmark.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/benchmark.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1358,7 +1358,7 @@ "signature": [ "\"90d\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1373,7 +1373,7 @@ "signature": [ "\"logs-cloud_security_posture.findings_latest-default\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1388,7 +1388,7 @@ "signature": [ "\"logs-cloud_security_posture.vulnerabilities_latest-default\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1403,7 +1403,7 @@ "signature": [ "\"security_solution-*.misconfiguration_latest\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1418,7 +1418,7 @@ "signature": [ "\"security_solution-*.vulnerability_latest\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1433,7 +1433,7 @@ "signature": [ "\"security_solution_cdr_latest_misconfigurations\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1448,7 +1448,7 @@ "signature": [ "\"Latest Cloud Security Misconfigurations\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1460,7 +1460,7 @@ "tags": [], "label": "CDR_MISCONFIGURATIONS_INDEX_PATTERN", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1472,7 +1472,7 @@ "tags": [], "label": "CDR_VULNERABILITIES_INDEX_PATTERN", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1489,7 +1489,7 @@ "signature": [ "\"/cloud_security_posture\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1504,7 +1504,7 @@ "signature": [ "\"1\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1519,7 +1519,7 @@ "signature": [ "\"/internal/cloud_security_posture/rules/_get_states\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1534,7 +1534,7 @@ "signature": [ "\"cspm\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1555,7 +1555,7 @@ "text": "BaseCspSetupStatus" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/status.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1570,7 +1570,7 @@ "signature": [ "\"indexed\" | \"unprivileged\" | \"indexing\" | \"index-timeout\" | \"not-deployed\" | \"not-installed\" | \"waiting_for_results\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/status.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1585,7 +1585,7 @@ "signature": [ "\"empty\" | \"not-empty\" | \"unprivileged\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/status.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1600,7 +1600,7 @@ "signature": [ "\"kspm\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1615,7 +1615,7 @@ "signature": [ "\"26h\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1630,7 +1630,7 @@ "signature": [ "\"3d\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1645,7 +1645,7 @@ "signature": [ "500" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1660,7 +1660,7 @@ "signature": [ "\"security-solution-default\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1675,7 +1675,7 @@ "signature": [ "\"1\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1690,7 +1690,7 @@ "signature": [ "\"/internal/cloud_security_posture/status\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1705,7 +1705,7 @@ "signature": [ "\"MEDIUM\" | \"UNKNOWN\" | \"LOW\" | \"HIGH\" | \"CRITICAL\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/types/vulnerabilities.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/vulnerabilities.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1719,7 +1719,7 @@ "tags": [], "label": "MISCONFIGURATION_STATUS", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1730,7 +1730,7 @@ "tags": [], "label": "PASSED", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -1741,7 +1741,7 @@ "tags": [], "label": "FAILED", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false } @@ -1755,7 +1755,7 @@ "tags": [], "label": "VULNERABILITIES_SEVERITY", "description": [], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1769,7 +1769,7 @@ "signature": [ "\"LOW\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -1783,7 +1783,7 @@ "signature": [ "\"MEDIUM\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -1797,7 +1797,7 @@ "signature": [ "\"HIGH\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -1811,7 +1811,7 @@ "signature": [ "\"CRITICAL\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -1825,7 +1825,7 @@ "signature": [ "\"UNKNOWN\"" ], - "path": "x-pack/packages/kbn-cloud-security-posture/common/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/kbn_cloud_security_posture_common.mdx b/api_docs/kbn_cloud_security_posture_common.mdx index 0c2b73a3a01f3..a0af136379cc8 100644 --- a/api_docs/kbn_cloud_security_posture_common.mdx +++ b/api_docs/kbn_cloud_security_posture_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cloud-security-posture-common title: "@kbn/cloud-security-posture-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cloud-security-posture-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cloud-security-posture-common'] --- import kbnCloudSecurityPostureCommonObj from './kbn_cloud_security_posture_common.devdocs.json'; diff --git a/api_docs/kbn_cloud_security_posture_graph.devdocs.json b/api_docs/kbn_cloud_security_posture_graph.devdocs.json index 00c821750e580..8182f0647e762 100644 --- a/api_docs/kbn_cloud_security_posture_graph.devdocs.json +++ b/api_docs/kbn_cloud_security_posture_graph.devdocs.json @@ -25,7 +25,7 @@ }, ") => React.JSX.Element" ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -45,7 +45,7 @@ "text": "GraphProps" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -68,7 +68,7 @@ "signature": [ "React.FunctionComponent" ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_investigation.tsx", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_investigation.tsx", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -116,7 +116,7 @@ "GraphPopoverProps", ") => React.JSX.Element | null" ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph_popover.tsx", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/graph_popover.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -130,7 +130,7 @@ "signature": [ "GraphPopoverProps" ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph_popover.tsx", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/graph_popover.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -154,7 +154,7 @@ ") => ", "UseFetchGraphDataResult" ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -168,7 +168,7 @@ "signature": [ "UseFetchGraphDataParams" ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -190,7 +190,7 @@ "(id: string) => ", "GraphPopoverState" ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/use_graph_popover.tsx", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/use_graph_popover.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -204,7 +204,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/use_graph_popover.tsx", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/use_graph_popover.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -232,7 +232,7 @@ }, " extends Record,Readonly<{} & { source: string; id: string; color: \"warning\" | \"primary\" | \"danger\"; target: string; }>" ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -255,7 +255,7 @@ }, " extends Record,Readonly<{ label?: string | undefined; icon?: string | undefined; } & { id: string; shape: \"ellipse\" | \"rectangle\" | \"hexagon\" | \"pentagon\" | \"diamond\"; color: \"warning\" | \"primary\" | \"danger\"; }>,BaseNodeDataViewModel" ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -270,7 +270,7 @@ "ExpandButtonClickCallback", " | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/types.ts", "deprecated": false, "trackAdoption": false }, @@ -285,7 +285,7 @@ "NodeClickCallback", " | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/types.ts", "deprecated": false, "trackAdoption": false } @@ -310,7 +310,7 @@ " extends ", "CommonProps" ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -333,7 +333,7 @@ }, "[]" ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx", "deprecated": false, "trackAdoption": false }, @@ -356,7 +356,7 @@ }, "[]" ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx", "deprecated": false, "trackAdoption": false }, @@ -369,7 +369,7 @@ "description": [ "\nDetermines whether the graph is interactive (allows panning, zooming, etc.).\nWhen set to false, the graph is locked and user interactions are disabled, effectively putting it in view-only mode." ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx", "deprecated": false, "trackAdoption": false }, @@ -385,7 +385,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx", "deprecated": false, "trackAdoption": false } @@ -409,7 +409,7 @@ }, " extends Record,Readonly<{ label?: string | undefined; icon?: string | undefined; } & { id: string; shape: \"group\"; }>,BaseNodeDataViewModel" ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -432,7 +432,7 @@ }, " extends Record,Readonly<{ label?: string | undefined; icon?: string | undefined; parentId?: string | undefined; } & { id: string; shape: \"label\"; color: \"warning\" | \"primary\" | \"danger\"; }>,BaseNodeDataViewModel" ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -447,7 +447,7 @@ "ExpandButtonClickCallback", " | undefined" ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/types.ts", "deprecated": false, "trackAdoption": false } @@ -487,7 +487,7 @@ }, ", string>, \"type\" | \"zIndex\" | \"dragging\">> & { isConnectable: boolean; positionAbsoluteX: number; positionAbsoluteY: number; }" ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -524,7 +524,7 @@ "text": "LabelNodeViewModel" } ], - "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/types.ts", + "path": "x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_cloud_security_posture_graph.mdx b/api_docs/kbn_cloud_security_posture_graph.mdx index d1eece16e6e01..57f89be499849 100644 --- a/api_docs/kbn_cloud_security_posture_graph.mdx +++ b/api_docs/kbn_cloud_security_posture_graph.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cloud-security-posture-graph title: "@kbn/cloud-security-posture-graph" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cloud-security-posture-graph plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cloud-security-posture-graph'] --- import kbnCloudSecurityPostureGraphObj from './kbn_cloud_security_posture_graph.devdocs.json'; diff --git a/api_docs/kbn_code_editor.mdx b/api_docs/kbn_code_editor.mdx index c43f8b06d487d..51da7eab9a69b 100644 --- a/api_docs/kbn_code_editor.mdx +++ b/api_docs/kbn_code_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-code-editor title: "@kbn/code-editor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/code-editor plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/code-editor'] --- import kbnCodeEditorObj from './kbn_code_editor.devdocs.json'; diff --git a/api_docs/kbn_code_editor_mock.mdx b/api_docs/kbn_code_editor_mock.mdx index 63eabdfe256fd..42c6830f091af 100644 --- a/api_docs/kbn_code_editor_mock.mdx +++ b/api_docs/kbn_code_editor_mock.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-code-editor-mock title: "@kbn/code-editor-mock" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/code-editor-mock plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/code-editor-mock'] --- import kbnCodeEditorMockObj from './kbn_code_editor_mock.devdocs.json'; diff --git a/api_docs/kbn_code_owners.mdx b/api_docs/kbn_code_owners.mdx index f64de28c3ebbd..92c3541ef322e 100644 --- a/api_docs/kbn_code_owners.mdx +++ b/api_docs/kbn_code_owners.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-code-owners title: "@kbn/code-owners" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/code-owners plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/code-owners'] --- import kbnCodeOwnersObj from './kbn_code_owners.devdocs.json'; diff --git a/api_docs/kbn_coloring.mdx b/api_docs/kbn_coloring.mdx index 4abdaaf9dacbe..3aa968c113880 100644 --- a/api_docs/kbn_coloring.mdx +++ b/api_docs/kbn_coloring.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-coloring title: "@kbn/coloring" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/coloring plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/coloring'] --- import kbnColoringObj from './kbn_coloring.devdocs.json'; diff --git a/api_docs/kbn_config.mdx b/api_docs/kbn_config.mdx index 70afd1e642208..ecffdce22ba2a 100644 --- a/api_docs/kbn_config.mdx +++ b/api_docs/kbn_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config title: "@kbn/config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config'] --- import kbnConfigObj from './kbn_config.devdocs.json'; diff --git a/api_docs/kbn_config_mocks.mdx b/api_docs/kbn_config_mocks.mdx index fdfc5136f6ef8..4962293eb459b 100644 --- a/api_docs/kbn_config_mocks.mdx +++ b/api_docs/kbn_config_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config-mocks title: "@kbn/config-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-mocks'] --- import kbnConfigMocksObj from './kbn_config_mocks.devdocs.json'; diff --git a/api_docs/kbn_config_schema.mdx b/api_docs/kbn_config_schema.mdx index 9f81bb710af15..5752f7b682f1c 100644 --- a/api_docs/kbn_config_schema.mdx +++ b/api_docs/kbn_config_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-config-schema title: "@kbn/config-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/config-schema plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-schema'] --- import kbnConfigSchemaObj from './kbn_config_schema.devdocs.json'; diff --git a/api_docs/kbn_content_management_content_editor.mdx b/api_docs/kbn_content_management_content_editor.mdx index bd0d6bc3bf088..13696b7289e72 100644 --- a/api_docs/kbn_content_management_content_editor.mdx +++ b/api_docs/kbn_content_management_content_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-content-editor title: "@kbn/content-management-content-editor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-content-editor plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-content-editor'] --- import kbnContentManagementContentEditorObj from './kbn_content_management_content_editor.devdocs.json'; diff --git a/api_docs/kbn_content_management_content_insights_public.mdx b/api_docs/kbn_content_management_content_insights_public.mdx index 31a376e92f705..d9589fbecf217 100644 --- a/api_docs/kbn_content_management_content_insights_public.mdx +++ b/api_docs/kbn_content_management_content_insights_public.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-content-insights-public title: "@kbn/content-management-content-insights-public" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-content-insights-public plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-content-insights-public'] --- import kbnContentManagementContentInsightsPublicObj from './kbn_content_management_content_insights_public.devdocs.json'; diff --git a/api_docs/kbn_content_management_content_insights_server.mdx b/api_docs/kbn_content_management_content_insights_server.mdx index 1834886e8b74e..eee4990198efa 100644 --- a/api_docs/kbn_content_management_content_insights_server.mdx +++ b/api_docs/kbn_content_management_content_insights_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-content-insights-server title: "@kbn/content-management-content-insights-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-content-insights-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-content-insights-server'] --- import kbnContentManagementContentInsightsServerObj from './kbn_content_management_content_insights_server.devdocs.json'; diff --git a/api_docs/kbn_content_management_favorites_common.mdx b/api_docs/kbn_content_management_favorites_common.mdx index d2754dbde5580..1334c287819f1 100644 --- a/api_docs/kbn_content_management_favorites_common.mdx +++ b/api_docs/kbn_content_management_favorites_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-favorites-common title: "@kbn/content-management-favorites-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-favorites-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-favorites-common'] --- import kbnContentManagementFavoritesCommonObj from './kbn_content_management_favorites_common.devdocs.json'; diff --git a/api_docs/kbn_content_management_favorites_public.mdx b/api_docs/kbn_content_management_favorites_public.mdx index df1af7664e62a..7bf30f3c2975c 100644 --- a/api_docs/kbn_content_management_favorites_public.mdx +++ b/api_docs/kbn_content_management_favorites_public.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-favorites-public title: "@kbn/content-management-favorites-public" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-favorites-public plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-favorites-public'] --- import kbnContentManagementFavoritesPublicObj from './kbn_content_management_favorites_public.devdocs.json'; diff --git a/api_docs/kbn_content_management_favorites_server.mdx b/api_docs/kbn_content_management_favorites_server.mdx index 950155b5b250b..39b7c58d355a3 100644 --- a/api_docs/kbn_content_management_favorites_server.mdx +++ b/api_docs/kbn_content_management_favorites_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-favorites-server title: "@kbn/content-management-favorites-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-favorites-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-favorites-server'] --- import kbnContentManagementFavoritesServerObj from './kbn_content_management_favorites_server.devdocs.json'; diff --git a/api_docs/kbn_content_management_tabbed_table_list_view.mdx b/api_docs/kbn_content_management_tabbed_table_list_view.mdx index b39ef5da4e7bb..68d3af1c66e82 100644 --- a/api_docs/kbn_content_management_tabbed_table_list_view.mdx +++ b/api_docs/kbn_content_management_tabbed_table_list_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-tabbed-table-list-view title: "@kbn/content-management-tabbed-table-list-view" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-tabbed-table-list-view plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-tabbed-table-list-view'] --- import kbnContentManagementTabbedTableListViewObj from './kbn_content_management_tabbed_table_list_view.devdocs.json'; diff --git a/api_docs/kbn_content_management_table_list_view.mdx b/api_docs/kbn_content_management_table_list_view.mdx index 94634dfa9a0a2..76702d1a75e67 100644 --- a/api_docs/kbn_content_management_table_list_view.mdx +++ b/api_docs/kbn_content_management_table_list_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-table-list-view title: "@kbn/content-management-table-list-view" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-table-list-view plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-table-list-view'] --- import kbnContentManagementTableListViewObj from './kbn_content_management_table_list_view.devdocs.json'; diff --git a/api_docs/kbn_content_management_table_list_view_common.mdx b/api_docs/kbn_content_management_table_list_view_common.mdx index 699bea7ce2960..0f8b7bc764589 100644 --- a/api_docs/kbn_content_management_table_list_view_common.mdx +++ b/api_docs/kbn_content_management_table_list_view_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-table-list-view-common title: "@kbn/content-management-table-list-view-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-table-list-view-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-table-list-view-common'] --- import kbnContentManagementTableListViewCommonObj from './kbn_content_management_table_list_view_common.devdocs.json'; diff --git a/api_docs/kbn_content_management_table_list_view_table.mdx b/api_docs/kbn_content_management_table_list_view_table.mdx index 725de292c5b45..717ed752fb5e1 100644 --- a/api_docs/kbn_content_management_table_list_view_table.mdx +++ b/api_docs/kbn_content_management_table_list_view_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-table-list-view-table title: "@kbn/content-management-table-list-view-table" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-table-list-view-table plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-table-list-view-table'] --- import kbnContentManagementTableListViewTableObj from './kbn_content_management_table_list_view_table.devdocs.json'; diff --git a/api_docs/kbn_content_management_user_profiles.mdx b/api_docs/kbn_content_management_user_profiles.mdx index dbf2b7f36dcc6..6b3279205282d 100644 --- a/api_docs/kbn_content_management_user_profiles.mdx +++ b/api_docs/kbn_content_management_user_profiles.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-user-profiles title: "@kbn/content-management-user-profiles" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-user-profiles plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-user-profiles'] --- import kbnContentManagementUserProfilesObj from './kbn_content_management_user_profiles.devdocs.json'; diff --git a/api_docs/kbn_content_management_utils.mdx b/api_docs/kbn_content_management_utils.mdx index dee78364d5e13..de9084e5f2a04 100644 --- a/api_docs/kbn_content_management_utils.mdx +++ b/api_docs/kbn_content_management_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-utils title: "@kbn/content-management-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-utils'] --- import kbnContentManagementUtilsObj from './kbn_content_management_utils.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser.devdocs.json b/api_docs/kbn_core_analytics_browser.devdocs.json index d16c4135f6e27..bf03226292177 100644 --- a/api_docs/kbn_core_analytics_browser.devdocs.json +++ b/api_docs/kbn_core_analytics_browser.devdocs.json @@ -658,10 +658,6 @@ "plugin": "discover", "path": "src/plugins/discover/public/services/discover_ebt_manager.ts" }, - { - "plugin": "integrationAssistant", - "path": "x-pack/platform/plugins/shared/integration_assistant/public/services/telemetry/service.ts" - }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/telemetry/fleet_usage_sender.ts" @@ -702,6 +698,10 @@ "plugin": "datasetQuality", "path": "x-pack/plugins/observability_solution/dataset_quality/public/services/telemetry/telemetry_client.ts" }, + { + "plugin": "integrationAssistant", + "path": "x-pack/platform/plugins/shared/integration_assistant/public/services/telemetry/service.ts" + }, { "plugin": "globalSearchBar", "path": "x-pack/plugins/global_search_bar/public/telemetry/event_reporter.ts" @@ -718,138 +718,6 @@ "plugin": "searchPlayground", "path": "x-pack/plugins/search_playground/server/routes.ts" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.ts" - }, - { - "plugin": "osquery", - "path": "x-pack/platform/plugins/shared/osquery/server/lib/telemetry/sender.ts" - }, - { - "plugin": "osquery", - "path": "x-pack/platform/plugins/shared/osquery/server/lib/telemetry/sender.ts" - }, - { - "plugin": "osquery", - "path": "x-pack/platform/plugins/shared/osquery/server/lib/telemetry/sender.ts" - }, - { - "plugin": "osquery", - "path": "x-pack/platform/plugins/shared/osquery/server/lib/telemetry/sender.ts" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/create_knowledge_base_entry.ts" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/create_knowledge_base_entry.ts" - }, - { - "plugin": "@kbn/langchain", - "path": "x-pack/platform/packages/shared/kbn-langchain/server/tracers/telemetry/telemetry_tracer.ts" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/helpers/helpers.ts" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/helpers/helpers.ts" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/handle_graph_error/index.tsx" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/handle_graph_error/index.tsx" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/bulk_actions_route.ts" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/helpers.ts" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/helpers.ts" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/helpers.ts" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/helpers.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/task/field_retention_enrichment_task.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/task/field_retention_enrichment_task.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upload_csv.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upload_csv.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/telemetry/async_sender.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/lib/telemetry/telemetry_service.ts" - }, - { - "plugin": "securitySolutionServerless", - "path": "x-pack/plugins/security_solution_serverless/server/task_manager/nlp_cleanup_task/nlp_cleanup_task.ts" - }, - { - "plugin": "securitySolutionServerless", - "path": "x-pack/plugins/security_solution_serverless/server/task_manager/nlp_cleanup_task/nlp_cleanup_task.ts" - }, { "plugin": "apm", "path": "x-pack/plugins/observability_solution/apm/public/services/telemetry/telemetry_client.ts" @@ -1000,51 +868,127 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/telemetry_service.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/platform/plugins/shared/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/platform/plugins/shared/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/platform/plugins/shared/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/platform/plugins/shared/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/create_knowledge_base_entry.ts" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/create_knowledge_base_entry.ts" + }, + { + "plugin": "@kbn/langchain", + "path": "x-pack/platform/packages/shared/kbn-langchain/server/tracers/telemetry/telemetry_tracer.ts" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/helpers/helpers.ts" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/helpers/helpers.ts" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/handle_graph_error/index.tsx" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/handle_graph_error/index.tsx" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/bulk_actions_route.ts" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/helpers.ts" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/helpers.ts" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/helpers.ts" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/task/field_retention_enrichment_task.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/task/field_retention_enrichment_task.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upload_csv.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upload_csv.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/async_sender.ts" }, { "plugin": "@kbn/langchain", @@ -1058,6 +1002,62 @@ "plugin": "observabilityAIAssistant", "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/service/create_chat_service.test.ts" }, + { + "plugin": "securitySolutionServerless", + "path": "x-pack/solutions/security/plugins/security_solution_serverless/server/task_manager/nlp_cleanup_task/nlp_cleanup_task.ts" + }, + { + "plugin": "securitySolutionServerless", + "path": "x-pack/solutions/security/plugins/security_solution_serverless/server/task_manager/nlp_cleanup_task/nlp_cleanup_task.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + }, { "plugin": "@kbn/shared-ux-chrome-navigation", "path": "packages/shared-ux/chrome/navigation/mocks/storybook.ts" @@ -1068,43 +1068,43 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" }, { "plugin": "discover", @@ -1456,11 +1456,11 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/lib/telemetry/telemetry_service.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/telemetry_service.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/lib/telemetry/telemetry_service.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/telemetry_service.test.ts" }, { "plugin": "@kbn/core-status-server-internal", @@ -1890,7 +1890,7 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/lib/telemetry/telemetry_service.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/telemetry_service.ts" }, { "plugin": "@kbn/core-analytics-browser-mocks", diff --git a/api_docs/kbn_core_analytics_browser.mdx b/api_docs/kbn_core_analytics_browser.mdx index 31da86b47f842..ec42a08d02704 100644 --- a/api_docs/kbn_core_analytics_browser.mdx +++ b/api_docs/kbn_core_analytics_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser title: "@kbn/core-analytics-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser'] --- import kbnCoreAnalyticsBrowserObj from './kbn_core_analytics_browser.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser_internal.mdx b/api_docs/kbn_core_analytics_browser_internal.mdx index b3e9b0f6e82be..d458b417b67ce 100644 --- a/api_docs/kbn_core_analytics_browser_internal.mdx +++ b/api_docs/kbn_core_analytics_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-internal title: "@kbn/core-analytics-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-internal'] --- import kbnCoreAnalyticsBrowserInternalObj from './kbn_core_analytics_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser_mocks.mdx b/api_docs/kbn_core_analytics_browser_mocks.mdx index ff660dbb3707f..418325f166366 100644 --- a/api_docs/kbn_core_analytics_browser_mocks.mdx +++ b/api_docs/kbn_core_analytics_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-browser-mocks title: "@kbn/core-analytics-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-browser-mocks'] --- import kbnCoreAnalyticsBrowserMocksObj from './kbn_core_analytics_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server.devdocs.json b/api_docs/kbn_core_analytics_server.devdocs.json index 9c703bb4489c9..793e015584e48 100644 --- a/api_docs/kbn_core_analytics_server.devdocs.json +++ b/api_docs/kbn_core_analytics_server.devdocs.json @@ -666,10 +666,6 @@ "plugin": "discover", "path": "src/plugins/discover/public/services/discover_ebt_manager.ts" }, - { - "plugin": "integrationAssistant", - "path": "x-pack/platform/plugins/shared/integration_assistant/public/services/telemetry/service.ts" - }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/telemetry/fleet_usage_sender.ts" @@ -710,6 +706,10 @@ "plugin": "datasetQuality", "path": "x-pack/plugins/observability_solution/dataset_quality/public/services/telemetry/telemetry_client.ts" }, + { + "plugin": "integrationAssistant", + "path": "x-pack/platform/plugins/shared/integration_assistant/public/services/telemetry/service.ts" + }, { "plugin": "globalSearchBar", "path": "x-pack/plugins/global_search_bar/public/telemetry/event_reporter.ts" @@ -726,138 +726,6 @@ "plugin": "searchPlayground", "path": "x-pack/plugins/search_playground/server/routes.ts" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.ts" - }, - { - "plugin": "osquery", - "path": "x-pack/platform/plugins/shared/osquery/server/lib/telemetry/sender.ts" - }, - { - "plugin": "osquery", - "path": "x-pack/platform/plugins/shared/osquery/server/lib/telemetry/sender.ts" - }, - { - "plugin": "osquery", - "path": "x-pack/platform/plugins/shared/osquery/server/lib/telemetry/sender.ts" - }, - { - "plugin": "osquery", - "path": "x-pack/platform/plugins/shared/osquery/server/lib/telemetry/sender.ts" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/create_knowledge_base_entry.ts" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/create_knowledge_base_entry.ts" - }, - { - "plugin": "@kbn/langchain", - "path": "x-pack/platform/packages/shared/kbn-langchain/server/tracers/telemetry/telemetry_tracer.ts" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/helpers/helpers.ts" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/helpers/helpers.ts" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/handle_graph_error/index.tsx" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/handle_graph_error/index.tsx" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/bulk_actions_route.ts" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/helpers.ts" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/helpers.ts" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/helpers.ts" - }, - { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/helpers.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/task/field_retention_enrichment_task.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/task/field_retention_enrichment_task.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upload_csv.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upload_csv.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/telemetry/async_sender.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/lib/telemetry/telemetry_service.ts" - }, - { - "plugin": "securitySolutionServerless", - "path": "x-pack/plugins/security_solution_serverless/server/task_manager/nlp_cleanup_task/nlp_cleanup_task.ts" - }, - { - "plugin": "securitySolutionServerless", - "path": "x-pack/plugins/security_solution_serverless/server/task_manager/nlp_cleanup_task/nlp_cleanup_task.ts" - }, { "plugin": "apm", "path": "x-pack/plugins/observability_solution/apm/public/services/telemetry/telemetry_client.ts" @@ -1008,51 +876,127 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/telemetry_service.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/platform/plugins/shared/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/platform/plugins/shared/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/platform/plugins/shared/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "osquery", + "path": "x-pack/platform/plugins/shared/osquery/server/lib/telemetry/sender.ts" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/create_knowledge_base_entry.ts" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/create_knowledge_base_entry.ts" + }, + { + "plugin": "@kbn/langchain", + "path": "x-pack/platform/packages/shared/kbn-langchain/server/tracers/telemetry/telemetry_tracer.ts" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/helpers/helpers.ts" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/helpers/helpers.ts" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/handle_graph_error/index.tsx" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/helpers/handle_graph_error/index.tsx" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/bulk_actions_route.ts" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/helpers.ts" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/helpers.ts" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/helpers.ts" + }, + { + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/helpers.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/task/field_retention_enrichment_task.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/task/field_retention_enrichment_task.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upload_csv.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upload_csv.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/async_sender.ts" }, { "plugin": "@kbn/langchain", @@ -1066,6 +1010,62 @@ "plugin": "observabilityAIAssistant", "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/service/create_chat_service.test.ts" }, + { + "plugin": "securitySolutionServerless", + "path": "x-pack/solutions/security/plugins/security_solution_serverless/server/task_manager/nlp_cleanup_task/nlp_cleanup_task.ts" + }, + { + "plugin": "securitySolutionServerless", + "path": "x-pack/solutions/security/plugins/security_solution_serverless/server/task_manager/nlp_cleanup_task/nlp_cleanup_task.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts" + }, { "plugin": "@kbn/shared-ux-chrome-navigation", "path": "packages/shared-ux/chrome/navigation/mocks/storybook.ts" @@ -1076,43 +1076,43 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts" }, { "plugin": "discover", @@ -1464,11 +1464,11 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/lib/telemetry/telemetry_service.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/telemetry_service.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/lib/telemetry/telemetry_service.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/telemetry_service.test.ts" }, { "plugin": "@kbn/core-status-server-internal", @@ -1898,7 +1898,7 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/lib/telemetry/telemetry_service.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/telemetry_service.ts" }, { "plugin": "@kbn/core-analytics-browser-mocks", diff --git a/api_docs/kbn_core_analytics_server.mdx b/api_docs/kbn_core_analytics_server.mdx index 5946e5c4ca73c..cf9514a0989ec 100644 --- a/api_docs/kbn_core_analytics_server.mdx +++ b/api_docs/kbn_core_analytics_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server title: "@kbn/core-analytics-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server'] --- import kbnCoreAnalyticsServerObj from './kbn_core_analytics_server.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server_internal.mdx b/api_docs/kbn_core_analytics_server_internal.mdx index 5afef0eebdeca..f88847571ef63 100644 --- a/api_docs/kbn_core_analytics_server_internal.mdx +++ b/api_docs/kbn_core_analytics_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-internal title: "@kbn/core-analytics-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-internal'] --- import kbnCoreAnalyticsServerInternalObj from './kbn_core_analytics_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_server_mocks.mdx b/api_docs/kbn_core_analytics_server_mocks.mdx index 0f340c367902d..da6bd5b6d2708 100644 --- a/api_docs/kbn_core_analytics_server_mocks.mdx +++ b/api_docs/kbn_core_analytics_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-analytics-server-mocks title: "@kbn/core-analytics-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-analytics-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-mocks'] --- import kbnCoreAnalyticsServerMocksObj from './kbn_core_analytics_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser.devdocs.json b/api_docs/kbn_core_application_browser.devdocs.json index daeae67d01d90..819f37d9483e0 100644 --- a/api_docs/kbn_core_application_browser.devdocs.json +++ b/api_docs/kbn_core_application_browser.devdocs.json @@ -1201,10 +1201,6 @@ "plugin": "management", "path": "src/platform/plugins/shared/management/public/application.tsx" }, - { - "plugin": "assetInventory", - "path": "x-pack/plugins/asset_inventory/public/application.tsx" - }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/public/applications/integrations/index.tsx" @@ -1213,6 +1209,10 @@ "plugin": "security", "path": "x-pack/plugins/security/public/authentication/logout/logout_app.test.ts" }, + { + "plugin": "assetInventory", + "path": "x-pack/solutions/security/plugins/asset_inventory/public/application.tsx" + }, { "plugin": "kibanaOverview", "path": "src/plugins/kibana_overview/public/application.tsx" diff --git a/api_docs/kbn_core_application_browser.mdx b/api_docs/kbn_core_application_browser.mdx index 947e84d0798d5..e42e79b29864a 100644 --- a/api_docs/kbn_core_application_browser.mdx +++ b/api_docs/kbn_core_application_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser title: "@kbn/core-application-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser'] --- import kbnCoreApplicationBrowserObj from './kbn_core_application_browser.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser_internal.mdx b/api_docs/kbn_core_application_browser_internal.mdx index f115c851fd15f..b1bd772e93abb 100644 --- a/api_docs/kbn_core_application_browser_internal.mdx +++ b/api_docs/kbn_core_application_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser-internal title: "@kbn/core-application-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser-internal'] --- import kbnCoreApplicationBrowserInternalObj from './kbn_core_application_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser_mocks.mdx b/api_docs/kbn_core_application_browser_mocks.mdx index 6d8a44fac7bd6..be852751b7082 100644 --- a/api_docs/kbn_core_application_browser_mocks.mdx +++ b/api_docs/kbn_core_application_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-browser-mocks title: "@kbn/core-application-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-browser-mocks'] --- import kbnCoreApplicationBrowserMocksObj from './kbn_core_application_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_application_common.mdx b/api_docs/kbn_core_application_common.mdx index 08fa9bc4f9631..ee6878afe39f3 100644 --- a/api_docs/kbn_core_application_common.mdx +++ b/api_docs/kbn_core_application_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-application-common title: "@kbn/core-application-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-application-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-application-common'] --- import kbnCoreApplicationCommonObj from './kbn_core_application_common.devdocs.json'; diff --git a/api_docs/kbn_core_apps_browser_internal.mdx b/api_docs/kbn_core_apps_browser_internal.mdx index 46fff43ec3c19..22d4fef14bc3c 100644 --- a/api_docs/kbn_core_apps_browser_internal.mdx +++ b/api_docs/kbn_core_apps_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-apps-browser-internal title: "@kbn/core-apps-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-apps-browser-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-apps-browser-internal'] --- import kbnCoreAppsBrowserInternalObj from './kbn_core_apps_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_apps_browser_mocks.mdx b/api_docs/kbn_core_apps_browser_mocks.mdx index 8c28b80e6e95a..20bff3a309af7 100644 --- a/api_docs/kbn_core_apps_browser_mocks.mdx +++ b/api_docs/kbn_core_apps_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-apps-browser-mocks title: "@kbn/core-apps-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-apps-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-apps-browser-mocks'] --- import kbnCoreAppsBrowserMocksObj from './kbn_core_apps_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_apps_server_internal.mdx b/api_docs/kbn_core_apps_server_internal.mdx index 66224e37c7e05..6eca6c33a8ccb 100644 --- a/api_docs/kbn_core_apps_server_internal.mdx +++ b/api_docs/kbn_core_apps_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-apps-server-internal title: "@kbn/core-apps-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-apps-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-apps-server-internal'] --- import kbnCoreAppsServerInternalObj from './kbn_core_apps_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_base_browser_mocks.mdx b/api_docs/kbn_core_base_browser_mocks.mdx index d7b9a63a8c287..4c6165965bc84 100644 --- a/api_docs/kbn_core_base_browser_mocks.mdx +++ b/api_docs/kbn_core_base_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-browser-mocks title: "@kbn/core-base-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-browser-mocks'] --- import kbnCoreBaseBrowserMocksObj from './kbn_core_base_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_base_common.mdx b/api_docs/kbn_core_base_common.mdx index a8c3461e0e123..2cb1cb1bfbb6d 100644 --- a/api_docs/kbn_core_base_common.mdx +++ b/api_docs/kbn_core_base_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-common title: "@kbn/core-base-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-common'] --- import kbnCoreBaseCommonObj from './kbn_core_base_common.devdocs.json'; diff --git a/api_docs/kbn_core_base_server_internal.mdx b/api_docs/kbn_core_base_server_internal.mdx index 4f3a2748b387f..d5539d9d03f32 100644 --- a/api_docs/kbn_core_base_server_internal.mdx +++ b/api_docs/kbn_core_base_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-internal title: "@kbn/core-base-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-internal'] --- import kbnCoreBaseServerInternalObj from './kbn_core_base_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_base_server_mocks.mdx b/api_docs/kbn_core_base_server_mocks.mdx index 46f586828c41e..d4ce02842586e 100644 --- a/api_docs/kbn_core_base_server_mocks.mdx +++ b/api_docs/kbn_core_base_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-base-server-mocks title: "@kbn/core-base-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-base-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-base-server-mocks'] --- import kbnCoreBaseServerMocksObj from './kbn_core_base_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_browser_mocks.mdx b/api_docs/kbn_core_capabilities_browser_mocks.mdx index feee079e1c9ff..a50635b75572e 100644 --- a/api_docs/kbn_core_capabilities_browser_mocks.mdx +++ b/api_docs/kbn_core_capabilities_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-browser-mocks title: "@kbn/core-capabilities-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-browser-mocks'] --- import kbnCoreCapabilitiesBrowserMocksObj from './kbn_core_capabilities_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_common.mdx b/api_docs/kbn_core_capabilities_common.mdx index 569e0d504e075..925cb415d1cfa 100644 --- a/api_docs/kbn_core_capabilities_common.mdx +++ b/api_docs/kbn_core_capabilities_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-common title: "@kbn/core-capabilities-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-common'] --- import kbnCoreCapabilitiesCommonObj from './kbn_core_capabilities_common.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_server.mdx b/api_docs/kbn_core_capabilities_server.mdx index 6dbda048a4fd0..e1b81ff15c914 100644 --- a/api_docs/kbn_core_capabilities_server.mdx +++ b/api_docs/kbn_core_capabilities_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-server title: "@kbn/core-capabilities-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-server'] --- import kbnCoreCapabilitiesServerObj from './kbn_core_capabilities_server.devdocs.json'; diff --git a/api_docs/kbn_core_capabilities_server_mocks.mdx b/api_docs/kbn_core_capabilities_server_mocks.mdx index 94a80c824391e..3606dd0ce9f08 100644 --- a/api_docs/kbn_core_capabilities_server_mocks.mdx +++ b/api_docs/kbn_core_capabilities_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-capabilities-server-mocks title: "@kbn/core-capabilities-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-capabilities-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-capabilities-server-mocks'] --- import kbnCoreCapabilitiesServerMocksObj from './kbn_core_capabilities_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_chrome_browser.mdx b/api_docs/kbn_core_chrome_browser.mdx index 6c583e21f241c..311a46f390b97 100644 --- a/api_docs/kbn_core_chrome_browser.mdx +++ b/api_docs/kbn_core_chrome_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-chrome-browser title: "@kbn/core-chrome-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-chrome-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-chrome-browser'] --- import kbnCoreChromeBrowserObj from './kbn_core_chrome_browser.devdocs.json'; diff --git a/api_docs/kbn_core_chrome_browser_mocks.mdx b/api_docs/kbn_core_chrome_browser_mocks.mdx index fdf7b38e98038..b1958014e7185 100644 --- a/api_docs/kbn_core_chrome_browser_mocks.mdx +++ b/api_docs/kbn_core_chrome_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-chrome-browser-mocks title: "@kbn/core-chrome-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-chrome-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-chrome-browser-mocks'] --- import kbnCoreChromeBrowserMocksObj from './kbn_core_chrome_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_config_server_internal.mdx b/api_docs/kbn_core_config_server_internal.mdx index b15c6f5b56a9c..daf0830364eac 100644 --- a/api_docs/kbn_core_config_server_internal.mdx +++ b/api_docs/kbn_core_config_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-config-server-internal title: "@kbn/core-config-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-config-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-config-server-internal'] --- import kbnCoreConfigServerInternalObj from './kbn_core_config_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_browser.mdx b/api_docs/kbn_core_custom_branding_browser.mdx index 4f08884e5c409..7750750c2a942 100644 --- a/api_docs/kbn_core_custom_branding_browser.mdx +++ b/api_docs/kbn_core_custom_branding_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-browser title: "@kbn/core-custom-branding-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-browser'] --- import kbnCoreCustomBrandingBrowserObj from './kbn_core_custom_branding_browser.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_browser_internal.mdx b/api_docs/kbn_core_custom_branding_browser_internal.mdx index bd883163bf8c5..632e1bb3c9045 100644 --- a/api_docs/kbn_core_custom_branding_browser_internal.mdx +++ b/api_docs/kbn_core_custom_branding_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-browser-internal title: "@kbn/core-custom-branding-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-browser-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-browser-internal'] --- import kbnCoreCustomBrandingBrowserInternalObj from './kbn_core_custom_branding_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_browser_mocks.mdx b/api_docs/kbn_core_custom_branding_browser_mocks.mdx index 2da4b387f6137..eeb1da499cc04 100644 --- a/api_docs/kbn_core_custom_branding_browser_mocks.mdx +++ b/api_docs/kbn_core_custom_branding_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-browser-mocks title: "@kbn/core-custom-branding-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-browser-mocks'] --- import kbnCoreCustomBrandingBrowserMocksObj from './kbn_core_custom_branding_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_common.mdx b/api_docs/kbn_core_custom_branding_common.mdx index 543fb4c73aaad..79d15f300845d 100644 --- a/api_docs/kbn_core_custom_branding_common.mdx +++ b/api_docs/kbn_core_custom_branding_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-common title: "@kbn/core-custom-branding-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-common'] --- import kbnCoreCustomBrandingCommonObj from './kbn_core_custom_branding_common.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_server.mdx b/api_docs/kbn_core_custom_branding_server.mdx index d1738e513bb66..de541b85656e8 100644 --- a/api_docs/kbn_core_custom_branding_server.mdx +++ b/api_docs/kbn_core_custom_branding_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-server title: "@kbn/core-custom-branding-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-server'] --- import kbnCoreCustomBrandingServerObj from './kbn_core_custom_branding_server.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_server_internal.mdx b/api_docs/kbn_core_custom_branding_server_internal.mdx index 238536855f615..4622e643d6191 100644 --- a/api_docs/kbn_core_custom_branding_server_internal.mdx +++ b/api_docs/kbn_core_custom_branding_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-server-internal title: "@kbn/core-custom-branding-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-server-internal'] --- import kbnCoreCustomBrandingServerInternalObj from './kbn_core_custom_branding_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_custom_branding_server_mocks.mdx b/api_docs/kbn_core_custom_branding_server_mocks.mdx index 3e31772f178c3..eea6d3646333d 100644 --- a/api_docs/kbn_core_custom_branding_server_mocks.mdx +++ b/api_docs/kbn_core_custom_branding_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-custom-branding-server-mocks title: "@kbn/core-custom-branding-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-custom-branding-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-custom-branding-server-mocks'] --- import kbnCoreCustomBrandingServerMocksObj from './kbn_core_custom_branding_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser.mdx b/api_docs/kbn_core_deprecations_browser.mdx index 87c9cb1546a6f..f4ec02ab408d4 100644 --- a/api_docs/kbn_core_deprecations_browser.mdx +++ b/api_docs/kbn_core_deprecations_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser title: "@kbn/core-deprecations-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser'] --- import kbnCoreDeprecationsBrowserObj from './kbn_core_deprecations_browser.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser_internal.mdx b/api_docs/kbn_core_deprecations_browser_internal.mdx index 1e0162d07a16a..9e57ad8e5c4ca 100644 --- a/api_docs/kbn_core_deprecations_browser_internal.mdx +++ b/api_docs/kbn_core_deprecations_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser-internal title: "@kbn/core-deprecations-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser-internal'] --- import kbnCoreDeprecationsBrowserInternalObj from './kbn_core_deprecations_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_browser_mocks.mdx b/api_docs/kbn_core_deprecations_browser_mocks.mdx index 5142a55157a13..9c984acbfd63c 100644 --- a/api_docs/kbn_core_deprecations_browser_mocks.mdx +++ b/api_docs/kbn_core_deprecations_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-browser-mocks title: "@kbn/core-deprecations-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-browser-mocks'] --- import kbnCoreDeprecationsBrowserMocksObj from './kbn_core_deprecations_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_common.mdx b/api_docs/kbn_core_deprecations_common.mdx index 7e14b409f6ce4..3b86527e129d9 100644 --- a/api_docs/kbn_core_deprecations_common.mdx +++ b/api_docs/kbn_core_deprecations_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-common title: "@kbn/core-deprecations-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-common'] --- import kbnCoreDeprecationsCommonObj from './kbn_core_deprecations_common.devdocs.json'; diff --git a/api_docs/kbn_core_deprecations_server.devdocs.json b/api_docs/kbn_core_deprecations_server.devdocs.json index 7bc0576b69422..493dc3a2cca43 100644 --- a/api_docs/kbn_core_deprecations_server.devdocs.json +++ b/api_docs/kbn_core_deprecations_server.devdocs.json @@ -18,7 +18,9 @@ "type": "Interface", "tags": [], "label": "DeprecationRegistryProvider", - "description": [], + "description": [ + "\nProvides a method to scope the {@link DeprecationsServiceSetup | Deprecations Service} to a specific domain." + ], "path": "packages/core/deprecations/core-deprecations-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, @@ -29,7 +31,9 @@ "type": "Function", "tags": [], "label": "getRegistry", - "description": [], + "description": [ + "\nReturns the {@link DeprecationsServiceSetup | Deprecations Service} scoped to a specific domain." + ], "signature": [ "(domainId: string) => ", { @@ -50,7 +54,9 @@ "type": "string", "tags": [], "label": "domainId", - "description": [], + "description": [ + "Domain ID to categorize the deprecations reported under it." + ], "signature": [ "string" ], @@ -84,7 +90,9 @@ "type": "Function", "tags": [], "label": "getAllDeprecations", - "description": [], + "description": [ + "\nFetch all Kibana deprecations." + ], "signature": [ "() => Promise<", { @@ -132,7 +140,9 @@ "type": "Object", "tags": [], "label": "client", - "description": [], + "description": [ + "\n{@link DeprecationsClient | Deprecations client} exposed in the request handler context." + ], "signature": [ { "pluginId": "@kbn/core-deprecations-server", @@ -168,7 +178,9 @@ "type": "Function", "tags": [], "label": "registerDeprecations", - "description": [], + "description": [ + "\nRegisters deprecation messages or notices for a specific feature or functionality\nwithin the application. This allows developers to flag certain behaviors or APIs\nas deprecated, providing guidance and warnings for future deprecation plans.\n" + ], "signature": [ "(deprecationContext: ", { @@ -190,7 +202,9 @@ "type": "Object", "tags": [], "label": "deprecationContext", - "description": [], + "description": [ + "- The configuration object containing\ninformation about the deprecated features, including messages, corrective actions,\nand any relevant metadata to inform users or developers about the deprecation." + ], "signature": [ { "pluginId": "@kbn/core-deprecations-server", @@ -217,7 +231,9 @@ "type": "Interface", "tags": [], "label": "GetDeprecationsContext", - "description": [], + "description": [ + "\nScoped clients and helpers to ease fetching the deprecations." + ], "path": "packages/core/deprecations/core-deprecations-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, @@ -228,7 +244,9 @@ "type": "Object", "tags": [], "label": "esClient", - "description": [], + "description": [ + "Elasticsearch client scoped to the current user" + ], "signature": [ { "pluginId": "@kbn/core-elasticsearch-server", @@ -248,7 +266,9 @@ "type": "Object", "tags": [], "label": "savedObjectsClient", - "description": [], + "description": [ + "Saved Objects client scoped to the current user and space" + ], "signature": [ { "pluginId": "@kbn/core-saved-objects-api-server", @@ -261,6 +281,27 @@ "path": "packages/core/deprecations/core-deprecations-server/src/contracts.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-deprecations-server", + "id": "def-server.GetDeprecationsContext.request", + "type": "Object", + "tags": [], + "label": "request", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, + "" + ], + "path": "packages/core/deprecations/core-deprecations-server/src/contracts.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -271,7 +312,9 @@ "type": "Interface", "tags": [], "label": "RegisterDeprecationsConfig", - "description": [], + "description": [ + "\nOptions to provide when registering deprecations via {@link DeprecationsServiceSetup.registerDeprecations}." + ], "path": "packages/core/deprecations/core-deprecations-server/src/contracts.ts", "deprecated": false, "trackAdoption": false, @@ -282,7 +325,9 @@ "type": "Function", "tags": [], "label": "getDeprecations", - "description": [], + "description": [ + "\nMethod called when the user wants to list any existing deprecations.\nReturns the list of deprecation messages to warn about." + ], "signature": [ "(context: ", { @@ -320,7 +365,9 @@ "type": "Object", "tags": [], "label": "context", - "description": [], + "description": [ + "Scoped clients and helpers to ease fetching the deprecations." + ], "signature": [ { "pluginId": "@kbn/core-deprecations-server", diff --git a/api_docs/kbn_core_deprecations_server.mdx b/api_docs/kbn_core_deprecations_server.mdx index 0b00c4e9d2395..fc11d0fac8103 100644 --- a/api_docs/kbn_core_deprecations_server.mdx +++ b/api_docs/kbn_core_deprecations_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server title: "@kbn/core-deprecations-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server'] --- import kbnCoreDeprecationsServerObj from './kbn_core_deprecations_server.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 16 | 0 | 13 | 0 | +| 17 | 0 | 1 | 0 | ## Server diff --git a/api_docs/kbn_core_deprecations_server_internal.devdocs.json b/api_docs/kbn_core_deprecations_server_internal.devdocs.json index 438b29f186d86..536d20bf570c2 100644 --- a/api_docs/kbn_core_deprecations_server_internal.devdocs.json +++ b/api_docs/kbn_core_deprecations_server_internal.devdocs.json @@ -18,7 +18,9 @@ "type": "Interface", "tags": [], "label": "InternalDeprecationsServiceStart", - "description": [], + "description": [ + "\nDeprecation Service: Internal Start contract" + ], "path": "packages/core/deprecations/core-deprecations-server-internal/src/deprecations_service.ts", "deprecated": false, "trackAdoption": false, @@ -30,7 +32,7 @@ "tags": [], "label": "asScopedToClient", "description": [ - "\nCreates a {@link DeprecationsClient} with provided SO client and ES client.\n" + "\nCreates a {@link DeprecationsClient} with provided SO client and ES client." ], "signature": [ "(esClient: ", @@ -49,7 +51,15 @@ "section": "def-server.SavedObjectsClientContract", "text": "SavedObjectsClientContract" }, - ") => ", + ", request: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, + ") => ", { "pluginId": "@kbn/core-deprecations-server", "scope": "server", @@ -68,7 +78,9 @@ "type": "Object", "tags": [], "label": "esClient", - "description": [], + "description": [ + "Scoped Elasticsearch client" + ], "signature": [ { "pluginId": "@kbn/core-elasticsearch-server", @@ -89,7 +101,9 @@ "type": "Object", "tags": [], "label": "savedObjectsClient", - "description": [], + "description": [ + "Scoped SO Client" + ], "signature": [ { "pluginId": "@kbn/core-saved-objects-api-server", @@ -103,6 +117,28 @@ "deprecated": false, "trackAdoption": false, "isRequired": true + }, + { + "parentPluginId": "@kbn/core-deprecations-server-internal", + "id": "def-server.InternalDeprecationsServiceStart.asScopedToClient.$3", + "type": "Object", + "tags": [], + "label": "request", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, + "" + ], + "path": "packages/core/deprecations/core-deprecations-server-internal/src/deprecations_service.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true } ], "returnComment": [] diff --git a/api_docs/kbn_core_deprecations_server_internal.mdx b/api_docs/kbn_core_deprecations_server_internal.mdx index d9ac63637deb4..d006f59d4c016 100644 --- a/api_docs/kbn_core_deprecations_server_internal.mdx +++ b/api_docs/kbn_core_deprecations_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server-internal title: "@kbn/core-deprecations-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server-internal'] --- import kbnCoreDeprecationsServerInternalObj from './kbn_core_deprecations_server_internal.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 4 | 0 | 3 | 0 | +| 5 | 0 | 1 | 0 | ## Server diff --git a/api_docs/kbn_core_deprecations_server_mocks.mdx b/api_docs/kbn_core_deprecations_server_mocks.mdx index 3b0c159596b8b..119dcfdbfacdc 100644 --- a/api_docs/kbn_core_deprecations_server_mocks.mdx +++ b/api_docs/kbn_core_deprecations_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-deprecations-server-mocks title: "@kbn/core-deprecations-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-deprecations-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-deprecations-server-mocks'] --- import kbnCoreDeprecationsServerMocksObj from './kbn_core_deprecations_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_browser.mdx b/api_docs/kbn_core_doc_links_browser.mdx index 2f6d2120848f2..b7b5e4ce7fa8f 100644 --- a/api_docs/kbn_core_doc_links_browser.mdx +++ b/api_docs/kbn_core_doc_links_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser title: "@kbn/core-doc-links-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-browser'] --- import kbnCoreDocLinksBrowserObj from './kbn_core_doc_links_browser.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_browser_mocks.mdx b/api_docs/kbn_core_doc_links_browser_mocks.mdx index eb3ca4df19b70..7768ed965eb6f 100644 --- a/api_docs/kbn_core_doc_links_browser_mocks.mdx +++ b/api_docs/kbn_core_doc_links_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-browser-mocks title: "@kbn/core-doc-links-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-browser-mocks'] --- import kbnCoreDocLinksBrowserMocksObj from './kbn_core_doc_links_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_server.mdx b/api_docs/kbn_core_doc_links_server.mdx index df327f3940276..66f9277c07d7a 100644 --- a/api_docs/kbn_core_doc_links_server.mdx +++ b/api_docs/kbn_core_doc_links_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server title: "@kbn/core-doc-links-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-server'] --- import kbnCoreDocLinksServerObj from './kbn_core_doc_links_server.devdocs.json'; diff --git a/api_docs/kbn_core_doc_links_server_mocks.mdx b/api_docs/kbn_core_doc_links_server_mocks.mdx index d69d15b510b7f..da83698912c88 100644 --- a/api_docs/kbn_core_doc_links_server_mocks.mdx +++ b/api_docs/kbn_core_doc_links_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-doc-links-server-mocks title: "@kbn/core-doc-links-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-doc-links-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-doc-links-server-mocks'] --- import kbnCoreDocLinksServerMocksObj from './kbn_core_doc_links_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_client_server_internal.mdx b/api_docs/kbn_core_elasticsearch_client_server_internal.mdx index 75688a3a33c81..346270a5c2c2a 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_internal.mdx +++ b/api_docs/kbn_core_elasticsearch_client_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-client-server-internal title: "@kbn/core-elasticsearch-client-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-client-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-internal'] --- import kbnCoreElasticsearchClientServerInternalObj from './kbn_core_elasticsearch_client_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx index 98f069e39a129..20a7ae1716d94 100644 --- a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx +++ b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-client-server-mocks title: "@kbn/core-elasticsearch-client-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-client-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-mocks'] --- import kbnCoreElasticsearchClientServerMocksObj from './kbn_core_elasticsearch_client_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server.mdx b/api_docs/kbn_core_elasticsearch_server.mdx index fba17e6286242..e0ebc30a32f9b 100644 --- a/api_docs/kbn_core_elasticsearch_server.mdx +++ b/api_docs/kbn_core_elasticsearch_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server title: "@kbn/core-elasticsearch-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server'] --- import kbnCoreElasticsearchServerObj from './kbn_core_elasticsearch_server.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server_internal.mdx b/api_docs/kbn_core_elasticsearch_server_internal.mdx index 6492886fb06de..bb7c496c33de3 100644 --- a/api_docs/kbn_core_elasticsearch_server_internal.mdx +++ b/api_docs/kbn_core_elasticsearch_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server-internal title: "@kbn/core-elasticsearch-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server-internal'] --- import kbnCoreElasticsearchServerInternalObj from './kbn_core_elasticsearch_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_server_mocks.mdx index f0740a0faf858..a8f19317319fd 100644 --- a/api_docs/kbn_core_elasticsearch_server_mocks.mdx +++ b/api_docs/kbn_core_elasticsearch_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-elasticsearch-server-mocks title: "@kbn/core-elasticsearch-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-elasticsearch-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server-mocks'] --- import kbnCoreElasticsearchServerMocksObj from './kbn_core_elasticsearch_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_environment_server_internal.mdx b/api_docs/kbn_core_environment_server_internal.mdx index 39ac84a137014..55643232ee7b5 100644 --- a/api_docs/kbn_core_environment_server_internal.mdx +++ b/api_docs/kbn_core_environment_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-internal title: "@kbn/core-environment-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-environment-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-internal'] --- import kbnCoreEnvironmentServerInternalObj from './kbn_core_environment_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_environment_server_mocks.mdx b/api_docs/kbn_core_environment_server_mocks.mdx index 6db9f2168603d..797922bd3015c 100644 --- a/api_docs/kbn_core_environment_server_mocks.mdx +++ b/api_docs/kbn_core_environment_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-environment-server-mocks title: "@kbn/core-environment-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-environment-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-environment-server-mocks'] --- import kbnCoreEnvironmentServerMocksObj from './kbn_core_environment_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser.mdx b/api_docs/kbn_core_execution_context_browser.mdx index 45bf4fce68420..3fe054ca7acf4 100644 --- a/api_docs/kbn_core_execution_context_browser.mdx +++ b/api_docs/kbn_core_execution_context_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser title: "@kbn/core-execution-context-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser'] --- import kbnCoreExecutionContextBrowserObj from './kbn_core_execution_context_browser.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser_internal.mdx b/api_docs/kbn_core_execution_context_browser_internal.mdx index 37e96722199a0..27c44b48067ff 100644 --- a/api_docs/kbn_core_execution_context_browser_internal.mdx +++ b/api_docs/kbn_core_execution_context_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser-internal title: "@kbn/core-execution-context-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-internal'] --- import kbnCoreExecutionContextBrowserInternalObj from './kbn_core_execution_context_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_browser_mocks.mdx b/api_docs/kbn_core_execution_context_browser_mocks.mdx index 0c80f9b7a2cf4..299c0f9defaad 100644 --- a/api_docs/kbn_core_execution_context_browser_mocks.mdx +++ b/api_docs/kbn_core_execution_context_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-browser-mocks title: "@kbn/core-execution-context-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-browser-mocks'] --- import kbnCoreExecutionContextBrowserMocksObj from './kbn_core_execution_context_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_common.mdx b/api_docs/kbn_core_execution_context_common.mdx index 0b1b78218b7f1..cf27c4d13084d 100644 --- a/api_docs/kbn_core_execution_context_common.mdx +++ b/api_docs/kbn_core_execution_context_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-common title: "@kbn/core-execution-context-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-common'] --- import kbnCoreExecutionContextCommonObj from './kbn_core_execution_context_common.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server.mdx b/api_docs/kbn_core_execution_context_server.mdx index 908edd86201f1..036fd0efc6591 100644 --- a/api_docs/kbn_core_execution_context_server.mdx +++ b/api_docs/kbn_core_execution_context_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server title: "@kbn/core-execution-context-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server'] --- import kbnCoreExecutionContextServerObj from './kbn_core_execution_context_server.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server_internal.mdx b/api_docs/kbn_core_execution_context_server_internal.mdx index 26ccee697387c..2eb9a5b6771a9 100644 --- a/api_docs/kbn_core_execution_context_server_internal.mdx +++ b/api_docs/kbn_core_execution_context_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server-internal title: "@kbn/core-execution-context-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server-internal'] --- import kbnCoreExecutionContextServerInternalObj from './kbn_core_execution_context_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_execution_context_server_mocks.mdx b/api_docs/kbn_core_execution_context_server_mocks.mdx index 6972077a3c7a6..e744a6078c717 100644 --- a/api_docs/kbn_core_execution_context_server_mocks.mdx +++ b/api_docs/kbn_core_execution_context_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-execution-context-server-mocks title: "@kbn/core-execution-context-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-execution-context-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-execution-context-server-mocks'] --- import kbnCoreExecutionContextServerMocksObj from './kbn_core_execution_context_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_fatal_errors_browser.mdx b/api_docs/kbn_core_fatal_errors_browser.mdx index d370044efee9e..3f7736852ea59 100644 --- a/api_docs/kbn_core_fatal_errors_browser.mdx +++ b/api_docs/kbn_core_fatal_errors_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser title: "@kbn/core-fatal-errors-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-fatal-errors-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser'] --- import kbnCoreFatalErrorsBrowserObj from './kbn_core_fatal_errors_browser.devdocs.json'; diff --git a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx index e7939abc9e0a2..89a56a5c5b933 100644 --- a/api_docs/kbn_core_fatal_errors_browser_mocks.mdx +++ b/api_docs/kbn_core_fatal_errors_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-fatal-errors-browser-mocks title: "@kbn/core-fatal-errors-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-fatal-errors-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-fatal-errors-browser-mocks'] --- import kbnCoreFatalErrorsBrowserMocksObj from './kbn_core_fatal_errors_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_feature_flags_browser.mdx b/api_docs/kbn_core_feature_flags_browser.mdx index 0f4d7182ae6a5..0acd09bcd0d8b 100644 --- a/api_docs/kbn_core_feature_flags_browser.mdx +++ b/api_docs/kbn_core_feature_flags_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-feature-flags-browser title: "@kbn/core-feature-flags-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-feature-flags-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-feature-flags-browser'] --- import kbnCoreFeatureFlagsBrowserObj from './kbn_core_feature_flags_browser.devdocs.json'; diff --git a/api_docs/kbn_core_feature_flags_browser_internal.mdx b/api_docs/kbn_core_feature_flags_browser_internal.mdx index 397a31af9aa00..45664660a4108 100644 --- a/api_docs/kbn_core_feature_flags_browser_internal.mdx +++ b/api_docs/kbn_core_feature_flags_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-feature-flags-browser-internal title: "@kbn/core-feature-flags-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-feature-flags-browser-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-feature-flags-browser-internal'] --- import kbnCoreFeatureFlagsBrowserInternalObj from './kbn_core_feature_flags_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_feature_flags_browser_mocks.mdx b/api_docs/kbn_core_feature_flags_browser_mocks.mdx index bb40a20b2be53..6bb075f9820af 100644 --- a/api_docs/kbn_core_feature_flags_browser_mocks.mdx +++ b/api_docs/kbn_core_feature_flags_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-feature-flags-browser-mocks title: "@kbn/core-feature-flags-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-feature-flags-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-feature-flags-browser-mocks'] --- import kbnCoreFeatureFlagsBrowserMocksObj from './kbn_core_feature_flags_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_feature_flags_server.mdx b/api_docs/kbn_core_feature_flags_server.mdx index b4f7cadb134e3..1384e2f0dc3c5 100644 --- a/api_docs/kbn_core_feature_flags_server.mdx +++ b/api_docs/kbn_core_feature_flags_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-feature-flags-server title: "@kbn/core-feature-flags-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-feature-flags-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-feature-flags-server'] --- import kbnCoreFeatureFlagsServerObj from './kbn_core_feature_flags_server.devdocs.json'; diff --git a/api_docs/kbn_core_feature_flags_server_internal.mdx b/api_docs/kbn_core_feature_flags_server_internal.mdx index 7fa81ddf23d8a..d93d175bc59cf 100644 --- a/api_docs/kbn_core_feature_flags_server_internal.mdx +++ b/api_docs/kbn_core_feature_flags_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-feature-flags-server-internal title: "@kbn/core-feature-flags-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-feature-flags-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-feature-flags-server-internal'] --- import kbnCoreFeatureFlagsServerInternalObj from './kbn_core_feature_flags_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_feature_flags_server_mocks.mdx b/api_docs/kbn_core_feature_flags_server_mocks.mdx index 4ca085dc9aa50..153ec4f6c9761 100644 --- a/api_docs/kbn_core_feature_flags_server_mocks.mdx +++ b/api_docs/kbn_core_feature_flags_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-feature-flags-server-mocks title: "@kbn/core-feature-flags-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-feature-flags-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-feature-flags-server-mocks'] --- import kbnCoreFeatureFlagsServerMocksObj from './kbn_core_feature_flags_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser.mdx b/api_docs/kbn_core_http_browser.mdx index 3ebf9ea20e359..f799a2e8cfff6 100644 --- a/api_docs/kbn_core_http_browser.mdx +++ b/api_docs/kbn_core_http_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser title: "@kbn/core-http-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser'] --- import kbnCoreHttpBrowserObj from './kbn_core_http_browser.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser_internal.mdx b/api_docs/kbn_core_http_browser_internal.mdx index bb29f07fe70c5..8d9c337de5020 100644 --- a/api_docs/kbn_core_http_browser_internal.mdx +++ b/api_docs/kbn_core_http_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-internal title: "@kbn/core-http-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-internal'] --- import kbnCoreHttpBrowserInternalObj from './kbn_core_http_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser_mocks.mdx b/api_docs/kbn_core_http_browser_mocks.mdx index 94b79ce4d53ac..348e2a6ca6ea9 100644 --- a/api_docs/kbn_core_http_browser_mocks.mdx +++ b/api_docs/kbn_core_http_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-browser-mocks title: "@kbn/core-http-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-browser-mocks'] --- import kbnCoreHttpBrowserMocksObj from './kbn_core_http_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_common.mdx b/api_docs/kbn_core_http_common.mdx index e5905aee43226..b2bdc3879d0ca 100644 --- a/api_docs/kbn_core_http_common.mdx +++ b/api_docs/kbn_core_http_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-common title: "@kbn/core-http-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-common'] --- import kbnCoreHttpCommonObj from './kbn_core_http_common.devdocs.json'; diff --git a/api_docs/kbn_core_http_context_server_mocks.mdx b/api_docs/kbn_core_http_context_server_mocks.mdx index e85aecd181e8a..23fce65cd9168 100644 --- a/api_docs/kbn_core_http_context_server_mocks.mdx +++ b/api_docs/kbn_core_http_context_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-context-server-mocks title: "@kbn/core-http-context-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-context-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-context-server-mocks'] --- import kbnCoreHttpContextServerMocksObj from './kbn_core_http_context_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_request_handler_context_server.mdx b/api_docs/kbn_core_http_request_handler_context_server.mdx index 9967561c7e763..8f4fc296eb15a 100644 --- a/api_docs/kbn_core_http_request_handler_context_server.mdx +++ b/api_docs/kbn_core_http_request_handler_context_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-request-handler-context-server title: "@kbn/core-http-request-handler-context-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-request-handler-context-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-request-handler-context-server'] --- import kbnCoreHttpRequestHandlerContextServerObj from './kbn_core_http_request_handler_context_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server.mdx b/api_docs/kbn_core_http_resources_server.mdx index 41d1a3f77570a..a1bc8c4cf9ead 100644 --- a/api_docs/kbn_core_http_resources_server.mdx +++ b/api_docs/kbn_core_http_resources_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server title: "@kbn/core-http-resources-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server'] --- import kbnCoreHttpResourcesServerObj from './kbn_core_http_resources_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server_internal.mdx b/api_docs/kbn_core_http_resources_server_internal.mdx index a93fe7fcb6aba..78cd94493964c 100644 --- a/api_docs/kbn_core_http_resources_server_internal.mdx +++ b/api_docs/kbn_core_http_resources_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server-internal title: "@kbn/core-http-resources-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server-internal'] --- import kbnCoreHttpResourcesServerInternalObj from './kbn_core_http_resources_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_resources_server_mocks.mdx b/api_docs/kbn_core_http_resources_server_mocks.mdx index 924946f96c48b..3fa59b4bd9ca5 100644 --- a/api_docs/kbn_core_http_resources_server_mocks.mdx +++ b/api_docs/kbn_core_http_resources_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-resources-server-mocks title: "@kbn/core-http-resources-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-resources-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-resources-server-mocks'] --- import kbnCoreHttpResourcesServerMocksObj from './kbn_core_http_resources_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_router_server_internal.mdx b/api_docs/kbn_core_http_router_server_internal.mdx index beba069a90751..758c59b234ef2 100644 --- a/api_docs/kbn_core_http_router_server_internal.mdx +++ b/api_docs/kbn_core_http_router_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-router-server-internal title: "@kbn/core-http-router-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-router-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-router-server-internal'] --- import kbnCoreHttpRouterServerInternalObj from './kbn_core_http_router_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_router_server_mocks.mdx b/api_docs/kbn_core_http_router_server_mocks.mdx index 7d24b35c87c0e..16c1ddaf57fd5 100644 --- a/api_docs/kbn_core_http_router_server_mocks.mdx +++ b/api_docs/kbn_core_http_router_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-router-server-mocks title: "@kbn/core-http-router-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-router-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-router-server-mocks'] --- import kbnCoreHttpRouterServerMocksObj from './kbn_core_http_router_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_server.devdocs.json b/api_docs/kbn_core_http_server.devdocs.json index 01b7dc9f3e8ec..cec8401172dd6 100644 --- a/api_docs/kbn_core_http_server.devdocs.json +++ b/api_docs/kbn_core_http_server.devdocs.json @@ -3905,30 +3905,6 @@ "plugin": "actions", "path": "x-pack/plugins/actions/server/routes/connector/get/get.ts" }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/find.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get_alert_state.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get_alert_instance_summary.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/list_alert_types.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/health.ts" - }, { "plugin": "alerting", "path": "x-pack/plugins/alerting/server/routes/rule/apis/get/get_rule_route.ts" @@ -4029,10 +4005,6 @@ "plugin": "inference", "path": "x-pack/platform/plugins/shared/inference/server/routes/connectors.ts" }, - { - "plugin": "assetInventory", - "path": "x-pack/plugins/asset_inventory/server/routes/index.ts" - }, { "plugin": "banners", "path": "x-pack/plugins/banners/server/routes/info.ts" @@ -4057,10 +4029,6 @@ "plugin": "savedObjectsTagging", "path": "x-pack/plugins/saved_objects_tagging/server/routes/internal/find_tags.ts" }, - { - "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/vulnerabilities_dashboard.ts" - }, { "plugin": "guidedOnboarding", "path": "src/plugins/guided_onboarding/server/routes/guide_state_routes.ts" @@ -4585,26 +4553,6 @@ "plugin": "indexManagement", "path": "x-pack/plugins/index_management/server/routes/api/templates/register_get_routes.ts" }, - { - "plugin": "ingestPipelines", - "path": "x-pack/plugins/ingest_pipelines/server/routes/api/get.ts" - }, - { - "plugin": "ingestPipelines", - "path": "x-pack/plugins/ingest_pipelines/server/routes/api/get.ts" - }, - { - "plugin": "ingestPipelines", - "path": "x-pack/plugins/ingest_pipelines/server/routes/api/privileges.ts" - }, - { - "plugin": "ingestPipelines", - "path": "x-pack/plugins/ingest_pipelines/server/routes/api/documents.ts" - }, - { - "plugin": "ingestPipelines", - "path": "x-pack/plugins/ingest_pipelines/server/routes/api/database/list.ts" - }, { "plugin": "logstash", "path": "x-pack/plugins/logstash/server/routes/cluster/load.ts" @@ -4681,14 +4629,6 @@ "plugin": "searchPlayground", "path": "x-pack/plugins/search_playground/server/routes.ts" }, - { - "plugin": "productDocBase", - "path": "x-pack/platform/plugins/shared/ai_infra/product_doc_base/server/routes/installation.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts" - }, { "plugin": "serverlessSearch", "path": "x-pack/plugins/serverless_search/server/routes/api_key_routes.ts" @@ -5013,10 +4953,38 @@ "plugin": "watcher", "path": "x-pack/platform/plugins/private/watcher/server/routes/api/register_load_history_route.ts" }, + { + "plugin": "ingestPipelines", + "path": "x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/get.ts" + }, + { + "plugin": "ingestPipelines", + "path": "x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/get.ts" + }, + { + "plugin": "ingestPipelines", + "path": "x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/privileges.ts" + }, + { + "plugin": "ingestPipelines", + "path": "x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/documents.ts" + }, + { + "plugin": "ingestPipelines", + "path": "x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/database/list.ts" + }, { "plugin": "licenseManagement", "path": "x-pack/platform/plugins/shared/license_management/server/routes/api/license/register_start_trial_routes.ts" }, + { + "plugin": "productDocBase", + "path": "x-pack/platform/plugins/shared/ai_infra/product_doc_base/server/routes/installation.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver.ts" + }, { "plugin": "@kbn/test-suites-xpack", "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/jira_simulation.ts" @@ -5053,6 +5021,14 @@ "plugin": "uptime", "path": "x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/uptime_server.ts" }, + { + "plugin": "assetInventory", + "path": "x-pack/solutions/security/plugins/asset_inventory/server/routes/index.ts" + }, + { + "plugin": "cloudSecurityPosture", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/vulnerabilities_dashboard.ts" + }, { "plugin": "dataViewManagement", "path": "src/plugins/data_view_management/server/routes/resolve_index.ts" @@ -5429,178 +5405,6 @@ "plugin": "triggersActionsUi", "path": "x-pack/plugins/triggers_actions_ui/server/routes/config.test.ts" }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/find.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/find.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/find.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/find.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/find.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/find.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/find.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/find.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/find.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get_alert_instance_summary.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get_alert_instance_summary.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get_alert_instance_summary.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get_alert_instance_summary.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get_alert_instance_summary.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get_alert_state.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get_alert_state.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get_alert_state.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get_alert_state.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get_alert_state.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/get_alert_state.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/health.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/health.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/health.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/health.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/health.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/health.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/health.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/health.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/health.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/health.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/list_alert_types.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/list_alert_types.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/list_alert_types.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/list_alert_types.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/list_alert_types.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/list_alert_types.test.ts" - }, { "plugin": "actions", "path": "x-pack/plugins/actions/server/routes/connector/get/get.test.ts" @@ -6583,38 +6387,6 @@ "plugin": "actions", "path": "x-pack/plugins/actions/server/routes/get_global_execution_kpi.ts" }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/create.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/enable.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/disable.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/update_api_key.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/mute_instance.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/unmute_instance.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/mute_all.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/unmute_all.ts" - }, { "plugin": "alerting", "path": "x-pack/plugins/alerting/server/routes/rule/apis/create/create_rule_route.ts" @@ -7223,22 +6995,6 @@ "plugin": "indexManagement", "path": "x-pack/plugins/index_management/server/routes/api/templates/register_simulate_route.ts" }, - { - "plugin": "ingestPipelines", - "path": "x-pack/plugins/ingest_pipelines/server/routes/api/create.ts" - }, - { - "plugin": "ingestPipelines", - "path": "x-pack/plugins/ingest_pipelines/server/routes/api/simulate.ts" - }, - { - "plugin": "ingestPipelines", - "path": "x-pack/plugins/ingest_pipelines/server/routes/api/parse_csv.ts" - }, - { - "plugin": "ingestPipelines", - "path": "x-pack/plugins/ingest_pipelines/server/routes/api/database/create.ts" - }, { "plugin": "logstash", "path": "x-pack/plugins/logstash/server/routes/pipelines/delete.ts" @@ -7299,22 +7055,6 @@ "plugin": "searchPlayground", "path": "x-pack/plugins/search_playground/server/routes.ts" }, - { - "plugin": "productDocBase", - "path": "x-pack/platform/plugins/shared/ai_infra/product_doc_base/server/routes/installation.ts" - }, - { - "plugin": "productDocBase", - "path": "x-pack/platform/plugins/shared/ai_infra/product_doc_base/server/routes/installation.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts" - }, { "plugin": "serverlessSearch", "path": "x-pack/plugins/serverless_search/server/routes/api_key_routes.ts" @@ -7508,8 +7248,24 @@ "path": "x-pack/platform/plugins/private/watcher/server/routes/api/register_list_fields_route.ts" }, { - "plugin": "licenseManagement", - "path": "x-pack/platform/plugins/shared/license_management/server/routes/api/license/register_start_basic_route.ts" + "plugin": "ingestPipelines", + "path": "x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/create.ts" + }, + { + "plugin": "ingestPipelines", + "path": "x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/simulate.ts" + }, + { + "plugin": "ingestPipelines", + "path": "x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/parse_csv.ts" + }, + { + "plugin": "ingestPipelines", + "path": "x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/database/create.ts" + }, + { + "plugin": "licenseManagement", + "path": "x-pack/platform/plugins/shared/license_management/server/routes/api/license/register_start_basic_route.ts" }, { "plugin": "licenseManagement", @@ -7519,6 +7275,22 @@ "plugin": "licenseManagement", "path": "x-pack/platform/plugins/shared/license_management/server/routes/api/license/register_permissions_route.ts" }, + { + "plugin": "productDocBase", + "path": "x-pack/platform/plugins/shared/ai_infra/product_doc_base/server/routes/installation.ts" + }, + { + "plugin": "productDocBase", + "path": "x-pack/platform/plugins/shared/ai_infra/product_doc_base/server/routes/installation.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver.ts" + }, { "plugin": "@kbn/test-suites-xpack", "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/pagerduty_simulation.ts" @@ -7879,190 +7651,6 @@ "plugin": "ruleRegistry", "path": "x-pack/plugins/rule_registry/server/routes/__mocks__/server.ts" }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/create.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/create.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/create.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/create.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/create.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/create.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/create.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/create.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/create.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/create.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/create.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/disable.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/disable.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/disable.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/disable.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/disable.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/enable.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/enable.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/enable.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/enable.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/enable.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/mute_all.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/mute_all.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/mute_all.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/mute_all.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/mute_all.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/mute_instance.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/mute_instance.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/mute_instance.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/mute_instance.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/mute_instance.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/unmute_all.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/unmute_all.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/unmute_all.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/unmute_all.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/unmute_all.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/unmute_instance.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/unmute_instance.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/unmute_instance.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/unmute_instance.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/unmute_instance.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/update_api_key.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/update_api_key.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/update_api_key.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/update_api_key.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/update_api_key.test.ts" - }, { "plugin": "alerting", "path": "x-pack/plugins/alerting/server/routes/suggestions/fileds_rule.test.ts" @@ -8111,10 +7699,6 @@ "plugin": "actions", "path": "x-pack/plugins/actions/server/routes/connector/execute/execute.test.ts" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts" - }, { "plugin": "spaces", "path": "x-pack/plugins/spaces/server/routes/api/external/copy_to_space.test.ts" @@ -8459,6 +8043,10 @@ "plugin": "crossClusterReplication", "path": "x-pack/platform/plugins/private/cross_cluster_replication/server/routes/api/follower_index/register_create_route.test.ts" }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts" + }, { "plugin": "home", "path": "src/plugins/home/server/plugin.test.ts" @@ -8801,10 +8389,6 @@ "plugin": "actions", "path": "x-pack/plugins/actions/server/routes/connector/update/update.ts" }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/update.ts" - }, { "plugin": "alerting", "path": "x-pack/plugins/alerting/server/routes/rule/apis/update/update_rule_route.ts" @@ -9025,10 +8609,6 @@ "plugin": "indexManagement", "path": "x-pack/plugins/index_management/server/routes/api/templates/register_update_route.ts" }, - { - "plugin": "ingestPipelines", - "path": "x-pack/plugins/ingest_pipelines/server/routes/api/update.ts" - }, { "plugin": "logstash", "path": "x-pack/plugins/logstash/server/routes/pipeline/save.ts" @@ -9121,6 +8701,10 @@ "plugin": "watcher", "path": "x-pack/platform/plugins/private/watcher/server/routes/api/watch/action/register_acknowledge_route.ts" }, + { + "plugin": "ingestPipelines", + "path": "x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/update.ts" + }, { "plugin": "licenseManagement", "path": "x-pack/platform/plugins/shared/license_management/server/routes/api/license/register_license_route.ts" @@ -9181,38 +8765,6 @@ "plugin": "ruleRegistry", "path": "x-pack/plugins/rule_registry/server/routes/__mocks__/server.ts" }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/update.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/update.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/update.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/update.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/update.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/update.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/update.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/update.test.ts" - }, { "plugin": "actions", "path": "x-pack/plugins/actions/server/routes/connector/update/update.test.ts" @@ -9797,10 +9349,6 @@ "plugin": "actions", "path": "x-pack/plugins/actions/server/routes/connector/delete/delete.ts" }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/delete.ts" - }, { "plugin": "alerting", "path": "x-pack/plugins/alerting/server/routes/rule/apis/delete/delete_rule_route.ts" @@ -9957,14 +9505,6 @@ "plugin": "indexManagement", "path": "x-pack/plugins/index_management/server/routes/api/enrich_policies/register_delete_route.ts" }, - { - "plugin": "ingestPipelines", - "path": "x-pack/plugins/ingest_pipelines/server/routes/api/delete.ts" - }, - { - "plugin": "ingestPipelines", - "path": "x-pack/plugins/ingest_pipelines/server/routes/api/database/delete.ts" - }, { "plugin": "logstash", "path": "x-pack/plugins/logstash/server/routes/pipeline/delete.ts" @@ -10033,6 +9573,14 @@ "plugin": "watcher", "path": "x-pack/platform/plugins/private/watcher/server/routes/api/watch/register_delete_route.ts" }, + { + "plugin": "ingestPipelines", + "path": "x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/delete.ts" + }, + { + "plugin": "ingestPipelines", + "path": "x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/database/delete.ts" + }, { "plugin": "grokdebugger", "path": "x-pack/platform/plugins/private/grokdebugger/server/lib/kibana_framework.ts" @@ -10077,30 +9625,6 @@ "plugin": "ruleRegistry", "path": "x-pack/plugins/rule_registry/server/routes/__mocks__/server.ts" }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/delete.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/delete.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/delete.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/delete.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/delete.test.ts" - }, - { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/routes/legacy/delete.test.ts" - }, { "plugin": "actions", "path": "x-pack/plugins/actions/server/routes/connector/delete/delete.test.ts" @@ -13474,148 +12998,148 @@ "path": "src/plugins/telemetry/server/routes/telemetry_config.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/agent/agent_status_handler.ts" + "plugin": "cloudFullStory", + "path": "x-pack/plugins/cloud_integrations/cloud_full_story/server/routes/fullstory.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts" + "plugin": "customBranding", + "path": "x-pack/plugins/custom_branding/server/routes/info.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts" + "plugin": "enterpriseSearch", + "path": "x-pack/plugins/enterprise_search/server/lib/route_config_helpers.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts" + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/routes/background_task_utilization.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/update_insight.ts" + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/routes/background_task_utilization.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/get_insights.ts" + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/routes/background_task_utilization.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts" + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/routes/background_task_utilization.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/agent/agent_status_handler.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/policy/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/file_download_handler.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/workflow_insights/update_insight.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/details.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/workflow_insights/get_insights.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/status.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/state.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/list.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/policy/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/file_download_handler.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/details.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/status.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/state.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/list.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/suggestions/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { - "plugin": "cloudFullStory", - "path": "x-pack/plugins/cloud_integrations/cloud_full_story/server/routes/fullstory.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { - "plugin": "customBranding", - "path": "x-pack/plugins/custom_branding/server/routes/info.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { - "plugin": "enterpriseSearch", - "path": "x-pack/plugins/enterprise_search/server/lib/route_config_helpers.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { - "plugin": "taskManager", - "path": "x-pack/plugins/task_manager/server/routes/background_task_utilization.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { - "plugin": "taskManager", - "path": "x-pack/plugins/task_manager/server/routes/background_task_utilization.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/suggestions/index.ts" }, { - "plugin": "taskManager", - "path": "x-pack/plugins/task_manager/server/routes/background_task_utilization.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts" }, { - "plugin": "taskManager", - "path": "x-pack/plugins/task_manager/server/routes/background_task_utilization.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts" }, { "plugin": "@kbn/test-suites-xpack", @@ -15909,38 +15433,6 @@ "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/security/fleet_router.ts" }, - { - "plugin": "cloudDefend", - "path": "x-pack/plugins/cloud_defend/server/routes/policies/policies.ts" - }, - { - "plugin": "cloudDefend", - "path": "x-pack/plugins/cloud_defend/server/routes/status/status.ts" - }, - { - "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.ts" - }, - { - "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts" - }, - { - "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/server/routes/status/status.ts" - }, - { - "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.ts" - }, - { - "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/server/routes/detection_engine/get_detection_engine_alerts_count_by_rule_tags.ts" - }, - { - "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/get_states/get_states.ts" - }, { "plugin": "logsShared", "path": "x-pack/plugins/observability_solution/logs_shared/server/lib/adapters/framework/kibana_framework_adapter.ts" @@ -16189,18 +15681,6 @@ "plugin": "fileUpload", "path": "x-pack/plugins/file_upload/server/routes.ts" }, - { - "plugin": "kubernetesSecurity", - "path": "x-pack/plugins/kubernetes_security/server/routes/aggregate.ts" - }, - { - "plugin": "kubernetesSecurity", - "path": "x-pack/plugins/kubernetes_security/server/routes/count.ts" - }, - { - "plugin": "kubernetesSecurity", - "path": "x-pack/plugins/kubernetes_security/server/routes/multi_terms_aggregate.ts" - }, { "plugin": "lists", "path": "x-pack/plugins/lists/server/routes/find_endpoint_list_item_route.ts" @@ -16281,6 +15761,70 @@ "plugin": "maps", "path": "x-pack/plugins/maps/server/routes.ts" }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/api/register_routes.ts" + }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/api/register_routes.ts" + }, + { + "plugin": "metricsDataAccess", + "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" + }, + { + "plugin": "dataUsage", + "path": "x-pack/platform/plugins/private/data_usage/server/routes/internal/data_streams.ts" + }, + { + "plugin": "dataVisualizer", + "path": "x-pack/platform/plugins/private/data_visualizer/server/routes.ts" + }, + { + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/server/routes/api/audit_messages/register_route.ts" + }, + { + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/server/routes/api/transforms_nodes/register_route.ts" + }, + { + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/server/routes/api/transforms_all/register_route.ts" + }, + { + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/server/routes/api/transforms_single/register_route.ts" + }, + { + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/server/routes/api/transforms_stats_all/register_route.ts" + }, + { + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/server/routes/api/transforms_stats_single/register_route.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_route.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_space_health/get_space_health_route.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.ts" + }, { "plugin": "osquery", "path": "x-pack/platform/plugins/shared/osquery/server/routes/live_query/get_live_query_details_route.ts" @@ -16395,347 +15939,327 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_and_timelines_status/get_prebuilt_rules_and_timelines_status_route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_status/get_prebuilt_rules_status_route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/find_rules/route.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/filters/route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_and_timelines_status/get_prebuilt_rules_and_timelines_status_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/read_rule/route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_status/get_prebuilt_rules_status_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/tags/read_tags/route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/find_rules/route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/agent/agent_status_handler.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/filters/route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/read_rule/route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_installed_integrations/route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/tags/read_tags/route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/find_exception_references/route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/agent/agent_status_handler.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/read_index_route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/get_signals_migration_status_route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_installed_integrations/route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/privileges/read_privileges_route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/find_exception_references/route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/telemetry/telemetry_detection_rules_preview_route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/read_index_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/read_alerts_index_exists_route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/get_signals_migration_status_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/get_insights.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/privileges/read_privileges_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/routes/read_prebuilt_dev_tool_content_route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/telemetry/telemetry_detection_rules_preview_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/index_status/index.ts" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/server/api/register_routes.ts" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/server/api/register_routes.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/read_alerts_index_exists_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/tags/routes/get_tags_by_name.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/workflow_insights/get_insights.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/routes/read_prebuilt_dev_tool_content_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/get_timeline/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/index_status/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/get_timelines/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/tags/routes/get_tags_by_name.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/resolve_timeline/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/draft_timelines/get_draft_timelines/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/get_timeline/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/get_timelines/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/security_integrations/cribl/routes/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/resolve_timeline/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/status.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/draft_timelines/get_draft_timelines/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/get.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/privileges.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/security_integrations/cribl/routes/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/list.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/status.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/status.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/get.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/privileges.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/privileges.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/settings.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/list.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/entities/list.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/status.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/get.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/privileges.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/list.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/settings.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/privileges.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/entities/list.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/status.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/get.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/get.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/list.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/stats.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/privileges.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/translation_stats.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/status.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/stats_all.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/get.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/get.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/stats.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/missing.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/translation_stats.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/get_prebuilt_rules.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/stats_all.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/get.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/missing.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/get_prebuilt_rules.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/policy/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/file_download_handler.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/details.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/policy/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/status.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/state.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/file_download_handler.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/list.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/details.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/status.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/state.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_space_health/get_space_health_route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/list.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.ts" + "plugin": "dataUsage", + "path": "x-pack/platform/plugins/private/data_usage/server/routes/internal/data_streams.test.ts" }, { - "plugin": "sessionView", - "path": "x-pack/plugins/session_view/server/routes/alerts_route.ts" + "plugin": "dataUsage", + "path": "x-pack/platform/plugins/private/data_usage/server/routes/internal/data_streams.test.ts" }, { - "plugin": "sessionView", - "path": "x-pack/plugins/session_view/server/routes/io_events_route.ts" + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/server.ts" }, { - "plugin": "sessionView", - "path": "x-pack/plugins/session_view/server/routes/process_events_route.ts" + "plugin": "uptime", + "path": "x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/uptime_server.ts" }, { - "plugin": "sessionView", - "path": "x-pack/plugins/session_view/server/routes/alert_status_route.ts" + "plugin": "cloudDefend", + "path": "x-pack/solutions/security/plugins/cloud_defend/server/routes/policies/policies.ts" }, { - "plugin": "sessionView", - "path": "x-pack/plugins/session_view/server/routes/get_total_io_bytes_route.ts" + "plugin": "cloudDefend", + "path": "x-pack/solutions/security/plugins/cloud_defend/server/routes/status/status.ts" }, { - "plugin": "metricsDataAccess", - "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" + "plugin": "cloudSecurityPosture", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" + "plugin": "cloudSecurityPosture", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts" }, { - "plugin": "dataUsage", - "path": "x-pack/platform/plugins/private/data_usage/server/routes/internal/data_streams.ts" + "plugin": "cloudSecurityPosture", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.ts" }, { - "plugin": "dataVisualizer", - "path": "x-pack/platform/plugins/private/data_visualizer/server/routes.ts" + "plugin": "cloudSecurityPosture", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.ts" }, { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/server/routes/api/audit_messages/register_route.ts" + "plugin": "cloudSecurityPosture", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/detection_engine/get_detection_engine_alerts_count_by_rule_tags.ts" }, { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/server/routes/api/transforms_nodes/register_route.ts" + "plugin": "cloudSecurityPosture", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/get_states/get_states.ts" }, { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/server/routes/api/transforms_all/register_route.ts" + "plugin": "ecsDataQualityDashboard", + "path": "x-pack/solutions/security/plugins/ecs_data_quality_dashboard/server/routes/get_index_mappings.ts" }, { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/server/routes/api/transforms_single/register_route.ts" + "plugin": "ecsDataQualityDashboard", + "path": "x-pack/solutions/security/plugins/ecs_data_quality_dashboard/server/routes/get_index_stats.ts" }, { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/server/routes/api/transforms_stats_all/register_route.ts" + "plugin": "ecsDataQualityDashboard", + "path": "x-pack/solutions/security/plugins/ecs_data_quality_dashboard/server/routes/get_ilm_explain.ts" }, { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/server/routes/api/transforms_stats_single/register_route.ts" + "plugin": "ecsDataQualityDashboard", + "path": "x-pack/solutions/security/plugins/ecs_data_quality_dashboard/server/routes/results/get_index_results_latest.ts" }, { - "plugin": "dataUsage", - "path": "x-pack/platform/plugins/private/data_usage/server/routes/internal/data_streams.test.ts" + "plugin": "ecsDataQualityDashboard", + "path": "x-pack/solutions/security/plugins/ecs_data_quality_dashboard/server/routes/results/get_index_results.ts" }, { - "plugin": "dataUsage", - "path": "x-pack/platform/plugins/private/data_usage/server/routes/internal/data_streams.test.ts" + "plugin": "kubernetesSecurity", + "path": "x-pack/solutions/security/plugins/kubernetes_security/server/routes/aggregate.ts" }, { - "plugin": "synthetics", - "path": "x-pack/solutions/observability/plugins/synthetics/server/server.ts" + "plugin": "kubernetesSecurity", + "path": "x-pack/solutions/security/plugins/kubernetes_security/server/routes/count.ts" }, { - "plugin": "uptime", - "path": "x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/uptime_server.ts" + "plugin": "kubernetesSecurity", + "path": "x-pack/solutions/security/plugins/kubernetes_security/server/routes/multi_terms_aggregate.ts" }, { - "plugin": "ecsDataQualityDashboard", - "path": "x-pack/solutions/security/plugins/ecs_data_quality_dashboard/server/routes/get_index_mappings.ts" + "plugin": "sessionView", + "path": "x-pack/solutions/security/plugins/session_view/server/routes/alerts_route.ts" }, { - "plugin": "ecsDataQualityDashboard", - "path": "x-pack/solutions/security/plugins/ecs_data_quality_dashboard/server/routes/get_index_stats.ts" + "plugin": "sessionView", + "path": "x-pack/solutions/security/plugins/session_view/server/routes/io_events_route.ts" }, { - "plugin": "ecsDataQualityDashboard", - "path": "x-pack/solutions/security/plugins/ecs_data_quality_dashboard/server/routes/get_ilm_explain.ts" + "plugin": "sessionView", + "path": "x-pack/solutions/security/plugins/session_view/server/routes/process_events_route.ts" }, { - "plugin": "ecsDataQualityDashboard", - "path": "x-pack/solutions/security/plugins/ecs_data_quality_dashboard/server/routes/results/get_index_results_latest.ts" + "plugin": "sessionView", + "path": "x-pack/solutions/security/plugins/session_view/server/routes/alert_status_route.ts" }, { - "plugin": "ecsDataQualityDashboard", - "path": "x-pack/solutions/security/plugins/ecs_data_quality_dashboard/server/routes/results/get_index_results.ts" + "plugin": "sessionView", + "path": "x-pack/solutions/security/plugins/session_view/server/routes/get_total_io_bytes_route.ts" }, { "plugin": "@kbn/core-http-router-server-internal", @@ -16854,24 +16378,24 @@ "path": "x-pack/plugins/canvas/server/routes/workpad/resolve.test.ts" }, { - "plugin": "cloudDefend", - "path": "x-pack/plugins/cloud_defend/server/routes/policies/policies.test.ts" + "plugin": "integrationAssistant", + "path": "x-pack/platform/plugins/shared/integration_assistant/server/__mocks__/mock_server.ts" }, { - "plugin": "cloudDefend", - "path": "x-pack/plugins/cloud_defend/server/routes/status/status.test.ts" + "plugin": "ecsDataQualityDashboard", + "path": "x-pack/solutions/security/plugins/ecs_data_quality_dashboard/server/__mocks__/server.ts" }, { - "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts" + "plugin": "cloudDefend", + "path": "x-pack/solutions/security/plugins/cloud_defend/server/routes/policies/policies.test.ts" }, { - "plugin": "integrationAssistant", - "path": "x-pack/platform/plugins/shared/integration_assistant/server/__mocks__/mock_server.ts" + "plugin": "cloudDefend", + "path": "x-pack/solutions/security/plugins/cloud_defend/server/routes/status/status.test.ts" }, { - "plugin": "ecsDataQualityDashboard", - "path": "x-pack/solutions/security/plugins/ecs_data_quality_dashboard/server/__mocks__/server.ts" + "plugin": "cloudSecurityPosture", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts" }, { "plugin": "@kbn/core-http-router-server-mocks", @@ -17100,6 +16624,22 @@ "plugin": "lists", "path": "x-pack/plugins/lists/server/routes/list/update_list_route.ts" }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/api/register_routes.ts" + }, + { + "plugin": "metricsDataAccess", + "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" + }, + { + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/server/routes/api/transforms_create/register_route.ts" + }, { "plugin": "osquery", "path": "x-pack/platform/plugins/shared/osquery/server/routes/saved_query/update_saved_query_route.ts" @@ -17114,75 +16654,59 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/update_rule/route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/update_rule/route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/update_insight.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/workflow_insights/update_insight.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/indices/create_index_route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/indices/create_index_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/create_script_route.ts" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/server/api/register_routes.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/stored_scripts/create_script_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/tags/routes/create_tag.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/tags/routes/create_tag.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/configure_saved_object.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/configure_saved_object.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/update.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/update.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/start.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/start.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/stop.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/stop.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/retry.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/retry.ts" }, { - "plugin": "metricsDataAccess", - "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/server.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" + "plugin": "uptime", + "path": "x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/uptime_server.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_update_rules/route.ts" - }, - { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/server/routes/api/transforms_create/register_route.ts" - }, - { - "plugin": "synthetics", - "path": "x-pack/solutions/observability/plugins/synthetics/server/server.ts" - }, - { - "plugin": "uptime", - "path": "x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/uptime_server.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_update_rules/route.ts" }, { "plugin": "@kbn/core-http-router-server-internal", @@ -17443,14 +16967,6 @@ "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/security/fleet_router.ts" }, - { - "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/bulk_action.ts" - }, - { - "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/server/routes/graph/route.ts" - }, { "plugin": "logsShared", "path": "x-pack/plugins/observability_solution/logs_shared/server/lib/adapters/framework/kibana_framework_adapter.ts" @@ -17840,452 +17356,444 @@ "path": "x-pack/plugins/maps/server/data_indexing/indexing_routes.ts" }, { - "plugin": "osquery", - "path": "x-pack/platform/plugins/shared/osquery/server/routes/live_query/create_live_query_route.ts" + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/api/register_routes.ts" }, { - "plugin": "osquery", - "path": "x-pack/platform/plugins/shared/osquery/server/routes/saved_query/create_saved_query_route.ts" + "plugin": "metricsDataAccess", + "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" }, { - "plugin": "osquery", - "path": "x-pack/platform/plugins/shared/osquery/server/routes/pack/create_pack_route.ts" + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" }, { - "plugin": "osquery", - "path": "x-pack/platform/plugins/shared/osquery/server/routes/asset/update_assets_route.ts" + "plugin": "dataUsage", + "path": "x-pack/platform/plugins/private/data_usage/server/routes/internal/usage_metrics.ts" }, { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/cancel/cancel_attack_discovery.ts" + "plugin": "dataVisualizer", + "path": "x-pack/platform/plugins/private/data_visualizer/server/routes.ts" }, { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/post_attack_discovery.ts" + "plugin": "dataVisualizer", + "path": "x-pack/platform/plugins/private/data_visualizer/server/routes.ts" }, { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/create_route.ts" + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/server/routes/api/field_histograms/register_route.ts" }, { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/bulk_actions_route.ts" + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/server/routes/api/transforms_update/register_route.ts" }, { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/append_conversation_messages_route.ts" + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/server/routes/api/reauthorize_transforms/register_route.ts" }, { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/post_knowledge_base.ts" + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/server/routes/api/reset_transforms/register_route.ts" }, { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/evaluate/post_evaluate.ts" + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/server/routes/api/transforms_preview/register_route.ts" }, { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/prompts/bulk_actions_route.ts" + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/server/routes/api/start_transforms/register_route.ts" }, { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/anonymization_fields/bulk_actions_route.ts" + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/server/routes/api/stop_transforms/register_route.ts" }, { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/chat/chat_complete_route.ts" + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/server/routes/api/delete_transforms/register_route.ts" }, { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/post_actions_connector_execute.ts" + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/server/routes/api/schedule_now_transforms/register_route.ts" }, { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/bulk_actions_route.ts" + "plugin": "aiops", + "path": "x-pack/platform/plugins/shared/aiops/server/routes/log_rate_analysis_field_candidates/define_route.ts" }, { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/create_route.ts" + "plugin": "aiops", + "path": "x-pack/platform/plugins/shared/aiops/server/routes/log_rate_analysis/define_route.ts" }, { - "plugin": "elasticAssistant", - "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/post_defend_insights.ts" + "plugin": "aiops", + "path": "x-pack/platform/plugins/shared/aiops/server/routes/categorization_field_validation/define_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/index.ts" + "plugin": "integrationAssistant", + "path": "x-pack/platform/plugins/shared/integration_assistant/server/routes/ecs_routes.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/index.ts" + "plugin": "integrationAssistant", + "path": "x-pack/platform/plugins/shared/integration_assistant/server/routes/build_integration_routes.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/index.ts" + "plugin": "integrationAssistant", + "path": "x-pack/platform/plugins/shared/integration_assistant/server/routes/categorization_routes.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_installation/review_rule_installation_route.ts" + "plugin": "integrationAssistant", + "path": "x-pack/platform/plugins/shared/integration_assistant/server/routes/related_routes.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_upgrade/review_rule_upgrade_route.ts" + "plugin": "integrationAssistant", + "path": "x-pack/platform/plugins/shared/integration_assistant/server/routes/pipeline_routes.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_installation/perform_rule_installation_route.ts" + "plugin": "integrationAssistant", + "path": "x-pack/platform/plugins/shared/integration_assistant/server/routes/analyze_logs_routes.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/route.ts" + "plugin": "integrationAssistant", + "path": "x-pack/platform/plugins/shared/integration_assistant/server/routes/cel_routes.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/create_rule/route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/export_rules/route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_rule_health/get_rule_health_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/import_rules/route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_space_health/get_space_health_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/coverage_overview/route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/setup/setup_health_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/perform_rule_upgrade_route.ts" + "plugin": "osquery", + "path": "x-pack/platform/plugins/shared/osquery/server/routes/live_query/create_live_query_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/bootstrap_prebuilt_rules/bootstrap_prebuilt_rules.ts" + "plugin": "osquery", + "path": "x-pack/platform/plugins/shared/osquery/server/routes/saved_query/create_saved_query_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/create_index_route.ts" + "plugin": "osquery", + "path": "x-pack/platform/plugins/shared/osquery/server/routes/pack/create_pack_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/create_rule_exceptions/route.ts" + "plugin": "osquery", + "path": "x-pack/platform/plugins/shared/osquery/server/routes/asset/update_assets_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts" + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/cancel/cancel_attack_discovery.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/create_signals_migration_route.ts" + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/attack_discovery/post/post_attack_discovery.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.ts" + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/create_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/query_signals_route.ts" + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/bulk_actions_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/open_close_signals_route.ts" + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/append_conversation_messages_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/indices/delete_indices_route.ts" + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/post_knowledge_base.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/create_prebuilt_saved_objects.ts" + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/evaluate/post_evaluate.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/delete_prebuilt_saved_objects.ts" + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/prompts/bulk_actions_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/onboarding/routes/install_risk_scores.ts" + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/anonymization_fields/bulk_actions_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/exceptions/api/manage_exceptions/route.ts" + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/chat/chat_complete_route.ts" }, { - "plugin": "dashboard", - "path": "src/plugins/dashboard/server/api/register_routes.ts" + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/post_actions_connector_execute.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/dashboards/routes/get_dashboards_by_tags.ts" + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/bulk_actions_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_tags_route.ts" + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/knowledge_base/entries/create_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_assignees_route.ts" + "plugin": "elasticAssistant", + "path": "x-pack/solutions/security/plugins/elastic_assistant/server/routes/defend_insights/post_defend_insights.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/export_timelines/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/copy_timeline/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/draft_timelines/clean_draft_timelines/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upsert.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_installation/review_rule_installation_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upload_csv.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_upgrade/review_rule_upgrade_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/bulk_upload.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_installation/perform_rule_installation_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/preview.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/entity_calculation.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/create_rule/route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/entity_calculation.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/export_rules/route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/init.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/import_rules/route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/enable.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/coverage_overview/route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/disable.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/perform_rule_upgrade_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/schedule_now.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/bootstrap_prebuilt_rules/bootstrap_prebuilt_rules.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/apply_dataview_indices.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/api/create_legacy_notification/route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/init.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/create_index_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/start.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/create_rule_exceptions/route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/stop.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/enablement.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/create_signals_migration_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/create.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/upsert.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/query_signals_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/install.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/open_close_signals_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/install_translated.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/indices/delete_indices_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/create_prebuilt_saved_objects.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/delete_prebuilt_saved_objects.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/onboarding/routes/install_risk_scores.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/exceptions/api/manage_exceptions/route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/dashboards/routes/get_dashboards_by_tags.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_tags_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_assignees_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/export_timelines/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/copy_timeline/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/draft_timelines/clean_draft_timelines/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/suggestions/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upsert.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upload_csv.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/bulk_upload.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_rule_health/get_rule_health_route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/preview.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_space_health/get_space_health_route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/entity_calculation.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/setup/setup_health_route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/entity_calculation.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/api/create_legacy_notification/route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/init.ts" }, { - "plugin": "integrationAssistant", - "path": "x-pack/platform/plugins/shared/integration_assistant/server/routes/ecs_routes.ts" - }, - { - "plugin": "integrationAssistant", - "path": "x-pack/platform/plugins/shared/integration_assistant/server/routes/build_integration_routes.ts" - }, - { - "plugin": "integrationAssistant", - "path": "x-pack/platform/plugins/shared/integration_assistant/server/routes/categorization_routes.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/enable.ts" }, { - "plugin": "integrationAssistant", - "path": "x-pack/platform/plugins/shared/integration_assistant/server/routes/related_routes.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/disable.ts" }, { - "plugin": "integrationAssistant", - "path": "x-pack/platform/plugins/shared/integration_assistant/server/routes/pipeline_routes.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/schedule_now.ts" }, { - "plugin": "integrationAssistant", - "path": "x-pack/platform/plugins/shared/integration_assistant/server/routes/analyze_logs_routes.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/apply_dataview_indices.ts" }, { - "plugin": "integrationAssistant", - "path": "x-pack/platform/plugins/shared/integration_assistant/server/routes/cel_routes.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/init.ts" }, { - "plugin": "metricsDataAccess", - "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/start.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/stop.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_create_rules/route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/enablement.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_delete_rules/route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/create.ts" }, { - "plugin": "dataUsage", - "path": "x-pack/platform/plugins/private/data_usage/server/routes/internal/usage_metrics.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/upsert.ts" }, { - "plugin": "dataVisualizer", - "path": "x-pack/platform/plugins/private/data_visualizer/server/routes.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/install.ts" }, { - "plugin": "dataVisualizer", - "path": "x-pack/platform/plugins/private/data_visualizer/server/routes.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/install_translated.ts" }, { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/server/routes/api/field_histograms/register_route.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/server/routes/api/transforms_update/register_route.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/server/routes/api/reauthorize_transforms/register_route.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/server/routes/api/reset_transforms/register_route.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/server/routes/api/transforms_preview/register_route.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/server/routes/api/start_transforms/register_route.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/server/routes/api/stop_transforms/register_route.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/server/routes/api/delete_transforms/register_route.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/server/routes/api/schedule_now_transforms/register_route.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { - "plugin": "aiops", - "path": "x-pack/platform/plugins/shared/aiops/server/routes/log_rate_analysis_field_candidates/define_route.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { - "plugin": "aiops", - "path": "x-pack/platform/plugins/shared/aiops/server/routes/log_rate_analysis/define_route.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/suggestions/index.ts" }, { - "plugin": "aiops", - "path": "x-pack/platform/plugins/shared/aiops/server/routes/categorization_field_validation/define_route.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts" }, { "plugin": "dataUsage", @@ -18299,6 +17807,14 @@ "plugin": "synthetics", "path": "x-pack/solutions/observability/plugins/synthetics/server/server.ts" }, + { + "plugin": "cloudSecurityPosture", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/bulk_action.ts" + }, + { + "plugin": "cloudSecurityPosture", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/graph/route.ts" + }, { "plugin": "ecsDataQualityDashboard", "path": "x-pack/solutions/security/plugins/ecs_data_quality_dashboard/server/routes/get_unallowed_field_values.ts" @@ -18307,6 +17823,14 @@ "plugin": "ecsDataQualityDashboard", "path": "x-pack/solutions/security/plugins/ecs_data_quality_dashboard/server/routes/results/post_index_results.ts" }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_create_rules/route.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_delete_rules/route.ts" + }, { "plugin": "dataViewFieldEditor", "path": "src/plugins/data_view_field_editor/server/routes/field_preview.ts" @@ -18499,36 +18023,36 @@ "path": "x-pack/plugins/lists/server/routes/list/patch_list_route.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/patch_rule/route.ts" + "plugin": "metricsDataAccess", + "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/patch_timelines/index.ts" + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/persist_favorite/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/patch_rule/route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/notes/persist_note.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/patch_timelines/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/pinned_events/persist_pinned_event.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/persist_favorite/index.ts" }, { - "plugin": "metricsDataAccess", - "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/notes/persist_note.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/pinned_events/persist_pinned_event.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_patch_rules/route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_patch_rules/route.ts" }, { "plugin": "@kbn/core-http-router-server-internal", @@ -18745,6 +18269,18 @@ "plugin": "maps", "path": "x-pack/plugins/maps/server/data_indexing/indexing_routes.ts" }, + { + "plugin": "dashboard", + "path": "src/plugins/dashboard/server/api/register_routes.ts" + }, + { + "plugin": "metricsDataAccess", + "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" + }, { "plugin": "osquery", "path": "x-pack/platform/plugins/shared/osquery/server/routes/saved_query/delete_saved_query_route.ts" @@ -18759,59 +18295,47 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/delete_rule/route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/delete_rule/route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/delete_signals_migration_route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/delete_signals_migration_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/delete_index_route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/delete_index_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/delete_script_route.ts" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/server/api/register_routes.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/stored_scripts/delete_script_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/delete_timelines/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/delete_timelines/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/notes/delete_note.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/notes/delete_note.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/delete.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/delete.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/delete.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/delete.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/delete.ts" - }, - { - "plugin": "metricsDataAccess", - "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/delete.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/server.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_delete_rules/route.ts" - }, - { - "plugin": "synthetics", - "path": "x-pack/solutions/observability/plugins/synthetics/server/server.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_delete_rules/route.ts" }, { "plugin": "@kbn/core-http-router-server-internal", diff --git a/api_docs/kbn_core_http_server.mdx b/api_docs/kbn_core_http_server.mdx index fb817e6d61e77..780088e905792 100644 --- a/api_docs/kbn_core_http_server.mdx +++ b/api_docs/kbn_core_http_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server title: "@kbn/core-http-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server'] --- import kbnCoreHttpServerObj from './kbn_core_http_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_internal.mdx b/api_docs/kbn_core_http_server_internal.mdx index 63a358fec238a..34c76f0cbcca5 100644 --- a/api_docs/kbn_core_http_server_internal.mdx +++ b/api_docs/kbn_core_http_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-internal title: "@kbn/core-http-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-internal'] --- import kbnCoreHttpServerInternalObj from './kbn_core_http_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_mocks.mdx b/api_docs/kbn_core_http_server_mocks.mdx index 8564175ccc606..be460ee613fd0 100644 --- a/api_docs/kbn_core_http_server_mocks.mdx +++ b/api_docs/kbn_core_http_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-mocks title: "@kbn/core-http-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-mocks'] --- import kbnCoreHttpServerMocksObj from './kbn_core_http_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_utils.mdx b/api_docs/kbn_core_http_server_utils.mdx index a40a09562c680..1e8cc6a944c74 100644 --- a/api_docs/kbn_core_http_server_utils.mdx +++ b/api_docs/kbn_core_http_server_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-utils title: "@kbn/core-http-server-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-utils'] --- import kbnCoreHttpServerUtilsObj from './kbn_core_http_server_utils.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_browser.mdx b/api_docs/kbn_core_i18n_browser.mdx index 06f9d177b5bf9..947e2990371ad 100644 --- a/api_docs/kbn_core_i18n_browser.mdx +++ b/api_docs/kbn_core_i18n_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser title: "@kbn/core-i18n-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser'] --- import kbnCoreI18nBrowserObj from './kbn_core_i18n_browser.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_browser_mocks.mdx b/api_docs/kbn_core_i18n_browser_mocks.mdx index 7dbba189b6b93..0d2df9c851421 100644 --- a/api_docs/kbn_core_i18n_browser_mocks.mdx +++ b/api_docs/kbn_core_i18n_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-browser-mocks title: "@kbn/core-i18n-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-browser-mocks'] --- import kbnCoreI18nBrowserMocksObj from './kbn_core_i18n_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server.mdx b/api_docs/kbn_core_i18n_server.mdx index e04ab003a615e..da3e262f1e377 100644 --- a/api_docs/kbn_core_i18n_server.mdx +++ b/api_docs/kbn_core_i18n_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server title: "@kbn/core-i18n-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server'] --- import kbnCoreI18nServerObj from './kbn_core_i18n_server.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server_internal.mdx b/api_docs/kbn_core_i18n_server_internal.mdx index f62a8249f3127..f552eeb4c652b 100644 --- a/api_docs/kbn_core_i18n_server_internal.mdx +++ b/api_docs/kbn_core_i18n_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server-internal title: "@kbn/core-i18n-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server-internal'] --- import kbnCoreI18nServerInternalObj from './kbn_core_i18n_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_server_mocks.mdx b/api_docs/kbn_core_i18n_server_mocks.mdx index d67c0832ab9a0..0c0b3a7206029 100644 --- a/api_docs/kbn_core_i18n_server_mocks.mdx +++ b/api_docs/kbn_core_i18n_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-i18n-server-mocks title: "@kbn/core-i18n-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-i18n-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-i18n-server-mocks'] --- import kbnCoreI18nServerMocksObj from './kbn_core_i18n_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx index a1bec75ab6ff9..67d7f8ad2e27f 100644 --- a/api_docs/kbn_core_injected_metadata_browser_mocks.mdx +++ b/api_docs/kbn_core_injected_metadata_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-injected-metadata-browser-mocks title: "@kbn/core-injected-metadata-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-injected-metadata-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-injected-metadata-browser-mocks'] --- import kbnCoreInjectedMetadataBrowserMocksObj from './kbn_core_injected_metadata_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_integrations_browser_internal.mdx b/api_docs/kbn_core_integrations_browser_internal.mdx index e0b674929eb99..405c62a9f203b 100644 --- a/api_docs/kbn_core_integrations_browser_internal.mdx +++ b/api_docs/kbn_core_integrations_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-integrations-browser-internal title: "@kbn/core-integrations-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-integrations-browser-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-integrations-browser-internal'] --- import kbnCoreIntegrationsBrowserInternalObj from './kbn_core_integrations_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_integrations_browser_mocks.mdx b/api_docs/kbn_core_integrations_browser_mocks.mdx index a5f85a670ef87..795d9101c2d03 100644 --- a/api_docs/kbn_core_integrations_browser_mocks.mdx +++ b/api_docs/kbn_core_integrations_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-integrations-browser-mocks title: "@kbn/core-integrations-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-integrations-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-integrations-browser-mocks'] --- import kbnCoreIntegrationsBrowserMocksObj from './kbn_core_integrations_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_browser.mdx b/api_docs/kbn_core_lifecycle_browser.mdx index e171efaa1b122..23a15e800995f 100644 --- a/api_docs/kbn_core_lifecycle_browser.mdx +++ b/api_docs/kbn_core_lifecycle_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-browser title: "@kbn/core-lifecycle-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-browser'] --- import kbnCoreLifecycleBrowserObj from './kbn_core_lifecycle_browser.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_browser_mocks.mdx b/api_docs/kbn_core_lifecycle_browser_mocks.mdx index 53af1e322b38f..6c5f918cbb1c2 100644 --- a/api_docs/kbn_core_lifecycle_browser_mocks.mdx +++ b/api_docs/kbn_core_lifecycle_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-browser-mocks title: "@kbn/core-lifecycle-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-browser-mocks'] --- import kbnCoreLifecycleBrowserMocksObj from './kbn_core_lifecycle_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_server.mdx b/api_docs/kbn_core_lifecycle_server.mdx index 37cb62afd58ad..01af455528351 100644 --- a/api_docs/kbn_core_lifecycle_server.mdx +++ b/api_docs/kbn_core_lifecycle_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-server title: "@kbn/core-lifecycle-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-server'] --- import kbnCoreLifecycleServerObj from './kbn_core_lifecycle_server.devdocs.json'; diff --git a/api_docs/kbn_core_lifecycle_server_mocks.mdx b/api_docs/kbn_core_lifecycle_server_mocks.mdx index 30f45c42e8c55..7042f6f1a0bda 100644 --- a/api_docs/kbn_core_lifecycle_server_mocks.mdx +++ b/api_docs/kbn_core_lifecycle_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-lifecycle-server-mocks title: "@kbn/core-lifecycle-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-lifecycle-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-lifecycle-server-mocks'] --- import kbnCoreLifecycleServerMocksObj from './kbn_core_lifecycle_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_logging_browser_mocks.mdx b/api_docs/kbn_core_logging_browser_mocks.mdx index 51a59f4c5d96d..f106be65cffa8 100644 --- a/api_docs/kbn_core_logging_browser_mocks.mdx +++ b/api_docs/kbn_core_logging_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-browser-mocks title: "@kbn/core-logging-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-browser-mocks'] --- import kbnCoreLoggingBrowserMocksObj from './kbn_core_logging_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_logging_common_internal.mdx b/api_docs/kbn_core_logging_common_internal.mdx index 9866b7109e8d1..cd0676e5dd670 100644 --- a/api_docs/kbn_core_logging_common_internal.mdx +++ b/api_docs/kbn_core_logging_common_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-common-internal title: "@kbn/core-logging-common-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-common-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-common-internal'] --- import kbnCoreLoggingCommonInternalObj from './kbn_core_logging_common_internal.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server.mdx b/api_docs/kbn_core_logging_server.mdx index fb8ee11df1dd3..beaa3bf73be6c 100644 --- a/api_docs/kbn_core_logging_server.mdx +++ b/api_docs/kbn_core_logging_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server title: "@kbn/core-logging-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server'] --- import kbnCoreLoggingServerObj from './kbn_core_logging_server.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server_internal.mdx b/api_docs/kbn_core_logging_server_internal.mdx index 0acd02be9dff4..7c63e96effc57 100644 --- a/api_docs/kbn_core_logging_server_internal.mdx +++ b/api_docs/kbn_core_logging_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-internal title: "@kbn/core-logging-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-internal'] --- import kbnCoreLoggingServerInternalObj from './kbn_core_logging_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_logging_server_mocks.mdx b/api_docs/kbn_core_logging_server_mocks.mdx index 19f98ecfda2d1..c72afbba9490d 100644 --- a/api_docs/kbn_core_logging_server_mocks.mdx +++ b/api_docs/kbn_core_logging_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-logging-server-mocks title: "@kbn/core-logging-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-logging-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-logging-server-mocks'] --- import kbnCoreLoggingServerMocksObj from './kbn_core_logging_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_collectors_server_internal.mdx b/api_docs/kbn_core_metrics_collectors_server_internal.mdx index 1f4a7c7326e1a..52c5a2e9abf20 100644 --- a/api_docs/kbn_core_metrics_collectors_server_internal.mdx +++ b/api_docs/kbn_core_metrics_collectors_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-collectors-server-internal title: "@kbn/core-metrics-collectors-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-collectors-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-collectors-server-internal'] --- import kbnCoreMetricsCollectorsServerInternalObj from './kbn_core_metrics_collectors_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_collectors_server_mocks.mdx b/api_docs/kbn_core_metrics_collectors_server_mocks.mdx index 565fdc6f3adf0..2b8d2b8e85818 100644 --- a/api_docs/kbn_core_metrics_collectors_server_mocks.mdx +++ b/api_docs/kbn_core_metrics_collectors_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-collectors-server-mocks title: "@kbn/core-metrics-collectors-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-collectors-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-collectors-server-mocks'] --- import kbnCoreMetricsCollectorsServerMocksObj from './kbn_core_metrics_collectors_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server.mdx b/api_docs/kbn_core_metrics_server.mdx index 2ed957b921c09..89e92aa689be3 100644 --- a/api_docs/kbn_core_metrics_server.mdx +++ b/api_docs/kbn_core_metrics_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server title: "@kbn/core-metrics-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server'] --- import kbnCoreMetricsServerObj from './kbn_core_metrics_server.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server_internal.mdx b/api_docs/kbn_core_metrics_server_internal.mdx index a23afb67746cd..173b2c04e33c5 100644 --- a/api_docs/kbn_core_metrics_server_internal.mdx +++ b/api_docs/kbn_core_metrics_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server-internal title: "@kbn/core-metrics-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server-internal'] --- import kbnCoreMetricsServerInternalObj from './kbn_core_metrics_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_metrics_server_mocks.mdx b/api_docs/kbn_core_metrics_server_mocks.mdx index bf3a4ab01b2ad..b02008727f3fb 100644 --- a/api_docs/kbn_core_metrics_server_mocks.mdx +++ b/api_docs/kbn_core_metrics_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-metrics-server-mocks title: "@kbn/core-metrics-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-metrics-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-metrics-server-mocks'] --- import kbnCoreMetricsServerMocksObj from './kbn_core_metrics_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_mount_utils_browser.mdx b/api_docs/kbn_core_mount_utils_browser.mdx index ec9c167a0e781..9937e09f02c72 100644 --- a/api_docs/kbn_core_mount_utils_browser.mdx +++ b/api_docs/kbn_core_mount_utils_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-mount-utils-browser title: "@kbn/core-mount-utils-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-mount-utils-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-mount-utils-browser'] --- import kbnCoreMountUtilsBrowserObj from './kbn_core_mount_utils_browser.devdocs.json'; diff --git a/api_docs/kbn_core_node_server.mdx b/api_docs/kbn_core_node_server.mdx index 305a6c2d6eef7..0ef85f44854cf 100644 --- a/api_docs/kbn_core_node_server.mdx +++ b/api_docs/kbn_core_node_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server title: "@kbn/core-node-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server'] --- import kbnCoreNodeServerObj from './kbn_core_node_server.devdocs.json'; diff --git a/api_docs/kbn_core_node_server_internal.mdx b/api_docs/kbn_core_node_server_internal.mdx index e7d5c5d621e4d..88efb60134746 100644 --- a/api_docs/kbn_core_node_server_internal.mdx +++ b/api_docs/kbn_core_node_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-internal title: "@kbn/core-node-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-internal'] --- import kbnCoreNodeServerInternalObj from './kbn_core_node_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_node_server_mocks.mdx b/api_docs/kbn_core_node_server_mocks.mdx index d7f76fee384c8..065a88bd003b0 100644 --- a/api_docs/kbn_core_node_server_mocks.mdx +++ b/api_docs/kbn_core_node_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-node-server-mocks title: "@kbn/core-node-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-node-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-node-server-mocks'] --- import kbnCoreNodeServerMocksObj from './kbn_core_node_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser.mdx b/api_docs/kbn_core_notifications_browser.mdx index 379a51ba3b507..ff60451c6e3c7 100644 --- a/api_docs/kbn_core_notifications_browser.mdx +++ b/api_docs/kbn_core_notifications_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser title: "@kbn/core-notifications-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser'] --- import kbnCoreNotificationsBrowserObj from './kbn_core_notifications_browser.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser_internal.mdx b/api_docs/kbn_core_notifications_browser_internal.mdx index 0b44ea6c717d1..ec8e9abf1b9c2 100644 --- a/api_docs/kbn_core_notifications_browser_internal.mdx +++ b/api_docs/kbn_core_notifications_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser-internal title: "@kbn/core-notifications-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser-internal'] --- import kbnCoreNotificationsBrowserInternalObj from './kbn_core_notifications_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_notifications_browser_mocks.mdx b/api_docs/kbn_core_notifications_browser_mocks.mdx index dfaab1304dd8a..9cc755920e753 100644 --- a/api_docs/kbn_core_notifications_browser_mocks.mdx +++ b/api_docs/kbn_core_notifications_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-notifications-browser-mocks title: "@kbn/core-notifications-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-notifications-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-notifications-browser-mocks'] --- import kbnCoreNotificationsBrowserMocksObj from './kbn_core_notifications_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser.mdx b/api_docs/kbn_core_overlays_browser.mdx index 668d3d54e3881..ba6945dd72be4 100644 --- a/api_docs/kbn_core_overlays_browser.mdx +++ b/api_docs/kbn_core_overlays_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser title: "@kbn/core-overlays-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser'] --- import kbnCoreOverlaysBrowserObj from './kbn_core_overlays_browser.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser_internal.mdx b/api_docs/kbn_core_overlays_browser_internal.mdx index 3125d9a5cd553..bba2164035761 100644 --- a/api_docs/kbn_core_overlays_browser_internal.mdx +++ b/api_docs/kbn_core_overlays_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser-internal title: "@kbn/core-overlays-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser-internal'] --- import kbnCoreOverlaysBrowserInternalObj from './kbn_core_overlays_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_overlays_browser_mocks.mdx b/api_docs/kbn_core_overlays_browser_mocks.mdx index a10476ba4b2a9..fd95ea1792514 100644 --- a/api_docs/kbn_core_overlays_browser_mocks.mdx +++ b/api_docs/kbn_core_overlays_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-overlays-browser-mocks title: "@kbn/core-overlays-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-overlays-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-overlays-browser-mocks'] --- import kbnCoreOverlaysBrowserMocksObj from './kbn_core_overlays_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_browser.mdx b/api_docs/kbn_core_plugins_browser.mdx index f10161a5e2e60..415ff8d539c8e 100644 --- a/api_docs/kbn_core_plugins_browser.mdx +++ b/api_docs/kbn_core_plugins_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-browser title: "@kbn/core-plugins-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-browser'] --- import kbnCorePluginsBrowserObj from './kbn_core_plugins_browser.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_browser_mocks.mdx b/api_docs/kbn_core_plugins_browser_mocks.mdx index d92d104a19fc2..a3f1c6f8f2d26 100644 --- a/api_docs/kbn_core_plugins_browser_mocks.mdx +++ b/api_docs/kbn_core_plugins_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-browser-mocks title: "@kbn/core-plugins-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-browser-mocks'] --- import kbnCorePluginsBrowserMocksObj from './kbn_core_plugins_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_contracts_browser.mdx b/api_docs/kbn_core_plugins_contracts_browser.mdx index 9041b6015d47c..c1265098619ef 100644 --- a/api_docs/kbn_core_plugins_contracts_browser.mdx +++ b/api_docs/kbn_core_plugins_contracts_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-contracts-browser title: "@kbn/core-plugins-contracts-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-contracts-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-contracts-browser'] --- import kbnCorePluginsContractsBrowserObj from './kbn_core_plugins_contracts_browser.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_contracts_server.mdx b/api_docs/kbn_core_plugins_contracts_server.mdx index aaa0404d7f5ba..2c64d111182fc 100644 --- a/api_docs/kbn_core_plugins_contracts_server.mdx +++ b/api_docs/kbn_core_plugins_contracts_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-contracts-server title: "@kbn/core-plugins-contracts-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-contracts-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-contracts-server'] --- import kbnCorePluginsContractsServerObj from './kbn_core_plugins_contracts_server.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_server.mdx b/api_docs/kbn_core_plugins_server.mdx index 37e7355c9ed88..4df4570abea06 100644 --- a/api_docs/kbn_core_plugins_server.mdx +++ b/api_docs/kbn_core_plugins_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-server title: "@kbn/core-plugins-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-server'] --- import kbnCorePluginsServerObj from './kbn_core_plugins_server.devdocs.json'; diff --git a/api_docs/kbn_core_plugins_server_mocks.mdx b/api_docs/kbn_core_plugins_server_mocks.mdx index dae42e2608cf4..9f97bda044714 100644 --- a/api_docs/kbn_core_plugins_server_mocks.mdx +++ b/api_docs/kbn_core_plugins_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-plugins-server-mocks title: "@kbn/core-plugins-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-plugins-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-plugins-server-mocks'] --- import kbnCorePluginsServerMocksObj from './kbn_core_plugins_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_preboot_server.mdx b/api_docs/kbn_core_preboot_server.mdx index 9091afdd50c8a..b7187d3cc673a 100644 --- a/api_docs/kbn_core_preboot_server.mdx +++ b/api_docs/kbn_core_preboot_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server title: "@kbn/core-preboot-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-preboot-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server'] --- import kbnCorePrebootServerObj from './kbn_core_preboot_server.devdocs.json'; diff --git a/api_docs/kbn_core_preboot_server_mocks.mdx b/api_docs/kbn_core_preboot_server_mocks.mdx index e0856600725fd..f9f5ed7a1b5a0 100644 --- a/api_docs/kbn_core_preboot_server_mocks.mdx +++ b/api_docs/kbn_core_preboot_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-preboot-server-mocks title: "@kbn/core-preboot-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-preboot-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-preboot-server-mocks'] --- import kbnCorePrebootServerMocksObj from './kbn_core_preboot_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_browser.mdx b/api_docs/kbn_core_rendering_browser.mdx index 175b0144c0954..d8ad82cfb271b 100644 --- a/api_docs/kbn_core_rendering_browser.mdx +++ b/api_docs/kbn_core_rendering_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-browser title: "@kbn/core-rendering-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-browser'] --- import kbnCoreRenderingBrowserObj from './kbn_core_rendering_browser.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_browser_mocks.mdx b/api_docs/kbn_core_rendering_browser_mocks.mdx index 27c226c43e685..82d5925b7f0bd 100644 --- a/api_docs/kbn_core_rendering_browser_mocks.mdx +++ b/api_docs/kbn_core_rendering_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-browser-mocks title: "@kbn/core-rendering-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-browser-mocks'] --- import kbnCoreRenderingBrowserMocksObj from './kbn_core_rendering_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_server_internal.mdx b/api_docs/kbn_core_rendering_server_internal.mdx index df9116372d034..98d7556b8dd41 100644 --- a/api_docs/kbn_core_rendering_server_internal.mdx +++ b/api_docs/kbn_core_rendering_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-server-internal title: "@kbn/core-rendering-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-server-internal'] --- import kbnCoreRenderingServerInternalObj from './kbn_core_rendering_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_server_mocks.mdx b/api_docs/kbn_core_rendering_server_mocks.mdx index 8713bcce77902..97a38256a1165 100644 --- a/api_docs/kbn_core_rendering_server_mocks.mdx +++ b/api_docs/kbn_core_rendering_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-server-mocks title: "@kbn/core-rendering-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-server-mocks'] --- import kbnCoreRenderingServerMocksObj from './kbn_core_rendering_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_root_server_internal.mdx b/api_docs/kbn_core_root_server_internal.mdx index 5729ad24532ba..175d6422863a5 100644 --- a/api_docs/kbn_core_root_server_internal.mdx +++ b/api_docs/kbn_core_root_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-root-server-internal title: "@kbn/core-root-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-root-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-root-server-internal'] --- import kbnCoreRootServerInternalObj from './kbn_core_root_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_browser.devdocs.json b/api_docs/kbn_core_saved_objects_api_browser.devdocs.json index d59bfd8881595..c9bd6ed6eec29 100644 --- a/api_docs/kbn_core_saved_objects_api_browser.devdocs.json +++ b/api_docs/kbn_core_saved_objects_api_browser.devdocs.json @@ -2849,11 +2849,11 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/hooks/types.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/hooks/types.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/hooks/types.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/hooks/types.ts" }, { "plugin": "eventAnnotation", diff --git a/api_docs/kbn_core_saved_objects_api_browser.mdx b/api_docs/kbn_core_saved_objects_api_browser.mdx index 697af82f5fc0a..9f4cd213ab5aa 100644 --- a/api_docs/kbn_core_saved_objects_api_browser.mdx +++ b/api_docs/kbn_core_saved_objects_api_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-browser title: "@kbn/core-saved-objects-api-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-browser'] --- import kbnCoreSavedObjectsApiBrowserObj from './kbn_core_saved_objects_api_browser.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_server.devdocs.json b/api_docs/kbn_core_saved_objects_api_server.devdocs.json index 983efe0f523dc..802006aa602aa 100644 --- a/api_docs/kbn_core_saved_objects_api_server.devdocs.json +++ b/api_docs/kbn_core_saved_objects_api_server.devdocs.json @@ -2098,6 +2098,49 @@ } ], "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-saved-objects-api-server", + "id": "def-server.ISavedObjectsRepository.asScopedToNamespace", + "type": "Function", + "tags": [], + "label": "asScopedToNamespace", + "description": [ + "\nReturns a new Saved Objects repository scoped to the specified namespace." + ], + "signature": [ + "(namespace: string) => ", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.ISavedObjectsRepository", + "text": "ISavedObjectsRepository" + } + ], + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-saved-objects-api-server", + "id": "def-server.ISavedObjectsRepository.asScopedToNamespace.$1", + "type": "string", + "tags": [], + "label": "namespace", + "description": [ + "Space to which the repository should be scoped to." + ], + "signature": [ + "string" + ], + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_repository.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] } ], "initialIsOpen": false @@ -2375,136 +2418,136 @@ "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" }, { - "plugin": "osquery", - "path": "x-pack/platform/plugins/shared/osquery/server/routes/pack/read_pack_route.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "osquery", + "path": "x-pack/platform/plugins/shared/osquery/server/routes/pack/read_pack_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/usage/detections/rules/get_metrics.mocks.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/get_metrics.mocks.ts" } ] }, @@ -2815,32 +2858,32 @@ "path": "x-pack/plugins/enterprise_search/server/collectors/lib/telemetry.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts" + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/task_store.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts" + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/task_store.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts" + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/task_store.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts" }, { - "plugin": "taskManager", - "path": "x-pack/plugins/task_manager/server/task_store.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts" }, { - "plugin": "taskManager", - "path": "x-pack/plugins/task_manager/server/task_store.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts" }, { - "plugin": "taskManager", - "path": "x-pack/plugins/task_manager/server/task_store.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts" }, { "plugin": "alerting", @@ -5785,6 +5828,49 @@ "trackAdoption": false, "children": [], "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-saved-objects-api-server", + "id": "def-server.SavedObjectsClientContract.asScopedToNamespace", + "type": "Function", + "tags": [], + "label": "asScopedToNamespace", + "description": [ + "\nReturns a clone of the current Saved Objects client but scoped to the specified namespace." + ], + "signature": [ + "(namespace: string) => ", + { + "pluginId": "@kbn/core-saved-objects-api-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsApiServerPluginApi", + "section": "def-server.SavedObjectsClientContract", + "text": "SavedObjectsClientContract" + } + ], + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-saved-objects-api-server", + "id": "def-server.SavedObjectsClientContract.asScopedToNamespace.$1", + "type": "string", + "tags": [], + "label": "namespace", + "description": [ + "Space to which the client should be scoped to." + ], + "signature": [ + "string" + ], + "path": "packages/core/saved-objects/core-saved-objects-api-server/src/saved_objects_client.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] } ], "initialIsOpen": false diff --git a/api_docs/kbn_core_saved_objects_api_server.mdx b/api_docs/kbn_core_saved_objects_api_server.mdx index 2d1ec1187d66a..f4cf8084833c6 100644 --- a/api_docs/kbn_core_saved_objects_api_server.mdx +++ b/api_docs/kbn_core_saved_objects_api_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-server title: "@kbn/core-saved-objects-api-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-server'] --- import kbnCoreSavedObjectsApiServerObj from './kbn_core_saved_objects_api_server.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 357 | 1 | 5 | 2 | +| 361 | 1 | 5 | 2 | ## Server diff --git a/api_docs/kbn_core_saved_objects_api_server_mocks.mdx b/api_docs/kbn_core_saved_objects_api_server_mocks.mdx index 6b8cc4674619e..450e8f925b9c1 100644 --- a/api_docs/kbn_core_saved_objects_api_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_api_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-api-server-mocks title: "@kbn/core-saved-objects-api-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-api-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-server-mocks'] --- import kbnCoreSavedObjectsApiServerMocksObj from './kbn_core_saved_objects_api_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_base_server_internal.mdx b/api_docs/kbn_core_saved_objects_base_server_internal.mdx index 376503f8b4b7f..a3f45a1d2c64d 100644 --- a/api_docs/kbn_core_saved_objects_base_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_base_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-base-server-internal title: "@kbn/core-saved-objects-base-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-base-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-base-server-internal'] --- import kbnCoreSavedObjectsBaseServerInternalObj from './kbn_core_saved_objects_base_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_base_server_mocks.mdx b/api_docs/kbn_core_saved_objects_base_server_mocks.mdx index 9ffb46ba019d8..dcd4fddf0bcc5 100644 --- a/api_docs/kbn_core_saved_objects_base_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_base_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-base-server-mocks title: "@kbn/core-saved-objects-base-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-base-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-base-server-mocks'] --- import kbnCoreSavedObjectsBaseServerMocksObj from './kbn_core_saved_objects_base_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser.mdx b/api_docs/kbn_core_saved_objects_browser.mdx index a86c605d704bd..636b5229343d1 100644 --- a/api_docs/kbn_core_saved_objects_browser.mdx +++ b/api_docs/kbn_core_saved_objects_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser title: "@kbn/core-saved-objects-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser'] --- import kbnCoreSavedObjectsBrowserObj from './kbn_core_saved_objects_browser.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser_internal.mdx b/api_docs/kbn_core_saved_objects_browser_internal.mdx index 1c110a36519eb..45c75c42efd1d 100644 --- a/api_docs/kbn_core_saved_objects_browser_internal.mdx +++ b/api_docs/kbn_core_saved_objects_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser-internal title: "@kbn/core-saved-objects-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser-internal'] --- import kbnCoreSavedObjectsBrowserInternalObj from './kbn_core_saved_objects_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser_mocks.mdx b/api_docs/kbn_core_saved_objects_browser_mocks.mdx index db00bf1b1d098..bc1f7d6fdf1fc 100644 --- a/api_docs/kbn_core_saved_objects_browser_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-browser-mocks title: "@kbn/core-saved-objects-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-browser-mocks'] --- import kbnCoreSavedObjectsBrowserMocksObj from './kbn_core_saved_objects_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_common.devdocs.json b/api_docs/kbn_core_saved_objects_common.devdocs.json index 3432b73b68444..5e18c6c5a18f3 100644 --- a/api_docs/kbn_core_saved_objects_common.devdocs.json +++ b/api_docs/kbn_core_saved_objects_common.devdocs.json @@ -1341,22 +1341,6 @@ "plugin": "savedObjectsTagging", "path": "x-pack/plugins/saved_objects_tagging/public/utils.test.ts" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" - }, { "plugin": "upgradeAssistant", "path": "x-pack/plugins/upgrade_assistant/common/types.ts" @@ -1377,6 +1361,22 @@ "plugin": "savedObjectsTagging", "path": "x-pack/plugins/saved_objects_tagging/common/test_utils/index.ts" }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + }, { "plugin": "savedObjectsManagement", "path": "src/plugins/saved_objects_management/server/lib/find_relationships.test.ts" @@ -1663,14 +1663,6 @@ "plugin": "visualizations", "path": "src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable.tsx" }, - { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable_factory.tsx" - }, - { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable_factory.tsx" - }, { "plugin": "canvas", "path": "x-pack/plugins/canvas/shareable_runtime/types.ts" @@ -1854,14 +1846,6 @@ "plugin": "visualizations", "path": "src/plugins/visualizations/public/utils/saved_visualize_utils.ts" }, - { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable_factory.tsx" - }, - { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable_factory.tsx" - }, { "plugin": "visualizations", "path": "src/plugins/visualizations/public/visualize_app/components/visualize_listing.tsx" diff --git a/api_docs/kbn_core_saved_objects_common.mdx b/api_docs/kbn_core_saved_objects_common.mdx index ed67ad0666fb8..d447a4a1970bb 100644 --- a/api_docs/kbn_core_saved_objects_common.mdx +++ b/api_docs/kbn_core_saved_objects_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-common title: "@kbn/core-saved-objects-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-common'] --- import kbnCoreSavedObjectsCommonObj from './kbn_core_saved_objects_common.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx b/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx index 5519086addab0..cc6e5dc775641 100644 --- a/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_import_export_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-import-export-server-internal title: "@kbn/core-saved-objects-import-export-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-import-export-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-import-export-server-internal'] --- import kbnCoreSavedObjectsImportExportServerInternalObj from './kbn_core_saved_objects_import_export_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx b/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx index bbc0a6c408f36..9911f26838bcc 100644 --- a/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_import_export_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-import-export-server-mocks title: "@kbn/core-saved-objects-import-export-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-import-export-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-import-export-server-mocks'] --- import kbnCoreSavedObjectsImportExportServerMocksObj from './kbn_core_saved_objects_import_export_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_migration_server_internal.mdx b/api_docs/kbn_core_saved_objects_migration_server_internal.mdx index f8f040587575e..2ea2289faa7ad 100644 --- a/api_docs/kbn_core_saved_objects_migration_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_migration_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-migration-server-internal title: "@kbn/core-saved-objects-migration-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-migration-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-migration-server-internal'] --- import kbnCoreSavedObjectsMigrationServerInternalObj from './kbn_core_saved_objects_migration_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx b/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx index 327e295362dbf..189a42b5b87da 100644 --- a/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_migration_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-migration-server-mocks title: "@kbn/core-saved-objects-migration-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-migration-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-migration-server-mocks'] --- import kbnCoreSavedObjectsMigrationServerMocksObj from './kbn_core_saved_objects_migration_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server.devdocs.json b/api_docs/kbn_core_saved_objects_server.devdocs.json index 3ade9b9cbe1b4..f9596351fc6d9 100644 --- a/api_docs/kbn_core_saved_objects_server.devdocs.json +++ b/api_docs/kbn_core_saved_objects_server.devdocs.json @@ -5120,6 +5120,49 @@ } ], "returnComment": [] + }, + { + "parentPluginId": "@kbn/core-saved-objects-server", + "id": "def-server.ISavedObjectsSpacesExtension.asScopedToNamespace", + "type": "Function", + "tags": [], + "label": "asScopedToNamespace", + "description": [ + "\nReturns a new Saved Objects Spaces Extension scoped to the specified namespace." + ], + "signature": [ + "(namespace: string) => ", + { + "pluginId": "@kbn/core-saved-objects-server", + "scope": "server", + "docId": "kibKbnCoreSavedObjectsServerPluginApi", + "section": "def-server.ISavedObjectsSpacesExtension", + "text": "ISavedObjectsSpacesExtension" + } + ], + "path": "packages/core/saved-objects/core-saved-objects-server/src/extensions/spaces.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/core-saved-objects-server", + "id": "def-server.ISavedObjectsSpacesExtension.asScopedToNamespace.$1", + "type": "string", + "tags": [], + "label": "namespace", + "description": [ + "Space to which the extension should be scoped to." + ], + "signature": [ + "string" + ], + "path": "packages/core/saved-objects/core-saved-objects-server/src/extensions/spaces.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] } ], "initialIsOpen": false @@ -5904,136 +5947,136 @@ "path": "x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts" }, { - "plugin": "osquery", - "path": "x-pack/platform/plugins/shared/osquery/server/routes/pack/read_pack_route.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "alerting", + "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" + "plugin": "osquery", + "path": "x-pack/platform/plugins/shared/osquery/server/routes/pack/read_pack_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/usage/detections/rules/get_metrics.mocks.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "alerting", - "path": "x-pack/plugins/alerting/server/rules_client/lib/siem_legacy_actions/retrieve_migrated_legacy_actions.mock.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/packages/get.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/get_metrics.mocks.ts" } ] }, @@ -6344,32 +6387,32 @@ "path": "x-pack/plugins/enterprise_search/server/collectors/lib/telemetry.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts" + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/task_store.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts" + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/task_store.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts" + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/task_store.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts" }, { - "plugin": "taskManager", - "path": "x-pack/plugins/task_manager/server/task_store.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts" }, { - "plugin": "taskManager", - "path": "x-pack/plugins/task_manager/server/task_store.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts" }, { - "plugin": "taskManager", - "path": "x-pack/plugins/task_manager/server/task_store.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts" }, { "plugin": "alerting", @@ -10731,10 +10774,6 @@ "plugin": "fleet", "path": "x-pack/plugins/fleet/server/saved_objects/index.ts" }, - { - "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/server/saved_objects/csp_benchmark_rule.ts" - }, { "plugin": "ml", "path": "x-pack/platform/plugins/shared/ml/server/saved_objects/saved_objects.ts" @@ -10764,44 +10803,44 @@ "path": "x-pack/plugins/maps/server/saved_objects/setup_saved_objects.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts" + "plugin": "apmDataAccess", + "path": "x-pack/plugins/observability_solution/apm_data_access/server/saved_objects/apm_indices.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/notes.ts" + "plugin": "apm", + "path": "x-pack/plugins/observability_solution/apm/server/saved_objects/apm_service_groups.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/pinned_events.ts" + "plugin": "visualizations", + "path": "src/plugins/visualizations/server/saved_objects/visualization.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_saved_object_mappings.ts" + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/server/lib/sources/saved_object_type.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/saved_object_mappings.ts" + "plugin": "slo", + "path": "x-pack/solutions/observability/plugins/slo/server/saved_objects/slo.ts" }, { - "plugin": "apmDataAccess", - "path": "x-pack/plugins/observability_solution/apm_data_access/server/saved_objects/apm_indices.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts" }, { - "plugin": "apm", - "path": "x-pack/plugins/observability_solution/apm/server/saved_objects/apm_service_groups.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/notes.ts" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/server/saved_objects/visualization.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/pinned_events.ts" }, { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/server/lib/sources/saved_object_type.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_saved_object_mappings.ts" }, { - "plugin": "slo", - "path": "x-pack/plugins/observability_solution/slo/server/saved_objects/slo.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/saved_object_mappings.ts" }, { "plugin": "synthetics", @@ -10811,6 +10850,10 @@ "plugin": "uptime", "path": "x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/saved_objects/uptime_settings.ts" }, + { + "plugin": "cloudSecurityPosture", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/server/saved_objects/csp_benchmark_rule.ts" + }, { "plugin": "eventAnnotation", "path": "src/plugins/event_annotation/server/saved_objects.ts" @@ -11335,16 +11378,16 @@ "path": "src/plugins/saved_search/server/saved_objects/search.ts" }, { - "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/server/saved_objects/csp_benchmark_rule.ts" + "plugin": "visualizations", + "path": "src/plugins/visualizations/server/saved_objects/visualization.ts" }, { "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/server/saved_objects/csp_settings.ts" + "path": "x-pack/solutions/security/plugins/cloud_security_posture/server/saved_objects/csp_benchmark_rule.ts" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/server/saved_objects/visualization.ts" + "plugin": "cloudSecurityPosture", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/server/saved_objects/csp_settings.ts" }, { "plugin": "@kbn/core-test-helpers-so-type-serializer", @@ -11555,24 +11598,24 @@ "path": "x-pack/plugins/maps/server/saved_objects/setup_saved_objects.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts" + "plugin": "visualizations", + "path": "src/plugins/visualizations/server/saved_objects/visualization.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/notes.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/pinned_events.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/notes.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_saved_object_mappings.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/pinned_events.ts" }, { - "plugin": "visualizations", - "path": "src/plugins/visualizations/server/saved_objects/visualization.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_saved_object_mappings.ts" }, { "plugin": "@kbn/core-test-helpers-so-type-serializer", diff --git a/api_docs/kbn_core_saved_objects_server.mdx b/api_docs/kbn_core_saved_objects_server.mdx index a1661c8a9b8d2..84e54ba54a401 100644 --- a/api_docs/kbn_core_saved_objects_server.mdx +++ b/api_docs/kbn_core_saved_objects_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server title: "@kbn/core-saved-objects-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server'] --- import kbnCoreSavedObjectsServerObj from './kbn_core_saved_objects_server.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 564 | 1 | 134 | 4 | +| 566 | 1 | 134 | 4 | ## Server diff --git a/api_docs/kbn_core_saved_objects_server_internal.mdx b/api_docs/kbn_core_saved_objects_server_internal.mdx index 24e882f0d0c2e..1d368c39b7395 100644 --- a/api_docs/kbn_core_saved_objects_server_internal.mdx +++ b/api_docs/kbn_core_saved_objects_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server-internal title: "@kbn/core-saved-objects-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server-internal'] --- import kbnCoreSavedObjectsServerInternalObj from './kbn_core_saved_objects_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_server_mocks.mdx b/api_docs/kbn_core_saved_objects_server_mocks.mdx index 0550f90d32def..bc2858bb1367b 100644 --- a/api_docs/kbn_core_saved_objects_server_mocks.mdx +++ b/api_docs/kbn_core_saved_objects_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-server-mocks title: "@kbn/core-saved-objects-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-server-mocks'] --- import kbnCoreSavedObjectsServerMocksObj from './kbn_core_saved_objects_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_utils_server.mdx b/api_docs/kbn_core_saved_objects_utils_server.mdx index 6626fedc6175c..9da82a3aeba53 100644 --- a/api_docs/kbn_core_saved_objects_utils_server.mdx +++ b/api_docs/kbn_core_saved_objects_utils_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-saved-objects-utils-server title: "@kbn/core-saved-objects-utils-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-saved-objects-utils-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-utils-server'] --- import kbnCoreSavedObjectsUtilsServerObj from './kbn_core_saved_objects_utils_server.devdocs.json'; diff --git a/api_docs/kbn_core_security_browser.mdx b/api_docs/kbn_core_security_browser.mdx index 50130a57894f8..d5055f9195040 100644 --- a/api_docs/kbn_core_security_browser.mdx +++ b/api_docs/kbn_core_security_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-browser title: "@kbn/core-security-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-browser'] --- import kbnCoreSecurityBrowserObj from './kbn_core_security_browser.devdocs.json'; diff --git a/api_docs/kbn_core_security_browser_internal.mdx b/api_docs/kbn_core_security_browser_internal.mdx index f1c43ffe83fd3..8bea246550e81 100644 --- a/api_docs/kbn_core_security_browser_internal.mdx +++ b/api_docs/kbn_core_security_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-browser-internal title: "@kbn/core-security-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-browser-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-browser-internal'] --- import kbnCoreSecurityBrowserInternalObj from './kbn_core_security_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_security_browser_mocks.mdx b/api_docs/kbn_core_security_browser_mocks.mdx index e2fff60825af8..2aec8f02f3816 100644 --- a/api_docs/kbn_core_security_browser_mocks.mdx +++ b/api_docs/kbn_core_security_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-browser-mocks title: "@kbn/core-security-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-browser-mocks'] --- import kbnCoreSecurityBrowserMocksObj from './kbn_core_security_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_security_common.mdx b/api_docs/kbn_core_security_common.mdx index db606b23da1cc..332752df684bc 100644 --- a/api_docs/kbn_core_security_common.mdx +++ b/api_docs/kbn_core_security_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-common title: "@kbn/core-security-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-common'] --- import kbnCoreSecurityCommonObj from './kbn_core_security_common.devdocs.json'; diff --git a/api_docs/kbn_core_security_server.mdx b/api_docs/kbn_core_security_server.mdx index 40bf9bbd5e61b..9541f95fe4fc0 100644 --- a/api_docs/kbn_core_security_server.mdx +++ b/api_docs/kbn_core_security_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-server title: "@kbn/core-security-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-server'] --- import kbnCoreSecurityServerObj from './kbn_core_security_server.devdocs.json'; diff --git a/api_docs/kbn_core_security_server_internal.mdx b/api_docs/kbn_core_security_server_internal.mdx index 6eb8c7c24bf55..e2e5a5b30b10e 100644 --- a/api_docs/kbn_core_security_server_internal.mdx +++ b/api_docs/kbn_core_security_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-server-internal title: "@kbn/core-security-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-server-internal'] --- import kbnCoreSecurityServerInternalObj from './kbn_core_security_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_security_server_mocks.mdx b/api_docs/kbn_core_security_server_mocks.mdx index 64cc96caa6e67..9d2bb2fb07c4e 100644 --- a/api_docs/kbn_core_security_server_mocks.mdx +++ b/api_docs/kbn_core_security_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-security-server-mocks title: "@kbn/core-security-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-security-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-server-mocks'] --- import kbnCoreSecurityServerMocksObj from './kbn_core_security_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_status_common.mdx b/api_docs/kbn_core_status_common.mdx index 8ce7497229ae8..eb05a0968d673 100644 --- a/api_docs/kbn_core_status_common.mdx +++ b/api_docs/kbn_core_status_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-common title: "@kbn/core-status-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-common'] --- import kbnCoreStatusCommonObj from './kbn_core_status_common.devdocs.json'; diff --git a/api_docs/kbn_core_status_server.mdx b/api_docs/kbn_core_status_server.mdx index 38ce07ecd24ee..c771b073f34cc 100644 --- a/api_docs/kbn_core_status_server.mdx +++ b/api_docs/kbn_core_status_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server title: "@kbn/core-status-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server'] --- import kbnCoreStatusServerObj from './kbn_core_status_server.devdocs.json'; diff --git a/api_docs/kbn_core_status_server_internal.mdx b/api_docs/kbn_core_status_server_internal.mdx index a8a95148cd2c9..e921db503078d 100644 --- a/api_docs/kbn_core_status_server_internal.mdx +++ b/api_docs/kbn_core_status_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server-internal title: "@kbn/core-status-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server-internal'] --- import kbnCoreStatusServerInternalObj from './kbn_core_status_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_status_server_mocks.mdx b/api_docs/kbn_core_status_server_mocks.mdx index cf023c50b0ad9..76aef15c810d3 100644 --- a/api_docs/kbn_core_status_server_mocks.mdx +++ b/api_docs/kbn_core_status_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-status-server-mocks title: "@kbn/core-status-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-status-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-status-server-mocks'] --- import kbnCoreStatusServerMocksObj from './kbn_core_status_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_deprecations_getters.mdx b/api_docs/kbn_core_test_helpers_deprecations_getters.mdx index 0a38278785854..612e270b0d536 100644 --- a/api_docs/kbn_core_test_helpers_deprecations_getters.mdx +++ b/api_docs/kbn_core_test_helpers_deprecations_getters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-deprecations-getters title: "@kbn/core-test-helpers-deprecations-getters" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-deprecations-getters plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-deprecations-getters'] --- import kbnCoreTestHelpersDeprecationsGettersObj from './kbn_core_test_helpers_deprecations_getters.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_http_setup_browser.mdx b/api_docs/kbn_core_test_helpers_http_setup_browser.mdx index 11d76a9521d87..f7bef342e59fb 100644 --- a/api_docs/kbn_core_test_helpers_http_setup_browser.mdx +++ b/api_docs/kbn_core_test_helpers_http_setup_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-http-setup-browser title: "@kbn/core-test-helpers-http-setup-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-http-setup-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-http-setup-browser'] --- import kbnCoreTestHelpersHttpSetupBrowserObj from './kbn_core_test_helpers_http_setup_browser.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_kbn_server.mdx b/api_docs/kbn_core_test_helpers_kbn_server.mdx index f6eb8568cb1d7..3903a7a6602ee 100644 --- a/api_docs/kbn_core_test_helpers_kbn_server.mdx +++ b/api_docs/kbn_core_test_helpers_kbn_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-kbn-server title: "@kbn/core-test-helpers-kbn-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-kbn-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-kbn-server'] --- import kbnCoreTestHelpersKbnServerObj from './kbn_core_test_helpers_kbn_server.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_model_versions.mdx b/api_docs/kbn_core_test_helpers_model_versions.mdx index ec5cbe14b3285..96d16804e5ffc 100644 --- a/api_docs/kbn_core_test_helpers_model_versions.mdx +++ b/api_docs/kbn_core_test_helpers_model_versions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-model-versions title: "@kbn/core-test-helpers-model-versions" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-model-versions plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-model-versions'] --- import kbnCoreTestHelpersModelVersionsObj from './kbn_core_test_helpers_model_versions.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_so_type_serializer.mdx b/api_docs/kbn_core_test_helpers_so_type_serializer.mdx index 5e72f253af9e7..73a0273ce3d46 100644 --- a/api_docs/kbn_core_test_helpers_so_type_serializer.mdx +++ b/api_docs/kbn_core_test_helpers_so_type_serializer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-so-type-serializer title: "@kbn/core-test-helpers-so-type-serializer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-so-type-serializer plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-so-type-serializer'] --- import kbnCoreTestHelpersSoTypeSerializerObj from './kbn_core_test_helpers_so_type_serializer.devdocs.json'; diff --git a/api_docs/kbn_core_test_helpers_test_utils.mdx b/api_docs/kbn_core_test_helpers_test_utils.mdx index 1f676fc512fa7..2accf5d5ed282 100644 --- a/api_docs/kbn_core_test_helpers_test_utils.mdx +++ b/api_docs/kbn_core_test_helpers_test_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-test-helpers-test-utils title: "@kbn/core-test-helpers-test-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-test-helpers-test-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-test-helpers-test-utils'] --- import kbnCoreTestHelpersTestUtilsObj from './kbn_core_test_helpers_test_utils.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser.mdx b/api_docs/kbn_core_theme_browser.mdx index 7068a81d5e9f2..94aa509d681c2 100644 --- a/api_docs/kbn_core_theme_browser.mdx +++ b/api_docs/kbn_core_theme_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser title: "@kbn/core-theme-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser'] --- import kbnCoreThemeBrowserObj from './kbn_core_theme_browser.devdocs.json'; diff --git a/api_docs/kbn_core_theme_browser_mocks.mdx b/api_docs/kbn_core_theme_browser_mocks.mdx index 8ebe188fcff12..fe8610c726f5e 100644 --- a/api_docs/kbn_core_theme_browser_mocks.mdx +++ b/api_docs/kbn_core_theme_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-theme-browser-mocks title: "@kbn/core-theme-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-theme-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser-mocks'] --- import kbnCoreThemeBrowserMocksObj from './kbn_core_theme_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser.mdx b/api_docs/kbn_core_ui_settings_browser.mdx index 2e62bb42ac10c..0c476e0c23312 100644 --- a/api_docs/kbn_core_ui_settings_browser.mdx +++ b/api_docs/kbn_core_ui_settings_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser title: "@kbn/core-ui-settings-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser'] --- import kbnCoreUiSettingsBrowserObj from './kbn_core_ui_settings_browser.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser_internal.mdx b/api_docs/kbn_core_ui_settings_browser_internal.mdx index 5253bf18b4127..82a06c29a5a39 100644 --- a/api_docs/kbn_core_ui_settings_browser_internal.mdx +++ b/api_docs/kbn_core_ui_settings_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser-internal title: "@kbn/core-ui-settings-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-internal'] --- import kbnCoreUiSettingsBrowserInternalObj from './kbn_core_ui_settings_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser_mocks.mdx b/api_docs/kbn_core_ui_settings_browser_mocks.mdx index 75cb6afd080b1..0330093dfe715 100644 --- a/api_docs/kbn_core_ui_settings_browser_mocks.mdx +++ b/api_docs/kbn_core_ui_settings_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-browser-mocks title: "@kbn/core-ui-settings-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-mocks'] --- import kbnCoreUiSettingsBrowserMocksObj from './kbn_core_ui_settings_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_common.mdx b/api_docs/kbn_core_ui_settings_common.mdx index 28d92530e35b4..87a8821501178 100644 --- a/api_docs/kbn_core_ui_settings_common.mdx +++ b/api_docs/kbn_core_ui_settings_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-common title: "@kbn/core-ui-settings-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-common'] --- import kbnCoreUiSettingsCommonObj from './kbn_core_ui_settings_common.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server.mdx b/api_docs/kbn_core_ui_settings_server.mdx index 2c593a311209c..8a9f8bcfebf1c 100644 --- a/api_docs/kbn_core_ui_settings_server.mdx +++ b/api_docs/kbn_core_ui_settings_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server title: "@kbn/core-ui-settings-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server'] --- import kbnCoreUiSettingsServerObj from './kbn_core_ui_settings_server.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server_internal.mdx b/api_docs/kbn_core_ui_settings_server_internal.mdx index 83a0ec399d271..0105811e82025 100644 --- a/api_docs/kbn_core_ui_settings_server_internal.mdx +++ b/api_docs/kbn_core_ui_settings_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server-internal title: "@kbn/core-ui-settings-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server-internal'] --- import kbnCoreUiSettingsServerInternalObj from './kbn_core_ui_settings_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_server_mocks.mdx b/api_docs/kbn_core_ui_settings_server_mocks.mdx index 8fbf217181de8..2ee0d10794369 100644 --- a/api_docs/kbn_core_ui_settings_server_mocks.mdx +++ b/api_docs/kbn_core_ui_settings_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-ui-settings-server-mocks title: "@kbn/core-ui-settings-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-ui-settings-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server-mocks'] --- import kbnCoreUiSettingsServerMocksObj from './kbn_core_ui_settings_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server.mdx b/api_docs/kbn_core_usage_data_server.mdx index c5712598528b8..b01e2e2aecee2 100644 --- a/api_docs/kbn_core_usage_data_server.mdx +++ b/api_docs/kbn_core_usage_data_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server title: "@kbn/core-usage-data-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server'] --- import kbnCoreUsageDataServerObj from './kbn_core_usage_data_server.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server_internal.mdx b/api_docs/kbn_core_usage_data_server_internal.mdx index 2e7769ba826d5..240c28903be4e 100644 --- a/api_docs/kbn_core_usage_data_server_internal.mdx +++ b/api_docs/kbn_core_usage_data_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server-internal title: "@kbn/core-usage-data-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server-internal'] --- import kbnCoreUsageDataServerInternalObj from './kbn_core_usage_data_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server_mocks.mdx b/api_docs/kbn_core_usage_data_server_mocks.mdx index 4e2d6f2ddf33b..af9fa5fd1ff15 100644 --- a/api_docs/kbn_core_usage_data_server_mocks.mdx +++ b/api_docs/kbn_core_usage_data_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-usage-data-server-mocks title: "@kbn/core-usage-data-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-usage-data-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-usage-data-server-mocks'] --- import kbnCoreUsageDataServerMocksObj from './kbn_core_usage_data_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_user_profile_browser.mdx b/api_docs/kbn_core_user_profile_browser.mdx index 686ad3d248219..fc328ae54f153 100644 --- a/api_docs/kbn_core_user_profile_browser.mdx +++ b/api_docs/kbn_core_user_profile_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-browser title: "@kbn/core-user-profile-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-browser'] --- import kbnCoreUserProfileBrowserObj from './kbn_core_user_profile_browser.devdocs.json'; diff --git a/api_docs/kbn_core_user_profile_browser_internal.mdx b/api_docs/kbn_core_user_profile_browser_internal.mdx index 6f418cb22e981..02fec7a8bb5ff 100644 --- a/api_docs/kbn_core_user_profile_browser_internal.mdx +++ b/api_docs/kbn_core_user_profile_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-browser-internal title: "@kbn/core-user-profile-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-browser-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-browser-internal'] --- import kbnCoreUserProfileBrowserInternalObj from './kbn_core_user_profile_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_user_profile_browser_mocks.mdx b/api_docs/kbn_core_user_profile_browser_mocks.mdx index abd2ad6d3f35a..230c5e7764f8f 100644 --- a/api_docs/kbn_core_user_profile_browser_mocks.mdx +++ b/api_docs/kbn_core_user_profile_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-browser-mocks title: "@kbn/core-user-profile-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-browser-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-browser-mocks'] --- import kbnCoreUserProfileBrowserMocksObj from './kbn_core_user_profile_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_user_profile_common.mdx b/api_docs/kbn_core_user_profile_common.mdx index 615d586203b23..1f5574f503b8d 100644 --- a/api_docs/kbn_core_user_profile_common.mdx +++ b/api_docs/kbn_core_user_profile_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-common title: "@kbn/core-user-profile-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-common'] --- import kbnCoreUserProfileCommonObj from './kbn_core_user_profile_common.devdocs.json'; diff --git a/api_docs/kbn_core_user_profile_server.mdx b/api_docs/kbn_core_user_profile_server.mdx index f2ed321136f39..d372df1f95f7f 100644 --- a/api_docs/kbn_core_user_profile_server.mdx +++ b/api_docs/kbn_core_user_profile_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-server title: "@kbn/core-user-profile-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-server'] --- import kbnCoreUserProfileServerObj from './kbn_core_user_profile_server.devdocs.json'; diff --git a/api_docs/kbn_core_user_profile_server_internal.mdx b/api_docs/kbn_core_user_profile_server_internal.mdx index 5c8de755b374f..d0c5f22ca403b 100644 --- a/api_docs/kbn_core_user_profile_server_internal.mdx +++ b/api_docs/kbn_core_user_profile_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-server-internal title: "@kbn/core-user-profile-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-server-internal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-server-internal'] --- import kbnCoreUserProfileServerInternalObj from './kbn_core_user_profile_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_user_profile_server_mocks.mdx b/api_docs/kbn_core_user_profile_server_mocks.mdx index b1649944bc7a2..499adc8add511 100644 --- a/api_docs/kbn_core_user_profile_server_mocks.mdx +++ b/api_docs/kbn_core_user_profile_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-profile-server-mocks title: "@kbn/core-user-profile-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-profile-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-profile-server-mocks'] --- import kbnCoreUserProfileServerMocksObj from './kbn_core_user_profile_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_user_settings_server.mdx b/api_docs/kbn_core_user_settings_server.mdx index d7fe84129e5f3..70c298d18af8a 100644 --- a/api_docs/kbn_core_user_settings_server.mdx +++ b/api_docs/kbn_core_user_settings_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-settings-server title: "@kbn/core-user-settings-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-settings-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-settings-server'] --- import kbnCoreUserSettingsServerObj from './kbn_core_user_settings_server.devdocs.json'; diff --git a/api_docs/kbn_core_user_settings_server_mocks.mdx b/api_docs/kbn_core_user_settings_server_mocks.mdx index 5445a085f973b..ebee3f10cf9be 100644 --- a/api_docs/kbn_core_user_settings_server_mocks.mdx +++ b/api_docs/kbn_core_user_settings_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-user-settings-server-mocks title: "@kbn/core-user-settings-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-user-settings-server-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-user-settings-server-mocks'] --- import kbnCoreUserSettingsServerMocksObj from './kbn_core_user_settings_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_crypto.mdx b/api_docs/kbn_crypto.mdx index 75d733fee1a62..447d19e38838a 100644 --- a/api_docs/kbn_crypto.mdx +++ b/api_docs/kbn_crypto.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-crypto title: "@kbn/crypto" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/crypto plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto'] --- import kbnCryptoObj from './kbn_crypto.devdocs.json'; diff --git a/api_docs/kbn_crypto_browser.mdx b/api_docs/kbn_crypto_browser.mdx index e68a28bd273e2..437e249565d08 100644 --- a/api_docs/kbn_crypto_browser.mdx +++ b/api_docs/kbn_crypto_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-crypto-browser title: "@kbn/crypto-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/crypto-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/crypto-browser'] --- import kbnCryptoBrowserObj from './kbn_crypto_browser.devdocs.json'; diff --git a/api_docs/kbn_custom_icons.mdx b/api_docs/kbn_custom_icons.mdx index 0d592fd7d1387..e04c064124719 100644 --- a/api_docs/kbn_custom_icons.mdx +++ b/api_docs/kbn_custom_icons.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-custom-icons title: "@kbn/custom-icons" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/custom-icons plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/custom-icons'] --- import kbnCustomIconsObj from './kbn_custom_icons.devdocs.json'; diff --git a/api_docs/kbn_custom_integrations.mdx b/api_docs/kbn_custom_integrations.mdx index 91ff9f8c1deba..8cfa9f4c077c8 100644 --- a/api_docs/kbn_custom_integrations.mdx +++ b/api_docs/kbn_custom_integrations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-custom-integrations title: "@kbn/custom-integrations" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/custom-integrations plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/custom-integrations'] --- import kbnCustomIntegrationsObj from './kbn_custom_integrations.devdocs.json'; diff --git a/api_docs/kbn_cypress_config.mdx b/api_docs/kbn_cypress_config.mdx index 46d4b09b04d33..cd32b2ac00480 100644 --- a/api_docs/kbn_cypress_config.mdx +++ b/api_docs/kbn_cypress_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cypress-config title: "@kbn/cypress-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cypress-config plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cypress-config'] --- import kbnCypressConfigObj from './kbn_cypress_config.devdocs.json'; diff --git a/api_docs/kbn_data_forge.mdx b/api_docs/kbn_data_forge.mdx index c8ecd59abc90a..7b90da90b6ada 100644 --- a/api_docs/kbn_data_forge.mdx +++ b/api_docs/kbn_data_forge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-data-forge title: "@kbn/data-forge" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/data-forge plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/data-forge'] --- import kbnDataForgeObj from './kbn_data_forge.devdocs.json'; diff --git a/api_docs/kbn_data_service.mdx b/api_docs/kbn_data_service.mdx index ca71f1b331020..4acb3c9981925 100644 --- a/api_docs/kbn_data_service.mdx +++ b/api_docs/kbn_data_service.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-data-service title: "@kbn/data-service" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/data-service plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/data-service'] --- import kbnDataServiceObj from './kbn_data_service.devdocs.json'; diff --git a/api_docs/kbn_data_stream_adapter.mdx b/api_docs/kbn_data_stream_adapter.mdx index ab2d55205f17d..e84234b7c8f7f 100644 --- a/api_docs/kbn_data_stream_adapter.mdx +++ b/api_docs/kbn_data_stream_adapter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-data-stream-adapter title: "@kbn/data-stream-adapter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/data-stream-adapter plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/data-stream-adapter'] --- import kbnDataStreamAdapterObj from './kbn_data_stream_adapter.devdocs.json'; diff --git a/api_docs/kbn_data_view_utils.mdx b/api_docs/kbn_data_view_utils.mdx index bab7c23ea1217..a53813ddb80d5 100644 --- a/api_docs/kbn_data_view_utils.mdx +++ b/api_docs/kbn_data_view_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-data-view-utils title: "@kbn/data-view-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/data-view-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/data-view-utils'] --- import kbnDataViewUtilsObj from './kbn_data_view_utils.devdocs.json'; diff --git a/api_docs/kbn_datemath.mdx b/api_docs/kbn_datemath.mdx index d21b548a97cf3..341a50b3adee7 100644 --- a/api_docs/kbn_datemath.mdx +++ b/api_docs/kbn_datemath.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-datemath title: "@kbn/datemath" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/datemath plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/datemath'] --- import kbnDatemathObj from './kbn_datemath.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_analytics.mdx b/api_docs/kbn_deeplinks_analytics.mdx index 6a0a5a813cfc3..57af9da1881f6 100644 --- a/api_docs/kbn_deeplinks_analytics.mdx +++ b/api_docs/kbn_deeplinks_analytics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-analytics title: "@kbn/deeplinks-analytics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-analytics plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-analytics'] --- import kbnDeeplinksAnalyticsObj from './kbn_deeplinks_analytics.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_devtools.mdx b/api_docs/kbn_deeplinks_devtools.mdx index 3cd01fb88bbfa..2134b892fe600 100644 --- a/api_docs/kbn_deeplinks_devtools.mdx +++ b/api_docs/kbn_deeplinks_devtools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-devtools title: "@kbn/deeplinks-devtools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-devtools plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-devtools'] --- import kbnDeeplinksDevtoolsObj from './kbn_deeplinks_devtools.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_fleet.mdx b/api_docs/kbn_deeplinks_fleet.mdx index c9fa8c5e9a388..3a93de8a39776 100644 --- a/api_docs/kbn_deeplinks_fleet.mdx +++ b/api_docs/kbn_deeplinks_fleet.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-fleet title: "@kbn/deeplinks-fleet" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-fleet plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-fleet'] --- import kbnDeeplinksFleetObj from './kbn_deeplinks_fleet.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_management.mdx b/api_docs/kbn_deeplinks_management.mdx index 1a92d9ac19dc6..5ac7541d3ec44 100644 --- a/api_docs/kbn_deeplinks_management.mdx +++ b/api_docs/kbn_deeplinks_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-management title: "@kbn/deeplinks-management" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-management plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-management'] --- import kbnDeeplinksManagementObj from './kbn_deeplinks_management.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_ml.mdx b/api_docs/kbn_deeplinks_ml.mdx index cbbe9ca6469b6..17fd5cd76fda5 100644 --- a/api_docs/kbn_deeplinks_ml.mdx +++ b/api_docs/kbn_deeplinks_ml.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-ml title: "@kbn/deeplinks-ml" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-ml plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-ml'] --- import kbnDeeplinksMlObj from './kbn_deeplinks_ml.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_observability.mdx b/api_docs/kbn_deeplinks_observability.mdx index fc32aab8a2c71..58970e23b27bc 100644 --- a/api_docs/kbn_deeplinks_observability.mdx +++ b/api_docs/kbn_deeplinks_observability.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-observability title: "@kbn/deeplinks-observability" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-observability plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-observability'] --- import kbnDeeplinksObservabilityObj from './kbn_deeplinks_observability.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_search.mdx b/api_docs/kbn_deeplinks_search.mdx index 1544b27bd0ad7..88bfcc997ad2d 100644 --- a/api_docs/kbn_deeplinks_search.mdx +++ b/api_docs/kbn_deeplinks_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-search title: "@kbn/deeplinks-search" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-search plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-search'] --- import kbnDeeplinksSearchObj from './kbn_deeplinks_search.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_security.devdocs.json b/api_docs/kbn_deeplinks_security.devdocs.json index 30343ed59fe16..03ce129ec8764 100644 --- a/api_docs/kbn_deeplinks_security.devdocs.json +++ b/api_docs/kbn_deeplinks_security.devdocs.json @@ -28,7 +28,7 @@ "tags": [], "label": "SecurityPageName", "description": [], - "path": "packages/deeplinks/security/deep_links.ts", + "path": "src/platform/packages/shared/deeplinks/security/deep_links.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -45,7 +45,7 @@ "signature": [ "\"securitySolutionUI\"" ], - "path": "packages/deeplinks/security/index.ts", + "path": "src/platform/packages/shared/deeplinks/security/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -60,7 +60,7 @@ "signature": [ "\"securitySolutionUI\" | \"securitySolutionUI:\" | \"securitySolutionUI:cases\" | \"securitySolutionUI:alerts\" | \"securitySolutionUI:rules\" | \"securitySolutionUI:policy\" | \"securitySolutionUI:overview\" | \"securitySolutionUI:dashboards\" | \"securitySolutionUI:kubernetes\" | \"securitySolutionUI:cases_create\" | \"securitySolutionUI:cases_configure\" | \"securitySolutionUI:hosts\" | \"securitySolutionUI:users\" | \"securitySolutionUI:cloud_defend-policies\" | \"securitySolutionUI:cloud_security_posture-dashboard\" | \"securitySolutionUI:cloud_security_posture-findings\" | \"securitySolutionUI:cloud_security_posture-benchmarks\" | \"securitySolutionUI:network\" | \"securitySolutionUI:data_quality\" | \"securitySolutionUI:explore\" | \"securitySolutionUI:assets\" | \"securitySolutionUI:cloud_defend\" | \"securitySolutionUI:notes\" | \"securitySolutionUI:administration\" | \"securitySolutionUI:attack_discovery\" | \"securitySolutionUI:blocklist\" | \"securitySolutionUI:cloud_security_posture-rules\" | \"securitySolutionUI:detections\" | \"securitySolutionUI:detection_response\" | \"securitySolutionUI:endpoints\" | \"securitySolutionUI:event_filters\" | \"securitySolutionUI:exceptions\" | \"securitySolutionUI:host_isolation_exceptions\" | \"securitySolutionUI:hosts-all\" | \"securitySolutionUI:hosts-anomalies\" | \"securitySolutionUI:hosts-risk\" | \"securitySolutionUI:hosts-events\" | \"securitySolutionUI:hosts-sessions\" | \"securitySolutionUI:hosts-uncommon_processes\" | \"securitySolutionUI:investigations\" | \"securitySolutionUI:get_started\" | \"securitySolutionUI:machine_learning-landing\" | \"securitySolutionUI:network-anomalies\" | \"securitySolutionUI:network-dns\" | \"securitySolutionUI:network-events\" | \"securitySolutionUI:network-flows\" | \"securitySolutionUI:network-http\" | \"securitySolutionUI:network-tls\" | \"securitySolutionUI:response_actions_history\" | \"securitySolutionUI:rules-add\" | \"securitySolutionUI:rules-create\" | \"securitySolutionUI:rules-landing\" | \"securitySolutionUI:siem_migrations-rules\" | \"securitySolutionUI:threat_intelligence\" | \"securitySolutionUI:timelines\" | \"securitySolutionUI:timelines-templates\" | \"securitySolutionUI:trusted_apps\" | \"securitySolutionUI:users-all\" | \"securitySolutionUI:users-anomalies\" | \"securitySolutionUI:users-authentications\" | \"securitySolutionUI:users-events\" | \"securitySolutionUI:users-risk\" | \"securitySolutionUI:entity_analytics\" | \"securitySolutionUI:entity_analytics-management\" | \"securitySolutionUI:entity_analytics-asset-classification\" | \"securitySolutionUI:entity_analytics-entity_store_management\" | \"securitySolutionUI:coverage-overview\"" ], - "path": "packages/deeplinks/security/index.ts", + "path": "src/platform/packages/shared/deeplinks/security/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -75,7 +75,7 @@ "signature": [ "\"\" | \"cases\" | \"alerts\" | \"rules\" | \"policy\" | \"overview\" | \"dashboards\" | \"kubernetes\" | \"cases_create\" | \"cases_configure\" | \"hosts\" | \"users\" | \"cloud_defend-policies\" | \"cloud_security_posture-dashboard\" | \"cloud_security_posture-findings\" | \"cloud_security_posture-benchmarks\" | \"network\" | \"data_quality\" | \"explore\" | \"assets\" | \"cloud_defend\" | \"notes\" | \"administration\" | \"attack_discovery\" | \"blocklist\" | \"cloud_security_posture-rules\" | \"detections\" | \"detection_response\" | \"endpoints\" | \"event_filters\" | \"exceptions\" | \"host_isolation_exceptions\" | \"hosts-all\" | \"hosts-anomalies\" | \"hosts-risk\" | \"hosts-events\" | \"hosts-sessions\" | \"hosts-uncommon_processes\" | \"investigations\" | \"get_started\" | \"machine_learning-landing\" | \"network-anomalies\" | \"network-dns\" | \"network-events\" | \"network-flows\" | \"network-http\" | \"network-tls\" | \"response_actions_history\" | \"rules-add\" | \"rules-create\" | \"rules-landing\" | \"siem_migrations-rules\" | \"threat_intelligence\" | \"timelines\" | \"timelines-templates\" | \"trusted_apps\" | \"users-all\" | \"users-anomalies\" | \"users-authentications\" | \"users-events\" | \"users-risk\" | \"entity_analytics\" | \"entity_analytics-management\" | \"entity_analytics-asset-classification\" | \"entity_analytics-entity_store_management\" | \"coverage-overview\"" ], - "path": "packages/deeplinks/security/index.ts", + "path": "src/platform/packages/shared/deeplinks/security/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -90,7 +90,7 @@ "signature": [ "\"securitySolutionUI\"" ], - "path": "packages/deeplinks/security/index.ts", + "path": "src/platform/packages/shared/deeplinks/security/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_deeplinks_security.mdx b/api_docs/kbn_deeplinks_security.mdx index 0ac681b816f97..753f6d9457ae0 100644 --- a/api_docs/kbn_deeplinks_security.mdx +++ b/api_docs/kbn_deeplinks_security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-security title: "@kbn/deeplinks-security" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-security plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-security'] --- import kbnDeeplinksSecurityObj from './kbn_deeplinks_security.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_shared.mdx b/api_docs/kbn_deeplinks_shared.mdx index d08bade81713d..f54f7d7d17d51 100644 --- a/api_docs/kbn_deeplinks_shared.mdx +++ b/api_docs/kbn_deeplinks_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-deeplinks-shared title: "@kbn/deeplinks-shared" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/deeplinks-shared plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-shared'] --- import kbnDeeplinksSharedObj from './kbn_deeplinks_shared.devdocs.json'; diff --git a/api_docs/kbn_default_nav_analytics.mdx b/api_docs/kbn_default_nav_analytics.mdx index 2ca937502adf7..4446aa8552dd0 100644 --- a/api_docs/kbn_default_nav_analytics.mdx +++ b/api_docs/kbn_default_nav_analytics.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-default-nav-analytics title: "@kbn/default-nav-analytics" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/default-nav-analytics plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/default-nav-analytics'] --- import kbnDefaultNavAnalyticsObj from './kbn_default_nav_analytics.devdocs.json'; diff --git a/api_docs/kbn_default_nav_devtools.mdx b/api_docs/kbn_default_nav_devtools.mdx index 7ce6106aa4d16..f713b25ce8fd9 100644 --- a/api_docs/kbn_default_nav_devtools.mdx +++ b/api_docs/kbn_default_nav_devtools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-default-nav-devtools title: "@kbn/default-nav-devtools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/default-nav-devtools plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/default-nav-devtools'] --- import kbnDefaultNavDevtoolsObj from './kbn_default_nav_devtools.devdocs.json'; diff --git a/api_docs/kbn_default_nav_management.mdx b/api_docs/kbn_default_nav_management.mdx index 067d45887bc23..76803b9baf099 100644 --- a/api_docs/kbn_default_nav_management.mdx +++ b/api_docs/kbn_default_nav_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-default-nav-management title: "@kbn/default-nav-management" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/default-nav-management plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/default-nav-management'] --- import kbnDefaultNavManagementObj from './kbn_default_nav_management.devdocs.json'; diff --git a/api_docs/kbn_default_nav_ml.mdx b/api_docs/kbn_default_nav_ml.mdx index 62ccff66398c8..db24cdb0bb1b3 100644 --- a/api_docs/kbn_default_nav_ml.mdx +++ b/api_docs/kbn_default_nav_ml.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-default-nav-ml title: "@kbn/default-nav-ml" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/default-nav-ml plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/default-nav-ml'] --- import kbnDefaultNavMlObj from './kbn_default_nav_ml.devdocs.json'; diff --git a/api_docs/kbn_dev_cli_errors.mdx b/api_docs/kbn_dev_cli_errors.mdx index a05bae887ecc1..0f4f204982a07 100644 --- a/api_docs/kbn_dev_cli_errors.mdx +++ b/api_docs/kbn_dev_cli_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-errors title: "@kbn/dev-cli-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-cli-errors plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-errors'] --- import kbnDevCliErrorsObj from './kbn_dev_cli_errors.devdocs.json'; diff --git a/api_docs/kbn_dev_cli_runner.mdx b/api_docs/kbn_dev_cli_runner.mdx index 618f2974d6a19..e18c4fe9232e3 100644 --- a/api_docs/kbn_dev_cli_runner.mdx +++ b/api_docs/kbn_dev_cli_runner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-cli-runner title: "@kbn/dev-cli-runner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-cli-runner plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-runner'] --- import kbnDevCliRunnerObj from './kbn_dev_cli_runner.devdocs.json'; diff --git a/api_docs/kbn_dev_proc_runner.mdx b/api_docs/kbn_dev_proc_runner.mdx index 44365421b2dcf..626863b889347 100644 --- a/api_docs/kbn_dev_proc_runner.mdx +++ b/api_docs/kbn_dev_proc_runner.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-proc-runner title: "@kbn/dev-proc-runner" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-proc-runner plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-proc-runner'] --- import kbnDevProcRunnerObj from './kbn_dev_proc_runner.devdocs.json'; diff --git a/api_docs/kbn_dev_utils.mdx b/api_docs/kbn_dev_utils.mdx index 5b40fbde6256a..e92a3f6fec3e1 100644 --- a/api_docs/kbn_dev_utils.mdx +++ b/api_docs/kbn_dev_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dev-utils title: "@kbn/dev-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dev-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-utils'] --- import kbnDevUtilsObj from './kbn_dev_utils.devdocs.json'; diff --git a/api_docs/kbn_discover_contextual_components.mdx b/api_docs/kbn_discover_contextual_components.mdx index 8684f2ed398b7..a64352133cee4 100644 --- a/api_docs/kbn_discover_contextual_components.mdx +++ b/api_docs/kbn_discover_contextual_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-discover-contextual-components title: "@kbn/discover-contextual-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/discover-contextual-components plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/discover-contextual-components'] --- import kbnDiscoverContextualComponentsObj from './kbn_discover_contextual_components.devdocs.json'; diff --git a/api_docs/kbn_discover_utils.mdx b/api_docs/kbn_discover_utils.mdx index ef04007b8a1a9..a98c1eaffb6f0 100644 --- a/api_docs/kbn_discover_utils.mdx +++ b/api_docs/kbn_discover_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-discover-utils title: "@kbn/discover-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/discover-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/discover-utils'] --- import kbnDiscoverUtilsObj from './kbn_discover_utils.devdocs.json'; diff --git a/api_docs/kbn_doc_links.mdx b/api_docs/kbn_doc_links.mdx index 9623d0ccdb737..b4d3b835b375a 100644 --- a/api_docs/kbn_doc_links.mdx +++ b/api_docs/kbn_doc_links.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-doc-links title: "@kbn/doc-links" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/doc-links plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/doc-links'] --- import kbnDocLinksObj from './kbn_doc_links.devdocs.json'; diff --git a/api_docs/kbn_docs_utils.mdx b/api_docs/kbn_docs_utils.mdx index 241db68926da3..b73a27e5020d0 100644 --- a/api_docs/kbn_docs_utils.mdx +++ b/api_docs/kbn_docs_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-docs-utils title: "@kbn/docs-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/docs-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/docs-utils'] --- import kbnDocsUtilsObj from './kbn_docs_utils.devdocs.json'; diff --git a/api_docs/kbn_dom_drag_drop.mdx b/api_docs/kbn_dom_drag_drop.mdx index fd7c5c6899f83..5b3f86bc5f9be 100644 --- a/api_docs/kbn_dom_drag_drop.mdx +++ b/api_docs/kbn_dom_drag_drop.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-dom-drag-drop title: "@kbn/dom-drag-drop" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/dom-drag-drop plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dom-drag-drop'] --- import kbnDomDragDropObj from './kbn_dom_drag_drop.devdocs.json'; diff --git a/api_docs/kbn_ebt_tools.mdx b/api_docs/kbn_ebt_tools.mdx index 9f287ae90737e..99ff91b2b7906 100644 --- a/api_docs/kbn_ebt_tools.mdx +++ b/api_docs/kbn_ebt_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ebt-tools title: "@kbn/ebt-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ebt-tools plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ebt-tools'] --- import kbnEbtToolsObj from './kbn_ebt_tools.devdocs.json'; diff --git a/api_docs/kbn_ecs_data_quality_dashboard.mdx b/api_docs/kbn_ecs_data_quality_dashboard.mdx index 13d99c1213054..daa733dbfbe4c 100644 --- a/api_docs/kbn_ecs_data_quality_dashboard.mdx +++ b/api_docs/kbn_ecs_data_quality_dashboard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ecs-data-quality-dashboard title: "@kbn/ecs-data-quality-dashboard" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ecs-data-quality-dashboard plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ecs-data-quality-dashboard'] --- import kbnEcsDataQualityDashboardObj from './kbn_ecs_data_quality_dashboard.devdocs.json'; diff --git a/api_docs/kbn_elastic_agent_utils.mdx b/api_docs/kbn_elastic_agent_utils.mdx index f7b4505c6a238..9801fe266c30d 100644 --- a/api_docs/kbn_elastic_agent_utils.mdx +++ b/api_docs/kbn_elastic_agent_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-elastic-agent-utils title: "@kbn/elastic-agent-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/elastic-agent-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/elastic-agent-utils'] --- import kbnElasticAgentUtilsObj from './kbn_elastic_agent_utils.devdocs.json'; diff --git a/api_docs/kbn_elastic_assistant.devdocs.json b/api_docs/kbn_elastic_assistant.devdocs.json index d0d05341c3543..c3c77455d16af 100644 --- a/api_docs/kbn_elastic_assistant.devdocs.json +++ b/api_docs/kbn_elastic_assistant.devdocs.json @@ -162,14 +162,6 @@ "plugin": "integrationAssistant", "path": "x-pack/platform/plugins/shared/integration_assistant/public/components/create_integration/create_integration_assistant/header/header.tsx" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/insights/workflow_insights_scan.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/insights/workflow_insights_scan.tsx" - }, { "plugin": "@kbn/ecs-data-quality-dashboard", "path": "x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.tsx" @@ -180,103 +172,111 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/assistant/get_comments/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/index.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/assistant/get_comments/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/assistant/header_link.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/assistant/get_comments/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/assistant/header_link.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/assistant/header_link.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/insights/workflow_insights_scan.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/assistant/header_link.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/insights/workflow_insights_scan.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/title/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/title/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/title/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/title/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/no_alerts/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/no_alerts/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/no_alerts/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/no_alerts/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/welcome/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/welcome/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/welcome/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/welcome/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/ai_assistant/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/ai_assistant/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/ai_assistant/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/ai_assistant/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/summary/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/summary/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/summary/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/summary/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_result_panel.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_result_panel.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_result_panel.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_result_panel.tsx" } ], "children": [ @@ -2841,7 +2841,7 @@ "tags": [], "label": "PromptContextTemplate", "description": [ - "\nThis interface is used to pass a default or base set of contexts to the Elastic AI Assistant when\ninitializing it. This is used to provide 'category' options when users create Quick Prompts.\nAlso, useful for collating all of a solutions' prompts in one place.\n\ne.g. see Security Solution's x-pack/plugins/security_solution/public/assistant/prompt_contexts/index.tsx" + "\nThis interface is used to pass a default or base set of contexts to the Elastic AI Assistant when\ninitializing it. This is used to provide 'category' options when users create Quick Prompts.\nAlso, useful for collating all of a solutions' prompts in one place.\n\ne.g. see Security Solution's x-pack/solutions/security/plugins/security_solution/public/assistant/prompt_contexts/index.tsx" ], "signature": [ "{ description: string; category: string; tooltip: React.ReactNode; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; suggestedUserPrompt?: string | undefined; }" diff --git a/api_docs/kbn_elastic_assistant.mdx b/api_docs/kbn_elastic_assistant.mdx index d56575332b507..be9f02ae14a81 100644 --- a/api_docs/kbn_elastic_assistant.mdx +++ b/api_docs/kbn_elastic_assistant.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-elastic-assistant title: "@kbn/elastic-assistant" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/elastic-assistant plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/elastic-assistant'] --- import kbnElasticAssistantObj from './kbn_elastic_assistant.devdocs.json'; diff --git a/api_docs/kbn_elastic_assistant_common.mdx b/api_docs/kbn_elastic_assistant_common.mdx index 579a0e8e6f52d..c79ef10364356 100644 --- a/api_docs/kbn_elastic_assistant_common.mdx +++ b/api_docs/kbn_elastic_assistant_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-elastic-assistant-common title: "@kbn/elastic-assistant-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/elastic-assistant-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/elastic-assistant-common'] --- import kbnElasticAssistantCommonObj from './kbn_elastic_assistant_common.devdocs.json'; diff --git a/api_docs/kbn_entities_schema.mdx b/api_docs/kbn_entities_schema.mdx index 3cf901b23581b..69590291c8ba0 100644 --- a/api_docs/kbn_entities_schema.mdx +++ b/api_docs/kbn_entities_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-entities-schema title: "@kbn/entities-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/entities-schema plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/entities-schema'] --- import kbnEntitiesSchemaObj from './kbn_entities_schema.devdocs.json'; diff --git a/api_docs/kbn_es.mdx b/api_docs/kbn_es.mdx index dd9389966034d..fc682489b4b00 100644 --- a/api_docs/kbn_es.mdx +++ b/api_docs/kbn_es.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es title: "@kbn/es" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es'] --- import kbnEsObj from './kbn_es.devdocs.json'; diff --git a/api_docs/kbn_es_archiver.mdx b/api_docs/kbn_es_archiver.mdx index a6f1ea7a63bb3..8ee3ddf1717cb 100644 --- a/api_docs/kbn_es_archiver.mdx +++ b/api_docs/kbn_es_archiver.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-archiver title: "@kbn/es-archiver" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-archiver plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-archiver'] --- import kbnEsArchiverObj from './kbn_es_archiver.devdocs.json'; diff --git a/api_docs/kbn_es_errors.mdx b/api_docs/kbn_es_errors.mdx index 181d09459fdd8..2d7f691f3cc62 100644 --- a/api_docs/kbn_es_errors.mdx +++ b/api_docs/kbn_es_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-errors title: "@kbn/es-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-errors plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-errors'] --- import kbnEsErrorsObj from './kbn_es_errors.devdocs.json'; diff --git a/api_docs/kbn_es_query.mdx b/api_docs/kbn_es_query.mdx index 392207a7e0ed2..c946c7b7bd9de 100644 --- a/api_docs/kbn_es_query.mdx +++ b/api_docs/kbn_es_query.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-query title: "@kbn/es-query" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-query plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-query'] --- import kbnEsQueryObj from './kbn_es_query.devdocs.json'; diff --git a/api_docs/kbn_es_types.mdx b/api_docs/kbn_es_types.mdx index a62217fa867a5..d8fb21f2d5745 100644 --- a/api_docs/kbn_es_types.mdx +++ b/api_docs/kbn_es_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-es-types title: "@kbn/es-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/es-types plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-types'] --- import kbnEsTypesObj from './kbn_es_types.devdocs.json'; diff --git a/api_docs/kbn_eslint_plugin_imports.mdx b/api_docs/kbn_eslint_plugin_imports.mdx index 575acb89705d5..1c3cc31e38c60 100644 --- a/api_docs/kbn_eslint_plugin_imports.mdx +++ b/api_docs/kbn_eslint_plugin_imports.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-eslint-plugin-imports title: "@kbn/eslint-plugin-imports" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/eslint-plugin-imports plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/eslint-plugin-imports'] --- import kbnEslintPluginImportsObj from './kbn_eslint_plugin_imports.devdocs.json'; diff --git a/api_docs/kbn_esql_ast.devdocs.json b/api_docs/kbn_esql_ast.devdocs.json index b0e685c37fde1..a0e8158ca2668 100644 --- a/api_docs/kbn_esql_ast.devdocs.json +++ b/api_docs/kbn_esql_ast.devdocs.json @@ -5776,6 +5776,40 @@ ], "returnComment": [] }, + { + "parentPluginId": "@kbn/esql-ast", + "id": "def-common.LeafPrinter.string", + "type": "Function", + "tags": [], + "label": "string", + "description": [], + "signature": [ + "(node: ", + "ESQLStringLiteral", + ") => string" + ], + "path": "src/platform/packages/shared/kbn-esql-ast/src/pretty_print/leaf_printer.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/esql-ast", + "id": "def-common.LeafPrinter.string.$1", + "type": "Object", + "tags": [], + "label": "node", + "description": [], + "signature": [ + "ESQLStringLiteral" + ], + "path": "src/platform/packages/shared/kbn-esql-ast/src/pretty_print/leaf_printer.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, { "parentPluginId": "@kbn/esql-ast", "id": "def-common.LeafPrinter.literal", diff --git a/api_docs/kbn_esql_ast.mdx b/api_docs/kbn_esql_ast.mdx index a6cd7f837f9e7..19d48b8a6e153 100644 --- a/api_docs/kbn_esql_ast.mdx +++ b/api_docs/kbn_esql_ast.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-esql-ast title: "@kbn/esql-ast" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/esql-ast plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/esql-ast'] --- import kbnEsqlAstObj from './kbn_esql_ast.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 285 | 1 | 223 | 25 | +| 287 | 1 | 225 | 25 | ## Common diff --git a/api_docs/kbn_esql_editor.mdx b/api_docs/kbn_esql_editor.mdx index 7f4d6706c58d8..c102fb7faefab 100644 --- a/api_docs/kbn_esql_editor.mdx +++ b/api_docs/kbn_esql_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-esql-editor title: "@kbn/esql-editor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/esql-editor plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/esql-editor'] --- import kbnEsqlEditorObj from './kbn_esql_editor.devdocs.json'; diff --git a/api_docs/kbn_esql_utils.mdx b/api_docs/kbn_esql_utils.mdx index e17b96f7c153d..b8a6b8c8ebc58 100644 --- a/api_docs/kbn_esql_utils.mdx +++ b/api_docs/kbn_esql_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-esql-utils title: "@kbn/esql-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/esql-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/esql-utils'] --- import kbnEsqlUtilsObj from './kbn_esql_utils.devdocs.json'; diff --git a/api_docs/kbn_esql_validation_autocomplete.mdx b/api_docs/kbn_esql_validation_autocomplete.mdx index a69a975f0ecf6..18635a4e21237 100644 --- a/api_docs/kbn_esql_validation_autocomplete.mdx +++ b/api_docs/kbn_esql_validation_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-esql-validation-autocomplete title: "@kbn/esql-validation-autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/esql-validation-autocomplete plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/esql-validation-autocomplete'] --- import kbnEsqlValidationAutocompleteObj from './kbn_esql_validation_autocomplete.devdocs.json'; diff --git a/api_docs/kbn_event_annotation_common.mdx b/api_docs/kbn_event_annotation_common.mdx index e06473b311a21..ad7426cdc2922 100644 --- a/api_docs/kbn_event_annotation_common.mdx +++ b/api_docs/kbn_event_annotation_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-event-annotation-common title: "@kbn/event-annotation-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/event-annotation-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/event-annotation-common'] --- import kbnEventAnnotationCommonObj from './kbn_event_annotation_common.devdocs.json'; diff --git a/api_docs/kbn_event_annotation_components.mdx b/api_docs/kbn_event_annotation_components.mdx index afb792d1c771f..f5c4aaa40e632 100644 --- a/api_docs/kbn_event_annotation_components.mdx +++ b/api_docs/kbn_event_annotation_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-event-annotation-components title: "@kbn/event-annotation-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/event-annotation-components plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/event-annotation-components'] --- import kbnEventAnnotationComponentsObj from './kbn_event_annotation_components.devdocs.json'; diff --git a/api_docs/kbn_expandable_flyout.mdx b/api_docs/kbn_expandable_flyout.mdx index 202bc6b0d3b57..82bb5ff6cb885 100644 --- a/api_docs/kbn_expandable_flyout.mdx +++ b/api_docs/kbn_expandable_flyout.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-expandable-flyout title: "@kbn/expandable-flyout" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/expandable-flyout plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/expandable-flyout'] --- import kbnExpandableFlyoutObj from './kbn_expandable_flyout.devdocs.json'; diff --git a/api_docs/kbn_field_types.mdx b/api_docs/kbn_field_types.mdx index f6cec3fd31af2..66b0bb5e6cf0a 100644 --- a/api_docs/kbn_field_types.mdx +++ b/api_docs/kbn_field_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-field-types title: "@kbn/field-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/field-types plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/field-types'] --- import kbnFieldTypesObj from './kbn_field_types.devdocs.json'; diff --git a/api_docs/kbn_field_utils.mdx b/api_docs/kbn_field_utils.mdx index bd4e4a98bd7ed..6cc4453d6dae8 100644 --- a/api_docs/kbn_field_utils.mdx +++ b/api_docs/kbn_field_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-field-utils title: "@kbn/field-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/field-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/field-utils'] --- import kbnFieldUtilsObj from './kbn_field_utils.devdocs.json'; diff --git a/api_docs/kbn_find_used_node_modules.mdx b/api_docs/kbn_find_used_node_modules.mdx index a93d7ba484cfe..821ff48855612 100644 --- a/api_docs/kbn_find_used_node_modules.mdx +++ b/api_docs/kbn_find_used_node_modules.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-find-used-node-modules title: "@kbn/find-used-node-modules" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/find-used-node-modules plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/find-used-node-modules'] --- import kbnFindUsedNodeModulesObj from './kbn_find_used_node_modules.devdocs.json'; diff --git a/api_docs/kbn_formatters.mdx b/api_docs/kbn_formatters.mdx index 654974edb4062..1c1e7021782b4 100644 --- a/api_docs/kbn_formatters.mdx +++ b/api_docs/kbn_formatters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-formatters title: "@kbn/formatters" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/formatters plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/formatters'] --- import kbnFormattersObj from './kbn_formatters.devdocs.json'; diff --git a/api_docs/kbn_ftr_common_functional_services.mdx b/api_docs/kbn_ftr_common_functional_services.mdx index 7a9c71e792bbe..943465c42c784 100644 --- a/api_docs/kbn_ftr_common_functional_services.mdx +++ b/api_docs/kbn_ftr_common_functional_services.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ftr-common-functional-services title: "@kbn/ftr-common-functional-services" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ftr-common-functional-services plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ftr-common-functional-services'] --- import kbnFtrCommonFunctionalServicesObj from './kbn_ftr_common_functional_services.devdocs.json'; diff --git a/api_docs/kbn_ftr_common_functional_ui_services.mdx b/api_docs/kbn_ftr_common_functional_ui_services.mdx index be90d5cd28ed7..293d3c3dbdc04 100644 --- a/api_docs/kbn_ftr_common_functional_ui_services.mdx +++ b/api_docs/kbn_ftr_common_functional_ui_services.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ftr-common-functional-ui-services title: "@kbn/ftr-common-functional-ui-services" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ftr-common-functional-ui-services plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ftr-common-functional-ui-services'] --- import kbnFtrCommonFunctionalUiServicesObj from './kbn_ftr_common_functional_ui_services.devdocs.json'; diff --git a/api_docs/kbn_gen_ai_functional_testing.mdx b/api_docs/kbn_gen_ai_functional_testing.mdx index 4bf44e52107f5..0068cc00d0042 100644 --- a/api_docs/kbn_gen_ai_functional_testing.mdx +++ b/api_docs/kbn_gen_ai_functional_testing.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-gen-ai-functional-testing title: "@kbn/gen-ai-functional-testing" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/gen-ai-functional-testing plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/gen-ai-functional-testing'] --- import kbnGenAiFunctionalTestingObj from './kbn_gen_ai_functional_testing.devdocs.json'; diff --git a/api_docs/kbn_generate.mdx b/api_docs/kbn_generate.mdx index 8b3f30769a32f..74a35a15ce539 100644 --- a/api_docs/kbn_generate.mdx +++ b/api_docs/kbn_generate.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-generate title: "@kbn/generate" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/generate plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate'] --- import kbnGenerateObj from './kbn_generate.devdocs.json'; diff --git a/api_docs/kbn_generate_console_definitions.mdx b/api_docs/kbn_generate_console_definitions.mdx index fbdd0c35dde4f..00e9ffa3ee153 100644 --- a/api_docs/kbn_generate_console_definitions.mdx +++ b/api_docs/kbn_generate_console_definitions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-generate-console-definitions title: "@kbn/generate-console-definitions" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/generate-console-definitions plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate-console-definitions'] --- import kbnGenerateConsoleDefinitionsObj from './kbn_generate_console_definitions.devdocs.json'; diff --git a/api_docs/kbn_generate_csv.mdx b/api_docs/kbn_generate_csv.mdx index 91470889b04f4..0ead547b7f603 100644 --- a/api_docs/kbn_generate_csv.mdx +++ b/api_docs/kbn_generate_csv.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-generate-csv title: "@kbn/generate-csv" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/generate-csv plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate-csv'] --- import kbnGenerateCsvObj from './kbn_generate_csv.devdocs.json'; diff --git a/api_docs/kbn_grid_layout.mdx b/api_docs/kbn_grid_layout.mdx index 77ab30cb18cc3..45b18e5f8b745 100644 --- a/api_docs/kbn_grid_layout.mdx +++ b/api_docs/kbn_grid_layout.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-grid-layout title: "@kbn/grid-layout" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/grid-layout plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/grid-layout'] --- import kbnGridLayoutObj from './kbn_grid_layout.devdocs.json'; diff --git a/api_docs/kbn_grouping.mdx b/api_docs/kbn_grouping.mdx index 1bd59e4479c65..8c3c79939e2a1 100644 --- a/api_docs/kbn_grouping.mdx +++ b/api_docs/kbn_grouping.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-grouping title: "@kbn/grouping" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/grouping plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/grouping'] --- import kbnGroupingObj from './kbn_grouping.devdocs.json'; diff --git a/api_docs/kbn_guided_onboarding.mdx b/api_docs/kbn_guided_onboarding.mdx index 9b3255f02b8b1..d612270029841 100644 --- a/api_docs/kbn_guided_onboarding.mdx +++ b/api_docs/kbn_guided_onboarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-guided-onboarding title: "@kbn/guided-onboarding" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/guided-onboarding plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/guided-onboarding'] --- import kbnGuidedOnboardingObj from './kbn_guided_onboarding.devdocs.json'; diff --git a/api_docs/kbn_handlebars.mdx b/api_docs/kbn_handlebars.mdx index 7beb299746efe..6a616b10ba7fa 100644 --- a/api_docs/kbn_handlebars.mdx +++ b/api_docs/kbn_handlebars.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-handlebars title: "@kbn/handlebars" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/handlebars plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/handlebars'] --- import kbnHandlebarsObj from './kbn_handlebars.devdocs.json'; diff --git a/api_docs/kbn_hapi_mocks.mdx b/api_docs/kbn_hapi_mocks.mdx index b972214253179..9537a13206668 100644 --- a/api_docs/kbn_hapi_mocks.mdx +++ b/api_docs/kbn_hapi_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-hapi-mocks title: "@kbn/hapi-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/hapi-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/hapi-mocks'] --- import kbnHapiMocksObj from './kbn_hapi_mocks.devdocs.json'; diff --git a/api_docs/kbn_health_gateway_server.mdx b/api_docs/kbn_health_gateway_server.mdx index 7fb89dd13fedb..7b17f4a9536ad 100644 --- a/api_docs/kbn_health_gateway_server.mdx +++ b/api_docs/kbn_health_gateway_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-health-gateway-server title: "@kbn/health-gateway-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/health-gateway-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/health-gateway-server'] --- import kbnHealthGatewayServerObj from './kbn_health_gateway_server.devdocs.json'; diff --git a/api_docs/kbn_home_sample_data_card.mdx b/api_docs/kbn_home_sample_data_card.mdx index d3deb4c652449..49f9af7afbde4 100644 --- a/api_docs/kbn_home_sample_data_card.mdx +++ b/api_docs/kbn_home_sample_data_card.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-home-sample-data-card title: "@kbn/home-sample-data-card" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/home-sample-data-card plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/home-sample-data-card'] --- import kbnHomeSampleDataCardObj from './kbn_home_sample_data_card.devdocs.json'; diff --git a/api_docs/kbn_home_sample_data_tab.mdx b/api_docs/kbn_home_sample_data_tab.mdx index 064a5efab87d0..2fee8eff547e6 100644 --- a/api_docs/kbn_home_sample_data_tab.mdx +++ b/api_docs/kbn_home_sample_data_tab.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-home-sample-data-tab title: "@kbn/home-sample-data-tab" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/home-sample-data-tab plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/home-sample-data-tab'] --- import kbnHomeSampleDataTabObj from './kbn_home_sample_data_tab.devdocs.json'; diff --git a/api_docs/kbn_i18n.mdx b/api_docs/kbn_i18n.mdx index 1ef1db188de0c..58259d6f4b443 100644 --- a/api_docs/kbn_i18n.mdx +++ b/api_docs/kbn_i18n.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-i18n title: "@kbn/i18n" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/i18n plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n'] --- import kbnI18nObj from './kbn_i18n.devdocs.json'; diff --git a/api_docs/kbn_i18n_react.mdx b/api_docs/kbn_i18n_react.mdx index f56671c806e48..48ecb52e03632 100644 --- a/api_docs/kbn_i18n_react.mdx +++ b/api_docs/kbn_i18n_react.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-i18n-react title: "@kbn/i18n-react" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/i18n-react plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/i18n-react'] --- import kbnI18nReactObj from './kbn_i18n_react.devdocs.json'; diff --git a/api_docs/kbn_import_resolver.mdx b/api_docs/kbn_import_resolver.mdx index 3707c148c3472..c9968a2d3e75b 100644 --- a/api_docs/kbn_import_resolver.mdx +++ b/api_docs/kbn_import_resolver.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-import-resolver title: "@kbn/import-resolver" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/import-resolver plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/import-resolver'] --- import kbnImportResolverObj from './kbn_import_resolver.devdocs.json'; diff --git a/api_docs/kbn_index_adapter.mdx b/api_docs/kbn_index_adapter.mdx index c28291fd43627..fe45dcbf1d9c9 100644 --- a/api_docs/kbn_index_adapter.mdx +++ b/api_docs/kbn_index_adapter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-index-adapter title: "@kbn/index-adapter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/index-adapter plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/index-adapter'] --- import kbnIndexAdapterObj from './kbn_index_adapter.devdocs.json'; diff --git a/api_docs/kbn_index_lifecycle_management_common_shared.mdx b/api_docs/kbn_index_lifecycle_management_common_shared.mdx index d11d8bba50046..c97099ed2fb43 100644 --- a/api_docs/kbn_index_lifecycle_management_common_shared.mdx +++ b/api_docs/kbn_index_lifecycle_management_common_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-index-lifecycle-management-common-shared title: "@kbn/index-lifecycle-management-common-shared" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/index-lifecycle-management-common-shared plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/index-lifecycle-management-common-shared'] --- import kbnIndexLifecycleManagementCommonSharedObj from './kbn_index_lifecycle_management_common_shared.devdocs.json'; diff --git a/api_docs/kbn_index_management_shared_types.mdx b/api_docs/kbn_index_management_shared_types.mdx index a51e54b2762a3..e43a8c95eb09d 100644 --- a/api_docs/kbn_index_management_shared_types.mdx +++ b/api_docs/kbn_index_management_shared_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-index-management-shared-types title: "@kbn/index-management-shared-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/index-management-shared-types plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/index-management-shared-types'] --- import kbnIndexManagementSharedTypesObj from './kbn_index_management_shared_types.devdocs.json'; diff --git a/api_docs/kbn_inference_common.mdx b/api_docs/kbn_inference_common.mdx index 2d5fb4c848fd4..7839ec75e94dc 100644 --- a/api_docs/kbn_inference_common.mdx +++ b/api_docs/kbn_inference_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-inference-common title: "@kbn/inference-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/inference-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/inference-common'] --- import kbnInferenceCommonObj from './kbn_inference_common.devdocs.json'; diff --git a/api_docs/kbn_inference_integration_flyout.mdx b/api_docs/kbn_inference_integration_flyout.mdx index 1a1258f4f3edc..ee1ddcd26867d 100644 --- a/api_docs/kbn_inference_integration_flyout.mdx +++ b/api_docs/kbn_inference_integration_flyout.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-inference_integration_flyout title: "@kbn/inference_integration_flyout" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/inference_integration_flyout plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/inference_integration_flyout'] --- import kbnInferenceIntegrationFlyoutObj from './kbn_inference_integration_flyout.devdocs.json'; diff --git a/api_docs/kbn_infra_forge.mdx b/api_docs/kbn_infra_forge.mdx index 33e49453b6ed6..5c3b5a3117a16 100644 --- a/api_docs/kbn_infra_forge.mdx +++ b/api_docs/kbn_infra_forge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-infra-forge title: "@kbn/infra-forge" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/infra-forge plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/infra-forge'] --- import kbnInfraForgeObj from './kbn_infra_forge.devdocs.json'; diff --git a/api_docs/kbn_interpreter.mdx b/api_docs/kbn_interpreter.mdx index f4c7ab795c046..5754f3ff47e96 100644 --- a/api_docs/kbn_interpreter.mdx +++ b/api_docs/kbn_interpreter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-interpreter title: "@kbn/interpreter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/interpreter plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/interpreter'] --- import kbnInterpreterObj from './kbn_interpreter.devdocs.json'; diff --git a/api_docs/kbn_investigation_shared.mdx b/api_docs/kbn_investigation_shared.mdx index 6538a8312b11f..72f08a21bf175 100644 --- a/api_docs/kbn_investigation_shared.mdx +++ b/api_docs/kbn_investigation_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-investigation-shared title: "@kbn/investigation-shared" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/investigation-shared plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/investigation-shared'] --- import kbnInvestigationSharedObj from './kbn_investigation_shared.devdocs.json'; diff --git a/api_docs/kbn_io_ts_utils.mdx b/api_docs/kbn_io_ts_utils.mdx index 4a4cdaa5d842e..e23a6a9395724 100644 --- a/api_docs/kbn_io_ts_utils.mdx +++ b/api_docs/kbn_io_ts_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-io-ts-utils title: "@kbn/io-ts-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/io-ts-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/io-ts-utils'] --- import kbnIoTsUtilsObj from './kbn_io_ts_utils.devdocs.json'; diff --git a/api_docs/kbn_ipynb.mdx b/api_docs/kbn_ipynb.mdx index 7349a9186f134..e148365af1760 100644 --- a/api_docs/kbn_ipynb.mdx +++ b/api_docs/kbn_ipynb.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ipynb title: "@kbn/ipynb" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ipynb plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ipynb'] --- import kbnIpynbObj from './kbn_ipynb.devdocs.json'; diff --git a/api_docs/kbn_item_buffer.mdx b/api_docs/kbn_item_buffer.mdx index 1d529356cabb4..77793bca2d956 100644 --- a/api_docs/kbn_item_buffer.mdx +++ b/api_docs/kbn_item_buffer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-item-buffer title: "@kbn/item-buffer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/item-buffer plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/item-buffer'] --- import kbnItemBufferObj from './kbn_item_buffer.devdocs.json'; diff --git a/api_docs/kbn_jest_serializers.mdx b/api_docs/kbn_jest_serializers.mdx index ba6c5034fd371..b8cc6c608d381 100644 --- a/api_docs/kbn_jest_serializers.mdx +++ b/api_docs/kbn_jest_serializers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-jest-serializers title: "@kbn/jest-serializers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/jest-serializers plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/jest-serializers'] --- import kbnJestSerializersObj from './kbn_jest_serializers.devdocs.json'; diff --git a/api_docs/kbn_journeys.mdx b/api_docs/kbn_journeys.mdx index 5970b7f8dd4bc..3326093cbe5f1 100644 --- a/api_docs/kbn_journeys.mdx +++ b/api_docs/kbn_journeys.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-journeys title: "@kbn/journeys" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/journeys plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/journeys'] --- import kbnJourneysObj from './kbn_journeys.devdocs.json'; diff --git a/api_docs/kbn_json_ast.mdx b/api_docs/kbn_json_ast.mdx index 4e44cf4e0b99a..9d7a885f188b4 100644 --- a/api_docs/kbn_json_ast.mdx +++ b/api_docs/kbn_json_ast.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-json-ast title: "@kbn/json-ast" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/json-ast plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/json-ast'] --- import kbnJsonAstObj from './kbn_json_ast.devdocs.json'; diff --git a/api_docs/kbn_json_schemas.mdx b/api_docs/kbn_json_schemas.mdx index 13c76698f8f7e..f060a19c09282 100644 --- a/api_docs/kbn_json_schemas.mdx +++ b/api_docs/kbn_json_schemas.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-json-schemas title: "@kbn/json-schemas" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/json-schemas plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/json-schemas'] --- import kbnJsonSchemasObj from './kbn_json_schemas.devdocs.json'; diff --git a/api_docs/kbn_kibana_manifest_schema.mdx b/api_docs/kbn_kibana_manifest_schema.mdx index ce622811deae3..00ea6aec4e66d 100644 --- a/api_docs/kbn_kibana_manifest_schema.mdx +++ b/api_docs/kbn_kibana_manifest_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-kibana-manifest-schema title: "@kbn/kibana-manifest-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/kibana-manifest-schema plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/kibana-manifest-schema'] --- import kbnKibanaManifestSchemaObj from './kbn_kibana_manifest_schema.devdocs.json'; diff --git a/api_docs/kbn_language_documentation.mdx b/api_docs/kbn_language_documentation.mdx index 74233d246e12b..428696920e976 100644 --- a/api_docs/kbn_language_documentation.mdx +++ b/api_docs/kbn_language_documentation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-language-documentation title: "@kbn/language-documentation" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/language-documentation plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/language-documentation'] --- import kbnLanguageDocumentationObj from './kbn_language_documentation.devdocs.json'; diff --git a/api_docs/kbn_lens_embeddable_utils.mdx b/api_docs/kbn_lens_embeddable_utils.mdx index 053e9fe2bf4f4..6a5aa3db9ccf3 100644 --- a/api_docs/kbn_lens_embeddable_utils.mdx +++ b/api_docs/kbn_lens_embeddable_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-lens-embeddable-utils title: "@kbn/lens-embeddable-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/lens-embeddable-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/lens-embeddable-utils'] --- import kbnLensEmbeddableUtilsObj from './kbn_lens_embeddable_utils.devdocs.json'; diff --git a/api_docs/kbn_lens_formula_docs.mdx b/api_docs/kbn_lens_formula_docs.mdx index d48247376fd95..4ed4e6199bfc9 100644 --- a/api_docs/kbn_lens_formula_docs.mdx +++ b/api_docs/kbn_lens_formula_docs.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-lens-formula-docs title: "@kbn/lens-formula-docs" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/lens-formula-docs plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/lens-formula-docs'] --- import kbnLensFormulaDocsObj from './kbn_lens_formula_docs.devdocs.json'; diff --git a/api_docs/kbn_logging.mdx b/api_docs/kbn_logging.mdx index 399aa768879a5..4b0fec550fd0d 100644 --- a/api_docs/kbn_logging.mdx +++ b/api_docs/kbn_logging.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-logging title: "@kbn/logging" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/logging plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging'] --- import kbnLoggingObj from './kbn_logging.devdocs.json'; diff --git a/api_docs/kbn_logging_mocks.mdx b/api_docs/kbn_logging_mocks.mdx index 1de889b0987db..d086f90645207 100644 --- a/api_docs/kbn_logging_mocks.mdx +++ b/api_docs/kbn_logging_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-logging-mocks title: "@kbn/logging-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/logging-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/logging-mocks'] --- import kbnLoggingMocksObj from './kbn_logging_mocks.devdocs.json'; diff --git a/api_docs/kbn_managed_content_badge.mdx b/api_docs/kbn_managed_content_badge.mdx index a00b0f94a0f70..bdc90ddd92125 100644 --- a/api_docs/kbn_managed_content_badge.mdx +++ b/api_docs/kbn_managed_content_badge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-managed-content-badge title: "@kbn/managed-content-badge" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/managed-content-badge plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/managed-content-badge'] --- import kbnManagedContentBadgeObj from './kbn_managed_content_badge.devdocs.json'; diff --git a/api_docs/kbn_managed_vscode_config.mdx b/api_docs/kbn_managed_vscode_config.mdx index 6d3e29adcb11b..c28ac7882693a 100644 --- a/api_docs/kbn_managed_vscode_config.mdx +++ b/api_docs/kbn_managed_vscode_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-managed-vscode-config title: "@kbn/managed-vscode-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/managed-vscode-config plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/managed-vscode-config'] --- import kbnManagedVscodeConfigObj from './kbn_managed_vscode_config.devdocs.json'; diff --git a/api_docs/kbn_management_cards_navigation.mdx b/api_docs/kbn_management_cards_navigation.mdx index c7e43fe2c2346..375eb56a2b51f 100644 --- a/api_docs/kbn_management_cards_navigation.mdx +++ b/api_docs/kbn_management_cards_navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-cards-navigation title: "@kbn/management-cards-navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-cards-navigation plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-cards-navigation'] --- import kbnManagementCardsNavigationObj from './kbn_management_cards_navigation.devdocs.json'; diff --git a/api_docs/kbn_management_settings_application.mdx b/api_docs/kbn_management_settings_application.mdx index d5c11c4896906..508a8570c555f 100644 --- a/api_docs/kbn_management_settings_application.mdx +++ b/api_docs/kbn_management_settings_application.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-application title: "@kbn/management-settings-application" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-application plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-application'] --- import kbnManagementSettingsApplicationObj from './kbn_management_settings_application.devdocs.json'; diff --git a/api_docs/kbn_management_settings_components_field_category.mdx b/api_docs/kbn_management_settings_components_field_category.mdx index dbfbde011f31a..8d2d700be41fa 100644 --- a/api_docs/kbn_management_settings_components_field_category.mdx +++ b/api_docs/kbn_management_settings_components_field_category.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-components-field-category title: "@kbn/management-settings-components-field-category" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-components-field-category plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-components-field-category'] --- import kbnManagementSettingsComponentsFieldCategoryObj from './kbn_management_settings_components_field_category.devdocs.json'; diff --git a/api_docs/kbn_management_settings_components_field_input.mdx b/api_docs/kbn_management_settings_components_field_input.mdx index 091d54a4512eb..830506b050dc7 100644 --- a/api_docs/kbn_management_settings_components_field_input.mdx +++ b/api_docs/kbn_management_settings_components_field_input.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-components-field-input title: "@kbn/management-settings-components-field-input" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-components-field-input plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-components-field-input'] --- import kbnManagementSettingsComponentsFieldInputObj from './kbn_management_settings_components_field_input.devdocs.json'; diff --git a/api_docs/kbn_management_settings_components_field_row.mdx b/api_docs/kbn_management_settings_components_field_row.mdx index 6c26d8a07a4b9..96b2d901c5df8 100644 --- a/api_docs/kbn_management_settings_components_field_row.mdx +++ b/api_docs/kbn_management_settings_components_field_row.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-components-field-row title: "@kbn/management-settings-components-field-row" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-components-field-row plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-components-field-row'] --- import kbnManagementSettingsComponentsFieldRowObj from './kbn_management_settings_components_field_row.devdocs.json'; diff --git a/api_docs/kbn_management_settings_components_form.mdx b/api_docs/kbn_management_settings_components_form.mdx index d0f1d6d66789f..3340917d6d275 100644 --- a/api_docs/kbn_management_settings_components_form.mdx +++ b/api_docs/kbn_management_settings_components_form.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-components-form title: "@kbn/management-settings-components-form" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-components-form plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-components-form'] --- import kbnManagementSettingsComponentsFormObj from './kbn_management_settings_components_form.devdocs.json'; diff --git a/api_docs/kbn_management_settings_field_definition.mdx b/api_docs/kbn_management_settings_field_definition.mdx index 7ed283dd33f90..18678c302b2cb 100644 --- a/api_docs/kbn_management_settings_field_definition.mdx +++ b/api_docs/kbn_management_settings_field_definition.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-field-definition title: "@kbn/management-settings-field-definition" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-field-definition plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-field-definition'] --- import kbnManagementSettingsFieldDefinitionObj from './kbn_management_settings_field_definition.devdocs.json'; diff --git a/api_docs/kbn_management_settings_ids.mdx b/api_docs/kbn_management_settings_ids.mdx index cd1897c127897..332865fcd8260 100644 --- a/api_docs/kbn_management_settings_ids.mdx +++ b/api_docs/kbn_management_settings_ids.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-ids title: "@kbn/management-settings-ids" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-ids plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-ids'] --- import kbnManagementSettingsIdsObj from './kbn_management_settings_ids.devdocs.json'; diff --git a/api_docs/kbn_management_settings_section_registry.mdx b/api_docs/kbn_management_settings_section_registry.mdx index 6d87f9416ef21..ea4a646f12108 100644 --- a/api_docs/kbn_management_settings_section_registry.mdx +++ b/api_docs/kbn_management_settings_section_registry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-section-registry title: "@kbn/management-settings-section-registry" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-section-registry plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-section-registry'] --- import kbnManagementSettingsSectionRegistryObj from './kbn_management_settings_section_registry.devdocs.json'; diff --git a/api_docs/kbn_management_settings_types.mdx b/api_docs/kbn_management_settings_types.mdx index 02cf98cbb6fd0..a7a49a96996a0 100644 --- a/api_docs/kbn_management_settings_types.mdx +++ b/api_docs/kbn_management_settings_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-types title: "@kbn/management-settings-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-types plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-types'] --- import kbnManagementSettingsTypesObj from './kbn_management_settings_types.devdocs.json'; diff --git a/api_docs/kbn_management_settings_utilities.mdx b/api_docs/kbn_management_settings_utilities.mdx index 04f1afe6501ed..7334ea82e2b2d 100644 --- a/api_docs/kbn_management_settings_utilities.mdx +++ b/api_docs/kbn_management_settings_utilities.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-settings-utilities title: "@kbn/management-settings-utilities" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-settings-utilities plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-utilities'] --- import kbnManagementSettingsUtilitiesObj from './kbn_management_settings_utilities.devdocs.json'; diff --git a/api_docs/kbn_management_storybook_config.mdx b/api_docs/kbn_management_storybook_config.mdx index 9f9f1ae97c912..cd69ad6b947cc 100644 --- a/api_docs/kbn_management_storybook_config.mdx +++ b/api_docs/kbn_management_storybook_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-management-storybook-config title: "@kbn/management-storybook-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/management-storybook-config plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-storybook-config'] --- import kbnManagementStorybookConfigObj from './kbn_management_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_manifest.mdx b/api_docs/kbn_manifest.mdx index 99cd7c75432cd..7cdf9ab3a59b9 100644 --- a/api_docs/kbn_manifest.mdx +++ b/api_docs/kbn_manifest.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-manifest title: "@kbn/manifest" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/manifest plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/manifest'] --- import kbnManifestObj from './kbn_manifest.devdocs.json'; diff --git a/api_docs/kbn_mapbox_gl.mdx b/api_docs/kbn_mapbox_gl.mdx index 5f04f82916a87..a9854dac71f61 100644 --- a/api_docs/kbn_mapbox_gl.mdx +++ b/api_docs/kbn_mapbox_gl.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-mapbox-gl title: "@kbn/mapbox-gl" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/mapbox-gl plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/mapbox-gl'] --- import kbnMapboxGlObj from './kbn_mapbox_gl.devdocs.json'; diff --git a/api_docs/kbn_maps_vector_tile_utils.mdx b/api_docs/kbn_maps_vector_tile_utils.mdx index 6992bc48b83b0..676ec31487c77 100644 --- a/api_docs/kbn_maps_vector_tile_utils.mdx +++ b/api_docs/kbn_maps_vector_tile_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-maps-vector-tile-utils title: "@kbn/maps-vector-tile-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/maps-vector-tile-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/maps-vector-tile-utils'] --- import kbnMapsVectorTileUtilsObj from './kbn_maps_vector_tile_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_agg_utils.mdx b/api_docs/kbn_ml_agg_utils.mdx index fe0965220de2e..8dc251504392a 100644 --- a/api_docs/kbn_ml_agg_utils.mdx +++ b/api_docs/kbn_ml_agg_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-agg-utils title: "@kbn/ml-agg-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-agg-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-agg-utils'] --- import kbnMlAggUtilsObj from './kbn_ml_agg_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_anomaly_utils.mdx b/api_docs/kbn_ml_anomaly_utils.mdx index fab8c3a92bde3..18ec92cbca310 100644 --- a/api_docs/kbn_ml_anomaly_utils.mdx +++ b/api_docs/kbn_ml_anomaly_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-anomaly-utils title: "@kbn/ml-anomaly-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-anomaly-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-anomaly-utils'] --- import kbnMlAnomalyUtilsObj from './kbn_ml_anomaly_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_cancellable_search.mdx b/api_docs/kbn_ml_cancellable_search.mdx index 3bc6ec91859c8..ac3b6c8bd7958 100644 --- a/api_docs/kbn_ml_cancellable_search.mdx +++ b/api_docs/kbn_ml_cancellable_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-cancellable-search title: "@kbn/ml-cancellable-search" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-cancellable-search plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-cancellable-search'] --- import kbnMlCancellableSearchObj from './kbn_ml_cancellable_search.devdocs.json'; diff --git a/api_docs/kbn_ml_category_validator.mdx b/api_docs/kbn_ml_category_validator.mdx index 9f9c82fd9cc54..14f48f8a3482f 100644 --- a/api_docs/kbn_ml_category_validator.mdx +++ b/api_docs/kbn_ml_category_validator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-category-validator title: "@kbn/ml-category-validator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-category-validator plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-category-validator'] --- import kbnMlCategoryValidatorObj from './kbn_ml_category_validator.devdocs.json'; diff --git a/api_docs/kbn_ml_chi2test.mdx b/api_docs/kbn_ml_chi2test.mdx index db2a748e444c1..a54e94969ba2f 100644 --- a/api_docs/kbn_ml_chi2test.mdx +++ b/api_docs/kbn_ml_chi2test.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-chi2test title: "@kbn/ml-chi2test" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-chi2test plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-chi2test'] --- import kbnMlChi2testObj from './kbn_ml_chi2test.devdocs.json'; diff --git a/api_docs/kbn_ml_data_frame_analytics_utils.mdx b/api_docs/kbn_ml_data_frame_analytics_utils.mdx index ded370fb77889..4608d29912af0 100644 --- a/api_docs/kbn_ml_data_frame_analytics_utils.mdx +++ b/api_docs/kbn_ml_data_frame_analytics_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-data-frame-analytics-utils title: "@kbn/ml-data-frame-analytics-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-data-frame-analytics-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-data-frame-analytics-utils'] --- import kbnMlDataFrameAnalyticsUtilsObj from './kbn_ml_data_frame_analytics_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_data_grid.mdx b/api_docs/kbn_ml_data_grid.mdx index 579b24e5dc66c..f45ca2d8c664e 100644 --- a/api_docs/kbn_ml_data_grid.mdx +++ b/api_docs/kbn_ml_data_grid.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-data-grid title: "@kbn/ml-data-grid" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-data-grid plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-data-grid'] --- import kbnMlDataGridObj from './kbn_ml_data_grid.devdocs.json'; diff --git a/api_docs/kbn_ml_date_picker.mdx b/api_docs/kbn_ml_date_picker.mdx index 442aa81067517..3e7a2fb11e94c 100644 --- a/api_docs/kbn_ml_date_picker.mdx +++ b/api_docs/kbn_ml_date_picker.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-date-picker title: "@kbn/ml-date-picker" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-date-picker plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-date-picker'] --- import kbnMlDatePickerObj from './kbn_ml_date_picker.devdocs.json'; diff --git a/api_docs/kbn_ml_date_utils.mdx b/api_docs/kbn_ml_date_utils.mdx index 2273fb75f2666..f26b3b2363e37 100644 --- a/api_docs/kbn_ml_date_utils.mdx +++ b/api_docs/kbn_ml_date_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-date-utils title: "@kbn/ml-date-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-date-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-date-utils'] --- import kbnMlDateUtilsObj from './kbn_ml_date_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_error_utils.mdx b/api_docs/kbn_ml_error_utils.mdx index 0fa5d37e44f3b..f186d79bbd9cc 100644 --- a/api_docs/kbn_ml_error_utils.mdx +++ b/api_docs/kbn_ml_error_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-error-utils title: "@kbn/ml-error-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-error-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-error-utils'] --- import kbnMlErrorUtilsObj from './kbn_ml_error_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_field_stats_flyout.mdx b/api_docs/kbn_ml_field_stats_flyout.mdx index 8b93a0a30eb87..86bd82901fa4d 100644 --- a/api_docs/kbn_ml_field_stats_flyout.mdx +++ b/api_docs/kbn_ml_field_stats_flyout.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-field-stats-flyout title: "@kbn/ml-field-stats-flyout" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-field-stats-flyout plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-field-stats-flyout'] --- import kbnMlFieldStatsFlyoutObj from './kbn_ml_field_stats_flyout.devdocs.json'; diff --git a/api_docs/kbn_ml_in_memory_table.mdx b/api_docs/kbn_ml_in_memory_table.mdx index 1ca63c97e6cea..2c3de4510d8b7 100644 --- a/api_docs/kbn_ml_in_memory_table.mdx +++ b/api_docs/kbn_ml_in_memory_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-in-memory-table title: "@kbn/ml-in-memory-table" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-in-memory-table plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-in-memory-table'] --- import kbnMlInMemoryTableObj from './kbn_ml_in_memory_table.devdocs.json'; diff --git a/api_docs/kbn_ml_is_defined.mdx b/api_docs/kbn_ml_is_defined.mdx index 22b5d0090332b..9144011b13f36 100644 --- a/api_docs/kbn_ml_is_defined.mdx +++ b/api_docs/kbn_ml_is_defined.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-is-defined title: "@kbn/ml-is-defined" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-is-defined plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-is-defined'] --- import kbnMlIsDefinedObj from './kbn_ml_is_defined.devdocs.json'; diff --git a/api_docs/kbn_ml_is_populated_object.mdx b/api_docs/kbn_ml_is_populated_object.mdx index 3cf78d84184af..05bed369ef440 100644 --- a/api_docs/kbn_ml_is_populated_object.mdx +++ b/api_docs/kbn_ml_is_populated_object.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-is-populated-object title: "@kbn/ml-is-populated-object" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-is-populated-object plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-is-populated-object'] --- import kbnMlIsPopulatedObjectObj from './kbn_ml_is_populated_object.devdocs.json'; diff --git a/api_docs/kbn_ml_kibana_theme.mdx b/api_docs/kbn_ml_kibana_theme.mdx index 64a9b94cbff79..54358bca7c2d6 100644 --- a/api_docs/kbn_ml_kibana_theme.mdx +++ b/api_docs/kbn_ml_kibana_theme.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-kibana-theme title: "@kbn/ml-kibana-theme" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-kibana-theme plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-kibana-theme'] --- import kbnMlKibanaThemeObj from './kbn_ml_kibana_theme.devdocs.json'; diff --git a/api_docs/kbn_ml_local_storage.mdx b/api_docs/kbn_ml_local_storage.mdx index 542a3716fa406..3dc60fa955603 100644 --- a/api_docs/kbn_ml_local_storage.mdx +++ b/api_docs/kbn_ml_local_storage.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-local-storage title: "@kbn/ml-local-storage" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-local-storage plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-local-storage'] --- import kbnMlLocalStorageObj from './kbn_ml_local_storage.devdocs.json'; diff --git a/api_docs/kbn_ml_nested_property.mdx b/api_docs/kbn_ml_nested_property.mdx index 14910ff0958e0..628d4c4a2ba1e 100644 --- a/api_docs/kbn_ml_nested_property.mdx +++ b/api_docs/kbn_ml_nested_property.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-nested-property title: "@kbn/ml-nested-property" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-nested-property plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-nested-property'] --- import kbnMlNestedPropertyObj from './kbn_ml_nested_property.devdocs.json'; diff --git a/api_docs/kbn_ml_number_utils.mdx b/api_docs/kbn_ml_number_utils.mdx index 4fc56f73a196c..dfc540c7705c1 100644 --- a/api_docs/kbn_ml_number_utils.mdx +++ b/api_docs/kbn_ml_number_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-number-utils title: "@kbn/ml-number-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-number-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-number-utils'] --- import kbnMlNumberUtilsObj from './kbn_ml_number_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_parse_interval.mdx b/api_docs/kbn_ml_parse_interval.mdx index e8bea5fba2760..9d5e3446ce9ba 100644 --- a/api_docs/kbn_ml_parse_interval.mdx +++ b/api_docs/kbn_ml_parse_interval.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-parse-interval title: "@kbn/ml-parse-interval" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-parse-interval plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-parse-interval'] --- import kbnMlParseIntervalObj from './kbn_ml_parse_interval.devdocs.json'; diff --git a/api_docs/kbn_ml_query_utils.mdx b/api_docs/kbn_ml_query_utils.mdx index b26e52fdaed1b..9a0f0d0b3d899 100644 --- a/api_docs/kbn_ml_query_utils.mdx +++ b/api_docs/kbn_ml_query_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-query-utils title: "@kbn/ml-query-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-query-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-query-utils'] --- import kbnMlQueryUtilsObj from './kbn_ml_query_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_random_sampler_utils.mdx b/api_docs/kbn_ml_random_sampler_utils.mdx index 0c24a2a4bacf0..4bf216a468fa4 100644 --- a/api_docs/kbn_ml_random_sampler_utils.mdx +++ b/api_docs/kbn_ml_random_sampler_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-random-sampler-utils title: "@kbn/ml-random-sampler-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-random-sampler-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-random-sampler-utils'] --- import kbnMlRandomSamplerUtilsObj from './kbn_ml_random_sampler_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_route_utils.mdx b/api_docs/kbn_ml_route_utils.mdx index 11ecb976569eb..c4036669a5782 100644 --- a/api_docs/kbn_ml_route_utils.mdx +++ b/api_docs/kbn_ml_route_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-route-utils title: "@kbn/ml-route-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-route-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-route-utils'] --- import kbnMlRouteUtilsObj from './kbn_ml_route_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_runtime_field_utils.mdx b/api_docs/kbn_ml_runtime_field_utils.mdx index 2a45beb292c36..2b8273c0a490a 100644 --- a/api_docs/kbn_ml_runtime_field_utils.mdx +++ b/api_docs/kbn_ml_runtime_field_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-runtime-field-utils title: "@kbn/ml-runtime-field-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-runtime-field-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-runtime-field-utils'] --- import kbnMlRuntimeFieldUtilsObj from './kbn_ml_runtime_field_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_string_hash.mdx b/api_docs/kbn_ml_string_hash.mdx index c422df53ca73c..bff681f8d0645 100644 --- a/api_docs/kbn_ml_string_hash.mdx +++ b/api_docs/kbn_ml_string_hash.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-string-hash title: "@kbn/ml-string-hash" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-string-hash plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-string-hash'] --- import kbnMlStringHashObj from './kbn_ml_string_hash.devdocs.json'; diff --git a/api_docs/kbn_ml_time_buckets.mdx b/api_docs/kbn_ml_time_buckets.mdx index aa54601d42860..39d0bcfb30f62 100644 --- a/api_docs/kbn_ml_time_buckets.mdx +++ b/api_docs/kbn_ml_time_buckets.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-time-buckets title: "@kbn/ml-time-buckets" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-time-buckets plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-time-buckets'] --- import kbnMlTimeBucketsObj from './kbn_ml_time_buckets.devdocs.json'; diff --git a/api_docs/kbn_ml_trained_models_utils.mdx b/api_docs/kbn_ml_trained_models_utils.mdx index e6bddbc5695a7..f567a99ab4c03 100644 --- a/api_docs/kbn_ml_trained_models_utils.mdx +++ b/api_docs/kbn_ml_trained_models_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-trained-models-utils title: "@kbn/ml-trained-models-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-trained-models-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-trained-models-utils'] --- import kbnMlTrainedModelsUtilsObj from './kbn_ml_trained_models_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_ui_actions.mdx b/api_docs/kbn_ml_ui_actions.mdx index 1ec0b7cdad4f2..86e4692e38f56 100644 --- a/api_docs/kbn_ml_ui_actions.mdx +++ b/api_docs/kbn_ml_ui_actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-ui-actions title: "@kbn/ml-ui-actions" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-ui-actions plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-ui-actions'] --- import kbnMlUiActionsObj from './kbn_ml_ui_actions.devdocs.json'; diff --git a/api_docs/kbn_ml_url_state.devdocs.json b/api_docs/kbn_ml_url_state.devdocs.json index fdb0e03e3d1c8..3e4caf1e8383c 100644 --- a/api_docs/kbn_ml_url_state.devdocs.json +++ b/api_docs/kbn_ml_url_state.devdocs.json @@ -20,10 +20,10 @@ "classes": [ { "parentPluginId": "@kbn/ml-url-state", - "id": "def-common.PageUrlStateService", + "id": "def-common.UrlStateService", "type": "Class", "tags": [], - "label": "PageUrlStateService", + "label": "UrlStateService", "description": [ "\nService for managing URL state of particular page." ], @@ -32,8 +32,8 @@ "pluginId": "@kbn/ml-url-state", "scope": "common", "docId": "kibKbnMlUrlStatePluginApi", - "section": "def-common.PageUrlStateService", - "text": "PageUrlStateService" + "section": "def-common.UrlStateService", + "text": "UrlStateService" }, "" ], @@ -43,10 +43,10 @@ "children": [ { "parentPluginId": "@kbn/ml-url-state", - "id": "def-common.PageUrlStateService.getPageUrlState$", + "id": "def-common.UrlStateService.getUrlState$", "type": "Function", "tags": [], - "label": "getPageUrlState$", + "label": "getUrlState$", "description": [ "\nProvides updates for the page URL state." ], @@ -63,10 +63,10 @@ }, { "parentPluginId": "@kbn/ml-url-state", - "id": "def-common.PageUrlStateService.getPageUrlState", + "id": "def-common.UrlStateService.getUrlState", "type": "Function", "tags": [], - "label": "getPageUrlState", + "label": "getUrlState", "description": [], "signature": [ "() => T | null" @@ -79,7 +79,7 @@ }, { "parentPluginId": "@kbn/ml-url-state", - "id": "def-common.PageUrlStateService.updateUrlState", + "id": "def-common.UrlStateService.updateUrlState", "type": "Function", "tags": [], "label": "updateUrlState", @@ -93,7 +93,7 @@ "children": [ { "parentPluginId": "@kbn/ml-url-state", - "id": "def-common.PageUrlStateService.updateUrlState.$1", + "id": "def-common.UrlStateService.updateUrlState.$1", "type": "Object", "tags": [], "label": "update", @@ -108,7 +108,7 @@ }, { "parentPluginId": "@kbn/ml-url-state", - "id": "def-common.PageUrlStateService.updateUrlState.$2", + "id": "def-common.UrlStateService.updateUrlState.$2", "type": "CompoundType", "tags": [], "label": "replaceState", @@ -126,7 +126,7 @@ }, { "parentPluginId": "@kbn/ml-url-state", - "id": "def-common.PageUrlStateService.setCurrentState", + "id": "def-common.UrlStateService.setCurrentState", "type": "Function", "tags": [], "label": "setCurrentState", @@ -142,7 +142,7 @@ "children": [ { "parentPluginId": "@kbn/ml-url-state", - "id": "def-common.PageUrlStateService.setCurrentState.$1", + "id": "def-common.UrlStateService.setCurrentState.$1", "type": "Uncategorized", "tags": [], "label": "currentState", @@ -160,7 +160,7 @@ }, { "parentPluginId": "@kbn/ml-url-state", - "id": "def-common.PageUrlStateService.setUpdateCallback", + "id": "def-common.UrlStateService.setUpdateCallback", "type": "Function", "tags": [], "label": "setUpdateCallback", @@ -176,7 +176,7 @@ "children": [ { "parentPluginId": "@kbn/ml-url-state", - "id": "def-common.PageUrlStateService.setUpdateCallback.$1", + "id": "def-common.UrlStateService.setUpdateCallback.$1", "type": "Function", "tags": [], "label": "callback", @@ -363,8 +363,8 @@ "pluginId": "@kbn/ml-url-state", "scope": "common", "docId": "kibKbnMlUrlStatePluginApi", - "section": "def-common.PageUrlStateService", - "text": "PageUrlStateService" + "section": "def-common.UrlStateService", + "text": "UrlStateService" }, "]" ], diff --git a/api_docs/kbn_ml_url_state.mdx b/api_docs/kbn_ml_url_state.mdx index 68147c6158d14..620f0c2a148d7 100644 --- a/api_docs/kbn_ml_url_state.mdx +++ b/api_docs/kbn_ml_url_state.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-url-state title: "@kbn/ml-url-state" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-url-state plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-url-state'] --- import kbnMlUrlStateObj from './kbn_ml_url_state.devdocs.json'; diff --git a/api_docs/kbn_ml_validators.mdx b/api_docs/kbn_ml_validators.mdx index 20dbb90a3fb42..fb5a7842de5e6 100644 --- a/api_docs/kbn_ml_validators.mdx +++ b/api_docs/kbn_ml_validators.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-validators title: "@kbn/ml-validators" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-validators plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-validators'] --- import kbnMlValidatorsObj from './kbn_ml_validators.devdocs.json'; diff --git a/api_docs/kbn_mock_idp_utils.mdx b/api_docs/kbn_mock_idp_utils.mdx index 3f18bebbf943b..fc6c7dc3c4dc2 100644 --- a/api_docs/kbn_mock_idp_utils.mdx +++ b/api_docs/kbn_mock_idp_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-mock-idp-utils title: "@kbn/mock-idp-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/mock-idp-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/mock-idp-utils'] --- import kbnMockIdpUtilsObj from './kbn_mock_idp_utils.devdocs.json'; diff --git a/api_docs/kbn_monaco.mdx b/api_docs/kbn_monaco.mdx index c431d39bdda61..e76ed4b489482 100644 --- a/api_docs/kbn_monaco.mdx +++ b/api_docs/kbn_monaco.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-monaco title: "@kbn/monaco" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/monaco plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/monaco'] --- import kbnMonacoObj from './kbn_monaco.devdocs.json'; diff --git a/api_docs/kbn_object_versioning.mdx b/api_docs/kbn_object_versioning.mdx index 0c4d9d77fa491..2c2f4bacd50cd 100644 --- a/api_docs/kbn_object_versioning.mdx +++ b/api_docs/kbn_object_versioning.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-object-versioning title: "@kbn/object-versioning" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/object-versioning plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/object-versioning'] --- import kbnObjectVersioningObj from './kbn_object_versioning.devdocs.json'; diff --git a/api_docs/kbn_object_versioning_utils.mdx b/api_docs/kbn_object_versioning_utils.mdx index 49afebe1f7ae6..2b6c76bf10527 100644 --- a/api_docs/kbn_object_versioning_utils.mdx +++ b/api_docs/kbn_object_versioning_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-object-versioning-utils title: "@kbn/object-versioning-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/object-versioning-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/object-versioning-utils'] --- import kbnObjectVersioningUtilsObj from './kbn_object_versioning_utils.devdocs.json'; diff --git a/api_docs/kbn_observability_alert_details.mdx b/api_docs/kbn_observability_alert_details.mdx index a8e9a84de869a..3511b63bdff45 100644 --- a/api_docs/kbn_observability_alert_details.mdx +++ b/api_docs/kbn_observability_alert_details.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-observability-alert-details title: "@kbn/observability-alert-details" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/observability-alert-details plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/observability-alert-details'] --- import kbnObservabilityAlertDetailsObj from './kbn_observability_alert_details.devdocs.json'; diff --git a/api_docs/kbn_observability_alerting_rule_utils.mdx b/api_docs/kbn_observability_alerting_rule_utils.mdx index cb6cf5aa5839c..40caf4571cda5 100644 --- a/api_docs/kbn_observability_alerting_rule_utils.mdx +++ b/api_docs/kbn_observability_alerting_rule_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-observability-alerting-rule-utils title: "@kbn/observability-alerting-rule-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/observability-alerting-rule-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/observability-alerting-rule-utils'] --- import kbnObservabilityAlertingRuleUtilsObj from './kbn_observability_alerting_rule_utils.devdocs.json'; diff --git a/api_docs/kbn_observability_alerting_test_data.mdx b/api_docs/kbn_observability_alerting_test_data.mdx index 73dcab2446c8a..0e100a4e46a92 100644 --- a/api_docs/kbn_observability_alerting_test_data.mdx +++ b/api_docs/kbn_observability_alerting_test_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-observability-alerting-test-data title: "@kbn/observability-alerting-test-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/observability-alerting-test-data plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/observability-alerting-test-data'] --- import kbnObservabilityAlertingTestDataObj from './kbn_observability_alerting_test_data.devdocs.json'; diff --git a/api_docs/kbn_observability_get_padded_alert_time_range_util.mdx b/api_docs/kbn_observability_get_padded_alert_time_range_util.mdx index a22e1657209fa..cbd006c0259d7 100644 --- a/api_docs/kbn_observability_get_padded_alert_time_range_util.mdx +++ b/api_docs/kbn_observability_get_padded_alert_time_range_util.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-observability-get-padded-alert-time-range-util title: "@kbn/observability-get-padded-alert-time-range-util" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/observability-get-padded-alert-time-range-util plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/observability-get-padded-alert-time-range-util'] --- import kbnObservabilityGetPaddedAlertTimeRangeUtilObj from './kbn_observability_get_padded_alert_time_range_util.devdocs.json'; diff --git a/api_docs/kbn_observability_logs_overview.mdx b/api_docs/kbn_observability_logs_overview.mdx index e177caf7b1d14..4132d15cc9952 100644 --- a/api_docs/kbn_observability_logs_overview.mdx +++ b/api_docs/kbn_observability_logs_overview.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-observability-logs-overview title: "@kbn/observability-logs-overview" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/observability-logs-overview plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/observability-logs-overview'] --- import kbnObservabilityLogsOverviewObj from './kbn_observability_logs_overview.devdocs.json'; diff --git a/api_docs/kbn_observability_synthetics_test_data.mdx b/api_docs/kbn_observability_synthetics_test_data.mdx index 170f35a3adead..0d373a2a7fa38 100644 --- a/api_docs/kbn_observability_synthetics_test_data.mdx +++ b/api_docs/kbn_observability_synthetics_test_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-observability-synthetics-test-data title: "@kbn/observability-synthetics-test-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/observability-synthetics-test-data plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/observability-synthetics-test-data'] --- import kbnObservabilitySyntheticsTestDataObj from './kbn_observability_synthetics_test_data.devdocs.json'; diff --git a/api_docs/kbn_openapi_bundler.mdx b/api_docs/kbn_openapi_bundler.mdx index 1de435a56c735..cbe66f0b49ec0 100644 --- a/api_docs/kbn_openapi_bundler.mdx +++ b/api_docs/kbn_openapi_bundler.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-openapi-bundler title: "@kbn/openapi-bundler" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/openapi-bundler plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/openapi-bundler'] --- import kbnOpenapiBundlerObj from './kbn_openapi_bundler.devdocs.json'; diff --git a/api_docs/kbn_openapi_generator.mdx b/api_docs/kbn_openapi_generator.mdx index 990f10a04ec7d..a3d94cb757aa5 100644 --- a/api_docs/kbn_openapi_generator.mdx +++ b/api_docs/kbn_openapi_generator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-openapi-generator title: "@kbn/openapi-generator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/openapi-generator plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/openapi-generator'] --- import kbnOpenapiGeneratorObj from './kbn_openapi_generator.devdocs.json'; diff --git a/api_docs/kbn_optimizer.mdx b/api_docs/kbn_optimizer.mdx index 4ea925b707471..33da82c9329d4 100644 --- a/api_docs/kbn_optimizer.mdx +++ b/api_docs/kbn_optimizer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer title: "@kbn/optimizer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/optimizer plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer'] --- import kbnOptimizerObj from './kbn_optimizer.devdocs.json'; diff --git a/api_docs/kbn_optimizer_webpack_helpers.mdx b/api_docs/kbn_optimizer_webpack_helpers.mdx index 2a0eb8d0ed703..596269472abaf 100644 --- a/api_docs/kbn_optimizer_webpack_helpers.mdx +++ b/api_docs/kbn_optimizer_webpack_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-optimizer-webpack-helpers title: "@kbn/optimizer-webpack-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/optimizer-webpack-helpers plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/optimizer-webpack-helpers'] --- import kbnOptimizerWebpackHelpersObj from './kbn_optimizer_webpack_helpers.devdocs.json'; diff --git a/api_docs/kbn_osquery_io_ts_types.mdx b/api_docs/kbn_osquery_io_ts_types.mdx index 4c242d2f1b8a5..99e8197157ab7 100644 --- a/api_docs/kbn_osquery_io_ts_types.mdx +++ b/api_docs/kbn_osquery_io_ts_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-osquery-io-ts-types title: "@kbn/osquery-io-ts-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/osquery-io-ts-types plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/osquery-io-ts-types'] --- import kbnOsqueryIoTsTypesObj from './kbn_osquery_io_ts_types.devdocs.json'; diff --git a/api_docs/kbn_palettes.mdx b/api_docs/kbn_palettes.mdx index 0f790a9a6fc21..00300e1cd7cb2 100644 --- a/api_docs/kbn_palettes.mdx +++ b/api_docs/kbn_palettes.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-palettes title: "@kbn/palettes" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/palettes plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/palettes'] --- import kbnPalettesObj from './kbn_palettes.devdocs.json'; diff --git a/api_docs/kbn_panel_loader.mdx b/api_docs/kbn_panel_loader.mdx index b2d988720f910..b1c79436841e3 100644 --- a/api_docs/kbn_panel_loader.mdx +++ b/api_docs/kbn_panel_loader.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-panel-loader title: "@kbn/panel-loader" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/panel-loader plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/panel-loader'] --- import kbnPanelLoaderObj from './kbn_panel_loader.devdocs.json'; diff --git a/api_docs/kbn_performance_testing_dataset_extractor.mdx b/api_docs/kbn_performance_testing_dataset_extractor.mdx index 7f3cfcd1f9a97..99024eb16710e 100644 --- a/api_docs/kbn_performance_testing_dataset_extractor.mdx +++ b/api_docs/kbn_performance_testing_dataset_extractor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-performance-testing-dataset-extractor title: "@kbn/performance-testing-dataset-extractor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/performance-testing-dataset-extractor plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/performance-testing-dataset-extractor'] --- import kbnPerformanceTestingDatasetExtractorObj from './kbn_performance_testing_dataset_extractor.devdocs.json'; diff --git a/api_docs/kbn_plugin_check.mdx b/api_docs/kbn_plugin_check.mdx index 978fdb9a45b29..4d5a4c84e5a2c 100644 --- a/api_docs/kbn_plugin_check.mdx +++ b/api_docs/kbn_plugin_check.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-check title: "@kbn/plugin-check" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-check plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-check'] --- import kbnPluginCheckObj from './kbn_plugin_check.devdocs.json'; diff --git a/api_docs/kbn_plugin_generator.mdx b/api_docs/kbn_plugin_generator.mdx index b236edcf16dfc..76b11cdec3801 100644 --- a/api_docs/kbn_plugin_generator.mdx +++ b/api_docs/kbn_plugin_generator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-generator title: "@kbn/plugin-generator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-generator plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-generator'] --- import kbnPluginGeneratorObj from './kbn_plugin_generator.devdocs.json'; diff --git a/api_docs/kbn_plugin_helpers.mdx b/api_docs/kbn_plugin_helpers.mdx index 8bb786e53d616..048effc85fbc0 100644 --- a/api_docs/kbn_plugin_helpers.mdx +++ b/api_docs/kbn_plugin_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-plugin-helpers title: "@kbn/plugin-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/plugin-helpers plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/plugin-helpers'] --- import kbnPluginHelpersObj from './kbn_plugin_helpers.devdocs.json'; diff --git a/api_docs/kbn_presentation_containers.mdx b/api_docs/kbn_presentation_containers.mdx index 0161be36a09e1..6d2294e0d2da7 100644 --- a/api_docs/kbn_presentation_containers.mdx +++ b/api_docs/kbn_presentation_containers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-presentation-containers title: "@kbn/presentation-containers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/presentation-containers plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/presentation-containers'] --- import kbnPresentationContainersObj from './kbn_presentation_containers.devdocs.json'; diff --git a/api_docs/kbn_presentation_publishing.mdx b/api_docs/kbn_presentation_publishing.mdx index 4a99a559a760d..f98ad209ad517 100644 --- a/api_docs/kbn_presentation_publishing.mdx +++ b/api_docs/kbn_presentation_publishing.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-presentation-publishing title: "@kbn/presentation-publishing" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/presentation-publishing plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/presentation-publishing'] --- import kbnPresentationPublishingObj from './kbn_presentation_publishing.devdocs.json'; diff --git a/api_docs/kbn_product_doc_artifact_builder.mdx b/api_docs/kbn_product_doc_artifact_builder.mdx index 6644721e996d9..0198a5c636bb3 100644 --- a/api_docs/kbn_product_doc_artifact_builder.mdx +++ b/api_docs/kbn_product_doc_artifact_builder.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-product-doc-artifact-builder title: "@kbn/product-doc-artifact-builder" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/product-doc-artifact-builder plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/product-doc-artifact-builder'] --- import kbnProductDocArtifactBuilderObj from './kbn_product_doc_artifact_builder.devdocs.json'; diff --git a/api_docs/kbn_product_doc_common.mdx b/api_docs/kbn_product_doc_common.mdx index 98484dacfae63..abb59452a217c 100644 --- a/api_docs/kbn_product_doc_common.mdx +++ b/api_docs/kbn_product_doc_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-product-doc-common title: "@kbn/product-doc-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/product-doc-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/product-doc-common'] --- import kbnProductDocCommonObj from './kbn_product_doc_common.devdocs.json'; diff --git a/api_docs/kbn_profiling_utils.mdx b/api_docs/kbn_profiling_utils.mdx index aff7e9f3e88ef..b75709cde15c0 100644 --- a/api_docs/kbn_profiling_utils.mdx +++ b/api_docs/kbn_profiling_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-profiling-utils title: "@kbn/profiling-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/profiling-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/profiling-utils'] --- import kbnProfilingUtilsObj from './kbn_profiling_utils.devdocs.json'; diff --git a/api_docs/kbn_random_sampling.mdx b/api_docs/kbn_random_sampling.mdx index a5b10efea427c..4c5b200a193ac 100644 --- a/api_docs/kbn_random_sampling.mdx +++ b/api_docs/kbn_random_sampling.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-random-sampling title: "@kbn/random-sampling" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/random-sampling plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/random-sampling'] --- import kbnRandomSamplingObj from './kbn_random_sampling.devdocs.json'; diff --git a/api_docs/kbn_react_field.mdx b/api_docs/kbn_react_field.mdx index 82d4286b2bc0e..167c49ad26a04 100644 --- a/api_docs/kbn_react_field.mdx +++ b/api_docs/kbn_react_field.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-field title: "@kbn/react-field" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-field plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-field'] --- import kbnReactFieldObj from './kbn_react_field.devdocs.json'; diff --git a/api_docs/kbn_react_hooks.mdx b/api_docs/kbn_react_hooks.mdx index 1a1fc35d8c4f5..e9fb23d2f4695 100644 --- a/api_docs/kbn_react_hooks.mdx +++ b/api_docs/kbn_react_hooks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-hooks title: "@kbn/react-hooks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-hooks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-hooks'] --- import kbnReactHooksObj from './kbn_react_hooks.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_common.mdx b/api_docs/kbn_react_kibana_context_common.mdx index 566b6cf454d51..46ef0b76e1c5b 100644 --- a/api_docs/kbn_react_kibana_context_common.mdx +++ b/api_docs/kbn_react_kibana_context_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-context-common title: "@kbn/react-kibana-context-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-context-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-common'] --- import kbnReactKibanaContextCommonObj from './kbn_react_kibana_context_common.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_render.mdx b/api_docs/kbn_react_kibana_context_render.mdx index c8155ef6996c2..27ceb95026ebf 100644 --- a/api_docs/kbn_react_kibana_context_render.mdx +++ b/api_docs/kbn_react_kibana_context_render.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-context-render title: "@kbn/react-kibana-context-render" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-context-render plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-render'] --- import kbnReactKibanaContextRenderObj from './kbn_react_kibana_context_render.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_root.mdx b/api_docs/kbn_react_kibana_context_root.mdx index ab6ec9e82796c..ea023701f9299 100644 --- a/api_docs/kbn_react_kibana_context_root.mdx +++ b/api_docs/kbn_react_kibana_context_root.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-context-root title: "@kbn/react-kibana-context-root" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-context-root plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-root'] --- import kbnReactKibanaContextRootObj from './kbn_react_kibana_context_root.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_styled.mdx b/api_docs/kbn_react_kibana_context_styled.mdx index c7e6500e1d466..c3233728d489a 100644 --- a/api_docs/kbn_react_kibana_context_styled.mdx +++ b/api_docs/kbn_react_kibana_context_styled.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-context-styled title: "@kbn/react-kibana-context-styled" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-context-styled plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-styled'] --- import kbnReactKibanaContextStyledObj from './kbn_react_kibana_context_styled.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_context_theme.mdx b/api_docs/kbn_react_kibana_context_theme.mdx index 7e1cacdaafd94..836bf595d0e93 100644 --- a/api_docs/kbn_react_kibana_context_theme.mdx +++ b/api_docs/kbn_react_kibana_context_theme.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-context-theme title: "@kbn/react-kibana-context-theme" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-context-theme plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-theme'] --- import kbnReactKibanaContextThemeObj from './kbn_react_kibana_context_theme.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_mount.mdx b/api_docs/kbn_react_kibana_mount.mdx index 56ad3db223247..b0ae003ced25f 100644 --- a/api_docs/kbn_react_kibana_mount.mdx +++ b/api_docs/kbn_react_kibana_mount.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-kibana-mount title: "@kbn/react-kibana-mount" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-kibana-mount plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-mount'] --- import kbnReactKibanaMountObj from './kbn_react_kibana_mount.devdocs.json'; diff --git a/api_docs/kbn_react_mute_legacy_root_warning.mdx b/api_docs/kbn_react_mute_legacy_root_warning.mdx index 4a2208d35a683..d7f1effe46449 100644 --- a/api_docs/kbn_react_mute_legacy_root_warning.mdx +++ b/api_docs/kbn_react_mute_legacy_root_warning.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-mute-legacy-root-warning title: "@kbn/react-mute-legacy-root-warning" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-mute-legacy-root-warning plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-mute-legacy-root-warning'] --- import kbnReactMuteLegacyRootWarningObj from './kbn_react_mute_legacy_root_warning.devdocs.json'; diff --git a/api_docs/kbn_recently_accessed.mdx b/api_docs/kbn_recently_accessed.mdx index 914f52df33c1e..8750d06c7c8a0 100644 --- a/api_docs/kbn_recently_accessed.mdx +++ b/api_docs/kbn_recently_accessed.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-recently-accessed title: "@kbn/recently-accessed" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/recently-accessed plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/recently-accessed'] --- import kbnRecentlyAccessedObj from './kbn_recently_accessed.devdocs.json'; diff --git a/api_docs/kbn_relocate.mdx b/api_docs/kbn_relocate.mdx index 1e3b8b3d0f365..939a0100b17b2 100644 --- a/api_docs/kbn_relocate.mdx +++ b/api_docs/kbn_relocate.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-relocate title: "@kbn/relocate" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/relocate plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/relocate'] --- import kbnRelocateObj from './kbn_relocate.devdocs.json'; diff --git a/api_docs/kbn_repo_file_maps.mdx b/api_docs/kbn_repo_file_maps.mdx index 2d08ccc145562..74739f25509f7 100644 --- a/api_docs/kbn_repo_file_maps.mdx +++ b/api_docs/kbn_repo_file_maps.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-file-maps title: "@kbn/repo-file-maps" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-file-maps plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-file-maps'] --- import kbnRepoFileMapsObj from './kbn_repo_file_maps.devdocs.json'; diff --git a/api_docs/kbn_repo_linter.mdx b/api_docs/kbn_repo_linter.mdx index b31ce55ab11ef..00dbc3d80e0fd 100644 --- a/api_docs/kbn_repo_linter.mdx +++ b/api_docs/kbn_repo_linter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-linter title: "@kbn/repo-linter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-linter plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-linter'] --- import kbnRepoLinterObj from './kbn_repo_linter.devdocs.json'; diff --git a/api_docs/kbn_repo_path.mdx b/api_docs/kbn_repo_path.mdx index 76521c594ef38..982f23332afa0 100644 --- a/api_docs/kbn_repo_path.mdx +++ b/api_docs/kbn_repo_path.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-path title: "@kbn/repo-path" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-path plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-path'] --- import kbnRepoPathObj from './kbn_repo_path.devdocs.json'; diff --git a/api_docs/kbn_repo_source_classifier.mdx b/api_docs/kbn_repo_source_classifier.mdx index 8165fcfd9f05f..624179cc98e21 100644 --- a/api_docs/kbn_repo_source_classifier.mdx +++ b/api_docs/kbn_repo_source_classifier.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-repo-source-classifier title: "@kbn/repo-source-classifier" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/repo-source-classifier plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/repo-source-classifier'] --- import kbnRepoSourceClassifierObj from './kbn_repo_source_classifier.devdocs.json'; diff --git a/api_docs/kbn_reporting_common.mdx b/api_docs/kbn_reporting_common.mdx index b3a535964300a..2d7b74d9a7320 100644 --- a/api_docs/kbn_reporting_common.mdx +++ b/api_docs/kbn_reporting_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-common title: "@kbn/reporting-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-common'] --- import kbnReportingCommonObj from './kbn_reporting_common.devdocs.json'; diff --git a/api_docs/kbn_reporting_csv_share_panel.mdx b/api_docs/kbn_reporting_csv_share_panel.mdx index e32f117fc0132..aa50373cb80ea 100644 --- a/api_docs/kbn_reporting_csv_share_panel.mdx +++ b/api_docs/kbn_reporting_csv_share_panel.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-csv-share-panel title: "@kbn/reporting-csv-share-panel" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-csv-share-panel plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-csv-share-panel'] --- import kbnReportingCsvSharePanelObj from './kbn_reporting_csv_share_panel.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_csv.mdx b/api_docs/kbn_reporting_export_types_csv.mdx index 287e2cdcebe84..8c0e69208f92d 100644 --- a/api_docs/kbn_reporting_export_types_csv.mdx +++ b/api_docs/kbn_reporting_export_types_csv.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-csv title: "@kbn/reporting-export-types-csv" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-csv plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-csv'] --- import kbnReportingExportTypesCsvObj from './kbn_reporting_export_types_csv.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_csv_common.mdx b/api_docs/kbn_reporting_export_types_csv_common.mdx index 0862eb334019a..86142d557dbf4 100644 --- a/api_docs/kbn_reporting_export_types_csv_common.mdx +++ b/api_docs/kbn_reporting_export_types_csv_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-csv-common title: "@kbn/reporting-export-types-csv-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-csv-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-csv-common'] --- import kbnReportingExportTypesCsvCommonObj from './kbn_reporting_export_types_csv_common.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_pdf.mdx b/api_docs/kbn_reporting_export_types_pdf.mdx index d6e6440662fb7..e5759525d5772 100644 --- a/api_docs/kbn_reporting_export_types_pdf.mdx +++ b/api_docs/kbn_reporting_export_types_pdf.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-pdf title: "@kbn/reporting-export-types-pdf" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-pdf plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-pdf'] --- import kbnReportingExportTypesPdfObj from './kbn_reporting_export_types_pdf.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_pdf_common.mdx b/api_docs/kbn_reporting_export_types_pdf_common.mdx index 3a2991d0baa27..9b3d1d4e06b6a 100644 --- a/api_docs/kbn_reporting_export_types_pdf_common.mdx +++ b/api_docs/kbn_reporting_export_types_pdf_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-pdf-common title: "@kbn/reporting-export-types-pdf-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-pdf-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-pdf-common'] --- import kbnReportingExportTypesPdfCommonObj from './kbn_reporting_export_types_pdf_common.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_png.mdx b/api_docs/kbn_reporting_export_types_png.mdx index f28eba61abd92..7b3723c6a0917 100644 --- a/api_docs/kbn_reporting_export_types_png.mdx +++ b/api_docs/kbn_reporting_export_types_png.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-png title: "@kbn/reporting-export-types-png" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-png plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-png'] --- import kbnReportingExportTypesPngObj from './kbn_reporting_export_types_png.devdocs.json'; diff --git a/api_docs/kbn_reporting_export_types_png_common.mdx b/api_docs/kbn_reporting_export_types_png_common.mdx index 2478a1bf43259..c2197661396be 100644 --- a/api_docs/kbn_reporting_export_types_png_common.mdx +++ b/api_docs/kbn_reporting_export_types_png_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-export-types-png-common title: "@kbn/reporting-export-types-png-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-export-types-png-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-export-types-png-common'] --- import kbnReportingExportTypesPngCommonObj from './kbn_reporting_export_types_png_common.devdocs.json'; diff --git a/api_docs/kbn_reporting_mocks_server.mdx b/api_docs/kbn_reporting_mocks_server.mdx index e884540b911cb..abadc5ca563a2 100644 --- a/api_docs/kbn_reporting_mocks_server.mdx +++ b/api_docs/kbn_reporting_mocks_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-mocks-server title: "@kbn/reporting-mocks-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-mocks-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-mocks-server'] --- import kbnReportingMocksServerObj from './kbn_reporting_mocks_server.devdocs.json'; diff --git a/api_docs/kbn_reporting_public.mdx b/api_docs/kbn_reporting_public.mdx index 3e9a5010c28ba..35f3fea52e836 100644 --- a/api_docs/kbn_reporting_public.mdx +++ b/api_docs/kbn_reporting_public.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-public title: "@kbn/reporting-public" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-public plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-public'] --- import kbnReportingPublicObj from './kbn_reporting_public.devdocs.json'; diff --git a/api_docs/kbn_reporting_server.mdx b/api_docs/kbn_reporting_server.mdx index f7bcfa0c81f50..23df115037689 100644 --- a/api_docs/kbn_reporting_server.mdx +++ b/api_docs/kbn_reporting_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-reporting-server title: "@kbn/reporting-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/reporting-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-server'] --- import kbnReportingServerObj from './kbn_reporting_server.devdocs.json'; diff --git a/api_docs/kbn_resizable_layout.mdx b/api_docs/kbn_resizable_layout.mdx index ba791f5652740..e62fd7ca8f9fb 100644 --- a/api_docs/kbn_resizable_layout.mdx +++ b/api_docs/kbn_resizable_layout.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-resizable-layout title: "@kbn/resizable-layout" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/resizable-layout plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/resizable-layout'] --- import kbnResizableLayoutObj from './kbn_resizable_layout.devdocs.json'; diff --git a/api_docs/kbn_response_ops_feature_flag_service.mdx b/api_docs/kbn_response_ops_feature_flag_service.mdx index 03821f32e0c4b..ac9d7df6e87be 100644 --- a/api_docs/kbn_response_ops_feature_flag_service.mdx +++ b/api_docs/kbn_response_ops_feature_flag_service.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-response-ops-feature-flag-service title: "@kbn/response-ops-feature-flag-service" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/response-ops-feature-flag-service plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/response-ops-feature-flag-service'] --- import kbnResponseOpsFeatureFlagServiceObj from './kbn_response_ops_feature_flag_service.devdocs.json'; diff --git a/api_docs/kbn_response_ops_rule_form.mdx b/api_docs/kbn_response_ops_rule_form.mdx index dfda25b778a1c..9eddee23ff21d 100644 --- a/api_docs/kbn_response_ops_rule_form.mdx +++ b/api_docs/kbn_response_ops_rule_form.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-response-ops-rule-form title: "@kbn/response-ops-rule-form" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/response-ops-rule-form plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/response-ops-rule-form'] --- import kbnResponseOpsRuleFormObj from './kbn_response_ops_rule_form.devdocs.json'; diff --git a/api_docs/kbn_response_ops_rule_params.mdx b/api_docs/kbn_response_ops_rule_params.mdx index a7af0bf846fd3..41dbc43dbf21c 100644 --- a/api_docs/kbn_response_ops_rule_params.mdx +++ b/api_docs/kbn_response_ops_rule_params.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-response-ops-rule-params title: "@kbn/response-ops-rule-params" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/response-ops-rule-params plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/response-ops-rule-params'] --- import kbnResponseOpsRuleParamsObj from './kbn_response_ops_rule_params.devdocs.json'; diff --git a/api_docs/kbn_rison.mdx b/api_docs/kbn_rison.mdx index f2c1045f559ce..944cde68cc1ad 100644 --- a/api_docs/kbn_rison.mdx +++ b/api_docs/kbn_rison.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rison title: "@kbn/rison" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rison plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rison'] --- import kbnRisonObj from './kbn_rison.devdocs.json'; diff --git a/api_docs/kbn_rollup.mdx b/api_docs/kbn_rollup.mdx index 429a14c88fa1a..7e0a3e59ce855 100644 --- a/api_docs/kbn_rollup.mdx +++ b/api_docs/kbn_rollup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rollup title: "@kbn/rollup" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rollup plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rollup'] --- import kbnRollupObj from './kbn_rollup.devdocs.json'; diff --git a/api_docs/kbn_router_to_openapispec.mdx b/api_docs/kbn_router_to_openapispec.mdx index 0482e4e425b85..5780887e97c15 100644 --- a/api_docs/kbn_router_to_openapispec.mdx +++ b/api_docs/kbn_router_to_openapispec.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-router-to-openapispec title: "@kbn/router-to-openapispec" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/router-to-openapispec plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/router-to-openapispec'] --- import kbnRouterToOpenapispecObj from './kbn_router_to_openapispec.devdocs.json'; diff --git a/api_docs/kbn_router_utils.mdx b/api_docs/kbn_router_utils.mdx index ec1104d5cff66..216f71535ac8f 100644 --- a/api_docs/kbn_router_utils.mdx +++ b/api_docs/kbn_router_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-router-utils title: "@kbn/router-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/router-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/router-utils'] --- import kbnRouterUtilsObj from './kbn_router_utils.devdocs.json'; diff --git a/api_docs/kbn_rrule.mdx b/api_docs/kbn_rrule.mdx index 2546f1149bedd..78ab3a9747ec6 100644 --- a/api_docs/kbn_rrule.mdx +++ b/api_docs/kbn_rrule.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rrule title: "@kbn/rrule" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rrule plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rrule'] --- import kbnRruleObj from './kbn_rrule.devdocs.json'; diff --git a/api_docs/kbn_rule_data_utils.mdx b/api_docs/kbn_rule_data_utils.mdx index 743b0af0236c6..5b5ac5a0a9b28 100644 --- a/api_docs/kbn_rule_data_utils.mdx +++ b/api_docs/kbn_rule_data_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-rule-data-utils title: "@kbn/rule-data-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/rule-data-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/rule-data-utils'] --- import kbnRuleDataUtilsObj from './kbn_rule_data_utils.devdocs.json'; diff --git a/api_docs/kbn_saved_objects_settings.mdx b/api_docs/kbn_saved_objects_settings.mdx index 3992a95ae0f23..e3da595d8e63e 100644 --- a/api_docs/kbn_saved_objects_settings.mdx +++ b/api_docs/kbn_saved_objects_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-saved-objects-settings title: "@kbn/saved-objects-settings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/saved-objects-settings plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/saved-objects-settings'] --- import kbnSavedObjectsSettingsObj from './kbn_saved_objects_settings.devdocs.json'; diff --git a/api_docs/kbn_saved_search_component.mdx b/api_docs/kbn_saved_search_component.mdx index 9419abeea145b..ee2a901613c93 100644 --- a/api_docs/kbn_saved_search_component.mdx +++ b/api_docs/kbn_saved_search_component.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-saved-search-component title: "@kbn/saved-search-component" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/saved-search-component plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/saved-search-component'] --- import kbnSavedSearchComponentObj from './kbn_saved_search_component.devdocs.json'; diff --git a/api_docs/kbn_scout.mdx b/api_docs/kbn_scout.mdx index 0db1ea778f651..ea12368f269a8 100644 --- a/api_docs/kbn_scout.mdx +++ b/api_docs/kbn_scout.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-scout title: "@kbn/scout" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/scout plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/scout'] --- import kbnScoutObj from './kbn_scout.devdocs.json'; diff --git a/api_docs/kbn_scout_info.mdx b/api_docs/kbn_scout_info.mdx index 088acea763ec4..09aeb2e4c335e 100644 --- a/api_docs/kbn_scout_info.mdx +++ b/api_docs/kbn_scout_info.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-scout-info title: "@kbn/scout-info" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/scout-info plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/scout-info'] --- import kbnScoutInfoObj from './kbn_scout_info.devdocs.json'; diff --git a/api_docs/kbn_scout_reporting.mdx b/api_docs/kbn_scout_reporting.mdx index 03e39573f348d..7c4041ae631af 100644 --- a/api_docs/kbn_scout_reporting.mdx +++ b/api_docs/kbn_scout_reporting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-scout-reporting title: "@kbn/scout-reporting" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/scout-reporting plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/scout-reporting'] --- import kbnScoutReportingObj from './kbn_scout_reporting.devdocs.json'; diff --git a/api_docs/kbn_screenshotting_server.mdx b/api_docs/kbn_screenshotting_server.mdx index 33e013f4da88c..8758ca2385a39 100644 --- a/api_docs/kbn_screenshotting_server.mdx +++ b/api_docs/kbn_screenshotting_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-screenshotting-server title: "@kbn/screenshotting-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/screenshotting-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/screenshotting-server'] --- import kbnScreenshottingServerObj from './kbn_screenshotting_server.devdocs.json'; diff --git a/api_docs/kbn_search_api_keys_components.mdx b/api_docs/kbn_search_api_keys_components.mdx index 9769a7df53292..d3c54dd13f8b7 100644 --- a/api_docs/kbn_search_api_keys_components.mdx +++ b/api_docs/kbn_search_api_keys_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-api-keys-components title: "@kbn/search-api-keys-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-api-keys-components plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-api-keys-components'] --- import kbnSearchApiKeysComponentsObj from './kbn_search_api_keys_components.devdocs.json'; diff --git a/api_docs/kbn_search_api_keys_server.mdx b/api_docs/kbn_search_api_keys_server.mdx index 8a1b952a24134..ee66c9648e479 100644 --- a/api_docs/kbn_search_api_keys_server.mdx +++ b/api_docs/kbn_search_api_keys_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-api-keys-server title: "@kbn/search-api-keys-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-api-keys-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-api-keys-server'] --- import kbnSearchApiKeysServerObj from './kbn_search_api_keys_server.devdocs.json'; diff --git a/api_docs/kbn_search_api_panels.mdx b/api_docs/kbn_search_api_panels.mdx index dddca915875ac..77391a5c23f00 100644 --- a/api_docs/kbn_search_api_panels.mdx +++ b/api_docs/kbn_search_api_panels.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-api-panels title: "@kbn/search-api-panels" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-api-panels plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-api-panels'] --- import kbnSearchApiPanelsObj from './kbn_search_api_panels.devdocs.json'; diff --git a/api_docs/kbn_search_connectors.mdx b/api_docs/kbn_search_connectors.mdx index 8b923a199eb47..d1de482bfc2e6 100644 --- a/api_docs/kbn_search_connectors.mdx +++ b/api_docs/kbn_search_connectors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-connectors title: "@kbn/search-connectors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-connectors plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-connectors'] --- import kbnSearchConnectorsObj from './kbn_search_connectors.devdocs.json'; diff --git a/api_docs/kbn_search_errors.mdx b/api_docs/kbn_search_errors.mdx index 7def59e32609f..d9ed776ad311e 100644 --- a/api_docs/kbn_search_errors.mdx +++ b/api_docs/kbn_search_errors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-errors title: "@kbn/search-errors" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-errors plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-errors'] --- import kbnSearchErrorsObj from './kbn_search_errors.devdocs.json'; diff --git a/api_docs/kbn_search_index_documents.mdx b/api_docs/kbn_search_index_documents.mdx index 85835f8189bc9..7091de6016996 100644 --- a/api_docs/kbn_search_index_documents.mdx +++ b/api_docs/kbn_search_index_documents.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-index-documents title: "@kbn/search-index-documents" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-index-documents plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-index-documents'] --- import kbnSearchIndexDocumentsObj from './kbn_search_index_documents.devdocs.json'; diff --git a/api_docs/kbn_search_response_warnings.mdx b/api_docs/kbn_search_response_warnings.mdx index 7af4f80f20699..adb58672e5907 100644 --- a/api_docs/kbn_search_response_warnings.mdx +++ b/api_docs/kbn_search_response_warnings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-response-warnings title: "@kbn/search-response-warnings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-response-warnings plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-response-warnings'] --- import kbnSearchResponseWarningsObj from './kbn_search_response_warnings.devdocs.json'; diff --git a/api_docs/kbn_search_shared_ui.mdx b/api_docs/kbn_search_shared_ui.mdx index cb778813bd77a..cff3490de5d61 100644 --- a/api_docs/kbn_search_shared_ui.mdx +++ b/api_docs/kbn_search_shared_ui.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-shared-ui title: "@kbn/search-shared-ui" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-shared-ui plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-shared-ui'] --- import kbnSearchSharedUiObj from './kbn_search_shared_ui.devdocs.json'; diff --git a/api_docs/kbn_search_types.mdx b/api_docs/kbn_search_types.mdx index 392dc2888c548..5b8955ae248fe 100644 --- a/api_docs/kbn_search_types.mdx +++ b/api_docs/kbn_search_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-types title: "@kbn/search-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-types plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-types'] --- import kbnSearchTypesObj from './kbn_search_types.devdocs.json'; diff --git a/api_docs/kbn_security_api_key_management.mdx b/api_docs/kbn_security_api_key_management.mdx index fd909db77c15a..669ef9ee13224 100644 --- a/api_docs/kbn_security_api_key_management.mdx +++ b/api_docs/kbn_security_api_key_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-api-key-management title: "@kbn/security-api-key-management" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-api-key-management plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-api-key-management'] --- import kbnSecurityApiKeyManagementObj from './kbn_security_api_key_management.devdocs.json'; diff --git a/api_docs/kbn_security_authorization_core.mdx b/api_docs/kbn_security_authorization_core.mdx index fcfc782f8df79..636d73fc41130 100644 --- a/api_docs/kbn_security_authorization_core.mdx +++ b/api_docs/kbn_security_authorization_core.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-authorization-core title: "@kbn/security-authorization-core" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-authorization-core plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-authorization-core'] --- import kbnSecurityAuthorizationCoreObj from './kbn_security_authorization_core.devdocs.json'; diff --git a/api_docs/kbn_security_authorization_core_common.mdx b/api_docs/kbn_security_authorization_core_common.mdx index 2ae58274c1c79..c78ea79fd102b 100644 --- a/api_docs/kbn_security_authorization_core_common.mdx +++ b/api_docs/kbn_security_authorization_core_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-authorization-core-common title: "@kbn/security-authorization-core-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-authorization-core-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-authorization-core-common'] --- import kbnSecurityAuthorizationCoreCommonObj from './kbn_security_authorization_core_common.devdocs.json'; diff --git a/api_docs/kbn_security_form_components.mdx b/api_docs/kbn_security_form_components.mdx index 18c002792ec26..93ed09c8a5866 100644 --- a/api_docs/kbn_security_form_components.mdx +++ b/api_docs/kbn_security_form_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-form-components title: "@kbn/security-form-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-form-components plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-form-components'] --- import kbnSecurityFormComponentsObj from './kbn_security_form_components.devdocs.json'; diff --git a/api_docs/kbn_security_hardening.mdx b/api_docs/kbn_security_hardening.mdx index 84f81b2d5cc62..5830bad9e7d09 100644 --- a/api_docs/kbn_security_hardening.mdx +++ b/api_docs/kbn_security_hardening.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-hardening title: "@kbn/security-hardening" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-hardening plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-hardening'] --- import kbnSecurityHardeningObj from './kbn_security_hardening.devdocs.json'; diff --git a/api_docs/kbn_security_plugin_types_common.mdx b/api_docs/kbn_security_plugin_types_common.mdx index 1083d79be968e..bb2bb4a300980 100644 --- a/api_docs/kbn_security_plugin_types_common.mdx +++ b/api_docs/kbn_security_plugin_types_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-plugin-types-common title: "@kbn/security-plugin-types-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-plugin-types-common plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-plugin-types-common'] --- import kbnSecurityPluginTypesCommonObj from './kbn_security_plugin_types_common.devdocs.json'; diff --git a/api_docs/kbn_security_plugin_types_public.devdocs.json b/api_docs/kbn_security_plugin_types_public.devdocs.json index 49fcb4a21570d..0f1b8532eb7aa 100644 --- a/api_docs/kbn_security_plugin_types_public.devdocs.json +++ b/api_docs/kbn_security_plugin_types_public.devdocs.json @@ -903,21 +903,21 @@ "plugin": "security", "path": "x-pack/plugins/security/public/plugin.tsx" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/links.ts" - }, { "plugin": "cloudLinks", "path": "x-pack/plugins/cloud_integrations/cloud_links/public/maybe_add_cloud_links/maybe_add_cloud_links.ts" }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/public/management/links.ts" + }, { "plugin": "cases", "path": "x-pack/plugins/cases/public/common/lib/kibana/hooks.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/lib/kibana/hooks.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/lib/kibana/hooks.ts" } ] }, @@ -1009,14 +1009,6 @@ "plugin": "searchPlayground", "path": "x-pack/plugins/search_playground/public/hooks/use_user_profile.ts" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/user_profiles/use_bulk_get_user_profiles.tsx" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/user_profiles/use_get_current_user_profile.tsx" - }, { "plugin": "cases", "path": "x-pack/plugins/cases/public/containers/user_profiles/api.test.ts" @@ -1032,6 +1024,14 @@ { "plugin": "cases", "path": "x-pack/plugins/cases/public/containers/user_profiles/api.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/use_bulk_get_user_profiles.tsx" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/use_get_current_user_profile.tsx" } ] } diff --git a/api_docs/kbn_security_plugin_types_public.mdx b/api_docs/kbn_security_plugin_types_public.mdx index c72fa94c7f95c..537cc169fc9c0 100644 --- a/api_docs/kbn_security_plugin_types_public.mdx +++ b/api_docs/kbn_security_plugin_types_public.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-plugin-types-public title: "@kbn/security-plugin-types-public" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-plugin-types-public plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-plugin-types-public'] --- import kbnSecurityPluginTypesPublicObj from './kbn_security_plugin_types_public.devdocs.json'; diff --git a/api_docs/kbn_security_plugin_types_server.devdocs.json b/api_docs/kbn_security_plugin_types_server.devdocs.json index 32feff21a5cb9..56538685b4d7c 100644 --- a/api_docs/kbn_security_plugin_types_server.devdocs.json +++ b/api_docs/kbn_security_plugin_types_server.devdocs.json @@ -4755,15 +4755,15 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/request_context_factory.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/request_context_factory.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/plugin.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/plugin.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/plugin.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/plugin.ts" } ] }, @@ -4869,10 +4869,6 @@ "plugin": "fleet", "path": "x-pack/plugins/fleet/server/routes/setup/handlers.ts" }, - { - "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/server/routes/setup_routes.ts" - }, { "plugin": "serverlessSearch", "path": "x-pack/plugins/serverless_search/server/routes/api_key_routes.ts" @@ -4968,6 +4964,10 @@ { "plugin": "synthetics", "path": "x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/enablement.ts" + }, + { + "plugin": "cloudSecurityPosture", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/setup_routes.ts" } ] }, @@ -5039,11 +5039,11 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.ts" } ] } diff --git a/api_docs/kbn_security_plugin_types_server.mdx b/api_docs/kbn_security_plugin_types_server.mdx index 95f3e4bc31f82..8007f75fb0007 100644 --- a/api_docs/kbn_security_plugin_types_server.mdx +++ b/api_docs/kbn_security_plugin_types_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-plugin-types-server title: "@kbn/security-plugin-types-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-plugin-types-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-plugin-types-server'] --- import kbnSecurityPluginTypesServerObj from './kbn_security_plugin_types_server.devdocs.json'; diff --git a/api_docs/kbn_security_role_management_model.mdx b/api_docs/kbn_security_role_management_model.mdx index d1427e1ce9f2e..9760a2a57e343 100644 --- a/api_docs/kbn_security_role_management_model.mdx +++ b/api_docs/kbn_security_role_management_model.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-role-management-model title: "@kbn/security-role-management-model" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-role-management-model plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-role-management-model'] --- import kbnSecurityRoleManagementModelObj from './kbn_security_role_management_model.devdocs.json'; diff --git a/api_docs/kbn_security_solution_distribution_bar.mdx b/api_docs/kbn_security_solution_distribution_bar.mdx index 4299b2d56438d..13121dd6211e0 100644 --- a/api_docs/kbn_security_solution_distribution_bar.mdx +++ b/api_docs/kbn_security_solution_distribution_bar.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-solution-distribution-bar title: "@kbn/security-solution-distribution-bar" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-solution-distribution-bar plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-distribution-bar'] --- import kbnSecuritySolutionDistributionBarObj from './kbn_security_solution_distribution_bar.devdocs.json'; diff --git a/api_docs/kbn_security_solution_features.mdx b/api_docs/kbn_security_solution_features.mdx index 46b1d5ce0dcfe..bb106670760b3 100644 --- a/api_docs/kbn_security_solution_features.mdx +++ b/api_docs/kbn_security_solution_features.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-solution-features title: "@kbn/security-solution-features" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-solution-features plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-features'] --- import kbnSecuritySolutionFeaturesObj from './kbn_security_solution_features.devdocs.json'; diff --git a/api_docs/kbn_security_solution_navigation.devdocs.json b/api_docs/kbn_security_solution_navigation.devdocs.json index 4e22926d5b05a..45942b22304fd 100644 --- a/api_docs/kbn_security_solution_navigation.devdocs.json +++ b/api_docs/kbn_security_solution_navigation.devdocs.json @@ -970,7 +970,7 @@ "tags": [], "label": "SecurityPageName", "description": [], - "path": "packages/deeplinks/security/deep_links.ts", + "path": "src/platform/packages/shared/deeplinks/security/deep_links.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_security_solution_navigation.mdx b/api_docs/kbn_security_solution_navigation.mdx index 52e7d136a266f..d3e7a409b082c 100644 --- a/api_docs/kbn_security_solution_navigation.mdx +++ b/api_docs/kbn_security_solution_navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-solution-navigation title: "@kbn/security-solution-navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-solution-navigation plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-navigation'] --- import kbnSecuritySolutionNavigationObj from './kbn_security_solution_navigation.devdocs.json'; diff --git a/api_docs/kbn_security_solution_side_nav.mdx b/api_docs/kbn_security_solution_side_nav.mdx index d259430d4993d..b50a64911a370 100644 --- a/api_docs/kbn_security_solution_side_nav.mdx +++ b/api_docs/kbn_security_solution_side_nav.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-solution-side-nav title: "@kbn/security-solution-side-nav" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-solution-side-nav plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-side-nav'] --- import kbnSecuritySolutionSideNavObj from './kbn_security_solution_side_nav.devdocs.json'; diff --git a/api_docs/kbn_security_solution_storybook_config.mdx b/api_docs/kbn_security_solution_storybook_config.mdx index 30344269a77c8..a468b3924dbd6 100644 --- a/api_docs/kbn_security_solution_storybook_config.mdx +++ b/api_docs/kbn_security_solution_storybook_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-solution-storybook-config title: "@kbn/security-solution-storybook-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-solution-storybook-config plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-solution-storybook-config'] --- import kbnSecuritySolutionStorybookConfigObj from './kbn_security_solution_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_security_ui_components.mdx b/api_docs/kbn_security_ui_components.mdx index b5d5a1db5d037..8ebf8fef112fc 100644 --- a/api_docs/kbn_security_ui_components.mdx +++ b/api_docs/kbn_security_ui_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-ui-components title: "@kbn/security-ui-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-ui-components plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-ui-components'] --- import kbnSecurityUiComponentsObj from './kbn_security_ui_components.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_autocomplete.mdx b/api_docs/kbn_securitysolution_autocomplete.mdx index 9c049ef8233fc..475247e77e62d 100644 --- a/api_docs/kbn_securitysolution_autocomplete.mdx +++ b/api_docs/kbn_securitysolution_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-autocomplete title: "@kbn/securitysolution-autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-autocomplete plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-autocomplete'] --- import kbnSecuritysolutionAutocompleteObj from './kbn_securitysolution_autocomplete.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_data_table.mdx b/api_docs/kbn_securitysolution_data_table.mdx index a299fa31d2d21..7fd97e37c760d 100644 --- a/api_docs/kbn_securitysolution_data_table.mdx +++ b/api_docs/kbn_securitysolution_data_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-data-table title: "@kbn/securitysolution-data-table" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-data-table plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-data-table'] --- import kbnSecuritysolutionDataTableObj from './kbn_securitysolution_data_table.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_ecs.mdx b/api_docs/kbn_securitysolution_ecs.mdx index 2dc3c0abd92c1..b1697069faec4 100644 --- a/api_docs/kbn_securitysolution_ecs.mdx +++ b/api_docs/kbn_securitysolution_ecs.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-ecs title: "@kbn/securitysolution-ecs" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-ecs plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-ecs'] --- import kbnSecuritysolutionEcsObj from './kbn_securitysolution_ecs.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_es_utils.mdx b/api_docs/kbn_securitysolution_es_utils.mdx index 93101eaa5d657..a24a4fd1eba09 100644 --- a/api_docs/kbn_securitysolution_es_utils.mdx +++ b/api_docs/kbn_securitysolution_es_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-es-utils title: "@kbn/securitysolution-es-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-es-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-es-utils'] --- import kbnSecuritysolutionEsUtilsObj from './kbn_securitysolution_es_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_exception_list_components.mdx b/api_docs/kbn_securitysolution_exception_list_components.mdx index e82152b195ced..4c79ab4acd08e 100644 --- a/api_docs/kbn_securitysolution_exception_list_components.mdx +++ b/api_docs/kbn_securitysolution_exception_list_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-exception-list-components title: "@kbn/securitysolution-exception-list-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-exception-list-components plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-exception-list-components'] --- import kbnSecuritysolutionExceptionListComponentsObj from './kbn_securitysolution_exception_list_components.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_hook_utils.mdx b/api_docs/kbn_securitysolution_hook_utils.mdx index b46fc552026ce..90b0ff3f1761b 100644 --- a/api_docs/kbn_securitysolution_hook_utils.mdx +++ b/api_docs/kbn_securitysolution_hook_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-hook-utils title: "@kbn/securitysolution-hook-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-hook-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-hook-utils'] --- import kbnSecuritysolutionHookUtilsObj from './kbn_securitysolution_hook_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx index 8beaf15be4bcf..4d02f1b8287e4 100644 --- a/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_alerting_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-alerting-types title: "@kbn/securitysolution-io-ts-alerting-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-alerting-types plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-alerting-types'] --- import kbnSecuritysolutionIoTsAlertingTypesObj from './kbn_securitysolution_io_ts_alerting_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_list_types.mdx b/api_docs/kbn_securitysolution_io_ts_list_types.mdx index 26966f77bb02b..3fa758ffa22dd 100644 --- a/api_docs/kbn_securitysolution_io_ts_list_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_list_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-list-types title: "@kbn/securitysolution-io-ts-list-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-list-types plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-list-types'] --- import kbnSecuritysolutionIoTsListTypesObj from './kbn_securitysolution_io_ts_list_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_types.devdocs.json b/api_docs/kbn_securitysolution_io_ts_types.devdocs.json index f3ad240b0edc4..b634ff0ec3895 100644 --- a/api_docs/kbn_securitysolution_io_ts_types.devdocs.json +++ b/api_docs/kbn_securitysolution_io_ts_types.devdocs.json @@ -1173,7 +1173,7 @@ "tags": [], "label": "version", "description": [ - "\nNote this is just a positive number, but we use it as a type here which is still ok.\nThis type was originally from \"x-pack/plugins/security_solution/common/detection_engine/schemas/common/schemas.ts\"\nbut is moved here to make things more portable. No unit tests, but see PositiveIntegerGreaterThanZero integer for unit tests." + "\nNote this is just a positive number, but we use it as a type here which is still ok.\nThis type was originally from \"x-pack/solutions/security/plugins/security_solution/common/detection_engine/schemas/common/schemas.ts\"\nbut is moved here to make things more portable. No unit tests, but see PositiveIntegerGreaterThanZero integer for unit tests." ], "signature": [ "Type", diff --git a/api_docs/kbn_securitysolution_io_ts_types.mdx b/api_docs/kbn_securitysolution_io_ts_types.mdx index beb17f89be006..e7e7814330004 100644 --- a/api_docs/kbn_securitysolution_io_ts_types.mdx +++ b/api_docs/kbn_securitysolution_io_ts_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-types title: "@kbn/securitysolution-io-ts-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-types plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-types'] --- import kbnSecuritysolutionIoTsTypesObj from './kbn_securitysolution_io_ts_types.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_io_ts_utils.mdx b/api_docs/kbn_securitysolution_io_ts_utils.mdx index bb2fc8c24d41d..f50677bac844d 100644 --- a/api_docs/kbn_securitysolution_io_ts_utils.mdx +++ b/api_docs/kbn_securitysolution_io_ts_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-io-ts-utils title: "@kbn/securitysolution-io-ts-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-io-ts-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-io-ts-utils'] --- import kbnSecuritysolutionIoTsUtilsObj from './kbn_securitysolution_io_ts_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_api.mdx b/api_docs/kbn_securitysolution_list_api.mdx index dba8b73a955d4..6b2832d1aa06a 100644 --- a/api_docs/kbn_securitysolution_list_api.mdx +++ b/api_docs/kbn_securitysolution_list_api.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-api title: "@kbn/securitysolution-list-api" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-api plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-api'] --- import kbnSecuritysolutionListApiObj from './kbn_securitysolution_list_api.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_constants.devdocs.json b/api_docs/kbn_securitysolution_list_constants.devdocs.json index c4e0211dbc40a..24ee046140a71 100644 --- a/api_docs/kbn_securitysolution_list_constants.devdocs.json +++ b/api_docs/kbn_securitysolution_list_constants.devdocs.json @@ -37,19 +37,19 @@ "references": [ { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/blocklist/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/blocklist/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/blocklists/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/blocklists/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/blocklists/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/blocklists/index.ts" } ], "initialIsOpen": false @@ -69,47 +69,47 @@ "references": [ { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/blocklist/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/blocklist/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/blocklists/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/blocklists/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/blocklists/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/blocklists/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" } ], "initialIsOpen": false @@ -129,19 +129,19 @@ "references": [ { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/blocklist/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/blocklist/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/blocklists/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/blocklists/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/blocklists/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/blocklists/index.ts" } ], "initialIsOpen": false @@ -161,27 +161,27 @@ "references": [ { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/event_filters/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/event_filters/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/event_filters/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/event_filters/index.ts" } ], "initialIsOpen": false @@ -201,119 +201,119 @@ "references": [ { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/components/form.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/components/form.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/event_filter_validator.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/utils.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/event_filter_validator.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/utils.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/service/service_actions.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/service/service_actions.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/event_filters/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/service/service_actions.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/event_filters/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/event_filters/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/event_filters/view/utils.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/event_filters/view/utils.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/event_filters/service/service_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/event_filters/service/service_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/event_filter_validator.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/event_filters/service/service_actions.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/event_filter_validator.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/event_filters/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/event_filters/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/telemetry/tasks/security_lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/security_lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/telemetry/tasks/security_lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/security_lists.test.ts" } ], "initialIsOpen": false @@ -333,27 +333,27 @@ "references": [ { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/event_filters/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/event_filters/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/event_filters/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/event_filters/index.ts" } ], "initialIsOpen": false @@ -373,19 +373,19 @@ "references": [ { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts" } ], "initialIsOpen": false @@ -404,64 +404,64 @@ "trackAdoption": false, "references": [ { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/services/exception_lists/get_exception_list_summary.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts" + "plugin": "lists", + "path": "x-pack/plugins/lists/server/services/exception_lists/get_exception_list_summary.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/host_isolation_exceptions_validator.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/host_isolation_exceptions_validator.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts" }, { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/services/exception_lists/get_exception_list_summary.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/host_isolation_exceptions_validator.ts" }, { - "plugin": "lists", - "path": "x-pack/plugins/lists/server/services/exception_lists/get_exception_list_summary.test.ts" + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/host_isolation_exceptions_validator.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/endpoint/data_generators/host_isolation_exception_generator.ts" + "path": "x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/host_isolation_exception_generator.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/endpoint/data_generators/host_isolation_exception_generator.ts" + "path": "x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/host_isolation_exception_generator.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" } ], "initialIsOpen": false @@ -481,19 +481,19 @@ "references": [ { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts" } ], "initialIsOpen": false @@ -614,19 +614,19 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/trusted_apps/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/trusted_apps/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts" }, { "plugin": "@kbn/securitysolution-io-ts-list-types", @@ -684,30 +684,6 @@ "plugin": "lists", "path": "x-pack/plugins/lists/common/schemas/response/exception_list_schema.mock.ts" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/trusted_apps/constants.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/trusted_apps/constants.ts" - }, { "plugin": "lists", "path": "x-pack/plugins/lists/server/saved_objects/migrations.test.ts" @@ -746,91 +722,115 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/mocks/trusted_apps_http_mocks.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/constants.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/constants.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/public/management/mocks/trusted_apps_http_mocks.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/mocks/trusted_apps_http_mocks.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/mocks/trusted_apps_http_mocks.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/mocks/trusted_apps_http_mocks.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/mocks/trusted_apps_http_mocks.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/mappers.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/service/mappers.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/mappers.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/service/mappers.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts" }, { "plugin": "@kbn/securitysolution-io-ts-list-types", @@ -874,19 +874,19 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/trusted_apps/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/trusted_apps/constants.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/constants.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts" }, { "plugin": "@kbn/securitysolution-io-ts-list-types", diff --git a/api_docs/kbn_securitysolution_list_constants.mdx b/api_docs/kbn_securitysolution_list_constants.mdx index 4aed9a45de248..2437ebbdcb0d3 100644 --- a/api_docs/kbn_securitysolution_list_constants.mdx +++ b/api_docs/kbn_securitysolution_list_constants.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-constants title: "@kbn/securitysolution-list-constants" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-constants plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-constants'] --- import kbnSecuritysolutionListConstantsObj from './kbn_securitysolution_list_constants.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_hooks.mdx b/api_docs/kbn_securitysolution_list_hooks.mdx index 8b4c9068d55bf..45e4929023a82 100644 --- a/api_docs/kbn_securitysolution_list_hooks.mdx +++ b/api_docs/kbn_securitysolution_list_hooks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-hooks title: "@kbn/securitysolution-list-hooks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-hooks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-hooks'] --- import kbnSecuritysolutionListHooksObj from './kbn_securitysolution_list_hooks.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_list_utils.mdx b/api_docs/kbn_securitysolution_list_utils.mdx index a199b63dfeed2..e06d5b8a27645 100644 --- a/api_docs/kbn_securitysolution_list_utils.mdx +++ b/api_docs/kbn_securitysolution_list_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-list-utils title: "@kbn/securitysolution-list-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-list-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-list-utils'] --- import kbnSecuritysolutionListUtilsObj from './kbn_securitysolution_list_utils.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_rules.mdx b/api_docs/kbn_securitysolution_rules.mdx index 41261ebb41a39..71315fc8a32b4 100644 --- a/api_docs/kbn_securitysolution_rules.mdx +++ b/api_docs/kbn_securitysolution_rules.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-rules title: "@kbn/securitysolution-rules" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-rules plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-rules'] --- import kbnSecuritysolutionRulesObj from './kbn_securitysolution_rules.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_t_grid.mdx b/api_docs/kbn_securitysolution_t_grid.mdx index 7ec944ea0619b..89d800ca1b520 100644 --- a/api_docs/kbn_securitysolution_t_grid.mdx +++ b/api_docs/kbn_securitysolution_t_grid.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-t-grid title: "@kbn/securitysolution-t-grid" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-t-grid plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-t-grid'] --- import kbnSecuritysolutionTGridObj from './kbn_securitysolution_t_grid.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_utils.mdx b/api_docs/kbn_securitysolution_utils.mdx index d9fe68d9ba067..dcc11b26f47ca 100644 --- a/api_docs/kbn_securitysolution_utils.mdx +++ b/api_docs/kbn_securitysolution_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-securitysolution-utils title: "@kbn/securitysolution-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/securitysolution-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-utils'] --- import kbnSecuritysolutionUtilsObj from './kbn_securitysolution_utils.devdocs.json'; diff --git a/api_docs/kbn_server_http_tools.mdx b/api_docs/kbn_server_http_tools.mdx index 07a18f5e69553..450a0ffaeeb96 100644 --- a/api_docs/kbn_server_http_tools.mdx +++ b/api_docs/kbn_server_http_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-http-tools title: "@kbn/server-http-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-http-tools plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-http-tools'] --- import kbnServerHttpToolsObj from './kbn_server_http_tools.devdocs.json'; diff --git a/api_docs/kbn_server_route_repository.mdx b/api_docs/kbn_server_route_repository.mdx index b39d09b4b76a8..5687543bf95eb 100644 --- a/api_docs/kbn_server_route_repository.mdx +++ b/api_docs/kbn_server_route_repository.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-route-repository title: "@kbn/server-route-repository" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-route-repository plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository'] --- import kbnServerRouteRepositoryObj from './kbn_server_route_repository.devdocs.json'; diff --git a/api_docs/kbn_server_route_repository_client.mdx b/api_docs/kbn_server_route_repository_client.mdx index 6fd7971c85a65..250f43dcf64db 100644 --- a/api_docs/kbn_server_route_repository_client.mdx +++ b/api_docs/kbn_server_route_repository_client.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-route-repository-client title: "@kbn/server-route-repository-client" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-route-repository-client plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository-client'] --- import kbnServerRouteRepositoryClientObj from './kbn_server_route_repository_client.devdocs.json'; diff --git a/api_docs/kbn_server_route_repository_utils.mdx b/api_docs/kbn_server_route_repository_utils.mdx index b1788e06d31f7..4720ef593f891 100644 --- a/api_docs/kbn_server_route_repository_utils.mdx +++ b/api_docs/kbn_server_route_repository_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-server-route-repository-utils title: "@kbn/server-route-repository-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/server-route-repository-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository-utils'] --- import kbnServerRouteRepositoryUtilsObj from './kbn_server_route_repository_utils.devdocs.json'; diff --git a/api_docs/kbn_serverless_common_settings.mdx b/api_docs/kbn_serverless_common_settings.mdx index 560f632ba746a..a77c4a5e5a9bd 100644 --- a/api_docs/kbn_serverless_common_settings.mdx +++ b/api_docs/kbn_serverless_common_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-common-settings title: "@kbn/serverless-common-settings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-common-settings plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-common-settings'] --- import kbnServerlessCommonSettingsObj from './kbn_serverless_common_settings.devdocs.json'; diff --git a/api_docs/kbn_serverless_observability_settings.mdx b/api_docs/kbn_serverless_observability_settings.mdx index 55e335d737a3e..bb58f17972f2c 100644 --- a/api_docs/kbn_serverless_observability_settings.mdx +++ b/api_docs/kbn_serverless_observability_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-observability-settings title: "@kbn/serverless-observability-settings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-observability-settings plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-observability-settings'] --- import kbnServerlessObservabilitySettingsObj from './kbn_serverless_observability_settings.devdocs.json'; diff --git a/api_docs/kbn_serverless_project_switcher.mdx b/api_docs/kbn_serverless_project_switcher.mdx index 94bf8f3a610eb..95a340d890191 100644 --- a/api_docs/kbn_serverless_project_switcher.mdx +++ b/api_docs/kbn_serverless_project_switcher.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-project-switcher title: "@kbn/serverless-project-switcher" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-project-switcher plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-project-switcher'] --- import kbnServerlessProjectSwitcherObj from './kbn_serverless_project_switcher.devdocs.json'; diff --git a/api_docs/kbn_serverless_search_settings.mdx b/api_docs/kbn_serverless_search_settings.mdx index 262a0f90df5f5..594403698c951 100644 --- a/api_docs/kbn_serverless_search_settings.mdx +++ b/api_docs/kbn_serverless_search_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-search-settings title: "@kbn/serverless-search-settings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-search-settings plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-search-settings'] --- import kbnServerlessSearchSettingsObj from './kbn_serverless_search_settings.devdocs.json'; diff --git a/api_docs/kbn_serverless_security_settings.devdocs.json b/api_docs/kbn_serverless_security_settings.devdocs.json index fd54e257a28c8..1a14ff45bb0f5 100644 --- a/api_docs/kbn_serverless_security_settings.devdocs.json +++ b/api_docs/kbn_serverless_security_settings.devdocs.json @@ -32,7 +32,7 @@ "signature": [ "string[]" ], - "path": "packages/serverless/settings/security_project/index.ts", + "path": "src/platform/packages/shared/serverless/settings/security_project/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_serverless_security_settings.mdx b/api_docs/kbn_serverless_security_settings.mdx index 0c001d765f9dc..a3eab8683551f 100644 --- a/api_docs/kbn_serverless_security_settings.mdx +++ b/api_docs/kbn_serverless_security_settings.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-security-settings title: "@kbn/serverless-security-settings" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-security-settings plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-security-settings'] --- import kbnServerlessSecuritySettingsObj from './kbn_serverless_security_settings.devdocs.json'; diff --git a/api_docs/kbn_serverless_storybook_config.mdx b/api_docs/kbn_serverless_storybook_config.mdx index 6d7c4cceba9dd..dc7c780f24afe 100644 --- a/api_docs/kbn_serverless_storybook_config.mdx +++ b/api_docs/kbn_serverless_storybook_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-serverless-storybook-config title: "@kbn/serverless-storybook-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/serverless-storybook-config plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/serverless-storybook-config'] --- import kbnServerlessStorybookConfigObj from './kbn_serverless_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_shared_svg.mdx b/api_docs/kbn_shared_svg.mdx index fcd4ae5ceaf32..9b5f271a4c769 100644 --- a/api_docs/kbn_shared_svg.mdx +++ b/api_docs/kbn_shared_svg.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-svg title: "@kbn/shared-svg" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-svg plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-svg'] --- import kbnSharedSvgObj from './kbn_shared_svg.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_avatar_solution.mdx b/api_docs/kbn_shared_ux_avatar_solution.mdx index e90081477719f..f84ac0124dbb4 100644 --- a/api_docs/kbn_shared_ux_avatar_solution.mdx +++ b/api_docs/kbn_shared_ux_avatar_solution.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-avatar-solution title: "@kbn/shared-ux-avatar-solution" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-avatar-solution plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-avatar-solution'] --- import kbnSharedUxAvatarSolutionObj from './kbn_shared_ux_avatar_solution.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_exit_full_screen.mdx b/api_docs/kbn_shared_ux_button_exit_full_screen.mdx index 1268455853214..659784921dc22 100644 --- a/api_docs/kbn_shared_ux_button_exit_full_screen.mdx +++ b/api_docs/kbn_shared_ux_button_exit_full_screen.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-exit-full-screen title: "@kbn/shared-ux-button-exit-full-screen" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-exit-full-screen plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-exit-full-screen'] --- import kbnSharedUxButtonExitFullScreenObj from './kbn_shared_ux_button_exit_full_screen.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_button_toolbar.mdx b/api_docs/kbn_shared_ux_button_toolbar.mdx index a5bfdc0898f82..be197259915b5 100644 --- a/api_docs/kbn_shared_ux_button_toolbar.mdx +++ b/api_docs/kbn_shared_ux_button_toolbar.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-button-toolbar title: "@kbn/shared-ux-button-toolbar" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-button-toolbar plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-toolbar'] --- import kbnSharedUxButtonToolbarObj from './kbn_shared_ux_button_toolbar.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_card_no_data.mdx b/api_docs/kbn_shared_ux_card_no_data.mdx index dcbcce555e542..9041718718a78 100644 --- a/api_docs/kbn_shared_ux_card_no_data.mdx +++ b/api_docs/kbn_shared_ux_card_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-card-no-data title: "@kbn/shared-ux-card-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-card-no-data plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data'] --- import kbnSharedUxCardNoDataObj from './kbn_shared_ux_card_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_card_no_data_mocks.mdx b/api_docs/kbn_shared_ux_card_no_data_mocks.mdx index f668dc0070401..b86b12da678b3 100644 --- a/api_docs/kbn_shared_ux_card_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_card_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-card-no-data-mocks title: "@kbn/shared-ux-card-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-card-no-data-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data-mocks'] --- import kbnSharedUxCardNoDataMocksObj from './kbn_shared_ux_card_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_chrome_navigation.mdx b/api_docs/kbn_shared_ux_chrome_navigation.mdx index 7740071a0dc91..6f5929594cd24 100644 --- a/api_docs/kbn_shared_ux_chrome_navigation.mdx +++ b/api_docs/kbn_shared_ux_chrome_navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-chrome-navigation title: "@kbn/shared-ux-chrome-navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-chrome-navigation plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-chrome-navigation'] --- import kbnSharedUxChromeNavigationObj from './kbn_shared_ux_chrome_navigation.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_error_boundary.mdx b/api_docs/kbn_shared_ux_error_boundary.mdx index efebb93defcd6..d8588df9842ff 100644 --- a/api_docs/kbn_shared_ux_error_boundary.mdx +++ b/api_docs/kbn_shared_ux_error_boundary.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-error-boundary title: "@kbn/shared-ux-error-boundary" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-error-boundary plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-error-boundary'] --- import kbnSharedUxErrorBoundaryObj from './kbn_shared_ux_error_boundary.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_context.mdx b/api_docs/kbn_shared_ux_file_context.mdx index ac118c771d5a0..d61c5d8e29182 100644 --- a/api_docs/kbn_shared_ux_file_context.mdx +++ b/api_docs/kbn_shared_ux_file_context.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-context title: "@kbn/shared-ux-file-context" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-context plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-context'] --- import kbnSharedUxFileContextObj from './kbn_shared_ux_file_context.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_image.mdx b/api_docs/kbn_shared_ux_file_image.mdx index aabe67b628ba5..ee0a93dc950ae 100644 --- a/api_docs/kbn_shared_ux_file_image.mdx +++ b/api_docs/kbn_shared_ux_file_image.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-image title: "@kbn/shared-ux-file-image" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-image plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-image'] --- import kbnSharedUxFileImageObj from './kbn_shared_ux_file_image.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_image_mocks.mdx b/api_docs/kbn_shared_ux_file_image_mocks.mdx index 1118b5fe72048..08a607cec68e2 100644 --- a/api_docs/kbn_shared_ux_file_image_mocks.mdx +++ b/api_docs/kbn_shared_ux_file_image_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-image-mocks title: "@kbn/shared-ux-file-image-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-image-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-image-mocks'] --- import kbnSharedUxFileImageMocksObj from './kbn_shared_ux_file_image_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_mocks.mdx b/api_docs/kbn_shared_ux_file_mocks.mdx index 1900244891aed..f22b4d5c43f6c 100644 --- a/api_docs/kbn_shared_ux_file_mocks.mdx +++ b/api_docs/kbn_shared_ux_file_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-mocks title: "@kbn/shared-ux-file-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-mocks'] --- import kbnSharedUxFileMocksObj from './kbn_shared_ux_file_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_picker.mdx b/api_docs/kbn_shared_ux_file_picker.mdx index f48d92228ad6d..1aca6e72435d3 100644 --- a/api_docs/kbn_shared_ux_file_picker.mdx +++ b/api_docs/kbn_shared_ux_file_picker.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-picker title: "@kbn/shared-ux-file-picker" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-picker plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-picker'] --- import kbnSharedUxFilePickerObj from './kbn_shared_ux_file_picker.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_types.mdx b/api_docs/kbn_shared_ux_file_types.mdx index 033695a4cff77..0c84859e5fb37 100644 --- a/api_docs/kbn_shared_ux_file_types.mdx +++ b/api_docs/kbn_shared_ux_file_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-types title: "@kbn/shared-ux-file-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-types plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-types'] --- import kbnSharedUxFileTypesObj from './kbn_shared_ux_file_types.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_upload.mdx b/api_docs/kbn_shared_ux_file_upload.mdx index b1b39e7d4a8f1..dd3bdacc27046 100644 --- a/api_docs/kbn_shared_ux_file_upload.mdx +++ b/api_docs/kbn_shared_ux_file_upload.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-upload title: "@kbn/shared-ux-file-upload" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-upload plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-upload'] --- import kbnSharedUxFileUploadObj from './kbn_shared_ux_file_upload.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_file_util.mdx b/api_docs/kbn_shared_ux_file_util.mdx index 14d442013da3a..adb9d919784cb 100644 --- a/api_docs/kbn_shared_ux_file_util.mdx +++ b/api_docs/kbn_shared_ux_file_util.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-file-util title: "@kbn/shared-ux-file-util" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-file-util plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-util'] --- import kbnSharedUxFileUtilObj from './kbn_shared_ux_file_util.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_link_redirect_app.mdx b/api_docs/kbn_shared_ux_link_redirect_app.mdx index e06025eedc94e..41b5243156f68 100644 --- a/api_docs/kbn_shared_ux_link_redirect_app.mdx +++ b/api_docs/kbn_shared_ux_link_redirect_app.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-link-redirect-app title: "@kbn/shared-ux-link-redirect-app" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-link-redirect-app plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-link-redirect-app'] --- import kbnSharedUxLinkRedirectAppObj from './kbn_shared_ux_link_redirect_app.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx b/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx index 12b4ab726bedc..e58c96f2d5c4d 100644 --- a/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx +++ b/api_docs/kbn_shared_ux_link_redirect_app_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-link-redirect-app-mocks title: "@kbn/shared-ux-link-redirect-app-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-link-redirect-app-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-link-redirect-app-mocks'] --- import kbnSharedUxLinkRedirectAppMocksObj from './kbn_shared_ux_link_redirect_app_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_markdown.mdx b/api_docs/kbn_shared_ux_markdown.mdx index 59269b7ef4125..78b8a5053b272 100644 --- a/api_docs/kbn_shared_ux_markdown.mdx +++ b/api_docs/kbn_shared_ux_markdown.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-markdown title: "@kbn/shared-ux-markdown" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-markdown plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-markdown'] --- import kbnSharedUxMarkdownObj from './kbn_shared_ux_markdown.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_markdown_mocks.mdx b/api_docs/kbn_shared_ux_markdown_mocks.mdx index 531505b973e06..fcea5cc84e378 100644 --- a/api_docs/kbn_shared_ux_markdown_mocks.mdx +++ b/api_docs/kbn_shared_ux_markdown_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-markdown-mocks title: "@kbn/shared-ux-markdown-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-markdown-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-markdown-mocks'] --- import kbnSharedUxMarkdownMocksObj from './kbn_shared_ux_markdown_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx index 1de3703010118..e37641d0c7d13 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_analytics_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-analytics-no-data title: "@kbn/shared-ux-page-analytics-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-analytics-no-data plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data'] --- import kbnSharedUxPageAnalyticsNoDataObj from './kbn_shared_ux_page_analytics_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx index f7a3ac1138298..3142a9cc969b8 100644 --- a/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_analytics_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-analytics-no-data-mocks title: "@kbn/shared-ux-page-analytics-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-analytics-no-data-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-analytics-no-data-mocks'] --- import kbnSharedUxPageAnalyticsNoDataMocksObj from './kbn_shared_ux_page_analytics_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx index 3ff3b8abad6bd..d9ef50beace83 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-no-data title: "@kbn/shared-ux-page-kibana-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-no-data plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-no-data'] --- import kbnSharedUxPageKibanaNoDataObj from './kbn_shared_ux_page_kibana_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx index fba08baead167..4b1e6f89f851c 100644 --- a/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-no-data-mocks title: "@kbn/shared-ux-page-kibana-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-no-data-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-no-data-mocks'] --- import kbnSharedUxPageKibanaNoDataMocksObj from './kbn_shared_ux_page_kibana_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_template.mdx b/api_docs/kbn_shared_ux_page_kibana_template.mdx index 6bfe2316d2cfb..4d12b538f14cc 100644 --- a/api_docs/kbn_shared_ux_page_kibana_template.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_template.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-template title: "@kbn/shared-ux-page-kibana-template" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-template plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-template'] --- import kbnSharedUxPageKibanaTemplateObj from './kbn_shared_ux_page_kibana_template.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx b/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx index 3b9afd9b1b559..75770ef30745c 100644 --- a/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_kibana_template_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-kibana-template-mocks title: "@kbn/shared-ux-page-kibana-template-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-kibana-template-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-kibana-template-mocks'] --- import kbnSharedUxPageKibanaTemplateMocksObj from './kbn_shared_ux_page_kibana_template_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data.mdx b/api_docs/kbn_shared_ux_page_no_data.mdx index bd679ef6a0924..425b93ebdfd2b 100644 --- a/api_docs/kbn_shared_ux_page_no_data.mdx +++ b/api_docs/kbn_shared_ux_page_no_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data title: "@kbn/shared-ux-page-no-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data'] --- import kbnSharedUxPageNoDataObj from './kbn_shared_ux_page_no_data.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_config.mdx b/api_docs/kbn_shared_ux_page_no_data_config.mdx index f026cdab3788d..ebc831f8e08bb 100644 --- a/api_docs/kbn_shared_ux_page_no_data_config.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-config title: "@kbn/shared-ux-page-no-data-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-config plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-config'] --- import kbnSharedUxPageNoDataConfigObj from './kbn_shared_ux_page_no_data_config.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx b/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx index 3a6bb3e23c4fa..03febd38af5c3 100644 --- a/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_config_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-config-mocks title: "@kbn/shared-ux-page-no-data-config-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-config-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-config-mocks'] --- import kbnSharedUxPageNoDataConfigMocksObj from './kbn_shared_ux_page_no_data_config_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_no_data_mocks.mdx b/api_docs/kbn_shared_ux_page_no_data_mocks.mdx index faab7c3c2394f..aaafccdaf9e04 100644 --- a/api_docs/kbn_shared_ux_page_no_data_mocks.mdx +++ b/api_docs/kbn_shared_ux_page_no_data_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-no-data-mocks title: "@kbn/shared-ux-page-no-data-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-no-data-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-no-data-mocks'] --- import kbnSharedUxPageNoDataMocksObj from './kbn_shared_ux_page_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_page_solution_nav.mdx b/api_docs/kbn_shared_ux_page_solution_nav.mdx index a461b34f9c68b..b12a79cc80e34 100644 --- a/api_docs/kbn_shared_ux_page_solution_nav.mdx +++ b/api_docs/kbn_shared_ux_page_solution_nav.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-page-solution-nav title: "@kbn/shared-ux-page-solution-nav" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-page-solution-nav plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-page-solution-nav'] --- import kbnSharedUxPageSolutionNavObj from './kbn_shared_ux_page_solution_nav.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx index 8546efc4c9dbc..4b1ea2e51abd8 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views.mdx +++ b/api_docs/kbn_shared_ux_prompt_no_data_views.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-no-data-views title: "@kbn/shared-ux-prompt-no-data-views" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-no-data-views plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views'] --- import kbnSharedUxPromptNoDataViewsObj from './kbn_shared_ux_prompt_no_data_views.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx index 2b641c2f42842..5d45f0d8b4146 100644 --- a/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx +++ b/api_docs/kbn_shared_ux_prompt_no_data_views_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-no-data-views-mocks title: "@kbn/shared-ux-prompt-no-data-views-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-no-data-views-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-no-data-views-mocks'] --- import kbnSharedUxPromptNoDataViewsMocksObj from './kbn_shared_ux_prompt_no_data_views_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_prompt_not_found.mdx b/api_docs/kbn_shared_ux_prompt_not_found.mdx index 9c56525b2ca2e..570aef1e686b2 100644 --- a/api_docs/kbn_shared_ux_prompt_not_found.mdx +++ b/api_docs/kbn_shared_ux_prompt_not_found.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-prompt-not-found title: "@kbn/shared-ux-prompt-not-found" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-prompt-not-found plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-prompt-not-found'] --- import kbnSharedUxPromptNotFoundObj from './kbn_shared_ux_prompt_not_found.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_router.mdx b/api_docs/kbn_shared_ux_router.mdx index 27ea5275cc2b9..fe88f898e5388 100644 --- a/api_docs/kbn_shared_ux_router.mdx +++ b/api_docs/kbn_shared_ux_router.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-router title: "@kbn/shared-ux-router" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-router plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-router'] --- import kbnSharedUxRouterObj from './kbn_shared_ux_router.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_router_mocks.mdx b/api_docs/kbn_shared_ux_router_mocks.mdx index b29997a3c56e6..4faafc232677a 100644 --- a/api_docs/kbn_shared_ux_router_mocks.mdx +++ b/api_docs/kbn_shared_ux_router_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-router-mocks title: "@kbn/shared-ux-router-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-router-mocks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-router-mocks'] --- import kbnSharedUxRouterMocksObj from './kbn_shared_ux_router_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_storybook_config.mdx b/api_docs/kbn_shared_ux_storybook_config.mdx index 6fe9b66be2119..af909d0900d84 100644 --- a/api_docs/kbn_shared_ux_storybook_config.mdx +++ b/api_docs/kbn_shared_ux_storybook_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-storybook-config title: "@kbn/shared-ux-storybook-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-storybook-config plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook-config'] --- import kbnSharedUxStorybookConfigObj from './kbn_shared_ux_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_storybook_mock.mdx b/api_docs/kbn_shared_ux_storybook_mock.mdx index c27ce0a666231..2867ea43422af 100644 --- a/api_docs/kbn_shared_ux_storybook_mock.mdx +++ b/api_docs/kbn_shared_ux_storybook_mock.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-storybook-mock title: "@kbn/shared-ux-storybook-mock" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-storybook-mock plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-storybook-mock'] --- import kbnSharedUxStorybookMockObj from './kbn_shared_ux_storybook_mock.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_tabbed_modal.mdx b/api_docs/kbn_shared_ux_tabbed_modal.mdx index 87290d1bca89a..b08a2a87367fd 100644 --- a/api_docs/kbn_shared_ux_tabbed_modal.mdx +++ b/api_docs/kbn_shared_ux_tabbed_modal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-tabbed-modal title: "@kbn/shared-ux-tabbed-modal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-tabbed-modal plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-tabbed-modal'] --- import kbnSharedUxTabbedModalObj from './kbn_shared_ux_tabbed_modal.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_table_persist.mdx b/api_docs/kbn_shared_ux_table_persist.mdx index 6e872996fe75c..1a7d837a66a93 100644 --- a/api_docs/kbn_shared_ux_table_persist.mdx +++ b/api_docs/kbn_shared_ux_table_persist.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-table-persist title: "@kbn/shared-ux-table-persist" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-table-persist plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-table-persist'] --- import kbnSharedUxTablePersistObj from './kbn_shared_ux_table_persist.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_utility.mdx b/api_docs/kbn_shared_ux_utility.mdx index 272ab59c7f1e2..9287ffe3e9611 100644 --- a/api_docs/kbn_shared_ux_utility.mdx +++ b/api_docs/kbn_shared_ux_utility.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-shared-ux-utility title: "@kbn/shared-ux-utility" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/shared-ux-utility plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-utility'] --- import kbnSharedUxUtilityObj from './kbn_shared_ux_utility.devdocs.json'; diff --git a/api_docs/kbn_slo_schema.mdx b/api_docs/kbn_slo_schema.mdx index 4b95899ca04c3..14d75f78bef21 100644 --- a/api_docs/kbn_slo_schema.mdx +++ b/api_docs/kbn_slo_schema.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-slo-schema title: "@kbn/slo-schema" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/slo-schema plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/slo-schema'] --- import kbnSloSchemaObj from './kbn_slo_schema.devdocs.json'; diff --git a/api_docs/kbn_some_dev_log.mdx b/api_docs/kbn_some_dev_log.mdx index 81ef6445ea37d..a435209eff110 100644 --- a/api_docs/kbn_some_dev_log.mdx +++ b/api_docs/kbn_some_dev_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-some-dev-log title: "@kbn/some-dev-log" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/some-dev-log plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/some-dev-log'] --- import kbnSomeDevLogObj from './kbn_some_dev_log.devdocs.json'; diff --git a/api_docs/kbn_sort_predicates.mdx b/api_docs/kbn_sort_predicates.mdx index 723bf099acc86..339b29e902134 100644 --- a/api_docs/kbn_sort_predicates.mdx +++ b/api_docs/kbn_sort_predicates.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-sort-predicates title: "@kbn/sort-predicates" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/sort-predicates plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/sort-predicates'] --- import kbnSortPredicatesObj from './kbn_sort_predicates.devdocs.json'; diff --git a/api_docs/kbn_sse_utils.mdx b/api_docs/kbn_sse_utils.mdx index 1f7765de7c15c..7884c24da843a 100644 --- a/api_docs/kbn_sse_utils.mdx +++ b/api_docs/kbn_sse_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-sse-utils title: "@kbn/sse-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/sse-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/sse-utils'] --- import kbnSseUtilsObj from './kbn_sse_utils.devdocs.json'; diff --git a/api_docs/kbn_sse_utils_client.mdx b/api_docs/kbn_sse_utils_client.mdx index d15759b117ef0..e821fe28b007e 100644 --- a/api_docs/kbn_sse_utils_client.mdx +++ b/api_docs/kbn_sse_utils_client.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-sse-utils-client title: "@kbn/sse-utils-client" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/sse-utils-client plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/sse-utils-client'] --- import kbnSseUtilsClientObj from './kbn_sse_utils_client.devdocs.json'; diff --git a/api_docs/kbn_sse_utils_server.mdx b/api_docs/kbn_sse_utils_server.mdx index b387e17f8ef94..bda5f1bb9c315 100644 --- a/api_docs/kbn_sse_utils_server.mdx +++ b/api_docs/kbn_sse_utils_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-sse-utils-server title: "@kbn/sse-utils-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/sse-utils-server plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/sse-utils-server'] --- import kbnSseUtilsServerObj from './kbn_sse_utils_server.devdocs.json'; diff --git a/api_docs/kbn_std.mdx b/api_docs/kbn_std.mdx index 925aa61ed2f2d..7934941750586 100644 --- a/api_docs/kbn_std.mdx +++ b/api_docs/kbn_std.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-std title: "@kbn/std" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/std plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/std'] --- import kbnStdObj from './kbn_std.devdocs.json'; diff --git a/api_docs/kbn_stdio_dev_helpers.mdx b/api_docs/kbn_stdio_dev_helpers.mdx index 2cdfa724b11c0..157f7946ca17f 100644 --- a/api_docs/kbn_stdio_dev_helpers.mdx +++ b/api_docs/kbn_stdio_dev_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-stdio-dev-helpers title: "@kbn/stdio-dev-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/stdio-dev-helpers plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/stdio-dev-helpers'] --- import kbnStdioDevHelpersObj from './kbn_stdio_dev_helpers.devdocs.json'; diff --git a/api_docs/kbn_storybook.mdx b/api_docs/kbn_storybook.mdx index 1ee57dc8681f1..184e68ab8e0da 100644 --- a/api_docs/kbn_storybook.mdx +++ b/api_docs/kbn_storybook.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-storybook title: "@kbn/storybook" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/storybook plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/storybook'] --- import kbnStorybookObj from './kbn_storybook.devdocs.json'; diff --git a/api_docs/kbn_synthetics_e2e.mdx b/api_docs/kbn_synthetics_e2e.mdx index f626fc2abcdd8..a868381aa1756 100644 --- a/api_docs/kbn_synthetics_e2e.mdx +++ b/api_docs/kbn_synthetics_e2e.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-synthetics-e2e title: "@kbn/synthetics-e2e" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/synthetics-e2e plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/synthetics-e2e'] --- import kbnSyntheticsE2eObj from './kbn_synthetics_e2e.devdocs.json'; diff --git a/api_docs/kbn_synthetics_private_location.mdx b/api_docs/kbn_synthetics_private_location.mdx index 4f640bdf0c736..ef34447ce016b 100644 --- a/api_docs/kbn_synthetics_private_location.mdx +++ b/api_docs/kbn_synthetics_private_location.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-synthetics-private-location title: "@kbn/synthetics-private-location" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/synthetics-private-location plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/synthetics-private-location'] --- import kbnSyntheticsPrivateLocationObj from './kbn_synthetics_private_location.devdocs.json'; diff --git a/api_docs/kbn_telemetry_tools.mdx b/api_docs/kbn_telemetry_tools.mdx index f463a8208fc0b..12fac3e9b5ed9 100644 --- a/api_docs/kbn_telemetry_tools.mdx +++ b/api_docs/kbn_telemetry_tools.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-telemetry-tools title: "@kbn/telemetry-tools" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/telemetry-tools plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/telemetry-tools'] --- import kbnTelemetryToolsObj from './kbn_telemetry_tools.devdocs.json'; diff --git a/api_docs/kbn_test.mdx b/api_docs/kbn_test.mdx index bde31b46166d7..f2eba58b7745d 100644 --- a/api_docs/kbn_test.mdx +++ b/api_docs/kbn_test.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test title: "@kbn/test" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test'] --- import kbnTestObj from './kbn_test.devdocs.json'; diff --git a/api_docs/kbn_test_eui_helpers.mdx b/api_docs/kbn_test_eui_helpers.mdx index 26f73cc607944..2fa92bc8e6b33 100644 --- a/api_docs/kbn_test_eui_helpers.mdx +++ b/api_docs/kbn_test_eui_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test-eui-helpers title: "@kbn/test-eui-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test-eui-helpers plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-eui-helpers'] --- import kbnTestEuiHelpersObj from './kbn_test_eui_helpers.devdocs.json'; diff --git a/api_docs/kbn_test_jest_helpers.mdx b/api_docs/kbn_test_jest_helpers.mdx index 5d06b8117f543..d2d76c9e2e243 100644 --- a/api_docs/kbn_test_jest_helpers.mdx +++ b/api_docs/kbn_test_jest_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test-jest-helpers title: "@kbn/test-jest-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test-jest-helpers plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-jest-helpers'] --- import kbnTestJestHelpersObj from './kbn_test_jest_helpers.devdocs.json'; diff --git a/api_docs/kbn_test_subj_selector.mdx b/api_docs/kbn_test_subj_selector.mdx index 531b49c7f625a..352b39ae33702 100644 --- a/api_docs/kbn_test_subj_selector.mdx +++ b/api_docs/kbn_test_subj_selector.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-test-subj-selector title: "@kbn/test-subj-selector" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/test-subj-selector plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-subj-selector'] --- import kbnTestSubjSelectorObj from './kbn_test_subj_selector.devdocs.json'; diff --git a/api_docs/kbn_timerange.mdx b/api_docs/kbn_timerange.mdx index 7b23222baf1ec..f224f46fbe206 100644 --- a/api_docs/kbn_timerange.mdx +++ b/api_docs/kbn_timerange.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-timerange title: "@kbn/timerange" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/timerange plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/timerange'] --- import kbnTimerangeObj from './kbn_timerange.devdocs.json'; diff --git a/api_docs/kbn_tooling_log.mdx b/api_docs/kbn_tooling_log.mdx index 054407736188a..6dbfed98d3042 100644 --- a/api_docs/kbn_tooling_log.mdx +++ b/api_docs/kbn_tooling_log.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-tooling-log title: "@kbn/tooling-log" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/tooling-log plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/tooling-log'] --- import kbnToolingLogObj from './kbn_tooling_log.devdocs.json'; diff --git a/api_docs/kbn_transpose_utils.mdx b/api_docs/kbn_transpose_utils.mdx index 024b3aec35d0d..9d4285b7df573 100644 --- a/api_docs/kbn_transpose_utils.mdx +++ b/api_docs/kbn_transpose_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-transpose-utils title: "@kbn/transpose-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/transpose-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/transpose-utils'] --- import kbnTransposeUtilsObj from './kbn_transpose_utils.devdocs.json'; diff --git a/api_docs/kbn_triggers_actions_ui_types.mdx b/api_docs/kbn_triggers_actions_ui_types.mdx index a1f11328a03d4..6cde720510f60 100644 --- a/api_docs/kbn_triggers_actions_ui_types.mdx +++ b/api_docs/kbn_triggers_actions_ui_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-triggers-actions-ui-types title: "@kbn/triggers-actions-ui-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/triggers-actions-ui-types plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/triggers-actions-ui-types'] --- import kbnTriggersActionsUiTypesObj from './kbn_triggers_actions_ui_types.devdocs.json'; diff --git a/api_docs/kbn_try_in_console.mdx b/api_docs/kbn_try_in_console.mdx index b99475f81492b..d8764e213b9c4 100644 --- a/api_docs/kbn_try_in_console.mdx +++ b/api_docs/kbn_try_in_console.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-try-in-console title: "@kbn/try-in-console" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/try-in-console plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/try-in-console'] --- import kbnTryInConsoleObj from './kbn_try_in_console.devdocs.json'; diff --git a/api_docs/kbn_ts_projects.mdx b/api_docs/kbn_ts_projects.mdx index 4d5beaefe5231..8058784fcddf7 100644 --- a/api_docs/kbn_ts_projects.mdx +++ b/api_docs/kbn_ts_projects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ts-projects title: "@kbn/ts-projects" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ts-projects plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ts-projects'] --- import kbnTsProjectsObj from './kbn_ts_projects.devdocs.json'; diff --git a/api_docs/kbn_typed_react_router_config.mdx b/api_docs/kbn_typed_react_router_config.mdx index 6af6165aa3871..ff8192983980b 100644 --- a/api_docs/kbn_typed_react_router_config.mdx +++ b/api_docs/kbn_typed_react_router_config.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-typed-react-router-config title: "@kbn/typed-react-router-config" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/typed-react-router-config plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/typed-react-router-config'] --- import kbnTypedReactRouterConfigObj from './kbn_typed_react_router_config.devdocs.json'; diff --git a/api_docs/kbn_ui_actions_browser.mdx b/api_docs/kbn_ui_actions_browser.mdx index 141c654b08cf5..64f811f7358ad 100644 --- a/api_docs/kbn_ui_actions_browser.mdx +++ b/api_docs/kbn_ui_actions_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ui-actions-browser title: "@kbn/ui-actions-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ui-actions-browser plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-actions-browser'] --- import kbnUiActionsBrowserObj from './kbn_ui_actions_browser.devdocs.json'; diff --git a/api_docs/kbn_ui_shared_deps_src.mdx b/api_docs/kbn_ui_shared_deps_src.mdx index 2252999cd62d6..9152b328c0f33 100644 --- a/api_docs/kbn_ui_shared_deps_src.mdx +++ b/api_docs/kbn_ui_shared_deps_src.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ui-shared-deps-src title: "@kbn/ui-shared-deps-src" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ui-shared-deps-src plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-shared-deps-src'] --- import kbnUiSharedDepsSrcObj from './kbn_ui_shared_deps_src.devdocs.json'; diff --git a/api_docs/kbn_ui_theme.devdocs.json b/api_docs/kbn_ui_theme.devdocs.json index 79750b38df53b..e4622567f99fb 100644 --- a/api_docs/kbn_ui_theme.devdocs.json +++ b/api_docs/kbn_ui_theme.devdocs.json @@ -99,23 +99,23 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/resolver/view/use_colors.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_colors.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/resolver/view/use_colors.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_colors.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/resolver/view/use_colors.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_colors.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/resolver/view/use_colors.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_colors.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/resolver/view/use_colors.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_colors.ts" } ], "initialIsOpen": false diff --git a/api_docs/kbn_ui_theme.mdx b/api_docs/kbn_ui_theme.mdx index 4d86293f62b7d..89281382725f6 100644 --- a/api_docs/kbn_ui_theme.mdx +++ b/api_docs/kbn_ui_theme.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ui-theme title: "@kbn/ui-theme" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ui-theme plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-theme'] --- import kbnUiThemeObj from './kbn_ui_theme.devdocs.json'; diff --git a/api_docs/kbn_unified_data_table.devdocs.json b/api_docs/kbn_unified_data_table.devdocs.json index e3125eeb4e0b6..24f786f64dcb2 100644 --- a/api_docs/kbn_unified_data_table.devdocs.json +++ b/api_docs/kbn_unified_data_table.devdocs.json @@ -2310,11 +2310,11 @@ "references": [ { "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.tsx" + "path": "x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/index.tsx" } ] }, diff --git a/api_docs/kbn_unified_data_table.mdx b/api_docs/kbn_unified_data_table.mdx index bbb802be0584f..6b9cec4178d5b 100644 --- a/api_docs/kbn_unified_data_table.mdx +++ b/api_docs/kbn_unified_data_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-unified-data-table title: "@kbn/unified-data-table" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/unified-data-table plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unified-data-table'] --- import kbnUnifiedDataTableObj from './kbn_unified_data_table.devdocs.json'; diff --git a/api_docs/kbn_unified_doc_viewer.mdx b/api_docs/kbn_unified_doc_viewer.mdx index 6ad7289ae296c..0c18e457ed8d7 100644 --- a/api_docs/kbn_unified_doc_viewer.mdx +++ b/api_docs/kbn_unified_doc_viewer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-unified-doc-viewer title: "@kbn/unified-doc-viewer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/unified-doc-viewer plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unified-doc-viewer'] --- import kbnUnifiedDocViewerObj from './kbn_unified_doc_viewer.devdocs.json'; diff --git a/api_docs/kbn_unified_field_list.mdx b/api_docs/kbn_unified_field_list.mdx index 5d7470ec828bf..b2e79f38c5acf 100644 --- a/api_docs/kbn_unified_field_list.mdx +++ b/api_docs/kbn_unified_field_list.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-unified-field-list title: "@kbn/unified-field-list" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/unified-field-list plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unified-field-list'] --- import kbnUnifiedFieldListObj from './kbn_unified_field_list.devdocs.json'; diff --git a/api_docs/kbn_unsaved_changes_badge.mdx b/api_docs/kbn_unsaved_changes_badge.mdx index 9190fd0049164..f1a8ae9f08904 100644 --- a/api_docs/kbn_unsaved_changes_badge.mdx +++ b/api_docs/kbn_unsaved_changes_badge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-unsaved-changes-badge title: "@kbn/unsaved-changes-badge" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/unsaved-changes-badge plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unsaved-changes-badge'] --- import kbnUnsavedChangesBadgeObj from './kbn_unsaved_changes_badge.devdocs.json'; diff --git a/api_docs/kbn_unsaved_changes_prompt.mdx b/api_docs/kbn_unsaved_changes_prompt.mdx index 9af7ca095271c..040be34a63c98 100644 --- a/api_docs/kbn_unsaved_changes_prompt.mdx +++ b/api_docs/kbn_unsaved_changes_prompt.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-unsaved-changes-prompt title: "@kbn/unsaved-changes-prompt" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/unsaved-changes-prompt plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unsaved-changes-prompt'] --- import kbnUnsavedChangesPromptObj from './kbn_unsaved_changes_prompt.devdocs.json'; diff --git a/api_docs/kbn_use_tracked_promise.mdx b/api_docs/kbn_use_tracked_promise.mdx index 0caf2531a7f8c..5c9a52b098a92 100644 --- a/api_docs/kbn_use_tracked_promise.mdx +++ b/api_docs/kbn_use_tracked_promise.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-use-tracked-promise title: "@kbn/use-tracked-promise" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/use-tracked-promise plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/use-tracked-promise'] --- import kbnUseTrackedPromiseObj from './kbn_use_tracked_promise.devdocs.json'; diff --git a/api_docs/kbn_user_profile_components.mdx b/api_docs/kbn_user_profile_components.mdx index 94bb87ab7217d..06f8347d0144f 100644 --- a/api_docs/kbn_user_profile_components.mdx +++ b/api_docs/kbn_user_profile_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-user-profile-components title: "@kbn/user-profile-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/user-profile-components plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/user-profile-components'] --- import kbnUserProfileComponentsObj from './kbn_user_profile_components.devdocs.json'; diff --git a/api_docs/kbn_utility_types.mdx b/api_docs/kbn_utility_types.mdx index 633d32e14e866..a90971c9f9692 100644 --- a/api_docs/kbn_utility_types.mdx +++ b/api_docs/kbn_utility_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types title: "@kbn/utility-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utility-types plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types'] --- import kbnUtilityTypesObj from './kbn_utility_types.devdocs.json'; diff --git a/api_docs/kbn_utility_types_jest.mdx b/api_docs/kbn_utility_types_jest.mdx index 6a0a9ecd634d0..a1f88a8cab9eb 100644 --- a/api_docs/kbn_utility_types_jest.mdx +++ b/api_docs/kbn_utility_types_jest.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utility-types-jest title: "@kbn/utility-types-jest" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utility-types-jest plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types-jest'] --- import kbnUtilityTypesJestObj from './kbn_utility_types_jest.devdocs.json'; diff --git a/api_docs/kbn_utils.mdx b/api_docs/kbn_utils.mdx index 283413d8a6278..7f60427e7d2f2 100644 --- a/api_docs/kbn_utils.mdx +++ b/api_docs/kbn_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-utils title: "@kbn/utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utils'] --- import kbnUtilsObj from './kbn_utils.devdocs.json'; diff --git a/api_docs/kbn_visualization_ui_components.mdx b/api_docs/kbn_visualization_ui_components.mdx index 04e743bf4b1eb..bde9ea21c85d0 100644 --- a/api_docs/kbn_visualization_ui_components.mdx +++ b/api_docs/kbn_visualization_ui_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-visualization-ui-components title: "@kbn/visualization-ui-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/visualization-ui-components plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/visualization-ui-components'] --- import kbnVisualizationUiComponentsObj from './kbn_visualization_ui_components.devdocs.json'; diff --git a/api_docs/kbn_visualization_utils.mdx b/api_docs/kbn_visualization_utils.mdx index 4c3fe23b27115..dcd78c3d4d6cd 100644 --- a/api_docs/kbn_visualization_utils.mdx +++ b/api_docs/kbn_visualization_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-visualization-utils title: "@kbn/visualization-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/visualization-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/visualization-utils'] --- import kbnVisualizationUtilsObj from './kbn_visualization_utils.devdocs.json'; diff --git a/api_docs/kbn_xstate_utils.mdx b/api_docs/kbn_xstate_utils.mdx index d589fb2be72ef..3d86ee471cab4 100644 --- a/api_docs/kbn_xstate_utils.mdx +++ b/api_docs/kbn_xstate_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-xstate-utils title: "@kbn/xstate-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/xstate-utils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/xstate-utils'] --- import kbnXstateUtilsObj from './kbn_xstate_utils.devdocs.json'; diff --git a/api_docs/kbn_yarn_lock_validator.mdx b/api_docs/kbn_yarn_lock_validator.mdx index b8751cff4e22c..f25850327324e 100644 --- a/api_docs/kbn_yarn_lock_validator.mdx +++ b/api_docs/kbn_yarn_lock_validator.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-yarn-lock-validator title: "@kbn/yarn-lock-validator" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/yarn-lock-validator plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/yarn-lock-validator'] --- import kbnYarnLockValidatorObj from './kbn_yarn_lock_validator.devdocs.json'; diff --git a/api_docs/kbn_zod.mdx b/api_docs/kbn_zod.mdx index 3681a10faa293..41fac44b0d59b 100644 --- a/api_docs/kbn_zod.mdx +++ b/api_docs/kbn_zod.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-zod title: "@kbn/zod" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/zod plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/zod'] --- import kbnZodObj from './kbn_zod.devdocs.json'; diff --git a/api_docs/kbn_zod_helpers.mdx b/api_docs/kbn_zod_helpers.mdx index 1dd61a82216c8..4f10d56aaafbe 100644 --- a/api_docs/kbn_zod_helpers.mdx +++ b/api_docs/kbn_zod_helpers.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-zod-helpers title: "@kbn/zod-helpers" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/zod-helpers plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/zod-helpers'] --- import kbnZodHelpersObj from './kbn_zod_helpers.devdocs.json'; diff --git a/api_docs/kibana_overview.mdx b/api_docs/kibana_overview.mdx index 1f89b7a33c876..c86431c37f4d6 100644 --- a/api_docs/kibana_overview.mdx +++ b/api_docs/kibana_overview.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaOverview title: "kibanaOverview" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaOverview plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaOverview'] --- import kibanaOverviewObj from './kibana_overview.devdocs.json'; diff --git a/api_docs/kibana_react.mdx b/api_docs/kibana_react.mdx index 1cf67f72ed9c3..16a0d78085d34 100644 --- a/api_docs/kibana_react.mdx +++ b/api_docs/kibana_react.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaReact title: "kibanaReact" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaReact plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaReact'] --- import kibanaReactObj from './kibana_react.devdocs.json'; diff --git a/api_docs/kibana_utils.mdx b/api_docs/kibana_utils.mdx index e6930c8b68523..153aa9684161d 100644 --- a/api_docs/kibana_utils.mdx +++ b/api_docs/kibana_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kibanaUtils title: "kibanaUtils" image: https://source.unsplash.com/400x175/?github description: API docs for the kibanaUtils plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaUtils'] --- import kibanaUtilsObj from './kibana_utils.devdocs.json'; diff --git a/api_docs/kubernetes_security.devdocs.json b/api_docs/kubernetes_security.devdocs.json index 6be2f6084e66f..c075e2c35e797 100644 --- a/api_docs/kubernetes_security.devdocs.json +++ b/api_docs/kubernetes_security.devdocs.json @@ -11,7 +11,7 @@ "tags": [], "label": "KubernetesSecurityStart", "description": [], - "path": "x-pack/plugins/kubernetes_security/public/types.ts", + "path": "x-pack/solutions/security/plugins/kubernetes_security/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -27,7 +27,7 @@ "KubernetesSecurityDeps", ") => JSX.Element" ], - "path": "x-pack/plugins/kubernetes_security/public/types.ts", + "path": "x-pack/solutions/security/plugins/kubernetes_security/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -41,7 +41,7 @@ "signature": [ "KubernetesSecurityDeps" ], - "path": "x-pack/plugins/kubernetes_security/public/types.ts", + "path": "x-pack/solutions/security/plugins/kubernetes_security/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -65,7 +65,7 @@ "signature": [ "\"/kubernetes\"" ], - "path": "x-pack/plugins/kubernetes_security/common/constants.ts", + "path": "x-pack/solutions/security/plugins/kubernetes_security/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -80,7 +80,7 @@ "signature": [ "\"Kubernetes\"" ], - "path": "x-pack/plugins/kubernetes_security/common/constants.ts", + "path": "x-pack/solutions/security/plugins/kubernetes_security/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kubernetes_security.mdx b/api_docs/kubernetes_security.mdx index 50a1baa109eea..b6a90c23048d6 100644 --- a/api_docs/kubernetes_security.mdx +++ b/api_docs/kubernetes_security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kubernetesSecurity title: "kubernetesSecurity" image: https://source.unsplash.com/400x175/?github description: API docs for the kubernetesSecurity plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kubernetesSecurity'] --- import kubernetesSecurityObj from './kubernetes_security.devdocs.json'; diff --git a/api_docs/lens.mdx b/api_docs/lens.mdx index 7935c20b65dd2..e8b1d8f77f5d5 100644 --- a/api_docs/lens.mdx +++ b/api_docs/lens.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/lens title: "lens" image: https://source.unsplash.com/400x175/?github description: API docs for the lens plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lens'] --- import lensObj from './lens.devdocs.json'; diff --git a/api_docs/license_api_guard.mdx b/api_docs/license_api_guard.mdx index 62b4f61b27a40..75d9fa274d294 100644 --- a/api_docs/license_api_guard.mdx +++ b/api_docs/license_api_guard.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licenseApiGuard title: "licenseApiGuard" image: https://source.unsplash.com/400x175/?github description: API docs for the licenseApiGuard plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseApiGuard'] --- import licenseApiGuardObj from './license_api_guard.devdocs.json'; diff --git a/api_docs/license_management.mdx b/api_docs/license_management.mdx index ba35ce535e942..871b80458cedc 100644 --- a/api_docs/license_management.mdx +++ b/api_docs/license_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licenseManagement title: "licenseManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the licenseManagement plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licenseManagement'] --- import licenseManagementObj from './license_management.devdocs.json'; diff --git a/api_docs/licensing.devdocs.json b/api_docs/licensing.devdocs.json index 1fb7433e760d1..f738e3bba61ea 100644 --- a/api_docs/licensing.devdocs.json +++ b/api_docs/licensing.devdocs.json @@ -572,71 +572,71 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/license/policy_config.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/common/license/policy_config.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/license/policy_config.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/common/license/policy_config.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/license/policy_config.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/common/license/policy_config.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/list.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/list.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/list.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/list.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/list.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/list.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts" } ] } @@ -824,7 +824,7 @@ }, { "plugin": "slo", - "path": "x-pack/plugins/observability_solution/slo/public/plugin.ts" + "path": "x-pack/solutions/observability/plugins/slo/public/plugin.ts" }, { "plugin": "crossClusterReplication", @@ -1893,71 +1893,71 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/license/policy_config.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/common/license/policy_config.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/license/policy_config.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/common/license/policy_config.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/license/policy_config.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/common/license/policy_config.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/list.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/list.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/list.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/list.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/list.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/list.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts" } ] } @@ -2202,26 +2202,6 @@ "plugin": "graph", "path": "x-pack/plugins/graph/server/plugin.ts" }, - { - "plugin": "osquery", - "path": "x-pack/platform/plugins/shared/osquery/server/handlers/action/create_action_service.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/create_threat_signals.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/query.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/threshold.ts" - }, { "plugin": "upgradeAssistant", "path": "x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts" @@ -2238,18 +2218,6 @@ "plugin": "upgradeAssistant", "path": "x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts" - }, { "plugin": "remoteClusters", "path": "x-pack/platform/plugins/private/remote_clusters/server/plugin.ts" @@ -2278,10 +2246,42 @@ "plugin": "aiops", "path": "x-pack/platform/plugins/shared/aiops/server/plugin.ts" }, + { + "plugin": "osquery", + "path": "x-pack/platform/plugins/shared/osquery/server/handlers/action/create_action_service.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/create_threat_signals.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/query.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/threshold.ts" + }, { "plugin": "searchprofiler", "path": "x-pack/platform/plugins/shared/searchprofiler/server/plugin.ts" }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts" + }, { "plugin": "actions", "path": "x-pack/plugins/actions/server/lib/license_state.test.ts" diff --git a/api_docs/licensing.mdx b/api_docs/licensing.mdx index e102408a81e23..66ae13dd20f2f 100644 --- a/api_docs/licensing.mdx +++ b/api_docs/licensing.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/licensing title: "licensing" image: https://source.unsplash.com/400x175/?github description: API docs for the licensing plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'licensing'] --- import licensingObj from './licensing.devdocs.json'; diff --git a/api_docs/links.mdx b/api_docs/links.mdx index 348ff1b4bd963..beb2a81d55ab9 100644 --- a/api_docs/links.mdx +++ b/api_docs/links.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/links title: "links" image: https://source.unsplash.com/400x175/?github description: API docs for the links plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'links'] --- import linksObj from './links.devdocs.json'; diff --git a/api_docs/lists.mdx b/api_docs/lists.mdx index c27b5fad11b6b..55c4c976f2b9a 100644 --- a/api_docs/lists.mdx +++ b/api_docs/lists.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/lists title: "lists" image: https://source.unsplash.com/400x175/?github description: API docs for the lists plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lists'] --- import listsObj from './lists.devdocs.json'; diff --git a/api_docs/llm_tasks.mdx b/api_docs/llm_tasks.mdx index 2ff111498a050..591a3dc4f0029 100644 --- a/api_docs/llm_tasks.mdx +++ b/api_docs/llm_tasks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/llmTasks title: "llmTasks" image: https://source.unsplash.com/400x175/?github description: API docs for the llmTasks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'llmTasks'] --- import llmTasksObj from './llm_tasks.devdocs.json'; diff --git a/api_docs/logs_data_access.mdx b/api_docs/logs_data_access.mdx index 3c9726b4ed719..c3975238dba69 100644 --- a/api_docs/logs_data_access.mdx +++ b/api_docs/logs_data_access.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/logsDataAccess title: "logsDataAccess" image: https://source.unsplash.com/400x175/?github description: API docs for the logsDataAccess plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'logsDataAccess'] --- import logsDataAccessObj from './logs_data_access.devdocs.json'; diff --git a/api_docs/logs_explorer.mdx b/api_docs/logs_explorer.mdx index 9b7f8011eb4cd..5ff8148405543 100644 --- a/api_docs/logs_explorer.mdx +++ b/api_docs/logs_explorer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/logsExplorer title: "logsExplorer" image: https://source.unsplash.com/400x175/?github description: API docs for the logsExplorer plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'logsExplorer'] --- import logsExplorerObj from './logs_explorer.devdocs.json'; diff --git a/api_docs/logs_shared.mdx b/api_docs/logs_shared.mdx index a5af3b84fbb62..483b69219b5cc 100644 --- a/api_docs/logs_shared.mdx +++ b/api_docs/logs_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/logsShared title: "logsShared" image: https://source.unsplash.com/400x175/?github description: API docs for the logsShared plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'logsShared'] --- import logsSharedObj from './logs_shared.devdocs.json'; diff --git a/api_docs/management.mdx b/api_docs/management.mdx index b0899d197fed3..84da16af56c12 100644 --- a/api_docs/management.mdx +++ b/api_docs/management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/management title: "management" image: https://source.unsplash.com/400x175/?github description: API docs for the management plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'management'] --- import managementObj from './management.devdocs.json'; diff --git a/api_docs/maps.mdx b/api_docs/maps.mdx index 144186fedcb1a..710d7517512fb 100644 --- a/api_docs/maps.mdx +++ b/api_docs/maps.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/maps title: "maps" image: https://source.unsplash.com/400x175/?github description: API docs for the maps plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'maps'] --- import mapsObj from './maps.devdocs.json'; diff --git a/api_docs/maps_ems.mdx b/api_docs/maps_ems.mdx index 9b2154c9d3e77..9ce2ceb9ea9c4 100644 --- a/api_docs/maps_ems.mdx +++ b/api_docs/maps_ems.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/mapsEms title: "mapsEms" image: https://source.unsplash.com/400x175/?github description: API docs for the mapsEms plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mapsEms'] --- import mapsEmsObj from './maps_ems.devdocs.json'; diff --git a/api_docs/metrics_data_access.mdx b/api_docs/metrics_data_access.mdx index ce340a6105193..49004fa283782 100644 --- a/api_docs/metrics_data_access.mdx +++ b/api_docs/metrics_data_access.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/metricsDataAccess title: "metricsDataAccess" image: https://source.unsplash.com/400x175/?github description: API docs for the metricsDataAccess plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'metricsDataAccess'] --- import metricsDataAccessObj from './metrics_data_access.devdocs.json'; diff --git a/api_docs/ml.mdx b/api_docs/ml.mdx index 8278f8f541021..88b6d0e13eac8 100644 --- a/api_docs/ml.mdx +++ b/api_docs/ml.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ml title: "ml" image: https://source.unsplash.com/400x175/?github description: API docs for the ml plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ml'] --- import mlObj from './ml.devdocs.json'; diff --git a/api_docs/mock_idp_plugin.mdx b/api_docs/mock_idp_plugin.mdx index 4f25d69c85df2..a636c60f3417e 100644 --- a/api_docs/mock_idp_plugin.mdx +++ b/api_docs/mock_idp_plugin.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/mockIdpPlugin title: "mockIdpPlugin" image: https://source.unsplash.com/400x175/?github description: API docs for the mockIdpPlugin plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mockIdpPlugin'] --- import mockIdpPluginObj from './mock_idp_plugin.devdocs.json'; diff --git a/api_docs/monitoring.mdx b/api_docs/monitoring.mdx index 77f6cdf310176..d08dc0ee8e112 100644 --- a/api_docs/monitoring.mdx +++ b/api_docs/monitoring.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/monitoring title: "monitoring" image: https://source.unsplash.com/400x175/?github description: API docs for the monitoring plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoring'] --- import monitoringObj from './monitoring.devdocs.json'; diff --git a/api_docs/monitoring_collection.mdx b/api_docs/monitoring_collection.mdx index a0a61a592f8a5..c76b7c0535b17 100644 --- a/api_docs/monitoring_collection.mdx +++ b/api_docs/monitoring_collection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/monitoringCollection title: "monitoringCollection" image: https://source.unsplash.com/400x175/?github description: API docs for the monitoringCollection plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'monitoringCollection'] --- import monitoringCollectionObj from './monitoring_collection.devdocs.json'; diff --git a/api_docs/navigation.mdx b/api_docs/navigation.mdx index e3f58a743a8f7..7ca45c650ddb2 100644 --- a/api_docs/navigation.mdx +++ b/api_docs/navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/navigation title: "navigation" image: https://source.unsplash.com/400x175/?github description: API docs for the navigation plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'navigation'] --- import navigationObj from './navigation.devdocs.json'; diff --git a/api_docs/newsfeed.mdx b/api_docs/newsfeed.mdx index e7014717b9ed0..1ddd0ecf2e37c 100644 --- a/api_docs/newsfeed.mdx +++ b/api_docs/newsfeed.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/newsfeed title: "newsfeed" image: https://source.unsplash.com/400x175/?github description: API docs for the newsfeed plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'newsfeed'] --- import newsfeedObj from './newsfeed.devdocs.json'; diff --git a/api_docs/no_data_page.mdx b/api_docs/no_data_page.mdx index 3be5517d2b777..c38287264d41f 100644 --- a/api_docs/no_data_page.mdx +++ b/api_docs/no_data_page.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/noDataPage title: "noDataPage" image: https://source.unsplash.com/400x175/?github description: API docs for the noDataPage plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'noDataPage'] --- import noDataPageObj from './no_data_page.devdocs.json'; diff --git a/api_docs/notifications.mdx b/api_docs/notifications.mdx index 46bfe1234d89e..8e1a3be5a0e9e 100644 --- a/api_docs/notifications.mdx +++ b/api_docs/notifications.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/notifications title: "notifications" image: https://source.unsplash.com/400x175/?github description: API docs for the notifications plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'notifications'] --- import notificationsObj from './notifications.devdocs.json'; diff --git a/api_docs/observability.mdx b/api_docs/observability.mdx index d4a9502af5586..4da8aa24a8b86 100644 --- a/api_docs/observability.mdx +++ b/api_docs/observability.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observability title: "observability" image: https://source.unsplash.com/400x175/?github description: API docs for the observability plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observability'] --- import observabilityObj from './observability.devdocs.json'; diff --git a/api_docs/observability_a_i_assistant.devdocs.json b/api_docs/observability_a_i_assistant.devdocs.json index 45d008746b3c3..5a2aff04231f0 100644 --- a/api_docs/observability_a_i_assistant.devdocs.json +++ b/api_docs/observability_a_i_assistant.devdocs.json @@ -147,26 +147,6 @@ { "plugin": "observabilityAIAssistantApp", "path": "x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_callout/index.tsx" - }, - { - "plugin": "observabilityAIAssistantApp", - "path": "x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/rule_connector/ai_assistant.tsx" - }, - { - "plugin": "observabilityAIAssistantApp", - "path": "x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/rule_connector/ai_assistant.tsx" - }, - { - "plugin": "observabilityAIAssistantApp", - "path": "x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/nav_control/index.tsx" - }, - { - "plugin": "observabilityAIAssistantApp", - "path": "x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/nav_control/index.tsx" - }, - { - "plugin": "observabilityAIAssistantApp", - "path": "x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/nav_control/index.tsx" } ], "children": [ diff --git a/api_docs/observability_a_i_assistant.mdx b/api_docs/observability_a_i_assistant.mdx index 4c2129c96ae59..f7dd0abb22396 100644 --- a/api_docs/observability_a_i_assistant.mdx +++ b/api_docs/observability_a_i_assistant.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityAIAssistant title: "observabilityAIAssistant" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityAIAssistant plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityAIAssistant'] --- import observabilityAIAssistantObj from './observability_a_i_assistant.devdocs.json'; diff --git a/api_docs/observability_a_i_assistant_app.mdx b/api_docs/observability_a_i_assistant_app.mdx index c981f2af1fb96..918376893a8ae 100644 --- a/api_docs/observability_a_i_assistant_app.mdx +++ b/api_docs/observability_a_i_assistant_app.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityAIAssistantApp title: "observabilityAIAssistantApp" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityAIAssistantApp plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityAIAssistantApp'] --- import observabilityAIAssistantAppObj from './observability_a_i_assistant_app.devdocs.json'; diff --git a/api_docs/observability_ai_assistant_management.mdx b/api_docs/observability_ai_assistant_management.mdx index b1912076c5a86..87a37dec963b2 100644 --- a/api_docs/observability_ai_assistant_management.mdx +++ b/api_docs/observability_ai_assistant_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityAiAssistantManagement title: "observabilityAiAssistantManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityAiAssistantManagement plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityAiAssistantManagement'] --- import observabilityAiAssistantManagementObj from './observability_ai_assistant_management.devdocs.json'; diff --git a/api_docs/observability_logs_explorer.mdx b/api_docs/observability_logs_explorer.mdx index a66ec551c2131..1d0833fe9b41f 100644 --- a/api_docs/observability_logs_explorer.mdx +++ b/api_docs/observability_logs_explorer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityLogsExplorer title: "observabilityLogsExplorer" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityLogsExplorer plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityLogsExplorer'] --- import observabilityLogsExplorerObj from './observability_logs_explorer.devdocs.json'; diff --git a/api_docs/observability_onboarding.mdx b/api_docs/observability_onboarding.mdx index cf4a707677dc4..c0e505928843d 100644 --- a/api_docs/observability_onboarding.mdx +++ b/api_docs/observability_onboarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityOnboarding title: "observabilityOnboarding" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityOnboarding plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityOnboarding'] --- import observabilityOnboardingObj from './observability_onboarding.devdocs.json'; diff --git a/api_docs/observability_shared.mdx b/api_docs/observability_shared.mdx index 12467466dd840..e65df2edcfc46 100644 --- a/api_docs/observability_shared.mdx +++ b/api_docs/observability_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/observabilityShared title: "observabilityShared" image: https://source.unsplash.com/400x175/?github description: API docs for the observabilityShared plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityShared'] --- import observabilitySharedObj from './observability_shared.devdocs.json'; diff --git a/api_docs/osquery.mdx b/api_docs/osquery.mdx index 521f7b64624a0..91b81bd03c14d 100644 --- a/api_docs/osquery.mdx +++ b/api_docs/osquery.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/osquery title: "osquery" image: https://source.unsplash.com/400x175/?github description: API docs for the osquery plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'osquery'] --- import osqueryObj from './osquery.devdocs.json'; diff --git a/api_docs/painless_lab.mdx b/api_docs/painless_lab.mdx index 9b527e74808be..bf06fb07d1314 100644 --- a/api_docs/painless_lab.mdx +++ b/api_docs/painless_lab.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/painlessLab title: "painlessLab" image: https://source.unsplash.com/400x175/?github description: API docs for the painlessLab plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'painlessLab'] --- import painlessLabObj from './painless_lab.devdocs.json'; diff --git a/api_docs/plugin_directory.mdx b/api_docs/plugin_directory.mdx index 25883101e839b..9b279a3527aba 100644 --- a/api_docs/plugin_directory.mdx +++ b/api_docs/plugin_directory.mdx @@ -7,7 +7,7 @@ id: kibDevDocsPluginDirectory slug: /kibana-dev-docs/api-meta/plugin-api-directory title: Directory description: Directory of public APIs available through plugins or packages. -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -15,13 +15,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Count | Plugins or Packages with a
public API | Number of teams | |--------------|----------|------------------------| -| 906 | 771 | 43 | +| 907 | 771 | 43 | ### Public API health stats | API Count | Any Count | Missing comments | Missing exports | |--------------|----------|-----------------|--------| -| 55156 | 243 | 41481 | 2033 | +| 55051 | 243 | 41372 | 2032 | ## Plugin Directory @@ -71,7 +71,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | A stateful layer to register shared features and provide an access point to discover without a direct dependency | 26 | 0 | 23 | 2 | | | [@elastic/security-threat-hunting-explore](https://github.com/orgs/elastic/teams/security-threat-hunting-explore) | APIs used to assess the quality of data in Elasticsearch indexes | 2 | 0 | 0 | 0 | | | [@elastic/security-generative-ai](https://github.com/orgs/elastic/teams/security-generative-ai) | Server APIs for the Elastic AI Assistant | 55 | 0 | 40 | 2 | -| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds embeddables service to Kibana | 537 | 1 | 433 | 6 | +| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds embeddables service to Kibana | 424 | 1 | 338 | 5 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Extends embeddable plugin with more functionality | 15 | 0 | 15 | 2 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides encryption and decryption utilities for saved objects containing sensitive information. | 54 | 0 | 47 | 1 | | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | Adds dashboards for discovering and managing Enterprise Search products. | 5 | 0 | 5 | 0 | @@ -242,7 +242,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Registers the vega visualization. Is the elastic version of vega and vega-lite libraries. | 2 | 0 | 2 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Contains the vislib visualizations. These are the classical area/line/bar, gauge/goal and heatmap charts. We want to replace them with elastic-charts. | 1 | 0 | 1 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Contains the new xy-axis chart using the elastic-charts library, which will eventually replace the vislib xy-axis charts including bar, area, and line. | 52 | 0 | 50 | 5 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Contains the shared architecture among all the legacy visualizations, e.g. the visualization type registry or the visualization embeddable. | 871 | 12 | 840 | 21 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Contains the shared architecture among all the legacy visualizations, e.g. the visualization type registry or the visualization embeddable. | 869 | 12 | 838 | 21 | | watcher | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 0 | 0 | 0 | 0 | ## Package Directory @@ -342,8 +342,8 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 6 | 0 | 6 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 4 | 0 | 4 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 23 | 0 | 15 | 0 | -| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 16 | 0 | 13 | 0 | -| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 4 | 0 | 3 | 0 | +| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 17 | 0 | 1 | 0 | +| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 5 | 0 | 1 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 6 | 0 | 6 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 4 | 0 | 4 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 4 | 0 | 4 | 0 | @@ -432,7 +432,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 4 | 0 | 4 | 1 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 13 | 1 | 12 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 113 | 1 | 0 | 0 | -| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 357 | 1 | 5 | 2 | +| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 361 | 1 | 5 | 2 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 11 | 0 | 11 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 226 | 0 | 183 | 11 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 5 | 0 | 5 | 0 | @@ -444,7 +444,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 4 | 0 | 4 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 128 | 0 | 94 | 44 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 12 | 0 | 12 | 0 | -| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 564 | 1 | 134 | 4 | +| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 566 | 1 | 134 | 4 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 75 | 0 | 74 | 5 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 14 | 0 | 14 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 36 | 0 | 6 | 0 | @@ -530,7 +530,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 271 | 1 | 210 | 14 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 31 | 0 | 31 | 1 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 2 | 0 | 1 | 0 | -| | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 285 | 1 | 223 | 25 | +| | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 287 | 1 | 225 | 25 | | | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 29 | 0 | 12 | 0 | | | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 83 | 0 | 74 | 0 | | | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 205 | 0 | 193 | 12 | diff --git a/api_docs/presentation_panel.mdx b/api_docs/presentation_panel.mdx index d6300ed4b6000..19af531f21eb7 100644 --- a/api_docs/presentation_panel.mdx +++ b/api_docs/presentation_panel.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/presentationPanel title: "presentationPanel" image: https://source.unsplash.com/400x175/?github description: API docs for the presentationPanel plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'presentationPanel'] --- import presentationPanelObj from './presentation_panel.devdocs.json'; diff --git a/api_docs/presentation_util.mdx b/api_docs/presentation_util.mdx index aaf113c709baa..dd1b157130b81 100644 --- a/api_docs/presentation_util.mdx +++ b/api_docs/presentation_util.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/presentationUtil title: "presentationUtil" image: https://source.unsplash.com/400x175/?github description: API docs for the presentationUtil plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'presentationUtil'] --- import presentationUtilObj from './presentation_util.devdocs.json'; diff --git a/api_docs/product_doc_base.mdx b/api_docs/product_doc_base.mdx index 6ff641728731b..406dacbd4bfa6 100644 --- a/api_docs/product_doc_base.mdx +++ b/api_docs/product_doc_base.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/productDocBase title: "productDocBase" image: https://source.unsplash.com/400x175/?github description: API docs for the productDocBase plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'productDocBase'] --- import productDocBaseObj from './product_doc_base.devdocs.json'; diff --git a/api_docs/profiling.mdx b/api_docs/profiling.mdx index 4d70e2c77feb1..4b2eb4a48ac9d 100644 --- a/api_docs/profiling.mdx +++ b/api_docs/profiling.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/profiling title: "profiling" image: https://source.unsplash.com/400x175/?github description: API docs for the profiling plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'profiling'] --- import profilingObj from './profiling.devdocs.json'; diff --git a/api_docs/profiling_data_access.mdx b/api_docs/profiling_data_access.mdx index 4669f80844043..fd6fb3f5fac81 100644 --- a/api_docs/profiling_data_access.mdx +++ b/api_docs/profiling_data_access.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/profilingDataAccess title: "profilingDataAccess" image: https://source.unsplash.com/400x175/?github description: API docs for the profilingDataAccess plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'profilingDataAccess'] --- import profilingDataAccessObj from './profiling_data_access.devdocs.json'; diff --git a/api_docs/remote_clusters.mdx b/api_docs/remote_clusters.mdx index 3be39556df49a..b4a2c8f50c5fd 100644 --- a/api_docs/remote_clusters.mdx +++ b/api_docs/remote_clusters.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/remoteClusters title: "remoteClusters" image: https://source.unsplash.com/400x175/?github description: API docs for the remoteClusters plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'remoteClusters'] --- import remoteClustersObj from './remote_clusters.devdocs.json'; diff --git a/api_docs/reporting.mdx b/api_docs/reporting.mdx index 72e787f70926c..423048ed92f9b 100644 --- a/api_docs/reporting.mdx +++ b/api_docs/reporting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/reporting title: "reporting" image: https://source.unsplash.com/400x175/?github description: API docs for the reporting plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'reporting'] --- import reportingObj from './reporting.devdocs.json'; diff --git a/api_docs/rollup.mdx b/api_docs/rollup.mdx index 80045c01b7c66..1d0652be22554 100644 --- a/api_docs/rollup.mdx +++ b/api_docs/rollup.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/rollup title: "rollup" image: https://source.unsplash.com/400x175/?github description: API docs for the rollup plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'rollup'] --- import rollupObj from './rollup.devdocs.json'; diff --git a/api_docs/rule_registry.mdx b/api_docs/rule_registry.mdx index 300cb7940bbc8..c32e479db696d 100644 --- a/api_docs/rule_registry.mdx +++ b/api_docs/rule_registry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ruleRegistry title: "ruleRegistry" image: https://source.unsplash.com/400x175/?github description: API docs for the ruleRegistry plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ruleRegistry'] --- import ruleRegistryObj from './rule_registry.devdocs.json'; diff --git a/api_docs/runtime_fields.mdx b/api_docs/runtime_fields.mdx index 7af31e261ccf4..a35362c90cfb3 100644 --- a/api_docs/runtime_fields.mdx +++ b/api_docs/runtime_fields.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/runtimeFields title: "runtimeFields" image: https://source.unsplash.com/400x175/?github description: API docs for the runtimeFields plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'runtimeFields'] --- import runtimeFieldsObj from './runtime_fields.devdocs.json'; diff --git a/api_docs/saved_objects.mdx b/api_docs/saved_objects.mdx index 981b5d8caa348..085a5db4fe1af 100644 --- a/api_docs/saved_objects.mdx +++ b/api_docs/saved_objects.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjects title: "savedObjects" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjects plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjects'] --- import savedObjectsObj from './saved_objects.devdocs.json'; diff --git a/api_docs/saved_objects_finder.devdocs.json b/api_docs/saved_objects_finder.devdocs.json index c6104240fef8c..940faea8dee89 100644 --- a/api_docs/saved_objects_finder.devdocs.json +++ b/api_docs/saved_objects_finder.devdocs.json @@ -449,10 +449,6 @@ "plugin": "visualizations", "path": "src/plugins/visualizations/public/wizard/search_selection/search_selection.tsx" }, - { - "plugin": "visualizations", - "path": "src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable_factory.tsx" - }, { "plugin": "graph", "path": "x-pack/plugins/graph/public/components/source_picker.tsx" diff --git a/api_docs/saved_objects_finder.mdx b/api_docs/saved_objects_finder.mdx index 19561c77187c1..dc5373fbf275c 100644 --- a/api_docs/saved_objects_finder.mdx +++ b/api_docs/saved_objects_finder.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsFinder title: "savedObjectsFinder" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsFinder plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsFinder'] --- import savedObjectsFinderObj from './saved_objects_finder.devdocs.json'; diff --git a/api_docs/saved_objects_management.mdx b/api_docs/saved_objects_management.mdx index 09a0bcdc0e4de..4a67b96236b2e 100644 --- a/api_docs/saved_objects_management.mdx +++ b/api_docs/saved_objects_management.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsManagement title: "savedObjectsManagement" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsManagement plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsManagement'] --- import savedObjectsManagementObj from './saved_objects_management.devdocs.json'; diff --git a/api_docs/saved_objects_tagging.mdx b/api_docs/saved_objects_tagging.mdx index 361e86c49e7ad..97d06ca2377cd 100644 --- a/api_docs/saved_objects_tagging.mdx +++ b/api_docs/saved_objects_tagging.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsTagging title: "savedObjectsTagging" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsTagging plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTagging'] --- import savedObjectsTaggingObj from './saved_objects_tagging.devdocs.json'; diff --git a/api_docs/saved_objects_tagging_oss.mdx b/api_docs/saved_objects_tagging_oss.mdx index fe26dbf95eb04..b8ff6660d5973 100644 --- a/api_docs/saved_objects_tagging_oss.mdx +++ b/api_docs/saved_objects_tagging_oss.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedObjectsTaggingOss title: "savedObjectsTaggingOss" image: https://source.unsplash.com/400x175/?github description: API docs for the savedObjectsTaggingOss plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTaggingOss'] --- import savedObjectsTaggingOssObj from './saved_objects_tagging_oss.devdocs.json'; diff --git a/api_docs/saved_search.mdx b/api_docs/saved_search.mdx index 7d8addf04867c..b1345cf274787 100644 --- a/api_docs/saved_search.mdx +++ b/api_docs/saved_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/savedSearch title: "savedSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the savedSearch plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedSearch'] --- import savedSearchObj from './saved_search.devdocs.json'; diff --git a/api_docs/screenshot_mode.mdx b/api_docs/screenshot_mode.mdx index 67f7e2bbd0100..21ab80b86ac78 100644 --- a/api_docs/screenshot_mode.mdx +++ b/api_docs/screenshot_mode.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/screenshotMode title: "screenshotMode" image: https://source.unsplash.com/400x175/?github description: API docs for the screenshotMode plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotMode'] --- import screenshotModeObj from './screenshot_mode.devdocs.json'; diff --git a/api_docs/screenshotting.mdx b/api_docs/screenshotting.mdx index 511d05380d743..ed89df609e03e 100644 --- a/api_docs/screenshotting.mdx +++ b/api_docs/screenshotting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/screenshotting title: "screenshotting" image: https://source.unsplash.com/400x175/?github description: API docs for the screenshotting plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotting'] --- import screenshottingObj from './screenshotting.devdocs.json'; diff --git a/api_docs/search_assistant.mdx b/api_docs/search_assistant.mdx index a5d8ce173b089..3781137be4039 100644 --- a/api_docs/search_assistant.mdx +++ b/api_docs/search_assistant.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchAssistant title: "searchAssistant" image: https://source.unsplash.com/400x175/?github description: API docs for the searchAssistant plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchAssistant'] --- import searchAssistantObj from './search_assistant.devdocs.json'; diff --git a/api_docs/search_connectors.mdx b/api_docs/search_connectors.mdx index fadf5396a9e82..94b3d67879900 100644 --- a/api_docs/search_connectors.mdx +++ b/api_docs/search_connectors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchConnectors title: "searchConnectors" image: https://source.unsplash.com/400x175/?github description: API docs for the searchConnectors plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchConnectors'] --- import searchConnectorsObj from './search_connectors.devdocs.json'; diff --git a/api_docs/search_homepage.mdx b/api_docs/search_homepage.mdx index 0d256e4bac8a4..377154950a7cc 100644 --- a/api_docs/search_homepage.mdx +++ b/api_docs/search_homepage.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchHomepage title: "searchHomepage" image: https://source.unsplash.com/400x175/?github description: API docs for the searchHomepage plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchHomepage'] --- import searchHomepageObj from './search_homepage.devdocs.json'; diff --git a/api_docs/search_indices.mdx b/api_docs/search_indices.mdx index 1077e5524771b..4912a21b41655 100644 --- a/api_docs/search_indices.mdx +++ b/api_docs/search_indices.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchIndices title: "searchIndices" image: https://source.unsplash.com/400x175/?github description: API docs for the searchIndices plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchIndices'] --- import searchIndicesObj from './search_indices.devdocs.json'; diff --git a/api_docs/search_inference_endpoints.mdx b/api_docs/search_inference_endpoints.mdx index 9b10a8ed0f8b9..7fcea62e7ba33 100644 --- a/api_docs/search_inference_endpoints.mdx +++ b/api_docs/search_inference_endpoints.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchInferenceEndpoints title: "searchInferenceEndpoints" image: https://source.unsplash.com/400x175/?github description: API docs for the searchInferenceEndpoints plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchInferenceEndpoints'] --- import searchInferenceEndpointsObj from './search_inference_endpoints.devdocs.json'; diff --git a/api_docs/search_navigation.mdx b/api_docs/search_navigation.mdx index c691317608d48..ad51c0a47a8e5 100644 --- a/api_docs/search_navigation.mdx +++ b/api_docs/search_navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchNavigation title: "searchNavigation" image: https://source.unsplash.com/400x175/?github description: API docs for the searchNavigation plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchNavigation'] --- import searchNavigationObj from './search_navigation.devdocs.json'; diff --git a/api_docs/search_notebooks.mdx b/api_docs/search_notebooks.mdx index 77b9529b3507f..78047262323e3 100644 --- a/api_docs/search_notebooks.mdx +++ b/api_docs/search_notebooks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchNotebooks title: "searchNotebooks" image: https://source.unsplash.com/400x175/?github description: API docs for the searchNotebooks plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchNotebooks'] --- import searchNotebooksObj from './search_notebooks.devdocs.json'; diff --git a/api_docs/search_playground.mdx b/api_docs/search_playground.mdx index e85036b62c9c3..64b0dc787fa3f 100644 --- a/api_docs/search_playground.mdx +++ b/api_docs/search_playground.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchPlayground title: "searchPlayground" image: https://source.unsplash.com/400x175/?github description: API docs for the searchPlayground plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchPlayground'] --- import searchPlaygroundObj from './search_playground.devdocs.json'; diff --git a/api_docs/security.devdocs.json b/api_docs/security.devdocs.json index a66deb7e92ab8..94b1e800ff111 100644 --- a/api_docs/security.devdocs.json +++ b/api_docs/security.devdocs.json @@ -6376,7 +6376,7 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts" } ] }, @@ -6517,10 +6517,6 @@ "plugin": "fleet", "path": "x-pack/plugins/fleet/server/routes/setup/handlers.ts" }, - { - "plugin": "cloudSecurityPosture", - "path": "x-pack/plugins/cloud_security_posture/server/routes/setup_routes.ts" - }, { "plugin": "serverlessSearch", "path": "x-pack/plugins/serverless_search/server/routes/api_key_routes.ts" @@ -6616,6 +6612,10 @@ { "plugin": "synthetics", "path": "x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/enablement.ts" + }, + { + "plugin": "cloudSecurityPosture", + "path": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/setup_routes.ts" } ] }, @@ -6683,11 +6683,11 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.ts" } ] } diff --git a/api_docs/security.mdx b/api_docs/security.mdx index 9db6ed33a5246..2a3264ee6b145 100644 --- a/api_docs/security.mdx +++ b/api_docs/security.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/security title: "security" image: https://source.unsplash.com/400x175/?github description: API docs for the security plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'security'] --- import securityObj from './security.devdocs.json'; diff --git a/api_docs/security_solution.devdocs.json b/api_docs/security_solution.devdocs.json index 16aff7a2ceaa4..dac95d2eed08e 100644 --- a/api_docs/security_solution.devdocs.json +++ b/api_docs/security_solution.devdocs.json @@ -47,7 +47,7 @@ "StartPlugins", ">" ], - "path": "x-pack/plugins/security_solution/public/plugin.tsx", + "path": "x-pack/solutions/security/plugins/security_solution/public/plugin.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -61,7 +61,7 @@ "signature": [ "any" ], - "path": "x-pack/plugins/security_solution/public/plugin.tsx", + "path": "x-pack/solutions/security/plugins/security_solution/public/plugin.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -82,7 +82,7 @@ }, "" ], - "path": "x-pack/plugins/security_solution/public/plugin.tsx", + "path": "x-pack/solutions/security/plugins/security_solution/public/plugin.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -127,7 +127,7 @@ "text": "PluginSetup" } ], - "path": "x-pack/plugins/security_solution/public/plugin.tsx", + "path": "x-pack/solutions/security/plugins/security_solution/public/plugin.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -158,7 +158,7 @@ }, ">" ], - "path": "x-pack/plugins/security_solution/public/plugin.tsx", + "path": "x-pack/solutions/security/plugins/security_solution/public/plugin.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -173,7 +173,7 @@ "signature": [ "SetupPlugins" ], - "path": "x-pack/plugins/security_solution/public/plugin.tsx", + "path": "x-pack/solutions/security/plugins/security_solution/public/plugin.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -208,7 +208,7 @@ "text": "PluginStart" } ], - "path": "x-pack/plugins/security_solution/public/plugin.tsx", + "path": "x-pack/solutions/security/plugins/security_solution/public/plugin.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -228,7 +228,7 @@ "text": "CoreStart" } ], - "path": "x-pack/plugins/security_solution/public/plugin.tsx", + "path": "x-pack/solutions/security/plugins/security_solution/public/plugin.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -243,7 +243,7 @@ "signature": [ "StartPlugins" ], - "path": "x-pack/plugins/security_solution/public/plugin.tsx", + "path": "x-pack/solutions/security/plugins/security_solution/public/plugin.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -261,7 +261,7 @@ "signature": [ "() => void" ], - "path": "x-pack/plugins/security_solution/public/plugin.tsx", + "path": "x-pack/solutions/security/plugins/security_solution/public/plugin.tsx", "deprecated": false, "trackAdoption": false, "children": [], @@ -297,7 +297,7 @@ "SetupPlugins", ") => Promise" ], - "path": "x-pack/plugins/security_solution/public/plugin.tsx", + "path": "x-pack/solutions/security/plugins/security_solution/public/plugin.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -328,7 +328,7 @@ }, ">" ], - "path": "x-pack/plugins/security_solution/public/plugin.tsx", + "path": "x-pack/solutions/security/plugins/security_solution/public/plugin.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -343,7 +343,7 @@ "signature": [ "SetupPlugins" ], - "path": "x-pack/plugins/security_solution/public/plugin.tsx", + "path": "x-pack/solutions/security/plugins/security_solution/public/plugin.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -360,10 +360,10 @@ "description": [], "signature": [ "() => Promise" ], - "path": "x-pack/plugins/security_solution/public/plugin.tsx", + "path": "x-pack/solutions/security/plugins/security_solution/public/plugin.tsx", "deprecated": false, "trackAdoption": false, "children": [], @@ -382,7 +382,7 @@ "tags": [], "label": "FetchRulesResponse", "description": [], - "path": "x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -393,7 +393,7 @@ "tags": [], "label": "page", "description": [], - "path": "x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/types.ts", "deprecated": false, "trackAdoption": false }, @@ -404,7 +404,7 @@ "tags": [], "label": "perPage", "description": [], - "path": "x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/types.ts", "deprecated": false, "trackAdoption": false }, @@ -415,7 +415,7 @@ "tags": [], "label": "total", "description": [], - "path": "x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/types.ts", "deprecated": false, "trackAdoption": false }, @@ -429,7 +429,7 @@ "signature": [ "({ id: string; type: \"eql\"; version: number; name: string; actions: { params: {} & { [k: string]: unknown; }; id: string; action_type_id: string; frequency?: { throttle: string | null; notifyWhen: \"onActionGroupChange\" | \"onActiveAlert\" | \"onThrottleInterval\"; summary: boolean; } | undefined; uuid?: string | undefined; group?: string | undefined; alerts_filter?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; }[]; tags: string[]; setup: string; description: string; enabled: boolean; revision: number; query: string; interval: string; severity: \"medium\" | \"high\" | \"low\" | \"critical\"; risk_score: number; from: string; to: string; language: \"eql\"; created_at: string; created_by: string; updated_at: string; updated_by: string; references: string[]; author: string[]; immutable: boolean; rule_id: string; threat: { framework: string; tactic: { id: string; name: string; reference: string; }; technique?: { id: string; name: string; reference: string; subtechnique?: { id: string; name: string; reference: string; }[] | undefined; }[] | undefined; }[]; risk_score_mapping: { value: string; field: string; operator: \"equals\"; risk_score?: number | undefined; }[]; severity_mapping: { value: string; field: string; severity: \"medium\" | \"high\" | \"low\" | \"critical\"; operator: \"equals\"; }[]; exceptions_list: { id: string; type: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\"; list_id: string; namespace_type: \"single\" | \"agnostic\"; }[]; false_positives: string[]; max_signals: number; related_integrations: { version: string; package: string; integration?: string | undefined; }[]; required_fields: { type: string; name: string; ecs: boolean; }[]; rule_source: { type: \"external\"; is_customized: boolean; } | { type: \"internal\"; }; meta?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; namespace?: string | undefined; index?: string[] | undefined; license?: string | undefined; throttle?: string | undefined; outcome?: \"exactMatch\" | \"aliasMatch\" | \"conflict\" | undefined; alias_target_id?: string | undefined; alias_purpose?: \"savedObjectConversion\" | \"savedObjectImport\" | undefined; filters?: unknown[] | undefined; tiebreaker_field?: string | undefined; timestamp_field?: string | undefined; note?: string | undefined; rule_name_override?: string | undefined; timestamp_override?: string | undefined; timestamp_override_fallback_disabled?: boolean | undefined; timeline_id?: string | undefined; timeline_title?: string | undefined; building_block_type?: string | undefined; output_index?: string | undefined; investigation_fields?: { field_names: string[]; } | undefined; response_actions?: ({ params: { query?: string | undefined; timeout?: number | undefined; queries?: { id: string; query: string; version?: string | undefined; snapshot?: boolean | undefined; platform?: string | undefined; ecs_mapping?: Zod.objectOutputType<{}, Zod.ZodObject<{ field: Zod.ZodOptional; value: Zod.ZodOptional]>>; }, \"strip\", Zod.ZodTypeAny, { value?: string | string[] | undefined; field?: string | undefined; }, { value?: string | string[] | undefined; field?: string | undefined; }>, \"strip\"> | undefined; removed?: boolean | undefined; }[] | undefined; ecs_mapping?: Zod.objectOutputType<{}, Zod.ZodObject<{ field: Zod.ZodOptional; value: Zod.ZodOptional]>>; }, \"strip\", Zod.ZodTypeAny, { value?: string | string[] | undefined; field?: string | undefined; }, { value?: string | string[] | undefined; field?: string | undefined; }>, \"strip\"> | undefined; saved_query_id?: string | undefined; pack_id?: string | undefined; }; action_type_id: \".osquery\"; } | { params: { command: \"isolate\"; comment?: string | undefined; } | { config: { field: string; overwrite: boolean; }; command: \"kill-process\" | \"suspend-process\"; comment?: string | undefined; }; action_type_id: \".endpoint\"; })[] | undefined; execution_summary?: { last_execution: { message: string; date: string; status: \"running\" | \"succeeded\" | \"failed\" | \"going to run\" | \"partial failure\"; metrics: { total_search_duration_ms?: number | undefined; total_indexing_duration_ms?: number | undefined; execution_gap_duration_s?: number | undefined; total_enrichment_duration_ms?: number | undefined; }; status_order: number; }; } | undefined; data_view_id?: string | undefined; event_category_override?: string | undefined; alert_suppression?: { group_by: string[]; duration?: { value: number; unit: \"m\" | \"s\" | \"h\"; } | undefined; missing_fields_strategy?: \"doNotSuppress\" | \"suppress\" | undefined; } | undefined; } | { id: string; type: \"query\"; version: number; name: string; actions: { params: {} & { [k: string]: unknown; }; id: string; action_type_id: string; frequency?: { throttle: string | null; notifyWhen: \"onActionGroupChange\" | \"onActiveAlert\" | \"onThrottleInterval\"; summary: boolean; } | undefined; uuid?: string | undefined; group?: string | undefined; alerts_filter?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; }[]; tags: string[]; setup: string; description: string; enabled: boolean; revision: number; query: string; interval: string; severity: \"medium\" | \"high\" | \"low\" | \"critical\"; risk_score: number; from: string; to: string; language: \"kuery\" | \"lucene\"; created_at: string; created_by: string; updated_at: string; updated_by: string; references: string[]; author: string[]; immutable: boolean; rule_id: string; threat: { framework: string; tactic: { id: string; name: string; reference: string; }; technique?: { id: string; name: string; reference: string; subtechnique?: { id: string; name: string; reference: string; }[] | undefined; }[] | undefined; }[]; risk_score_mapping: { value: string; field: string; operator: \"equals\"; risk_score?: number | undefined; }[]; severity_mapping: { value: string; field: string; severity: \"medium\" | \"high\" | \"low\" | \"critical\"; operator: \"equals\"; }[]; exceptions_list: { id: string; type: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\"; list_id: string; namespace_type: \"single\" | \"agnostic\"; }[]; false_positives: string[]; max_signals: number; related_integrations: { version: string; package: string; integration?: string | undefined; }[]; required_fields: { type: string; name: string; ecs: boolean; }[]; rule_source: { type: \"external\"; is_customized: boolean; } | { type: \"internal\"; }; meta?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; namespace?: string | undefined; index?: string[] | undefined; license?: string | undefined; throttle?: string | undefined; outcome?: \"exactMatch\" | \"aliasMatch\" | \"conflict\" | undefined; alias_target_id?: string | undefined; alias_purpose?: \"savedObjectConversion\" | \"savedObjectImport\" | undefined; filters?: unknown[] | undefined; note?: string | undefined; rule_name_override?: string | undefined; timestamp_override?: string | undefined; timestamp_override_fallback_disabled?: boolean | undefined; timeline_id?: string | undefined; timeline_title?: string | undefined; building_block_type?: string | undefined; output_index?: string | undefined; investigation_fields?: { field_names: string[]; } | undefined; response_actions?: ({ params: { query?: string | undefined; timeout?: number | undefined; queries?: { id: string; query: string; version?: string | undefined; snapshot?: boolean | undefined; platform?: string | undefined; ecs_mapping?: Zod.objectOutputType<{}, Zod.ZodObject<{ field: Zod.ZodOptional; value: Zod.ZodOptional]>>; }, \"strip\", Zod.ZodTypeAny, { value?: string | string[] | undefined; field?: string | undefined; }, { value?: string | string[] | undefined; field?: string | undefined; }>, \"strip\"> | undefined; removed?: boolean | undefined; }[] | undefined; ecs_mapping?: Zod.objectOutputType<{}, Zod.ZodObject<{ field: Zod.ZodOptional; value: Zod.ZodOptional]>>; }, \"strip\", Zod.ZodTypeAny, { value?: string | string[] | undefined; field?: string | undefined; }, { value?: string | string[] | undefined; field?: string | undefined; }>, \"strip\"> | undefined; saved_query_id?: string | undefined; pack_id?: string | undefined; }; action_type_id: \".osquery\"; } | { params: { command: \"isolate\"; comment?: string | undefined; } | { config: { field: string; overwrite: boolean; }; command: \"kill-process\" | \"suspend-process\"; comment?: string | undefined; }; action_type_id: \".endpoint\"; })[] | undefined; execution_summary?: { last_execution: { message: string; date: string; status: \"running\" | \"succeeded\" | \"failed\" | \"going to run\" | \"partial failure\"; metrics: { total_search_duration_ms?: number | undefined; total_indexing_duration_ms?: number | undefined; execution_gap_duration_s?: number | undefined; total_enrichment_duration_ms?: number | undefined; }; status_order: number; }; } | undefined; data_view_id?: string | undefined; alert_suppression?: { group_by: string[]; duration?: { value: number; unit: \"m\" | \"s\" | \"h\"; } | undefined; missing_fields_strategy?: \"doNotSuppress\" | \"suppress\" | undefined; } | undefined; saved_id?: string | undefined; } | { id: string; type: \"saved_query\"; version: number; name: string; actions: { params: {} & { [k: string]: unknown; }; id: string; action_type_id: string; frequency?: { throttle: string | null; notifyWhen: \"onActionGroupChange\" | \"onActiveAlert\" | \"onThrottleInterval\"; summary: boolean; } | undefined; uuid?: string | undefined; group?: string | undefined; alerts_filter?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; }[]; tags: string[]; setup: string; description: string; enabled: boolean; revision: number; interval: string; severity: \"medium\" | \"high\" | \"low\" | \"critical\"; risk_score: number; from: string; to: string; language: \"kuery\" | \"lucene\"; created_at: string; created_by: string; updated_at: string; updated_by: string; references: string[]; author: string[]; immutable: boolean; rule_id: string; threat: { framework: string; tactic: { id: string; name: string; reference: string; }; technique?: { id: string; name: string; reference: string; subtechnique?: { id: string; name: string; reference: string; }[] | undefined; }[] | undefined; }[]; risk_score_mapping: { value: string; field: string; operator: \"equals\"; risk_score?: number | undefined; }[]; severity_mapping: { value: string; field: string; severity: \"medium\" | \"high\" | \"low\" | \"critical\"; operator: \"equals\"; }[]; exceptions_list: { id: string; type: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\"; list_id: string; namespace_type: \"single\" | \"agnostic\"; }[]; false_positives: string[]; max_signals: number; related_integrations: { version: string; package: string; integration?: string | undefined; }[]; required_fields: { type: string; name: string; ecs: boolean; }[]; rule_source: { type: \"external\"; is_customized: boolean; } | { type: \"internal\"; }; saved_id: string; meta?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; namespace?: string | undefined; index?: string[] | undefined; license?: string | undefined; throttle?: string | undefined; query?: string | undefined; outcome?: \"exactMatch\" | \"aliasMatch\" | \"conflict\" | undefined; alias_target_id?: string | undefined; alias_purpose?: \"savedObjectConversion\" | \"savedObjectImport\" | undefined; filters?: unknown[] | undefined; note?: string | undefined; rule_name_override?: string | undefined; timestamp_override?: string | undefined; timestamp_override_fallback_disabled?: boolean | undefined; timeline_id?: string | undefined; timeline_title?: string | undefined; building_block_type?: string | undefined; output_index?: string | undefined; investigation_fields?: { field_names: string[]; } | undefined; response_actions?: ({ params: { query?: string | undefined; timeout?: number | undefined; queries?: { id: string; query: string; version?: string | undefined; snapshot?: boolean | undefined; platform?: string | undefined; ecs_mapping?: Zod.objectOutputType<{}, Zod.ZodObject<{ field: Zod.ZodOptional; value: Zod.ZodOptional]>>; }, \"strip\", Zod.ZodTypeAny, { value?: string | string[] | undefined; field?: string | undefined; }, { value?: string | string[] | undefined; field?: string | undefined; }>, \"strip\"> | undefined; removed?: boolean | undefined; }[] | undefined; ecs_mapping?: Zod.objectOutputType<{}, Zod.ZodObject<{ field: Zod.ZodOptional; value: Zod.ZodOptional]>>; }, \"strip\", Zod.ZodTypeAny, { value?: string | string[] | undefined; field?: string | undefined; }, { value?: string | string[] | undefined; field?: string | undefined; }>, \"strip\"> | undefined; saved_query_id?: string | undefined; pack_id?: string | undefined; }; action_type_id: \".osquery\"; } | { params: { command: \"isolate\"; comment?: string | undefined; } | { config: { field: string; overwrite: boolean; }; command: \"kill-process\" | \"suspend-process\"; comment?: string | undefined; }; action_type_id: \".endpoint\"; })[] | undefined; execution_summary?: { last_execution: { message: string; date: string; status: \"running\" | \"succeeded\" | \"failed\" | \"going to run\" | \"partial failure\"; metrics: { total_search_duration_ms?: number | undefined; total_indexing_duration_ms?: number | undefined; execution_gap_duration_s?: number | undefined; total_enrichment_duration_ms?: number | undefined; }; status_order: number; }; } | undefined; data_view_id?: string | undefined; alert_suppression?: { group_by: string[]; duration?: { value: number; unit: \"m\" | \"s\" | \"h\"; } | undefined; missing_fields_strategy?: \"doNotSuppress\" | \"suppress\" | undefined; } | undefined; } | { id: string; type: \"threshold\"; version: number; name: string; actions: { params: {} & { [k: string]: unknown; }; id: string; action_type_id: string; frequency?: { throttle: string | null; notifyWhen: \"onActionGroupChange\" | \"onActiveAlert\" | \"onThrottleInterval\"; summary: boolean; } | undefined; uuid?: string | undefined; group?: string | undefined; alerts_filter?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; }[]; tags: string[]; setup: string; description: string; enabled: boolean; revision: number; query: string; interval: string; severity: \"medium\" | \"high\" | \"low\" | \"critical\"; risk_score: number; from: string; to: string; language: \"kuery\" | \"lucene\"; created_at: string; created_by: string; updated_at: string; updated_by: string; references: string[]; author: string[]; immutable: boolean; rule_id: string; threshold: { value: number; field: string | string[]; cardinality?: { value: number; field: string; }[] | undefined; }; threat: { framework: string; tactic: { id: string; name: string; reference: string; }; technique?: { id: string; name: string; reference: string; subtechnique?: { id: string; name: string; reference: string; }[] | undefined; }[] | undefined; }[]; risk_score_mapping: { value: string; field: string; operator: \"equals\"; risk_score?: number | undefined; }[]; severity_mapping: { value: string; field: string; severity: \"medium\" | \"high\" | \"low\" | \"critical\"; operator: \"equals\"; }[]; exceptions_list: { id: string; type: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\"; list_id: string; namespace_type: \"single\" | \"agnostic\"; }[]; false_positives: string[]; max_signals: number; related_integrations: { version: string; package: string; integration?: string | undefined; }[]; required_fields: { type: string; name: string; ecs: boolean; }[]; rule_source: { type: \"external\"; is_customized: boolean; } | { type: \"internal\"; }; meta?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; namespace?: string | undefined; index?: string[] | undefined; license?: string | undefined; throttle?: string | undefined; outcome?: \"exactMatch\" | \"aliasMatch\" | \"conflict\" | undefined; alias_target_id?: string | undefined; alias_purpose?: \"savedObjectConversion\" | \"savedObjectImport\" | undefined; filters?: unknown[] | undefined; note?: string | undefined; rule_name_override?: string | undefined; timestamp_override?: string | undefined; timestamp_override_fallback_disabled?: boolean | undefined; timeline_id?: string | undefined; timeline_title?: string | undefined; building_block_type?: string | undefined; output_index?: string | undefined; investigation_fields?: { field_names: string[]; } | undefined; response_actions?: ({ params: { query?: string | undefined; timeout?: number | undefined; queries?: { id: string; query: string; version?: string | undefined; snapshot?: boolean | undefined; platform?: string | undefined; ecs_mapping?: Zod.objectOutputType<{}, Zod.ZodObject<{ field: Zod.ZodOptional; value: Zod.ZodOptional]>>; }, \"strip\", Zod.ZodTypeAny, { value?: string | string[] | undefined; field?: string | undefined; }, { value?: string | string[] | undefined; field?: string | undefined; }>, \"strip\"> | undefined; removed?: boolean | undefined; }[] | undefined; ecs_mapping?: Zod.objectOutputType<{}, Zod.ZodObject<{ field: Zod.ZodOptional; value: Zod.ZodOptional]>>; }, \"strip\", Zod.ZodTypeAny, { value?: string | string[] | undefined; field?: string | undefined; }, { value?: string | string[] | undefined; field?: string | undefined; }>, \"strip\"> | undefined; saved_query_id?: string | undefined; pack_id?: string | undefined; }; action_type_id: \".osquery\"; } | { params: { command: \"isolate\"; comment?: string | undefined; } | { config: { field: string; overwrite: boolean; }; command: \"kill-process\" | \"suspend-process\"; comment?: string | undefined; }; action_type_id: \".endpoint\"; })[] | undefined; execution_summary?: { last_execution: { message: string; date: string; status: \"running\" | \"succeeded\" | \"failed\" | \"going to run\" | \"partial failure\"; metrics: { total_search_duration_ms?: number | undefined; total_indexing_duration_ms?: number | undefined; execution_gap_duration_s?: number | undefined; total_enrichment_duration_ms?: number | undefined; }; status_order: number; }; } | undefined; data_view_id?: string | undefined; alert_suppression?: { duration: { value: number; unit: \"m\" | \"s\" | \"h\"; }; } | undefined; saved_id?: string | undefined; } | { id: string; type: \"threat_match\"; version: number; name: string; actions: { params: {} & { [k: string]: unknown; }; id: string; action_type_id: string; frequency?: { throttle: string | null; notifyWhen: \"onActionGroupChange\" | \"onActiveAlert\" | \"onThrottleInterval\"; summary: boolean; } | undefined; uuid?: string | undefined; group?: string | undefined; alerts_filter?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; }[]; tags: string[]; setup: string; description: string; enabled: boolean; revision: number; query: string; interval: string; severity: \"medium\" | \"high\" | \"low\" | \"critical\"; risk_score: number; from: string; to: string; language: \"kuery\" | \"lucene\"; created_at: string; created_by: string; updated_at: string; updated_by: string; references: string[]; author: string[]; immutable: boolean; rule_id: string; threat: { framework: string; tactic: { id: string; name: string; reference: string; }; technique?: { id: string; name: string; reference: string; subtechnique?: { id: string; name: string; reference: string; }[] | undefined; }[] | undefined; }[]; risk_score_mapping: { value: string; field: string; operator: \"equals\"; risk_score?: number | undefined; }[]; severity_mapping: { value: string; field: string; severity: \"medium\" | \"high\" | \"low\" | \"critical\"; operator: \"equals\"; }[]; exceptions_list: { id: string; type: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\"; list_id: string; namespace_type: \"single\" | \"agnostic\"; }[]; false_positives: string[]; max_signals: number; related_integrations: { version: string; package: string; integration?: string | undefined; }[]; required_fields: { type: string; name: string; ecs: boolean; }[]; rule_source: { type: \"external\"; is_customized: boolean; } | { type: \"internal\"; }; threat_query: string; threat_mapping: { entries: { value: string; type: \"mapping\"; field: string; }[]; }[]; threat_index: string[]; meta?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; namespace?: string | undefined; index?: string[] | undefined; license?: string | undefined; throttle?: string | undefined; outcome?: \"exactMatch\" | \"aliasMatch\" | \"conflict\" | undefined; alias_target_id?: string | undefined; alias_purpose?: \"savedObjectConversion\" | \"savedObjectImport\" | undefined; filters?: unknown[] | undefined; note?: string | undefined; rule_name_override?: string | undefined; timestamp_override?: string | undefined; timestamp_override_fallback_disabled?: boolean | undefined; timeline_id?: string | undefined; timeline_title?: string | undefined; building_block_type?: string | undefined; output_index?: string | undefined; investigation_fields?: { field_names: string[]; } | undefined; response_actions?: ({ params: { query?: string | undefined; timeout?: number | undefined; queries?: { id: string; query: string; version?: string | undefined; snapshot?: boolean | undefined; platform?: string | undefined; ecs_mapping?: Zod.objectOutputType<{}, Zod.ZodObject<{ field: Zod.ZodOptional; value: Zod.ZodOptional]>>; }, \"strip\", Zod.ZodTypeAny, { value?: string | string[] | undefined; field?: string | undefined; }, { value?: string | string[] | undefined; field?: string | undefined; }>, \"strip\"> | undefined; removed?: boolean | undefined; }[] | undefined; ecs_mapping?: Zod.objectOutputType<{}, Zod.ZodObject<{ field: Zod.ZodOptional; value: Zod.ZodOptional]>>; }, \"strip\", Zod.ZodTypeAny, { value?: string | string[] | undefined; field?: string | undefined; }, { value?: string | string[] | undefined; field?: string | undefined; }>, \"strip\"> | undefined; saved_query_id?: string | undefined; pack_id?: string | undefined; }; action_type_id: \".osquery\"; } | { params: { command: \"isolate\"; comment?: string | undefined; } | { config: { field: string; overwrite: boolean; }; command: \"kill-process\" | \"suspend-process\"; comment?: string | undefined; }; action_type_id: \".endpoint\"; })[] | undefined; execution_summary?: { last_execution: { message: string; date: string; status: \"running\" | \"succeeded\" | \"failed\" | \"going to run\" | \"partial failure\"; metrics: { total_search_duration_ms?: number | undefined; total_indexing_duration_ms?: number | undefined; execution_gap_duration_s?: number | undefined; total_enrichment_duration_ms?: number | undefined; }; status_order: number; }; } | undefined; data_view_id?: string | undefined; alert_suppression?: { group_by: string[]; duration?: { value: number; unit: \"m\" | \"s\" | \"h\"; } | undefined; missing_fields_strategy?: \"doNotSuppress\" | \"suppress\" | undefined; } | undefined; saved_id?: string | undefined; threat_filters?: unknown[] | undefined; threat_indicator_path?: string | undefined; threat_language?: \"kuery\" | \"lucene\" | undefined; concurrent_searches?: number | undefined; items_per_search?: number | undefined; } | { id: string; type: \"machine_learning\"; version: number; name: string; actions: { params: {} & { [k: string]: unknown; }; id: string; action_type_id: string; frequency?: { throttle: string | null; notifyWhen: \"onActionGroupChange\" | \"onActiveAlert\" | \"onThrottleInterval\"; summary: boolean; } | undefined; uuid?: string | undefined; group?: string | undefined; alerts_filter?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; }[]; tags: string[]; setup: string; description: string; enabled: boolean; revision: number; interval: string; severity: \"medium\" | \"high\" | \"low\" | \"critical\"; risk_score: number; from: string; to: string; created_at: string; created_by: string; updated_at: string; updated_by: string; references: string[]; author: string[]; immutable: boolean; rule_id: string; threat: { framework: string; tactic: { id: string; name: string; reference: string; }; technique?: { id: string; name: string; reference: string; subtechnique?: { id: string; name: string; reference: string; }[] | undefined; }[] | undefined; }[]; risk_score_mapping: { value: string; field: string; operator: \"equals\"; risk_score?: number | undefined; }[]; severity_mapping: { value: string; field: string; severity: \"medium\" | \"high\" | \"low\" | \"critical\"; operator: \"equals\"; }[]; exceptions_list: { id: string; type: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\"; list_id: string; namespace_type: \"single\" | \"agnostic\"; }[]; false_positives: string[]; max_signals: number; related_integrations: { version: string; package: string; integration?: string | undefined; }[]; required_fields: { type: string; name: string; ecs: boolean; }[]; rule_source: { type: \"external\"; is_customized: boolean; } | { type: \"internal\"; }; anomaly_threshold: number; machine_learning_job_id: string | string[]; meta?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; namespace?: string | undefined; license?: string | undefined; throttle?: string | undefined; outcome?: \"exactMatch\" | \"aliasMatch\" | \"conflict\" | undefined; alias_target_id?: string | undefined; alias_purpose?: \"savedObjectConversion\" | \"savedObjectImport\" | undefined; note?: string | undefined; rule_name_override?: string | undefined; timestamp_override?: string | undefined; timestamp_override_fallback_disabled?: boolean | undefined; timeline_id?: string | undefined; timeline_title?: string | undefined; building_block_type?: string | undefined; output_index?: string | undefined; investigation_fields?: { field_names: string[]; } | undefined; response_actions?: ({ params: { query?: string | undefined; timeout?: number | undefined; queries?: { id: string; query: string; version?: string | undefined; snapshot?: boolean | undefined; platform?: string | undefined; ecs_mapping?: Zod.objectOutputType<{}, Zod.ZodObject<{ field: Zod.ZodOptional; value: Zod.ZodOptional]>>; }, \"strip\", Zod.ZodTypeAny, { value?: string | string[] | undefined; field?: string | undefined; }, { value?: string | string[] | undefined; field?: string | undefined; }>, \"strip\"> | undefined; removed?: boolean | undefined; }[] | undefined; ecs_mapping?: Zod.objectOutputType<{}, Zod.ZodObject<{ field: Zod.ZodOptional; value: Zod.ZodOptional]>>; }, \"strip\", Zod.ZodTypeAny, { value?: string | string[] | undefined; field?: string | undefined; }, { value?: string | string[] | undefined; field?: string | undefined; }>, \"strip\"> | undefined; saved_query_id?: string | undefined; pack_id?: string | undefined; }; action_type_id: \".osquery\"; } | { params: { command: \"isolate\"; comment?: string | undefined; } | { config: { field: string; overwrite: boolean; }; command: \"kill-process\" | \"suspend-process\"; comment?: string | undefined; }; action_type_id: \".endpoint\"; })[] | undefined; execution_summary?: { last_execution: { message: string; date: string; status: \"running\" | \"succeeded\" | \"failed\" | \"going to run\" | \"partial failure\"; metrics: { total_search_duration_ms?: number | undefined; total_indexing_duration_ms?: number | undefined; execution_gap_duration_s?: number | undefined; total_enrichment_duration_ms?: number | undefined; }; status_order: number; }; } | undefined; alert_suppression?: { group_by: string[]; duration?: { value: number; unit: \"m\" | \"s\" | \"h\"; } | undefined; missing_fields_strategy?: \"doNotSuppress\" | \"suppress\" | undefined; } | undefined; } | { id: string; type: \"new_terms\"; version: number; name: string; actions: { params: {} & { [k: string]: unknown; }; id: string; action_type_id: string; frequency?: { throttle: string | null; notifyWhen: \"onActionGroupChange\" | \"onActiveAlert\" | \"onThrottleInterval\"; summary: boolean; } | undefined; uuid?: string | undefined; group?: string | undefined; alerts_filter?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; }[]; tags: string[]; setup: string; description: string; enabled: boolean; revision: number; query: string; interval: string; severity: \"medium\" | \"high\" | \"low\" | \"critical\"; risk_score: number; from: string; to: string; language: \"kuery\" | \"lucene\"; created_at: string; created_by: string; updated_at: string; updated_by: string; references: string[]; author: string[]; immutable: boolean; rule_id: string; threat: { framework: string; tactic: { id: string; name: string; reference: string; }; technique?: { id: string; name: string; reference: string; subtechnique?: { id: string; name: string; reference: string; }[] | undefined; }[] | undefined; }[]; risk_score_mapping: { value: string; field: string; operator: \"equals\"; risk_score?: number | undefined; }[]; severity_mapping: { value: string; field: string; severity: \"medium\" | \"high\" | \"low\" | \"critical\"; operator: \"equals\"; }[]; exceptions_list: { id: string; type: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\"; list_id: string; namespace_type: \"single\" | \"agnostic\"; }[]; false_positives: string[]; max_signals: number; related_integrations: { version: string; package: string; integration?: string | undefined; }[]; required_fields: { type: string; name: string; ecs: boolean; }[]; rule_source: { type: \"external\"; is_customized: boolean; } | { type: \"internal\"; }; new_terms_fields: string[]; history_window_start: string; meta?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; namespace?: string | undefined; index?: string[] | undefined; license?: string | undefined; throttle?: string | undefined; outcome?: \"exactMatch\" | \"aliasMatch\" | \"conflict\" | undefined; alias_target_id?: string | undefined; alias_purpose?: \"savedObjectConversion\" | \"savedObjectImport\" | undefined; filters?: unknown[] | undefined; note?: string | undefined; rule_name_override?: string | undefined; timestamp_override?: string | undefined; timestamp_override_fallback_disabled?: boolean | undefined; timeline_id?: string | undefined; timeline_title?: string | undefined; building_block_type?: string | undefined; output_index?: string | undefined; investigation_fields?: { field_names: string[]; } | undefined; response_actions?: ({ params: { query?: string | undefined; timeout?: number | undefined; queries?: { id: string; query: string; version?: string | undefined; snapshot?: boolean | undefined; platform?: string | undefined; ecs_mapping?: Zod.objectOutputType<{}, Zod.ZodObject<{ field: Zod.ZodOptional; value: Zod.ZodOptional]>>; }, \"strip\", Zod.ZodTypeAny, { value?: string | string[] | undefined; field?: string | undefined; }, { value?: string | string[] | undefined; field?: string | undefined; }>, \"strip\"> | undefined; removed?: boolean | undefined; }[] | undefined; ecs_mapping?: Zod.objectOutputType<{}, Zod.ZodObject<{ field: Zod.ZodOptional; value: Zod.ZodOptional]>>; }, \"strip\", Zod.ZodTypeAny, { value?: string | string[] | undefined; field?: string | undefined; }, { value?: string | string[] | undefined; field?: string | undefined; }>, \"strip\"> | undefined; saved_query_id?: string | undefined; pack_id?: string | undefined; }; action_type_id: \".osquery\"; } | { params: { command: \"isolate\"; comment?: string | undefined; } | { config: { field: string; overwrite: boolean; }; command: \"kill-process\" | \"suspend-process\"; comment?: string | undefined; }; action_type_id: \".endpoint\"; })[] | undefined; execution_summary?: { last_execution: { message: string; date: string; status: \"running\" | \"succeeded\" | \"failed\" | \"going to run\" | \"partial failure\"; metrics: { total_search_duration_ms?: number | undefined; total_indexing_duration_ms?: number | undefined; execution_gap_duration_s?: number | undefined; total_enrichment_duration_ms?: number | undefined; }; status_order: number; }; } | undefined; data_view_id?: string | undefined; alert_suppression?: { group_by: string[]; duration?: { value: number; unit: \"m\" | \"s\" | \"h\"; } | undefined; missing_fields_strategy?: \"doNotSuppress\" | \"suppress\" | undefined; } | undefined; } | { id: string; type: \"esql\"; version: number; name: string; actions: { params: {} & { [k: string]: unknown; }; id: string; action_type_id: string; frequency?: { throttle: string | null; notifyWhen: \"onActionGroupChange\" | \"onActiveAlert\" | \"onThrottleInterval\"; summary: boolean; } | undefined; uuid?: string | undefined; group?: string | undefined; alerts_filter?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; }[]; tags: string[]; setup: string; description: string; enabled: boolean; revision: number; query: string; interval: string; severity: \"medium\" | \"high\" | \"low\" | \"critical\"; risk_score: number; from: string; to: string; language: \"esql\"; created_at: string; created_by: string; updated_at: string; updated_by: string; references: string[]; author: string[]; immutable: boolean; rule_id: string; threat: { framework: string; tactic: { id: string; name: string; reference: string; }; technique?: { id: string; name: string; reference: string; subtechnique?: { id: string; name: string; reference: string; }[] | undefined; }[] | undefined; }[]; risk_score_mapping: { value: string; field: string; operator: \"equals\"; risk_score?: number | undefined; }[]; severity_mapping: { value: string; field: string; severity: \"medium\" | \"high\" | \"low\" | \"critical\"; operator: \"equals\"; }[]; exceptions_list: { id: string; type: \"endpoint\" | \"detection\" | \"rule_default\" | \"endpoint_trusted_apps\" | \"endpoint_events\" | \"endpoint_host_isolation_exceptions\" | \"endpoint_blocklists\"; list_id: string; namespace_type: \"single\" | \"agnostic\"; }[]; false_positives: string[]; max_signals: number; related_integrations: { version: string; package: string; integration?: string | undefined; }[]; required_fields: { type: string; name: string; ecs: boolean; }[]; rule_source: { type: \"external\"; is_customized: boolean; } | { type: \"internal\"; }; meta?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; namespace?: string | undefined; license?: string | undefined; throttle?: string | undefined; outcome?: \"exactMatch\" | \"aliasMatch\" | \"conflict\" | undefined; alias_target_id?: string | undefined; alias_purpose?: \"savedObjectConversion\" | \"savedObjectImport\" | undefined; note?: string | undefined; rule_name_override?: string | undefined; timestamp_override?: string | undefined; timestamp_override_fallback_disabled?: boolean | undefined; timeline_id?: string | undefined; timeline_title?: string | undefined; building_block_type?: string | undefined; output_index?: string | undefined; investigation_fields?: { field_names: string[]; } | undefined; response_actions?: ({ params: { query?: string | undefined; timeout?: number | undefined; queries?: { id: string; query: string; version?: string | undefined; snapshot?: boolean | undefined; platform?: string | undefined; ecs_mapping?: Zod.objectOutputType<{}, Zod.ZodObject<{ field: Zod.ZodOptional; value: Zod.ZodOptional]>>; }, \"strip\", Zod.ZodTypeAny, { value?: string | string[] | undefined; field?: string | undefined; }, { value?: string | string[] | undefined; field?: string | undefined; }>, \"strip\"> | undefined; removed?: boolean | undefined; }[] | undefined; ecs_mapping?: Zod.objectOutputType<{}, Zod.ZodObject<{ field: Zod.ZodOptional; value: Zod.ZodOptional]>>; }, \"strip\", Zod.ZodTypeAny, { value?: string | string[] | undefined; field?: string | undefined; }, { value?: string | string[] | undefined; field?: string | undefined; }>, \"strip\"> | undefined; saved_query_id?: string | undefined; pack_id?: string | undefined; }; action_type_id: \".osquery\"; } | { params: { command: \"isolate\"; comment?: string | undefined; } | { config: { field: string; overwrite: boolean; }; command: \"kill-process\" | \"suspend-process\"; comment?: string | undefined; }; action_type_id: \".endpoint\"; })[] | undefined; execution_summary?: { last_execution: { message: string; date: string; status: \"running\" | \"succeeded\" | \"failed\" | \"going to run\" | \"partial failure\"; metrics: { total_search_duration_ms?: number | undefined; total_indexing_duration_ms?: number | undefined; execution_gap_duration_s?: number | undefined; total_enrichment_duration_ms?: number | undefined; }; status_order: number; }; } | undefined; alert_suppression?: { group_by: string[]; duration?: { value: number; unit: \"m\" | \"s\" | \"h\"; } | undefined; missing_fields_strategy?: \"doNotSuppress\" | \"suppress\" | undefined; } | undefined; })[]" ], - "path": "x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/types.ts", "deprecated": false, "trackAdoption": false } @@ -443,7 +443,7 @@ "tags": [], "label": "LinkItem", "description": [], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -460,7 +460,7 @@ "RequiredCapabilities", " | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -492,7 +492,7 @@ }, ">[] | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -508,7 +508,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -524,7 +524,7 @@ "signature": [ "\"assistantModelEvaluation\" | \"defendInsights\" | \"alertSuppressionForSequenceEqlRuleEnabled\" | \"excludePoliciesInFilterEnabled\" | \"kubernetesEnabled\" | \"donutChartEmbeddablesEnabled\" | \"previewTelemetryUrlEnabled\" | \"extendedRuleExecutionLoggingEnabled\" | \"socTrendsEnabled\" | \"responseActionUploadEnabled\" | \"automatedProcessActionsEnabled\" | \"responseActionsSentinelOneV1Enabled\" | \"responseActionsSentinelOneV2Enabled\" | \"responseActionsSentinelOneGetFileEnabled\" | \"responseActionsSentinelOneKillProcessEnabled\" | \"responseActionsSentinelOneProcessesEnabled\" | \"responseActionsCrowdstrikeManualHostIsolationEnabled\" | \"endpointManagementSpaceAwarenessEnabled\" | \"securitySolutionNotesDisabled\" | \"entityAlertPreviewDisabled\" | \"newUserDetailsFlyoutManagedUser\" | \"riskScoringPersistence\" | \"riskScoringRoutesEnabled\" | \"esqlRulesDisabled\" | \"protectionUpdatesEnabled\" | \"disableTimelineSaveTour\" | \"riskEnginePrivilegesRouteEnabled\" | \"sentinelOneDataInAnalyzerEnabled\" | \"sentinelOneManualHostActionsEnabled\" | \"crowdstrikeDataInAnalyzerEnabled\" | \"responseActionsTelemetryEnabled\" | \"jamfDataInAnalyzerEnabled\" | \"timelineEsqlTabDisabled\" | \"analyzerDatePickersAndSourcererDisabled\" | \"graphVisualizationInFlyoutEnabled\" | \"prebuiltRulesCustomizationEnabled\" | \"malwareOnWriteScanOptionAvailable\" | \"unifiedManifestEnabled\" | \"valueListItemsModalEnabled\" | \"filterProcessDescendantsForEventFiltersEnabled\" | \"dataIngestionHubEnabled\" | \"entityStoreDisabled\" | \"serviceEntityStoreEnabled\" | \"siemMigrationsEnabled\" | \"newExpandableFlyoutNavigationEnabled\" | \"crowdstrikeRunScriptEnabled\" | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -540,7 +540,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -556,7 +556,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -572,7 +572,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -588,7 +588,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -604,7 +604,7 @@ "signature": [ "\"assistantModelEvaluation\" | \"defendInsights\" | \"alertSuppressionForSequenceEqlRuleEnabled\" | \"excludePoliciesInFilterEnabled\" | \"kubernetesEnabled\" | \"donutChartEmbeddablesEnabled\" | \"previewTelemetryUrlEnabled\" | \"extendedRuleExecutionLoggingEnabled\" | \"socTrendsEnabled\" | \"responseActionUploadEnabled\" | \"automatedProcessActionsEnabled\" | \"responseActionsSentinelOneV1Enabled\" | \"responseActionsSentinelOneV2Enabled\" | \"responseActionsSentinelOneGetFileEnabled\" | \"responseActionsSentinelOneKillProcessEnabled\" | \"responseActionsSentinelOneProcessesEnabled\" | \"responseActionsCrowdstrikeManualHostIsolationEnabled\" | \"endpointManagementSpaceAwarenessEnabled\" | \"securitySolutionNotesDisabled\" | \"entityAlertPreviewDisabled\" | \"newUserDetailsFlyoutManagedUser\" | \"riskScoringPersistence\" | \"riskScoringRoutesEnabled\" | \"esqlRulesDisabled\" | \"protectionUpdatesEnabled\" | \"disableTimelineSaveTour\" | \"riskEnginePrivilegesRouteEnabled\" | \"sentinelOneDataInAnalyzerEnabled\" | \"sentinelOneManualHostActionsEnabled\" | \"crowdstrikeDataInAnalyzerEnabled\" | \"responseActionsTelemetryEnabled\" | \"jamfDataInAnalyzerEnabled\" | \"timelineEsqlTabDisabled\" | \"analyzerDatePickersAndSourcererDisabled\" | \"graphVisualizationInFlyoutEnabled\" | \"prebuiltRulesCustomizationEnabled\" | \"malwareOnWriteScanOptionAvailable\" | \"unifiedManifestEnabled\" | \"valueListItemsModalEnabled\" | \"filterProcessDescendantsForEventFiltersEnabled\" | \"dataIngestionHubEnabled\" | \"entityStoreDisabled\" | \"serviceEntityStoreEnabled\" | \"siemMigrationsEnabled\" | \"newExpandableFlyoutNavigationEnabled\" | \"crowdstrikeRunScriptEnabled\" | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -626,7 +626,7 @@ "text": "SecurityPageName" } ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -642,7 +642,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -658,7 +658,7 @@ "signature": [ "{ text: string; } | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -675,7 +675,7 @@ "IconType", " | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -691,7 +691,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -707,7 +707,7 @@ "signature": [ "\"basic\" | \"standard\" | \"gold\" | \"platinum\" | \"enterprise\" | \"trial\" | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -730,7 +730,7 @@ }, "[] | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -743,7 +743,7 @@ "description": [ "\nLink path relative to security root" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -759,7 +759,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -775,7 +775,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -792,7 +792,7 @@ "IconType", " | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -808,7 +808,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -821,7 +821,7 @@ "description": [ "\nTitle of the link" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -837,7 +837,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -860,7 +860,7 @@ }, "[] | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false }, @@ -876,7 +876,7 @@ "signature": [ "string | { key: string; value: unknown; } | undefined" ], - "path": "x-pack/plugins/security_solution/public/common/links/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts", "deprecated": false, "trackAdoption": false } @@ -890,7 +890,7 @@ "tags": [], "label": "TimelineModel", "description": [], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -906,7 +906,7 @@ "signature": [ "TimelineTabs" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -920,7 +920,7 @@ "signature": [ "TimelineTabs" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -937,7 +937,7 @@ "ScrollToTopEvent", " | undefined" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -953,7 +953,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -966,7 +966,7 @@ "description": [ "A summary of the events and notes in this timeline" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -986,7 +986,7 @@ "text": "EqlOptions" } ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1003,7 +1003,7 @@ "TimelineEventsType", " | undefined" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1019,7 +1019,7 @@ "signature": [ "{ [x: string]: string[]; }" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1035,7 +1035,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1048,7 +1048,7 @@ "description": [ "The chronological history of actions related to this timeline" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1061,7 +1061,7 @@ "description": [ "When true, this timeline was marked as \"favorite\" by the user" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1074,7 +1074,7 @@ "description": [ "When true, the timeline will update as new data arrives" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1090,7 +1090,7 @@ "signature": [ "\"filter\" | \"search\"" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1103,7 +1103,7 @@ "description": [ "Title" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1119,7 +1119,7 @@ "signature": [ "\"default\" | \"template\"" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1135,7 +1135,7 @@ "signature": [ "string | null" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1151,7 +1151,7 @@ "signature": [ "number | null" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1167,7 +1167,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1183,7 +1183,7 @@ "signature": [ "{ [x: string]: boolean; }" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1197,7 +1197,7 @@ "signature": [ "{ [x: string]: { version: string; eventId: string; timelineId: string; pinnedEventId: string; createdBy?: string | null | undefined; updatedBy?: string | null | undefined; created?: number | null | undefined; updated?: number | null | undefined; }; }" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1212,7 +1212,7 @@ "ResolveTimelineConfig", " | undefined" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1226,7 +1226,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1240,7 +1240,7 @@ "signature": [ "string | null | undefined" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1255,7 +1255,7 @@ "SessionViewConfig", " | null" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1268,7 +1268,7 @@ "description": [ "When true, show the timeline flyover" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1284,7 +1284,7 @@ "signature": [ "\"active\" | \"draft\" | \"immutable\"" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1300,7 +1300,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1316,7 +1316,7 @@ "signature": [ "string | null | undefined" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1329,7 +1329,7 @@ "description": [ "timeline is saving" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1343,7 +1343,7 @@ "signature": [ "string | null" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1357,7 +1357,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1371,7 +1371,7 @@ "signature": [ "string | null" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1388,7 +1388,7 @@ "SortColumnTimeline", "[]" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1405,7 +1405,7 @@ "ColumnHeaderOptions", "[]" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1420,7 +1420,7 @@ "ColumnHeaderOptions", "[]" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1443,7 +1443,7 @@ }, "[]" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1459,7 +1459,7 @@ "signature": [ "string | null" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1475,7 +1475,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1486,7 +1486,7 @@ "tags": [], "label": "documentType", "description": [], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1500,7 +1500,7 @@ "signature": [ "(\"alert\" | \"alerts\" | \"plain\" | \"system\" | \"registry\" | \"auditd\" | \"auditd_file\" | \"library\" | \"netflow\" | \"suricata\" | \"system_dns\" | \"system_endgame_process\" | \"system_file\" | \"system_fim\" | \"system_security_event\" | \"system_socket\" | \"threat_match\" | \"zeek\")[]" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1521,7 +1521,7 @@ }, "[] | undefined" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1535,7 +1535,7 @@ "signature": [ "string | number | boolean | React.ReactElement> | Iterable | React.ReactPortal | null | undefined" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1549,7 +1549,7 @@ "signature": [ "string | number | boolean | React.ReactElement> | Iterable | React.ReactPortal | null | undefined" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1563,7 +1563,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1579,7 +1579,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1593,7 +1593,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1606,7 +1606,7 @@ "description": [ "The number of items to show in a single page of results" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1622,7 +1622,7 @@ "signature": [ "number[]" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1640,7 +1640,7 @@ "SerializedFilterQuery", " | null; }" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1656,7 +1656,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1672,7 +1672,7 @@ "signature": [ "{ start: string; end: string; }" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1685,7 +1685,7 @@ "description": [ "Uniquely identifies the timeline" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1707,7 +1707,7 @@ }, "[]; }" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1720,7 +1720,7 @@ "description": [ "If selectAll checkbox in header is checked" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1731,7 +1731,7 @@ "tags": [], "label": "selectAll", "description": [], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1745,7 +1745,7 @@ "signature": [ "string | null" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1766,7 +1766,7 @@ }, " | null" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1777,7 +1777,7 @@ "tags": [], "label": "isDataProviderVisible", "description": [], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1793,7 +1793,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1807,7 +1807,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1818,7 +1818,7 @@ "tags": [], "label": "sampleSize", "description": [], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false }, @@ -1834,7 +1834,7 @@ "signature": [ "string | null | undefined" ], - "path": "x-pack/plugins/security_solution/public/timelines/store/model.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts", "deprecated": false, "trackAdoption": false } @@ -1852,7 +1852,7 @@ "tags": [], "label": "PluginSetup", "description": [], - "path": "x-pack/plugins/security_solution/public/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1868,7 +1868,7 @@ "ResolverPluginSetup", ">" ], - "path": "x-pack/plugins/security_solution/public/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -1884,7 +1884,7 @@ "signature": [ "{ readonly alertSuppressionForSequenceEqlRuleEnabled: boolean; readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly donutChartEmbeddablesEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsSentinelOneKillProcessEnabled: boolean; readonly responseActionsSentinelOneProcessesEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly endpointManagementSpaceAwarenessEnabled: boolean; readonly securitySolutionNotesDisabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly responseActionsTelemetryEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly graphVisualizationInFlyoutEnabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; readonly entityStoreDisabled: boolean; readonly serviceEntityStoreEnabled: boolean; readonly siemMigrationsEnabled: boolean; readonly defendInsights: boolean; readonly newExpandableFlyoutNavigationEnabled: boolean; readonly crowdstrikeRunScriptEnabled: boolean; }" ], - "path": "x-pack/plugins/security_solution/public/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -1899,7 +1899,7 @@ "tags": [], "label": "PluginStart", "description": [], - "path": "x-pack/plugins/security_solution/public/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1917,7 +1917,7 @@ "NavigationLink", "[]>" ], - "path": "x-pack/plugins/security_solution/public/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -1933,7 +1933,7 @@ "signature": [ "(components: Partial<{ GetStarted: React.ComponentType<{ indicesExist?: boolean | undefined; }>; DashboardsLandingCallout: React.ComponentType<{}>; EnablementModalCallout: React.ComponentType<{}>; }>) => void" ], - "path": "x-pack/plugins/security_solution/public/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -1948,7 +1948,7 @@ "signature": [ "{ GetStarted?: React.ComponentType<{ indicesExist?: boolean | undefined; }> | undefined; DashboardsLandingCallout?: React.ComponentType<{}> | undefined; EnablementModalCallout?: React.ComponentType<{}> | undefined; }" ], - "path": "x-pack/plugins/security_solution/public/contract_components.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/contract_components.ts", "deprecated": false, "trackAdoption": false } @@ -1968,7 +1968,7 @@ "BreadcrumbsNav", ">" ], - "path": "x-pack/plugins/security_solution/public/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -1985,7 +1985,7 @@ "() => ", "UpsellingService" ], - "path": "x-pack/plugins/security_solution/public/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2001,7 +2001,7 @@ "signature": [ "({ userUrl, isAgentlessAvailable, }: { userUrl: UserUrl; isAgentlessAvailable: boolean; }) => void" ], - "path": "x-pack/plugins/security_solution/public/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -2016,7 +2016,7 @@ "signature": [ "{ userUrl: UserUrl; isAgentlessAvailable: boolean; }" ], - "path": "x-pack/plugins/security_solution/public/onboarding/service/onboarding_service.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/onboarding/service/onboarding_service.ts", "deprecated": false, "trackAdoption": false } @@ -2032,7 +2032,7 @@ "signature": [ "(isSolutionNavigationEnabled: boolean) => void" ], - "path": "x-pack/plugins/security_solution/public/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2046,7 +2046,7 @@ "signature": [ "boolean" ], - "path": "x-pack/plugins/security_solution/public/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2066,7 +2066,7 @@ "SolutionNavigation", ">" ], - "path": "x-pack/plugins/security_solution/public/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2086,7 +2086,7 @@ "tags": [], "label": "AppClient", "description": [], - "path": "x-pack/plugins/security_solution/server/client/client.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/client/client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2100,7 +2100,7 @@ "signature": [ "any" ], - "path": "x-pack/plugins/security_solution/server/client/client.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/client/client.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2114,7 +2114,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/security_solution/server/client/client.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/client/client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2135,7 +2135,7 @@ "text": "ConfigType" } ], - "path": "x-pack/plugins/security_solution/server/client/client.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/client/client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2150,7 +2150,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/security_solution/server/client/client.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/client/client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2165,7 +2165,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/security_solution/server/client/client.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/client/client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2186,7 +2186,7 @@ "text": "BuildFlavor" } ], - "path": "x-pack/plugins/security_solution/server/client/client.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/client/client.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2204,7 +2204,7 @@ "signature": [ "() => string" ], - "path": "x-pack/plugins/security_solution/server/client/client.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/client/client.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2220,7 +2220,7 @@ "signature": [ "() => string" ], - "path": "x-pack/plugins/security_solution/server/client/client.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/client/client.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2236,7 +2236,7 @@ "signature": [ "() => string" ], - "path": "x-pack/plugins/security_solution/server/client/client.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/client/client.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2252,7 +2252,7 @@ "signature": [ "() => string" ], - "path": "x-pack/plugins/security_solution/server/client/client.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/client/client.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2268,7 +2268,7 @@ "signature": [ "() => string" ], - "path": "x-pack/plugins/security_solution/server/client/client.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/client/client.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2284,7 +2284,7 @@ "signature": [ "() => string" ], - "path": "x-pack/plugins/security_solution/server/client/client.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/client/client.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2300,7 +2300,7 @@ "signature": [ "() => string" ], - "path": "x-pack/plugins/security_solution/server/client/client.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/client/client.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2323,7 +2323,7 @@ "text": "BuildFlavor" } ], - "path": "x-pack/plugins/security_solution/server/client/client.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/client/client.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2377,7 +2377,7 @@ "SecuritySolutionPluginStartDependencies", ">" ], - "path": "x-pack/plugins/security_solution/server/plugin.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2391,7 +2391,7 @@ "signature": [ "any" ], - "path": "x-pack/plugins/security_solution/server/plugin.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2412,7 +2412,7 @@ }, "" ], - "path": "x-pack/plugins/security_solution/server/plugin.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/plugin.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2441,7 +2441,7 @@ "text": "SecuritySolutionPluginSetup" } ], - "path": "x-pack/plugins/security_solution/server/plugin.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2455,7 +2455,7 @@ "signature": [ "SecuritySolutionPluginCoreSetupDependencies" ], - "path": "x-pack/plugins/security_solution/server/plugin.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/plugin.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2470,7 +2470,7 @@ "signature": [ "SecuritySolutionPluginSetupDependencies" ], - "path": "x-pack/plugins/security_solution/server/plugin.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/plugin.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2505,7 +2505,7 @@ "text": "SecuritySolutionPluginStart" } ], - "path": "x-pack/plugins/security_solution/server/plugin.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2525,7 +2525,7 @@ "text": "CoreStart" } ], - "path": "x-pack/plugins/security_solution/server/plugin.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/plugin.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2540,7 +2540,7 @@ "signature": [ "SecuritySolutionPluginStartDependencies" ], - "path": "x-pack/plugins/security_solution/server/plugin.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/plugin.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2558,7 +2558,7 @@ "signature": [ "() => void" ], - "path": "x-pack/plugins/security_solution/server/plugin.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2577,7 +2577,7 @@ "tags": [], "label": "SecuritySolutionApiRequestHandlerContext", "description": [], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2597,7 +2597,7 @@ "text": "CoreRequestHandlerContext" } ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false }, @@ -2611,7 +2611,7 @@ "signature": [ "() => string" ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2631,7 +2631,7 @@ "EndpointAuthz", ">>" ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2654,7 +2654,7 @@ "text": "ConfigType" } ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2671,7 +2671,7 @@ "() => ", "FrameworkRequest" ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2694,7 +2694,7 @@ "text": "AppClient" } ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2710,7 +2710,7 @@ "signature": [ "() => string" ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2733,7 +2733,7 @@ "text": "IRuleDataService" } ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2750,7 +2750,7 @@ "() => ", "IDetectionRulesClient" ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2767,7 +2767,7 @@ "() => ", "IDetectionEngineHealthClient" ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2784,7 +2784,7 @@ "() => ", "IRuleExecutionLogForRoutes" ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2816,7 +2816,7 @@ }, ">" ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2837,7 +2837,7 @@ }, "" ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2863,7 +2863,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2886,7 +2886,7 @@ "text": "DataViewsService" } ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2910,7 +2910,7 @@ }, " | null" ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2927,7 +2927,7 @@ "() => ", "EndpointInternalFleetServicesInterface" ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2944,7 +2944,7 @@ "() => ", "RiskEngineDataClient" ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2961,7 +2961,7 @@ "() => ", "RiskScoreDataClient" ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2978,7 +2978,7 @@ "() => ", "AssetCriticalityDataClient" ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2995,7 +2995,7 @@ "() => ", "EntityStoreDataClient" ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -3012,7 +3012,7 @@ "() => ", "SiemRuleMigrationsClient" ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -3035,7 +3035,7 @@ "text": "InferenceClient" } ], - "path": "x-pack/plugins/security_solution/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -3067,7 +3067,7 @@ "ConfigSettings", "; enableUiSettingsValidations: boolean; }" ], - "path": "x-pack/plugins/security_solution/server/config.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/config.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3081,7 +3081,7 @@ "tags": [], "label": "SecuritySolutionPluginSetup", "description": [], - "path": "x-pack/plugins/security_solution/server/plugin_contract.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/plugin_contract.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3099,7 +3099,7 @@ "ProductFeaturesConfigurator", ") => void" ], - "path": "x-pack/plugins/security_solution/server/plugin_contract.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/plugin_contract.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -3114,7 +3114,7 @@ "signature": [ "ProductFeaturesConfigurator" ], - "path": "x-pack/plugins/security_solution/server/lib/product_features_service/product_features_service.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/product_features_service.ts", "deprecated": false, "trackAdoption": false } @@ -3132,7 +3132,7 @@ "signature": [ "{ readonly alertSuppressionForSequenceEqlRuleEnabled: boolean; readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly donutChartEmbeddablesEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsSentinelOneKillProcessEnabled: boolean; readonly responseActionsSentinelOneProcessesEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly endpointManagementSpaceAwarenessEnabled: boolean; readonly securitySolutionNotesDisabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly responseActionsTelemetryEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly graphVisualizationInFlyoutEnabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; readonly entityStoreDisabled: boolean; readonly serviceEntityStoreEnabled: boolean; readonly siemMigrationsEnabled: boolean; readonly defendInsights: boolean; readonly newExpandableFlyoutNavigationEnabled: boolean; readonly crowdstrikeRunScriptEnabled: boolean; }" ], - "path": "x-pack/plugins/security_solution/server/plugin_contract.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/plugin_contract.ts", "deprecated": false, "trackAdoption": false } @@ -3147,7 +3147,7 @@ "tags": [], "label": "SecuritySolutionPluginStart", "description": [], - "path": "x-pack/plugins/security_solution/server/plugin_contract.ts", + "path": "x-pack/solutions/security/plugins/security_solution/server/plugin_contract.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -3167,7 +3167,7 @@ "tags": [], "label": "SecurityPageName", "description": [], - "path": "packages/deeplinks/security/deep_links.ts", + "path": "src/platform/packages/shared/deeplinks/security/deep_links.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3181,7 +3181,7 @@ "tags": [], "label": "ADD_DATA_PATH", "description": [], - "path": "x-pack/plugins/security_solution/common/constants.ts", + "path": "x-pack/solutions/security/plugins/security_solution/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3198,7 +3198,7 @@ "signature": [ "\"securitySolution\"" ], - "path": "x-pack/plugins/security_solution/common/constants.ts", + "path": "x-pack/solutions/security/plugins/security_solution/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3213,7 +3213,7 @@ "signature": [ "\"/app/security\"" ], - "path": "x-pack/plugins/security_solution/common/constants.ts", + "path": "x-pack/solutions/security/plugins/security_solution/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3228,7 +3228,7 @@ "signature": [ "\"securitySolutionUI\"" ], - "path": "x-pack/plugins/security_solution/common/constants.ts", + "path": "x-pack/solutions/security/plugins/security_solution/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3243,7 +3243,7 @@ "signature": [ "\"securitySolutionCasesV2\"" ], - "path": "x-pack/plugins/security_solution/common/constants.ts", + "path": "x-pack/solutions/security/plugins/security_solution/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3258,7 +3258,7 @@ "signature": [ "\"/api/detection_engine/rules/_find\"" ], - "path": "x-pack/plugins/security_solution/common/constants.ts", + "path": "x-pack/solutions/security/plugins/security_solution/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3275,7 +3275,7 @@ "signature": [ "\"9a1a2dae-0b5f-4c3d-8305-a268d404c306\"" ], - "path": "x-pack/plugins/security_solution/common/detection_engine/constants.ts", + "path": "x-pack/solutions/security/plugins/security_solution/common/detection_engine/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3290,7 +3290,7 @@ "signature": [ "\"alert.attributes.enabled\"" ], - "path": "x-pack/plugins/security_solution/common/detection_engine/rule_management/rule_fields.ts", + "path": "x-pack/solutions/security/plugins/security_solution/common/detection_engine/rule_management/rule_fields.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3305,7 +3305,7 @@ "signature": [ "{ readonly alertSuppressionForSequenceEqlRuleEnabled: boolean; readonly excludePoliciesInFilterEnabled: boolean; readonly kubernetesEnabled: boolean; readonly donutChartEmbeddablesEnabled: boolean; readonly previewTelemetryUrlEnabled: boolean; readonly extendedRuleExecutionLoggingEnabled: boolean; readonly socTrendsEnabled: boolean; readonly responseActionUploadEnabled: boolean; readonly automatedProcessActionsEnabled: boolean; readonly responseActionsSentinelOneV1Enabled: boolean; readonly responseActionsSentinelOneV2Enabled: boolean; readonly responseActionsSentinelOneGetFileEnabled: boolean; readonly responseActionsSentinelOneKillProcessEnabled: boolean; readonly responseActionsSentinelOneProcessesEnabled: boolean; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: boolean; readonly endpointManagementSpaceAwarenessEnabled: boolean; readonly securitySolutionNotesDisabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: boolean; readonly newUserDetailsFlyoutManagedUser: boolean; readonly riskScoringPersistence: boolean; readonly riskScoringRoutesEnabled: boolean; readonly esqlRulesDisabled: boolean; readonly protectionUpdatesEnabled: boolean; readonly disableTimelineSaveTour: boolean; readonly riskEnginePrivilegesRouteEnabled: boolean; readonly sentinelOneDataInAnalyzerEnabled: boolean; readonly sentinelOneManualHostActionsEnabled: boolean; readonly crowdstrikeDataInAnalyzerEnabled: boolean; readonly responseActionsTelemetryEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly graphVisualizationInFlyoutEnabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; readonly entityStoreDisabled: boolean; readonly serviceEntityStoreEnabled: boolean; readonly siemMigrationsEnabled: boolean; readonly defendInsights: boolean; readonly newExpandableFlyoutNavigationEnabled: boolean; readonly crowdstrikeRunScriptEnabled: boolean; }" ], - "path": "x-pack/plugins/security_solution/common/experimental_features.ts", + "path": "x-pack/solutions/security/plugins/security_solution/common/experimental_features.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3320,7 +3320,7 @@ "signature": [ "\"/manage\"" ], - "path": "x-pack/plugins/security_solution/common/constants.ts", + "path": "x-pack/solutions/security/plugins/security_solution/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3337,7 +3337,7 @@ "signature": [ "\"logs-sentinel_one.activity-*\"" ], - "path": "x-pack/plugins/security_solution/common/endpoint/service/response_actions/sentinel_one.ts", + "path": "x-pack/solutions/security/plugins/security_solution/common/endpoint/service/response_actions/sentinel_one.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3352,7 +3352,7 @@ "signature": [ "\"siem\"" ], - "path": "x-pack/plugins/security_solution/common/constants.ts", + "path": "x-pack/solutions/security/plugins/security_solution/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3371,7 +3371,7 @@ "signature": [ "{ readonly alertSuppressionForSequenceEqlRuleEnabled: true; readonly excludePoliciesInFilterEnabled: false; readonly kubernetesEnabled: false; readonly donutChartEmbeddablesEnabled: false; readonly previewTelemetryUrlEnabled: false; readonly extendedRuleExecutionLoggingEnabled: false; readonly socTrendsEnabled: false; readonly responseActionUploadEnabled: true; readonly automatedProcessActionsEnabled: true; readonly responseActionsSentinelOneV1Enabled: true; readonly responseActionsSentinelOneV2Enabled: true; readonly responseActionsSentinelOneGetFileEnabled: true; readonly responseActionsSentinelOneKillProcessEnabled: true; readonly responseActionsSentinelOneProcessesEnabled: true; readonly responseActionsCrowdstrikeManualHostIsolationEnabled: true; readonly endpointManagementSpaceAwarenessEnabled: false; readonly securitySolutionNotesDisabled: false; readonly entityAlertPreviewDisabled: false; readonly assistantModelEvaluation: false; readonly newUserDetailsFlyoutManagedUser: false; readonly riskScoringPersistence: true; readonly riskScoringRoutesEnabled: true; readonly esqlRulesDisabled: false; readonly protectionUpdatesEnabled: true; readonly disableTimelineSaveTour: false; readonly riskEnginePrivilegesRouteEnabled: true; readonly sentinelOneDataInAnalyzerEnabled: true; readonly sentinelOneManualHostActionsEnabled: true; readonly crowdstrikeDataInAnalyzerEnabled: true; readonly responseActionsTelemetryEnabled: false; readonly jamfDataInAnalyzerEnabled: true; readonly timelineEsqlTabDisabled: false; readonly analyzerDatePickersAndSourcererDisabled: false; readonly graphVisualizationInFlyoutEnabled: false; readonly prebuiltRulesCustomizationEnabled: false; readonly malwareOnWriteScanOptionAvailable: true; readonly unifiedManifestEnabled: true; readonly valueListItemsModalEnabled: true; readonly filterProcessDescendantsForEventFiltersEnabled: true; readonly dataIngestionHubEnabled: false; readonly entityStoreDisabled: false; readonly serviceEntityStoreEnabled: false; readonly siemMigrationsEnabled: false; readonly defendInsights: false; readonly newExpandableFlyoutNavigationEnabled: false; readonly crowdstrikeRunScriptEnabled: false; }" ], - "path": "x-pack/plugins/security_solution/common/experimental_features.ts", + "path": "x-pack/solutions/security/plugins/security_solution/common/experimental_features.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/security_solution.mdx b/api_docs/security_solution.mdx index dc91293ada90e..4d6d35520ae1e 100644 --- a/api_docs/security_solution.mdx +++ b/api_docs/security_solution.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/securitySolution title: "securitySolution" image: https://source.unsplash.com/400x175/?github description: API docs for the securitySolution plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolution'] --- import securitySolutionObj from './security_solution.devdocs.json'; diff --git a/api_docs/security_solution_ess.devdocs.json b/api_docs/security_solution_ess.devdocs.json index 86a4acbd57322..ddf880d8dc85d 100644 --- a/api_docs/security_solution_ess.devdocs.json +++ b/api_docs/security_solution_ess.devdocs.json @@ -14,7 +14,7 @@ "tags": [], "label": "SecuritySolutionEssPluginSetup", "description": [], - "path": "x-pack/plugins/security_solution_ess/public/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution_ess/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -28,7 +28,7 @@ "tags": [], "label": "SecuritySolutionEssPluginStart", "description": [], - "path": "x-pack/plugins/security_solution_ess/public/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution_ess/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -50,7 +50,7 @@ "tags": [], "label": "SecuritySolutionEssPluginSetup", "description": [], - "path": "x-pack/plugins/security_solution_ess/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution_ess/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -64,7 +64,7 @@ "tags": [], "label": "SecuritySolutionEssPluginStart", "description": [], - "path": "x-pack/plugins/security_solution_ess/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution_ess/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -88,7 +88,7 @@ "signature": [ "\"securitySolutionEss\"" ], - "path": "x-pack/plugins/security_solution_ess/common/index.ts", + "path": "x-pack/solutions/security/plugins/security_solution_ess/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -103,7 +103,7 @@ "signature": [ "\"securitySolutionEss\"" ], - "path": "x-pack/plugins/security_solution_ess/common/index.ts", + "path": "x-pack/solutions/security/plugins/security_solution_ess/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/security_solution_ess.mdx b/api_docs/security_solution_ess.mdx index 6e9d98f339555..ff752ff79abb7 100644 --- a/api_docs/security_solution_ess.mdx +++ b/api_docs/security_solution_ess.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/securitySolutionEss title: "securitySolutionEss" image: https://source.unsplash.com/400x175/?github description: API docs for the securitySolutionEss plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolutionEss'] --- import securitySolutionEssObj from './security_solution_ess.devdocs.json'; diff --git a/api_docs/security_solution_serverless.devdocs.json b/api_docs/security_solution_serverless.devdocs.json index f216fd2475aca..b5d2fc3e68290 100644 --- a/api_docs/security_solution_serverless.devdocs.json +++ b/api_docs/security_solution_serverless.devdocs.json @@ -14,7 +14,7 @@ "tags": [], "label": "SecuritySolutionServerlessPluginSetup", "description": [], - "path": "x-pack/plugins/security_solution_serverless/public/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution_serverless/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -28,7 +28,7 @@ "tags": [], "label": "SecuritySolutionServerlessPluginStart", "description": [], - "path": "x-pack/plugins/security_solution_serverless/public/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution_serverless/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -50,7 +50,7 @@ "tags": [], "label": "SecuritySolutionServerlessPluginSetup", "description": [], - "path": "x-pack/plugins/security_solution_serverless/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution_serverless/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -64,7 +64,7 @@ "tags": [], "label": "SecuritySolutionServerlessPluginStart", "description": [], - "path": "x-pack/plugins/security_solution_serverless/server/types.ts", + "path": "x-pack/solutions/security/plugins/security_solution_serverless/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -88,7 +88,7 @@ "signature": [ "\"securitySolutionServerless\"" ], - "path": "x-pack/plugins/security_solution_serverless/common/index.ts", + "path": "x-pack/solutions/security/plugins/security_solution_serverless/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -103,7 +103,7 @@ "signature": [ "\"securitySolutionServerless\"" ], - "path": "x-pack/plugins/security_solution_serverless/common/index.ts", + "path": "x-pack/solutions/security/plugins/security_solution_serverless/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -118,7 +118,7 @@ "signature": [ "\"security\"" ], - "path": "x-pack/plugins/security_solution_serverless/common/index.ts", + "path": "x-pack/solutions/security/plugins/security_solution_serverless/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/security_solution_serverless.mdx b/api_docs/security_solution_serverless.mdx index 5782e0c0de424..36d630567dca7 100644 --- a/api_docs/security_solution_serverless.mdx +++ b/api_docs/security_solution_serverless.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/securitySolutionServerless title: "securitySolutionServerless" image: https://source.unsplash.com/400x175/?github description: API docs for the securitySolutionServerless plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'securitySolutionServerless'] --- import securitySolutionServerlessObj from './security_solution_serverless.devdocs.json'; diff --git a/api_docs/serverless.mdx b/api_docs/serverless.mdx index 2aa47ad420be1..2e68221d4fe11 100644 --- a/api_docs/serverless.mdx +++ b/api_docs/serverless.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/serverless title: "serverless" image: https://source.unsplash.com/400x175/?github description: API docs for the serverless plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'serverless'] --- import serverlessObj from './serverless.devdocs.json'; diff --git a/api_docs/serverless_observability.mdx b/api_docs/serverless_observability.mdx index a07466ffbd040..1d5e3d895dd30 100644 --- a/api_docs/serverless_observability.mdx +++ b/api_docs/serverless_observability.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/serverlessObservability title: "serverlessObservability" image: https://source.unsplash.com/400x175/?github description: API docs for the serverlessObservability plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'serverlessObservability'] --- import serverlessObservabilityObj from './serverless_observability.devdocs.json'; diff --git a/api_docs/serverless_search.mdx b/api_docs/serverless_search.mdx index 447ca16377489..e6e48faee4739 100644 --- a/api_docs/serverless_search.mdx +++ b/api_docs/serverless_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/serverlessSearch title: "serverlessSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the serverlessSearch plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'serverlessSearch'] --- import serverlessSearchObj from './serverless_search.devdocs.json'; diff --git a/api_docs/session_view.devdocs.json b/api_docs/session_view.devdocs.json index ccf4c1e0cd822..2aa60214d7714 100644 --- a/api_docs/session_view.devdocs.json +++ b/api_docs/session_view.devdocs.json @@ -11,7 +11,7 @@ "tags": [], "label": "SessionViewStart", "description": [], - "path": "x-pack/plugins/session_view/public/types.ts", + "path": "x-pack/solutions/security/plugins/session_view/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -27,7 +27,7 @@ "SessionViewDeps", ") => JSX.Element" ], - "path": "x-pack/plugins/session_view/public/types.ts", + "path": "x-pack/solutions/security/plugins/session_view/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -41,7 +41,7 @@ "signature": [ "SessionViewDeps" ], - "path": "x-pack/plugins/session_view/public/types.ts", + "path": "x-pack/solutions/security/plugins/session_view/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -65,7 +65,7 @@ "signature": [ "\"process.entry_leader.entity_id\"" ], - "path": "x-pack/plugins/session_view/common/constants.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -92,7 +92,7 @@ "tags": [], "label": "Aggregate", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -106,7 +106,7 @@ "signature": [ "string | number" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -117,7 +117,7 @@ "tags": [], "label": "doc_count", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false } @@ -131,7 +131,7 @@ "tags": [], "label": "AlertStatusEventEntityIdMap", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -145,7 +145,7 @@ "signature": [ "[alertUuid: string]: { status: string; processEntityId: string; }" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false } @@ -159,7 +159,7 @@ "tags": [], "label": "AlertTypeCount", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -174,7 +174,7 @@ "\"all\" | ", "EventCategory" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -185,7 +185,7 @@ "tags": [], "label": "count", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false } @@ -199,7 +199,7 @@ "tags": [], "label": "IOLine", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -219,7 +219,7 @@ "text": "ProcessEvent" } ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -230,7 +230,7 @@ "tags": [], "label": "value", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false } @@ -244,7 +244,7 @@ "tags": [], "label": "Process", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -255,7 +255,7 @@ "tags": [], "label": "id", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -276,7 +276,7 @@ }, "[]" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -297,7 +297,7 @@ }, "[]" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -318,7 +318,7 @@ }, "[]" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -339,7 +339,7 @@ }, "[]" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -360,7 +360,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -371,7 +371,7 @@ "tags": [], "label": "autoExpand", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -385,7 +385,7 @@ "signature": [ "number[] | null" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -407,7 +407,7 @@ }, ") => void" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -427,7 +427,7 @@ "text": "ProcessEvent" } ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -453,7 +453,7 @@ }, ") => void" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -473,7 +473,7 @@ "text": "ProcessEvent" } ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -499,7 +499,7 @@ }, ") => void" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -519,7 +519,7 @@ "text": "Process" } ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -537,7 +537,7 @@ "signature": [ "() => void" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -553,7 +553,7 @@ "signature": [ "() => boolean" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -569,7 +569,7 @@ "signature": [ "() => boolean" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -593,7 +593,7 @@ }, "[]" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -617,7 +617,7 @@ }, ") => void" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -637,7 +637,7 @@ "text": "AlertStatusEventEntityIdMap" } ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -655,7 +655,7 @@ "signature": [ "() => boolean" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -671,7 +671,7 @@ "signature": [ "() => string" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -694,7 +694,7 @@ "text": "ProcessEvent" } ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -710,7 +710,7 @@ "signature": [ "() => boolean" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -734,7 +734,7 @@ }, "[]" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -748,7 +748,7 @@ "signature": [ "boolean" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -766,7 +766,7 @@ "signature": [ "() => boolean" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -782,7 +782,7 @@ "signature": [ "() => string" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -806,7 +806,7 @@ }, ") => boolean" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -826,7 +826,7 @@ "text": "Process" } ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -844,7 +844,7 @@ "tags": [], "label": "ProcessEvent", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -858,7 +858,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -900,7 +900,7 @@ }, "[] | undefined; type?: string | string[] | undefined; id?: string | undefined; } | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -914,7 +914,7 @@ "signature": [ "{ extension?: string | undefined; path?: string | undefined; name?: string | undefined; } | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -929,7 +929,7 @@ "ProcessEventNetwork", " | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -950,7 +950,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -971,7 +971,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -986,7 +986,7 @@ "User", " | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1001,7 +1001,7 @@ "Group", " | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1022,7 +1022,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1037,7 +1037,7 @@ "ProcessSelf", " | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1059,7 +1059,7 @@ }, " | undefined; } | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1080,7 +1080,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1101,7 +1101,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1122,7 +1122,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false } @@ -1136,7 +1136,7 @@ "tags": [], "label": "ProcessEventAlert", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1150,7 +1150,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1164,7 +1164,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1178,7 +1178,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1192,7 +1192,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1206,7 +1206,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1236,7 +1236,7 @@ }, "[] | undefined; } | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1251,7 +1251,7 @@ "ProcessEventAlertRule", " | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false } @@ -1265,7 +1265,7 @@ "tags": [], "label": "ProcessEventCloud", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1279,7 +1279,7 @@ "signature": [ "{ name?: string | undefined; } | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1293,7 +1293,7 @@ "signature": [ "{ id?: string | undefined; } | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1307,7 +1307,7 @@ "signature": [ "{ id?: string | undefined; name?: string | undefined; } | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1321,7 +1321,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1335,7 +1335,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false } @@ -1349,7 +1349,7 @@ "tags": [], "label": "ProcessEventContainer", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1363,7 +1363,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1377,7 +1377,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1391,7 +1391,7 @@ "signature": [ "{ name?: string | undefined; tag?: string | undefined; hash?: { all?: string | undefined; } | undefined; } | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false } @@ -1405,7 +1405,7 @@ "tags": [], "label": "ProcessEventHost", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1419,7 +1419,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1433,7 +1433,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1447,7 +1447,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1461,7 +1461,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1475,7 +1475,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1489,7 +1489,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1503,7 +1503,7 @@ "signature": [ "{ family?: string | undefined; full?: string | undefined; kernel?: string | undefined; name?: string | undefined; platform?: string | undefined; version?: string | undefined; } | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1517,7 +1517,7 @@ "signature": [ "{ id?: string | undefined; } | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false } @@ -1531,7 +1531,7 @@ "tags": [], "label": "ProcessEventIPAddress", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1545,7 +1545,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1559,7 +1559,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1573,7 +1573,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false } @@ -1587,7 +1587,7 @@ "tags": [], "label": "ProcessEventOrchestrator", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1601,7 +1601,7 @@ "signature": [ "{ name?: string | undefined; type?: string | undefined; ip?: string | undefined; parent?: { type?: string | undefined; } | undefined; labels?: string[] | undefined; annotations?: string[] | undefined; } | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1615,7 +1615,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1629,7 +1629,7 @@ "signature": [ "{ name?: string | undefined; id?: string | undefined; } | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false } @@ -1643,7 +1643,7 @@ "tags": [], "label": "ProcessEventResults", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1657,7 +1657,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1671,7 +1671,7 @@ "signature": [ "any[] | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false } @@ -1685,7 +1685,7 @@ "tags": [], "label": "ProcessEventsPage", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1706,7 +1706,7 @@ }, "[] | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1720,7 +1720,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1734,7 +1734,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false } @@ -1748,7 +1748,7 @@ "tags": [], "label": "ProcessFields", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1762,7 +1762,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1776,7 +1776,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1790,7 +1790,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1804,7 +1804,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1818,7 +1818,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1832,7 +1832,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1846,7 +1846,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1860,7 +1860,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1874,7 +1874,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1888,7 +1888,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1902,7 +1902,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1917,7 +1917,7 @@ "User", " | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1932,7 +1932,7 @@ "Group", " | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1947,7 +1947,7 @@ "Group", "[] | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1961,7 +1961,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1976,7 +1976,7 @@ "EntryMeta", " | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -1997,7 +1997,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false } @@ -2011,7 +2011,7 @@ "tags": [], "label": "ProcessStartMarker", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2031,7 +2031,7 @@ "text": "ProcessEvent" } ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -2042,7 +2042,7 @@ "tags": [], "label": "line", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -2056,7 +2056,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false } @@ -2070,7 +2070,7 @@ "tags": [], "label": "Teletype", "description": [], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2084,7 +2084,7 @@ "signature": [ "{ major?: number | undefined; minor?: number | undefined; } | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -2098,7 +2098,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false }, @@ -2112,7 +2112,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false } @@ -2132,7 +2132,7 @@ "signature": [ "\"process.entry_leader.entity_id\"" ], - "path": "x-pack/plugins/session_view/common/constants.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2147,7 +2147,7 @@ "signature": [ "\"end\" | \"fork\" | \"exec\" | \"text_output\" | \"executed\"" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2162,7 +2162,7 @@ "signature": [ "\"event\" | \"signal\"" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2178,7 +2178,7 @@ "\"all\" | ", "EventCategory" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2201,7 +2201,7 @@ }, "; }" ], - "path": "x-pack/plugins/session_view/common/types/v1.ts", + "path": "x-pack/solutions/security/plugins/session_view/common/types/v1.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/session_view.mdx b/api_docs/session_view.mdx index 17874eb6b1bda..f3ccb5be91195 100644 --- a/api_docs/session_view.mdx +++ b/api_docs/session_view.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/sessionView title: "sessionView" image: https://source.unsplash.com/400x175/?github description: API docs for the sessionView plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'sessionView'] --- import sessionViewObj from './session_view.devdocs.json'; diff --git a/api_docs/share.mdx b/api_docs/share.mdx index e75e2ee32966f..9acb90e44c143 100644 --- a/api_docs/share.mdx +++ b/api_docs/share.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/share title: "share" image: https://source.unsplash.com/400x175/?github description: API docs for the share plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'share'] --- import shareObj from './share.devdocs.json'; diff --git a/api_docs/slo.devdocs.json b/api_docs/slo.devdocs.json index 410a5f83698d0..10274a3f7c2c0 100644 --- a/api_docs/slo.devdocs.json +++ b/api_docs/slo.devdocs.json @@ -11,7 +11,7 @@ "tags": [], "label": "SLOPublicPluginsSetup", "description": [], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -31,7 +31,7 @@ "text": "DataPublicPluginSetup" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -51,7 +51,7 @@ "text": "EmbeddableSetup" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -71,7 +71,7 @@ "text": "LicensingPluginSetup" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -161,7 +161,7 @@ }, "; }" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -182,7 +182,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -206,7 +206,7 @@ }, "[]>) => void; }; }" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -226,7 +226,7 @@ "text": "PresentationUtilPluginStart" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -247,7 +247,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -295,7 +295,7 @@ }, ") => void; }" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -315,7 +315,7 @@ "text": "TriggersAndActionsUIPublicPluginSetup" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -361,7 +361,7 @@ }, ") => void; }" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -381,7 +381,7 @@ "text": "UsageCollectionSetup" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -402,7 +402,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -416,7 +416,7 @@ "tags": [], "label": "SLOPublicPluginsStart", "description": [], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -436,7 +436,7 @@ "text": "AiopsPluginStart" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -456,7 +456,7 @@ "text": "CasesPublicStart" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -479,7 +479,7 @@ "ActiveCursor", "; }" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -500,7 +500,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -520,7 +520,7 @@ "text": "DashboardStart" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -540,7 +540,7 @@ "text": "DataPublicPluginStart" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -560,7 +560,7 @@ "text": "PluginStart" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -580,7 +580,7 @@ "text": "PluginStart" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -600,7 +600,7 @@ "text": "DataViewsServicePublic" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -621,7 +621,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -641,7 +641,7 @@ "text": "DiscoverSharedPublicStart" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -661,7 +661,7 @@ "text": "EmbeddableStart" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -682,7 +682,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -712,7 +712,7 @@ }, "; }" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -732,7 +732,7 @@ "text": "LensPublicStart" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -752,7 +752,7 @@ "text": "LicensingPluginStart" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -800,7 +800,7 @@ "LinkProps", "; }" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -821,7 +821,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -865,7 +865,7 @@ }, ">; }) => void; }" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -885,7 +885,7 @@ "text": "PresentationUtilPluginStart" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -906,7 +906,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -946,7 +946,7 @@ }, ">): void; }" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -967,7 +967,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -987,7 +987,7 @@ "text": "TriggersAndActionsUIPublicPluginStart" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1075,7 +1075,7 @@ }, "; }" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1095,7 +1095,7 @@ "text": "UnifiedSearchPublicPluginStart" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1115,7 +1115,7 @@ "text": "UsageCollectionStart" } ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1136,7 +1136,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -1165,7 +1165,7 @@ }, "<{ name: string; description: string; indicator: { type: \"sli.apm.transactionDuration\"; params: { environment: string; service: string; transactionType: string; transactionName: string; threshold: number; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.apm.transactionErrorRate\"; params: { environment: string; service: string; transactionType: string; transactionName: string; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.synthetics.availability\"; params: { monitorIds: { value: string; label: string; }[]; index: string; } & { tags?: { value: string; label: string; }[] | undefined; projects?: { value: string; label: string; }[] | undefined; filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.kql.custom\"; params: { index: string; good: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; total: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.custom\"; params: { index: string; good: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; total: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.timeslice\"; params: { index: string; metric: { metrics: (({ name: string; aggregation: \"min\" | \"max\" | \"sum\" | \"avg\" | \"cardinality\" | \"last_value\" | \"std_deviation\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"percentile\"; field: string; percentile: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; threshold: number; comparator: \"GT\" | \"GTE\" | \"LT\" | \"LTE\"; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.histogram.custom\"; params: { index: string; timestampField: string; good: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); total: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; }; timeWindow: { duration: string; type: \"rolling\"; } | { duration: string; type: \"calendarAligned\"; }; budgetingMethod: \"occurrences\" | \"timeslices\"; objective: { target: number; } & { timesliceTarget?: number | undefined; timesliceWindow?: string | undefined; }; } & { id?: string | undefined; settings?: { syncDelay?: string | undefined; frequency?: string | undefined; preventInitialBackfill?: boolean | undefined; syncField?: string | null | undefined; } | undefined; tags?: string[] | undefined; groupBy?: string | string[] | undefined; revision?: number | undefined; }> | undefined; }>; }" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false, "lifecycle": "start", @@ -1211,7 +1211,7 @@ "SloListLocatorParams", ">; }" ], - "path": "x-pack/plugins/observability_solution/slo/public/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/public/types.ts", "deprecated": false, "trackAdoption": false, "lifecycle": "setup", @@ -1229,7 +1229,7 @@ "tags": [], "label": "SloClient", "description": [], - "path": "x-pack/plugins/observability_solution/slo/server/client/index.ts", + "path": "x-pack/solutions/observability/plugins/slo/server/client/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1243,7 +1243,7 @@ "signature": [ "() => Promise" ], - "path": "x-pack/plugins/observability_solution/slo/server/client/index.ts", + "path": "x-pack/solutions/observability/plugins/slo/server/client/index.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -1263,7 +1263,7 @@ "tags": [], "label": "SLOServerSetup", "description": [], - "path": "x-pack/plugins/observability_solution/slo/server/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -1277,7 +1277,7 @@ "tags": [], "label": "SLOServerStart", "description": [], - "path": "x-pack/plugins/observability_solution/slo/server/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1306,7 +1306,7 @@ "text": "SloClient" } ], - "path": "x-pack/plugins/observability_solution/slo/server/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1327,7 +1327,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/slo/server/types.ts", + "path": "x-pack/solutions/observability/plugins/slo/server/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1356,7 +1356,7 @@ "signature": [ "\"SLOs\"" ], - "path": "x-pack/plugins/observability_solution/slo/common/index.ts", + "path": "x-pack/solutions/observability/plugins/slo/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1371,7 +1371,7 @@ "signature": [ "\"slo\"" ], - "path": "x-pack/plugins/observability_solution/slo/common/index.ts", + "path": "x-pack/solutions/observability/plugins/slo/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1388,7 +1388,7 @@ "signature": [ "{ slos: string; slosSettings: string; slosWelcome: string; slosOutdatedDefinitions: string; sloCreate: string; sloCreateWithEncodedForm: (encodedParams: string) => string; sloEdit: (sloId: string) => string; sloEditWithEncodedForm: (sloId: string, encodedParams: string) => string; sloDetails: (sloId: string, instanceId?: string | undefined, remoteName?: string | undefined, tabId?: string | undefined) => string; }" ], - "path": "x-pack/plugins/observability_solution/slo/common/index.ts", + "path": "x-pack/solutions/observability/plugins/slo/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/slo.mdx b/api_docs/slo.mdx index d479eb028a385..7e51eaad109eb 100644 --- a/api_docs/slo.mdx +++ b/api_docs/slo.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/slo title: "slo" image: https://source.unsplash.com/400x175/?github description: API docs for the slo plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'slo'] --- import sloObj from './slo.devdocs.json'; diff --git a/api_docs/snapshot_restore.mdx b/api_docs/snapshot_restore.mdx index 5fdabb4c58a1d..c95111e641a60 100644 --- a/api_docs/snapshot_restore.mdx +++ b/api_docs/snapshot_restore.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/snapshotRestore title: "snapshotRestore" image: https://source.unsplash.com/400x175/?github description: API docs for the snapshotRestore plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'snapshotRestore'] --- import snapshotRestoreObj from './snapshot_restore.devdocs.json'; diff --git a/api_docs/spaces.mdx b/api_docs/spaces.mdx index d61dd6d838a4c..0b4048878e808 100644 --- a/api_docs/spaces.mdx +++ b/api_docs/spaces.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/spaces title: "spaces" image: https://source.unsplash.com/400x175/?github description: API docs for the spaces plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'spaces'] --- import spacesObj from './spaces.devdocs.json'; diff --git a/api_docs/stack_alerts.devdocs.json b/api_docs/stack_alerts.devdocs.json index ffa4f04113286..a766826e2e72e 100644 --- a/api_docs/stack_alerts.devdocs.json +++ b/api_docs/stack_alerts.devdocs.json @@ -13,7 +13,7 @@ "signature": [ "({ dependencies: { dataViews, dataViewEditor }, metadata, dataView, onSelectDataView, onChangeMetaData, }: ", "DataViewSelectPopoverProps", - ") => React.JSX.Element | null" + ") => React.JSX.Element" ], "path": "x-pack/plugins/stack_alerts/public/rule_types/components/data_view_select_popover.tsx", "deprecated": false, diff --git a/api_docs/stack_alerts.mdx b/api_docs/stack_alerts.mdx index e668fa01d9167..fe85571e22a3f 100644 --- a/api_docs/stack_alerts.mdx +++ b/api_docs/stack_alerts.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/stackAlerts title: "stackAlerts" image: https://source.unsplash.com/400x175/?github description: API docs for the stackAlerts plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackAlerts'] --- import stackAlertsObj from './stack_alerts.devdocs.json'; diff --git a/api_docs/stack_connectors.mdx b/api_docs/stack_connectors.mdx index 7500838da8853..c830d2c6252af 100644 --- a/api_docs/stack_connectors.mdx +++ b/api_docs/stack_connectors.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/stackConnectors title: "stackConnectors" image: https://source.unsplash.com/400x175/?github description: API docs for the stackConnectors plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackConnectors'] --- import stackConnectorsObj from './stack_connectors.devdocs.json'; diff --git a/api_docs/streams.mdx b/api_docs/streams.mdx index b4b0226c9f6fa..12d94aa1db8bd 100644 --- a/api_docs/streams.mdx +++ b/api_docs/streams.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/streams title: "streams" image: https://source.unsplash.com/400x175/?github description: API docs for the streams plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'streams'] --- import streamsObj from './streams.devdocs.json'; diff --git a/api_docs/streams_app.mdx b/api_docs/streams_app.mdx index 530cc57b65d76..5ead02c343fbb 100644 --- a/api_docs/streams_app.mdx +++ b/api_docs/streams_app.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/streamsApp title: "streamsApp" image: https://source.unsplash.com/400x175/?github description: API docs for the streamsApp plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'streamsApp'] --- import streamsAppObj from './streams_app.devdocs.json'; diff --git a/api_docs/task_manager.mdx b/api_docs/task_manager.mdx index 6f0c28ae4f170..09bfec7a46728 100644 --- a/api_docs/task_manager.mdx +++ b/api_docs/task_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/taskManager title: "taskManager" image: https://source.unsplash.com/400x175/?github description: API docs for the taskManager plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'taskManager'] --- import taskManagerObj from './task_manager.devdocs.json'; diff --git a/api_docs/telemetry.devdocs.json b/api_docs/telemetry.devdocs.json index 72092679afa2c..765689834b183 100644 --- a/api_docs/telemetry.devdocs.json +++ b/api_docs/telemetry.devdocs.json @@ -811,14 +811,6 @@ "plugin": "datasetQuality", "path": "x-pack/plugins/observability_solution/dataset_quality/server/services/data_telemetry/data_telemetry_service.ts" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender_helpers.ts" - }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/server/telemetry/sender.test.ts" @@ -829,7 +821,11 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/sender.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/sender_helpers.ts" }, { "plugin": "synthetics", @@ -842,6 +838,10 @@ { "plugin": "synthetics", "path": "x-pack/solutions/observability/plugins/synthetics/server/telemetry/sender.test.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/sender.test.ts" } ], "children": [], diff --git a/api_docs/telemetry.mdx b/api_docs/telemetry.mdx index 0b8f5b1048e56..c952ea58fd007 100644 --- a/api_docs/telemetry.mdx +++ b/api_docs/telemetry.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetry title: "telemetry" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetry plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetry'] --- import telemetryObj from './telemetry.devdocs.json'; diff --git a/api_docs/telemetry_collection_manager.mdx b/api_docs/telemetry_collection_manager.mdx index a821a1d0530e2..762b4de3bd2fe 100644 --- a/api_docs/telemetry_collection_manager.mdx +++ b/api_docs/telemetry_collection_manager.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryCollectionManager title: "telemetryCollectionManager" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryCollectionManager plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionManager'] --- import telemetryCollectionManagerObj from './telemetry_collection_manager.devdocs.json'; diff --git a/api_docs/telemetry_management_section.mdx b/api_docs/telemetry_management_section.mdx index ee2d0c9f6dd5c..e0107c7da79cc 100644 --- a/api_docs/telemetry_management_section.mdx +++ b/api_docs/telemetry_management_section.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/telemetryManagementSection title: "telemetryManagementSection" image: https://source.unsplash.com/400x175/?github description: API docs for the telemetryManagementSection plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryManagementSection'] --- import telemetryManagementSectionObj from './telemetry_management_section.devdocs.json'; diff --git a/api_docs/threat_intelligence.devdocs.json b/api_docs/threat_intelligence.devdocs.json index 57443fe73fb61..f55a8d2199db8 100644 --- a/api_docs/threat_intelligence.devdocs.json +++ b/api_docs/threat_intelligence.devdocs.json @@ -505,7 +505,7 @@ "tags": [], "label": "TIPageId", "description": [ - "\nAll the IDs for the threat intelligence pages.\nThis needs to match the threat intelligence page entries in SecurityPageName` (x-pack/plugins/security_solution/common/constants.ts).\n\nExample to add more IDs:\n export type TIPageId = 'threat_intelligence' | 'threat_intelligence-feed';" + "\nAll the IDs for the threat intelligence pages.\nThis needs to match the threat intelligence page entries in SecurityPageName` (x-pack/solutions/security/plugins/security_solution/common/constants.ts).\n\nExample to add more IDs:\n export type TIPageId = 'threat_intelligence' | 'threat_intelligence-feed';" ], "signature": [ "\"threat_intelligence\"" diff --git a/api_docs/threat_intelligence.mdx b/api_docs/threat_intelligence.mdx index 19af1ba8edb45..0abea67f7f77a 100644 --- a/api_docs/threat_intelligence.mdx +++ b/api_docs/threat_intelligence.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/threatIntelligence title: "threatIntelligence" image: https://source.unsplash.com/400x175/?github description: API docs for the threatIntelligence plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'threatIntelligence'] --- import threatIntelligenceObj from './threat_intelligence.devdocs.json'; diff --git a/api_docs/timelines.devdocs.json b/api_docs/timelines.devdocs.json index 4f5ced0bc1b6d..b916d23908995 100644 --- a/api_docs/timelines.devdocs.json +++ b/api_docs/timelines.devdocs.json @@ -1232,11 +1232,11 @@ "references": [ { "plugin": "kubernetesSecurity", - "path": "x-pack/plugins/kubernetes_security/public/hooks/use_filter.ts" + "path": "x-pack/solutions/security/plugins/kubernetes_security/public/hooks/use_filter.ts" }, { - "plugin": "threatIntelligence", - "path": "x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx" + "plugin": "osquery", + "path": "x-pack/platform/plugins/shared/osquery/public/timelines/add_to_timeline_button.tsx" }, { "plugin": "threatIntelligence", @@ -1251,8 +1251,8 @@ "path": "x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx" }, { - "plugin": "osquery", - "path": "x-pack/platform/plugins/shared/osquery/public/timelines/add_to_timeline_button.tsx" + "plugin": "threatIntelligence", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx" } ], "children": [], @@ -1834,7 +1834,7 @@ ], "label": "DeprecatedRowRenderer", "description": [ - "\nThis interface should not be used anymore.\nUse the one from `plugins/security_solution/common/types/timeline`." + "\nThis interface should not be used anymore.\nUse the one from `solutions/security/plugins/security_solution/common/types/timeline`." ], "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/rows/index.ts", "deprecated": true, @@ -1850,11 +1850,11 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/index.tsx" } ], "children": [ @@ -2394,27 +2394,27 @@ "references": [ { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/common/search_strategy/index_fields/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" } ], "children": [ @@ -3699,19 +3699,19 @@ "references": [ { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/common/search_strategy/index_fields/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts" } ], "initialIsOpen": false @@ -3772,323 +3772,315 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/types/timeline/cells/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/common/search_strategy/index_fields/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/types/timeline/cells/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/common/types/timeline/cells/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/types/header_actions/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/common/types/timeline/cells/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/types/header_actions/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/common/types/header_actions/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/lib/kuery/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/common/types/header_actions/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/lib/kuery/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/lib/kuery/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/lib/kuery/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/lib/kuery/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/lib/kuery/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/lib/kuery/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/lib/kuery/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/lib/kuery/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/lib/kuery/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/lib/kuery/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/lib/kuery/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/lib/kuery/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/lib/kuery/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/lib/kuery/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/lib/kuery/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/lib/kuery/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/lib/kuery/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/lib/kuery/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/lib/kuery/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/lib/kuery/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/lib/kuery/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/control_columns/transform_control_columns.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/control_columns/transform_control_columns.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/components/control_columns/transform_control_columns.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/components/control_columns/transform_control_columns.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.test.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/mock.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.test.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/mock.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/containers/source/mock.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/sourcerer/store/model.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/containers/source/mock.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/sourcerer/store/model.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/model.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/sourcerer/store/model.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/model.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/use_data_view.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/model.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/use_data_view.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/containers/source/use_data_view.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/containers/source/use_data_view.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/containers/source/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/containers/source/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/containers/source/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/containers/source/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/containers/source/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/containers/source/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/helpers.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/helpers.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/helpers.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/helpers.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/helpers.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/helpers.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/helpers.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/helpers.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/helpers.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/helpers.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/helpers.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/helpers.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_actions.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_actions.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_actions.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_actions.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_actions.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_badge.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_actions.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_badge.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_badge.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_badge.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/add_data_provider_popover.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/add_data_provider_popover.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/empty.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/empty.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/add_data_provider_popover.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/providers.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/add_data_provider_popover.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/providers.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/empty.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/empty.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/providers.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/providers.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/components/top_n/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_event_details.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/components/top_n/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_event_details.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_event_details.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/flyout/document_details/shared/context.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_event_details.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/flyout/document_details/shared/context.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/context.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/flyout/document_details/right/tabs/table_tab.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/context.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/flyout/document_details/right/tabs/table_tab.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/tabs/table_tab.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/flyout/document_details/right/tabs/table_tab.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/tabs/table_tab.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/flyout/document_details/right/utils/enriched_field_info.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/tabs/table_tab.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/flyout/document_details/right/utils/enriched_field_info.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/utils.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/utils.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/utils.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/utils.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/utils/enriched_field_info.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_browser_fields.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_browser_fields.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/utils/enriched_field_info.ts" }, { "plugin": "@kbn/securitysolution-data-table", @@ -4097,6 +4089,14 @@ { "plugin": "@kbn/securitysolution-data-table", "path": "x-pack/solutions/security/packages/data_table/mock/mock_source.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_browser_fields.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_browser_fields.ts" } ], "initialIsOpen": false @@ -4195,7 +4195,7 @@ ], "label": "DeprecatedCellValueElementProps", "description": [ - "\nThe following props are provided to the function called by `renderCellValue`.\nWarning: This type might be outdated. Therefore, migrate to the new one from\n`plugins/security_solution/common/types/timeline/cells/index.ts`." + "\nThe following props are provided to the function called by `renderCellValue`.\nWarning: This type might be outdated. Therefore, migrate to the new one from\n`solutions/security/plugins/security_solution/common/types/timeline/cells/index.ts`." ], "signature": [ "EuiDataGridCellValueElementProps", @@ -4263,11 +4263,11 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx" + "path": "x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/index.tsx" } ], "initialIsOpen": false @@ -4347,27 +4347,27 @@ "references": [ { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/common/search_strategy/index_fields/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts" + "path": "x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" + "path": "x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts" } ], "initialIsOpen": false diff --git a/api_docs/timelines.mdx b/api_docs/timelines.mdx index 868c7979d56da..01510bd9702eb 100644 --- a/api_docs/timelines.mdx +++ b/api_docs/timelines.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/timelines title: "timelines" image: https://source.unsplash.com/400x175/?github description: API docs for the timelines plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'timelines'] --- import timelinesObj from './timelines.devdocs.json'; diff --git a/api_docs/transform.mdx b/api_docs/transform.mdx index 3c8150febee49..55971fa847f57 100644 --- a/api_docs/transform.mdx +++ b/api_docs/transform.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/transform title: "transform" image: https://source.unsplash.com/400x175/?github description: API docs for the transform plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'transform'] --- import transformObj from './transform.devdocs.json'; diff --git a/api_docs/triggers_actions_ui.mdx b/api_docs/triggers_actions_ui.mdx index 2f23d7290d015..a13ba2194a69f 100644 --- a/api_docs/triggers_actions_ui.mdx +++ b/api_docs/triggers_actions_ui.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/triggersActionsUi title: "triggersActionsUi" image: https://source.unsplash.com/400x175/?github description: API docs for the triggersActionsUi plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'triggersActionsUi'] --- import triggersActionsUiObj from './triggers_actions_ui.devdocs.json'; diff --git a/api_docs/ui_actions.mdx b/api_docs/ui_actions.mdx index 754aef05ec21f..23b397c7b5a2f 100644 --- a/api_docs/ui_actions.mdx +++ b/api_docs/ui_actions.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uiActions title: "uiActions" image: https://source.unsplash.com/400x175/?github description: API docs for the uiActions plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActions'] --- import uiActionsObj from './ui_actions.devdocs.json'; diff --git a/api_docs/ui_actions_enhanced.mdx b/api_docs/ui_actions_enhanced.mdx index b27933cb17d41..b90d759d538e8 100644 --- a/api_docs/ui_actions_enhanced.mdx +++ b/api_docs/ui_actions_enhanced.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uiActionsEnhanced title: "uiActionsEnhanced" image: https://source.unsplash.com/400x175/?github description: API docs for the uiActionsEnhanced plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uiActionsEnhanced'] --- import uiActionsEnhancedObj from './ui_actions_enhanced.devdocs.json'; diff --git a/api_docs/unified_doc_viewer.mdx b/api_docs/unified_doc_viewer.mdx index 8228f5579ba4e..e4027cba28248 100644 --- a/api_docs/unified_doc_viewer.mdx +++ b/api_docs/unified_doc_viewer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedDocViewer title: "unifiedDocViewer" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedDocViewer plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedDocViewer'] --- import unifiedDocViewerObj from './unified_doc_viewer.devdocs.json'; diff --git a/api_docs/unified_histogram.mdx b/api_docs/unified_histogram.mdx index 55df6a34560b5..6a92acf4f886a 100644 --- a/api_docs/unified_histogram.mdx +++ b/api_docs/unified_histogram.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedHistogram title: "unifiedHistogram" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedHistogram plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedHistogram'] --- import unifiedHistogramObj from './unified_histogram.devdocs.json'; diff --git a/api_docs/unified_search.mdx b/api_docs/unified_search.mdx index 74f24c5082b1e..5d73dcd94c28c 100644 --- a/api_docs/unified_search.mdx +++ b/api_docs/unified_search.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedSearch title: "unifiedSearch" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedSearch plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch'] --- import unifiedSearchObj from './unified_search.devdocs.json'; diff --git a/api_docs/unified_search_autocomplete.mdx b/api_docs/unified_search_autocomplete.mdx index 1959d26e1b8f9..803d5daaa841a 100644 --- a/api_docs/unified_search_autocomplete.mdx +++ b/api_docs/unified_search_autocomplete.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/unifiedSearch-autocomplete title: "unifiedSearch.autocomplete" image: https://source.unsplash.com/400x175/?github description: API docs for the unifiedSearch.autocomplete plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'unifiedSearch.autocomplete'] --- import unifiedSearchAutocompleteObj from './unified_search_autocomplete.devdocs.json'; diff --git a/api_docs/uptime.mdx b/api_docs/uptime.mdx index 42327497a4524..32a44d3be1620 100644 --- a/api_docs/uptime.mdx +++ b/api_docs/uptime.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/uptime title: "uptime" image: https://source.unsplash.com/400x175/?github description: API docs for the uptime plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'uptime'] --- import uptimeObj from './uptime.devdocs.json'; diff --git a/api_docs/url_forwarding.mdx b/api_docs/url_forwarding.mdx index fe7f17537e6a3..cc47aee78a473 100644 --- a/api_docs/url_forwarding.mdx +++ b/api_docs/url_forwarding.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/urlForwarding title: "urlForwarding" image: https://source.unsplash.com/400x175/?github description: API docs for the urlForwarding plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'urlForwarding'] --- import urlForwardingObj from './url_forwarding.devdocs.json'; diff --git a/api_docs/usage_collection.mdx b/api_docs/usage_collection.mdx index 0fbf4b92f4305..bf548b4bda351 100644 --- a/api_docs/usage_collection.mdx +++ b/api_docs/usage_collection.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/usageCollection title: "usageCollection" image: https://source.unsplash.com/400x175/?github description: API docs for the usageCollection plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'usageCollection'] --- import usageCollectionObj from './usage_collection.devdocs.json'; diff --git a/api_docs/ux.mdx b/api_docs/ux.mdx index b45c8d36b2df9..43141e952c6bb 100644 --- a/api_docs/ux.mdx +++ b/api_docs/ux.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/ux title: "ux" image: https://source.unsplash.com/400x175/?github description: API docs for the ux plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ux'] --- import uxObj from './ux.devdocs.json'; diff --git a/api_docs/vis_default_editor.mdx b/api_docs/vis_default_editor.mdx index 5ea0cc7513b80..1b8bf23cbc877 100644 --- a/api_docs/vis_default_editor.mdx +++ b/api_docs/vis_default_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visDefaultEditor title: "visDefaultEditor" image: https://source.unsplash.com/400x175/?github description: API docs for the visDefaultEditor plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visDefaultEditor'] --- import visDefaultEditorObj from './vis_default_editor.devdocs.json'; diff --git a/api_docs/vis_type_gauge.mdx b/api_docs/vis_type_gauge.mdx index ea353603bbed9..0cab4afd538cc 100644 --- a/api_docs/vis_type_gauge.mdx +++ b/api_docs/vis_type_gauge.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeGauge title: "visTypeGauge" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeGauge plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeGauge'] --- import visTypeGaugeObj from './vis_type_gauge.devdocs.json'; diff --git a/api_docs/vis_type_heatmap.mdx b/api_docs/vis_type_heatmap.mdx index fef00021ad8d3..23b0529eb7342 100644 --- a/api_docs/vis_type_heatmap.mdx +++ b/api_docs/vis_type_heatmap.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeHeatmap title: "visTypeHeatmap" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeHeatmap plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeHeatmap'] --- import visTypeHeatmapObj from './vis_type_heatmap.devdocs.json'; diff --git a/api_docs/vis_type_pie.mdx b/api_docs/vis_type_pie.mdx index 208d388e98bf3..c16f1d1efbe82 100644 --- a/api_docs/vis_type_pie.mdx +++ b/api_docs/vis_type_pie.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypePie title: "visTypePie" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypePie plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypePie'] --- import visTypePieObj from './vis_type_pie.devdocs.json'; diff --git a/api_docs/vis_type_table.mdx b/api_docs/vis_type_table.mdx index 3867d78a82815..85d9f7d8fe2d6 100644 --- a/api_docs/vis_type_table.mdx +++ b/api_docs/vis_type_table.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTable title: "visTypeTable" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTable plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTable'] --- import visTypeTableObj from './vis_type_table.devdocs.json'; diff --git a/api_docs/vis_type_timelion.mdx b/api_docs/vis_type_timelion.mdx index c94880612324f..64c11ccddea9e 100644 --- a/api_docs/vis_type_timelion.mdx +++ b/api_docs/vis_type_timelion.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTimelion title: "visTypeTimelion" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTimelion plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimelion'] --- import visTypeTimelionObj from './vis_type_timelion.devdocs.json'; diff --git a/api_docs/vis_type_timeseries.mdx b/api_docs/vis_type_timeseries.mdx index eb421e85d90cf..e1ed183fe8272 100644 --- a/api_docs/vis_type_timeseries.mdx +++ b/api_docs/vis_type_timeseries.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeTimeseries title: "visTypeTimeseries" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeTimeseries plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeTimeseries'] --- import visTypeTimeseriesObj from './vis_type_timeseries.devdocs.json'; diff --git a/api_docs/vis_type_vega.mdx b/api_docs/vis_type_vega.mdx index 10659cd5fcfa2..1f630d3c43c40 100644 --- a/api_docs/vis_type_vega.mdx +++ b/api_docs/vis_type_vega.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeVega title: "visTypeVega" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeVega plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVega'] --- import visTypeVegaObj from './vis_type_vega.devdocs.json'; diff --git a/api_docs/vis_type_vislib.mdx b/api_docs/vis_type_vislib.mdx index b2307719c9a3c..e996ae141aeab 100644 --- a/api_docs/vis_type_vislib.mdx +++ b/api_docs/vis_type_vislib.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeVislib title: "visTypeVislib" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeVislib plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeVislib'] --- import visTypeVislibObj from './vis_type_vislib.devdocs.json'; diff --git a/api_docs/vis_type_xy.mdx b/api_docs/vis_type_xy.mdx index 91e90b024ae2e..8ca0f55262678 100644 --- a/api_docs/vis_type_xy.mdx +++ b/api_docs/vis_type_xy.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visTypeXy title: "visTypeXy" image: https://source.unsplash.com/400x175/?github description: API docs for the visTypeXy plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visTypeXy'] --- import visTypeXyObj from './vis_type_xy.devdocs.json'; diff --git a/api_docs/visualizations.devdocs.json b/api_docs/visualizations.devdocs.json index 5e2ffe587d533..9de2b4cce618e 100644 --- a/api_docs/visualizations.devdocs.json +++ b/api_docs/visualizations.devdocs.json @@ -1476,44 +1476,6 @@ "deprecated": false, "trackAdoption": false, "isRequired": false - }, - { - "parentPluginId": "visualizations", - "id": "def-public.VisualizeEmbeddable.Unnamed.$5", - "type": "Object", - "tags": [], - "label": "parent", - "description": [], - "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - "> | undefined" - ], - "path": "src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": false } ], "returnComment": [] @@ -6828,31 +6790,7 @@ "section": "def-public.ViewMode", "text": "ViewMode" }, - ">; uuid: string; readonly parent?: ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - "> | undefined; destroy: () => void; dataViews: ", + ">; uuid: string; destroy: () => void; dataViews: ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -6932,31 +6870,7 @@ "section": "def-public.PublishingSubject", "text": "PublishingSubject" }, - "; setDisabledActionIds: (ids: string[] | undefined) => void; parentApi: (", - { - "pluginId": "@kbn/presentation-containers", - "scope": "public", - "docId": "kibKbnPresentationContainersPluginApi", - "section": "def-public.PresentationContainer", - "text": "PresentationContainer" - }, - " & Partial & ", - { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.PublishesViewMode", - "text": "PublishesViewMode" - }, - ">) | undefined; hasLockedHoverActions$: ", + "; setDisabledActionIds: (ids: string[] | undefined) => void; hasLockedHoverActions$: ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -7060,7 +6974,7 @@ "section": "def-common.TimeRange", "text": "TimeRange" }, - " | undefined) => void; linkToLibrary: (() => Promise) | undefined; unlinkFromLibrary: (() => Promise) | undefined; getExplicitInput: () => ", + " | undefined) => void; linkToLibrary: (() => Promise) | undefined; unlinkFromLibrary: (() => Promise) | undefined; getExplicitInput: () => Readonly<", { "pluginId": "visualizations", "scope": "public", @@ -7068,7 +6982,7 @@ "section": "def-public.VisualizeInput", "text": "VisualizeInput" }, - "; getDescription: () => string; phase$: ", + ">; getDescription: () => string; phase$: ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -7158,7 +7072,7 @@ "VisualizeByValueInput", ">; getInputAsRefType: () => Promise<", "VisualizeByReferenceInput", - ">; readonly runtimeId: number; readonly isContainer: boolean; readonly deferEmbeddableLoad: boolean; catchError?: ((error: ", + ">; readonly runtimeId: number; readonly deferEmbeddableLoad: boolean; catchError?: ((error: ", { "pluginId": "expressions", "scope": "common", @@ -7166,39 +7080,7 @@ "section": "def-common.ErrorLike", "text": "ErrorLike" }, - ", domNode: HTMLElement | Element) => any) | undefined; fatalError?: Error | undefined; getAppContext: () => ", - { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.EmbeddableAppContext", - "text": "EmbeddableAppContext" - }, - " | undefined; refreshInputFromParent: () => void; getIsContainer: () => this is ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - ">; getUpdated$: () => Readonly<", + ", domNode: HTMLElement | Element) => any) | undefined; fatalError?: Error | undefined; getUpdated$: () => Readonly<", "Observable", "<", { @@ -7224,7 +7106,7 @@ "section": "def-public.VisualizeInput", "text": "VisualizeInput" }, - ">) => Promise; getPersistableInput: () => ", + ">) => Promise; getPersistableInput: () => Readonly<", { "pluginId": "visualizations", "scope": "public", @@ -7232,7 +7114,7 @@ "section": "def-public.VisualizeInput", "text": "VisualizeInput" }, - "; getInput: () => Readonly<", + ">; getInput: () => Readonly<", { "pluginId": "visualizations", "scope": "public", @@ -7240,55 +7122,7 @@ "section": "def-public.VisualizeInput", "text": "VisualizeInput" }, - ">; getTitle: () => string; getRoot: () => ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IEmbeddable", - "text": "IEmbeddable" - }, - "<", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" - }, - ", ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" - }, - ", any> | ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - ">; untilInitializationFinished: () => Promise; updateOutput: (outputChanges: Partial<", + ">; getTitle: () => string; untilInitializationFinished: () => Promise; updateOutput: (outputChanges: Partial<", "VisualizeOutput", ">) => void; }" ], @@ -7296,197 +7130,6 @@ "deprecated": false, "trackAdoption": false, "initialIsOpen": false - }, - { - "parentPluginId": "visualizations", - "id": "def-public.VisualizeEmbeddableFactoryContract", - "type": "Type", - "tags": [], - "label": "VisualizeEmbeddableFactoryContract", - "description": [], - "signature": [ - "{ readonly type: \"visualization\"; create: (input: ", - { - "pluginId": "visualizations", - "scope": "public", - "docId": "kibVisualizationsPluginApi", - "section": "def-public.VisualizeInput", - "text": "VisualizeInput" - }, - " & { savedVis?: ", - { - "pluginId": "visualizations", - "scope": "common", - "docId": "kibVisualizationsPluginApi", - "section": "def-common.SerializedVis", - "text": "SerializedVis" - }, - "<", - { - "pluginId": "visualizations", - "scope": "common", - "docId": "kibVisualizationsPluginApi", - "section": "def-common.VisParams", - "text": "VisParams" - }, - "> | undefined; }, parent?: ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - "> | undefined) => Promise<", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ErrorEmbeddable", - "text": "ErrorEmbeddable" - }, - " | ", - { - "pluginId": "visualizations", - "scope": "public", - "docId": "kibVisualizationsPluginApi", - "section": "def-public.VisualizeEmbeddable", - "text": "VisualizeEmbeddable" - }, - " | undefined>; inject: (_state: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - }, - ", references: ", - { - "pluginId": "@kbn/core-saved-objects-common", - "scope": "common", - "docId": "kibKbnCoreSavedObjectsCommonPluginApi", - "section": "def-common.SavedObjectReference", - "text": "SavedObjectReference" - }, - "[]) => ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - }, - "; extract: (_state: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - }, - ") => { state: ", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableStateWithType", - "text": "EmbeddableStateWithType" - }, - "; references: ", - { - "pluginId": "@kbn/core-saved-objects-common", - "scope": "common", - "docId": "kibKbnCoreSavedObjectsCommonPluginApi", - "section": "def-common.SavedObjectReference", - "text": "SavedObjectReference" - }, - "[]; }; getDisplayName: () => string; isEditable: () => Promise; createFromSavedObject: (savedObjectId: string, input: Partial<", - { - "pluginId": "visualizations", - "scope": "public", - "docId": "kibVisualizationsPluginApi", - "section": "def-public.VisualizeInput", - "text": "VisualizeInput" - }, - "> & { id: string; }, parent?: ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IContainer", - "text": "IContainer" - }, - "<{}, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerInput", - "text": "ContainerInput" - }, - "<{}>, ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ContainerOutput", - "text": "ContainerOutput" - }, - "> | undefined) => Promise<", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ErrorEmbeddable", - "text": "ErrorEmbeddable" - }, - " | ", - { - "pluginId": "visualizations", - "scope": "public", - "docId": "kibVisualizationsPluginApi", - "section": "def-public.VisualizeEmbeddable", - "text": "VisualizeEmbeddable" - }, - ">; readonly savedObjectMetaData: ", - { - "pluginId": "savedObjectsFinder", - "scope": "public", - "docId": "kibSavedObjectsFinderPluginApi", - "section": "def-public.SavedObjectMetaData", - "text": "SavedObjectMetaData" - }, - "; getCurrentAppId: () => Promise; checkTitle: (props: ", - { - "pluginId": "savedObjects", - "scope": "public", - "docId": "kibSavedObjectsPluginApi", - "section": "def-public.OnSaveProps", - "text": "OnSaveProps" - }, - ") => Promise; }" - ], - "path": "src/plugins/visualizations/public/index.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false } ], "objects": [ diff --git a/api_docs/visualizations.mdx b/api_docs/visualizations.mdx index 55ddd823bde26..084b21a46e04f 100644 --- a/api_docs/visualizations.mdx +++ b/api_docs/visualizations.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/visualizations title: "visualizations" image: https://source.unsplash.com/400x175/?github description: API docs for the visualizations plugin -date: 2024-12-16 +date: 2024-12-17 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visualizations'] --- import visualizationsObj from './visualizations.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/k | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 871 | 12 | 840 | 21 | +| 869 | 12 | 838 | 21 | ## Client diff --git a/config/serverless.security.yml b/config/serverless.security.yml index 47a67c293565a..0e3a0c92f8546 100644 --- a/config/serverless.security.yml +++ b/config/serverless.security.yml @@ -106,7 +106,7 @@ xpack.fleet.internal.registry.excludePackages: [ 'dga', # Unsupported in serverless - 'cloud-defend', + 'cloud_defend', ] # fleet_server package installed to publish agent metrics xpack.fleet.packages: diff --git a/dev_docs/key_concepts/building_blocks.mdx b/dev_docs/key_concepts/building_blocks.mdx index 29cf2df7a764f..1afac686d1adc 100644 --- a/dev_docs/key_concepts/building_blocks.mdx +++ b/dev_docs/key_concepts/building_blocks.mdx @@ -42,7 +42,7 @@ and . Every feature that is added to a registered (Lens, Maps, Saved Searches and more) will be available automatically, as well as any that are added to the Embeddable context menu panel (for example, drilldowns, custom panel time ranges, and "share to" features). +with the . Every feature that is added to a registered (Lens, Maps, Discover sessions and more) will be available automatically, as well as any that are added to the Embeddable context menu panel (for example, drilldowns, custom panel time ranges, and "share to" features). The Dashboard Embeddable is one of the highest-level UI components you can add to your application. diff --git a/dev_docs/tutorials/performance/adding_custom_performance_metrics.mdx b/dev_docs/tutorials/performance/adding_custom_performance_metrics.mdx index 37322e3f55e05..41570826ad2bd 100644 --- a/dev_docs/tutorials/performance/adding_custom_performance_metrics.mdx +++ b/dev_docs/tutorials/performance/adding_custom_performance_metrics.mdx @@ -294,7 +294,63 @@ This event will be indexed with the following structure: } ``` +#### Add time ranges + +The meta field supports telemetry on time ranges, providing calculated metrics for enhanced context. This includes: + +- **Query range in ceconds:** + + - Calculated as the time difference in seconds between `rangeFrom` and `rangeTo`. + +- **Offset calculation:** + - A **negative offset** indicates that `rangeTo` is in the past. + - A **positive offset** indicates that `rangeTo` is in the future. + - An offset of **zero** indicates that `rangeTo` matches `'now'`. + +###### Code example + +``` +onPageReady({ + meta: { + rangeFrom: 'now-15m', + rangeTo: 'now', + } +}); +``` + +This will be indexed as: + +```typescript +{ + "_index": "backing-ebt-kibana-browser-performance-metrics-000001", // Performance metrics are stored in a dedicated simplified index (browser \ server). + "_source": { + "timestamp": "2024-08-13T11:29:58.275Z" + "event_type": "performance_metric", // All performance events share a common event type to simplify mapping + "eventName": 'kibana:plugin_render_time', // Event name as specified when reporting it + "duration": 736, // Event duration as specified when reporting it + "meta": { + "target": '/home', + "query_range_secs": 900 + "query_offset_secs": 0 // now + }, + "context": { // Context holds information identifying the deployment, version, application and page that generated the event + "version": "8.16.0-SNAPSHOT", + "cluster_name": "elasticsearch", + "pageName": "application:home:app", + "applicationId": "home", + "page": "app", + "entityId": "61c58ad0-3dd3-11e8-b2b9-5d5dc1715159", + "branch": "main", + ... + }, + + ... + }, +} +``` + #### Add custom metrics + Having `kibana:plugin_render_time` metric event is not always enough, depending on the use case you would likely need some complementary information to give some sense to the value reported by the metric (e.g. number of hosts, number of services, number of dataStreams, etc). `kibana:plugin_render_time` metric API supports up to 9 numbered free fields that can be used to report numeric metrics that you intend to analyze. Note that they can be used for any type of numeric information you may want to report. @@ -304,10 +360,12 @@ We could make use of these custom metrics using the following format: ... // Call onPageReady once the meaningful data has rendered and visible to the user onPageReady({ - key1: 'datasets', - value1: 5, - key2: 'documents', - value2: 1000, + customMetrics: { + key1: 'datasets', + value1: 5, + key2: 'documents', + value2: 1000, + } }); ... ``` diff --git a/docs/concepts/data-views.asciidoc b/docs/concepts/data-views.asciidoc index 02922b2989762..eb090554186a8 100644 --- a/docs/concepts/data-views.asciidoc +++ b/docs/concepts/data-views.asciidoc @@ -166,7 +166,7 @@ clusters or indicies from cross-cluster search]. When you delete a {data-source}, you cannot recover the associated field formatters, runtime fields, source filters, and field popularity data. Deleting a {data-source} does not remove any indices or data documents from {es}. -WARNING: Deleting a {data-source} breaks all visualizations, saved searches, and other saved objects that reference the data view. +WARNING: Deleting a {data-source} breaks all visualizations, saved Discover sessions, and other saved objects that reference the data view. . Go to the **Data Views** management page using the navigation menu or the <>. diff --git a/docs/concepts/esql.asciidoc b/docs/concepts/esql.asciidoc index a3a091a4c6d0a..0b9af290c2d8d 100644 --- a/docs/concepts/esql.asciidoc +++ b/docs/concepts/esql.asciidoc @@ -26,7 +26,7 @@ disabled using the `enableESQL` setting from the {kibana-ref}/advanced-options.html[Advanced Settings]. This will hide the {esql} user interface from various applications. -However, users will be able to access existing {esql} artifacts like saved searches and visualizations. +However, users will be able to access existing {esql} artifacts like saved Discover sessions and visualizations. ==== [float] diff --git a/docs/concepts/save-query.asciidoc b/docs/concepts/save-query.asciidoc index b249f7e9aea26..a4d6dd28ea6e1 100644 --- a/docs/concepts/save-query.asciidoc +++ b/docs/concepts/save-query.asciidoc @@ -11,10 +11,10 @@ Save this query, and you can embed the search results in dashboards, use them as a foundation for building a visualization, and share them in a link or CVS form. -Saved queries are different than <>, +Saved queries are different than <>, which include the *Discover* configuration—selected columns in the document table, sort order, and {data-source}—in addition to the query. -Saved searches are primarily used for adding search results to a dashboard. +Discover sessions are primarily used for adding search results to a dashboard. [role="xpack"] ==== Read-only access diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index 101dcdec07810..80511095a000f 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -309,6 +309,7 @@ oss plugins. |{kib-repo}blob/{branch}/src/plugins/saved_search/README.md[savedSearch] |Contains the saved search saved object definition and helpers. +This object is created when a user saves their current session in the Discover app. |{kib-repo}blob/{branch}/src/plugins/screenshot_mode/README.md[screenshotMode] @@ -470,7 +471,7 @@ The plugin exposes the static DefaultEditorController class to consume. |WARNING: Missing README. -|{kib-repo}blob/{branch}/x-pack/plugins/asset_inventory/README.md[assetInventory] +|{kib-repo}blob/{branch}/x-pack/solutions/security/plugins/asset_inventory/README.md[assetInventory] |Centralized asset inventory experience within the Elastic Security solution. A central place for users to view and manage all their assets from different environments. @@ -499,7 +500,7 @@ It was removed, but the plugin was left behind to register no longer used config |Static migration page where self-managed users can see text/copy about migrating to Elastic Cloud -|{kib-repo}blob/{branch}/x-pack/plugins/cloud_defend/README.md[cloudDefend] +|{kib-repo}blob/{branch}/x-pack/solutions/security/plugins/cloud_defend/README.md[cloudDefend] |This plugin currently only exists to provide custom fleet policy UX for a set of new BPF LSM features. The first feature being container "drift prevention". @@ -516,7 +517,7 @@ This plugin no-longer exposes any evaluation APIs. Refer to > and the time range with the search. +. Once you've created a view worth saving, click *Save* in the toolbar. +. Enter a name for the session. +. Optionally store <> and the time range with the session. . Click *Save*. -. To reload your search results in *Discover*, click *Open* in the toolbar, and select the saved search. +. To reload your search results in *Discover*, click *Open* in the toolbar, and select the saved Discover session. + -If the saved search is associated with a different {data-source} than is currently -selected, opening the saved search changes the selected {data-source}. The query language -used for the saved search is also automatically selected. +If the saved Discover session is associated with a different {data-source} than is currently +selected, opening the saved Discover session changes the selected {data-source}. The query language +used for the saved Discover session is also automatically selected. [float] -=== Duplicate a search -. In **Discover**, open the search that you want to duplicate. +=== Duplicate a Discover session +. In **Discover**, open the Discover session that you want to duplicate. . In the toolbar, click *Save*. -. Give the search a new name. -. Turn on **Save as new search**. +. Give the session a new name. +. Turn on **Save as new Discover session**. . Click *Save*. @@ -46,5 +46,5 @@ used for the saved search is also automatically selected. . Go to *Dashboards*. . Open or create the dashboard, then click *Edit*. . Click *Add from library*. -. From the *Types* dropdown, select *Saved search*. -. Select the saved search that you want to visualize, then click *X* to close the list. +. From the *Types* dropdown, select *Discover session*. +. Select the Discover session that you want to add, then click *X* to close the list. diff --git a/docs/discover/search-sessions.asciidoc b/docs/discover/search-sessions.asciidoc index fe1e945e676ff..5d6b4a2d00435 100644 --- a/docs/discover/search-sessions.asciidoc +++ b/docs/discover/search-sessions.asciidoc @@ -52,7 +52,7 @@ image::images/search-session-awhile.png[Search Session indicator displaying the Once you save a search session, you can start a new search, navigate to a different application, or close the browser. -. To view your saved searches, go to the +. To view your saved search sessions, go to the *Search Sessions* management page using the navigation menu or the <>. For a saved or completed session, you can also open this view from the search sessions popup. diff --git a/docs/discover/search.asciidoc b/docs/discover/search.asciidoc index 439c5c443cc02..c7fde4159ec98 100644 --- a/docs/discover/search.asciidoc +++ b/docs/discover/search.asciidoc @@ -92,10 +92,10 @@ status:[400 TO 499] AND (extension:php OR extension:html) [[save-open-search]] -=== Save a search -A saved search persists your current view of Discover for later retrieval and reuse. You can reload a saved search into Discover, add it to a dashboard, and use it as the basis for a visualization. +=== Save a Discover session +A saved Discover session persists your current view of Discover for later retrieval and reuse. You can reload a saved session into Discover, add it to a dashboard, and use it as the basis for a visualization. -A saved search includes the query text, filters, and optionally, the time filter. A saved search also includes the selected columns in the document table, the sort order, and the current index pattern. +A Discover session includes the query text, filters, and optionally, the time filter. A Discover session also includes the selected columns in the document table, the sort order, and the current {data-source}. [role="xpack"] [[discover-read-only-access]] @@ -107,23 +107,23 @@ Kibana see <>. [role="screenshot"] image::discover/images/read-only-badge.png[Example of Discover's read only access indicator in Kibana's header] -==== Save a search -To save the current search: +==== Save a Discover session +To save the current session: . Click *Save* in the toolbar. -. Enter a name for the search and click *Save*. +. Enter a name for the session and click *Save*. -To import, export, and delete saved searches, go to the *Saved Objects* management page using the navigation menu or the <>. +To import, export, and delete saved Discover sessions, go to the *Saved Objects* management page using the navigation menu or the <>. -==== Open a saved search -To load a saved search into Discover: +==== Open a saved Discover session +To load a saved session into Discover: . Click *Open* in the toolbar. -. Select the search you want to open. +. Select the session you want to open. -If the saved search is associated with a different index pattern than is currently -selected, opening the saved search changes the selected index pattern. The query language -used for the saved search will also be automatically selected. +If the saved Discover session is associated with a different {data-source} than is currently +selected, opening the saved Discover session changes the selected {data-source}. The query language +used for the saved Discover session will also be automatically selected. [[save-load-delete-query]] === Save a query @@ -133,7 +133,7 @@ A saved query is a portable collection of query text and filters that you can re * View the results of the same query in multiple apps * Share your query -Saved queries don't include information specific to Discover, such as the currently selected columns in the document table, the sort order, and the index pattern. If you want to save your current view of Discover for later retrieval and reuse, create a <> instead. +Saved queries don't include information specific to Discover, such as the currently selected columns in the document table, the sort order, and the {data-source}. If you want to save your current view of Discover for later retrieval and reuse, create a <> instead. [role="xpack"] ==== Read-only access diff --git a/docs/fleet/fleet.asciidoc b/docs/fleet/fleet.asciidoc index 52c2825557001..366d28fae3f5e 100644 --- a/docs/fleet/fleet.asciidoc +++ b/docs/fleet/fleet.asciidoc @@ -18,7 +18,7 @@ It is recommended for advanced users only. [role="screenshot"] image::fleet/images/fleet-start.png[{fleet} app in {kib}] -Most integration content installed by {fleet} isn’t editable. This content is tagged with a **Managed** badge in the {kib} UI. Managed content itself cannot be edited or deleted, however managed visualizations, dashboards, and saved searches can be cloned. +Most integration content installed by {fleet} isn’t editable. This content is tagged with a **Managed** badge in the {kib} UI. Managed content itself cannot be edited or deleted, however managed visualizations, dashboards, and Discover sessions can be cloned. [role="screenshot"] image::fleet/images/system-managed.png[An image of the new managed badge.] @@ -37,7 +37,7 @@ To clone a dashboard: . Click *Save and return* after editing the dashboard. . Click *Save*. -To clone managed content relating to specific visualization editors, such as Lens, TSVB, and Maps, view the visualization in the editor then begin to make edits. Unlike cloning dashboards, and dashboard panels, the cloned content retains the original configurations. Once finished you are prompted to save the edits as a new visualization. The same applies for altering any saved searches in a managed visualization. +To clone managed content relating to specific visualization editors, such as Lens, TSVB, and Maps, view the visualization in the editor then begin to make edits. Unlike cloning dashboards, and dashboard panels, the cloned content retains the original configurations. Once finished you are prompted to save the edits as a new visualization. The same applies for altering any linked Discover sessions in a managed visualization. [float] == Get started diff --git a/docs/management/advanced-options.asciidoc b/docs/management/advanced-options.asciidoc index ef6d6306792b1..5f51a86b01aed 100644 --- a/docs/management/advanced-options.asciidoc +++ b/docs/management/advanced-options.asciidoc @@ -311,7 +311,7 @@ Sets the maximum number of rows for the entire document table. This is the maxim [[discover-searchonpageload]]`discover:searchOnPageLoad`:: Controls whether a search is executed when *Discover* first loads. This setting -does not have an effect when loading a saved search. +does not have an effect when loading a saved Discover session. [[discover:showFieldStatistics]]`discover:showFieldStatistics`:: beta[] Enables the Field statistics view. Examine details such as @@ -324,10 +324,10 @@ Controls the display of multi-fields in the expanded document view. The default sort direction for time-based data views. [[doctable-hidetimecolumn]]`doc_table:hideTimeColumn`:: -Hides the "Time" column in *Discover* and in all saved searches on dashboards. +Hides the "Time" column in *Discover* and in all Discover session panels on dashboards. [[doctable-highlight]]`doc_table:highlight`:: -Highlights results in *Discover* and saved searches on dashboards. Highlighting +Highlights search results in *Discover* and Discover session panels on dashboards. Highlighting slows requests when working on big documents. diff --git a/docs/search/playground/index.asciidoc b/docs/search/playground/index.asciidoc index 72d8eccab47c1..465637e79bc02 100644 --- a/docs/search/playground/index.asciidoc +++ b/docs/search/playground/index.asciidoc @@ -18,7 +18,16 @@ Refer to the following for more advanced topics: * <> * <> -* <> +* <> + +.🍿 Getting started videos +*********************** +Watch these video tutorials to help you get started: + +* https://www.youtube.com/watch?v=zTHgJ3rhe10[Getting Started] +* https://www.youtube.com/watch?v=ZtxoASFvkno[Using Playground with local LLMs] +*********************** + [float] [[playground-how-it-works]] @@ -259,4 +268,4 @@ Once you've got {x} up and running, and you've tested out the chat interface, yo include::playground-context.asciidoc[] include::playground-query.asciidoc[] -include::playground-troubleshooting.asciidoc[] \ No newline at end of file +include::playground-troubleshooting.asciidoc[] diff --git a/docs/setup/configuring-reporting.asciidoc b/docs/setup/configuring-reporting.asciidoc index bcef6a0266251..8711185dbc1bb 100644 --- a/docs/setup/configuring-reporting.asciidoc +++ b/docs/setup/configuring-reporting.asciidoc @@ -121,8 +121,8 @@ PUT :/api/security/role/custom_reporting_user // CONSOLE <1> Grants access to generate PNG and PDF reports in *Dashboard*. -<2> Grants access to generate CSV reports from saved search panels in *Dashboard*. -<3> Grants access to generate CSV reports from saved searches in *Discover*. +<2> Grants access to generate CSV reports from saved Discover session panels in *Dashboard*. +<3> Grants access to generate CSV reports from saved Discover sessions in *Discover*. <4> Grants access to generate PDF reports in *Canvas*. <5> Grants access to generate PNG and PDF reports in *Visualize Library*. @@ -157,8 +157,8 @@ PUT localhost:5601/api/security/role/custom_reporting_user --------------------------------------------------------------- // CONSOLE -<1> Grants access to generate CSV reports from saved searches in *Discover*. -<2> Grants access to generate CSV reports from saved search panels in *Dashboard*. +<1> Grants access to generate CSV reports from saved Discover sessions in *Discover*. +<2> Grants access to generate CSV reports from saved Discover session panels in *Dashboard*. [float] [[grant-user-access-external-provider]] diff --git a/docs/user/dashboard/aggregation-based.asciidoc b/docs/user/dashboard/aggregation-based.asciidoc index f27d60928e6fe..e3f1f0bea6718 100644 --- a/docs/user/dashboard/aggregation-based.asciidoc +++ b/docs/user/dashboard/aggregation-based.asciidoc @@ -7,7 +7,7 @@ With aggregation-based visualizations, you can: * Split charts up to three aggregation levels, which is more than *Lens* and *TSVB* * Create visualization with non-time series data -* Use a <> as an input +* Use a <> as an input * Sort data tables and use the summary row and percentage column features * Assign colors to data series * Extend features with plugins @@ -112,7 +112,7 @@ Choose the type of visualization you want to create, then use the editor to conf .. Select the data source you want to visualize. + -NOTE: There is no performance impact on the data source you select. For example, *Discover* saved searches perform the same as {data-sources}. +NOTE: There is no performance impact on the data source you select. For example, saved Discover sessions perform the same as {data-sources}. . Add the <> you want to visualize using the editor, then click *Update*. + diff --git a/docs/user/dashboard/create-visualizations.asciidoc b/docs/user/dashboard/create-visualizations.asciidoc index 815f46d5711eb..f0cf95733a972 100644 --- a/docs/user/dashboard/create-visualizations.asciidoc +++ b/docs/user/dashboard/create-visualizations.asciidoc @@ -163,9 +163,9 @@ To enable series data interactions, configure <> data in *Discover*. +* *Discover session interactions* — Opens <> data in *Discover*. + -To use saved search interactions, open the panel menu, then click *More > View saved search*. +To use saved Discover session interactions, open the panel menu, then click *More > View Discover session*. [[edit-panels]] === Edit panels diff --git a/docs/user/dashboard/lens.asciidoc b/docs/user/dashboard/lens.asciidoc index 3c2a120d167d9..525ff8d7bfb6a 100644 --- a/docs/user/dashboard/lens.asciidoc +++ b/docs/user/dashboard/lens.asciidoc @@ -668,10 +668,10 @@ For area, line, and bar charts, press Shift, then click the series in the legend [discrete] [[is-it-possible-to-use-saved-serches-in-lens]] -.*How do I visualize saved searches?* +.*How do I visualize saved Discover sessions?* [%collapsible] ==== -Visualizing saved searches in unsupported. +Visualizing saved Discover sessions in unsupported. ==== [discrete] diff --git a/docs/user/dashboard/tsvb.asciidoc b/docs/user/dashboard/tsvb.asciidoc index e8e7cec488007..15433b19b6fc9 100644 --- a/docs/user/dashboard/tsvb.asciidoc +++ b/docs/user/dashboard/tsvb.asciidoc @@ -233,7 +233,7 @@ For example `https://example.org/{{key}}` This instructs TSVB to substitute the value from your visualization wherever it sees `{{key}}`. -If your data contain reserved or invalid URL characters such as "#" or "&", you should apply a transform to URL-encode the key like this `{{encodeURIComponent key}}`. If you are dynamically constructing a drilldown to another location in Kibana (for example, clicking a table row takes to you a value-scoped saved search), you will likely want to Rison-encode your key as it may contain invalid Rison characters. (https://github.com/Nanonid/rison#rison---compact-data-in-uris[Rison] is the serialization format many parts of Kibana use to store information in their URL.) +If your data contain reserved or invalid URL characters such as "#" or "&", you should apply a transform to URL-encode the key like this `{{encodeURIComponent key}}`. If you are dynamically constructing a drilldown to another location in Kibana (for example, clicking a table row takes to you a value-scoped Discover session), you will likely want to Rison-encode your key as it may contain invalid Rison characters. (https://github.com/Nanonid/rison#rison---compact-data-in-uris[Rison] is the serialization format many parts of Kibana use to store information in their URL.) For example: `discover#/view/0ac50180-82d9-11ec-9f4a-55de56b00cc0?_a=(filters:!((query:(match_phrase:(foo.keyword:{{rison key}})))))` diff --git a/docs/user/management.asciidoc b/docs/user/management.asciidoc index c46786b98829d..b503dbdc2d0ea 100644 --- a/docs/user/management.asciidoc +++ b/docs/user/management.asciidoc @@ -85,7 +85,7 @@ You can add and remove remote clusters, and check their connectivity. | <> | Monitor the generation of reports—PDF, PNG, and CSV—and download reports that you previously generated. -A report can contain a dashboard, visualization, saved search, or Canvas workpad. +A report can contain a dashboard, visualization, table with Discover search results, or Canvas workpad. | Machine Learning Jobs | View, export, and import your <> and diff --git a/docs/user/ml/index.asciidoc b/docs/user/ml/index.asciidoc index 91227055fa8a7..92a28a1fdb0c8 100644 --- a/docs/user/ml/index.asciidoc +++ b/docs/user/ml/index.asciidoc @@ -168,7 +168,7 @@ It makes it easy to find and investigate causes of unusual spikes or drops by us Examine the histogram chart of the log rates for a given {data-source}, and find the reason behind a particular change possibly in millions of log events across multiple fields and values. You can find log rate analysis embedded in multiple applications. -In {kib}, you can find it under **{ml-app}** > **AIOps Labs** or by using the <>. Here, you can select the {data-source} or saved search that you want to analyze. +In {kib}, you can find it under **{ml-app}** > **AIOps Labs** or by using the <>. Here, you can select the {data-source} or saved Discover session that you want to analyze. [role="screenshot"] image::user/ml/images/ml-log-rate-analysis-before.png[Log event histogram chart] @@ -203,7 +203,7 @@ and an example document that matches the category. //end::log-pattern-analysis-intro[] You can find log pattern analysis under **{ml-app}** > **AIOps Labs** or by using the <>. -Here, you can select the {data-source} or saved search that you want to analyze, or in +Here, you can select the {data-source} or saved Discover session that you want to analyze, or in **Discover** as an available action for any text field. [role="screenshot"] @@ -228,7 +228,7 @@ to detect distribution changes, trend changes, and other statistically significant change points in a metric of your time series data. You can find change point detection under **{ml-app}** > **AIOps Labs** or by using the <>. -Here, you can select the {data-source} or saved search that you want to analyze. +Here, you can select the {data-source} or saved Discover session that you want to analyze. [role="screenshot"] image::user/ml/images/ml-change-point-detection.png[Change point detection UI] diff --git a/docs/user/reporting/automating-report-generation.asciidoc b/docs/user/reporting/automating-report-generation.asciidoc index b4334b7c7ea80..0b773decd60a7 100644 --- a/docs/user/reporting/automating-report-generation.asciidoc +++ b/docs/user/reporting/automating-report-generation.asciidoc @@ -24,7 +24,7 @@ To create the POST URL for CSV reports: . Go to *Discover*. -. Open the saved search you want to share. +. Open the saved Discover session you want to share. . In the toolbar, click *Share > Export > Copy POST URL*. @@ -54,7 +54,7 @@ If you experience issues with the deprecated report URLs after you upgrade {kib} * *Dashboard* reports: `/api/reporting/generate/dashboard/` * *Visualize Library* reports: `/api/reporting/generate/visualization/` -* *Discover* saved search reports: `/api/reporting/generate/search/` +* *Discover* reports: `/api/reporting/generate/search/` IMPORTANT: In earlier {kib} versions, you could use the `&sync` parameter to append to report URLs that held the request open until the document was fully generated. The `&sync` parameter is now unsupported. If you use the `&sync` parameter in Watcher, you must update the parameter. diff --git a/docs/user/reporting/index.asciidoc b/docs/user/reporting/index.asciidoc index 4425cc45d9b4d..7a52f5d77b10d 100644 --- a/docs/user/reporting/index.asciidoc +++ b/docs/user/reporting/index.asciidoc @@ -4,16 +4,16 @@ [partintro] -- -:frontmatter-description: {kib} provides you with several options to share *Discover* saved searches, dashboards, *Visualize Library* visualizations, and *Canvas* workpads with others, or on a website. +:frontmatter-description: {kib} provides you with several options to share *Discover* sessions, dashboards, *Visualize Library* visualizations, and *Canvas* workpads with others, or on a website. :frontmatter-tags-products: [kibana] -{kib} provides you with several options to share *Discover* saved searches, dashboards, *Visualize Library* visualizations, and *Canvas* workpads. These sharing options are available from the *Share* menu in the toolbar. +{kib} provides you with several options to share *Discover* sessions, dashboards, *Visualize Library* visualizations, and *Canvas* workpads. These sharing options are available from the *Share* menu in the toolbar. [float] [[share-a-direct-link]] == Share with a direct link -You can share direct links to saved searches, dashboards, and visualizations. When clicking **Share**, look for the **Links** tab to get the shareable link and copy it. +You can share direct links to saved Discover sessions, dashboards, and visualizations. When clicking **Share**, look for the **Links** tab to get the shareable link and copy it. TIP: When sharing an object with unsaved changes, you get a temporary link that might break in the future, for example in case of upgrade. Save the object to get a permanent link instead. @@ -29,13 +29,13 @@ image::https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/blt49f2b5a80 NOTE: For more information on how to configure reporting in {kib}, refer to <> -Create and download PDF, PNG, or CSV reports of saved searches, dashboards, visualizations, and workpads. +Create and download PDF, PNG, or CSV reports of saved Discover sessions, dashboards, visualizations, and workpads. * *PDF* — Generate and download PDF files of dashboards, visualizations, and *Canvas* workpads. PDF reports are a link:https://www.elastic.co/subscriptions[subscription feature]. * *PNG* — Generate and download PNG files of dashboards and visualizations. PNG reports are a link:https://www.elastic.co/subscriptions[subscription feature]. -* *CSV Reports* — Generate CSV reports of saved searches. <>. +* *CSV Reports* — Generate CSV reports of saved Discover sessions. <>. * *CSV Download* — Generate and download CSV files of *Lens* visualizations. @@ -44,7 +44,7 @@ Create and download PDF, PNG, or CSV reports of saved searches, dashboards, visu [[reporting-layout-sizing]] The layout and size of the report depends on what you are sharing. -For saved searches, dashboards, and visualizations, the layout depends on the size of the panels. +For saved Discover sessions, dashboards, and visualizations, the layout depends on the size of the panels. For workpads, the layout depends on the size of the worksheet dimensions. To change the output size, change the size of the browser, which resizes the shareable container before the report generates. It might take some trial and error before you're satisfied. @@ -54,13 +54,13 @@ In the following dashboard, the shareable container is highlighted: [role="screenshot"] image::user/reporting/images/shareable-container.png["Shareable Container"] -. Open the saved search, dashboard, visualization, or workpad you want to share. +. Open the saved Discover session, dashboard, visualization, or workpad you want to share. . From the toolbar, click *Share*, then select the report option. * If you are creating dashboard PDFs, select *For printing* to create printer-friendly PDFs with multiple A4 portrait pages and two visualizations per page. + -NOTE: When you create a dashboard report that includes a data table or saved search, the PDF includes only the visible data. +NOTE: When you create a dashboard report that includes a data table or Discover session, the PDF includes only the visible data. * If you are creating workpad PDFs, select *Full page layout* to create PDFs without margins that surround the workpad. diff --git a/examples/bfetch_explorer/README.md b/examples/bfetch_explorer/README.md deleted file mode 100644 index 33723e7cabe07..0000000000000 --- a/examples/bfetch_explorer/README.md +++ /dev/null @@ -1,11 +0,0 @@ -## bfetch explorer - -bfetch is a service that allows you to batch HTTP requests and stream responses -back. - -This example app demonstrates: - - How you can create a streaming response route and consume it from the - client - - How you can create a batch processing route and consume it from the client - -To run this example, use the command `yarn start --run-examples`. diff --git a/examples/bfetch_explorer/kibana.jsonc b/examples/bfetch_explorer/kibana.jsonc deleted file mode 100644 index dbcd5c3496355..0000000000000 --- a/examples/bfetch_explorer/kibana.jsonc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "type": "plugin", - "id": "@kbn/bfetch-explorer-plugin", - "owner": "@elastic/appex-sharedux", - "plugin": { - "id": "bfetchExplorer", - "server": true, - "browser": true, - "requiredPlugins": [ - "bfetch", - "developerExamples" - ], - "requiredBundles": [ - "kibanaReact" - ] - } -} diff --git a/examples/bfetch_explorer/public/components/count_until/index.tsx b/examples/bfetch_explorer/public/components/count_until/index.tsx deleted file mode 100644 index 3708fcc78193e..0000000000000 --- a/examples/bfetch_explorer/public/components/count_until/index.tsx +++ /dev/null @@ -1,83 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { useState } from 'react'; -import useMountedState from 'react-use/lib/useMountedState'; -import useList from 'react-use/lib/useList'; -import { EuiForm, EuiSpacer, EuiFieldNumber, EuiFormRow, EuiButton } from '@elastic/eui'; -import { BfetchPublicSetup } from '@kbn/bfetch-plugin/public'; - -export interface Props { - fetchStreaming: BfetchPublicSetup['fetchStreaming']; -} - -export const CountUntil: React.FC = ({ fetchStreaming }) => { - const isMounted = useMountedState(); - const [data, setData] = useState(5); - const [showingResults, setShowingResults] = useState(false); - const [results, { push: pushResult, clear: clearList }] = useList([]); - const [completed, setCompleted] = useState(false); - const [error, setError] = useState(null); - - const handleSubmit = () => { - setShowingResults(true); - const { stream } = fetchStreaming({ - url: '/bfetch_explorer/count', - body: JSON.stringify({ data }), - }); - stream.subscribe({ - next: (next: string) => { - if (!isMounted()) return; - pushResult(next); - }, - error: (nextError: any) => { - if (!isMounted()) return; - setError(nextError); - }, - complete: () => { - if (!isMounted()) return; - setCompleted(true); - }, - }); - }; - - const handleReset = () => { - setShowingResults(false); - clearList(); - setError(null); - setCompleted(false); - }; - - if (showingResults) { - return ( - -
{JSON.stringify(error || results, null, 4)}
- - - Reset - -
- ); - } - - return ( - - - setData(Number(e.target.value))} - /> - - - Start - - - ); -}; diff --git a/examples/bfetch_explorer/public/components/double_integers/index.tsx b/examples/bfetch_explorer/public/components/double_integers/index.tsx deleted file mode 100644 index cf71bde62f09e..0000000000000 --- a/examples/bfetch_explorer/public/components/double_integers/index.tsx +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { useState } from 'react'; -import useMountedState from 'react-use/lib/useMountedState'; -import useList from 'react-use/lib/useList'; -import useCounter from 'react-use/lib/useCounter'; -import { EuiForm, EuiSpacer, EuiTextArea, EuiFormRow, EuiButton } from '@elastic/eui'; -import { ExplorerService } from '../../plugin'; - -interface ResultItem { - num: number; - result?: { - num: number; - }; - error?: any; -} - -const defaultNumbers = [2000, 300, -1, 1000].join('\n'); - -export interface Props { - double: ExplorerService['double']; -} - -export const DoubleIntegers: React.FC = ({ double }) => { - const isMounted = useMountedState(); - const [numbers, setNumbers] = useState(defaultNumbers); - const [showingResults, setShowingResults] = useState(false); - const [numberOfResultsAwaiting, counter] = useCounter(0); - const [results, { push: pushResult, clear: clearList }] = useList([]); - - const handleSubmit = () => { - setShowingResults(true); - const nums = numbers - .split('\n') - .map((num) => num.trim()) - .filter(Boolean) - .map(Number); - counter.set(nums.length); - nums.forEach((num) => { - double({ num }).then( - (result) => { - if (!isMounted()) return; - counter.dec(); - pushResult({ num, result }); - }, - (error) => { - if (!isMounted()) return; - counter.dec(); - pushResult({ num, error }); - } - ); - }); - }; - - const handleReset = () => { - setShowingResults(false); - counter.reset(); - clearList(); - }; - - if (showingResults) { - return ( - -
{JSON.stringify(results, null, 4)}
- - - Reset - -
- ); - } - - return ( - - - setNumbers(e.target.value)} - /> - - - Send - - - ); -}; diff --git a/examples/bfetch_explorer/public/components/page/index.tsx b/examples/bfetch_explorer/public/components/page/index.tsx deleted file mode 100644 index 2d17f9ba23dae..0000000000000 --- a/examples/bfetch_explorer/public/components/page/index.tsx +++ /dev/null @@ -1,34 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { FC, PropsWithChildren } from 'react'; -import { EuiPageTemplate, EuiPageSection, EuiPageHeader } from '@elastic/eui'; - -export interface PageProps { - title?: React.ReactNode; - sidebar?: React.ReactNode; -} - -export const Page: FC> = ({ - title = 'Untitled', - sidebar, - children, -}) => { - return ( - - {sidebar} - - - - - {children} - - - ); -}; diff --git a/examples/bfetch_explorer/public/containers/app/index.tsx b/examples/bfetch_explorer/public/containers/app/index.tsx deleted file mode 100644 index 9ddd1b44e4354..0000000000000 --- a/examples/bfetch_explorer/public/containers/app/index.tsx +++ /dev/null @@ -1,37 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { Redirect } from 'react-router-dom'; -import { BrowserRouter as Router, Route, Routes } from '@kbn/shared-ux-router'; -import { EuiPage } from '@elastic/eui'; -import { useDeps } from '../../hooks/use_deps'; -import { routes } from '../../routes'; - -export const App: React.FC = () => { - const { appBasePath } = useDeps(); - - const routeElements: React.ReactElement[] = []; - for (const { items } of routes) { - for (const { id, component } of items) { - routeElements.push( component} />); - } - } - - return ( - - - - {routeElements} - - - - - ); -}; diff --git a/examples/bfetch_explorer/public/containers/app/pages/page_count_until/index.tsx b/examples/bfetch_explorer/public/containers/app/pages/page_count_until/index.tsx deleted file mode 100644 index fdd5de83bf058..0000000000000 --- a/examples/bfetch_explorer/public/containers/app/pages/page_count_until/index.tsx +++ /dev/null @@ -1,33 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as React from 'react'; -import { EuiPanel, EuiText } from '@elastic/eui'; -import { CountUntil } from '../../../../components/count_until'; -import { Page } from '../../../../components/page'; -import { useDeps } from '../../../../hooks/use_deps'; -import { Sidebar } from '../../sidebar'; - -export const PageCountUntil = () => { - const { plugins } = useDeps(); - - return ( - }> - - This demo sends a single number N using fetchStreaming to the server. The - server will stream back N number of messages with 1 second delay each containing a number - from 1 to N, after which it will close the stream. - -
- - - -
- ); -}; diff --git a/examples/bfetch_explorer/public/containers/app/pages/page_double_integers/index.tsx b/examples/bfetch_explorer/public/containers/app/pages/page_double_integers/index.tsx deleted file mode 100644 index 4e6b1864c638d..0000000000000 --- a/examples/bfetch_explorer/public/containers/app/pages/page_double_integers/index.tsx +++ /dev/null @@ -1,33 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as React from 'react'; -import { EuiPanel, EuiText } from '@elastic/eui'; -import { DoubleIntegers } from '../../../../components/double_integers'; -import { Page } from '../../../../components/page'; -import { useDeps } from '../../../../hooks/use_deps'; -import { Sidebar } from '../../sidebar'; - -export const PageDoubleIntegers = () => { - const { explorer } = useDeps(); - - return ( - }> - - Below is a list of numbers in milliseconds. They are sent as a batch to the server. For each - number server waits given number of milliseconds then doubles the number and streams it - back. - -
- - - -
- ); -}; diff --git a/examples/bfetch_explorer/public/containers/app/sidebar/index.tsx b/examples/bfetch_explorer/public/containers/app/sidebar/index.tsx deleted file mode 100644 index 784c8b5a7b1fa..0000000000000 --- a/examples/bfetch_explorer/public/containers/app/sidebar/index.tsx +++ /dev/null @@ -1,42 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { EuiSideNav } from '@elastic/eui'; -import { useHistory } from 'react-router-dom'; -import { routes } from '../../../routes'; - -// eslint-disable-next-line @typescript-eslint/no-empty-interface -interface SidebarProps {} - -export const Sidebar: React.FC = () => { - const history = useHistory(); - - return ( - ({ - id, - name: title, - isSelected: true, - items: items.map((route) => ({ - id: route.id, - name: route.title, - onClick: () => history.push(`/${route.id}`), - 'data-test-subj': route.id, - })), - })), - }, - ]} - /> - ); -}; diff --git a/examples/bfetch_explorer/public/hooks/use_deps.ts b/examples/bfetch_explorer/public/hooks/use_deps.ts deleted file mode 100644 index a212525d00eff..0000000000000 --- a/examples/bfetch_explorer/public/hooks/use_deps.ts +++ /dev/null @@ -1,13 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { BfetchDeps } from '../mount'; - -export const useDeps = () => useKibana().services as unknown as BfetchDeps; diff --git a/examples/bfetch_explorer/public/index.ts b/examples/bfetch_explorer/public/index.ts deleted file mode 100644 index ebc736cca673b..0000000000000 --- a/examples/bfetch_explorer/public/index.ts +++ /dev/null @@ -1,12 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { BfetchExplorerPlugin } from './plugin'; - -export const plugin = () => new BfetchExplorerPlugin(); diff --git a/examples/bfetch_explorer/public/mount.tsx b/examples/bfetch_explorer/public/mount.tsx deleted file mode 100644 index 525f7b21078f0..0000000000000 --- a/examples/bfetch_explorer/public/mount.tsx +++ /dev/null @@ -1,39 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as React from 'react'; -import { render, unmountComponentAtNode } from 'react-dom'; -import { CoreSetup, CoreStart, AppMountParameters } from '@kbn/core/public'; -import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; -import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; -import { BfetchExplorerStartPlugins, ExplorerService } from './plugin'; -import { App } from './containers/app'; - -export interface BfetchDeps { - appBasePath: string; - core: CoreStart; - plugins: BfetchExplorerStartPlugins; - explorer: ExplorerService; -} - -export const mount = - (coreSetup: CoreSetup, explorer: ExplorerService) => - async ({ appBasePath, element }: AppMountParameters) => { - const [core, plugins] = await coreSetup.getStartServices(); - const deps: BfetchDeps = { appBasePath, core, plugins, explorer }; - const reactElement = ( - - - - - - ); - render(reactElement, element); - return () => unmountComponentAtNode(element); - }; diff --git a/examples/bfetch_explorer/public/plugin.tsx b/examples/bfetch_explorer/public/plugin.tsx deleted file mode 100644 index 2840f016b5d2b..0000000000000 --- a/examples/bfetch_explorer/public/plugin.tsx +++ /dev/null @@ -1,67 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { Plugin, CoreSetup } from '@kbn/core/public'; -import { BfetchPublicSetup, BfetchPublicStart } from '@kbn/bfetch-plugin/public'; -import { DeveloperExamplesSetup } from '@kbn/developer-examples-plugin/public'; -import { mount } from './mount'; - -export interface ExplorerService { - double: (number: { num: number }) => Promise<{ num: number }>; -} - -export interface BfetchExplorerSetupPlugins { - bfetch: BfetchPublicSetup; - developerExamples: DeveloperExamplesSetup; -} - -export interface BfetchExplorerStartPlugins { - bfetch: BfetchPublicStart; -} - -export class BfetchExplorerPlugin implements Plugin { - public setup( - core: CoreSetup, - { bfetch, developerExamples }: BfetchExplorerSetupPlugins - ) { - const double = bfetch.batchedFunction<{ num: number }, { num: number }>({ - url: '/bfetch_explorer/double', - }); - - const explorer: ExplorerService = { - double, - }; - - core.application.register({ - id: 'bfetch-explorer', - title: 'bfetch explorer', - visibleIn: [], - mount: mount(core, explorer), - }); - - developerExamples.register({ - appId: 'bfetch-explorer', - title: 'bfetch', - description: - 'bfetch is a service that allows to batch HTTP requests and streams responses back.', - links: [ - { - label: 'README', - href: 'https://github.com/elastic/kibana/blob/main/src/plugins/bfetch/README.md', - iconType: 'logoGithub', - size: 's', - target: '_blank', - }, - ], - }); - } - - public start() {} - public stop() {} -} diff --git a/examples/bfetch_explorer/public/routes.tsx b/examples/bfetch_explorer/public/routes.tsx deleted file mode 100644 index 69ae6a8e94bbb..0000000000000 --- a/examples/bfetch_explorer/public/routes.tsx +++ /dev/null @@ -1,49 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { PageDoubleIntegers } from './containers/app/pages/page_double_integers'; -import { PageCountUntil } from './containers/app/pages/page_count_until'; - -interface RouteSectionDef { - title: string; - id: string; - items: RouteDef[]; -} - -interface RouteDef { - title: string; - id: string; - component: React.ReactNode; -} - -export const routes: RouteSectionDef[] = [ - { - title: 'fetchStreaming', - id: 'fetchStreaming', - items: [ - { - title: 'Count until', - id: 'count-until', - component: , - }, - ], - }, - { - title: 'batchedFunction', - id: 'batchedFunction', - items: [ - { - title: 'Double integers', - id: 'double-integers', - component: , - }, - ], - }, -]; diff --git a/examples/bfetch_explorer/server/index.ts b/examples/bfetch_explorer/server/index.ts deleted file mode 100644 index ef09a9627b139..0000000000000 --- a/examples/bfetch_explorer/server/index.ts +++ /dev/null @@ -1,13 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export const plugin = async () => { - const { BfetchExplorerPlugin } = await import('./plugin'); - return new BfetchExplorerPlugin(); -}; diff --git a/examples/bfetch_explorer/server/plugin.ts b/examples/bfetch_explorer/server/plugin.ts deleted file mode 100644 index 41dd5ab4f4601..0000000000000 --- a/examples/bfetch_explorer/server/plugin.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { Subject } from 'rxjs'; -import { Plugin, CoreSetup, CoreStart } from '@kbn/core/server'; -import { BfetchServerSetup, BfetchServerStart } from '@kbn/bfetch-plugin/server'; - -export interface BfetchExplorerSetupPlugins { - bfetch: BfetchServerSetup; -} - -export interface BfetchExplorerStartPlugins { - bfetch: BfetchServerStart; -} - -export class BfetchExplorerPlugin implements Plugin { - public setup(core: CoreSetup, plugins: BfetchExplorerSetupPlugins) { - plugins.bfetch.addStreamingResponseRoute('/bfetch_explorer/count', () => ({ - getResponseStream: ({ data }: any) => { - const subject = new Subject(); - const countTo = Number(data); - for (let cnt = 1; cnt <= countTo; cnt++) { - setTimeout(() => { - subject.next(String(cnt)); - }, cnt * 1000); - } - setTimeout(() => { - subject.complete(); - }, countTo * 1000); - return subject; - }, - })); - - plugins.bfetch.addBatchProcessingRoute<{ num: number }, { num: number }>( - '/bfetch_explorer/double', - () => ({ - onBatchItem: async ({ num }) => { - // Validate inputs. - if (num < 0) throw new Error('Invalid number'); - // Wait number of specified milliseconds. - await new Promise((r) => setTimeout(r, num)); - // Double the number and send it back. - return { num: 2 * num }; - }, - }) - ); - } - - public start(core: CoreStart, plugins: BfetchExplorerStartPlugins) {} - - public stop() {} -} diff --git a/examples/bfetch_explorer/tsconfig.json b/examples/bfetch_explorer/tsconfig.json deleted file mode 100644 index c8417c734f58d..0000000000000 --- a/examples/bfetch_explorer/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - }, - "include": [ - "index.ts", - "public/**/*.ts", - "public/**/*.tsx", - "server/**/*.ts", - "../../typings/**/*", - ], - "exclude": [ - "target/**/*", - ], - "kbn_references": [ - "@kbn/core", - "@kbn/developer-examples-plugin", - "@kbn/bfetch-plugin", - "@kbn/kibana-react-plugin", - "@kbn/shared-ux-router", - "@kbn/react-kibana-context-render", - ] -} diff --git a/examples/content_management_examples/public/examples/finder/finder_app.tsx b/examples/content_management_examples/public/examples/finder/finder_app.tsx index b8aaa6fe5f34b..dda034e711180 100644 --- a/examples/content_management_examples/public/examples/finder/finder_app.tsx +++ b/examples/content_management_examples/public/examples/finder/finder_app.tsx @@ -37,7 +37,7 @@ export const FinderApp = (props: { { type: `search`, getIconForSavedObject: () => 'discoverApp', - name: 'Saved search', + name: 'Discover session', }, { type: 'index-pattern', diff --git a/oas_docs/bundle.json b/oas_docs/bundle.json index 320730edc972e..3e3d47df01661 100644 --- a/oas_docs/bundle.json +++ b/oas_docs/bundle.json @@ -39790,7 +39790,7 @@ }, "/api/spaces/_copy_saved_objects": { "post": { - "description": "It also allows you to automatically copy related objects, so when you copy a dashboard, this can automatically copy over the associated visualizations, data views, and saved searches, as required. You can request to overwrite any objects that already exist in the target space if they share an identifier or you can use the resolve copy saved objects conflicts API to do this on a per-object basis.

[Required authorization] Route required privileges: ALL of [copySavedObjectsToSpaces].", + "description": "It also allows you to automatically copy related objects, so when you copy a dashboard, this can automatically copy over the associated visualizations, data views, and saved Discover sessions, as required. You can request to overwrite any objects that already exist in the target space if they share an identifier or you can use the resolve copy saved objects conflicts API to do this on a per-object basis.

[Required authorization] Route required privileges: ALL of [copySavedObjectsToSpaces].", "operationId": "post-spaces-copy-saved-objects", "parameters": [ { diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index f12014443bb0b..5845ba56ae895 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -37372,7 +37372,7 @@ paths: - roles /api/spaces/_copy_saved_objects: post: - description: 'It also allows you to automatically copy related objects, so when you copy a dashboard, this can automatically copy over the associated visualizations, data views, and saved searches, as required. You can request to overwrite any objects that already exist in the target space if they share an identifier or you can use the resolve copy saved objects conflicts API to do this on a per-object basis.

[Required authorization] Route required privileges: ALL of [copySavedObjectsToSpaces].' + description: 'It also allows you to automatically copy related objects, so when you copy a dashboard, this can automatically copy over the associated visualizations, data views, and saved Discover sessions, as required. You can request to overwrite any objects that already exist in the target space if they share an identifier or you can use the resolve copy saved objects conflicts API to do this on a per-object basis.

[Required authorization] Route required privileges: ALL of [copySavedObjectsToSpaces].' operationId: post-spaces-copy-saved-objects parameters: - description: A required header to protect against CSRF attacks diff --git a/oas_docs/overlays/alerting.overlays.yaml b/oas_docs/overlays/alerting.overlays.yaml index f6920e662e9e3..0f579b54a5502 100644 --- a/oas_docs/overlays/alerting.overlays.yaml +++ b/oas_docs/overlays/alerting.overlays.yaml @@ -111,7 +111,7 @@ actions: # Infra metric threshold rule (metrics.alert.threshold) - $ref: '../../x-pack/plugins/observability_solution/infra/server/lib/alerting/docs/params_property_infra_metric_threshold.yaml' # SLO burn rate (slo.rules.burnRate) - - $ref: '../../x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/docs/params_property_slo_burn_rate.yaml' + - $ref: '../../x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/docs/params_property_slo_burn_rate.yaml' # Synthetics uptime TLS rule (xpack.uptime.alerts.tls) - $ref: '../../x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_uptime_tls.yaml' # Uptime monitor status rule (xpack.uptime.alerts.monitorStatus) diff --git a/oas_docs/package-lock.json b/oas_docs/package-lock.json index b12374f23e3bf..637641180323c 100644 --- a/oas_docs/package-lock.json +++ b/oas_docs/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@redocly/cli": "^1.25.15", + "@redocly/cli": "^1.26.0", "bump-cli": "^2.8.4" } }, @@ -515,12 +515,12 @@ } }, "node_modules/@redocly/cli": { - "version": "1.25.15", - "resolved": "https://registry.npmjs.org/@redocly/cli/-/cli-1.25.15.tgz", - "integrity": "sha512-ZD743CJX4FpMJvGNE9Cm3gNn8LNRzRjyrYNVPi1C4iIEtrFkr5Zq791qv6gUFehWns71svbVyzWD9ftVTdfqYg==", + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@redocly/cli/-/cli-1.26.0.tgz", + "integrity": "sha512-yUsrTmEPHaBDQf16jSFGi2n+AJabHacLpr7La92Dseo0tRkgLKsUWiaVEEyqm79POBytD87mVTi3THitqnSyZQ==", "license": "MIT", "dependencies": { - "@redocly/openapi-core": "1.25.15", + "@redocly/openapi-core": "1.26.0", "abort-controller": "^3.0.0", "chokidar": "^3.5.1", "colorette": "^1.2.0", @@ -556,9 +556,9 @@ "license": "MIT" }, "node_modules/@redocly/openapi-core": { - "version": "1.25.15", - "resolved": "https://registry.npmjs.org/@redocly/openapi-core/-/openapi-core-1.25.15.tgz", - "integrity": "sha512-/dpr5zpGj2t1Bf7EIXEboRZm1hsJZBQfv3Q1pkivtdAEg3if2khv+b9gY68aquC6cM/2aQY2kMLy8LlY2tn+Og==", + "version": "1.26.0", + "resolved": "https://registry.npmjs.org/@redocly/openapi-core/-/openapi-core-1.26.0.tgz", + "integrity": "sha512-8Ofu6WpBp7eoLmf1qQ4+T0W4LRr8es+4Drw/RJG+acPXmaT2TmHk2B2v+3+1R9GqSIj6kx3N7JmQkxAPCnvDLw==", "license": "MIT", "dependencies": { "@redocly/ajv": "^8.11.2", diff --git a/oas_docs/package.json b/oas_docs/package.json index 67289885b4ba3..81ce46597c50d 100644 --- a/oas_docs/package.json +++ b/oas_docs/package.json @@ -8,7 +8,7 @@ }, "dependencies": { "bump-cli": "^2.8.4", - "@redocly/cli": "^1.25.15" + "@redocly/cli": "^1.26.0" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" diff --git a/oas_docs/scripts/merge_ess_oas.js b/oas_docs/scripts/merge_ess_oas.js index c44a6669ca8bc..df0b6e5a4ac04 100644 --- a/oas_docs/scripts/merge_ess_oas.js +++ b/oas_docs/scripts/merge_ess_oas.js @@ -23,13 +23,13 @@ const { REPO_ROOT } = require('@kbn/repo-info'); // Observability Solution `${REPO_ROOT}/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.yaml`, - `${REPO_ROOT}/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml`, + `${REPO_ROOT}/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/bundled.yaml`, // Security solution - `${REPO_ROOT}/x-pack/plugins/security_solution/docs/openapi/ess/*.schema.yaml`, - `${REPO_ROOT}/packages/kbn-securitysolution-lists-common/docs/openapi/ess/*.schema.yaml`, - `${REPO_ROOT}/packages/kbn-securitysolution-exceptions-common/docs/openapi/ess/*.schema.yaml`, - `${REPO_ROOT}/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/ess/*.schema.yaml`, + `${REPO_ROOT}/x-pack/solutions/security/plugins/security_solution/docs/openapi/ess/*.schema.yaml`, + `${REPO_ROOT}/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/docs/openapi/ess/*.schema.yaml`, + `${REPO_ROOT}/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/docs/openapi/ess/*.schema.yaml`, + `${REPO_ROOT}/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/ess/*.schema.yaml`, `${REPO_ROOT}/x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/ess/*.schema.yaml`, `${REPO_ROOT}/x-pack/platform/plugins/shared/osquery/docs/openapi/ess/*.schema.yaml`, ], diff --git a/oas_docs/scripts/merge_serverless_oas.js b/oas_docs/scripts/merge_serverless_oas.js index bc466a289bdd5..343487d8fc4f8 100644 --- a/oas_docs/scripts/merge_serverless_oas.js +++ b/oas_docs/scripts/merge_serverless_oas.js @@ -21,13 +21,13 @@ const { REPO_ROOT } = require('@kbn/repo-info'); // Observability Solution `${REPO_ROOT}/x-pack/plugins/observability_solution/apm/docs/openapi/apm/bundled.yaml`, - `${REPO_ROOT}/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml`, + `${REPO_ROOT}/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/bundled.yaml`, // Security solution - `${REPO_ROOT}/x-pack/plugins/security_solution/docs/openapi/serverless/*.schema.yaml`, - `${REPO_ROOT}/packages/kbn-securitysolution-lists-common/docs/openapi/serverless/*.schema.yaml`, - `${REPO_ROOT}/packages/kbn-securitysolution-exceptions-common/docs/openapi/serverless/*.schema.yaml`, - `${REPO_ROOT}/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/serverless/*.schema.yaml`, + `${REPO_ROOT}/x-pack/solutions/security/plugins/security_solution/docs/openapi/serverless/*.schema.yaml`, + `${REPO_ROOT}/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/docs/openapi/serverless/*.schema.yaml`, + `${REPO_ROOT}/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/docs/openapi/serverless/*.schema.yaml`, + `${REPO_ROOT}/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/serverless/*.schema.yaml`, `${REPO_ROOT}/x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/serverless/*.schema.yaml`, `${REPO_ROOT}/x-pack/platform/plugins/shared/osquery/docs/openapi/serverless/*.schema.yaml`, ], diff --git a/package.json b/package.json index 29e87c578ad44..a60710029650e 100644 --- a/package.json +++ b/package.json @@ -192,12 +192,11 @@ "@kbn/apm-utils": "link:packages/kbn-apm-utils", "@kbn/app-link-test-plugin": "link:test/plugin_functional/plugins/app_link_test", "@kbn/application-usage-test-plugin": "link:x-pack/test/usage_collection/plugins/application_usage_test", - "@kbn/asset-inventory-plugin": "link:x-pack/plugins/asset_inventory", + "@kbn/asset-inventory-plugin": "link:x-pack/solutions/security/plugins/asset_inventory", "@kbn/audit-log-plugin": "link:x-pack/test/security_api_integration/plugins/audit_log", "@kbn/avc-banner": "link:src/platform/packages/shared/kbn-avc-banner", "@kbn/banners-plugin": "link:x-pack/plugins/banners", "@kbn/bfetch-error": "link:packages/kbn-bfetch-error", - "@kbn/bfetch-explorer-plugin": "link:examples/bfetch_explorer", "@kbn/bfetch-plugin": "link:src/plugins/bfetch", "@kbn/calculate-auto": "link:packages/kbn-calculate-auto", "@kbn/calculate-width-from-char-count": "link:packages/kbn-calculate-width-from-char-count", @@ -213,16 +212,16 @@ "@kbn/cloud": "link:packages/cloud", "@kbn/cloud-chat-plugin": "link:x-pack/plugins/cloud_integrations/cloud_chat", "@kbn/cloud-data-migration-plugin": "link:x-pack/platform/plugins/private/cloud_integrations/cloud_data_migration", - "@kbn/cloud-defend-plugin": "link:x-pack/plugins/cloud_defend", + "@kbn/cloud-defend-plugin": "link:x-pack/solutions/security/plugins/cloud_defend", "@kbn/cloud-experiments-plugin": "link:x-pack/plugins/cloud_integrations/cloud_experiments", "@kbn/cloud-full-story-plugin": "link:x-pack/plugins/cloud_integrations/cloud_full_story", "@kbn/cloud-integration-saml-provider-plugin": "link:x-pack/test/cloud_integration/plugins/saml_provider", "@kbn/cloud-links-plugin": "link:x-pack/plugins/cloud_integrations/cloud_links", "@kbn/cloud-plugin": "link:x-pack/plugins/cloud", - "@kbn/cloud-security-posture": "link:x-pack/packages/kbn-cloud-security-posture/public", - "@kbn/cloud-security-posture-common": "link:x-pack/packages/kbn-cloud-security-posture/common", - "@kbn/cloud-security-posture-graph": "link:x-pack/packages/kbn-cloud-security-posture/graph", - "@kbn/cloud-security-posture-plugin": "link:x-pack/plugins/cloud_security_posture", + "@kbn/cloud-security-posture": "link:x-pack/solutions/security/packages/kbn-cloud-security-posture/public", + "@kbn/cloud-security-posture-common": "link:x-pack/platform/packages/shared/kbn-cloud-security-posture/common", + "@kbn/cloud-security-posture-graph": "link:x-pack/solutions/security/packages/kbn-cloud-security-posture/graph", + "@kbn/cloud-security-posture-plugin": "link:x-pack/solutions/security/plugins/cloud_security_posture", "@kbn/code-editor": "link:packages/shared-ux/code_editor/impl", "@kbn/code-editor-mock": "link:packages/shared-ux/code_editor/mocks", "@kbn/coloring": "link:packages/kbn-coloring", @@ -447,7 +446,7 @@ "@kbn/deeplinks-ml": "link:src/platform/packages/shared/deeplinks/ml", "@kbn/deeplinks-observability": "link:src/platform/packages/shared/deeplinks/observability", "@kbn/deeplinks-search": "link:packages/deeplinks/search", - "@kbn/deeplinks-security": "link:packages/deeplinks/security", + "@kbn/deeplinks-security": "link:src/platform/packages/shared/deeplinks/security", "@kbn/deeplinks-shared": "link:packages/deeplinks/shared", "@kbn/default-nav-analytics": "link:packages/default-nav/analytics", "@kbn/default-nav-devtools": "link:src/platform/packages/private/default-nav/devtools", @@ -583,7 +582,7 @@ "@kbn/inference_integration_flyout": "link:x-pack/platform/packages/private/ml/inference_integration_flyout", "@kbn/infra-forge": "link:x-pack/platform/packages/private/kbn-infra-forge", "@kbn/infra-plugin": "link:x-pack/plugins/observability_solution/infra", - "@kbn/ingest-pipelines-plugin": "link:x-pack/plugins/ingest_pipelines", + "@kbn/ingest-pipelines-plugin": "link:x-pack/platform/plugins/shared/ingest_pipelines", "@kbn/input-control-vis-plugin": "link:src/plugins/input_control_vis", "@kbn/inspector-plugin": "link:src/plugins/inspector", "@kbn/integration-assistant-plugin": "link:x-pack/platform/plugins/shared/integration_assistant", @@ -608,7 +607,7 @@ "@kbn/kibana-react-plugin": "link:src/plugins/kibana_react", "@kbn/kibana-usage-collection-plugin": "link:src/plugins/kibana_usage_collection", "@kbn/kibana-utils-plugin": "link:src/plugins/kibana_utils", - "@kbn/kubernetes-security-plugin": "link:x-pack/plugins/kubernetes_security", + "@kbn/kubernetes-security-plugin": "link:x-pack/solutions/security/plugins/kubernetes_security", "@kbn/langchain": "link:x-pack/platform/packages/shared/kbn-langchain", "@kbn/language-documentation": "link:src/platform/packages/private/kbn-language-documentation", "@kbn/lens-config-builder-example-plugin": "link:x-pack/examples/lens_config_builder_example", @@ -620,7 +619,7 @@ "@kbn/license-management-plugin": "link:x-pack/platform/plugins/shared/license_management", "@kbn/licensing-plugin": "link:x-pack/plugins/licensing", "@kbn/links-plugin": "link:src/plugins/links", - "@kbn/lists-plugin": "link:x-pack/plugins/lists", + "@kbn/lists-plugin": "link:x-pack/solutions/security/plugins/lists", "@kbn/llm-tasks-plugin": "link:x-pack/platform/plugins/shared/ai_infra/llm_tasks", "@kbn/locator-examples-plugin": "link:examples/locator_examples", "@kbn/locator-explorer-plugin": "link:examples/locator_explorer", @@ -714,7 +713,7 @@ "@kbn/observability-utils-server": "link:x-pack/packages/observability/observability_utils/observability_utils_server", "@kbn/oidc-provider-plugin": "link:x-pack/test/security_api_integration/plugins/oidc_provider", "@kbn/open-telemetry-instrumented-plugin": "link:test/common/plugins/otel_metrics", - "@kbn/openapi-common": "link:packages/kbn-openapi-common", + "@kbn/openapi-common": "link:src/platform/packages/shared/kbn-openapi-common", "@kbn/osquery-io-ts-types": "link:src/platform/packages/shared/kbn-osquery-io-ts-types", "@kbn/osquery-plugin": "link:x-pack/platform/plugins/shared/osquery", "@kbn/paertial-results-example-plugin": "link:examples/partial_results_example", @@ -797,7 +796,7 @@ "@kbn/screenshot-mode-example-plugin": "link:examples/screenshot_mode_example", "@kbn/screenshot-mode-plugin": "link:src/plugins/screenshot_mode", "@kbn/screenshotting-example-plugin": "link:x-pack/examples/screenshotting_example", - "@kbn/screenshotting-plugin": "link:x-pack/plugins/screenshotting", + "@kbn/screenshotting-plugin": "link:x-pack/platform/plugins/shared/screenshotting", "@kbn/screenshotting-server": "link:packages/kbn-screenshotting-server", "@kbn/search-api-keys-components": "link:packages/kbn-search-api-keys-components", "@kbn/search-api-keys-server": "link:packages/kbn-search-api-keys-server", @@ -829,37 +828,37 @@ "@kbn/security-plugin-types-server": "link:x-pack/packages/security/plugin_types_server", "@kbn/security-role-management-model": "link:x-pack/packages/security/role_management_model", "@kbn/security-solution-distribution-bar": "link:x-pack/solutions/security/packages/distribution_bar", - "@kbn/security-solution-ess": "link:x-pack/plugins/security_solution_ess", + "@kbn/security-solution-ess": "link:x-pack/solutions/security/plugins/security_solution_ess", "@kbn/security-solution-features": "link:x-pack/solutions/security/packages/features", "@kbn/security-solution-fixtures-plugin": "link:x-pack/test/cases_api_integration/common/plugins/security_solution", "@kbn/security-solution-navigation": "link:x-pack/solutions/security/packages/navigation", - "@kbn/security-solution-plugin": "link:x-pack/plugins/security_solution", - "@kbn/security-solution-serverless": "link:x-pack/plugins/security_solution_serverless", + "@kbn/security-solution-plugin": "link:x-pack/solutions/security/plugins/security_solution", + "@kbn/security-solution-serverless": "link:x-pack/solutions/security/plugins/security_solution_serverless", "@kbn/security-solution-side-nav": "link:x-pack/solutions/security/packages/side_nav", "@kbn/security-solution-storybook-config": "link:x-pack/solutions/security/packages/storybook/config", "@kbn/security-solution-upselling": "link:x-pack/solutions/security/packages/upselling", "@kbn/security-test-endpoints-plugin": "link:x-pack/test/security_functional/plugins/test_endpoints", "@kbn/security-ui-components": "link:x-pack/packages/security/ui_components", - "@kbn/securitysolution-autocomplete": "link:packages/kbn-securitysolution-autocomplete", + "@kbn/securitysolution-autocomplete": "link:x-pack/solutions/security/packages/kbn-securitysolution-autocomplete", "@kbn/securitysolution-data-table": "link:x-pack/solutions/security/packages/data_table", "@kbn/securitysolution-ecs": "link:src/platform/packages/shared/kbn-securitysolution-ecs", - "@kbn/securitysolution-endpoint-exceptions-common": "link:packages/kbn-securitysolution-endpoint-exceptions-common", - "@kbn/securitysolution-es-utils": "link:packages/kbn-securitysolution-es-utils", - "@kbn/securitysolution-exception-list-components": "link:packages/kbn-securitysolution-exception-list-components", - "@kbn/securitysolution-exceptions-common": "link:packages/kbn-securitysolution-exceptions-common", - "@kbn/securitysolution-hook-utils": "link:packages/kbn-securitysolution-hook-utils", - "@kbn/securitysolution-io-ts-alerting-types": "link:packages/kbn-securitysolution-io-ts-alerting-types", - "@kbn/securitysolution-io-ts-list-types": "link:packages/kbn-securitysolution-io-ts-list-types", - "@kbn/securitysolution-io-ts-types": "link:packages/kbn-securitysolution-io-ts-types", - "@kbn/securitysolution-io-ts-utils": "link:packages/kbn-securitysolution-io-ts-utils", - "@kbn/securitysolution-list-api": "link:packages/kbn-securitysolution-list-api", - "@kbn/securitysolution-list-constants": "link:packages/kbn-securitysolution-list-constants", - "@kbn/securitysolution-list-hooks": "link:packages/kbn-securitysolution-list-hooks", - "@kbn/securitysolution-list-utils": "link:packages/kbn-securitysolution-list-utils", - "@kbn/securitysolution-lists-common": "link:packages/kbn-securitysolution-lists-common", - "@kbn/securitysolution-rules": "link:packages/kbn-securitysolution-rules", - "@kbn/securitysolution-t-grid": "link:packages/kbn-securitysolution-t-grid", - "@kbn/securitysolution-utils": "link:packages/kbn-securitysolution-utils", + "@kbn/securitysolution-endpoint-exceptions-common": "link:x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common", + "@kbn/securitysolution-es-utils": "link:src/platform/packages/shared/kbn-securitysolution-es-utils", + "@kbn/securitysolution-exception-list-components": "link:x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components", + "@kbn/securitysolution-exceptions-common": "link:x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common", + "@kbn/securitysolution-hook-utils": "link:x-pack/solutions/security/packages/kbn-securitysolution-hook-utils", + "@kbn/securitysolution-io-ts-alerting-types": "link:x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types", + "@kbn/securitysolution-io-ts-list-types": "link:x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types", + "@kbn/securitysolution-io-ts-types": "link:src/platform/packages/shared/kbn-securitysolution-io-ts-types", + "@kbn/securitysolution-io-ts-utils": "link:src/platform/packages/shared/kbn-securitysolution-io-ts-utils", + "@kbn/securitysolution-list-api": "link:x-pack/solutions/security/packages/kbn-securitysolution-list-api", + "@kbn/securitysolution-list-constants": "link:x-pack/solutions/security/packages/kbn-securitysolution-list-constants", + "@kbn/securitysolution-list-hooks": "link:x-pack/solutions/security/packages/kbn-securitysolution-list-hooks", + "@kbn/securitysolution-list-utils": "link:x-pack/solutions/security/packages/kbn-securitysolution-list-utils", + "@kbn/securitysolution-lists-common": "link:x-pack/solutions/security/packages/kbn-securitysolution-lists-common", + "@kbn/securitysolution-rules": "link:src/platform/packages/shared/kbn-securitysolution-rules", + "@kbn/securitysolution-t-grid": "link:x-pack/solutions/security/packages/kbn-securitysolution-t-grid", + "@kbn/securitysolution-utils": "link:x-pack/solutions/security/packages/kbn-securitysolution-utils", "@kbn/server-http-tools": "link:packages/kbn-server-http-tools", "@kbn/server-route-repository": "link:src/platform/packages/shared/kbn-server-route-repository", "@kbn/server-route-repository-client": "link:src/platform/packages/shared/kbn-server-route-repository-client", @@ -871,10 +870,10 @@ "@kbn/serverless-project-switcher": "link:packages/serverless/project_switcher", "@kbn/serverless-search": "link:x-pack/plugins/serverless_search", "@kbn/serverless-search-settings": "link:packages/serverless/settings/search_project", - "@kbn/serverless-security-settings": "link:packages/serverless/settings/security_project", + "@kbn/serverless-security-settings": "link:src/platform/packages/shared/serverless/settings/security_project", "@kbn/serverless-types": "link:packages/serverless/types", "@kbn/session-notifications-plugin": "link:test/plugin_functional/plugins/session_notifications", - "@kbn/session-view-plugin": "link:x-pack/plugins/session_view", + "@kbn/session-view-plugin": "link:x-pack/solutions/security/plugins/session_view", "@kbn/set-map": "link:packages/kbn-set-map", "@kbn/share-examples-plugin": "link:examples/share_examples", "@kbn/share-plugin": "link:src/plugins/share", @@ -929,7 +928,7 @@ "@kbn/shared-ux-tabbed-modal": "link:packages/shared-ux/modal/tabbed", "@kbn/shared-ux-table-persist": "link:packages/shared-ux/table_persist", "@kbn/shared-ux-utility": "link:packages/kbn-shared-ux-utility", - "@kbn/slo-plugin": "link:x-pack/plugins/observability_solution/slo", + "@kbn/slo-plugin": "link:x-pack/solutions/observability/plugins/slo", "@kbn/slo-schema": "link:x-pack/platform/packages/shared/kbn-slo-schema", "@kbn/snapshot-restore-plugin": "link:x-pack/platform/plugins/private/snapshot_restore", "@kbn/sort-predicates": "link:packages/kbn-sort-predicates", @@ -1028,7 +1027,7 @@ "@kbn/watcher-plugin": "link:x-pack/platform/plugins/private/watcher", "@kbn/xstate-utils": "link:packages/kbn-xstate-utils", "@kbn/zod": "link:packages/kbn-zod", - "@kbn/zod-helpers": "link:packages/kbn-zod-helpers", + "@kbn/zod-helpers": "link:src/platform/packages/shared/kbn-zod-helpers", "@langchain/aws": "^0.1.2", "@langchain/community": "0.3.14", "@langchain/core": "^0.3.16", @@ -1530,7 +1529,7 @@ "@octokit/rest": "^17.11.2", "@parcel/watcher": "^2.1.0", "@playwright/test": "1.49.0", - "@redocly/cli": "^1.25.15", + "@redocly/cli": "^1.26.0", "@statoscope/webpack-plugin": "^5.28.2", "@storybook/addon-a11y": "^6.5.16", "@storybook/addon-actions": "^6.5.16", diff --git a/packages/core/application/core-application-browser-internal/integration_tests/router.test.tsx b/packages/core/application/core-application-browser-internal/integration_tests/router.test.tsx index 26245733dd329..f38a28696db92 100644 --- a/packages/core/application/core-application-browser-internal/integration_tests/router.test.tsx +++ b/packages/core/application/core-application-browser-internal/integration_tests/router.test.tsx @@ -120,7 +120,7 @@ describe('AppRouter', () => { expect(app1.mounter.mount).toHaveBeenCalled(); expect(dom?.html()).toMatchInlineSnapshot(` - "
+ "
basename: /app/app1 html: App 1
" @@ -132,7 +132,7 @@ describe('AppRouter', () => { expect(app1Unmount).toHaveBeenCalled(); expect(app2.mounter.mount).toHaveBeenCalled(); expect(dom?.html()).toMatchInlineSnapshot(` - "
+ "
basename: /app/app2 html:
App 2
" @@ -146,7 +146,7 @@ describe('AppRouter', () => { expect(standardApp.mounter.mount).toHaveBeenCalled(); expect(dom?.html()).toMatchInlineSnapshot(` - "
+ "
basename: /app/app1 html: App 1
" @@ -158,7 +158,7 @@ describe('AppRouter', () => { expect(standardAppUnmount).toHaveBeenCalled(); expect(chromelessApp.mounter.mount).toHaveBeenCalled(); expect(dom?.html()).toMatchInlineSnapshot(` - "
+ "
basename: /chromeless-a/path html:
Chromeless A
" @@ -170,7 +170,7 @@ describe('AppRouter', () => { expect(chromelessAppUnmount).toHaveBeenCalled(); expect(standardApp.mounter.mount).toHaveBeenCalledTimes(2); expect(dom?.html()).toMatchInlineSnapshot(` - "
+ "
basename: /app/app1 html: App 1
" @@ -184,7 +184,7 @@ describe('AppRouter', () => { expect(chromelessAppA.mounter.mount).toHaveBeenCalled(); expect(dom?.html()).toMatchInlineSnapshot(` - "
+ "
basename: /chromeless-a/path html:
Chromeless A
" @@ -196,7 +196,7 @@ describe('AppRouter', () => { expect(chromelessAppAUnmount).toHaveBeenCalled(); expect(chromelessAppB.mounter.mount).toHaveBeenCalled(); expect(dom?.html()).toMatchInlineSnapshot(` - "
+ "
basename: /chromeless-b/path html:
Chromeless B
" @@ -208,7 +208,7 @@ describe('AppRouter', () => { expect(chromelessAppBUnmount).toHaveBeenCalled(); expect(chromelessAppA.mounter.mount).toHaveBeenCalledTimes(2); expect(dom?.html()).toMatchInlineSnapshot(` - "
+ "
basename: /chromeless-a/path html:
Chromeless A
" diff --git a/packages/core/application/core-application-browser-internal/src/ui/app_container.scss b/packages/core/application/core-application-browser-internal/src/ui/app_container.scss deleted file mode 100644 index d30db740505d1..0000000000000 --- a/packages/core/application/core-application-browser-internal/src/ui/app_container.scss +++ /dev/null @@ -1,25 +0,0 @@ -.appContainer__loading { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - z-index: $euiZLevel1; - animation-name: appContainerFadeIn; - animation-iteration-count: 1; - animation-timing-function: ease-in; - animation-duration: 2s; -} - -@keyframes appContainerFadeIn { - 0% { - opacity: 0; - } - - 50% { - opacity: 0; - } - - 100% { - opacity: 1; - } -} diff --git a/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx b/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx index b175cd30d992e..072253a6f9140 100644 --- a/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx +++ b/packages/core/application/core-application-browser-internal/src/ui/app_container.tsx @@ -7,11 +7,10 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import './app_container.scss'; - +import { css, keyframes } from '@emotion/react'; import { Observable } from 'rxjs'; import React, { Fragment, FC, useLayoutEffect, useRef, useState, MutableRefObject } from 'react'; -import { EuiLoadingElastic, EuiLoadingSpinner } from '@elastic/eui'; +import { EuiLoadingElastic, EuiLoadingSpinner, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import type { CoreTheme } from '@kbn/core-theme-browser'; @@ -129,11 +128,29 @@ export const AppContainer: FC = ({ }; const AppLoadingPlaceholder: FC<{ showPlainSpinner: boolean }> = ({ showPlainSpinner }) => { + const { euiTheme } = useEuiTheme(); + const appContainerFadeIn = keyframes({ + '0%': { opacity: 0 }, + '50%': { opacity: 0 }, + '100%': { opacity: 1 }, + }); + const appContainerStyles = css({ + position: 'absolute', + top: '50%', + left: '50%', + transform: 'translate(-50%, -50%)', + zIndex: euiTheme.levels.header, + animationName: appContainerFadeIn, + animationIterationCount: 1, + animationTimingFunction: 'ease-in', + animationDuration: '2s', + }); + if (showPlainSpinner) { return ( = ({ showPlainSpi } return ( css` + #kibana-body { + // DO NOT ADD ANY OVERFLOW BEHAVIORS HERE + // It will break the sticky navigation + min-height: 100%; + display: flex; + flex-direction: column; + } + + // Affixes a div to restrict the position of charts tooltip to the visible viewport minus the header + #app-fixed-viewport { + pointer-events: none; + visibility: hidden; + position: fixed; + top: var(--kbnAppHeadersOffset, var(--euiFixedHeadersOffset, 0)); + right: 0; + bottom: 0; + left: 0; + } + + .kbnAppWrapper { + // DO NOT ADD ANY OTHER STYLES TO THIS SELECTOR + // This a very nested dependency happening in "all" apps + display: flex; + flex-flow: column nowrap; + flex-grow: 1; + z-index: 0; // This effectively puts every high z-index inside the scope of this wrapper to it doesn't interfere with the header and/or overlay mask + position: relative; // This is temporary for apps that relied on this being present on \`.application\` + } + + .kbnBody { + padding-top: var(--euiFixedHeadersOffset, 0); + } + + // Conditionally override :root CSS fixed header variable. Updating \`--euiFixedHeadersOffset\` + //on the body will cause all child EUI components to automatically update their offsets + .kbnBody--hasHeaderBanner { + --euiFixedHeadersOffset: var(--kbnHeaderOffsetWithBanner); + + // Offset fixed EuiHeaders by the top banner + .euiHeader[data-fixed-header] { + margin-top: var(--kbnHeaderBannerHeight); + } + + // Prevent banners from covering full screen data grids + .euiDataGrid--fullScreen { + height: calc(100vh - var(--kbnHeaderBannerHeight)); + top: var(--kbnHeaderBannerHeight); + } + } + + // Set a body CSS variable for the app container to use - calculates the total + // height of all fixed headers + the sticky action menu toolbar + .kbnBody--hasProjectActionMenu { + --kbnAppHeadersOffset: calc( + var(--kbnHeaderOffset) + var(--kbnProjectHeaderAppActionMenuHeight) + ); + + &.kbnBody--hasHeaderBanner { + --kbnAppHeadersOffset: calc( + var(--kbnHeaderOffsetWithBanner) + var(--kbnProjectHeaderAppActionMenuHeight) + ); + } + } + + .kbnBody--chromeHidden { + // stylelint-disable-next-line length-zero-no-unit + --euiFixedHeadersOffset: 0px; + + &.kbnBody--hasHeaderBanner { + --euiFixedHeadersOffset: var(--kbnHeaderBannerHeight); + } + + &.kbnBody--hasProjectActionMenu { + --kbnAppHeadersOffset: var(--euiFixedHeadersOffset, 0); + } + } +`; + +export const bannerStyles = (euiTheme: UseEuiTheme['euiTheme']) => css` + .header__topBanner { + position: fixed; + top: 0; + left: 0; + height: var(--kbnHeaderBannerHeight); + width: 100%; + z-index: ${euiTheme.levels.header}; + } + + .header__topBannerContainer { + height: 100%; + width: 100%; + } +`; + +export const chromeStyles = (euiTheme: UseEuiTheme['euiTheme']) => css` + .euiDataGrid__restrictBody { + .headerGlobalNav, + .kbnQueryBar { + display: none; + } + } + + .euiDataGrid__restrictBody.euiBody--headerIsFixed { + .euiFlyout { + top: 0; + height: 100%; + } + } + + .chrHeaderHelpMenu__version { + text-transform: none; + } + + .chrHeaderBadge__wrapper { + align-self: center; + margin-right: ${euiTheme.size.base}; + } + + .header__toggleNavButtonSection { + .euiBody--collapsibleNavIsDocked & { + display: none; + } + } + + .header__breadcrumbsWithExtensionContainer { + overflow: hidden; // enables text-ellipsis in the last breadcrumb + .euiHeaderBreadcrumbs { + // stop breadcrumbs from growing. + // this makes the extension appear right next to the last breadcrumb + flex-grow: 0; + margin-right: 0; + + overflow: hidden; // enables text-ellipsis in the last breadcrumb + } + } + .header__breadcrumbsAppendExtension { + flex-grow: 1; + } +`; + +export const GlobalAppStyle = () => { + const { euiTheme } = useEuiTheme(); + return ( + + ); +}; diff --git a/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts b/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts index e8519030c3fdf..189f42ee448ad 100644 --- a/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts +++ b/packages/core/apps/core-apps-browser-internal/src/status/lib/load_status.ts @@ -155,7 +155,9 @@ function formatStatus(id: string, status: ServiceStatus): FormattedStatus { }, }; } - +/** + * Maps status to health color for frontend views + */ export const STATUS_LEVEL_UI_ATTRS: Record = { critical: { title: i18n.translate('core.status.redTitle', { diff --git a/packages/core/http/core-http-server-internal/src/http_config.test.ts b/packages/core/http/core-http-server-internal/src/http_config.test.ts index 4ba13489552bd..fa2fbe7ad9f36 100644 --- a/packages/core/http/core-http-server-internal/src/http_config.test.ts +++ b/packages/core/http/core-http-server-internal/src/http_config.test.ts @@ -517,9 +517,9 @@ describe('versioned', () => { ).toThrow(/failed validation/); }); - it('defaults version resolution "none" when in dev', () => { + it('defaults version resolution "oldest" when in dev', () => { expect(config.schema.validate({}, { dev: true })).toMatchObject({ - versioned: { versionResolution: 'none' }, + versioned: { versionResolution: 'oldest' }, }); }); }); diff --git a/packages/core/http/core-http-server-internal/src/http_config.ts b/packages/core/http/core-http-server-internal/src/http_config.ts index 11c1afc410331..4ba9bcb9e88be 100644 --- a/packages/core/http/core-http-server-internal/src/http_config.ts +++ b/packages/core/http/core-http-server-internal/src/http_config.ts @@ -213,7 +213,7 @@ const configSchema = schema.object( * Which handler resolution algo to use for public routes: "newest" or "oldest". * * @note Internal routes always require a version to be specified. - * @note in development we have an additional option "none" which is also the default in dev. + * @note in development we have an additional option "none". * This prevents any fallbacks and requires that a version specified. * Useful for ensuring that a given client always specifies a version. */ @@ -221,7 +221,7 @@ const configSchema = schema.object( schema.contextRef('dev'), true, schema.oneOf([schema.literal('newest'), schema.literal('oldest'), schema.literal('none')], { - defaultValue: 'none', + defaultValue: 'oldest', }), schema.oneOf([schema.literal('newest'), schema.literal('oldest')], { defaultValue: 'oldest', diff --git a/packages/core/http/core-http-server-internal/src/http_server.ts b/packages/core/http/core-http-server-internal/src/http_server.ts index 14cc4397ebce0..1d80c9c4ab0dc 100644 --- a/packages/core/http/core-http-server-internal/src/http_server.ts +++ b/packages/core/http/core-http-server-internal/src/http_server.ts @@ -93,7 +93,11 @@ function startEluMeasurement( if ( eluMonitorOptions.logging.enabled && active >= eluMonitorOptions.logging.threshold.ela && - utilization >= eluMonitorOptions.logging.threshold.elu + utilization >= eluMonitorOptions.logging.threshold.elu && + // static js and js.map assets are generating lots of noise for this + // event loop check, hiding endpoint slowness which are higher priority + // remove this check once endpoints slowness is addressed + !['js', 'js.map'].some((ext) => path.endsWith(ext)) ) { log.warn( `Event loop utilization for ${path} exceeded threshold of ${elaThreshold}ms (${Math.round( diff --git a/packages/core/overlays/core-overlays-browser-internal/src/banners/banners_list.scss b/packages/core/overlays/core-overlays-browser-internal/src/banners/banners_list.scss deleted file mode 100644 index 3d10a71c84a95..0000000000000 --- a/packages/core/overlays/core-overlays-browser-internal/src/banners/banners_list.scss +++ /dev/null @@ -1,3 +0,0 @@ -.kbnGlobalBannerList__item + .kbnGlobalBannerList__item { - margin-top: $euiSizeS; -} diff --git a/packages/core/overlays/core-overlays-browser-internal/src/banners/banners_list.test.tsx b/packages/core/overlays/core-overlays-browser-internal/src/banners/banners_list.test.tsx index f5e7d8c686ce7..36ee74d2bfa59 100644 --- a/packages/core/overlays/core-overlays-browser-internal/src/banners/banners_list.test.tsx +++ b/packages/core/overlays/core-overlays-browser-internal/src/banners/banners_list.test.tsx @@ -33,7 +33,7 @@ describe('BannersList', () => { ]); expect(mount().html()).toMatchInlineSnapshot( - `"

Hello!

"` + `"

Hello!

"` ); }); @@ -75,7 +75,7 @@ describe('BannersList', () => { // Two new banners should be rendered expect(component.html()).toMatchInlineSnapshot( - `"

First Banner!

Second banner!

"` + `"

First Banner!

Second banner!

"` ); // Original banner should be unmounted expect(unmount).toHaveBeenCalled(); diff --git a/packages/core/overlays/core-overlays-browser-internal/src/banners/banners_list.tsx b/packages/core/overlays/core-overlays-browser-internal/src/banners/banners_list.tsx index 173f1f3519a8f..63323b1fee3f9 100644 --- a/packages/core/overlays/core-overlays-browser-internal/src/banners/banners_list.tsx +++ b/packages/core/overlays/core-overlays-browser-internal/src/banners/banners_list.tsx @@ -11,8 +11,6 @@ import React, { useEffect, useRef, useState } from 'react'; import { Observable } from 'rxjs'; import type { OverlayBanner } from './banners_service'; -import './banners_list.scss'; - interface Props { banners$: Observable; } @@ -52,7 +50,9 @@ const BannerItem: React.FunctionComponent<{ banner: OverlayBanner }> = ({ banner return (
({ + '& + &': { marginTop: euiTheme.size.s }, + })} ref={element} data-test-subj="global-banner-item" /> diff --git a/packages/core/overlays/core-overlays-browser-internal/tsconfig.json b/packages/core/overlays/core-overlays-browser-internal/tsconfig.json index 3604db4bc64f7..13263f09b74d5 100644 --- a/packages/core/overlays/core-overlays-browser-internal/tsconfig.json +++ b/packages/core/overlays/core-overlays-browser-internal/tsconfig.json @@ -5,12 +5,14 @@ "types": [ "jest", "node", - "react" + "react", + "@emotion/react/types/css-prop" ] }, "include": [ "**/*.ts", - "**/*.tsx" + "**/*.tsx", + "../../../../typings/emotion.d.ts" ], "kbn_references": [ "@kbn/i18n-react", @@ -28,9 +30,9 @@ "@kbn/core-analytics-browser-mocks", "@kbn/core-analytics-browser", "@kbn/core-user-profile-browser-mocks", - "@kbn/core-user-profile-browser", + "@kbn/core-user-profile-browser" ], "exclude": [ - "target/**/*", + "target/**/*" ] } diff --git a/packages/core/rendering/core-rendering-browser-internal/src/rendering_service.tsx b/packages/core/rendering/core-rendering-browser-internal/src/rendering_service.tsx index 1995d6c013cf6..9d5982bd40d35 100644 --- a/packages/core/rendering/core-rendering-browser-internal/src/rendering_service.tsx +++ b/packages/core/rendering/core-rendering-browser-internal/src/rendering_service.tsx @@ -20,6 +20,7 @@ import type { ThemeServiceStart } from '@kbn/core-theme-browser'; import type { UserProfileService } from '@kbn/core-user-profile-browser'; import { KibanaRootContextProvider } from '@kbn/react-kibana-context-root'; import { APP_FIXED_VIEWPORT_ID } from '@kbn/core-rendering-browser'; +import { GlobalAppStyle } from '@kbn/core-application-common'; import { AppWrapper } from './app_containers'; interface StartServices { @@ -62,6 +63,9 @@ export class RenderingService { ReactDOM.render( <> + {/* Global Styles that apply across the entire app */} + + {/* Fixed headers */} {chromeHeader} diff --git a/packages/core/root/core-root-browser-internal/src/core_system.scss b/packages/core/root/core-root-browser-internal/src/core_system.scss deleted file mode 100644 index 7a8870606c207..0000000000000 --- a/packages/core/root/core-root-browser-internal/src/core_system.scss +++ /dev/null @@ -1,9 +0,0 @@ -/** - * designed to emulate root-element stretching and overflow - * prevention previously handled in kbn_chrome.less - */ -.coreSystemRootDomElement { - overflow-x: hidden; - min-width: 100%; - min-height: 100%; -} diff --git a/packages/core/root/core-root-browser-internal/src/core_system.ts b/packages/core/root/core-root-browser-internal/src/core_system.ts index c9ad8194e4b64..042017368168c 100644 --- a/packages/core/root/core-root-browser-internal/src/core_system.ts +++ b/packages/core/root/core-root-browser-internal/src/core_system.ts @@ -7,6 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ +import { css } from '@emotion/css'; import { filter, firstValueFrom } from 'rxjs'; import type { CoreContext } from '@kbn/core-base-browser-internal'; import { @@ -54,8 +55,6 @@ import { LOAD_START, } from './events'; -import './core_system.scss'; - /** * @internal */ @@ -405,11 +404,17 @@ export class CoreSystem { // ensure the rootDomElement is empty this.rootDomElement.textContent = ''; - this.rootDomElement.classList.add('coreSystemRootDomElement'); this.rootDomElement.appendChild(coreUiTargetDomElement); this.rootDomElement.appendChild(notificationsTargetDomElement); this.rootDomElement.appendChild(overlayTargetDomElement); + const coreSystemRootDomElement = css` + overflow-x: hidden; + min-width: 100%; + min-height: 100%; + `; + this.rootDomElement.classList.add(coreSystemRootDomElement); + this.rendering.start({ application, chrome, diff --git a/packages/deeplinks/security/jest.config.js b/packages/deeplinks/security/jest.config.js deleted file mode 100644 index 6353eecfe6b98..0000000000000 --- a/packages/deeplinks/security/jest.config.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../..', - roots: ['/packages/deeplinks/security'], -}; diff --git a/packages/deeplinks/security/tsconfig.json b/packages/deeplinks/security/tsconfig.json deleted file mode 100644 index d1414086f2187..0000000000000 --- a/packages/deeplinks/security/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node", - "react" - ] - }, - "include": [ - "**/*.ts", - "**/*.tsx", - ], - "exclude": [ - "target/**/*" - ], - "kbn_references": [] -} diff --git a/packages/kbn-alerts-grouping/src/components/alerts_grouping.test.tsx b/packages/kbn-alerts-grouping/src/components/alerts_grouping.test.tsx index 0137953b2313c..14efad8dbddc2 100644 --- a/packages/kbn-alerts-grouping/src/components/alerts_grouping.test.tsx +++ b/packages/kbn-alerts-grouping/src/components/alerts_grouping.test.tsx @@ -8,7 +8,7 @@ */ /** - * Adapted from x-pack/plugins/security_solution/public/detections/components/alerts_table/alerts_grouping.test.tsx + * Adapted from x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/alerts_grouping.test.tsx */ import React from 'react'; import { render, within, screen } from '@testing-library/react'; diff --git a/packages/kbn-babel-preset/styled_components_files.js b/packages/kbn-babel-preset/styled_components_files.js index 1eaeb115ab673..6f6e1ddbb14ac 100644 --- a/packages/kbn-babel-preset/styled_components_files.js +++ b/packages/kbn-babel-preset/styled_components_files.js @@ -15,12 +15,14 @@ module.exports = { USES_STYLED_COMPONENTS: [ /packages[\/\\]kbn-ui-shared-deps-(npm|src)[\/\\]/, /src[\/\\]plugins[\/\\](kibana_react)[\/\\]/, - /x-pack[\/\\]solutions[\/\\]observability[\/\\]plugins[\/\\]/, - /x-pack[\/\\]plugins[\/\\](observability_solution\/apm|beats_management|fleet|lists|observability_solution\/observability|observability_solution\/observability_shared|observability_solution\/exploratory_view|security_solution|timelines|observability_solution\/synthetics|observability_solution\/ux|observability_solution\/uptime)[\/\\]/, - /x-pack[\/\\]solutions[\/\\]security[\/\\]plugins[\/\\](observability_solution\/apm|beats_management|fleet|observability_solution\/infra|lists|observability_solution\/observability|observability_solution\/observability_shared|observability_solution\/exploratory_view|security_solution|timelines|observability_solution\/synthetics|observability_solution\/ux|observability_solution\/uptime)[\/\\]/, + /x-pack[\/\\]solutions[\/\\]observability[\/\\]plugins[\/\\](exploratory_view|investigate|investigate_app|observability|observability_ai_assistant_app|observability_ai_assistant_management|observability_solution|serverless_observability|streams|streams_app|synthetics|uptime|ux)[\/\\]/, + /x-pack[\/\\]plugins[\/\\](beats_management|fleet|observability_solution\/observability|observability_solution\/observability_shared|observability_solution\/exploratory_view|security_solution|timelines|observability_solution\/synthetics|observability_solution\/ux|observability_solution\/uptime)[\/\\]/, + /x-pack[\/\\]solutions[\/\\]security[\/\\]plugins[\/\\](beats_management|fleet|lists|observability_solution\/observability|observability_solution\/observability_shared|observability_solution\/exploratory_view|security_solution|timelines|observability_solution\/synthetics|observability_solution\/ux|observability_solution\/uptime)[\/\\]/, /x-pack[\/\\]test[\/\\]plugin_functional[\/\\]plugins[\/\\]resolver_test[\/\\]/, /x-pack[\/\\]packages[\/\\]elastic_assistant[\/\\]/, /x-pack[\/\\]solutions[\/\\]security[\/\\]packages[\/\\]ecs_data_quality_dashboard[\/\\]/, + /x-pack[\/\\]solutions[\/\\]security[\/\\]plugins[\/\\]security_solution[\/\\]/, /x-pack[\/\\]platform[\/\\]packages[\/\\]shared[\/\\]kbn-elastic-assistant[\/\\]/, + /x-pack[\/\\]solutions[\/\\]security[\/\\]plugins[\/\\]lists/, ], }; diff --git a/packages/kbn-cli-dev-mode/src/watcher.ts b/packages/kbn-cli-dev-mode/src/watcher.ts index 6dc11371d9582..193458495aa21 100644 --- a/packages/kbn-cli-dev-mode/src/watcher.ts +++ b/packages/kbn-cli-dev-mode/src/watcher.ts @@ -19,7 +19,7 @@ import { Log } from './log'; const packageMatcher = makeMatcher([ '**/*', '!**/.*', - '!x-pack/plugins/screenshotting/chromium/**', + '!x-pack/platform/plugins/shared/screenshotting/chromium/**', '!x-pack/plugins/canvas/shareable_runtime/**', ]); diff --git a/packages/kbn-dependency-usage/README.md b/packages/kbn-dependency-usage/README.md index 95d0b237bb141..5a8e07f6b32f9 100644 --- a/packages/kbn-dependency-usage/README.md +++ b/packages/kbn-dependency-usage/README.md @@ -30,11 +30,11 @@ bash scripts/dependency_usage.sh --dependency-name --paths **Example**: ```sh -bash scripts/dependency_usage.sh -p x-pack/plugins/security_solution +bash scripts/dependency_usage.sh -p x-pack/solutions/security/plugins/security_solution ``` -- `-p x-pack/plugins/security_solution`: Specifies the package or directory for which to list all dependencies. -- **Output**: Lists all dependencies for `x-pack/plugins/security_solution`. +- `-p x-pack/solutions/security/plugins/security_solution`: Specifies the package or directory for which to list all dependencies. +- **Output**: Lists all dependencies for `x-pack/solutions/security/plugins/security_solution`. --- @@ -91,18 +91,18 @@ When a package or plugin has multiple subteams, use the `--collapse-depth` optio Shows all subteams within `security_solution`. ```sh -bash scripts/dependency_usage.sh -p x-pack/plugins/security_solution -g owner --collapse-depth 4 +bash scripts/dependency_usage.sh -p x-pack/solutions/security/plugins/security_solution -g owner --collapse-depth 4 ``` #### Collapsed Grouping Groups the results under a higher-level owner (e.g., `security_solution` as a single group). ```sh -bash scripts/dependency_usage.sh -p x-pack/plugins/security_solution -g owner --collapse-depth 1 +bash scripts/dependency_usage.sh -p x-pack/solutions/security/plugins/security_solution -g owner --collapse-depth 1 ``` **Explanation**: -- `-p x-pack/plugins/security_solution`: Specifies the directory to scan. +- `-p x-pack/solutions/security/plugins/security_solution`: Specifies the directory to scan. - `-g owner`: Groups results by code owner. - `--collapse-depth`: Defines the depth for grouping, where higher numbers show more granular subteams. - **Output**: Lists dependencies grouped by code owner at different levels of depth based on the `--collapse-depth` value. @@ -119,13 +119,13 @@ bash scripts/dependency_usage.sh -p -d '' -o -o -v **Example**: ```sh -bash scripts/dependency_usage.sh -p x-pack/plugins/security_solution -o ./tmp/results.json +bash scripts/dependency_usage.sh -p x-pack/solutions/security/plugins/security_solution -o ./tmp/results.json ``` -- `-p x-pack/plugins/security_solution`: Specifies the target directory or package to analyze. +- `-p x-pack/solutions/security/plugins/security_solution`: Specifies the target directory or package to analyze. - `-o ./tmp/results.json`: Saves the output to the `results.json` file in the `./tmp` directory. - `-v`: Enables verbose mode. -**Output**: Saves a list of all dependencies in `x-pack/plugins/security_solution` to `./tmp/results.json`. Additionally, it logs a detailed, non aggregated dependency graph to `.dependency-graph-log.json` for debugging purposes. +**Output**: Saves a list of all dependencies in `x-pack/solutions/security/plugins/security_solution` to `./tmp/results.json`. Additionally, it logs a detailed, non aggregated dependency graph to `.dependency-graph-log.json` for debugging purposes. --- diff --git a/packages/kbn-dependency-usage/src/dependency_graph/providers/cruiser.test.ts b/packages/kbn-dependency-usage/src/dependency_graph/providers/cruiser.test.ts index ed2004c462ab3..14ad94f45000a 100644 --- a/packages/kbn-dependency-usage/src/dependency_graph/providers/cruiser.test.ts +++ b/packages/kbn-dependency-usage/src/dependency_graph/providers/cruiser.test.ts @@ -19,15 +19,21 @@ const codeOwners: Record = { 'plugins/data_charts': ['team_visualization'], 'plugins/analytics': ['team_analytics'], 'plugins/notification': ['team_alerts', 'team_notifications'], - 'plugins/security_solution/public/entity_analytics/components': ['team_security_analytics'], - 'plugins/security_solution/public/entity_analytics/components/componentA.ts': [ + 'solutions/security/plugins/security_solution/public/entity_analytics/components': [ 'team_security_analytics', ], - 'plugins/security_solution/public/entity_analytics/components/componentB.ts': [ + 'solutions/security/plugins/security_solution/public/entity_analytics/components/componentA.ts': [ 'team_security_analytics', ], - 'plugins/security_solution/server/lib/analytics/analytics.ts': ['team_security_analytics'], - 'plugins/security_solution/common/api/detection_engine': ['team_security_solution'], + 'solutions/security/plugins/security_solution/public/entity_analytics/components/componentB.ts': [ + 'team_security_analytics', + ], + 'solutions/security/plugins/security_solution/server/lib/analytics/analytics.ts': [ + 'team_security_analytics', + ], + 'solutions/security/plugins/security_solution/common/api/detection_engine': [ + 'team_security_solution', + ], }; jest.mock('dependency-cruiser', () => ({ @@ -301,23 +307,23 @@ describe('identifyDependencyUsage', () => { summary: { violations: [ { - from: 'plugins/security_solution/public/entity_analytics/components/componentA.ts', + from: 'solutions/security/plugins/security_solution/public/entity_analytics/components/componentA.ts', to: 'node_modules/lodash/fp.js', }, { - from: 'plugins/security_solution/public/entity_analytics/components/componentB.ts', + from: 'solutions/security/plugins/security_solution/public/entity_analytics/components/componentB.ts', to: 'node_modules/lodash/partition.js', }, { - from: 'plugins/security_solution/server/lib/analytics/analytics.ts', + from: 'solutions/security/plugins/security_solution/server/lib/analytics/analytics.ts', to: 'node_modules/lodash/partition.js', }, { - from: 'plugins/security_solution/server/lib/analytics/analytics.ts', + from: 'solutions/security/plugins/security_solution/server/lib/analytics/analytics.ts', to: 'node_modules/lodash/cloneDeep.js', }, { - from: 'plugins/security_solution/common/api/detection_engine', + from: 'solutions/security/plugins/security_solution/common/api/detection_engine', to: 'node_modules/lodash/sortBy.js', }, ], @@ -337,15 +343,15 @@ describe('identifyDependencyUsage', () => { expect(result).toEqual({ team_security_analytics: { modules: [ - 'plugins/security_solution/public/entity_analytics/components/componentA.ts', - 'plugins/security_solution/public/entity_analytics/components/componentB.ts', - 'plugins/security_solution/server/lib/analytics/analytics.ts', + 'solutions/security/plugins/security_solution/public/entity_analytics/components/componentA.ts', + 'solutions/security/plugins/security_solution/public/entity_analytics/components/componentB.ts', + 'solutions/security/plugins/security_solution/server/lib/analytics/analytics.ts', ], deps: ['lodash/fp.js', 'lodash/partition.js', 'lodash/cloneDeep.js'], teams: ['team_security_analytics'], }, team_security_solution: { - modules: ['plugins/security_solution/common/api/detection_engine'], + modules: ['solutions/security/plugins/security_solution/common/api/detection_engine'], deps: ['lodash/sortBy.js'], teams: ['team_security_solution'], }, diff --git a/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/__fixtures__/ftr_report.xml b/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/__fixtures__/ftr_report.xml index 07f1e79b0f5df..77c0d7691d22d 100644 --- a/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/__fixtures__/ftr_report.xml +++ b/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/__fixtures__/ftr_report.xml @@ -1,7 +1,7 @@ - + - + - + - + { ‹?xml version="1.0" encoding="utf-8"?› ‹testsuites name="ftr" timestamp="2019-06-05T23:37:10" time="903.670" tests="129" failures="5" skipped="71" command-line="node scripts/functional_tests --config=x-pack/test/api_integration/apis/status/config.ts"› ‹testsuite timestamp="2019-06-05T23:37:10" time="903.670" tests="129" failures="5" skipped="71" command-line="node scripts/functional_tests --config=x-pack/test/api_integration/apis/status/config.ts"› - ‹testcase name="maps app maps loaded from sample data ecommerce "before all" hook" classname="Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/maps/sample_data·js" time="154.378"› + ‹testcase name="maps app maps loaded from sample data ecommerce "before all" hook" classname="Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/maps/sample_data·js" time="154.378" owners="elastic/kibana-presentation"› - ‹system-out› - ‹![CDATA[[00:00:00] │ + ‹system-out›Failed Tests Reporter: @@ -88,7 +88,7 @@ it('rewrites ftr reports with minimal changes', async () => { + at onFailure (/var/lib/jenkins/workspace/elastic+kibana+master/JOB/x-pack-ciGroup7/node/immutable/kibana/test/common/services/retry/retry_for_success.ts:68:13) ‹/failure› ‹/testcase› - ‹testcase name="maps app "after all" hook" classname="Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/maps" time="0.179" metadata-json="{"messages":["foo"],"screenshots":[{"name":"failure[dashboard app using current data dashboard snapshots compare TSVB snapshot]","url":"https://storage.googleapis.com/kibana-ci-artifacts/jobs/elastic+kibana+7.x/1632/kibana-oss-tests/test/functional/screenshots/failure/dashboard%20app%20using%20current%20data%20dashboard%20snapshots%20compare%20TSVB%20snapshot.png"}]}"› + ‹testcase name="maps app "after all" hook" classname="Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/maps" time="0.179" metadata-json="{"messages":["foo"],"screenshots":[{"name":"failure[dashboard app using current data dashboard snapshots compare TSVB snapshot]","url":"https://storage.googleapis.com/kibana-ci-artifacts/jobs/elastic+kibana+7.x/1632/kibana-oss-tests/test/functional/screenshots/failure/dashboard%20app%20using%20current%20data%20dashboard%20snapshots%20compare%20TSVB%20snapshot.png"}]}" owners="elastic/kibana-presentation"› ‹system-out› - ‹![CDATA[[00:00:00] │ + [00:00:00] │ @@ -106,7 +106,7 @@ it('rewrites ftr reports with minimal changes', async () => { + at process._tickCallback (internal/process/next_tick.js:68:7) name: 'NoSuchSessionError', remoteStacktrace: '' } ‹/failure› ‹/testcase› - ‹testcase name="InfraOps app feature controls infrastructure security global infrastructure all privileges shows infrastructure navlink" classname="Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/infra/feature_controls/infrastructure_security·ts"› + ‹testcase name="InfraOps app feature controls infrastructure security global infrastructure all privileges shows infrastructure navlink" classname="Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/infra/feature_controls/infrastructure_security·ts" owners="elastic/kibana-presentation"› ‹system-out› - ‹![CDATA[[00:00:00] │ + [00:00:00] │ @@ -117,7 +117,7 @@ it('rewrites ftr reports with minimal changes', async () => { ‹/system-out› ‹skipped/› ‹/testcase› - ‹testcase name="machine learning anomaly detection saved search with lucene query job creation opens the advanced section" classname="Firefox XPack UI Functional Tests.x-pack/test/functional/apps/machine_learning/anomaly_detection/saved_search_job·ts" time="6.040"› + ‹testcase name="machine learning anomaly detection saved search with lucene query job creation opens the advanced section" classname="Firefox XPack UI Functional Tests.x-pack/test/functional/apps/machine_learning/anomaly_detection/saved_search_job·ts" time="6.040" owners="elastic/ml-ui"› - ‹system-out›‹![CDATA[[00:21:57] └-: machine learning...]]›‹/system-out› - ‹failure›‹![CDATA[{ NoSuchSessionError: Tried to run command without establishing a connection + ‹system-out›[00:21:57] └-: machine learning...‹/system-out› diff --git a/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/get_failures.test.ts b/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/get_failures.test.ts index b00ef8cb6bc49..52d2858232d52 100644 --- a/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/get_failures.test.ts +++ b/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/get_failures.test.ts @@ -28,6 +28,7 @@ it('discovers failures in ftr report', async () => { ", "likelyIrrelevant": false, "name": "maps app maps loaded from sample data ecommerce \\"before all\\" hook", + "owners": "elastic/kibana-presentation", "system-out": " [00:00:00] │ [00:07:04] └-: maps app @@ -49,6 +50,7 @@ it('discovers failures in ftr report', async () => { "likelyIrrelevant": true, "metadata-json": "{\\"messages\\":[\\"foo\\"],\\"screenshots\\":[{\\"name\\":\\"failure[dashboard app using current data dashboard snapshots compare TSVB snapshot]\\",\\"url\\":\\"https://storage.googleapis.com/kibana-ci-artifacts/jobs/elastic+kibana+7.x/1632/kibana-oss-tests/test/functional/screenshots/failure/dashboard%20app%20using%20current%20data%20dashboard%20snapshots%20compare%20TSVB%20snapshot.png\\"}]}", "name": "maps app \\"after all\\" hook", + "owners": "elastic/kibana-presentation", "system-out": " [00:00:00] │ [00:07:04] └-: maps app @@ -67,6 +69,7 @@ it('discovers failures in ftr report', async () => { at process._tickCallback (internal/process/next_tick.js:68:7) name: 'NoSuchSessionError', remoteStacktrace: '' }", "likelyIrrelevant": true, "name": "machine learning anomaly detection saved search with lucene query job creation opens the advanced section", + "owners": "elastic/ml-ui", "system-out": "[00:21:57] └-: machine learning...", "time": "6.040", }, @@ -87,6 +90,7 @@ it('discovers failures in jest report', async () => { ", "likelyIrrelevant": false, "name": "launcher can reconnect if process died", + "owners": undefined, "system-out": "", "time": "7.060", }, @@ -116,6 +120,7 @@ it('discovers failures in mocha report', async () => { ", "likelyIrrelevant": true, "name": "code in multiple nodes \\"before all\\" hook", + "owners": undefined, "system-out": " ", @@ -131,6 +136,7 @@ it('discovers failures in mocha report', async () => { ", "likelyIrrelevant": true, "name": "code in multiple nodes \\"after all\\" hook", + "owners": undefined, "system-out": " ", diff --git a/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/get_failures.ts b/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/get_failures.ts index dd5e846dfc01e..d65773810ddf4 100644 --- a/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/get_failures.ts +++ b/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/get_failures.ts @@ -18,6 +18,7 @@ export type TestFailure = FailedTestCase['$'] & { githubIssue?: string; failureCount?: number; commandLine?: string; + owners?: any; }; const getText = (node?: Array) => { @@ -78,6 +79,7 @@ export function getFailures(report: TestReport) { for (const testCase of makeFailedTestCaseIter(report)) { const failure = getText(testCase.failure); const likelyIrrelevant = isLikelyIrrelevant(testCase.$.name, failure); + const owners = testCase.$.owners; const failureObj = { // unwrap xml weirdness @@ -87,6 +89,7 @@ export function getFailures(report: TestReport) { likelyIrrelevant, 'system-out': getText(testCase['system-out']), commandLine, + owners, }; // cleaning up duplicates diff --git a/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/report_failures_to_file.ts b/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/report_failures_to_file.ts index b1e3997ebf030..049aff3dcdef1 100644 --- a/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/report_failures_to_file.ts +++ b/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/report_failures_to_file.ts @@ -179,6 +179,12 @@ export async function reportFailuresToFile(
` : '' } +
+ Owners: +
${escape(
+                  failure?.owners ? (failure?.owners as string) : 'Unable to determine code owners'
+                )}
+
Failures in tracked branches: ${failure.failureCount || 0} diff --git a/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/test_report.ts b/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/test_report.ts index e56e4a6810efd..6467cfaab14be 100644 --- a/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/test_report.ts +++ b/packages/kbn-failed-test-reporter-cli/failed_tests_reporter/test_report.ts @@ -11,7 +11,6 @@ import Fs from 'fs'; import { promisify } from 'util'; import xml2js from 'xml2js'; - const readAsync = promisify(Fs.readFile); export type TestReport = @@ -40,6 +39,8 @@ export interface TestSuite { 'metadata-json'?: string; /* the command that ran this suite */ 'command-line'?: string; + /* the codeowners of the file */ + owners?: string; }; testcase?: TestCase[]; } @@ -56,6 +57,8 @@ export interface TestCase { 'metadata-json'?: string; /* the command that ran this suite */ 'command-line'?: string; + /* the codeowners of the file */ + owners?: string; }; /* contents of system-out elements */ 'system-out'?: Array; diff --git a/packages/kbn-openapi-common/jest.config.js b/packages/kbn-openapi-common/jest.config.js deleted file mode 100644 index c8e533f9d7ed8..0000000000000 --- a/packages/kbn-openapi-common/jest.config.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - preset: '@kbn/test/jest_node', - rootDir: '../..', - roots: ['/packages/kbn-openapi-common'], -}; diff --git a/packages/kbn-openapi-common/scripts/openapi_generate.js b/packages/kbn-openapi-common/scripts/openapi_generate.js deleted file mode 100644 index 07b7c4c0e4a0b..0000000000000 --- a/packages/kbn-openapi-common/scripts/openapi_generate.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -require('../../../src/setup_node_env'); -const { resolve } = require('path'); -const { generate } = require('@kbn/openapi-generator'); - -const ROOT = resolve(__dirname, '..'); - -(async () => { - await generate({ - title: 'OpenAPI Common Schemas (kbn-openapi-common)', - rootDir: ROOT, - sourceGlob: './schemas/**/*.schema.yaml', - templateName: 'zod_operation_schema', - }); -})(); diff --git a/packages/kbn-openapi-common/tsconfig.json b/packages/kbn-openapi-common/tsconfig.json deleted file mode 100644 index 29a271ba4840d..0000000000000 --- a/packages/kbn-openapi-common/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "outDir": "target/types", - "types": ["jest", "node"] - }, - "exclude": ["target/**/*"], - "extends": "../../tsconfig.base.json", - "include": ["**/*.ts"], - "kbn_references": [ - "@kbn/zod", - "@kbn/zod-helpers", - ] -} diff --git a/packages/kbn-openapi-generator/README.md b/packages/kbn-openapi-generator/README.md index 1652588cbe15b..de83360a788ec 100644 --- a/packages/kbn-openapi-generator/README.md +++ b/packages/kbn-openapi-generator/README.md @@ -57,7 +57,7 @@ Put it anywhere in your plugin, the code generation script will traverse the who Then to generate code run the following command: ```bash -node scripts/generate_openapi --rootDir ./x-pack/plugins/security_solution +node scripts/generate_openapi --rootDir ./x-pack/solutions/security/plugins/security_solution ``` ![Generator command output](image.png) @@ -134,7 +134,7 @@ source .buildkite/scripts/common/util.sh echo --- Security Solution OpenAPI Code Generation -(cd x-pack/plugins/security_solution && yarn openapi:generate) +(cd x-pack/solutions/security/plugins/security_solution && yarn openapi:generate) check_for_changed_files "yarn openapi:generate" true ``` diff --git a/packages/kbn-relocate/constants.ts b/packages/kbn-relocate/constants.ts index 5b5f4099b782b..8c3bf347de4cb 100644 --- a/packages/kbn-relocate/constants.ts +++ b/packages/kbn-relocate/constants.ts @@ -46,8 +46,10 @@ export const EXTENSIONS = [ 'mdz', 'asciidoc', 'sh', + 'snap', 'ts', 'jsonc', + 'xml', 'yaml', 'yml', ]; diff --git a/packages/kbn-relocate/relocate.ts b/packages/kbn-relocate/relocate.ts index fe2537ddeb040..16b2c17f4b066 100644 --- a/packages/kbn-relocate/relocate.ts +++ b/packages/kbn-relocate/relocate.ts @@ -15,7 +15,7 @@ import { orderBy } from 'lodash'; import type { ToolingLog } from '@kbn/tooling-log'; import { getPackages } from '@kbn/repo-packages'; import { REPO_ROOT } from '@kbn/repo-info'; -import type { Package } from './types'; +import type { Package, PullRequest } from './types'; import { DESCRIPTION, EXCLUDED_MODULES, KIBANA_FOLDER, NEW_BRANCH } from './constants'; import { belongsTo, @@ -26,7 +26,15 @@ import { } from './utils/relocate'; import { safeExec } from './utils/exec'; import { relocatePlan, relocateSummary } from './utils/logging'; -import { checkoutBranch, checkoutResetPr, findGithubLogin, findRemoteName } from './utils/git'; +import { + checkoutBranch, + checkoutResetPr, + cherryPickManualCommits, + findGithubLogin, + findPr, + findRemoteName, + getManualCommits, +} from './utils/git'; const moveModule = async (module: Package, log: ToolingLog) => { const destination = calculateModuleTargetFolder(module); @@ -128,6 +136,9 @@ export const findAndMoveModule = async (moduleId: string, log: ToolingLog) => { }; export const findAndRelocateModules = async (params: RelocateModulesParams, log: ToolingLog) => { + const { prNumber, baseBranch, ...findParams } = params; + let pr: PullRequest | undefined; + const upstream = await findRemoteName('elastic/kibana'); if (!upstream) { log.error( @@ -142,8 +153,6 @@ export const findAndRelocateModules = async (params: RelocateModulesParams, log: return; } - const { prNumber, baseBranch, ...findParams } = params; - const toMove = findModules(findParams, log); if (!toMove.length) { log.info( @@ -153,40 +162,60 @@ export const findAndRelocateModules = async (params: RelocateModulesParams, log: } relocatePlan(toMove, log); - const res1 = await inquirer.prompt({ + + const resConfirmPlan = await inquirer.prompt({ type: 'confirm', name: 'confirmPlan', message: `The script will RESET CHANGES in this repository, relocate the modules above and update references. Proceed?`, }); - if (!res1.confirmPlan) { + if (!resConfirmPlan.confirmPlan) { log.info('Aborting'); return; } + if (prNumber) { + pr = await findPr(prNumber); + + if (getManualCommits(pr.commits).length > 0) { + const resOverride = await inquirer.prompt({ + type: 'confirm', + name: 'overrideManualCommits', + message: 'Detected manual commits in the PR, do you want to override them?', + }); + if (!resOverride.overrideManualCommits) { + return; + } + } + } + // start with a clean repo await safeExec(`git restore --staged .`); await safeExec(`git restore .`); await safeExec(`git clean -f -d`); await safeExec(`git checkout ${baseBranch} && git pull ${upstream} ${baseBranch}`); - if (prNumber) { + if (pr) { // checkout existing PR, reset all commits, rebase from baseBranch try { - if (!(await checkoutResetPr(baseBranch, prNumber))) { - log.info('Aborting'); - return; - } + await checkoutResetPr(pr, baseBranch); } catch (error) { log.error(`Error checking out / resetting PR #${prNumber}:`); log.error(error); return; } } else { - // checkout [new] branch + // checkout new branch await checkoutBranch(NEW_BRANCH); } + // push changes in the branch + await inquirer.prompt({ + type: 'confirm', + name: 'readyRelocate', + message: `Ready to relocate! You can commit changes previous to the relocation at this point. Confirm to proceed with the relocation`, + }); + // relocate modules await safeExec(`yarn kbn bootstrap`); const movedCount = await relocateModules(toMove, log); @@ -197,10 +226,15 @@ export const findAndRelocateModules = async (params: RelocateModulesParams, log: ); return; } + relocateSummary(log); + if (pr) { + await cherryPickManualCommits(pr, log); + } + // push changes in the branch - const res2 = await inquirer.prompt({ + const resPushBranch = await inquirer.prompt({ type: 'confirm', name: 'pushBranch', message: `Relocation finished! You can commit extra changes at this point. Confirm to proceed pushing the current branch`, @@ -210,7 +244,7 @@ export const findAndRelocateModules = async (params: RelocateModulesParams, log: ? `git push --force-with-lease` : `git push --set-upstream ${origin} ${NEW_BRANCH}`; - if (!res2.pushBranch) { + if (!resPushBranch.pushBranch) { log.info(`Remember to push changes with "${pushCmd}"`); return; } @@ -221,6 +255,8 @@ export const findAndRelocateModules = async (params: RelocateModulesParams, log: log.info(`Access the PR at: https://github.com/elastic/kibana/pull/${prNumber}`); } else { log.info('TIP: Run the following command to quickly create a PR:'); - log.info(`$ gh pr create -d -t "" -F ${DESCRIPTION} -R elastic/kibana`); + log.info( + `$ gh pr create -d -B "${baseBranch}" -t "<title>" -F ${DESCRIPTION} -R elastic/kibana` + ); } }; diff --git a/packages/kbn-relocate/types.ts b/packages/kbn-relocate/types.ts index 391cef336d639..2f030bb68ae7e 100644 --- a/packages/kbn-relocate/types.ts +++ b/packages/kbn-relocate/types.ts @@ -14,6 +14,7 @@ export interface CommitAuthor { } export interface Commit { + oid: string; messageHeadline: string; authors: CommitAuthor[]; } diff --git a/packages/kbn-relocate/utils/git.ts b/packages/kbn-relocate/utils/git.ts index f2e529bee6d0f..0085e07fdd6b5 100644 --- a/packages/kbn-relocate/utils/git.ts +++ b/packages/kbn-relocate/utils/git.ts @@ -8,17 +8,24 @@ */ import inquirer from 'inquirer'; +import type { ToolingLog } from '@kbn/tooling-log'; import type { Commit, PullRequest } from '../types'; import { safeExec } from './exec'; export const findRemoteName = async (repo: string) => { - const res = await safeExec('git remote -v'); - const remotes = res.stdout.split('\n').map((line) => line.split(/\t| /).filter(Boolean)); - return remotes.find(([_, url]) => url.includes(`github.com/${repo}`))?.[0]; + const res = await safeExec('git remote -v', true, false); + const remotes = res.stdout + .trim() + .split('\n') + .map((line) => line.split(/\t| /).filter(Boolean)) + .filter((chunks) => chunks.length >= 2); + return remotes.find( + ([, url]) => url.includes(`github.com/${repo}`) || url.includes(`github.com:${repo}`) + )?.[0]; }; export const findGithubLogin = async () => { - const res = await safeExec('gh auth status'); + const res = await safeExec('gh auth status', true, false); // e.g. ✓ Logged in to github.com account gsoldevila (/Users/gsoldevila/.config/gh/hosts.yml) const loginLine = res.stdout .split('\n') @@ -34,17 +41,16 @@ export const findPr = async (number: string): Promise<PullRequest> => { return { ...JSON.parse(res.stdout), number }; }; -export function hasManualCommits(commits: Commit[]) { - const manualCommits = commits.filter( - (commit) => - !commit.messageHeadline.startsWith('Relocating module ') && - !commit.messageHeadline.startsWith('Moving modules owned by ') && - commit.authors.some( - (author) => author.login !== 'kibanamachine' && author.login !== 'elasticmachine' - ) +export const isManualCommit = (commit: Commit) => + !commit.messageHeadline.startsWith('Relocating module ') && + !commit.messageHeadline.startsWith('Moving modules owned by ') && + !commit.messageHeadline.startsWith('Merge branch ') && + commit.authors.some( + (author) => author.login !== 'kibanamachine' && author.login !== 'elasticmachine' ); - return manualCommits.length > 0; +export function getManualCommits(commits: Commit[]) { + return commits.filter(isManualCommit); } export async function getLastCommitMessage() { @@ -87,33 +93,14 @@ async function deleteBranches(...branchNames: string[]) { ); } -export const checkoutResetPr = async (baseBranch: string, prNumber: string): Promise<boolean> => { - const pr = await findPr(prNumber); - - if (hasManualCommits(pr.commits)) { - const res = await inquirer.prompt({ - type: 'confirm', - name: 'overrideManualCommits', - message: 'Detected manual commits in the PR, do you want to override them?', - }); - if (!res.overrideManualCommits) { - return false; - } - } - - // previous cleanup on current branch - await safeExec(`git restore --staged .`); - await safeExec(`git restore .`); - await safeExec(`git clean -f -d`); - +export const checkoutResetPr = async (pr: PullRequest, baseBranch: string) => { // delete existing branch await deleteBranches(pr.headRefName); // checkout the PR branch - await safeExec(`gh pr checkout ${prNumber}`); + await safeExec(`gh pr checkout ${pr.number}`); await resetAllCommits(pr.commits.length); await safeExec(`git rebase ${baseBranch}`); - return true; }; export const checkoutBranch = async (branch: string) => { @@ -124,3 +111,71 @@ export const checkoutBranch = async (branch: string) => { await safeExec(`git checkout -b ${branch}`); } }; + +export const cherryPickManualCommits = async (pr: PullRequest, log: ToolingLog) => { + const manualCommits = getManualCommits(pr.commits); + if (manualCommits.length) { + log.info(`Found manual commits on https://github.com/elastic/kibana/pull/${pr.number}/commits`); + + for (let i = 0; i < manualCommits.length; ++i) { + const { oid, messageHeadline, authors } = manualCommits[i]; + const url = `https://github.com/elastic/kibana/pull/${pr.number}/commits/${oid}`; + + const res = await inquirer.prompt({ + type: 'list', + choices: [ + { name: 'Yes, attempt to cherry-pick', value: 'yes' }, + { name: 'No, I will add it manually (press when finished)', value: 'no' }, + ], + name: 'cherryPick', + message: `Do you want to cherry pick '${messageHeadline}' (${authors[0].login})?`, + }); + + if (res.cherryPick === 'yes') { + try { + await safeExec(`git cherry-pick ${oid}`); + log.info(`Commit '${messageHeadline}' (${authors[0].login}) cherry-picked successfully!`); + } catch (error) { + log.info(`Error trying to cherry-pick: ${url}`); + log.error(error.message); + const res2 = await inquirer.prompt({ + type: 'list', + choices: [ + { name: 'Abort this cherry-pick', value: 'abort' }, + { name: 'Conflicts solved (git cherry-pick --continue)', value: 'continue' }, + { name: 'I solved the conflicts and commited', value: 'done' }, + ], + name: 'cherryPickFailed', + message: `Automatic cherry-pick failed, manual intervention required`, + }); + + if (res2.cherryPickFailed === 'abort') { + try { + await safeExec(`git cherry-pick --abort`); + log.warning( + 'Cherry-pick aborted, please review changes in that commit and apply them manually if needed!' + ); + } catch (error2) { + log.error( + 'Cherry-pick --abort failed, please cleanup your working tree before continuing!' + ); + } + } else if (res2.cherryPickFailed === 'continue') { + try { + await safeExec(`git cherry-pick --continue`); + log.info( + `Commit '${messageHeadline}' (${authors[0].login}) cherry-picked successfully!` + ); + } catch (error2) { + await inquirer.prompt({ + type: 'confirm', + name: 'cherryPickContinueFailed', + message: `Cherry pick --continue failed, please address conflicts AND COMMIT manually. Hit confirm when ready`, + }); + } + } + } + } + } + } +}; diff --git a/packages/kbn-relocate/utils/logging.ts b/packages/kbn-relocate/utils/logging.ts index 742610dfe1de6..4aec07a1d9bf9 100644 --- a/packages/kbn-relocate/utils/logging.ts +++ b/packages/kbn-relocate/utils/logging.ts @@ -10,6 +10,7 @@ import type { ToolingLog } from '@kbn/tooling-log'; import { appendFileSync, writeFileSync } from 'fs'; import dedent from 'dedent'; +import Table from 'cli-table3'; import type { Package } from '../types'; import { calculateModuleTargetFolder } from './relocate'; import { @@ -21,6 +22,20 @@ import { UPDATED_RELATIVE_PATHS, } from '../constants'; +export const createModuleTable = (entries: string[][]) => { + const table = new Table({ + head: ['Id', 'Target folder'], + colAligns: ['left', 'left'], + style: { + 'padding-left': 2, + 'padding-right': 2, + }, + }); + + table.push(...entries); + return table; +}; + export const relocatePlan = (modules: Package[], log: ToolingLog) => { const plugins = modules.filter((module) => module.manifest.type === 'plugin'); const packages = modules.filter((module) => module.manifest.type !== 'plugin'); @@ -37,11 +52,8 @@ export const relocatePlan = (modules: Package[], log: ToolingLog) => { \n\n`; appendFileSync(DESCRIPTION, pluginList); - log.info( - `${plugins.length} plugin(s) are going to be relocated:\n${plugins - .map((plg) => `${plg.id} => ${target(plg)}`) - .join('\n')}` - ); + const plgTable = createModuleTable(plugins.map((plg) => [plg.id, target(plg)])); + log.info(`${plugins.length} plugin(s) are going to be relocated:\n${plgTable.toString()}`); } if (packages.length) { @@ -53,11 +65,8 @@ export const relocatePlan = (modules: Package[], log: ToolingLog) => { \n\n`; appendFileSync(DESCRIPTION, packageList); - log.info( - `${packages.length} packages(s) are going to be relocated:\n${packages - .map((plg) => `${plg.id} => ${target(plg)}`) - .join('\n')}` - ); + const pkgTable = createModuleTable(packages.map((pkg) => [pkg.id, target(pkg)])); + log.info(`${packages.length} packages(s) are going to be relocated:\n${pkgTable.toString()}`); } }; diff --git a/packages/kbn-saved-search-component/README.md b/packages/kbn-saved-search-component/README.md index 296ddb9079bcf..61ec5a6cd8a90 100644 --- a/packages/kbn-saved-search-component/README.md +++ b/packages/kbn-saved-search-component/README.md @@ -1,6 +1,6 @@ # @kbn/saved-search-component -A component wrapper around Discover's Saved Search embeddable. This can be used in solutions without being within a Dasboard context. +A component wrapper around Discover session embeddable. This can be used in solutions without being within a Dasboard context. This can be used to render a context-aware (logs etc) "document table". diff --git a/packages/kbn-search-api-panels/components/cloud_details.tsx b/packages/kbn-search-api-panels/components/cloud_details.tsx index df2cc6bb6837d..0c406b4c31855 100644 --- a/packages/kbn-search-api-panels/components/cloud_details.tsx +++ b/packages/kbn-search-api-panels/components/cloud_details.tsx @@ -97,7 +97,7 @@ export const CloudDetailsPanel = ({ </EuiFlexItem> <EuiFlexItem grow={false}> <span> - <EuiBadge color="success"> + <EuiBadge color="accent"> <FormattedMessage id="searchApiPanels.cloudIdDetails.elasticsearchEndpoint.recommendedBadge" defaultMessage="Recommended" diff --git a/packages/kbn-search-connectors/lib/collect_connector_stats_test_data.ts b/packages/kbn-search-connectors/lib/collect_connector_stats_test_data.ts index 38b334462c401..cbd104480ae6d 100644 --- a/packages/kbn-search-connectors/lib/collect_connector_stats_test_data.ts +++ b/packages/kbn-search-connectors/lib/collect_connector_stats_test_data.ts @@ -29,7 +29,7 @@ export const spoConnector: Connector = { last_indexed_document_count: 1000, pipeline: { extract_binary_content: false, - name: 'ent-search-generic-ingestion', + name: 'search-default-ingestion', reduce_whitespace: true, run_ml_inference: false, }, @@ -99,7 +99,7 @@ export const mysqlConnector: Connector = { last_indexed_document_count: 2000, pipeline: { extract_binary_content: true, - name: 'ent-search-generic-ingestion', + name: 'search-default-ingestion', reduce_whitespace: true, run_ml_inference: false, }, diff --git a/packages/kbn-search-connectors/lib/create_connector_document.test.ts b/packages/kbn-search-connectors/lib/create_connector_document.test.ts index 0d0400d7081f5..c8b14317c33de 100644 --- a/packages/kbn-search-connectors/lib/create_connector_document.test.ts +++ b/packages/kbn-search-connectors/lib/create_connector_document.test.ts @@ -21,7 +21,7 @@ describe('createConnectorDocument', () => { name: 'indexName-name', pipeline: { extract_binary_content: true, - name: 'ent-search-generic-ingestion', + name: 'search-default-ingestion', reduce_whitespace: true, run_ml_inference: false, }, @@ -103,7 +103,7 @@ describe('createConnectorDocument', () => { name: 'indexName-name', pipeline: { extract_binary_content: true, - name: 'ent-search-generic-ingestion', + name: 'search-default-ingestion', reduce_whitespace: true, run_ml_inference: false, }, diff --git a/packages/kbn-securitysolution-autocomplete/index.ts b/packages/kbn-securitysolution-autocomplete/index.ts deleted file mode 100644 index e47113719176f..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/index.ts +++ /dev/null @@ -1,25 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './src/check_empty_value'; -export * from './src/es_field_selector'; -export * from './src/field_value_exists'; -export * from './src/field_value_lists'; -export * from './src/field_value_match'; -export * from './src/field_value_match_any'; -export * from './src/field_value_wildcard'; -export * from './src/filter_field_to_list'; -export * from './src/get_generic_combo_box_props'; -export * from './src/get_operators'; -export * from './src/hooks'; -export * from './src/operator'; -export * from './src/param_is_valid'; -export * from './src/param_contains_space'; - -export { default as autoCompletei18n } from './src/translations'; diff --git a/packages/kbn-securitysolution-autocomplete/jest.config.js b/packages/kbn-securitysolution-autocomplete/jest.config.js deleted file mode 100644 index b7d1e59f77866..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/jest.config.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../..', - roots: ['<rootDir>/packages/kbn-securitysolution-autocomplete'], -}; diff --git a/packages/kbn-securitysolution-autocomplete/package.json b/packages/kbn-securitysolution-autocomplete/package.json deleted file mode 100644 index f841706e57a7e..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@kbn/securitysolution-autocomplete", - "version": "1.0.0", - "description": "Security Solution auto complete", - "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0", - "private": true, - "sideEffects": false -} \ No newline at end of file diff --git a/packages/kbn-securitysolution-autocomplete/src/autocomplete/index.mock.ts b/packages/kbn-securitysolution-autocomplete/src/autocomplete/index.mock.ts deleted file mode 100644 index 71bfb7f4a67cd..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/autocomplete/index.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -// Copied from "src/plugins/data/public/mocks.ts" but without any type information -// TODO: Remove this in favor of the data/public/mocks if/when they become available, https://github.com/elastic/kibana/issues/100715 -export const autocompleteStartMock = { - getQuerySuggestions: jest.fn(), - getValueSuggestions: jest.fn(), - hasQuerySuggestions: jest.fn(), -}; diff --git a/packages/kbn-securitysolution-autocomplete/src/check_empty_value/index.test.ts b/packages/kbn-securitysolution-autocomplete/src/check_empty_value/index.test.ts deleted file mode 100644 index d98feca80b75b..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/check_empty_value/index.test.ts +++ /dev/null @@ -1,50 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { checkEmptyValue } from '.'; -import { getField } from '../fields/index.mock'; -import * as i18n from '../translations'; - -describe('check_empty_value', () => { - test('returns no errors if no field has been selected', () => { - const isValid = checkEmptyValue('', undefined, true, false); - - expect(isValid).toBeUndefined(); - }); - - test('returns error string if user has touched a required input and left empty', () => { - const isValid = checkEmptyValue(undefined, getField('@timestamp'), true, true); - - expect(isValid).toEqual(i18n.FIELD_REQUIRED_ERR); - }); - - test('returns no errors if required input is empty but user has not yet touched it', () => { - const isValid = checkEmptyValue(undefined, getField('@timestamp'), true, false); - - expect(isValid).toBeUndefined(); - }); - - test('returns no errors if user has touched an input that is not required and left empty', () => { - const isValid = checkEmptyValue(undefined, getField('@timestamp'), false, true); - - expect(isValid).toBeUndefined(); - }); - - test('returns no errors if user has touched an input that is not required and left empty string', () => { - const isValid = checkEmptyValue('', getField('@timestamp'), false, true); - - expect(isValid).toBeUndefined(); - }); - - test('returns null if input value is not empty string or undefined', () => { - const isValid = checkEmptyValue('hellooo', getField('@timestamp'), false, true); - - expect(isValid).toBeNull(); - }); -}); diff --git a/packages/kbn-securitysolution-autocomplete/src/check_empty_value/index.ts b/packages/kbn-securitysolution-autocomplete/src/check_empty_value/index.ts deleted file mode 100644 index 218b8fee94d1e..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/check_empty_value/index.ts +++ /dev/null @@ -1,35 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { DataViewFieldBase } from '@kbn/es-query'; -import * as i18n from '../translations'; - -/** - * Determines if empty value is ok - */ -export const checkEmptyValue = ( - param: string | undefined, - field: DataViewFieldBase | undefined, - isRequired: boolean, - touched: boolean -): string | undefined | null => { - if (isRequired && touched && (param == null || param.trim() === '')) { - return i18n.FIELD_REQUIRED_ERR; - } - - if ( - field == null || - (isRequired && !touched) || - (!isRequired && (param == null || param === '')) - ) { - return undefined; - } - - return null; -}; diff --git a/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/disabled_types_with_tooltip_text.test.ts b/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/disabled_types_with_tooltip_text.test.ts deleted file mode 100644 index 980819d1cedf1..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/disabled_types_with_tooltip_text.test.ts +++ /dev/null @@ -1,20 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { disabledTypesWithTooltipText } from '../disabled_types_with_tooltip_text'; - -jest.mock('../../translations', () => ({ - BINARY_TYPE_NOT_SUPPORTED: 'Binary fields are currently unsupported', -})); -describe('disabledTypesWithTooltipText', () => { - it('should return Binary fields are currently unsupported for binary type', () => { - const type = 'binary'; - expect(disabledTypesWithTooltipText[type]).toEqual('Binary fields are currently unsupported'); - }); -}); diff --git a/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/index.test.tsx b/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/index.test.tsx deleted file mode 100644 index 1b33b4b294644..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/index.test.tsx +++ /dev/null @@ -1,144 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { fireEvent, render, waitFor, within } from '@testing-library/react'; -import '@testing-library/jest-dom'; - -import { EsFieldSelector } from '..'; -import { fields, getField } from '../../fields/index.mock'; - -describe('FieldComponent', () => { - it('should render the component enabled and displays the selected field correctly', () => { - const wrapper = render( - <EsFieldSelector - isClearable={false} - isDisabled={false} - isLoading={false} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - onChange={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('machine.os.raw')} - /> - ); - expect(wrapper.container).toMatchSnapshot(); - const comboBox = wrapper.getByTestId('fieldAutocompleteComboBox'); - const input = within(comboBox).getByRole('combobox'); - expect(input).toHaveAttribute('value', 'machine.os.raw'); - }); - it('should render the component disabled if isDisabled is true', () => { - const wrapper = render( - <EsFieldSelector - isClearable={false} - isDisabled={true} - isLoading={false} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - onChange={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('machine.os.raw')} - /> - ); - expect(wrapper.container).toMatchSnapshot(); - expect(wrapper.getByTestId('fieldAutocompleteComboBox').querySelector('input')).toBeDisabled(); - }); - it('should render the loading spinner if isLoading is true when clicked', () => { - const wrapper = render( - <EsFieldSelector - isClearable={false} - isDisabled={true} - isLoading={true} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - onChange={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('machine.os.raw')} - /> - ); - const fieldAutocompleteComboBox = wrapper.getByTestId('fieldAutocompleteComboBox'); - expect(wrapper.container).toMatchSnapshot(); - fireEvent.click(fieldAutocompleteComboBox); - expect(wrapper.getByRole('progressbar')).toBeInTheDocument(); - }); - it('should allow user to clear values if isClearable is true', () => { - const wrapper = render( - <EsFieldSelector - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={true} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('machine.os.raw')} - /> - ); - expect(wrapper.container).toMatchSnapshot(); - expect(wrapper.getByTestId('comboBoxClearButton')).toBeInTheDocument(); - }); - it('should change the selected value', async () => { - const wrapper = render( - <EsFieldSelector - isClearable={false} - isDisabled={true} - isLoading={false} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - onChange={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('machine.os.raw')} - /> - ); - const fieldAutocompleteComboBox = wrapper.getByTestId('comboBoxSearchInput'); - fireEvent.change(fieldAutocompleteComboBox, { target: { value: '_source' } }); - expect(fieldAutocompleteComboBox).toHaveValue('_source'); - }); - - it('it allows custom user input if "acceptsCustomOptions" is "true"', async () => { - const mockOnChange = jest.fn(); - const wrapper = render( - <EsFieldSelector - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={mockOnChange} - placeholder="Placeholder text" - selectedField={undefined} - acceptsCustomOptions - /> - ); - - const fieldAutocompleteComboBox = wrapper.getByTestId('comboBoxSearchInput'); - fireEvent.change(fieldAutocompleteComboBox, { target: { value: 'custom' } }); - await waitFor(() => - expect(wrapper.getByTestId('fieldAutocompleteComboBox')).toHaveTextContent('custom') - ); - }); -}); diff --git a/packages/kbn-securitysolution-autocomplete/src/es_field_selector/disabled_types_with_tooltip_text.ts b/packages/kbn-securitysolution-autocomplete/src/es_field_selector/disabled_types_with_tooltip_text.ts deleted file mode 100644 index 422a909bb9910..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/es_field_selector/disabled_types_with_tooltip_text.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -interface DisabledTypesTextType { - [typeName: string]: string; -} -import * as i18n from '../translations'; - -export const disabledTypesWithTooltipText: DisabledTypesTextType = { - binary: i18n.BINARY_TYPE_NOT_SUPPORTED, -}; diff --git a/packages/kbn-securitysolution-autocomplete/src/es_field_selector/index.tsx b/packages/kbn-securitysolution-autocomplete/src/es_field_selector/index.tsx deleted file mode 100644 index 31efaa23b62df..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/es_field_selector/index.tsx +++ /dev/null @@ -1,109 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { EuiComboBox } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; - -import { FieldBaseProps } from './types'; -import { useEsField } from './use_es_field'; - -const AS_PLAIN_TEXT = { asPlainText: true }; - -interface EsFieldSelectorProps extends FieldBaseProps { - isClearable?: boolean; - isDisabled?: boolean; - isLoading?: boolean; - placeholder: string; - acceptsCustomOptions?: boolean; - showMappingConflicts?: boolean; - 'aria-label'?: string; -} - -export function EsFieldSelector({ - fieldInputWidth, - fieldTypeFilter = [], - indexPattern, - isClearable = false, - isDisabled = false, - isLoading = false, - isRequired = false, - onChange, - placeholder, - selectedField, - acceptsCustomOptions = false, - showMappingConflicts = false, - 'aria-label': ariaLabel, -}: EsFieldSelectorProps): JSX.Element { - const { - isInvalid, - comboOptions, - selectedComboOptions, - fieldWidth, - renderFields, - handleTouch, - handleValuesChange, - handleCreateCustomOption, - } = useEsField({ - indexPattern, - fieldTypeFilter, - isRequired, - selectedField, - fieldInputWidth, - showMappingConflicts, - onChange, - }); - - if (acceptsCustomOptions) { - return ( - <EuiComboBox - placeholder={placeholder} - options={comboOptions} - selectedOptions={selectedComboOptions} - onChange={handleValuesChange} - isLoading={isLoading} - isDisabled={isDisabled} - isClearable={isClearable} - isInvalid={isInvalid} - onFocus={handleTouch} - singleSelection={AS_PLAIN_TEXT} - data-test-subj="fieldAutocompleteComboBox" - style={fieldWidth} - onCreateOption={handleCreateCustomOption} - customOptionText={i18n.translate('autocomplete.customOptionText', { - defaultMessage: 'Add {searchValuePlaceholder} as a custom field', - values: { searchValuePlaceholder: '{searchValue}' }, - })} - fullWidth - renderOption={renderFields} - aria-label={ariaLabel} - /> - ); - } - - return ( - <EuiComboBox - placeholder={placeholder} - options={comboOptions} - selectedOptions={selectedComboOptions} - onChange={handleValuesChange} - isLoading={isLoading} - isDisabled={isDisabled} - isClearable={isClearable} - isInvalid={isInvalid} - onFocus={handleTouch} - singleSelection={AS_PLAIN_TEXT} - data-test-subj="fieldAutocompleteComboBox" - style={fieldWidth} - fullWidth - renderOption={renderFields} - aria-label={ariaLabel} - /> - ); -} diff --git a/packages/kbn-securitysolution-autocomplete/src/es_field_selector/types.ts b/packages/kbn-securitysolution-autocomplete/src/es_field_selector/types.ts deleted file mode 100644 index b0f1ab56e8079..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/es_field_selector/types.ts +++ /dev/null @@ -1,36 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { DataViewBase, DataViewFieldBase } from '@kbn/es-query'; -import { FieldConflictsInfo } from '@kbn/securitysolution-list-utils'; -import { GetGenericComboBoxPropsReturn } from '../get_generic_combo_box_props'; - -export interface FieldBaseProps { - indexPattern: DataViewBase | undefined; - fieldTypeFilter?: string[]; - isRequired?: boolean; - selectedField?: DataViewFieldBase | undefined; - fieldInputWidth?: number; - showMappingConflicts?: boolean; - onChange: (a: DataViewFieldBase[]) => void; -} - -export interface ComboBoxFields { - availableFields: DataViewField[]; - selectedFields: DataViewField[]; -} - -export interface GetFieldComboBoxPropsReturn extends GetGenericComboBoxPropsReturn { - disabledLabelTooltipTexts: { [label: string]: string }; - mappingConflictsTooltipInfo: { [label: string]: FieldConflictsInfo[] }; -} - -export interface DataViewField extends DataViewFieldBase { - esTypes?: string[]; -} diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_exists/index.test.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_exists/index.test.tsx deleted file mode 100644 index 801f8e2864d55..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_exists/index.test.tsx +++ /dev/null @@ -1,25 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { mount } from 'enzyme'; - -import { AutocompleteFieldExistsComponent } from '.'; - -describe('AutocompleteFieldExistsComponent', () => { - test('it renders field disabled', () => { - const wrapper = mount(<AutocompleteFieldExistsComponent placeholder="Placeholder text" />); - - expect( - wrapper - .find(`[data-test-subj="valuesAutocompleteComboBox existsComboxBox"] input`) - .prop('disabled') - ).toBeTruthy(); - }); -}); diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_exists/index.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_exists/index.tsx deleted file mode 100644 index 592886905aaec..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_exists/index.tsx +++ /dev/null @@ -1,40 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { EuiComboBox, EuiComboBoxOptionOption, EuiFormRow } from '@elastic/eui'; - -const NO_OPTIONS_FOR_EXIST: EuiComboBoxOptionOption[] = []; - -interface AutocompleteFieldExistsProps { - placeholder: string; - rowLabel?: string; - 'aria-label'?: string; -} - -export const AutocompleteFieldExistsComponent: React.FC<AutocompleteFieldExistsProps> = ({ - placeholder, - rowLabel, - 'aria-label': ariaLabel, -}): JSX.Element => ( - <EuiFormRow label={rowLabel} fullWidth> - <EuiComboBox - placeholder={placeholder} - options={NO_OPTIONS_FOR_EXIST} - selectedOptions={NO_OPTIONS_FOR_EXIST} - onChange={undefined} - isDisabled - data-test-subj="valuesAutocompleteComboBox existsComboxBox" - aria-label={ariaLabel} - fullWidth - /> - </EuiFormRow> -); - -AutocompleteFieldExistsComponent.displayName = 'AutocompleteFieldExists'; diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.test.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.test.tsx deleted file mode 100644 index b2d8dc0a70be9..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.test.tsx +++ /dev/null @@ -1,270 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { mount } from 'enzyme'; -import { EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui'; -import { waitFor } from '@testing-library/react'; -import type { ListSchema } from '@kbn/securitysolution-io-ts-list-types'; - -import { getField } from '../fields/index.mock'; -import { AutocompleteFieldListsComponent } from '.'; -import { - getListResponseMock, - getFoundListsBySizeSchemaMock, - DATE_NOW, - IMMUTABLE, - VERSION, -} from '../list_schema/index.mock'; - -// TODO: Once these mocks are available, use them instead of hand mocking, https://github.com/elastic/kibana/issues/100715 -// const mockKibanaHttpService = coreMock.createStart().http; -// import { coreMock } from '../../../../../../../src/core/public/mocks'; -const mockKibanaHttpService = jest.fn(); -const mockShowValueListModal = jest.fn(); -const MockedShowValueListModal = (props: unknown) => { - mockShowValueListModal(props); - return <></>; -}; -const mockStart = jest.fn(); -const mockKeywordList: ListSchema = { - ...getListResponseMock(), - id: 'keyword_list', - name: 'keyword list', - type: 'keyword', -}; -const mockResult = { ...getFoundListsBySizeSchemaMock() }; -mockResult.smallLists = [...mockResult.smallLists, mockKeywordList]; -mockResult.largeLists = []; -jest.mock('@kbn/securitysolution-list-hooks', () => { - const originalModule = jest.requireActual('@kbn/securitysolution-list-hooks'); - - return { - ...originalModule, - useFindListsBySize: () => ({ - error: undefined, - loading: false, - result: mockResult, - start: mockStart.mockReturnValue(mockResult), - }), - }; -}); - -describe('AutocompleteFieldListsComponent', () => { - test('it renders disabled if "isDisabled" is true', async () => { - const wrapper = mount( - <AutocompleteFieldListsComponent - httpService={mockKibanaHttpService} - isClearable={true} - isDisabled - isLoading={false} - onChange={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('ip')} - selectedValue="some-list-id" - showValueListModal={MockedShowValueListModal} - /> - ); - - expect( - wrapper - .find(`[data-test-subj="valuesAutocompleteComboBox listsComboxBox"] input`) - .prop('disabled') - ).toBeTruthy(); - }); - - test('it renders loading if "isLoading" is true', async () => { - const wrapper = mount( - <AutocompleteFieldListsComponent - httpService={mockKibanaHttpService} - isClearable={false} - isDisabled={false} - isLoading - onChange={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('@tags')} - selectedValue="" - showValueListModal={MockedShowValueListModal} - /> - ); - - wrapper - .find(`[data-test-subj="valuesAutocompleteComboBox listsComboxBox"] button`) - .at(0) - .simulate('click'); - expect( - wrapper - .find( - `EuiComboBoxOptionsList[data-test-subj="valuesAutocompleteComboBox listsComboxBox-optionsList"]` - ) - .prop('isLoading') - ).toBeTruthy(); - }); - - test('it allows user to clear values if "isClearable" is true', async () => { - const wrapper = mount( - <AutocompleteFieldListsComponent - httpService={mockKibanaHttpService} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('ip')} - selectedValue="" - showValueListModal={MockedShowValueListModal} - /> - ); - expect( - wrapper - .find('EuiComboBox[data-test-subj="valuesAutocompleteComboBox listsComboxBox"]') - .prop('options') - ).toEqual([{ label: 'some name', disabled: false }]); - }); - - test('it correctly displays lists that match the selected "keyword" field esType', () => { - const wrapper = mount( - <AutocompleteFieldListsComponent - httpService={mockKibanaHttpService} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('@tags')} - selectedValue="" - showValueListModal={MockedShowValueListModal} - /> - ); - - wrapper.find('[data-test-subj="comboBoxToggleListButton"] button').simulate('click'); - - expect( - wrapper - .find('EuiComboBox[data-test-subj="valuesAutocompleteComboBox listsComboxBox"]') - .prop('options') - ).toEqual([{ label: 'keyword list', disabled: false }]); - }); - - test('it correctly displays lists that match the selected "ip" field esType', () => { - const wrapper = mount( - <AutocompleteFieldListsComponent - httpService={mockKibanaHttpService} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('ip')} - selectedValue="" - showValueListModal={MockedShowValueListModal} - /> - ); - - wrapper.find('[data-test-subj="comboBoxToggleListButton"] button').simulate('click'); - - expect( - wrapper - .find('EuiComboBox[data-test-subj="valuesAutocompleteComboBox listsComboxBox"]') - .prop('options') - ).toEqual([{ label: 'some name', disabled: false }]); - }); - - test('it correctly displays selected list', async () => { - const wrapper = mount( - <AutocompleteFieldListsComponent - httpService={mockKibanaHttpService} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('ip')} - selectedValue="some-list-id" - showValueListModal={MockedShowValueListModal} - /> - ); - - expect( - wrapper - .find(`[data-test-subj="valuesAutocompleteComboBox listsComboxBox"] input`) - .at(0) - .props().value - ).toEqual('some name'); - }); - - test('it invokes "onChange" when option selected', async () => { - const mockOnChange = jest.fn(); - const wrapper = mount( - <AutocompleteFieldListsComponent - httpService={mockKibanaHttpService} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={mockOnChange} - placeholder="Placeholder text" - selectedField={getField('ip')} - selectedValue="" - showValueListModal={MockedShowValueListModal} - /> - ); - - ( - wrapper.find(EuiComboBox).props() as unknown as { - onChange: (a: EuiComboBoxOptionOption[]) => void; - } - ).onChange([{ label: 'some name', disabled: false }]); - - await waitFor(() => { - expect(mockOnChange).toHaveBeenCalledWith({ - '@timestamp': DATE_NOW, - _version: undefined, - created_at: DATE_NOW, - created_by: 'some user', - description: 'some description', - deserializer: undefined, - id: 'some-list-id', - immutable: IMMUTABLE, - meta: {}, - name: 'some name', - serializer: undefined, - tie_breaker_id: '6a76b69d-80df-4ab2-8c3e-85f466b06a0e', - type: 'ip', - updated_at: DATE_NOW, - updated_by: 'some user', - version: VERSION, - }); - }); - }); - - test('it render the value list modal', async () => { - mockShowValueListModal.mockReset(); - mount( - <AutocompleteFieldListsComponent - httpService={mockKibanaHttpService} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('ip')} - selectedValue="some-list-id" - showValueListModal={MockedShowValueListModal} - /> - ); - - expect(mockShowValueListModal).toHaveBeenCalledWith( - expect.objectContaining({ - children: 'Show value list', - listId: 'some-list-id', - shouldShowContentIfModalNotAvailable: false, - }) - ); - }); -}); diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.tsx deleted file mode 100644 index c332dde356f29..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.tsx +++ /dev/null @@ -1,183 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { ElementType, useCallback, useEffect, useMemo, useState } from 'react'; -import { EuiComboBox, EuiComboBoxOptionOption, EuiFormRow, EuiLink, EuiText } from '@elastic/eui'; -import type { ListSchema } from '@kbn/securitysolution-io-ts-list-types'; -import { useFindListsBySize } from '@kbn/securitysolution-list-hooks'; -import { DataViewFieldBase } from '@kbn/es-query'; -import { getDocLinks } from '@kbn/doc-links'; - -import { filterFieldToList } from '../filter_field_to_list'; -import { getGenericComboBoxProps } from '../get_generic_combo_box_props'; - -// TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715 -// import { HttpStart } from '@kbn/core/public'; -type HttpStart = any; - -import * as i18n from '../translations'; - -const SINGLE_SELECTION = { asPlainText: true }; - -interface AutocompleteFieldListsProps { - httpService: HttpStart; - isClearable: boolean; - isDisabled: boolean; - isLoading: boolean; - onChange: (arg: ListSchema) => void; - placeholder: string; - rowLabel?: string; - selectedField: DataViewFieldBase | undefined; - selectedValue: string | undefined; - allowLargeValueLists?: boolean; - 'aria-label'?: string; - showValueListModal: ElementType; -} - -export interface AutocompleteListsData { - smallLists: ListSchema[]; - largeLists: ListSchema[]; -} - -export const AutocompleteFieldListsComponent: React.FC<AutocompleteFieldListsProps> = ({ - httpService, - isClearable = false, - isDisabled = false, - isLoading = false, - onChange, - placeholder, - rowLabel, - selectedField, - selectedValue, - allowLargeValueLists = false, - 'aria-label': ariaLabel, - showValueListModal, -}): JSX.Element => { - const [error, setError] = useState<string | undefined>(undefined); - const [listData, setListData] = useState<AutocompleteListsData>({ - smallLists: [], - largeLists: [], - }); - const { loading, result, start } = useFindListsBySize(); - const getLabel = useCallback(({ name }: ListSchema) => name, []); - - const optionsMemo = useMemo( - () => filterFieldToList(listData, selectedField), - [listData, selectedField] - ); - const selectedOptionsMemo = useMemo(() => { - if (selectedValue != null) { - const combinedLists = [...listData.smallLists, ...listData.largeLists]; - const list = combinedLists.filter(({ id }) => id === selectedValue); - return list ?? []; - } else { - return []; - } - }, [selectedValue, listData]); - const { comboOptions, labels, selectedComboOptions } = useMemo( - () => - getGenericComboBoxProps<ListSchema>({ - getLabel, - options: [...optionsMemo.smallLists, ...optionsMemo.largeLists], - selectedOptions: selectedOptionsMemo, - disabledOptions: allowLargeValueLists ? undefined : optionsMemo.largeLists, // Disable large lists if the rule type doesn't allow it - }), - [optionsMemo, selectedOptionsMemo, getLabel, allowLargeValueLists] - ); - - const handleValuesChange = useCallback( - (newOptions: EuiComboBoxOptionOption[]) => { - const combinedLists = [...optionsMemo.smallLists, ...optionsMemo.largeLists]; - const [newValue] = newOptions.map(({ label }) => combinedLists[labels.indexOf(label)]); - onChange(newValue ?? ''); - }, - [labels, optionsMemo, onChange] - ); - - const setIsTouchedValue = useCallback((): void => { - setError(selectedValue == null ? i18n.FIELD_REQUIRED_ERR : undefined); - }, [selectedValue]); - - useEffect(() => { - if (result != null) { - setListData(result); - } - }, [result]); - - useEffect(() => { - if (selectedField != null && httpService != null) { - start({ - http: httpService, - pageIndex: 1, - pageSize: 500, - }); - } - }, [selectedField, start, httpService]); - - const isLoadingState = useMemo((): boolean => isLoading || loading, [isLoading, loading]); - const ShowValueListModal = showValueListModal; - - const helpText = useMemo(() => { - return ( - <> - {selectedValue && ( - <ShowValueListModal shouldShowContentIfModalNotAvailable={false} listId={selectedValue}> - {i18n.SHOW_VALUE_LIST_MODAL} - </ShowValueListModal> - )} - {!allowLargeValueLists && ( - <EuiText size="xs"> - {i18n.LISTS_TOOLTIP_INFO}{' '} - <EuiLink - external - target="_blank" - href={ - getDocLinks({ - kibanaBranch: 'main', - buildFlavor: 'traditional', - }).securitySolution.exceptions.value_lists - } - > - {i18n.SEE_DOCUMENTATION} - </EuiLink> - </EuiText> - )} - </> - ); - }, [allowLargeValueLists, selectedValue, ShowValueListModal]); - return ( - <EuiFormRow - label={rowLabel} - error={error} - isInvalid={error != null} - helpText={helpText} - fullWidth - > - <EuiComboBox - async - data-test-subj="valuesAutocompleteComboBox listsComboxBox" - fullWidth - isClearable={isClearable} - isDisabled={isDisabled} - isInvalid={error != null} - isLoading={isLoadingState} - onBlur={setIsTouchedValue} - onChange={handleValuesChange} - options={comboOptions} - placeholder={placeholder} - selectedOptions={selectedComboOptions} - singleSelection={SINGLE_SELECTION} - sortMatchesBy="startsWith" - aria-label={ariaLabel} - /> - </EuiFormRow> - ); -}; - -AutocompleteFieldListsComponent.displayName = 'AutocompleteFieldList'; diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.test.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.test.tsx deleted file mode 100644 index e83d79b180e90..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.test.tsx +++ /dev/null @@ -1,631 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { ReactWrapper, mount } from 'enzyme'; -import { - EuiComboBox, - EuiComboBoxOptionOption, - EuiFormHelpText, - EuiSuperSelect, -} from '@elastic/eui'; -import { act, waitFor } from '@testing-library/react'; -import { AutocompleteFieldMatchComponent } from '.'; -import { useFieldValueAutocomplete } from '../hooks/use_field_value_autocomplete'; -import { fields, getField } from '../fields/index.mock'; -import { autocompleteStartMock } from '../autocomplete/index.mock'; - -jest.mock('../hooks/use_field_value_autocomplete'); -jest.mock('../translations', () => ({ - FIELD_SPACE_WARNING: 'Warning: there is a space', -})); -describe('AutocompleteFieldMatchComponent', () => { - let wrapper: ReactWrapper; - - const getValueSuggestionsMock = jest - .fn() - .mockResolvedValue([false, true, ['value 3', 'value 4'], jest.fn()]); - - const findEuiComboBox = () => - wrapper.find(EuiComboBox).props() as unknown as { - onChange: (a: EuiComboBoxOptionOption[]) => void; - onSearchChange: (a: string) => void; - onCreateOption: (a: string) => void; - }; - - beforeEach(() => { - (useFieldValueAutocomplete as jest.Mock).mockReturnValue([ - false, - true, - ['value 1', 'value 2'], - getValueSuggestionsMock, - ]); - }); - - afterEach(() => { - jest.clearAllMocks(); - wrapper.unmount(); - }); - - test('it renders row label if one passed in', () => { - wrapper = mount( - <AutocompleteFieldMatchComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled - isLoading={false} - onChange={jest.fn()} - placeholder="Placeholder text" - rowLabel={'Row Label'} - selectedField={getField('ip')} - selectedValue="127.0.0.1" - /> - ); - - expect( - wrapper.find('[data-test-subj="valuesAutocompleteMatchLabel"] label').at(0).text() - ).toEqual('Row Label'); - }); - - test('it renders disabled if "isDisabled" is true', () => { - wrapper = mount( - <AutocompleteFieldMatchComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('ip')} - selectedValue="127.0.0.1" - /> - ); - - expect( - wrapper.find('[data-test-subj="valuesAutocompleteMatch"] input').prop('disabled') - ).toBeTruthy(); - }); - - test('it renders loading if "isLoading" is true', () => { - wrapper = mount( - <AutocompleteFieldMatchComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading - onChange={jest.fn()} - onError={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('ip')} - selectedValue="127.0.0.1" - /> - ); - wrapper.find('[data-test-subj="valuesAutocompleteMatch"] button').at(0).simulate('click'); - expect( - wrapper - .find('EuiComboBoxOptionsList[data-test-subj="valuesAutocompleteMatch-optionsList"]') - .prop('isLoading') - ).toBeTruthy(); - }); - - test('it allows user to clear values if "isClearable" is true', () => { - wrapper = mount( - <AutocompleteFieldMatchComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={true} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('ip')} - selectedValue="127.0.0.1" - /> - ); - - expect(wrapper.find(`[data-test-subj="comboBoxClearButton"]`)).toBeTruthy(); - }); - - test('it correctly displays selected value', () => { - wrapper = mount( - <AutocompleteFieldMatchComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('ip')} - selectedValue="127.0.0.1" - /> - ); - - expect( - wrapper.find('[data-test-subj="valuesAutocompleteMatch"] input').at(0).props().value - ).toEqual('127.0.0.1'); - }); - - test('it invokes "onChange" when new value created', () => { - const mockOnChange = jest.fn(); - wrapper = mount( - <AutocompleteFieldMatchComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={mockOnChange} - onError={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('ip')} - selectedValue="" - /> - ); - - findEuiComboBox().onCreateOption('127.0.0.1'); - - expect(mockOnChange).toHaveBeenCalledWith('127.0.0.1'); - }); - - test('it invokes "onChange" when new value selected', () => { - const mockOnChange = jest.fn(); - wrapper = mount( - <AutocompleteFieldMatchComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={mockOnChange} - onError={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('machine.os.raw')} - selectedValue="" - /> - ); - - findEuiComboBox().onChange([{ label: 'value 1' }]); - - expect(mockOnChange).toHaveBeenCalledWith('value 1'); - }); - - test('it invokes "onChange" with empty value (i.e. clears selection) when new value searched', () => { - const mockOnChange = jest.fn(); - wrapper = mount( - <AutocompleteFieldMatchComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={mockOnChange} - onError={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('machine.os.raw')} - selectedValue="value 1" - /> - ); - - act(() => { - findEuiComboBox().onSearchChange('value 12'); - }); - - expect(mockOnChange).toHaveBeenCalledWith(''); - }); - - test('should show the warning helper text if the new value contains spaces when change', async () => { - (useFieldValueAutocomplete as jest.Mock).mockReturnValue([ - false, - true, - [' value 1 ', 'value 2'], - getValueSuggestionsMock, - ]); - const mockOnChange = jest.fn(); - wrapper = mount( - <AutocompleteFieldMatchComponent - autocompleteService={autocompleteStartMock} - rowLabel="Test" - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={mockOnChange} - onError={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('machine.os.raw')} - selectedValue="" - /> - ); - - await waitFor(() => findEuiComboBox().onChange([{ label: ' value 1 ' }])); - wrapper.update(); - expect(mockOnChange).toHaveBeenCalledWith(' value 1 '); - - const euiFormHelptext = wrapper.find(EuiFormHelpText); - expect(euiFormHelptext.length).toBeTruthy(); - }); - - test('it refreshes autocomplete with search query when new value searched', () => { - wrapper = mount( - <AutocompleteFieldMatchComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('machine.os.raw')} - selectedValue="" - /> - ); - act(() => { - findEuiComboBox().onSearchChange('value 1'); - }); - - expect(useFieldValueAutocomplete).toHaveBeenCalledWith({ - autocompleteService: autocompleteStartMock, - fieldValue: '', - indexPattern: { - fields, - id: '1234', - title: 'logstash-*', - }, - operatorType: 'match', - query: 'value 1', - selectedField: getField('machine.os.raw'), - }); - }); - - test('it refreshes autocomplete with search query when input field is cleared', () => { - wrapper = mount( - <AutocompleteFieldMatchComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('machine.os.raw')} - selectedValue="windows" - /> - ); - - act(() => { - findEuiComboBox().onSearchChange('value 1'); - }); - act(() => { - findEuiComboBox().onSearchChange(''); - }); - - // 1st call is initial render, 2nd call sets the search query: - expect(useFieldValueAutocomplete).toHaveBeenNthCalledWith(2, { - autocompleteService: autocompleteStartMock, - fieldValue: 'windows', - indexPattern: { fields, id: '1234', title: 'logstash-*' }, - operatorType: 'match', - query: 'value 1', - selectedField: getField('machine.os.raw'), - }); - // last call is the refresh when input field is cleared - expect(useFieldValueAutocomplete).toHaveBeenLastCalledWith({ - autocompleteService: autocompleteStartMock, - fieldValue: 'windows', - indexPattern: { fields, id: '1234', title: 'logstash-*' }, - operatorType: 'match', - query: '', - selectedField: getField('machine.os.raw'), - }); - }); - - test('should show the warning helper text if the new value contains spaces when searching a new query', () => { - wrapper = mount( - <AutocompleteFieldMatchComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('machine.os.raw')} - selectedValue="" - /> - ); - act(() => { - findEuiComboBox().onSearchChange(' value 1'); - }); - - wrapper.update(); - const euiFormHelptext = wrapper.find(EuiFormHelpText); - expect(euiFormHelptext.length).toBeTruthy(); - expect(euiFormHelptext.text()).toEqual('Warning: there is a space'); - }); - - test('should show the warning helper text if selectedValue contains spaces when editing', () => { - wrapper = mount( - <AutocompleteFieldMatchComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('machine.os.raw')} - selectedValue=" leading and trailing space " - /> - ); - const euiFormHelptext = wrapper.find(EuiFormHelpText); - expect(euiFormHelptext.length).toBeTruthy(); - expect(euiFormHelptext.text()).toEqual('Warning: there is a space'); - }); - - test('should not show the warning helper text if selectedValue is falsy', () => { - wrapper = mount( - <AutocompleteFieldMatchComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('machine.os.raw')} - selectedValue="" - /> - ); - const euiFormHelptext = wrapper.find(EuiFormHelpText); - expect(euiFormHelptext.length).toBeFalsy(); - }); - - describe('boolean type', () => { - const valueSuggestionsMock = jest.fn().mockResolvedValue([false, false, [], jest.fn()]); - - beforeEach(() => { - (useFieldValueAutocomplete as jest.Mock).mockReturnValue([ - false, - false, - [], - valueSuggestionsMock, - ]); - }); - - test('it displays only two options - "true" or "false"', () => { - wrapper = mount( - <AutocompleteFieldMatchComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('ssl')} - selectedValue="" - /> - ); - expect( - wrapper.find('[data-test-subj="valuesAutocompleteMatchBoolean"]').exists() - ).toBeTruthy(); - expect( - wrapper.find('[data-test-subj="valuesAutocompleteMatchBoolean"]').at(0).prop('options') - ).toEqual([ - { - inputDisplay: 'true', - value: 'true', - }, - { - inputDisplay: 'false', - value: 'false', - }, - ]); - }); - - test('it invokes "onChange" with "true" when selected', () => { - const mockOnChange = jest.fn(); - wrapper = mount( - <AutocompleteFieldMatchComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={mockOnChange} - onError={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('ssl')} - selectedValue="" - /> - ); - - ( - wrapper.find(EuiSuperSelect).props() as unknown as { - onChange: (a: string) => void; - } - ).onChange('true'); - - expect(mockOnChange).toHaveBeenCalledWith('true'); - }); - - test('it invokes "onChange" with "false" when selected', () => { - const mockOnChange = jest.fn(); - wrapper = mount( - <AutocompleteFieldMatchComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={mockOnChange} - onError={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('ssl')} - selectedValue="" - /> - ); - - ( - wrapper.find(EuiSuperSelect).props() as unknown as { - onChange: (a: string) => void; - } - ).onChange('false'); - - expect(mockOnChange).toHaveBeenCalledWith('false'); - }); - }); - - describe('number type', () => { - const valueSuggestionsMock = jest.fn().mockResolvedValue([false, false, [], jest.fn()]); - - beforeEach(() => { - (useFieldValueAutocomplete as jest.Mock).mockReturnValue([ - false, - false, - [], - valueSuggestionsMock, - ]); - }); - - test('it number input when field type is number', () => { - wrapper = mount( - <AutocompleteFieldMatchComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('bytes')} - selectedValue="" - /> - ); - - expect( - wrapper.find('[data-test-subj="valueAutocompleteFieldMatchNumber"]').exists() - ).toBeTruthy(); - }); - - test('it invokes "onChange" with numeric value when inputted', () => { - const mockOnChange = jest.fn(); - wrapper = mount( - <AutocompleteFieldMatchComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={mockOnChange} - onError={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('bytes')} - selectedValue="" - /> - ); - wrapper - .find('[data-test-subj="valueAutocompleteFieldMatchNumber"] input') - .at(0) - .simulate('change', { target: { value: '8' } }); - - expect(mockOnChange).toHaveBeenCalledWith('8'); - }); - }); -}); diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.tsx deleted file mode 100644 index 5b627451db191..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.tsx +++ /dev/null @@ -1,377 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { useCallback, useMemo, useState, useEffect } from 'react'; -import { - EuiSuperSelect, - EuiFormRow, - EuiFieldNumber, - EuiComboBoxOptionOption, - EuiComboBox, -} from '@elastic/eui'; -import { DataViewBase, DataViewFieldBase } from '@kbn/es-query'; - -import { uniq } from 'lodash'; - -import { ListOperatorTypeEnum as OperatorTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; - -// TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715 -// import { AutocompleteStart } from '../../../../../../../src/plugins/unified_search/public'; -type AutocompleteStart = any; - -import * as i18n from '../translations'; -import { useFieldValueAutocomplete } from '../hooks/use_field_value_autocomplete'; -import { - getGenericComboBoxProps, - GetGenericComboBoxPropsReturn, -} from '../get_generic_combo_box_props'; -import { paramIsValid } from '../param_is_valid'; -import { paramContainsSpace } from '../param_contains_space'; - -const BOOLEAN_OPTIONS = [ - { inputDisplay: 'true', value: 'true' }, - { inputDisplay: 'false', value: 'false' }, -]; - -const SINGLE_SELECTION = { asPlainText: true }; - -type Warning = string | React.ReactNode; - -interface AutocompleteFieldMatchProps { - placeholder: string; - selectedField: DataViewFieldBase | undefined; - selectedValue: string | undefined; - indexPattern: DataViewBase | undefined; - isLoading?: boolean; - isDisabled?: boolean; - isClearable?: boolean; - isRequired?: boolean; - fieldInputWidth?: number; - rowLabel?: string; - autocompleteService: AutocompleteStart; - onChange: (arg: string) => void; - onError?: (arg: boolean) => void; - onWarning?: (arg: boolean) => void; - warning?: Warning; - 'aria-label'?: string; -} - -export const AutocompleteFieldMatchComponent: React.FC<AutocompleteFieldMatchProps> = ({ - placeholder, - rowLabel, - selectedField, - selectedValue, - indexPattern, - isLoading = false, - isDisabled = false, - isClearable = false, - isRequired = false, - fieldInputWidth, - autocompleteService, - onChange, - onError, - onWarning, - warning, - 'aria-label': ariaLabel, -}): JSX.Element => { - const [searchQuery, setSearchQuery] = useState(''); - const [touched, setIsTouched] = useState(false); - const [error, setError] = useState<string | undefined>(undefined); - const [showSpacesWarning, setShowSpacesWarning] = useState<boolean>(false); - const [isLoadingSuggestions, isSuggestingValues, suggestions] = useFieldValueAutocomplete({ - autocompleteService, - fieldValue: selectedValue, - indexPattern, - operatorType: OperatorTypeEnum.MATCH, - query: searchQuery, - selectedField, - }); - const getLabel = useCallback((option: string): string => option, []); - - const optionsMemo = useMemo((): string[] => { - const valueAsStr = String(selectedValue); - return selectedValue != null && selectedValue.trim() !== '' - ? uniq([valueAsStr, ...suggestions]) - : suggestions; - }, [suggestions, selectedValue]); - - const selectedOptionsMemo = useMemo((): string[] => { - const valueAsStr = String(selectedValue); - return selectedValue ? [valueAsStr] : []; - }, [selectedValue]); - - const handleSpacesWarning = useCallback( - (param: string | undefined) => { - if (!param) return setShowSpacesWarning(false); - setShowSpacesWarning(!!paramContainsSpace(param)); - }, - [setShowSpacesWarning] - ); - - const handleError = useCallback( - (err: string | undefined): void => { - setError((existingErr): string | undefined => { - const oldErr = existingErr != null; - const newErr = err != null; - if (oldErr !== newErr && onError != null) { - onError(newErr); - } - - return err; - }); - }, - [setError, onError] - ); - - const handleWarning = useCallback( - (warn: Warning | undefined): void => { - if (onWarning) { - onWarning(warn !== undefined); - } - }, - [onWarning] - ); - - const { comboOptions, labels, selectedComboOptions } = useMemo( - (): GetGenericComboBoxPropsReturn => - getGenericComboBoxProps<string>({ - getLabel, - options: optionsMemo, - selectedOptions: selectedOptionsMemo, - }), - [optionsMemo, selectedOptionsMemo, getLabel] - ); - - const handleValuesChange = useCallback( - (newOptions: EuiComboBoxOptionOption[]): void => { - const [newValue] = newOptions.map(({ label }) => optionsMemo[labels.indexOf(label)]); - - handleSpacesWarning(newValue); - handleError(undefined); - handleWarning(undefined); - onChange(newValue ?? ''); - }, - [handleError, handleWarning, handleSpacesWarning, labels, onChange, optionsMemo] - ); - - const handleSearchChange = useCallback( - (searchVal: string): void => { - if (searchVal !== '' && selectedField != null) { - const err = paramIsValid(searchVal, selectedField, isRequired, touched); - handleError(err); - handleWarning(warning); - - if (!err) handleSpacesWarning(searchVal); - } - - if (searchVal) { - // Clear selected option when user types to allow user to modify value without {backspace} - onChange(''); - } - - // Update search query unconditionally to show correct suggestions even when input is cleared - setSearchQuery(searchVal); - }, - [ - selectedField, - onChange, - isRequired, - touched, - handleError, - handleWarning, - warning, - handleSpacesWarning, - ] - ); - - const handleCreateOption = useCallback( - (option: string): boolean | undefined => { - const err = paramIsValid(option, selectedField, isRequired, touched); - handleError(err); - handleWarning(warning); - - if (err != null) { - // Explicitly reject the user's input - setShowSpacesWarning(false); - return false; - } - - handleSpacesWarning(option); - onChange(option); - return undefined; - }, - [ - isRequired, - onChange, - selectedField, - touched, - handleError, - handleSpacesWarning, - handleWarning, - warning, - ] - ); - - const handleNonComboBoxInputChange = useCallback( - (event: React.ChangeEvent<HTMLInputElement>): void => { - const newValue = event.target.value; - onChange(newValue); - }, - [onChange] - ); - - const handleBooleanInputChange = useCallback( - (newOption: string): void => { - onChange(newOption); - }, - [onChange] - ); - - const setIsTouchedValue = useCallback((): void => { - setIsTouched(true); - - const err = paramIsValid(selectedValue, selectedField, isRequired, true); - handleError(err); - handleWarning(warning); - }, [setIsTouched, handleError, selectedValue, selectedField, isRequired, warning, handleWarning]); - - const inputPlaceholder = useMemo((): string => { - if (isLoading || isLoadingSuggestions) { - return i18n.LOADING; - } else if (selectedField == null) { - return i18n.SELECT_FIELD_FIRST; - } else { - return placeholder; - } - }, [isLoading, selectedField, isLoadingSuggestions, placeholder]); - - const isLoadingState = useMemo( - (): boolean => isLoading || isLoadingSuggestions, - [isLoading, isLoadingSuggestions] - ); - - useEffect((): void => { - setError(undefined); - if (onError != null) onError(false); - - handleSpacesWarning(selectedValue); - // Looks like selectedField return new object every time when we for example add "and" entry - // that's why we need to check for name and type here - // Probably we should use some kind of memoization on parent components for entries - }, [selectedField?.name, selectedField?.type, selectedValue, handleSpacesWarning, onError]); - - const defaultInput = useMemo((): JSX.Element => { - return ( - <EuiFormRow - label={rowLabel} - error={error} - isInvalid={selectedField != null && error != null} - data-test-subj="valuesAutocompleteMatchLabel" - fullWidth - helpText={warning || (showSpacesWarning && i18n.FIELD_SPACE_WARNING)} - > - <EuiComboBox - placeholder={inputPlaceholder} - isDisabled={isDisabled || !selectedField} - isLoading={isLoadingState} - isClearable={isClearable} - options={comboOptions} - selectedOptions={selectedComboOptions} - onChange={handleValuesChange} - singleSelection={SINGLE_SELECTION} - onSearchChange={handleSearchChange} - onCreateOption={handleCreateOption} - isInvalid={selectedField != null && error != null} - onBlur={setIsTouchedValue} - sortMatchesBy="startsWith" - data-test-subj="valuesAutocompleteMatch" - style={fieldInputWidth ? { width: `${fieldInputWidth}px` } : {}} - aria-label={ariaLabel} - fullWidth - async - /> - </EuiFormRow> - ); - }, [ - rowLabel, - error, - selectedField, - showSpacesWarning, - inputPlaceholder, - isDisabled, - isLoadingState, - isClearable, - comboOptions, - selectedComboOptions, - handleValuesChange, - handleSearchChange, - handleCreateOption, - setIsTouchedValue, - warning, - fieldInputWidth, - ariaLabel, - ]); - - if (!isSuggestingValues && selectedField != null) { - switch (selectedField.type) { - case 'number': - return ( - <EuiFormRow - label={rowLabel} - error={error} - isInvalid={selectedField != null && error != null} - data-test-subj="valuesAutocompleteMatchLabel" - fullWidth - > - <EuiFieldNumber - placeholder={inputPlaceholder} - onBlur={setIsTouchedValue} - value={ - typeof selectedValue === 'string' && selectedValue.trim().length > 0 - ? parseFloat(selectedValue) - : selectedValue ?? '' - } - onChange={handleNonComboBoxInputChange} - data-test-subj="valueAutocompleteFieldMatchNumber" - style={fieldInputWidth ? { width: `${fieldInputWidth}px` } : {}} - aria-label={ariaLabel} - fullWidth - /> - </EuiFormRow> - ); - case 'boolean': - return ( - <EuiFormRow - label={rowLabel} - error={error} - isInvalid={selectedField != null && error != null} - data-test-subj="valuesAutocompleteMatchLabel" - fullWidth - > - <EuiSuperSelect - isLoading={isLoadingState} - options={BOOLEAN_OPTIONS} - valueOfSelected={selectedValue ?? 'true'} - onChange={handleBooleanInputChange} - data-test-subj="valuesAutocompleteMatchBoolean" - style={fieldInputWidth ? { width: `${fieldInputWidth}px` } : {}} - aria-label={ariaLabel} - fullWidth - /> - </EuiFormRow> - ); - default: - return defaultInput; - } - } else { - return defaultInput; - } -}; - -AutocompleteFieldMatchComponent.displayName = 'AutocompleteFieldMatch'; diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_match_any/index.test.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_match_any/index.test.tsx deleted file mode 100644 index 0b73a57814aaf..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_match_any/index.test.tsx +++ /dev/null @@ -1,400 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { ReactWrapper, mount } from 'enzyme'; -import { EuiComboBox, EuiComboBoxOptionOption, EuiFormHelpText } from '@elastic/eui'; -import { act, waitFor } from '@testing-library/react'; - -import { AutocompleteFieldMatchAnyComponent } from '.'; -import { getField, fields } from '../fields/index.mock'; -import { useFieldValueAutocomplete } from '../hooks/use_field_value_autocomplete'; -import { autocompleteStartMock } from '../autocomplete/index.mock'; - -jest.mock('../hooks/use_field_value_autocomplete', () => { - const actual = jest.requireActual('../hooks/use_field_value_autocomplete'); - return { - ...actual, - useFieldValueAutocomplete: jest.fn(), - }; -}); -jest.mock('../translations', () => ({ - FIELD_SPACE_WARNING: 'Warning: there is a space', -})); - -describe('AutocompleteFieldMatchAnyComponent', () => { - let wrapper: ReactWrapper; - const getValueSuggestionsMock = jest - .fn() - .mockResolvedValue([false, true, ['value 3', 'value 4'], jest.fn()]); - - beforeEach(() => { - (useFieldValueAutocomplete as jest.Mock).mockReturnValue([ - false, - true, - ['value 1', 'value 2'], - getValueSuggestionsMock, - ]); - }); - - afterEach(() => { - jest.clearAllMocks(); - wrapper.unmount(); - }); - - test('it renders disabled if "isDisabled" is true', () => { - wrapper = mount( - <AutocompleteFieldMatchAnyComponent - autocompleteService={{ - ...autocompleteStartMock, - getValueSuggestions: getValueSuggestionsMock, - }} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={true} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - placeholder="Placeholder text" - rowLabel={'Row Label'} - selectedField={getField('ip')} - selectedValue={['127.0.0.1']} - /> - ); - - expect( - wrapper.find(`[data-test-subj="valuesAutocompleteMatchAny"] input`).prop('disabled') - ).toBeTruthy(); - }); - - test('it renders loading if "isLoading" is true', () => { - wrapper = mount( - <AutocompleteFieldMatchAnyComponent - autocompleteService={{ - ...autocompleteStartMock, - getValueSuggestions: getValueSuggestionsMock, - }} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={true} - onChange={jest.fn()} - onError={jest.fn()} - placeholder="Placeholder text" - rowLabel={'Row Label'} - selectedField={getField('ip')} - selectedValue={[]} - /> - ); - wrapper.find(`[data-test-subj="valuesAutocompleteMatchAny"] button`).at(0).simulate('click'); - expect( - wrapper - .find(`EuiComboBoxOptionsList[data-test-subj="valuesAutocompleteMatchAny-optionsList"]`) - .prop('isLoading') - ).toBeTruthy(); - }); - - test('it allows user to clear values if "isClearable" is true', () => { - wrapper = mount( - <AutocompleteFieldMatchAnyComponent - autocompleteService={{ - ...autocompleteStartMock, - getValueSuggestions: getValueSuggestionsMock, - }} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={true} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - placeholder="Placeholder text" - rowLabel={'Row Label'} - selectedField={getField('ip')} - selectedValue={['127.0.0.1']} - /> - ); - - expect(wrapper.find(`[data-test-subj="comboBoxClearButton"]`)).toBeTruthy(); - }); - - test('it correctly displays selected value', () => { - wrapper = mount( - <AutocompleteFieldMatchAnyComponent - autocompleteService={{ - ...autocompleteStartMock, - getValueSuggestions: getValueSuggestionsMock, - }} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - placeholder="Placeholder text" - rowLabel={'Row Label'} - selectedField={getField('ip')} - selectedValue={['127.0.0.1']} - /> - ); - - expect( - wrapper.find(`[data-test-subj="valuesAutocompleteMatchAny"] EuiComboBoxPill`).at(0).text() - ).toEqual('127.0.0.1'); - }); - - test('it invokes "onChange" when new value created', async () => { - const mockOnChange = jest.fn(); - wrapper = mount( - <AutocompleteFieldMatchAnyComponent - autocompleteService={{ - ...autocompleteStartMock, - getValueSuggestions: getValueSuggestionsMock, - }} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={mockOnChange} - onError={jest.fn()} - placeholder="Placeholder text" - rowLabel={'Row Label'} - selectedField={getField('ip')} - selectedValue={[]} - /> - ); - - ( - wrapper.find(EuiComboBox).props() as unknown as { - onCreateOption: (a: string) => void; - } - ).onCreateOption('127.0.0.1'); - - expect(mockOnChange).toHaveBeenCalledWith(['127.0.0.1']); - }); - - test('it invokes "onChange" when new value selected', async () => { - const mockOnChange = jest.fn(); - wrapper = mount( - <AutocompleteFieldMatchAnyComponent - autocompleteService={{ - ...autocompleteStartMock, - getValueSuggestions: getValueSuggestionsMock, - }} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isLoading={false} - isClearable={false} - isDisabled={false} - onChange={mockOnChange} - onError={jest.fn()} - placeholder="Placeholder text" - rowLabel={'Row Label'} - selectedField={getField('machine.os.raw')} - selectedValue={[]} - /> - ); - - ( - wrapper.find(EuiComboBox).props() as unknown as { - onChange: (a: EuiComboBoxOptionOption[]) => void; - } - ).onChange([{ label: 'value 1' }]); - - expect(mockOnChange).toHaveBeenCalledWith(['value 1']); - }); - - test('it refreshes autocomplete with search query when new value searched', () => { - wrapper = mount( - <AutocompleteFieldMatchAnyComponent - autocompleteService={{ - ...autocompleteStartMock, - }} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - placeholder="Placeholder text" - rowLabel={'Row Label'} - selectedField={getField('machine.os.raw')} - selectedValue={[]} - /> - ); - act(() => { - ( - wrapper.find(EuiComboBox).props() as unknown as { - onSearchChange: (a: string) => void; - } - ).onSearchChange('value 1'); - }); - expect(useFieldValueAutocomplete).toHaveBeenCalledWith({ - autocompleteService: autocompleteStartMock, - fieldValue: [], - indexPattern: { - fields, - id: '1234', - title: 'logstash-*', - }, - operatorType: 'match_any', - query: 'value 1', - selectedField: getField('machine.os.raw'), - }); - }); - test('should show the warning helper text if the new value contains spaces when change', async () => { - (useFieldValueAutocomplete as jest.Mock).mockReturnValue([ - false, - true, - [' value 1 ', 'value 2'], - getValueSuggestionsMock, - ]); - const mockOnChange = jest.fn(); - wrapper = mount( - <AutocompleteFieldMatchAnyComponent - autocompleteService={{ - ...autocompleteStartMock, - }} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={mockOnChange} - placeholder="Placeholder text" - rowLabel={'Row Label'} - selectedField={getField('machine.os.raw')} - selectedValue={[]} - /> - ); - - await waitFor(() => - ( - wrapper.find(EuiComboBox).props() as unknown as { - onChange: (a: EuiComboBoxOptionOption[]) => void; - } - ).onChange([{ label: ' value 1 ' }]) - ); - wrapper.update(); - expect(mockOnChange).toHaveBeenCalledWith([' value 1 ']); - const euiFormHelptext = wrapper.find(EuiFormHelpText); - expect(euiFormHelptext.length).toBeTruthy(); - }); - test('should show the warning helper text if the new value contains spaces when searching a new query', () => { - wrapper = mount( - <AutocompleteFieldMatchAnyComponent - autocompleteService={{ - ...autocompleteStartMock, - }} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - placeholder="Placeholder text" - rowLabel={'Row Label'} - selectedField={getField('machine.os.raw')} - selectedValue={[]} - /> - ); - act(() => { - ( - wrapper.find(EuiComboBox).props() as unknown as { - onSearchChange: (a: string) => void; - } - ).onSearchChange(' value 1'); - }); - - wrapper.update(); - const euiFormHelptext = wrapper.find(EuiFormHelpText); - expect(euiFormHelptext.length).toBeTruthy(); - expect(euiFormHelptext.text()).toEqual('Warning: there is a space'); - }); - test('should show the warning helper text if selectedValue contains spaces when editing', () => { - wrapper = mount( - <AutocompleteFieldMatchAnyComponent - autocompleteService={{ - ...autocompleteStartMock, - }} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - placeholder="Placeholder text" - rowLabel={'Row Label'} - selectedField={getField('machine.os.raw')} - selectedValue={['value with trailing space ', 'value 1']} - /> - ); - const euiFormHelptext = wrapper.find(EuiFormHelpText); - expect(euiFormHelptext.length).toBeTruthy(); - expect(euiFormHelptext.text()).toEqual('Warning: there is a space'); - }); - test('should not show the warning helper text if selectedValue is falsy', () => { - wrapper = mount( - <AutocompleteFieldMatchAnyComponent - autocompleteService={{ - ...autocompleteStartMock, - }} - indexPattern={{ - fields, - id: '1234', - title: 'logstash-*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - placeholder="Placeholder text" - rowLabel={'Row Label'} - selectedField={getField('machine.os.raw')} - selectedValue={[]} - /> - ); - const euiFormHelptext = wrapper.find(EuiFormHelpText); - expect(euiFormHelptext.length).toBeFalsy(); - }); -}); diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_match_any/index.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_match_any/index.tsx deleted file mode 100644 index 761712797c5e1..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_match_any/index.tsx +++ /dev/null @@ -1,253 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { useCallback, useEffect, useMemo, useState } from 'react'; -import { EuiComboBox, EuiComboBoxOptionOption, EuiFormRow } from '@elastic/eui'; -import { uniq } from 'lodash'; -import { ListOperatorTypeEnum as OperatorTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; -import { DataViewBase, DataViewFieldBase } from '@kbn/es-query'; - -// TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715 -// import { AutocompleteStart } from '../../../../../../../src/plugins/unified_search/public'; -type AutocompleteStart = any; - -import * as i18n from '../translations'; -import { - getGenericComboBoxProps, - GetGenericComboBoxPropsReturn, -} from '../get_generic_combo_box_props'; -import { useFieldValueAutocomplete } from '../hooks/use_field_value_autocomplete'; -import { paramIsValid } from '../param_is_valid'; -import { paramContainsSpace } from '../param_contains_space'; - -interface AutocompleteFieldMatchAnyProps { - placeholder: string; - selectedField: DataViewFieldBase | undefined; - selectedValue: string[]; - indexPattern: DataViewBase | undefined; - isLoading: boolean; - isDisabled: boolean; - isClearable: boolean; - isRequired?: boolean; - rowLabel?: string; - autocompleteService: AutocompleteStart; - onChange: (arg: string[]) => void; - onError?: (arg: boolean) => void; - 'aria-label'?: string; -} - -export const AutocompleteFieldMatchAnyComponent: React.FC<AutocompleteFieldMatchAnyProps> = ({ - placeholder, - rowLabel, - selectedField, - selectedValue, - indexPattern, - isLoading, - isDisabled = false, - isClearable = false, - isRequired = false, - onChange, - onError, - autocompleteService, - 'aria-label': ariaLabel, -}): JSX.Element => { - const [searchQuery, setSearchQuery] = useState(''); - const [touched, setIsTouched] = useState(false); - const [error, setError] = useState<string | undefined>(undefined); - const [showSpacesWarning, setShowSpacesWarning] = useState<boolean>(false); - const [isLoadingSuggestions, isSuggestingValues, suggestions] = useFieldValueAutocomplete({ - autocompleteService, - fieldValue: selectedValue, - indexPattern, - operatorType: OperatorTypeEnum.MATCH_ANY, - query: searchQuery, - selectedField, - }); - const getLabel = useCallback((option: string): string => option, []); - const optionsMemo = useMemo( - (): string[] => (selectedValue ? uniq([...selectedValue, ...suggestions]) : suggestions), - [suggestions, selectedValue] - ); - const { comboOptions, labels, selectedComboOptions } = useMemo( - (): GetGenericComboBoxPropsReturn => - getGenericComboBoxProps<string>({ - getLabel, - options: optionsMemo, - selectedOptions: selectedValue, - }), - [optionsMemo, selectedValue, getLabel] - ); - const handleSpacesWarning = useCallback( - (params: string[]) => - setShowSpacesWarning(!!params.find((param: string) => paramContainsSpace(param))), - [setShowSpacesWarning] - ); - const handleError = useCallback( - (err: string | undefined): void => { - setError((existingErr): string | undefined => { - const oldErr = existingErr != null; - const newErr = err != null; - if (oldErr !== newErr && onError != null) { - onError(newErr); - } - - return err; - }); - }, - [setError, onError] - ); - - const handleValuesChange = useCallback( - (newOptions: EuiComboBoxOptionOption[]): void => { - const newValues: string[] = newOptions.map(({ label }) => optionsMemo[labels.indexOf(label)]); - handleError(undefined); - handleSpacesWarning(newValues); - onChange(newValues); - }, - [handleError, handleSpacesWarning, labels, onChange, optionsMemo] - ); - - const handleSearchChange = useCallback( - (searchVal: string) => { - if (searchVal === '') { - handleError(undefined); - } - - if (searchVal !== '' && selectedField != null) { - const err = paramIsValid(searchVal, selectedField, isRequired, touched); - handleError(err); - - if (!err) handleSpacesWarning([searchVal]); - - setSearchQuery(searchVal); - } - }, - [handleError, handleSpacesWarning, isRequired, selectedField, touched] - ); - - const handleCreateOption = useCallback( - (option: string): boolean => { - const err = paramIsValid(option, selectedField, isRequired, touched); - handleError(err); - - if (err != null) { - // Explicitly reject the user's input - setShowSpacesWarning(false); - return false; - } - - onChange([...(selectedValue || []), option]); - handleSpacesWarning([option]); - return true; - }, - [handleError, handleSpacesWarning, isRequired, onChange, selectedField, selectedValue, touched] - ); - - const setIsTouchedValue = useCallback((): void => { - handleError(selectedComboOptions.length === 0 ? i18n.FIELD_REQUIRED_ERR : undefined); - setIsTouched(true); - }, [setIsTouched, handleError, selectedComboOptions]); - - const inputPlaceholder = useMemo( - (): string => (isLoading || isLoadingSuggestions ? i18n.LOADING : placeholder), - [isLoading, isLoadingSuggestions, placeholder] - ); - - const isLoadingState = useMemo( - (): boolean => isLoading || isLoadingSuggestions, - [isLoading, isLoadingSuggestions] - ); - useEffect((): void => { - handleSpacesWarning(selectedValue); - }, [selectedField, selectedValue, handleSpacesWarning]); - - const defaultInput = useMemo((): JSX.Element => { - return ( - <EuiFormRow - label={rowLabel} - error={error} - isInvalid={selectedField != null && error != null} - helpText={showSpacesWarning && i18n.FIELD_SPACE_WARNING} - fullWidth - > - <EuiComboBox - placeholder={inputPlaceholder} - isLoading={isLoadingState} - isClearable={isClearable} - isDisabled={isDisabled} - options={comboOptions} - selectedOptions={selectedComboOptions} - onChange={handleValuesChange} - onSearchChange={handleSearchChange} - onCreateOption={handleCreateOption} - isInvalid={selectedField != null && error != null} - isCaseSensitive - onBlur={setIsTouchedValue} - data-test-subj="valuesAutocompleteMatchAny" - aria-label={ariaLabel} - fullWidth - async - /> - </EuiFormRow> - ); - }, [ - rowLabel, - error, - selectedField, - showSpacesWarning, - inputPlaceholder, - isLoadingState, - isClearable, - isDisabled, - comboOptions, - selectedComboOptions, - handleValuesChange, - handleSearchChange, - handleCreateOption, - setIsTouchedValue, - ariaLabel, - ]); - - if (!isSuggestingValues && selectedField != null) { - switch (selectedField.type) { - case 'number': - return ( - <EuiFormRow - label={rowLabel} - error={error} - isInvalid={selectedField != null && error != null} - fullWidth - > - <EuiComboBox - noSuggestions - placeholder={inputPlaceholder} - isLoading={isLoadingState} - isClearable={isClearable} - isDisabled={isDisabled} - selectedOptions={selectedComboOptions} - onChange={handleValuesChange} - onSearchChange={handleSearchChange} - onCreateOption={handleCreateOption} - isInvalid={selectedField != null && error != null} - onFocus={setIsTouchedValue} - data-test-subj="valuesAutocompleteMatchAnyNumber" - aria-label={ariaLabel} - fullWidth - /> - </EuiFormRow> - ); - default: - return defaultInput; - } - } - - return defaultInput; -}; - -AutocompleteFieldMatchAnyComponent.displayName = 'AutocompleteFieldMatchAny'; diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.test.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.test.tsx deleted file mode 100644 index 2840e428a69e2..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.test.tsx +++ /dev/null @@ -1,516 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { ReactWrapper, mount } from 'enzyme'; -import { EuiComboBox, EuiComboBoxOptionOption, EuiFormHelpText } from '@elastic/eui'; -import { act, waitFor } from '@testing-library/react'; -import { AutocompleteFieldWildcardComponent } from '.'; -import { useFieldValueAutocomplete } from '../hooks/use_field_value_autocomplete'; -import { fields, getField } from '../fields/index.mock'; -import { autocompleteStartMock } from '../autocomplete/index.mock'; -import { WILDCARD_WARNING, FILEPATH_WARNING } from '@kbn/securitysolution-utils'; - -jest.mock('../hooks/use_field_value_autocomplete'); -jest.mock('../translations', () => ({ - FIELD_SPACE_WARNING: 'Warning: there is a space', -})); -describe('AutocompleteFieldWildcardComponent', () => { - let wrapper: ReactWrapper; - - const getValueSuggestionsMock = jest - .fn() - .mockResolvedValue([false, true, ['value 3', 'value 4'], jest.fn()]); - - beforeEach(() => { - (useFieldValueAutocomplete as jest.Mock).mockReturnValue([ - false, - true, - ['value 1', 'value 2'], - getValueSuggestionsMock, - ]); - }); - - afterEach(() => { - jest.clearAllMocks(); - wrapper.unmount(); - }); - - test('it renders row label if one passed in', () => { - wrapper = mount( - <AutocompleteFieldWildcardComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logs-endpoint.events.*', - }} - isClearable={false} - isDisabled - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - onWarning={jest.fn()} - placeholder="Placeholder text" - rowLabel={'Row Label'} - selectedField={getField('file.path.text')} - selectedValue="/opt/bin/app.dmg" - /> - ); - - expect( - wrapper.find('[data-test-subj="valuesAutocompleteWildcardLabel"] label').at(0).text() - ).toEqual('Row Label'); - }); - - test('it renders disabled if "isDisabled" is true', () => { - wrapper = mount( - <AutocompleteFieldWildcardComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logs-endpoint.events.*', - }} - isClearable={false} - isDisabled - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - onWarning={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('file.path.text')} - selectedValue="/opt/*/app.dmg" - /> - ); - - expect( - wrapper.find('[data-test-subj="valuesAutocompleteWildcard"] input').prop('disabled') - ).toBeTruthy(); - }); - - test('it renders loading if "isLoading" is true', () => { - wrapper = mount( - <AutocompleteFieldWildcardComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logs-endpoint.events.*', - }} - isClearable={false} - isDisabled={false} - isLoading - onChange={jest.fn()} - onError={jest.fn()} - onWarning={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('file.path.text')} - selectedValue="/opt/*/app.dmg" - /> - ); - wrapper.find('[data-test-subj="valuesAutocompleteWildcard"] button').at(0).simulate('click'); - expect( - wrapper - .find('EuiComboBoxOptionsList[data-test-subj="valuesAutocompleteWildcard-optionsList"]') - .prop('isLoading') - ).toBeTruthy(); - }); - - test('it allows user to clear values if "isClearable" is true', () => { - wrapper = mount( - <AutocompleteFieldWildcardComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logs-endpoint.events.*', - }} - isClearable={true} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - onWarning={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('file.path.text')} - selectedValue="/opt/*/app.dmg" - /> - ); - - expect(wrapper.find(`[data-test-subj="comboBoxClearButton"]`)).toBeTruthy(); - }); - - test('it correctly displays selected value', () => { - wrapper = mount( - <AutocompleteFieldWildcardComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logs-endpoint.events.*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - onWarning={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('file.path.text')} - selectedValue="/opt/*/app.dmg" - /> - ); - - expect( - wrapper.find('[data-test-subj="valuesAutocompleteWildcard"] input').at(0).props().value - ).toEqual('/opt/*/app.dmg'); - }); - - test('it invokes "onChange" when new value created', async () => { - const mockOnChange = jest.fn(); - wrapper = mount( - <AutocompleteFieldWildcardComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logs-endpoint.events.*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={mockOnChange} - onError={jest.fn()} - onWarning={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('file.path.text')} - selectedValue="" - /> - ); - - ( - wrapper.find(EuiComboBox).props() as unknown as { - onCreateOption: (a: string) => void; - } - ).onCreateOption('/opt/*/app.dmg'); - - expect(mockOnChange).toHaveBeenCalledWith('/opt/*/app.dmg'); - }); - - test('it invokes "onChange" when new value selected', async () => { - const mockOnChange = jest.fn(); - wrapper = mount( - <AutocompleteFieldWildcardComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logs-endpoint.events.*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={mockOnChange} - onError={jest.fn()} - onWarning={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('file.path.text')} - selectedValue="" - /> - ); - - ( - wrapper.find(EuiComboBox).props() as unknown as { - onChange: (a: EuiComboBoxOptionOption[]) => void; - } - ).onChange([{ label: 'value 1' }]); - - expect(mockOnChange).toHaveBeenCalledWith('value 1'); - }); - - test('it refreshes autocomplete with search query when new value searched', () => { - wrapper = mount( - <AutocompleteFieldWildcardComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logs-endpoint.events.*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - onWarning={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('file.path.text')} - selectedValue="" - /> - ); - act(() => { - ( - wrapper.find(EuiComboBox).props() as unknown as { - onSearchChange: (a: string) => void; - } - ).onSearchChange('A:\\Some Folder\\inc*.exe'); - }); - - expect(useFieldValueAutocomplete).toHaveBeenCalledWith({ - autocompleteService: autocompleteStartMock, - fieldValue: '', - indexPattern: { - fields, - id: '1234', - title: 'logs-endpoint.events.*', - }, - operatorType: 'wildcard', - query: 'A:\\Some Folder\\inc*.exe', - selectedField: getField('file.path.text'), - }); - }); - - test('it does not invoke "onWarning" when no warning exists', () => { - const mockOnWarning = jest.fn(); - wrapper = mount( - <AutocompleteFieldWildcardComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logs-endpoint.events.*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - onWarning={mockOnWarning} - placeholder="Placeholder text" - selectedField={getField('file.path.text')} - selectedValue="invalid path" - /> - ); - - act(() => { - ( - wrapper.find(EuiComboBox).props() as unknown as { - onBlur: () => void; - } - ).onBlur(); - }); - - expect(mockOnWarning).not.toHaveBeenCalledWith(true); - }); - - test('it invokes "onWarning" when warning exists', () => { - const mockOnWarning = jest.fn(); - wrapper = mount( - <AutocompleteFieldWildcardComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logs-endpoint.events.*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - onWarning={mockOnWarning} - placeholder="Placeholder text" - selectedField={getField('file.path.text')} - selectedValue="invalid path" - warning={FILEPATH_WARNING} - /> - ); - - act(() => { - ( - wrapper.find(EuiComboBox).props() as unknown as { - onBlur: () => void; - } - ).onBlur(); - }); - - expect(mockOnWarning).toHaveBeenCalledWith(true); - expect( - wrapper - .find('[data-test-subj="valuesAutocompleteWildcardLabel"] div.euiFormHelpText') - .at(0) - .text() - ).toEqual(FILEPATH_WARNING); - }); - - test('it invokes "onWarning" when warning exists and is wildcard warning', () => { - const mockOnWarning = jest.fn(); - wrapper = mount( - <AutocompleteFieldWildcardComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logs-endpoint.events.*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - onWarning={mockOnWarning} - placeholder="Placeholder text" - selectedField={getField('file.path.text')} - selectedValue="invalid path" - warning={WILDCARD_WARNING} - /> - ); - - act(() => { - ( - wrapper.find(EuiComboBox).props() as unknown as { - onBlur: () => void; - } - ).onBlur(); - }); - - expect(mockOnWarning).toHaveBeenCalledWith(true); - const helpText = wrapper - .find('[data-test-subj="valuesAutocompleteWildcardLabel"] div.euiFormHelpText') - .at(0); - expect(helpText.text()).toEqual(WILDCARD_WARNING); - expect(helpText.find('.euiToolTipAnchor')).toBeTruthy(); - }); - test('should show the warning helper text if the new value contains spaces when change', async () => { - (useFieldValueAutocomplete as jest.Mock).mockReturnValue([ - false, - true, - [' value 1 ', 'value 2'], - getValueSuggestionsMock, - ]); - const mockOnChange = jest.fn(); - wrapper = mount( - <AutocompleteFieldWildcardComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logs-endpoint.events.*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={mockOnChange} - onError={jest.fn()} - onWarning={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('file.path.text')} - selectedValue="invalid path" - warning={WILDCARD_WARNING} - /> - ); - - await waitFor(() => - ( - wrapper.find(EuiComboBox).props() as unknown as { - onChange: (a: EuiComboBoxOptionOption[]) => void; - } - ).onChange([{ label: ' value 1 ' }]) - ); - wrapper.update(); - expect(mockOnChange).toHaveBeenCalledWith(' value 1 '); - - const euiFormHelptext = wrapper.find(EuiFormHelpText); - expect(euiFormHelptext.length).toBeTruthy(); - }); - test('should show the warning helper text if the new value contains spaces when searching a new query', () => { - wrapper = mount( - <AutocompleteFieldWildcardComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logs-endpoint.events.*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - onWarning={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('file.path.text')} - selectedValue="invalid path" - warning={''} - /> - ); - act(() => { - ( - wrapper.find(EuiComboBox).props() as unknown as { - onSearchChange: (a: string) => void; - } - ).onSearchChange(' value 1'); - }); - - wrapper.update(); - const euiFormHelptext = wrapper.find(EuiFormHelpText); - expect(euiFormHelptext.length).toBeTruthy(); - expect(euiFormHelptext.text()).toEqual('Warning: there is a space'); - }); - test('should show the warning helper text if selectedValue contains spaces when editing', () => { - wrapper = mount( - <AutocompleteFieldWildcardComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logs-endpoint.events.*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - onWarning={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('file.path.text')} - selectedValue=" leading space" - warning={''} - /> - ); - const euiFormHelptext = wrapper.find(EuiFormHelpText); - expect(euiFormHelptext.length).toBeTruthy(); - expect(euiFormHelptext.text()).toEqual('Warning: there is a space'); - }); - test('should not show the warning helper text if selectedValue is falsy', () => { - wrapper = mount( - <AutocompleteFieldWildcardComponent - autocompleteService={autocompleteStartMock} - indexPattern={{ - fields, - id: '1234', - title: 'logs-endpoint.events.*', - }} - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - onError={jest.fn()} - onWarning={jest.fn()} - placeholder="Placeholder text" - selectedField={getField('file.path.text')} - selectedValue="" - warning={''} - /> - ); - const euiFormHelptext = wrapper.find(EuiFormHelpText); - expect(euiFormHelptext.length).toBeFalsy(); - }); -}); diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.tsx deleted file mode 100644 index 5a55b3399a6af..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.tsx +++ /dev/null @@ -1,286 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { useCallback, useMemo, useState, useEffect, memo } from 'react'; -import { EuiFormRow, EuiComboBoxOptionOption, EuiComboBox } from '@elastic/eui'; -import { DataViewBase, DataViewFieldBase } from '@kbn/es-query'; - -import { uniq } from 'lodash'; - -import { ListOperatorTypeEnum as OperatorTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; - -// TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715 -// import { AutocompleteStart } from '../../../../../../../src/plugins/unified_search/public'; -type AutocompleteStart = any; - -import * as i18n from '../translations'; -import { useFieldValueAutocomplete } from '../hooks/use_field_value_autocomplete'; -import { - getGenericComboBoxProps, - GetGenericComboBoxPropsReturn, -} from '../get_generic_combo_box_props'; -import { paramIsValid } from '../param_is_valid'; -import { paramContainsSpace } from '../param_contains_space'; - -const SINGLE_SELECTION = { asPlainText: true }; - -type Warning = string | React.ReactNode; -interface AutocompleteFieldWildcardProps { - placeholder: string; - selectedField: DataViewFieldBase | undefined; - selectedValue: string | undefined; - indexPattern: DataViewBase | undefined; - isLoading: boolean; - isDisabled?: boolean; - isClearable?: boolean; - isRequired?: boolean; - fieldInputWidth?: number; - rowLabel?: string; - autocompleteService: AutocompleteStart; - onChange: (arg: string) => void; - onError: (arg: boolean) => void; - onWarning: (arg: boolean) => void; - warning?: Warning; - 'aria-label'?: string; -} - -export const AutocompleteFieldWildcardComponent: React.FC<AutocompleteFieldWildcardProps> = memo( - ({ - autocompleteService, - placeholder, - rowLabel, - selectedField, - selectedValue, - indexPattern, - isLoading, - isDisabled = false, - isClearable = false, - isRequired = false, - fieldInputWidth, - onChange, - onError, - onWarning, - warning, - 'aria-label': ariaLabel, - }): JSX.Element => { - const [searchQuery, setSearchQuery] = useState(''); - const [touched, setIsTouched] = useState(false); - const [error, setError] = useState<string | undefined>(undefined); - const [showSpacesWarning, setShowSpacesWarning] = useState<boolean>(false); - const [isLoadingSuggestions, , suggestions] = useFieldValueAutocomplete({ - autocompleteService, - fieldValue: selectedValue, - indexPattern, - operatorType: OperatorTypeEnum.WILDCARD, - query: searchQuery, - selectedField, - }); - const getLabel = useCallback((option: string): string => option, []); - const optionsMemo = useMemo((): string[] => { - const valueAsStr = String(selectedValue); - return selectedValue != null && selectedValue.trim() !== '' - ? uniq([valueAsStr, ...suggestions]) - : suggestions; - }, [suggestions, selectedValue]); - const selectedOptionsMemo = useMemo((): string[] => { - const valueAsStr = String(selectedValue); - return selectedValue ? [valueAsStr] : []; - }, [selectedValue]); - - const handleSpacesWarning = useCallback( - (param: string | undefined) => { - if (!param) return setShowSpacesWarning(false); - setShowSpacesWarning(!!paramContainsSpace(param)); - }, - [setShowSpacesWarning] - ); - const handleError = useCallback( - (err: string | undefined): void => { - setError((existingErr): string | undefined => { - const oldErr = existingErr != null; - const newErr = err != null; - if (oldErr !== newErr && onError != null) { - onError(newErr); - } - - return err; - }); - }, - [setError, onError] - ); - - const handleWarning = useCallback( - (warn: Warning | undefined): void => { - onWarning(warn !== undefined); - }, - [onWarning] - ); - - const { comboOptions, labels, selectedComboOptions } = useMemo( - (): GetGenericComboBoxPropsReturn => - getGenericComboBoxProps<string>({ - getLabel, - options: optionsMemo, - selectedOptions: selectedOptionsMemo, - }), - [optionsMemo, selectedOptionsMemo, getLabel] - ); - - const handleValuesChange = useCallback( - (newOptions: EuiComboBoxOptionOption[]): void => { - const [newValue] = newOptions.map(({ label }) => optionsMemo[labels.indexOf(label)]); - handleError(undefined); - handleSpacesWarning(newValue); - setShowSpacesWarning(false); - - onChange(newValue ?? ''); - }, - [handleError, handleSpacesWarning, labels, onChange, optionsMemo] - ); - - const handleSearchChange = useCallback( - (searchVal: string): void => { - if (searchVal.trim() !== '' && selectedField != null) { - const err = paramIsValid(searchVal, selectedField, isRequired, touched); - handleError(err); - handleWarning(warning); - if (!err) handleSpacesWarning(searchVal); - - setSearchQuery(searchVal); - } - }, - [handleError, handleSpacesWarning, isRequired, selectedField, touched, warning, handleWarning] - ); - - const handleCreateOption = useCallback( - (option: string): boolean | undefined => { - const err = paramIsValid(option, selectedField, isRequired, touched); - handleError(err); - handleWarning(warning); - - if (err != null) { - // Explicitly reject the user's input - setShowSpacesWarning(false); - return false; - } - - handleSpacesWarning(option); - onChange(option); - return undefined; - }, - [ - isRequired, - handleSpacesWarning, - onChange, - selectedField, - touched, - handleError, - handleWarning, - warning, - ] - ); - - const setIsTouchedValue = useCallback((): void => { - setIsTouched(true); - - const err = paramIsValid(selectedValue, selectedField, isRequired, true); - handleError(err); - handleWarning(warning); - }, [ - setIsTouched, - handleError, - selectedValue, - selectedField, - isRequired, - handleWarning, - warning, - ]); - - const inputPlaceholder = useMemo((): string => { - if (isLoading || isLoadingSuggestions) { - return i18n.LOADING; - } else if (selectedField == null) { - return i18n.SELECT_FIELD_FIRST; - } else { - return placeholder; - } - }, [isLoading, selectedField, isLoadingSuggestions, placeholder]); - - const isLoadingState = useMemo( - (): boolean => isLoading || isLoadingSuggestions, - [isLoading, isLoadingSuggestions] - ); - - useEffect((): void => { - setError(undefined); - if (onError != null) { - onError(false); - } - handleSpacesWarning(selectedValue); - - onWarning(false); - }, [selectedField, selectedValue, onError, onWarning, handleSpacesWarning]); - - const defaultInput = useMemo((): JSX.Element => { - return ( - <EuiFormRow - label={rowLabel} - error={error} - helpText={warning || (showSpacesWarning && i18n.FIELD_SPACE_WARNING)} - isInvalid={selectedField != null && error != null} - data-test-subj="valuesAutocompleteWildcardLabel" - fullWidth - > - <EuiComboBox - placeholder={inputPlaceholder} - isDisabled={isDisabled || !selectedField} - isLoading={isLoadingState} - isClearable={isClearable} - options={comboOptions} - selectedOptions={selectedComboOptions} - onChange={handleValuesChange} - singleSelection={SINGLE_SELECTION} - onSearchChange={handleSearchChange} - onCreateOption={handleCreateOption} - isInvalid={selectedField != null && error != null} - onBlur={setIsTouchedValue} - sortMatchesBy="startsWith" - data-test-subj="valuesAutocompleteWildcard" - style={fieldInputWidth ? { width: `${fieldInputWidth}px` } : {}} - fullWidth - async - aria-label={ariaLabel} - /> - </EuiFormRow> - ); - }, [ - rowLabel, - error, - warning, - showSpacesWarning, - selectedField, - inputPlaceholder, - isDisabled, - isLoadingState, - isClearable, - comboOptions, - selectedComboOptions, - handleValuesChange, - handleSearchChange, - handleCreateOption, - setIsTouchedValue, - fieldInputWidth, - ariaLabel, - ]); - - return defaultInput; - } -); - -AutocompleteFieldWildcardComponent.displayName = 'AutocompleteFieldWildcard'; diff --git a/packages/kbn-securitysolution-autocomplete/src/fields/index.mock.ts b/packages/kbn-securitysolution-autocomplete/src/fields/index.mock.ts deleted file mode 100644 index dcb719ccdb56c..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/fields/index.mock.ts +++ /dev/null @@ -1,323 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { DataViewFieldBase } from '@kbn/es-query'; - -// Copied from "src/plugins/data/common/index_patterns/fields/fields.mocks.ts" but with the types changed to "DataViewFieldBase" since that type is compatible. -// TODO: This should move out once those mocks are directly useable or in their own package, https://github.com/elastic/kibana/issues/100715 - -export const fields: DataViewFieldBase[] = [ - { - name: 'bytes', - type: 'number', - esTypes: ['long'], - count: 10, - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - name: 'ssl', - type: 'boolean', - esTypes: ['boolean'], - count: 20, - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - name: '@timestamp', - type: 'date', - esTypes: ['date'], - count: 30, - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - name: 'time', - type: 'date', - esTypes: ['date'], - count: 30, - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - name: '@tags', - type: 'string', - esTypes: ['keyword'], - count: 0, - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - name: 'utc_time', - type: 'date', - esTypes: ['date'], - count: 0, - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - name: 'phpmemory', - type: 'number', - esTypes: ['integer'], - count: 0, - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - name: 'ip', - type: 'ip', - esTypes: ['ip'], - count: 0, - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - name: 'request_body', - type: 'attachment', - esTypes: ['attachment'], - count: 0, - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - name: 'point', - type: 'geo_point', - esTypes: ['geo_point'], - count: 0, - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - name: 'area', - type: 'geo_shape', - esTypes: ['geo_shape'], - count: 0, - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - name: 'hashed', - type: 'murmur3', - esTypes: ['murmur3'], - count: 0, - scripted: false, - searchable: true, - aggregatable: false, - readFromDocValues: false, - }, - { - name: 'geo.coordinates', - type: 'geo_point', - esTypes: ['geo_point'], - count: 0, - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - name: 'extension', - type: 'string', - esTypes: ['keyword'], - count: 0, - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - name: 'machine.os', - type: 'string', - esTypes: ['text'], - count: 0, - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: false, - }, - { - name: 'machine.os.raw', - type: 'string', - esTypes: ['keyword'], - count: 0, - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - subType: { multi: { parent: 'machine.os' } }, - }, - { - name: 'geo.src', - type: 'string', - esTypes: ['keyword'], - count: 0, - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - name: '_id', - type: 'string', - esTypes: ['_id'], - count: 0, - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: false, - }, - { - name: '_type', - type: 'string', - esTypes: ['_type'], - count: 0, - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: false, - }, - { - name: '_source', - type: '_source', - esTypes: ['_source'], - count: 0, - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: false, - }, - { - name: 'non-filterable', - type: 'string', - esTypes: ['text'], - count: 0, - scripted: false, - searchable: false, - aggregatable: true, - readFromDocValues: false, - }, - { - name: 'non-sortable', - type: 'string', - esTypes: ['text'], - count: 0, - scripted: false, - searchable: false, - aggregatable: false, - readFromDocValues: false, - }, - { - name: 'custom_user_field', - type: 'conflict', - esTypes: ['long', 'text'], - count: 0, - scripted: false, - searchable: true, - aggregatable: true, - readFromDocValues: true, - }, - { - name: 'script string', - type: 'string', - count: 0, - scripted: true, - script: "'i am a string'", - lang: 'expression', - searchable: true, - aggregatable: true, - readFromDocValues: false, - }, - { - name: 'script number', - type: 'number', - count: 0, - scripted: true, - script: '1234', - lang: 'expression', - searchable: true, - aggregatable: true, - readFromDocValues: false, - }, - { - name: 'script date', - type: 'date', - count: 0, - scripted: true, - script: '1234', - lang: 'painless', - searchable: true, - aggregatable: true, - readFromDocValues: false, - }, - { - name: 'script murmur3', - type: 'murmur3', - count: 0, - scripted: true, - script: '1234', - lang: 'expression', - searchable: true, - aggregatable: true, - readFromDocValues: false, - }, - { - name: 'nestedField.child', - type: 'string', - esTypes: ['text'], - count: 0, - scripted: false, - searchable: true, - aggregatable: false, - readFromDocValues: false, - subType: { nested: { path: 'nestedField' } }, - }, - { - name: 'nestedField.nestedChild.doublyNestedChild', - type: 'string', - esTypes: ['text'], - count: 0, - scripted: false, - searchable: true, - aggregatable: false, - readFromDocValues: false, - subType: { nested: { path: 'nestedField.nestedChild' } }, - }, - { - name: 'file.path.text', - type: 'string', - esTypes: ['text'], - searchable: true, - aggregatable: false, - subType: { multi: { parent: 'file.path' } }, - }, -] as unknown as DataViewFieldBase[]; - -export const getField = (name: string) => fields.find((field) => field.name === name); diff --git a/packages/kbn-securitysolution-autocomplete/src/filter_field_to_list/index.test.ts b/packages/kbn-securitysolution-autocomplete/src/filter_field_to_list/index.test.ts deleted file mode 100644 index be0710bfd1bab..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/filter_field_to_list/index.test.ts +++ /dev/null @@ -1,125 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { filterFieldToList } from '.'; - -import { getListResponseMock } from '../list_schema/index.mock'; -import { DataViewFieldBase } from '@kbn/es-query'; -import { AutocompleteListsData } from '../field_value_lists'; - -const emptyListData: AutocompleteListsData = { smallLists: [], largeLists: [] }; - -describe('#filterFieldToList', () => { - test('it returns empty list data object if given a undefined for field', () => { - const filter = filterFieldToList(emptyListData, undefined); - expect(filter).toEqual(emptyListData); - }); - - test('it returns empty list data object if filed does not contain esTypes', () => { - const field: DataViewFieldBase = { - name: 'some-name', - type: 'some-type', - }; - const filter = filterFieldToList(emptyListData, field); - expect(filter).toEqual(emptyListData); - }); - - test('it returns filtered lists of ip_range -> ip', () => { - const field: DataViewFieldBase & { esTypes: string[] } = { - esTypes: ['ip'], - name: 'some-name', - type: 'ip', - }; - const listData: AutocompleteListsData = { - smallLists: [{ ...getListResponseMock(), type: 'ip_range' }], - largeLists: [], - }; - const filter = filterFieldToList(listData, field); - const expected = listData; - expect(filter).toEqual(expected); - }); - - test('it returns filtered lists of ip -> ip', () => { - const field: DataViewFieldBase & { esTypes: string[] } = { - esTypes: ['ip'], - name: 'some-name', - type: 'ip', - }; - const listData: AutocompleteListsData = { - smallLists: [{ ...getListResponseMock(), type: 'ip' }], - largeLists: [], - }; - const filter = filterFieldToList(listData, field); - const expected = listData; - expect(filter).toEqual(expected); - }); - - test('it returns filtered lists of keyword -> keyword', () => { - const field: DataViewFieldBase & { esTypes: string[] } = { - esTypes: ['keyword'], - name: 'some-name', - type: 'keyword', - }; - const listData: AutocompleteListsData = { - smallLists: [{ ...getListResponseMock(), type: 'keyword' }], - largeLists: [], - }; - const filter = filterFieldToList(listData, field); - const expected = listData; - expect(filter).toEqual(expected); - }); - - test('it returns filtered lists of text -> text', () => { - const field: DataViewFieldBase & { esTypes: string[] } = { - esTypes: ['text'], - name: 'some-name', - type: 'text', - }; - const listData: AutocompleteListsData = { - smallLists: [{ ...getListResponseMock(), type: 'text' }], - largeLists: [], - }; - const filter = filterFieldToList(listData, field); - const expected = listData; - expect(filter).toEqual(expected); - }); - - test('it returns small and large filtered lists of ip_range -> ip', () => { - const field: DataViewFieldBase & { esTypes: string[] } = { - esTypes: ['ip'], - name: 'some-name', - type: 'ip', - }; - const listData: AutocompleteListsData = { - smallLists: [{ ...getListResponseMock(), type: 'ip_range' }], - largeLists: [{ ...getListResponseMock(), type: 'ip_range' }], - }; - const filter = filterFieldToList(listData, field); - const expected = listData; - expect(filter).toEqual(expected); - }); - - test('it returns 1 filtered lists of ip_range -> ip if the 2nd is not compatible type', () => { - const field: DataViewFieldBase & { esTypes: string[] } = { - esTypes: ['ip'], - name: 'some-name', - type: 'ip', - }; - const listData: AutocompleteListsData = { - smallLists: [{ ...getListResponseMock(), type: 'ip_range' }], - largeLists: [{ ...getListResponseMock(), type: 'text' }], - }; - const filter = filterFieldToList(listData, field); - const expected: AutocompleteListsData = { - smallLists: [{ ...getListResponseMock(), type: 'ip_range' }], - largeLists: [], - }; - expect(filter).toEqual(expected); - }); -}); diff --git a/packages/kbn-securitysolution-autocomplete/src/filter_field_to_list/index.ts b/packages/kbn-securitysolution-autocomplete/src/filter_field_to_list/index.ts deleted file mode 100644 index 86d429cc9ef80..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/filter_field_to_list/index.ts +++ /dev/null @@ -1,41 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { DataViewFieldBase } from '@kbn/es-query'; -import { typeMatch } from '../type_match'; -import { AutocompleteListsData } from '../field_value_lists'; - -/** - * Given an array of lists and optionally a field this will return all - * the lists that match against the field based on the types from the field - * - * NOTE: That we support one additional property from "FieldSpec" located here: - * src/plugins/data/common/index_patterns/fields/types.ts - * This type property is esTypes. If it exists and is on there we will read off the esTypes. - * @param lists The lists to match against the field - * @param field The field to check against the list to see if they are compatible - */ -export const filterFieldToList = ( - lists: AutocompleteListsData, - field?: DataViewFieldBase & { esTypes?: string[] } -): AutocompleteListsData => { - if (field != null) { - const { esTypes = [] } = field; - return { - smallLists: lists.smallLists.filter(({ type }) => - esTypes.some((esType: string) => typeMatch(type, esType)) - ), - largeLists: lists.largeLists.filter(({ type }) => - esTypes.some((esType: string) => typeMatch(type, esType)) - ), - }; - } else { - return { smallLists: [], largeLists: [] }; - } -}; diff --git a/packages/kbn-securitysolution-autocomplete/src/get_generic_combo_box_props/index.test.tsx b/packages/kbn-securitysolution-autocomplete/src/get_generic_combo_box_props/index.test.tsx deleted file mode 100644 index 82ca7f60de24b..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/get_generic_combo_box_props/index.test.tsx +++ /dev/null @@ -1,126 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { getGenericComboBoxProps } from '.'; - -describe('get_generic_combo_box_props', () => { - test('it returns empty arrays if "options" is empty array', () => { - const result = getGenericComboBoxProps<string>({ - options: [], - selectedOptions: ['option1'], - getLabel: (t: string) => t, - }); - - expect(result).toEqual({ comboOptions: [], labels: [], selectedComboOptions: [] }); - }); - - test('it returns formatted props if "options" array is not empty', () => { - const result = getGenericComboBoxProps<string>({ - options: ['option1', 'option2', 'option3'], - selectedOptions: [], - getLabel: (t: string) => t, - }); - - expect(result).toEqual({ - comboOptions: [ - { - label: 'option1', - }, - { - label: 'option2', - }, - { - label: 'option3', - }, - ], - labels: ['option1', 'option2', 'option3'], - selectedComboOptions: [], - }); - }); - - test('it does not return "selectedOptions" items that do not appear in "options"', () => { - const result = getGenericComboBoxProps<string>({ - options: ['option1', 'option2', 'option3'], - selectedOptions: ['option4'], - getLabel: (t: string) => t, - }); - - expect(result).toEqual({ - comboOptions: [ - { - label: 'option1', - }, - { - label: 'option2', - }, - { - label: 'option3', - }, - ], - labels: ['option1', 'option2', 'option3'], - selectedComboOptions: [], - }); - }); - - test('it returns "selectedOptions" items that do appear in "options"', () => { - const result = getGenericComboBoxProps<string>({ - options: ['option1', 'option2', 'option3'], - selectedOptions: ['option2'], - getLabel: (t: string) => t, - }); - - expect(result).toEqual({ - comboOptions: [ - { - label: 'option1', - }, - { - label: 'option2', - }, - { - label: 'option3', - }, - ], - labels: ['option1', 'option2', 'option3'], - selectedComboOptions: [ - { - label: 'option2', - }, - ], - }); - }); - - test('it returns "disabledOptions" items that do appear in "options" as disabled', () => { - const result = getGenericComboBoxProps<string>({ - options: ['option1', 'option2', 'option3'], - selectedOptions: [], - disabledOptions: ['option2'], - getLabel: (t: string) => t, - }); - - expect(result).toEqual({ - comboOptions: [ - { - label: 'option1', - disabled: false, - }, - { - label: 'option2', - disabled: true, - }, - { - label: 'option3', - disabled: false, - }, - ], - labels: ['option1', 'option2', 'option3'], - selectedComboOptions: [], - }); - }); -}); diff --git a/packages/kbn-securitysolution-autocomplete/src/get_generic_combo_box_props/index.ts b/packages/kbn-securitysolution-autocomplete/src/get_generic_combo_box_props/index.ts deleted file mode 100644 index 2f2a6697c4226..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/get_generic_combo_box_props/index.ts +++ /dev/null @@ -1,55 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EuiComboBoxOptionOption } from '@elastic/eui'; - -export interface GetGenericComboBoxPropsReturn { - comboOptions: EuiComboBoxOptionOption[]; - labels: string[]; - selectedComboOptions: EuiComboBoxOptionOption[]; -} - -/** - * Determines the options, selected values and option labels for EUI combo box - * @param options options user can select from - * @param selectedOptions user selection if any - * @param getLabel helper function to know which property to use for labels - */ -export const getGenericComboBoxProps = <T>({ - getLabel, - options, - selectedOptions, - disabledOptions, -}: { - getLabel: (value: T) => string; - options: T[]; - selectedOptions: T[]; - disabledOptions?: T[]; -}): GetGenericComboBoxPropsReturn => { - const newLabels = options.map(getLabel); - const disabledLabels = disabledOptions?.map(getLabel); - const newComboOptions: EuiComboBoxOptionOption[] = newLabels.map((label) => ({ - label, - disabled: disabledLabels && disabledLabels.length !== 0 && disabledLabels.includes(label), - })); - const newSelectedComboOptions = selectedOptions - .map(getLabel) - .filter((option) => { - return newLabels.indexOf(option) !== -1; - }) - .map((option) => { - return newComboOptions[newLabels.indexOf(option)]; - }); - - return { - comboOptions: newComboOptions, - labels: newLabels, - selectedComboOptions: newSelectedComboOptions, - }; -}; diff --git a/packages/kbn-securitysolution-autocomplete/src/get_operators/index.test.ts b/packages/kbn-securitysolution-autocomplete/src/get_operators/index.test.ts deleted file mode 100644 index 711e7ea87a8e0..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/get_operators/index.test.ts +++ /dev/null @@ -1,59 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { - doesNotExistOperator, - EVENT_FILTERS_OPERATORS, - ALL_OPERATORS, - existsOperator, - isNotOperator, - isOperator, -} from '@kbn/securitysolution-list-utils'; -import { getOperators } from '.'; -import { getField } from '../fields/index.mock'; - -describe('#getOperators', () => { - test('it returns "isOperator" if passed in field is "undefined"', () => { - const operator = getOperators(undefined); - - expect(operator).toEqual([isOperator]); - }); - - test('it returns expected operators when field type is "boolean"', () => { - const operator = getOperators(getField('ssl')); - - expect(operator).toEqual([isOperator, isNotOperator, existsOperator, doesNotExistOperator]); - }); - - test('it returns "isOperator" when field type is "nested"', () => { - const operator = getOperators({ - name: 'nestedField', - scripted: false, - subType: { nested: { path: 'nestedField' } }, - type: 'nested', - }); - - expect(operator).toEqual([isOperator]); - }); - - test('it includes a "matches" operator when field is "file.path.text"', () => { - const operator = getOperators({ - name: 'file.path.text', - type: 'simple', - }); - - expect(operator).toEqual(EVENT_FILTERS_OPERATORS); - }); - - test('it returns all operator types when field type is not null, boolean, or nested', () => { - const operator = getOperators(getField('machine.os.raw')); - - expect(operator).toEqual(ALL_OPERATORS); - }); -}); diff --git a/packages/kbn-securitysolution-autocomplete/src/get_operators/index.ts b/packages/kbn-securitysolution-autocomplete/src/get_operators/index.ts deleted file mode 100644 index dbb36fd479df6..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/get_operators/index.ts +++ /dev/null @@ -1,40 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { DataViewFieldBase } from '@kbn/es-query'; - -import { - ALL_OPERATORS, - EVENT_FILTERS_OPERATORS, - OperatorOption, - doesNotExistOperator, - existsOperator, - isNotOperator, - isOperator, -} from '@kbn/securitysolution-list-utils'; - -/** - * Returns the appropriate operators given a field type - * - * @param field DataViewFieldBase selected field - * - */ -export const getOperators = (field: DataViewFieldBase | undefined): OperatorOption[] => { - if (field == null) { - return [isOperator]; - } else if (field.type === 'boolean') { - return [isOperator, isNotOperator, existsOperator, doesNotExistOperator]; - } else if (field.type === 'nested') { - return [isOperator]; - } else if (field.name === 'file.path.text') { - return EVENT_FILTERS_OPERATORS; - } else { - return ALL_OPERATORS; - } -}; diff --git a/packages/kbn-securitysolution-autocomplete/src/hooks/index.ts b/packages/kbn-securitysolution-autocomplete/src/hooks/index.ts deleted file mode 100644 index 5aa216af4c67e..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/hooks/index.ts +++ /dev/null @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './use_field_value_autocomplete'; diff --git a/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.test.ts b/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.test.ts deleted file mode 100644 index 836744f3ede28..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.test.ts +++ /dev/null @@ -1,300 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { waitFor, renderHook } from '@testing-library/react'; -import { ListOperatorTypeEnum as OperatorTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; - -import { UseFieldValueAutocompleteReturn, useFieldValueAutocomplete } from '.'; -import { getField } from '../../fields/index.mock'; -import { autocompleteStartMock } from '../../autocomplete/index.mock'; -import { DataViewFieldBase } from '@kbn/es-query'; - -// Copied from "src/plugins/data/common/index_patterns/index_pattern.stub.ts" -// TODO: Remove this in favor of the above if/when it is ported, https://github.com/elastic/kibana/issues/100715 -export const stubIndexPatternWithFields = { - id: '1234', - title: 'logstash-*', - fields: [ - { - name: 'response', - type: 'number', - esTypes: ['integer'], - aggregatable: true, - filterable: true, - searchable: true, - }, - ], -}; - -describe('use_field_value_autocomplete', () => { - const onErrorMock = jest.fn(); - const getValueSuggestionsMock = jest.fn().mockResolvedValue(['value 1', 'value 2']); - - afterEach(() => { - onErrorMock.mockClear(); - getValueSuggestionsMock.mockClear(); - }); - - test('initializes hook', async () => { - const { result } = renderHook(() => - useFieldValueAutocomplete({ - autocompleteService: { - ...autocompleteStartMock, - getValueSuggestions: getValueSuggestionsMock, - }, - fieldValue: '', - indexPattern: undefined, - operatorType: OperatorTypeEnum.MATCH, - query: '', - selectedField: undefined, - }) - ); - await waitFor(() => expect(result.current).toEqual([false, true, [], result.current[3]])); - }); - - test('does not call autocomplete service if "operatorType" is "exists"', async () => { - const { result } = renderHook(() => - useFieldValueAutocomplete({ - autocompleteService: { - ...autocompleteStartMock, - getValueSuggestions: getValueSuggestionsMock, - }, - fieldValue: '', - indexPattern: stubIndexPatternWithFields, - operatorType: OperatorTypeEnum.EXISTS, - query: '', - selectedField: getField('machine.os'), - }) - ); - - await waitFor(() => { - const expectedResult: UseFieldValueAutocompleteReturn = [false, true, [], result.current[3]]; - - expect(result.current).toEqual(expectedResult); - expect(getValueSuggestionsMock).not.toHaveBeenCalled(); - }); - }); - - test('does not call autocomplete service if "selectedField" is undefined', async () => { - const { result } = renderHook(() => - useFieldValueAutocomplete({ - autocompleteService: { - ...autocompleteStartMock, - getValueSuggestions: getValueSuggestionsMock, - }, - fieldValue: '', - indexPattern: stubIndexPatternWithFields, - operatorType: OperatorTypeEnum.EXISTS, - query: '', - selectedField: undefined, - }) - ); - - await waitFor(() => { - const expectedResult: UseFieldValueAutocompleteReturn = [false, true, [], result.current[3]]; - - expect(result.current).toEqual(expectedResult); - expect(getValueSuggestionsMock).not.toHaveBeenCalled(); - }); - }); - - test('does not call autocomplete service if "indexPattern" is undefined', async () => { - const { result } = renderHook(() => - useFieldValueAutocomplete({ - autocompleteService: { - ...autocompleteStartMock, - getValueSuggestions: getValueSuggestionsMock, - }, - fieldValue: '', - indexPattern: undefined, - operatorType: OperatorTypeEnum.EXISTS, - query: '', - selectedField: getField('machine.os'), - }) - ); - - await waitFor(() => { - const expectedResult: UseFieldValueAutocompleteReturn = [false, true, [], result.current[3]]; - - expect(result.current).toEqual(expectedResult); - expect(getValueSuggestionsMock).not.toHaveBeenCalled(); - }); - }); - - test('it uses full path name for nested fields to fetch suggestions', async () => { - const suggestionsMock = jest.fn().mockResolvedValue([]); - - const selectedField: DataViewFieldBase | undefined = getField('nestedField.child'); - if (selectedField == null) { - throw new TypeError('selectedField for this test should always be defined'); - } - - const { signal } = new AbortController(); - renderHook(() => - useFieldValueAutocomplete({ - autocompleteService: { - ...autocompleteStartMock, - getValueSuggestions: suggestionsMock, - }, - fieldValue: '', - indexPattern: stubIndexPatternWithFields, - operatorType: OperatorTypeEnum.MATCH, - query: '', - selectedField: { ...selectedField, name: 'child' }, - }) - ); - - await waitFor(() => - expect(suggestionsMock).toHaveBeenCalledWith({ - field: { ...getField('nestedField.child'), name: 'nestedField.child' }, - indexPattern: { - fields: [ - { - aggregatable: true, - esTypes: ['integer'], - filterable: true, - name: 'response', - searchable: true, - type: 'number', - }, - ], - id: '1234', - title: 'logstash-*', - }, - query: '', - signal, - useTimeRange: false, - }) - ); - }); - - test('returns "isSuggestingValues" of false if field type is boolean', async () => { - const { result } = renderHook(() => - useFieldValueAutocomplete({ - autocompleteService: { - ...autocompleteStartMock, - getValueSuggestions: getValueSuggestionsMock, - }, - fieldValue: '', - indexPattern: stubIndexPatternWithFields, - operatorType: OperatorTypeEnum.MATCH, - query: '', - selectedField: getField('ssl'), - }) - ); - - await waitFor(() => { - const expectedResult: UseFieldValueAutocompleteReturn = [false, false, [], result.current[3]]; - - expect(result.current).toEqual(expectedResult); - expect(getValueSuggestionsMock).not.toHaveBeenCalled(); - }); - }); - - test('returns "isSuggestingValues" of false to note that autocomplete service is not in use if no autocomplete suggestions available', async () => { - const suggestionsMock = jest.fn().mockResolvedValue([]); - - const { result } = renderHook(() => - useFieldValueAutocomplete({ - autocompleteService: { - ...autocompleteStartMock, - getValueSuggestions: suggestionsMock, - }, - fieldValue: '', - indexPattern: stubIndexPatternWithFields, - operatorType: OperatorTypeEnum.MATCH, - query: '', - selectedField: getField('bytes'), - }) - ); - - await waitFor(() => { - const expectedResult: UseFieldValueAutocompleteReturn = [false, false, [], result.current[3]]; - - expect(suggestionsMock).toHaveBeenCalled(); - expect(result.current).toEqual(expectedResult); - }); - }); - - test('returns suggestions', async () => { - const { signal } = new AbortController(); - const { result } = renderHook(() => - useFieldValueAutocomplete({ - autocompleteService: { - ...autocompleteStartMock, - getValueSuggestions: getValueSuggestionsMock, - }, - fieldValue: '', - indexPattern: stubIndexPatternWithFields, - operatorType: OperatorTypeEnum.MATCH, - query: '', - selectedField: getField('@tags'), - }) - ); - - await waitFor(() => { - const expectedResult: UseFieldValueAutocompleteReturn = [ - false, - true, - ['value 1', 'value 2'], - result.current[3], - ]; - - expect(getValueSuggestionsMock).toHaveBeenCalledWith({ - field: getField('@tags'), - indexPattern: stubIndexPatternWithFields, - query: '', - signal, - useTimeRange: false, - }); - expect(result.current).toEqual(expectedResult); - }); - }); - - test('returns new suggestions on subsequent calls', async () => { - const { result } = renderHook(() => - useFieldValueAutocomplete({ - autocompleteService: { - ...autocompleteStartMock, - getValueSuggestions: getValueSuggestionsMock, - }, - fieldValue: '', - indexPattern: stubIndexPatternWithFields, - operatorType: OperatorTypeEnum.MATCH, - query: '', - selectedField: getField('@tags'), - }) - ); - - await waitFor(() => expect(result.current[3]).not.toBeNull()); - - // Added check for typescripts sake, if null, - // would not reach below logic as test would stop above - if (result.current[3] != null) { - result.current[3]({ - fieldSelected: getField('@tags'), - patterns: stubIndexPatternWithFields, - searchQuery: '', - value: 'hello', - }); - } - - await waitFor(() => { - const expectedResult: UseFieldValueAutocompleteReturn = [ - false, - true, - ['value 1', 'value 2'], - result.current[3], - ]; - - expect(getValueSuggestionsMock).toHaveBeenCalledTimes(2); - expect(result.current).toEqual(expectedResult); - }); - }); -}); diff --git a/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.ts b/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.ts deleted file mode 100644 index 9fff2abfd5be5..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.ts +++ /dev/null @@ -1,123 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { useEffect, useRef, useState } from 'react'; -import { debounce } from 'lodash'; -import { ListOperatorTypeEnum as OperatorTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; -import { DataViewBase, DataViewFieldBase, getDataViewFieldSubtypeNested } from '@kbn/es-query'; - -// TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715 -// import { AutocompleteStart } from '../../../../../../../../src/plugins/unified_search/public'; -type AutocompleteStart = any; - -interface FuncArgs { - fieldSelected: DataViewFieldBase | undefined; - patterns: DataViewBase | undefined; - searchQuery: string; - value: string | string[] | undefined; -} - -type Func = (args: FuncArgs) => void; - -export type UseFieldValueAutocompleteReturn = [boolean, boolean, string[], Func | null]; - -export interface UseFieldValueAutocompleteProps { - autocompleteService: AutocompleteStart; - fieldValue: string | string[] | undefined; - indexPattern: DataViewBase | undefined; - operatorType: OperatorTypeEnum; - query: string; - selectedField: DataViewFieldBase | undefined; -} -/** - * Hook for using the field value autocomplete service - */ -export const useFieldValueAutocomplete = ({ - selectedField, - operatorType, - fieldValue, - query, - indexPattern, - autocompleteService, -}: UseFieldValueAutocompleteProps): UseFieldValueAutocompleteReturn => { - const [isLoading, setIsLoading] = useState(false); - const [isSuggestingValues, setIsSuggestingValues] = useState(true); - const [suggestions, setSuggestions] = useState<string[]>([]); - const updateSuggestions = useRef<Func | null>(null); - - useEffect(() => { - let isSubscribed = true; - const abortCtrl = new AbortController(); - - const fetchSuggestions = debounce( - async ({ fieldSelected, patterns, searchQuery }: FuncArgs) => { - try { - if (isSubscribed) { - if (fieldSelected == null || patterns == null) { - return; - } - - if (fieldSelected.type === 'boolean') { - setIsSuggestingValues(false); - return; - } - - setIsLoading(true); - const subTypeNested = getDataViewFieldSubtypeNested(fieldSelected); - const field = subTypeNested - ? { - ...fieldSelected, - name: `${subTypeNested.nested.path}.${fieldSelected.name}`, - } - : fieldSelected; - - const newSuggestions = await autocompleteService.getValueSuggestions({ - field, - indexPattern: patterns, - query: searchQuery, - signal: abortCtrl.signal, - useTimeRange: false, - }); - - if (newSuggestions.length === 0) { - setIsSuggestingValues(false); - } - - setIsLoading(false); - setSuggestions([...newSuggestions]); - } - } catch (error) { - if (isSubscribed) { - setSuggestions([]); - setIsLoading(false); - } - } - }, - 500 - ); - - if (operatorType !== OperatorTypeEnum.EXISTS) { - fetchSuggestions({ - fieldSelected: selectedField, - patterns: indexPattern, - searchQuery: query, - value: fieldValue, - }); - } - - updateSuggestions.current = fetchSuggestions; - - return (): void => { - isSubscribed = false; - abortCtrl.abort(); - }; - }, [selectedField, operatorType, fieldValue, indexPattern, query, autocompleteService]); - - return [isLoading, isSuggestingValues, suggestions, updateSuggestions.current]; -}; diff --git a/packages/kbn-securitysolution-autocomplete/src/list_schema/index.mock.ts b/packages/kbn-securitysolution-autocomplete/src/list_schema/index.mock.ts deleted file mode 100644 index e2c2c9b0fe051..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/list_schema/index.mock.ts +++ /dev/null @@ -1,62 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { - FoundListSchema, - ListSchema, - FoundListsBySizeSchema, -} from '@kbn/securitysolution-io-ts-list-types'; - -// TODO: Once this mock is available within packages, use it instead, https://github.com/elastic/kibana/issues/100715 -// import { getFoundListSchemaMock } from '../../../../../lists/common/schemas/response/found_list_schema.mock'; -export const getFoundListSchemaMock = (): FoundListSchema => ({ - cursor: '123', - data: [getListResponseMock()], - page: 1, - per_page: 1, - total: 1, -}); - -export const getFoundListsBySizeSchemaMock = (): FoundListsBySizeSchema => ({ - smallLists: [getListResponseMock()], - largeLists: [getListResponseMock()], -}); - -// TODO: Once these mocks are available from packages use it instead, https://github.com/elastic/kibana/issues/100715 -export const DATE_NOW = '2020-04-20T15:25:31.830Z'; -export const USER = 'some user'; -export const IMMUTABLE = false; -export const VERSION = 1; -export const DESCRIPTION = 'some description'; -export const TIE_BREAKER = '6a76b69d-80df-4ab2-8c3e-85f466b06a0e'; -export const LIST_ID = 'some-list-id'; -export const META = {}; -export const TYPE = 'ip'; -export const NAME = 'some name'; - -// TODO: Once this mock is available within packages, use it instead, https://github.com/elastic/kibana/issues/100715 -// import { getListResponseMock } from '../../../../../lists/common/schemas/response/list_schema.mock'; -export const getListResponseMock = (): ListSchema => ({ - '@timestamp': DATE_NOW, - _version: undefined, - created_at: DATE_NOW, - created_by: USER, - description: DESCRIPTION, - deserializer: undefined, - id: LIST_ID, - immutable: IMMUTABLE, - meta: META, - name: NAME, - serializer: undefined, - tie_breaker_id: TIE_BREAKER, - type: TYPE, - updated_at: DATE_NOW, - updated_by: USER, - version: VERSION, -}); diff --git a/packages/kbn-securitysolution-autocomplete/src/operator/index.test.tsx b/packages/kbn-securitysolution-autocomplete/src/operator/index.test.tsx deleted file mode 100644 index 4d2112d8f31d1..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/operator/index.test.tsx +++ /dev/null @@ -1,255 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { mount } from 'enzyme'; -import { EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui'; -import { isNotOperator, isOperator } from '@kbn/securitysolution-list-utils'; - -import { OperatorComponent } from '.'; -import { getField } from '../fields/index.mock'; - -describe('operator', () => { - test('it renders disabled if "isDisabled" is true', () => { - const wrapper = mount( - <OperatorComponent - isClearable={false} - isDisabled={true} - isLoading={false} - onChange={jest.fn()} - operator={isOperator} - placeholder="Placeholder text" - selectedField={getField('machine.os.raw')} - /> - ); - - expect( - wrapper.find(`[data-test-subj="operatorAutocompleteComboBox"] input`).prop('disabled') - ).toBeTruthy(); - }); - - test('it renders loading if "isLoading" is true', () => { - const wrapper = mount( - <OperatorComponent - isClearable={false} - isDisabled={false} - isLoading={true} - onChange={jest.fn()} - operator={isOperator} - placeholder="Placeholder text" - selectedField={getField('machine.os.raw')} - /> - ); - wrapper.find(`[data-test-subj="operatorAutocompleteComboBox"] button`).at(0).simulate('click'); - expect( - wrapper - .find(`EuiComboBoxOptionsList[data-test-subj="operatorAutocompleteComboBox-optionsList"]`) - .prop('isLoading') - ).toBeTruthy(); - }); - - test('it allows user to clear values if "isClearable" is true', () => { - const wrapper = mount( - <OperatorComponent - isClearable={true} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - operator={isOperator} - placeholder="Placeholder text" - selectedField={getField('machine.os.raw')} - /> - ); - - expect(wrapper.find(`button[data-test-subj="comboBoxClearButton"]`).exists()).toBeTruthy(); - }); - - test('it displays "operatorOptions" if param is passed in with items', () => { - const wrapper = mount( - <OperatorComponent - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - operator={isOperator} - operatorOptions={[isNotOperator]} - placeholder="Placeholder text" - selectedField={getField('machine.os.raw')} - /> - ); - - expect( - wrapper.find(`[data-test-subj="operatorAutocompleteComboBox"]`).at(0).prop('options') - ).toEqual([{ label: 'is not' }]); - }); - - test('it does not display "operatorOptions" if param is passed in with no items', () => { - const wrapper = mount( - <OperatorComponent - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - operator={isOperator} - operatorOptions={[]} - placeholder="Placeholder text" - selectedField={getField('machine.os.raw')} - /> - ); - - expect( - wrapper.find(`[data-test-subj="operatorAutocompleteComboBox"]`).at(0).prop('options') - ).toEqual([ - { - label: 'is', - }, - { - label: 'is not', - }, - { - label: 'is one of', - }, - { - label: 'is not one of', - }, - { - label: 'exists', - }, - { - label: 'does not exist', - }, - { - label: 'is in list', - }, - { - label: 'is not in list', - }, - { - label: 'matches', - }, - { - label: 'does not match', - }, - ]); - }); - - test('it correctly displays selected operator', () => { - const wrapper = mount( - <OperatorComponent - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - operator={isOperator} - placeholder="Placeholder text" - selectedField={getField('machine.os.raw')} - /> - ); - - expect( - wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').at(0).props().value - ).toEqual('is'); - }); - - test('it only displays subset of operators if field type is nested', () => { - const wrapper = mount( - <OperatorComponent - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - operator={isOperator} - placeholder="Placeholder text" - selectedField={{ - name: 'nestedField', - scripted: false, - subType: { nested: { path: 'nestedField' } }, - type: 'nested', - }} - /> - ); - - expect( - wrapper.find(`[data-test-subj="operatorAutocompleteComboBox"]`).at(0).prop('options') - ).toEqual([{ label: 'is' }]); - }); - - test('it only displays subset of operators if field type is boolean', () => { - const wrapper = mount( - <OperatorComponent - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - operator={isOperator} - placeholder="Placeholder text" - selectedField={getField('ssl')} - /> - ); - - expect( - wrapper.find(`[data-test-subj="operatorAutocompleteComboBox"]`).at(0).prop('options') - ).toEqual([ - { label: 'is' }, - { label: 'is not' }, - { label: 'exists' }, - { label: 'does not exist' }, - ]); - }); - - test('it only displays subset of operators if field name is "file.path.text"', () => { - const wrapper = mount( - <OperatorComponent - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={jest.fn()} - operator={isOperator} - placeholder="Placeholder text" - selectedField={getField('file.path.text')} - /> - ); - - expect( - wrapper.find(`[data-test-subj="operatorAutocompleteComboBox"]`).at(0).prop('options') - ).toEqual([ - { label: 'is' }, - { label: 'is not' }, - { label: 'is one of' }, - { label: 'is not one of' }, - { label: 'matches' }, - { label: 'does not match' }, - ]); - }); - - test('it invokes "onChange" when option selected', () => { - const mockOnChange = jest.fn(); - const wrapper = mount( - <OperatorComponent - isClearable={false} - isDisabled={false} - isLoading={false} - onChange={mockOnChange} - operator={isOperator} - placeholder="Placeholder text" - selectedField={getField('machine.os.raw')} - /> - ); - - ( - wrapper.find(EuiComboBox).props() as unknown as { - onChange: (a: EuiComboBoxOptionOption[]) => void; - } - ).onChange([{ label: 'is not' }]); - - expect(mockOnChange).toHaveBeenCalledWith([ - { message: 'is not', operator: 'excluded', type: 'match', value: 'is_not' }, - ]); - }); -}); diff --git a/packages/kbn-securitysolution-autocomplete/src/operator/index.tsx b/packages/kbn-securitysolution-autocomplete/src/operator/index.tsx deleted file mode 100644 index c3d91c16eae91..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/operator/index.tsx +++ /dev/null @@ -1,101 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { useCallback, useMemo } from 'react'; -import { EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui'; -import { OperatorOption } from '@kbn/securitysolution-list-utils'; -import { DataViewFieldBase } from '@kbn/es-query'; - -import { getOperators } from '../get_operators'; -import { - getGenericComboBoxProps, - GetGenericComboBoxPropsReturn, -} from '../get_generic_combo_box_props'; - -const AS_PLAIN_TEXT = { asPlainText: true }; - -interface OperatorState { - isClearable: boolean; - isDisabled: boolean; - isLoading: boolean; - onChange: (arg: OperatorOption[]) => void; - operator: OperatorOption; - operatorInputWidth?: number; - operatorOptions?: OperatorOption[]; - placeholder: string; - selectedField: DataViewFieldBase | undefined; - 'aria-label'?: string; -} - -export const OperatorComponent: React.FC<OperatorState> = ({ - isClearable = false, - isDisabled = false, - isLoading = false, - onChange, - operator, - operatorOptions, - operatorInputWidth = 150, - placeholder, - selectedField, - 'aria-label': ariaLabel, -}): JSX.Element => { - const getLabel = useCallback(({ message }: OperatorOption): string => message, []); - const optionsMemo = useMemo( - (): OperatorOption[] => - operatorOptions != null && operatorOptions.length > 0 - ? operatorOptions - : getOperators(selectedField), - [operatorOptions, selectedField] - ); - const selectedOptionsMemo = useMemo( - (): OperatorOption[] => (operator ? [operator] : []), - [operator] - ); - const { comboOptions, labels, selectedComboOptions } = useMemo( - (): GetGenericComboBoxPropsReturn => - getGenericComboBoxProps<OperatorOption>({ - getLabel, - options: optionsMemo, - selectedOptions: selectedOptionsMemo, - }), - [optionsMemo, selectedOptionsMemo, getLabel] - ); - - const handleValuesChange = useCallback( - (newOptions: EuiComboBoxOptionOption[]): void => { - const newValues: OperatorOption[] = newOptions.map( - ({ label }) => optionsMemo[labels.indexOf(label)] - ); - onChange(newValues); - }, - [labels, onChange, optionsMemo] - ); - - const inputWidth = useMemo(() => { - return { width: `${operatorInputWidth}px` }; - }, [operatorInputWidth]); - - return ( - <EuiComboBox - placeholder={placeholder} - options={comboOptions} - selectedOptions={selectedComboOptions} - onChange={handleValuesChange} - isLoading={isLoading} - isDisabled={isDisabled} - isClearable={isClearable} - singleSelection={AS_PLAIN_TEXT} - data-test-subj="operatorAutocompleteComboBox" - style={inputWidth} - aria-label={ariaLabel} - /> - ); -}; - -OperatorComponent.displayName = 'Operator'; diff --git a/packages/kbn-securitysolution-autocomplete/src/param_contains_space/index.test.ts b/packages/kbn-securitysolution-autocomplete/src/param_contains_space/index.test.ts deleted file mode 100644 index aef6fc4acffa2..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/param_contains_space/index.test.ts +++ /dev/null @@ -1,31 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { paramContainsSpace } from '.'; - -describe('param_contains_space', () => { - test('should return true if leading spaces were found', () => { - expect(paramContainsSpace(' test')).toBeTruthy(); - }); - test('should return true if trailing spaces were found', () => { - expect(paramContainsSpace('test ')).toBeTruthy(); - }); - test('should return true if both trailing and leading spaces were found', () => { - expect(paramContainsSpace(' test ')).toBeTruthy(); - }); - test('should return true if tabs was found', () => { - expect(paramContainsSpace('\ttest')).toBeTruthy(); - }); - test('should return false if no spaces were found', () => { - expect(paramContainsSpace('test test')).toBeFalsy(); - }); - test('should return false if param is falsy', () => { - expect(paramContainsSpace('')).toBeFalsy(); - }); -}); diff --git a/packages/kbn-securitysolution-autocomplete/src/param_contains_space/index.ts b/packages/kbn-securitysolution-autocomplete/src/param_contains_space/index.ts deleted file mode 100644 index 996167f20536f..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/param_contains_space/index.ts +++ /dev/null @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export const paramContainsSpace = (param: string) => param && param.trim().length !== param.length; diff --git a/packages/kbn-securitysolution-autocomplete/src/param_is_valid/index.test.ts b/packages/kbn-securitysolution-autocomplete/src/param_is_valid/index.test.ts deleted file mode 100644 index c530bca356cbf..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/param_is_valid/index.test.ts +++ /dev/null @@ -1,107 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { paramIsValid } from '.'; -import { getField } from '../fields/index.mock'; -import * as i18n from '../translations'; -import moment from 'moment'; - -describe('params_is_valid', () => { - beforeEach(() => { - // Disable momentJS deprecation warning and it looks like it is not typed either so - // we have to disable the type as well and cannot extend it easily. - ( - moment as unknown as { - suppressDeprecationWarnings: boolean; - } - ).suppressDeprecationWarnings = true; - }); - - afterEach(() => { - // Re-enable momentJS deprecation warning and it looks like it is not typed either so - // we have to disable the type as well and cannot extend it easily. - ( - moment as unknown as { - suppressDeprecationWarnings: boolean; - } - ).suppressDeprecationWarnings = false; - }); - - test('returns no errors if no field has been selected', () => { - const isValid = paramIsValid('', undefined, true, false); - - expect(isValid).toBeUndefined(); - }); - - test('returns error string if user has touched a required input and left empty', () => { - const isValid = paramIsValid(undefined, getField('@timestamp'), true, true); - - expect(isValid).toEqual(i18n.FIELD_REQUIRED_ERR); - }); - - test('returns no errors if required input is empty but user has not yet touched it', () => { - const isValid = paramIsValid(undefined, getField('@timestamp'), true, false); - - expect(isValid).toBeUndefined(); - }); - - test('returns no errors if user has touched an input that is not required and left empty', () => { - const isValid = paramIsValid(undefined, getField('@timestamp'), false, true); - - expect(isValid).toBeUndefined(); - }); - - test('returns no errors if user has touched an input that is not required and left empty string', () => { - const isValid = paramIsValid('', getField('@timestamp'), false, true); - - expect(isValid).toBeUndefined(); - }); - - test('returns no errors if field is of type date and value is valid', () => { - const isValid = paramIsValid('1994-11-05T08:15:30-05:00', getField('@timestamp'), false, true); - - expect(isValid).toBeUndefined(); - }); - - test('returns errors if filed is of type date and value is not valid', () => { - const isValid = paramIsValid('1593478826', getField('@timestamp'), false, true); - - expect(isValid).toEqual(i18n.DATE_ERR); - }); - - test('returns no errors if field is of type number and value is an integer', () => { - const isValid = paramIsValid('4', getField('bytes'), true, true); - - expect(isValid).toBeUndefined(); - }); - - test('returns no errors if field is of type number and value is a float', () => { - const isValid = paramIsValid('4.3', getField('bytes'), true, true); - - expect(isValid).toBeUndefined(); - }); - - test('returns no errors if field is of type number and value is a long', () => { - const isValid = paramIsValid('-9223372036854775808', getField('bytes'), true, true); - - expect(isValid).toBeUndefined(); - }); - - test('returns errors if field is of type number and value is "hello"', () => { - const isValid = paramIsValid('hello', getField('bytes'), true, true); - - expect(isValid).toEqual(i18n.NUMBER_ERR); - }); - - test('returns errors if field is of type number and value is "123abc"', () => { - const isValid = paramIsValid('123abc', getField('bytes'), true, true); - - expect(isValid).toEqual(i18n.NUMBER_ERR); - }); -}); diff --git a/packages/kbn-securitysolution-autocomplete/src/param_is_valid/index.ts b/packages/kbn-securitysolution-autocomplete/src/param_is_valid/index.ts deleted file mode 100644 index 5abde0b36c4c7..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/param_is_valid/index.ts +++ /dev/null @@ -1,50 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import dateMath from '@kbn/datemath'; -import { DataViewFieldBase } from '@kbn/es-query'; -import { checkEmptyValue } from '../check_empty_value'; - -import * as i18n from '../translations'; - -/** - * Very basic validation for values - * @param param the value being checked - * @param field the selected field - * @param isRequired whether or not an empty value is allowed - * @param touched has field been touched by user - * @returns undefined if valid, string with error message if invalid - */ -export const paramIsValid = ( - param: string | undefined, - field: DataViewFieldBase | undefined, - isRequired: boolean, - touched: boolean -): string | undefined => { - if (field == null) { - return undefined; - } - - const emptyValueError = checkEmptyValue(param, field, isRequired, touched); - if (emptyValueError !== null) { - return emptyValueError; - } - - switch (field.type) { - case 'date': - const moment = dateMath.parse(param ?? ''); - const isDate = Boolean(moment && moment.isValid()); - return isDate ? undefined : i18n.DATE_ERR; - case 'number': - const isNum = param != null && param.trim() !== '' && !isNaN(+param); - return isNum ? undefined : i18n.NUMBER_ERR; - default: - return undefined; - } -}; diff --git a/packages/kbn-securitysolution-autocomplete/src/translations/index.ts b/packages/kbn-securitysolution-autocomplete/src/translations/index.ts deleted file mode 100644 index 01671880d2dcb..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/translations/index.ts +++ /dev/null @@ -1,81 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { i18n } from '@kbn/i18n'; - -export const LOADING = i18n.translate('autocomplete.loadingDescription', { - defaultMessage: 'Loading...', -}); - -export const SELECT_FIELD_FIRST = i18n.translate('autocomplete.selectField', { - defaultMessage: 'Please select a field first...', -}); - -export const FIELD_REQUIRED_ERR = i18n.translate('autocomplete.fieldRequiredError', { - defaultMessage: 'Value cannot be empty', -}); - -export const NUMBER_ERR = i18n.translate('autocomplete.invalidNumberError', { - defaultMessage: 'Not a valid number', -}); - -export const DATE_ERR = i18n.translate('autocomplete.invalidDateError', { - defaultMessage: 'Not a valid date', -}); - -export const BINARY_TYPE_NOT_SUPPORTED = i18n.translate('autocomplete.invalidBinaryType', { - defaultMessage: 'Binary fields are currently unsupported', -}); -export const FIELD_SPACE_WARNING = i18n.translate('autocomplete.fieldSpaceWarning', { - defaultMessage: "Warning: Spaces at the start or end of this value aren't being displayed.", -}); - -export const LISTS_TOOLTIP_INFO = i18n.translate('autocomplete.listsTooltipWarning', { - defaultMessage: "Lists that aren't able to be processed by this rule type will be disabled.", -}); - -export const SEE_DOCUMENTATION = i18n.translate('autocomplete.seeDocumentation', { - defaultMessage: 'See Documentation', -}); - -export const FIELD_CONFLICT_INDICES_WARNING_TITLE = i18n.translate( - 'autocomplete.conflictIndicesWarning.title', - { - defaultMessage: 'Mapping Conflict', - } -); - -export const FIELD_CONFLICT_INDICES_WARNING_DESCRIPTION = i18n.translate( - 'autocomplete.conflictIndicesWarning.description', - { - defaultMessage: - 'This field is defined as different types across the following indices or is unmapped. This can cause unexpected query results.', - } -); - -export const CONFLICT_MULTIPLE_INDEX_DESCRIPTION = (name: string, count: number): string => - i18n.translate('autocomplete.conflictIndicesWarning.index.description', { - defaultMessage: '{name} ({count} indices)', - values: { count, name }, - }); - -export const SHOW_VALUE_LIST_MODAL = i18n.translate('autocomplete.showValueListModal', { - defaultMessage: 'Show value list', -}); - -// eslint-disable-next-line import/no-default-export -export default { - LOADING, - SELECT_FIELD_FIRST, - FIELD_REQUIRED_ERR, - NUMBER_ERR, - DATE_ERR, - FIELD_SPACE_WARNING, - BINARY_TYPE_NOT_SUPPORTED, -}; diff --git a/packages/kbn-securitysolution-autocomplete/src/type_match/index.test.ts b/packages/kbn-securitysolution-autocomplete/src/type_match/index.test.ts deleted file mode 100644 index 15c7c3f580da6..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/type_match/index.test.ts +++ /dev/null @@ -1,60 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { typeMatch } from '.'; - -describe('type_match', () => { - test('ip -> ip is true', () => { - expect(typeMatch('ip', 'ip')).toEqual(true); - }); - - test('keyword -> keyword is true', () => { - expect(typeMatch('keyword', 'keyword')).toEqual(true); - }); - - test('text -> text is true', () => { - expect(typeMatch('text', 'text')).toEqual(true); - }); - - test('ip_range -> ip is true', () => { - expect(typeMatch('ip_range', 'ip')).toEqual(true); - }); - - test('date_range -> date is true', () => { - expect(typeMatch('date_range', 'date')).toEqual(true); - }); - - test('double_range -> double is true', () => { - expect(typeMatch('double_range', 'double')).toEqual(true); - }); - - test('float_range -> float is true', () => { - expect(typeMatch('float_range', 'float')).toEqual(true); - }); - - test('integer_range -> integer is true', () => { - expect(typeMatch('integer_range', 'integer')).toEqual(true); - }); - - test('long_range -> long is true', () => { - expect(typeMatch('long_range', 'long')).toEqual(true); - }); - - test('ip -> date is false', () => { - expect(typeMatch('ip', 'date')).toEqual(false); - }); - - test('long -> float is false', () => { - expect(typeMatch('long', 'float')).toEqual(false); - }); - - test('integer -> long is false', () => { - expect(typeMatch('integer', 'long')).toEqual(false); - }); -}); diff --git a/packages/kbn-securitysolution-autocomplete/src/type_match/index.ts b/packages/kbn-securitysolution-autocomplete/src/type_match/index.ts deleted file mode 100644 index 4d5899a376a08..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/src/type_match/index.ts +++ /dev/null @@ -1,28 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { Type } from '@kbn/securitysolution-io-ts-list-types'; - -/** - * Given an input list type and a string based ES type this will match - * if they're exact or if they are compatible with a range - * @param type The type to match against the esType - * @param esType The ES type to match with - */ -export const typeMatch = (type: Type, esType: string): boolean => { - return ( - type === esType || - (type === 'ip_range' && esType === 'ip') || - (type === 'date_range' && esType === 'date') || - (type === 'double_range' && esType === 'double') || - (type === 'float_range' && esType === 'float') || - (type === 'integer_range' && esType === 'integer') || - (type === 'long_range' && esType === 'long') - ); -}; diff --git a/packages/kbn-securitysolution-autocomplete/tsconfig.json b/packages/kbn-securitysolution-autocomplete/tsconfig.json deleted file mode 100644 index f7df7da6f06ad..0000000000000 --- a/packages/kbn-securitysolution-autocomplete/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": ["jest", "node"] - }, - "include": [ - "**/*.ts", - "**/*.tsx", - ], - "kbn_references": [ - "@kbn/datemath", - "@kbn/es-query", - "@kbn/i18n", - "@kbn/securitysolution-io-ts-list-types", - "@kbn/securitysolution-list-hooks", - "@kbn/securitysolution-list-utils", - "@kbn/doc-links", - "@kbn/securitysolution-utils", - ], - "exclude": [ - "target/**/*", - ], -} diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.gen.ts b/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.gen.ts deleted file mode 100644 index 42a3b67106c02..0000000000000 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.gen.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* - * NOTICE: Do not edit this file manually. - * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. - * - * info: - * title: Create endpoint list API endpoint - * version: 2023-10-31 - */ - -import { z } from '@kbn/zod'; - -import { EndpointList } from '../model/endpoint_list_common.gen'; - -export type CreateEndpointListResponse = z.infer<typeof CreateEndpointListResponse>; -export const CreateEndpointListResponse = EndpointList; diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.schema.yaml b/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.schema.yaml deleted file mode 100644 index b2ca0f563617d..0000000000000 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.schema.yaml +++ /dev/null @@ -1,45 +0,0 @@ -openapi: 3.0.0 -info: - title: Create endpoint list API endpoint - version: '2023-10-31' -paths: - /api/endpoint_list: - post: - x-labels: [serverless, ess] - x-codegen-enabled: true - operationId: CreateEndpointList - summary: Create an endpoint exception list - description: Create an endpoint exception list, which groups endpoint exception list items. If an endpoint exception list already exists, an empty response is returned. - responses: - 200: - description: Successful response - content: - application/json: - schema: - $ref: '../model/endpoint_list_common.schema.yaml#/components/schemas/EndpointList' - 400: - description: Invalid input data - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Insufficient privileges - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 500: - description: Internal server error - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.schema.yaml b/packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.schema.yaml deleted file mode 100644 index 69db506169187..0000000000000 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.schema.yaml +++ /dev/null @@ -1,64 +0,0 @@ -openapi: 3.0.0 -info: - title: Delete endpoint list item API endpoint - version: '2023-10-31' -paths: - /api/endpoint_list/items: - delete: - x-labels: [serverless, ess] - x-codegen-enabled: true - operationId: DeleteEndpointListItem - summary: Delete an endpoint exception list item - description: Delete an endpoint exception list item using the `id` or `item_id` field. - parameters: - - name: id - in: query - required: false - description: Either `id` or `item_id` must be specified - schema: - $ref: '../../../kbn-securitysolution-exceptions-common/api/model/exception_list_common.schema.yaml#/components/schemas/ExceptionListItemId' - - name: item_id - in: query - required: false - description: Either `id` or `item_id` must be specified - schema: - $ref: '../../../kbn-securitysolution-exceptions-common/api/model/exception_list_common.schema.yaml#/components/schemas/ExceptionListItemHumanId' - responses: - 200: - description: Successful response - content: - application/json: - schema: - $ref: '../model/endpoint_list_common.schema.yaml#/components/schemas/EndpointListItem' - 400: - description: Invalid input data - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Insufficient privileges - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 404: - description: Endpoint list item not found - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.schema.yaml b/packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.schema.yaml deleted file mode 100644 index 6dc2fcaa7e87a..0000000000000 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.schema.yaml +++ /dev/null @@ -1,113 +0,0 @@ -openapi: 3.0.0 -info: - title: Find endpoint list items API endpoint - version: '2023-10-31' -paths: - /api/endpoint_list/items/_find: - get: - x-labels: [serverless, ess] - x-codegen-enabled: true - operationId: FindEndpointListItems - summary: Get endpoint exception list items - description: Get a list of all endpoint exception list items. - parameters: - - name: filter - in: query - required: false - description: | - Filters the returned results according to the value of the specified field, - using the `<field name>:<field value>` syntax. - schema: - $ref: '#/components/schemas/FindEndpointListItemsFilter' - - name: page - in: query - required: false - description: The page number to return - schema: - type: integer - minimum: 0 - - name: per_page - in: query - required: false - description: The number of exception list items to return per page - schema: - type: integer - minimum: 0 - - name: sort_field - in: query - required: false - description: Determines which field is used to sort the results - schema: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - - name: sort_order - in: query - required: false - description: Determines the sort order, which can be `desc` or `asc` - schema: - type: string - enum: [desc, asc] - responses: - 200: - description: Successful response - content: - application/json: - schema: - type: object - properties: - data: - type: array - items: - $ref: '../model/endpoint_list_common.schema.yaml#/components/schemas/EndpointListItem' - page: - type: integer - minimum: 0 - per_page: - type: integer - minimum: 0 - total: - type: integer - minimum: 0 - pit: - type: string - required: - - data - - page - - per_page - - total - 400: - description: Invalid input data - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Insufficient privileges - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 404: - description: Endpoint list not found - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - -components: - schemas: - FindEndpointListItemsFilter: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/index.ts b/packages/kbn-securitysolution-endpoint-exceptions-common/api/index.ts deleted file mode 100644 index c71b02c448db8..0000000000000 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './create_endpoint_list/create_endpoint_list.gen'; -export * from './create_endpoint_list_item/create_endpoint_list_item.gen'; -export * from './read_endpoint_list_item/read_endpoint_list_item.gen'; -export * from './update_endpoint_list_item/update_endpoint_list_item.gen'; -export * from './delete_endpoint_list_item/delete_endpoint_list_item.gen'; -export * from './find_endpoint_list_item/find_endpoint_list_item.gen'; diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/model/endpoint_list_common.gen.ts b/packages/kbn-securitysolution-endpoint-exceptions-common/api/model/endpoint_list_common.gen.ts deleted file mode 100644 index 6c8093246b1a6..0000000000000 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/model/endpoint_list_common.gen.ts +++ /dev/null @@ -1,30 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* - * NOTICE: Do not edit this file manually. - * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. - * - * info: - * title: Common Exception List Attributes - * version: not applicable - */ - -import { z } from '@kbn/zod'; - -import { - ExceptionList, - ExceptionListItem, -} from '@kbn/securitysolution-exceptions-common/api/model/exception_list_common.gen'; - -export type EndpointList = z.infer<typeof EndpointList>; -export const EndpointList = z.union([ExceptionList, z.object({}).strict()]); - -export type EndpointListItem = z.infer<typeof EndpointListItem>; -export const EndpointListItem = ExceptionListItem; diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.schema.yaml b/packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.schema.yaml deleted file mode 100644 index 8a4e0b291c76f..0000000000000 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.schema.yaml +++ /dev/null @@ -1,66 +0,0 @@ -openapi: 3.0.0 -info: - title: Read endpoint list item API endpoint - version: '2023-10-31' -paths: - /api/endpoint_list/items: - get: - x-labels: [serverless, ess] - x-codegen-enabled: true - operationId: ReadEndpointListItem - summary: Get an endpoint exception list item - description: Get the details of an endpoint exception list item using the `id` or `item_id` field. - parameters: - - name: id - in: query - required: false - description: Either `id` or `item_id` must be specified - schema: - $ref: '../../../kbn-securitysolution-exceptions-common/api/model/exception_list_common.schema.yaml#/components/schemas/ExceptionListItemId' - - name: item_id - in: query - required: false - description: Either `id` or `item_id` must be specified - schema: - $ref: '../../../kbn-securitysolution-exceptions-common/api/model/exception_list_common.schema.yaml#/components/schemas/ExceptionListItemHumanId' - responses: - 200: - description: Successful response - content: - application/json: - schema: - type: array - items: - $ref: '../model/endpoint_list_common.schema.yaml#/components/schemas/EndpointListItem' - 400: - description: Invalid input data - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Insufficient privileges - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 404: - description: Endpoint list item not found - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/package.json b/packages/kbn-securitysolution-endpoint-exceptions-common/package.json deleted file mode 100644 index 78470be1d4e4f..0000000000000 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "description": "OpenAPI Endpoint Exceptions Common", - "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0", - "name": "@kbn/securitysolution-endpoint-exceptions-common", - "private": true, - "version": "1.0.0", - "scripts": { - "openapi:generate": "node scripts/openapi_generate", - "openapi:bundle": "node scripts/openapi_bundle" - } -} diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/scripts/openapi_bundle.js b/packages/kbn-securitysolution-endpoint-exceptions-common/scripts/openapi_bundle.js deleted file mode 100644 index e5a02965593c3..0000000000000 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/scripts/openapi_bundle.js +++ /dev/null @@ -1,66 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -require('../../../src/setup_node_env'); -const { join, resolve } = require('path'); -const { bundle } = require('@kbn/openapi-bundler'); - -const ROOT = resolve(__dirname, '..'); - -(async () => { - await bundle({ - sourceGlob: join(ROOT, 'api/**/*.schema.yaml'), - outputFilePath: join( - ROOT, - 'docs/openapi/serverless/security_solution_endpoint_exceptions_api_{version}.bundled.schema.yaml' - ), - options: { - includeLabels: ['serverless'], - prototypeDocument: { - info: { - title: 'Security Endpoint Exceptions API (Elastic Cloud Serverless)', - description: 'Endpoint Exceptions API allow you to manage Endpoint lists.', - }, - tags: [ - { - name: 'Security Endpoint Exceptions API', - 'x-displayName': 'Security endpoint exceptions', - description: - "Endpoint Exceptions API allows you to manage detection rule endpoint exceptions to prevent a rule from generating an alert from incoming events even when the rule's other criteria are met.", - }, - ], - }, - }, - }); - - await bundle({ - sourceGlob: join(ROOT, 'api/**/*.schema.yaml'), - outputFilePath: join( - ROOT, - 'docs/openapi/ess/security_solution_endpoint_exceptions_api_{version}.bundled.schema.yaml' - ), - options: { - includeLabels: ['ess'], - prototypeDocument: { - info: { - title: 'Security Endpoint Exceptions API (Elastic Cloud and self-hosted)', - description: 'Endpoint Exceptions API allow you to manage Endpoint lists.', - }, - tags: [ - { - name: 'Security Endpoint Exceptions API', - 'x-displayName': 'Security endpoint exceptions', - description: - "Endpoint Exceptions API allows you to manage detection rule endpoint exceptions to prevent a rule from generating an alert from incoming events even when the rule's other criteria are met.", - }, - ], - }, - }, - }); -})(); diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/scripts/openapi_generate.js b/packages/kbn-securitysolution-endpoint-exceptions-common/scripts/openapi_generate.js deleted file mode 100644 index bca85786a518f..0000000000000 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/scripts/openapi_generate.js +++ /dev/null @@ -1,38 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -require('../../../src/setup_node_env'); -const { join, resolve } = require('path'); -const { generate } = require('@kbn/openapi-generator'); -const { REPO_ROOT } = require('@kbn/repo-info'); - -const ROOT = resolve(__dirname, '..'); - -(async () => { - await generate({ - title: 'OpenAPI Endpoint Exceptions API Schemas', - rootDir: ROOT, - sourceGlob: './api/**/*.schema.yaml', - templateName: 'zod_operation_schema', - }); - - await generate({ - title: 'Endpoint Exceptions API client for tests', - rootDir: ROOT, - sourceGlob: './api/**/*.schema.yaml', - templateName: 'api_client_supertest', - skipLinting: true, - bundle: { - outFile: join( - REPO_ROOT, - 'x-pack/test/api_integration/services/security_solution_endpoint_exceptions_api.gen.ts' - ), - }, - }); -})(); diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/tsconfig.json b/packages/kbn-securitysolution-endpoint-exceptions-common/tsconfig.json deleted file mode 100644 index 7e3c3fd7396dc..0000000000000 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "compilerOptions": { - "outDir": "target/types", - "types": ["jest", "node"] - }, - "exclude": ["target/**/*"], - "extends": "../../tsconfig.base.json", - "include": ["**/*.ts"], - "kbn_references": [ - "@kbn/securitysolution-exceptions-common", - "@kbn/openapi-common", - "@kbn/zod", - ] -} diff --git a/packages/kbn-securitysolution-es-utils/jest.config.js b/packages/kbn-securitysolution-es-utils/jest.config.js deleted file mode 100644 index 5d52b2d390b57..0000000000000 --- a/packages/kbn-securitysolution-es-utils/jest.config.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../..', - roots: ['<rootDir>/packages/kbn-securitysolution-es-utils'], -}; diff --git a/packages/kbn-securitysolution-es-utils/tsconfig.json b/packages/kbn-securitysolution-es-utils/tsconfig.json deleted file mode 100644 index e584d504cc9c0..0000000000000 --- a/packages/kbn-securitysolution-es-utils/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts" - ], - "exclude": [ - "target/**/*", - ], - "kbn_references": [ - "@kbn/zod-helpers", - "@kbn/zod", - ] -} diff --git a/packages/kbn-securitysolution-exception-list-components/index.ts b/packages/kbn-securitysolution-exception-list-components/index.ts deleted file mode 100644 index 0e11a4694384d..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './src/search_bar'; -export * from './src/empty_viewer_state'; -export * from './src/pagination/pagination'; -// export * from './src/exceptions_utility/exceptions_utility'; -export * from './src/exception_items'; -export * from './src/exception_item_card'; -export * from './src/value_with_space_warning'; -export * from './src/types'; -export * from './src/list_header'; -export * from './src/header_menu'; -export * from './src/generate_linked_rules_menu_item'; -export * from './src/wildcard_with_wrong_operator_callout'; -export * from './src/partial_code_signature_callout'; diff --git a/packages/kbn-securitysolution-exception-list-components/jest.config.js b/packages/kbn-securitysolution-exception-list-components/jest.config.js deleted file mode 100644 index e9d4ad8ad8487..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/jest.config.js +++ /dev/null @@ -1,29 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../..', - roots: ['<rootDir>/packages/kbn-securitysolution-exception-list-components'], - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/packages/kbn-securitysolution-exception-list-components/**/*.{ts,tsx}', - '!<rootDir>/packages/kbn-securitysolution-exception-list-components/**/*.test', - '!<rootDir>/packages/kbn-securitysolution-exception-list-components/**/types/*', - '!<rootDir>/packages/kbn-securitysolution-exception-list-components/**/*.type', - '!<rootDir>/packages/kbn-securitysolution-exception-list-components/**/*.styles', - '!<rootDir>/packages/kbn-securitysolution-exception-list-components/**/mocks/*', - '!<rootDir>/packages/kbn-securitysolution-exception-list-components/**/*.config', - '!<rootDir>/packages/kbn-securitysolution-exception-list-components/**/translations', - '!<rootDir>/packages/kbn-securitysolution-exception-list-components/**/types/*', - ], - setupFilesAfterEnv: [ - '<rootDir>/packages/kbn-securitysolution-exception-list-components/setup_test.ts', - ], -}; diff --git a/packages/kbn-securitysolution-exception-list-components/package.json b/packages/kbn-securitysolution-exception-list-components/package.json deleted file mode 100644 index 0b99a01c071e8..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@kbn/securitysolution-exception-list-components", - "private": true, - "version": "1.0.0", - "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0", - "sideEffects": false -} \ No newline at end of file diff --git a/packages/kbn-securitysolution-exception-list-components/setup_test.ts b/packages/kbn-securitysolution-exception-list-components/setup_test.ts deleted file mode 100644 index 5ebc6d3dac1ca..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/setup_test.ts +++ /dev/null @@ -1,11 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -// eslint-disable-next-line import/no-extraneous-dependencies -import '@testing-library/jest-dom'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/custom.d.ts b/packages/kbn-securitysolution-exception-list-components/src/custom.d.ts deleted file mode 100644 index aa99593b9e877..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/custom.d.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -declare module '*.svg' { - const content: string; - // eslint-disable-next-line import/no-default-export - export default content; -} diff --git a/packages/kbn-securitysolution-exception-list-components/src/empty_viewer_state/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/empty_viewer_state/index.tsx deleted file mode 100644 index e9996e814c34a..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/empty_viewer_state/index.tsx +++ /dev/null @@ -1,135 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { useMemo } from 'react'; -import type { FC } from 'react'; -import { css } from '@emotion/react'; -import { - EuiSkeletonText, - EuiImage, - EuiEmptyPrompt, - EuiButton, - useEuiTheme, - EuiPanel, -} from '@elastic/eui'; -import type { ExpressionColor } from '@elastic/eui/src/components/expression/expression'; -import type { EuiFacetGroupLayout } from '@elastic/eui/src/components/facet/facet_group'; -import { euiThemeVars } from '@kbn/ui-theme'; -import { ListTypeText, ViewerStatus } from '../types'; -import * as i18n from '../translations'; -import illustration from '../assets/images/illustration_product_no_results_magnifying_glass.svg'; - -interface EmptyViewerStateProps { - title?: string; - body?: string; - buttonText?: string; - listType?: ListTypeText; - isReadOnly: boolean; - viewerStatus: ViewerStatus; - onEmptyButtonStateClick?: () => void | null; -} - -const panelCss = css` - margin: ${euiThemeVars.euiSizeL} 0; - padding: ${euiThemeVars.euiSizeL} 0; -`; -const EmptyViewerStateComponent: FC<EmptyViewerStateProps> = ({ - title, - body, - buttonText, - listType, - isReadOnly, - viewerStatus, - onEmptyButtonStateClick, -}) => { - const { euiTheme } = useEuiTheme(); - - const euiEmptyPromptProps = useMemo(() => { - switch (viewerStatus) { - case ViewerStatus.ERROR: { - return { - color: 'danger' as ExpressionColor, - iconType: 'error', - title: ( - <h2 data-test-subj="errorTitle">{title || i18n.EMPTY_VIEWER_STATE_ERROR_TITLE}</h2> - ), - body: <p data-test-subj="errorBody">{body || i18n.EMPTY_VIEWER_STATE_ERROR_BODY}</p>, - 'data-test-subj': 'errorViewerState', - }; - } - case ViewerStatus.EMPTY: - return { - color: 'subdued' as ExpressionColor, - iconType: 'plusInCircle', - iconColor: euiTheme.colors.darkestShade, - title: ( - <h2 data-test-subj="emptyTitle">{title || i18n.EMPTY_VIEWER_STATE_EMPTY_TITLE}</h2> - ), - body: <p data-test-subj="emptyBody">{body || i18n.EMPTY_VIEWER_STATE_EMPTY_BODY}</p>, - 'data-test-subj': 'emptyViewerState', - actions: [ - <EuiButton - data-test-subj="emptyStateButton" - onClick={onEmptyButtonStateClick} - iconType="plusInCircle" - color="primary" - isDisabled={isReadOnly} - fill - > - {buttonText || i18n.EMPTY_VIEWER_STATE_EMPTY_VIEWER_BUTTON(listType || 'rule')} - </EuiButton>, - ], - }; - case ViewerStatus.EMPTY_SEARCH: - return { - color: 'plain' as ExpressionColor, - layout: 'horizontal' as EuiFacetGroupLayout, - hasBorder: true, - hasShadow: false, - icon: <EuiImage size="fullWidth" alt="" src={illustration} />, - title: ( - <h3 data-test-subj="emptySearchTitle"> - {title || i18n.EMPTY_VIEWER_STATE_EMPTY_SEARCH_TITLE} - </h3> - ), - body: ( - <p data-test-subj="emptySearchBody"> - {body || i18n.EMPTY_VIEWER_STATE_EMPTY_SEARCH_BODY} - </p> - ), - 'data-test-subj': 'emptySearchViewerState', - }; - } - }, [ - viewerStatus, - euiTheme.colors.darkestShade, - title, - body, - onEmptyButtonStateClick, - isReadOnly, - buttonText, - listType, - ]); - - return ( - <EuiSkeletonText - lines={4} - data-test-subj="loadingViewerState" - isLoading={viewerStatus === ViewerStatus.LOADING || viewerStatus === ViewerStatus.SEARCHING} - > - <EuiPanel css={panelCss} color={viewerStatus === 'empty_search' ? 'subdued' : 'transparent'}> - <EuiEmptyPrompt {...euiEmptyPromptProps} /> - </EuiPanel> - </EuiSkeletonText> - ); -}; - -export const EmptyViewerState = React.memo(EmptyViewerStateComponent); - -EmptyViewerState.displayName = 'EmptyViewerState'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/index.tsx deleted file mode 100644 index d2e5ac0577af3..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/index.tsx +++ /dev/null @@ -1,50 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { memo } from 'react'; -import type { EuiCommentProps } from '@elastic/eui'; -import { EuiAccordion, EuiCommentList, EuiFlexItem, EuiPanel, EuiText } from '@elastic/eui'; -import { css } from '@emotion/react'; -import { euiThemeVars } from '@kbn/ui-theme'; -import * as i18n from '../translations'; - -const accordionCss = css` - color: ${euiThemeVars.euiColorPrimary}; -`; - -export interface ExceptionItemCardCommentsProps { - comments: EuiCommentProps[]; - dataTestSubj?: string; -} - -export const ExceptionItemCardComments = memo<ExceptionItemCardCommentsProps>( - ({ comments, dataTestSubj }) => { - if (!comments.length) return null; - return ( - <EuiFlexItem data-test-subj={dataTestSubj}> - <EuiAccordion - id="exceptionItemCardComments" - buttonContent={ - <EuiText size="s" css={accordionCss} data-test-subj={`${dataTestSubj || ''}TextButton`}> - {i18n.exceptionItemCardCommentsAccordion(comments.length)} - </EuiText> - } - arrowDisplay="none" - data-test-subj="exceptionItemCardComments" - > - <EuiPanel data-test-subj="accordionContentPanel" hasBorder hasShadow paddingSize="m"> - <EuiCommentList data-test-subj="accordionCommentList" comments={comments} /> - </EuiPanel> - </EuiAccordion> - </EuiFlexItem> - ); - } -); - -ExceptionItemCardComments.displayName = 'ExceptionItemCardComments'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/conditions.styles.tsx b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/conditions.styles.tsx deleted file mode 100644 index 8a089df54f2f6..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/conditions.styles.tsx +++ /dev/null @@ -1,38 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { cx } from '@emotion/css'; -import { css } from '@emotion/react'; -import { euiThemeVars } from '@kbn/ui-theme'; - -// TODO check font Roboto Mono -export const nestedGroupSpaceCss = css` - margin-left: ${euiThemeVars.euiSizeXL}; - margin-bottom: ${euiThemeVars.euiSizeXS}; - padding-top: ${euiThemeVars.euiSizeXS}; -`; - -export const borderCss = cx( - 'eui-xScroll', - ` - border: 1px; - border-color: #d3dae6; - border-style: solid; -` -); - -export const valueContainerCss = css` - display: flex; - align-items: center; - margin-left: ${euiThemeVars.euiSizeS}; -`; -export const expressionContainerCss = css` - display: flex; - align-items: center; -`; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/index.tsx deleted file mode 100644 index b765439116ced..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/index.tsx +++ /dev/null @@ -1,83 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { ElementType, FC, memo } from 'react'; -import { EuiExpression, EuiToken, EuiFlexGroup } from '@elastic/eui'; -import { ListOperatorTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; -import { - nestedGroupSpaceCss, - valueContainerCss, - expressionContainerCss, -} from '../conditions.styles'; -import type { Entry } from '../types'; -import * as i18n from '../../translations'; -import { getValue, getValueExpression } from './entry_content.helper'; - -interface EntryContentProps { - entry: Entry; - index: number; - isNestedEntry?: boolean; - dataTestSubj?: string; - showValueListModal: ElementType; -} - -export const EntryContent: FC<EntryContentProps> = memo( - ({ entry, index, isNestedEntry = false, dataTestSubj, showValueListModal }) => { - const { field, type } = entry; - const value = getValue(entry); - const operator = 'operator' in entry ? entry.operator : ''; - - const entryKey = `${field}${type}${value}${index}`; - return ( - <div data-test-subj={`${dataTestSubj || ''}${entryKey}EntryContent`} key={entryKey}> - <div css={expressionContainerCss}> - {isNestedEntry ? ( - <EuiFlexGroup - responsive - css={nestedGroupSpaceCss} - direction="row" - alignItems="center" - gutterSize="m" - data-test-subj={`${dataTestSubj || ''}NestedEntry`} - > - <EuiToken data-test-subj="nstedEntryIcon" iconType="tokenNested" size="s" /> - - <div css={valueContainerCss}> - <EuiExpression description="" value={field} color="subdued" /> - {getValueExpression( - type as ListOperatorTypeEnum, - operator, - value, - showValueListModal - )} - </div> - </EuiFlexGroup> - ) : ( - <> - <EuiExpression - description={index === 0 ? '' : i18n.CONDITION_AND} - value={field} - color={index === 0 ? 'primary' : 'subdued'} - data-test-subj={`${dataTestSubj || ''}SingleEntry`} - /> - - {getValueExpression( - type as ListOperatorTypeEnum, - operator, - value, - showValueListModal - )} - </> - )} - </div> - </div> - ); - } -); -EntryContent.displayName = 'EntryContent'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/index.tsx deleted file mode 100644 index f472402adddc4..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/index.tsx +++ /dev/null @@ -1,59 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { memo } from 'react'; -import { EuiPanel } from '@elastic/eui'; - -import { borderCss } from './conditions.styles'; -import { EntryContent } from './entry_content'; -import { OsCondition } from './os_conditions'; -import type { CriteriaConditionsProps, Entry } from './types'; - -export const ExceptionItemCardConditions = memo<CriteriaConditionsProps>( - ({ os, entries, dataTestSubj, showValueListModal }) => { - return ( - <EuiPanel - color="subdued" - hasBorder={true} - hasShadow={false} - data-test-subj={dataTestSubj} - className={borderCss} - > - {os?.length ? <OsCondition os={os} dataTestSubj={dataTestSubj} /> : null} - {entries.map((entry: Entry, index: number) => { - const nestedEntries = 'entries' in entry ? entry.entries : []; - return ( - <div key={`ExceptionItemCardConditionsContainer${index}`}> - <EntryContent - key={`entry${index}`} - entry={entry} - index={index} - dataTestSubj={dataTestSubj} - showValueListModal={showValueListModal} - /> - {nestedEntries?.length - ? nestedEntries.map((nestedEntry: Entry, nestedIndex: number) => ( - <EntryContent - key={`nestedEntry${index}${nestedIndex}`} - entry={nestedEntry} - index={nestedIndex} - isNestedEntry={true} - dataTestSubj={dataTestSubj} - showValueListModal={showValueListModal} - /> - )) - : null} - </div> - ); - })} - </EuiPanel> - ); - } -); -ExceptionItemCardConditions.displayName = 'ExceptionItemCardConditions'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/os_conditions/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/os_conditions/index.tsx deleted file mode 100644 index 0d8285924c314..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/os_conditions/index.tsx +++ /dev/null @@ -1,39 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { memo, useMemo } from 'react'; -import { EuiExpression } from '@elastic/eui'; - -import { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; -import { OS_LABELS } from '../conditions.config'; -import * as i18n from '../../translations'; - -export interface OsConditionsProps { - dataTestSubj?: string; - os: ExceptionListItemSchema['os_types']; -} - -export const OsCondition = memo<OsConditionsProps>(({ os, dataTestSubj }) => { - const osLabel = useMemo(() => { - return os.map((osValue) => OS_LABELS[osValue] ?? osValue).join(', '); - }, [os]); - return osLabel ? ( - <div data-test-subj={`${dataTestSubj || ''}Os`}> - <strong> - <EuiExpression data-test-subj="osLabel" description="" value={i18n.CONDITION_OS} /> - <EuiExpression - data-test-subj="osValue" - description={i18n.CONDITION_OPERATOR_TYPE_MATCH} - value={osLabel} - /> - </strong> - </div> - ) : null; -}); -OsCondition.displayName = 'OsCondition'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/types.ts b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/types.ts deleted file mode 100644 index 0400ca6548d9f..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/types.ts +++ /dev/null @@ -1,35 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { - EntryExists, - EntryList, - EntryMatch, - EntryMatchAny, - EntryMatchWildcard, - EntryNested, - ExceptionListItemSchema, -} from '@kbn/securitysolution-io-ts-list-types'; -import { ElementType } from 'react'; - -export type Entry = - | EntryExists - | EntryList - | EntryMatch - | EntryMatchAny - | EntryMatchWildcard - | EntryNested; - -export type Entries = ExceptionListItemSchema['entries']; -export interface CriteriaConditionsProps { - entries: Entries; - dataTestSubj: string; - os?: ExceptionListItemSchema['os_types']; - showValueListModal: ElementType; -} diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/header/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/header/index.tsx deleted file mode 100644 index 72b02cc79a791..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/header/index.tsx +++ /dev/null @@ -1,46 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { memo } from 'react'; -import { EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui'; -import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; -import { HeaderMenu } from '../../header_menu'; - -export interface ExceptionItemCardHeaderProps { - item: ExceptionListItemSchema; - actions: Array<{ key: string; icon: string; label: string | boolean; onClick: () => void }>; - disableActions?: boolean; - dataTestSubj: string; -} - -export const ExceptionItemCardHeader = memo<ExceptionItemCardHeaderProps>( - ({ item, actions, disableActions = false, dataTestSubj }) => { - return ( - <EuiFlexGroup responsive data-test-subj={dataTestSubj} justifyContent="spaceBetween"> - <EuiFlexItem grow={9}> - <EuiTitle size="xs" textTransform="uppercase" data-test-subj={`${dataTestSubj}Title`}> - <h3>{item.name}</h3> - </EuiTitle> - </EuiFlexItem> - <EuiFlexItem grow={false}> - <HeaderMenu - iconType="boxesHorizontal" - disableActions={disableActions} - actions={actions} - aria-label="Exception item actions menu" - dataTestSubj={dataTestSubj} - anchorPosition="downCenter" - /> - </EuiFlexItem> - </EuiFlexGroup> - ); - } -); - -ExceptionItemCardHeader.displayName = 'ExceptionItemCardHeader'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/index.ts b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/index.ts deleted file mode 100644 index 26af377092336..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './conditions'; -export * from './header'; -export * from './meta'; -export * from './comments'; -export * from './exception_item_card'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/details_info/details_info.test.tsx b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/details_info/details_info.test.tsx deleted file mode 100644 index cbb48e172322e..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/details_info/details_info.test.tsx +++ /dev/null @@ -1,39 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { render } from '@testing-library/react'; -import { MetaInfoDetails } from '.'; - -describe('MetaInfoDetails', () => { - it('should render lastUpdate as string', () => { - const wrapper = render( - <MetaInfoDetails - dataTestSubj="MetaInfoDetails" - label="created_by" - lastUpdate="last update" - lastUpdateValue="value" - /> - ); - expect(wrapper.container).toMatchSnapshot(); - expect(wrapper.getByTestId('MetaInfoDetailslastUpdate')).toHaveTextContent('last update'); - }); - it('should render lastUpdate as JSX Element', () => { - const wrapper = render( - <MetaInfoDetails - dataTestSubj="MetaInfoDetails" - label="created_by" - lastUpdate={<p>Last update value</p>} - lastUpdateValue="value" - /> - ); - expect(wrapper.container).toMatchSnapshot(); - expect(wrapper.getByTestId('MetaInfoDetailslastUpdate')).toHaveTextContent('Last update value'); - }); -}); diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/details_info/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/details_info/index.tsx deleted file mode 100644 index cc9eaa813aa9b..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/details_info/index.tsx +++ /dev/null @@ -1,69 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { memo } from 'react'; -import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; -import { css } from '@emotion/react'; -import { euiThemeVars } from '@kbn/ui-theme'; -import * as i18n from '../../translations'; - -interface MetaInfoDetailsProps { - label: string; - lastUpdate: JSX.Element | string; - lastUpdateValue?: string; - dataTestSubj?: string; -} - -const euiBadgeFontFamily = css` - font-family: ${euiThemeVars.euiFontFamily}; -`; -export const MetaInfoDetails = memo<MetaInfoDetailsProps>( - ({ label, lastUpdate, lastUpdateValue, dataTestSubj }) => { - return ( - <EuiFlexGroup - data-test-subj={`${dataTestSubj || ''}metaInfoDetails`} - alignItems="center" - gutterSize="s" - wrap - responsive - > - <EuiFlexItem grow={false}> - <EuiText size="xs" css={euiBadgeFontFamily}> - {label} - </EuiText> - </EuiFlexItem> - <EuiFlexItem grow={false} data-test-subj={`${dataTestSubj || ''}lastUpdate`}> - <EuiBadge color="default" css={euiBadgeFontFamily}> - {lastUpdate} - </EuiBadge> - </EuiFlexItem> - {lastUpdateValue != null && ( - <> - <EuiFlexItem grow={false}> - <EuiText size="xs" css={euiBadgeFontFamily}> - {i18n.EXCEPTION_ITEM_CARD_META_BY} - </EuiText> - </EuiFlexItem> - <EuiFlexItem grow={false} data-test-subj={`${dataTestSubj || ''}lastUpdateValue`}> - <EuiFlexGroup responsive gutterSize="xs" alignItems="center"> - <EuiFlexItem grow={false}> - <EuiBadge color="hollow" css={euiBadgeFontFamily}> - {lastUpdateValue} - </EuiBadge> - </EuiFlexItem> - </EuiFlexGroup> - </EuiFlexItem> - </> - )} - </EuiFlexGroup> - ); - } -); - -MetaInfoDetails.displayName = 'MetaInfoDetails'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/index.tsx deleted file mode 100644 index d9c0f84b02d0f..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/index.tsx +++ /dev/null @@ -1,125 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { memo, useMemo } from 'react'; -import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; - -import { css } from '@emotion/react'; -import { euiThemeVars } from '@kbn/ui-theme'; -import * as i18n from '../translations'; -import type { Rule } from '../../types'; -import { MetaInfoDetails } from './details_info'; -import { HeaderMenu } from '../../header_menu'; -import { generateLinkedRulesMenuItems } from '../../generate_linked_rules_menu_item'; - -const itemCss = css` - border-right: 1px solid #d3dae6; - padding: ${euiThemeVars.euiSizeS} ${euiThemeVars.euiSizeM} ${euiThemeVars.euiSizeS} 0; -`; - -export interface ExceptionItemCardMetaInfoProps { - item: ExceptionListItemSchema; - rules: Rule[]; - dataTestSubj: string; - formattedDateComponent: React.ElementType; // This property needs to be removed to avoid the Prop Drilling, once we move all the common components from x-pack/security-solution/common - securityLinkAnchorComponent: React.ElementType; // This property needs to be removed to avoid the Prop Drilling, once we move all the common components from x-pack/security-solution/common -} - -export const ExceptionItemCardMetaInfo = memo<ExceptionItemCardMetaInfoProps>( - ({ item, rules, dataTestSubj, securityLinkAnchorComponent, formattedDateComponent }) => { - const FormattedDateComponent = formattedDateComponent; - - const referencedLinks = useMemo( - () => - generateLinkedRulesMenuItems({ - dataTestSubj, - linkedRules: rules, - securityLinkAnchorComponent, - }), - [dataTestSubj, rules, securityLinkAnchorComponent] - ); - - const isExpired = useMemo( - () => (item.expire_time ? new Date(item.expire_time) <= new Date() : false), - [item] - ); - - return ( - <EuiFlexGroup alignItems="center" responsive gutterSize="s" data-test-subj={dataTestSubj}> - {FormattedDateComponent !== null && ( - <> - <EuiFlexItem css={itemCss} grow={false}> - <MetaInfoDetails - label={i18n.EXCEPTION_ITEM_CARD_CREATED_LABEL} - lastUpdate={ - <FormattedDateComponent - data-test-subj={`{dataTestSubj||''}formattedDateComponentCreatedBy`} - fieldName="created_at" - value={item.created_at} - /> - } - lastUpdateValue={item.created_by} - dataTestSubj={`${dataTestSubj || ''}CreatedBy`} - /> - </EuiFlexItem> - - <EuiFlexItem css={itemCss} grow={false}> - <MetaInfoDetails - label={i18n.EXCEPTION_ITEM_CARD_UPDATED_LABEL} - lastUpdate={ - <FormattedDateComponent - data-test-subj={`{dataTestSubj||''}formattedDateComponentUpdatedBy`} - fieldName="updated_at" - value={item.updated_at} - /> - } - lastUpdateValue={item.updated_by} - dataTestSubj={`${dataTestSubj || ''}UpdatedBy`} - /> - </EuiFlexItem> - {item.expire_time != null && ( - <> - <EuiFlexItem css={itemCss} grow={false}> - <MetaInfoDetails - label={ - isExpired - ? i18n.EXCEPTION_ITEM_CARD_EXPIRED_LABEL - : i18n.EXCEPTION_ITEM_CARD_EXPIRES_LABEL - } - lastUpdate={ - <FormattedDateComponent - data-test-subj={`{dataTestSubj||''}formattedDateComponentExpireTime`} - fieldName="expire_time" - value={item.expire_time} - /> - } - dataTestSubj={`${dataTestSubj || ''}ExpireTime`} - /> - </EuiFlexItem> - </> - )} - </> - )} - <EuiFlexItem> - <HeaderMenu - emptyButton - useCustomActions - iconType="list" - actions={referencedLinks} - disableActions={false} - text={i18n.AFFECTED_RULES(rules.length)} - dataTestSubj={dataTestSubj} - /> - </EuiFlexItem> - </EuiFlexGroup> - ); - } -); -ExceptionItemCardMetaInfo.displayName = 'ExceptionItemCardMetaInfo'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/translations.ts b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/translations.ts deleted file mode 100644 index 78a0dac775cf3..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/translations.ts +++ /dev/null @@ -1,181 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { i18n } from '@kbn/i18n'; - -export const exceptionItemCardEditButton = (listType: string) => - i18n.translate('exceptionList-components.exceptions.exceptionItem.card.editItemButton', { - values: { listType }, - defaultMessage: 'Edit {listType} exception', - }); - -export const exceptionItemCardDeleteButton = (listType: string) => - i18n.translate('exceptionList-components.exceptions.exceptionItem.card.deleteItemButton', { - values: { listType }, - defaultMessage: 'Delete {listType} exception', - }); - -export const EXCEPTION_ITEM_CARD_CREATED_LABEL = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.createdLabel', - { - defaultMessage: 'Created', - } -); - -export const EXCEPTION_ITEM_CARD_UPDATED_LABEL = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.updatedLabel', - { - defaultMessage: 'Updated', - } -); - -export const EXCEPTION_ITEM_CARD_EXPIRES_LABEL = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.expiresLabel', - { - defaultMessage: 'Expires at', - } -); - -export const EXCEPTION_ITEM_CARD_EXPIRED_LABEL = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.expiredLabel', - { - defaultMessage: 'Expired at', - } -); - -export const EXCEPTION_ITEM_CARD_META_BY = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.metaDetailsBy', - { - defaultMessage: 'by', - } -); - -export const exceptionItemCardCommentsAccordion = (comments: number) => - i18n.translate('exceptionList-components.exceptions.exceptionItem.card.showCommentsLabel', { - values: { comments }, - defaultMessage: 'Show {comments, plural, =1 {comment} other {comments}} ({comments})', - }); - -export const CONDITION_OPERATOR_TYPE_MATCH = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.conditions.matchOperator', - { - defaultMessage: 'IS', - } -); - -export const CONDITION_OPERATOR_TYPE_NOT_MATCH = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.conditions.matchOperator.not', - { - defaultMessage: 'IS NOT', - } -); - -export const CONDITION_OPERATOR_TYPE_WILDCARD_MATCHES = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.conditions.wildcardMatchesOperator', - { - defaultMessage: 'MATCHES', - } -); - -export const CONDITION_OPERATOR_TYPE_WILDCARD_DOES_NOT_MATCH = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.conditions.wildcardDoesNotMatchOperator', - { - defaultMessage: 'DOES NOT MATCH', - } -); - -export const CONDITION_OPERATOR_TYPE_NESTED = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.conditions.nestedOperator', - { - defaultMessage: 'has', - } -); - -export const CONDITION_OPERATOR_TYPE_MATCH_ANY = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.conditions.matchAnyOperator', - { - defaultMessage: 'is one of', - } -); - -export const CONDITION_OPERATOR_TYPE_NOT_MATCH_ANY = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.conditions.matchAnyOperator.not', - { - defaultMessage: 'is not one of', - } -); - -export const CONDITION_OPERATOR_TYPE_EXISTS = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.conditions.existsOperator', - { - defaultMessage: 'exists', - } -); - -export const CONDITION_OPERATOR_TYPE_DOES_NOT_EXIST = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.conditions.existsOperator.not', - { - defaultMessage: 'does not exist', - } -); - -export const CONDITION_OPERATOR_TYPE_LIST = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.conditions.listOperator', - { - defaultMessage: 'included in', - } -); - -export const CONDITION_OPERATOR_TYPE_NOT_IN_LIST = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.conditions.listOperator.not', - { - defaultMessage: 'is not included in', - } -); - -export const CONDITION_AND = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.conditions.and', - { - defaultMessage: 'AND', - } -); - -export const CONDITION_OS = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.conditions.os', - { - defaultMessage: 'OS', - } -); - -export const OS_WINDOWS = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.conditions.windows', - { - defaultMessage: 'Windows', - } -); - -export const OS_LINUX = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.conditions.linux', - { - defaultMessage: 'Linux', - } -); - -export const OS_MAC = i18n.translate( - 'exceptionList-components.exceptions.exceptionItem.card.conditions.macos', - { - defaultMessage: 'Mac', - } -); - -export const AFFECTED_RULES = (numRules: number) => - i18n.translate('exceptionList-components.exceptions.card.exceptionItem.affectedRules', { - values: { numRules }, - defaultMessage: 'Affects {numRules} {numRules, plural, =1 {rule} other {rules}}', - }); diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_items/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/exception_items/index.tsx deleted file mode 100644 index edad9aecdb0d0..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_items/index.tsx +++ /dev/null @@ -1,155 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { ElementType } from 'react'; -import { css } from '@emotion/react'; -import type { FC } from 'react'; -import { EuiCommentProps, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; - -import type { - CommentsArray, - ExceptionListItemSchema, - ExceptionListTypeEnum, -} from '@kbn/securitysolution-io-ts-list-types'; - -import { euiThemeVars } from '@kbn/ui-theme'; -import { EmptyViewerState, ExceptionItemCard, Pagination, PaginationProps } from '../..'; - -import type { - RuleReferences, - ExceptionListItemIdentifiers, - ViewerStatus, - GetExceptionItemProps, -} from '../types'; - -const exceptionItemCss = css` - margin: ${euiThemeVars.euiSize} 0; - &div:first-child { - margin: ${euiThemeVars.euiSizeXS} 0 ${euiThemeVars.euiSize}; - } -`; - -interface ExceptionItemsProps { - lastUpdated: string | number | null; - viewerStatus: ViewerStatus; - isReadOnly: boolean; - emptyViewerTitle?: string; - emptyViewerBody?: string; - emptyViewerButtonText?: string; - exceptions: ExceptionListItemSchema[]; - listType: ExceptionListTypeEnum; - ruleReferences: RuleReferences; - pagination: PaginationProps['pagination']; - editActionLabel?: string; - deleteActionLabel?: string; - dataTestSubj?: string; - securityLinkAnchorComponent: ElementType; // This property needs to be removed to avoid the Prop Drilling, once we move all the common components from x-pack/security-solution/common - formattedDateComponent: ElementType; // This property needs to be removed to avoid the Prop Drilling, once we move all the common components from x-pack/security-solution/common - exceptionsUtilityComponent: ElementType; // This property needs to be removed to avoid the Prop Drilling, once we move all the common components from x-pack/security-solution/common - getFormattedComments: (comments: CommentsArray) => EuiCommentProps[]; // This property needs to be removed to avoid the Prop Drilling, once we move all the common components from x-pack/security-solution/common - onCreateExceptionListItem?: () => void; - onDeleteException: (arg: ExceptionListItemIdentifiers) => void; - onEditExceptionItem: (item: ExceptionListItemSchema) => void; - onPaginationChange: (arg: GetExceptionItemProps) => void; - showValueListModal: ElementType; -} - -const ExceptionItemsComponent: FC<ExceptionItemsProps> = ({ - lastUpdated, - viewerStatus, - isReadOnly, - exceptions, - listType, - ruleReferences, - emptyViewerTitle, - emptyViewerBody, - emptyViewerButtonText, - pagination, - dataTestSubj, - editActionLabel, - deleteActionLabel, - securityLinkAnchorComponent, - exceptionsUtilityComponent, - formattedDateComponent, - getFormattedComments, - onPaginationChange, - onDeleteException, - onEditExceptionItem, - onCreateExceptionListItem, - showValueListModal, -}) => { - const ExceptionsUtility = exceptionsUtilityComponent; - if (!exceptions.length || viewerStatus) - return ( - <EmptyViewerState - isReadOnly={isReadOnly} - title={emptyViewerTitle} - viewerStatus={viewerStatus} - buttonText={emptyViewerButtonText} - body={emptyViewerBody} - onEmptyButtonStateClick={onCreateExceptionListItem} - /> - ); - const ShowValueListModal = showValueListModal; - return ( - <> - <ExceptionsUtility pagination={pagination} lastUpdated={lastUpdated} /> - <EuiFlexGroup direction="column" gutterSize="none" className="eui-yScrollWithShadows"> - <EuiFlexItem grow={false}> - <EuiFlexGroup - css={exceptionItemCss} - data-test-subj={`${dataTestSubj || ''}exceptionsContainer`} - direction="column" - gutterSize="s" - > - {exceptions.map((exception) => ( - <EuiFlexItem - data-test-subj={`${dataTestSubj || ''}exceptionItemContainer`} - grow={false} - key={exception.id} - > - <ExceptionItemCard - key={`${exception.id}exceptionItemCardKey`} - dataTestSubj={`${dataTestSubj || ''}exceptionItemCard`} - disableActions={isReadOnly} - exceptionItem={exception} - listType={listType} - ruleReferences={ - Object.keys(ruleReferences).length && ruleReferences[exception.list_id] - ? ruleReferences[exception.list_id].referenced_rules - : [] - } - editActionLabel={editActionLabel} - deleteActionLabel={deleteActionLabel} - onDeleteException={onDeleteException} - onEditException={onEditExceptionItem} - securityLinkAnchorComponent={securityLinkAnchorComponent} - formattedDateComponent={formattedDateComponent} - getFormattedComments={getFormattedComments} - showValueListModal={ShowValueListModal} - /> - </EuiFlexItem> - ))} - </EuiFlexGroup> - </EuiFlexItem> - </EuiFlexGroup> - <Pagination - dataTestSubj={`${dataTestSubj || ''}pagination`} - pagination={pagination} - onPaginationChange={onPaginationChange} - /> - </> - ); -}; - -ExceptionItemsComponent.displayName = 'ExceptionItemsComponent'; - -export const ExceptionItems = React.memo(ExceptionItemsComponent); - -ExceptionItems.displayName = 'ExceptionsItems'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/index.tsx deleted file mode 100644 index d68ac8f114a09..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/index.tsx +++ /dev/null @@ -1,51 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { ElementType, ReactElement } from 'react'; -import { EuiContextMenuItem, EuiFlexGroup, EuiFlexItem, EuiIcon, IconType } from '@elastic/eui'; -import { Rule } from '../types'; -import { itemContentCss, containerCss } from './menu_link.styles'; - -interface MenuItemLinkedRulesProps { - leftIcon?: IconType; - dataTestSubj?: string; - linkedRules: Rule[]; - securityLinkAnchorComponent: ElementType; // This property needs to be removed to avoid the Prop Drilling, once we move all the common components from x-pack/security-solution/common -} - -export const generateLinkedRulesMenuItems = ({ - dataTestSubj, - linkedRules, - securityLinkAnchorComponent, - leftIcon = '', -}: MenuItemLinkedRulesProps): ReactElement[] | null => { - if (!linkedRules.length || securityLinkAnchorComponent === null) return null; - - const SecurityLinkAnchor = securityLinkAnchorComponent; - return linkedRules.map((rule) => { - return ( - <EuiContextMenuItem - css={linkedRules.length > 1 ? containerCss : ''} - data-test-subj={`${dataTestSubj || ''}ActionItem${rule.id}`} - key={rule.id} - > - <EuiFlexGroup gutterSize="s" css={itemContentCss}> - {leftIcon ? ( - <EuiFlexItem data-test-subj={`${dataTestSubj || ''}LeftIcon`} grow={false}> - <EuiIcon type={leftIcon} /> - </EuiFlexItem> - ) : null} - <EuiFlexItem css={itemContentCss}> - <SecurityLinkAnchor external referenceName={rule.name} referenceId={rule.id} /> - </EuiFlexItem> - </EuiFlexGroup> - </EuiContextMenuItem> - ); - }); -}; diff --git a/packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/menu_link.styles.ts b/packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/menu_link.styles.ts deleted file mode 100644 index 42f470ce39dd5..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/menu_link.styles.ts +++ /dev/null @@ -1,20 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { css } from '@emotion/react'; -import { euiThemeVars } from '@kbn/ui-theme'; - -export const containerCss = css` - border-bottom: 1px solid ${euiThemeVars.euiColorLightShade}; -`; - -export const itemContentCss = css` - color: ${euiThemeVars.euiColorPrimary}; - flex-basis: content; -`; diff --git a/packages/kbn-securitysolution-exception-list-components/src/header_menu/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/header_menu/index.tsx deleted file mode 100644 index 2f39959c33fe4..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/header_menu/index.tsx +++ /dev/null @@ -1,139 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { FC, ReactElement, useMemo, useState } from 'react'; -import { - EuiButtonEmpty, - EuiButtonEmptyProps, - EuiButtonIcon, - EuiContextMenuItem, - EuiContextMenuPanel, - EuiFlexGroup, - EuiPopover, - PanelPaddingSize, - PopoverAnchorPosition, -} from '@elastic/eui'; - -import { css } from '@emotion/react'; - -export interface Action { - key: string; - icon: string; - label: string | boolean; - disabled?: boolean; - onClick: (e: React.MouseEvent<Element, MouseEvent>) => void; -} - -interface HeaderMenuComponentProps { - disableActions: boolean; - actions: Action[] | ReactElement[] | null; - text?: string; - iconType?: EuiButtonEmptyProps['iconType']; - iconSide?: EuiButtonEmptyProps['iconSide']; - dataTestSubj?: string; - emptyButton?: boolean; - useCustomActions?: boolean; - anchorPosition?: PopoverAnchorPosition; - panelPaddingSize?: PanelPaddingSize; -} - -const popoverHeightStyle = css` - max-height: 300px; - height: 100%; - overflow-x: hidden; - overflow-y: auto; -`; -const HeaderMenuComponent: FC<HeaderMenuComponentProps> = ({ - text, - dataTestSubj, - actions, - disableActions, - emptyButton, - useCustomActions, - iconType, - iconSide = 'left', - anchorPosition = 'downCenter', - panelPaddingSize = 's', -}) => { - const [isPopoverOpen, setIsPopoverOpen] = useState(false); - - const onAffectedRulesClick = () => setIsPopoverOpen((isOpen) => !isOpen); - const onClosePopover = () => setIsPopoverOpen(false); - - const itemActions = useMemo(() => { - if (useCustomActions || actions === null) return actions; - return (actions as Action[]).map((action) => ( - <EuiContextMenuItem - data-test-subj={`${dataTestSubj || ''}ActionItem${action.key}`} - key={action.key} - icon={action.icon} - disabled={action.disabled} - layoutAlign="center" - onClick={(e) => { - onClosePopover(); - if (typeof action.onClick === 'function') action.onClick(e); - }} - > - {action.label} - </EuiContextMenuItem> - )); - }, [actions, dataTestSubj, useCustomActions]); - - return ( - <EuiFlexGroup responsive> - <EuiPopover - button={ - emptyButton ? ( - <EuiButtonEmpty - isDisabled={disableActions} - onClick={onAffectedRulesClick} - iconType={iconType ? iconType : undefined} - iconSide={iconSide} - data-test-subj={`${dataTestSubj || ''}EmptyButton`} - aria-label="Header menu Button Empty" - > - {text} - </EuiButtonEmpty> - ) : ( - <EuiButtonIcon - isDisabled={disableActions} - onClick={onAffectedRulesClick} - iconType={iconType ? iconType : 'boxesHorizontal'} - data-test-subj={`${dataTestSubj || ''}ButtonIcon`} - aria-label="Header menu Button Icon" - > - {text} - </EuiButtonIcon> - ) - } - onClick={(e) => e.stopPropagation()} - panelPaddingSize={panelPaddingSize} - isOpen={isPopoverOpen} - closePopover={onClosePopover} - anchorPosition={anchorPosition} - data-test-subj={`${dataTestSubj || ''}Items`} - > - {!itemActions ? null : ( - <EuiContextMenuPanel - css={popoverHeightStyle} - className="eui-scrollBar" - data-test-subj={`${dataTestSubj || ''}MenuPanel`} - size="s" - items={itemActions as ReactElement[]} - /> - )} - </EuiPopover> - </EuiFlexGroup> - ); -}; -HeaderMenuComponent.displayName = 'HeaderMenuComponent'; - -export const HeaderMenu = React.memo(HeaderMenuComponent); - -HeaderMenu.displayName = 'HeaderMenu'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/index.tsx deleted file mode 100644 index 82aec99bebb3a..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { FC } from 'react'; -import { - EuiButton, - EuiButtonEmpty, - EuiFieldText, - EuiForm, - EuiFormRow, - EuiModal, - EuiModalBody, - EuiModalFooter, - EuiModalHeader, - EuiModalHeaderTitle, - EuiTextArea, - EuiProgress, -} from '@elastic/eui'; -import * as i18n from '../../translations'; -import { ListDetails } from '../../types'; -import { useEditModal } from './use_edit_modal'; - -interface EditModalProps { - listDetails: ListDetails; - onSave: (newListDetails: ListDetails) => void; - onCancel: () => void; -} - -const EditModalComponent: FC<EditModalProps> = ({ listDetails, onSave, onCancel }) => { - const { error, modalFormId, newListDetails, showProgress, onBlur, onSubmit, onChange } = - useEditModal({ - listDetails, - onSave, - }); - return ( - <EuiModal data-test-subj="EditModal" onClose={onCancel} initialFocus="[name=popswitch]"> - {showProgress && ( - <EuiProgress data-test-subj="editModalProgess" size="xs" position="absolute" /> - )} - <EuiModalHeader> - <EuiModalHeaderTitle data-test-subj="editModalTitle"> - {i18n.EXCEPTION_LIST_HEADER_EDIT_MODAL_TITLE(listDetails.name)} - </EuiModalHeaderTitle> - </EuiModalHeader> - - <EuiModalBody> - <EuiForm - id={modalFormId} - data-test-subj="editModalForm" - component="form" - onSubmit={onSubmit} - > - <EuiFormRow - error={error} - isInvalid={!!error} - fullWidth - label={i18n.EXCEPTION_LIST_HEADER_NAME_TEXTBOX} - > - <EuiFieldText - fullWidth - isInvalid={!!error} - onBlur={onBlur} - data-test-subj="editModalNameTextField" - name="name" - value={newListDetails.name} - onChange={onChange} - /> - </EuiFormRow> - - <EuiFormRow fullWidth label={i18n.EXCEPTION_LIST_HEADER_DESCRIPTION_TEXTBOX}> - <EuiTextArea - fullWidth - data-test-subj="editModalDescriptionTextField" - name="description" - value={newListDetails.description} - onChange={onChange} - onBlur={onBlur} - /> - </EuiFormRow> - </EuiForm> - </EuiModalBody> - - <EuiModalFooter> - <EuiButtonEmpty data-test-subj="editModalCancelBtn" onClick={onCancel}> - {i18n.EXCEPTION_LIST_HEADER_EDIT_MODAL_CANCEL_BUTTON} - </EuiButtonEmpty> - - <EuiButton - data-test-subj="editModalSaveBtn" - type="submit" - form={modalFormId} - onClick={onSubmit} - fill - > - {i18n.EXCEPTION_LIST_HEADER_EDIT_MODAL_SAVE_BUTTON} - </EuiButton> - </EuiModalFooter> - </EuiModal> - ); -}; -EditModalComponent.displayName = 'EditModalComponent'; - -export const EditModal = React.memo(EditModalComponent); - -EditModal.displayName = 'EditModal'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/list_header/index.tsx deleted file mode 100644 index 849dd4ef1ba85..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/list_header/index.tsx +++ /dev/null @@ -1,138 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import type { FC } from 'react'; -import { EuiIcon, EuiPageHeader, EuiText } from '@elastic/eui'; -import * as i18n from '../translations'; -import { textCss, descriptionContainerCss, backTextCss } from './list_header.styles'; -import { MenuItems } from './menu_items'; -import { TextWithEdit } from '../text_with_edit'; -import { EditModal } from './edit_modal'; -import { ListDetails, Rule } from '../types'; -import { useExceptionListHeader } from './use_list_header'; -import { textWithEditContainerCss } from '../text_with_edit/text_with_edit.styles'; - -interface ExceptionListHeaderComponentProps { - name: string; - description?: string; - listId: string; - isReadonly: boolean; - linkedRules: Rule[]; - dataTestSubj?: string; - backOptions: BackOptions; - canUserEditList?: boolean; - securityLinkAnchorComponent: React.ElementType; // This property needs to be removed to avoid the Prop Drilling, once we move all the common components from x-pack/security-solution/common - onEditListDetails: (listDetails: ListDetails) => void; - onDeleteList: () => void; - onManageRules: () => void; - onExportList: () => void; - onDuplicateList: () => void; -} - -export interface BackOptions { - pageId: string; - path: string; - dataTestSubj?: string; - onNavigate: (path: string) => void; -} -const ExceptionListHeaderComponent: FC<ExceptionListHeaderComponentProps> = ({ - name, - description, - listId, - linkedRules, - isReadonly, - dataTestSubj, - securityLinkAnchorComponent, - backOptions, - canUserEditList = true, - onEditListDetails, - onDeleteList, - onManageRules, - onExportList, - onDuplicateList, -}) => { - const { isModalVisible, listDetails, onEdit, onSave, onCancel } = useExceptionListHeader({ - name, - description, - onEditListDetails, - }); - return ( - <div> - <EuiPageHeader - bottomBorder - paddingSize="none" - pageTitle={ - <TextWithEdit - dataTestSubj={`${dataTestSubj || ''}Title`} - text={listDetails.name || i18n.EXCEPTION_LIST_HEADER_NAME} - isReadonly={isReadonly || !canUserEditList} - onEdit={onEdit} - /> - } - responsive - data-test-subj={`${dataTestSubj || ''}PageHeader`} - description={ - <div css={descriptionContainerCss}> - <TextWithEdit - dataTestSubj={`${dataTestSubj || ''}Description`} - textCss={textCss} - isReadonly={isReadonly || !canUserEditList} - text={listDetails.description || i18n.EXCEPTION_LIST_HEADER_DESCRIPTION} - onEdit={onEdit} - /> - <div css={textWithEditContainerCss} data-test-subj={`${dataTestSubj || ''}ListID`}> - <EuiText css={textCss}>{i18n.EXCEPTION_LIST_HEADER_LIST_ID}:</EuiText> - <EuiText css={textCss}>{listId}</EuiText> - </div> - </div> - } - rightSideItems={[ - <MenuItems - dataTestSubj={`${dataTestSubj || ''}RightSideMenuItems`} - linkedRules={linkedRules} - isReadonly={isReadonly} - canUserEditList={canUserEditList} - securityLinkAnchorComponent={securityLinkAnchorComponent} - onDeleteList={onDeleteList} - onManageRules={onManageRules} - onExportList={onExportList} - onDuplicateList={onDuplicateList} - />, - ]} - breadcrumbs={[ - { - text: ( - <div data-test-subj={`${dataTestSubj || ''}Breadcrumb`} css={backTextCss}> - <EuiIcon size="s" type="arrowLeft" /> - {i18n.EXCEPTION_LIST_HEADER_BREADCRUMB} - </div> - ), - color: 'primary', - 'aria-current': false, - href: backOptions.path, - onClick: (e) => { - e.preventDefault(); - backOptions.onNavigate(backOptions.path); - }, - }, - ]} - /> - {isModalVisible && ( - <EditModal listDetails={listDetails} onSave={onSave} onCancel={onCancel} /> - )} - </div> - ); -}; - -ExceptionListHeaderComponent.displayName = 'ExceptionListHeaderComponent'; - -export const ExceptionListHeader = React.memo(ExceptionListHeaderComponent); - -ExceptionListHeader.displayName = 'ExceptionListHeader'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/list_header.styles.ts b/packages/kbn-securitysolution-exception-list-components/src/list_header/list_header.styles.ts deleted file mode 100644 index c3cba9f9dcdbe..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/list_header/list_header.styles.ts +++ /dev/null @@ -1,34 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { css } from '@emotion/react'; -import { euiThemeVars } from '@kbn/ui-theme'; - -export const headerMenuCss = css` - border-right: 1px solid #d3dae6; - padding: ${euiThemeVars.euiSizeXS} ${euiThemeVars.euiSizeL} ${euiThemeVars.euiSizeXS} 0; -`; - -export const noLinkedRulesCss = css` - width: max-content; -`; - -export const textCss = css` - font-size: ${euiThemeVars.euiFontSize}; - color: ${euiThemeVars.euiTextSubduedColor}; - margin-left: ${euiThemeVars.euiSizeXS}; -`; -export const descriptionContainerCss = css` - margin-top: -${euiThemeVars.euiSizeL}; - margin-bottom: -${euiThemeVars.euiSizeL}; -`; - -export const backTextCss = css` - font-size: ${euiThemeVars.euiFontSizeXS}; -`; diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/index.tsx deleted file mode 100644 index f0aecf21b6c73..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/index.tsx +++ /dev/null @@ -1,136 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiTextColor } from '@elastic/eui'; -import React, { FC, useMemo } from 'react'; -import { HeaderMenu } from '../../header_menu'; -import { headerMenuCss, noLinkedRulesCss } from '../list_header.styles'; -import * as i18n from '../../translations'; -import { Rule } from '../../types'; -import { generateLinkedRulesMenuItems } from '../../generate_linked_rules_menu_item'; -interface MenuItemsProps { - isReadonly: boolean; - dataTestSubj?: string; - linkedRules: Rule[]; - canUserEditList?: boolean; - securityLinkAnchorComponent: React.ElementType; // This property needs to be removed to avoid the Prop Drilling, once we move all the common components from x-pack/security-solution/common - onDeleteList: () => void; - onManageRules: () => void; - onExportList: () => void; - onDuplicateList: () => void; -} - -const MenuItemsComponent: FC<MenuItemsProps> = ({ - dataTestSubj, - linkedRules, - securityLinkAnchorComponent, - isReadonly, - canUserEditList = true, - onDeleteList, - onManageRules, - onExportList, - onDuplicateList, -}) => { - const referencedLinks = useMemo( - () => - generateLinkedRulesMenuItems({ - leftIcon: 'check', - dataTestSubj, - linkedRules, - securityLinkAnchorComponent, - }), - [dataTestSubj, linkedRules, securityLinkAnchorComponent] - ); - return ( - <EuiFlexGroup - direction="row" - alignItems="baseline" - justifyContent="center" - responsive - data-test-subj={`${dataTestSubj || ''}Container`} - gutterSize="l" - > - <EuiFlexItem css={headerMenuCss}> - {linkedRules.length ? ( - <HeaderMenu - dataTestSubj={`${dataTestSubj || ''}LinkedRulesMenu`} - emptyButton - useCustomActions - text={i18n.EXCEPTION_LIST_HEADER_LINKED_RULES(linkedRules.length)} - actions={referencedLinks} - disableActions={false} - iconType="arrowDown" - iconSide="right" - panelPaddingSize="none" - /> - ) : ( - <EuiTextColor data-test-subj="noLinkedRules" css={noLinkedRulesCss} color="subdued"> - {i18n.EXCEPTION_LIST_HEADER_LINKED_RULES(linkedRules.length)} - </EuiTextColor> - )} - </EuiFlexItem> - - {canUserEditList && ( - <EuiFlexItem> - <EuiButton - data-test-subj={`${dataTestSubj || ''}LinkRulesButton`} - fill - onClick={() => { - if (typeof onManageRules === 'function') onManageRules(); - }} - > - {i18n.EXCEPTION_LIST_HEADER_LINK_RULES_BUTTON} - </EuiButton> - </EuiFlexItem> - )} - <EuiFlexItem> - <HeaderMenu - iconType="boxesHorizontal" - dataTestSubj={`${dataTestSubj || ''}MenuActions`} - actions={[ - { - key: '1', - icon: 'exportAction', - label: i18n.EXCEPTION_LIST_HEADER_EXPORT_ACTION, - onClick: () => { - if (typeof onExportList === 'function') onExportList(); - }, - }, - { - key: '2', - icon: 'copy', - label: i18n.EXCEPTION_LIST_HEADER_DUPLICATE_ACTION, - onClick: () => { - if (typeof onDuplicateList === 'function') onDuplicateList(); - }, - disabled: !canUserEditList, - }, - { - key: '3', - icon: 'trash', - label: i18n.EXCEPTION_LIST_HEADER_DELETE_ACTION, - onClick: () => { - if (typeof onDeleteList === 'function') onDeleteList(); - }, - disabled: !canUserEditList, - }, - ]} - disableActions={isReadonly} - anchorPosition="downCenter" - /> - </EuiFlexItem> - </EuiFlexGroup> - ); -}; - -MenuItemsComponent.displayName = 'MenuItemsComponent'; - -export const MenuItems = React.memo(MenuItemsComponent); - -MenuItems.displayName = 'MenuItems'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/use_list_header.ts b/packages/kbn-securitysolution-exception-list-components/src/list_header/use_list_header.ts deleted file mode 100644 index 676dd08a53be1..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/list_header/use_list_header.ts +++ /dev/null @@ -1,46 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { useState } from 'react'; -import { ListDetails } from '../types'; - -interface UseExceptionListHeaderProps { - name: string; - description?: string; - onEditListDetails: (listDetails: ListDetails) => void; -} -export const useExceptionListHeader = ({ - name, - description, - onEditListDetails, -}: UseExceptionListHeaderProps) => { - const [isModalVisible, setIsModalVisible] = useState(false); - const [listDetails, setListDetails] = useState<ListDetails>({ name, description }); - const onEdit = () => { - setIsModalVisible(true); - }; - const onSave = (newListDetails: ListDetails) => { - setListDetails(newListDetails); - if (typeof onEditListDetails === 'function') onEditListDetails(newListDetails); - setTimeout(() => { - setIsModalVisible(false); - }, 200); - }; - const onCancel = () => { - setIsModalVisible(false); - }; - - return { - isModalVisible, - listDetails, - onEdit, - onSave, - onCancel, - }; -}; diff --git a/packages/kbn-securitysolution-exception-list-components/src/mocks/comments.mock.tsx b/packages/kbn-securitysolution-exception-list-components/src/mocks/comments.mock.tsx deleted file mode 100644 index 4c9b813463ca3..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/mocks/comments.mock.tsx +++ /dev/null @@ -1,26 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import type { Comment, CommentsArray } from '@kbn/securitysolution-io-ts-list-types'; - -export const getCommentsMock = (): Comment => ({ - comment: 'some old comment', - created_at: '2020-04-20T15:25:31.830Z', - created_by: 'some user', - id: 'uuid_here', -}); - -export const getCommentsArrayMock = (): CommentsArray => [getCommentsMock(), getCommentsMock()]; - -export const mockGetFormattedComments = () => - getCommentsArrayMock().map((comment) => ({ - username: comment.created_by, - children: <p>{comment.comment}</p>, - })); diff --git a/packages/kbn-securitysolution-exception-list-components/src/mocks/entry.mock.ts b/packages/kbn-securitysolution-exception-list-components/src/mocks/entry.mock.ts deleted file mode 100644 index a39fe947caa2e..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/mocks/entry.mock.ts +++ /dev/null @@ -1,30 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { Entry } from '../exception_item_card/conditions/types'; - -export const includedListTypeEntry: Entry = { - field: '', - operator: 'included', - type: 'list', - list: { id: 'list_id', type: 'boolean' }, -}; - -export const includedMatchTypeEntry: Entry = { - field: '', - operator: 'included', - type: 'match', - value: 'matches value', -}; - -export const includedExistsTypeEntry: Entry = { - field: '', - operator: 'included', - type: 'exists', -}; diff --git a/packages/kbn-securitysolution-exception-list-components/src/mocks/exception_list_item_schema.mock.ts b/packages/kbn-securitysolution-exception-list-components/src/mocks/exception_list_item_schema.mock.ts deleted file mode 100644 index f9c24d46228c5..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/mocks/exception_list_item_schema.mock.ts +++ /dev/null @@ -1,44 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; - -export const getExceptionListItemSchemaMock = ( - overrides?: Partial<ExceptionListItemSchema> -): ExceptionListItemSchema => ({ - _version: undefined, - comments: [], - created_at: '2020-04-20T15:25:31.830Z', - created_by: 'some user', - description: 'some description', - entries: [ - { - entries: [ - { field: 'nested.field', operator: 'included', type: 'match', value: 'some value' }, - ], - field: 'some.parentField', - type: 'nested', - }, - { field: 'some.not.nested.field', operator: 'included', type: 'match', value: 'some value' }, - ], - expire_time: undefined, - id: '1', - item_id: 'endpoint_list_item', - list_id: 'endpoint_list_id', - meta: {}, - name: 'some name', - namespace_type: 'single', - os_types: [], - tags: ['user added string for a tag', 'malware'], - tie_breaker_id: '6a76b69d-80df-4ab2-8c3e-85f466b06a0e', - type: 'simple', - updated_at: '2020-04-20T15:25:31.830Z', - updated_by: 'some user', - ...(overrides || {}), -}); diff --git a/packages/kbn-securitysolution-exception-list-components/src/mocks/header.mock.ts b/packages/kbn-securitysolution-exception-list-components/src/mocks/header.mock.ts deleted file mode 100644 index 06aa00b5ff724..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/mocks/header.mock.ts +++ /dev/null @@ -1,40 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export const handleEdit = jest.fn(); -export const handleDelete = jest.fn(); -export const actions = [ - { - key: 'edit', - icon: 'pencil', - label: 'Edit detection exception', - onClick: handleEdit, - }, - { - key: 'delete', - icon: 'trash', - label: 'Delete detection exception', - onClick: handleDelete, - }, -]; -export const actionsWithDisabledDelete = [ - { - key: 'edit', - icon: 'pencil', - label: 'Edit detection exception', - onClick: handleEdit, - }, - { - key: 'delete', - icon: 'trash', - disabled: true, - label: 'Delete detection exception', - onClick: handleDelete, - }, -]; diff --git a/packages/kbn-securitysolution-exception-list-components/src/mocks/rule_references.mock.ts b/packages/kbn-securitysolution-exception-list-components/src/mocks/rule_references.mock.ts deleted file mode 100644 index 3592d5f03cc4c..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/mocks/rule_references.mock.ts +++ /dev/null @@ -1,43 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { Rule, RuleReference } from '../types'; - -export const rules: Rule[] = [ - { - exceptions_list: [ - { - id: '123', - list_id: 'i_exist', - namespace_type: 'single', - type: 'detection', - }, - { - id: '456', - list_id: 'i_exist_2', - namespace_type: 'single', - type: 'detection', - }, - ], - id: '1a2b3c', - name: 'Simple Rule Query', - rule_id: 'rule-2', - }, -]; - -export const ruleReference: RuleReference = { - name: 'endpoint list', - id: 'endpoint_list', - referenced_rules: rules, - listId: 'endpoint_list_id', -}; - -export const ruleReferences = { - endpoint_list_id: ruleReference, -}; diff --git a/packages/kbn-securitysolution-exception-list-components/src/mocks/security_link_component.mock.tsx b/packages/kbn-securitysolution-exception-list-components/src/mocks/security_link_component.mock.tsx deleted file mode 100644 index 1ad7d2921c5a0..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/mocks/security_link_component.mock.tsx +++ /dev/null @@ -1,38 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { ReactElement } from 'react'; -import { generateLinkedRulesMenuItems } from '../generate_linked_rules_menu_item'; -import { rules } from './rule_references.mock'; -export const securityLinkAnchorComponentMock = ({ - referenceName, - referenceId, -}: { - referenceName: string; - referenceId: string; -}) => ( - <div data-test-subj="securityLinkAnchorComponent"> - <a href={referenceId}>{referenceName}</a> - </div> -); - -export const getSecurityLinkAction = (dataTestSubj: string) => - generateLinkedRulesMenuItems({ - dataTestSubj, - linkedRules: [ - ...rules, - { - exceptions_list: [], - id: '2a2b3c', - name: 'Simple Rule Query 2', - rule_id: 'rule-2', - }, - ], - securityLinkAnchorComponent: securityLinkAnchorComponentMock, - }) as ReactElement[]; diff --git a/packages/kbn-securitysolution-exception-list-components/src/mocks/value_list_modal.mock.tsx b/packages/kbn-securitysolution-exception-list-components/src/mocks/value_list_modal.mock.tsx deleted file mode 100644 index 930439b577fff..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/mocks/value_list_modal.mock.tsx +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; - -export const mockShowValueListModal = jest.fn(); -export const MockedShowValueListModal = (props: { children: React.ReactNode }) => { - mockShowValueListModal(props); - return <>{props.children}</>; -}; diff --git a/packages/kbn-securitysolution-exception-list-components/src/pagination/pagination.tsx b/packages/kbn-securitysolution-exception-list-components/src/pagination/pagination.tsx deleted file mode 100644 index 38be3b8474ad7..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/pagination/pagination.tsx +++ /dev/null @@ -1,51 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import type { FC } from 'react'; -import { EuiTablePagination } from '@elastic/eui'; - -import type { PaginationProps } from '../types'; -import { usePagination } from './use_pagination'; - -const PaginationComponent: FC<PaginationProps> = ({ - dataTestSubj, - ariaLabel, - pagination, - onPaginationChange, -}) => { - const { - pageIndex, - pageCount, - pageSize, - pageSizeOptions, - - handleItemsPerPageChange, - handlePageIndexChange, - } = usePagination({ pagination, onPaginationChange }); - - return ( - <EuiTablePagination - data-test-subj={dataTestSubj} - aria-label={ariaLabel} - pageCount={pageCount} - activePage={pageIndex} - itemsPerPage={pageSize} - onChangePage={handlePageIndexChange} - onChangeItemsPerPage={handleItemsPerPageChange} - itemsPerPageOptions={pageSizeOptions} - /> - ); -}; - -PaginationComponent.displayName = 'PaginationComponent'; - -export const Pagination = React.memo(PaginationComponent); - -Pagination.displayName = 'Pagination'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/partial_code_signature_callout/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/partial_code_signature_callout/index.tsx deleted file mode 100644 index 72836fc78fb55..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/partial_code_signature_callout/index.tsx +++ /dev/null @@ -1,34 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { i18n } from '@kbn/i18n'; - -import { EuiCallOut } from '@elastic/eui'; - -export const PartialCodeSignatureCallout = () => { - return ( - <EuiCallOut - title={i18n.translate('exceptionList-components.partialCodeSignatureCallout.title', { - defaultMessage: 'Please review your entries', - })} - iconType="warning" - color="warning" - size="s" - data-test-subj="partialCodeSignatureCallout" - > - <FormattedMessage - id="exceptionList-components.partialCodeSignatureCallout.body" - defaultMessage='Please review field values, as your filter criteria may be incomplete. We recommend both the signer name and trust status be included (using the "AND" operator) to avoid potential security gaps.' - tagName="p" - /> - </EuiCallOut> - ); -}; diff --git a/packages/kbn-securitysolution-exception-list-components/src/search_bar/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/search_bar/index.tsx deleted file mode 100644 index 0670a2553a696..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/search_bar/index.tsx +++ /dev/null @@ -1,124 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { useCallback } from 'react'; -import type { FC } from 'react'; - -import type { EuiSearchBarProps, IconType, SearchFilterConfig } from '@elastic/eui'; -import { EuiFlexGroup, EuiFlexItem, EuiButton, EuiSearchBar } from '@elastic/eui'; -import type { ExceptionListTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; -import type { GetExceptionItemProps } from '../types'; - -const ITEMS_SCHEMA = { - strict: true, - fields: { - created_by: { - type: 'string', - }, - description: { - type: 'string', - }, - id: { - type: 'string', - }, - item_id: { - type: 'string', - }, - list_id: { - type: 'string', - }, - name: { - type: 'string', - }, - os_types: { - type: 'string', - }, - tags: { - type: 'string', - }, - }, -}; -interface SearchBarProps { - addExceptionButtonText?: string; - placeholdertext?: string; - canAddException?: boolean; // TODO what is the default value - - // TODO: REFACTOR: not to send the listType and handle it in the Parent - // Exception list type used to determine what type of item is - // being created when "onAddExceptionClick" is invoked - listType: ExceptionListTypeEnum; - isSearching?: boolean; - dataTestSubj?: string; - filters?: SearchFilterConfig[]; // TODO about filters - isButtonFilled?: boolean; - buttonIconType?: IconType; - onSearch: (arg: GetExceptionItemProps) => void; - onAddExceptionClick: (type: ExceptionListTypeEnum) => void; -} -const SearchBarComponent: FC<SearchBarProps> = ({ - addExceptionButtonText, - placeholdertext, - canAddException, - listType, - isSearching, - dataTestSubj, - filters = [], - isButtonFilled = true, - buttonIconType, - onSearch, - onAddExceptionClick, -}) => { - const handleOnSearch = useCallback<NonNullable<EuiSearchBarProps['onChange']>>( - ({ queryText }): void => { - onSearch({ search: queryText }); - }, - [onSearch] - ); - - const handleAddException = useCallback(() => { - // TODO: ASK YARA why we need to send the listType - onAddExceptionClick(listType); - }, [onAddExceptionClick, listType]); - - return ( - <EuiFlexGroup alignItems="center"> - <EuiFlexItem grow={true}> - <EuiSearchBar - box={{ - placeholder: placeholdertext, - incremental: false, - schema: ITEMS_SCHEMA, - 'data-test-subj': `${dataTestSubj || ''}searchBar`, - }} - filters={filters} - onChange={handleOnSearch} - /> - </EuiFlexItem> - {!canAddException && ( - <EuiFlexItem grow={false}> - <EuiButton - data-test-subj={`${dataTestSubj || ''}Button`} - onClick={handleAddException} - isDisabled={isSearching} - fill={isButtonFilled} - iconType={buttonIconType} - > - {addExceptionButtonText} - </EuiButton> - </EuiFlexItem> - )} - </EuiFlexGroup> - ); -}; - -SearchBarComponent.displayName = 'SearchBarComponent'; - -export const SearchBar = React.memo(SearchBarComponent); - -SearchBar.displayName = 'SearchBar'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/index.tsx deleted file mode 100644 index aa5625cfe671c..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/index.tsx +++ /dev/null @@ -1,53 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { FC } from 'react'; -import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { Interpolation, Theme } from '@emotion/react'; -import { textWithEditContainerCss, editIconCss } from './text_with_edit.styles'; -interface TextWithEditProps { - isReadonly: boolean; - dataTestSubj?: string; - text: string; - textCss?: Interpolation<Theme>; - onEdit?: () => void; -} - -const TextWithEditComponent: FC<TextWithEditProps> = ({ - isReadonly, - dataTestSubj, - text, - onEdit, - textCss, -}) => { - return ( - <EuiFlexGroup css={textWithEditContainerCss}> - <EuiFlexItem grow={10}> - <span css={textCss} data-test-subj={`${dataTestSubj || ''}Text`}> - {text} - </span> - </EuiFlexItem> - <EuiFlexItem grow={false} css={editIconCss}> - {isReadonly ? null : ( - <EuiButtonIcon - data-test-subj={`${dataTestSubj || ''}EditIcon`} - aria-label="Edit Text List Header" - iconType="pencil" - onClick={() => (typeof onEdit === 'function' ? onEdit() : null)} - /> - )} - </EuiFlexItem> - </EuiFlexGroup> - ); -}; -TextWithEditComponent.displayName = 'TextWithEditComponent'; - -export const TextWithEdit = React.memo(TextWithEditComponent); - -TextWithEdit.displayName = 'TextWithEdit'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/text_with_edit.styles.ts b/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/text_with_edit.styles.ts deleted file mode 100644 index e293ea0730410..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/text_with_edit.styles.ts +++ /dev/null @@ -1,26 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { css } from '@emotion/react'; -import { euiThemeVars } from '@kbn/ui-theme'; - -export const textWithEditContainerCss = css` - display: flex; - width: fit-content; - align-items: baseline; - padding-bottom: ${euiThemeVars.euiSizeS}; - h1 { - margin-bottom: 0; - } -`; -export const editIconCss = css` - button { - margin-left: -${euiThemeVars.euiSizeM}; - } -`; diff --git a/packages/kbn-securitysolution-exception-list-components/src/translations.ts b/packages/kbn-securitysolution-exception-list-components/src/translations.ts deleted file mode 100644 index dff688d156da8..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/translations.ts +++ /dev/null @@ -1,156 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { i18n } from '@kbn/i18n'; - -export const EMPTY_VIEWER_STATE_EMPTY_TITLE = i18n.translate( - 'exceptionList-components.empty.viewer.state.empty.title', - { - defaultMessage: 'Add exceptions to this list', - } -); - -export const EMPTY_VIEWER_STATE_EMPTY_BODY = i18n.translate( - 'exceptionList-components.empty.viewer.state.empty.body', - { - defaultMessage: 'There is no exception in your list. Create your first exception.', - } -); -export const EMPTY_VIEWER_STATE_EMPTY_SEARCH_TITLE = i18n.translate( - 'exceptionList-components.empty.viewer.state.empty_search.search.title', - { - defaultMessage: 'No results match your search criteria', - } -); - -export const EMPTY_VIEWER_STATE_EMPTY_SEARCH_BODY = i18n.translate( - 'exceptionList-components.empty.viewer.state.empty_search.body', - { - defaultMessage: 'Try modifying your search', - } -); - -export const EMPTY_VIEWER_STATE_EMPTY_VIEWER_BUTTON = (exceptionType: string) => - i18n.translate('exceptionList-components.empty.viewer.state.empty.viewer_button', { - values: { exceptionType }, - defaultMessage: 'Create {exceptionType} exception', - }); - -export const EMPTY_VIEWER_STATE_ERROR_TITLE = i18n.translate( - 'exceptionList-components.empty.viewer.state.error_title', - { - defaultMessage: 'Unable to load exception items', - } -); - -export const EMPTY_VIEWER_STATE_ERROR_BODY = i18n.translate( - 'exceptionList-components.empty.viewer.state.error_body', - { - defaultMessage: - 'There was an error loading the exception items. Contact your administrator for help.', - } -); -export const EXCEPTION_LIST_HEADER_EXPORT_ACTION = i18n.translate( - 'exceptionList-components.exception_list_header_export_action', - { - defaultMessage: 'Export exception list', - } -); -export const EXCEPTION_LIST_HEADER_DELETE_ACTION = i18n.translate( - 'exceptionList-components.exception_list_header_delete_action', - { - defaultMessage: 'Delete exception list', - } -); -export const EXCEPTION_LIST_HEADER_DUPLICATE_ACTION = i18n.translate( - 'exceptionList-components.exception_list_header_duplicate_action', - { - defaultMessage: 'Duplicate exception list', - } -); -export const EXCEPTION_LIST_HEADER_LINK_RULES_BUTTON = i18n.translate( - 'exceptionList-components.exception_list_header_link_rules_button', - { - defaultMessage: 'Link rules', - } -); - -export const EXCEPTION_LIST_HEADER_LINKED_RULES = (noOfRules: number) => - i18n.translate('exceptionList-components.exception_list_header_linked_rules', { - values: { noOfRules }, - defaultMessage: 'Linked to {noOfRules} rules', - }); - -export const EXCEPTION_LIST_HEADER_BREADCRUMB = i18n.translate( - 'exceptionList-components.exception_list_header_breadcrumb', - { - defaultMessage: 'Shared Exception Lists', - } -); - -export const EXCEPTION_LIST_HEADER_LIST_ID = i18n.translate( - 'exceptionList-components.exception_list_header_list_id', - { - defaultMessage: 'List ID', - } -); - -export const EXCEPTION_LIST_HEADER_NAME = i18n.translate( - 'exceptionList-components.exception_list_header_name', - { - defaultMessage: 'Add a name', - } -); - -export const EXCEPTION_LIST_HEADER_DESCRIPTION = i18n.translate( - 'exceptionList-components.exception_list_header_description', - { - defaultMessage: 'Add a description', - } -); - -export const EXCEPTION_LIST_HEADER_EDIT_MODAL_TITLE = (listName: string) => - i18n.translate('exceptionList-components.exception_list_header_edit_modal_name', { - defaultMessage: 'Edit {listName}', - values: { listName }, - }); - -export const EXCEPTION_LIST_HEADER_EDIT_MODAL_SAVE_BUTTON = i18n.translate( - 'exceptionList-components.exception_list_header_edit_modal_save_button', - { - defaultMessage: 'Save', - } -); - -export const EXCEPTION_LIST_HEADER_EDIT_MODAL_CANCEL_BUTTON = i18n.translate( - 'exceptionList-components.exception_list_header_edit_modal_cancel_button', - { - defaultMessage: 'Cancel', - } -); -export const EXCEPTION_LIST_HEADER_NAME_TEXTBOX = i18n.translate( - 'exceptionList-components.exception_list_header_Name_textbox', - { - defaultMessage: 'Name', - } -); - -export const EXCEPTION_LIST_HEADER_DESCRIPTION_TEXTBOX = i18n.translate( - 'exceptionList-components.exception_list_header_description_textbox', - { - defaultMessage: 'Description (optional)', - } -); - -export const LIST_NAME_REQUIRED_ERROR = i18n.translate( - 'exceptionList-components.exception_list_header_description_textboxexceptionList-components.exception_list_header_name_required_eror', - { - defaultMessage: 'List name cannot be empty', - } -); diff --git a/packages/kbn-securitysolution-exception-list-components/src/types/index.ts b/packages/kbn-securitysolution-exception-list-components/src/types/index.ts deleted file mode 100644 index 57a0ee3901ba4..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/types/index.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ListArray } from '@kbn/securitysolution-io-ts-list-types'; - -import type { Pagination } from '@elastic/eui'; -import type { NamespaceType } from '@kbn/securitysolution-io-ts-list-types'; - -export interface GetExceptionItemProps { - pagination?: PaginationProps['pagination']; - search?: string; - filters?: string; -} - -export interface PaginationProps { - dataTestSubj?: string; - ariaLabel?: string; - pagination: Pagination & { pageSize: number }; - onPaginationChange: (arg: GetExceptionItemProps) => void; -} - -export enum ViewerStatus { - ERROR = 'error', - EMPTY = 'empty', - EMPTY_SEARCH = 'empty_search', - LOADING = 'loading', - SEARCHING = 'searching', - DELETING = 'deleting', -} - -export interface ExceptionListSummaryProps { - pagination: Pagination; - // Corresponds to last time exception items were fetched - lastUpdated: string | number | null; -} - -export type ViewerFlyoutName = 'addException' | 'editException' | null; - -export interface RuleReferences { - [key: string]: RuleReference; -} - -export interface ExceptionListItemIdentifiers { - id: string; - name: string; - namespaceType: NamespaceType; -} - -export enum ListTypeText { - ENDPOINT = 'endpoint', - DETECTION = 'empty', - RULE_DEFAULT = 'empty_search', -} -export interface Rule { - name: string; - id: string; - rule_id: string; - exceptions_list?: ListArray; -} - -export interface RuleReference { - name: string; - id: string; - referenced_rules: Rule[]; - listId?: string; -} - -export interface ListDetails { - name: string; - description?: string; -} diff --git a/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/index.ts b/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/index.ts deleted file mode 100644 index 5a0843be833f7..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/index.ts +++ /dev/null @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export { ValueWithSpaceWarning } from './value_with_space_warning'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/use_value_with_space_warning.ts b/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/use_value_with_space_warning.ts deleted file mode 100644 index d5a6392815a78..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/use_value_with_space_warning.ts +++ /dev/null @@ -1,33 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { paramContainsSpace, autoCompletei18n } from '@kbn/securitysolution-autocomplete'; - -interface UseValueWithSpaceWarningResult { - showSpaceWarningIcon: boolean; - warningText: string; -} -interface UseValueWithSpaceWarningProps { - value: string | string[]; - tooltipIconText?: string; -} - -export const useValueWithSpaceWarning = ({ - value, - tooltipIconText, -}: UseValueWithSpaceWarningProps): UseValueWithSpaceWarningResult => { - const showSpaceWarningIcon = Array.isArray(value) - ? value.find(paramContainsSpace) - : paramContainsSpace(value); - - return { - showSpaceWarningIcon: !!showSpaceWarningIcon, - warningText: tooltipIconText || autoCompletei18n.FIELD_SPACE_WARNING, - }; -}; diff --git a/packages/kbn-securitysolution-exception-list-components/src/wildcard_with_wrong_operator_callout/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/wildcard_with_wrong_operator_callout/index.tsx deleted file mode 100644 index d68782b4c17f8..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/src/wildcard_with_wrong_operator_callout/index.tsx +++ /dev/null @@ -1,53 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { i18n } from '@kbn/i18n'; - -import { EuiCallOut } from '@elastic/eui'; - -export const WildCardWithWrongOperatorCallout = () => { - return ( - <EuiCallOut - title={i18n.translate('exceptionList-components.wildcardWithWrongOperatorCallout.title', { - defaultMessage: 'Please review your entries', - })} - iconType="warning" - color="warning" - size="s" - data-test-subj="wildcardWithWrongOperatorCallout" - > - <p> - <FormattedMessage - id="exceptionList-components.wildcardWithWrongOperatorCallout.body" - defaultMessage='Using a "*" or a "?" in the value with the "is" operator can make the entry ineffective. {operator} to "{matches}" to ensure wildcards run properly.' - values={{ - operator: ( - <strong> - {i18n.translate( - 'exceptionList-components.wildcardWithWrongOperatorCallout.changeTheOperator', - { defaultMessage: 'Change the operator' } - )} - </strong> - ), - matches: ( - <strong> - {i18n.translate( - 'exceptionList-components.wildcardWithWrongOperatorCallout.matches', - { defaultMessage: 'matches' } - )} - </strong> - ), - }} - /> - </p> - </EuiCallOut> - ); -}; diff --git a/packages/kbn-securitysolution-exception-list-components/tsconfig.json b/packages/kbn-securitysolution-exception-list-components/tsconfig.json deleted file mode 100644 index b3df3a2aa208b..0000000000000 --- a/packages/kbn-securitysolution-exception-list-components/tsconfig.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node", - "react", - "@emotion/react/types/css-prop" - ] - }, - "include": [ - "**/*.ts", - "**/*.tsx", - "**/*.d.ts" - ], - "kbn_references": [ - "@kbn/securitysolution-io-ts-list-types", - "@kbn/securitysolution-autocomplete", - "@kbn/ui-theme", - "@kbn/i18n", - "@kbn/i18n-react", - ], - "exclude": [ - "target/**/*", - ] -} diff --git a/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.gen.ts deleted file mode 100644 index aedd1f5fc5cc6..0000000000000 --- a/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.gen.ts +++ /dev/null @@ -1,39 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* - * NOTICE: Do not edit this file manually. - * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. - * - * info: - * title: Create shared exception list API endpoint - * version: 2023-10-31 - */ - -import { z } from '@kbn/zod'; - -import { - ExceptionListName, - ExceptionListDescription, - ExceptionList, -} from '../model/exception_list_common.gen'; - -export type CreateSharedExceptionListRequestBody = z.infer< - typeof CreateSharedExceptionListRequestBody ->; -export const CreateSharedExceptionListRequestBody = z.object({ - name: ExceptionListName, - description: ExceptionListDescription, -}); -export type CreateSharedExceptionListRequestBodyInput = z.input< - typeof CreateSharedExceptionListRequestBody ->; - -export type CreateSharedExceptionListResponse = z.infer<typeof CreateSharedExceptionListResponse>; -export const CreateSharedExceptionListResponse = ExceptionList; diff --git a/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.schema.yaml b/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.schema.yaml deleted file mode 100644 index c4cee089e5836..0000000000000 --- a/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.schema.yaml +++ /dev/null @@ -1,68 +0,0 @@ -openapi: 3.0.0 -info: - title: Create shared exception list API endpoint - version: '2023-10-31' -paths: - /api/exceptions/shared: - post: - x-labels: [serverless, ess] - operationId: CreateSharedExceptionList - x-codegen-enabled: true - summary: Create a shared exception list - description: | - An exception list groups exception items and can be associated with detection rules. A shared exception list can apply to multiple detection rules. - > info - > All exception items added to the same list are evaluated using `OR` logic. That is, if any of the items in a list evaluate to `true`, the exception prevents the rule from generating an alert. Likewise, `OR` logic is used for evaluating exceptions when more than one exception list is assigned to a rule. To use the `AND` operator, you can define multiple clauses (`entries`) in a single exception item. - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - name: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListName' - description: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListDescription' - required: - - name - - description - responses: - 200: - description: Successful response - content: - application/json: - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionList' - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 409: - description: Exception list already exists response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.schema.yaml b/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.schema.yaml deleted file mode 100644 index 92afc3232efee..0000000000000 --- a/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.schema.yaml +++ /dev/null @@ -1,70 +0,0 @@ -openapi: 3.0.0 -info: - title: Delete exception list API endpoint - version: '2023-10-31' -paths: - /api/exception_lists: - delete: - x-labels: [serverless, ess] - operationId: DeleteExceptionList - x-codegen-enabled: true - summary: Delete an exception list - description: Delete an exception list using the `id` or `list_id` field. - parameters: - - name: id - in: query - required: false - description: Either `id` or `list_id` must be specified - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListId' - - name: list_id - in: query - required: false - description: Either `id` or `list_id` must be specified - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListHumanId' - - name: namespace_type - in: query - required: false - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionNamespaceType' - default: single - responses: - 200: - description: Successful response - content: - application/json: - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionList' - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 404: - description: Exception list not found response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.schema.yaml b/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.schema.yaml deleted file mode 100644 index 9f57afcd5ab1c..0000000000000 --- a/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.schema.yaml +++ /dev/null @@ -1,70 +0,0 @@ -openapi: 3.0.0 -info: - title: Delete exception list item API endpoint - version: '2023-10-31' -paths: - /api/exception_lists/items: - delete: - x-labels: [serverless, ess] - operationId: DeleteExceptionListItem - x-codegen-enabled: true - summary: Delete an exception list item - description: Delete an exception list item using the `id` or `item_id` field. - parameters: - - name: id - in: query - required: false - description: Either `id` or `item_id` must be specified - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListItemId' - - name: item_id - in: query - required: false - description: Either `id` or `item_id` must be specified - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListItemHumanId' - - name: namespace_type - in: query - required: false - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionNamespaceType' - default: single - responses: - 200: - description: Successful response - content: - application/json: - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListItem' - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 404: - description: Exception list item not found response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.schema.yaml b/packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.schema.yaml deleted file mode 100644 index 758171327ee4c..0000000000000 --- a/packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.schema.yaml +++ /dev/null @@ -1,71 +0,0 @@ -openapi: 3.0.0 -info: - title: Duplicate exception list API endpoint - version: '2023-10-31' -paths: - /api/exception_lists/_duplicate: - post: - x-labels: [serverless, ess] - operationId: DuplicateExceptionList - x-codegen-enabled: true - summary: Duplicate an exception list - description: Duplicate an existing exception list. - parameters: - - name: list_id - in: query - required: true - description: Exception list's human identifier - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListHumanId' - - name: namespace_type - in: query - required: true - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionNamespaceType' - - name: include_expired_exceptions - in: query - required: true - description: Determines whether to include expired exceptions in the exported list - schema: - type: string - enum: ['true', 'false'] - default: 'true' - responses: - 200: - description: Successful response - content: - application/json: - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionList' - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 405: - description: Exception list to duplicate not found response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.gen.ts deleted file mode 100644 index 9645b8ac793cb..0000000000000 --- a/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.gen.ts +++ /dev/null @@ -1,43 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* - * NOTICE: Do not edit this file manually. - * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. - * - * info: - * title: Export exception list API endpoint - * version: 2023-10-31 - */ - -import { z } from '@kbn/zod'; - -import { - ExceptionListId, - ExceptionListHumanId, - ExceptionNamespaceType, -} from '../model/exception_list_common.gen'; - -export type ExportExceptionListRequestQuery = z.infer<typeof ExportExceptionListRequestQuery>; -export const ExportExceptionListRequestQuery = z.object({ - /** - * Exception list's identifier - */ - id: ExceptionListId, - /** - * Exception list's human identifier - */ - list_id: ExceptionListHumanId, - namespace_type: ExceptionNamespaceType, - /** - * Determines whether to include expired exceptions in the exported list - */ - include_expired_exceptions: z.enum(['true', 'false']).default('true'), -}); -export type ExportExceptionListRequestQueryInput = z.input<typeof ExportExceptionListRequestQuery>; diff --git a/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.schema.yaml b/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.schema.yaml deleted file mode 100644 index 3232f46c238c8..0000000000000 --- a/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.schema.yaml +++ /dev/null @@ -1,79 +0,0 @@ -openapi: 3.0.0 -info: - title: Export exception list API endpoint - version: '2023-10-31' -paths: - /api/exception_lists/_export: - post: - x-labels: [serverless, ess] - operationId: ExportExceptionList - x-codegen-enabled: true - summary: Export an exception list - description: Export an exception list and its associated items to an NDJSON file. - parameters: - - name: id - in: query - required: true - description: Exception list's identifier - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListId' - - name: list_id - in: query - required: true - description: Exception list's human identifier - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListHumanId' - - name: namespace_type - in: query - required: true - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionNamespaceType' - - name: include_expired_exceptions - in: query - required: true - description: Determines whether to include expired exceptions in the exported list - schema: - type: string - enum: ['true', 'false'] - default: 'true' - responses: - 200: - description: Successful response - content: - application/ndjson: - schema: - type: string - format: binary - description: A `.ndjson` file containing specified exception list and its items - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 404: - description: Exception list not found response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-exceptions-common/api/index.ts b/packages/kbn-securitysolution-exceptions-common/api/index.ts deleted file mode 100644 index fd6722b67ace3..0000000000000 --- a/packages/kbn-securitysolution-exceptions-common/api/index.ts +++ /dev/null @@ -1,27 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './model/exception_list_common.gen'; -export * from './model/exception_list_item_entry.gen'; -export * from './create_exception_list_item/create_exception_list_item.gen'; -export * from './create_rule_exceptions/create_rule_exceptions.gen'; -export * from './create_shared_exceptions_list/create_shared_exceptions_list.gen'; -export * from './create_exception_list/create_exception_list.gen'; -export * from './delete_exception_list_item/delete_exception_list_item.gen'; -export * from './delete_exception_list/delete_exception_list.gen'; -export * from './duplicate_exception_list/duplicate_exception_list.gen'; -export * from './export_exception_list/export_exception_list.gen'; -export * from './find_exception_list_items/find_exception_list_items.gen'; -export * from './find_exception_lists/find_exception_lists.gen'; -export * from './import_exceptions/import_exceptions.gen'; -export * from './read_exception_list_item/read_exception_list_item.gen'; -export * from './read_exception_list/read_exception_list.gen'; -export * from './read_exception_list_summary/read_exception_list_summary.gen'; -export * from './update_exception_list_item/update_exception_list_item.gen'; -export * from './update_exception_list/update_exception_list.gen'; diff --git a/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.schema.yaml b/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.schema.yaml deleted file mode 100644 index 883a62e5bbec5..0000000000000 --- a/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.schema.yaml +++ /dev/null @@ -1,147 +0,0 @@ -openapi: 3.0.0 -info: - title: Common Exception List Item Entry Attributes - version: 'not applicable' -paths: {} -components: - x-codegen-enabled: true - schemas: - ExceptionListItemEntryOperator: - type: string - enum: [excluded, included] - - ExceptionListItemEntryMatch: - type: object - properties: - type: - type: string - enum: [match] - field: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - value: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - operator: - $ref: '#/components/schemas/ExceptionListItemEntryOperator' - required: - - type - - field - - value - - operator - - ExceptionListItemEntryMatchAny: - type: object - properties: - type: - type: string - enum: [match_any] - field: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - value: - type: array - items: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - minItems: 1 - operator: - $ref: '#/components/schemas/ExceptionListItemEntryOperator' - required: - - type - - field - - value - - operator - - ExceptionListItemEntryList: - type: object - properties: - type: - type: string - enum: [list] - field: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - list: - type: object - properties: - id: - $ref: '../../../kbn-securitysolution-lists-common/api/model/list_common.schema.yaml#/components/schemas/ListId' - type: - $ref: '../../../kbn-securitysolution-lists-common/api/model/list_common.schema.yaml#/components/schemas/ListType' - required: [id, type] - operator: - $ref: '#/components/schemas/ExceptionListItemEntryOperator' - required: - - type - - field - - list - - operator - - ExceptionListItemEntryExists: - type: object - properties: - type: - type: string - enum: [exists] - field: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - operator: - $ref: '#/components/schemas/ExceptionListItemEntryOperator' - required: - - type - - field - - operator - - ExceptionListItemEntryNestedEntryItem: - oneOf: - - $ref: '#/components/schemas/ExceptionListItemEntryMatch' - - $ref: '#/components/schemas/ExceptionListItemEntryMatchAny' - - $ref: '#/components/schemas/ExceptionListItemEntryExists' - - ExceptionListItemEntryNested: - type: object - properties: - type: - type: string - enum: [nested] - field: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - entries: - type: array - items: - $ref: '#/components/schemas/ExceptionListItemEntryNestedEntryItem' - minItems: 1 - required: - - type - - field - - entries - - ExceptionListItemEntryMatchWildcard: - type: object - properties: - type: - type: string - enum: [wildcard] - field: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - value: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - operator: - $ref: '#/components/schemas/ExceptionListItemEntryOperator' - required: - - type - - field - - value - - operator - - ExceptionListItemEntry: - discriminator: - propertyName: type - anyOf: - - $ref: '#/components/schemas/ExceptionListItemEntryMatch' - - $ref: '#/components/schemas/ExceptionListItemEntryMatchAny' - - $ref: '#/components/schemas/ExceptionListItemEntryList' - - $ref: '#/components/schemas/ExceptionListItemEntryExists' - - $ref: '#/components/schemas/ExceptionListItemEntryNested' - - $ref: '#/components/schemas/ExceptionListItemEntryMatchWildcard' - - ExceptionListItemEntryArray: - type: array - items: - $ref: '#/components/schemas/ExceptionListItemEntry' diff --git a/packages/kbn-securitysolution-exceptions-common/api/quickstart_client.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/quickstart_client.gen.ts deleted file mode 100644 index 4827baab85e90..0000000000000 --- a/packages/kbn-securitysolution-exceptions-common/api/quickstart_client.gen.ts +++ /dev/null @@ -1,427 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* - * NOTICE: Do not edit this file manually. - * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. - * - * info: - * title: Exceptions API client for quickstart - * version: Bundle (no version) - */ - -import type { KbnClient } from '@kbn/test'; -import { ToolingLog } from '@kbn/tooling-log'; -import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; -import { replaceParams } from '@kbn/openapi-common/shared'; -import { catchAxiosErrorFormatAndThrow } from '@kbn/securitysolution-utils'; - -import type { - CreateExceptionListItemRequestBodyInput, - CreateExceptionListItemResponse, -} from './create_exception_list_item/create_exception_list_item.gen'; -import type { - CreateExceptionListRequestBodyInput, - CreateExceptionListResponse, -} from './create_exception_list/create_exception_list.gen'; -import type { - CreateRuleExceptionListItemsRequestParamsInput, - CreateRuleExceptionListItemsRequestBodyInput, - CreateRuleExceptionListItemsResponse, -} from './create_rule_exceptions/create_rule_exceptions.gen'; -import type { - CreateSharedExceptionListRequestBodyInput, - CreateSharedExceptionListResponse, -} from './create_shared_exceptions_list/create_shared_exceptions_list.gen'; -import type { - DeleteExceptionListItemRequestQueryInput, - DeleteExceptionListItemResponse, -} from './delete_exception_list_item/delete_exception_list_item.gen'; -import type { - DeleteExceptionListRequestQueryInput, - DeleteExceptionListResponse, -} from './delete_exception_list/delete_exception_list.gen'; -import type { - DuplicateExceptionListRequestQueryInput, - DuplicateExceptionListResponse, -} from './duplicate_exception_list/duplicate_exception_list.gen'; -import type { ExportExceptionListRequestQueryInput } from './export_exception_list/export_exception_list.gen'; -import type { - FindExceptionListItemsRequestQueryInput, - FindExceptionListItemsResponse, -} from './find_exception_list_items/find_exception_list_items.gen'; -import type { - FindExceptionListsRequestQueryInput, - FindExceptionListsResponse, -} from './find_exception_lists/find_exception_lists.gen'; -import type { - ImportExceptionListRequestQueryInput, - ImportExceptionListResponse, -} from './import_exceptions/import_exceptions.gen'; -import type { - ReadExceptionListItemRequestQueryInput, - ReadExceptionListItemResponse, -} from './read_exception_list_item/read_exception_list_item.gen'; -import type { - ReadExceptionListSummaryRequestQueryInput, - ReadExceptionListSummaryResponse, -} from './read_exception_list_summary/read_exception_list_summary.gen'; -import type { - ReadExceptionListRequestQueryInput, - ReadExceptionListResponse, -} from './read_exception_list/read_exception_list.gen'; -import type { - UpdateExceptionListItemRequestBodyInput, - UpdateExceptionListItemResponse, -} from './update_exception_list_item/update_exception_list_item.gen'; -import type { - UpdateExceptionListRequestBodyInput, - UpdateExceptionListResponse, -} from './update_exception_list/update_exception_list.gen'; - -export interface ClientOptions { - kbnClient: KbnClient; - log: ToolingLog; -} - -export class Client { - readonly kbnClient: KbnClient; - readonly log: ToolingLog; - - constructor(options: ClientOptions) { - this.kbnClient = options.kbnClient; - this.log = options.log; - } - /** - * An exception list groups exception items and can be associated with detection rules. You can assign detection rules with multiple exception lists. -> info -> All exception items added to the same list are evaluated using `OR` logic. That is, if any of the items in a list evaluate to `true`, the exception prevents the rule from generating an alert. Likewise, `OR` logic is used for evaluating exceptions when more than one exception list is assigned to a rule. To use the `AND` operator, you can define multiple clauses (`entries`) in a single exception item. - - */ - async createExceptionList(props: CreateExceptionListProps) { - this.log.info(`${new Date().toISOString()} Calling API CreateExceptionList`); - return this.kbnClient - .request<CreateExceptionListResponse>({ - path: '/api/exception_lists', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'POST', - body: props.body, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Create an exception item and associate it with the specified exception list. -> info -> Before creating exception items, you must create an exception list. - - */ - async createExceptionListItem(props: CreateExceptionListItemProps) { - this.log.info(`${new Date().toISOString()} Calling API CreateExceptionListItem`); - return this.kbnClient - .request<CreateExceptionListItemResponse>({ - path: '/api/exception_lists/items', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'POST', - body: props.body, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Create exception items that apply to a single detection rule. - */ - async createRuleExceptionListItems(props: CreateRuleExceptionListItemsProps) { - this.log.info(`${new Date().toISOString()} Calling API CreateRuleExceptionListItems`); - return this.kbnClient - .request<CreateRuleExceptionListItemsResponse>({ - path: replaceParams('/api/detection_engine/rules/{id}/exceptions', props.params), - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'POST', - body: props.body, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * An exception list groups exception items and can be associated with detection rules. A shared exception list can apply to multiple detection rules. -> info -> All exception items added to the same list are evaluated using `OR` logic. That is, if any of the items in a list evaluate to `true`, the exception prevents the rule from generating an alert. Likewise, `OR` logic is used for evaluating exceptions when more than one exception list is assigned to a rule. To use the `AND` operator, you can define multiple clauses (`entries`) in a single exception item. - - */ - async createSharedExceptionList(props: CreateSharedExceptionListProps) { - this.log.info(`${new Date().toISOString()} Calling API CreateSharedExceptionList`); - return this.kbnClient - .request<CreateSharedExceptionListResponse>({ - path: '/api/exceptions/shared', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'POST', - body: props.body, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Delete an exception list using the `id` or `list_id` field. - */ - async deleteExceptionList(props: DeleteExceptionListProps) { - this.log.info(`${new Date().toISOString()} Calling API DeleteExceptionList`); - return this.kbnClient - .request<DeleteExceptionListResponse>({ - path: '/api/exception_lists', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'DELETE', - - query: props.query, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Delete an exception list item using the `id` or `item_id` field. - */ - async deleteExceptionListItem(props: DeleteExceptionListItemProps) { - this.log.info(`${new Date().toISOString()} Calling API DeleteExceptionListItem`); - return this.kbnClient - .request<DeleteExceptionListItemResponse>({ - path: '/api/exception_lists/items', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'DELETE', - - query: props.query, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Duplicate an existing exception list. - */ - async duplicateExceptionList(props: DuplicateExceptionListProps) { - this.log.info(`${new Date().toISOString()} Calling API DuplicateExceptionList`); - return this.kbnClient - .request<DuplicateExceptionListResponse>({ - path: '/api/exception_lists/_duplicate', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'POST', - - query: props.query, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Export an exception list and its associated items to an NDJSON file. - */ - async exportExceptionList(props: ExportExceptionListProps) { - this.log.info(`${new Date().toISOString()} Calling API ExportExceptionList`); - return this.kbnClient - .request({ - path: '/api/exception_lists/_export', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'POST', - - query: props.query, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Get a list of all exception list items in the specified list. - */ - async findExceptionListItems(props: FindExceptionListItemsProps) { - this.log.info(`${new Date().toISOString()} Calling API FindExceptionListItems`); - return this.kbnClient - .request<FindExceptionListItemsResponse>({ - path: '/api/exception_lists/items/_find', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'GET', - - query: props.query, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Get a list of all exception lists. - */ - async findExceptionLists(props: FindExceptionListsProps) { - this.log.info(`${new Date().toISOString()} Calling API FindExceptionLists`); - return this.kbnClient - .request<FindExceptionListsResponse>({ - path: '/api/exception_lists/_find', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'GET', - - query: props.query, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Import an exception list and its associated items from an NDJSON file. - */ - async importExceptionList(props: ImportExceptionListProps) { - this.log.info(`${new Date().toISOString()} Calling API ImportExceptionList`); - return this.kbnClient - .request<ImportExceptionListResponse>({ - path: '/api/exception_lists/_import', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'POST', - body: props.attachment, - query: props.query, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Get the details of an exception list using the `id` or `list_id` field. - */ - async readExceptionList(props: ReadExceptionListProps) { - this.log.info(`${new Date().toISOString()} Calling API ReadExceptionList`); - return this.kbnClient - .request<ReadExceptionListResponse>({ - path: '/api/exception_lists', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'GET', - - query: props.query, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Get the details of an exception list item using the `id` or `item_id` field. - */ - async readExceptionListItem(props: ReadExceptionListItemProps) { - this.log.info(`${new Date().toISOString()} Calling API ReadExceptionListItem`); - return this.kbnClient - .request<ReadExceptionListItemResponse>({ - path: '/api/exception_lists/items', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'GET', - - query: props.query, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Get a summary of the specified exception list. - */ - async readExceptionListSummary(props: ReadExceptionListSummaryProps) { - this.log.info(`${new Date().toISOString()} Calling API ReadExceptionListSummary`); - return this.kbnClient - .request<ReadExceptionListSummaryResponse>({ - path: '/api/exception_lists/summary', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'GET', - - query: props.query, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Update an exception list using the `id` or `list_id` field. - */ - async updateExceptionList(props: UpdateExceptionListProps) { - this.log.info(`${new Date().toISOString()} Calling API UpdateExceptionList`); - return this.kbnClient - .request<UpdateExceptionListResponse>({ - path: '/api/exception_lists', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'PUT', - body: props.body, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Update an exception list item using the `id` or `item_id` field. - */ - async updateExceptionListItem(props: UpdateExceptionListItemProps) { - this.log.info(`${new Date().toISOString()} Calling API UpdateExceptionListItem`); - return this.kbnClient - .request<UpdateExceptionListItemResponse>({ - path: '/api/exception_lists/items', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'PUT', - body: props.body, - }) - .catch(catchAxiosErrorFormatAndThrow); - } -} - -export interface CreateExceptionListProps { - body: CreateExceptionListRequestBodyInput; -} -export interface CreateExceptionListItemProps { - body: CreateExceptionListItemRequestBodyInput; -} -export interface CreateRuleExceptionListItemsProps { - params: CreateRuleExceptionListItemsRequestParamsInput; - body: CreateRuleExceptionListItemsRequestBodyInput; -} -export interface CreateSharedExceptionListProps { - body: CreateSharedExceptionListRequestBodyInput; -} -export interface DeleteExceptionListProps { - query: DeleteExceptionListRequestQueryInput; -} -export interface DeleteExceptionListItemProps { - query: DeleteExceptionListItemRequestQueryInput; -} -export interface DuplicateExceptionListProps { - query: DuplicateExceptionListRequestQueryInput; -} -export interface ExportExceptionListProps { - query: ExportExceptionListRequestQueryInput; -} -export interface FindExceptionListItemsProps { - query: FindExceptionListItemsRequestQueryInput; -} -export interface FindExceptionListsProps { - query: FindExceptionListsRequestQueryInput; -} -export interface ImportExceptionListProps { - query: ImportExceptionListRequestQueryInput; - attachment: FormData; -} -export interface ReadExceptionListProps { - query: ReadExceptionListRequestQueryInput; -} -export interface ReadExceptionListItemProps { - query: ReadExceptionListItemRequestQueryInput; -} -export interface ReadExceptionListSummaryProps { - query: ReadExceptionListSummaryRequestQueryInput; -} -export interface UpdateExceptionListProps { - body: UpdateExceptionListRequestBodyInput; -} -export interface UpdateExceptionListItemProps { - body: UpdateExceptionListItemRequestBodyInput; -} diff --git a/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.gen.ts b/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.gen.ts deleted file mode 100644 index 67a832b01195c..0000000000000 --- a/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.gen.ts +++ /dev/null @@ -1,43 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* - * NOTICE: Do not edit this file manually. - * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. - * - * info: - * title: Read exception list API endpoint - * version: 2023-10-31 - */ - -import { z } from '@kbn/zod'; - -import { - ExceptionListId, - ExceptionListHumanId, - ExceptionNamespaceType, - ExceptionList, -} from '../model/exception_list_common.gen'; - -export type ReadExceptionListRequestQuery = z.infer<typeof ReadExceptionListRequestQuery>; -export const ReadExceptionListRequestQuery = z.object({ - /** - * Either `id` or `list_id` must be specified - */ - id: ExceptionListId.optional(), - /** - * Either `id` or `list_id` must be specified - */ - list_id: ExceptionListHumanId.optional(), - namespace_type: ExceptionNamespaceType.optional().default('single'), -}); -export type ReadExceptionListRequestQueryInput = z.input<typeof ReadExceptionListRequestQuery>; - -export type ReadExceptionListResponse = z.infer<typeof ReadExceptionListResponse>; -export const ReadExceptionListResponse = ExceptionList; diff --git a/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.schema.yaml b/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.schema.yaml deleted file mode 100644 index 0bf082c1713bd..0000000000000 --- a/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.schema.yaml +++ /dev/null @@ -1,70 +0,0 @@ -openapi: 3.0.0 -info: - title: Read exception list API endpoint - version: '2023-10-31' -paths: - /api/exception_lists: - get: - x-labels: [serverless, ess] - operationId: ReadExceptionList - x-codegen-enabled: true - summary: Get exception list details - description: Get the details of an exception list using the `id` or `list_id` field. - parameters: - - name: id - in: query - required: false - description: Either `id` or `list_id` must be specified - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListId' - - name: list_id - in: query - required: false - description: Either `id` or `list_id` must be specified - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListHumanId' - - name: namespace_type - in: query - required: false - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionNamespaceType' - default: single - responses: - 200: - description: Successful response - content: - application/json: - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionList' - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 404: - description: Exception list item not found response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.schema.yaml b/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.schema.yaml deleted file mode 100644 index c271016a87eb5..0000000000000 --- a/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.schema.yaml +++ /dev/null @@ -1,70 +0,0 @@ -openapi: 3.0.0 -info: - title: Read exception list item API endpoint - version: '2023-10-31' -paths: - /api/exception_lists/items: - get: - x-labels: [serverless, ess] - operationId: ReadExceptionListItem - x-codegen-enabled: true - summary: Get an exception list item - description: Get the details of an exception list item using the `id` or `item_id` field. - parameters: - - name: id - in: query - required: false - description: Either `id` or `item_id` must be specified - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListItemId' - - name: item_id - in: query - required: false - description: Either `id` or `item_id` must be specified - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListItemHumanId' - - name: namespace_type - in: query - required: false - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionNamespaceType' - default: single - responses: - 200: - description: Successful response - content: - application/json: - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListItem' - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 404: - description: Exception list item not found response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.schema.yaml b/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.schema.yaml deleted file mode 100644 index b0627111e877f..0000000000000 --- a/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.schema.yaml +++ /dev/null @@ -1,89 +0,0 @@ -openapi: 3.0.0 -info: - title: Read exception list summary API endpoint - version: '2023-10-31' -paths: - /api/exception_lists/summary: - get: - x-labels: [serverless, ess] - operationId: ReadExceptionListSummary - x-codegen-enabled: true - summary: Get an exception list summary - description: Get a summary of the specified exception list. - parameters: - - name: id - in: query - required: false - description: Exception list's identifier generated upon creation - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListId' - - name: list_id - in: query - required: false - description: Exception list's human readable identifier - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListHumanId' - - name: namespace_type - in: query - required: false - schema: - $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionNamespaceType' - default: single - - name: filter - in: query - required: false - description: Search filter clause - schema: - type: string - responses: - 200: - description: Successful response - content: - application/json: - schema: - type: object - properties: - windows: - type: integer - minimum: 0 - linux: - type: integer - minimum: 0 - macos: - type: integer - minimum: 0 - total: - type: integer - minimum: 0 - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 404: - description: Exception list not found response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-exceptions-common/package.json b/packages/kbn-securitysolution-exceptions-common/package.json deleted file mode 100644 index 5148c4d5eedf5..0000000000000 --- a/packages/kbn-securitysolution-exceptions-common/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "description": "Security Solution Exceptions common package", - "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0", - "name": "@kbn/securitysolution-exceptions-common", - "private": true, - "version": "1.0.0", - "scripts": { - "openapi:generate": "node scripts/openapi_generate", - "openapi:bundle": "node scripts/openapi_bundle" - } -} diff --git a/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle.js b/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle.js deleted file mode 100644 index 70299e56eac2e..0000000000000 --- a/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle.js +++ /dev/null @@ -1,40 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -require('../../../src/setup_node_env'); -const { join, resolve } = require('path'); -const { bundle } = require('@kbn/openapi-bundler'); - -const ROOT = resolve(__dirname, '..'); - -(async () => { - await bundle({ - sourceGlob: join(ROOT, 'api/**/*.schema.yaml'), - outputFilePath: join( - ROOT, - 'docs/openapi/serverless/security_solution_exceptions_api_{version}.bundled.schema.yaml' - ), - options: { - includeLabels: ['serverless'], - prototypeDocument: join(ROOT, 'scripts/openapi_bundle_info/exceptions_serverless.info.yaml'), - }, - }); - - await bundle({ - sourceGlob: join(ROOT, 'api/**/*.schema.yaml'), - outputFilePath: join( - ROOT, - 'docs/openapi/ess/security_solution_exceptions_api_{version}.bundled.schema.yaml' - ), - options: { - includeLabels: ['ess'], - prototypeDocument: join(ROOT, 'scripts/openapi_bundle_info/exceptions_ess.info.yaml'), - }, - }); -})(); diff --git a/packages/kbn-securitysolution-exceptions-common/scripts/openapi_generate.js b/packages/kbn-securitysolution-exceptions-common/scripts/openapi_generate.js deleted file mode 100644 index 13b260476f3a3..0000000000000 --- a/packages/kbn-securitysolution-exceptions-common/scripts/openapi_generate.js +++ /dev/null @@ -1,52 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -require('../../../src/setup_node_env'); -const { join, resolve } = require('path'); -const { generate } = require('@kbn/openapi-generator'); -const { REPO_ROOT } = require('@kbn/repo-info'); - -const ROOT = resolve(__dirname, '..'); - -(async () => { - await generate({ - title: 'OpenAPI Exceptions API Schemas', - rootDir: ROOT, - sourceGlob: './api/**/*.schema.yaml', - templateName: 'zod_operation_schema', - }); - - await generate({ - title: 'Exceptions API client for tests', - rootDir: ROOT, - sourceGlob: './api/**/*.schema.yaml', - templateName: 'api_client_supertest', - skipLinting: true, - bundle: { - outFile: join( - REPO_ROOT, - 'x-pack/test/api_integration/services/security_solution_exceptions_api.gen.ts' - ), - }, - }); - - await generate({ - title: 'Exceptions API client for quickstart', - rootDir: ROOT, - sourceGlob: './api/**/*.schema.yaml', - templateName: 'api_client_quickstart', - skipLinting: true, - bundle: { - outFile: join( - REPO_ROOT, - 'packages/kbn-securitysolution-exceptions-common/api/quickstart_client.gen.ts' - ), - }, - }); -})(); diff --git a/packages/kbn-securitysolution-exceptions-common/tsconfig.json b/packages/kbn-securitysolution-exceptions-common/tsconfig.json deleted file mode 100644 index a58753f53a4fb..0000000000000 --- a/packages/kbn-securitysolution-exceptions-common/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "outDir": "target/types", - "types": ["jest", "node"] - }, - "exclude": ["target/**/*"], - "extends": "../../tsconfig.base.json", - "include": ["**/*.ts"], - "kbn_references": [ - "@kbn/openapi-common", - "@kbn/zod-helpers", - "@kbn/securitysolution-lists-common", - "@kbn/test", - "@kbn/tooling-log", - "@kbn/core-http-common", - "@kbn/securitysolution-utils", - "@kbn/zod", - ] -} diff --git a/packages/kbn-securitysolution-hook-utils/index.ts b/packages/kbn-securitysolution-hook-utils/index.ts deleted file mode 100644 index be336bddcf9b5..0000000000000 --- a/packages/kbn-securitysolution-hook-utils/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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './src/types'; -export * from './src/use_async'; -export * from './src/use_is_mounted'; -export * from './src/use_observable'; -export * from './src/with_optional_signal'; diff --git a/packages/kbn-securitysolution-hook-utils/jest.config.js b/packages/kbn-securitysolution-hook-utils/jest.config.js deleted file mode 100644 index badea193370b6..0000000000000 --- a/packages/kbn-securitysolution-hook-utils/jest.config.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../..', - roots: ['<rootDir>/packages/kbn-securitysolution-hook-utils'], -}; diff --git a/packages/kbn-securitysolution-hook-utils/package.json b/packages/kbn-securitysolution-hook-utils/package.json deleted file mode 100644 index 71a83ce3ebb4b..0000000000000 --- a/packages/kbn-securitysolution-hook-utils/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@kbn/securitysolution-hook-utils", - "version": "1.0.0", - "description": "Security Solution utilities for React hooks", - "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0", - "private": true, - "sideEffects": false -} \ No newline at end of file diff --git a/packages/kbn-securitysolution-hook-utils/src/types.ts b/packages/kbn-securitysolution-hook-utils/src/types.ts deleted file mode 100644 index 6642afac7381e..0000000000000 --- a/packages/kbn-securitysolution-hook-utils/src/types.ts +++ /dev/null @@ -1,19 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/** - * Represents the state of an asynchronous task, along with an initiator - * function to kick off the work. - */ -export interface Task<Args extends unknown[], Result> { - loading: boolean; - error: unknown | undefined; - result: Result | undefined; - start: (...args: Args) => void; -} diff --git a/packages/kbn-securitysolution-hook-utils/src/use_async/index.test.ts b/packages/kbn-securitysolution-hook-utils/src/use_async/index.test.ts deleted file mode 100644 index 99417c1fe3292..0000000000000 --- a/packages/kbn-securitysolution-hook-utils/src/use_async/index.test.ts +++ /dev/null @@ -1,166 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { waitFor, renderHook, act } from '@testing-library/react'; - -import { useAsync } from '.'; - -interface TestArgs { - n: number; - s: string; -} - -type TestReturn = Promise<unknown>; - -describe('useAsync', () => { - /** - * Timeout for both jest tests and for the waitFor. - * jest tests default to 5 seconds and waitFor defaults to 1 second. - * 20_0000 = 20,000 milliseconds = 20 seconds - */ - const timeout = 20_000; - - let fn: jest.Mock<TestReturn, TestArgs[]>; - let args: TestArgs; - - beforeEach(() => { - args = { n: 1, s: 's' }; - fn = jest.fn().mockResolvedValue(false); - }); - - it('does not invoke fn if start was not called', () => { - renderHook(() => useAsync(fn)); - expect(fn).not.toHaveBeenCalled(); - }); - - it( - 'invokes the function when start is called', - async () => { - const { result } = renderHook(() => useAsync(fn)); - - act(() => { - result.current.start(args); - }); - await waitFor(() => expect(fn).toHaveBeenCalled(), { timeout }); - }, - timeout - ); - - it('invokes the function with start args', async () => { - const { result } = renderHook(() => useAsync(fn)); - const expectedArgs = { ...args }; - - act(() => { - result.current.start(args); - }); - await waitFor(() => expect(fn).toHaveBeenCalledWith(expectedArgs), { timeout }); - }); - - it( - 'populates result with the resolved value of the fn', - async () => { - const { result } = renderHook(() => useAsync(fn)); - fn.mockResolvedValue({ resolved: 'value' }); - - act(() => { - result.current.start(args); - }); - await waitFor( - () => { - expect(result.current.result).toEqual({ resolved: 'value' }); - expect(result.current.error).toBeUndefined(); - }, - { timeout } - ); - }, - timeout - ); - - it( - 'populates error if function rejects', - async () => { - fn.mockRejectedValue(new Error('whoops')); - const { result } = renderHook(() => useAsync(fn)); - - act(() => { - result.current.start(args); - }); - - await waitFor( - () => { - expect(result.current.result).toBeUndefined(); - expect(result.current.error).toEqual(new Error('whoops')); - }, - { timeout } - ); - }, - timeout - ); - - it( - 'populates the loading state while the function is pending', - async () => { - let resolve: () => void; - fn.mockImplementation(() => new Promise<void>((_resolve) => (resolve = _resolve))); - - const { result } = renderHook(() => useAsync(fn)); - - act(() => { - result.current.start(args); - }); - - expect(result.current.loading).toBe(true); - - act(() => resolve()); - await waitFor(() => expect(result.current.loading).toBe(false), { timeout }); - }, - timeout - ); - - it( - 'multiple start calls reset state', - async () => { - let resolve: (result: string) => void; - fn.mockImplementation(() => new Promise((_resolve) => (resolve = _resolve))); - - const { result } = renderHook(() => useAsync(fn)); - - act(() => { - result.current.start(args); - }); - - expect(result.current.loading).toBe(true); - - act(() => resolve('result')); - await waitFor( - () => { - expect(result.current.loading).toBe(false); - expect(result.current.result).toBe('result'); - }, - { timeout } - ); - - act(() => { - result.current.start(args); - }); - - expect(result.current.loading).toBe(true); - expect(result.current.result).toBe(undefined); - act(() => resolve('result')); - await waitFor( - () => { - expect(result.current.loading).toBe(false); - expect(result.current.result).toBe('result'); - }, - { timeout } - ); - }, - timeout - ); -}); diff --git a/packages/kbn-securitysolution-hook-utils/src/use_async/index.ts b/packages/kbn-securitysolution-hook-utils/src/use_async/index.ts deleted file mode 100644 index 2c695b26acdd6..0000000000000 --- a/packages/kbn-securitysolution-hook-utils/src/use_async/index.ts +++ /dev/null @@ -1,56 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { useCallback, useState } from 'react'; - -import { Task } from '../types'; -import { useIsMounted } from '../use_is_mounted'; - -/** - * - * This hook wraps a promise-returning thunk (task) in order to conditionally - * initiate the work, and automatically provide state corresponding to the - * task's status. - * - * In order to function properly and not rerender unnecessarily, ensure that - * your task is a stable function reference. - * - * @param fn a function returning a promise. - * - * @returns An {@link Task} containing the task's current state along with a - * start callback - */ -export const useAsync = <Args extends unknown[], Result>( - fn: (...args: Args) => Promise<Result> -): Task<Args, Result> => { - const isMounted = useIsMounted(); - const [loading, setLoading] = useState(false); - const [error, setError] = useState<unknown | undefined>(); - const [result, setResult] = useState<Result | undefined>(); - - const start = useCallback( - (...args: Args) => { - setLoading(true); - setResult(undefined); - setError(undefined); - fn(...args) - .then((r) => isMounted() && setResult(r)) - .catch((e) => isMounted() && setError(e)) - .finally(() => isMounted() && setLoading(false)); - }, - [fn, isMounted] - ); - - return { - error, - loading, - result, - start, - }; -}; diff --git a/packages/kbn-securitysolution-hook-utils/src/use_is_mounted/index.test.ts b/packages/kbn-securitysolution-hook-utils/src/use_is_mounted/index.test.ts deleted file mode 100644 index a8013a65441c9..0000000000000 --- a/packages/kbn-securitysolution-hook-utils/src/use_is_mounted/index.test.ts +++ /dev/null @@ -1,27 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { renderHook } from '@testing-library/react'; - -import { useIsMounted } from '.'; - -describe('useIsMounted', () => { - it('evaluates to true when mounted', () => { - const { result } = renderHook(() => useIsMounted()); - - expect(result.current()).toEqual(true); - }); - - it('evaluates to false when unmounted', () => { - const { result, unmount } = renderHook(() => useIsMounted()); - - unmount(); - expect(result.current()).toEqual(false); - }); -}); diff --git a/packages/kbn-securitysolution-hook-utils/src/use_is_mounted/index.ts b/packages/kbn-securitysolution-hook-utils/src/use_is_mounted/index.ts deleted file mode 100644 index b563840d2f73a..0000000000000 --- a/packages/kbn-securitysolution-hook-utils/src/use_is_mounted/index.ts +++ /dev/null @@ -1,31 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { useCallback, useEffect, useRef } from 'react'; - -type GetIsMounted = () => boolean; - -/** - * - * @returns A {@link GetIsMounted} getter function returning whether the component is currently mounted - */ -export const useIsMounted = (): GetIsMounted => { - const isMounted = useRef(false); - const getIsMounted: GetIsMounted = useCallback(() => isMounted.current, []); - const handleCleanup = useCallback(() => { - isMounted.current = false; - }, []); - - useEffect(() => { - isMounted.current = true; - return handleCleanup; - }, [handleCleanup]); - - return getIsMounted; -}; diff --git a/packages/kbn-securitysolution-hook-utils/src/use_observable/index.test.ts b/packages/kbn-securitysolution-hook-utils/src/use_observable/index.test.ts deleted file mode 100644 index 8d90bffeb3ee2..0000000000000 --- a/packages/kbn-securitysolution-hook-utils/src/use_observable/index.test.ts +++ /dev/null @@ -1,161 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { renderHook, act } from '@testing-library/react'; -import { Subject, throwError } from 'rxjs'; - -import { useObservable } from '.'; - -interface TestArgs { - n: number; - s: string; -} - -type TestReturn = Subject<unknown>; - -describe('useObservable', () => { - let fn: jest.Mock<TestReturn, TestArgs[]>; - let subject: TestReturn; - let args: TestArgs; - - beforeEach(() => { - args = { n: 1, s: 's' }; - subject = new Subject(); - fn = jest.fn().mockReturnValue(subject); - }); - - it('does not invoke fn if start was not called', () => { - renderHook(() => useObservable(fn)); - expect(fn).not.toHaveBeenCalled(); - }); - - it('invokes the function when start is called', () => { - const { result } = renderHook(() => useObservable(fn)); - - act(() => { - result.current.start(args); - }); - - expect(fn).toHaveBeenCalled(); - }); - - it('invokes the function with start args', () => { - const { result } = renderHook(() => useObservable(fn)); - const expectedArgs = { ...args }; - - act(() => { - result.current.start(args); - }); - - expect(fn).toHaveBeenCalledWith(expectedArgs); - }); - - it('populates result with the next value of the fn', () => { - const { result } = renderHook(() => useObservable(fn)); - - act(() => { - result.current.start(args); - }); - act(() => subject.next('value')); - - expect(result.current.result).toEqual('value'); - expect(result.current.error).toBeUndefined(); - }); - - it('populates error if observable throws an error', () => { - const error = new Error('whoops'); - const errorFn = () => throwError(error); - - const { result } = renderHook(() => useObservable(errorFn)); - - act(() => { - result.current.start(); - }); - - expect(result.current.result).toBeUndefined(); - expect(result.current.error).toEqual(error); - }); - - it('populates the loading state while no value has resolved', () => { - const { result } = renderHook(() => useObservable(fn)); - - act(() => { - result.current.start(args); - }); - - expect(result.current.loading).toBe(true); - - act(() => subject.next('a value')); - - expect(result.current.loading).toBe(false); - }); - - it('updates result with each resolved value', () => { - const { result } = renderHook(() => useObservable(fn)); - - act(() => { - result.current.start(args); - }); - - act(() => subject.next('a value')); - expect(result.current.result).toEqual('a value'); - - act(() => subject.next('a subsequent value')); - expect(result.current.result).toEqual('a subsequent value'); - }); - - it('does not update result with values if start has not been called', () => { - const { result } = renderHook(() => useObservable(fn)); - - act(() => subject.next('a value')); - expect(result.current.result).toBeUndefined(); - - act(() => subject.next('a subsequent value')); - expect(result.current.result).toBeUndefined(); - }); - - it('unsubscribes on unmount', () => { - const { result, unmount } = renderHook(() => useObservable(fn)); - - act(() => { - result.current.start(args); - }); - expect(subject.observers).toHaveLength(1); - - unmount(); - expect(subject.observers).toHaveLength(0); - }); - - it('multiple start calls reset state', () => { - const { result } = renderHook(() => useObservable(fn)); - - act(() => { - result.current.start(args); - }); - - expect(result.current.loading).toBe(true); - - act(() => subject.next('one value')); - - expect(result.current.loading).toBe(false); - expect(result.current.result).toBe('one value'); - - act(() => { - result.current.start(args); - }); - - expect(result.current.loading).toBe(true); - expect(result.current.result).toBe(undefined); - - act(() => subject.next('another value')); - - expect(result.current.loading).toBe(false); - expect(result.current.result).toBe('another value'); - }); -}); diff --git a/packages/kbn-securitysolution-hook-utils/src/use_observable/index.ts b/packages/kbn-securitysolution-hook-utils/src/use_observable/index.ts deleted file mode 100644 index 0b7f9ab93e022..0000000000000 --- a/packages/kbn-securitysolution-hook-utils/src/use_observable/index.ts +++ /dev/null @@ -1,93 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { useCallback, useEffect, useRef, useReducer, Reducer } from 'react'; -import { Observable, Subscription } from 'rxjs'; - -import { useIsMounted } from '../use_is_mounted'; -import { Task } from '../types'; - -interface State<T> { - loading: boolean; - error?: unknown; - result?: T; -} - -export type Action<T> = - | { type: 'setResult'; result: T } - | { type: 'setError'; error: unknown } - | { type: 'load' }; - -function reducer<T>(state: State<T>, action: Action<T>) { - switch (action.type) { - case 'setResult': - return { ...state, result: action.result, loading: false }; - case 'setError': - return { ...state, error: action.error, loading: false }; - case 'load': - return { loading: true, result: undefined, error: undefined }; - } -} - -/** - * - * @param fn function returning an observable - * - * @returns An {@link Async} containing the underlying task's state along with a start callback - */ -export const useObservable = <Args extends unknown[], Result>( - fn: (...args: Args) => Observable<Result> -): Task<Args, Result> => { - const isMounted = useIsMounted(); - const subRef = useRef<Subscription | undefined>(); - const [state, dispatch] = useReducer<Reducer<State<Result>, Action<Result>>>(reducer, { - loading: false, - error: undefined, - result: undefined, - }); - - const start = useCallback( - (...args: Args) => { - if (subRef.current) { - subRef.current.unsubscribe(); - } - dispatch({ type: 'load' }); - - subRef.current = fn(...args).subscribe( - (r) => { - if (isMounted()) { - dispatch({ type: 'setResult', result: r }); - } - }, - (e) => { - if (isMounted()) { - dispatch({ type: 'setError', error: e }); - } - } - ); - }, - [fn, isMounted] - ); - - useEffect( - () => () => { - if (subRef.current) { - subRef.current.unsubscribe(); - } - }, - [] - ); - - return { - result: state.result, - error: state.error, - loading: state.loading, - start, - }; -}; diff --git a/packages/kbn-securitysolution-hook-utils/src/with_optional_signal/index.test.ts b/packages/kbn-securitysolution-hook-utils/src/with_optional_signal/index.test.ts deleted file mode 100644 index fa77482d24bed..0000000000000 --- a/packages/kbn-securitysolution-hook-utils/src/with_optional_signal/index.test.ts +++ /dev/null @@ -1,32 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { withOptionalSignal } from '.'; - -type TestFn = ({ number, signal }: { number: number; signal: AbortSignal }) => boolean; - -describe('withOptionalSignal', () => { - it('does not require a signal on the returned function', () => { - const fn = jest.fn().mockReturnValue('hello') as TestFn; - - const wrappedFn = withOptionalSignal(fn); - - expect(wrappedFn({ number: 1 })).toEqual('hello'); - }); - - it('will pass a given signal to the wrapped function', () => { - const fn = jest.fn().mockReturnValue('hello') as TestFn; - const { signal } = new AbortController(); - - const wrappedFn = withOptionalSignal(fn); - - wrappedFn({ number: 1, signal }); - expect(fn).toHaveBeenCalledWith({ number: 1, signal }); - }); -}); diff --git a/packages/kbn-securitysolution-hook-utils/src/with_optional_signal/index.ts b/packages/kbn-securitysolution-hook-utils/src/with_optional_signal/index.ts deleted file mode 100644 index eb7cffeb7e003..0000000000000 --- a/packages/kbn-securitysolution-hook-utils/src/with_optional_signal/index.ts +++ /dev/null @@ -1,27 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -interface SignalArgs { - signal: AbortSignal; -} - -export type OptionalSignalArgs<Args> = Omit<Args, 'signal'> & Partial<SignalArgs>; - -/** - * - * @param fn an async function receiving an AbortSignal argument - * - * @returns An async function where the AbortSignal argument is optional - */ -export const withOptionalSignal = - <Args extends SignalArgs, Result>(fn: (args: Args) => Result) => - (args: OptionalSignalArgs<Args>): Result => { - const signal = args.signal != null ? args.signal : new AbortController().signal; - return fn({ ...args, signal } as Args); - }; diff --git a/packages/kbn-securitysolution-hook-utils/tsconfig.json b/packages/kbn-securitysolution-hook-utils/tsconfig.json deleted file mode 100644 index 9b5c5373afe0e..0000000000000 --- a/packages/kbn-securitysolution-hook-utils/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": ["jest", "node"] - }, - "include": [ - "**/*.ts" - ], - "exclude": [ - "target/**/*", - ] -} diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/index.ts deleted file mode 100644 index 6baaf0a704036..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/index.ts +++ /dev/null @@ -1,42 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './src/actions'; -export * from './src/default_actions_array'; -export * from './src/default_export_file_name'; -export * from './src/default_from_string'; -export * from './src/default_interval_string'; -export * from './src/default_language_string'; -export * from './src/default_max_signals_number'; -export * from './src/default_page'; -export * from './src/default_per_page'; -export * from './src/default_risk_score_mapping_array'; -export * from './src/default_severity_mapping_array'; -export * from './src/default_threat_array'; -export * from './src/default_to_string'; -export * from './src/default_uuid'; -export * from './src/frequency'; -export * from './src/language'; -export * from './src/machine_learning_job_id'; -export * from './src/max_signals'; -export * from './src/normalized_ml_job_id'; -export * from './src/references_default_array'; -export * from './src/risk_score'; -export * from './src/risk_score_mapping'; -export * from './src/rule_schedule'; -export * from './src/saved_object_attributes'; -export * from './src/severity'; -export * from './src/severity_mapping'; -export * from './src/threat'; -export * from './src/threat_mapping'; -export * from './src/threat_subtechnique'; -export * from './src/threat_tactic'; -export * from './src/threat_technique'; -export * from './src/throttle'; -export * from './src/type'; diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/jest.config.js b/packages/kbn-securitysolution-io-ts-alerting-types/jest.config.js deleted file mode 100644 index b4c7014f91544..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/jest.config.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../..', - roots: ['<rootDir>/packages/kbn-securitysolution-io-ts-alerting-types'], -}; diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/package.json b/packages/kbn-securitysolution-io-ts-alerting-types/package.json deleted file mode 100644 index ab19f69d20b3f..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@kbn/securitysolution-io-ts-alerting-types", - "version": "1.0.0", - "description": "io ts utilities and types to be shared with plugins from the security solution project", - "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0", - "private": true, - "sideEffects": false -} \ No newline at end of file diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/actions/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/actions/index.ts deleted file mode 100644 index ad1dde3da7450..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/actions/index.ts +++ /dev/null @@ -1,129 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; - -import * as t from 'io-ts'; -import { saved_object_attributes } from '../saved_object_attributes'; -import { RuleActionFrequency } from '../frequency'; - -export type RuleActionGroup = t.TypeOf<typeof RuleActionGroup>; -export const RuleActionGroup = t.string; - -export type RuleActionId = t.TypeOf<typeof RuleActionId>; -export const RuleActionId = t.string; - -export type RuleActionTypeId = t.TypeOf<typeof RuleActionTypeId>; -export const RuleActionTypeId = t.string; - -export type RuleActionUuid = t.TypeOf<typeof RuleActionUuid>; -export const RuleActionUuid = NonEmptyString; - -/** - * Params is an "object", since it is a type of RuleActionParams which is action templates. - * @see x-pack/plugins/alerting/common/rule.ts - */ -export type RuleActionParams = t.TypeOf<typeof RuleActionParams>; -export const RuleActionParams = saved_object_attributes; - -export const RuleActionAlertsFilter = t.partial({ - query: t.union([ - t.undefined, - t.intersection([ - t.strict({ - kql: t.string, - filters: t.array( - t.intersection([ - t.type({ - meta: t.partial({ - alias: t.union([t.string, t.null]), - disabled: t.boolean, - negate: t.boolean, - controlledBy: t.string, - group: t.string, - index: t.string, - isMultiIndex: t.boolean, - type: t.string, - key: t.string, - params: t.any, - value: t.string, - }), - }), - t.partial({ - $state: t.type({ store: t.any }), - query: t.record(t.string, t.any), - }), - ]) - ), - }), - t.partial({ dsl: t.string }), - ]), - ]), - timeframe: t.union([ - t.undefined, - t.strict({ - timezone: t.string, - days: t.array( - t.union([ - t.literal(1), - t.literal(2), - t.literal(3), - t.literal(4), - t.literal(5), - t.literal(6), - t.literal(7), - ]) - ), - hours: t.strict({ - start: t.string, - end: t.string, - }), - }), - ]), -}); - -export type RuleAction = t.TypeOf<typeof RuleAction>; -export const RuleAction = t.exact( - t.intersection([ - t.type({ - group: RuleActionGroup, - id: RuleActionId, - action_type_id: RuleActionTypeId, - params: RuleActionParams, - }), - t.partial({ - uuid: RuleActionUuid, - alerts_filter: RuleActionAlertsFilter, - frequency: RuleActionFrequency, - }), - ]) -); - -export type RuleActionArray = t.TypeOf<typeof RuleActionArray>; -export const RuleActionArray = t.array(RuleAction); - -export type RuleActionCamel = t.TypeOf<typeof RuleActionCamel>; -export const RuleActionCamel = t.exact( - t.intersection([ - t.type({ - group: RuleActionGroup, - id: RuleActionId, - actionTypeId: RuleActionTypeId, - params: RuleActionParams, - }), - t.partial({ - uuid: RuleActionUuid, - alertsFilter: RuleActionAlertsFilter, - frequency: RuleActionFrequency, - }), - ]) -); - -export type RuleActionArrayCamel = t.TypeOf<typeof RuleActionArrayCamel>; -export const RuleActionArrayCamel = t.array(RuleActionCamel); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/constants/index.mock.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/constants/index.mock.ts deleted file mode 100644 index bb398e0df8460..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/constants/index.mock.ts +++ /dev/null @@ -1,26 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export const ENTRY_VALUE = 'some host name'; -export const FIELD = 'host.name'; -export const MATCH = 'match'; -export const MATCH_ANY = 'match_any'; -export const OPERATOR = 'included'; -export const NESTED = 'nested'; -export const NESTED_FIELD = 'parent.field'; -export const LIST_ID = 'some-list-id'; -export const LIST = 'list'; -export const TYPE = 'ip'; -export const EXISTS = 'exists'; -export const WILDCARD = 'wildcard'; -export const USER = 'some user'; -export const DATE_NOW = '2020-04-20T15:25:31.830Z'; - -// Exception List specific -export const ID = 'uuid_here'; diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/constants/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/constants/index.ts deleted file mode 100644 index 0c930e5f4a808..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/constants/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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/** - * TODO: Create a kbn-alerting-constants and add this to it. - * @deprecated Use a DEFAULT_MAX_SIGNALS from a kbn-alerting-constants package. - */ -export const DEFAULT_MAX_SIGNALS = 100; diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_actions_array/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_actions_array/index.ts deleted file mode 100644 index 17c3f9301c6d7..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_actions_array/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; -import { RuleActionArray } from '../actions'; - -export const DefaultActionsArray = new t.Type< - RuleActionArray, - RuleActionArray | undefined, - unknown ->( - 'DefaultActionsArray', - RuleActionArray.is, - (input, context): Either<t.Errors, RuleActionArray> => - input == null ? t.success([]) : RuleActionArray.validate(input, context), - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_export_file_name/index.test.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_export_file_name/index.test.ts deleted file mode 100644 index b07ade238db28..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_export_file_name/index.test.ts +++ /dev/null @@ -1,44 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { DefaultExportFileName } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('default_export_file_name', () => { - test('it should validate a regular string', () => { - const payload = 'some string'; - const decoded = DefaultExportFileName.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not validate a number', () => { - const payload = 5; - const decoded = DefaultExportFileName.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "5" supplied to "DefaultExportFileName"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should return a default of "export.ndjson"', () => { - const payload = null; - const decoded = DefaultExportFileName.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual('export.ndjson'); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_export_file_name/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_export_file_name/index.ts deleted file mode 100644 index dedbadfa6f522..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_export_file_name/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; - -/** - * Types the DefaultExportFileName as: - * - If null or undefined, then a default of "export.ndjson" will be used - */ -export const DefaultExportFileName = new t.Type<string, string | undefined, unknown>( - 'DefaultExportFileName', - t.string.is, - (input, context): Either<t.Errors, string> => - input == null ? t.success('export.ndjson') : t.string.validate(input, context), - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_from_string/index.test.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_from_string/index.test.ts deleted file mode 100644 index 2515b3f8b0152..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_from_string/index.test.ts +++ /dev/null @@ -1,44 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { DefaultFromString } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('default_from_string', () => { - test('it should validate a from string', () => { - const payload = 'now-20m'; - const decoded = DefaultFromString.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not validate a number', () => { - const payload = 5; - const decoded = DefaultFromString.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "5" supplied to "DefaultFromString"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should return a default of "now-6m"', () => { - const payload = null; - const decoded = DefaultFromString.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual('now-6m'); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_from_string/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_from_string/index.ts deleted file mode 100644 index ccf70aab8a7b9..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_from_string/index.ts +++ /dev/null @@ -1,28 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; -import { From } from '../from'; - -/** - * Types the DefaultFromString as: - * - If null or undefined, then a default of the string "now-6m" will be used - */ -export const DefaultFromString = new t.Type<string, string | undefined, unknown>( - 'DefaultFromString', - t.string.is, - (input, context): Either<t.Errors, string> => { - if (input == null) { - return t.success('now-6m'); - } - return From.validate(input, context); - }, - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_interval_string/index.test.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_interval_string/index.test.ts deleted file mode 100644 index 8944d57ba8999..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_interval_string/index.test.ts +++ /dev/null @@ -1,44 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { DefaultIntervalString } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('default_interval_string', () => { - test('it should validate a interval string', () => { - const payload = '20m'; - const decoded = DefaultIntervalString.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not validate a number', () => { - const payload = 5; - const decoded = DefaultIntervalString.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "5" supplied to "DefaultIntervalString"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should return a default of "5m"', () => { - const payload = null; - const decoded = DefaultIntervalString.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual('5m'); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_interval_string/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_interval_string/index.ts deleted file mode 100644 index 3fc5d4f42ccbd..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_interval_string/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; - -/** - * Types the DefaultIntervalString as: - * - If null or undefined, then a default of the string "5m" will be used - */ -export const DefaultIntervalString = new t.Type<string, string | undefined, unknown>( - 'DefaultIntervalString', - t.string.is, - (input, context): Either<t.Errors, string> => - input == null ? t.success('5m') : t.string.validate(input, context), - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_language_string/index.test.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_language_string/index.test.ts deleted file mode 100644 index 4a8d50c88eaa8..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_language_string/index.test.ts +++ /dev/null @@ -1,45 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { Language } from '../language'; -import { DefaultLanguageString } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('default_language_string', () => { - test('it should validate a string', () => { - const payload: Language = 'lucene'; - const decoded = DefaultLanguageString.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not validate a number', () => { - const payload = 5; - const decoded = DefaultLanguageString.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "5" supplied to "DefaultLanguageString"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should return a default of "kuery"', () => { - const payload = null; - const decoded = DefaultLanguageString.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual('kuery'); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_language_string/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_language_string/index.ts deleted file mode 100644 index 02328d94b0114..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_language_string/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; -import { language } from '../language'; - -/** - * Types the DefaultLanguageString as: - * - If null or undefined, then a default of the string "kuery" will be used - */ -export const DefaultLanguageString = new t.Type<string, string | undefined, unknown>( - 'DefaultLanguageString', - t.string.is, - (input, context): Either<t.Errors, string> => - input == null ? t.success('kuery') : language.validate(input, context), - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_max_signals_number/index.test.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_max_signals_number/index.test.ts deleted file mode 100644 index 66eb77400ac1d..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_max_signals_number/index.test.ts +++ /dev/null @@ -1,67 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { DefaultMaxSignalsNumber } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; -import { DEFAULT_MAX_SIGNALS } from '../constants'; - -describe('default_from_string', () => { - test('it should validate a max signal number', () => { - const payload = 5; - const decoded = DefaultMaxSignalsNumber.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not validate a string', () => { - const payload = '5'; - const decoded = DefaultMaxSignalsNumber.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "5" supplied to "DefaultMaxSignals"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not validate a zero', () => { - const payload = 0; - const decoded = DefaultMaxSignalsNumber.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "0" supplied to "DefaultMaxSignals"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not validate a negative number', () => { - const payload = -1; - const decoded = DefaultMaxSignalsNumber.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "-1" supplied to "DefaultMaxSignals"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should return a default of DEFAULT_MAX_SIGNALS', () => { - const payload = null; - const decoded = DefaultMaxSignalsNumber.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(DEFAULT_MAX_SIGNALS); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_max_signals_number/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_max_signals_number/index.ts deleted file mode 100644 index 8acbc2f223a14..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_max_signals_number/index.ts +++ /dev/null @@ -1,28 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; -import { max_signals } from '../max_signals'; -import { DEFAULT_MAX_SIGNALS } from '../constants'; - -/** - * Types the default max signal: - * - Natural Number (positive integer and not a float), - * - greater than 1 - * - If undefined then it will use DEFAULT_MAX_SIGNALS (100) as the default - */ -export const DefaultMaxSignalsNumber = new t.Type<number, number | undefined, unknown>( - 'DefaultMaxSignals', - t.number.is, - (input, context): Either<t.Errors, number> => { - return input == null ? t.success(DEFAULT_MAX_SIGNALS) : max_signals.validate(input, context); - }, - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_page/index.test.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_page/index.test.ts deleted file mode 100644 index 5af986fefe8dd..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_page/index.test.ts +++ /dev/null @@ -1,86 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { DefaultPage } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('default_page', () => { - test('it should validate a regular number greater than zero', () => { - const payload = 5; - const decoded = DefaultPage.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate a string of a number', () => { - const payload = '5'; - const decoded = DefaultPage.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(5); - }); - - test('it should not validate a junk string', () => { - const payload = 'invalid-string'; - const decoded = DefaultPage.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "NaN" supplied to "DefaultPerPage"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not validate an empty string', () => { - const payload = ''; - const decoded = DefaultPage.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "NaN" supplied to "DefaultPerPage"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not validate a zero', () => { - const payload = 0; - const decoded = DefaultPage.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "0" supplied to "DefaultPerPage"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not validate a negative number', () => { - const payload = -1; - const decoded = DefaultPage.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "-1" supplied to "DefaultPerPage"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should return a default of 20', () => { - const payload = null; - const decoded = DefaultPage.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(1); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_page/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_page/index.ts deleted file mode 100644 index 8486c516aebf7..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_page/index.ts +++ /dev/null @@ -1,33 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; -import { PositiveIntegerGreaterThanZero } from '@kbn/securitysolution-io-ts-types'; - -/** - * Types the DefaultPerPage as: - * - If a string this will convert the string to a number - * - If null or undefined, then a default of 1 will be used - * - If the number is 0 or less this will not validate as it has to be a positive number greater than zero - */ -export const DefaultPage = new t.Type<number, number | undefined, unknown>( - 'DefaultPerPage', - t.number.is, - (input, context): Either<t.Errors, number> => { - if (input == null) { - return t.success(1); - } else if (typeof input === 'string') { - return PositiveIntegerGreaterThanZero.validate(parseInt(input, 10), context); - } else { - return PositiveIntegerGreaterThanZero.validate(input, context); - } - }, - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_per_page/index.test.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_per_page/index.test.ts deleted file mode 100644 index 78fa2a9be8c82..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_per_page/index.test.ts +++ /dev/null @@ -1,86 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { DefaultPerPage } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('default_per_page', () => { - test('it should validate a regular number greater than zero', () => { - const payload = 5; - const decoded = DefaultPerPage.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate a string of a number', () => { - const payload = '5'; - const decoded = DefaultPerPage.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(5); - }); - - test('it should not validate a junk string', () => { - const payload = 'invalid-string'; - const decoded = DefaultPerPage.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "NaN" supplied to "DefaultPerPage"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not validate an empty string', () => { - const payload = ''; - const decoded = DefaultPerPage.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "NaN" supplied to "DefaultPerPage"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not validate a zero', () => { - const payload = 0; - const decoded = DefaultPerPage.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "0" supplied to "DefaultPerPage"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not validate a negative number', () => { - const payload = -1; - const decoded = DefaultPerPage.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "-1" supplied to "DefaultPerPage"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should return a default of 20', () => { - const payload = null; - const decoded = DefaultPerPage.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(20); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_per_page/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_per_page/index.ts deleted file mode 100644 index 4f272fc0517eb..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_per_page/index.ts +++ /dev/null @@ -1,33 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; -import { PositiveIntegerGreaterThanZero } from '@kbn/securitysolution-io-ts-types'; - -/** - * Types the DefaultPerPage as: - * - If a string this will convert the string to a number - * - If null or undefined, then a default of 20 will be used - * - If the number is 0 or less this will not validate as it has to be a positive number greater than zero - */ -export const DefaultPerPage = new t.Type<number, number | undefined, unknown>( - 'DefaultPerPage', - t.number.is, - (input, context): Either<t.Errors, number> => { - if (input == null) { - return t.success(20); - } else if (typeof input === 'string') { - return PositiveIntegerGreaterThanZero.validate(parseInt(input, 10), context); - } else { - return PositiveIntegerGreaterThanZero.validate(input, context); - } - }, - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_risk_score_mapping_array/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_risk_score_mapping_array/index.ts deleted file mode 100644 index 9eb6938bcfcbd..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_risk_score_mapping_array/index.ts +++ /dev/null @@ -1,28 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; -import { RiskScoreMapping } from '../risk_score_mapping'; - -/** - * Types the DefaultStringArray as: - * - If null or undefined, then a default RiskScoreMapping array will be set - */ -export const DefaultRiskScoreMappingArray = new t.Type< - RiskScoreMapping, - RiskScoreMapping | undefined, - unknown ->( - 'DefaultRiskScoreMappingArray', - RiskScoreMapping.is, - (input, context): Either<t.Errors, RiskScoreMapping> => - input == null ? t.success([]) : RiskScoreMapping.validate(input, context), - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_severity_mapping_array/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_severity_mapping_array/index.ts deleted file mode 100644 index ac72e3330f2a1..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_severity_mapping_array/index.ts +++ /dev/null @@ -1,28 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; -import { SeverityMapping } from '../severity_mapping'; - -/** - * Types the DefaultStringArray as: - * - If null or undefined, then a default SeverityMapping array will be set - */ -export const DefaultSeverityMappingArray = new t.Type< - SeverityMapping, - SeverityMapping | undefined, - unknown ->( - 'DefaultSeverityMappingArray', - SeverityMapping.is, - (input, context): Either<t.Errors, SeverityMapping> => - input == null ? t.success([]) : SeverityMapping.validate(input, context), - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_threat_array/index.test.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_threat_array/index.test.ts deleted file mode 100644 index ebd1ca9384b13..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_threat_array/index.test.ts +++ /dev/null @@ -1,67 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { Threats } from '../threat'; -import { DefaultThreatArray } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('default_threat_null', () => { - test('it should validate an empty array', () => { - const payload: Threats = []; - const decoded = DefaultThreatArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate an array of threats', () => { - const payload: Threats = [ - { - framework: 'MITRE ATTACK', - technique: [{ reference: 'https://test.com', name: 'Audio Capture', id: 'T1123' }], - tactic: { reference: 'https://test.com', name: 'Collection', id: 'TA000999' }, - }, - ]; - const decoded = DefaultThreatArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not validate an array with a number', () => { - const payload = [ - { - framework: 'MITRE ATTACK', - technique: [{ reference: 'https://test.com', name: 'Audio Capture', id: 'T1123' }], - tactic: { reference: 'https://test.com', name: 'Collection', id: 'TA000999' }, - }, - 5, - ]; - const decoded = DefaultThreatArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "5" supplied to "DefaultThreatArray"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should return a default empty array if not provided a value', () => { - const payload = null; - const decoded = DefaultThreatArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual([]); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_threat_array/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_threat_array/index.ts deleted file mode 100644 index bb38b6382230c..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_threat_array/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; -import { threats, Threats } from '../threat'; - -/** - * Types the DefaultThreatArray as: - * - If null or undefined, then an empty array will be set - */ -export const DefaultThreatArray = new t.Type<Threats, Threats | undefined, unknown>( - 'DefaultThreatArray', - threats.is, - (input, context): Either<t.Errors, Threats> => - input == null ? t.success([]) : threats.validate(input, context), - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_to_string/index.test.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_to_string/index.test.ts deleted file mode 100644 index e8bcdcc664cfe..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_to_string/index.test.ts +++ /dev/null @@ -1,44 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { DefaultToString } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('default_to_string', () => { - test('it should validate a to string', () => { - const payload = 'now-5m'; - const decoded = DefaultToString.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not validate a number', () => { - const payload = 5; - const decoded = DefaultToString.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "5" supplied to "DefaultToString"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should return a default of "now"', () => { - const payload = null; - const decoded = DefaultToString.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual('now'); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_to_string/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_to_string/index.ts deleted file mode 100644 index 4074cc3bbbe9e..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_to_string/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; - -/** - * Types the DefaultToString as: - * - If null or undefined, then a default of the string "now" will be used - */ -export const DefaultToString = new t.Type<string, string | undefined, unknown>( - 'DefaultToString', - t.string.is, - (input, context): Either<t.Errors, string> => - input == null ? t.success('now') : t.string.validate(input, context), - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_uuid/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/default_uuid/index.ts deleted file mode 100644 index 4144b4e6824ce..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_uuid/index.ts +++ /dev/null @@ -1,26 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; -import { v4 as uuidv4 } from 'uuid'; -import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; - -/** - * Types the DefaultUuid as: - * - If null or undefined, then a default string uuidv4() will be - * created otherwise it will be checked just against an empty string - */ -export const DefaultUuid = new t.Type<string, string | undefined, unknown>( - 'DefaultUuid', - t.string.is, - (input, context): Either<t.Errors, string> => - input == null ? t.success(uuidv4()) : NonEmptyString.validate(input, context), - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/frequency/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/frequency/index.ts deleted file mode 100644 index 0247bfb155f32..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/frequency/index.ts +++ /dev/null @@ -1,38 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { RuleActionThrottle } from '../throttle'; - -/** - * Action summary indicates whether we will send a summary notification about all the generate alerts or notification per individual alert - */ -export type RuleActionSummary = t.TypeOf<typeof RuleActionSummary>; -export const RuleActionSummary = t.boolean; - -/** - * The condition for throttling the notification: `onActionGroupChange`, `onActiveAlert`, or `onThrottleInterval` - */ -export type RuleActionNotifyWhen = t.TypeOf<typeof RuleActionNotifyWhen>; -export const RuleActionNotifyWhen = t.union([ - t.literal('onActionGroupChange'), - t.literal('onActiveAlert'), - t.literal('onThrottleInterval'), -]); - -/** - * The action frequency defines when the action runs (for example, only on rule execution or at specific time intervals). - */ -export type RuleActionFrequency = t.TypeOf<typeof RuleActionFrequency>; -export const RuleActionFrequency = t.type({ - summary: RuleActionSummary, - notifyWhen: RuleActionNotifyWhen, - throttle: t.union([RuleActionThrottle, t.null]), -}); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/from/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/from/index.ts deleted file mode 100644 index 390649416273d..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/from/index.ts +++ /dev/null @@ -1,27 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { Either } from 'fp-ts/lib/Either'; -import * as t from 'io-ts'; -import { parseScheduleDates } from '@kbn/securitysolution-io-ts-utils'; - -const stringValidator = (input: unknown): input is string => typeof input === 'string'; - -export type From = t.TypeOf<typeof From>; -export const From = new t.Type<string, string, unknown>( - 'From', - t.string.is, - (input, context): Either<t.Errors, string> => { - if (stringValidator(input) && parseScheduleDates(input) == null) { - return t.failure(input, context, 'Failed to parse "from" on rule param'); - } - return t.string.validate(input, context); - }, - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/language/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/language/index.ts deleted file mode 100644 index 95017209b2c6d..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/language/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const language = t.keyof({ eql: null, kuery: null, lucene: null, esql: null }); -export type Language = t.TypeOf<typeof language>; - -export const languageOrUndefined = t.union([language, t.undefined]); -export type LanguageOrUndefined = t.TypeOf<typeof languageOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/machine_learning_job_id/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/machine_learning_job_id/index.ts deleted file mode 100644 index 00dc70eb55751..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/machine_learning_job_id/index.ts +++ /dev/null @@ -1,20 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; - -import { machine_learning_job_id_normalized } from '../normalized_ml_job_id'; - -export const machine_learning_job_id = t.union([t.string, machine_learning_job_id_normalized]); -export type MachineLearningJobId = t.TypeOf<typeof machine_learning_job_id>; - -export const machineLearningJobIdOrUndefined = t.union([machine_learning_job_id, t.undefined]); -export type MachineLearningJobIdOrUndefined = t.TypeOf<typeof machineLearningJobIdOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/max_signals/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/max_signals/index.ts deleted file mode 100644 index aa8bdf6f539af..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/max_signals/index.ts +++ /dev/null @@ -1,19 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; -import { PositiveIntegerGreaterThanZero } from '@kbn/securitysolution-io-ts-types'; - -export const max_signals = PositiveIntegerGreaterThanZero; -export type MaxSignals = t.TypeOf<typeof max_signals>; - -export const maxSignalsOrUndefined = t.union([max_signals, t.undefined]); -export type MaxSignalsOrUndefined = t.TypeOf<typeof maxSignalsOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/normalized_ml_job_id/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/normalized_ml_job_id/index.ts deleted file mode 100644 index 2d89147c4fa11..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/normalized_ml_job_id/index.ts +++ /dev/null @@ -1,25 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; - -import { NonEmptyArray } from '@kbn/securitysolution-io-ts-types'; - -export const machine_learning_job_id_normalized = NonEmptyArray(t.string); -export type MachineLearningJobIdNormalized = t.TypeOf<typeof machine_learning_job_id_normalized>; - -export const machineLearningJobIdNormalizedOrUndefined = t.union([ - machine_learning_job_id_normalized, - t.undefined, -]); -export type MachineLearningJobIdNormalizedOrUndefined = t.TypeOf< - typeof machineLearningJobIdNormalizedOrUndefined ->; diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/references_default_array/index.test.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/references_default_array/index.test.ts deleted file mode 100644 index 7b6146a320d6b..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/references_default_array/index.test.ts +++ /dev/null @@ -1,53 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { ReferencesDefaultArray } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('default_string_array', () => { - test('it should validate an empty array', () => { - const payload: string[] = []; - const decoded = ReferencesDefaultArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate an array of strings', () => { - const payload = ['value 1', 'value 2']; - const decoded = ReferencesDefaultArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not validate an array with a number', () => { - const payload = ['value 1', 5]; - const decoded = ReferencesDefaultArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "5" supplied to "referencesWithDefaultArray"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should return a default array entry', () => { - const payload = null; - const decoded = ReferencesDefaultArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual([]); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/references_default_array/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/references_default_array/index.ts deleted file mode 100644 index fcf22ad918c9b..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/references_default_array/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; - -/** - * Types the ReferencesDefaultArray as: - * - If null or undefined, then a default array will be set - */ -export const ReferencesDefaultArray = new t.Type<string[], string[] | undefined, unknown>( - 'referencesWithDefaultArray', - t.array(t.string).is, - (input, context): Either<t.Errors, string[]> => - input == null ? t.success([]) : t.array(t.string).validate(input, context), - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/risk_score/index.test.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/risk_score/index.test.ts deleted file mode 100644 index 85d83d0ec77d7..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/risk_score/index.test.ts +++ /dev/null @@ -1,62 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; -import { RiskScore } from '.'; - -describe('risk_score', () => { - test('it should validate a positive number', () => { - const payload = 1; - const decoded = RiskScore.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate a zero', () => { - const payload = 0; - const decoded = RiskScore.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT validate a negative number', () => { - const payload = -1; - const decoded = RiskScore.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "-1" supplied to "RiskScore"']); - expect(message.schema).toEqual({}); - }); - - test('it should NOT validate a string', () => { - const payload = 'some string'; - const decoded = RiskScore.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "some string" supplied to "RiskScore"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT validate a risk score greater than 100', () => { - const payload = 101; - const decoded = RiskScore.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "101" supplied to "RiskScore"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/risk_score/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/risk_score/index.ts deleted file mode 100644 index ecc48e9a699de..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/risk_score/index.ts +++ /dev/null @@ -1,28 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; - -/** - * Types the risk score as: - * - Natural Number (positive integer and not a float), - * - Between the values [0 and 100] inclusive. - */ -export type RiskScore = t.TypeOf<typeof RiskScore>; -export const RiskScore = new t.Type<number, number, unknown>( - 'RiskScore', - t.number.is, - (input, context): Either<t.Errors, number> => { - return typeof input === 'number' && Number.isSafeInteger(input) && input >= 0 && input <= 100 - ? t.success(input) - : t.failure(input, context); - }, - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/risk_score_mapping/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/risk_score_mapping/index.ts deleted file mode 100644 index 59f7c7ab69fbe..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/risk_score_mapping/index.ts +++ /dev/null @@ -1,25 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { operator } from '@kbn/securitysolution-io-ts-types'; -import { RiskScore } from '../risk_score'; - -export type RiskScoreMappingItem = t.TypeOf<typeof RiskScoreMappingItem>; -export const RiskScoreMappingItem = t.exact( - t.type({ - field: t.string, - value: t.string, - operator, - risk_score: t.union([RiskScore, t.undefined]), - }) -); - -export type RiskScoreMapping = t.TypeOf<typeof RiskScoreMapping>; -export const RiskScoreMapping = t.array(RiskScoreMappingItem); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/rule_schedule/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/rule_schedule/index.ts deleted file mode 100644 index 4d0113f330ae9..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/rule_schedule/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { From } from '../from'; - -export type RuleInterval = t.TypeOf<typeof RuleInterval>; -export const RuleInterval = t.string; // we need a more specific schema - -export type RuleIntervalFrom = t.TypeOf<typeof RuleIntervalFrom>; -export const RuleIntervalFrom = From; - -/** - * TODO: Create a regular expression type or custom date math part type here - */ -export type RuleIntervalTo = t.TypeOf<typeof RuleIntervalTo>; -export const RuleIntervalTo = t.string; // we need a more specific schema diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/saved_object_attributes/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/saved_object_attributes/index.ts deleted file mode 100644 index 2a7af4e665183..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/saved_object_attributes/index.ts +++ /dev/null @@ -1,64 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; - -/** - * TODO: This type are originally from "src/core/types/saved_objects.ts", once that is package friendly remove - * this copied type. - * - * Don't use this type, it's simply a helper type for {@link SavedObjectAttribute} - * - * @public - */ -export type SavedObjectAttributeSingle = - | string - | number - | boolean - | null - | undefined - | SavedObjectAttributes; - -/** - * TODO: This type are originally from "src/core/types/saved_objects.ts", once that is package friendly remove - * this copied type. - * - * Type definition for a Saved Object attribute value - * - * @public - */ -export type SavedObjectAttribute = SavedObjectAttributeSingle | SavedObjectAttributeSingle[]; - -/** - * TODO: This type are originally from "src/core/types/saved_objects.ts", once that is package friendly remove - * this copied type. - * - * The data for a Saved Object is stored as an object in the `attributes` - * property. - * - * @public - */ -export interface SavedObjectAttributes { - [key: string]: SavedObjectAttribute; -} - -export const saved_object_attribute_single: t.Type<SavedObjectAttributeSingle> = t.recursion( - 'saved_object_attribute_single', - () => t.union([t.string, t.number, t.boolean, t.null, t.undefined, saved_object_attributes]) -); -export const saved_object_attribute: t.Type<SavedObjectAttribute> = t.recursion( - 'saved_object_attribute', - () => t.union([saved_object_attribute_single, t.array(saved_object_attribute_single)]) -); -export const saved_object_attributes: t.Type<SavedObjectAttributes> = t.recursion( - 'saved_object_attributes', - () => t.record(t.string, saved_object_attribute) -); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/severity/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/severity/index.ts deleted file mode 100644 index fef1082129df8..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/severity/index.ts +++ /dev/null @@ -1,13 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export type Severity = t.TypeOf<typeof Severity>; -export const Severity = t.keyof({ low: null, medium: null, high: null, critical: null }); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/severity_mapping/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/severity_mapping/index.ts deleted file mode 100644 index afd7889658a35..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/severity_mapping/index.ts +++ /dev/null @@ -1,26 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { operator } from '@kbn/securitysolution-io-ts-types'; -import { Severity } from '../severity'; - -export type SeverityMappingItem = t.TypeOf<typeof SeverityMappingItem>; -export const SeverityMappingItem = t.exact( - t.type({ - field: t.string, - operator, - value: t.string, - severity: Severity, - }) -); - -export type SeverityMapping = t.TypeOf<typeof SeverityMapping>; -export const SeverityMapping = t.array(SeverityMappingItem); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/threat/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/threat/index.ts deleted file mode 100644 index e60f9ccafcc13..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/threat/index.ts +++ /dev/null @@ -1,38 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; -import { threat_tactic } from '../threat_tactic'; -import { threat_techniques } from '../threat_technique'; - -export const threat_framework = t.string; - -export const threat = t.intersection([ - t.exact( - t.type({ - framework: threat_framework, - tactic: threat_tactic, - }) - ), - t.exact( - t.partial({ - technique: threat_techniques, - }) - ), -]); - -export type Threat = t.TypeOf<typeof threat>; - -export const threats = t.array(threat); -export type Threats = t.TypeOf<typeof threats>; - -export const threatsOrUndefined = t.union([threats, t.undefined]); -export type ThreatsOrUndefined = t.TypeOf<typeof threatsOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_mapping/index.test.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_mapping/index.test.ts deleted file mode 100644 index 3d3e1ab9a22bf..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_mapping/index.test.ts +++ /dev/null @@ -1,237 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { - concurrent_searches, - items_per_search, - ThreatMapping, - threatMappingEntries, - ThreatMappingEntries, - threat_mapping, -} from '.'; -import { foldLeftRight, getPaths, exactCheck } from '@kbn/securitysolution-io-ts-utils'; - -describe('threat_mapping', () => { - describe('threatMappingEntries', () => { - test('it should validate an entry', () => { - const payload: ThreatMappingEntries = [ - { - field: 'field.one', - type: 'mapping', - value: 'field.one', - }, - ]; - const decoded = threatMappingEntries.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should fail validation with an extra entry item', () => { - const payload: Array<ThreatMappingEntries[0] & { extra: string }> = [ - { - field: 'field.one', - type: 'mapping', - value: 'field.one', - extra: 'blah', - }, - ]; - const decoded = threatMappingEntries.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extra"']); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation with a non string', () => { - const payload = [ - { - field: 5, - type: 'mapping', - value: 'field.one', - }, - ] as unknown as ThreatMappingEntries[]; - const decoded = threatMappingEntries.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "5" supplied to "field"']); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation with a wrong type', () => { - const payload = [ - { - field: 'field.one', - type: 'invalid', - value: 'field.one', - }, - ] as unknown as ThreatMappingEntries[]; - const decoded = threatMappingEntries.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "invalid" supplied to "type"', - ]); - expect(message.schema).toEqual({}); - }); - }); - - describe('threat_mapping', () => { - test('it should validate a threat mapping', () => { - const payload: ThreatMapping = [ - { - entries: [ - { - field: 'field.one', - type: 'mapping', - value: 'field.one', - }, - ], - }, - ]; - const decoded = threat_mapping.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - }); - - test('it should fail validate with an extra key', () => { - const payload: Array<ThreatMapping[0] & { extra: string }> = [ - { - entries: [ - { - field: 'field.one', - type: 'mapping', - value: 'field.one', - }, - ], - extra: 'invalid', - }, - ]; - - const decoded = threat_mapping.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extra"']); - expect(message.schema).toEqual({}); - }); - - test('it should fail validate with an extra inner entry', () => { - const payload: Array<ThreatMapping[0] & { entries: Array<{ extra: string }> }> = [ - { - entries: [ - { - field: 'field.one', - type: 'mapping', - value: 'field.one', - extra: 'blah', - }, - ], - }, - ]; - - const decoded = threat_mapping.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extra"']); - expect(message.schema).toEqual({}); - }); - - test('it should fail validate with an extra inner entry with the wrong data type', () => { - const payload = [ - { - entries: [ - { - field: 5, - type: 'mapping', - value: 'field.one', - }, - ], - }, - ] as unknown as ThreatMapping; - - const decoded = threat_mapping.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "5" supplied to "entries,field"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should fail validate with empty array', () => { - const payload: string[] = []; - - const decoded = threat_mapping.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "[]" supplied to "NonEmptyArray<ThreatMap>"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation when concurrent_searches is < 0', () => { - const payload = -1; - const decoded = concurrent_searches.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "-1" supplied to "PositiveIntegerGreaterThanZero"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation when concurrent_searches is 0', () => { - const payload = 0; - const decoded = concurrent_searches.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "0" supplied to "PositiveIntegerGreaterThanZero"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation when items_per_search is 0', () => { - const payload = 0; - const decoded = items_per_search.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "0" supplied to "PositiveIntegerGreaterThanZero"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation when items_per_search is < 0', () => { - const payload = -1; - const decoded = items_per_search.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "-1" supplied to "PositiveIntegerGreaterThanZero"', - ]); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_mapping/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_mapping/index.ts deleted file mode 100644 index 0cc8c950f7549..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_mapping/index.ts +++ /dev/null @@ -1,79 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; -import { - NonEmptyArray, - NonEmptyString, - PositiveIntegerGreaterThanZero, -} from '@kbn/securitysolution-io-ts-types'; -import { language } from '../language'; - -export const threat_query = t.string; -export type ThreatQuery = t.TypeOf<typeof threat_query>; -export const threatQueryOrUndefined = t.union([threat_query, t.undefined]); -export type ThreatQueryOrUndefined = t.TypeOf<typeof threatQueryOrUndefined>; - -export const threat_indicator_path = t.string; -export type ThreatIndicatorPath = t.TypeOf<typeof threat_indicator_path>; -export const threatIndicatorPathOrUndefined = t.union([threat_indicator_path, t.undefined]); -export type ThreatIndicatorPathOrUndefined = t.TypeOf<typeof threatIndicatorPathOrUndefined>; - -export const threat_filters = t.array(t.unknown); // Filters are not easily type-able yet -export type ThreatFilters = t.TypeOf<typeof threat_filters>; -export const threatFiltersOrUndefined = t.union([threat_filters, t.undefined]); -export type ThreatFiltersOrUndefined = t.TypeOf<typeof threatFiltersOrUndefined>; - -export const threatMapEntry = t.exact( - t.type({ - field: NonEmptyString, - type: t.keyof({ mapping: null }), - value: NonEmptyString, - }) -); - -export type ThreatMapEntry = t.TypeOf<typeof threatMapEntry>; - -export const threatMappingEntries = t.array(threatMapEntry); -export type ThreatMappingEntries = t.TypeOf<typeof threatMappingEntries>; - -export const threatMap = t.exact( - t.type({ - entries: threatMappingEntries, - }) -); -export type ThreatMap = t.TypeOf<typeof threatMap>; - -export const threat_mapping = NonEmptyArray(threatMap, 'NonEmptyArray<ThreatMap>'); -export type ThreatMapping = t.TypeOf<typeof threat_mapping>; - -export const threatMappingOrUndefined = t.union([threat_mapping, t.undefined]); -export type ThreatMappingOrUndefined = t.TypeOf<typeof threatMappingOrUndefined>; - -export const threat_index = t.array(t.string); -export type ThreatIndex = t.TypeOf<typeof threat_index>; -export const threatIndexOrUndefined = t.union([threat_index, t.undefined]); -export type ThreatIndexOrUndefined = t.TypeOf<typeof threatIndexOrUndefined>; - -export const threat_language = t.union([language, t.undefined]); -export type ThreatLanguage = t.TypeOf<typeof threat_language>; -export const threatLanguageOrUndefined = t.union([threat_language, t.undefined]); -export type ThreatLanguageOrUndefined = t.TypeOf<typeof threatLanguageOrUndefined>; - -export const concurrent_searches = PositiveIntegerGreaterThanZero; -export type ConcurrentSearches = t.TypeOf<typeof concurrent_searches>; -export const concurrentSearchesOrUndefined = t.union([concurrent_searches, t.undefined]); -export type ConcurrentSearchesOrUndefined = t.TypeOf<typeof concurrentSearchesOrUndefined>; - -export const items_per_search = PositiveIntegerGreaterThanZero; -export type ItemsPerSearch = t.TypeOf<typeof concurrent_searches>; -export const itemsPerSearchOrUndefined = t.union([items_per_search, t.undefined]); -export type ItemsPerSearchOrUndefined = t.TypeOf<typeof itemsPerSearchOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_subtechnique/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_subtechnique/index.ts deleted file mode 100644 index 963bf76bf5f87..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_subtechnique/index.ts +++ /dev/null @@ -1,26 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; - -export const threat_subtechnique_id = t.string; -export const threat_subtechnique_name = t.string; -export const threat_subtechnique_reference = t.string; - -export const threat_subtechnique = t.type({ - id: threat_subtechnique_id, - name: threat_subtechnique_name, - reference: threat_subtechnique_reference, -}); - -export const threat_subtechniques = t.array(threat_subtechnique); - -export type ThreatSubtechnique = t.TypeOf<typeof threat_subtechnique>; diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_tactic/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_tactic/index.ts deleted file mode 100644 index a142788876e7d..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_tactic/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; - -export const threat_tactic_id = t.string; -export const threat_tactic_name = t.string; -export const threat_tactic_reference = t.string; - -export const threat_tactic = t.type({ - id: threat_tactic_id, - name: threat_tactic_name, - reference: threat_tactic_reference, -}); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_technique/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_technique/index.ts deleted file mode 100644 index 2953ea86b3b3d..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_technique/index.ts +++ /dev/null @@ -1,35 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; -import { threat_subtechniques } from '../threat_subtechnique'; - -export const threat_technique_id = t.string; -export const threat_technique_name = t.string; -export const threat_technique_reference = t.string; - -export const threat_technique = t.intersection([ - t.exact( - t.type({ - id: threat_technique_id, - name: threat_technique_name, - reference: threat_technique_reference, - }) - ), - t.exact( - t.partial({ - subtechnique: threat_subtechniques, - }) - ), -]); -export const threat_techniques = t.array(threat_technique); - -export type ThreatTechnique = t.TypeOf<typeof threat_technique>; diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/throttle/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/throttle/index.ts deleted file mode 100644 index f1d6bdca8fed9..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/throttle/index.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { TimeDuration } from '@kbn/securitysolution-io-ts-types'; - -export type RuleActionThrottle = t.TypeOf<typeof RuleActionThrottle>; -export const RuleActionThrottle = t.union([ - t.literal('no_actions'), - t.literal('rule'), - TimeDuration({ allowedUnits: ['s', 'm', 'h', 'd'] }), -]); diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/type/index.ts b/packages/kbn-securitysolution-io-ts-alerting-types/src/type/index.ts deleted file mode 100644 index 68c7a2f30a2bb..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/src/type/index.ts +++ /dev/null @@ -1,25 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const type = t.keyof({ - eql: null, - machine_learning: null, - query: null, - saved_query: null, - threshold: null, - threat_match: null, - new_terms: null, - esql: null, -}); -export type Type = t.TypeOf<typeof type>; - -export const typeOrUndefined = t.union([type, t.undefined]); -export type TypeOrUndefined = t.TypeOf<typeof typeOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json b/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json deleted file mode 100644 index f9fb0b0fcebb2..0000000000000 --- a/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts" - ], - "kbn_references": [ - "@kbn/securitysolution-io-ts-types", - "@kbn/securitysolution-io-ts-utils" - ], - "exclude": [ - "target/**/*", - ] -} diff --git a/packages/kbn-securitysolution-io-ts-list-types/index.ts b/packages/kbn-securitysolution-io-ts-list-types/index.ts deleted file mode 100644 index 6d6b4e241b6d1..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/index.ts +++ /dev/null @@ -1,13 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './src/common'; -export * from './src/request'; -export * from './src/response'; -export * from './src/typescript_types'; diff --git a/packages/kbn-securitysolution-io-ts-list-types/jest.config.js b/packages/kbn-securitysolution-io-ts-list-types/jest.config.js deleted file mode 100644 index adcf48629dd7d..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/jest.config.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../..', - roots: ['<rootDir>/packages/kbn-securitysolution-io-ts-list-types'], -}; diff --git a/packages/kbn-securitysolution-io-ts-list-types/package.json b/packages/kbn-securitysolution-io-ts-list-types/package.json deleted file mode 100644 index 50c88fb22054f..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@kbn/securitysolution-io-ts-list-types", - "version": "1.0.0", - "description": "io ts utilities and types to be shared with plugins from the security solution project", - "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0", - "private": true, - "sideEffects": false -} \ No newline at end of file diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/comment/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/comment/index.mock.ts deleted file mode 100644 index d824f23fe74b8..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/comment/index.mock.ts +++ /dev/null @@ -1,20 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { Comment, CommentsArray } from '.'; -import { DATE_NOW, ID, USER } from '../../constants/index.mock'; - -export const getCommentsMock = (): Comment => ({ - comment: 'some old comment', - created_at: DATE_NOW, - created_by: USER, - id: ID, -}); - -export const getCommentsArrayMock = (): CommentsArray => [getCommentsMock(), getCommentsMock()]; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/comment/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/comment/index.test.ts deleted file mode 100644 index deca11f809cbe..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/comment/index.test.ts +++ /dev/null @@ -1,238 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { getCommentsArrayMock, getCommentsMock } from './index.mock'; -import { - Comment, - comment, - CommentsArray, - commentsArray, - CommentsArrayOrUndefined, - commentsArrayOrUndefined, -} from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; -import { DATE_NOW } from '../../constants/index.mock'; - -describe('Comment', () => { - describe('comment', () => { - test('it fails validation when "id" is undefined', () => { - const payload = { ...getCommentsMock(), id: undefined }; - const decoded = comment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "id"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it passes validation with a typical comment', () => { - const payload = getCommentsMock(); - const decoded = comment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it passes validation with "updated_at" and "updated_by" fields included', () => { - const payload = getCommentsMock(); - payload.updated_at = DATE_NOW; - payload.updated_by = 'someone'; - const decoded = comment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it fails validation when undefined', () => { - const payload = undefined; - const decoded = comment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>)"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it fails validation when "comment" is an empty string', () => { - const payload: Omit<Comment, 'comment'> & { comment: string } = { - ...getCommentsMock(), - comment: '', - }; - const decoded = comment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "comment"']); - expect(message.schema).toEqual({}); - }); - - test('it fails validation when "comment" is not a string', () => { - const payload: Omit<Comment, 'comment'> & { comment: string[] } = { - ...getCommentsMock(), - comment: ['some value'], - }; - const decoded = comment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "["some value"]" supplied to "comment"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it fails validation when "created_at" is not a string', () => { - const payload: Omit<Comment, 'created_at'> & { created_at: number } = { - ...getCommentsMock(), - created_at: 1, - }; - const decoded = comment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "created_at"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it fails validation when "created_by" is not a string', () => { - const payload: Omit<Comment, 'created_by'> & { created_by: number } = { - ...getCommentsMock(), - created_by: 1, - }; - const decoded = comment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "created_by"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it fails validation when "updated_at" is not a string', () => { - const payload: Omit<Comment, 'updated_at'> & { updated_at: number } = { - ...getCommentsMock(), - updated_at: 1, - }; - const decoded = comment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "updated_at"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it fails validation when "updated_by" is not a string', () => { - const payload: Omit<Comment, 'updated_by'> & { updated_by: number } = { - ...getCommentsMock(), - updated_by: 1, - }; - const decoded = comment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "updated_by"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should strip out extra keys', () => { - const payload: Comment & { - extraKey?: string; - } = getCommentsMock(); - payload.extraKey = 'some value'; - const decoded = comment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getCommentsMock()); - }); - }); - - describe('commentsArray', () => { - test('it passes validation an array of Comment', () => { - const payload = getCommentsArrayMock(); - const decoded = commentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it passes validation when a Comment includes "updated_at" and "updated_by"', () => { - const commentsPayload = getCommentsMock(); - commentsPayload.updated_at = DATE_NOW; - commentsPayload.updated_by = 'someone'; - const payload = [{ ...commentsPayload }, ...getCommentsArrayMock()]; - const decoded = commentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it fails validation when undefined', () => { - const payload = undefined; - const decoded = commentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "Array<({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>)>"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it fails validation when array includes non Comment types', () => { - const payload = [1] as unknown as CommentsArray; - const decoded = commentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "Array<({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>)>"', - ]); - expect(message.schema).toEqual({}); - }); - }); - - describe('commentsArrayOrUndefined', () => { - test('it passes validation an array of Comment', () => { - const payload = getCommentsArrayMock(); - const decoded = commentsArrayOrUndefined.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it passes validation when undefined', () => { - const payload = undefined; - const decoded = commentsArrayOrUndefined.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it fails validation when array includes non Comment types', () => { - const payload = [1] as unknown as CommentsArrayOrUndefined; - const decoded = commentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "Array<({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>)>"', - ]); - expect(message.schema).toEqual({}); - }); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/comment/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/comment/index.ts deleted file mode 100644 index 3aac99e6c48e2..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/comment/index.ts +++ /dev/null @@ -1,40 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; -import { created_at } from '../created_at'; -import { created_by } from '../created_by'; -import { id } from '../id'; -import { updated_at } from '../updated_at'; -import { updated_by } from '../updated_by'; - -export const comment = t.intersection([ - t.exact( - t.type({ - comment: NonEmptyString, - created_at, - created_by, - id, - }) - ), - t.exact( - t.partial({ - updated_at, - updated_by, - }) - ), -]); - -export const commentsArray = t.array(comment); -export type CommentsArray = t.TypeOf<typeof commentsArray>; -export type Comment = t.TypeOf<typeof comment>; -export const commentsArrayOrUndefined = t.union([commentsArray, t.undefined]); -export type CommentsArrayOrUndefined = t.TypeOf<typeof commentsArrayOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/create_comment/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/create_comment/index.mock.ts deleted file mode 100644 index bad427de97471..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/create_comment/index.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { CreateComment, CreateCommentsArray } from '.'; - -export const getCreateCommentsMock = (): CreateComment => ({ - comment: 'some comments', -}); - -export const getCreateCommentsArrayMock = (): CreateCommentsArray => [getCreateCommentsMock()]; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/create_comment/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/create_comment/index.test.ts deleted file mode 100644 index c537e9e28091c..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/create_comment/index.test.ts +++ /dev/null @@ -1,135 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { getCreateCommentsArrayMock, getCreateCommentsMock } from './index.mock'; -import { - CreateComment, - createComment, - CreateCommentsArray, - createCommentsArray, - CreateCommentsArrayOrUndefined, - createCommentsArrayOrUndefined, -} from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('CreateComment', () => { - describe('createComment', () => { - test('it passes validation with a default comment', () => { - const payload = getCreateCommentsMock(); - const decoded = createComment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it fails validation when undefined', () => { - const payload = undefined; - const decoded = createComment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "{| comment: NonEmptyString |}"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it fails validation when "comment" is not a string', () => { - const payload: Omit<CreateComment, 'comment'> & { comment: string[] } = { - ...getCreateCommentsMock(), - comment: ['some value'], - }; - const decoded = createComment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "["some value"]" supplied to "comment"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should strip out extra keys', () => { - const payload: CreateComment & { - extraKey?: string; - } = getCreateCommentsMock(); - payload.extraKey = 'some value'; - const decoded = createComment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getCreateCommentsMock()); - }); - }); - - describe('createCommentsArray', () => { - test('it passes validation an array of comments', () => { - const payload = getCreateCommentsArrayMock(); - const decoded = createCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it fails validation when undefined', () => { - const payload = undefined; - const decoded = createCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "Array<{| comment: NonEmptyString |}>"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it fails validation when array includes non comments types', () => { - const payload = [1] as unknown as CreateCommentsArray; - const decoded = createCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "Array<{| comment: NonEmptyString |}>"', - ]); - expect(message.schema).toEqual({}); - }); - }); - - describe('createCommentsArrayOrUndefined', () => { - test('it passes validation an array of comments', () => { - const payload = getCreateCommentsArrayMock(); - const decoded = createCommentsArrayOrUndefined.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it passes validation when undefined', () => { - const payload = undefined; - const decoded = createCommentsArrayOrUndefined.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it fails validation when array includes non comments types', () => { - const payload = [1] as unknown as CreateCommentsArrayOrUndefined; - const decoded = createCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "Array<{| comment: NonEmptyString |}>"', - ]); - expect(message.schema).toEqual({}); - }); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/create_comment/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/create_comment/index.ts deleted file mode 100644 index f4082df289ac2..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/create_comment/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; - -export const createComment = t.exact( - t.type({ - comment: NonEmptyString, - }) -); - -export type CreateComment = t.TypeOf<typeof createComment>; -export const createCommentsArray = t.array(createComment); -export type CreateCommentsArray = t.TypeOf<typeof createCommentsArray>; -export type CreateComments = t.TypeOf<typeof createComment>; -export const createCommentsArrayOrUndefined = t.union([createCommentsArray, t.undefined]); -export type CreateCommentsArrayOrUndefined = t.TypeOf<typeof createCommentsArrayOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/created_at/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/created_at/index.ts deleted file mode 100644 index 697a5034cbf05..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/created_at/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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; - -export const created_at = t.string; // TODO: Make this into an ISO Date string check diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/created_by/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/created_by/index.ts deleted file mode 100644 index e6f3e2f90edb4..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/created_by/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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; - -export const created_by = t.string; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/cursor/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/cursor/index.ts deleted file mode 100644 index 4844ffe7e3640..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/cursor/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const cursor = t.string; -export type Cursor = t.TypeOf<typeof cursor>; -export const cursorOrUndefined = t.union([cursor, t.undefined]); -export type CursorOrUndefined = t.TypeOf<typeof cursorOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_comments_array/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/default_comments_array/index.test.ts deleted file mode 100644 index d0c7e3cc0447a..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_comments_array/index.test.ts +++ /dev/null @@ -1,66 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { CommentsArray } from '../comment'; -import { DefaultCommentsArray } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; -import { getCommentsArrayMock } from '../comment/index.mock'; - -describe('default_comments_array', () => { - test('it should pass validation when supplied an empty array', () => { - const payload: CommentsArray = []; - const decoded = DefaultCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should pass validation when supplied an array of comments', () => { - const payload: CommentsArray = getCommentsArrayMock(); - const decoded = DefaultCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should fail validation when supplied an array of numbers', () => { - const payload = [1]; - const decoded = DefaultCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "Array<({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>)>"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation when supplied an array of strings', () => { - const payload = ['some string']; - const decoded = DefaultCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "some string" supplied to "Array<({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>)>"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should return a default array entry', () => { - const payload = null; - const decoded = DefaultCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual([]); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_comments_array/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/default_comments_array/index.ts deleted file mode 100644 index 6a89b00633513..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_comments_array/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; -import { comment, CommentsArray } from '../comment'; - -/** - * Types the DefaultCommentsArray as: - * - If null or undefined, then a default array of type entry will be set - */ -export const DefaultCommentsArray = new t.Type<CommentsArray, CommentsArray, unknown>( - 'DefaultCommentsArray', - t.array(comment).is, - (input): Either<t.Errors, CommentsArray> => - input == null ? t.success([]) : t.array(comment).decode(input), - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_create_comments_array/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/default_create_comments_array/index.test.ts deleted file mode 100644 index ce909c0314b3b..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_create_comments_array/index.test.ts +++ /dev/null @@ -1,66 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; -import { CommentsArray } from '../comment'; -import { DefaultCommentsArray } from '../default_comments_array'; -import { getCommentsArrayMock } from '../comment/index.mock'; - -describe('default_comments_array', () => { - test('it should pass validation when supplied an empty array', () => { - const payload: CommentsArray = []; - const decoded = DefaultCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should pass validation when supplied an array of comments', () => { - const payload: CommentsArray = getCommentsArrayMock(); - const decoded = DefaultCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should fail validation when supplied an array of numbers', () => { - const payload = [1]; - const decoded = DefaultCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "Array<({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>)>"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation when supplied an array of strings', () => { - const payload = ['some string']; - const decoded = DefaultCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "some string" supplied to "Array<({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>)>"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should return a default array entry', () => { - const payload = null; - const decoded = DefaultCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual([]); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_create_comments_array/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/default_create_comments_array/index.ts deleted file mode 100644 index 0ed345891719b..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_create_comments_array/index.ts +++ /dev/null @@ -1,28 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; -import { createComment, CreateCommentsArray } from '../create_comment'; - -/** - * Types the DefaultCreateComments as: - * - If null or undefined, then a default array of type entry will be set - */ -export const DefaultCreateCommentsArray = new t.Type< - CreateCommentsArray, - CreateCommentsArray, - unknown ->( - 'DefaultCreateComments', - t.array(createComment).is, - (input): Either<t.Errors, CreateCommentsArray> => - input == null ? t.success([]) : t.array(createComment).decode(input), - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_import_comments_array/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/default_import_comments_array/index.test.ts deleted file mode 100644 index 9b6f8df6850cb..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_import_comments_array/index.test.ts +++ /dev/null @@ -1,88 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; -import { ImportCommentsArray } from '../import_comment'; -import { DefaultImportCommentsArray } from '.'; -import { getCommentsArrayMock } from '../comment/index.mock'; -import { getCreateCommentsArrayMock } from '../create_comment/index.mock'; - -describe('default_import_comments_array', () => { - test('it should pass validation when supplied an empty array', () => { - const payload: ImportCommentsArray = []; - const decoded = DefaultImportCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should pass validation when supplied an array of comments', () => { - const payload: ImportCommentsArray = getCommentsArrayMock(); - const decoded = DefaultImportCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should pass validation when supplied an array of new comments', () => { - const payload: ImportCommentsArray = getCreateCommentsArrayMock(); - const decoded = DefaultImportCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should pass validation when supplied an array of new and existing comments', () => { - const payload: ImportCommentsArray = [ - ...getCommentsArrayMock(), - ...getCreateCommentsArrayMock(), - ]; - const decoded = DefaultImportCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should fail validation when supplied an array of numbers', () => { - const payload = [1]; - const decoded = DefaultImportCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "DefaultImportComments"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation when supplied an array of strings', () => { - const payload = ['some string']; - const decoded = DefaultImportCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "some string" supplied to "DefaultImportComments"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should return a default array entry', () => { - const payload = null; - const decoded = DefaultImportCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual([]); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_import_comments_array/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/default_import_comments_array/index.ts deleted file mode 100644 index dc8d18e7e11e6..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_import_comments_array/index.ts +++ /dev/null @@ -1,28 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; -import { importComment, ImportCommentsArray } from '../import_comment'; - -/** - * Types the DefaultImportCommentsArray as: - * - If null or undefined, then a default array of type ImportCommentsArray will be set - */ -export const DefaultImportCommentsArray = new t.Type< - ImportCommentsArray, - ImportCommentsArray, - unknown ->( - 'DefaultImportComments', - t.array(importComment).is, - (input, context): Either<t.Errors, ImportCommentsArray> => - input == null ? t.success([]) : t.array(importComment).validate(input, context), - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace/index.test.ts deleted file mode 100644 index 69cdd841c0a5e..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace/index.test.ts +++ /dev/null @@ -1,62 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { DefaultNamespace } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('default_namespace', () => { - test('it should validate "single"', () => { - const payload = 'single'; - const decoded = DefaultNamespace.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate "agnostic"', () => { - const payload = 'agnostic'; - const decoded = DefaultNamespace.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it defaults to "single" if "undefined"', () => { - const payload = undefined; - const decoded = DefaultNamespace.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual('single'); - }); - - test('it defaults to "single" if "null"', () => { - const payload = null; - const decoded = DefaultNamespace.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual('single'); - }); - - test('it should FAIL validation if not "single" or "agnostic"', () => { - const payload = 'something else'; - const decoded = DefaultNamespace.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - `Invalid value "something else" supplied to "DefaultNamespace"`, - ]); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace/index.ts deleted file mode 100644 index 33f53c55b1986..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace/index.ts +++ /dev/null @@ -1,26 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; - -export const namespaceType = t.keyof({ agnostic: null, single: null }); -export type NamespaceType = t.TypeOf<typeof namespaceType>; - -/** - * Types the DefaultNamespace as: - * - If null or undefined, then a default string/enumeration of "single" will be used. - */ -export const DefaultNamespace = new t.Type<NamespaceType, NamespaceType | undefined, unknown>( - 'DefaultNamespace', - namespaceType.is, - (input, context): Either<t.Errors, NamespaceType> => - input == null ? t.success('single') : namespaceType.validate(input, context), - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace_array/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace_array/index.test.ts deleted file mode 100644 index 359674e57041e..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace_array/index.test.ts +++ /dev/null @@ -1,100 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { DefaultNamespaceArray, DefaultNamespaceArrayType } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('default_namespace_array', () => { - test('it should validate "null" single item as an array with a "single" value', () => { - const payload: DefaultNamespaceArrayType = null; - const decoded = DefaultNamespaceArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(['single']); - }); - - test('it should FAIL validation of numeric value', () => { - const payload = 5; - const decoded = DefaultNamespaceArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "5" supplied to "DefaultNamespaceArray"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should validate "undefined" item as an array with a "single" value', () => { - const payload: DefaultNamespaceArrayType = undefined; - const decoded = DefaultNamespaceArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(['single']); - }); - - test('it should validate "single" as an array of a "single" value', () => { - const payload: DefaultNamespaceArrayType = 'single'; - const decoded = DefaultNamespaceArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual([payload]); - }); - - test('it should validate "agnostic" as an array of a "agnostic" value', () => { - const payload: DefaultNamespaceArrayType = 'agnostic'; - const decoded = DefaultNamespaceArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual([payload]); - }); - - test('it should validate "single,agnostic" as an array of 2 values of ["single", "agnostic"] values', () => { - const payload: DefaultNamespaceArrayType = 'agnostic,single'; - const decoded = DefaultNamespaceArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(['agnostic', 'single']); - }); - - test('it should validate 3 elements of "single,agnostic,single" as an array of 3 values of ["single", "agnostic", "single"] values', () => { - const payload: DefaultNamespaceArrayType = 'single,agnostic,single'; - const decoded = DefaultNamespaceArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(['single', 'agnostic', 'single']); - }); - - test('it should validate 3 elements of "single,agnostic, single" as an array of 3 values of ["single", "agnostic", "single"] values when there are spaces', () => { - const payload: DefaultNamespaceArrayType = ' single, agnostic, single '; - const decoded = DefaultNamespaceArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(['single', 'agnostic', 'single']); - }); - - test('it should FAIL validation when given 3 elements of "single,agnostic,junk" since the 3rd value is junk', () => { - const payload: DefaultNamespaceArrayType = 'single,agnostic,junk'; - const decoded = DefaultNamespaceArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "junk" supplied to "DefaultNamespaceArray"', - ]); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace_array/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace_array/index.ts deleted file mode 100644 index 9692b8a2783d8..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace_array/index.ts +++ /dev/null @@ -1,45 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; -import { namespaceType } from '../default_namespace'; - -export const namespaceTypeArray = t.array(namespaceType); -export type NamespaceTypeArray = t.TypeOf<typeof namespaceTypeArray>; - -/** - * Types the DefaultNamespaceArray as: - * - If null or undefined, then a default string array of "single" will be used. - * - If it contains a string, then it is split along the commas and puts them into an array and validates it - */ -export const DefaultNamespaceArray = new t.Type< - NamespaceTypeArray, - string | undefined | null, - unknown ->( - 'DefaultNamespaceArray', - namespaceTypeArray.is, - (input, context): Either<t.Errors, NamespaceTypeArray> => { - if (input == null) { - return t.success(['single']); - } else if (typeof input === 'string') { - const commaSeparatedValues = input - .trim() - .split(',') - .map((value) => value.trim()); - return namespaceTypeArray.validate(commaSeparatedValues, context); - } - return t.failure(input, context); - }, - String -); - -export type DefaultNamespaceArrayType = t.OutputOf<typeof DefaultNamespaceArray>; -export type DefaultNamespaceArrayTypeDecoded = t.TypeOf<typeof DefaultNamespaceArray>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_update_comments_array/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/default_update_comments_array/index.test.ts deleted file mode 100644 index aaffae53cecab..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_update_comments_array/index.test.ts +++ /dev/null @@ -1,66 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { UpdateCommentsArray } from '../update_comment'; -import { DefaultUpdateCommentsArray } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; -import { getUpdateCommentsArrayMock } from '../update_comment/index.mock'; - -describe('default_update_comments_array', () => { - test('it should pass validation when supplied an empty array', () => { - const payload: UpdateCommentsArray = []; - const decoded = DefaultUpdateCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should pass validation when supplied an array of comments', () => { - const payload: UpdateCommentsArray = getUpdateCommentsArrayMock(); - const decoded = DefaultUpdateCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should fail validation when supplied an array of numbers', () => { - const payload = [1]; - const decoded = DefaultUpdateCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "DefaultUpdateComments"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation when supplied an array of strings', () => { - const payload = ['some string']; - const decoded = DefaultUpdateCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "some string" supplied to "DefaultUpdateComments"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should return a default array entry', () => { - const payload = null; - const decoded = DefaultUpdateCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual([]); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_update_comments_array/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/default_update_comments_array/index.ts deleted file mode 100644 index 47c0e562133df..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/default_update_comments_array/index.ts +++ /dev/null @@ -1,28 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; -import { updateCommentsArray, UpdateCommentsArray } from '../update_comment'; - -/** - * Types the DefaultUpdateComments as: - * - If null or undefined, then a default array of type UpdateCommentsArray will be set - */ -export const DefaultUpdateCommentsArray = new t.Type< - UpdateCommentsArray, - UpdateCommentsArray, - unknown ->( - 'DefaultUpdateComments', - updateCommentsArray.is, - (input, context): Either<t.Errors, UpdateCommentsArray> => - input == null ? t.success([]) : updateCommentsArray.validate(input, context), - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/description/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/description/index.ts deleted file mode 100644 index 75fd7ac92ffcf..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/description/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const description = t.string; -export type Description = t.TypeOf<typeof description>; -export const descriptionOrUndefined = t.union([description, t.undefined]); -export type DescriptionOrUndefined = t.TypeOf<typeof descriptionOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/deserializer/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/deserializer/index.ts deleted file mode 100644 index c5489a946897e..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/deserializer/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const deserializer = t.string; -export type Deserializer = t.TypeOf<typeof deserializer>; -export const deserializerOrUndefined = t.union([deserializer, t.undefined]); -export type DeserializerOrUndefined = t.TypeOf<typeof deserializerOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entries/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entries/index.mock.ts deleted file mode 100644 index bc091b1e33c35..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entries/index.mock.ts +++ /dev/null @@ -1,21 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EndpointEntriesArray } from '.'; -import { getEndpointEntryMatchMock } from '../entry_match/index.mock'; -import { getEndpointEntryMatchAnyMock } from '../entry_match_any/index.mock'; -import { getEndpointEntryNestedMock } from '../entry_nested/index.mock'; -import { getEndpointEntryMatchWildcardMock } from '../entry_match_wildcard/index.mock'; - -export const getEndpointEntriesArrayMock = (): EndpointEntriesArray => [ - getEndpointEntryMatchMock(), - getEndpointEntryMatchAnyMock(), - getEndpointEntryNestedMock(), - getEndpointEntryMatchWildcardMock(), -]; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entries/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entries/index.test.ts deleted file mode 100644 index 574bf4276461b..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entries/index.test.ts +++ /dev/null @@ -1,122 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { getEndpointEntryMatchMock } from '../entry_match/index.mock'; -import { - endpointEntriesArray, - nonEmptyEndpointEntriesArray, - NonEmptyEndpointEntriesArray, -} from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; -import { getEndpointEntryMatchAnyMock } from '../entry_match_any/index.mock'; -import { getEndpointEntryNestedMock } from '../entry_nested/index.mock'; -import { getEndpointEntriesArrayMock } from './index.mock'; -import { getEntryListMock } from '../../entries_list/index.mock'; -import { getEntryExistsMock } from '../../entries_exist/index.mock'; -import { getEndpointEntryMatchWildcardMock } from '../entry_match_wildcard/index.mock'; - -describe('Endpoint', () => { - describe('entriesArray', () => { - test('it should validate an array with match entry', () => { - const payload = [getEndpointEntryMatchMock()]; - const decoded = endpointEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate an array with match_any entry', () => { - const payload = [getEndpointEntryMatchAnyMock()]; - const decoded = endpointEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT validate an empty array', () => { - const payload: NonEmptyEndpointEntriesArray = []; - const decoded = nonEmptyEndpointEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "[]" supplied to "NonEmptyEndpointEntriesArray"', - ]); - expect(message.schema).toEqual({}); - }); - - test('type guard for nonEmptyEndpointNestedEntries should allow array of endpoint entries', () => { - const payload: NonEmptyEndpointEntriesArray = [getEndpointEntryMatchAnyMock()]; - const guarded = nonEmptyEndpointEntriesArray.is(payload); - expect(guarded).toBeTruthy(); - }); - - test('type guard for nonEmptyEndpointNestedEntries should disallow empty arrays', () => { - const payload: NonEmptyEndpointEntriesArray = []; - const guarded = nonEmptyEndpointEntriesArray.is(payload); - expect(guarded).toBeFalsy(); - }); - - test('it should NOT validate an array with exists entry', () => { - const payload = [getEntryExistsMock()]; - const decoded = endpointEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "exists" supplied to "type"', - 'Invalid value "undefined" supplied to "value"', - 'Invalid value "undefined" supplied to "entries"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT validate an array with list entry', () => { - const payload = [getEntryListMock()]; - const decoded = endpointEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "list" supplied to "type"', - 'Invalid value "undefined" supplied to "value"', - 'Invalid value "undefined" supplied to "entries"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should validate an array with nested entry', () => { - const payload = [getEndpointEntryNestedMock()]; - const decoded = endpointEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate an array with wildcard entry', () => { - const payload = [getEndpointEntryMatchWildcardMock()]; - const decoded = endpointEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate an array with all types of entries', () => { - const payload = getEndpointEntriesArrayMock(); - const decoded = endpointEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entries/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entries/index.ts deleted file mode 100644 index 992237161d06c..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entries/index.ts +++ /dev/null @@ -1,50 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; -import { endpointEntryMatch } from '../entry_match'; -import { endpointEntryMatchAny } from '../entry_match_any'; -import { endpointEntryNested } from '../entry_nested'; -import { endpointEntryMatchWildcard } from '../entry_match_wildcard'; - -export const endpointEntriesArray = t.array( - t.union([ - endpointEntryMatch, - endpointEntryMatchAny, - endpointEntryMatchWildcard, - endpointEntryNested, - ]) -); -export type EndpointEntriesArray = t.TypeOf<typeof endpointEntriesArray>; - -/** - * Types the nonEmptyEndpointEntriesArray as: - * - An array of entries of length 1 or greater - * - */ -export const nonEmptyEndpointEntriesArray = new t.Type< - EndpointEntriesArray, - EndpointEntriesArray, - unknown ->( - 'NonEmptyEndpointEntriesArray', - (u: unknown): u is EndpointEntriesArray => endpointEntriesArray.is(u) && u.length > 0, - (input, context): Either<t.Errors, EndpointEntriesArray> => { - if (Array.isArray(input) && input.length === 0) { - return t.failure(input, context); - } else { - return endpointEntriesArray.validate(input, context); - } - }, - t.identity -); - -export type NonEmptyEndpointEntriesArray = t.OutputOf<typeof nonEmptyEndpointEntriesArray>; -export type NonEmptyEndpointEntriesArrayDecoded = t.TypeOf<typeof nonEmptyEndpointEntriesArray>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match/index.mock.ts deleted file mode 100644 index 76305cf70c585..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match/index.mock.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EndpointEntryMatch } from '.'; -import { ENTRY_VALUE, FIELD, MATCH, OPERATOR } from '../../../constants/index.mock'; - -export const getEndpointEntryMatchMock = (): EndpointEntryMatch => ({ - field: FIELD, - operator: OPERATOR, - type: MATCH, - value: ENTRY_VALUE, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match/index.test.ts deleted file mode 100644 index 5c20b697b3bf5..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match/index.test.ts +++ /dev/null @@ -1,103 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { getEndpointEntryMatchMock } from './index.mock'; -import { EndpointEntryMatch, endpointEntryMatch } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; -import { getEntryMatchMock } from '../../entry_match/index.mock'; - -describe('endpointEntryMatch', () => { - test('it should validate an entry', () => { - const payload = getEndpointEntryMatchMock(); - const decoded = endpointEntryMatch.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT validate when "operator" is "excluded"', () => { - // Use the generic entry mock so we can test operator: excluded - const payload = getEntryMatchMock(); - payload.operator = 'excluded'; - const decoded = endpointEntryMatch.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "excluded" supplied to "operator"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "field" is empty string', () => { - const payload: Omit<EndpointEntryMatch, 'field'> & { field: string } = { - ...getEndpointEntryMatchMock(), - field: '', - }; - const decoded = endpointEntryMatch.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "field"']); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "value" is not string', () => { - const payload: Omit<EndpointEntryMatch, 'value'> & { value: string[] } = { - ...getEndpointEntryMatchMock(), - value: ['some value'], - }; - const decoded = endpointEntryMatch.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "["some value"]" supplied to "value"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "value" is empty string', () => { - const payload: Omit<EndpointEntryMatch, 'value'> & { value: string } = { - ...getEndpointEntryMatchMock(), - value: '', - }; - const decoded = endpointEntryMatch.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "value"']); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "type" is not "match"', () => { - const payload: Omit<EndpointEntryMatch, 'type'> & { type: string } = { - ...getEndpointEntryMatchMock(), - type: 'match_any', - }; - const decoded = endpointEntryMatch.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "match_any" supplied to "type"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should strip out extra keys', () => { - const payload: EndpointEntryMatch & { - extraKey?: string; - } = getEndpointEntryMatchMock(); - payload.extraKey = 'some value'; - const decoded = endpointEntryMatch.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getEntryMatchMock()); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match/index.ts deleted file mode 100644 index 5ae0258ebfb79..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match/index.ts +++ /dev/null @@ -1,21 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { NonEmptyString, operatorIncluded } from '@kbn/securitysolution-io-ts-types'; - -export const endpointEntryMatch = t.exact( - t.type({ - field: NonEmptyString, - operator: operatorIncluded, - type: t.keyof({ match: null }), - value: NonEmptyString, - }) -); -export type EndpointEntryMatch = t.TypeOf<typeof endpointEntryMatch>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_any/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_any/index.mock.ts deleted file mode 100644 index b3bfffd4daf97..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_any/index.mock.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ENTRY_VALUE, FIELD, MATCH_ANY, OPERATOR } from '../../../constants/index.mock'; -import { EndpointEntryMatchAny } from '.'; - -export const getEndpointEntryMatchAnyMock = (): EndpointEntryMatchAny => ({ - field: FIELD, - operator: OPERATOR, - type: MATCH_ANY, - value: [ENTRY_VALUE], -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_any/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_any/index.test.ts deleted file mode 100644 index e121eed769ea9..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_any/index.test.ts +++ /dev/null @@ -1,101 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { getEndpointEntryMatchAnyMock } from './index.mock'; -import { EndpointEntryMatchAny, endpointEntryMatchAny } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; -import { getEntryMatchAnyMock } from '../../entry_match_any/index.mock'; - -describe('endpointEntryMatchAny', () => { - test('it should validate an entry', () => { - const payload = getEndpointEntryMatchAnyMock(); - const decoded = endpointEntryMatchAny.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT validate when operator is "excluded"', () => { - // Use the generic entry mock so we can test operator: excluded - const payload = getEntryMatchAnyMock(); - payload.operator = 'excluded'; - const decoded = endpointEntryMatchAny.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "excluded" supplied to "operator"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when field is empty string', () => { - const payload: Omit<EndpointEntryMatchAny, 'field'> & { field: string } = { - ...getEndpointEntryMatchAnyMock(), - field: '', - }; - const decoded = endpointEntryMatchAny.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "field"']); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when value is empty array', () => { - const payload: Omit<EndpointEntryMatchAny, 'value'> & { value: string[] } = { - ...getEndpointEntryMatchAnyMock(), - value: [], - }; - const decoded = endpointEntryMatchAny.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "[]" supplied to "value"']); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when value is not string array', () => { - const payload: Omit<EndpointEntryMatchAny, 'value'> & { value: string } = { - ...getEndpointEntryMatchAnyMock(), - value: 'some string', - }; - const decoded = endpointEntryMatchAny.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "some string" supplied to "value"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "type" is not "match_any"', () => { - const payload: Omit<EndpointEntryMatchAny, 'type'> & { type: string } = { - ...getEndpointEntryMatchAnyMock(), - type: 'match', - }; - const decoded = endpointEntryMatchAny.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "match" supplied to "type"']); - expect(message.schema).toEqual({}); - }); - - test('it should strip out extra keys', () => { - const payload: EndpointEntryMatchAny & { - extraKey?: string; - } = getEndpointEntryMatchAnyMock(); - payload.extraKey = 'some extra key'; - const decoded = endpointEntryMatchAny.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getEntryMatchAnyMock()); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_any/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_any/index.ts deleted file mode 100644 index d639f4481d4d3..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_any/index.ts +++ /dev/null @@ -1,25 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { - NonEmptyString, - nonEmptyOrNullableStringArray, - operatorIncluded, -} from '@kbn/securitysolution-io-ts-types'; - -export const endpointEntryMatchAny = t.exact( - t.type({ - field: NonEmptyString, - operator: operatorIncluded, - type: t.keyof({ match_any: null }), - value: nonEmptyOrNullableStringArray, - }) -); -export type EndpointEntryMatchAny = t.TypeOf<typeof endpointEntryMatchAny>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_wildcard/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_wildcard/index.mock.ts deleted file mode 100644 index f1b5c7e7421af..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_wildcard/index.mock.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ENTRY_VALUE, FIELD, OPERATOR, WILDCARD } from '../../../constants/index.mock'; -import { EndpointEntryMatchWildcard } from '.'; - -export const getEndpointEntryMatchWildcardMock = (): EndpointEntryMatchWildcard => ({ - field: FIELD, - operator: OPERATOR, - type: WILDCARD, - value: ENTRY_VALUE, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_wildcard/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_wildcard/index.test.ts deleted file mode 100644 index 025994afcd9ef..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_wildcard/index.test.ts +++ /dev/null @@ -1,98 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { getEndpointEntryMatchWildcardMock } from './index.mock'; -import { EndpointEntryMatchWildcard, endpointEntryMatchWildcard } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; -import { getEntryMatchWildcardMock } from '../../entry_match_wildcard/index.mock'; - -describe('endpointEntryMatchWildcard', () => { - test('it should validate an entry', () => { - const payload = getEndpointEntryMatchWildcardMock(); - const decoded = endpointEntryMatchWildcard.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate when "operator" is "excluded"', () => { - const payload = getEntryMatchWildcardMock(); - payload.operator = 'excluded'; - const decoded = endpointEntryMatchWildcard.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should FAIL validation when "field" is empty string', () => { - const payload: Omit<EndpointEntryMatchWildcard, 'field'> & { field: string } = { - ...getEndpointEntryMatchWildcardMock(), - field: '', - }; - const decoded = endpointEntryMatchWildcard.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "field"']); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "value" is not string', () => { - const payload: Omit<EndpointEntryMatchWildcard, 'value'> & { value: string[] } = { - ...getEndpointEntryMatchWildcardMock(), - value: ['some value'], - }; - const decoded = endpointEntryMatchWildcard.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "["some value"]" supplied to "value"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "value" is empty string', () => { - const payload: Omit<EndpointEntryMatchWildcard, 'value'> & { value: string } = { - ...getEndpointEntryMatchWildcardMock(), - value: '', - }; - const decoded = endpointEntryMatchWildcard.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "value"']); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "type" is not "wildcard"', () => { - const payload: Omit<EndpointEntryMatchWildcard, 'type'> & { type: string } = { - ...getEndpointEntryMatchWildcardMock(), - type: 'match', - }; - const decoded = endpointEntryMatchWildcard.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "match" supplied to "type"']); - expect(message.schema).toEqual({}); - }); - - test('it should strip out extra keys', () => { - const payload: EndpointEntryMatchWildcard & { - extraKey?: string; - } = getEndpointEntryMatchWildcardMock(); - payload.extraKey = 'some value'; - const decoded = endpointEntryMatchWildcard.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getEntryMatchWildcardMock()); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_wildcard/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_wildcard/index.ts deleted file mode 100644 index b42f6245ea28d..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_wildcard/index.ts +++ /dev/null @@ -1,25 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { - NonEmptyString, - operatorExcluded, - operatorIncluded, -} from '@kbn/securitysolution-io-ts-types'; - -export const endpointEntryMatchWildcard = t.exact( - t.type({ - field: NonEmptyString, - operator: t.union([operatorIncluded, operatorExcluded]), - type: t.keyof({ wildcard: null }), - value: NonEmptyString, - }) -); -export type EndpointEntryMatchWildcard = t.TypeOf<typeof endpointEntryMatchWildcard>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_nested/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_nested/index.mock.ts deleted file mode 100644 index 44c5f8db5f6e7..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_nested/index.mock.ts +++ /dev/null @@ -1,19 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EndpointEntryNested } from '.'; -import { FIELD, NESTED } from '../../../constants/index.mock'; -import { getEndpointEntryMatchMock } from '../entry_match/index.mock'; -import { getEndpointEntryMatchAnyMock } from '../entry_match_any/index.mock'; - -export const getEndpointEntryNestedMock = (): EndpointEntryNested => ({ - entries: [getEndpointEntryMatchMock(), getEndpointEntryMatchAnyMock()], - field: FIELD, - type: NESTED, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_nested/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_nested/index.test.ts deleted file mode 100644 index c062deb88af81..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_nested/index.test.ts +++ /dev/null @@ -1,138 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { EndpointEntryNested, endpointEntryNested } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; -import { getEndpointEntryNestedMock } from './index.mock'; -import { getEndpointEntryMatchAnyMock } from '../entry_match_any/index.mock'; -import { - nonEmptyEndpointNestedEntriesArray, - NonEmptyEndpointNestedEntriesArray, -} from '../non_empty_nested_entries_array'; -import { getEndpointEntryMatchMock } from '../entry_match/index.mock'; -import { getEntryExistsMock } from '../../entries_exist/index.mock'; - -describe('endpointEntryNested', () => { - test('it should validate a nested entry', () => { - const payload = getEndpointEntryNestedMock(); - const decoded = endpointEntryNested.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should FAIL validation when "type" is not "nested"', () => { - const payload: Omit<EndpointEntryNested, 'type'> & { type: 'match' } = { - ...getEndpointEntryNestedMock(), - type: 'match', - }; - const decoded = endpointEntryNested.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "match" supplied to "type"']); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "field" is empty string', () => { - const payload: Omit<EndpointEntryNested, 'field'> & { - field: string; - } = { ...getEndpointEntryNestedMock(), field: '' }; - const decoded = endpointEntryNested.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "field"']); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "field" is not a string', () => { - const payload: Omit<EndpointEntryNested, 'field'> & { - field: number; - } = { ...getEndpointEntryNestedMock(), field: 1 }; - const decoded = endpointEntryNested.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "1" supplied to "field"']); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "entries" is not an array', () => { - const payload: Omit<EndpointEntryNested, 'entries'> & { - entries: string; - } = { ...getEndpointEntryNestedMock(), entries: 'im a string' }; - const decoded = endpointEntryNested.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "im a string" supplied to "entries"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should validate when "entries" contains an entry item that is type "match"', () => { - const payload = { ...getEndpointEntryNestedMock(), entries: [getEndpointEntryMatchAnyMock()] }; - const decoded = endpointEntryNested.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual({ - entries: [ - { - field: 'host.name', - operator: 'included', - type: 'match_any', - value: ['some host name'], - }, - ], - field: 'host.name', - type: 'nested', - }); - }); - - test('it should NOT validate when "entries" contains an entry item that is type "exists"', () => { - const payload = { ...getEndpointEntryNestedMock(), entries: [getEntryExistsMock()] }; - const decoded = endpointEntryNested.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "exists" supplied to "entries,type"', - 'Invalid value "undefined" supplied to "entries,value"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should strip out extra keys', () => { - const payload: EndpointEntryNested & { - extraKey?: string; - } = getEndpointEntryNestedMock(); - payload.extraKey = 'some extra key'; - const decoded = endpointEntryNested.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getEndpointEntryNestedMock()); - }); - - test('type guard for nonEmptyEndpointNestedEntries should allow array of endpoint entries', () => { - const payload: NonEmptyEndpointNestedEntriesArray = [ - getEndpointEntryMatchMock(), - getEndpointEntryMatchAnyMock(), - ]; - const guarded = nonEmptyEndpointNestedEntriesArray.is(payload); - expect(guarded).toBeTruthy(); - }); - - test('type guard for nonEmptyEndpointNestedEntries should disallow empty arrays', () => { - const payload: NonEmptyEndpointNestedEntriesArray = []; - const guarded = nonEmptyEndpointNestedEntriesArray.is(payload); - expect(guarded).toBeFalsy(); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_nested/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_nested/index.ts deleted file mode 100644 index 6625c1dfeaf59..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_nested/index.ts +++ /dev/null @@ -1,21 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; -import { nonEmptyEndpointNestedEntriesArray } from '../non_empty_nested_entries_array'; - -export const endpointEntryNested = t.exact( - t.type({ - entries: nonEmptyEndpointNestedEntriesArray, - field: NonEmptyString, - type: t.keyof({ nested: null }), - }) -); -export type EndpointEntryNested = t.TypeOf<typeof endpointEntryNested>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/index.ts deleted file mode 100644 index fb42cc8ee4686..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/index.ts +++ /dev/null @@ -1,11 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './entries'; -export * from './non_empty_nested_entries_array'; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/non_empty_nested_entries_array/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/non_empty_nested_entries_array/index.ts deleted file mode 100644 index 9bcfccae97b31..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/non_empty_nested_entries_array/index.ts +++ /dev/null @@ -1,47 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; -import { endpointEntryMatch } from '../entry_match'; -import { endpointEntryMatchAny } from '../entry_match_any'; - -export const endpointNestedEntriesArray = t.array( - t.union([endpointEntryMatch, endpointEntryMatchAny]) -); -export type EndpointNestedEntriesArray = t.TypeOf<typeof endpointNestedEntriesArray>; - -/** - * Types the nonEmptyNestedEntriesArray as: - * - An array of entries of length 1 or greater - * - */ -export const nonEmptyEndpointNestedEntriesArray = new t.Type< - EndpointNestedEntriesArray, - EndpointNestedEntriesArray, - unknown ->( - 'NonEmptyEndpointNestedEntriesArray', - (u: unknown): u is EndpointNestedEntriesArray => endpointNestedEntriesArray.is(u) && u.length > 0, - (input, context): Either<t.Errors, EndpointNestedEntriesArray> => { - if (Array.isArray(input) && input.length === 0) { - return t.failure(input, context); - } else { - return endpointNestedEntriesArray.validate(input, context); - } - }, - t.identity -); - -export type NonEmptyEndpointNestedEntriesArray = t.OutputOf< - typeof nonEmptyEndpointNestedEntriesArray ->; -export type NonEmptyEndpointNestedEntriesArrayDecoded = t.TypeOf< - typeof nonEmptyEndpointNestedEntriesArray ->; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.mock.ts deleted file mode 100644 index 5b8c802c94a38..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.mock.ts +++ /dev/null @@ -1,32 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EntriesArray } from '.'; -import { getEntryExistsMock } from '../entries_exist/index.mock'; -import { getEntryListMock } from '../entries_list/index.mock'; -import { getEntryMatchMock } from '../entry_match/index.mock'; -import { getEntryMatchAnyMock } from '../entry_match_any/index.mock'; -import { getEntryNestedMock } from '../entry_nested/index.mock'; - -export const getListAndNonListEntriesArrayMock = (): EntriesArray => [ - getEntryMatchMock(), - getEntryMatchAnyMock(), - getEntryListMock(), - getEntryExistsMock(), - getEntryNestedMock(), -]; - -export const getListEntriesArrayMock = (): EntriesArray => [getEntryListMock(), getEntryListMock()]; - -export const getEntriesArrayMock = (): EntriesArray => [ - getEntryMatchMock(), - getEntryMatchAnyMock(), - getEntryExistsMock(), - getEntryNestedMock(), -]; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.test.ts deleted file mode 100644 index 73553be78b9a1..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.test.ts +++ /dev/null @@ -1,149 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { getEntryMatchMock } from '../entry_match/index.mock'; -import { entriesArray, entriesArrayOrUndefined, entry } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; -import { getEntryMatchAnyMock } from '../entry_match_any/index.mock'; -import { getEntryExistsMock } from '../entries_exist/index.mock'; -import { getEntryListMock } from '../entries_list/index.mock'; -import { getEntryNestedMock } from '../entry_nested/index.mock'; -import { getEntriesArrayMock } from './index.mock'; - -describe('Entries', () => { - describe('entry', () => { - test('it should validate a match entry', () => { - const payload = getEntryMatchMock(); - const decoded = entry.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate a match_any entry', () => { - const payload = getEntryMatchAnyMock(); - const decoded = entry.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate a exists entry', () => { - const payload = getEntryExistsMock(); - const decoded = entry.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate a list entry', () => { - const payload = getEntryListMock(); - const decoded = entry.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should FAIL validation of nested entry', () => { - const payload = getEntryNestedMock(); - const decoded = entry.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "operator"', - 'Invalid value "nested" supplied to "type"', - 'Invalid value "undefined" supplied to "value"', - 'Invalid value "undefined" supplied to "list"', - ]); - expect(message.schema).toEqual({}); - }); - }); - - describe('entriesArray', () => { - test('it should validate an array with match entry', () => { - const payload = [getEntryMatchMock()]; - const decoded = entriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate an array with match_any entry', () => { - const payload = [getEntryMatchAnyMock()]; - const decoded = entriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate an array with exists entry', () => { - const payload = [getEntryExistsMock()]; - const decoded = entriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate an array with list entry', () => { - const payload = [getEntryListMock()]; - const decoded = entriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate an array with nested entry', () => { - const payload = [getEntryNestedMock()]; - const decoded = entriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate an array with all types of entries', () => { - const payload = [...getEntriesArrayMock()]; - const decoded = entriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - }); - - describe('entriesArrayOrUndefined', () => { - test('it should validate undefined', () => { - const payload = undefined; - const decoded = entriesArrayOrUndefined.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate an array with nested entry', () => { - const payload = [getEntryNestedMock()]; - const decoded = entriesArrayOrUndefined.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.ts deleted file mode 100644 index f2dbbd91dfceb..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.ts +++ /dev/null @@ -1,42 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { entriesExists } from '../entries_exist'; -import { entriesList } from '../entries_list'; -import { entriesMatch } from '../entry_match'; -import { entriesMatchAny } from '../entry_match_any'; -import { entriesMatchWildcard } from '../entry_match_wildcard'; -import { entriesNested } from '../entry_nested'; - -// NOTE: Type nested is not included here to denote it's non-recursive nature. -// So a nested entry is really just a collection of `Entry` types. -export const entry = t.union([ - entriesMatch, - entriesMatchAny, - entriesList, - entriesExists, - entriesMatchWildcard, -]); -export type Entry = t.TypeOf<typeof entry>; - -export const entriesArray = t.array( - t.union([ - entriesMatch, - entriesMatchAny, - entriesList, - entriesExists, - entriesNested, - entriesMatchWildcard, - ]) -); -export type EntriesArray = t.TypeOf<typeof entriesArray>; - -export const entriesArrayOrUndefined = t.union([entriesArray, t.undefined]); -export type EntriesArrayOrUndefined = t.TypeOf<typeof entriesArrayOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_exist/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_exist/index.mock.ts deleted file mode 100644 index 3a588ec9cc7ba..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_exist/index.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EntryExists } from '.'; -import { EXISTS, FIELD, OPERATOR } from '../../constants/index.mock'; - -export const getEntryExistsMock = (): EntryExists => ({ - field: FIELD, - operator: OPERATOR, - type: EXISTS, -}); - -export const getEntryExistsExcludedMock = (): EntryExists => ({ - ...getEntryExistsMock(), - operator: 'excluded', -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_exist/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_exist/index.test.ts deleted file mode 100644 index 8ebf60ebc19f1..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_exist/index.test.ts +++ /dev/null @@ -1,80 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { getEntryExistsMock } from './index.mock'; -import { entriesExists, EntryExists } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('entriesExists', () => { - test('it should validate an entry', () => { - const payload = getEntryExistsMock(); - const decoded = entriesExists.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate when "operator" is "included"', () => { - const payload = getEntryExistsMock(); - const decoded = entriesExists.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate when "operator" is "excluded"', () => { - const payload = getEntryExistsMock(); - payload.operator = 'excluded'; - const decoded = entriesExists.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should FAIL validation when "field" is empty string', () => { - const payload: Omit<EntryExists, 'field'> & { field: string } = { - ...getEntryExistsMock(), - field: '', - }; - const decoded = entriesExists.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "field"']); - expect(message.schema).toEqual({}); - }); - - test('it should strip out extra keys', () => { - const payload: EntryExists & { - extraKey?: string; - } = getEntryExistsMock(); - payload.extraKey = 'some extra key'; - const decoded = entriesExists.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getEntryExistsMock()); - }); - - test('it should FAIL validation when "type" is not "exists"', () => { - const payload: Omit<EntryExists, 'type'> & { type: string } = { - ...getEntryExistsMock(), - type: 'match', - }; - const decoded = entriesExists.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "match" supplied to "type"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_exist/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_exist/index.ts deleted file mode 100644 index 460030dcc951b..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_exist/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; -import { listOperator as operator } from '../list_operator'; - -export const entriesExists = t.exact( - t.type({ - field: NonEmptyString, - operator, - type: t.keyof({ exists: null }), - }) -); -export type EntryExists = t.TypeOf<typeof entriesExists>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_list/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_list/index.mock.ts deleted file mode 100644 index 06e006ed661ba..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_list/index.mock.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EntryList } from '.'; -import { FIELD, LIST, LIST_ID, OPERATOR, TYPE } from '../../constants/index.mock'; - -export const getEntryListMock = (): EntryList => ({ - field: FIELD, - list: { id: LIST_ID, type: TYPE }, - operator: OPERATOR, - type: LIST, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_list/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_list/index.test.ts deleted file mode 100644 index eb047a07f08dd..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_list/index.test.ts +++ /dev/null @@ -1,97 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { getEntryListMock } from './index.mock'; -import { entriesList, EntryList } from '.'; - -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('entriesList', () => { - test('it should validate an entry', () => { - const payload = getEntryListMock(); - const decoded = entriesList.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate when operator is "included"', () => { - const payload = getEntryListMock(); - const decoded = entriesList.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate when "operator" is "excluded"', () => { - const payload = getEntryListMock(); - payload.operator = 'excluded'; - const decoded = entriesList.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should FAIL validation when "list" is not expected value', () => { - const payload: Omit<EntryList, 'list'> & { list: string } = { - ...getEntryListMock(), - list: 'someListId', - }; - const decoded = entriesList.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "someListId" supplied to "list"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "list.id" is empty string', () => { - const payload: Omit<EntryList, 'list'> & { list: { id: string; type: 'ip' } } = { - ...getEntryListMock(), - list: { id: '', type: 'ip' }, - }; - const decoded = entriesList.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "list,id"']); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "type" is not "lists"', () => { - const payload: Omit<EntryList, 'type'> & { type: 'match_any' } = { - ...getEntryListMock(), - type: 'match_any', - }; - const decoded = entriesList.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "match_any" supplied to "type"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should strip out extra keys', () => { - const payload: EntryList & { - extraKey?: string; - } = getEntryListMock(); - payload.extraKey = 'some extra key'; - const decoded = entriesList.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getEntryListMock()); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_list/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_list/index.ts deleted file mode 100644 index f55a3f056218a..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_list/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; - -import { type } from '../type'; -import { listOperator as operator } from '../list_operator'; - -export const entriesList = t.exact( - t.type({ - field: NonEmptyString, - list: t.exact(t.type({ id: NonEmptyString, type })), - operator, - type: t.keyof({ list: null }), - }) -); -export type EntryList = t.TypeOf<typeof entriesList>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match/index.mock.ts deleted file mode 100644 index 9e09661c29456..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match/index.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EntryMatch } from '.'; -import { ENTRY_VALUE, FIELD, MATCH, OPERATOR } from '../../constants/index.mock'; - -export const getEntryMatchMock = (): EntryMatch => ({ - field: FIELD, - operator: OPERATOR, - type: MATCH, - value: ENTRY_VALUE, -}); - -export const getEntryMatchExcludeMock = (): EntryMatch => ({ - ...getEntryMatchMock(), - operator: 'excluded', -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match/index.test.ts deleted file mode 100644 index f2f8dbb8998f3..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match/index.test.ts +++ /dev/null @@ -1,108 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { getEntryMatchMock } from './index.mock'; -import { entriesMatch, EntryMatch } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('entriesMatch', () => { - test('it should validate an entry', () => { - const payload = getEntryMatchMock(); - const decoded = entriesMatch.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate when operator is "included"', () => { - const payload = getEntryMatchMock(); - const decoded = entriesMatch.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate when "operator" is "excluded"', () => { - const payload = getEntryMatchMock(); - payload.operator = 'excluded'; - const decoded = entriesMatch.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should FAIL validation when "field" is empty string', () => { - const payload: Omit<EntryMatch, 'field'> & { field: string } = { - ...getEntryMatchMock(), - field: '', - }; - const decoded = entriesMatch.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "field"']); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "value" is not string', () => { - const payload: Omit<EntryMatch, 'value'> & { value: string[] } = { - ...getEntryMatchMock(), - value: ['some value'], - }; - const decoded = entriesMatch.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "["some value"]" supplied to "value"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "value" is empty string', () => { - const payload: Omit<EntryMatch, 'value'> & { value: string } = { - ...getEntryMatchMock(), - value: '', - }; - const decoded = entriesMatch.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "value"']); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "type" is not "match"', () => { - const payload: Omit<EntryMatch, 'type'> & { type: string } = { - ...getEntryMatchMock(), - type: 'match_any', - }; - const decoded = entriesMatch.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "match_any" supplied to "type"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should strip out extra keys', () => { - const payload: EntryMatch & { - extraKey?: string; - } = getEntryMatchMock(); - payload.extraKey = 'some value'; - const decoded = entriesMatch.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getEntryMatchMock()); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match/index.ts deleted file mode 100644 index 17bf0ab5b89e6..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; -import { listOperator as operator } from '../list_operator'; - -export const entriesMatch = t.exact( - t.type({ - field: NonEmptyString, - operator, - type: t.keyof({ match: null }), - value: NonEmptyString, - }) -); -export type EntryMatch = t.TypeOf<typeof entriesMatch>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_any/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_any/index.mock.ts deleted file mode 100644 index 7a5c4c57fa32f..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_any/index.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EntryMatchAny } from '.'; -import { ENTRY_VALUE, FIELD, MATCH_ANY, OPERATOR } from '../../constants/index.mock'; - -export const getEntryMatchAnyMock = (): EntryMatchAny => ({ - field: FIELD, - operator: OPERATOR, - type: MATCH_ANY, - value: [ENTRY_VALUE], -}); - -export const getEntryMatchAnyExcludeMock = (): EntryMatchAny => ({ - ...getEntryMatchAnyMock(), - operator: 'excluded', - value: [ENTRY_VALUE, 'some other host name'], -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_any/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_any/index.test.ts deleted file mode 100644 index 3e4752f395088..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_any/index.test.ts +++ /dev/null @@ -1,106 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { getEntryMatchAnyMock } from './index.mock'; -import { entriesMatchAny, EntryMatchAny } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('entriesMatchAny', () => { - test('it should validate an entry', () => { - const payload = getEntryMatchAnyMock(); - const decoded = entriesMatchAny.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate when operator is "included"', () => { - const payload = getEntryMatchAnyMock(); - const decoded = entriesMatchAny.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate when operator is "excluded"', () => { - const payload = getEntryMatchAnyMock(); - payload.operator = 'excluded'; - const decoded = entriesMatchAny.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should FAIL validation when field is empty string', () => { - const payload: Omit<EntryMatchAny, 'field'> & { field: string } = { - ...getEntryMatchAnyMock(), - field: '', - }; - const decoded = entriesMatchAny.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "field"']); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when value is empty array', () => { - const payload: Omit<EntryMatchAny, 'value'> & { value: string[] } = { - ...getEntryMatchAnyMock(), - value: [], - }; - const decoded = entriesMatchAny.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "[]" supplied to "value"']); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when value is not string array', () => { - const payload: Omit<EntryMatchAny, 'value'> & { value: string } = { - ...getEntryMatchAnyMock(), - value: 'some string', - }; - const decoded = entriesMatchAny.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "some string" supplied to "value"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "type" is not "match_any"', () => { - const payload: Omit<EntryMatchAny, 'type'> & { type: string } = { - ...getEntryMatchAnyMock(), - type: 'match', - }; - const decoded = entriesMatchAny.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "match" supplied to "type"']); - expect(message.schema).toEqual({}); - }); - - test('it should strip out extra keys', () => { - const payload: EntryMatchAny & { - extraKey?: string; - } = getEntryMatchAnyMock(); - payload.extraKey = 'some extra key'; - const decoded = entriesMatchAny.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getEntryMatchAnyMock()); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_any/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_any/index.ts deleted file mode 100644 index be08fb370abdc..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_any/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { NonEmptyString, nonEmptyOrNullableStringArray } from '@kbn/securitysolution-io-ts-types'; -import { listOperator as operator } from '../list_operator'; - -export const entriesMatchAny = t.exact( - t.type({ - field: NonEmptyString, - operator, - type: t.keyof({ match_any: null }), - value: nonEmptyOrNullableStringArray, - }) -); -export type EntryMatchAny = t.TypeOf<typeof entriesMatchAny>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_wildcard/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_wildcard/index.mock.ts deleted file mode 100644 index 6dc33289d22db..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_wildcard/index.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EntryMatchWildcard } from '.'; -import { ENTRY_VALUE, FIELD, OPERATOR, WILDCARD } from '../../constants/index.mock'; - -export const getEntryMatchWildcardMock = (): EntryMatchWildcard => ({ - field: FIELD, - operator: OPERATOR, - type: WILDCARD, - value: ENTRY_VALUE, -}); - -export const getEntryMatchWildcardExcludeMock = (): EntryMatchWildcard => ({ - ...getEntryMatchWildcardMock(), - operator: 'excluded', -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_wildcard/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_wildcard/index.test.ts deleted file mode 100644 index a84996a6c1050..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_wildcard/index.test.ts +++ /dev/null @@ -1,106 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { getEntryMatchWildcardMock } from './index.mock'; -import { entriesMatchWildcard, EntryMatchWildcard } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('entriesMatchWildcard', () => { - test('it should validate an entry', () => { - const payload = getEntryMatchWildcardMock(); - const decoded = entriesMatchWildcard.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate when operator is "included"', () => { - const payload = getEntryMatchWildcardMock(); - const decoded = entriesMatchWildcard.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate when "operator" is "excluded"', () => { - const payload = getEntryMatchWildcardMock(); - payload.operator = 'excluded'; - const decoded = entriesMatchWildcard.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should FAIL validation when "field" is empty string', () => { - const payload: Omit<EntryMatchWildcard, 'field'> & { field: string } = { - ...getEntryMatchWildcardMock(), - field: '', - }; - const decoded = entriesMatchWildcard.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "field"']); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "value" is not string', () => { - const payload: Omit<EntryMatchWildcard, 'value'> & { value: string[] } = { - ...getEntryMatchWildcardMock(), - value: ['some value'], - }; - const decoded = entriesMatchWildcard.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "["some value"]" supplied to "value"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "value" is empty string', () => { - const payload: Omit<EntryMatchWildcard, 'value'> & { value: string } = { - ...getEntryMatchWildcardMock(), - value: '', - }; - const decoded = entriesMatchWildcard.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "value"']); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "type" is not "wildcard"', () => { - const payload: Omit<EntryMatchWildcard, 'type'> & { type: string } = { - ...getEntryMatchWildcardMock(), - type: 'match', - }; - const decoded = entriesMatchWildcard.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "match" supplied to "type"']); - expect(message.schema).toEqual({}); - }); - - test('it should strip out extra keys', () => { - const payload: EntryMatchWildcard & { - extraKey?: string; - } = getEntryMatchWildcardMock(); - payload.extraKey = 'some value'; - const decoded = entriesMatchWildcard.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getEntryMatchWildcardMock()); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_wildcard/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_wildcard/index.ts deleted file mode 100644 index 17afe342961c2..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_wildcard/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; -import { listOperator as operator } from '../list_operator'; - -export const entriesMatchWildcard = t.exact( - t.type({ - field: NonEmptyString, - operator, - type: t.keyof({ wildcard: null }), - value: NonEmptyString, - }) -); -export type EntryMatchWildcard = t.TypeOf<typeof entriesMatchWildcard>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_nested/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_nested/index.mock.ts deleted file mode 100644 index 34d687502e245..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_nested/index.mock.ts +++ /dev/null @@ -1,30 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EntryNested } from '.'; -import { NESTED, NESTED_FIELD } from '../../constants/index.mock'; -import { getEntryExistsMock } from '../entries_exist/index.mock'; -import { getEntryMatchExcludeMock, getEntryMatchMock } from '../entry_match/index.mock'; -import { getEntryMatchAnyExcludeMock, getEntryMatchAnyMock } from '../entry_match_any/index.mock'; - -export const getEntryNestedMock = (): EntryNested => ({ - entries: [getEntryMatchMock(), getEntryMatchAnyMock()], - field: NESTED_FIELD, - type: NESTED, -}); - -export const getEntryNestedExcludeMock = (): EntryNested => ({ - ...getEntryNestedMock(), - entries: [getEntryMatchExcludeMock(), getEntryMatchAnyExcludeMock()], -}); - -export const getEntryNestedMixedEntries = (): EntryNested => ({ - ...getEntryNestedMock(), - entries: [getEntryMatchMock(), getEntryMatchAnyExcludeMock(), getEntryExistsMock()], -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_nested/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_nested/index.test.ts deleted file mode 100644 index cfd43c4c09935..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_nested/index.test.ts +++ /dev/null @@ -1,125 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { getEntryNestedMock } from './index.mock'; -import { entriesNested, EntryNested } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; -import { getEntryMatchAnyMock } from '../entry_match_any/index.mock'; -import { getEntryExistsMock } from '../entries_exist/index.mock'; - -describe('entriesNested', () => { - test('it should validate a nested entry', () => { - const payload = getEntryNestedMock(); - const decoded = entriesNested.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should FAIL validation when "type" is not "nested"', () => { - const payload: Omit<EntryNested, 'type'> & { type: 'match' } = { - ...getEntryNestedMock(), - type: 'match', - }; - const decoded = entriesNested.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "match" supplied to "type"']); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "field" is empty string', () => { - const payload: Omit<EntryNested, 'field'> & { - field: string; - } = { ...getEntryNestedMock(), field: '' }; - const decoded = entriesNested.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "field"']); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "field" is not a string', () => { - const payload: Omit<EntryNested, 'field'> & { - field: number; - } = { ...getEntryNestedMock(), field: 1 }; - const decoded = entriesNested.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "1" supplied to "field"']); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when "entries" is not a an array', () => { - const payload: Omit<EntryNested, 'entries'> & { - entries: string; - } = { ...getEntryNestedMock(), entries: 'im a string' }; - const decoded = entriesNested.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "im a string" supplied to "entries"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should validate when "entries" contains an entry item that is type "match"', () => { - const payload = { ...getEntryNestedMock(), entries: [getEntryMatchAnyMock()] }; - const decoded = entriesNested.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual({ - entries: [ - { - field: 'host.name', - operator: 'included', - type: 'match_any', - value: ['some host name'], - }, - ], - field: 'parent.field', - type: 'nested', - }); - }); - - test('it should validate when "entries" contains an entry item that is type "exists"', () => { - const payload = { ...getEntryNestedMock(), entries: [getEntryExistsMock()] }; - const decoded = entriesNested.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual({ - entries: [ - { - field: 'host.name', - operator: 'included', - type: 'exists', - }, - ], - field: 'parent.field', - type: 'nested', - }); - }); - - test('it should strip out extra keys', () => { - const payload: EntryNested & { - extraKey?: string; - } = getEntryNestedMock(); - payload.extraKey = 'some extra key'; - const decoded = entriesNested.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getEntryNestedMock()); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_nested/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_nested/index.ts deleted file mode 100644 index 8b19fee9fb5cf..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_nested/index.ts +++ /dev/null @@ -1,21 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; -import { nonEmptyNestedEntriesArray } from '../non_empty_nested_entries_array'; - -export const entriesNested = t.exact( - t.type({ - entries: nonEmptyNestedEntriesArray, - field: NonEmptyString, - type: t.keyof({ nested: null }), - }) -); -export type EntryNested = t.TypeOf<typeof entriesNested>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_export_details/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_export_details/index.mock.ts deleted file mode 100644 index 15cdd79dc2e9b..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_export_details/index.mock.ts +++ /dev/null @@ -1,30 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ExportExceptionDetails } from '.'; - -export interface ExportExceptionDetailsMock { - listCount?: number; - missingListsCount?: number; - missingLists?: Array<Record<'list_id', string>>; - itemCount?: number; - missingItemCount?: number; - missingItems?: Array<Record<'item_id', string>>; -} - -export const getExceptionExportDetailsMock = ( - details?: ExportExceptionDetailsMock -): ExportExceptionDetails => ({ - exported_exception_list_count: details?.listCount ?? 0, - exported_exception_list_item_count: details?.itemCount ?? 0, - missing_exception_list_item_count: details?.missingItemCount ?? 0, - missing_exception_list_items: details?.missingItems ?? [], - missing_exception_lists: details?.missingLists ?? [], - missing_exception_lists_count: details?.missingListsCount ?? 0, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_export_details/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_export_details/index.test.ts deleted file mode 100644 index c9b1a4767e573..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_export_details/index.test.ts +++ /dev/null @@ -1,37 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { getExceptionExportDetailsMock } from './index.mock'; -import { exportExceptionDetailsSchema, ExportExceptionDetails } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('exportExceptionDetails', () => { - test('it should validate export meta', () => { - const payload = getExceptionExportDetailsMock(); - const decoded = exportExceptionDetailsSchema.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should strip out extra keys', () => { - const payload: ExportExceptionDetails & { - extraKey?: string; - } = getExceptionExportDetailsMock(); - payload.extraKey = 'some extra key'; - const decoded = exportExceptionDetailsSchema.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getExceptionExportDetailsMock()); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_export_details/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_export_details/index.ts deleted file mode 100644 index 9e4ff134d6e9f..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_export_details/index.ts +++ /dev/null @@ -1,36 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; - -export const exportExceptionDetails = { - exported_exception_list_count: t.number, - exported_exception_list_item_count: t.number, - missing_exception_list_item_count: t.number, - missing_exception_list_items: t.array( - t.exact( - t.type({ - item_id: NonEmptyString, - }) - ) - ), - missing_exception_lists: t.array( - t.exact( - t.type({ - list_id: NonEmptyString, - }) - ) - ), - missing_exception_lists_count: t.number, -}; - -export const exportExceptionDetailsSchema = t.exact(t.type(exportExceptionDetails)); - -export type ExportExceptionDetails = t.TypeOf<typeof exportExceptionDetailsSchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list/index.test.ts deleted file mode 100644 index 2c6aae8a56937..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list/index.test.ts +++ /dev/null @@ -1,55 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { exceptionListType, ExceptionListTypeEnum } from '.'; - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('exceptionListType', () => { - test('it should validate for "detection"', () => { - const payload = 'detection'; - const decoded = exceptionListType.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate for "rule_default"', () => { - const payload = 'rule_default'; - const decoded = exceptionListType.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate for "endpoint"', () => { - const payload = 'endpoint'; - const decoded = exceptionListType.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should contain same amount of keys as enum', () => { - // Might seem like a weird test, but its meant to - // ensure that if exceptionListType is updated, you - // also update the ExceptionListTypeEnum, a workaround - // for io-ts not yet supporting enums - // https://github.com/gcanti/io-ts/issues/67 - const keys = Object.keys(exceptionListType.keys).sort().join(',').toLowerCase(); - const enumKeys = Object.keys(ExceptionListTypeEnum).sort().join(',').toLowerCase(); - - expect(keys).toEqual(enumKeys); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list/index.ts deleted file mode 100644 index db7633705ac5b..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list/index.ts +++ /dev/null @@ -1,32 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const exceptionListType = t.keyof({ - detection: null, - rule_default: null, - endpoint: null, - endpoint_trusted_apps: null, - endpoint_events: null, - endpoint_host_isolation_exceptions: null, - endpoint_blocklists: null, -}); -export const exceptionListTypeOrUndefined = t.union([exceptionListType, t.undefined]); -export type ExceptionListType = t.TypeOf<typeof exceptionListType>; -export type ExceptionListTypeOrUndefined = t.TypeOf<typeof exceptionListTypeOrUndefined>; -export enum ExceptionListTypeEnum { - DETECTION = 'detection', // shared exception list type - RULE_DEFAULT = 'rule_default', // rule default, cannot be shared - ENDPOINT = 'endpoint', - ENDPOINT_TRUSTED_APPS = 'endpoint', - ENDPOINT_EVENTS = 'endpoint_events', - ENDPOINT_HOST_ISOLATION_EXCEPTIONS = 'endpoint_host_isolation_exceptions', - ENDPOINT_BLOCKLISTS = 'endpoint_blocklists', -} diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list_item_type/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list_item_type/index.ts deleted file mode 100644 index 5e124b9f923d9..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list_item_type/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const exceptionListItemType = t.keyof({ simple: null }); -export const exceptionListItemTypeOrUndefined = t.union([exceptionListItemType, t.undefined]); -export type ExceptionListItemType = t.TypeOf<typeof exceptionListItemType>; -export type ExceptionListItemTypeOrUndefined = t.TypeOf<typeof exceptionListItemTypeOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/expire_time/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/expire_time/index.ts deleted file mode 100644 index 4e8184d4e6ce9..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/expire_time/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { IsoDateString } from '@kbn/securitysolution-io-ts-types'; - -export const expireTime = IsoDateString; -export const expireTimeOrUndefined = t.union([expireTime, t.undefined]); -export type ExpireTimeOrUndefined = t.TypeOf<typeof expireTimeOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/file/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/file/index.ts deleted file mode 100644 index f569d42c41f17..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/file/index.ts +++ /dev/null @@ -1,12 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const file = t.object; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/filter/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/filter/index.ts deleted file mode 100644 index 70d526eaefbe5..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/filter/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const filter = t.string; -export type Filter = t.TypeOf<typeof filter>; -export const filterOrUndefined = t.union([filter, t.undefined]); -export type FilterOrUndefined = t.TypeOf<typeof filterOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/id/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/id/index.ts deleted file mode 100644 index c9f35b36ee577..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/id/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; - -export const id = NonEmptyString; -export type Id = t.TypeOf<typeof id>; -export const idOrUndefined = t.union([id, t.undefined]); -export type IdOrUndefined = t.TypeOf<typeof idOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/immutable/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/immutable/index.ts deleted file mode 100644 index 9bdb50647abd2..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/immutable/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const immutable = t.boolean; -export type Immutable = t.TypeOf<typeof immutable>; -export const immutableOrUndefined = t.union([immutable, t.undefined]); -export type ImmutableOrUndefined = t.TypeOf<typeof immutableOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/import_comment/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/import_comment/index.test.ts deleted file mode 100644 index 50121086c1411..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/import_comment/index.test.ts +++ /dev/null @@ -1,136 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { getCommentsArrayMock, getCommentsMock } from '../comment/index.mock'; -import { getCreateCommentsArrayMock } from '../create_comment/index.mock'; -import { - importComment, - ImportCommentsArray, - importCommentsArray, - ImportCommentsArrayOrUndefined, - importCommentsArrayOrUndefined, -} from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('ImportComment', () => { - describe('importComment', () => { - test('it passes validation with a typical comment', () => { - const payload = getCommentsMock(); - const decoded = importComment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it passes validation with a new comment', () => { - const payload = { comment: 'new comment' }; - const decoded = importComment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it fails validation when undefined', () => { - const payload = undefined; - const decoded = importComment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "(({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>) | {| comment: NonEmptyString |})"', - ]); - expect(message.schema).toEqual({}); - }); - }); - - describe('importCommentsArray', () => { - test('it passes validation an array of Comment', () => { - const payload = getCommentsArrayMock(); - const decoded = importCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it passes validation an array of CreateComment', () => { - const payload = getCreateCommentsArrayMock(); - const decoded = importCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it passes validation an array of Comment and CreateComment', () => { - const payload = [...getCommentsArrayMock(), ...getCreateCommentsArrayMock()]; - const decoded = importCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it fails validation when undefined', () => { - const payload = undefined; - const decoded = importCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "Array<(({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>) | {| comment: NonEmptyString |})>"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it fails validation when array includes non ImportComment types', () => { - const payload = [1] as unknown as ImportCommentsArray; - const decoded = importCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "Array<(({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>) | {| comment: NonEmptyString |})>"', - ]); - expect(message.schema).toEqual({}); - }); - }); - - describe('importCommentsArrayOrUndefined', () => { - test('it passes validation an array of ImportComment', () => { - const payload = [...getCommentsArrayMock(), ...getCreateCommentsArrayMock()]; - const decoded = importCommentsArrayOrUndefined.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it passes validation when undefined', () => { - const payload = undefined; - const decoded = importCommentsArrayOrUndefined.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it fails validation when array includes non ImportComment types', () => { - const payload = [1] as unknown as ImportCommentsArrayOrUndefined; - const decoded = importCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "Array<(({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>) | {| comment: NonEmptyString |})>"', - ]); - expect(message.schema).toEqual({}); - }); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/import_comment/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/import_comment/index.ts deleted file mode 100644 index 4511b28078bc6..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/import_comment/index.ts +++ /dev/null @@ -1,20 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { createComment } from '../create_comment'; -import { comment } from '../comment'; - -export const importComment = t.union([comment, createComment]); - -export type ImportComment = t.TypeOf<typeof importComment>; -export const importCommentsArray = t.array(importComment); -export type ImportCommentsArray = t.TypeOf<typeof importCommentsArray>; -export const importCommentsArrayOrUndefined = t.union([importCommentsArray, t.undefined]); -export type ImportCommentsArrayOrUndefined = t.TypeOf<typeof importCommentsArrayOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/include_expired_exceptions/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/include_expired_exceptions/index.ts deleted file mode 100644 index 7c40e74d81895..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/include_expired_exceptions/index.ts +++ /dev/null @@ -1,21 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; - -export const include_expired_exceptions = t.keyof({ true: null, false: null }); -export const includeExpiredExceptionsOrUndefined = t.union([ - include_expired_exceptions, - t.undefined, -]); -export type IncludeExpiredExceptionsOrUndefined = t.TypeOf< - typeof includeExpiredExceptionsOrUndefined ->; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/index.ts deleted file mode 100644 index b30ac02dab962..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/index.ts +++ /dev/null @@ -1,67 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './comment'; -export * from './create_comment'; -export * from './created_at'; -export * from './created_by'; -export * from './cursor'; -export * from './default_namespace'; -export * from './default_namespace_array'; -export * from './default_create_comments_array'; -export * from './default_import_comments_array'; -export * from './description'; -export * from './deserializer'; -export * from './endpoint'; -export * from './entries'; -export * from './entries_exist'; -export * from './entries_list'; -export * from './entry_match'; -export * from './entry_match_any'; -export * from './entry_match_wildcard'; -export * from './entry_nested'; -export * from './exception_export_details'; -export * from './exception_list'; -export * from './exception_list_item_type'; -export * from './expire_time'; -export * from './filter'; -export * from './id'; -export * from './immutable'; -export * from './import_comment'; -export * from './item_id'; -export * from './list_id'; -export * from './list_operator'; -export * from './list_type'; -export * from './lists'; -export * from './lists_default_array'; -export * from './max_size'; -export * from './meta'; -export * from './name'; -export * from './namespace_type'; -export * from './non_empty_entries_array'; -export * from './non_empty_nested_entries_array'; -export * from './os_type'; -export * from './page'; -export * from './per_page'; -export * from './pit'; -export * from './search'; -export * from './search_after'; -export * from './serializer'; -export * from './sort_field'; -export * from './sort_order'; -export * from './tags'; -export * from './tie_breaker_id'; -export * from './timestamp'; -export * from './total'; -export * from './type'; -export * from './underscore_version'; -export * from './update_comment'; -export * from './updated_at'; -export * from './updated_by'; -export * from './refresh'; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/item/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/item/index.ts deleted file mode 100644 index d69ec53584001..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/item/index.ts +++ /dev/null @@ -1,12 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const item = t.string; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/item_id/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/item_id/index.ts deleted file mode 100644 index 0e4551ad5c8f6..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/item_id/index.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; -import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; - -export const item_id = NonEmptyString; -export type ItemId = t.TypeOf<typeof item_id>; -export const itemIdOrUndefined = t.union([item_id, t.undefined]); -export type ItemIdOrUndefined = t.TypeOf<typeof itemIdOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/list_id/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/list_id/index.ts deleted file mode 100644 index 88e88aa8bc3c7..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/list_id/index.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; -import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; - -export const list_id = NonEmptyString; -export type ListId = t.TypeOf<typeof list_id>; -export const list_idOrUndefined = t.union([list_id, t.undefined]); -export type ListIdOrUndefined = t.TypeOf<typeof list_idOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/list_operator/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/list_operator/index.test.ts deleted file mode 100644 index 054af26b4a620..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/list_operator/index.test.ts +++ /dev/null @@ -1,46 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { ListOperatorEnum as OperatorEnum, listOperator as operator } from '.'; - -describe('operator', () => { - test('it should validate for "included"', () => { - const payload = 'included'; - const decoded = operator.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate for "excluded"', () => { - const payload = 'excluded'; - const decoded = operator.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should contain same amount of keys as enum', () => { - // Might seem like a weird test, but its meant to - // ensure that if operator is updated, you - // also update the operatorEnum, a workaround - // for io-ts not yet supporting enums - // https://github.com/gcanti/io-ts/issues/67 - const keys = Object.keys(operator.keys).sort().join(',').toLowerCase(); - const enumKeys = Object.keys(OperatorEnum).sort().join(',').toLowerCase(); - - expect(keys).toEqual(enumKeys); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/list_operator/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/list_operator/index.ts deleted file mode 100644 index 574a64e0f0320..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/list_operator/index.ts +++ /dev/null @@ -1,35 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const listOperator = t.keyof({ excluded: null, included: null }); -export type ListOperator = t.TypeOf<typeof listOperator>; -export enum ListOperatorEnum { - INCLUDED = 'included', - EXCLUDED = 'excluded', -} - -export const listOperatorType = t.keyof({ - nested: null, - match: null, - match_any: null, - wildcard: null, - exists: null, - list: null, -}); -export type ListOperatorType = t.TypeOf<typeof listOperatorType>; -export enum ListOperatorTypeEnum { - NESTED = 'nested', - MATCH = 'match', - MATCH_ANY = 'match_any', - WILDCARD = 'wildcard', - EXISTS = 'exists', - LIST = 'list', -} diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/list_type/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/list_type/index.ts deleted file mode 100644 index 716d9a6b24d7e..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/list_type/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; - -export const list_type = t.keyof({ item: null, list: null }); -export type ListType = t.TypeOf<typeof list_type>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.mock.ts deleted file mode 100644 index c8319867b5775..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.mock.ts +++ /dev/null @@ -1,27 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { List, ListArray } from '.'; -import { ENDPOINT_LIST_ID } from '@kbn/securitysolution-list-constants'; - -export const getListMock = (): List => ({ - id: 'some_uuid', - list_id: 'list_id_single', - namespace_type: 'single', - type: 'detection', -}); - -export const getEndpointListMock = (): List => ({ - id: ENDPOINT_LIST_ID, - list_id: ENDPOINT_LIST_ID, - namespace_type: 'agnostic', - type: 'endpoint', -}); - -export const getListArrayMock = (): ListArray => [getListMock(), getEndpointListMock()]; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.test.ts deleted file mode 100644 index 57c221f10384f..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.test.ts +++ /dev/null @@ -1,127 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { getEndpointListMock, getListArrayMock, getListMock } from './index.mock'; -import { List, list, ListArray, listArray, ListArrayOrUndefined, listArrayOrUndefined } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('Lists', () => { - describe('list', () => { - test('it should validate a list', () => { - const payload = getListMock(); - const decoded = list.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate a list with "namespace_type" of "agnostic"', () => { - const payload = getEndpointListMock(); - const decoded = list.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT validate a list without an "id"', () => { - const payload = getListMock(); - // @ts-expect-error - delete payload.id; - const decoded = list.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "id"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT validate a list without "namespace_type"', () => { - const payload = getListMock(); - // @ts-expect-error - delete payload.namespace_type; - const decoded = list.decode(payload); - const message = pipe(decoded, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "namespace_type"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should strip out extra keys', () => { - const payload: List & { - extraKey?: string; - } = getListMock(); - payload.extraKey = 'some value'; - const decoded = list.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getListMock()); - }); - }); - - describe('listArray', () => { - test('it should validate an array of lists', () => { - const payload = getListArrayMock(); - const decoded = listArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not validate when unexpected type found in array', () => { - const payload = [1] as unknown as ListArray; - const decoded = listArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "Array<{| id: NonEmptyString, list_id: NonEmptyString, type: "detection" | "rule_default" | "endpoint" | "endpoint_trusted_apps" | "endpoint_events" | "endpoint_host_isolation_exceptions" | "endpoint_blocklists", namespace_type: "agnostic" | "single" |}>"', - ]); - expect(message.schema).toEqual({}); - }); - }); - - describe('listArrayOrUndefined', () => { - test('it should validate an array of lists', () => { - const payload = getListArrayMock(); - const decoded = listArrayOrUndefined.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate when undefined', () => { - const payload = undefined; - const decoded = listArrayOrUndefined.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not allow an item that is not of type "list" in array', () => { - const payload = [1] as unknown as ListArrayOrUndefined; - const decoded = listArrayOrUndefined.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "(Array<{| id: NonEmptyString, list_id: NonEmptyString, type: "detection" | "rule_default" | "endpoint" | "endpoint_trusted_apps" | "endpoint_events" | "endpoint_host_isolation_exceptions" | "endpoint_blocklists", namespace_type: "agnostic" | "single" |}> | undefined)"', - 'Invalid value "[1]" supplied to "(Array<{| id: NonEmptyString, list_id: NonEmptyString, type: "detection" | "rule_default" | "endpoint" | "endpoint_trusted_apps" | "endpoint_events" | "endpoint_host_isolation_exceptions" | "endpoint_blocklists", namespace_type: "agnostic" | "single" |}> | undefined)"', - ]); - expect(message.schema).toEqual({}); - }); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.ts deleted file mode 100644 index 564ce7833b0f0..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.ts +++ /dev/null @@ -1,28 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; -import { exceptionListType } from '../exception_list'; -import { namespaceType } from '../default_namespace'; - -export const list = t.exact( - t.type({ - id: NonEmptyString, - list_id: NonEmptyString, - type: exceptionListType, - namespace_type: namespaceType, - }) -); - -export type List = t.TypeOf<typeof list>; -export const listArray = t.array(list); -export type ListArray = t.TypeOf<typeof listArray>; -export const listArrayOrUndefined = t.union([listArray, t.undefined]); -export type ListArrayOrUndefined = t.TypeOf<typeof listArrayOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/lists_default_array/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/lists_default_array/index.test.ts deleted file mode 100644 index fa4f22c4718e1..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/lists_default_array/index.test.ts +++ /dev/null @@ -1,64 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { DefaultListArray } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; -import { getListArrayMock } from '../lists/index.mock'; - -describe('lists_default_array', () => { - test('it should return a default array when null', () => { - const payload = null; - const decoded = DefaultListArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual([]); - }); - - test('it should return a default array when undefined', () => { - const payload = undefined; - const decoded = DefaultListArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual([]); - }); - - test('it should validate an empty array', () => { - const payload: string[] = []; - const decoded = DefaultListArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate an array of lists', () => { - const payload = getListArrayMock(); - const decoded = DefaultListArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not validate an array of non accepted types', () => { - // Terrible casting for purpose of tests - const payload = [1] as unknown; - const decoded = DefaultListArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "DefaultListArray"', - ]); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/lists_default_array/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/lists_default_array/index.ts deleted file mode 100644 index a014d769410ee..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/lists_default_array/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; -import { list, ListArray } from '../lists'; - -/** - * Types the DefaultListArray as: - * - If null or undefined, then a default array of type list will be set - */ -export const DefaultListArray = new t.Type<ListArray, ListArray | undefined, unknown>( - 'DefaultListArray', - t.array(list).is, - (input, context): Either<t.Errors, ListArray> => - input == null ? t.success([]) : t.array(list).validate(input, context), - t.identity -); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/max_size/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/max_size/index.test.ts deleted file mode 100644 index 9ddf86818eaf7..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/max_size/index.test.ts +++ /dev/null @@ -1,60 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { exactCheck } from '@kbn/securitysolution-io-ts-utils'; -import { maxSizeOrUndefined } from '.'; - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; - -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('maxSizeOrUndefined', () => { - test('it will validate a correct max value', () => { - const payload = 123; - const decoded = maxSizeOrUndefined.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it will fail to validate a 0', () => { - const payload = 0; - const decoded = maxSizeOrUndefined.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "0" supplied to "(PositiveIntegerGreaterThanZero | undefined)"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it will fail to validate a -1', () => { - const payload = -1; - const decoded = maxSizeOrUndefined.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "-1" supplied to "(PositiveIntegerGreaterThanZero | undefined)"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it will fail to validate a string', () => { - const payload = '123'; - const decoded = maxSizeOrUndefined.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "123" supplied to "(PositiveIntegerGreaterThanZero | undefined)"', - ]); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/max_size/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/max_size/index.ts deleted file mode 100644 index 0c99edf692527..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/max_size/index.ts +++ /dev/null @@ -1,19 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import { PositiveIntegerGreaterThanZero } from '@kbn/securitysolution-io-ts-types'; -import * as t from 'io-ts'; - -export const max_size = PositiveIntegerGreaterThanZero; -export type MaxSize = t.TypeOf<typeof max_size>; - -export const maxSizeOrUndefined = t.union([max_size, t.undefined]); -export type MaxSizeOrUndefined = t.TypeOf<typeof maxSizeOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/meta/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/meta/index.ts deleted file mode 100644 index 07f329819fc12..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/meta/index.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const meta = t.object; -export type Meta = t.TypeOf<typeof meta>; -export const metaOrUndefined = t.union([meta, t.undefined]); -export type MetaOrUndefined = t.TypeOf<typeof metaOrUndefined>; - -export const nullableMetaOrUndefined = t.union([metaOrUndefined, t.null]); -export type NullableMetaOrUndefined = t.TypeOf<typeof nullableMetaOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/name/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/name/index.ts deleted file mode 100644 index 5d4a13c06ceef..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/name/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const name = t.string; -export type Name = t.TypeOf<typeof name>; -export const nameOrUndefined = t.union([name, t.undefined]); -export type NameOrUndefined = t.TypeOf<typeof nameOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/namespace_type/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/namespace_type/index.ts deleted file mode 100644 index b8d052910b86a..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/namespace_type/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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import { DefaultNamespace } from '../default_namespace'; - -export const namespace_type = DefaultNamespace; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.test.ts deleted file mode 100644 index 1128dd53871ee..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.test.ts +++ /dev/null @@ -1,132 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { EntriesArray } from '../entries'; -import { nonEmptyEntriesArray } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; -import { getEntryMatchMock } from '../entry_match/index.mock'; -import { getEntryMatchAnyMock } from '../entry_match_any/index.mock'; -import { getEntryExistsMock } from '../entries_exist/index.mock'; -import { - getEntriesArrayMock, - getListAndNonListEntriesArrayMock, - getListEntriesArrayMock, -} from '../entries/index.mock'; -import { getEntryNestedMock } from '../entry_nested/index.mock'; - -describe('non_empty_entries_array', () => { - test('it should FAIL validation when given an empty array', () => { - const payload: EntriesArray = []; - const decoded = nonEmptyEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "[]" supplied to "NonEmptyEntriesArray"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when given "undefined"', () => { - const payload = undefined; - const decoded = nonEmptyEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "NonEmptyEntriesArray"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when given "null"', () => { - const payload = null; - const decoded = nonEmptyEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "null" supplied to "NonEmptyEntriesArray"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should validate an array of "match" entries', () => { - const payload: EntriesArray = [getEntryMatchMock(), getEntryMatchMock()]; - const decoded = nonEmptyEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate an array of "match_any" entries', () => { - const payload: EntriesArray = [getEntryMatchAnyMock(), getEntryMatchAnyMock()]; - const decoded = nonEmptyEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate an array of "exists" entries', () => { - const payload: EntriesArray = [getEntryExistsMock(), getEntryExistsMock()]; - const decoded = nonEmptyEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate an array of "list" entries', () => { - const payload: EntriesArray = [...getListEntriesArrayMock()]; - const decoded = nonEmptyEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate an array of "nested" entries', () => { - const payload: EntriesArray = [getEntryNestedMock(), getEntryNestedMock()]; - const decoded = nonEmptyEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate an array of entries', () => { - const payload: EntriesArray = [...getEntriesArrayMock()]; - const decoded = nonEmptyEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should FAIL validation when given an array of entries of value list and non-value list entries', () => { - const payload: EntriesArray = [...getListAndNonListEntriesArrayMock()]; - const decoded = nonEmptyEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Cannot have entry of type list and other']); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when given an array of non entries', () => { - const payload = [1]; - const decoded = nonEmptyEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "NonEmptyEntriesArray"', - ]); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.ts deleted file mode 100644 index a5e06d5bb2c43..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.ts +++ /dev/null @@ -1,42 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; -import { entriesArray, EntriesArray } from '../entries'; -import { entriesList } from '../entries_list'; - -/** - * Types the nonEmptyEntriesArray as: - * - An array of entries of length 1 or greater - * - */ -export const nonEmptyEntriesArray = new t.Type<EntriesArray, EntriesArray, unknown>( - 'NonEmptyEntriesArray', - entriesArray.is, - (input, context): Either<t.Errors, EntriesArray> => { - if (Array.isArray(input) && input.length === 0) { - return t.failure(input, context); - } else { - if ( - Array.isArray(input) && - input.some((entry) => entriesList.is(entry)) && - input.some((entry) => !entriesList.is(entry)) - ) { - // fail when an exception item contains both a value list entry and a non-value list entry - return t.failure(input, context, 'Cannot have entry of type list and other'); - } - return entriesArray.validate(input, context); - } - }, - t.identity -); - -export type NonEmptyEntriesArray = t.OutputOf<typeof nonEmptyEntriesArray>; -export type NonEmptyEntriesArrayDecoded = t.TypeOf<typeof nonEmptyEntriesArray>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_nested_entries_array/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_nested_entries_array/index.test.ts deleted file mode 100644 index afb62d1f87685..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_nested_entries_array/index.test.ts +++ /dev/null @@ -1,117 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { EntriesArray } from '../entries'; -import { nonEmptyNestedEntriesArray } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; -import { getEntryMatchMock } from '../entry_match/index.mock'; -import { getEntryMatchAnyMock } from '../entry_match_any/index.mock'; -import { getEntryExistsMock } from '../entries_exist/index.mock'; -import { getEntryNestedMock } from '../entry_nested/index.mock'; - -describe('non_empty_nested_entries_array', () => { - test('it should FAIL validation when given an empty array', () => { - const payload: EntriesArray = []; - const decoded = nonEmptyNestedEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "[]" supplied to "NonEmptyNestedEntriesArray"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when given "undefined"', () => { - const payload = undefined; - const decoded = nonEmptyNestedEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "NonEmptyNestedEntriesArray"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should FAIL validation when given "null"', () => { - const payload = null; - const decoded = nonEmptyNestedEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "null" supplied to "NonEmptyNestedEntriesArray"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should validate an array of "match" entries', () => { - const payload: EntriesArray = [getEntryMatchMock(), getEntryMatchMock()]; - const decoded = nonEmptyNestedEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate an array of "match_any" entries', () => { - const payload: EntriesArray = [getEntryMatchAnyMock(), getEntryMatchAnyMock()]; - const decoded = nonEmptyNestedEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate an array of "exists" entries', () => { - const payload: EntriesArray = [getEntryExistsMock(), getEntryExistsMock()]; - const decoded = nonEmptyNestedEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should FAIL validation when given an array of "nested" entries', () => { - const payload: EntriesArray = [getEntryNestedMock(), getEntryNestedMock()]; - const decoded = nonEmptyNestedEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "operator"', - 'Invalid value "nested" supplied to "type"', - 'Invalid value "undefined" supplied to "value"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should validate an array of entries', () => { - const payload: EntriesArray = [ - getEntryExistsMock(), - getEntryMatchAnyMock(), - getEntryMatchMock(), - ]; - const decoded = nonEmptyNestedEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should FAIL validation when given an array of non entries', () => { - const payload = [1]; - const decoded = nonEmptyNestedEntriesArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "NonEmptyNestedEntriesArray"', - ]); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_nested_entries_array/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_nested_entries_array/index.ts deleted file mode 100644 index 73a00e75010f3..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_nested_entries_array/index.ts +++ /dev/null @@ -1,43 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { Either } from 'fp-ts/lib/Either'; -import { entriesMatch } from '../entry_match'; -import { entriesMatchAny } from '../entry_match_any'; -import { entriesExists } from '../entries_exist'; - -export const nestedEntryItem = t.union([entriesMatch, entriesMatchAny, entriesExists]); -export const nestedEntriesArray = t.array(nestedEntryItem); -export type NestedEntriesArray = t.TypeOf<typeof nestedEntriesArray>; - -/** - * Types the nonEmptyNestedEntriesArray as: - * - An array of entries of length 1 or greater - * - */ -export const nonEmptyNestedEntriesArray = new t.Type< - NestedEntriesArray, - NestedEntriesArray, - unknown ->( - 'NonEmptyNestedEntriesArray', - nestedEntriesArray.is, - (input, context): Either<t.Errors, NestedEntriesArray> => { - if (Array.isArray(input) && input.length === 0) { - return t.failure(input, context); - } else { - return nestedEntriesArray.validate(input, context); - } - }, - t.identity -); - -export type NonEmptyNestedEntriesArray = t.OutputOf<typeof nonEmptyNestedEntriesArray>; -export type NonEmptyNestedEntriesArrayDecoded = t.TypeOf<typeof nonEmptyNestedEntriesArray>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/os_type/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/os_type/index.test.ts deleted file mode 100644 index 566a2aa0973aa..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/os_type/index.test.ts +++ /dev/null @@ -1,47 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { exactCheck } from '@kbn/securitysolution-io-ts-utils'; -import { osType, osTypeArrayOrUndefined } from '.'; - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; - -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('osType', () => { - test('it will validate a correct osType', () => { - const payload = 'windows'; - const decoded = osType.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it will fail to validate an incorrect osType', () => { - const payload = 'foo'; - const decoded = osType.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "foo" supplied to ""linux" | "macos" | "windows""', - ]); - expect(message.schema).toEqual({}); - }); - - test('it will default to an empty array when osTypeArrayOrUndefined is used', () => { - const payload = undefined; - const decoded = osTypeArrayOrUndefined.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual([]); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/os_type/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/os_type/index.ts deleted file mode 100644 index 1dfbb9687e214..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/os_type/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { DefaultArray } from '@kbn/securitysolution-io-ts-types'; - -export const osType = t.keyof({ - linux: null, - macos: null, - windows: null, -}); -export type OsType = t.TypeOf<typeof osType>; - -export const osTypeArray = DefaultArray(osType); -export type OsTypeArray = t.TypeOf<typeof osTypeArray>; - -export const osTypeArrayOrUndefined = t.union([osTypeArray, t.undefined]); -export type OsTypeArrayOrUndefined = t.OutputOf<typeof osTypeArray>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/page/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/page/index.ts deleted file mode 100644 index 58c5581cc6e26..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/page/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const page = t.number; // TODO: Change this out for PositiveNumber from siem -export type Page = t.TypeOf<typeof page>; - -export const pageOrUndefined = t.union([page, t.undefined]); -export type PageOrUndefined = t.TypeOf<typeof pageOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/per_page/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/per_page/index.ts deleted file mode 100644 index 9ab3d1dde38c9..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/per_page/index.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; - -export const per_page = t.number; // TODO: Change this out for PositiveNumber from siem -export type PerPage = t.TypeOf<typeof per_page>; - -export const perPageOrUndefined = t.union([per_page, t.undefined]); -export type PerPageOrUndefined = t.TypeOf<typeof perPageOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/pit/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/pit/index.test.ts deleted file mode 100644 index 36bc95ce17862..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/pit/index.test.ts +++ /dev/null @@ -1,66 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { exactCheck } from '@kbn/securitysolution-io-ts-utils'; -import { pitOrUndefined } from '.'; - -import * as t from 'io-ts'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; - -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('pitOrUndefined', () => { - test('it will validate a correct pit', () => { - const payload = { id: '123', keepAlive: '1m' }; - const decoded = pitOrUndefined.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it will validate with the value of "undefined"', () => { - const obj = t.exact( - t.type({ - pit_id: pitOrUndefined, - }) - ); - const payload: t.TypeOf<typeof obj> = { - pit_id: undefined, - }; - const decoded = obj.decode({ - pit_id: undefined, - }); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it will validate a correct pit without having a "keepAlive"', () => { - const payload = { id: '123' }; - const decoded = pitOrUndefined.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it will fail to validate an incorrect pit', () => { - const payload = 'foo'; - const decoded = pitOrUndefined.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "foo" supplied to "({| id: string, keepAlive: (string | undefined) |} | undefined)"', - ]); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/pit/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/pit/index.ts deleted file mode 100644 index 3347f986113e2..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/pit/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const pitId = t.string; -export const pit = t.exact( - t.type({ - id: pitId, - keepAlive: t.union([t.string, t.undefined]), - }) -); -export const pitOrUndefined = t.union([pit, t.undefined]); - -export type Pit = t.TypeOf<typeof pit>; -export type PitId = t.TypeOf<typeof pitId>; -export type PitOrUndefined = t.TypeOf<typeof pitOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/refresh/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/refresh/index.ts deleted file mode 100644 index faa301fd450ae..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/refresh/index.ts +++ /dev/null @@ -1,19 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const refresh = t.union([t.literal('true'), t.literal('false')]); -export const refreshWithWaitFor = t.union([ - t.literal('true'), - t.literal('false'), - t.literal('wait_for'), -]); -export type Refresh = t.TypeOf<typeof refresh>; -export type RefreshWithWaitFor = t.TypeOf<typeof refreshWithWaitFor>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/required_keep_undefined/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/required_keep_undefined/index.ts deleted file mode 100644 index 5e6b30cf720cb..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/required_keep_undefined/index.ts +++ /dev/null @@ -1,25 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/** - * This makes any optional property the same as Required<T> would but also has the - * added benefit of keeping your undefined. - * - * For example: - * type A = RequiredKeepUndefined<{ a?: undefined; b: number }>; - * - * will yield a type of: - * type A = { a: undefined; b: number; } - * @deprecated This has no replacement. We should stop using/relying on this and just remove it. - */ -export type RequiredKeepUndefined<T> = { [K in keyof T]-?: [T[K]] } extends infer U - ? U extends Record<keyof U, [unknown]> - ? { [K in keyof U]: U[K][0] } - : never - : never; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/search/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/search/index.test.ts deleted file mode 100644 index 1224b277c8520..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/search/index.test.ts +++ /dev/null @@ -1,57 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { exactCheck } from '@kbn/securitysolution-io-ts-utils'; -import { searchOrUndefined } from '.'; - -import * as t from 'io-ts'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; - -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('search', () => { - test('it will validate a correct search', () => { - const payload = 'name:foo'; - const decoded = searchOrUndefined.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it will validate with the value of "undefined"', () => { - const obj = t.exact( - t.type({ - search: searchOrUndefined, - }) - ); - const payload: t.TypeOf<typeof obj> = { - search: undefined, - }; - const decoded = obj.decode({ - pit_id: undefined, - }); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it will fail to validate an incorrect search', () => { - const payload = ['foo']; - const decoded = searchOrUndefined.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "["foo"]" supplied to "(string | undefined)"', - ]); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/search/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/search/index.ts deleted file mode 100644 index 85e360b842672..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/search/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const search = t.string; -export type Search = t.TypeOf<typeof search>; - -export const searchOrUndefined = t.union([search, t.undefined]); -export type SearchOrUndefined = t.TypeOf<typeof searchOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/search_after/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/search_after/index.test.ts deleted file mode 100644 index d06198272792a..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/search_after/index.test.ts +++ /dev/null @@ -1,57 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { exactCheck } from '@kbn/securitysolution-io-ts-utils'; -import { searchAfterOrUndefined } from '.'; - -import * as t from 'io-ts'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; - -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('searchAfter', () => { - test('it will validate a correct search_after', () => { - const payload = ['test-1', 'test-2']; - const decoded = searchAfterOrUndefined.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it will validate with the value of "undefined"', () => { - const obj = t.exact( - t.type({ - search_after: searchAfterOrUndefined, - }) - ); - const payload: t.TypeOf<typeof obj> = { - search_after: undefined, - }; - const decoded = obj.decode({ - pit_id: undefined, - }); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it will fail to validate an incorrect search_after', () => { - const payload = 'foo'; - const decoded = searchAfterOrUndefined.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "foo" supplied to "(Array<string> | undefined)"', - ]); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/search_after/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/search_after/index.ts deleted file mode 100644 index 5cef26cbb0c47..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/search_after/index.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; - -export const search_after = t.array(t.string); -export type SearchAfter = t.TypeOf<typeof search_after>; - -export const searchAfterOrUndefined = t.union([search_after, t.undefined]); -export type SearchAfterOrUndefined = t.TypeOf<typeof searchAfterOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/serializer/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/serializer/index.ts deleted file mode 100644 index 7eb585c068e2d..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/serializer/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const serializer = t.string; -export type Serializer = t.TypeOf<typeof serializer>; -export const serializerOrUndefined = t.union([serializer, t.undefined]); -export type SerializerOrUndefined = t.TypeOf<typeof serializerOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/sort_field/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/sort_field/index.ts deleted file mode 100644 index e2c61659a94e4..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/sort_field/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; - -export const sort_field = t.string; -export const sortFieldOrUndefined = t.union([sort_field, t.undefined]); -export type SortFieldOrUndefined = t.TypeOf<typeof sortFieldOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/sort_order/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/sort_order/index.ts deleted file mode 100644 index fb075ff63fee4..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/sort_order/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; - -export const sort_order = t.keyof({ asc: null, desc: null }); -export const sortOrderOrUndefined = t.union([sort_order, t.undefined]); -export type SortOrderOrUndefined = t.TypeOf<typeof sortOrderOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/tags/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/tags/index.ts deleted file mode 100644 index ad99a1d0800fb..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/tags/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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { DefaultStringArray } from '@kbn/securitysolution-io-ts-types'; - -export const tags = DefaultStringArray; -export type Tags = t.TypeOf<typeof tags>; -export const tagsOrUndefined = t.union([tags, t.undefined]); -export type TagsOrUndefined = t.TypeOf<typeof tagsOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/tie_breaker_id/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/tie_breaker_id/index.ts deleted file mode 100644 index 0e393c7f154b8..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/tie_breaker_id/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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; - -export const tie_breaker_id = t.string; // TODO: Use UUID for this instead of a string for validation diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/timestamp/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/timestamp/index.ts deleted file mode 100644 index ba47dd545fbbb..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/timestamp/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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { IsoDateString } from '@kbn/securitysolution-io-ts-types'; - -export const timestamp = IsoDateString; -export const timestampOrUndefined = t.union([IsoDateString, t.undefined]); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/total/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/total/index.ts deleted file mode 100644 index f3c84417cd419..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/total/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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const total = t.number; // TODO: Change this out for PositiveNumber from siem -export const totalUndefined = t.union([total, t.undefined]); -export type TotalOrUndefined = t.TypeOf<typeof totalUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/type/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/type/index.test.ts deleted file mode 100644 index 60156cda9fe6d..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/type/index.test.ts +++ /dev/null @@ -1,35 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { Type, type } from '.'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('type', () => { - test('it will work with a given expected type', () => { - const payload: Type = 'keyword'; - const decoded = type.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it will give an error if given a type that does not exist', () => { - const payload: Type | 'madeup' = 'madeup'; - const decoded = type.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "madeup" supplied to ""binary" | "boolean" | "byte" | "date" | "date_nanos" | "date_range" | "double" | "double_range" | "float" | "float_range" | "geo_point" | "geo_shape" | "half_float" | "integer" | "integer_range" | "ip" | "ip_range" | "keyword" | "long" | "long_range" | "shape" | "short" | "text""', - ]); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/type/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/type/index.ts deleted file mode 100644 index d617fd2cccdf3..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/type/index.ts +++ /dev/null @@ -1,44 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -/** - * Types of all the regular single value list items but not exception list - * or exception list types. Those types are in the list_types folder. - */ -export const type = t.keyof({ - binary: null, - boolean: null, - byte: null, - date: null, - date_nanos: null, - date_range: null, - double: null, - double_range: null, - float: null, - float_range: null, - geo_point: null, - geo_shape: null, - half_float: null, - integer: null, - integer_range: null, - ip: null, - ip_range: null, - keyword: null, - long: null, - long_range: null, - shape: null, - short: null, - text: null, -}); - -export const typeOrUndefined = t.union([type, t.undefined]); -export type Type = t.TypeOf<typeof type>; -export type TypeOrUndefined = t.TypeOf<typeof typeOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/underscore_version/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/underscore_version/index.ts deleted file mode 100644 index 2e4901990fb5f..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/underscore_version/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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const _version = t.string; -export const _versionOrUndefined = t.union([_version, t.undefined]); -export type _VersionOrUndefined = t.TypeOf<typeof _versionOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.mock.ts deleted file mode 100644 index c84db08f8c93c..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.mock.ts +++ /dev/null @@ -1,21 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { UpdateComment, UpdateCommentsArray } from '.'; -import { ID } from '../../constants/index.mock'; - -export const getUpdateCommentMock = (): UpdateComment => ({ - comment: 'some comment', - id: ID, -}); - -export const getUpdateCommentsArrayMock = (): UpdateCommentsArray => [ - getUpdateCommentMock(), - getUpdateCommentMock(), -]; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.test.ts deleted file mode 100644 index 88cdfbdd573e6..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.test.ts +++ /dev/null @@ -1,150 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { getUpdateCommentMock, getUpdateCommentsArrayMock } from './index.mock'; -import { - UpdateComment, - updateComment, - UpdateCommentsArray, - updateCommentsArray, - UpdateCommentsArrayOrUndefined, - updateCommentsArrayOrUndefined, -} from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('UpdateComment', () => { - describe('updateComment', () => { - test('it should pass validation when supplied typical comment update', () => { - const payload = getUpdateCommentMock(); - const decoded = updateComment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should fail validation when supplied an undefined for "comment"', () => { - const payload = getUpdateCommentMock(); - // @ts-expect-error - delete payload.comment; - const decoded = updateComment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "comment"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation when supplied an empty string for "comment"', () => { - const payload = { ...getUpdateCommentMock(), comment: '' }; - const decoded = updateComment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "comment"']); - expect(message.schema).toEqual({}); - }); - - test('it should pass validation when supplied an undefined for "id"', () => { - const payload = getUpdateCommentMock(); - delete payload.id; - const decoded = updateComment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should fail validation when supplied an empty string for "id"', () => { - const payload = { ...getUpdateCommentMock(), id: '' }; - const decoded = updateComment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "id"']); - expect(message.schema).toEqual({}); - }); - - test('it should strip out extra key passed in', () => { - const payload: UpdateComment & { - extraKey?: string; - } = { ...getUpdateCommentMock(), extraKey: 'some new value' }; - const decoded = updateComment.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getUpdateCommentMock()); - }); - }); - - describe('updateCommentsArray', () => { - test('it should pass validation when supplied an array of comments', () => { - const payload = getUpdateCommentsArrayMock(); - const decoded = updateCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should fail validation when undefined', () => { - const payload = undefined; - const decoded = updateCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "Array<({| comment: NonEmptyString |} & Partial<{| id: NonEmptyString |}>)>"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation when array includes non comments types', () => { - const payload = [1] as unknown as UpdateCommentsArray; - const decoded = updateCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "Array<({| comment: NonEmptyString |} & Partial<{| id: NonEmptyString |}>)>"', - ]); - expect(message.schema).toEqual({}); - }); - }); - - describe('updateCommentsArrayOrUndefined', () => { - test('it should pass validation when supplied an array of comments', () => { - const payload = getUpdateCommentsArrayMock(); - const decoded = updateCommentsArrayOrUndefined.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should pass validation when supplied when undefined', () => { - const payload = undefined; - const decoded = updateCommentsArrayOrUndefined.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should fail validation when array includes non comments types', () => { - const payload = [1] as unknown as UpdateCommentsArrayOrUndefined; - const decoded = updateCommentsArray.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "1" supplied to "Array<({| comment: NonEmptyString |} & Partial<{| id: NonEmptyString |}>)>"', - ]); - expect(message.schema).toEqual({}); - }); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.ts deleted file mode 100644 index 79a721c8dad54..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.ts +++ /dev/null @@ -1,31 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; -import { id } from '../id'; - -export const updateComment = t.intersection([ - t.exact( - t.type({ - comment: NonEmptyString, - }) - ), - t.exact( - t.partial({ - id, - }) - ), -]); - -export type UpdateComment = t.TypeOf<typeof updateComment>; -export const updateCommentsArray = t.array(updateComment); -export type UpdateCommentsArray = t.TypeOf<typeof updateCommentsArray>; -export const updateCommentsArrayOrUndefined = t.union([updateCommentsArray, t.undefined]); -export type UpdateCommentsArrayOrUndefined = t.TypeOf<typeof updateCommentsArrayOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/updated_at/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/updated_at/index.ts deleted file mode 100644 index a6c0a803e6dbc..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/updated_at/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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; - -export const updated_at = t.string; // TODO: Make this into an ISO Date string check diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/updated_by/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/updated_by/index.ts deleted file mode 100644 index b99396254c914..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/updated_by/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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable @typescript-eslint/naming-convention */ - -import * as t from 'io-ts'; - -export const updated_by = t.string; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/common/value/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/common/value/index.ts deleted file mode 100644 index cad092aee4b79..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/common/value/index.ts +++ /dev/null @@ -1,13 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const value = t.string; -export const valueOrUndefined = t.union([value, t.undefined]); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/constants/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/constants/index.mock.ts deleted file mode 100644 index 4d09fc1efbeb3..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/constants/index.mock.ts +++ /dev/null @@ -1,115 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EndpointEntriesArray } from '../common/endpoint/entries'; -import { EntriesArray, Entry } from '../common/entries'; -import { EntryMatch } from '../common/entry_match'; -import { EntryNested } from '../common/entry_nested'; -import { OsTypeArray } from '../common/os_type'; - -export const DATE_NOW = '2020-04-20T15:25:31.830Z'; -export const OLD_DATE_RELATIVE_TO_DATE_NOW = '2020-04-19T15:25:31.830Z'; -export const USER = 'some user'; -export const ELASTIC_USER = 'elastic'; -export const LIST_INDEX = '.lists'; -export const LIST_ITEM_INDEX = '.items'; -export const NAME = 'some name'; -export const DESCRIPTION = 'some description'; -export const LIST_ID = 'some-list-id'; -export const LIST_ITEM_ID = 'some-list-item-id'; -export const TIE_BREAKER = '6a76b69d-80df-4ab2-8c3e-85f466b06a0e'; -export const TIE_BREAKERS = [ - '21530991-4051-46ec-bc35-2afa09a1b0b5', - '3c662054-ae37-4aa9-9936-3e8e2ea26775', - '60e49a20-3a23-48b6-8bf9-ed5e3b70f7a0', - '38814080-a40f-4358-992a-3b875f9b7dec', - '29fa61be-aaaf-411c-a78a-7059e3f723f1', - '9c19c959-cb9d-4cd2-99e4-1ea2baf0ef0e', - 'd409308c-f94b-4b3a-8234-bbd7a80c9140', - '87824c99-cd83-45c4-8aa6-4ad95dfea62c', - '7b940c17-9355-479f-b882-f3e575718f79', - '5983ad0c-4ef4-4fa0-8308-80ab9ecc4f74', -]; -export const META = {}; -export const TYPE = 'ip'; -export const VALUE = '127.0.0.1'; -export const VALUE_2 = '255.255.255'; -export const NAMESPACE_TYPE = 'single'; -export const NESTED_FIELD = 'parent.field'; - -// Exception List specific -export const ID = 'uuid_here'; -export const ITEM_ID = 'some-list-item-id'; -export const DETECTION_TYPE = 'detection'; -export const ENDPOINT_TYPE = 'endpoint'; -export const FIELD = 'host.name'; -export const OPERATOR = 'included'; -export const OPERATOR_EXCLUDED = 'excluded'; -export const ENTRY_VALUE = 'some host name'; -export const MATCH = 'match'; -export const MATCH_ANY = 'match_any'; -export const WILDCARD = 'wildcard'; -export const MAX_IMPORT_PAYLOAD_BYTES = 9000000; -export const IMPORT_BUFFER_SIZE = 1000; -export const LIST = 'list'; -export const EXISTS = 'exists'; -export const NESTED = 'nested'; -export const ENTRIES: EntriesArray = [ - { - entries: [{ field: 'nested.field', operator: 'included', type: 'match', value: 'some value' }], - field: 'some.parentField', - type: 'nested', - }, - { field: 'some.not.nested.field', operator: 'included', type: 'match', value: 'some value' }, -]; -export const ENDPOINT_ENTRIES: EndpointEntriesArray = [ - { - entries: [{ field: 'nested.field', operator: 'included', type: 'match', value: 'some value' }], - field: 'some.parentField', - type: 'nested', - }, - { field: 'some.not.nested.field', operator: 'included', type: 'match', value: 'some value' }, -]; -// ENTRIES_WITH_IDS should only be used to mock out functionality of a collection of transforms -// that are UI specific and useful for UI concerns that are inserted between the -// API and the actual user interface. In some ways these might be viewed as -// technical debt or to compensate for the differences and preferences -// of how ReactJS might prefer data vs. how we want to model data. -export const ENTRIES_WITH_IDS: EntriesArray = [ - { - entries: [ - { - field: 'nested.field', - id: '123', - operator: 'included', - type: 'match', - value: 'some value', - } as EntryMatch & { id: string }, - ], - field: 'some.parentField', - id: '123', - type: 'nested', - } as EntryNested & { id: string }, - { - field: 'some.not.nested.field', - id: '123', - operator: 'included', - type: 'match', - value: 'some value', - } as Entry & { id: string }, -]; -export const ITEM_TYPE = 'simple'; -export const OS_TYPES: OsTypeArray = ['windows']; -export const TAGS = []; -export const COMMENTS = []; -export const FILTER = 'name:Nicolas Bourbaki'; -export const CURSOR = 'c29tZXN0cmluZ2ZvcnlvdQ=='; -export const _VERSION = 'WzI5NywxXQ=='; -export const VERSION = 1; -export const IMMUTABLE = false; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.mock.ts deleted file mode 100644 index db83807b0271d..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.mock.ts +++ /dev/null @@ -1,32 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { CreateEndpointListItemSchema } from '.'; -import { - COMMENTS, - DESCRIPTION, - ENDPOINT_ENTRIES, - ITEM_TYPE, - META, - NAME, - OS_TYPES, - TAGS, -} from '../../constants/index.mock'; - -export const getCreateEndpointListItemSchemaMock = (): CreateEndpointListItemSchema => ({ - comments: COMMENTS, - description: DESCRIPTION, - entries: ENDPOINT_ENTRIES, - item_id: undefined, - meta: META, - name: NAME, - os_types: OS_TYPES, - tags: TAGS, - type: ITEM_TYPE, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.test.ts deleted file mode 100644 index 9dc599a75ad5c..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.test.ts +++ /dev/null @@ -1,207 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; -import { getCreateEndpointListItemSchemaMock } from './index.mock'; -import { CreateEndpointListItemSchema, createEndpointListItemSchema } from '.'; -import { getCreateCommentsArrayMock } from '../../common/create_comment/index.mock'; -import { getCommentsMock } from '../../common/comment/index.mock'; -import { CommentsArray } from '../../common/comment'; - -describe('create_endpoint_list_item_schema', () => { - test('it should pass validation when supplied a typical list item request not counting the auto generated uuid', () => { - const payload = getCreateEndpointListItemSchemaMock(); - const decoded = createEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as CreateEndpointListItemSchema).item_id; - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should fail validation when supplied an undefined for "description"', () => { - const payload = getCreateEndpointListItemSchemaMock(); - // @ts-expect-error - delete payload.description; - const decoded = createEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "description"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation when supplied an undefined for "name"', () => { - const payload = getCreateEndpointListItemSchemaMock(); - // @ts-expect-error - delete payload.name; - const decoded = createEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "name"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation when supplied an undefined for "type"', () => { - const payload = getCreateEndpointListItemSchemaMock(); - // @ts-expect-error - delete payload.type; - const decoded = createEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "type"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation when supplied a "list_id" since it does not required one', () => { - const inputPayload: CreateEndpointListItemSchema & { list_id: string } = { - ...getCreateEndpointListItemSchemaMock(), - list_id: 'list-123', - }; - const decoded = createEndpointListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "list_id"']); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation when supplied a "namespace_type" since it does not required one', () => { - const inputPayload: CreateEndpointListItemSchema & { namespace_type: string } = { - ...getCreateEndpointListItemSchemaMock(), - namespace_type: 'single', - }; - const decoded = createEndpointListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "namespace_type"']); - expect(message.schema).toEqual({}); - }); - - test('it should pass validation when supplied an undefined for "meta" but strip it out and generate a correct body not counting the auto generated uuid', () => { - const payload = getCreateEndpointListItemSchemaMock(); - const outputPayload = getCreateEndpointListItemSchemaMock(); - delete payload.meta; - delete outputPayload.meta; - const decoded = createEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as CreateEndpointListItemSchema).item_id; - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(outputPayload); - }); - - test('it should pass validation when supplied an undefined for "comments" but return an array and generate a correct body not counting the auto generated uuid', () => { - const inputPayload = getCreateEndpointListItemSchemaMock(); - const outputPayload = getCreateEndpointListItemSchemaMock(); - delete inputPayload.comments; - outputPayload.comments = []; - const decoded = createEndpointListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as CreateEndpointListItemSchema).item_id; - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(outputPayload); - }); - - test('it should pass validation when supplied "comments" array', () => { - const inputPayload = { - ...getCreateEndpointListItemSchemaMock(), - comments: getCreateCommentsArrayMock(), - }; - const decoded = createEndpointListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as CreateEndpointListItemSchema).item_id; - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(inputPayload); - }); - - test('it should fail validation when supplied "comments" with "created_at", "created_by", or "id" values', () => { - const inputPayload: Omit<CreateEndpointListItemSchema, 'comments'> & { - comments?: CommentsArray; - } = { - ...getCreateEndpointListItemSchemaMock(), - comments: [getCommentsMock()], - }; - const decoded = createEndpointListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "created_at,created_by,id"']); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation when supplied an undefined for "entries"', () => { - const inputPayload = getCreateEndpointListItemSchemaMock(); - const outputPayload = getCreateEndpointListItemSchemaMock(); - // @ts-expect-error - delete inputPayload.entries; - outputPayload.entries = []; - const decoded = createEndpointListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as CreateEndpointListItemSchema).item_id; - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "entries"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should pass validation when supplied an undefined for "tags" but return an array and generate a correct body not counting the auto generated uuid', () => { - const inputPayload = getCreateEndpointListItemSchemaMock(); - const outputPayload = getCreateEndpointListItemSchemaMock(); - delete inputPayload.tags; - outputPayload.tags = []; - const decoded = createEndpointListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as CreateEndpointListItemSchema).item_id; - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(outputPayload); - }); - - test('it should pass validation when supplied an undefined for "item_id" and auto generate a uuid', () => { - const inputPayload = getCreateEndpointListItemSchemaMock(); - delete inputPayload.item_id; - const decoded = createEndpointListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect((message.schema as CreateEndpointListItemSchema).item_id).toMatch( - /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i - ); - }); - - test('it should pass validation when supplied an undefined for "item_id" and generate a correct body not counting the uuid', () => { - const inputPayload = getCreateEndpointListItemSchemaMock(); - delete inputPayload.item_id; - const decoded = createEndpointListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as CreateEndpointListItemSchema).item_id; - expect(message.schema).toEqual(inputPayload); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: CreateEndpointListItemSchema & { - extraKey: string; - } = { ...getCreateEndpointListItemSchemaMock(), extraKey: 'some new value' }; - const decoded = createEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.ts deleted file mode 100644 index f8e3965df733e..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.ts +++ /dev/null @@ -1,59 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { DefaultUuid } from '@kbn/securitysolution-io-ts-types'; -import { nonEmptyEndpointEntriesArray } from '../../common/endpoint/entries'; -import { exceptionListItemType } from '../../common/exception_list_item_type'; -import { DefaultCreateCommentsArray } from '../../common/default_create_comments_array'; -import { OsTypeArray, osTypeArrayOrUndefined } from '../../common/os_type'; -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { CreateCommentsArray } from '../../common/create_comment'; -import { Tags } from '../../common/tags'; -import { ItemId } from '../../common/item_id'; -import { EntriesArray } from '../../common/entries'; -import { description } from '../../common/description'; -import { name } from '../../common/name'; -import { meta } from '../../common/meta'; -import { tags } from '../../common/tags'; - -export const createEndpointListItemSchema = t.intersection([ - t.exact( - t.type({ - description, - entries: nonEmptyEndpointEntriesArray, - name, - type: exceptionListItemType, - }) - ), - t.exact( - t.partial({ - comments: DefaultCreateCommentsArray, // defaults to empty array if not set during decode - item_id: DefaultUuid, // defaults to GUID (uuid v4) if not set during decode - meta, // defaults to undefined if not set during decode - os_types: osTypeArrayOrUndefined, // defaults to empty array if not set during decode - tags, // defaults to empty array if not set during decode - }) - ), -]); - -export type CreateEndpointListItemSchema = t.OutputOf<typeof createEndpointListItemSchema>; - -// This type is used after a decode since some things are defaults after a decode. -export type CreateEndpointListItemSchemaDecoded = Omit< - RequiredKeepUndefined<t.TypeOf<typeof createEndpointListItemSchema>>, - 'tags' | 'item_id' | 'entries' | 'comments' | 'os_types' -> & { - comments: CreateCommentsArray; - tags: Tags; - item_id: ItemId; - entries: EntriesArray; - os_types: OsTypeArray; -}; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.mock.ts deleted file mode 100644 index 23b3eb19171de..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.mock.ts +++ /dev/null @@ -1,63 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { CreateExceptionListItemSchema } from '.'; -import { - COMMENTS, - DESCRIPTION, - ENTRIES, - ITEM_ID, - ITEM_TYPE, - LIST_ID, - META, - NAME, - NAMESPACE_TYPE, - OS_TYPES, - TAGS, -} from '../../constants/index.mock'; - -export const getCreateExceptionListItemSchemaMock = (): CreateExceptionListItemSchema => ({ - comments: COMMENTS, - description: DESCRIPTION, - entries: ENTRIES, - item_id: undefined, - list_id: LIST_ID, - meta: META, - name: NAME, - namespace_type: NAMESPACE_TYPE, - os_types: OS_TYPES, - tags: TAGS, - type: ITEM_TYPE, -}); - -/** - * Useful for end to end testing - */ -export const getCreateExceptionListItemMinimalSchemaMock = (): CreateExceptionListItemSchema => ({ - description: DESCRIPTION, - entries: ENTRIES, - item_id: ITEM_ID, - list_id: LIST_ID, - name: NAME, - os_types: OS_TYPES, - type: ITEM_TYPE, -}); - -/** - * Useful for end to end testing - */ -export const getCreateExceptionListItemMinimalSchemaMockWithoutId = - (): CreateExceptionListItemSchema => ({ - description: DESCRIPTION, - entries: ENTRIES, - list_id: LIST_ID, - name: NAME, - os_types: OS_TYPES, - type: ITEM_TYPE, - }); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.test.ts deleted file mode 100644 index dc5dcb63cf1b7..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.test.ts +++ /dev/null @@ -1,211 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getCreateExceptionListItemSchemaMock } from './index.mock'; -import { CreateExceptionListItemSchema, createExceptionListItemSchema } from '.'; -import { getCreateCommentsArrayMock } from '../../common/create_comment/index.mock'; -import { getCommentsMock } from '../../common/comment/index.mock'; -import { CommentsArray } from '../../common/comment'; - -describe('create_exception_list_item_schema', () => { - test('it should pass validation when supplied a typical exception list item request not counting the auto generated uuid', () => { - const payload = getCreateExceptionListItemSchemaMock(); - const decoded = createExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as CreateExceptionListItemSchema).item_id; - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should fail validation when supplied an undefined for "description"', () => { - const payload = getCreateExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.description; - const decoded = createExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "description"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation when supplied an undefined for "name"', () => { - const payload = getCreateExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.name; - const decoded = createExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "name"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation when supplied an undefined for "type"', () => { - const payload = getCreateExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.type; - const decoded = createExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "type"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation when supplied an undefined for "list_id"', () => { - const inputPayload = getCreateExceptionListItemSchemaMock(); - // @ts-expect-error - delete inputPayload.list_id; - const decoded = createExceptionListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "list_id"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should pass validation when supplied an undefined for "meta" but strip it out and generate a correct body not counting the auto generated uuid', () => { - const payload = getCreateExceptionListItemSchemaMock(); - const outputPayload = getCreateExceptionListItemSchemaMock(); - delete payload.meta; - delete outputPayload.meta; - const decoded = createExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as CreateExceptionListItemSchema).item_id; - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(outputPayload); - }); - - test('it should pass validation when supplied an undefined for "comments" but return an array and generate a correct body not counting the auto generated uuid', () => { - const inputPayload = getCreateExceptionListItemSchemaMock(); - const outputPayload = getCreateExceptionListItemSchemaMock(); - delete inputPayload.comments; - outputPayload.comments = []; - const decoded = createExceptionListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as CreateExceptionListItemSchema).item_id; - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(outputPayload); - }); - - test('it should pass validation when supplied "comments" array', () => { - const inputPayload = { - ...getCreateExceptionListItemSchemaMock(), - comments: getCreateCommentsArrayMock(), - }; - const decoded = createExceptionListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as CreateExceptionListItemSchema).item_id; - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(inputPayload); - }); - - test('it should fail validation when supplied "comments" with "created_at" or "created_by" values', () => { - const inputPayload: Omit<CreateExceptionListItemSchema, 'comments'> & { - comments?: CommentsArray; - } = { - ...getCreateExceptionListItemSchemaMock(), - comments: [getCommentsMock()], - }; - const decoded = createExceptionListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "created_at,created_by,id"']); - expect(message.schema).toEqual({}); - }); - - test('it should fail validation when supplied an undefined for "entries"', () => { - const inputPayload = getCreateExceptionListItemSchemaMock(); - const outputPayload = getCreateExceptionListItemSchemaMock(); - // @ts-expect-error - delete inputPayload.entries; - outputPayload.entries = []; - const decoded = createExceptionListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as CreateExceptionListItemSchema).item_id; - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "entries"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should pass validation when supplied an undefined for "namespace_type" but return enum "single" and generate a correct body not counting the auto generated uuid', () => { - const inputPayload = getCreateExceptionListItemSchemaMock(); - const outputPayload = getCreateExceptionListItemSchemaMock(); - delete inputPayload.namespace_type; - outputPayload.namespace_type = 'single'; - const decoded = createExceptionListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as CreateExceptionListItemSchema).item_id; - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(outputPayload); - }); - - test('it should pass validation when supplied an undefined for "tags" but return an array and generate a correct body not counting the auto generated uuid', () => { - const inputPayload = getCreateExceptionListItemSchemaMock(); - const outputPayload = getCreateExceptionListItemSchemaMock(); - delete inputPayload.tags; - outputPayload.tags = []; - const decoded = createExceptionListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as CreateExceptionListItemSchema).item_id; - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(outputPayload); - }); - - test('it should pass validation when supplied an undefined for "item_id" and auto generate a uuid', () => { - const inputPayload = getCreateExceptionListItemSchemaMock(); - delete inputPayload.item_id; - const decoded = createExceptionListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect((message.schema as CreateExceptionListItemSchema).item_id).toMatch( - /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i - ); - }); - - test('it should pass validation when supplied an undefined for "item_id" and generate a correct body not counting the uuid', () => { - const inputPayload = getCreateExceptionListItemSchemaMock(); - delete inputPayload.item_id; - const decoded = createExceptionListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as CreateExceptionListItemSchema).item_id; - expect(message.schema).toEqual(inputPayload); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: CreateExceptionListItemSchema & { - extraKey?: string; - } = getCreateExceptionListItemSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = createExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.ts deleted file mode 100644 index 8445b2d03d677..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.ts +++ /dev/null @@ -1,68 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { DefaultUuid } from '@kbn/securitysolution-io-ts-types'; - -import { DefaultCreateCommentsArray } from '../../common/default_create_comments_array'; -import { CreateCommentsArray } from '../../common/create_comment'; -import { Tags } from '../../common/tags'; -import { ItemId } from '../../common/item_id'; -import { EntriesArray } from '../../common/entries'; -import { NamespaceType } from '../../common/default_namespace'; -import { OsTypeArray, osTypeArrayOrUndefined } from '../../common/os_type'; -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { description } from '../../common/description'; -import { list_id } from '../../common/list_id'; -import { name } from '../../common/name'; -import { exceptionListItemType } from '../../common/exception_list_item_type'; -import { meta } from '../../common/meta'; -import { namespace_type } from '../../common/namespace_type'; -import { tags } from '../../common/tags'; -import { nonEmptyEntriesArray } from '../../common/non_empty_entries_array'; -import { ExpireTimeOrUndefined, expireTimeOrUndefined } from '../../common'; - -export const createExceptionListItemSchema = t.intersection([ - t.exact( - t.type({ - description, - entries: nonEmptyEntriesArray, - list_id, - name, - type: exceptionListItemType, - }) - ), - t.exact( - t.partial({ - comments: DefaultCreateCommentsArray, // defaults to empty array if not set during decode - expire_time: expireTimeOrUndefined, - item_id: DefaultUuid, // defaults to GUID (uuid v4) if not set during decode - meta, // defaults to undefined if not set during decode - namespace_type, // defaults to 'single' if not set during decode - os_types: osTypeArrayOrUndefined, // defaults to empty array if not set during decode - tags, // defaults to empty array if not set during decode - }) - ), -]); - -export type CreateExceptionListItemSchema = t.OutputOf<typeof createExceptionListItemSchema>; - -// This type is used after a decode since some things are defaults after a decode. -export type CreateExceptionListItemSchemaDecoded = Omit< - RequiredKeepUndefined<t.TypeOf<typeof createExceptionListItemSchema>>, - 'tags' | 'item_id' | 'entries' | 'namespace_type' | 'comments' | 'expire_time' -> & { - comments: CreateCommentsArray; - expire_time: ExpireTimeOrUndefined; - tags: Tags; - item_id: ItemId; - entries: EntriesArray; - namespace_type: NamespaceType; - os_types: OsTypeArray; -}; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_schema/index.mock.ts deleted file mode 100644 index 798d36783d7ca..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_schema/index.mock.ts +++ /dev/null @@ -1,61 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { - DESCRIPTION, - ENDPOINT_TYPE, - LIST_ID, - META, - NAME, - NAMESPACE_TYPE, - VERSION, -} from '../../constants/index.mock'; - -import { CreateExceptionListSchema } from '.'; - -export const getCreateExceptionListSchemaMock = (): CreateExceptionListSchema => ({ - description: DESCRIPTION, - list_id: undefined, - meta: META, - name: NAME, - namespace_type: NAMESPACE_TYPE, - os_types: [], - tags: [], - type: ENDPOINT_TYPE, - version: VERSION, -}); - -/** - * Useful for end to end testing - */ -export const getCreateExceptionListMinimalSchemaMock = (): CreateExceptionListSchema => ({ - description: DESCRIPTION, - list_id: LIST_ID, - name: NAME, - type: ENDPOINT_TYPE, -}); - -/** - * Useful for end to end testing - */ -export const getCreateExceptionListMinimalSchemaMockWithoutId = (): CreateExceptionListSchema => ({ - description: DESCRIPTION, - name: NAME, - type: ENDPOINT_TYPE, -}); - -/** - * Useful for end to end testing with detections - */ -export const getCreateExceptionListDetectionSchemaMock = (): CreateExceptionListSchema => ({ - description: DESCRIPTION, - list_id: LIST_ID, - name: NAME, - type: 'detection', -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_schema/index.test.ts deleted file mode 100644 index f6d164f8786bb..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_schema/index.test.ts +++ /dev/null @@ -1,85 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { CreateExceptionListSchema, createExceptionListSchema } from '.'; -import { getCreateExceptionListSchemaMock } from './index.mock'; - -describe('create_exception_list_schema', () => { - test('it should validate a typical exception lists request and generate a correct body not counting the uuid', () => { - const payload = getCreateExceptionListSchemaMock(); - const decoded = createExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as CreateExceptionListSchema).list_id; - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "meta" and generate a correct body not counting the uuid', () => { - const payload = getCreateExceptionListSchemaMock(); - delete payload.meta; - const decoded = createExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as CreateExceptionListSchema).list_id; - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "tags" but return an array and generate a correct body not counting the uuid', () => { - const inputPayload = getCreateExceptionListSchemaMock(); - const outputPayload = getCreateExceptionListSchemaMock(); - delete inputPayload.tags; - outputPayload.tags = []; - const decoded = createExceptionListSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as CreateExceptionListSchema).list_id; - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(outputPayload); - }); - - test('it should accept an undefined for "list_id" and auto generate a uuid', () => { - const inputPayload = getCreateExceptionListSchemaMock(); - delete inputPayload.list_id; - const decoded = createExceptionListSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect((message.schema as CreateExceptionListSchema).list_id).toMatch( - /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i - ); - }); - - test('it should accept an undefined for "list_id" and generate a correct body not counting the uuid', () => { - const inputPayload = getCreateExceptionListSchemaMock(); - delete inputPayload.list_id; - const decoded = createExceptionListSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as CreateExceptionListSchema).list_id; - expect(message.schema).toEqual(inputPayload); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: CreateExceptionListSchema & { - extraKey?: string; - } = getCreateExceptionListSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = createExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_schema/index.ts deleted file mode 100644 index 786e39a618641..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_schema/index.ts +++ /dev/null @@ -1,61 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { - DefaultUuid, - DefaultVersionNumber, - DefaultVersionNumberDecoded, -} from '@kbn/securitysolution-io-ts-types'; - -import { exceptionListType } from '../../common/exception_list'; -import { OsTypeArray, osTypeArrayOrUndefined } from '../../common/os_type'; -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { Tags } from '../../common/tags'; -import { ListId } from '../../common/list_id'; -import { NamespaceType } from '../../common/default_namespace'; -import { name } from '../../common/name'; -import { description } from '../../common/description'; -import { namespace_type } from '../../common/namespace_type'; -import { tags } from '../../common/tags'; -import { meta } from '../../common/meta'; - -export const createExceptionListSchema = t.intersection([ - t.exact( - t.type({ - description, - name, - type: exceptionListType, - }) - ), - t.exact( - t.partial({ - list_id: DefaultUuid, // defaults to a GUID (UUID v4) string if not set during decode - meta, // defaults to undefined if not set during decode - namespace_type, // defaults to 'single' if not set during decode - os_types: osTypeArrayOrUndefined, // defaults to empty array if not set during decode - tags, // defaults to empty array if not set during decode - version: DefaultVersionNumber, // defaults to numerical 1 if not set during decode - }) - ), -]); - -export type CreateExceptionListSchema = t.OutputOf<typeof createExceptionListSchema>; - -// This type is used after a decode since some things are defaults after a decode. -export type CreateExceptionListSchemaDecoded = Omit< - RequiredKeepUndefined<t.TypeOf<typeof createExceptionListSchema>>, - 'tags' | 'list_id' | 'namespace_type' | 'os_types' -> & { - tags: Tags; - list_id: ListId; - namespace_type: NamespaceType; - os_types: OsTypeArray; - version: DefaultVersionNumberDecoded; -}; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_item_schema/index.mock.ts deleted file mode 100644 index ed9a77fb859ae..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_item_schema/index.mock.ts +++ /dev/null @@ -1,36 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { LIST_ID, LIST_ITEM_ID, META, VALUE } from '../../constants/index.mock'; - -import { CreateListItemSchema } from '.'; - -export const getCreateListItemSchemaMock = (): CreateListItemSchema => ({ - id: LIST_ITEM_ID, - list_id: LIST_ID, - meta: META, - value: VALUE, -}); - -/** - * Useful for end to end testing - */ -export const getCreateMinimalListItemSchemaMock = (): CreateListItemSchema => ({ - id: LIST_ITEM_ID, - list_id: LIST_ID, - value: VALUE, -}); - -/** - * Useful for end to end testing - */ -export const getCreateMinimalListItemSchemaMockWithoutId = (): CreateListItemSchema => ({ - list_id: LIST_ID, - value: VALUE, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_item_schema/index.test.ts deleted file mode 100644 index 3e991933b664c..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_item_schema/index.test.ts +++ /dev/null @@ -1,59 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getCreateListItemSchemaMock } from './index.mock'; -import { CreateListItemSchema, createListItemSchema } from '.'; - -describe('create_list_item_schema', () => { - test('it should validate a typical list item request', () => { - const payload = getCreateListItemSchemaMock(); - const decoded = createListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for an id', () => { - const payload = getCreateListItemSchemaMock(); - delete payload.id; - const decoded = createListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for meta', () => { - const payload = getCreateListItemSchemaMock(); - delete payload.meta; - const decoded = createListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: CreateListItemSchema & { extraKey?: string } = getCreateListItemSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = createListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_item_schema/index.ts deleted file mode 100644 index f1b3c65865357..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_item_schema/index.ts +++ /dev/null @@ -1,32 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { list_id } from '../../common/list_id'; -import { value } from '../../common/value'; -import { id } from '../../common/id'; -import { meta } from '../../common/meta'; -import { refreshWithWaitFor } from '../../common/refresh'; - -export const createListItemSchema = t.intersection([ - t.exact( - t.type({ - list_id, - value, - }) - ), - t.exact(t.partial({ id, meta, refresh: refreshWithWaitFor })), -]); - -export type CreateListItemSchema = t.OutputOf<typeof createListItemSchema>; -export type CreateListItemSchemaDecoded = RequiredKeepUndefined< - t.TypeOf<typeof createListItemSchema> ->; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.mock.ts deleted file mode 100644 index bbdd927a58e74..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.mock.ts +++ /dev/null @@ -1,42 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { DESCRIPTION, LIST_ID, META, NAME, TYPE, VERSION } from '../../constants/index.mock'; - -import { CreateListSchema } from '.'; - -export const getCreateListSchemaMock = (): CreateListSchema => ({ - description: DESCRIPTION, - deserializer: undefined, - id: LIST_ID, - meta: META, - name: NAME, - serializer: undefined, - type: TYPE, - version: VERSION, -}); - -/** - * Useful for end to end tests and other mechanisms which want to fill in the values - */ -export const getCreateMinimalListSchemaMock = (): CreateListSchema => ({ - description: DESCRIPTION, - id: LIST_ID, - name: NAME, - type: TYPE, -}); - -/** - * Useful for end to end tests and other mechanisms which want to fill in the values - */ -export const getCreateMinimalListSchemaMockWithoutId = (): CreateListSchema => ({ - description: DESCRIPTION, - name: NAME, - type: TYPE, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.test.ts deleted file mode 100644 index 0eb9ecd02505f..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.test.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { CreateListSchema, createListSchema } from '.'; -import { getCreateListSchemaMock } from './index.mock'; - -describe('create_list_schema', () => { - test('it should validate a typical lists request', () => { - const payload = getCreateListSchemaMock(); - const decoded = createListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for an id', () => { - const payload = getCreateListSchemaMock(); - delete payload.id; - const decoded = createListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for meta', () => { - const payload = getCreateListSchemaMock(); - delete payload.meta; - const decoded = createListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for serializer', () => { - const payload = getCreateListSchemaMock(); - delete payload.serializer; - const decoded = createListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for deserializer', () => { - const payload = getCreateListSchemaMock(); - delete payload.deserializer; - const decoded = createListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: CreateListSchema & { extraKey?: string } = getCreateListSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = createListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.ts deleted file mode 100644 index c6e210a999ea7..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.ts +++ /dev/null @@ -1,47 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { - DefaultVersionNumber, - DefaultVersionNumberDecoded, -} from '@kbn/securitysolution-io-ts-types'; - -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { name } from '../../common/name'; -import { description } from '../../common/description'; -import { type } from '../../common/type'; -import { deserializer } from '../../common/deserializer'; -import { id } from '../../common/id'; -import { meta } from '../../common/meta'; -import { serializer } from '../../common/serializer'; - -export const createListSchema = t.intersection([ - t.exact( - t.type({ - description, - name, - type, - }) - ), - t.exact( - t.partial({ - deserializer, // defaults to undefined if not set during decode - id, // defaults to undefined if not set during decode - meta, // defaults to undefined if not set during decode - serializer, // defaults to undefined if not set during decode - version: DefaultVersionNumber, // defaults to a numerical 1 if not set during decode - }) - ), -]); - -export type CreateListSchema = t.OutputOf<typeof createListSchema>; -export type CreateListSchemaDecoded = RequiredKeepUndefined< - Omit<t.TypeOf<typeof createListSchema>, 'version'> -> & { version: DefaultVersionNumberDecoded }; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_rule_exception_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/create_rule_exception_item_schema/index.test.ts deleted file mode 100644 index 1eda590adb5de..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_rule_exception_item_schema/index.test.ts +++ /dev/null @@ -1,127 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { CreateRuleExceptionListItemSchema, createRuleExceptionListItemSchema } from '.'; -import { CreateExceptionListItemSchema } from '../create_exception_list_item_schema'; - -const getCreateExceptionListItemSchemaMock = (): CreateExceptionListItemSchema => ({ - comments: [], - description: 'some description', - entries: [ - { - field: 'host.name', - operator: 'included', - type: 'match_any', - value: ['foo', 'bar'], - }, - ], - item_id: undefined, - list_id: 'some-list-id', - name: 'some name', - namespace_type: 'single', - os_types: [], - tags: [], - type: 'simple', -}); - -describe('createRuleExceptionListItemSchema', () => { - test('empty objects do not validate', () => { - const payload = {} as CreateRuleExceptionListItemSchema; - - const decoded = createRuleExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "description"', - 'Invalid value "undefined" supplied to "entries"', - 'Invalid value "undefined" supplied to "name"', - 'Invalid value "undefined" supplied to "type"', - ]); - expect(message.schema).toEqual({}); - }); - - test('items without list_id validate', () => { - const payload: CreateRuleExceptionListItemSchema = { - description: 'Exception item for rule default exception list', - entries: [ - { - field: 'some.not.nested.field', - operator: 'included', - type: 'match', - value: 'some value', - }, - ], - name: 'Sample exception item', - type: 'simple', - }; - - const decoded = createRuleExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual( - expect.objectContaining({ - comments: [], - description: 'Exception item for rule default exception list', - entries: [ - { - field: 'some.not.nested.field', - operator: 'included', - type: 'match', - value: 'some value', - }, - ], - name: 'Sample exception item', - os_types: [], - tags: [], - type: 'simple', - }) - ); - }); - - test('items with list_id do not validate', () => { - const payload = - getCreateExceptionListItemSchemaMock() as unknown as CreateRuleExceptionListItemSchema; - - const decoded = createRuleExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "some-list-id" supplied to "list_id"', - ]); - expect(message.schema).toEqual({}); - }); - - test('made up parameters do not validate', () => { - const payload: Partial<CreateRuleExceptionListItemSchema> & { madeUp: string } = { - description: 'Exception item for rule default exception list', - entries: [ - { - field: 'some.not.nested.field', - operator: 'included', - type: 'match', - value: 'some value', - }, - ], - name: 'Sample exception item', - type: 'simple', - madeUp: 'invalid value', - }; - - const decoded = createRuleExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "madeUp"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_rule_exception_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/create_rule_exception_item_schema/index.ts deleted file mode 100644 index 1e4a254f92b81..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/create_rule_exception_item_schema/index.ts +++ /dev/null @@ -1,73 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { DefaultUuid } from '@kbn/securitysolution-io-ts-types'; - -import { - CreateCommentsArray, - DefaultCreateCommentsArray, - description, - EntriesArray, - exceptionListItemType, - ItemId, - meta, - NamespaceType, - namespaceType, - nonEmptyEntriesArray, - OsTypeArray, - osTypeArrayOrUndefined, - Tags, - tags, - name, - ExpireTimeOrUndefined, - expireTimeOrUndefined, -} from '../../common'; -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; - -export const createRuleExceptionListItemSchema = t.intersection([ - t.exact( - t.type({ - description, - entries: nonEmptyEntriesArray, - name, - type: exceptionListItemType, - }) - ), - t.exact( - t.partial({ - comments: DefaultCreateCommentsArray, // defaults to empty array if not set during decode - item_id: DefaultUuid, // defaults to GUID (uuid v4) if not set during decode - list_id: t.undefined, - meta, // defaults to undefined if not set during decode - namespace_type: namespaceType, // defaults to 'single' if not set during decode - os_types: osTypeArrayOrUndefined, // defaults to empty array if not set during decode - tags, // defaults to empty array if not set during decode - expire_time: expireTimeOrUndefined, - }) - ), -]); - -export type CreateRuleExceptionListItemSchema = t.OutputOf< - typeof createRuleExceptionListItemSchema ->; - -// This type is used after a decode since some things are defaults after a decode. -export type CreateRuleExceptionListItemSchemaDecoded = Omit< - RequiredKeepUndefined<t.TypeOf<typeof createRuleExceptionListItemSchema>>, - 'tags' | 'item_id' | 'entries' | 'namespace_type' | 'comments' | 'expire_time' -> & { - comments: CreateCommentsArray; - tags: Tags; - item_id: ItemId; - entries: EntriesArray; - namespace_type: NamespaceType; - os_types: OsTypeArray; - expire_time: ExpireTimeOrUndefined; -}; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_endpoint_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_endpoint_list_item_schema/index.mock.ts deleted file mode 100644 index 2f7963171197f..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_endpoint_list_item_schema/index.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ID } from '../../constants/index.mock'; - -import { DeleteEndpointListItemSchema } from '.'; - -export const getDeleteEndpointListItemSchemaMock = (): DeleteEndpointListItemSchema => ({ - id: ID, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_endpoint_list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_endpoint_list_item_schema/index.test.ts deleted file mode 100644 index d702632713a59..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_endpoint_list_item_schema/index.test.ts +++ /dev/null @@ -1,51 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { DeleteEndpointListItemSchema, deleteEndpointListItemSchema } from '.'; -import { getDeleteEndpointListItemSchemaMock } from './index.mock'; - -describe('delete_endpoint_list_item_schema', () => { - test('it should validate a typical endpoint list item request', () => { - const payload = getDeleteEndpointListItemSchemaMock(); - const decoded = deleteEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept a value for "namespace_type" since it does not require one', () => { - const payload: DeleteEndpointListItemSchema & { - namespace_type: string; - } = { ...getDeleteEndpointListItemSchemaMock(), namespace_type: 'single' }; - // @ts-expect-error - delete payload.namespace_type; - const decoded = deleteEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getDeleteEndpointListItemSchemaMock()); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: DeleteEndpointListItemSchema & { - extraKey?: string; - } = { ...getDeleteEndpointListItemSchemaMock(), extraKey: 'some new value' }; - const decoded = deleteEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_endpoint_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_endpoint_list_item_schema/index.ts deleted file mode 100644 index f968b1410a25d..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_endpoint_list_item_schema/index.ts +++ /dev/null @@ -1,28 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { id } from '../../common/id'; -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { item_id } from '../../common/item_id'; - -export const deleteEndpointListItemSchema = t.exact( - t.partial({ - id, - item_id, - }) -); - -export type DeleteEndpointListItemSchema = t.OutputOf<typeof deleteEndpointListItemSchema>; - -// This type is used after a decode since some things are defaults after a decode. -export type DeleteEndpointListItemSchemaDecoded = RequiredKeepUndefined< - t.TypeOf<typeof deleteEndpointListItemSchema> ->; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_item_schema/index.mock.ts deleted file mode 100644 index 723b5acb6620c..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_item_schema/index.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ID, NAMESPACE_TYPE } from '../../constants/index.mock'; - -import { DeleteExceptionListItemSchema } from '.'; - -export const getDeleteExceptionListItemSchemaMock = (): DeleteExceptionListItemSchema => ({ - id: ID, - namespace_type: NAMESPACE_TYPE, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_item_schema/index.test.ts deleted file mode 100644 index 375fc20ba4da4..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_item_schema/index.test.ts +++ /dev/null @@ -1,49 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { DeleteExceptionListItemSchema, deleteExceptionListItemSchema } from '.'; -import { getDeleteExceptionListItemSchemaMock } from './index.mock'; - -describe('delete_exception_list_item_schema', () => { - test('it should validate a typical exception list item request', () => { - const payload = getDeleteExceptionListItemSchemaMock(); - const decoded = deleteExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "namespace_type" but default to "single"', () => { - const payload = getDeleteExceptionListItemSchemaMock(); - delete payload.namespace_type; - const decoded = deleteExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getDeleteExceptionListItemSchemaMock()); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: DeleteExceptionListItemSchema & { - extraKey?: string; - } = getDeleteExceptionListItemSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = deleteExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_item_schema/index.ts deleted file mode 100644 index 4d961aa9e1a5b..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_item_schema/index.ts +++ /dev/null @@ -1,34 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { NamespaceType } from '../../common/default_namespace'; -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { id } from '../../common/id'; -import { item_id } from '../../common/item_id'; -import { namespace_type } from '../../common/namespace_type'; - -export const deleteExceptionListItemSchema = t.exact( - t.partial({ - id, - item_id, - namespace_type, // defaults to 'single' if not set during decode - }) -); - -export type DeleteExceptionListItemSchema = t.OutputOf<typeof deleteExceptionListItemSchema>; - -// This type is used after a decode since some things are defaults after a decode. -export type DeleteExceptionListItemSchemaDecoded = Omit< - RequiredKeepUndefined<t.TypeOf<typeof deleteExceptionListItemSchema>>, - 'namespace_type' -> & { - namespace_type: NamespaceType; -}; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_schema/index.mock.ts deleted file mode 100644 index f41f5b288004b..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_schema/index.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ID, NAMESPACE_TYPE } from '../../constants/index.mock'; - -import { DeleteExceptionListSchema } from '.'; - -export const getDeleteExceptionListSchemaMock = (): DeleteExceptionListSchema => ({ - id: ID, - namespace_type: NAMESPACE_TYPE, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_schema/index.test.ts deleted file mode 100644 index 5507f855d783a..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_schema/index.test.ts +++ /dev/null @@ -1,49 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { DeleteExceptionListSchema, deleteExceptionListSchema } from '.'; -import { getDeleteExceptionListSchemaMock } from './index.mock'; - -describe('delete_exception_list_schema', () => { - test('it should validate a typical exception list request', () => { - const payload = getDeleteExceptionListSchemaMock(); - const decoded = deleteExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "namespace_type" but default to "single"', () => { - const payload = getDeleteExceptionListSchemaMock(); - delete payload.namespace_type; - const decoded = deleteExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getDeleteExceptionListSchemaMock()); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: DeleteExceptionListSchema & { - extraKey?: string; - } = getDeleteExceptionListSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = deleteExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_schema/index.ts deleted file mode 100644 index 62855c9dc212d..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_schema/index.ts +++ /dev/null @@ -1,34 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { NamespaceType } from '../../common/default_namespace'; -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { id } from '../../common/id'; -import { list_id } from '../../common/list_id'; -import { namespace_type } from '../../common/namespace_type'; - -export const deleteExceptionListSchema = t.exact( - t.partial({ - id, - list_id, - namespace_type, // defaults to 'single' if not set during decode - }) -); - -export type DeleteExceptionListSchema = t.OutputOf<typeof deleteExceptionListSchema>; - -// This type is used after a decode since some things are defaults after a decode. -export type DeleteExceptionListSchemaDecoded = Omit< - RequiredKeepUndefined<t.TypeOf<typeof deleteExceptionListSchema>>, - 'namespace_type' -> & { - namespace_type: NamespaceType; -}; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_item_schema/index.mock.ts deleted file mode 100644 index aaa03621d676f..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_item_schema/index.mock.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ID, LIST_ID, VALUE } from '../../constants/index.mock'; - -import { DeleteListItemSchema } from '.'; - -export const getDeleteListItemSchemaMock = (): DeleteListItemSchema => ({ - id: ID, - list_id: LIST_ID, - value: VALUE, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_item_schema/index.test.ts deleted file mode 100644 index d838fbab4f162..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_item_schema/index.test.ts +++ /dev/null @@ -1,38 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { DeleteListItemSchema, deleteListItemSchema } from '.'; -import { getDeleteListItemSchemaMock } from './index.mock'; - -describe('delete_list_item_schema', () => { - test('it should validate a typical list item request', () => { - const payload = getDeleteListItemSchemaMock(); - const decoded = deleteListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: DeleteListItemSchema & { - extraKey?: string; - } = { ...getDeleteListItemSchemaMock(), extraKey: 'some new value' }; - const decoded = deleteListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_item_schema/index.ts deleted file mode 100644 index bbf0a09a15c81..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_item_schema/index.ts +++ /dev/null @@ -1,30 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { id } from '../../common/id'; -import { list_id } from '../../common/list_id'; -import { valueOrUndefined } from '../../common/value'; -import { refresh } from '../../common/refresh'; - -export const deleteListItemSchema = t.intersection([ - t.exact( - t.type({ - value: valueOrUndefined, - }) - ), - t.exact(t.partial({ id, list_id, refresh })), -]); - -export type DeleteListItemSchema = t.OutputOf<typeof deleteListItemSchema>; -export type DeleteListItemSchemaDecoded = RequiredKeepUndefined< - t.TypeOf<typeof deleteListItemSchema> ->; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_schema/index.mock.ts deleted file mode 100644 index 4514b70ad39fe..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_schema/index.mock.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { LIST_ID } from '../../constants/index.mock'; - -import { DeleteListSchema } from '.'; - -export const getDeleteListSchemaMock = (): DeleteListSchema => ({ - deleteReferences: false, - id: LIST_ID, - ignoreReferences: true, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_schema/index.test.ts deleted file mode 100644 index 5de3ec2c21097..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_schema/index.test.ts +++ /dev/null @@ -1,48 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { DeleteListSchema, deleteListSchema } from '.'; -import { getDeleteListSchemaMock } from './index.mock'; - -describe('delete_list_schema', () => { - test('it should validate a typical lists request', () => { - const payload = getDeleteListSchemaMock(); - const decoded = deleteListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept an undefined for an id', () => { - const payload = getDeleteListSchemaMock(); - // @ts-expect-error - delete payload.id; - const decoded = deleteListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['Invalid value "undefined" supplied to "id"']); - expect(message.schema).toEqual({}); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: DeleteListSchema & { extraKey?: string } = getDeleteListSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = deleteListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_schema/index.ts deleted file mode 100644 index 239a4d72113d7..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_schema/index.ts +++ /dev/null @@ -1,31 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { DefaultStringBooleanFalse } from '@kbn/securitysolution-io-ts-types'; - -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { id } from '../../common/id'; - -export const deleteListSchema = t.intersection([ - t.exact( - t.type({ - id, - }) - ), - t.exact( - t.partial({ - deleteReferences: DefaultStringBooleanFalse, - ignoreReferences: DefaultStringBooleanFalse, - }) - ), -]); - -export type DeleteListSchema = RequiredKeepUndefined<t.TypeOf<typeof deleteListSchema>>; -export type DeleteListSchemaEncoded = t.OutputOf<typeof deleteListSchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/duplicate_exception_list_query_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/duplicate_exception_list_query_schema/index.mock.ts deleted file mode 100644 index 121ab5f0b914e..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/duplicate_exception_list_query_schema/index.mock.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { LIST_ID, NAMESPACE_TYPE } from '../../constants/index.mock'; - -import { DuplicateExceptionListQuerySchema } from '.'; - -export const getDuplicateExceptionListQuerySchemaMock = (): DuplicateExceptionListQuerySchema => ({ - list_id: LIST_ID, - namespace_type: NAMESPACE_TYPE, - include_expired_exceptions: 'true', -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/duplicate_exception_list_query_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/duplicate_exception_list_query_schema/index.test.ts deleted file mode 100644 index 244adc07a81d8..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/duplicate_exception_list_query_schema/index.test.ts +++ /dev/null @@ -1,67 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { DuplicateExceptionListQuerySchema, duplicateExceptionListQuerySchema } from '.'; -import { getDuplicateExceptionListQuerySchemaMock } from './index.mock'; - -describe('duplicate_exceptionList_query_schema', () => { - test('it should validate a typical lists request', () => { - const payload = getDuplicateExceptionListQuerySchemaMock(); - const decoded = duplicateExceptionListQuerySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should default namespace_type to "single" if an undefined given for namespacetype', () => { - const payload = getDuplicateExceptionListQuerySchemaMock(); - delete payload.namespace_type; - const decoded = duplicateExceptionListQuerySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(message.schema).toEqual({ - include_expired_exceptions: 'true', - list_id: 'some-list-id', - namespace_type: 'single', - }); - }); - - test('it should NOT accept an undefined for an list_id', () => { - const payload = getDuplicateExceptionListQuerySchemaMock(); - // @ts-expect-error - delete payload.list_id; - const decoded = duplicateExceptionListQuerySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "list_id"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: DuplicateExceptionListQuerySchema & { - extraKey?: string; - } = getDuplicateExceptionListQuerySchemaMock(); - payload.extraKey = 'some new value'; - const decoded = duplicateExceptionListQuerySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/duplicate_exception_list_query_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/duplicate_exception_list_query_schema/index.ts deleted file mode 100644 index b329e1244eb90..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/duplicate_exception_list_query_schema/index.ts +++ /dev/null @@ -1,35 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { NamespaceType } from '../../common'; - -import { includeExpiredExceptionsOrUndefined } from '../../common/include_expired_exceptions'; -import { list_id } from '../../common/list_id'; -import { namespace_type } from '../../common/namespace_type'; - -export const duplicateExceptionListQuerySchema = t.exact( - t.type({ - list_id, - namespace_type, - include_expired_exceptions: includeExpiredExceptionsOrUndefined, - }) -); - -export type DuplicateExceptionListQuerySchema = t.OutputOf< - typeof duplicateExceptionListQuerySchema ->; - -// This type is used after a decode since some things are defaults after a decode. -export type DuplicateExceptionListQuerySchemaDecoded = Omit< - t.TypeOf<typeof duplicateExceptionListQuerySchema>, - 'namespace_type' -> & { - namespace_type: NamespaceType; -}; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/export_exception_list_query_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/export_exception_list_query_schema/index.mock.ts deleted file mode 100644 index 4f34a59407eae..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/export_exception_list_query_schema/index.mock.ts +++ /dev/null @@ -1,19 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ID, LIST_ID, NAMESPACE_TYPE } from '../../constants/index.mock'; - -import { ExportExceptionListQuerySchema } from '.'; - -export const getExportExceptionListQuerySchemaMock = (): ExportExceptionListQuerySchema => ({ - id: ID, - list_id: LIST_ID, - namespace_type: NAMESPACE_TYPE, - include_expired_exceptions: 'true', -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/export_exception_list_query_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/export_exception_list_query_schema/index.test.ts deleted file mode 100644 index 00b41f6d70f99..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/export_exception_list_query_schema/index.test.ts +++ /dev/null @@ -1,80 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { ExportExceptionListQuerySchema, exportExceptionListQuerySchema } from '.'; -import { getExportExceptionListQuerySchemaMock } from './index.mock'; - -describe('export_exception_list_schema', () => { - test('it should validate a typical lists request', () => { - const payload = getExportExceptionListQuerySchemaMock(); - const decoded = exportExceptionListQuerySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept an undefined for an id', () => { - const payload = getExportExceptionListQuerySchemaMock(); - // @ts-expect-error - delete payload.id; - const decoded = exportExceptionListQuerySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "undefined" supplied to "id"']); - expect(message.schema).toEqual({}); - }); - - test('it should default namespace_type to "single" if an undefined given for namespacetype', () => { - const payload = getExportExceptionListQuerySchemaMock(); - delete payload.namespace_type; - const decoded = exportExceptionListQuerySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(message.schema).toEqual({ - id: 'uuid_here', - include_expired_exceptions: 'true', - list_id: 'some-list-id', - namespace_type: 'single', - }); - }); - - test('it should NOT accept an undefined for an list_id', () => { - const payload = getExportExceptionListQuerySchemaMock(); - // @ts-expect-error - delete payload.list_id; - const decoded = exportExceptionListQuerySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "list_id"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: ExportExceptionListQuerySchema & { - extraKey?: string; - } = getExportExceptionListQuerySchemaMock(); - payload.extraKey = 'some new value'; - const decoded = exportExceptionListQuerySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/export_exception_list_query_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/export_exception_list_query_schema/index.ts deleted file mode 100644 index 3943af148b159..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/export_exception_list_query_schema/index.ts +++ /dev/null @@ -1,27 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { id } from '../../common/id'; -import { includeExpiredExceptionsOrUndefined } from '../../common/include_expired_exceptions'; -import { list_id } from '../../common/list_id'; -import { namespace_type } from '../../common/namespace_type'; - -export const exportExceptionListQuerySchema = t.exact( - t.type({ - id, - list_id, - namespace_type, - include_expired_exceptions: includeExpiredExceptionsOrUndefined, - // TODO: Add file_name here with a default value - }) -); - -export type ExportExceptionListQuerySchema = t.OutputOf<typeof exportExceptionListQuerySchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/export_list_item_query_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/export_list_item_query_schema/index.mock.ts deleted file mode 100644 index 3c66cae1fb0ee..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/export_list_item_query_schema/index.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { LIST_ID } from '../../constants/index.mock'; - -import { ExportListItemQuerySchema } from '.'; - -export const getExportListItemQuerySchemaMock = (): ExportListItemQuerySchema => ({ - list_id: LIST_ID, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/export_list_item_query_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/export_list_item_query_schema/index.test.ts deleted file mode 100644 index 55713e33f1600..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/export_list_item_query_schema/index.test.ts +++ /dev/null @@ -1,52 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { ExportListItemQuerySchema, exportListItemQuerySchema } from '.'; -import { getExportListItemQuerySchemaMock } from './index.mock'; - -describe('export_list_item_schema', () => { - test('it should validate a typical lists request', () => { - const payload = getExportListItemQuerySchemaMock(); - const decoded = exportListItemQuerySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept an undefined for an id', () => { - const payload = getExportListItemQuerySchemaMock(); - // @ts-expect-error - delete payload.list_id; - const decoded = exportListItemQuerySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "list_id"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: ExportListItemQuerySchema & { - extraKey?: string; - } = getExportListItemQuerySchemaMock(); - payload.extraKey = 'some new value'; - const decoded = exportListItemQuerySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/export_list_item_query_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/export_list_item_query_schema/index.ts deleted file mode 100644 index 86c8318f1ad5c..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/export_list_item_query_schema/index.ts +++ /dev/null @@ -1,25 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { list_id } from '../../common/list_id'; -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; - -export const exportListItemQuerySchema = t.exact( - t.type({ - list_id, - // TODO: Add file_name here with a default value - }) -); - -export type ExportListItemQuerySchema = RequiredKeepUndefined< - t.TypeOf<typeof exportListItemQuerySchema> ->; -export type ExportListItemQuerySchemaEncoded = t.OutputOf<typeof exportListItemQuerySchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_endpoint_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/find_endpoint_list_item_schema/index.mock.ts deleted file mode 100644 index d24d31cca5d98..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_endpoint_list_item_schema/index.mock.ts +++ /dev/null @@ -1,28 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { FILTER } from '../../constants/index.mock'; - -import { FindEndpointListItemSchema, FindEndpointListItemSchemaDecoded } from '.'; - -export const getFindEndpointListItemSchemaMock = (): FindEndpointListItemSchema => ({ - filter: FILTER, - page: '1', - per_page: '25', - sort_field: undefined, - sort_order: undefined, -}); - -export const getFindEndpointListItemSchemaDecodedMock = (): FindEndpointListItemSchemaDecoded => ({ - filter: FILTER, - page: 1, - per_page: 25, - sort_field: undefined, - sort_order: undefined, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_endpoint_list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/find_endpoint_list_item_schema/index.test.ts deleted file mode 100644 index 776cc2976868d..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_endpoint_list_item_schema/index.test.ts +++ /dev/null @@ -1,109 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { - getFindEndpointListItemSchemaDecodedMock, - getFindEndpointListItemSchemaMock, -} from './index.mock'; -import { FindEndpointListItemSchema, findEndpointListItemSchema } from '.'; - -describe('find_endpoint_list_item_schema', () => { - test('it should validate a typical find item request', () => { - const payload = getFindEndpointListItemSchemaMock(); - const decoded = findEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getFindEndpointListItemSchemaDecodedMock()); - }); - - test('it should validate and empty object since everything is optional and has defaults', () => { - const payload: FindEndpointListItemSchema = {}; - const decoded = findEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate with page missing', () => { - const payload = getFindEndpointListItemSchemaMock(); - delete payload.page; - const decoded = findEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindEndpointListItemSchemaDecodedMock(); - delete expected.page; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with pre_page missing', () => { - const payload = getFindEndpointListItemSchemaMock(); - delete payload.per_page; - const decoded = findEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindEndpointListItemSchemaDecodedMock(); - delete expected.per_page; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with filter missing', () => { - const payload = getFindEndpointListItemSchemaMock(); - delete payload.filter; - const decoded = findEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindEndpointListItemSchemaDecodedMock(); - delete expected.filter; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with sort_field missing', () => { - const payload = getFindEndpointListItemSchemaMock(); - delete payload.sort_field; - const decoded = findEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindEndpointListItemSchemaDecodedMock(); - delete expected.sort_field; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with sort_order missing', () => { - const payload = getFindEndpointListItemSchemaMock(); - delete payload.sort_order; - const decoded = findEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindEndpointListItemSchemaDecodedMock(); - delete expected.sort_order; - expect(message.schema).toEqual(expected); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: FindEndpointListItemSchema & { - extraKey: string; - } = { ...getFindEndpointListItemSchemaMock(), extraKey: 'some new value' }; - const decoded = findEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_endpoint_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/find_endpoint_list_item_schema/index.ts deleted file mode 100644 index a76854d3b4bfc..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_endpoint_list_item_schema/index.ts +++ /dev/null @@ -1,33 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { StringToPositiveNumber } from '@kbn/securitysolution-io-ts-types'; - -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { filter } from '../../common/filter'; -import { sort_field } from '../../common/sort_field'; -import { sort_order } from '../../common/sort_order'; - -export const findEndpointListItemSchema = t.exact( - t.partial({ - filter, // defaults to undefined if not set during decode - page: StringToPositiveNumber, // defaults to undefined if not set during decode - per_page: StringToPositiveNumber, // defaults to undefined if not set during decode - sort_field, // defaults to undefined if not set during decode - sort_order, // defaults to undefined if not set during decode - }) -); - -export type FindEndpointListItemSchema = t.OutputOf<typeof findEndpointListItemSchema>; - -// This type is used after a decode since some things are defaults after a decode. -export type FindEndpointListItemSchemaDecoded = RequiredKeepUndefined< - t.TypeOf<typeof findEndpointListItemSchema> ->; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_item_schema/index.mock.ts deleted file mode 100644 index 02b89bdf4c730..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_item_schema/index.mock.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { FILTER, LIST_ID, NAMESPACE_TYPE } from '../../constants/index.mock'; - -import { FindExceptionListItemSchema, FindExceptionListItemSchemaDecoded } from '.'; - -export const getFindExceptionListItemSchemaMock = (): FindExceptionListItemSchema => ({ - filter: FILTER, - list_id: LIST_ID, - namespace_type: NAMESPACE_TYPE, - page: '1', - per_page: '25', - search: undefined, - sort_field: undefined, - sort_order: undefined, -}); - -export const getFindExceptionListItemSchemaMultipleMock = (): FindExceptionListItemSchema => ({ - filter: 'name:Sofia Kovalevskaya,name:Hypatia,name:Sophie Germain', - list_id: 'list-1,list-2,list-3', - namespace_type: 'single,single,agnostic', - page: '1', - per_page: '25', - search: undefined, - sort_field: undefined, - sort_order: undefined, -}); - -export const getFindExceptionListItemSchemaDecodedMock = - (): FindExceptionListItemSchemaDecoded => ({ - filter: [FILTER], - list_id: [LIST_ID], - namespace_type: [NAMESPACE_TYPE], - page: 1, - per_page: 25, - search: undefined, - sort_field: undefined, - sort_order: undefined, - }); - -export const getFindExceptionListItemSchemaDecodedMultipleMock = - (): FindExceptionListItemSchemaDecoded => ({ - filter: ['name:Sofia Kovalevskaya', 'name:Hypatia', 'name:Sophie Germain'], - list_id: ['list-1', 'list-2', 'list-3'], - namespace_type: ['single', 'single', 'agnostic'], - page: 1, - per_page: 25, - search: undefined, - sort_field: undefined, - sort_order: undefined, - }); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_item_schema/index.test.ts deleted file mode 100644 index da9c98d48e62b..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_item_schema/index.test.ts +++ /dev/null @@ -1,150 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { LIST_ID } from '../../constants/index.mock'; - -import { - getFindExceptionListItemSchemaDecodedMock, - getFindExceptionListItemSchemaDecodedMultipleMock, - getFindExceptionListItemSchemaMock, - getFindExceptionListItemSchemaMultipleMock, -} from './index.mock'; -import { - FindExceptionListItemSchema, - FindExceptionListItemSchemaDecoded, - findExceptionListItemSchema, -} from '.'; - -describe('find_list_item_schema', () => { - test('it should validate a typical find item request', () => { - const payload = getFindExceptionListItemSchemaMock(); - const decoded = findExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getFindExceptionListItemSchemaDecodedMock()); - }); - - test('it should validate a typical find item request with multiple input strings turned into array elements', () => { - const payload = getFindExceptionListItemSchemaMultipleMock(); - const decoded = findExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getFindExceptionListItemSchemaDecodedMultipleMock()); - }); - - test('it should validate just a list_id where it decodes into an array for list_id and adds a namespace_type of "single" as an array', () => { - const payload: FindExceptionListItemSchema = { list_id: LIST_ID }; - const decoded = findExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected: FindExceptionListItemSchemaDecoded = { - filter: [], - list_id: [LIST_ID], - namespace_type: ['single'], - page: undefined, - per_page: undefined, - search: undefined, - sort_field: undefined, - sort_order: undefined, - }; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with page missing', () => { - const payload = getFindExceptionListItemSchemaMock(); - delete payload.page; - const decoded = findExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindExceptionListItemSchemaDecodedMock(); - delete expected.page; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with per_page missing', () => { - const payload = getFindExceptionListItemSchemaMock(); - delete payload.per_page; - const decoded = findExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindExceptionListItemSchemaDecodedMock(); - delete expected.per_page; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with filter missing and add filter as an empty array', () => { - const payload = getFindExceptionListItemSchemaMock(); - delete payload.filter; - const decoded = findExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected: FindExceptionListItemSchemaDecoded = { - ...getFindExceptionListItemSchemaDecodedMock(), - filter: [], - }; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with sort_field missing', () => { - const payload = getFindExceptionListItemSchemaMock(); - delete payload.sort_field; - const decoded = findExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindExceptionListItemSchemaDecodedMock(); - delete expected.sort_field; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with sort_order missing', () => { - const payload = getFindExceptionListItemSchemaMock(); - delete payload.sort_order; - const decoded = findExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindExceptionListItemSchemaDecodedMock(); - delete expected.sort_order; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with search missing', () => { - const payload = getFindExceptionListItemSchemaMock(); - delete payload.search; - const decoded = findExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindExceptionListItemSchemaDecodedMock(); - delete expected.search; - expect(message.schema).toEqual(expected); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: FindExceptionListItemSchema & { - extraKey: string; - } = { ...getFindExceptionListItemSchemaMock(), extraKey: 'some new value' }; - const decoded = findExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_item_schema/index.ts deleted file mode 100644 index 88258538e0311..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_item_schema/index.ts +++ /dev/null @@ -1,55 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { - EmptyStringArray, - EmptyStringArrayDecoded, - NonEmptyStringArray, - StringToPositiveNumber, -} from '@kbn/securitysolution-io-ts-types'; - -import { - DefaultNamespaceArray, - DefaultNamespaceArrayTypeDecoded, -} from '../../common/default_namespace_array'; -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { sort_field } from '../../common/sort_field'; -import { sort_order } from '../../common/sort_order'; -import { search } from '../../common/search'; - -export const findExceptionListItemSchema = t.intersection([ - t.exact( - t.type({ - list_id: NonEmptyStringArray, - }) - ), - t.exact( - t.partial({ - filter: EmptyStringArray, // defaults to an empty array [] if not set during decode - namespace_type: DefaultNamespaceArray, // defaults to ['single'] if not set during decode - page: StringToPositiveNumber, // defaults to undefined if not set during decode - per_page: StringToPositiveNumber, // defaults to undefined if not set during decode - search, - sort_field, // defaults to undefined if not set during decode - sort_order, // defaults to undefined if not set during decode - }) - ), -]); - -export type FindExceptionListItemSchema = t.OutputOf<typeof findExceptionListItemSchema>; - -// This type is used after a decode since some things are defaults after a decode. -export type FindExceptionListItemSchemaDecoded = Omit< - RequiredKeepUndefined<t.TypeOf<typeof findExceptionListItemSchema>>, - 'namespace_type' | 'filter' -> & { - filter: EmptyStringArrayDecoded; - namespace_type: DefaultNamespaceArrayTypeDecoded; -}; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_schema/index.mock.ts deleted file mode 100644 index 0b8c9e3db9bb1..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_schema/index.mock.ts +++ /dev/null @@ -1,30 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { FILTER, NAMESPACE_TYPE } from '../../constants/index.mock'; - -import { FindExceptionListSchema, FindExceptionListSchemaDecoded } from '.'; - -export const getFindExceptionListSchemaMock = (): FindExceptionListSchema => ({ - filter: FILTER, - namespace_type: NAMESPACE_TYPE, - page: '1', - per_page: '25', - sort_field: undefined, - sort_order: undefined, -}); - -export const getFindExceptionListSchemaDecodedMock = (): FindExceptionListSchemaDecoded => ({ - filter: FILTER, - namespace_type: [NAMESPACE_TYPE], - page: 1, - per_page: 25, - sort_field: undefined, - sort_order: undefined, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_schema/index.test.ts deleted file mode 100644 index fd105d3d2f61e..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_schema/index.test.ts +++ /dev/null @@ -1,121 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { - getFindExceptionListSchemaDecodedMock, - getFindExceptionListSchemaMock, -} from './index.mock'; -import { - FindExceptionListSchema, - FindExceptionListSchemaDecoded, - findExceptionListSchema, -} from '.'; - -describe('find_exception_list_schema', () => { - test('it should validate a typical find item request', () => { - const payload = getFindExceptionListSchemaMock(); - const decoded = findExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getFindExceptionListSchemaDecodedMock()); - }); - - test('it should validate and empty object since everything is optional and will respond only with namespace_type filled out to be "single"', () => { - const payload: FindExceptionListSchema = {}; - const decoded = findExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected: FindExceptionListSchemaDecoded = { - filter: undefined, - namespace_type: ['single'], - page: undefined, - per_page: undefined, - sort_field: undefined, - sort_order: undefined, - }; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with page missing', () => { - const payload = getFindExceptionListSchemaMock(); - delete payload.page; - const decoded = findExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindExceptionListSchemaDecodedMock(); - delete expected.page; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with pre_page missing', () => { - const payload = getFindExceptionListSchemaMock(); - delete payload.per_page; - const decoded = findExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindExceptionListSchemaDecodedMock(); - delete expected.per_page; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with filter missing', () => { - const payload = getFindExceptionListSchemaMock(); - delete payload.filter; - const decoded = findExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindExceptionListSchemaDecodedMock(); - delete expected.filter; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with sort_field missing', () => { - const payload = getFindExceptionListSchemaMock(); - delete payload.sort_field; - const decoded = findExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindExceptionListSchemaDecodedMock(); - delete expected.sort_field; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with sort_order missing', () => { - const payload = getFindExceptionListSchemaMock(); - delete payload.sort_order; - const decoded = findExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindExceptionListSchemaDecodedMock(); - delete expected.sort_order; - expect(message.schema).toEqual(expected); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: FindExceptionListSchema & { - extraKey: string; - } = { ...getFindExceptionListSchemaMock(), extraKey: 'some new value' }; - const decoded = findExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_schema/index.ts deleted file mode 100644 index 1e22f752d0142..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_schema/index.ts +++ /dev/null @@ -1,38 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { StringToPositiveNumber } from '@kbn/securitysolution-io-ts-types'; - -import { DefaultNamespaceArray, NamespaceTypeArray } from '../../common/default_namespace_array'; -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { filter } from '../../common/filter'; -import { sort_field } from '../../common/sort_field'; -import { sort_order } from '../../common/sort_order'; - -export const findExceptionListSchema = t.exact( - t.partial({ - filter, // defaults to undefined if not set during decode - namespace_type: DefaultNamespaceArray, // defaults to 'single' if not set during decode - page: StringToPositiveNumber, // defaults to undefined if not set during decode - per_page: StringToPositiveNumber, // defaults to undefined if not set during decode - sort_field, // defaults to undefined if not set during decode - sort_order, // defaults to undefined if not set during decode - }) -); - -export type FindExceptionListSchema = t.OutputOf<typeof findExceptionListSchema>; - -// This type is used after a decode since some things are defaults after a decode. -export type FindExceptionListSchemaDecoded = Omit< - RequiredKeepUndefined<t.TypeOf<typeof findExceptionListSchema>>, - 'namespace_type' -> & { - namespace_type: NamespaceTypeArray; -}; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_item_schema/index.mock.ts deleted file mode 100644 index 601406ce3e37e..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_item_schema/index.mock.ts +++ /dev/null @@ -1,32 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { CURSOR, FILTER, LIST_ID } from '../../constants/index.mock'; - -import { FindListItemSchema, FindListItemSchemaDecoded } from '.'; - -export const getFindListItemSchemaMock = (): FindListItemSchema => ({ - cursor: CURSOR, - filter: FILTER, - list_id: LIST_ID, - page: '1', - per_page: '25', - sort_field: undefined, - sort_order: undefined, -}); - -export const getFindListItemSchemaDecodedMock = (): FindListItemSchemaDecoded => ({ - cursor: CURSOR, - filter: FILTER, - list_id: LIST_ID, - page: 1, - per_page: 25, - sort_field: undefined, - sort_order: undefined, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_item_schema/index.test.ts deleted file mode 100644 index b80629f8546b5..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_item_schema/index.test.ts +++ /dev/null @@ -1,105 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { LIST_ID } from '../../constants/index.mock'; - -import { FindListItemSchema, FindListItemSchemaDecoded, findListItemSchema } from '.'; -import { getFindListItemSchemaDecodedMock, getFindListItemSchemaMock } from './index.mock'; - -describe('find_list_item_schema', () => { - test('it should validate a typical find item request', () => { - const payload = getFindListItemSchemaMock(); - const decoded = findListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getFindListItemSchemaDecodedMock()); - }); - - test('it should validate just a list_id where it decodes into an array for list_id and adds a namespace_type of "single"', () => { - const payload: FindListItemSchema = { list_id: LIST_ID }; - const decoded = findListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected: FindListItemSchemaDecoded = { - cursor: undefined, - filter: undefined, - list_id: LIST_ID, - page: undefined, - per_page: undefined, - sort_field: undefined, - sort_order: undefined, - }; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with page missing', () => { - const payload = getFindListItemSchemaMock(); - delete payload.page; - const decoded = findListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindListItemSchemaDecodedMock(); - delete expected.page; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with pre_page missing', () => { - const payload = getFindListItemSchemaMock(); - delete payload.per_page; - const decoded = findListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindListItemSchemaDecodedMock(); - delete expected.per_page; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with sort_field missing', () => { - const payload = getFindListItemSchemaMock(); - delete payload.sort_field; - const decoded = findListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindListItemSchemaDecodedMock(); - delete expected.sort_field; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with sort_order missing', () => { - const payload = getFindListItemSchemaMock(); - delete payload.sort_order; - const decoded = findListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindListItemSchemaDecodedMock(); - delete expected.sort_order; - expect(message.schema).toEqual(expected); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: FindListItemSchema & { - extraKey: string; - } = { ...getFindListItemSchemaMock(), extraKey: 'some new value' }; - const decoded = findListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_item_schema/index.ts deleted file mode 100644 index 4509f6bc973bf..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_item_schema/index.ts +++ /dev/null @@ -1,37 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { StringToPositiveNumber } from '@kbn/securitysolution-io-ts-types'; -import { filter } from '../../common/filter'; -import { cursor } from '../../common/cursor'; -import { sort_field } from '../../common/sort_field'; -import { sort_order } from '../../common/sort_order'; -import { list_id } from '../../common/list_id'; -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; - -export const findListItemSchema = t.intersection([ - t.exact(t.type({ list_id })), - t.exact( - t.partial({ - cursor, // defaults to undefined if not set during decode - filter, // defaults to undefined if not set during decode - page: StringToPositiveNumber, // defaults to undefined if not set during decode - per_page: StringToPositiveNumber, // defaults to undefined if not set during decode - sort_field, // defaults to undefined if not set during decode - sort_order, // defaults to undefined if not set during decode - }) - ), -]); - -export type FindListItemSchema = t.OutputOf<typeof findListItemSchema>; - -// This type is used after a decode since some things are defaults after a decode. -export type FindListItemSchemaDecoded = RequiredKeepUndefined<t.TypeOf<typeof findListItemSchema>>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_schema/index.mock.ts deleted file mode 100644 index 48c9671e4ac17..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_schema/index.mock.ts +++ /dev/null @@ -1,29 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { FILTER } from '../../constants/index.mock'; - -import { FindListSchema, FindListSchemaEncoded } from '.'; - -export const getFindListSchemaMock = (): FindListSchemaEncoded => ({ - filter: FILTER, - page: '1', - per_page: '25', - sort_field: undefined, - sort_order: undefined, -}); - -export const getFindListSchemaDecodedMock = (): FindListSchema => ({ - cursor: undefined, - filter: FILTER, - page: 1, - per_page: 25, - sort_field: undefined, - sort_order: undefined, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_schema/index.test.ts deleted file mode 100644 index ba03ddcb85269..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_schema/index.test.ts +++ /dev/null @@ -1,106 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getFindListSchemaDecodedMock, getFindListSchemaMock } from './index.mock'; -import { FindListSchemaEncoded, findListSchema } from '.'; - -describe('find_list_schema', () => { - test('it should validate a typical find item request', () => { - const payload = getFindListSchemaMock(); - const decoded = findListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getFindListSchemaDecodedMock()); - }); - - test('it should validate and empty object since everything is optional and will respond with an empty object', () => { - const payload: FindListSchemaEncoded = {}; - const decoded = findListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should validate with page missing', () => { - const payload = getFindListSchemaMock(); - delete payload.page; - const decoded = findListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindListSchemaDecodedMock(); - delete expected.page; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with pre_page missing', () => { - const payload = getFindListSchemaMock(); - delete payload.per_page; - const decoded = findListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindListSchemaDecodedMock(); - delete expected.per_page; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with filter missing', () => { - const payload = getFindListSchemaMock(); - delete payload.filter; - const decoded = findListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindListSchemaDecodedMock(); - delete expected.filter; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with sort_field missing', () => { - const payload = getFindListSchemaMock(); - delete payload.sort_field; - const decoded = findListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindListSchemaDecodedMock(); - delete expected.sort_field; - expect(message.schema).toEqual(expected); - }); - - test('it should validate with sort_order missing', () => { - const payload = getFindListSchemaMock(); - delete payload.sort_order; - const decoded = findListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - const expected = getFindListSchemaDecodedMock(); - delete expected.sort_order; - expect(message.schema).toEqual(expected); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: FindListSchemaEncoded & { - extraKey: string; - } = { ...getFindListSchemaMock(), extraKey: 'some new value' }; - const decoded = findListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_schema/index.ts deleted file mode 100644 index 8b33ffc6a9470..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_schema/index.ts +++ /dev/null @@ -1,31 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { StringToPositiveNumber } from '@kbn/securitysolution-io-ts-types'; -import { cursor } from '../../common/cursor'; -import { filter } from '../../common/filter'; -import { sort_field } from '../../common/sort_field'; -import { sort_order } from '../../common/sort_order'; -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; - -export const findListSchema = t.exact( - t.partial({ - cursor, // defaults to undefined if not set during decode - filter, // defaults to undefined if not set during decode - page: StringToPositiveNumber, // defaults to undefined if not set during decode - per_page: StringToPositiveNumber, // defaults to undefined if not set during decode - sort_field, // defaults to undefined if not set during decode - sort_order, // defaults to undefined if not set during decode - }) -); - -export type FindListSchema = RequiredKeepUndefined<t.TypeOf<typeof findListSchema>>; -export type FindListSchemaEncoded = t.OutputOf<typeof findListSchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/get_exception_filter_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/get_exception_filter_schema/index.ts deleted file mode 100644 index 58c93b697a850..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/get_exception_filter_schema/index.ts +++ /dev/null @@ -1,40 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { namespaceType } from '../../common/default_namespace'; -import { exceptionListItemSchema } from '../../response'; -import { createExceptionListItemSchema } from '../create_exception_list_item_schema'; - -const exceptionListId = t.type({ - exception_list_id: t.string, - namespace_type: namespaceType, -}); - -export const exceptionListIds = t.type({ - exception_list_ids: t.array(exceptionListId), - type: t.literal('exception_list_ids'), -}); - -export const exceptions = t.type({ - exceptions: t.array(t.union([exceptionListItemSchema, createExceptionListItemSchema])), - type: t.literal('exception_items'), -}); - -const optionalExceptionParams = t.exact( - t.partial({ alias: t.string, chunk_size: t.number, exclude_exceptions: t.boolean }) -); - -export const getExceptionFilterSchema = t.intersection([ - t.union([exceptions, exceptionListIds]), - optionalExceptionParams, -]); - -export type GetExceptionFilterSchema = t.TypeOf<typeof getExceptionFilterSchema>; -export type ExceptionListId = t.TypeOf<typeof exceptionListId>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.mock.ts deleted file mode 100644 index e66b805de4967..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.mock.ts +++ /dev/null @@ -1,36 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ENTRIES } from '../../constants/index.mock'; -import { ImportExceptionListItemSchema, ImportExceptionListItemSchemaDecoded } from '.'; - -export const getImportExceptionsListItemSchemaMock = ( - itemId = 'item_id_1', - listId = 'detection_list_id' -): ImportExceptionListItemSchema => ({ - description: 'some description', - entries: ENTRIES, - item_id: itemId, - list_id: listId, - name: 'Query with a rule id', - type: 'simple', -}); - -export const getImportExceptionsListItemSchemaDecodedMock = ( - itemId = 'item_id_1', - listId = 'detection_list_id' -): ImportExceptionListItemSchemaDecoded => ({ - ...getImportExceptionsListItemSchemaMock(itemId, listId), - comments: [], - meta: undefined, - namespace_type: 'single', - os_types: [], - tags: [], - expire_time: undefined, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.test.ts deleted file mode 100644 index 58b9bce4c4108..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.test.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { importExceptionListItemSchema, ImportExceptionListItemSchema } from '.'; -import { - getImportExceptionsListItemSchemaDecodedMock, - getImportExceptionsListItemSchemaMock, -} from './index.mock'; -import { getCommentsArrayMock } from '../../common/comment/index.mock'; - -describe('import_list_item_schema', () => { - test('it should validate a typical item request', () => { - const payload = getImportExceptionsListItemSchemaMock(); - const decoded = importExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getImportExceptionsListItemSchemaDecodedMock()); - }); - - test('it should validate a typical item request with comments', () => { - const payload = { - ...getImportExceptionsListItemSchemaMock(), - comments: getCommentsArrayMock(), - }; - const decoded = importExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual({ - ...getImportExceptionsListItemSchemaDecodedMock(), - comments: [ - { - comment: 'some old comment', - created_at: '2020-04-20T15:25:31.830Z', - created_by: 'some user', - id: 'uuid_here', - }, - { - comment: 'some old comment', - created_at: '2020-04-20T15:25:31.830Z', - created_by: 'some user', - id: 'uuid_here', - }, - ], - }); - }); - - test('it should NOT accept an undefined for "item_id"', () => { - const payload: Partial<ReturnType<typeof getImportExceptionsListItemSchemaMock>> = - getImportExceptionsListItemSchemaMock(); - delete payload.item_id; - const decoded = importExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "item_id"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "list_id"', () => { - const payload: Partial<ReturnType<typeof getImportExceptionsListItemSchemaMock>> = - getImportExceptionsListItemSchemaMock(); - delete payload.list_id; - const decoded = importExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "list_id"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "description"', () => { - const payload: Partial<ReturnType<typeof getImportExceptionsListItemSchemaMock>> = - getImportExceptionsListItemSchemaMock(); - delete payload.description; - const decoded = importExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "description"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "name"', () => { - const payload: Partial<ReturnType<typeof getImportExceptionsListItemSchemaMock>> = - getImportExceptionsListItemSchemaMock(); - delete payload.name; - const decoded = importExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "name"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "type"', () => { - const payload: Partial<ReturnType<typeof getImportExceptionsListItemSchemaMock>> = - getImportExceptionsListItemSchemaMock(); - delete payload.type; - const decoded = importExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "type"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "entries"', () => { - const payload: Partial<ReturnType<typeof getImportExceptionsListItemSchemaMock>> = - getImportExceptionsListItemSchemaMock(); - delete payload.entries; - const decoded = importExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "entries"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should accept any partial fields', () => { - const payload: ImportExceptionListItemSchema = { - ...getImportExceptionsListItemSchemaMock(), - id: '123', - namespace_type: 'single', - comments: [], - os_types: [], - tags: ['123'], - created_at: '2018-08-24T17:49:30.145142000', - created_by: 'elastic', - updated_at: '2018-08-24T17:49:30.145142000', - updated_by: 'elastic', - tie_breaker_id: '123', - _version: '3', - meta: undefined, - }; - - const decoded = importExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: ImportExceptionListItemSchema & { - extraKey?: string; - } = getImportExceptionsListItemSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = importExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.ts deleted file mode 100644 index 9b0762005f3af..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.ts +++ /dev/null @@ -1,90 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { OsTypeArray, osTypeArrayOrUndefined } from '../../common/os_type'; -import { Tags } from '../../common/tags'; -import { NamespaceType } from '../../common/default_namespace'; -import { name } from '../../common/name'; -import { description } from '../../common/description'; -import { namespace_type } from '../../common/namespace_type'; -import { tags } from '../../common/tags'; -import { meta } from '../../common/meta'; -import { list_id } from '../../common/list_id'; -import { item_id } from '../../common/item_id'; -import { id } from '../../common/id'; -import { created_at } from '../../common/created_at'; -import { created_by } from '../../common/created_by'; -import { updated_at } from '../../common/updated_at'; -import { updated_by } from '../../common/updated_by'; -import { _version } from '../../common/underscore_version'; -import { tie_breaker_id } from '../../common/tie_breaker_id'; -import { nonEmptyEntriesArray } from '../../common/non_empty_entries_array'; -import { exceptionListItemType } from '../../common/exception_list_item_type'; -import { ItemId } from '../../common/item_id'; -import { EntriesArray } from '../../common/entries'; -import { DefaultImportCommentsArray } from '../../common/default_import_comments_array'; -import { ExpireTimeOrUndefined, expireTimeOrUndefined, ImportCommentsArray } from '../../common'; - -/** - * Differences from this and the createExceptionsListItemSchema are - * - item_id is required - * - id is optional (but ignored in the import code - item_id is exclusively used for imports) - * - immutable is optional but if it is any value other than false it will be rejected - * - created_at is optional (but ignored in the import code) - * - updated_at is optional (but ignored in the import code) - * - created_by is optional (but ignored in the import code) - * - updated_by is optional (but ignored in the import code) - */ -export const importExceptionListItemSchema = t.intersection([ - t.exact( - t.type({ - description, - entries: nonEmptyEntriesArray, - item_id, - list_id, - name, - type: exceptionListItemType, - }) - ), - t.exact( - t.partial({ - id, // defaults to undefined if not set during decode - comments: DefaultImportCommentsArray, // defaults to empty array if not set during decode - created_at, // defaults undefined if not set during decode - updated_at, // defaults undefined if not set during decode - created_by, // defaults undefined if not set during decode - updated_by, // defaults undefined if not set during decode - _version, // defaults to undefined if not set during decode - tie_breaker_id, - meta, // defaults to undefined if not set during decode - namespace_type, // defaults to 'single' if not set during decode - os_types: osTypeArrayOrUndefined, // defaults to empty array if not set during decode - tags, // defaults to empty array if not set during decode - expire_time: expireTimeOrUndefined, - }) - ), -]); - -export type ImportExceptionListItemSchema = t.OutputOf<typeof importExceptionListItemSchema>; - -// This type is used after a decode since some things are defaults after a decode. -export type ImportExceptionListItemSchemaDecoded = Omit< - ImportExceptionListItemSchema, - 'tags' | 'item_id' | 'entries' | 'namespace_type' | 'comments' | 'expire_time' -> & { - comments: ImportCommentsArray; - tags: Tags; - item_id: ItemId; - entries: EntriesArray; - namespace_type: NamespaceType; - os_types: OsTypeArray; - expire_time: ExpireTimeOrUndefined; -}; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_list_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_list_schema/index.mock.ts deleted file mode 100644 index 5bf263beb3720..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_list_schema/index.mock.ts +++ /dev/null @@ -1,31 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ImportExceptionListSchemaDecoded, ImportExceptionsListSchema } from '.'; - -export const getImportExceptionsListSchemaMock = ( - listId = 'detection_list_id' -): ImportExceptionsListSchema => ({ - description: 'some description', - list_id: listId, - name: 'Query with a rule id', - type: 'detection', -}); - -export const getImportExceptionsListSchemaDecodedMock = ( - listId = 'detection_list_id' -): ImportExceptionListSchemaDecoded => ({ - ...getImportExceptionsListSchemaMock(listId), - immutable: false, - meta: undefined, - namespace_type: 'single', - os_types: [], - tags: [], - version: 1, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_list_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_list_schema/index.test.ts deleted file mode 100644 index 677e089fe1efe..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_list_schema/index.test.ts +++ /dev/null @@ -1,133 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { importExceptionsListSchema, ImportExceptionsListSchema } from '.'; -import { - getImportExceptionsListSchemaMock, - getImportExceptionsListSchemaDecodedMock, -} from './index.mock'; - -describe('import_list_item_schema', () => { - test('it should validate a typical lists request', () => { - const payload = getImportExceptionsListSchemaMock(); - const decoded = importExceptionsListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getImportExceptionsListSchemaDecodedMock()); - }); - - test('it should NOT accept an undefined for "list_id"', () => { - const payload: Partial<ReturnType<typeof getImportExceptionsListSchemaMock>> = - getImportExceptionsListSchemaMock(); - delete payload.list_id; - const decoded = importExceptionsListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "list_id"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "description"', () => { - const payload: Partial<ReturnType<typeof getImportExceptionsListSchemaMock>> = - getImportExceptionsListSchemaMock(); - delete payload.description; - const decoded = importExceptionsListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "description"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "name"', () => { - const payload: Partial<ReturnType<typeof getImportExceptionsListSchemaMock>> = - getImportExceptionsListSchemaMock(); - delete payload.name; - const decoded = importExceptionsListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "name"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "type"', () => { - const payload: Partial<ReturnType<typeof getImportExceptionsListSchemaMock>> = - getImportExceptionsListSchemaMock(); - delete payload.type; - const decoded = importExceptionsListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "type"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept value of "true" for "immutable"', () => { - const payload: ImportExceptionsListSchema = { - ...getImportExceptionsListSchemaMock(), - immutable: true, - }; - - const decoded = importExceptionsListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "true" supplied to "immutable"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should accept any partial fields', () => { - const payload: ImportExceptionsListSchema = { - ...getImportExceptionsListSchemaMock(), - namespace_type: 'single', - immutable: false, - os_types: [], - tags: ['123'], - created_at: '2018-08-24T17:49:30.145142000', - created_by: 'elastic', - updated_at: '2018-08-24T17:49:30.145142000', - updated_by: 'elastic', - version: 3, - tie_breaker_id: '123', - _version: '3', - meta: undefined, - }; - - const decoded = importExceptionsListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: ImportExceptionsListSchema & { - extraKey?: string; - } = getImportExceptionsListSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = importExceptionsListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_list_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_list_schema/index.ts deleted file mode 100644 index 9c0584aa267e1..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_list_schema/index.ts +++ /dev/null @@ -1,88 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { - DefaultVersionNumber, - DefaultVersionNumberDecoded, - OnlyFalseAllowed, -} from '@kbn/securitysolution-io-ts-types'; - -import { exceptionListType } from '../../common/exception_list'; -import { OsTypeArray, osTypeArrayOrUndefined } from '../../common/os_type'; -import { Tags } from '../../common/tags'; -import { ListId } from '../../common/list_id'; -import { NamespaceType } from '../../common/default_namespace'; -import { name } from '../../common/name'; -import { description } from '../../common/description'; -import { namespace_type } from '../../common/namespace_type'; -import { tags } from '../../common/tags'; -import { meta } from '../../common/meta'; -import { list_id } from '../../common/list_id'; -import { id } from '../../common/id'; -import { created_at } from '../../common/created_at'; -import { created_by } from '../../common/created_by'; -import { updated_at } from '../../common/updated_at'; -import { updated_by } from '../../common/updated_by'; -import { _version } from '../../common/underscore_version'; -import { tie_breaker_id } from '../../common/tie_breaker_id'; - -/** - * Differences from this and the createExceptionsSchema are - * - list_id is required - * - id is optional (but ignored in the import code - list_id is exclusively used for imports) - * - immutable is optional but if it is any value other than false it will be rejected - * - created_at is optional (but ignored in the import code) - * - updated_at is optional (but ignored in the import code) - * - created_by is optional (but ignored in the import code) - * - updated_by is optional (but ignored in the import code) - */ -export const importExceptionsListSchema = t.intersection([ - t.exact( - t.type({ - description, - name, - type: exceptionListType, - list_id, - }) - ), - t.exact( - t.partial({ - id, // defaults to undefined if not set during decode - immutable: OnlyFalseAllowed, - meta, // defaults to undefined if not set during decode - namespace_type, // defaults to 'single' if not set during decode - os_types: osTypeArrayOrUndefined, // defaults to empty array if not set during decode - tags, // defaults to empty array if not set during decode - created_at, // defaults "undefined" if not set during decode - updated_at, // defaults "undefined" if not set during decode - created_by, // defaults "undefined" if not set during decode - updated_by, // defaults "undefined" if not set during decode - _version, // defaults to undefined if not set during decode - tie_breaker_id, - version: DefaultVersionNumber, // defaults to numerical 1 if not set during decode - }) - ), -]); - -export type ImportExceptionsListSchema = t.TypeOf<typeof importExceptionsListSchema>; - -// This type is used after a decode since some things are defaults after a decode. -export type ImportExceptionListSchemaDecoded = Omit< - ImportExceptionsListSchema, - 'tags' | 'list_id' | 'namespace_type' | 'os_types' | 'immutable' -> & { - immutable: false; - tags: Tags; - list_id: ListId; - namespace_type: NamespaceType; - os_types: OsTypeArray; - version: DefaultVersionNumberDecoded; -}; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.mock.ts deleted file mode 100644 index 74a2122ff1dc4..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.mock.ts +++ /dev/null @@ -1,20 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { LIST_ID, TYPE } from '../../constants/index.mock'; - -import { ImportListItemQuerySchema } from '.'; - -export const getImportListItemQuerySchemaMock = (): ImportListItemQuerySchema => ({ - deserializer: undefined, - list_id: LIST_ID, - serializer: undefined, - type: TYPE, - refresh: 'false', -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.test.ts deleted file mode 100644 index b0ec4f10af876..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.test.ts +++ /dev/null @@ -1,90 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { ImportListItemQuerySchema, importListItemQuerySchema } from '.'; -import { getImportListItemQuerySchemaMock } from './index.mock'; - -describe('import_list_item_schema', () => { - test('it should validate a typical lists request', () => { - const payload = getImportListItemQuerySchemaMock(); - const decoded = importListItemQuerySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "list_id"', () => { - const payload = getImportListItemQuerySchemaMock(); - delete payload.list_id; - const decoded = importListItemQuerySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "type"', () => { - const payload = getImportListItemQuerySchemaMock(); - delete payload.type; - const decoded = importListItemQuerySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "type" and "list_id', () => { - const payload = getImportListItemQuerySchemaMock(); - delete payload.type; - delete payload.list_id; - const decoded = importListItemQuerySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "serializer"', () => { - const payload = getImportListItemQuerySchemaMock(); - delete payload.serializer; - const decoded = importListItemQuerySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "deserializer"', () => { - const payload = getImportListItemQuerySchemaMock(); - delete payload.deserializer; - const decoded = importListItemQuerySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: ImportListItemQuerySchema & { - extraKey?: string; - } = getImportListItemQuerySchemaMock(); - payload.extraKey = 'some new value'; - const decoded = importListItemQuerySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.ts deleted file mode 100644 index e34d94c498662..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.ts +++ /dev/null @@ -1,26 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { deserializer } from '../../common/deserializer'; -import { list_id } from '../../common/list_id'; -import { type } from '../../common/type'; -import { serializer } from '../../common/serializer'; -import { refreshWithWaitFor } from '../../common/refresh'; - -export const importListItemQuerySchema = t.exact( - t.partial({ deserializer, list_id, serializer, type, refresh: refreshWithWaitFor }) -); - -export type ImportListItemQuerySchema = RequiredKeepUndefined< - t.TypeOf<typeof importListItemQuerySchema> ->; -export type ImportListItemQuerySchemaEncoded = t.OutputOf<typeof importListItemQuerySchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_schema/index.mock.ts deleted file mode 100644 index 15dd19d4bdefd..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_schema/index.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ImportListItemSchema } from '.'; - -export const getImportListItemSchemaMock = (): ImportListItemSchema => ({ - file: {}, -}); - -/** - * This is useful for end to end tests, it will return a buffer given a string array - * of things to import. - * @param input Array of strings of things to import - */ -export const getImportListItemAsBuffer = (input: string[]): Buffer => { - return Buffer.from(input.join('\r\n')); -}; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_schema/index.test.ts deleted file mode 100644 index c4841f394f8d1..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_schema/index.test.ts +++ /dev/null @@ -1,52 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { ImportListItemSchema, importListItemSchema } from '.'; -import { getImportListItemSchemaMock } from './index.mock'; - -describe('import_list_item_schema', () => { - test('it should validate a typical lists request', () => { - const payload = getImportListItemSchemaMock(); - const decoded = importListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept an undefined for a file', () => { - const payload = getImportListItemSchemaMock(); - // @ts-expect-error - delete payload.file; - const decoded = importListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "file"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: ImportListItemSchema & { - extraKey?: string; - } = getImportListItemSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = importListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_schema/index.ts deleted file mode 100644 index 45dbf838e5871..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_schema/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { file } from '../../common/file'; - -export const importListItemSchema = t.exact( - t.type({ - file, - }) -); - -export type ImportListItemSchema = RequiredKeepUndefined<t.TypeOf<typeof importListItemSchema>>; -export type ImportListItemSchemaEncoded = t.OutputOf<typeof importListItemSchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/index.ts deleted file mode 100644 index 3d21a5ffdcb24..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/index.ts +++ /dev/null @@ -1,49 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './create_endpoint_list_item_schema'; -export * from './create_exception_list_item_schema'; -export * from './create_exception_list_schema'; -export * from './create_rule_exception_item_schema'; -export * from './create_list_item_schema'; -export * from './create_list_schema'; -export * from './delete_endpoint_list_item_schema'; -export * from './delete_exception_list_schema'; -export * from './delete_exception_list_item_schema'; -export * from './delete_list_item_schema'; -export * from './delete_list_schema'; -export * from './duplicate_exception_list_query_schema'; -export * from './export_exception_list_query_schema'; -export * from './export_list_item_query_schema'; -export * from './find_endpoint_list_item_schema'; -export * from './find_exception_list_schema'; -export * from './find_exception_list_item_schema'; -export * from './find_list_item_schema'; -export * from './find_list_schema'; -export * from './get_exception_filter_schema'; -export * from './import_list_item_query_schema'; -export * from './import_exception_list_schema'; -export * from './import_exception_item_schema'; -export * from './import_list_item_schema'; -export * from './patch_list_item_schema'; -export * from './patch_list_schema'; -export * from './read_endpoint_list_item_schema'; -export * from './read_exception_list_item_schema'; -export * from './read_exception_list_schema'; -export * from './read_list_item_schema'; -export * from './read_list_schema'; -export * from './summary_exception_list_schema'; -export * from './update_endpoint_list_item_schema'; -export * from './update_exception_list_item_schema'; -export * from './update_exception_list_schema'; -export * from './update_list_item_schema'; -export * from './update_list_schema'; - -// Internal routes -export * from './internal/create_exception_list_schema'; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/internal/create_exception_list_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/internal/create_exception_list_schema/index.test.ts deleted file mode 100644 index 4a4a090723c39..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/internal/create_exception_list_schema/index.test.ts +++ /dev/null @@ -1,70 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; - -import { ExceptionListTypeEnum } from '../../../common/exception_list'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { internalCreateExceptionListSchema } from '.'; -import { getCreateExceptionListSchemaMock } from '../../create_exception_list_schema/index.mock'; - -describe('create_exception_list_schema', () => { - test('it should accept artifact list_id', () => { - const payload = { - ...getCreateExceptionListSchemaMock(), - list_id: ExceptionListTypeEnum.ENDPOINT_BLOCKLISTS, - }; - const decoded = internalCreateExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - test('it should fail when invalid list_id', () => { - const payload = { - ...getCreateExceptionListSchemaMock(), - list_id: ExceptionListTypeEnum.DETECTION, - }; - const decoded = internalCreateExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "detection" supplied to "list_id"', - ]); - expect(message.schema).toEqual({}); - }); - test('it should accept artifact type', () => { - const payload = { - ...getCreateExceptionListSchemaMock(), - list_id: ExceptionListTypeEnum.ENDPOINT_BLOCKLISTS, - type: ExceptionListTypeEnum.ENDPOINT_BLOCKLISTS, - }; - const decoded = internalCreateExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - test('it should fail when invalid type', () => { - const payload = { - ...getCreateExceptionListSchemaMock(), - list_id: ExceptionListTypeEnum.ENDPOINT_BLOCKLISTS, - type: ExceptionListTypeEnum.DETECTION, - }; - const decoded = internalCreateExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "detection" supplied to "type"', - ]); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/internal/create_exception_list_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/internal/create_exception_list_schema/index.ts deleted file mode 100644 index 3aa11ba500502..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/internal/create_exception_list_schema/index.ts +++ /dev/null @@ -1,48 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ENDPOINT_ARTIFACT_LIST_IDS } from '@kbn/securitysolution-list-constants'; -import * as t from 'io-ts'; - -import { - createExceptionListSchema, - CreateExceptionListSchemaDecoded, -} from '../../create_exception_list_schema'; - -export const internalCreateExceptionListSchema = t.intersection([ - t.exact( - t.type({ - type: t.keyof({ - endpoint: null, - endpoint_events: null, - endpoint_host_isolation_exceptions: null, - endpoint_blocklists: null, - }), - }) - ), - t.exact( - t.partial({ - list_id: t.keyof( - ENDPOINT_ARTIFACT_LIST_IDS.reduce<Record<string, null>>((mapOfListIds, listId) => { - mapOfListIds[listId] = null; - - return mapOfListIds; - }, {}) - ), - }) - ), - createExceptionListSchema, -]); - -export type InternalCreateExceptionListSchema = t.OutputOf< - typeof internalCreateExceptionListSchema ->; - -// This type is used after a decode since some things are defaults after a decode. -export type InternalCreateExceptionListSchemaDecoded = CreateExceptionListSchemaDecoded; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_item_schema/index.mock.ts deleted file mode 100644 index ff156386baa93..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_item_schema/index.mock.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { LIST_ITEM_ID, META, VALUE } from '../../constants/index.mock'; - -import { PatchListItemSchema } from '.'; - -export const getPathListItemSchemaMock = (): PatchListItemSchema => ({ - id: LIST_ITEM_ID, - meta: META, - value: VALUE, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_item_schema/index.test.ts deleted file mode 100644 index fddeeaf0055c5..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_item_schema/index.test.ts +++ /dev/null @@ -1,83 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getPathListItemSchemaMock } from './index.mock'; -import { PatchListItemSchema, patchListItemSchema } from '.'; - -describe('patch_list_item_schema', () => { - test('it should validate a typical list item request', () => { - const payload = getPathListItemSchemaMock(); - const decoded = patchListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept an undefined for "id"', () => { - const payload = getPathListItemSchemaMock(); - // @ts-expect-error - delete payload.id; - const decoded = patchListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "undefined" supplied to "id"']); - expect(message.schema).toEqual({}); - }); - - test('it should accept an undefined for "meta"', () => { - const payload = getPathListItemSchemaMock(); - delete payload.meta; - const decoded = patchListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "value"', () => { - const payload = getPathListItemSchemaMock(); - delete payload.value; - const decoded = patchListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "meta" and "value"', () => { - const payload = getPathListItemSchemaMock(); - delete payload.meta; - delete payload.value; - const decoded = patchListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: PatchListItemSchema & { extraKey?: string } = getPathListItemSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = patchListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_item_schema/index.ts deleted file mode 100644 index 96b50702d99b2..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_item_schema/index.ts +++ /dev/null @@ -1,31 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { _version } from '../../common/underscore_version'; -import { id } from '../../common/id'; -import { meta } from '../../common/meta'; -import { value } from '../../common/value'; -import { refresh } from '../../common/refresh'; - -export const patchListItemSchema = t.intersection([ - t.exact( - t.type({ - id, - }) - ), - t.exact(t.partial({ _version, meta, value, refresh })), -]); - -export type PatchListItemSchema = t.OutputOf<typeof patchListItemSchema>; -export type PatchListItemSchemaDecoded = RequiredKeepUndefined< - t.TypeOf<typeof patchListItemSchema> ->; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_schema/index.mock.ts deleted file mode 100644 index 818dd4e79e98f..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_schema/index.mock.ts +++ /dev/null @@ -1,19 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { DESCRIPTION, LIST_ITEM_ID, META, NAME } from '../../constants/index.mock'; - -import { PatchListSchema } from '.'; - -export const getPathListSchemaMock = (): PatchListSchema => ({ - description: DESCRIPTION, - id: LIST_ITEM_ID, - meta: META, - name: NAME, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_schema/index.test.ts deleted file mode 100644 index b79bfc8fddd65..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_schema/index.test.ts +++ /dev/null @@ -1,131 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getPathListSchemaMock } from './index.mock'; -import { PatchListSchema, patchListSchema } from '.'; - -describe('patch_list_schema', () => { - test('it should validate a typical list item request', () => { - const payload = getPathListSchemaMock(); - const decoded = patchListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept an undefined for "id"', () => { - const payload = getPathListSchemaMock(); - // @ts-expect-error - delete payload.id; - const decoded = patchListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "undefined" supplied to "id"']); - expect(message.schema).toEqual({}); - }); - - test('it should accept an undefined for "meta"', () => { - const payload = getPathListSchemaMock(); - delete payload.meta; - const decoded = patchListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "name"', () => { - const payload = getPathListSchemaMock(); - delete payload.name; - const decoded = patchListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "description"', () => { - const payload = getPathListSchemaMock(); - delete payload.description; - const decoded = patchListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "description", "meta", "name', () => { - const payload = getPathListSchemaMock(); - delete payload.description; - delete payload.name; - delete payload.meta; - const decoded = patchListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "description", "meta"', () => { - const payload = getPathListSchemaMock(); - delete payload.description; - delete payload.meta; - const decoded = patchListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "description", "name"', () => { - const payload = getPathListSchemaMock(); - delete payload.description; - delete payload.name; - const decoded = patchListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "meta", "name"', () => { - const payload = getPathListSchemaMock(); - delete payload.meta; - delete payload.name; - const decoded = patchListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: PatchListSchema & { extraKey?: string } = getPathListSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = patchListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_schema/index.ts deleted file mode 100644 index e5c477c844247..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_schema/index.ts +++ /dev/null @@ -1,38 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { version } from '@kbn/securitysolution-io-ts-types'; - -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { id } from '../../common/id'; -import { _version } from '../../common/underscore_version'; -import { meta } from '../../common/meta'; -import { name } from '../../common/name'; -import { description } from '../../common/description'; - -export const patchListSchema = t.intersection([ - t.exact( - t.type({ - id, - }) - ), - t.exact( - t.partial({ - _version, // is undefined if not set during decode - description, // is undefined if not set during decode - meta, // is undefined if not set during decode - name, // is undefined if not set during decode - version, // is undefined if not set during decode - }) - ), -]); - -export type PatchListSchema = t.OutputOf<typeof patchListSchema>; -export type PatchListSchemaDecoded = RequiredKeepUndefined<t.TypeOf<typeof patchListSchema>>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_endpoint_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/read_endpoint_list_item_schema/index.mock.ts deleted file mode 100644 index d7850f0cca32e..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_endpoint_list_item_schema/index.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ID, ITEM_ID } from '../../constants/index.mock'; - -import { ReadEndpointListItemSchema } from '.'; - -export const getReadEndpointListItemSchemaMock = (): ReadEndpointListItemSchema => ({ - id: ID, - item_id: ITEM_ID, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_endpoint_list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/read_endpoint_list_item_schema/index.test.ts deleted file mode 100644 index d9de257a31300..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_endpoint_list_item_schema/index.test.ts +++ /dev/null @@ -1,87 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getReadEndpointListItemSchemaMock } from './index.mock'; -import { ReadEndpointListItemSchema, readEndpointListItemSchema } from '.'; - -describe('read_endpoint_list_item_schema', () => { - test('it should validate a typical list request', () => { - const payload = getReadEndpointListItemSchemaMock(); - const decoded = readEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "id"', () => { - const payload = getReadEndpointListItemSchemaMock(); - delete payload.id; - const decoded = readEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "item_id"', () => { - const payload = getReadEndpointListItemSchemaMock(); - delete payload.item_id; - const decoded = readEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept "namespace_type" since endpoint list items do not need it', () => { - const payload: ReadEndpointListItemSchema & { - namespace_type: string; - } = { ...getReadEndpointListItemSchemaMock(), namespace_type: 'single' }; - // @ts-expect-error - delete payload.namespace_type; - const decoded = readEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getReadEndpointListItemSchemaMock()); - }); - - test('it should accept an undefined for "id", "item_id"', () => { - const payload = getReadEndpointListItemSchemaMock(); - delete payload.id; - delete payload.item_id; - const decoded = readEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: ReadEndpointListItemSchema & { - extraKey?: string; - } = getReadEndpointListItemSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = readEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_endpoint_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/read_endpoint_list_item_schema/index.ts deleted file mode 100644 index dbf3a59d79b3a..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_endpoint_list_item_schema/index.ts +++ /dev/null @@ -1,28 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { id } from '../../common/id'; -import { item_id } from '../../common/item_id'; - -export const readEndpointListItemSchema = t.exact( - t.partial({ - id, - item_id, - }) -); - -export type ReadEndpointListItemSchema = t.OutputOf<typeof readEndpointListItemSchema>; - -// This type is used after a decode since some things are defaults after a decode. -export type ReadEndpointListItemSchemaDecoded = RequiredKeepUndefined< - t.TypeOf<typeof readEndpointListItemSchema> ->; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_item_schema/index.mock.ts deleted file mode 100644 index 00e72dc68f5fc..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_item_schema/index.mock.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ID, ITEM_ID, NAMESPACE_TYPE } from '../../constants/index.mock'; - -import { ReadExceptionListItemSchema } from '.'; - -export const getReadExceptionListItemSchemaMock = (): ReadExceptionListItemSchema => ({ - id: ID, - item_id: ITEM_ID, - namespace_type: NAMESPACE_TYPE, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_item_schema/index.test.ts deleted file mode 100644 index e1c4615510305..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_item_schema/index.test.ts +++ /dev/null @@ -1,128 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getReadExceptionListItemSchemaMock } from './index.mock'; -import { ReadExceptionListItemSchema, readExceptionListItemSchema } from '.'; - -describe('read_exception_list_item_schema', () => { - test('it should validate a typical exception list request', () => { - const payload = getReadExceptionListItemSchemaMock(); - const decoded = readExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "id"', () => { - const payload = getReadExceptionListItemSchemaMock(); - delete payload.id; - const decoded = readExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "item_id"', () => { - const payload = getReadExceptionListItemSchemaMock(); - delete payload.item_id; - const decoded = readExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "namespace_type" but default to "single"', () => { - const payload = getReadExceptionListItemSchemaMock(); - delete payload.namespace_type; - const decoded = readExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getReadExceptionListItemSchemaMock()); - }); - - test('it should accept an undefined for "id", "item_id", "namespace_type" but default "namespace_type" to "single"', () => { - const payload = getReadExceptionListItemSchemaMock(); - delete payload.id; - delete payload.namespace_type; - delete payload.item_id; - const output = getReadExceptionListItemSchemaMock(); - delete output.id; - delete output.item_id; - const decoded = readExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(output); - }); - - test('it should accept an undefined for "id", "item_id"', () => { - const payload = getReadExceptionListItemSchemaMock(); - delete payload.id; - delete payload.item_id; - const decoded = readExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "id", "namespace_type" but default "namespace_type" to "single"', () => { - const payload = getReadExceptionListItemSchemaMock(); - delete payload.id; - delete payload.namespace_type; - const output = getReadExceptionListItemSchemaMock(); - delete output.id; - const decoded = readExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(output); - }); - - test('it should accept an undefined for "item_id", "namespace_type" but default "namespace_type" to "single"', () => { - const payload = getReadExceptionListItemSchemaMock(); - delete payload.namespace_type; - delete payload.item_id; - const output = getReadExceptionListItemSchemaMock(); - delete output.item_id; - const decoded = readExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(output); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: ReadExceptionListItemSchema & { - extraKey?: string; - } = getReadExceptionListItemSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = readExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_item_schema/index.ts deleted file mode 100644 index 6f54ede5ff51d..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_item_schema/index.ts +++ /dev/null @@ -1,34 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { NamespaceType } from '../../common/default_namespace'; -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { id } from '../../common/id'; -import { item_id } from '../../common/item_id'; -import { namespace_type } from '../../common/namespace_type'; - -export const readExceptionListItemSchema = t.exact( - t.partial({ - id, - item_id, - namespace_type, // defaults to 'single' if not set during decode - }) -); - -export type ReadExceptionListItemSchema = t.OutputOf<typeof readExceptionListItemSchema>; - -// This type is used after a decode since some things are defaults after a decode. -export type ReadExceptionListItemSchemaDecoded = Omit< - RequiredKeepUndefined<t.TypeOf<typeof readExceptionListItemSchema>>, - 'namespace_type' -> & { - namespace_type: NamespaceType; -}; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_schema/index.mock.ts deleted file mode 100644 index 47fcba01fd95e..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_schema/index.mock.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ID, LIST_ID, NAMESPACE_TYPE } from '../../constants/index.mock'; - -import { ReadExceptionListSchema } from '.'; - -export const getReadExceptionListSchemaMock = (): ReadExceptionListSchema => ({ - id: ID, - list_id: LIST_ID, - namespace_type: NAMESPACE_TYPE, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_schema/index.test.ts deleted file mode 100644 index 2c5a93021b7ca..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_schema/index.test.ts +++ /dev/null @@ -1,128 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getReadExceptionListSchemaMock } from './index.mock'; -import { ReadExceptionListSchema, readExceptionListSchema } from '.'; - -describe('read_exception_list_schema', () => { - test('it should validate a typical exception list request', () => { - const payload = getReadExceptionListSchemaMock(); - const decoded = readExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "id"', () => { - const payload = getReadExceptionListSchemaMock(); - delete payload.id; - const decoded = readExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "list_id"', () => { - const payload = getReadExceptionListSchemaMock(); - delete payload.list_id; - const decoded = readExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "namespace_type" but default to "single"', () => { - const payload = getReadExceptionListSchemaMock(); - delete payload.namespace_type; - const decoded = readExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getReadExceptionListSchemaMock()); - }); - - test('it should accept an undefined for "id", "list_id", "namespace_type" but default "namespace_type" to "single"', () => { - const payload = getReadExceptionListSchemaMock(); - delete payload.id; - delete payload.namespace_type; - delete payload.list_id; - const output = getReadExceptionListSchemaMock(); - delete output.id; - delete output.list_id; - const decoded = readExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(output); - }); - - test('it should accept an undefined for "id", "list_id"', () => { - const payload = getReadExceptionListSchemaMock(); - delete payload.id; - delete payload.list_id; - const decoded = readExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "id", "namespace_type" but default "namespace_type" to "single"', () => { - const payload = getReadExceptionListSchemaMock(); - delete payload.id; - delete payload.namespace_type; - const output = getReadExceptionListSchemaMock(); - delete output.id; - const decoded = readExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(output); - }); - - test('it should accept an undefined for "list_id", "namespace_type" but default "namespace_type" to "single"', () => { - const payload = getReadExceptionListSchemaMock(); - delete payload.namespace_type; - delete payload.list_id; - const output = getReadExceptionListSchemaMock(); - delete output.list_id; - const decoded = readExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(output); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: ReadExceptionListSchema & { - extraKey?: string; - } = getReadExceptionListSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = readExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_schema/index.ts deleted file mode 100644 index fb2e66d2f1de2..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_schema/index.ts +++ /dev/null @@ -1,34 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { NamespaceType } from '../../common/default_namespace'; -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { id } from '../../common/id'; -import { list_id } from '../../common/list_id'; -import { namespace_type } from '../../common/namespace_type'; - -export const readExceptionListSchema = t.exact( - t.partial({ - id, - list_id, - namespace_type, // defaults to 'single' if not set during decode - }) -); - -export type ReadExceptionListSchema = t.OutputOf<typeof readExceptionListSchema>; - -// This type is used after a decode since some things are defaults after a decode. -export type ReadExceptionListSchemaDecoded = Omit< - RequiredKeepUndefined<t.TypeOf<typeof readExceptionListSchema>>, - 'namespace_type' -> & { - namespace_type: NamespaceType; -}; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_item_schema/index.mock.ts deleted file mode 100644 index d78bb6f44bc78..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_item_schema/index.mock.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { LIST_ID, LIST_ITEM_ID, VALUE } from '../../constants/index.mock'; - -import { ReadListItemSchema } from '.'; - -export const getReadListItemSchemaMock = (): ReadListItemSchema => ({ - id: LIST_ITEM_ID, - list_id: LIST_ID, - value: VALUE, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_item_schema/index.test.ts deleted file mode 100644 index 547537afc6735..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_item_schema/index.test.ts +++ /dev/null @@ -1,119 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getReadListItemSchemaMock } from './index.mock'; -import { ReadListItemSchema, readListItemSchema } from '.'; - -describe('read_list_item_schema', () => { - test('it should validate a typical list item request', () => { - const payload = getReadListItemSchemaMock(); - const decoded = readListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "id"', () => { - const payload = getReadListItemSchemaMock(); - delete payload.id; - const decoded = readListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "list_id"', () => { - const payload = getReadListItemSchemaMock(); - delete payload.list_id; - const decoded = readListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "value"', () => { - const payload = getReadListItemSchemaMock(); - delete payload.value; - const decoded = readListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "id", "list_id", "value"', () => { - const payload = getReadListItemSchemaMock(); - delete payload.id; - delete payload.value; - delete payload.list_id; - const decoded = readListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "id", "list_id"', () => { - const payload = getReadListItemSchemaMock(); - delete payload.id; - delete payload.list_id; - const decoded = readListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "id", "value"', () => { - const payload = getReadListItemSchemaMock(); - delete payload.id; - delete payload.value; - const decoded = readListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "list_id", "value"', () => { - const payload = getReadListItemSchemaMock(); - delete payload.value; - delete payload.list_id; - const decoded = readListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: ReadListItemSchema & { extraKey?: string } = getReadListItemSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = readListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_item_schema/index.ts deleted file mode 100644 index 3b45ebeea6bae..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_item_schema/index.ts +++ /dev/null @@ -1,20 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { id } from '../../common/id'; -import { list_id } from '../../common/list_id'; -import { value } from '../../common/value'; - -export const readListItemSchema = t.exact(t.partial({ id, list_id, value })); - -export type ReadListItemSchema = t.OutputOf<typeof readListItemSchema>; -export type ReadListItemSchemaDecoded = RequiredKeepUndefined<t.TypeOf<typeof readListItemSchema>>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_schema/index.mock.ts deleted file mode 100644 index 5eecbd49e472a..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_schema/index.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { LIST_ID } from '../../constants/index.mock'; - -import { ReadListSchema } from '.'; - -export const getReadListSchemaMock = (): ReadListSchema => ({ - id: LIST_ID, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_schema/index.test.ts deleted file mode 100644 index d26f8206c4985..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_schema/index.test.ts +++ /dev/null @@ -1,49 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getReadListSchemaMock } from './index.mock'; -import { ReadListSchema, readListSchema } from '.'; - -describe('read_list_schema', () => { - test('it should validate a typical list item request', () => { - const payload = getReadListSchemaMock(); - const decoded = readListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept an undefined for "id"', () => { - const payload = getReadListSchemaMock(); - // @ts-expect-error - delete payload.id; - const decoded = readListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "undefined" supplied to "id"']); - expect(message.schema).toEqual({}); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: ReadListSchema & { extraKey?: string } = getReadListSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = readListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_schema/index.ts deleted file mode 100644 index b9c008287139e..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_schema/index.ts +++ /dev/null @@ -1,20 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { id } from '../../common/id'; - -export const readListSchema = t.exact( - t.type({ - id, - }) -); - -export type ReadListSchema = t.OutputOf<typeof readListSchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/summary_exception_list_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/summary_exception_list_schema/index.mock.ts deleted file mode 100644 index 61e8dfbae15fd..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/summary_exception_list_schema/index.mock.ts +++ /dev/null @@ -1,19 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { FILTER, ID, LIST_ID, NAMESPACE_TYPE } from '../../constants/index.mock'; - -import { SummaryExceptionListSchema } from '.'; - -export const getSummaryExceptionListSchemaMock = (): SummaryExceptionListSchema => ({ - filter: FILTER, - id: ID, - list_id: LIST_ID, - namespace_type: NAMESPACE_TYPE, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/summary_exception_list_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/summary_exception_list_schema/index.test.ts deleted file mode 100644 index 06db32fa2df30..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/summary_exception_list_schema/index.test.ts +++ /dev/null @@ -1,138 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getSummaryExceptionListSchemaMock } from './index.mock'; -import { SummaryExceptionListSchema, summaryExceptionListSchema } from '.'; - -describe('summary_exception_list_schema', () => { - test('it should validate a typical exception list request', () => { - const payload = getSummaryExceptionListSchemaMock(); - const decoded = summaryExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = foldLeftRight(checked); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "filter"', () => { - const payload = getSummaryExceptionListSchemaMock(); - delete payload.filter; - const decoded = summaryExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = foldLeftRight(checked); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "id"', () => { - const payload = getSummaryExceptionListSchemaMock(); - delete payload.id; - const decoded = summaryExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = foldLeftRight(checked); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "list_id"', () => { - const payload = getSummaryExceptionListSchemaMock(); - delete payload.list_id; - const decoded = summaryExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = foldLeftRight(checked); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "namespace_type" but default to "single"', () => { - const payload = getSummaryExceptionListSchemaMock(); - delete payload.namespace_type; - const decoded = summaryExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = foldLeftRight(checked); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(getSummaryExceptionListSchemaMock()); - }); - - test('it should accept an undefined for "id", "list_id", "namespace_type" but default "namespace_type" to "single"', () => { - const payload = getSummaryExceptionListSchemaMock(); - delete payload.id; - delete payload.namespace_type; - delete payload.list_id; - const output = getSummaryExceptionListSchemaMock(); - delete output.id; - delete output.list_id; - const decoded = summaryExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = foldLeftRight(checked); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(output); - }); - - test('it should accept an undefined for "id", "list_id"', () => { - const payload = getSummaryExceptionListSchemaMock(); - delete payload.id; - delete payload.list_id; - const decoded = summaryExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = foldLeftRight(checked); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "id", "namespace_type" but default "namespace_type" to "single"', () => { - const payload = getSummaryExceptionListSchemaMock(); - delete payload.id; - delete payload.namespace_type; - const output = getSummaryExceptionListSchemaMock(); - delete output.id; - const decoded = summaryExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = foldLeftRight(checked); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(output); - }); - - test('it should accept an undefined for "list_id", "namespace_type" but default "namespace_type" to "single"', () => { - const payload = getSummaryExceptionListSchemaMock(); - delete payload.namespace_type; - delete payload.list_id; - const output = getSummaryExceptionListSchemaMock(); - delete output.list_id; - const decoded = summaryExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = foldLeftRight(checked); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(output); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: SummaryExceptionListSchema & { - extraKey?: string; - } = getSummaryExceptionListSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = summaryExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = foldLeftRight(checked); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/summary_exception_list_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/summary_exception_list_schema/index.ts deleted file mode 100644 index 2815dfa05b27e..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/summary_exception_list_schema/index.ts +++ /dev/null @@ -1,37 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { NamespaceType } from '../../common/default_namespace'; -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { id } from '../../common/id'; -import { filter, Filter } from '../../common/filter'; -import { list_id } from '../../common/list_id'; -import { namespace_type } from '../../common/namespace_type'; - -export const summaryExceptionListSchema = t.exact( - t.partial({ - filter, - id, - list_id, - namespace_type, // defaults to 'single' if not set during decode - }) -); - -export type SummaryExceptionListSchema = t.OutputOf<typeof summaryExceptionListSchema>; - -// This type is used after a decode since some things are defaults after a decode. -export type SummaryExceptionListSchemaDecoded = Omit< - RequiredKeepUndefined<t.TypeOf<typeof summaryExceptionListSchema>>, - 'namespace_type' -> & { - namespace_type: NamespaceType; - filter: Filter; -}; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.mock.ts deleted file mode 100644 index 8b34549a8c90f..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.mock.ts +++ /dev/null @@ -1,37 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { - COMMENTS, - DESCRIPTION, - ENTRIES, - ID, - ITEM_TYPE, - LIST_ITEM_ID, - META, - NAME, - OS_TYPES, - TAGS, -} from '../../constants/index.mock'; - -import { UpdateEndpointListItemSchema } from '.'; - -export const getUpdateEndpointListItemSchemaMock = (): UpdateEndpointListItemSchema => ({ - _version: undefined, - comments: COMMENTS, - description: DESCRIPTION, - entries: ENTRIES, - id: ID, - item_id: LIST_ITEM_ID, - meta: META, - name: NAME, - os_types: OS_TYPES, - tags: TAGS, - type: ITEM_TYPE, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.test.ts deleted file mode 100644 index f595ecd1ebbed..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.test.ts +++ /dev/null @@ -1,140 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { UpdateEndpointListItemSchema, updateEndpointListItemSchema } from '.'; -import { getUpdateEndpointListItemSchemaMock } from './index.mock'; - -describe('update_endpoint_list_item_schema', () => { - test('it should validate a typical list item request', () => { - const payload = getUpdateEndpointListItemSchemaMock(); - const decoded = updateEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not accept an undefined for "description"', () => { - const payload = getUpdateEndpointListItemSchemaMock(); - // @ts-expect-error - delete payload.description; - const decoded = updateEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "description"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not accept an undefined for "name"', () => { - const payload = getUpdateEndpointListItemSchemaMock(); - // @ts-expect-error - delete payload.name; - const decoded = updateEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "name"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not accept an undefined for "type"', () => { - const payload = getUpdateEndpointListItemSchemaMock(); - // @ts-expect-error - delete payload.type; - const decoded = updateEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "type"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not accept a value for "list_id"', () => { - const payload: UpdateEndpointListItemSchema & { - list_id?: string; - } = getUpdateEndpointListItemSchemaMock(); - payload.list_id = 'some new list_id'; - const decoded = updateEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "list_id"']); - expect(message.schema).toEqual({}); - }); - - test('it should accept an undefined for "meta" but strip it out', () => { - const payload = getUpdateEndpointListItemSchemaMock(); - const outputPayload = getUpdateEndpointListItemSchemaMock(); - delete payload.meta; - const decoded = updateEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - delete outputPayload.meta; - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(outputPayload); - }); - - test('it should accept an undefined for "comments" but return an array', () => { - const inputPayload = getUpdateEndpointListItemSchemaMock(); - const outputPayload = getUpdateEndpointListItemSchemaMock(); - delete inputPayload.comments; - outputPayload.comments = []; - const decoded = updateEndpointListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(outputPayload); - }); - - test('it should NOT accept an undefined for "entries"', () => { - const inputPayload = getUpdateEndpointListItemSchemaMock(); - const outputPayload = getUpdateEndpointListItemSchemaMock(); - // @ts-expect-error - delete inputPayload.entries; - outputPayload.entries = []; - const decoded = updateEndpointListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "entries"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should accept an undefined for "tags" but return an array', () => { - const inputPayload = getUpdateEndpointListItemSchemaMock(); - const outputPayload = getUpdateEndpointListItemSchemaMock(); - delete inputPayload.tags; - outputPayload.tags = []; - const decoded = updateEndpointListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(outputPayload); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: UpdateEndpointListItemSchema & { - extraKey?: string; - } = getUpdateEndpointListItemSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = updateEndpointListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.ts deleted file mode 100644 index 7851d80ef2ef9..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.ts +++ /dev/null @@ -1,59 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { DefaultUpdateCommentsArray } from '../../common/default_update_comments_array'; -import { exceptionListItemType } from '../../common/exception_list_item_type'; -import { nonEmptyEntriesArray } from '../../common/non_empty_entries_array'; -import { OsTypeArray, osTypeArrayOrUndefined } from '../../common/os_type'; -import { description } from '../../common/description'; -import { name } from '../../common/name'; -import { _version } from '../../common/underscore_version'; -import { id } from '../../common/id'; -import { meta } from '../../common/meta'; -import { Tags, tags } from '../../common/tags'; -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { UpdateCommentsArray } from '../../common/update_comment'; -import { EntriesArray } from '../../common/entries'; - -export const updateEndpointListItemSchema = t.intersection([ - t.exact( - t.type({ - description, - entries: nonEmptyEntriesArray, - name, - type: exceptionListItemType, - }) - ), - t.exact( - t.partial({ - _version, // defaults to undefined if not set during decode - comments: DefaultUpdateCommentsArray, // defaults to empty array if not set during decode - id, // defaults to undefined if not set during decode - item_id: t.union([t.string, t.undefined]), - meta, // defaults to undefined if not set during decode - os_types: osTypeArrayOrUndefined, // defaults to empty array if not set during decode - tags, // defaults to empty array if not set during decode - }) - ), -]); - -export type UpdateEndpointListItemSchema = t.OutputOf<typeof updateEndpointListItemSchema>; - -// This type is used after a decode since some things are defaults after a decode. -export type UpdateEndpointListItemSchemaDecoded = Omit< - RequiredKeepUndefined<t.TypeOf<typeof updateEndpointListItemSchema>>, - 'tags' | 'entries' | 'comments' -> & { - comments: UpdateCommentsArray; - tags: Tags; - entries: EntriesArray; - os_types: OsTypeArray; -}; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.mock.ts deleted file mode 100644 index fce5d2f7e18bc..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.mock.ts +++ /dev/null @@ -1,53 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { - COMMENTS, - DESCRIPTION, - ENTRIES, - ID, - ITEM_ID, - ITEM_TYPE, - LIST_ITEM_ID, - META, - NAME, - NAMESPACE_TYPE, - OS_TYPES, - TAGS, -} from '../../constants/index.mock'; - -import { UpdateExceptionListItemSchema } from '.'; - -export const getUpdateExceptionListItemSchemaMock = (): UpdateExceptionListItemSchema => ({ - _version: undefined, - comments: COMMENTS, - description: DESCRIPTION, - entries: ENTRIES, - id: ID, - item_id: LIST_ITEM_ID, - meta: META, - name: NAME, - namespace_type: NAMESPACE_TYPE, - os_types: ['linux'], - tags: TAGS, - type: ITEM_TYPE, -}); - -/** - * Useful for end to end tests and other mechanisms which want to fill in the values - * after doing a get of the structure. - */ -export const getUpdateMinimalExceptionListItemSchemaMock = (): UpdateExceptionListItemSchema => ({ - description: DESCRIPTION, - entries: ENTRIES, - item_id: ITEM_ID, - name: NAME, - os_types: OS_TYPES, - type: ITEM_TYPE, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.test.ts deleted file mode 100644 index 84e9b801c171d..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.test.ts +++ /dev/null @@ -1,162 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { UpdateExceptionListItemSchema, updateExceptionListItemSchema } from '.'; -import { getUpdateExceptionListItemSchemaMock } from './index.mock'; - -describe('update_exception_list_item_schema', () => { - test('it should validate a typical exception list item request', () => { - const payload = getUpdateExceptionListItemSchemaMock(); - const decoded = updateExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not accept an undefined for "description"', () => { - const payload = getUpdateExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.description; - const decoded = updateExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "description"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not accept an undefined for "name"', () => { - const payload = getUpdateExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.name; - const decoded = updateExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "name"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not accept an undefined for "type"', () => { - const payload = getUpdateExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.type; - const decoded = updateExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "type"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not accept a value for "list_id"', () => { - const payload: UpdateExceptionListItemSchema & { - list_id?: string; - } = getUpdateExceptionListItemSchemaMock(); - payload.list_id = 'some new list_id'; - const decoded = updateExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "list_id"']); - expect(message.schema).toEqual({}); - }); - - test('it should accept an undefined for "meta" but strip it out', () => { - const payload = getUpdateExceptionListItemSchemaMock(); - const outputPayload = getUpdateExceptionListItemSchemaMock(); - delete payload.meta; - const decoded = updateExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - delete outputPayload.meta; - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(outputPayload); - }); - - test('it should accept an undefined for "comments" but return an array', () => { - const inputPayload = getUpdateExceptionListItemSchemaMock(); - const outputPayload = getUpdateExceptionListItemSchemaMock(); - delete inputPayload.comments; - outputPayload.comments = []; - const decoded = updateExceptionListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(outputPayload); - }); - - test('it should NOT accept an undefined for "entries"', () => { - const inputPayload = getUpdateExceptionListItemSchemaMock(); - const outputPayload = getUpdateExceptionListItemSchemaMock(); - // @ts-expect-error - delete inputPayload.entries; - outputPayload.entries = []; - const decoded = updateExceptionListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "entries"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should accept an undefined for "namespace_type" but return enum "single"', () => { - const inputPayload = getUpdateExceptionListItemSchemaMock(); - const outputPayload = getUpdateExceptionListItemSchemaMock(); - delete inputPayload.namespace_type; - outputPayload.namespace_type = 'single'; - const decoded = updateExceptionListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(outputPayload); - }); - - test('it should accept an undefined for "tags" but return an array', () => { - const inputPayload = getUpdateExceptionListItemSchemaMock(); - const outputPayload = getUpdateExceptionListItemSchemaMock(); - delete inputPayload.tags; - outputPayload.tags = []; - const decoded = updateExceptionListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(outputPayload); - }); - - test('it should accept an undefined for "item_id" and generate a correct body not counting the uuid', () => { - const inputPayload = getUpdateExceptionListItemSchemaMock(); - delete inputPayload.item_id; - const decoded = updateExceptionListItemSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as UpdateExceptionListItemSchema).item_id; - expect(message.schema).toEqual(inputPayload); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: UpdateExceptionListItemSchema & { - extraKey?: string; - } = getUpdateExceptionListItemSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = updateExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.ts deleted file mode 100644 index b0190d8fa3883..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.ts +++ /dev/null @@ -1,66 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { ExceptionListItemEntryArray } from '@kbn/securitysolution-exceptions-common/api'; -import { NamespaceType } from '../../common/default_namespace'; -import { DefaultUpdateCommentsArray } from '../../common/default_update_comments_array'; -import { exceptionListItemType } from '../../common/exception_list_item_type'; -import { nonEmptyEntriesArray } from '../../common/non_empty_entries_array'; -import { OsTypeArray, osTypeArrayOrUndefined } from '../../common/os_type'; -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { Tags, tags } from '../../common/tags'; -import { UpdateCommentsArray } from '../../common/update_comment'; -import { description } from '../../common/description'; -import { name } from '../../common/name'; -import { _version } from '../../common/underscore_version'; -import { id } from '../../common/id'; -import { item_id } from '../../common/item_id'; -import { meta } from '../../common/meta'; -import { namespace_type } from '../../common/namespace_type'; -import { ExpireTimeOrUndefined, expireTimeOrUndefined } from '../../common'; - -export const updateExceptionListItemSchema = t.intersection([ - t.exact( - t.type({ - description, - entries: nonEmptyEntriesArray, - name, - type: exceptionListItemType, - }) - ), - t.exact( - t.partial({ - _version, // defaults to undefined if not set during decode - comments: DefaultUpdateCommentsArray, // defaults to empty array if not set during decode - expire_time: expireTimeOrUndefined, - id, // defaults to undefined if not set during decode - item_id, - meta, // defaults to undefined if not set during decode - namespace_type, // defaults to 'single' if not set during decode - os_types: osTypeArrayOrUndefined, // defaults to empty array if not set during decode - tags, // defaults to empty array if not set during decode - }) - ), -]); - -export type UpdateExceptionListItemSchema = t.OutputOf<typeof updateExceptionListItemSchema>; - -// This type is used after a decode since some things are defaults after a decode. -export type UpdateExceptionListItemSchemaDecoded = Omit< - RequiredKeepUndefined<t.TypeOf<typeof updateExceptionListItemSchema>>, - 'tags' | 'entries' | 'namespace_type' | 'comments' | 'os_types' | 'expire_time' -> & { - comments: UpdateCommentsArray; - tags: Tags; - entries: ExceptionListItemEntryArray; - namespace_type: NamespaceType; - os_types: OsTypeArray; - expire_time: ExpireTimeOrUndefined; -}; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_schema/index.mock.ts deleted file mode 100644 index ff98cc71f03f4..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_schema/index.mock.ts +++ /dev/null @@ -1,36 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { DESCRIPTION, ID, LIST_ID, META, NAME, NAMESPACE_TYPE } from '../../constants/index.mock'; - -import { UpdateExceptionListSchema } from '.'; - -export const getUpdateExceptionListSchemaMock = (): UpdateExceptionListSchema => ({ - _version: undefined, - description: DESCRIPTION, - id: ID, - list_id: LIST_ID, - meta: META, - name: NAME, - namespace_type: NAMESPACE_TYPE, - os_types: [], - tags: ['malware'], - type: 'endpoint', -}); - -/** - * Useful for end to end tests and other mechanisms which want to fill in the values - * after doing a get of the structure. - */ -export const getUpdateMinimalExceptionListSchemaMock = (): UpdateExceptionListSchema => ({ - description: DESCRIPTION, - list_id: LIST_ID, - name: NAME, - type: 'endpoint', -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_schema/index.test.ts deleted file mode 100644 index 4821251f36d14..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_schema/index.test.ts +++ /dev/null @@ -1,123 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { UpdateExceptionListSchema, updateExceptionListSchema } from '.'; -import { getUpdateExceptionListSchemaMock } from './index.mock'; - -describe('update_exception_list_schema', () => { - test('it should validate a typical exception list request', () => { - const payload = getUpdateExceptionListSchemaMock(); - const decoded = updateExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not accept an undefined for "description"', () => { - const payload = getUpdateExceptionListSchemaMock(); - // @ts-expect-error - delete payload.description; - const decoded = updateExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "description"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not accept an undefined for "name"', () => { - const payload = getUpdateExceptionListSchemaMock(); - // @ts-expect-error - delete payload.name; - const decoded = updateExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "name"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not accept an undefined for "type"', () => { - const payload = getUpdateExceptionListSchemaMock(); - // @ts-expect-error - delete payload.type; - const decoded = updateExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "type"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should accept an undefined for "meta" but strip it out', () => { - const payload = getUpdateExceptionListSchemaMock(); - const outputPayload = getUpdateExceptionListSchemaMock(); - delete payload.meta; - const decoded = updateExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - delete outputPayload.meta; - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(outputPayload); - }); - - test('it should accept an undefined for "namespace_type" but return enum "single"', () => { - const inputPayload = getUpdateExceptionListSchemaMock(); - const outputPayload = getUpdateExceptionListSchemaMock(); - delete inputPayload.namespace_type; - outputPayload.namespace_type = 'single'; - const decoded = updateExceptionListSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(outputPayload); - }); - - test('it should accept an undefined for "tags" but return an array', () => { - const inputPayload = getUpdateExceptionListSchemaMock(); - const outputPayload = getUpdateExceptionListSchemaMock(); - delete inputPayload.tags; - outputPayload.tags = []; - const decoded = updateExceptionListSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(outputPayload); - }); - - test('it should accept an undefined for "list_id" and generate a correct body not counting the uuid', () => { - const inputPayload = getUpdateExceptionListSchemaMock(); - delete inputPayload.list_id; - const decoded = updateExceptionListSchema.decode(inputPayload); - const checked = exactCheck(inputPayload, decoded); - const message = pipe(checked, foldLeftRight); - delete (message.schema as UpdateExceptionListSchema).list_id; - expect(message.schema).toEqual(inputPayload); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: UpdateExceptionListSchema & { - extraKey?: string; - } = getUpdateExceptionListSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = updateExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_schema/index.ts deleted file mode 100644 index 62add37568ba3..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_schema/index.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { version } from '@kbn/securitysolution-io-ts-types'; -import { OsTypeArray, osTypeArrayOrUndefined } from '../../common/os_type'; -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { Tags, tags } from '../../common/tags'; -import { NamespaceType } from '../../common/default_namespace'; -import { description } from '../../common/description'; -import { name } from '../../common/name'; -import { _version } from '../../common/underscore_version'; -import { exceptionListType } from '../../common/exception_list'; -import { id } from '../../common/id'; -import { list_id } from '../../common/list_id'; -import { meta } from '../../common/meta'; -import { namespace_type } from '../../common/namespace_type'; - -export const updateExceptionListSchema = t.intersection([ - t.exact( - t.type({ - description, - name, - type: exceptionListType, - }) - ), - t.exact( - t.partial({ - _version, // defaults to undefined if not set during decode - id, // defaults to undefined if not set during decode - list_id, // defaults to undefined if not set during decode - meta, // defaults to undefined if not set during decode - namespace_type, // defaults to 'single' if not set during decode - os_types: osTypeArrayOrUndefined, // defaults to empty array if not set during decode - tags, // defaults to empty array if not set during decode - version, // defaults to undefined if not set during decode - }) - ), -]); - -export type UpdateExceptionListSchema = t.OutputOf<typeof updateExceptionListSchema>; - -// This type is used after a decode since the arrays turn into defaults of empty arrays. -export type UpdateExceptionListSchemaDecoded = Omit< - RequiredKeepUndefined<t.TypeOf<typeof updateExceptionListSchema>>, - 'tags | namespace_type' | 'os_types' -> & { - tags: Tags; - namespace_type: NamespaceType; - os_types: OsTypeArray; -}; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_item_schema/index.mock.ts deleted file mode 100644 index 9c3b2dbbd7d35..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_item_schema/index.mock.ts +++ /dev/null @@ -1,26 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ID, LIST_ITEM_ID, META, VALUE } from '../../constants/index.mock'; - -import { UpdateListItemSchema } from '.'; - -export const getUpdateListItemSchemaMock = (): UpdateListItemSchema => ({ - id: ID, - meta: META, - value: VALUE, -}); - -/** - * Useful for end to end testing - */ -export const getUpdateMinimalListItemSchemaMock = (): UpdateListItemSchema => ({ - id: LIST_ITEM_ID, - value: VALUE, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_item_schema/index.test.ts deleted file mode 100644 index 6c7637cbde05e..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_item_schema/index.test.ts +++ /dev/null @@ -1,50 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { UpdateListItemSchema, updateListItemSchema } from '.'; -import { getUpdateListItemSchemaMock } from './index.mock'; - -describe('update_list_item_schema', () => { - test('it should validate a typical list item request', () => { - const payload = getUpdateListItemSchemaMock(); - const decoded = updateListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "meta" but strip it out', () => { - const payload = getUpdateListItemSchemaMock(); - const outputPayload = getUpdateListItemSchemaMock(); - delete payload.meta; - const decoded = updateListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - delete outputPayload.meta; - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(outputPayload); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: UpdateListItemSchema & { - extraKey?: string; - } = getUpdateListItemSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = updateListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_item_schema/index.ts deleted file mode 100644 index 613dde36ef0f7..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_item_schema/index.ts +++ /dev/null @@ -1,36 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { _version } from '../../common/underscore_version'; -import { id } from '../../common/id'; -import { value } from '../../common/value'; -import { meta } from '../../common/meta'; - -export const updateListItemSchema = t.intersection([ - t.exact( - t.type({ - id, - value, - }) - ), - t.exact( - t.partial({ - _version, // defaults to undefined if not set during decode - meta, // defaults to undefined if not set during decode - }) - ), -]); - -export type UpdateListItemSchema = t.OutputOf<typeof updateListItemSchema>; -export type UpdateListItemSchemaDecoded = RequiredKeepUndefined< - t.TypeOf<typeof updateListItemSchema> ->; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_schema/index.mock.ts deleted file mode 100644 index 5f1fc8fe926d5..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_schema/index.mock.ts +++ /dev/null @@ -1,30 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { DESCRIPTION, LIST_ID, META, NAME, _VERSION } from '../../constants/index.mock'; - -import { UpdateListSchema } from '.'; - -export const getUpdateListSchemaMock = (): UpdateListSchema => ({ - _version: _VERSION, - description: DESCRIPTION, - id: LIST_ID, - meta: META, - name: NAME, -}); - -/** - * Useful for end to end tests and other mechanisms which want to fill in the values - * after doing a get of the structure. - */ -export const getUpdateMinimalListSchemaMock = (): UpdateListSchema => ({ - description: DESCRIPTION, - id: LIST_ID, - name: NAME, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_schema/index.test.ts deleted file mode 100644 index cac97d7c32cf2..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_schema/index.test.ts +++ /dev/null @@ -1,50 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { UpdateListSchema, updateListSchema } from '.'; -import { getUpdateListSchemaMock } from './index.mock'; - -describe('update_list_schema', () => { - test('it should validate a typical list request', () => { - const payload = getUpdateListSchemaMock(); - const decoded = updateListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "meta" but strip it out', () => { - const payload = getUpdateListSchemaMock(); - const outputPayload = getUpdateListSchemaMock(); - delete payload.meta; - const decoded = updateListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - delete outputPayload.meta; - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(outputPayload); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: UpdateListSchema & { - extraKey?: string; - } = getUpdateListSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = updateListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_schema/index.ts deleted file mode 100644 index 41ddb81c36e38..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_schema/index.ts +++ /dev/null @@ -1,38 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { version } from '@kbn/securitysolution-io-ts-types'; -import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; -import { id } from '../../common/id'; -import { name } from '../../common/name'; -import { description } from '../../common/description'; -import { _version } from '../../common/underscore_version'; -import { meta } from '../../common/meta'; - -export const updateListSchema = t.intersection([ - t.exact( - t.type({ - description, - id, - name, - }) - ), - t.exact( - t.partial({ - _version, // defaults to undefined if not set during decode - meta, // defaults to undefined if not set during decode - version, // defaults to undefined if not set during decode - }) - ), -]); - -export type UpdateListSchema = t.OutputOf<typeof updateListSchema>; -export type UpdateListSchemaDecoded = RequiredKeepUndefined<t.TypeOf<typeof updateListSchema>>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/acknowledge_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/acknowledge_schema/index.mock.ts deleted file mode 100644 index c532dd7401971..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/acknowledge_schema/index.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { AcknowledgeSchema } from '.'; - -export const getAcknowledgeSchemaResponseMock = (): AcknowledgeSchema => ({ - acknowledged: true, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/acknowledge_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/acknowledge_schema/index.test.ts deleted file mode 100644 index 2d3086b023153..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/acknowledge_schema/index.test.ts +++ /dev/null @@ -1,50 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getAcknowledgeSchemaResponseMock } from './index.mock'; -import { AcknowledgeSchema, acknowledgeSchema } from '.'; - -describe('acknowledge_schema', () => { - test('it should validate a typical response', () => { - const payload = getAcknowledgeSchemaResponseMock(); - const decoded = acknowledgeSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - test('it should NOT accept an undefined for "ok"', () => { - const payload = getAcknowledgeSchemaResponseMock(); - // @ts-expect-error - delete payload.acknowledged; - const decoded = acknowledgeSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "acknowledged"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: AcknowledgeSchema & { extraKey?: string } = getAcknowledgeSchemaResponseMock(); - payload.extraKey = 'some new value'; - const decoded = acknowledgeSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/acknowledge_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/acknowledge_schema/index.ts deleted file mode 100644 index d506f038534d9..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/acknowledge_schema/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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const acknowledgeSchema = t.exact(t.type({ acknowledged: t.boolean })); - -export type AcknowledgeSchema = t.TypeOf<typeof acknowledgeSchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/create_endpoint_list_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/create_endpoint_list_schema/index.test.ts deleted file mode 100644 index 52c72cf0e8cbc..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/create_endpoint_list_schema/index.test.ts +++ /dev/null @@ -1,75 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { CreateEndpointListSchema, createEndpointListSchema } from '.'; -import { getExceptionListSchemaMock } from '../exception_list_schema/index.mock'; - -describe('create_endpoint_list_schema', () => { - test('it should validate a typical endpoint list response', () => { - const payload = getExceptionListSchemaMock(); - const decoded = createEndpointListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an empty object when an endpoint list already exists', () => { - const payload: CreateEndpointListSchema = {}; - const decoded = createEndpointListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept an undefined for "list_id"', () => { - const payload = getExceptionListSchemaMock(); - // @ts-expect-error - delete payload.list_id; - const decoded = createEndpointListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'invalid keys "_version,created_at,created_by,description,id,immutable,meta,{},name,namespace_type,os_types,["linux"],tags,["user added string for a tag","malware"],tie_breaker_id,type,updated_at,updated_by,version"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT allow missing fields', () => { - const payload = getExceptionListSchemaMock(); - // @ts-expect-error - delete payload.list_id; - const decoded = createEndpointListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors)).length).toEqual(1); - expect(message.schema).toEqual({}); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: CreateEndpointListSchema & { - extraKey?: string; - } = getExceptionListSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = createEndpointListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/create_endpoint_list_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/create_endpoint_list_schema/index.ts deleted file mode 100644 index cdcdc8e67e07c..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/create_endpoint_list_schema/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { exceptionListSchema } from '../exception_list_schema'; - -export const createEndpointListSchema = t.union([exceptionListSchema, t.exact(t.type({}))]); - -export type CreateEndpointListSchema = t.TypeOf<typeof createEndpointListSchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.mock.ts deleted file mode 100644 index 2c0449ea900ee..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.mock.ts +++ /dev/null @@ -1,72 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { - COMMENTS, - DATE_NOW, - DESCRIPTION, - ELASTIC_USER, - ENTRIES, - ITEM_ID, - ITEM_TYPE, - LIST_ID, - META, - NAME, - NAMESPACE_TYPE, - OS_TYPES, - TIE_BREAKER, - USER, -} from '../../constants/index.mock'; - -import { ExceptionListItemSchema } from '.'; - -export const getExceptionListItemSchemaMock = ( - overrides?: Partial<ExceptionListItemSchema> -): ExceptionListItemSchema => ({ - _version: undefined, - comments: COMMENTS, - created_at: DATE_NOW, - created_by: USER, - description: DESCRIPTION, - entries: ENTRIES, - expire_time: undefined, - id: '1', - item_id: 'endpoint_list_item', - list_id: 'endpoint_list_id', - meta: META, - name: NAME, - namespace_type: NAMESPACE_TYPE, - os_types: ['linux'], - tags: ['user added string for a tag', 'malware'], - tie_breaker_id: TIE_BREAKER, - type: ITEM_TYPE, - updated_at: DATE_NOW, - updated_by: USER, - ...(overrides || {}), -}); - -/** - * This is useful for end to end tests where we remove the auto generated parts for comparisons - * such as created_at, updated_at, and id. - */ -export const getExceptionListItemResponseMockWithoutAutoGeneratedValues = - (): Partial<ExceptionListItemSchema> => ({ - comments: [], - created_by: ELASTIC_USER, - description: DESCRIPTION, - entries: ENTRIES, - item_id: ITEM_ID, - list_id: LIST_ID, - name: NAME, - namespace_type: 'single', - os_types: OS_TYPES, - tags: [], - type: ITEM_TYPE, - updated_by: ELASTIC_USER, - }); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.test.ts deleted file mode 100644 index 9c98d97a596ab..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.test.ts +++ /dev/null @@ -1,242 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getExceptionListItemSchemaMock } from './index.mock'; -import { ExceptionListItemSchema, exceptionListItemSchema } from '.'; - -describe('exception_list_item_schema', () => { - test('it should validate a typical exception list item response', () => { - const payload = getExceptionListItemSchemaMock(); - const decoded = exceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept an undefined for "id"', () => { - const payload = getExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.id; - const decoded = exceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "undefined" supplied to "id"']); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "list_id"', () => { - const payload = getExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.list_id; - const decoded = exceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "list_id"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "item_id"', () => { - const payload = getExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.item_id; - const decoded = exceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "item_id"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "comments"', () => { - const payload = getExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.comments; - const decoded = exceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "comments"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "entries"', () => { - const payload = getExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.entries; - const decoded = exceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "entries"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "name"', () => { - const payload = getExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.name; - const decoded = exceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "name"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should accept an undefined for "namespace_type" and return "single" as a default value for "namespace_type"', () => { - const payload = getExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.namespace_type; - const decoded = exceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect((message.schema as ExceptionListItemSchema).namespace_type).toEqual('single'); - }); - - test('it should NOT accept an undefined for "description"', () => { - const payload = getExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.description; - const decoded = exceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "description"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should accept an undefined for "meta"', () => { - const payload = getExceptionListItemSchemaMock(); - delete payload.meta; - const decoded = exceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept an undefined for "created_at"', () => { - const payload = getExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.created_at; - const decoded = exceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "created_at"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "created_by"', () => { - const payload = getExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.created_by; - const decoded = exceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "created_by"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "tie_breaker_id"', () => { - const payload = getExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.tie_breaker_id; - const decoded = exceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "tie_breaker_id"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "type"', () => { - const payload = getExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.type; - const decoded = exceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "type"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "updated_at"', () => { - const payload = getExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.updated_at; - const decoded = exceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "updated_at"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "updated_by"', () => { - const payload = getExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.updated_by; - const decoded = exceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "updated_by"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: ExceptionListItemSchema & { - extraKey?: string; - } = getExceptionListItemSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = exceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.ts deleted file mode 100644 index 5408aa581bdfa..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.ts +++ /dev/null @@ -1,56 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { namespace_type } from '../../common/namespace_type'; -import { metaOrUndefined } from '../../common/meta'; -import { name } from '../../common/name'; -import { created_at } from '../../common/created_at'; -import { created_by } from '../../common/created_by'; -import { id } from '../../common/id'; -import { tie_breaker_id } from '../../common/tie_breaker_id'; -import { updated_at } from '../../common/updated_at'; -import { updated_by } from '../../common/updated_by'; -import { list_id } from '../../common/list_id'; -import { description } from '../../common/description'; -import { osTypeArray } from '../../common/os_type'; -import { tags } from '../../common/tags'; -import { _versionOrUndefined } from '../../common/underscore_version'; -import { commentsArray } from '../../common/comment'; -import { entriesArray } from '../../common/entries'; -import { item_id } from '../../common/item_id'; -import { exceptionListItemType } from '../../common/exception_list_item_type'; -import { expireTimeOrUndefined } from '../../common/expire_time'; - -export const exceptionListItemSchema = t.exact( - t.type({ - _version: _versionOrUndefined, - comments: commentsArray, - created_at, - created_by, - description, - entries: entriesArray, - expire_time: expireTimeOrUndefined, - id, - item_id, - list_id, - meta: metaOrUndefined, - name, - namespace_type, - os_types: osTypeArray, - tags, - tie_breaker_id, - type: exceptionListItemType, - updated_at, - updated_by, - }) -); - -export type ExceptionListItemSchema = t.TypeOf<typeof exceptionListItemSchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_schema/index.mock.ts deleted file mode 100644 index de2efb85c3379..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_schema/index.mock.ts +++ /dev/null @@ -1,79 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { - DATE_NOW, - DESCRIPTION, - ELASTIC_USER, - ENDPOINT_TYPE, - IMMUTABLE, - LIST_ID, - META, - NAME, - TIE_BREAKER, - USER, - VERSION, - _VERSION, -} from '../../constants/index.mock'; -import { - ENDPOINT_LIST_ID, - ENDPOINT_TRUSTED_APPS_LIST_DESCRIPTION, - ENDPOINT_TRUSTED_APPS_LIST_ID, - ENDPOINT_TRUSTED_APPS_LIST_NAME, -} from '@kbn/securitysolution-list-constants'; - -import { ExceptionListSchema } from '.'; - -export const getExceptionListSchemaMock = (): ExceptionListSchema => ({ - _version: _VERSION, - created_at: DATE_NOW, - created_by: USER, - description: DESCRIPTION, - id: '1', - immutable: IMMUTABLE, - list_id: ENDPOINT_LIST_ID, - meta: META, - name: 'Sample Endpoint Exception List', - namespace_type: 'agnostic', - os_types: ['linux'], - tags: ['user added string for a tag', 'malware'], - tie_breaker_id: TIE_BREAKER, - type: ENDPOINT_TYPE, - updated_at: DATE_NOW, - updated_by: 'user_name', - version: VERSION, -}); - -export const getTrustedAppsListSchemaMock = (): ExceptionListSchema => { - return { - ...getExceptionListSchemaMock(), - description: ENDPOINT_TRUSTED_APPS_LIST_DESCRIPTION, - list_id: ENDPOINT_TRUSTED_APPS_LIST_ID, - name: ENDPOINT_TRUSTED_APPS_LIST_NAME, - }; -}; - -/** - * This is useful for end to end tests where we remove the auto generated parts for comparisons - * such as created_at, updated_at, and id. - */ -export const getExceptionResponseMockWithoutAutoGeneratedValues = - (): Partial<ExceptionListSchema> => ({ - created_by: ELASTIC_USER, - description: DESCRIPTION, - immutable: IMMUTABLE, - list_id: LIST_ID, - name: NAME, - namespace_type: 'single', - os_types: [], - tags: [], - type: ENDPOINT_TYPE, - updated_by: ELASTIC_USER, - version: VERSION, - }); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_schema/index.test.ts deleted file mode 100644 index e8dc043bd6b07..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_schema/index.test.ts +++ /dev/null @@ -1,200 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getExceptionListSchemaMock } from './index.mock'; -import { ExceptionListSchema, exceptionListSchema } from '.'; - -describe('exception_list_schema', () => { - test('it should validate a typical exception list response', () => { - const payload = getExceptionListSchemaMock(); - const decoded = exceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept an undefined for "id"', () => { - const payload = getExceptionListSchemaMock(); - // @ts-expect-error - delete payload.id; - const decoded = exceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "undefined" supplied to "id"']); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "list_id"', () => { - const payload = getExceptionListSchemaMock(); - // @ts-expect-error - delete payload.list_id; - const decoded = exceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "list_id"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "name"', () => { - const payload = getExceptionListSchemaMock(); - // @ts-expect-error - delete payload.name; - const decoded = exceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "name"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should accept an undefined for "namespace_type" and make "namespace_type" that of "single"', () => { - const payload = getExceptionListSchemaMock(); - // @ts-expect-error - delete payload.namespace_type; - const decoded = exceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect((message.schema as ExceptionListSchema).namespace_type).toEqual('single'); - }); - - test('it should NOT accept an undefined for "description"', () => { - const payload = getExceptionListSchemaMock(); - // @ts-expect-error - delete payload.description; - const decoded = exceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "description"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should accept an undefined for "meta"', () => { - const payload = getExceptionListSchemaMock(); - delete payload.meta; - const decoded = exceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept an undefined for "created_at"', () => { - const payload = getExceptionListSchemaMock(); - // @ts-expect-error - delete payload.created_at; - const decoded = exceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "created_at"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "created_by"', () => { - const payload = getExceptionListSchemaMock(); - // @ts-expect-error - delete payload.created_by; - const decoded = exceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "created_by"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "tie_breaker_id"', () => { - const payload = getExceptionListSchemaMock(); - // @ts-expect-error - delete payload.tie_breaker_id; - const decoded = exceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "tie_breaker_id"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "type"', () => { - const payload = getExceptionListSchemaMock(); - // @ts-expect-error - delete payload.type; - const decoded = exceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "type"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "updated_at"', () => { - const payload = getExceptionListSchemaMock(); - // @ts-expect-error - delete payload.updated_at; - const decoded = exceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "updated_at"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "updated_by"', () => { - const payload = getExceptionListSchemaMock(); - // @ts-expect-error - delete payload.updated_by; - const decoded = exceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "updated_by"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: ExceptionListSchema & { - extraKey?: string; - } = getExceptionListSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = exceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_schema/index.ts deleted file mode 100644 index 0667153c27776..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_schema/index.ts +++ /dev/null @@ -1,52 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { version } from '@kbn/securitysolution-io-ts-types'; -import { _versionOrUndefined } from '../../common/underscore_version'; -import { namespace_type } from '../../common/namespace_type'; -import { metaOrUndefined } from '../../common/meta'; -import { name } from '../../common/name'; -import { created_at } from '../../common/created_at'; -import { created_by } from '../../common/created_by'; -import { id } from '../../common/id'; -import { tie_breaker_id } from '../../common/tie_breaker_id'; -import { immutable } from '../../common/immutable'; -import { updated_at } from '../../common/updated_at'; -import { updated_by } from '../../common/updated_by'; -import { list_id } from '../../common/list_id'; -import { description } from '../../common/description'; -import { osTypeArray } from '../../common/os_type'; -import { exceptionListType } from '../../common/exception_list'; -import { tags } from '../../common/tags'; - -export const exceptionListSchema = t.exact( - t.type({ - _version: _versionOrUndefined, - created_at, - created_by, - description, - id, - immutable, - list_id, - meta: metaOrUndefined, - name, - namespace_type, - os_types: osTypeArray, - tags, - tie_breaker_id, - type: exceptionListType, - updated_at, - updated_by, - version, - }) -); - -export type ExceptionListSchema = t.TypeOf<typeof exceptionListSchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_summary_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_summary_schema/index.mock.ts deleted file mode 100644 index 1decbde1374b0..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_summary_schema/index.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ExceptionListSummarySchema } from '.'; - -export const getListSummaryResponseMock = (): ExceptionListSummarySchema => ({ - windows: 0, - linux: 1, - macos: 2, - total: 3, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_summary_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_summary_schema/index.test.ts deleted file mode 100644 index ad1d8b737e46d..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_summary_schema/index.test.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getListSummaryResponseMock } from './index.mock'; -import { ExceptionListSummarySchema, exceptionListSummarySchema } from '.'; - -describe('list_summary_schema', () => { - test('it should validate a typical list summary response', () => { - const payload = getListSummaryResponseMock(); - const decoded = exceptionListSummarySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept an undefined for "windows"', () => { - const payload = getListSummaryResponseMock(); - // @ts-expect-error - delete payload.windows; - const decoded = exceptionListSummarySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "windows"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "linux"', () => { - const payload = getListSummaryResponseMock(); - // @ts-expect-error - delete payload.linux; - const decoded = exceptionListSummarySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "linux"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "macos"', () => { - const payload = getListSummaryResponseMock(); - // @ts-expect-error - delete payload.macos; - const decoded = exceptionListSummarySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "macos"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "total"', () => { - const payload = getListSummaryResponseMock(); - // @ts-expect-error - delete payload.total; - const decoded = exceptionListSummarySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "total"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: ExceptionListSummarySchema & { - extraKey?: string; - } = getListSummaryResponseMock(); - payload.extraKey = 'some new value'; - const decoded = exceptionListSummarySchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_summary_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_summary_schema/index.ts deleted file mode 100644 index a14eaba10b78f..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_summary_schema/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { PositiveInteger } from '@kbn/securitysolution-io-ts-types'; -import * as t from 'io-ts'; - -export const exceptionListSummarySchema = t.exact( - t.type({ - windows: PositiveInteger, - linux: PositiveInteger, - macos: PositiveInteger, - total: PositiveInteger, - }) -); - -export type ExceptionListSummarySchema = t.TypeOf<typeof exceptionListSummarySchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_all_list_items_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/found_all_list_items_schema/index.mock.ts deleted file mode 100644 index 7f6ec6e8bd5c1..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_all_list_items_schema/index.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { FoundAllListItemsSchema } from '.'; -import { getListItemResponseMock } from '../list_item_schema/index.mock'; - -export const getFoundAllListItemsSchemaMock = (): FoundAllListItemsSchema => ({ - data: [getListItemResponseMock()], - total: 1, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_all_list_items_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/found_all_list_items_schema/index.ts deleted file mode 100644 index f8e6dc43647fd..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_all_list_items_schema/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { listItemSchema } from '../list_item_schema'; -import { total } from '../../common/total'; - -export const foundAllListItemsSchema = t.exact( - t.type({ - data: t.array(listItemSchema), - total, - }) -); - -export type FoundAllListItemsSchema = t.TypeOf<typeof foundAllListItemsSchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.mock.ts deleted file mode 100644 index 8a7abc59a9cdc..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.mock.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { FoundExceptionListItemSchema } from '.'; -import { getExceptionListItemSchemaMock } from '../exception_list_item_schema/index.mock'; - -export const getFoundExceptionListItemSchemaMock = (): FoundExceptionListItemSchema => ({ - data: [getExceptionListItemSchemaMock()], - page: 1, - per_page: 1, - total: 1, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.test.ts deleted file mode 100644 index eeaeee26fac49..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.test.ts +++ /dev/null @@ -1,154 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getFoundExceptionListItemSchemaMock } from './index.mock'; -import { FoundExceptionListItemSchema, foundExceptionListItemSchema } from '.'; -import { ExceptionListItemSchema } from '../exception_list_item_schema'; -import { getExceptionListItemSchemaMock } from '../exception_list_item_schema/index.mock'; - -describe('found_exception_list_item_schema', () => { - test('it should validate a typical exception list response', () => { - const payload = getFoundExceptionListItemSchemaMock(); - const decoded = foundExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept a malformed exception list item within "data"', () => { - const item: Omit<ExceptionListItemSchema, 'entries'> & { - entries?: string; - } = { ...getExceptionListItemSchemaMock(), entries: 'I should be an array' }; - const payload: Omit<FoundExceptionListItemSchema, 'data'> & { - data?: Array< - Omit<ExceptionListItemSchema, 'entries'> & { - entries?: string; - } - >; - } = { ...getFoundExceptionListItemSchemaMock(), data: [item] }; - const decoded = foundExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "I should be an array" supplied to "data,entries"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept a string for "page"', () => { - const payload: Omit<FoundExceptionListItemSchema, 'page'> & { - page?: string; - } = { ...getFoundExceptionListItemSchemaMock(), page: '1' }; - const decoded = foundExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "1" supplied to "page"']); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept a string for "per_page"', () => { - const payload: Omit<FoundExceptionListItemSchema, 'per_page'> & { - per_page?: string; - } = { ...getFoundExceptionListItemSchemaMock(), per_page: '20' }; - const decoded = foundExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "20" supplied to "per_page"']); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept a string for "total"', () => { - const payload: Omit<FoundExceptionListItemSchema, 'total'> & { - total?: string; - } = { ...getFoundExceptionListItemSchemaMock(), total: '1' }; - const decoded = foundExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "1" supplied to "total"']); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "page"', () => { - const payload = getFoundExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.page; - const decoded = foundExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "page"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "per_page"', () => { - const payload = getFoundExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.per_page; - const decoded = foundExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "per_page"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "total"', () => { - const payload = getFoundExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.total; - const decoded = foundExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "total"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "data"', () => { - const payload = getFoundExceptionListItemSchemaMock(); - // @ts-expect-error - delete payload.data; - const decoded = foundExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "data"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: FoundExceptionListItemSchema & { - extraKey?: string; - } = getFoundExceptionListItemSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = foundExceptionListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.ts deleted file mode 100644 index 6e34672f3349c..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.ts +++ /dev/null @@ -1,34 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { page } from '../../common/page'; -import { per_page } from '../../common/per_page'; -import { pitId } from '../../common/pit'; -import { total } from '../../common/total'; -import { exceptionListItemSchema } from '../exception_list_item_schema'; - -export const foundExceptionListItemSchema = t.intersection([ - t.exact( - t.type({ - data: t.array(exceptionListItemSchema), - page, - per_page, - total, - }) - ), - t.exact( - t.partial({ - pit: pitId, - }) - ), -]); - -export type FoundExceptionListItemSchema = t.TypeOf<typeof foundExceptionListItemSchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_schema/index.mock.ts deleted file mode 100644 index 5a4aa9fcbe577..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_schema/index.mock.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { FoundExceptionListSchema } from '.'; -import { getExceptionListSchemaMock } from '../exception_list_schema/index.mock'; - -export const getFoundExceptionListSchemaMock = (): FoundExceptionListSchema => ({ - data: [getExceptionListSchemaMock()], - page: 1, - per_page: 1, - total: 1, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_schema/index.test.ts deleted file mode 100644 index 07b302c801708..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_schema/index.test.ts +++ /dev/null @@ -1,154 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getFoundExceptionListSchemaMock } from './index.mock'; -import { FoundExceptionListSchema, foundExceptionListSchema } from '.'; -import { getExceptionListSchemaMock } from '../exception_list_schema/index.mock'; -import { ExceptionListSchema } from '../exception_list_schema'; - -describe('exception_list_schema', () => { - test('it should validate a typical exception list response', () => { - const payload = getFoundExceptionListSchemaMock(); - const decoded = foundExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept a malformed exception list item within "data"', () => { - const item: Omit<ExceptionListSchema, 'entries'> & { - entries?: string[]; - } = { ...getExceptionListSchemaMock(), entries: ['I should not be here'] }; - const payload: Omit<FoundExceptionListSchema, 'data'> & { - data?: Array< - Omit<ExceptionListSchema, 'entries'> & { - entries?: string[]; - } - >; - } = { ...getFoundExceptionListSchemaMock(), data: [item] }; - const decoded = foundExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'invalid keys "entries,["I should not be here"]"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept a string for "page"', () => { - const payload: Omit<FoundExceptionListSchema, 'page'> & { - page?: string; - } = { ...getFoundExceptionListSchemaMock(), page: '1' }; - const decoded = foundExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "1" supplied to "page"']); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept a string for "per_page"', () => { - const payload: Omit<FoundExceptionListSchema, 'per_page'> & { - per_page?: string; - } = { ...getFoundExceptionListSchemaMock(), per_page: '20' }; - const decoded = foundExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "20" supplied to "per_page"']); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept a string for "total"', () => { - const payload: Omit<FoundExceptionListSchema, 'total'> & { - total?: string; - } = { ...getFoundExceptionListSchemaMock(), total: '1' }; - const decoded = foundExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "1" supplied to "total"']); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "page"', () => { - const payload = getFoundExceptionListSchemaMock(); - // @ts-expect-error - delete payload.page; - const decoded = foundExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "page"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "per_page"', () => { - const payload = getFoundExceptionListSchemaMock(); - // @ts-expect-error - delete payload.per_page; - const decoded = foundExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "per_page"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "total"', () => { - const payload = getFoundExceptionListSchemaMock(); - // @ts-expect-error - delete payload.total; - const decoded = foundExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "total"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "data"', () => { - const payload = getFoundExceptionListSchemaMock(); - // @ts-expect-error - delete payload.data; - const decoded = foundExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "data"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: FoundExceptionListSchema & { - extraKey?: string; - } = getFoundExceptionListSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = foundExceptionListSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_schema/index.ts deleted file mode 100644 index de4a222b61e78..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_schema/index.ts +++ /dev/null @@ -1,31 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { page } from '../../common/page'; -import { per_page } from '../../common/per_page'; -import { pitId } from '../../common/pit'; -import { total } from '../../common/total'; - -import { exceptionListSchema } from '../exception_list_schema'; - -export const foundExceptionListSchema = t.intersection([ - t.exact( - t.type({ - data: t.array(exceptionListSchema), - page, - per_page, - total, - }) - ), - t.exact(t.partial({ pit: pitId })), -]); - -export type FoundExceptionListSchema = t.TypeOf<typeof foundExceptionListSchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_item_schema/index.mock.ts deleted file mode 100644 index 3f20835657432..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_item_schema/index.mock.ts +++ /dev/null @@ -1,19 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { FoundListItemSchema } from '.'; -import { getListItemResponseMock } from '../list_item_schema/index.mock'; - -export const getFoundListItemSchemaMock = (): FoundListItemSchema => ({ - cursor: 'WzI1LFsiNmE3NmI2OWQtODBkZi00YWIyLThjM2UtODVmNDY2YjA2YTBlIl1d', - data: [getListItemResponseMock()], - page: 1, - per_page: 25, - total: 1, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_item_schema/index.ts deleted file mode 100644 index 872a178b2f130..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_item_schema/index.ts +++ /dev/null @@ -1,28 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { listItemSchema } from '../list_item_schema'; -import { cursor } from '../../common/cursor'; -import { page } from '../../common/page'; -import { per_page } from '../../common/per_page'; -import { total } from '../../common/total'; - -export const foundListItemSchema = t.exact( - t.type({ - cursor, - data: t.array(listItemSchema), - page, - per_page, - total, - }) -); - -export type FoundListItemSchema = t.TypeOf<typeof foundListItemSchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_schema/index.mock.ts deleted file mode 100644 index 232de4d47c156..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_schema/index.mock.ts +++ /dev/null @@ -1,19 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { FoundListSchema } from '.'; -import { getListResponseMock } from '../list_schema/index.mock'; - -export const getFoundListSchemaMock = (): FoundListSchema => ({ - cursor: '123', - data: [getListResponseMock()], - page: 1, - per_page: 1, - total: 1, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_schema/index.ts deleted file mode 100644 index 6b97b8c73e634..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_schema/index.ts +++ /dev/null @@ -1,28 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { listSchema } from '../list_schema'; -import { cursor } from '../../common/cursor'; -import { page } from '../../common/page'; -import { per_page } from '../../common/per_page'; -import { total } from '../../common/total'; - -export const foundListSchema = t.exact( - t.type({ - cursor, - data: t.array(listSchema), - page, - per_page, - total, - }) -); - -export type FoundListSchema = t.TypeOf<typeof foundListSchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_lists_by_size_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/found_lists_by_size_schema/index.mock.ts deleted file mode 100644 index bd654ccde56e8..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_lists_by_size_schema/index.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { FoundListsBySizeSchema } from '.'; -import { getListResponseMock } from '../list_schema/index.mock'; - -export const getFoundListsBySizeSchemaMock = (): FoundListsBySizeSchema => ({ - smallLists: [getListResponseMock()], - largeLists: [getListResponseMock()], -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_lists_by_size_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/found_lists_by_size_schema/index.ts deleted file mode 100644 index b4d41484bf269..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/found_lists_by_size_schema/index.ts +++ /dev/null @@ -1,21 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { listSchema } from '../list_schema'; - -export const foundListsBySizeSchema = t.exact( - t.type({ - largeLists: t.array(listSchema), - smallLists: t.array(listSchema), - }) -); - -export type FoundListsBySizeSchema = t.TypeOf<typeof foundListsBySizeSchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/import_exceptions_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/import_exceptions_schema/index.mock.ts deleted file mode 100644 index b1502381013c3..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/import_exceptions_schema/index.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ImportExceptionsResponseSchema } from '.'; - -export const getImportExceptionsResponseSchemaMock = ( - success = 0, - lists = 0, - items = 0 -): ImportExceptionsResponseSchema => ({ - errors: [], - success: true, - success_count: success, - success_exception_lists: true, - success_count_exception_lists: lists, - success_exception_list_items: true, - success_count_exception_list_items: items, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/import_exceptions_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/import_exceptions_schema/index.test.ts deleted file mode 100644 index 81dd87bf19a56..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/import_exceptions_schema/index.test.ts +++ /dev/null @@ -1,130 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { importExceptionsResponseSchema, ImportExceptionsResponseSchema } from '.'; -import { getImportExceptionsResponseSchemaMock } from './index.mock'; - -describe('importExceptionsResponseSchema', () => { - test('it should validate a typical exceptions import response', () => { - const payload = getImportExceptionsResponseSchemaMock(); - const decoded = importExceptionsResponseSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept an undefined for "errors"', () => { - const payload: Partial<ReturnType<typeof getImportExceptionsResponseSchemaMock>> = - getImportExceptionsResponseSchemaMock(); - delete payload.errors; - const decoded = importExceptionsResponseSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "errors"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "success"', () => { - const payload: Partial<ReturnType<typeof getImportExceptionsResponseSchemaMock>> = - getImportExceptionsResponseSchemaMock(); - delete payload.success; - const decoded = importExceptionsResponseSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "success"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "success_count"', () => { - const payload: Partial<ReturnType<typeof getImportExceptionsResponseSchemaMock>> = - getImportExceptionsResponseSchemaMock(); - delete payload.success_count; - const decoded = importExceptionsResponseSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "success_count"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "success_exception_lists"', () => { - const payload: Partial<ReturnType<typeof getImportExceptionsResponseSchemaMock>> = - getImportExceptionsResponseSchemaMock(); - delete payload.success_exception_lists; - const decoded = importExceptionsResponseSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "success_exception_lists"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "success_count_exception_lists"', () => { - const payload: Partial<ReturnType<typeof getImportExceptionsResponseSchemaMock>> = - getImportExceptionsResponseSchemaMock(); - delete payload.success_count_exception_lists; - const decoded = importExceptionsResponseSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "success_count_exception_lists"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "success_exception_list_items"', () => { - const payload: Partial<ReturnType<typeof getImportExceptionsResponseSchemaMock>> = - getImportExceptionsResponseSchemaMock(); - delete payload.success_exception_list_items; - const decoded = importExceptionsResponseSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "success_exception_list_items"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "success_count_exception_list_items"', () => { - const payload: Partial<ReturnType<typeof getImportExceptionsResponseSchemaMock>> = - getImportExceptionsResponseSchemaMock(); - delete payload.success_count_exception_list_items; - const decoded = importExceptionsResponseSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "success_count_exception_list_items"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: ImportExceptionsResponseSchema & { - extraKey?: string; - } = getImportExceptionsResponseSchemaMock(); - payload.extraKey = 'some new value'; - const decoded = importExceptionsResponseSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/import_exceptions_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/import_exceptions_schema/index.ts deleted file mode 100644 index b976ab298e0c7..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/import_exceptions_schema/index.ts +++ /dev/null @@ -1,52 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { PositiveInteger } from '@kbn/securitysolution-io-ts-types'; - -import { id } from '../../common/id'; -import { list_id } from '../../common/list_id'; -import { item_id } from '../../common/item_id'; - -export const bulkErrorErrorSchema = t.exact( - t.type({ - status_code: t.number, - message: t.string, - }) -); - -export const bulkErrorSchema = t.intersection([ - t.exact( - t.type({ - error: bulkErrorErrorSchema, - }) - ), - t.partial({ - id, - list_id, - item_id, - }), -]); - -export type BulkErrorSchema = t.TypeOf<typeof bulkErrorSchema>; - -export const importExceptionsResponseSchema = t.exact( - t.type({ - errors: t.array(bulkErrorSchema), - success: t.boolean, - success_count: PositiveInteger, - success_exception_lists: t.boolean, - success_count_exception_lists: PositiveInteger, - success_exception_list_items: t.boolean, - success_count_exception_list_items: PositiveInteger, - }) -); - -export type ImportExceptionsResponseSchema = t.TypeOf<typeof importExceptionsResponseSchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/index.ts deleted file mode 100644 index 49c42783473d7..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/index.ts +++ /dev/null @@ -1,25 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './acknowledge_schema'; -export * from './create_endpoint_list_schema'; -export * from './exception_list_schema'; -export * from './exception_list_item_schema'; -export * from './found_exception_list_item_schema'; -export * from './found_exception_list_schema'; -export * from './found_all_list_items_schema'; -export * from './found_lists_by_size_schema'; -export * from './found_list_item_schema'; -export * from './found_list_schema'; -export * from './import_exceptions_schema'; -export * from './list_item_schema'; -export * from './list_schema'; -export * from './exception_list_summary_schema'; -export * from './list_item_index_exist_schema'; -export * from './search_list_item_schema'; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_index_exist_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_index_exist_schema/index.mock.ts deleted file mode 100644 index eff892b3f00bb..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_index_exist_schema/index.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ListItemIndexExistSchema } from '.'; - -export const getListItemIndexExistSchemaResponseMock = (): ListItemIndexExistSchema => ({ - list_index: true, - list_item_index: true, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_index_exist_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_index_exist_schema/index.test.ts deleted file mode 100644 index 2827cd3627344..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_index_exist_schema/index.test.ts +++ /dev/null @@ -1,67 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getListItemIndexExistSchemaResponseMock } from './index.mock'; -import { ListItemIndexExistSchema, listItemIndexExistSchema } from '.'; - -describe('list_item_index_exist_schema', () => { - test('it should validate a typical list item request', () => { - const payload = getListItemIndexExistSchemaResponseMock(); - const decoded = listItemIndexExistSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept an undefined for "list_index"', () => { - const payload = getListItemIndexExistSchemaResponseMock(); - // @ts-expect-error - delete payload.list_index; - const decoded = listItemIndexExistSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "list_index"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "list_item_index"', () => { - const payload = getListItemIndexExistSchemaResponseMock(); - // @ts-expect-error - delete payload.list_item_index; - const decoded = listItemIndexExistSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "list_item_index"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: ListItemIndexExistSchema & { - extraKey?: string; - } = getListItemIndexExistSchemaResponseMock(); - payload.extraKey = 'some new value'; - const decoded = listItemIndexExistSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_index_exist_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_index_exist_schema/index.ts deleted file mode 100644 index 494af4e3e7590..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_index_exist_schema/index.ts +++ /dev/null @@ -1,19 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -export const listItemIndexExistSchema = t.exact( - t.type({ - list_index: t.boolean, - list_item_index: t.boolean, - }) -); - -export type ListItemIndexExistSchema = t.TypeOf<typeof listItemIndexExistSchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.mock.ts deleted file mode 100644 index 22c2e5ae07f61..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.mock.ts +++ /dev/null @@ -1,50 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ListItemSchema } from '.'; -import { - DATE_NOW, - ELASTIC_USER, - LIST_ID, - LIST_ITEM_ID, - META, - TIE_BREAKER, - TYPE, - USER, - VALUE, -} from '../../constants/index.mock'; - -export const getListItemResponseMock = (): ListItemSchema => ({ - _version: undefined, - '@timestamp': DATE_NOW, - created_at: DATE_NOW, - created_by: USER, - deserializer: undefined, - id: LIST_ITEM_ID, - list_id: LIST_ID, - meta: META, - serializer: undefined, - tie_breaker_id: TIE_BREAKER, - type: TYPE, - updated_at: DATE_NOW, - updated_by: USER, - value: VALUE, -}); - -/** - * This is useful for end to end tests where we remove the auto generated parts for comparisons - * such as created_at, updated_at, and id. - */ -export const getListItemResponseMockWithoutAutoGeneratedValues = (): Partial<ListItemSchema> => ({ - created_by: ELASTIC_USER, - list_id: LIST_ID, - type: TYPE, - updated_by: ELASTIC_USER, - value: VALUE, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.test.ts deleted file mode 100644 index 5b4238e136dc6..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.test.ts +++ /dev/null @@ -1,194 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getListItemResponseMock } from './index.mock'; -import { ListItemSchema, listItemSchema } from '.'; - -describe('list_item_schema', () => { - test('it should validate a typical list item response', () => { - const payload = getListItemResponseMock(); - const decoded = listItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept an undefined for "id"', () => { - const payload = getListItemResponseMock(); - // @ts-expect-error - delete payload.id; - const decoded = listItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "undefined" supplied to "id"']); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "list_id"', () => { - const payload = getListItemResponseMock(); - // @ts-expect-error - delete payload.list_id; - const decoded = listItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "list_id"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should accept an undefined for "meta"', () => { - const payload = getListItemResponseMock(); - delete payload.meta; - const decoded = listItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "serializer"', () => { - const payload = getListItemResponseMock(); - delete payload.serializer; - const decoded = listItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "deserializer"', () => { - const payload = getListItemResponseMock(); - delete payload.deserializer; - const decoded = listItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept an undefined for "created_at"', () => { - const payload = getListItemResponseMock(); - // @ts-expect-error - delete payload.created_at; - const decoded = listItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "created_at"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "created_by"', () => { - const payload = getListItemResponseMock(); - // @ts-expect-error - delete payload.created_by; - const decoded = listItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "created_by"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "tie_breaker_id"', () => { - const payload = getListItemResponseMock(); - // @ts-expect-error - delete payload.tie_breaker_id; - const decoded = listItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "tie_breaker_id"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "type"', () => { - const payload = getListItemResponseMock(); - // @ts-expect-error - delete payload.type; - const decoded = listItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "type"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "updated_at"', () => { - const payload = getListItemResponseMock(); - // @ts-expect-error - delete payload.updated_at; - const decoded = listItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "updated_at"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "updated_by"', () => { - const payload = getListItemResponseMock(); - // @ts-expect-error - delete payload.updated_by; - const decoded = listItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "updated_by"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "value"', () => { - const payload = getListItemResponseMock(); - // @ts-expect-error - delete payload.value; - const decoded = listItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "value"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: ListItemSchema & { extraKey?: string } = getListItemResponseMock(); - payload.extraKey = 'some new value'; - const decoded = listItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.ts deleted file mode 100644 index 869ca695fa42e..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.ts +++ /dev/null @@ -1,49 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; - -import { _versionOrUndefined } from '../../common/underscore_version'; -import { deserializerOrUndefined } from '../../common/deserializer'; -import { metaOrUndefined } from '../../common/meta'; -import { timestampOrUndefined } from '../../common/timestamp'; -import { serializerOrUndefined } from '../../common/serializer'; -import { created_at } from '../../common/created_at'; -import { created_by } from '../../common/created_by'; -import { id } from '../../common/id'; -import { tie_breaker_id } from '../../common/tie_breaker_id'; -import { type } from '../../common/type'; -import { updated_at } from '../../common/updated_at'; -import { updated_by } from '../../common/updated_by'; -import { list_id } from '../../common/list_id'; -import { value } from '../../common/value'; - -export const listItemSchema = t.exact( - t.type({ - _version: _versionOrUndefined, - '@timestamp': timestampOrUndefined, - created_at, - created_by, - deserializer: deserializerOrUndefined, - id, - list_id, - meta: metaOrUndefined, - serializer: serializerOrUndefined, - tie_breaker_id, - type, - updated_at, - updated_by, - value, - }) -); - -export type ListItemSchema = t.TypeOf<typeof listItemSchema>; - -export const listItemArraySchema = t.array(listItemSchema); -export type ListItemArraySchema = t.TypeOf<typeof listItemArraySchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.mock.ts deleted file mode 100644 index 7a0b9e01b87c5..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.mock.ts +++ /dev/null @@ -1,56 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ListSchema } from '.'; -import { - DATE_NOW, - DESCRIPTION, - ELASTIC_USER, - IMMUTABLE, - LIST_ID, - META, - NAME, - TIE_BREAKER, - TYPE, - USER, - VERSION, -} from '../../constants/index.mock'; - -export const getListResponseMock = (): ListSchema => ({ - _version: undefined, - '@timestamp': DATE_NOW, - created_at: DATE_NOW, - created_by: USER, - description: DESCRIPTION, - deserializer: undefined, - id: LIST_ID, - immutable: IMMUTABLE, - meta: META, - name: NAME, - serializer: undefined, - tie_breaker_id: TIE_BREAKER, - type: TYPE, - updated_at: DATE_NOW, - updated_by: USER, - version: VERSION, -}); - -/** - * This is useful for end to end tests where we remove the auto generated parts for comparisons - * such as created_at, updated_at, and id. - */ -export const getListResponseMockWithoutAutoGeneratedValues = (): Partial<ListSchema> => ({ - created_by: ELASTIC_USER, - description: DESCRIPTION, - immutable: IMMUTABLE, - name: NAME, - type: TYPE, - updated_by: ELASTIC_USER, - version: VERSION, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.test.ts deleted file mode 100644 index 17f25de7d8ec2..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.test.ts +++ /dev/null @@ -1,194 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getListResponseMock } from './index.mock'; -import { ListSchema, listSchema } from '.'; - -describe('list_schema', () => { - test('it should validate a typical list response', () => { - const payload = getListResponseMock(); - const decoded = listSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept an undefined for "id"', () => { - const payload = getListResponseMock(); - // @ts-expect-error - delete payload.id; - const decoded = listSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "undefined" supplied to "id"']); - expect(message.schema).toEqual({}); - }); - - test('it should accept an undefined for "meta"', () => { - const payload = getListResponseMock(); - delete payload.meta; - const decoded = listSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "serializer"', () => { - const payload = getListResponseMock(); - delete payload.serializer; - const decoded = listSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should accept an undefined for "deserializer"', () => { - const payload = getListResponseMock(); - delete payload.deserializer; - const decoded = listSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT accept an undefined for "created_at"', () => { - const payload = getListResponseMock(); - // @ts-expect-error - delete payload.created_at; - const decoded = listSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "created_at"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "created_by"', () => { - const payload = getListResponseMock(); - // @ts-expect-error - delete payload.created_by; - const decoded = listSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "created_by"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "tie_breaker_id"', () => { - const payload = getListResponseMock(); - // @ts-expect-error - delete payload.tie_breaker_id; - const decoded = listSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "tie_breaker_id"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "type"', () => { - const payload = getListResponseMock(); - // @ts-expect-error - delete payload.type; - const decoded = listSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "type"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "updated_at"', () => { - const payload = getListResponseMock(); - // @ts-expect-error - delete payload.updated_at; - const decoded = listSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "updated_at"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "updated_by"', () => { - const payload = getListResponseMock(); - // @ts-expect-error - delete payload.updated_by; - const decoded = listSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "updated_by"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "name"', () => { - const payload = getListResponseMock(); - // @ts-expect-error - delete payload.name; - const decoded = listSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "name"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should NOT accept an undefined for "description"', () => { - const payload = getListResponseMock(); - // @ts-expect-error - delete payload.description; - const decoded = listSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "description"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: ListSchema & { extraKey?: string } = getListResponseMock(); - payload.extraKey = 'some new value'; - const decoded = listSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.ts deleted file mode 100644 index 5029e55df3244..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.ts +++ /dev/null @@ -1,52 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { version } from '@kbn/securitysolution-io-ts-types'; -import { _versionOrUndefined } from '../../common/underscore_version'; -import { deserializerOrUndefined } from '../../common/deserializer'; -import { metaOrUndefined } from '../../common/meta'; -import { serializerOrUndefined } from '../../common/serializer'; -import { created_at } from '../../common/created_at'; -import { timestampOrUndefined } from '../../common/timestamp'; -import { created_by } from '../../common/created_by'; -import { description } from '../../common/description'; -import { id } from '../../common/id'; -import { immutable } from '../../common/immutable'; -import { name } from '../../common/name'; -import { tie_breaker_id } from '../../common/tie_breaker_id'; -import { type } from '../../common/type'; -import { updated_at } from '../../common/updated_at'; -import { updated_by } from '../../common/updated_by'; - -export const listSchema = t.exact( - t.type({ - _version: _versionOrUndefined, - '@timestamp': timestampOrUndefined, - created_at, - created_by, - description, - deserializer: deserializerOrUndefined, - id, - immutable, - meta: metaOrUndefined, - name, - serializer: serializerOrUndefined, - tie_breaker_id, - type, - updated_at, - updated_by, - version, - }) -); - -export type ListSchema = t.TypeOf<typeof listSchema>; - -export const listArraySchema = t.array(listSchema); -export type ListArraySchema = t.TypeOf<typeof listArraySchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.mock.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.mock.ts deleted file mode 100644 index 1cab9a6b827c6..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { SearchListItemSchema } from '.'; -import { VALUE } from '../../constants/index.mock'; -import { getListItemResponseMock } from '../list_item_schema/index.mock'; - -export const getSearchListItemResponseMock = (): SearchListItemSchema => ({ - items: [getListItemResponseMock()], - value: VALUE, -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.test.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.test.ts deleted file mode 100644 index a6604f39b4626..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.test.ts +++ /dev/null @@ -1,49 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { left } from 'fp-ts/lib/Either'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -import { getSearchListItemResponseMock } from './index.mock'; -import { SearchListItemSchema, searchListItemSchema } from '.'; - -describe('search_list_item_schema', () => { - test('it should validate a typical search list item response', () => { - const payload = getSearchListItemResponseMock(); - const decoded = searchListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should NOT validate with an "undefined" for "items"', () => { - const { items, ...noItems } = getSearchListItemResponseMock(); - const decoded = searchListItemSchema.decode(noItems); - const checked = exactCheck(noItems, decoded); - const message = pipe(checked, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([ - 'Invalid value "undefined" supplied to "items"', - ]); - expect(message.schema).toEqual({}); - }); - - test('it should not allow an extra key to be sent in', () => { - const payload: SearchListItemSchema & { extraKey?: string } = getSearchListItemResponseMock(); - payload.extraKey = 'some new value'; - const decoded = searchListItemSchema.decode(payload); - const checked = exactCheck(payload, decoded); - const message = pipe(checked, foldLeftRight); - expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); - expect(message.schema).toEqual({}); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.ts deleted file mode 100644 index c5a07308dd0f8..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.ts +++ /dev/null @@ -1,28 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { listItemArraySchema } from '../list_item_schema'; - -/** - * NOTE: Although this is defined within "response" this does not expose a REST API - * endpoint right now for this particular response. Instead this is only used internally - * for the plugins at this moment. If this changes, please remove this message. - */ -export const searchListItemSchema = t.exact( - t.type({ - items: listItemArraySchema, - value: t.unknown, - }) -); - -export type SearchListItemSchema = t.TypeOf<typeof searchListItemSchema>; - -export const searchListItemArraySchema = t.array(searchListItemSchema); -export type SearchListItemArraySchema = t.TypeOf<typeof searchListItemArraySchema>; diff --git a/packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts b/packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts deleted file mode 100644 index 9a8cd1e4fab56..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts +++ /dev/null @@ -1,244 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { HttpStart } from '@kbn/core-http-browser'; -import type { NotificationsStart } from '@kbn/core-notifications-browser'; -import type { Filter } from '@kbn/es-query'; -import { NamespaceType } from '../common/default_namespace'; -import { ExceptionListType, ExceptionListTypeEnum } from '../common/exception_list'; -import { Page } from '../common/page'; -import { PerPage } from '../common/per_page'; -import { TotalOrUndefined } from '../common/total'; -import { CreateExceptionListItemSchema } from '../request/create_exception_list_item_schema'; -import { CreateExceptionListSchema } from '../request/create_exception_list_schema'; -import { ExceptionListId } from '../request/get_exception_filter_schema'; -import { UpdateExceptionListItemSchema } from '../request/update_exception_list_item_schema'; -import { UpdateExceptionListSchema } from '../request/update_exception_list_schema'; -import { ExceptionListItemSchema } from '../response/exception_list_item_schema'; -import { ExceptionListSchema } from '../response/exception_list_schema'; - -interface BaseParams { - http: HttpStart; - signal: AbortSignal; -} - -export interface DuplicateExceptionListProps extends BaseParams { - listId: string; - namespaceType: NamespaceType; - includeExpiredExceptions: boolean; -} - -export interface ApiListDuplicateProps - extends Omit<DuplicateExceptionListProps, 'http' | 'signal'> { - onError: (err: Error) => void; - onSuccess: (newList: ExceptionListSchema) => void; -} - -export interface ExceptionListFilter { - name?: string | null; - list_id?: string | null; - created_by?: string | null; - types?: ExceptionListTypeEnum[] | null; - tags?: string | null; -} - -export interface UseExceptionListsProps { - errorMessage: string; - filterOptions?: ExceptionListFilter; - http: HttpStart; - namespaceTypes: NamespaceType[]; - notifications: NotificationsStart; - initialPagination?: Pagination; - hideLists?: readonly string[]; - initialSort?: Sort; -} - -export interface UseExceptionListProps { - http: HttpStart; - lists: ExceptionListIdentifiers[]; - onError?: (arg: string[]) => void; - filterOptions: FilterExceptionsOptions[]; - pagination?: Pagination; - showDetectionsListsOnly: boolean; - showEndpointListsOnly: boolean; - matchFilters: boolean; - onSuccess?: (arg: UseExceptionListItemsSuccess) => void; - sort?: Sort; -} - -export interface FilterExceptionsOptions { - filter: string; - tags: string[]; -} - -export interface ApiCallMemoProps { - id: string; - namespaceType: NamespaceType; - onError: (arg: Error) => void; - onSuccess: () => void; -} - -// TODO: Switch to use ApiCallMemoProps -// after cleaning up exceptions/api file to -// remove unnecessary validation checks -export interface ApiListExportProps { - id: string; - includeExpiredExceptions: boolean; - listId: string; - namespaceType: NamespaceType; - onError: (err: Error) => void; - onSuccess: (blob: Blob) => void; -} - -export interface Sort { - field: string; - order: string; -} -export interface Pagination { - page: Page; - perPage: PerPage; - total: TotalOrUndefined; -} - -export interface UseExceptionListItemsSuccess { - exceptions: ExceptionListItemSchema[]; - pagination: Pagination; -} - -export interface ExceptionListIdentifiers { - id: string; - listId: string; - namespaceType: NamespaceType; - type: ExceptionListType; -} - -export interface ApiCallFindListsItemsMemoProps { - lists: ExceptionListIdentifiers[]; - pagination: Partial<Pagination>; - showDetectionsListsOnly: boolean; - showEndpointListsOnly: boolean; - filter?: string; - onError: (arg: string[]) => void; - onSuccess: (arg: UseExceptionListItemsSuccess) => void; -} - -export interface ApiCallGetExceptionFilterFromIdsMemoProps extends GetExceptionFilterOptionalProps { - exceptionListIds: ExceptionListId[]; - onError: (arg: string[]) => void; - onSuccess: (arg: Filter) => void; -} - -export interface ApiCallGetExceptionFilterFromExceptionsMemoProps - extends GetExceptionFilterOptionalProps { - exceptions: Array<ExceptionListItemSchema | CreateExceptionListItemSchema>; - onError: (arg: string[]) => void; - onSuccess: (arg: Filter) => void; -} - -export interface ExportExceptionListProps { - http: HttpStart; - id: string; - listId: string; - namespaceType: NamespaceType; - includeExpiredExceptions: boolean; - signal: AbortSignal; -} - -export interface AddEndpointExceptionListProps { - http: HttpStart; - signal: AbortSignal; -} - -export interface UpdateExceptionListItemProps { - http: HttpStart; - listItem: UpdateExceptionListItemSchema; - signal: AbortSignal; -} - -export interface UpdateExceptionListProps { - http: HttpStart; - list: UpdateExceptionListSchema; - signal: AbortSignal; -} - -export interface AddExceptionListItemProps { - http: HttpStart; - listItem: CreateExceptionListItemSchema; - signal: AbortSignal; -} - -export interface AddExceptionListProps { - http: HttpStart; - list: CreateExceptionListSchema; - signal: AbortSignal; -} - -export interface UseExceptionListsSuccess { - exceptions: ExceptionListSchema[]; - pagination: Pagination; -} - -export interface ApiCallFetchExceptionListsProps { - http: HttpStart; - namespaceTypes: string; - pagination: Partial<Pagination>; - sort?: Sort; - filters: string; - signal: AbortSignal; -} - -export interface ApiCallByIdProps { - http: HttpStart; - id: string; - namespaceType: NamespaceType; - signal: AbortSignal; -} - -export interface ApiCallByListIdProps { - http: HttpStart; - listIds: string[]; - namespaceTypes: NamespaceType[]; - pagination: Partial<Pagination>; - search?: string; - filter?: string; - signal: AbortSignal; -} - -export type AddExceptionList = UpdateExceptionListSchema | CreateExceptionListSchema; - -export interface PersistHookProps { - http: HttpStart; - onError: (arg: Error) => void; -} - -export interface ExceptionList extends ExceptionListSchema { - totalItems: number; -} - -export interface GetExceptionFilterOptionalProps { - signal?: AbortSignal; - chunkSize?: number; - alias?: string; - excludeExceptions?: boolean; -} - -export interface GetExceptionFilterFromExceptionListIdsProps - extends GetExceptionFilterOptionalProps { - http: HttpStart; - exceptionListIds: ExceptionListId[]; -} - -export interface GetExceptionFilterFromExceptionsProps extends GetExceptionFilterOptionalProps { - http: HttpStart; - exceptions: Array<ExceptionListItemSchema | CreateExceptionListItemSchema>; -} - -export interface ExceptionFilterResponse { - filter: Filter; -} diff --git a/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json b/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json deleted file mode 100644 index 706aa6e81fc59..0000000000000 --- a/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": ["jest", "node"] - }, - "include": ["**/*.ts"], - "kbn_references": [ - "@kbn/securitysolution-io-ts-types", - "@kbn/securitysolution-io-ts-utils", - "@kbn/securitysolution-list-constants", - "@kbn/es-query", - "@kbn/core-http-browser", - "@kbn/core-notifications-browser", - "@kbn/securitysolution-exceptions-common" - ], - "exclude": ["target/**/*"] -} diff --git a/packages/kbn-securitysolution-io-ts-types/jest.config.js b/packages/kbn-securitysolution-io-ts-types/jest.config.js deleted file mode 100644 index c6efe620b09f8..0000000000000 --- a/packages/kbn-securitysolution-io-ts-types/jest.config.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../..', - roots: ['<rootDir>/packages/kbn-securitysolution-io-ts-types'], -}; diff --git a/packages/kbn-securitysolution-io-ts-types/src/default_uuid/index.test.ts b/packages/kbn-securitysolution-io-ts-types/src/default_uuid/index.test.ts deleted file mode 100644 index c429529167e52..0000000000000 --- a/packages/kbn-securitysolution-io-ts-types/src/default_uuid/index.test.ts +++ /dev/null @@ -1,44 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { left } from 'fp-ts/lib/Either'; -import { DefaultUuid } from '.'; -import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; - -describe('default_uuid', () => { - test('it should validate a regular string', () => { - const payload = '1'; - const decoded = DefaultUuid.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toEqual(payload); - }); - - test('it should not validate a number', () => { - const payload = 5; - const decoded = DefaultUuid.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual(['Invalid value "5" supplied to "DefaultUuid"']); - expect(message.schema).toEqual({}); - }); - - test('it should return a default of a uuid', () => { - const payload = null; - const decoded = DefaultUuid.decode(payload); - const message = pipe(decoded, foldLeftRight); - - expect(getPaths(left(message.errors))).toEqual([]); - expect(message.schema).toMatch( - /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i - ); - }); -}); diff --git a/packages/kbn-securitysolution-io-ts-types/src/version/index.ts b/packages/kbn-securitysolution-io-ts-types/src/version/index.ts deleted file mode 100644 index 3269a335347fd..0000000000000 --- a/packages/kbn-securitysolution-io-ts-types/src/version/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import * as t from 'io-ts'; -import { PositiveIntegerGreaterThanZero } from '../positive_integer_greater_than_zero'; - -/** - * Note this is just a positive number, but we use it as a type here which is still ok. - * This type was originally from "x-pack/plugins/security_solution/common/detection_engine/schemas/common/schemas.ts" - * but is moved here to make things more portable. No unit tests, but see PositiveIntegerGreaterThanZero integer for unit tests. - */ -export const version = PositiveIntegerGreaterThanZero; -export type Version = t.TypeOf<typeof version>; - -export const versionOrUndefined = t.union([version, t.undefined]); -export type VersionOrUndefined = t.TypeOf<typeof versionOrUndefined>; diff --git a/packages/kbn-securitysolution-io-ts-types/tsconfig.json b/packages/kbn-securitysolution-io-ts-types/tsconfig.json deleted file mode 100644 index 25b82d38b7dc9..0000000000000 --- a/packages/kbn-securitysolution-io-ts-types/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts" - ], - "kbn_references": [ - "@kbn/securitysolution-io-ts-utils" - ], - "exclude": [ - "target/**/*", - ] -} diff --git a/packages/kbn-securitysolution-io-ts-utils/jest.config.js b/packages/kbn-securitysolution-io-ts-utils/jest.config.js deleted file mode 100644 index 457ac315951b6..0000000000000 --- a/packages/kbn-securitysolution-io-ts-utils/jest.config.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../..', - roots: ['<rootDir>/packages/kbn-securitysolution-io-ts-utils'], -}; diff --git a/packages/kbn-securitysolution-io-ts-utils/tsconfig.json b/packages/kbn-securitysolution-io-ts-utils/tsconfig.json deleted file mode 100644 index 13f8244edd1ad..0000000000000 --- a/packages/kbn-securitysolution-io-ts-utils/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts" - ], - "kbn_references": [ - "@kbn/datemath" - ], - "exclude": [ - "target/**/*", - ] -} diff --git a/packages/kbn-securitysolution-list-api/index.ts b/packages/kbn-securitysolution-list-api/index.ts deleted file mode 100644 index fc434f01c7ecb..0000000000000 --- a/packages/kbn-securitysolution-list-api/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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './src/api'; -export * from './src/fp_utils'; -export * from './src/list_api'; -export * from './src/list_item_api'; -export * from './src/types'; diff --git a/packages/kbn-securitysolution-list-api/jest.config.js b/packages/kbn-securitysolution-list-api/jest.config.js deleted file mode 100644 index 434cef2b7ca33..0000000000000 --- a/packages/kbn-securitysolution-list-api/jest.config.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../..', - roots: ['<rootDir>/packages/kbn-securitysolution-list-api'], -}; diff --git a/packages/kbn-securitysolution-list-api/package.json b/packages/kbn-securitysolution-list-api/package.json deleted file mode 100644 index bcb7a79accdc5..0000000000000 --- a/packages/kbn-securitysolution-list-api/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@kbn/securitysolution-list-api", - "version": "1.0.0", - "description": "security solution list REST API", - "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0", - "private": true -} \ No newline at end of file diff --git a/packages/kbn-securitysolution-list-api/src/api/index.ts b/packages/kbn-securitysolution-list-api/src/api/index.ts deleted file mode 100644 index 4bd188672e5a9..0000000000000 --- a/packages/kbn-securitysolution-list-api/src/api/index.ts +++ /dev/null @@ -1,666 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { chain, fromEither, tryCatch } from 'fp-ts/lib/TaskEither'; -import { flow } from 'fp-ts/lib/function'; -import { validateEither } from '@kbn/securitysolution-io-ts-utils'; -import { - CreateEndpointListSchema, - ExceptionListItemSchema, - ExceptionListSchema, - FoundExceptionListItemSchema, - FoundExceptionListSchema, - createEndpointListSchema, - exceptionListItemSchema, - exceptionListSchema, - foundExceptionListItemSchema, - foundExceptionListSchema, - AddEndpointExceptionListProps, - AddExceptionListItemProps, - AddExceptionListProps, - ApiCallByIdProps, - ApiCallByListIdProps, - ApiCallFetchExceptionListsProps, - ExportExceptionListProps, - UpdateExceptionListItemProps, - UpdateExceptionListProps, - GetExceptionFilterFromExceptionListIdsProps, - GetExceptionFilterFromExceptionsProps, - ExceptionFilterResponse, - DuplicateExceptionListProps, -} from '@kbn/securitysolution-io-ts-list-types'; - -import { - ENDPOINT_LIST_URL, - INTERNAL_EXCEPTION_FILTER, - EXCEPTION_LIST_ITEM_URL, - EXCEPTION_LIST_URL, -} from '@kbn/securitysolution-list-constants'; -import { toError, toPromise } from '../fp_utils'; - -const version = '2023-10-31'; - -/** - * Add new ExceptionList - * - * @param http Kibana http service - * @param list exception list to add - * @param signal to cancel request - * - * @throws An error if response is not OK - * - */ -const addExceptionList = async ({ - http, - list, - signal, -}: AddExceptionListProps): Promise<ExceptionListSchema> => - http.fetch<ExceptionListSchema>(EXCEPTION_LIST_URL, { - body: JSON.stringify(list), - method: 'POST', - signal, - version, - }); - -const addExceptionListWithValidation = async ({ - http, - list, - signal, -}: AddExceptionListProps): Promise<ExceptionListSchema> => - flow( - () => - tryCatch( - () => - addExceptionList({ - http, - list, - signal, - }), - toError - ), - chain((response) => fromEither(validateEither(exceptionListSchema, response))), - flow(toPromise) - )(); - -export { addExceptionListWithValidation as addExceptionList }; - -/** - * Add new ExceptionListItem - * - * @param http Kibana http service - * @param listItem exception list item to add - * @param signal to cancel request - * - * @throws An error if response is not OK - * - */ -const addExceptionListItem = async ({ - http, - listItem, - signal, -}: AddExceptionListItemProps): Promise<ExceptionListItemSchema> => - http.fetch<ExceptionListItemSchema>(EXCEPTION_LIST_ITEM_URL, { - body: JSON.stringify(listItem), - method: 'POST', - signal, - version, - }); - -const addExceptionListItemWithValidation = async ({ - http, - listItem, - signal, -}: AddExceptionListItemProps): Promise<ExceptionListItemSchema> => - flow( - () => - tryCatch( - () => - addExceptionListItem({ - http, - listItem, - signal, - }), - toError - ), - chain((response) => fromEither(validateEither(exceptionListItemSchema, response))), - flow(toPromise) - )(); - -export { addExceptionListItemWithValidation as addExceptionListItem }; - -/** - * Update existing ExceptionList - * - * @param http Kibana http service - * @param list exception list to add - * @param signal to cancel request - * - * @throws An error if response is not OK - * - */ -const updateExceptionList = async ({ - http, - list, - signal, -}: UpdateExceptionListProps): Promise<ExceptionListSchema> => - http.fetch<ExceptionListSchema>(EXCEPTION_LIST_URL, { - body: JSON.stringify(list), - method: 'PUT', - signal, - version, - }); - -const updateExceptionListWithValidation = async ({ - http, - list, - signal, -}: UpdateExceptionListProps): Promise<ExceptionListSchema> => - flow( - () => - tryCatch( - () => - updateExceptionList({ - http, - list, - signal, - }), - toError - ), - chain((response) => fromEither(validateEither(exceptionListSchema, response))), - flow(toPromise) - )(); - -export { updateExceptionListWithValidation as updateExceptionList }; - -/** - * Update existing ExceptionListItem - * - * @param http Kibana http service - * @param listItem exception list item to add - * @param signal to cancel request - * - * @throws An error if response is not OK - * - */ -const updateExceptionListItem = async ({ - http, - listItem, - signal, -}: UpdateExceptionListItemProps): Promise<ExceptionListItemSchema> => - http.fetch<ExceptionListItemSchema>(EXCEPTION_LIST_ITEM_URL, { - body: JSON.stringify(listItem), - method: 'PUT', - signal, - version, - }); - -const updateExceptionListItemWithValidation = async ({ - http, - listItem, - signal, -}: UpdateExceptionListItemProps): Promise<ExceptionListItemSchema> => - flow( - () => - tryCatch( - () => - updateExceptionListItem({ - http, - listItem, - signal, - }), - toError - ), - chain((response) => fromEither(validateEither(exceptionListItemSchema, response))), - flow(toPromise) - )(); - -export { updateExceptionListItemWithValidation as updateExceptionListItem }; - -/** - * Fetch all ExceptionLists (optionally by namespaceType) - * - * @param http Kibana http service - * @param namespaceTypes ExceptionList namespace_types of lists to find - * @param filters search bar filters - * @param pagination optional - * @param signal to cancel request - * - * @throws An error if request params or response is not OK - */ -const fetchExceptionLists = async ({ - http, - filters, - namespaceTypes, - pagination, - signal, - sort, -}: ApiCallFetchExceptionListsProps): Promise<FoundExceptionListSchema> => { - const query = { - filter: filters || undefined, - namespace_type: namespaceTypes, - page: pagination.page ? `${pagination.page}` : '1', - per_page: pagination.perPage ? `${pagination.perPage}` : '20', - sort_field: sort?.field ? sort?.field : 'exception-list.created_at', - sort_order: sort?.order ? sort?.order : 'desc', - }; - - return http.fetch<FoundExceptionListSchema>(`${EXCEPTION_LIST_URL}/_find`, { - method: 'GET', - query, - signal, - version, - }); -}; - -const fetchExceptionListsWithValidation = async ({ - filters, - http, - namespaceTypes, - pagination, - signal, - sort, -}: ApiCallFetchExceptionListsProps): Promise<FoundExceptionListSchema> => - flow( - () => - tryCatch( - () => - fetchExceptionLists({ - filters, - http, - namespaceTypes, - pagination, - signal, - sort, - }), - toError - ), - chain((response) => fromEither(validateEither(foundExceptionListSchema, response))), - flow(toPromise) - )(); - -export { fetchExceptionListsWithValidation as fetchExceptionLists }; - -/** - * Fetch an ExceptionList by providing a ExceptionList ID - * - * @param http Kibana http service - * @param id ExceptionList ID (not list_id) - * @param namespaceType ExceptionList namespace_type - * @param signal to cancel request - * - * @throws An error if response is not OK - */ -const fetchExceptionListById = async ({ - http, - id, - namespaceType, - signal, -}: ApiCallByIdProps): Promise<ExceptionListSchema> => - http.fetch<ExceptionListSchema>(EXCEPTION_LIST_URL, { - method: 'GET', - query: { id, namespace_type: namespaceType }, - signal, - version, - }); - -const fetchExceptionListByIdWithValidation = async ({ - http, - id, - namespaceType, - signal, -}: ApiCallByIdProps): Promise<ExceptionListSchema> => - flow( - () => - tryCatch( - () => - fetchExceptionListById({ - http, - id, - namespaceType, - signal, - }), - toError - ), - chain((response) => fromEither(validateEither(exceptionListSchema, response))), - flow(toPromise) - )(); - -export { fetchExceptionListByIdWithValidation as fetchExceptionListById }; - -/** - * Fetch an ExceptionList's ExceptionItems by providing a ExceptionList list_id - * - * @param http Kibana http service - * @param listIds ExceptionList list_ids (not ID) - * @param namespaceTypes ExceptionList namespace_types - * @param search optional - simple search string - * @param filter optional - * @param pagination optional - * @param signal to cancel request - * - * @throws An error if response is not OK - */ -const fetchExceptionListsItemsByListIds = async ({ - http, - listIds, - namespaceTypes, - filter, - pagination, - search, - signal, -}: ApiCallByListIdProps): Promise<FoundExceptionListItemSchema> => { - const query = { - list_id: listIds.join(','), - namespace_type: namespaceTypes.join(','), - page: pagination.page ? `${pagination.page}` : '1', - per_page: pagination.perPage ? `${pagination.perPage}` : '20', - search, - sort_field: 'exception-list.created_at', - sort_order: 'desc', - filter, - }; - - return http.fetch<FoundExceptionListItemSchema>(`${EXCEPTION_LIST_ITEM_URL}/_find`, { - method: 'GET', - query, - signal, - version, - }); -}; - -const fetchExceptionListsItemsByListIdsWithValidation = async ({ - filter, - http, - listIds, - namespaceTypes, - pagination, - search, - signal, -}: ApiCallByListIdProps): Promise<FoundExceptionListItemSchema> => - flow( - () => - tryCatch( - () => - fetchExceptionListsItemsByListIds({ - filter, - http, - listIds, - namespaceTypes, - pagination, - search, - signal, - }), - toError - ), - chain((response) => fromEither(validateEither(foundExceptionListItemSchema, response))), - flow(toPromise) - )(); - -export { fetchExceptionListsItemsByListIdsWithValidation as fetchExceptionListsItemsByListIds }; - -/** - * Fetch an ExceptionListItem by providing a ExceptionListItem ID - * - * @param http Kibana http service - * @param id ExceptionListItem ID (not item_id) - * @param namespaceType ExceptionList namespace_type - * @param signal to cancel request - * - * @throws An error if response is not OK - */ -const fetchExceptionListItemById = async ({ - http, - id, - namespaceType, - signal, -}: ApiCallByIdProps): Promise<ExceptionListItemSchema> => - http.fetch<ExceptionListItemSchema>(EXCEPTION_LIST_ITEM_URL, { - method: 'GET', - query: { id, namespace_type: namespaceType }, - signal, - version, - }); - -const fetchExceptionListItemByIdWithValidation = async ({ - http, - id, - namespaceType, - signal, -}: ApiCallByIdProps): Promise<ExceptionListItemSchema> => - flow( - () => tryCatch(() => fetchExceptionListItemById({ http, id, namespaceType, signal }), toError), - chain((response) => fromEither(validateEither(exceptionListItemSchema, response))), - flow(toPromise) - )(); - -export { fetchExceptionListItemByIdWithValidation as fetchExceptionListItemById }; - -/** - * Delete an ExceptionList by providing a ExceptionList ID - * - * @param http Kibana http service - * @param id ExceptionList ID (not list_id) - * @param namespaceType ExceptionList namespace_type - * @param signal to cancel request - * - * @throws An error if response is not OK - */ -const deleteExceptionListById = async ({ - http, - id, - namespaceType, - signal, -}: ApiCallByIdProps): Promise<ExceptionListSchema> => - http.fetch<ExceptionListSchema>(EXCEPTION_LIST_URL, { - method: 'DELETE', - query: { id, namespace_type: namespaceType }, - signal, - version, - }); - -const deleteExceptionListByIdWithValidation = async ({ - http, - id, - namespaceType, - signal, -}: ApiCallByIdProps): Promise<ExceptionListSchema> => - flow( - () => tryCatch(() => deleteExceptionListById({ http, id, namespaceType, signal }), toError), - chain((response) => fromEither(validateEither(exceptionListSchema, response))), - flow(toPromise) - )(); - -export { deleteExceptionListByIdWithValidation as deleteExceptionListById }; - -/** - * Delete an ExceptionListItem by providing a ExceptionListItem ID - * - * @param http Kibana http service - * @param id ExceptionListItem ID (not item_id) - * @param namespaceType ExceptionList namespace_type - * @param signal to cancel request - * - * @throws An error if response is not OK - */ -const deleteExceptionListItemById = async ({ - http, - id, - namespaceType, - signal, -}: ApiCallByIdProps): Promise<ExceptionListItemSchema> => - http.fetch<ExceptionListItemSchema>(EXCEPTION_LIST_ITEM_URL, { - method: 'DELETE', - query: { id, namespace_type: namespaceType }, - signal, - version, - }); - -const deleteExceptionListItemByIdWithValidation = async ({ - http, - id, - namespaceType, - signal, -}: ApiCallByIdProps): Promise<ExceptionListItemSchema> => - flow( - () => tryCatch(() => deleteExceptionListItemById({ http, id, namespaceType, signal }), toError), - chain((response) => fromEither(validateEither(exceptionListItemSchema, response))), - flow(toPromise) - )(); - -export { deleteExceptionListItemByIdWithValidation as deleteExceptionListItemById }; - -/** - * Add new Endpoint ExceptionList - * - * @param http Kibana http service - * @param signal to cancel request - * - * @throws An error if response is not OK - * - */ -const addEndpointExceptionList = async ({ - http, - signal, -}: AddEndpointExceptionListProps): Promise<CreateEndpointListSchema> => - http.fetch<ExceptionListItemSchema>(ENDPOINT_LIST_URL, { - method: 'POST', - signal, - version, - }); - -const addEndpointExceptionListWithValidation = async ({ - http, - signal, -}: AddEndpointExceptionListProps): Promise<CreateEndpointListSchema> => - flow( - () => tryCatch(() => addEndpointExceptionList({ http, signal }), toError), - chain((response) => fromEither(validateEither(createEndpointListSchema, response))), - flow(toPromise) - )(); - -export { addEndpointExceptionListWithValidation as addEndpointExceptionList }; - -/** - * Export an ExceptionList by providing a ExceptionList ID - * - * @param http Kibana http service - * @param id ExceptionList ID (not list_id) - * @param includeExpiredExceptions boolean for including expired exceptions - * @param listId ExceptionList LIST_ID (not id) - * @param namespaceType ExceptionList namespace_type - * @param signal to cancel request - * - * @throws An error if response is not OK - */ -export const exportExceptionList = async ({ - http, - id, - includeExpiredExceptions, - listId, - namespaceType, - signal, -}: ExportExceptionListProps): Promise<Blob> => - http.fetch<Blob>(`${EXCEPTION_LIST_URL}/_export`, { - method: 'POST', - query: { - id, - list_id: listId, - namespace_type: namespaceType, - include_expired_exceptions: includeExpiredExceptions, - }, - signal, - version, - }); - -/** - * Create a Filter query from an exception list id - * - * @param exceptionListId The id of the exception list from which create a Filter query - * @param signal AbortSignal for cancelling request - * - * @throws An error if response is not OK - */ -export const getExceptionFilterFromExceptionListIds = async ({ - alias, - chunkSize, - exceptionListIds, - excludeExceptions, - http, - signal, -}: GetExceptionFilterFromExceptionListIdsProps): Promise<ExceptionFilterResponse> => - http.fetch(INTERNAL_EXCEPTION_FILTER, { - method: 'POST', - version: '1', - body: JSON.stringify({ - exception_list_ids: exceptionListIds, - type: 'exception_list_ids', - alias, - exclude_exceptions: excludeExceptions, - chunk_size: chunkSize, - }), - signal, - }); - -/** - * Create a Filter query from a list of exceptions - * - * @param exceptions Exception items to be made into a `Filter` query - * @param signal AbortSignal for cancelling request - * - * @throws An error if response is not OK - */ -export const getExceptionFilterFromExceptions = async ({ - exceptions, - alias, - excludeExceptions, - http, - chunkSize, - signal, -}: GetExceptionFilterFromExceptionsProps): Promise<ExceptionFilterResponse> => - http.fetch(INTERNAL_EXCEPTION_FILTER, { - method: 'POST', - version: '1', - body: JSON.stringify({ - exceptions, - type: 'exception_items', - alias, - exclude_exceptions: excludeExceptions, - chunk_size: chunkSize, - }), - signal, - }); - -/** - * Duplicate an ExceptionList and its items by providing a ExceptionList list_id - * - * @param http Kibana http service - * @param includeExpiredExceptions boolean for including exception items with expired TTL - * @param listId ExceptionList LIST_ID (not id) - * @param namespaceType ExceptionList namespace_type - * @param signal to cancel request - * - * @throws An error if response is not OK - */ -export const duplicateExceptionList = async ({ - http, - includeExpiredExceptions, - listId, - namespaceType, - signal, -}: DuplicateExceptionListProps): Promise<ExceptionListSchema> => - http.fetch<ExceptionListSchema>(`${EXCEPTION_LIST_URL}/_duplicate`, { - method: 'POST', - query: { - list_id: listId, - namespace_type: namespaceType, - include_expired_exceptions: includeExpiredExceptions, - }, - signal, - version, - }); diff --git a/packages/kbn-securitysolution-list-api/src/fp_utils/index.test.ts b/packages/kbn-securitysolution-list-api/src/fp_utils/index.test.ts deleted file mode 100644 index 98872f45cb77c..0000000000000 --- a/packages/kbn-securitysolution-list-api/src/fp_utils/index.test.ts +++ /dev/null @@ -1,26 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { tryCatch } from 'fp-ts/lib/TaskEither'; - -import { toPromise } from '.'; - -describe('toPromise', () => { - it('rejects with left if TaskEither is left', async () => { - const task = tryCatch(() => Promise.reject(new Error('whoops')), String); - - await expect(toPromise(task)).rejects.toEqual('Error: whoops'); - }); - - it('resolves with right if TaskEither is right', async () => { - const task = tryCatch(() => Promise.resolve('success'), String); - - await expect(toPromise(task)).resolves.toEqual('success'); - }); -}); diff --git a/packages/kbn-securitysolution-list-api/src/fp_utils/index.ts b/packages/kbn-securitysolution-list-api/src/fp_utils/index.ts deleted file mode 100644 index 5614a3e7cb8df..0000000000000 --- a/packages/kbn-securitysolution-list-api/src/fp_utils/index.ts +++ /dev/null @@ -1,25 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { pipe } from 'fp-ts/lib/pipeable'; -import { TaskEither } from 'fp-ts/lib/TaskEither'; -import { fold } from 'fp-ts/lib/Either'; - -// TODO: This is copied in a few other spots and probably should live within its own kbn package -// rather than living here. A package such as kbn-security-solution-fp-utils -export const toPromise = async <E, A>(taskEither: TaskEither<E, A>): Promise<A> => - pipe( - await taskEither(), - fold( - (e) => Promise.reject(e), - (a) => Promise.resolve(a) - ) - ); - -export const toError = (e: unknown): Error => (e instanceof Error ? e : new Error(String(e))); diff --git a/packages/kbn-securitysolution-list-api/src/list_api/index.test.ts b/packages/kbn-securitysolution-list-api/src/list_api/index.test.ts deleted file mode 100644 index 6b8698a707aa2..0000000000000 --- a/packages/kbn-securitysolution-list-api/src/list_api/index.test.ts +++ /dev/null @@ -1,445 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { createListIndex, deleteList, exportList, findLists, importList, readListIndex } from '.'; -import { - ApiPayload, - DeleteListParams, - ExportListParams, - FindListsParams, - ImportListParams, -} from '../types'; - -import { HttpFetchOptions } from '@kbn/core-http-browser'; -import { httpServiceMock } from '@kbn/core-http-browser-mocks'; - -import { getFoundListSchemaMock } from './mocks/response/found_list_schema.mock'; -import { getListResponseMock } from './mocks/response/list_schema.mock'; -import { getListItemIndexExistSchemaResponseMock } from './mocks/response/list_item_index_exist_schema.mock'; -import { getAcknowledgeSchemaResponseMock } from './mocks/response/acknowledge_schema.mock'; - -describe('Value Lists API', () => { - let httpMock: ReturnType<typeof httpServiceMock.createStartContract>; - - beforeEach(() => { - httpMock = httpServiceMock.createStartContract(); - }); - describe('deleteList', () => { - beforeEach(() => { - httpMock.fetch.mockResolvedValue(getListResponseMock()); - }); - - it('DELETEs specifying the id as a query parameter', async () => { - const abortCtrl = new AbortController(); - const payload: ApiPayload<DeleteListParams> = { - deleteReferences: false, - id: 'list-id', - ignoreReferences: true, - }; - await deleteList({ - http: httpMock, - ...payload, - signal: abortCtrl.signal, - }); - - expect(httpMock.fetch).toHaveBeenCalledWith( - '/api/lists', - expect.objectContaining({ - method: 'DELETE', - query: { deleteReferences: false, id: 'list-id', ignoreReferences: true }, - }) - ); - }); - - it('rejects with an error if request payload is invalid (and does not make API call)', async () => { - const abortCtrl = new AbortController(); - const payload: Omit<ApiPayload<DeleteListParams>, 'id'> & { - id: number; - } = { id: 23 }; - - await expect( - deleteList({ - http: httpMock, - ...(payload as unknown as ApiPayload<DeleteListParams>), - signal: abortCtrl.signal, - }) - ).rejects.toEqual(new Error('Invalid value "23" supplied to "id"')); - expect(httpMock.fetch).not.toHaveBeenCalled(); - }); - - it('rejects with an error if response payload is invalid', async () => { - const abortCtrl = new AbortController(); - const payload: ApiPayload<DeleteListParams> = { id: 'list-id' }; - const badResponse = { ...getListResponseMock(), id: undefined }; - httpMock.fetch.mockResolvedValue(badResponse); - - await expect( - deleteList({ - http: httpMock, - ...payload, - signal: abortCtrl.signal, - }) - ).rejects.toEqual(new Error('Invalid value "undefined" supplied to "id"')); - }); - }); - describe('findLists', () => { - beforeEach(() => { - httpMock.fetch.mockResolvedValue(getFoundListSchemaMock()); - }); - - it('GETs from the lists endpoint', async () => { - const abortCtrl = new AbortController(); - await findLists({ - http: httpMock, - pageIndex: 1, - pageSize: 10, - signal: abortCtrl.signal, - }); - - expect(httpMock.fetch).toHaveBeenCalledWith( - '/api/lists/_find', - expect.objectContaining({ - method: 'GET', - }) - ); - }); - - it('sends pagination as query parameters', async () => { - const abortCtrl = new AbortController(); - await findLists({ - cursor: 'cursor', - http: httpMock, - pageIndex: 1, - pageSize: 10, - signal: abortCtrl.signal, - }); - - expect(httpMock.fetch).toHaveBeenCalledWith( - '/api/lists/_find', - expect.objectContaining({ - query: { - cursor: 'cursor', - page: 1, - per_page: 10, - }, - }) - ); - }); - - it('sends sort_field and sort_order as query parameters', async () => { - const abortCtrl = new AbortController(); - await findLists({ - cursor: 'cursor', - http: httpMock, - pageIndex: 1, - pageSize: 10, - signal: abortCtrl.signal, - sortField: 'created_at', - sortOrder: 'desc', - }); - - expect(httpMock.fetch).toHaveBeenCalledWith( - '/api/lists/_find', - expect.objectContaining({ - query: { - cursor: 'cursor', - page: 1, - per_page: 10, - sort_field: 'created_at', - sort_order: 'desc', - }, - }) - ); - }); - - it('rejects with an error if request payload is invalid (and does not make API call)', async () => { - const abortCtrl = new AbortController(); - const payload: ApiPayload<FindListsParams> = { - pageIndex: 10, - pageSize: 0, - }; - - await expect( - findLists({ - http: httpMock, - ...payload, - signal: abortCtrl.signal, - }) - ).rejects.toEqual(new Error('Invalid value "0" supplied to "per_page"')); - expect(httpMock.fetch).not.toHaveBeenCalled(); - }); - - it('rejects with an error if response payload is invalid', async () => { - const abortCtrl = new AbortController(); - const payload: ApiPayload<FindListsParams> = { - pageIndex: 1, - pageSize: 10, - }; - const badResponse = { ...getFoundListSchemaMock(), cursor: undefined }; - httpMock.fetch.mockResolvedValue(badResponse); - - await expect( - findLists({ - http: httpMock, - ...payload, - signal: abortCtrl.signal, - }) - ).rejects.toEqual(new Error('Invalid value "undefined" supplied to "cursor"')); - }); - }); - describe('importList', () => { - beforeEach(() => { - httpMock.fetch.mockResolvedValue(getListResponseMock()); - }); - - it('POSTs the file', async () => { - const abortCtrl = new AbortController(); - const file = new File([], 'name'); - - await importList({ - file, - http: httpMock, - listId: 'my_list', - signal: abortCtrl.signal, - type: 'keyword', - }); - expect(httpMock.fetch).toHaveBeenCalledWith( - '/api/lists/items/_import', - expect.objectContaining({ - method: 'POST', - }) - ); - - // httpmock's fetch signature is inferred incorrectly - const [[, { body }]] = httpMock.fetch.mock.calls as unknown as Array< - [unknown, HttpFetchOptions] - >; - const actualFile = (body as FormData).get('file'); - expect(actualFile).toEqual(file); - }); - - it('sends type and id as query parameters', async () => { - const abortCtrl = new AbortController(); - const file = new File([], 'name'); - - await importList({ - file, - http: httpMock, - listId: 'my_list', - signal: abortCtrl.signal, - type: 'keyword', - }); - - expect(httpMock.fetch).toHaveBeenCalledWith( - '/api/lists/items/_import', - expect.objectContaining({ - query: { list_id: 'my_list', type: 'keyword' }, - }) - ); - }); - - it('rejects with an error if request body is invalid (and does not make API call)', async () => { - const abortCtrl = new AbortController(); - const payload: ApiPayload<ImportListParams> = { - file: undefined as unknown as File, - listId: 'list-id', - type: 'ip', - }; - - await expect( - importList({ - http: httpMock, - ...payload, - signal: abortCtrl.signal, - }) - ).rejects.toEqual(new Error('Invalid value "undefined" supplied to "file"')); - expect(httpMock.fetch).not.toHaveBeenCalled(); - }); - - it('rejects with an error if request params are invalid (and does not make API call)', async () => { - const abortCtrl = new AbortController(); - const file = new File([], 'name'); - const payload: ApiPayload<ImportListParams> = { - file, - listId: 'list-id', - type: 'other' as 'ip', - }; - - await expect( - importList({ - http: httpMock, - ...payload, - signal: abortCtrl.signal, - }) - ).rejects.toEqual(new Error('Invalid value "other" supplied to "type"')); - expect(httpMock.fetch).not.toHaveBeenCalled(); - }); - - it('rejects with an error if response payload is invalid', async () => { - const abortCtrl = new AbortController(); - const file = new File([], 'name'); - const payload: ApiPayload<ImportListParams> = { - file, - listId: 'list-id', - type: 'ip', - }; - const badResponse = { ...getListResponseMock(), id: undefined }; - httpMock.fetch.mockResolvedValue(badResponse); - - await expect( - importList({ - http: httpMock, - ...payload, - signal: abortCtrl.signal, - }) - ).rejects.toEqual(new Error('Invalid value "undefined" supplied to "id"')); - }); - }); - describe('exportList', () => { - beforeEach(() => { - httpMock.fetch.mockResolvedValue({}); - }); - - it('POSTs to the export endpoint', async () => { - const abortCtrl = new AbortController(); - - await exportList({ - http: httpMock, - listId: 'my_list', - signal: abortCtrl.signal, - }); - expect(httpMock.fetch).toHaveBeenCalledWith( - '/api/lists/items/_export', - expect.objectContaining({ - method: 'POST', - }) - ); - }); - - it('sends type and id as query parameters', async () => { - const abortCtrl = new AbortController(); - - await exportList({ - http: httpMock, - listId: 'my_list', - signal: abortCtrl.signal, - }); - expect(httpMock.fetch).toHaveBeenCalledWith( - '/api/lists/items/_export', - expect.objectContaining({ - query: { list_id: 'my_list' }, - }) - ); - }); - - it('rejects with an error if request params are invalid (and does not make API call)', async () => { - const abortCtrl = new AbortController(); - const payload: ApiPayload<ExportListParams> = { - listId: 23 as unknown as string, - }; - - await expect( - exportList({ - http: httpMock, - ...payload, - signal: abortCtrl.signal, - }) - ).rejects.toEqual(new Error('Invalid value "23" supplied to "list_id"')); - expect(httpMock.fetch).not.toHaveBeenCalled(); - }); - }); - - describe('readListIndex', () => { - beforeEach(() => { - httpMock.fetch.mockResolvedValue(getListItemIndexExistSchemaResponseMock()); - }); - - it('GETs the list index', async () => { - const abortCtrl = new AbortController(); - await readListIndex({ - http: httpMock, - signal: abortCtrl.signal, - }); - - expect(httpMock.fetch).toHaveBeenCalledWith( - '/api/lists/index', - expect.objectContaining({ - method: 'GET', - }) - ); - }); - - it('returns the response when valid', async () => { - const abortCtrl = new AbortController(); - const result = await readListIndex({ - http: httpMock, - signal: abortCtrl.signal, - }); - - expect(result).toEqual(getListItemIndexExistSchemaResponseMock()); - }); - - it('rejects with an error if response payload is invalid', async () => { - const abortCtrl = new AbortController(); - const badResponse = { ...getListItemIndexExistSchemaResponseMock(), list_index: undefined }; - httpMock.fetch.mockResolvedValue(badResponse); - - await expect( - readListIndex({ - http: httpMock, - signal: abortCtrl.signal, - }) - ).rejects.toEqual(new Error('Invalid value "undefined" supplied to "list_index"')); - }); - }); - - describe('createListIndex', () => { - beforeEach(() => { - httpMock.fetch.mockResolvedValue(getAcknowledgeSchemaResponseMock()); - }); - - it('GETs the list index', async () => { - const abortCtrl = new AbortController(); - await createListIndex({ - http: httpMock, - signal: abortCtrl.signal, - }); - - expect(httpMock.fetch).toHaveBeenCalledWith( - '/api/lists/index', - expect.objectContaining({ - method: 'POST', - }) - ); - }); - - it('returns the response when valid', async () => { - const abortCtrl = new AbortController(); - const result = await createListIndex({ - http: httpMock, - signal: abortCtrl.signal, - }); - - expect(result).toEqual(getAcknowledgeSchemaResponseMock()); - }); - - it('rejects with an error if response payload is invalid', async () => { - const abortCtrl = new AbortController(); - const badResponse = { acknowledged: undefined }; - httpMock.fetch.mockResolvedValue(badResponse); - - await expect( - createListIndex({ - http: httpMock, - signal: abortCtrl.signal, - }) - ).rejects.toEqual(new Error('Invalid value "undefined" supplied to "acknowledged"')); - }); - }); -}); diff --git a/packages/kbn-securitysolution-list-api/src/list_api/index.ts b/packages/kbn-securitysolution-list-api/src/list_api/index.ts deleted file mode 100644 index 3087ed5333cc4..0000000000000 --- a/packages/kbn-securitysolution-list-api/src/list_api/index.ts +++ /dev/null @@ -1,344 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { chain, fromEither, map, tryCatch } from 'fp-ts/lib/TaskEither'; -import { flow } from 'fp-ts/lib/function'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { validateEither } from '@kbn/securitysolution-io-ts-utils'; -import { - AcknowledgeSchema, - DeleteListSchemaEncoded, - ExportListItemQuerySchemaEncoded, - FindListSchemaEncoded, - FoundListSchema, - ImportListItemQuerySchemaEncoded, - ImportListItemSchemaEncoded, - ListItemIndexExistSchema, - ListSchema, - ReadListSchema, - acknowledgeSchema, - deleteListSchema, - readListSchema, - exportListItemQuerySchema, - findListSchema, - foundListSchema, - importListItemQuerySchema, - importListItemSchema, - listItemIndexExistSchema, - listSchema, - foundListsBySizeSchema, - FoundListsBySizeSchema, -} from '@kbn/securitysolution-io-ts-list-types'; -import { - LIST_INDEX, - LIST_ITEM_URL, - LIST_PRIVILEGES_URL, - LIST_URL, - INTERNAL_FIND_LISTS_BY_SIZE, -} from '@kbn/securitysolution-list-constants'; -import { toError, toPromise } from '../fp_utils'; - -import { - ApiParams, - DeleteListParams, - ExportListParams, - FindListsParams, - ImportListParams, - GetListByIdParams, -} from '../types'; - -export type { - ApiParams, - DeleteListParams, - ExportListParams, - FindListsParams, - ImportListParams, -} from '../types'; - -const version = '2023-10-31'; - -const findLists = async ({ - http, - cursor, - page, - // eslint-disable-next-line @typescript-eslint/naming-convention - per_page, - signal, - // eslint-disable-next-line @typescript-eslint/naming-convention - sort_field, - // eslint-disable-next-line @typescript-eslint/naming-convention - sort_order, -}: ApiParams & FindListSchemaEncoded): Promise<FoundListSchema> => { - return http.fetch(`${LIST_URL}/_find`, { - method: 'GET', - query: { - cursor, - page, - per_page, - sort_field, - sort_order, - }, - signal, - version, - }); -}; - -const findListsWithValidation = async ({ - cursor, - http, - pageIndex, - pageSize, - signal, - sortField, - sortOrder, -}: FindListsParams): Promise<FoundListSchema> => - pipe( - { - cursor: cursor != null ? cursor.toString() : undefined, - page: pageIndex != null ? pageIndex.toString() : undefined, - per_page: pageSize != null ? pageSize.toString() : undefined, - sort_field: sortField != null ? sortField.toString() : undefined, - sort_order: sortOrder, - }, - (payload) => fromEither(validateEither(findListSchema, payload)), - chain((payload) => tryCatch(() => findLists({ http, signal, ...payload }), toError)), - chain((response) => fromEither(validateEither(foundListSchema, response))), - flow(toPromise) - ); - -export { findListsWithValidation as findLists }; - -const findListsBySize = async ({ - http, - cursor, - page, - // eslint-disable-next-line @typescript-eslint/naming-convention - per_page, - signal, -}: ApiParams & FindListSchemaEncoded): Promise<FoundListsBySizeSchema> => { - return http.fetch(`${INTERNAL_FIND_LISTS_BY_SIZE}`, { - method: 'GET', - version: '1', - query: { - cursor, - page, - per_page, - }, - signal, - }); -}; - -const findListsBySizeWithValidation = async ({ - cursor, - http, - pageIndex, - pageSize, - signal, -}: FindListsParams): Promise<FoundListsBySizeSchema> => - pipe( - { - cursor: cursor != null ? cursor.toString() : undefined, - page: pageIndex != null ? pageIndex.toString() : undefined, - per_page: pageSize != null ? pageSize.toString() : undefined, - }, - (payload) => fromEither(validateEither(findListSchema, payload)), - chain((payload) => tryCatch(() => findListsBySize({ http, signal, ...payload }), toError)), - chain((response) => fromEither(validateEither(foundListsBySizeSchema, response))), - flow(toPromise) - ); - -export { findListsBySizeWithValidation as findListsBySize }; - -const importList = async ({ - file, - http, - // eslint-disable-next-line @typescript-eslint/naming-convention - list_id, - type, - signal, - refresh, -}: ApiParams & - ImportListItemSchemaEncoded & - ImportListItemQuerySchemaEncoded): Promise<ListSchema> => { - const formData = new FormData(); - formData.append('file', file as Blob); - - return http.fetch<ListSchema>(`${LIST_ITEM_URL}/_import`, { - body: formData, - headers: { 'Content-Type': undefined }, - method: 'POST', - query: { list_id, type, refresh }, - signal, - version, - }); -}; - -const importListWithValidation = async ({ - file, - http, - listId, - type, - signal, - refresh, -}: ImportListParams): Promise<ListSchema> => - pipe( - { - list_id: listId, - type, - refresh, - }, - (query) => fromEither(validateEither(importListItemQuerySchema, query)), - chain((query) => - pipe( - fromEither(validateEither(importListItemSchema, { file })), - map((body) => ({ ...body, ...query })) - ) - ), - chain((payload) => tryCatch(() => importList({ http, signal, ...payload }), toError)), - chain((response) => fromEither(validateEither(listSchema, response))), - toPromise - ); - -export { importListWithValidation as importList }; - -const deleteList = async ({ - deleteReferences = false, - http, - id, - ignoreReferences = false, - signal, -}: ApiParams & DeleteListSchemaEncoded): Promise<ListSchema> => - http.fetch<ListSchema>(LIST_URL, { - method: 'DELETE', - query: { deleteReferences, id, ignoreReferences }, - signal, - version, - }); - -const deleteListWithValidation = async ({ - deleteReferences, - http, - id, - ignoreReferences, - signal, -}: DeleteListParams): Promise<ListSchema> => - pipe( - { deleteReferences, id, ignoreReferences }, - (payload) => fromEither(validateEither(deleteListSchema, payload)), - chain((payload) => tryCatch(() => deleteList({ http, signal, ...payload }), toError)), - chain((response) => fromEither(validateEither(listSchema, response))), - flow(toPromise) - ); - -export { deleteListWithValidation as deleteList }; - -const exportList = async ({ - http, - // eslint-disable-next-line @typescript-eslint/naming-convention - list_id, - signal, -}: ApiParams & ExportListItemQuerySchemaEncoded): Promise<Blob> => - http.fetch<Blob>(`${LIST_ITEM_URL}/_export`, { - method: 'POST', - query: { list_id }, - signal, - version, - }); - -const exportListWithValidation = async ({ - http, - listId, - signal, -}: ExportListParams): Promise<Blob> => - pipe( - { list_id: listId }, - (payload) => fromEither(validateEither(exportListItemQuerySchema, payload)), - chain((payload) => tryCatch(() => exportList({ http, signal, ...payload }), toError)), - flow(toPromise) - ); - -export { exportListWithValidation as exportList }; - -const readListIndex = async ({ http, signal }: ApiParams): Promise<ListItemIndexExistSchema> => - http.fetch<ListItemIndexExistSchema>(LIST_INDEX, { - method: 'GET', - signal, - version, - }); - -const readListIndexWithValidation = async ({ - http, - signal, -}: ApiParams): Promise<ListItemIndexExistSchema> => - flow( - () => tryCatch(() => readListIndex({ http, signal }), toError), - chain((response) => fromEither(validateEither(listItemIndexExistSchema, response))), - flow(toPromise) - )(); - -export { readListIndexWithValidation as readListIndex }; - -// TODO add types and validation -export const readListPrivileges = async ({ http, signal }: ApiParams): Promise<unknown> => - http.fetch<unknown>(LIST_PRIVILEGES_URL, { - method: 'GET', - signal, - version, - }); - -const createListIndex = async ({ http, signal }: ApiParams): Promise<AcknowledgeSchema> => - http.fetch<AcknowledgeSchema>(LIST_INDEX, { - method: 'POST', - signal, - version, - }); - -const createListIndexWithValidation = async ({ - http, - signal, -}: ApiParams): Promise<AcknowledgeSchema> => - flow( - () => tryCatch(() => createListIndex({ http, signal }), toError), - chain((response) => fromEither(validateEither(acknowledgeSchema, response))), - flow(toPromise) - )(); - -export { createListIndexWithValidation as createListIndex }; - -const getListById = async ({ - http, - signal, - id, -}: ApiParams & ReadListSchema): Promise<ListSchema> => { - return http.fetch(`${LIST_URL}`, { - method: 'GET', - query: { - id, - }, - signal, - version, - }); -}; - -const getListByIdWithValidation = async ({ - http, - signal, - id, -}: GetListByIdParams): Promise<ListSchema> => - pipe( - { - id, - }, - (payload) => fromEither(validateEither(readListSchema, payload)), - chain((payload) => tryCatch(() => getListById({ http, signal, ...payload }), toError)), - chain((response) => fromEither(validateEither(listSchema, response))), - flow(toPromise) - ); - -export { getListByIdWithValidation as getListById }; diff --git a/packages/kbn-securitysolution-list-api/src/list_api/mocks/constants.mock.ts b/packages/kbn-securitysolution-list-api/src/list_api/mocks/constants.mock.ts deleted file mode 100644 index 3043cc70642c2..0000000000000 --- a/packages/kbn-securitysolution-list-api/src/list_api/mocks/constants.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export const DATE_NOW = '2020-04-20T15:25:31.830Z'; -export const USER = 'some user'; -export const ELASTIC_USER = 'elastic'; -export const NAME = 'some name'; -export const DESCRIPTION = 'some description'; -export const LIST_ID = 'some-list-id'; -export const TIE_BREAKER = '6a76b69d-80df-4ab2-8c3e-85f466b06a0e'; - -export const META = {}; -export const TYPE = 'ip'; - -export const VERSION = 1; -export const IMMUTABLE = false; diff --git a/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/acknowledge_schema.mock.ts b/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/acknowledge_schema.mock.ts deleted file mode 100644 index 788fab714e2d2..0000000000000 --- a/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/acknowledge_schema.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { AcknowledgeSchema } from '@kbn/securitysolution-io-ts-list-types'; - -export const getAcknowledgeSchemaResponseMock = (): AcknowledgeSchema => ({ - acknowledged: true, -}); diff --git a/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/found_list_schema.mock.ts b/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/found_list_schema.mock.ts deleted file mode 100644 index 436ddcd7a83db..0000000000000 --- a/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/found_list_schema.mock.ts +++ /dev/null @@ -1,20 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { FoundListSchema } from '@kbn/securitysolution-io-ts-list-types'; - -import { getListResponseMock } from './list_schema.mock'; - -export const getFoundListSchemaMock = (): FoundListSchema => ({ - cursor: '123', - data: [getListResponseMock()], - page: 1, - per_page: 1, - total: 1, -}); diff --git a/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/list_item_index_exist_schema.mock.ts b/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/list_item_index_exist_schema.mock.ts deleted file mode 100644 index 27a54a5fd96fc..0000000000000 --- a/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/list_item_index_exist_schema.mock.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { ListItemIndexExistSchema } from '@kbn/securitysolution-io-ts-list-types'; - -export const getListItemIndexExistSchemaResponseMock = (): ListItemIndexExistSchema => ({ - list_index: true, - list_item_index: true, -}); diff --git a/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/list_schema.mock.ts b/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/list_schema.mock.ts deleted file mode 100644 index 79ed256419770..0000000000000 --- a/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/list_schema.mock.ts +++ /dev/null @@ -1,57 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { ListSchema } from '@kbn/securitysolution-io-ts-list-types'; - -import { - DATE_NOW, - DESCRIPTION, - ELASTIC_USER, - IMMUTABLE, - LIST_ID, - META, - NAME, - TIE_BREAKER, - TYPE, - USER, - VERSION, -} from '../constants.mock'; - -export const getListResponseMock = (): ListSchema => ({ - '@timestamp': DATE_NOW, - _version: undefined, - created_at: DATE_NOW, - created_by: USER, - description: DESCRIPTION, - deserializer: undefined, - id: LIST_ID, - immutable: IMMUTABLE, - meta: META, - name: NAME, - serializer: undefined, - tie_breaker_id: TIE_BREAKER, - type: TYPE, - updated_at: DATE_NOW, - updated_by: USER, - version: VERSION, -}); - -/** - * This is useful for end to end tests where we remove the auto generated parts for comparisons - * such as created_at, updated_at, and id. - */ -export const getListResponseMockWithoutAutoGeneratedValues = (): Partial<ListSchema> => ({ - created_by: ELASTIC_USER, - description: DESCRIPTION, - immutable: IMMUTABLE, - name: NAME, - type: TYPE, - updated_by: ELASTIC_USER, - version: VERSION, -}); diff --git a/packages/kbn-securitysolution-list-api/src/list_item_api/index.test.ts b/packages/kbn-securitysolution-list-api/src/list_item_api/index.test.ts deleted file mode 100644 index 95e37ec434107..0000000000000 --- a/packages/kbn-securitysolution-list-api/src/list_item_api/index.test.ts +++ /dev/null @@ -1,173 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { createListItem, deleteListItem, findListItems, patchListItem } from '.'; -import { httpServiceMock } from '@kbn/core-http-browser-mocks'; -import { - getFoundListSchemaMock, - getCreateListItemResponseMock, - getUpdatedListItemResponseMock, - getDeletedListItemResponseMock, -} from './mocks/response'; - -describe('Value list item API', () => { - let httpMock: ReturnType<typeof httpServiceMock.createStartContract>; - beforeEach(() => { - httpMock = httpServiceMock.createStartContract(); - }); - - describe('findListItems', () => { - beforeEach(() => { - httpMock.fetch.mockResolvedValue(getFoundListSchemaMock()); - }); - - it('GETs from the lists endpoint with query params', async () => { - const abortCtrl = new AbortController(); - await findListItems({ - http: httpMock, - pageIndex: 1, - pageSize: 10, - signal: abortCtrl.signal, - filter: '*:*', - listId: 'list_id', - sortField: 'updated_at', - sortOrder: 'asc', - }); - - expect(httpMock.fetch).toHaveBeenCalledWith( - '/api/lists/items/_find', - expect.objectContaining({ - method: 'GET', - query: { - cursor: undefined, - filter: '*:*', - list_id: 'list_id', - page: 1, - per_page: 10, - sort_field: 'updated_at', - sort_order: 'asc', - }, - }) - ); - }); - }); - - describe('createListItem', () => { - beforeEach(() => { - httpMock.fetch.mockResolvedValue(getCreateListItemResponseMock()); - }); - - it('POSTs to the lists endpoint with the list item', async () => { - const abortCtrl = new AbortController(); - await createListItem({ - http: httpMock, - signal: abortCtrl.signal, - value: '123', - listId: 'list_id', - }); - - expect(httpMock.fetch).toHaveBeenCalledWith( - '/api/lists/items', - expect.objectContaining({ - method: 'POST', - body: JSON.stringify({ - value: '123', - list_id: 'list_id', - }), - }) - ); - }); - - it('returns the created list item', async () => { - const abortCtrl = new AbortController(); - const result = await createListItem({ - http: httpMock, - signal: abortCtrl.signal, - value: '123', - listId: 'list_id', - }); - - expect(result).toEqual(getCreateListItemResponseMock()); - }); - }); - - describe('patchListItem', () => { - beforeEach(() => { - httpMock.fetch.mockResolvedValue(getUpdatedListItemResponseMock()); - }); - - it('PATCH to the lists endpoint with the list item', async () => { - const abortCtrl = new AbortController(); - await patchListItem({ - http: httpMock, - signal: abortCtrl.signal, - id: 'item_id', - value: '123', - }); - - expect(httpMock.fetch).toHaveBeenCalledWith( - '/api/lists/items', - expect.objectContaining({ - method: 'PATCH', - body: JSON.stringify({ - id: 'item_id', - value: '123', - }), - }) - ); - }); - - it('returns the updated list item', async () => { - const abortCtrl = new AbortController(); - const result = await patchListItem({ - http: httpMock, - signal: abortCtrl.signal, - id: 'item_id', - value: '123', - }); - - expect(result).toEqual(getUpdatedListItemResponseMock()); - }); - }); - - describe('deleteListItem', () => { - beforeEach(() => { - httpMock.fetch.mockResolvedValue(getCreateListItemResponseMock()); - }); - - it('DELETE to the lists endpoint with the list item', async () => { - const abortCtrl = new AbortController(); - await deleteListItem({ - http: httpMock, - signal: abortCtrl.signal, - id: 'item_id', - refresh: 'true', - }); - - expect(httpMock.fetch).toHaveBeenCalledWith( - '/api/lists/items', - expect.objectContaining({ - method: 'DELETE', - query: { id: 'item_id', refresh: 'true' }, - }) - ); - }); - - it('returns the deleted list item', async () => { - const abortCtrl = new AbortController(); - const result = await deleteListItem({ - http: httpMock, - signal: abortCtrl.signal, - id: 'item_id', - }); - - expect(result).toEqual(getDeletedListItemResponseMock()); - }); - }); -}); diff --git a/packages/kbn-securitysolution-list-api/src/list_item_api/index.ts b/packages/kbn-securitysolution-list-api/src/list_item_api/index.ts deleted file mode 100644 index 8c6cdc358f70a..0000000000000 --- a/packages/kbn-securitysolution-list-api/src/list_item_api/index.ts +++ /dev/null @@ -1,227 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { - FindListItemSchema, - ListItemSchema, - deleteListItemSchema, - patchListItemSchema, - createListItemSchema, - findListItemSchema, - foundListItemSchema, - listItemSchema, - FoundListItemSchema, - DeleteListItemSchema, - PatchListItemSchema, - CreateListItemSchema, -} from '@kbn/securitysolution-io-ts-list-types'; -import { chain, fromEither, tryCatch } from 'fp-ts/lib/TaskEither'; -import { flow } from 'fp-ts/lib/function'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { validateEither } from '@kbn/securitysolution-io-ts-utils'; - -import { LIST_ITEM_URL } from '@kbn/securitysolution-list-constants'; -import { - ApiParams, - FindListItemsParams, - DeleteListItemParams, - PatchListItemParams, - CreateListItemParams, -} from '../types'; -import { toError, toPromise } from '../fp_utils'; - -const version = '2023-10-31'; - -/** - * Fetch list items - */ -const findListItems = async ({ - http, - cursor, - page, - // eslint-disable-next-line @typescript-eslint/naming-convention - list_id, - // eslint-disable-next-line @typescript-eslint/naming-convention - per_page, - signal, - // eslint-disable-next-line @typescript-eslint/naming-convention - sort_field, - // eslint-disable-next-line @typescript-eslint/naming-convention - sort_order, - filter, -}: ApiParams & FindListItemSchema): Promise<FoundListItemSchema> => { - return http.fetch(`${LIST_ITEM_URL}/_find`, { - method: 'GET', - query: { - cursor, - page, - per_page, - sort_field, - sort_order, - list_id, - filter, - }, - signal, - version, - }); -}; - -const findListItemsWithValidation = async ({ - cursor, - http, - pageIndex, - pageSize, - signal, - sortField, - sortOrder, - filter, - listId, -}: FindListItemsParams): Promise<FoundListItemSchema> => - pipe( - { - cursor: cursor != null ? cursor.toString() : undefined, - page: pageIndex != null ? pageIndex.toString() : undefined, - per_page: pageSize != null ? pageSize.toString() : undefined, - sort_field: sortField != null ? sortField.toString() : undefined, - filter: filter != null ? filter.toString() : undefined, - sort_order: sortOrder, - list_id: listId, - }, - (payload) => fromEither(validateEither(findListItemSchema, payload)), - chain((payload) => tryCatch(() => findListItems({ http, signal, ...payload }), toError)), - chain((response) => fromEither(validateEither(foundListItemSchema, response))), - flow(toPromise) - ); - -export { findListItemsWithValidation as findListItems }; - -const deleteListItem = async ({ - http, - id, - signal, - refresh, -}: ApiParams & DeleteListItemSchema): Promise<ListItemSchema> => - http.fetch<ListItemSchema>(LIST_ITEM_URL, { - method: 'DELETE', - query: { id, refresh }, - signal, - version, - }); - -const deleteListItemWithValidation = async ({ - http, - id, - signal, - refresh, -}: DeleteListItemParams): Promise<ListItemSchema> => - pipe( - { id, refresh }, - (payload) => fromEither(validateEither(deleteListItemSchema, payload)), - chain((payload) => - tryCatch( - () => - deleteListItem({ - http, - signal, - ...payload, - value: undefined, - list_id: undefined, - }), - toError - ) - ), - chain((response) => fromEither(validateEither(listItemSchema, response))), - flow(toPromise) - ); - -export { deleteListItemWithValidation as deleteListItem }; - -const patchListItem = async ({ - http, - id, - signal, - value, - _version, -}: ApiParams & PatchListItemSchema): Promise<ListItemSchema> => - http.fetch<ListItemSchema>(LIST_ITEM_URL, { - method: 'PATCH', - body: JSON.stringify({ id, value, _version }), - signal, - version, - }); - -const patchListItemWithValidation = async ({ - http, - id, - signal, - value, - refresh, - _version, -}: PatchListItemParams): Promise<ListItemSchema> => - pipe( - { id, value, _version, refresh }, - (payload) => fromEither(validateEither(patchListItemSchema, payload)), - chain((payload) => - tryCatch( - () => - patchListItem({ - http, - signal, - ...payload, - }), - toError - ) - ), - chain((response) => fromEither(validateEither(listItemSchema, response))), - flow(toPromise) - ); - -export { patchListItemWithValidation as patchListItem }; - -const createListItem = async ({ - http, - signal, - value, - // eslint-disable-next-line @typescript-eslint/naming-convention - list_id, - refresh, -}: ApiParams & CreateListItemSchema): Promise<ListItemSchema> => - http.fetch<ListItemSchema>(LIST_ITEM_URL, { - method: 'POST', - body: JSON.stringify({ value, list_id, refresh }), - signal, - version, - }); - -const createListItemWithValidation = async ({ - http, - signal, - value, - refresh, - listId, -}: CreateListItemParams): Promise<ListItemSchema> => - pipe( - { list_id: listId, value, refresh }, - (payload) => fromEither(validateEither(createListItemSchema, payload)), - chain((payload) => - tryCatch( - () => - createListItem({ - http, - signal, - ...payload, - }), - toError - ) - ), - chain((response) => fromEither(validateEither(listItemSchema, response))), - flow(toPromise) - ); - -export { createListItemWithValidation as createListItem }; diff --git a/packages/kbn-securitysolution-list-api/src/list_item_api/mocks/response/index.ts b/packages/kbn-securitysolution-list-api/src/list_item_api/mocks/response/index.ts deleted file mode 100644 index 5ef4e52adbe88..0000000000000 --- a/packages/kbn-securitysolution-list-api/src/list_item_api/mocks/response/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { FoundListItemSchema, ListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; - -import { getListItemResponseMock } from './list_item_schema.mock'; - -export const getFoundListSchemaMock = (): FoundListItemSchema => ({ - cursor: '123', - data: [getListItemResponseMock()], - page: 1, - per_page: 1, - total: 1, -}); - -export const getCreateListItemResponseMock = (): ListItemSchema => getListItemResponseMock(); -export const getUpdatedListItemResponseMock = (): ListItemSchema => getListItemResponseMock(); -export const getDeletedListItemResponseMock = (): ListItemSchema => getListItemResponseMock(); diff --git a/packages/kbn-securitysolution-list-api/src/list_item_api/mocks/response/list_item_schema.mock.ts b/packages/kbn-securitysolution-list-api/src/list_item_api/mocks/response/list_item_schema.mock.ts deleted file mode 100644 index eb67b97773548..0000000000000 --- a/packages/kbn-securitysolution-list-api/src/list_item_api/mocks/response/list_item_schema.mock.ts +++ /dev/null @@ -1,27 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { ListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; - -export const getListItemResponseMock = (): ListItemSchema => ({ - _version: '1', - '@timestamp': '2020-08-11T11:22:13.670Z', - created_at: '2020-08-11T11:22:13.670Z', - created_by: 'elastic', - deserializer: 'some deserializer', - id: 'bpdB3XMBx7pemMHopQ6M', - list_id: 'list_id', - meta: {}, - serializer: 'some serializer', - tie_breaker_id: '17d3befb-dc22-4b3c-a286-b5504c4fbeeb', - type: 'keyword', - updated_at: '2020-08-11T11:22:13.670Z', - updated_by: 'elastic', - value: 'some keyword', -}); diff --git a/packages/kbn-securitysolution-list-api/src/types.ts b/packages/kbn-securitysolution-list-api/src/types.ts deleted file mode 100644 index c78071bb5824f..0000000000000 --- a/packages/kbn-securitysolution-list-api/src/types.ts +++ /dev/null @@ -1,86 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { - SortFieldOrUndefined, - SortOrderOrUndefined, - Type, - Refresh, - RefreshWithWaitFor, -} from '@kbn/securitysolution-io-ts-list-types'; - -// TODO: Replace these with kbn packaged versions once we have those available to us -// These originally came from this location below before moving them to this hacked "any" types: -// import { HttpStart, NotificationsStart } from '../../../../../src/core/public'; -interface HttpStart { - fetch: <T>(...args: any) => any; -} - -export interface ApiParams { - http: HttpStart; - signal: AbortSignal; -} -export type ApiPayload<T extends ApiParams> = Omit<T, 'http' | 'signal'>; - -export interface FindListsParams extends ApiParams { - cursor?: string | undefined; - pageSize: number | undefined; - pageIndex: number | undefined; - sortOrder?: SortOrderOrUndefined; - sortField?: SortFieldOrUndefined; -} - -export interface FindListItemsParams extends ApiParams { - cursor?: string | undefined; - pageSize: number | undefined; - pageIndex: number | undefined; - sortOrder?: SortOrderOrUndefined; - sortField?: SortFieldOrUndefined; - filter: string | undefined; - listId: string; -} - -export interface ImportListParams extends ApiParams { - file: File; - listId: string | undefined; - type: Type | undefined; - refresh?: RefreshWithWaitFor; -} - -export interface DeleteListParams extends ApiParams { - deleteReferences?: boolean; - id: string; - ignoreReferences?: boolean; -} - -export interface DeleteListItemParams extends ApiParams { - refresh?: Refresh; - id: string; -} - -export interface PatchListItemParams extends ApiParams { - refresh?: Refresh; - id: string; - value: string; - _version?: string; -} - -export interface CreateListItemParams extends ApiParams { - refresh?: RefreshWithWaitFor; - value: string; - listId: string; -} - -export interface ExportListParams extends ApiParams { - listId: string; -} - -export interface GetListByIdParams extends ApiParams { - id: string; -} diff --git a/packages/kbn-securitysolution-list-api/tsconfig.json b/packages/kbn-securitysolution-list-api/tsconfig.json deleted file mode 100644 index 2c2ca29316fcd..0000000000000 --- a/packages/kbn-securitysolution-list-api/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts" - ], - "kbn_references": [ - "@kbn/securitysolution-io-ts-list-types", - "@kbn/securitysolution-io-ts-utils", - "@kbn/securitysolution-list-constants", - "@kbn/core-http-browser", - "@kbn/core-http-browser-mocks", - ], - "exclude": [ - "target/**/*", - ] -} diff --git a/packages/kbn-securitysolution-list-constants/index.ts b/packages/kbn-securitysolution-list-constants/index.ts deleted file mode 100644 index 6f1e8d01b830a..0000000000000 --- a/packages/kbn-securitysolution-list-constants/index.ts +++ /dev/null @@ -1,148 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { deepFreeze } from '@kbn/std'; - -/** - * Value list routes - */ -export const LIST_URL = '/api/lists'; -export const LIST_INDEX = `${LIST_URL}/index`; -export const LIST_ITEM_URL = `${LIST_URL}/items`; -export const LIST_PRIVILEGES_URL = `${LIST_URL}/privileges`; - -/** - * Internal value list routes - */ -export const INTERNAL_LIST_URL = '/internal/lists'; -export const INTERNAL_FIND_LISTS_BY_SIZE = `${INTERNAL_LIST_URL}/_find_lists_by_size` as const; -export const INTERNAL_EXCEPTION_FILTER = `${INTERNAL_LIST_URL}/_create_filter` as const; - -/** - * Exception list routes - */ -export const EXCEPTION_LIST_URL = '/api/exception_lists'; -export const EXCEPTION_LIST_ITEM_URL = '/api/exception_lists/items'; - -/** - * Internal exception list routes - */ -export const INTERNAL_EXCEPTION_LIST_URL = `/internal${EXCEPTION_LIST_URL}`; -export const INTERNAL_EXCEPTIONS_LIST_ENSURE_CREATED_URL = `${INTERNAL_EXCEPTION_LIST_URL}/_create`; - -/** - * Exception list spaces - */ -export const EXCEPTION_LIST_NAMESPACE_AGNOSTIC = 'exception-list-agnostic'; -export const EXCEPTION_LIST_NAMESPACE = 'exception-list'; - -/** - * Specific routes for the single global space agnostic endpoint list - */ -export const ENDPOINT_LIST_URL = '/api/endpoint_list'; - -/** - * Specific routes for the single global space agnostic endpoint list. These are convenience - * routes where they are going to try and create the global space agnostic endpoint list if it - * does not exist yet or if it was deleted at some point and re-create it before adding items to - * the list - */ -export const ENDPOINT_LIST_ITEM_URL = '/api/endpoint_list/items'; - -/** - * This ID is used for _both_ the Saved Object ID and for the list_id - * for the single global space agnostic endpoint list - */ -export const ENDPOINT_LIST_ID = 'endpoint_list'; - -/** The name of the single global space agnostic endpoint list */ -export const ENDPOINT_LIST_NAME = 'Endpoint Security Exception List'; - -/** The description of the single global space agnostic endpoint list */ -export const ENDPOINT_LIST_DESCRIPTION = 'Endpoint Security Exception List'; - -export const MAX_EXCEPTION_LIST_SIZE = 10000; - -export const MAXIMUM_SMALL_VALUE_LIST_SIZE = 65536; - -export const MAXIMUM_SMALL_IP_RANGE_VALUE_LIST_DASH_SIZE = 200; - -/** - * List definitions for Endpoint Artifact - */ -export const ENDPOINT_ARTIFACT_LISTS = deepFreeze({ - trustedApps: { - id: 'endpoint_trusted_apps', - name: 'Endpoint Security Trusted Apps List', - description: 'Endpoint Security Trusted Apps List', - }, - eventFilters: { - id: 'endpoint_event_filters', - name: 'Endpoint Security Event Filters List', - description: 'Endpoint Security Event Filters List', - }, - hostIsolationExceptions: { - id: 'endpoint_host_isolation_exceptions', - name: 'Endpoint Security Host isolation exceptions List', - description: 'Endpoint Security Host isolation exceptions List', - }, - blocklists: { - id: 'endpoint_blocklists', - name: 'Endpoint Security Blocklists List', - description: 'Endpoint Security Blocklists List', - }, -}); - -/** - * The IDs of all Endpoint artifact lists - */ -export const ENDPOINT_ARTIFACT_LIST_IDS = Object.freeze( - Object.values(ENDPOINT_ARTIFACT_LISTS).map(({ id }) => id) -); - -/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ -export const ENDPOINT_TRUSTED_APPS_LIST_ID = ENDPOINT_ARTIFACT_LISTS.trustedApps.id; - -/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ -export const ENDPOINT_TRUSTED_APPS_LIST_NAME = ENDPOINT_ARTIFACT_LISTS.trustedApps.name; - -/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ -export const ENDPOINT_TRUSTED_APPS_LIST_DESCRIPTION = - ENDPOINT_ARTIFACT_LISTS.trustedApps.description; - -/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ -export const ENDPOINT_EVENT_FILTERS_LIST_ID = ENDPOINT_ARTIFACT_LISTS.eventFilters.id; - -/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ -export const ENDPOINT_EVENT_FILTERS_LIST_NAME = ENDPOINT_ARTIFACT_LISTS.eventFilters.name; - -/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ -export const ENDPOINT_EVENT_FILTERS_LIST_DESCRIPTION = - ENDPOINT_ARTIFACT_LISTS.eventFilters.description; - -/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ -export const ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID = - ENDPOINT_ARTIFACT_LISTS.hostIsolationExceptions.id; - -/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ -export const ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_NAME = - ENDPOINT_ARTIFACT_LISTS.hostIsolationExceptions.name; - -/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ -export const ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_DESCRIPTION = - ENDPOINT_ARTIFACT_LISTS.hostIsolationExceptions.description; - -/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ -export const ENDPOINT_BLOCKLISTS_LIST_ID = ENDPOINT_ARTIFACT_LISTS.blocklists.id; - -/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ -export const ENDPOINT_BLOCKLISTS_LIST_NAME = ENDPOINT_ARTIFACT_LISTS.blocklists.name; - -/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ -export const ENDPOINT_BLOCKLISTS_LIST_DESCRIPTION = ENDPOINT_ARTIFACT_LISTS.blocklists.description; diff --git a/packages/kbn-securitysolution-list-constants/package.json b/packages/kbn-securitysolution-list-constants/package.json deleted file mode 100644 index 1b03f95f0f150..0000000000000 --- a/packages/kbn-securitysolution-list-constants/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@kbn/securitysolution-list-constants", - "version": "1.0.0", - "description": "security solution list constants to use across plugins such lists, security_solution, cases, etc...", - "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0", - "private": true -} \ No newline at end of file diff --git a/packages/kbn-securitysolution-list-constants/tsconfig.json b/packages/kbn-securitysolution-list-constants/tsconfig.json deleted file mode 100644 index 0cd8de173ed4f..0000000000000 --- a/packages/kbn-securitysolution-list-constants/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts" - ], - "kbn_references": [ - "@kbn/std" - ], - "exclude": [ - "target/**/*", - ] -} diff --git a/packages/kbn-securitysolution-list-hooks/index.ts b/packages/kbn-securitysolution-list-hooks/index.ts deleted file mode 100644 index 5ec2cb85d8c23..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/index.ts +++ /dev/null @@ -1,28 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './src/transforms'; -export * from './src/use_api'; -export * from './src/use_create_list_index'; -export * from './src/use_cursor'; -export * from './src/use_delete_list'; -export * from './src/use_exception_lists'; -export * from './src/use_export_list'; -export * from './src/use_find_lists'; -export * from './src/use_find_lists_by_size'; -export * from './src/use_import_list'; -export * from './src/use_persist_exception_item'; -export * from './src/use_persist_exception_list'; -export * from './src/use_read_list_index'; -export * from './src/use_read_list_privileges'; -export * from './src/use_find_list_items'; -export * from './src/use_create_list_item'; -export * from './src/use_delete_list_item'; -export * from './src/use_patch_list_item'; -export * from './src/use_get_list_by_id'; diff --git a/packages/kbn-securitysolution-list-hooks/jest.config.js b/packages/kbn-securitysolution-list-hooks/jest.config.js deleted file mode 100644 index f5fadd8bf399a..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/jest.config.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../..', - roots: ['<rootDir>/packages/kbn-securitysolution-list-hooks'], -}; diff --git a/packages/kbn-securitysolution-list-hooks/package.json b/packages/kbn-securitysolution-list-hooks/package.json deleted file mode 100644 index 3d9f2019d3f23..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@kbn/securitysolution-list-hooks", - "version": "1.0.0", - "description": "Security solution list ReactJS hooks", - "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0", - "private": true, - "sideEffects": false -} \ No newline at end of file diff --git a/packages/kbn-securitysolution-list-hooks/src/constants.ts b/packages/kbn-securitysolution-list-hooks/src/constants.ts deleted file mode 100644 index 333fb40ca4caf..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/constants.ts +++ /dev/null @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export const READ_INDEX_QUERY_KEY = ['detectionEngine', 'listIndex']; diff --git a/packages/kbn-securitysolution-list-hooks/src/index.ts b/packages/kbn-securitysolution-list-hooks/src/index.ts deleted file mode 100644 index 852d138b8931d..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/index.ts +++ /dev/null @@ -1,27 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './transforms'; -export * from './use_api'; -export * from './use_create_list_index'; -export * from './use_cursor'; -export * from './use_delete_list'; -export * from './use_exception_lists'; -export * from './use_export_list'; -export * from './use_find_lists'; -export * from './use_import_list'; -export * from './use_persist_exception_item'; -export * from './use_persist_exception_list'; -export * from './use_read_list_index'; -export * from './use_read_list_privileges'; -export * from './use_find_list_items'; -export * from './use_create_list_item'; -export * from './use_delete_list_item'; -export * from './use_patch_list_item'; -export * from './use_get_list_by_id'; diff --git a/packages/kbn-securitysolution-list-hooks/src/mocks/constants.mock.ts b/packages/kbn-securitysolution-list-hooks/src/mocks/constants.mock.ts deleted file mode 100644 index 67dcac046c8d2..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/mocks/constants.mock.ts +++ /dev/null @@ -1,101 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { - CommentsArray, - EntriesArray, - Entry, - EntryMatch, - EntryNested, - OsTypeArray, -} from '@kbn/securitysolution-io-ts-list-types'; - -export const DATE_NOW = '2020-04-20T15:25:31.830Z'; -export const USER = 'some user'; -export const ELASTIC_USER = 'elastic'; -export const NAME = 'some name'; -export const DESCRIPTION = 'some description'; -export const LIST_ID = 'some-list-id'; -export const TIE_BREAKER = '6a76b69d-80df-4ab2-8c3e-85f466b06a0e'; - -export const META = {}; -export const TYPE = 'ip'; - -export const VERSION = 1; -export const IMMUTABLE = false; -// Exception List specific -export const ID = 'uuid_here'; -export const NAMESPACE_TYPE = 'single'; -export const OS_TYPES: OsTypeArray = ['windows']; -export const TAGS = []; -export const UPDATED_COMMENTS = [ - { - comment: 'old comment', - id: 'old_created_id', - }, - { - comment: 'new comment', - id: 'new_id', - }, -]; -export const COMMENTS = []; -export const ENTRIES: EntriesArray = [ - { - entries: [{ field: 'nested.field', operator: 'included', type: 'match', value: 'some value' }], - field: 'some.parentField', - type: 'nested', - }, - { field: 'some.not.nested.field', operator: 'included', type: 'match', value: 'some value' }, -]; -export const ITEM_ID = 'some-list-item-id'; -export const ITEM_TYPE = 'simple'; -export const LIST_ITEM_ID = 'some-list-item-id'; -// ENTRIES_WITH_IDS should only be used to mock out functionality of a collection of transforms -// that are UI specific and useful for UI concerns that are inserted between the -// API and the actual user interface. In some ways these might be viewed as -// technical debt or to compensate for the differences and preferences -// of how ReactJS might prefer data vs. how we want to model data. -export const ENTRIES_WITH_IDS: EntriesArray = [ - { - entries: [ - { - field: 'nested.field', - id: '123', - operator: 'included', - type: 'match', - value: 'some value', - } as EntryMatch & { id: string }, - ], - field: 'some.parentField', - id: '123', - type: 'nested', - } as EntryNested & { id: string }, - { - field: 'some.not.nested.field', - id: '123', - operator: 'included', - type: 'match', - value: 'some value', - } as Entry & { id: string }, -]; - -export const COMMENTS_WITH_CREATEDAT_CREATEDBY: CommentsArray = [ - { - comment: 'old comment', - id: 'old_created_id', - created_at: '2022-01-08T15:25:31.830Z', - created_by: 'elastic', - }, - { - comment: 'new comment', - id: 'new_id', - created_at: '2022-05-14T15:25:31.830Z', - created_by: 'elastic', - }, -]; diff --git a/packages/kbn-securitysolution-list-hooks/src/mocks/request/update_exception_list_item_schema.mock.ts b/packages/kbn-securitysolution-list-hooks/src/mocks/request/update_exception_list_item_schema.mock.ts deleted file mode 100644 index 916ce0c81daca..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/mocks/request/update_exception_list_item_schema.mock.ts +++ /dev/null @@ -1,53 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { UpdateExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; - -import { - DESCRIPTION, - ENTRIES, - ID, - ITEM_ID, - ITEM_TYPE, - LIST_ITEM_ID, - META, - NAME, - NAMESPACE_TYPE, - OS_TYPES, - TAGS, - UPDATED_COMMENTS, -} from '../constants.mock'; - -export const getUpdateExceptionListItemSchemaMock = (): UpdateExceptionListItemSchema => ({ - _version: undefined, - comments: UPDATED_COMMENTS, - description: DESCRIPTION, - entries: ENTRIES, - id: ID, - item_id: LIST_ITEM_ID, - meta: META, - name: NAME, - namespace_type: NAMESPACE_TYPE, - os_types: ['linux'], - tags: TAGS, - type: ITEM_TYPE, -}); - -/** - * Useful for end to end tests and other mechanisms which want to fill in the values - * after doing a get of the structure. - */ -export const getUpdateMinimalExceptionListItemSchemaMock = (): UpdateExceptionListItemSchema => ({ - description: DESCRIPTION, - entries: ENTRIES, - item_id: ITEM_ID, - name: NAME, - os_types: OS_TYPES, - type: ITEM_TYPE, -}); diff --git a/packages/kbn-securitysolution-list-hooks/src/mocks/response/exception_list_item_schema.mock.ts b/packages/kbn-securitysolution-list-hooks/src/mocks/response/exception_list_item_schema.mock.ts deleted file mode 100644 index 0c5e732a1f301..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/mocks/response/exception_list_item_schema.mock.ts +++ /dev/null @@ -1,72 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; - -import { - COMMENTS, - DATE_NOW, - DESCRIPTION, - ELASTIC_USER, - ENTRIES, - ITEM_ID, - ITEM_TYPE, - LIST_ID, - META, - NAME, - NAMESPACE_TYPE, - OS_TYPES, - TIE_BREAKER, - USER, -} from '../constants.mock'; - -export const getExceptionListItemSchemaMock = ( - overrides?: Partial<ExceptionListItemSchema> -): ExceptionListItemSchema => ({ - _version: undefined, - comments: COMMENTS, - created_at: DATE_NOW, - created_by: USER, - description: DESCRIPTION, - entries: ENTRIES, - expire_time: undefined, - id: '1', - item_id: 'endpoint_list_item', - list_id: 'endpoint_list_id', - meta: META, - name: NAME, - namespace_type: NAMESPACE_TYPE, - os_types: [], - tags: ['user added string for a tag', 'malware'], - tie_breaker_id: TIE_BREAKER, - type: ITEM_TYPE, - updated_at: DATE_NOW, - updated_by: USER, - ...(overrides || {}), -}); - -/** - * This is useful for end to end tests where we remove the auto generated parts for comparisons - * such as created_at, updated_at, and id. - */ -export const getExceptionListItemResponseMockWithoutAutoGeneratedValues = - (): Partial<ExceptionListItemSchema> => ({ - comments: [], - created_by: ELASTIC_USER, - description: DESCRIPTION, - entries: ENTRIES, - item_id: ITEM_ID, - list_id: LIST_ID, - name: NAME, - namespace_type: 'single', - os_types: OS_TYPES, - tags: [], - type: ITEM_TYPE, - updated_by: ELASTIC_USER, - }); diff --git a/packages/kbn-securitysolution-list-hooks/src/mocks/response/found_list_schema.mock.ts b/packages/kbn-securitysolution-list-hooks/src/mocks/response/found_list_schema.mock.ts deleted file mode 100644 index 436ddcd7a83db..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/mocks/response/found_list_schema.mock.ts +++ /dev/null @@ -1,20 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { FoundListSchema } from '@kbn/securitysolution-io-ts-list-types'; - -import { getListResponseMock } from './list_schema.mock'; - -export const getFoundListSchemaMock = (): FoundListSchema => ({ - cursor: '123', - data: [getListResponseMock()], - page: 1, - per_page: 1, - total: 1, -}); diff --git a/packages/kbn-securitysolution-list-hooks/src/mocks/response/list_schema.mock.ts b/packages/kbn-securitysolution-list-hooks/src/mocks/response/list_schema.mock.ts deleted file mode 100644 index 79ed256419770..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/mocks/response/list_schema.mock.ts +++ /dev/null @@ -1,57 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { ListSchema } from '@kbn/securitysolution-io-ts-list-types'; - -import { - DATE_NOW, - DESCRIPTION, - ELASTIC_USER, - IMMUTABLE, - LIST_ID, - META, - NAME, - TIE_BREAKER, - TYPE, - USER, - VERSION, -} from '../constants.mock'; - -export const getListResponseMock = (): ListSchema => ({ - '@timestamp': DATE_NOW, - _version: undefined, - created_at: DATE_NOW, - created_by: USER, - description: DESCRIPTION, - deserializer: undefined, - id: LIST_ID, - immutable: IMMUTABLE, - meta: META, - name: NAME, - serializer: undefined, - tie_breaker_id: TIE_BREAKER, - type: TYPE, - updated_at: DATE_NOW, - updated_by: USER, - version: VERSION, -}); - -/** - * This is useful for end to end tests where we remove the auto generated parts for comparisons - * such as created_at, updated_at, and id. - */ -export const getListResponseMockWithoutAutoGeneratedValues = (): Partial<ListSchema> => ({ - created_by: ELASTIC_USER, - description: DESCRIPTION, - immutable: IMMUTABLE, - name: NAME, - type: TYPE, - updated_by: ELASTIC_USER, - version: VERSION, -}); diff --git a/packages/kbn-securitysolution-list-hooks/src/transforms/index.test.ts b/packages/kbn-securitysolution-list-hooks/src/transforms/index.test.ts deleted file mode 100644 index bb0cb6e6e9075..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/transforms/index.test.ts +++ /dev/null @@ -1,299 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { - CreateExceptionListItemSchema, - Entry, - EntryMatch, - EntryNested, - ExceptionListItemSchema, - UpdateExceptionListItemSchema, -} from '@kbn/securitysolution-io-ts-list-types'; -import { - addIdToExceptionItemEntries, - removeIdFromExceptionItemsEntries, - transformInput, - transformOutput, -} from '../..'; - -import { getCreateExceptionListItemSchemaMock } from '../mocks/request/create_exception_list_item_schema.mock'; -import { getUpdateExceptionListItemSchemaMock } from '../mocks/request/update_exception_list_item_schema.mock'; -import { getExceptionListItemSchemaMock } from '../mocks/response/exception_list_item_schema.mock'; -import { COMMENTS_WITH_CREATEDAT_CREATEDBY, ENTRIES_WITH_IDS } from '../mocks/constants.mock'; - -jest.mock('uuid', () => ({ - v4: jest.fn().mockReturnValue('123'), -})); - -describe('Exceptions transforms', () => { - describe('transformOutput', () => { - it('should return same output as input with stripped ids per entry - CreateExceptionListItemSchema', () => { - const mockCreateExceptionItem = { - ...getCreateExceptionListItemSchemaMock(), - entries: ENTRIES_WITH_IDS, - }; - const output = transformOutput(mockCreateExceptionItem); - const expectedOutput: CreateExceptionListItemSchema = getCreateExceptionListItemSchemaMock(); - - expect(output).toEqual(expectedOutput); - }); - - it('should return same output as input with stripped ids per entry - UpdateExceptionListItemSchema', () => { - const mockUpdateExceptionItem = { - ...getUpdateExceptionListItemSchemaMock(), - entries: ENTRIES_WITH_IDS, - }; - const output = transformOutput(mockUpdateExceptionItem); - const expectedOutput: UpdateExceptionListItemSchema = getUpdateExceptionListItemSchemaMock(); - - expect(output).toEqual(expectedOutput); - }); - it('should return output as input with stripped createdAt and createdBy per entry - UpdateExceptionListItemSchema', () => { - const mockUpdateExceptionItem = { - ...getUpdateExceptionListItemSchemaMock(), - entries: ENTRIES_WITH_IDS, - comments: COMMENTS_WITH_CREATEDAT_CREATEDBY, - }; - const output = transformOutput(mockUpdateExceptionItem); - const expectedOutput: UpdateExceptionListItemSchema = getUpdateExceptionListItemSchemaMock(); - - expect(output).toEqual(expectedOutput); - }); - }); - - describe('transformInput', () => { - it('should return same output as input with added ids per entry', () => { - const mockExceptionItem = getExceptionListItemSchemaMock(); - const output = transformInput(mockExceptionItem); - const expectedOutput: ExceptionListItemSchema = { - ...getExceptionListItemSchemaMock(), - entries: ENTRIES_WITH_IDS, - }; - - expect(output).toEqual(expectedOutput); - }); - }); - - describe('addIdToExceptionItemEntries', () => { - it('should return same output as input with added ids per entry', () => { - const mockExceptionItem: ExceptionListItemSchema = { - ...getExceptionListItemSchemaMock(), - entries: [ - { - field: 'some.not.nested.field', - operator: 'included', - type: 'match', - value: 'some value', - }, - ], - }; - const output = addIdToExceptionItemEntries(mockExceptionItem); - const expectedOutput: ExceptionListItemSchema = { - ...getExceptionListItemSchemaMock(), - entries: [ - { - field: 'some.not.nested.field', - id: '123', - operator: 'included', - type: 'match', - value: 'some value', - } as Entry & { id: string }, - ], - }; - - expect(output).toEqual(expectedOutput); - }); - - it('should return same output as input with added ids per nested entry', () => { - const mockExceptionItem: ExceptionListItemSchema = { - ...getExceptionListItemSchemaMock(), - entries: [ - { - entries: [ - { - field: 'nested.field', - operator: 'included', - type: 'match', - value: 'some value', - }, - ], - field: 'some.parentField', - type: 'nested', - }, - ], - }; - const output = addIdToExceptionItemEntries(mockExceptionItem); - const expectedOutput: ExceptionListItemSchema = { - ...getExceptionListItemSchemaMock(), - entries: [ - { - entries: [ - { - field: 'nested.field', - id: '123', - operator: 'included', - type: 'match', - value: 'some value', - } as EntryMatch & { id: string }, - ], - field: 'some.parentField', - id: '123', - type: 'nested', - } as EntryNested & { id: string }, - ], - }; - - expect(output).toEqual(expectedOutput); - }); - }); - - describe('removeIdFromExceptionItemsEntries', () => { - it('should return same output as input with stripped ids per entry - CreateExceptionListItemSchema', () => { - const mockCreateExceptionItem = { - ...getCreateExceptionListItemSchemaMock(), - entries: [ - { - field: 'some.not.nested.field', - id: '123', - operator: 'included', - type: 'match', - value: 'some value', - } as Entry & { id: string }, - ], - }; - const output = removeIdFromExceptionItemsEntries(mockCreateExceptionItem); - const expectedOutput: CreateExceptionListItemSchema = { - ...getCreateExceptionListItemSchemaMock(), - entries: [ - { - field: 'some.not.nested.field', - operator: 'included', - type: 'match', - value: 'some value', - }, - ], - }; - - expect(output).toEqual(expectedOutput); - }); - - it('should return same output as input with stripped ids per nested entry - CreateExceptionListItemSchema', () => { - const mockCreateExceptionItem = { - ...getCreateExceptionListItemSchemaMock(), - entries: [ - { - entries: [ - { - field: 'nested.field', - id: '123', - operator: 'included', - type: 'match', - value: 'some value', - } as EntryMatch & { id: string }, - ], - field: 'some.parentField', - id: '123', - type: 'nested', - } as EntryNested & { id: string }, - ], - }; - const output = removeIdFromExceptionItemsEntries(mockCreateExceptionItem); - const expectedOutput: CreateExceptionListItemSchema = { - ...getCreateExceptionListItemSchemaMock(), - entries: [ - { - entries: [ - { - field: 'nested.field', - operator: 'included', - type: 'match', - value: 'some value', - }, - ], - field: 'some.parentField', - type: 'nested', - }, - ], - }; - - expect(output).toEqual(expectedOutput); - }); - - it('should return same output as input with stripped ids per entry - UpdateExceptionListItemSchema', () => { - const mockUpdateExceptionItem = { - ...getUpdateExceptionListItemSchemaMock(), - entries: [ - { - field: 'some.not.nested.field', - id: '123', - operator: 'included', - type: 'match', - value: 'some value', - } as Entry & { id: string }, - ], - }; - const output = removeIdFromExceptionItemsEntries(mockUpdateExceptionItem); - const expectedOutput: UpdateExceptionListItemSchema = { - ...getUpdateExceptionListItemSchemaMock(), - entries: [ - { - field: 'some.not.nested.field', - operator: 'included', - type: 'match', - value: 'some value', - }, - ], - }; - - expect(output).toEqual(expectedOutput); - }); - - it('should return same output as input with stripped ids per nested entry - UpdateExceptionListItemSchema', () => { - const mockUpdateExceptionItem = { - ...getUpdateExceptionListItemSchemaMock(), - entries: [ - { - entries: [ - { - field: 'nested.field', - id: '123', - operator: 'included', - type: 'match', - value: 'some value', - } as EntryMatch & { id: string }, - ], - field: 'some.parentField', - id: '123', - type: 'nested', - } as EntryNested & { id: string }, - ], - }; - const output = removeIdFromExceptionItemsEntries(mockUpdateExceptionItem); - const expectedOutput: UpdateExceptionListItemSchema = { - ...getUpdateExceptionListItemSchemaMock(), - entries: [ - { - entries: [ - { - field: 'nested.field', - operator: 'included', - type: 'match', - value: 'some value', - }, - ], - field: 'some.parentField', - type: 'nested', - }, - ], - }; - - expect(output).toEqual(expectedOutput); - }); - }); -}); diff --git a/packages/kbn-securitysolution-list-hooks/src/transforms/index.ts b/packages/kbn-securitysolution-list-hooks/src/transforms/index.ts deleted file mode 100644 index c30ea9ad8679c..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/transforms/index.ts +++ /dev/null @@ -1,138 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { flow } from 'fp-ts/lib/function'; -import { addIdToItem, removeIdFromItem } from '@kbn/securitysolution-utils'; -import type { - CreateExceptionListItemSchema, - EntriesArray, - Entry, - ExceptionListItemSchema, - UpdateExceptionListItemSchema, -} from '@kbn/securitysolution-io-ts-list-types'; - -// These are a collection of transforms that are UI specific and useful for UI concerns -// that are inserted between the API and the actual user interface. In some ways these -// might be viewed as technical debt or to compensate for the differences and preferences -// of how ReactJS might prefer data vs. how we want to model data. Each function should have -// a description giving context around the transform. - -/** - * Transforms the output of exception items to compensate for technical debt or UI concerns such as - * ReactJS preferences for having ids within arrays if the data is not modeled that way. - * - * If you add a new transform of the output called "myNewTransform" do it - * in the form of: - * flow(removeIdFromExceptionItemsEntries, myNewTransform)(exceptionItem) - * - * @param exceptionItem The exceptionItem to transform the output of - * @returns The exceptionItem transformed from the output - */ -export const transformOutput = ( - exceptionItem: UpdateExceptionListItemSchema | ExceptionListItemSchema -): UpdateExceptionListItemSchema | ExceptionListItemSchema => - flow( - removeCreatedAtCreatedByFromCommentsOnUpdate, - removeIdFromExceptionItemsEntries - )(exceptionItem); - -export const transformNewItemOutput = ( - exceptionItem: CreateExceptionListItemSchema -): CreateExceptionListItemSchema => flow(removeIdFromExceptionItemsEntries)(exceptionItem); - -/** - * Transforms the output of rules to compensate for technical debt or UI concerns such as - * ReactJS preferences for having ids within arrays if the data is not modeled that way. - * - * If you add a new transform of the input called "myNewTransform" do it - * in the form of: - * flow(addIdToExceptionItemEntries, myNewTransform)(exceptionItem) - * - * @param exceptionItem The exceptionItem to transform the output of - * @returns The exceptionItem transformed from the output - */ -export const transformInput = (exceptionItem: ExceptionListItemSchema): ExceptionListItemSchema => - flow(addIdToExceptionItemEntries)(exceptionItem); - -/** - * This adds an id to the incoming exception item entries as ReactJS prefers to have - * an id added to them for use as a stable id. Later if we decide to change the data - * model to have id's within the array then this code should be removed. If not, then - * this code should stay as an adapter for ReactJS. - * - * This does break the type system slightly as we are lying a bit to the type system as we return - * the same exceptionItem as we have previously but are augmenting the arrays with an id which TypeScript - * doesn't mind us doing here. However, downstream you will notice that you have an id when the type - * does not indicate it. In that case use (ExceptionItem & { id: string }) temporarily if you're using the id. If you're not, - * you can ignore the id and just use the normal TypeScript with ReactJS. - * - * @param exceptionItem The exceptionItem to add an id to the threat matches. - * @returns exceptionItem The exceptionItem but with id added to the exception item entries - */ -export const addIdToExceptionItemEntries = ( - exceptionItem: ExceptionListItemSchema -): ExceptionListItemSchema => { - const entries = exceptionItem.entries.map((entry) => { - if (entry.type === 'nested') { - return addIdToItem({ - ...entry, - entries: entry.entries.map((nestedEntry) => addIdToItem(nestedEntry)), - }); - } else { - return addIdToItem(entry); - } - }); - return { ...exceptionItem, entries }; -}; - -/** - * This removes an id from the exceptionItem entries as ReactJS prefers to have - * an id added to them for use as a stable id. Later if we decide to change the data - * model to have id's within the array then this code should be removed. If not, then - * this code should stay as an adapter for ReactJS. - * - * @param exceptionItem The exceptionItem to remove an id from the entries. - * @returns exceptionItem The exceptionItem but with id removed from the entries - */ -export const removeIdFromExceptionItemsEntries = <T extends { entries: EntriesArray }>( - exceptionItem: T -): T => { - const { entries } = exceptionItem; - const entriesNoId = entries.map((entry) => { - if (entry.type === 'nested') { - return removeIdFromItem({ - ...entry, - entries: entry.entries.map((nestedEntry) => removeIdFromItem(nestedEntry)), - }); - } else { - return removeIdFromItem<Entry>(entry); - } - }); - return { ...exceptionItem, entries: entriesNoId }; -}; - -/** - * This removes createdAt, createdBy from the exceptionItem if a comment was added to - * the Exception item, and return the comment message with id to prevent creating the commet - * twice - * @param exceptionItem The exceptionItem to remove createdAt, createdBy from the comments array. - * @returns exceptionItem The exceptionItem with comments do not have createdAt, createdBy. - */ -export const removeCreatedAtCreatedByFromCommentsOnUpdate = ( - exceptionItem: UpdateExceptionListItemSchema | ExceptionListItemSchema -) => { - const { comments } = exceptionItem; - if (!comments || !comments.length) return exceptionItem; - - const entriesNoCreatedAtAndBy = comments.map(({ comment, id }) => ({ - comment, - id, - })); - return { ...exceptionItem, comments: entriesNoCreatedAtAndBy }; -}; diff --git a/packages/kbn-securitysolution-list-hooks/src/use_api/index.ts b/packages/kbn-securitysolution-list-hooks/src/use_api/index.ts deleted file mode 100644 index 4ce917f5ad95b..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_api/index.ts +++ /dev/null @@ -1,317 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { useMemo } from 'react'; -import type { - CreateExceptionListItemSchema, - ExceptionListItemSchema, - ExceptionListSchema, - UpdateExceptionListItemSchema, - ApiCallFindListsItemsMemoProps, - ApiCallMemoProps, - ApiListExportProps, - ApiCallGetExceptionFilterFromIdsMemoProps, - ApiCallGetExceptionFilterFromExceptionsMemoProps, - ApiListDuplicateProps, -} from '@kbn/securitysolution-io-ts-list-types'; -import * as Api from '@kbn/securitysolution-list-api'; -import { getIdsAndNamespaces } from '@kbn/securitysolution-list-utils'; -import type { HttpStart } from '@kbn/core-http-browser'; - -import { transformInput, transformNewItemOutput, transformOutput } from '../transforms'; - -export interface ExceptionsApi { - addExceptionListItem: (arg: { - listItem: CreateExceptionListItemSchema; - }) => Promise<ExceptionListItemSchema>; - updateExceptionListItem: (arg: { - listItem: UpdateExceptionListItemSchema; - }) => Promise<ExceptionListItemSchema>; - deleteExceptionItem: (arg: ApiCallMemoProps) => Promise<void>; - deleteExceptionList: (arg: ApiCallMemoProps) => Promise<void>; - duplicateExceptionList: (arg: ApiListDuplicateProps) => Promise<void>; - getExceptionItem: ( - arg: ApiCallMemoProps & { onSuccess: (arg: ExceptionListItemSchema) => void } - ) => Promise<void>; - getExceptionList: ( - arg: ApiCallMemoProps & { onSuccess: (arg: ExceptionListSchema) => void } - ) => Promise<void>; - getExceptionListsItems: (arg: ApiCallFindListsItemsMemoProps) => Promise<void>; - getExceptionFilterFromIds: (arg: ApiCallGetExceptionFilterFromIdsMemoProps) => Promise<void>; - getExceptionFilterFromExceptions: ( - arg: ApiCallGetExceptionFilterFromExceptionsMemoProps - ) => Promise<void>; - exportExceptionList: (arg: ApiListExportProps) => Promise<void>; -} - -export const useApi = (http: HttpStart): ExceptionsApi => { - return useMemo( - (): ExceptionsApi => ({ - async addExceptionListItem({ - listItem, - }: { - listItem: CreateExceptionListItemSchema; - }): Promise<ExceptionListItemSchema> { - const abortCtrl = new AbortController(); - const sanitizedItem: CreateExceptionListItemSchema = transformNewItemOutput(listItem); - - return Api.addExceptionListItem({ - http, - listItem: sanitizedItem, - signal: abortCtrl.signal, - }); - }, - async deleteExceptionItem({ - id, - namespaceType, - onSuccess, - onError, - }: ApiCallMemoProps): Promise<void> { - const abortCtrl = new AbortController(); - - try { - await Api.deleteExceptionListItemById({ - http, - id, - namespaceType, - signal: abortCtrl.signal, - }); - onSuccess(); - } catch (error) { - onError(error); - } - }, - async deleteExceptionList({ - id, - namespaceType, - onSuccess, - onError, - }: ApiCallMemoProps): Promise<void> { - const abortCtrl = new AbortController(); - - try { - await Api.deleteExceptionListById({ - http, - id, - namespaceType, - signal: abortCtrl.signal, - }); - onSuccess(); - } catch (error) { - onError(error); - } - }, - async duplicateExceptionList({ - includeExpiredExceptions, - listId, - namespaceType, - onError, - onSuccess, - }: ApiListDuplicateProps): Promise<void> { - const abortCtrl = new AbortController(); - - try { - const newList = await Api.duplicateExceptionList({ - http, - includeExpiredExceptions, - listId, - namespaceType, - signal: abortCtrl.signal, - }); - onSuccess(newList); - } catch (error) { - onError(error); - } - }, - async exportExceptionList({ - id, - includeExpiredExceptions, - listId, - namespaceType, - onError, - onSuccess, - }: ApiListExportProps): Promise<void> { - const abortCtrl = new AbortController(); - - try { - const blob = await Api.exportExceptionList({ - http, - id, - includeExpiredExceptions, - listId, - namespaceType, - signal: abortCtrl.signal, - }); - onSuccess(blob); - } catch (error) { - onError(error); - } - }, - async getExceptionItem({ - id, - namespaceType, - onSuccess, - onError, - }: ApiCallMemoProps & { onSuccess: (arg: ExceptionListItemSchema) => void }): Promise<void> { - const abortCtrl = new AbortController(); - - try { - const item = transformInput( - await Api.fetchExceptionListItemById({ - http, - id, - namespaceType, - signal: abortCtrl.signal, - }) - ); - onSuccess(item); - } catch (error) { - onError(error); - } - }, - async getExceptionList({ - id, - namespaceType, - onSuccess, - onError, - }: ApiCallMemoProps & { onSuccess: (arg: ExceptionListSchema) => void }): Promise<void> { - const abortCtrl = new AbortController(); - - try { - const list = await Api.fetchExceptionListById({ - http, - id, - namespaceType, - signal: abortCtrl.signal, - }); - onSuccess(list); - } catch (error) { - onError(error); - } - }, - async getExceptionListsItems({ - lists, - filter, - pagination, - showDetectionsListsOnly, - showEndpointListsOnly, - onSuccess, - onError, - }: ApiCallFindListsItemsMemoProps): Promise<void> { - const abortCtrl = new AbortController(); - const { ids, namespaces } = getIdsAndNamespaces({ - lists, - showDetection: showDetectionsListsOnly, - showEndpoint: showEndpointListsOnly, - }); - - try { - if (ids.length > 0 && namespaces.length > 0) { - const { - data, - page, - per_page: perPage, - total, - } = await Api.fetchExceptionListsItemsByListIds({ - filter, - http, - listIds: ids, - namespaceTypes: namespaces, - pagination, - signal: abortCtrl.signal, - }); - onSuccess({ - // This data transform is UI specific and useful for UI concerns - // to compensate for the differences and preferences of how ReactJS might prefer - // data vs. how we want to model data. View `transformInput` for more details - exceptions: data.map((item) => transformInput(item)), - pagination: { - page, - perPage, - total, - }, - }); - } else { - onSuccess({ - exceptions: [], - pagination: { - page: 0, - perPage: pagination.perPage != null ? pagination.perPage : 0, - total: 0, - }, - }); - } - } catch (error) { - onError(error); - } - }, - async getExceptionFilterFromIds({ - exceptionListIds, - chunkSize, - alias, - excludeExceptions, - onSuccess, - onError, - }: ApiCallGetExceptionFilterFromIdsMemoProps): Promise<void> { - const abortCtrl = new AbortController(); - try { - const { filter } = await Api.getExceptionFilterFromExceptionListIds({ - http, - exceptionListIds, - signal: abortCtrl.signal, - chunkSize, - alias, - excludeExceptions, - }); - onSuccess(filter); - } catch (error) { - onError(error); - } - }, - async getExceptionFilterFromExceptions({ - exceptions, - chunkSize, - alias, - excludeExceptions, - onSuccess, - onError, - }: ApiCallGetExceptionFilterFromExceptionsMemoProps): Promise<void> { - const abortCtrl = new AbortController(); - try { - const { filter } = await Api.getExceptionFilterFromExceptions({ - http, - exceptions, - signal: abortCtrl.signal, - chunkSize, - alias, - excludeExceptions, - }); - onSuccess(filter); - } catch (error) { - onError(error); - } - }, - async updateExceptionListItem({ - listItem, - }: { - listItem: UpdateExceptionListItemSchema; - }): Promise<ExceptionListItemSchema> { - const abortCtrl = new AbortController(); - const sanitizedItem: UpdateExceptionListItemSchema = transformOutput(listItem); - - return Api.updateExceptionListItem({ - http, - listItem: sanitizedItem, - signal: abortCtrl.signal, - }); - }, - }), - [http] - ); -}; diff --git a/packages/kbn-securitysolution-list-hooks/src/use_create_list_index/index.ts b/packages/kbn-securitysolution-list-hooks/src/use_create_list_index/index.ts deleted file mode 100644 index 06b87f510796c..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_create_list_index/index.ts +++ /dev/null @@ -1,43 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { useMutation, useQueryClient } from '@tanstack/react-query'; - -import { createListIndex, ApiParams } from '@kbn/securitysolution-list-api'; -import { withOptionalSignal } from '@kbn/securitysolution-hook-utils'; - -import { READ_INDEX_QUERY_KEY } from '../constants'; - -const createListIndexWithOptionalSignal = withOptionalSignal(createListIndex); - -export const useCreateListIndex = ({ - http, - onError, -}: { - http: ApiParams['http']; - onError?: (err: unknown) => void; -}) => { - const queryClient = useQueryClient(); - - const { mutate, isLoading, error } = useMutation( - () => createListIndexWithOptionalSignal({ http }), - { - onSuccess: () => { - queryClient.invalidateQueries(READ_INDEX_QUERY_KEY); - }, - onError, - } - ); - - return { - start: mutate, - loading: isLoading, - error, - }; -}; diff --git a/packages/kbn-securitysolution-list-hooks/src/use_create_list_item/index.ts b/packages/kbn-securitysolution-list-hooks/src/use_create_list_item/index.ts deleted file mode 100644 index 98939d93185d6..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_create_list_item/index.ts +++ /dev/null @@ -1,43 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { UseMutationOptions } from '@tanstack/react-query'; -import type { ListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; -import type { IHttpFetchError } from '@kbn/core-http-browser'; -import { useMutation } from '@tanstack/react-query'; -import { createListItem } from '@kbn/securitysolution-list-api'; -import type { CreateListItemParams } from '@kbn/securitysolution-list-api'; -import { withOptionalSignal } from '@kbn/securitysolution-hook-utils'; - -import { useInvalidateListItemQuery } from '../use_find_list_items'; - -const createListItemWithOptionalSignal = withOptionalSignal(createListItem); - -export const CREATE_LIST_ITEM_MUTATION_KEY = ['POST', 'LIST_ITEM_CREATE']; -type CreateListMutationParams = Omit<CreateListItemParams, 'refresh' | 'signal'>; - -export const useCreateListItemMutation = ( - options?: UseMutationOptions<ListItemSchema, IHttpFetchError<Error>, CreateListMutationParams> -) => { - const invalidateListItemQuery = useInvalidateListItemQuery(); - return useMutation<ListItemSchema, IHttpFetchError<Error>, CreateListMutationParams>( - ({ listId, value, http }) => - createListItemWithOptionalSignal({ listId, value, http, refresh: 'wait_for' }), - { - ...options, - mutationKey: CREATE_LIST_ITEM_MUTATION_KEY, - onSettled: (...args) => { - invalidateListItemQuery(); - if (options?.onSettled) { - options.onSettled(...args); - } - }, - } - ); -}; diff --git a/packages/kbn-securitysolution-list-hooks/src/use_cursor/index.test.ts b/packages/kbn-securitysolution-list-hooks/src/use_cursor/index.test.ts deleted file mode 100644 index ca94eda81f950..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_cursor/index.test.ts +++ /dev/null @@ -1,121 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { renderHook, act } from '@testing-library/react'; - -import { UseCursorProps, useCursor } from '.'; - -describe('useCursor', () => { - it('returns undefined cursor if no values have been set', () => { - const { result } = renderHook((props: UseCursorProps) => useCursor(props), { - initialProps: { pageIndex: 0, pageSize: 0 }, - }); - - expect(result.current[0]).toBeUndefined(); - }); - - it('retrieves a cursor for the next page of a given page size', () => { - const { rerender, result } = renderHook((props: UseCursorProps) => useCursor(props), { - initialProps: { pageIndex: 0, pageSize: 0 }, - }); - rerender({ pageIndex: 1, pageSize: 1 }); - act(() => { - result.current[1]('new_cursor'); - }); - - expect(result.current[0]).toBeUndefined(); - - rerender({ pageIndex: 2, pageSize: 1 }); - expect(result.current[0]).toEqual('new_cursor'); - }); - - it('returns undefined cursor for an unknown search', () => { - const { rerender, result } = renderHook((props: UseCursorProps) => useCursor(props), { - initialProps: { pageIndex: 0, pageSize: 0 }, - }); - act(() => { - result.current[1]('new_cursor'); - }); - - rerender({ pageIndex: 1, pageSize: 2 }); - expect(result.current[0]).toBeUndefined(); - }); - - it('remembers cursor through rerenders', () => { - const { rerender, result } = renderHook((props: UseCursorProps) => useCursor(props), { - initialProps: { pageIndex: 0, pageSize: 0 }, - }); - - rerender({ pageIndex: 1, pageSize: 1 }); - act(() => { - result.current[1]('new_cursor'); - }); - - rerender({ pageIndex: 2, pageSize: 1 }); - expect(result.current[0]).toEqual('new_cursor'); - - rerender({ pageIndex: 0, pageSize: 0 }); - expect(result.current[0]).toBeUndefined(); - - rerender({ pageIndex: 2, pageSize: 1 }); - expect(result.current[0]).toEqual('new_cursor'); - }); - - it('remembers multiple cursors', () => { - const { rerender, result } = renderHook((props: UseCursorProps) => useCursor(props), { - initialProps: { pageIndex: 0, pageSize: 0 }, - }); - - rerender({ pageIndex: 1, pageSize: 1 }); - act(() => { - result.current[1]('new_cursor'); - }); - rerender({ pageIndex: 2, pageSize: 2 }); - act(() => { - result.current[1]('another_cursor'); - }); - - rerender({ pageIndex: 2, pageSize: 1 }); - expect(result.current[0]).toEqual('new_cursor'); - - rerender({ pageIndex: 3, pageSize: 2 }); - expect(result.current[0]).toEqual('another_cursor'); - }); - - it('returns the "nearest" cursor for the given page size', () => { - const { rerender, result } = renderHook((props: UseCursorProps) => useCursor(props), { - initialProps: { pageIndex: 0, pageSize: 0 }, - }); - - rerender({ pageIndex: 1, pageSize: 2 }); - act(() => { - result.current[1]('cursor1'); - }); - rerender({ pageIndex: 2, pageSize: 2 }); - act(() => { - result.current[1]('cursor2'); - }); - rerender({ pageIndex: 3, pageSize: 2 }); - act(() => { - result.current[1]('cursor3'); - }); - - rerender({ pageIndex: 2, pageSize: 2 }); - expect(result.current[0]).toEqual('cursor1'); - - rerender({ pageIndex: 3, pageSize: 2 }); - expect(result.current[0]).toEqual('cursor2'); - - rerender({ pageIndex: 4, pageSize: 2 }); - expect(result.current[0]).toEqual('cursor3'); - - rerender({ pageIndex: 6, pageSize: 2 }); - expect(result.current[0]).toEqual('cursor3'); - }); -}); diff --git a/packages/kbn-securitysolution-list-hooks/src/use_cursor/index.ts b/packages/kbn-securitysolution-list-hooks/src/use_cursor/index.ts deleted file mode 100644 index b8e8df0438828..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_cursor/index.ts +++ /dev/null @@ -1,46 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { useCallback, useState } from 'react'; - -export interface UseCursorProps { - pageIndex: number; - pageSize: number; -} -type Cursor = string | undefined; -type SetCursor = (cursor: Cursor) => void; -type UseCursor = (props: UseCursorProps) => [Cursor, SetCursor]; - -const hash = (props: UseCursorProps): string => JSON.stringify(props); - -export const useCursor: UseCursor = ({ pageIndex, pageSize }) => { - const [cache, setCache] = useState<Record<string, Cursor>>({}); - - const setCursor = useCallback<SetCursor>( - (cursor) => { - setCache({ - ...cache, - [hash({ pageIndex: pageIndex + 1, pageSize })]: cursor, - }); - }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [pageIndex, pageSize] - ); - - let cursor: Cursor; - for (let i = pageIndex; i >= 0; i--) { - const currentProps = { pageIndex: i, pageSize }; - cursor = cache[hash(currentProps)]; - if (cursor) { - break; - } - } - - return [cursor, setCursor]; -}; diff --git a/packages/kbn-securitysolution-list-hooks/src/use_delete_list/index.ts b/packages/kbn-securitysolution-list-hooks/src/use_delete_list/index.ts deleted file mode 100644 index fe88e19f84892..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_delete_list/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { deleteList } from '@kbn/securitysolution-list-api'; -import { useAsync, withOptionalSignal } from '@kbn/securitysolution-hook-utils'; - -const deleteListWithOptionalSignal = withOptionalSignal(deleteList); - -export const useDeleteList = () => useAsync(deleteListWithOptionalSignal); diff --git a/packages/kbn-securitysolution-list-hooks/src/use_delete_list_item/index.ts b/packages/kbn-securitysolution-list-hooks/src/use_delete_list_item/index.ts deleted file mode 100644 index 63107edda73a9..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_delete_list_item/index.ts +++ /dev/null @@ -1,41 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { UseMutationOptions } from '@tanstack/react-query'; -import type { ListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; -import { useMutation } from '@tanstack/react-query'; -import { deleteListItem } from '@kbn/securitysolution-list-api'; -import type { IHttpFetchError } from '@kbn/core-http-browser'; -import type { DeleteListItemParams } from '@kbn/securitysolution-list-api'; -import { withOptionalSignal } from '@kbn/securitysolution-hook-utils'; -import { useInvalidateListItemQuery } from '../use_find_list_items'; - -const deleteListItemWithOptionalSignal = withOptionalSignal(deleteListItem); - -export const DELETE_LIST_ITEM_MUTATION_KEY = ['POST', ' DELETE_LIST_ITEM_MUTATION']; -type DeleteListMutationParams = Omit<DeleteListItemParams, 'refresh' | 'signal'>; - -export const useDeleteListItemMutation = ( - options?: UseMutationOptions<ListItemSchema, IHttpFetchError<Error>, DeleteListMutationParams> -) => { - const invalidateListItemQuery = useInvalidateListItemQuery(); - return useMutation<ListItemSchema, IHttpFetchError<Error>, DeleteListMutationParams>( - ({ id, http }) => deleteListItemWithOptionalSignal({ id, http }), - { - ...options, - mutationKey: DELETE_LIST_ITEM_MUTATION_KEY, - onSettled: (...args) => { - invalidateListItemQuery(); - if (options?.onSettled) { - options.onSettled(...args); - } - }, - } - ); -}; diff --git a/packages/kbn-securitysolution-list-hooks/src/use_exception_lists/index.ts b/packages/kbn-securitysolution-list-hooks/src/use_exception_lists/index.ts deleted file mode 100644 index 2907de45eba40..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_exception_lists/index.ts +++ /dev/null @@ -1,142 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import type { - ExceptionListSchema, - UseExceptionListsProps, - Pagination, - Sort, -} from '@kbn/securitysolution-io-ts-list-types'; -import { fetchExceptionLists } from '@kbn/securitysolution-list-api'; - -import { getFilters } from '@kbn/securitysolution-list-utils'; - -export type Func = () => void; -export type ReturnExceptionLists = [ - loading: boolean, - exceptionLists: ExceptionListSchema[], - pagination: Pagination, - setPagination: React.Dispatch<React.SetStateAction<Pagination>>, - fetchLists: Func | null, - sort: Sort, - setSort: React.Dispatch<React.SetStateAction<Sort>> -]; - -const DEFAULT_PAGINATION = { - page: 1, - perPage: 20, - total: 0, -}; - -const DEFAULT_SORT = { - field: 'created_at', - order: 'desc', -}; - -/** - * Hook for fetching ExceptionLists - * - * @param http Kibana http service - * @param errorMessage message shown to user if error occurs - * @param filterOptions filter by certain fields - * @param namespaceTypes spaces to be searched - * @param notifications kibana service for displaying toasters - * @param hideLists a list of listIds we don't want to query - * @param initialPagination - * - */ -export const useExceptionLists = ({ - errorMessage, - http, - initialPagination = DEFAULT_PAGINATION, - filterOptions = {}, - namespaceTypes, - notifications, - hideLists = [], - initialSort = DEFAULT_SORT, -}: UseExceptionListsProps): ReturnExceptionLists => { - const [exceptionLists, setExceptionLists] = useState<ExceptionListSchema[]>([]); - const [pagination, setPagination] = useState<Pagination>(initialPagination); - const [sort, setSort] = useState<Sort>(initialSort); - const [loading, setLoading] = useState(true); - const abortCtrlRef = useRef<AbortController>(); - - const namespaceTypesAsString = useMemo(() => namespaceTypes.join(','), [namespaceTypes]); - const filters = useMemo( - (): string => - getFilters({ - filters: filterOptions, - namespaceTypes, - hideLists, - }), - [namespaceTypes, filterOptions, hideLists] - ); - - const fetchData = useCallback(async (): Promise<void> => { - try { - setLoading(true); - - abortCtrlRef.current = new AbortController(); - - const { - page, - per_page: perPage, - total, - data, - } = await fetchExceptionLists({ - filters, - http, - namespaceTypes: namespaceTypesAsString, - pagination: { - page: pagination.page, - perPage: pagination.perPage, - }, - sort, - signal: abortCtrlRef.current.signal, - }); - - setPagination({ - page, - perPage, - total, - }); - setExceptionLists(data); - setLoading(false); - } catch (error) { - if (error.name !== 'AbortError') { - notifications.toasts.addError(error, { - title: errorMessage, - }); - setExceptionLists([]); - setPagination(DEFAULT_PAGINATION); - setLoading(false); - } - } - }, [ - errorMessage, - filters, - http, - namespaceTypesAsString, - notifications.toasts, - pagination.page, - pagination.perPage, - sort, - ]); - - useEffect(() => { - fetchData(); - - return (): void => { - abortCtrlRef.current?.abort(); - }; - }, [fetchData]); - - return [loading, exceptionLists, pagination, setPagination, fetchData, sort, setSort]; -}; diff --git a/packages/kbn-securitysolution-list-hooks/src/use_export_list/index.ts b/packages/kbn-securitysolution-list-hooks/src/use_export_list/index.ts deleted file mode 100644 index 77a213cc47b9c..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_export_list/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { exportList } from '@kbn/securitysolution-list-api'; -import { useAsync, withOptionalSignal } from '@kbn/securitysolution-hook-utils'; - -const exportListWithOptionalSignal = withOptionalSignal(exportList); - -export const useExportList = () => useAsync(exportListWithOptionalSignal); diff --git a/packages/kbn-securitysolution-list-hooks/src/use_find_list_items/index.ts b/packages/kbn-securitysolution-list-hooks/src/use_find_list_items/index.ts deleted file mode 100644 index f385408d26fdd..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_find_list_items/index.ts +++ /dev/null @@ -1,75 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { useCallback } from 'react'; -import { useQuery, useQueryClient } from '@tanstack/react-query'; -import { findListItems, ApiParams } from '@kbn/securitysolution-list-api'; -import { withOptionalSignal } from '@kbn/securitysolution-hook-utils'; -import { useCursor } from '../use_cursor'; - -const findListItemsWithOptionalSignal = withOptionalSignal(findListItems); - -const FIND_LIST_ITEMS_QUERY_KEY = 'FIND_LIST_ITEMS'; - -export const useInvalidateListItemQuery = () => { - const queryClient = useQueryClient(); - - return useCallback(() => { - queryClient.invalidateQueries([FIND_LIST_ITEMS_QUERY_KEY], { - refetchType: 'active', - }); - }, [queryClient]); -}; - -export const useFindListItems = ({ - pageIndex, - pageSize, - sortField, - sortOrder, - listId, - filter, - http, -}: { - pageIndex: number; - pageSize: number; - sortField: string; - sortOrder: 'asc' | 'desc'; - listId: string; - filter: string; - http: ApiParams['http']; -}) => { - const [cursor, setCursor] = useCursor({ pageIndex, pageSize }); - return useQuery( - [FIND_LIST_ITEMS_QUERY_KEY, pageIndex, pageSize, sortField, sortOrder, listId, filter], - async ({ signal }) => { - const response = await findListItemsWithOptionalSignal({ - http, - signal, - pageIndex, - pageSize, - sortField, - sortOrder, - listId, - cursor, - filter, - }); - return response; - }, - { - keepPreviousData: true, - refetchOnWindowFocus: false, - retry: false, - onSuccess: (data) => { - if (data?.cursor) { - setCursor(data?.cursor); - } - }, - } - ); -}; diff --git a/packages/kbn-securitysolution-list-hooks/src/use_find_lists/index.test.ts b/packages/kbn-securitysolution-list-hooks/src/use_find_lists/index.test.ts deleted file mode 100644 index fcce54ac3be32..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_find_lists/index.test.ts +++ /dev/null @@ -1,39 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { waitFor, renderHook, act } from '@testing-library/react'; - -import { useFindLists } from '.'; -import { httpServiceMock } from '@kbn/core-http-browser-mocks'; -import * as Api from '@kbn/securitysolution-list-api'; - -import { getFoundListSchemaMock } from '../mocks/response/found_list_schema.mock'; - -jest.mock('@kbn/securitysolution-list-api'); - -describe('useFindLists', () => { - let httpMock: ReturnType<typeof httpServiceMock.createStartContract>; - - beforeEach(() => { - httpMock = httpServiceMock.createStartContract(); - (Api.findLists as jest.Mock).mockResolvedValue(getFoundListSchemaMock()); - }); - - it('invokes Api.findLists', async () => { - const { result } = renderHook(() => useFindLists()); - act(() => { - result.current.start({ http: httpMock, pageIndex: 1, pageSize: 10 }); - }); - await waitFor(() => - expect(Api.findLists).toHaveBeenCalledWith( - expect.objectContaining({ http: httpMock, pageIndex: 1, pageSize: 10 }) - ) - ); - }); -}); diff --git a/packages/kbn-securitysolution-list-hooks/src/use_find_lists/index.ts b/packages/kbn-securitysolution-list-hooks/src/use_find_lists/index.ts deleted file mode 100644 index a33e3ba9f8607..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_find_lists/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { findLists } from '@kbn/securitysolution-list-api'; -import { useAsync, withOptionalSignal } from '@kbn/securitysolution-hook-utils'; - -const findListsWithOptionalSignal = withOptionalSignal(findLists); - -export const useFindLists = () => useAsync(findListsWithOptionalSignal); diff --git a/packages/kbn-securitysolution-list-hooks/src/use_find_lists_by_size/index.ts b/packages/kbn-securitysolution-list-hooks/src/use_find_lists_by_size/index.ts deleted file mode 100644 index 25027ee3901d2..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_find_lists_by_size/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { findListsBySize } from '@kbn/securitysolution-list-api'; -import { useAsync, withOptionalSignal } from '@kbn/securitysolution-hook-utils'; - -const findListsBySizeWithOptionalSignal = withOptionalSignal(findListsBySize); - -export const useFindListsBySize = () => useAsync(findListsBySizeWithOptionalSignal); diff --git a/packages/kbn-securitysolution-list-hooks/src/use_get_list_by_id/index.ts b/packages/kbn-securitysolution-list-hooks/src/use_get_list_by_id/index.ts deleted file mode 100644 index 030fbcfae829f..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_get_list_by_id/index.ts +++ /dev/null @@ -1,28 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { useQuery } from '@tanstack/react-query'; -import { getListById, ApiParams } from '@kbn/securitysolution-list-api'; -import { withOptionalSignal } from '@kbn/securitysolution-hook-utils'; - -const getListByIdWithOptionalSignal = withOptionalSignal(getListById); - -const GET_LIST_BY_ID_QUERY_KEY = 'GET_LIST_BY_ID'; -export const useGetListById = ({ http, id }: { http: ApiParams['http']; id: string }) => { - return useQuery( - [GET_LIST_BY_ID_QUERY_KEY, id], - async ({ signal }) => { - const respone = await getListByIdWithOptionalSignal({ http, signal, id }); - return respone; - }, - { - refetchOnWindowFocus: false, - } - ); -}; diff --git a/packages/kbn-securitysolution-list-hooks/src/use_import_list/index.ts b/packages/kbn-securitysolution-list-hooks/src/use_import_list/index.ts deleted file mode 100644 index 1bbccd1448017..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_import_list/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { importList } from '@kbn/securitysolution-list-api'; -import { useAsync, withOptionalSignal } from '@kbn/securitysolution-hook-utils'; - -const importListWithOptionalSignal = withOptionalSignal(importList); - -export const useImportList = () => useAsync(importListWithOptionalSignal); diff --git a/packages/kbn-securitysolution-list-hooks/src/use_patch_list_item/index.ts b/packages/kbn-securitysolution-list-hooks/src/use_patch_list_item/index.ts deleted file mode 100644 index cdae3015cff81..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_patch_list_item/index.ts +++ /dev/null @@ -1,42 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { UseMutationOptions } from '@tanstack/react-query'; -import type { ListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; -import { useMutation } from '@tanstack/react-query'; -import type { PatchListItemParams } from '@kbn/securitysolution-list-api'; -import { patchListItem } from '@kbn/securitysolution-list-api'; -import type { IHttpFetchError } from '@kbn/core-http-browser'; -import { withOptionalSignal } from '@kbn/securitysolution-hook-utils'; -import { useInvalidateListItemQuery } from '../use_find_list_items'; - -const patchListItemWithOptionalSignal = withOptionalSignal(patchListItem); - -export const PATCH_LIST_ITEM_MUTATION_KEY = ['PATCH', 'LIST_ITEM_MUTATION']; -type PatchListMutationParams = Omit<PatchListItemParams, 'refresh' | 'signal'>; - -export const usePatchListItemMutation = ( - options?: UseMutationOptions<ListItemSchema, IHttpFetchError<Error>, PatchListMutationParams> -) => { - const invalidateListItemQuery = useInvalidateListItemQuery(); - return useMutation<ListItemSchema, IHttpFetchError<Error>, PatchListMutationParams>( - ({ id, value, _version, http }: PatchListMutationParams) => - patchListItemWithOptionalSignal({ id, value, http, refresh: 'true', _version }), - { - ...options, - mutationKey: PATCH_LIST_ITEM_MUTATION_KEY, - onSettled: (...args) => { - invalidateListItemQuery(); - if (options?.onSettled) { - options.onSettled(...args); - } - }, - } - ); -}; diff --git a/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.ts b/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.ts deleted file mode 100644 index 79f8748345fdf..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { Dispatch, useEffect, useRef, useState } from 'react'; -import type { - CreateExceptionListItemSchema, - PersistHookProps, - UpdateExceptionListItemSchema, -} from '@kbn/securitysolution-io-ts-list-types'; -import { addExceptionListItem, updateExceptionListItem } from '@kbn/securitysolution-list-api'; - -import { transformNewItemOutput, transformOutput } from '../transforms'; - -interface PersistReturnExceptionItem { - isLoading: boolean; - isSaved: boolean; -} - -export type ReturnPersistExceptionItem = [ - PersistReturnExceptionItem, - Dispatch<CreateExceptionListItemSchema | UpdateExceptionListItemSchema | null> -]; - -// TODO: Add this to @kbn/securitysolution-list-hooks - -/** - * Hook for creating or updating ExceptionListItem - * - * @param http Kibana http service - * @param onError error callback - * - */ -export const usePersistExceptionItem = ({ - http, - onError, -}: PersistHookProps): ReturnPersistExceptionItem => { - const [exceptionListItem, setExceptionItem] = useState< - CreateExceptionListItemSchema | UpdateExceptionListItemSchema | null - >(null); - const [isSaved, setIsSaved] = useState(false); - const [isLoading, setIsLoading] = useState(false); - const isUpdateExceptionItem = (item: unknown): item is UpdateExceptionListItemSchema => - Boolean(item && (item as UpdateExceptionListItemSchema).id != null); - const isSubscribed = useRef(false); - - useEffect(() => { - let abortCtrl: AbortController | null = null; - isSubscribed.current = true; - setIsSaved(false); - - const saveExceptionItem = async (): Promise<void> => { - if (exceptionListItem === null) { - return; - } - - try { - abortCtrl = new AbortController(); - setIsLoading(true); - - if (isUpdateExceptionItem(exceptionListItem)) { - // Please see `x-pack/plugins/lists/public/exceptions/transforms.ts` doc notes - // for context around the temporary `id` - const transformedList = transformOutput(exceptionListItem); - - await updateExceptionListItem({ - http, - listItem: transformedList, - signal: abortCtrl.signal, - }); - } else { - // Please see `x-pack/plugins/lists/public/exceptions/transforms.ts` doc notes - // for context around the temporary `id` - const transformedList = transformNewItemOutput(exceptionListItem); - - await addExceptionListItem({ - http, - listItem: transformedList, - signal: abortCtrl.signal, - }); - } - - if (isSubscribed.current) { - setIsSaved(true); - } - } catch (error) { - if (isSubscribed.current) { - onError(error); - } - } finally { - if (isSubscribed.current) { - setIsLoading(false); - } - } - }; - - saveExceptionItem(); - - return (): void => { - isSubscribed.current = false; - abortCtrl?.abort(); - }; - }, [http, exceptionListItem, onError]); - - return [{ isLoading, isSaved }, setExceptionItem]; -}; diff --git a/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_list/index.ts b/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_list/index.ts deleted file mode 100644 index 8648516d008cc..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_list/index.ts +++ /dev/null @@ -1,81 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { Dispatch, useEffect, useState } from 'react'; -import type { - AddExceptionList, - PersistHookProps, - UpdateExceptionListSchema, -} from '@kbn/securitysolution-io-ts-list-types'; -import { addExceptionList, updateExceptionList } from '@kbn/securitysolution-list-api'; - -interface PersistReturnExceptionList { - isLoading: boolean; - isSaved: boolean; -} - -export type ReturnPersistExceptionList = [ - PersistReturnExceptionList, - Dispatch<AddExceptionList | null> -]; - -/** - * Hook for creating or updating ExceptionList - * - * @param http Kibana http service - * @param onError error callback - * - */ -export const usePersistExceptionList = ({ - http, - onError, -}: PersistHookProps): ReturnPersistExceptionList => { - const [exceptionList, setExceptionList] = useState<AddExceptionList | null>(null); - const [isSaved, setIsSaved] = useState(false); - const [isLoading, setIsLoading] = useState(false); - const isUpdateExceptionList = (item: unknown): item is UpdateExceptionListSchema => - Boolean(item && (item as UpdateExceptionListSchema).id != null); - - useEffect(() => { - let isSubscribed = true; - const abortCtrl = new AbortController(); - setIsSaved(false); - - const saveExceptionList = async (): Promise<void> => { - if (exceptionList != null) { - try { - setIsLoading(true); - if (isUpdateExceptionList(exceptionList)) { - await updateExceptionList({ http, list: exceptionList, signal: abortCtrl.signal }); - } else { - await addExceptionList({ http, list: exceptionList, signal: abortCtrl.signal }); - } - if (isSubscribed) { - setIsSaved(true); - } - } catch (error) { - if (isSubscribed) { - onError(error); - } - } - if (isSubscribed) { - setIsLoading(false); - } - } - }; - - saveExceptionList(); - return (): void => { - isSubscribed = false; - abortCtrl.abort(); - }; - }, [http, exceptionList, onError]); - - return [{ isLoading, isSaved }, setExceptionList]; -}; diff --git a/packages/kbn-securitysolution-list-hooks/src/use_read_list_index/index.ts b/packages/kbn-securitysolution-list-hooks/src/use_read_list_index/index.ts deleted file mode 100644 index 4853f0a7480a8..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_read_list_index/index.ts +++ /dev/null @@ -1,51 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { useQuery } from '@tanstack/react-query'; - -import { readListIndex, ApiParams } from '@kbn/securitysolution-list-api'; -import { withOptionalSignal } from '@kbn/securitysolution-hook-utils'; - -import { READ_INDEX_QUERY_KEY } from '../constants'; - -const readListIndexWithOptionalSignal = withOptionalSignal(readListIndex); - -export const useReadListIndex = ({ - http, - isEnabled, - onError, -}: { - isEnabled: boolean; - http: ApiParams['http']; - onError?: (err: unknown) => void; -}) => { - const query = useQuery( - READ_INDEX_QUERY_KEY, - async ({ signal }) => { - if (!isEnabled) { - return null; - } - - return readListIndexWithOptionalSignal({ http, signal }); - }, - { - onError, - retry: false, - refetchOnWindowFocus: false, - enabled: isEnabled, - staleTime: Infinity, - } - ); - - return { - result: query.data, - loading: query.isFetching, - error: query.error, - }; -}; diff --git a/packages/kbn-securitysolution-list-hooks/src/use_read_list_privileges/index.ts b/packages/kbn-securitysolution-list-hooks/src/use_read_list_privileges/index.ts deleted file mode 100644 index 42a055c168085..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/src/use_read_list_privileges/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { readListPrivileges } from '@kbn/securitysolution-list-api'; -import { useAsync, withOptionalSignal } from '@kbn/securitysolution-hook-utils'; - -const readListPrivilegesWithOptionalSignal = withOptionalSignal(readListPrivileges); - -export const useReadListPrivileges = () => useAsync(readListPrivilegesWithOptionalSignal); diff --git a/packages/kbn-securitysolution-list-hooks/tsconfig.json b/packages/kbn-securitysolution-list-hooks/tsconfig.json deleted file mode 100644 index 53e105e609750..0000000000000 --- a/packages/kbn-securitysolution-list-hooks/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts", - ], - "kbn_references": [ - "@kbn/securitysolution-hook-utils", - "@kbn/securitysolution-io-ts-list-types", - "@kbn/securitysolution-list-api", - "@kbn/securitysolution-list-utils", - "@kbn/securitysolution-utils", - "@kbn/core-http-browser-mocks", - "@kbn/core-http-browser", - ], - "exclude": [ - "target/**/*", - ] -} diff --git a/packages/kbn-securitysolution-list-utils/index.ts b/packages/kbn-securitysolution-list-utils/index.ts deleted file mode 100644 index c5999a044a188..0000000000000 --- a/packages/kbn-securitysolution-list-utils/index.ts +++ /dev/null @@ -1,19 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './src/autocomplete_operators'; -export * from './src/get_exception_list_type'; -export * from './src/get_filters'; -export * from './src/get_general_filters'; -export * from './src/get_ids_and_namespaces'; -export * from './src/get_saved_object_type'; -export * from './src/get_saved_object_types'; -export * from './src/has_large_value_list'; -export * from './src/helpers'; -export * from './src/types'; diff --git a/packages/kbn-securitysolution-list-utils/jest.config.js b/packages/kbn-securitysolution-list-utils/jest.config.js deleted file mode 100644 index b24a4fa543f78..0000000000000 --- a/packages/kbn-securitysolution-list-utils/jest.config.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../..', - roots: ['<rootDir>/packages/kbn-securitysolution-list-utils'], -}; diff --git a/packages/kbn-securitysolution-list-utils/package.json b/packages/kbn-securitysolution-list-utils/package.json deleted file mode 100644 index e9ace6e302344..0000000000000 --- a/packages/kbn-securitysolution-list-utils/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@kbn/securitysolution-list-utils", - "version": "1.0.0", - "description": "security solution list utilities", - "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0", - "private": true, - "sideEffects": false -} \ No newline at end of file diff --git a/packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts b/packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts deleted file mode 100644 index b4b1eec6be342..0000000000000 --- a/packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts +++ /dev/null @@ -1,160 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { i18n } from '@kbn/i18n'; -import { - ListOperatorEnum as OperatorEnum, - ListOperatorTypeEnum as OperatorTypeEnum, -} from '@kbn/securitysolution-io-ts-list-types'; -import { OperatorOption } from '../types'; - -export const isOperator: OperatorOption = { - message: i18n.translate('lists.exceptions.isOperatorLabel', { - defaultMessage: 'is', - }), - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH, - value: 'is', -}; - -export const isNotOperator: OperatorOption = { - message: i18n.translate('lists.exceptions.isNotOperatorLabel', { - defaultMessage: 'is not', - }), - operator: OperatorEnum.EXCLUDED, - type: OperatorTypeEnum.MATCH, - value: 'is_not', -}; - -export const isOneOfOperator: OperatorOption = { - message: i18n.translate('lists.exceptions.isOneOfOperatorLabel', { - defaultMessage: 'is one of', - }), - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH_ANY, - value: 'is_one_of', -}; - -export const isNotOneOfOperator: OperatorOption = { - message: i18n.translate('lists.exceptions.isNotOneOfOperatorLabel', { - defaultMessage: 'is not one of', - }), - operator: OperatorEnum.EXCLUDED, - type: OperatorTypeEnum.MATCH_ANY, - value: 'is_not_one_of', -}; - -export const existsOperator: OperatorOption = { - message: i18n.translate('lists.exceptions.existsOperatorLabel', { - defaultMessage: 'exists', - }), - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.EXISTS, - value: 'exists', -}; - -export const doesNotExistOperator: OperatorOption = { - message: i18n.translate('lists.exceptions.doesNotExistOperatorLabel', { - defaultMessage: 'does not exist', - }), - operator: OperatorEnum.EXCLUDED, - type: OperatorTypeEnum.EXISTS, - value: 'does_not_exist', -}; - -export const isInListOperator: OperatorOption = { - message: i18n.translate('lists.exceptions.isInListOperatorLabel', { - defaultMessage: 'is in list', - }), - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.LIST, - value: 'is_in_list', -}; - -export const isNotInListOperator: OperatorOption = { - message: i18n.translate('lists.exceptions.isNotInListOperatorLabel', { - defaultMessage: 'is not in list', - }), - operator: OperatorEnum.EXCLUDED, - type: OperatorTypeEnum.LIST, - value: 'is_not_in_list', -}; - -export const matchesOperator: OperatorOption = { - message: i18n.translate('lists.exceptions.matchesOperatorLabel', { - defaultMessage: 'matches', - }), - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.WILDCARD, - value: 'matches', -}; - -export const doesNotMatchOperator: OperatorOption = { - message: i18n.translate('lists.exceptions.doesNotMatchOperatorLabel', { - defaultMessage: 'does not match', - }), - operator: OperatorEnum.EXCLUDED, - type: OperatorTypeEnum.WILDCARD, - value: 'does_not_match', -}; - -export const EVENT_FILTERS_OPERATORS: OperatorOption[] = [ - isOperator, - isNotOperator, - isOneOfOperator, - isNotOneOfOperator, - matchesOperator, - doesNotMatchOperator, -]; - -/* - * !IMPORTANT! - Please only add to this list if it is an operator - * supported by the detection engine. - */ -export const DETECTION_ENGINE_EXCEPTION_OPERATORS: OperatorOption[] = [ - isOperator, - isNotOperator, - isOneOfOperator, - isNotOneOfOperator, - existsOperator, - doesNotExistOperator, - isInListOperator, - isNotInListOperator, - matchesOperator, - doesNotMatchOperator, -]; - -export const ALL_OPERATORS: OperatorOption[] = [ - isOperator, - isNotOperator, - isOneOfOperator, - isNotOneOfOperator, - existsOperator, - doesNotExistOperator, - isInListOperator, - isNotInListOperator, - matchesOperator, - doesNotMatchOperator, -]; - -export const EXCEPTION_OPERATORS_SANS_LISTS: OperatorOption[] = [ - isOperator, - isNotOperator, - isOneOfOperator, - isNotOneOfOperator, - existsOperator, - doesNotExistOperator, - matchesOperator, - doesNotMatchOperator, -]; - -export const EXCEPTION_OPERATORS_ONLY_LISTS: OperatorOption[] = [ - isInListOperator, - isNotInListOperator, -]; diff --git a/packages/kbn-securitysolution-list-utils/src/get_exception_list_type/index.ts b/packages/kbn-securitysolution-list-utils/src/get_exception_list_type/index.ts deleted file mode 100644 index 568436c487dea..0000000000000 --- a/packages/kbn-securitysolution-list-utils/src/get_exception_list_type/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { NamespaceType } from '@kbn/securitysolution-io-ts-list-types'; - -import { exceptionListAgnosticSavedObjectType } from '../types'; - -export const getExceptionListType = ({ - savedObjectType, -}: { - savedObjectType: string; -}): NamespaceType => { - if (savedObjectType === exceptionListAgnosticSavedObjectType) { - return 'agnostic'; - } else { - return 'single'; - } -}; diff --git a/packages/kbn-securitysolution-list-utils/src/get_filters/index.test.ts b/packages/kbn-securitysolution-list-utils/src/get_filters/index.test.ts deleted file mode 100644 index 76b9eeda44f86..0000000000000 --- a/packages/kbn-securitysolution-list-utils/src/get_filters/index.test.ts +++ /dev/null @@ -1,209 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { getFilters } from '.'; - -describe('getFilters', () => { - describe('single', () => { - test('it properly formats when no filters and hide lists contains few list ids', () => { - const filter = getFilters({ - filters: {}, - namespaceTypes: ['single'], - hideLists: ['listId-1', 'listId-2', 'listId-3'], - }); - - expect(filter).toEqual( - '(not exception-list.attributes.list_id: listId-1*) AND (not exception-list.attributes.list_id: listId-2*) AND (not exception-list.attributes.list_id: listId-3*)' - ); - }); - test('it properly formats when no filters and hide lists contains one list id', () => { - const filter = getFilters({ - filters: {}, - namespaceTypes: ['single'], - hideLists: ['listId-1'], - }); - - expect(filter).toEqual('(not exception-list.attributes.list_id: listId-1*)'); - }); - test('it properly formats when no filters and no hide lists', () => { - const filter = getFilters({ - filters: {}, - namespaceTypes: ['single'], - hideLists: [], - }); - - expect(filter).toEqual(''); - }); - test('it properly formats when filters passed and hide lists contains few list ids', () => { - const filter = getFilters({ - filters: { created_by: 'moi', name: 'Sample' }, - namespaceTypes: ['single'], - hideLists: ['listId-1', 'listId-2', 'listId-3'], - }); - - expect(filter).toEqual( - '(exception-list.attributes.created_by:moi) AND (exception-list.attributes.name.text:Sample) AND (not exception-list.attributes.list_id: listId-1*) AND (not exception-list.attributes.list_id: listId-2*) AND (not exception-list.attributes.list_id: listId-3*)' - ); - }); - test('it properly formats when filters passed and hide lists contains one list id', () => { - const filter = getFilters({ - filters: { created_by: 'moi', name: 'Sample' }, - namespaceTypes: ['single'], - hideLists: ['listId-1'], - }); - - expect(filter).toEqual( - '(exception-list.attributes.created_by:moi) AND (exception-list.attributes.name.text:Sample) AND (not exception-list.attributes.list_id: listId-1*)' - ); - }); - test('it properly formats when filters passed and no hide lists', () => { - const filter = getFilters({ - filters: { created_by: 'moi', name: 'Sample' }, - namespaceTypes: ['single'], - hideLists: [], - }); - - expect(filter).toEqual( - '(exception-list.attributes.created_by:moi) AND (exception-list.attributes.name.text:Sample)' - ); - }); - }); - - describe('agnostic', () => { - test('it properly formats when no filters and hide lists contains few list ids', () => { - const filter = getFilters({ - filters: {}, - namespaceTypes: ['agnostic'], - hideLists: ['listId-1', 'listId-2', 'listId-3'], - }); - - expect(filter).toEqual( - '(not exception-list-agnostic.attributes.list_id: listId-1*) AND (not exception-list-agnostic.attributes.list_id: listId-2*) AND (not exception-list-agnostic.attributes.list_id: listId-3*)' - ); - }); - test('it properly formats when no filters and hide lists contains one list id', () => { - const filter = getFilters({ - filters: {}, - namespaceTypes: ['agnostic'], - hideLists: ['listId-1'], - }); - - expect(filter).toEqual('(not exception-list-agnostic.attributes.list_id: listId-1*)'); - }); - test('it properly formats when no filters and no hide lists', () => { - const filter = getFilters({ - filters: {}, - namespaceTypes: ['agnostic'], - hideLists: [], - }); - - expect(filter).toEqual(''); - }); - test('it properly formats when filters passed and hide lists contains few list ids', () => { - const filter = getFilters({ - filters: { created_by: 'moi', name: 'Sample' }, - namespaceTypes: ['agnostic'], - hideLists: ['listId-1', 'listId-2', 'listId-3'], - }); - - expect(filter).toEqual( - '(exception-list-agnostic.attributes.created_by:moi) AND (exception-list-agnostic.attributes.name.text:Sample) AND (not exception-list-agnostic.attributes.list_id: listId-1*) AND (not exception-list-agnostic.attributes.list_id: listId-2*) AND (not exception-list-agnostic.attributes.list_id: listId-3*)' - ); - }); - test('it properly formats when filters passed and hide lists contains one list id', () => { - const filter = getFilters({ - filters: { created_by: 'moi', name: 'Sample' }, - namespaceTypes: ['agnostic'], - hideLists: ['listId-1'], - }); - - expect(filter).toEqual( - '(exception-list-agnostic.attributes.created_by:moi) AND (exception-list-agnostic.attributes.name.text:Sample) AND (not exception-list-agnostic.attributes.list_id: listId-1*)' - ); - }); - test('it properly formats when filters passed and no hide lists', () => { - const filter = getFilters({ - filters: { created_by: 'moi', name: 'Sample' }, - namespaceTypes: ['agnostic'], - hideLists: [], - }); - - expect(filter).toEqual( - '(exception-list-agnostic.attributes.created_by:moi) AND (exception-list-agnostic.attributes.name.text:Sample)' - ); - }); - }); - - describe('single, agnostic', () => { - test('it properly formats when no filters and hide lists contains few list ids', () => { - const filter = getFilters({ - filters: {}, - namespaceTypes: ['single', 'agnostic'], - hideLists: ['listId-1', 'listId-2', 'listId-3'], - }); - - expect(filter).toEqual( - '(not exception-list.attributes.list_id: listId-1* AND not exception-list-agnostic.attributes.list_id: listId-1*) AND (not exception-list.attributes.list_id: listId-2* AND not exception-list-agnostic.attributes.list_id: listId-2*) AND (not exception-list.attributes.list_id: listId-3* AND not exception-list-agnostic.attributes.list_id: listId-3*)' - ); - }); - test('it properly formats when no filters and hide lists contains one list id', () => { - const filter = getFilters({ - filters: {}, - namespaceTypes: ['single', 'agnostic'], - hideLists: ['listId-1'], - }); - - expect(filter).toEqual( - '(not exception-list.attributes.list_id: listId-1* AND not exception-list-agnostic.attributes.list_id: listId-1*)' - ); - }); - test('it properly formats when no filters and no hide lists', () => { - const filter = getFilters({ - filters: {}, - namespaceTypes: ['single', 'agnostic'], - hideLists: [], - }); - - expect(filter).toEqual(''); - }); - test('it properly formats when filters passed and hide lists contains few list ids', () => { - const filter = getFilters({ - filters: { created_by: 'moi', name: 'Sample' }, - namespaceTypes: ['single', 'agnostic'], - hideLists: ['listId-1', 'listId-2', 'listId-3'], - }); - - expect(filter).toEqual( - '(exception-list.attributes.created_by:moi OR exception-list-agnostic.attributes.created_by:moi) AND (exception-list.attributes.name.text:Sample OR exception-list-agnostic.attributes.name.text:Sample) AND (not exception-list.attributes.list_id: listId-1* AND not exception-list-agnostic.attributes.list_id: listId-1*) AND (not exception-list.attributes.list_id: listId-2* AND not exception-list-agnostic.attributes.list_id: listId-2*) AND (not exception-list.attributes.list_id: listId-3* AND not exception-list-agnostic.attributes.list_id: listId-3*)' - ); - }); - test('it properly formats when filters passed and hide lists contains one list id', () => { - const filter = getFilters({ - filters: { created_by: 'moi', name: 'Sample' }, - namespaceTypes: ['single', 'agnostic'], - hideLists: ['listId-1'], - }); - - expect(filter).toEqual( - '(exception-list.attributes.created_by:moi OR exception-list-agnostic.attributes.created_by:moi) AND (exception-list.attributes.name.text:Sample OR exception-list-agnostic.attributes.name.text:Sample) AND (not exception-list.attributes.list_id: listId-1* AND not exception-list-agnostic.attributes.list_id: listId-1*)' - ); - }); - test('it properly formats when filters passed and no hide lists', () => { - const filter = getFilters({ - filters: { created_by: 'moi', name: 'Sample' }, - namespaceTypes: ['single', 'agnostic'], - hideLists: [], - }); - - expect(filter).toEqual( - '(exception-list.attributes.created_by:moi OR exception-list-agnostic.attributes.created_by:moi) AND (exception-list.attributes.name.text:Sample OR exception-list-agnostic.attributes.name.text:Sample)' - ); - }); - }); -}); diff --git a/packages/kbn-securitysolution-list-utils/src/get_filters/index.ts b/packages/kbn-securitysolution-list-utils/src/get_filters/index.ts deleted file mode 100644 index 6ca3119855b34..0000000000000 --- a/packages/kbn-securitysolution-list-utils/src/get_filters/index.ts +++ /dev/null @@ -1,32 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ExceptionListFilter, NamespaceType } from '@kbn/securitysolution-io-ts-list-types'; -import { getGeneralFilters } from '../get_general_filters'; -import { getSavedObjectTypes } from '../get_saved_object_types'; -export interface GetFiltersParams { - filters: ExceptionListFilter; - namespaceTypes: NamespaceType[]; - hideLists: readonly string[]; -} - -export const getFilters = ({ filters, namespaceTypes, hideLists }: GetFiltersParams): string => { - const namespaces = getSavedObjectTypes({ namespaceType: namespaceTypes }); - const generalFilters = getGeneralFilters(filters, namespaces); - const hideListsFilters = hideLists.map((listId) => { - const filtersByNamespace = namespaces.map((namespace) => { - return `not ${namespace}.attributes.list_id: ${listId}*`; - }); - return `(${filtersByNamespace.join(' AND ')})`; - }); - - return [generalFilters, ...hideListsFilters] - .filter((filter) => filter.trim() !== '') - .join(' AND '); -}; diff --git a/packages/kbn-securitysolution-list-utils/src/get_general_filters/index.test.ts b/packages/kbn-securitysolution-list-utils/src/get_general_filters/index.test.ts deleted file mode 100644 index b349c57ab3868..0000000000000 --- a/packages/kbn-securitysolution-list-utils/src/get_general_filters/index.test.ts +++ /dev/null @@ -1,53 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ExceptionListTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; -import { getGeneralFilters } from '.'; - -describe('getGeneralFilters', () => { - test('it returns empty string if no filters', () => { - const filters = getGeneralFilters({}, ['exception-list']); - - expect(filters).toEqual(''); - }); - - test('it properly formats filters when one namespace type passed in', () => { - const filters = getGeneralFilters({ created_by: 'moi', name: 'Sample' }, ['exception-list']); - - expect(filters).toEqual( - '(exception-list.attributes.created_by:moi) AND (exception-list.attributes.name.text:Sample)' - ); - }); - - test('it properly formats filters when two namespace types passed in', () => { - const filters = getGeneralFilters({ created_by: 'moi', name: 'Sample' }, [ - 'exception-list', - 'exception-list-agnostic', - ]); - - expect(filters).toEqual( - '(exception-list.attributes.created_by:moi OR exception-list-agnostic.attributes.created_by:moi) AND (exception-list.attributes.name.text:Sample OR exception-list-agnostic.attributes.name.text:Sample)' - ); - }); - - test('it properly formats filters when two types are passed in', () => { - const filters = getGeneralFilters( - { - created_by: 'moi', - name: 'Sample', - types: [ExceptionListTypeEnum.DETECTION, ExceptionListTypeEnum.RULE_DEFAULT], - }, - ['exception-list', 'exception-list-agnostic'] - ); - - expect(filters).toEqual( - '(exception-list.attributes.created_by:moi OR exception-list-agnostic.attributes.created_by:moi) AND (exception-list.attributes.name.text:Sample OR exception-list-agnostic.attributes.name.text:Sample) AND (exception-list.attributes.type:detection OR exception-list.attributes.type:rule_default OR exception-list-agnostic.attributes.type:detection OR exception-list-agnostic.attributes.type:rule_default)' - ); - }); -}); diff --git a/packages/kbn-securitysolution-list-utils/src/get_general_filters/index.ts b/packages/kbn-securitysolution-list-utils/src/get_general_filters/index.ts deleted file mode 100644 index cc9b46728cbc4..0000000000000 --- a/packages/kbn-securitysolution-list-utils/src/get_general_filters/index.ts +++ /dev/null @@ -1,37 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ExceptionListFilter } from '@kbn/securitysolution-io-ts-list-types'; -import { isArray } from 'lodash'; -import { get } from 'lodash/fp'; -import { SavedObjectType } from '../types'; - -export const getGeneralFilters = ( - filters: ExceptionListFilter, - namespaceTypes: SavedObjectType[] -): string => { - return Object.keys(filters) - .map((filterKey) => { - const value = get(filterKey, filters); - if (isArray(value) || (value != null && value.trim() !== '')) { - const filtersByNamespace = namespaceTypes - .map((namespace) => { - const fieldToSearch = - filterKey === 'name' ? 'name.text' : filterKey === 'types' ? 'type' : filterKey; - return isArray(value) - ? value.map((val) => `${namespace}.attributes.${fieldToSearch}:${val}`).join(' OR ') - : `${namespace}.attributes.${fieldToSearch}:${value}`; - }) - .join(' OR '); - return `(${filtersByNamespace})`; - } else return null; - }) - .filter((item) => item != null) - .join(' AND '); -}; diff --git a/packages/kbn-securitysolution-list-utils/src/get_ids_and_namespaces/index.test.ts b/packages/kbn-securitysolution-list-utils/src/get_ids_and_namespaces/index.test.ts deleted file mode 100644 index df5bedc2d2b49..0000000000000 --- a/packages/kbn-securitysolution-list-utils/src/get_ids_and_namespaces/index.test.ts +++ /dev/null @@ -1,106 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { getIdsAndNamespaces } from '.'; - -describe('getIdsAndNamespaces', () => { - test('it returns empty arrays if no lists found', async () => { - const output = getIdsAndNamespaces({ - lists: [], - showDetection: false, - showEndpoint: false, - }); - - expect(output).toEqual({ ids: [], namespaces: [] }); - }); - - test('it returns all lists if "showDetection" and "showEndpoint" are "false"', async () => { - const output = getIdsAndNamespaces({ - lists: [ - { id: 'myListId', listId: 'list_id', namespaceType: 'single', type: 'detection' }, - { - id: 'myListIdEndpoint', - listId: 'list_id_endpoint', - namespaceType: 'agnostic', - type: 'endpoint', - }, - ], - showDetection: false, - showEndpoint: false, - }); - - expect(output).toEqual({ - ids: ['list_id', 'list_id_endpoint'], - namespaces: ['single', 'agnostic'], - }); - }); - - test('it returns only detections lists if "showDetection" is "true"', async () => { - const output = getIdsAndNamespaces({ - lists: [ - { id: 'myListId', listId: 'list_id', namespaceType: 'single', type: 'detection' }, - { - id: 'myListIdEndpoint', - listId: 'list_id_endpoint', - namespaceType: 'agnostic', - type: 'endpoint', - }, - ], - showDetection: true, - showEndpoint: false, - }); - - expect(output).toEqual({ - ids: ['list_id'], - namespaces: ['single'], - }); - }); - - test('it returns only endpoint lists if "showEndpoint" is "true"', async () => { - const output = getIdsAndNamespaces({ - lists: [ - { id: 'myListId', listId: 'list_id', namespaceType: 'single', type: 'detection' }, - { - id: 'myListIdEndpoint', - listId: 'list_id_endpoint', - namespaceType: 'agnostic', - type: 'endpoint', - }, - ], - showDetection: false, - showEndpoint: true, - }); - - expect(output).toEqual({ - ids: ['list_id_endpoint'], - namespaces: ['agnostic'], - }); - }); - - test('it returns only detection lists if both "showEndpoint" and "showDetection" are "true"', async () => { - const output = getIdsAndNamespaces({ - lists: [ - { id: 'myListId', listId: 'list_id', namespaceType: 'single', type: 'detection' }, - { - id: 'myListIdEndpoint', - listId: 'list_id_endpoint', - namespaceType: 'agnostic', - type: 'endpoint', - }, - ], - showDetection: true, - showEndpoint: true, - }); - - expect(output).toEqual({ - ids: ['list_id'], - namespaces: ['single'], - }); - }); -}); diff --git a/packages/kbn-securitysolution-list-utils/src/get_ids_and_namespaces/index.ts b/packages/kbn-securitysolution-list-utils/src/get_ids_and_namespaces/index.ts deleted file mode 100644 index bc18dff7d33e1..0000000000000 --- a/packages/kbn-securitysolution-list-utils/src/get_ids_and_namespaces/index.ts +++ /dev/null @@ -1,37 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ExceptionListIdentifiers, NamespaceType } from '@kbn/securitysolution-io-ts-list-types'; - -export const getIdsAndNamespaces = ({ - lists, - showDetection, - showEndpoint, -}: { - lists: ExceptionListIdentifiers[]; - showDetection: boolean; - showEndpoint: boolean; -}): { ids: string[]; namespaces: NamespaceType[] } => - lists - .filter((list) => { - if (showDetection) { - return list.type === 'detection'; - } else if (showEndpoint) { - return list.type === 'endpoint'; - } else { - return true; - } - }) - .reduce<{ ids: string[]; namespaces: NamespaceType[] }>( - (acc, { listId, namespaceType }) => ({ - ids: [...acc.ids, listId], - namespaces: [...acc.namespaces, namespaceType], - }), - { ids: [], namespaces: [] } - ); diff --git a/packages/kbn-securitysolution-list-utils/src/get_saved_object_type/index.ts b/packages/kbn-securitysolution-list-utils/src/get_saved_object_type/index.ts deleted file mode 100644 index 3e6cd312cb967..0000000000000 --- a/packages/kbn-securitysolution-list-utils/src/get_saved_object_type/index.ts +++ /dev/null @@ -1,28 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { NamespaceType } from '@kbn/securitysolution-io-ts-list-types'; - -import { - exceptionListAgnosticSavedObjectType, - exceptionListSavedObjectType, - SavedObjectType, -} from '../types'; - -export const getSavedObjectType = ({ - namespaceType, -}: { - namespaceType: NamespaceType; -}): SavedObjectType => { - if (namespaceType === 'agnostic') { - return exceptionListAgnosticSavedObjectType; - } else { - return exceptionListSavedObjectType; - } -}; diff --git a/packages/kbn-securitysolution-list-utils/src/get_saved_object_types/index.ts b/packages/kbn-securitysolution-list-utils/src/get_saved_object_types/index.ts deleted file mode 100644 index ec09fc25bd772..0000000000000 --- a/packages/kbn-securitysolution-list-utils/src/get_saved_object_types/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { NamespaceTypeArray } from '@kbn/securitysolution-io-ts-list-types'; - -import { SavedObjectType } from '../types'; -import { getSavedObjectType } from '../get_saved_object_type'; - -export const getSavedObjectTypes = ({ - namespaceType, -}: { - namespaceType: NamespaceTypeArray; -}): SavedObjectType[] => { - return namespaceType.map((singleNamespaceType) => - getSavedObjectType({ namespaceType: singleNamespaceType }) - ); -}; diff --git a/packages/kbn-securitysolution-list-utils/src/has_large_value_list/index.ts b/packages/kbn-securitysolution-list-utils/src/has_large_value_list/index.ts deleted file mode 100644 index ef774b5c8cf11..0000000000000 --- a/packages/kbn-securitysolution-list-utils/src/has_large_value_list/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { EntriesArray } from '@kbn/securitysolution-io-ts-list-types'; - -export const hasLargeValueList = (entries: EntriesArray): boolean => { - const found = entries.filter(({ type }) => type === 'list'); - return found.length > 0; -}; diff --git a/packages/kbn-securitysolution-list-utils/src/helpers/index.test.ts b/packages/kbn-securitysolution-list-utils/src/helpers/index.test.ts deleted file mode 100644 index fffcabbf41575..0000000000000 --- a/packages/kbn-securitysolution-list-utils/src/helpers/index.test.ts +++ /dev/null @@ -1,377 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { - getMappingConflictsInfo, - fieldSupportsMatches, - hasWrongOperatorWithWildcard, - hasPartialCodeSignatureEntry, -} from '.'; - -describe('Helpers', () => { - describe('getMappingConflictsInfo', () => { - test('it return null if there are not conflicts', () => { - const field = { - name: 'field1', - type: 'string', - }; - const conflictsInfo = getMappingConflictsInfo(field); - - expect(conflictsInfo).toBeNull(); - }); - test('it groups ".ds-" data stream indices', () => { - const field = { - name: 'field1', - type: 'conflict', - conflictDescriptions: { - text: [ - '.ds-logs-default-2023.01.18-000001', - '.ds-logs-default-2023.01.18-000002', - '.ds-logs-tortilla.process-default-2022.11.20-000011', - '.ds-logs-tortilla.process-default-2022.11.20-000012', - '.ds-logs-tortilla.process-default-2022.11.20-000016', - ], - long: [ - '.ds-logs-default-2023.01.18-000004', - '.ds-logs-default-2023.01.18-000005', - 'partial-.ds-logs-gcp.audit-2021.12.22-000240', - 'partial-.ds-logs-gcp.audit-2021.12.22-000242', - ], - }, - }; - const conflictsInfo = getMappingConflictsInfo(field); - - expect(conflictsInfo).toEqual([ - { - type: 'text', - totalIndexCount: 5, - groupedIndices: [ - { name: 'logs-tortilla.process-default', count: 3 }, - { name: 'logs-default', count: 2 }, - ], - }, - { - type: 'long', - totalIndexCount: 4, - groupedIndices: [ - { name: 'logs-default', count: 2 }, - { name: 'logs-gcp.audit', count: 2 }, - ], - }, - ]); - }); - test('it groups old ".siem-" indices', () => { - const field = { - name: 'field1', - type: 'conflict', - conflictDescriptions: { - text: [ - '.siem-signals-default-000001', - '.siem-signals-default-000002', - '.siem-signals-default-000011', - '.siem-signals-default-000012', - ], - unmapped: [ - '.siem-signals-default-000004', - '.siem-signals-default-000005', - '.siem-signals-default-000240', - ], - }, - }; - const conflictsInfo = getMappingConflictsInfo(field); - - expect(conflictsInfo).toEqual([ - { - type: 'text', - totalIndexCount: 4, - groupedIndices: [{ name: '.siem-signals-default', count: 4 }], - }, - { - type: 'unmapped', - totalIndexCount: 3, - groupedIndices: [{ name: '.siem-signals-default', count: 3 }], - }, - ]); - }); - test('it groups mixed indices', () => { - const field = { - name: 'field1', - type: 'conflict', - conflictDescriptions: { - boolean: [ - '.ds-logs-default-2023.01.18-000001', - '.ds-logs-tortilla.process-default-2022.11.20-000011', - '.ds-logs-tortilla.process-default-2022.11.20-000012', - '.ds-logs-tortilla.process-default-2022.11.20-000016', - '.siem-signals-default-000001', - '.siem-signals-default-000002', - '.siem-signals-default-000012', - 'my-own-index-1', - 'my-own-index-2', - ], - unmapped: [ - '.siem-signals-default-000004', - 'partial-.ds-logs-gcp.audit-2021.12.22-000240', - 'partial-.ds-logs-gcp.audit-2021.12.22-000242', - 'my-own-index-3', - ], - }, - }; - const conflictsInfo = getMappingConflictsInfo(field); - - expect(conflictsInfo).toEqual([ - { - type: 'boolean', - totalIndexCount: 9, - groupedIndices: [ - { name: 'logs-tortilla.process-default', count: 3 }, - { name: '.siem-signals-default', count: 3 }, - { name: 'logs-default', count: 1 }, - { name: 'my-own-index-1', count: 1 }, - { name: 'my-own-index-2', count: 1 }, - ], - }, - { - type: 'unmapped', - totalIndexCount: 4, - groupedIndices: [ - { name: 'logs-gcp.audit', count: 2 }, - { name: '.siem-signals-default', count: 1 }, - { name: 'my-own-index-3', count: 1 }, - ], - }, - ]); - }); - }); - - describe('fieldSupportsMatches', () => { - test('it returns true if esTypes is keyword', () => { - expect( - fieldSupportsMatches({ name: 'field', type: 'conflict', esTypes: ['keyword'] }) - ).toBeTruthy(); - }); - - test('it returns true if one of the esTypes is kibana type string and another is not', () => { - expect( - fieldSupportsMatches({ name: 'field', type: 'conflict', esTypes: ['keyword', 'object'] }) - ).toBeTruthy(); - }); - - test('it returns true if one of the esTypes is keyword', () => { - expect( - fieldSupportsMatches({ name: 'field', type: 'conflict', esTypes: ['keyword', 'unmapped'] }) - ).toBeTruthy(); - }); - - test('it returns true if one of the esTypes is text', () => { - expect( - fieldSupportsMatches({ name: 'field', type: 'conflict', esTypes: ['text', 'unmapped'] }) - ).toBeTruthy(); - }); - - test('it returns true if all of the esTypes is map to kibana type string', () => { - expect( - fieldSupportsMatches({ name: 'field', type: 'conflict', esTypes: ['text', 'keyword'] }) - ).toBeTruthy(); - }); - - test('it returns false if none of the esTypes map to kibana type string', () => { - expect( - fieldSupportsMatches({ name: 'field', type: 'conflict', esTypes: ['bool', 'unmapped'] }) - ).toBeFalsy(); - }); - }); - describe('hasWrongOperatorWithWildcard', () => { - test('it returns true if there is at least one exception entry with a wildcard and the wrong operator', () => { - expect( - hasWrongOperatorWithWildcard([ - { - description: '', - name: '', - type: 'simple', - entries: [{ type: 'match', value: 'withwildcard*', field: '', operator: 'included' }], - }, - ]) - ).toBeTruthy(); - expect( - hasWrongOperatorWithWildcard([ - { - description: '', - name: '', - type: 'simple', - entries: [{ type: 'match', value: 'withwildcard?', field: '', operator: 'included' }], - }, - ]) - ).toBeTruthy(); - }); - - test('it returns true if there are entries joined with an OR that have a wildcard and the wrong operator', () => { - expect( - hasWrongOperatorWithWildcard([ - { - description: '', - name: '', - type: 'simple', - entries: [{ type: 'match', value: 'withwildcard?', field: '', operator: 'included' }], - }, - { - description: '', - name: '', - type: 'simple', - entries: [{ type: 'match', value: 'withwildcard?*', field: '', operator: 'included' }], - }, - ]) - ).toBeTruthy(); - }); - - test('it returns false if there are no exception entries with a wildcard and the wrong operator', () => { - expect( - hasWrongOperatorWithWildcard([ - { - description: '', - name: '', - type: 'simple', - entries: [ - { type: 'match', value: 'nowildcard', field: '', operator: 'excluded' }, - { type: 'wildcard', value: 'withwildcard*?', field: '', operator: 'included' }, - ], - }, - ]) - ).toBeFalsy(); - }); - - test('it returns true if there are nested entries with a wildcard and the wrong operator', () => { - expect( - hasWrongOperatorWithWildcard([ - { - description: '', - name: '', - type: 'simple', - entries: [ - { type: 'match', value: 'nowildcard', field: '', operator: 'excluded' }, - { - field: '', - type: 'nested', - entries: [{ type: 'match', value: 'wildcard?', field: '', operator: 'excluded' }], - }, - ], - }, - ]) - ).toBeTruthy(); - }); - }); - - describe('hasPartialCodeSignatureEntry', () => { - it('returns false if the entry has neither code signature subject name nor trusted field', () => { - expect( - hasPartialCodeSignatureEntry([ - { - description: '', - name: '', - type: 'simple', - os_types: ['windows'], - entries: [{ type: 'match', value: 'asdf', field: 'someField', operator: 'excluded' }], - }, - ]) - ).toBeFalsy(); - }); - it('returns true if the entry has code signature subject name but not trusted field', () => { - expect( - hasPartialCodeSignatureEntry([ - { - description: '', - name: '', - type: 'simple', - os_types: ['windows'], - entries: [ - { - type: 'match', - value: 'asdf', - field: 'process.code_signature.subject_name', - operator: 'excluded', - }, - ], - }, - ]) - ).toBeTruthy(); - }); - it('returns true if the entry has code signature trusted but not the subject name field', () => { - expect( - hasPartialCodeSignatureEntry([ - { - description: '', - name: '', - type: 'simple', - os_types: ['windows'], - entries: [ - { - type: 'match', - value: 'asdf', - field: 'process.code_signature.trusted', - operator: 'excluded', - }, - ], - }, - ]) - ).toBeTruthy(); - }); - it('returns false if the entry has both code signature subject name and trusted field', () => { - expect( - hasPartialCodeSignatureEntry([ - { - description: '', - name: '', - type: 'simple', - os_types: ['windows'], - entries: [ - { - type: 'match', - value: 'asdf', - field: 'process.code_signature.subject_name', - operator: 'excluded', - }, - { - type: 'match', - value: 'true', - field: 'process.code_signature.trusted', - operator: 'excluded', - }, - ], - }, - ]) - ).toBeFalsy(); - }); - it('returns false if the entry has both code signature team_id and trusted fields for mac os', () => { - expect( - hasPartialCodeSignatureEntry([ - { - description: '', - name: '', - type: 'simple', - os_types: ['macos'], - entries: [ - { - type: 'match', - value: 'asdf', - field: 'process.code_signature.team_id', - operator: 'excluded', - }, - { - type: 'match', - value: 'true', - field: 'process.code_signature.trusted', - operator: 'excluded', - }, - ], - }, - ]) - ).toBeFalsy(); - }); - }); -}); diff --git a/packages/kbn-securitysolution-list-utils/src/helpers/index.ts b/packages/kbn-securitysolution-list-utils/src/helpers/index.ts deleted file mode 100644 index 8031cfba14f2d..0000000000000 --- a/packages/kbn-securitysolution-list-utils/src/helpers/index.ts +++ /dev/null @@ -1,1089 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { v4 as uuidv4 } from 'uuid'; -import { - addIdToItem, - removeIdFromItem, - validateHasWildcardWithWrongOperator, -} from '@kbn/securitysolution-utils'; -import { validate } from '@kbn/securitysolution-io-ts-utils'; -import { - CreateExceptionListItemSchema, - EntriesArray, - Entry, - EntryNested, - ExceptionListType, - ListSchema, - NamespaceType, - ListOperatorEnum as OperatorEnum, - ListOperatorTypeEnum as OperatorTypeEnum, - createExceptionListItemSchema, - entriesList, - entriesNested, - entry, - exceptionListItemSchema, - nestedEntryItem, - CreateRuleExceptionListItemSchema, - createRuleExceptionListItemSchema, -} from '@kbn/securitysolution-io-ts-list-types'; -import { - DataViewBase, - DataViewFieldBase, - getDataViewFieldSubtypeNested, - isDataViewFieldSubtypeNested, -} from '@kbn/es-query'; -import { castEsToKbnFieldTypeName, KBN_FIELD_TYPES } from '@kbn/field-types'; - -import { - ALL_OPERATORS, - EXCEPTION_OPERATORS_SANS_LISTS, - doesNotExistOperator, - existsOperator, - isNotOperator, - isOneOfOperator, - isOperator, - DETECTION_ENGINE_EXCEPTION_OPERATORS, - isNotOneOfOperator, - isInListOperator, - isNotInListOperator, - matchesOperator, - doesNotMatchOperator, -} from '../autocomplete_operators'; - -import { - BuilderEntry, - CreateExceptionListItemBuilderSchema, - DataViewField, - EmptyEntry, - EmptyNestedEntry, - ExceptionsBuilderExceptionItem, - ExceptionsBuilderReturnExceptionItem, - FormattedBuilderEntry, - OperatorOption, - SavedObjectType, -} from '../types'; - -export const isEntryNested = (item: BuilderEntry): item is EntryNested => { - return (item as EntryNested).entries != null; -}; - -export const filterExceptionItems = ( - exceptions: ExceptionsBuilderExceptionItem[] -): ExceptionsBuilderReturnExceptionItem[] => { - return exceptions.reduce<ExceptionsBuilderReturnExceptionItem[]>((acc, exception) => { - const entries = exception.entries.reduce<BuilderEntry[]>((nestedAcc, singleEntry) => { - const strippedSingleEntry = removeIdFromItem(singleEntry); - if (entriesNested.is(strippedSingleEntry)) { - const nestedEntriesArray = strippedSingleEntry.entries.filter((singleNestedEntry) => { - const noIdSingleNestedEntry = removeIdFromItem(singleNestedEntry); - const [validatedNestedEntry] = validate(noIdSingleNestedEntry, nestedEntryItem); - return validatedNestedEntry != null; - }); - const noIdNestedEntries = nestedEntriesArray.map((singleNestedEntry) => - removeIdFromItem(singleNestedEntry) - ); - - const [validatedNestedEntry] = validate( - { ...strippedSingleEntry, entries: noIdNestedEntries }, - entriesNested - ); - - if (validatedNestedEntry != null) { - return [...nestedAcc, { ...singleEntry, entries: nestedEntriesArray }]; - } - return nestedAcc; - } else { - const [validatedEntry] = validate(strippedSingleEntry, entry); - if (validatedEntry != null) { - return [...nestedAcc, singleEntry]; - } - return nestedAcc; - } - }, []); - - if (entries.length === 0) { - return acc; - } - - const item = { ...exception, entries }; - - if (exceptionListItemSchema.is(item)) { - return [...acc, item]; - } else if ( - createExceptionListItemSchema.is(item) || - createRuleExceptionListItemSchema.is(item) - ) { - const { meta, ...rest } = item; - const itemSansMetaId: CreateExceptionListItemSchema | CreateRuleExceptionListItemSchema = { - ...rest, - meta: undefined, - }; - return [...acc, itemSansMetaId]; - } else { - return acc; - } - }, []); -}; - -export const addIdToEntries = (entries: EntriesArray): EntriesArray => { - return entries.map((singleEntry) => { - if (singleEntry.type === 'nested') { - return addIdToItem({ - ...singleEntry, - entries: singleEntry.entries.map((nestedEntry) => addIdToItem(nestedEntry)), - }); - } else { - return addIdToItem(singleEntry); - } - }); -}; - -export const getNewExceptionItem = ({ - listId, - namespaceType, - name, -}: { - listId: string | undefined; - namespaceType: NamespaceType | undefined; - name: string; -}): CreateExceptionListItemBuilderSchema => { - return { - comments: [], - description: `Exception list item`, - entries: addIdToEntries([ - { - field: '', - operator: 'included', - type: 'match', - value: '', - }, - ]), - item_id: undefined, - list_id: listId, - meta: { - temporaryUuid: uuidv4(), - }, - name, - namespace_type: namespaceType, - tags: [], - type: 'simple', - }; -}; - -/** - * Returns the operator type, may not need this if using io-ts types - * - * @param item a single ExceptionItem entry - */ -export const getOperatorType = (item: BuilderEntry): OperatorTypeEnum => { - switch (item.type) { - case 'match': - return OperatorTypeEnum.MATCH; - case 'match_any': - return OperatorTypeEnum.MATCH_ANY; - case 'wildcard': - return OperatorTypeEnum.WILDCARD; - case 'list': - return OperatorTypeEnum.LIST; - default: - return OperatorTypeEnum.EXISTS; - } -}; - -/** - * Determines operator selection (is/is not/is one of, etc.) - * Default operator is "is" - * - * @param item a single ExceptionItem entry - */ -export const getExceptionOperatorSelect = (item: BuilderEntry): OperatorOption => { - if (item.type === 'nested') { - return isOperator; - } else { - const operatorType = getOperatorType(item); - const foundOperator = ALL_OPERATORS.find((operatorOption) => { - return item.operator === operatorOption.operator && operatorType === operatorOption.type; - }); - - return foundOperator != null ? foundOperator : isOperator; - } -}; - -/** - * Returns the fields corresponding value for an entry - * - * @param item a single ExceptionItem entry - */ -export const getEntryValue = (item: BuilderEntry): string | string[] | undefined => { - switch (item.type) { - case OperatorTypeEnum.MATCH: - case OperatorTypeEnum.MATCH_ANY: - case OperatorTypeEnum.WILDCARD: - return item.value; - case OperatorTypeEnum.EXISTS: - return undefined; - case OperatorTypeEnum.LIST: - return item.list.id; - default: - return undefined; - } -}; - -/** - * Determines whether an entire entry, exception item, or entry within a nested - * entry needs to be removed - * - * @param exceptionItem - * @param entryIndex index of given entry, for nested entries, this will correspond - * to their parent index - * @param nestedEntryIndex index of nested entry - * - */ -export const getUpdatedEntriesOnDelete = ( - exceptionItem: ExceptionsBuilderExceptionItem, - entryIndex: number, - nestedParentIndex: number | null -): ExceptionsBuilderExceptionItem => { - const itemOfInterest: BuilderEntry = - exceptionItem.entries[nestedParentIndex != null ? nestedParentIndex : entryIndex]; - - if (nestedParentIndex != null && itemOfInterest.type === OperatorTypeEnum.NESTED) { - const updatedEntryEntries = [ - ...itemOfInterest.entries.slice(0, entryIndex), - ...itemOfInterest.entries.slice(entryIndex + 1), - ]; - - if (updatedEntryEntries.length === 0) { - return { - ...exceptionItem, - entries: [ - ...exceptionItem.entries.slice(0, nestedParentIndex), - ...exceptionItem.entries.slice(nestedParentIndex + 1), - ], - }; - } else { - const { field } = itemOfInterest; - const updatedItemOfInterest: EntryNested | EmptyNestedEntry = { - entries: updatedEntryEntries, - field, - id: itemOfInterest.id != null ? itemOfInterest.id : `${entryIndex}`, - type: OperatorTypeEnum.NESTED, - }; - - return { - ...exceptionItem, - entries: [ - ...exceptionItem.entries.slice(0, nestedParentIndex), - updatedItemOfInterest, - ...exceptionItem.entries.slice(nestedParentIndex + 1), - ], - }; - } - } else { - return { - ...exceptionItem, - entries: [ - ...exceptionItem.entries.slice(0, entryIndex), - ...exceptionItem.entries.slice(entryIndex + 1), - ], - }; - } -}; - -/** - * Returns filtered index patterns based on the field - if a user selects to - * add nested entry, should only show nested fields, if item is the parent - * field of a nested entry, we only display the parent field - * - * @param patterns DataViewBase containing available fields on rule index - * @param item exception item entry - * set to add a nested field - */ -export const getFilteredIndexPatterns = ( - patterns: DataViewBase, - item: FormattedBuilderEntry -): DataViewBase => { - if (item.nested === 'child' && item.parent != null) { - // when user has selected a nested entry, only fields with the common parent are shown - return { - ...patterns, - fields: patterns.fields - .filter((indexField) => { - const subTypeNested = getDataViewFieldSubtypeNested(indexField); - const fieldHasCommonParentPath = - subTypeNested && - item.parent != null && - subTypeNested.nested.path === item.parent.parent.field; - - return fieldHasCommonParentPath; - }) - .map((f) => { - const [fieldNameWithoutParentPath] = f.name.split('.').slice(-1); - return { ...f, name: fieldNameWithoutParentPath }; - }), - }; - } else if (item.nested === 'parent' && item.field != null) { - // when user has selected a nested entry, right above it we show the common parent - return { ...patterns, fields: [item.field] }; - } else if (item.nested === 'parent' && item.field == null) { - // when user selects to add a nested entry, only nested fields are shown as options - return { - ...patterns, - fields: patterns.fields.filter((field) => isDataViewFieldSubtypeNested(field)), - }; - } else { - return patterns; - } -}; - -/** - * Determines proper entry update when user selects new field - * - * @param item - current exception item entry values - * @param newField - newly selected field - * - */ -export const getEntryOnFieldChange = ( - item: FormattedBuilderEntry, - newField: DataViewFieldBase -): { index: number; updatedEntry: BuilderEntry } => { - const { parent, entryIndex, nested } = item; - const newChildFieldValue = newField != null ? newField.name.split('.').slice(-1)[0] : ''; - - if (nested === 'parent') { - // For nested entries, when user first selects to add a nested - // entry, they first see a row similar to what is shown for when - // a user selects "exists", as soon as they make a selection - // we can now identify the 'parent' and 'child' this is where - // we first convert the entry into type "nested" - const subTypeNested = getDataViewFieldSubtypeNested(newField); - const newParentFieldValue = subTypeNested?.nested.path || ''; - - return { - index: entryIndex, - updatedEntry: { - entries: [ - addIdToItem({ - field: newChildFieldValue != null ? newChildFieldValue : '', - operator: isOperator.operator, - type: OperatorTypeEnum.MATCH, - value: '', - }), - ], - field: newParentFieldValue, - id: item.id, - type: OperatorTypeEnum.NESTED, - }, - }; - } else if (nested === 'child' && parent != null) { - return { - index: parent.parentIndex, - updatedEntry: { - ...parent.parent, - entries: [ - ...parent.parent.entries.slice(0, entryIndex), - { - field: newChildFieldValue != null ? newChildFieldValue : '', - id: item.id, - operator: isOperator.operator, - type: OperatorTypeEnum.MATCH, - value: '', - }, - ...parent.parent.entries.slice(entryIndex + 1), - ], - }, - }; - } else { - return { - index: entryIndex, - updatedEntry: { - field: newField != null ? newField.name : '', - id: item.id, - operator: isOperator.operator, - type: OperatorTypeEnum.MATCH, - value: '', - }, - }; - } -}; - -/** - * Determines proper entry update when user updates value - * when operator is of type "list" - * - * @param item - current exception item entry values - * @param newField - newly selected list - * - */ -export const getEntryOnListChange = ( - item: FormattedBuilderEntry, - newField: ListSchema -): { index: number; updatedEntry: BuilderEntry } => { - const { entryIndex, field, operator } = item; - const { id, type } = newField; - - return { - index: entryIndex, - updatedEntry: { - field: field != null ? field.name : '', - id: item.id, - list: { id, type }, - operator: operator.operator, - type: OperatorTypeEnum.LIST, - }, - }; -}; - -/** - * Determines proper entry update when user updates value - * when operator is of type "match_any" - * - * @param item - current exception item entry values - * @param newField - newly entered value - * - */ -export const getEntryOnMatchAnyChange = ( - item: FormattedBuilderEntry, - newField: string[] -): { index: number; updatedEntry: BuilderEntry } => { - const { nested, parent, entryIndex, field, operator } = item; - - if (nested != null && parent != null) { - const fieldName = field != null ? field.name.split('.').slice(-1)[0] : ''; - - return { - index: parent.parentIndex, - updatedEntry: { - ...parent.parent, - entries: [ - ...parent.parent.entries.slice(0, entryIndex), - { - field: fieldName, - id: item.id, - operator: operator.operator, - type: OperatorTypeEnum.MATCH_ANY, - value: newField, - }, - ...parent.parent.entries.slice(entryIndex + 1), - ], - }, - }; - } else { - return { - index: entryIndex, - updatedEntry: { - field: field != null ? field.name : '', - id: item.id, - operator: operator.operator, - type: OperatorTypeEnum.MATCH_ANY, - value: newField, - }, - }; - } -}; - -/** - * Determines proper entry update when user updates value - * when operator is of type "match" - * - * @param item - current exception item entry values - * @param newField - newly entered value - * - */ -export const getEntryOnMatchChange = ( - item: FormattedBuilderEntry, - newField: string -): { index: number; updatedEntry: BuilderEntry } => { - const { nested, parent, entryIndex, field, operator } = item; - - if (nested != null && parent != null) { - const fieldName = field != null ? field.name.split('.').slice(-1)[0] : ''; - - return { - index: parent.parentIndex, - updatedEntry: { - ...parent.parent, - entries: [ - ...parent.parent.entries.slice(0, entryIndex), - { - field: fieldName, - id: item.id, - operator: operator.operator, - type: OperatorTypeEnum.MATCH, - value: newField, - }, - ...parent.parent.entries.slice(entryIndex + 1), - ], - }, - }; - } else { - return { - index: entryIndex, - updatedEntry: { - field: field != null ? field.name : '', - id: item.id, - operator: operator.operator, - type: OperatorTypeEnum.MATCH, - value: newField, - }, - }; - } -}; - -/** - * Determines proper entry update when user updates value - * when operator is of type "wildcard" - * - * @param item - current exception item entry values - * @param newField - newly entered value - * - */ -export const getEntryOnWildcardChange = ( - item: FormattedBuilderEntry, - newField: string -): { index: number; updatedEntry: BuilderEntry } => { - const { nested, parent, entryIndex, field, operator } = item; - - if (nested != null && parent != null) { - const fieldName = field != null ? field.name.split('.').slice(-1)[0] : ''; - - return { - index: parent.parentIndex, - updatedEntry: { - ...parent.parent, - entries: [ - ...parent.parent.entries.slice(0, entryIndex), - { - field: fieldName, - id: item.id, - operator: operator.operator, - type: OperatorTypeEnum.WILDCARD, - value: newField, - }, - ...parent.parent.entries.slice(entryIndex + 1), - ], - }, - }; - } else { - return { - index: entryIndex, - updatedEntry: { - field: field != null ? field.name : '', - id: item.id, - operator: operator.operator, - type: OperatorTypeEnum.WILDCARD, - value: newField, - }, - }; - } -}; - -/** - * On operator change, determines whether value needs to be cleared or not - * - * @param field - * @param selectedOperator - * @param currentEntry - * - */ -export const getEntryFromOperator = ( - selectedOperator: OperatorOption, - currentEntry: FormattedBuilderEntry -): Entry & { id?: string } => { - const isSameOperatorType = currentEntry.operator.type === selectedOperator.type; - const fieldValue = currentEntry.field != null ? currentEntry.field.name : ''; - switch (selectedOperator.type) { - case 'match': - return { - field: fieldValue, - id: currentEntry.id, - operator: selectedOperator.operator, - type: OperatorTypeEnum.MATCH, - value: - isSameOperatorType && typeof currentEntry.value === 'string' ? currentEntry.value : '', - }; - case 'match_any': - return { - field: fieldValue, - id: currentEntry.id, - operator: selectedOperator.operator, - type: OperatorTypeEnum.MATCH_ANY, - value: isSameOperatorType && Array.isArray(currentEntry.value) ? currentEntry.value : [], - }; - case 'list': - return { - field: fieldValue, - id: currentEntry.id, - list: { id: '', type: 'ip' }, - operator: selectedOperator.operator, - type: OperatorTypeEnum.LIST, - }; - case 'wildcard': - return { - field: fieldValue, - id: currentEntry.id, - operator: selectedOperator.operator, - type: OperatorTypeEnum.WILDCARD, - value: - isSameOperatorType && typeof currentEntry.value === 'string' ? currentEntry.value : '', - }; - default: - return { - field: fieldValue, - id: currentEntry.id, - operator: selectedOperator.operator, - type: OperatorTypeEnum.EXISTS, - }; - } -}; - -/** - * Determines proper entry update when user selects new operator - * - * @param item - current exception item entry values - * @param newOperator - newly selected operator - * - */ -export const getEntryOnOperatorChange = ( - item: FormattedBuilderEntry, - newOperator: OperatorOption -): { updatedEntry: BuilderEntry; index: number } => { - const { parent, entryIndex, field, nested } = item; - const newEntry = getEntryFromOperator(newOperator, item); - - if (!entriesList.is(newEntry) && nested != null && parent != null) { - return { - index: parent.parentIndex, - updatedEntry: { - ...parent.parent, - entries: [ - ...parent.parent.entries.slice(0, entryIndex), - { - ...newEntry, - field: field != null ? field.name.split('.').slice(-1)[0] : '', - }, - ...parent.parent.entries.slice(entryIndex + 1), - ], - }, - }; - } else { - return { index: entryIndex, updatedEntry: newEntry }; - } -}; - -export const isKibanaStringType = (type: string) => { - const kbnFieldType = castEsToKbnFieldTypeName(type); - return kbnFieldType === KBN_FIELD_TYPES.STRING; -}; - -export const fieldSupportsMatches = (field: DataViewFieldBase) => { - return field.esTypes?.some(isKibanaStringType); -}; - -/** - * Determines which operators to make available - * - * @param item - * @param listType - * @param isBoolean - * @param includeValueListOperators whether or not to include the 'is in list' and 'is not in list' operators - */ -export const getOperatorOptions = ( - item: FormattedBuilderEntry, - listType: ExceptionListType, - isBoolean: boolean, - includeValueListOperators = true -): OperatorOption[] => { - if (item.nested === 'parent' || item.field == null) { - return [isOperator]; - } else if (listType === 'endpoint') { - if (isBoolean) { - return [isOperator]; - } else { - return fieldSupportsMatches(item.field) - ? [isOperator, isOneOfOperator, matchesOperator, doesNotMatchOperator] - : [isOperator, isOneOfOperator]; - } - } else if (item.nested != null && listType === 'detection') { - return isBoolean ? [isOperator, existsOperator] : [isOperator, isOneOfOperator, existsOperator]; - } else if (isBoolean) { - return [isOperator, isNotOperator, existsOperator, doesNotExistOperator]; - } else if (!includeValueListOperators) { - return fieldSupportsMatches(item.field) - ? EXCEPTION_OPERATORS_SANS_LISTS - : [ - isOperator, - isNotOperator, - isOneOfOperator, - isNotOneOfOperator, - existsOperator, - doesNotExistOperator, - ]; - } else { - return listType === 'detection' - ? fieldSupportsMatches(item.field) - ? DETECTION_ENGINE_EXCEPTION_OPERATORS - : [ - isOperator, - isNotOperator, - isOneOfOperator, - isNotOneOfOperator, - existsOperator, - doesNotExistOperator, - isInListOperator, - isNotInListOperator, - ] - : ALL_OPERATORS; - } -}; - -/** - * Fields of type 'text' do not generate autocomplete values, we want - * to find it's corresponding keyword type (if available) which does - * generate autocomplete values - * - * @param fields DataViewFieldBase fields - * @param selectedField the field name that was selected - * @param isTextType we only want a corresponding keyword field if - * the selected field is of type 'text' - * - */ -export const getCorrespondingKeywordField = ({ - fields, - selectedField, -}: { - fields: DataViewFieldBase[]; - selectedField: string | undefined; -}): DataViewFieldBase | undefined => { - const selectedFieldBits = - selectedField != null && selectedField !== '' ? selectedField.split('.') : []; - const selectedFieldIsTextType = selectedFieldBits.slice(-1)[0] === 'text'; - - if (selectedFieldIsTextType && selectedFieldBits.length > 0) { - const keywordField = selectedFieldBits.slice(0, selectedFieldBits.length - 1).join('.'); - const [foundKeywordField] = fields.filter( - ({ name }) => keywordField !== '' && keywordField === name - ); - return foundKeywordField; - } - - return undefined; -}; - -/** - * Formats the entry into one that is easily usable for the UI, most of the - * complexity was introduced with nested fields - * - * @param patterns DataViewBase containing available fields on rule index - * @param item exception item entry - * @param itemIndex entry index - * @param parent nested entries hold copy of their parent for use in various logic - * @param parentIndex corresponds to the entry index, this might seem obvious, but - * was added to ensure that nested items could be identified with their parent entry - * @param allowCustomFieldOptions determines if field must be found to match in indexPattern or not - */ -export const getFormattedBuilderEntry = ( - indexPattern: DataViewBase, - item: BuilderEntry, - itemIndex: number, - parent: EntryNested | undefined, - parentIndex: number | undefined, - allowCustomFieldOptions: boolean -): FormattedBuilderEntry => { - const { fields } = indexPattern; - const field = parent != null ? `${parent.field}.${item.field}` : item.field; - const [foundField] = fields.filter(({ name }) => field != null && field === name); - const correspondingKeywordField = getCorrespondingKeywordField({ - fields, - selectedField: field, - }); - - if (parent != null && parentIndex != null) { - return { - correspondingKeywordField, - entryIndex: itemIndex, - field: - foundField != null - ? { ...foundField, name: foundField.name.split('.').slice(-1)[0] } - : foundField, - id: item.id != null ? item.id : `${itemIndex}`, - nested: 'child', - operator: getExceptionOperatorSelect(item), - parent: { parent, parentIndex }, - value: getEntryValue(item), - }; - } else { - const fieldToUse = allowCustomFieldOptions - ? foundField ?? { name: item.field, type: 'keyword' } - : foundField; - - return { - correspondingKeywordField, - entryIndex: itemIndex, - field: fieldToUse, - id: item.id != null ? item.id : `${itemIndex}`, - nested: undefined, - operator: getExceptionOperatorSelect(item), - parent: undefined, - value: getEntryValue(item), - }; - } -}; - -/** - * Formats the entries to be easily usable for the UI, most of the - * complexity was introduced with nested fields - * - * @param patterns DataViewBase containing available fields on rule index - * @param entries exception item entries - * @param allowCustomFieldOptions determines if field must be found to match in indexPattern or not - * @param parent nested entries hold copy of their parent for use in various logic - * @param parentIndex corresponds to the entry index, this might seem obvious, but - * was added to ensure that nested items could be identified with their parent entry - */ -export const getFormattedBuilderEntries = ( - indexPattern: DataViewBase, - entries: BuilderEntry[], - allowCustomFieldOptions: boolean, - parent?: EntryNested, - parentIndex?: number -): FormattedBuilderEntry[] => { - return entries.reduce<FormattedBuilderEntry[]>((acc, item, index) => { - const isNewNestedEntry = item.type === 'nested' && item.entries.length === 0; - if (item.type !== 'nested' && !isNewNestedEntry) { - const newItemEntry: FormattedBuilderEntry = getFormattedBuilderEntry( - indexPattern, - item, - index, - parent, - parentIndex, - allowCustomFieldOptions - ); - return [...acc, newItemEntry]; - } else { - const parentEntry: FormattedBuilderEntry = { - correspondingKeywordField: undefined, - entryIndex: index, - field: isNewNestedEntry - ? undefined - : // This type below is really a FieldSpec type from "src/plugins/data/common/index_patterns/fields/types.ts", we cast it here to keep using the DataViewFieldBase interface - ({ - aggregatable: false, - esTypes: ['nested'], - name: item.field != null ? item.field : '', - searchable: false, - type: 'string', - } as DataViewFieldBase), - id: item.id != null ? item.id : `${index}`, - nested: 'parent', - operator: isOperator, - parent: undefined, - value: undefined, - }; - - // User has selected to add a nested field, but not yet selected the field - if (isNewNestedEntry) { - return [...acc, parentEntry]; - } - - if (isEntryNested(item)) { - const nestedItems = getFormattedBuilderEntries( - indexPattern, - item.entries, - allowCustomFieldOptions, - item, - index - ); - - return [...acc, parentEntry, ...nestedItems]; - } - - return [...acc]; - } - }, []); -}; - -export const getDefaultEmptyEntry = (): EmptyEntry => ({ - field: '', - id: uuidv4(), - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH, - value: '', -}); - -export const getDefaultNestedEmptyEntry = (): EmptyNestedEntry => ({ - entries: [], - field: '', - id: uuidv4(), - type: OperatorTypeEnum.NESTED, -}); - -export const containsValueListEntry = (items: ExceptionsBuilderExceptionItem[]): boolean => - items.some((item) => item.entries.some(({ type }) => type === OperatorTypeEnum.LIST)); - -export const buildShowActiveExceptionsFilter = (savedObjectPrefix: SavedObjectType[]): string => { - const now = new Date().toISOString(); - const filters = savedObjectPrefix.map( - (prefix) => - `${prefix}.attributes.expire_time > "${now}" OR NOT ${prefix}.attributes.expire_time: *` - ); - return filters.join(','); -}; - -export const buildShowExpiredExceptionsFilter = (savedObjectPrefix: SavedObjectType[]): string => { - const now = new Date().toISOString(); - const filters = savedObjectPrefix.map((prefix) => `${prefix}.attributes.expire_time <= "${now}"`); - return filters.join(','); -}; - -const getIndexGroupName = (indexName: string): string => { - // Check whether it is a Data Stream index - const dataStreamExp = /.ds-(.*?)-[0-9]{4}\.[0-9]{2}\.[0-9]{2}-[0-9]{6}/; - let result = indexName.match(dataStreamExp); - if (result && result.length === 2) { - return result[1]; - } - - // Check whether it is an old '.siem' index group - const siemSignalsExp = /.siem-(.*?)-[0-9]{6}/; - result = indexName.match(siemSignalsExp); - if (result && result.length === 2) { - return `.siem-${result[1]}`; - } - - // Otherwise return index name - return indexName; -}; - -export interface FieldConflictsInfo { - /** - * Kibana field type - */ - type: string; - /** - * Total count of the indices of this type - */ - totalIndexCount: number; - /** - * Grouped indices info - */ - groupedIndices: Array<{ - /** - * Index group name (like '.ds-...' or '.siem-signals-...') - */ - name: string; - /** - * Count of indices in the group - */ - count: number; - }>; -} - -export const getMappingConflictsInfo = (field: DataViewField): FieldConflictsInfo[] | null => { - if (!field.conflictDescriptions) { - return null; - } - const conflicts: FieldConflictsInfo[] = []; - for (const [key, value] of Object.entries(field.conflictDescriptions)) { - const groupedIndices: Array<{ - name: string; - count: number; - }> = []; - - // Group indices and calculate count of indices in each group - const groupedInfo: { [key: string]: number } = {}; - value.forEach((index) => { - const groupName = getIndexGroupName(index); - if (!groupedInfo[groupName]) { - groupedInfo[groupName] = 0; - } - groupedInfo[groupName]++; - }); - for (const [name, count] of Object.entries(groupedInfo)) { - groupedIndices.push({ - name, - count, - }); - } - - // Sort groups by the indices count - groupedIndices.sort((group1, group2) => { - return group2.count - group1.count; - }); - - conflicts.push({ - type: key, - totalIndexCount: value.length, - groupedIndices, - }); - } - return conflicts; -}; - -/** - * Given an exceptions list, determine if any entries have an "IS" operator with a wildcard value - */ -export const hasWrongOperatorWithWildcard = ( - items: ExceptionsBuilderReturnExceptionItem[] -): boolean => { - // flattens array of multiple entries added with OR - const multipleEntries = items.flatMap((item) => item.entries); - // flattens nested entries - const allEntries = multipleEntries.flatMap((item) => { - if (item.type === 'nested') { - return item.entries; - } - return item; - }); - - return allEntries.some((e) => { - if (e.type !== 'list' && 'value' in e) { - return validateHasWildcardWithWrongOperator({ - operator: e.type, - value: e.value, - }); - } - }); -}; - -/** - * Event filters helper where given an exceptions list, - * determine if both 'subject_name' and 'trusted' are - * included in an entry with 'code_signature' - */ -export const hasPartialCodeSignatureEntry = ( - items: ExceptionsBuilderReturnExceptionItem[] -): boolean => { - const { os_types: os = ['windows'], entries = [] } = items[0] || {}; - let name = false; - let trusted = false; - - for (const e of entries) { - if (e.type === 'nested' && e.field === 'process.Ext.code_signature') { - const includesNestedName = e.entries.some( - (nestedEntry) => nestedEntry.field === 'subject_name' - ); - const includesNestedTrusted = e.entries.some( - (nestedEntry) => nestedEntry.field === 'trusted' - ); - if (includesNestedName !== includesNestedTrusted) { - return true; - } - } else if ( - e.field === 'process.code_signature.subject_name' || - (os.includes('macos') && e.field === 'process.code_signature.team_id') - ) { - name = true; - } else if (e.field === 'process.code_signature.trusted') { - trusted = true; - } - } - return name !== trusted; -}; diff --git a/packages/kbn-securitysolution-list-utils/src/types/index.ts b/packages/kbn-securitysolution-list-utils/src/types/index.ts deleted file mode 100644 index 97098af88caf4..0000000000000 --- a/packages/kbn-securitysolution-list-utils/src/types/index.ts +++ /dev/null @@ -1,124 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { DataViewFieldBase } from '@kbn/es-query'; -import type { - CreateExceptionListItemSchema, - CreateRuleExceptionListItemSchema, - Entry, - EntryExists, - EntryMatch, - EntryMatchAny, - EntryMatchWildcard, - EntryNested, - ExceptionListItemSchema, - ListOperatorEnum as OperatorEnum, - ListOperatorTypeEnum as OperatorTypeEnum, - NamespaceType, -} from '@kbn/securitysolution-io-ts-list-types'; -import { - EXCEPTION_LIST_NAMESPACE, - EXCEPTION_LIST_NAMESPACE_AGNOSTIC, -} from '@kbn/securitysolution-list-constants'; - -export interface DataViewField extends DataViewFieldBase { - conflictDescriptions?: Record<string, string[]>; -} - -export interface OperatorOption { - message: string; - value: string; - operator: OperatorEnum; - type: OperatorTypeEnum; -} - -export interface FormattedBuilderEntry { - id: string; - field: DataViewField | undefined; - operator: OperatorOption; - value: string | string[] | undefined; - nested: 'parent' | 'child' | undefined; - entryIndex: number; - parent: { parent: BuilderEntryNested; parentIndex: number } | undefined; - correspondingKeywordField: DataViewFieldBase | undefined; -} - -export interface EmptyEntry { - id: string; - field: string | undefined; - operator: OperatorEnum; - type: OperatorTypeEnum.MATCH | OperatorTypeEnum.MATCH_ANY | OperatorTypeEnum.WILDCARD; - value: string | string[] | undefined; -} - -export interface EmptyListEntry { - id: string; - field: string | undefined; - operator: OperatorEnum; - type: OperatorTypeEnum.LIST; - list: { id: string | undefined; type: string | undefined }; -} - -export interface EmptyNestedEntry { - id: string; - field: string | undefined; - type: OperatorTypeEnum.NESTED; - entries: Array< - | (EntryMatch & { id?: string }) - | (EntryMatchAny & { id?: string }) - | (EntryMatchWildcard & { id?: string }) - | (EntryExists & { id?: string }) - >; -} - -export type BuilderEntry = - | (Entry & { id?: string }) - | EmptyListEntry - | EmptyEntry - | BuilderEntryNested - | EmptyNestedEntry; - -export type BuilderEntryNested = Omit<EntryNested, 'entries'> & { - id?: string; - entries: Array< - | (EntryMatch & { id?: string }) - | (EntryMatchAny & { id?: string }) - | (EntryMatchWildcard & { id?: string }) - | (EntryExists & { id?: string }) - >; -}; - -export type ExceptionListItemBuilderSchema = Omit<ExceptionListItemSchema, 'entries'> & { - entries: BuilderEntry[]; -}; - -export type CreateExceptionListItemBuilderSchema = Omit< - CreateExceptionListItemSchema, - 'meta' | 'entries' | 'list_id' | 'namespace_type' -> & { - meta: { temporaryUuid: string }; - entries: BuilderEntry[]; - list_id: string | undefined; - namespace_type: NamespaceType | undefined; -}; - -export type ExceptionsBuilderExceptionItem = - | ExceptionListItemBuilderSchema - | CreateExceptionListItemBuilderSchema; - -export type ExceptionsBuilderReturnExceptionItem = - | ExceptionListItemSchema - | CreateExceptionListItemSchema - | CreateRuleExceptionListItemSchema; - -export const exceptionListSavedObjectType = EXCEPTION_LIST_NAMESPACE; -export const exceptionListAgnosticSavedObjectType = EXCEPTION_LIST_NAMESPACE_AGNOSTIC; -export type SavedObjectType = - | typeof EXCEPTION_LIST_NAMESPACE - | typeof EXCEPTION_LIST_NAMESPACE_AGNOSTIC; diff --git a/packages/kbn-securitysolution-list-utils/tsconfig.json b/packages/kbn-securitysolution-list-utils/tsconfig.json deleted file mode 100644 index d75eb1f98314c..0000000000000 --- a/packages/kbn-securitysolution-list-utils/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts" - ], - "kbn_references": [ - "@kbn/es-query", - "@kbn/i18n", - "@kbn/securitysolution-io-ts-list-types", - "@kbn/securitysolution-io-ts-utils", - "@kbn/securitysolution-list-constants", - "@kbn/securitysolution-utils", - "@kbn/field-types" - ], - "exclude": [ - "target/**/*", - ] -} diff --git a/packages/kbn-securitysolution-lists-common/api/create_list/create_list.gen.ts b/packages/kbn-securitysolution-lists-common/api/create_list/create_list.gen.ts deleted file mode 100644 index ce05117c33082..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/create_list/create_list.gen.ts +++ /dev/null @@ -1,44 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* - * NOTICE: Do not edit this file manually. - * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. - * - * info: - * title: Create list API endpoint - * version: 2023-10-31 - */ - -import { z } from '@kbn/zod'; - -import { - ListId, - ListName, - ListDescription, - ListType, - ListMetadata, -} from '../model/list_common.gen'; -import { List } from '../model/list_schemas.gen'; - -export type CreateListRequestBody = z.infer<typeof CreateListRequestBody>; -export const CreateListRequestBody = z.object({ - id: ListId.optional(), - name: ListName, - description: ListDescription, - type: ListType, - serializer: z.string().optional(), - deserializer: z.string().optional(), - meta: ListMetadata.optional(), - version: z.number().int().min(1).optional().default(1), -}); -export type CreateListRequestBodyInput = z.input<typeof CreateListRequestBody>; - -export type CreateListResponse = z.infer<typeof CreateListResponse>; -export const CreateListResponse = List; diff --git a/packages/kbn-securitysolution-lists-common/api/create_list/create_list.schema.yaml b/packages/kbn-securitysolution-lists-common/api/create_list/create_list.schema.yaml deleted file mode 100644 index 191e973beba61..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/create_list/create_list.schema.yaml +++ /dev/null @@ -1,81 +0,0 @@ -openapi: 3.0.0 -info: - title: Create list API endpoint - version: '2023-10-31' -paths: - /api/lists: - post: - x-labels: [serverless, ess] - operationId: CreateList - x-codegen-enabled: true - summary: Create a list - description: Create a new list. - requestBody: - description: List's properties - required: true - content: - application/json: - schema: - type: object - properties: - id: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' - name: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListName' - description: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListDescription' - type: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListType' - serializer: - type: string - deserializer: - type: string - meta: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListMetadata' - version: - type: integer - minimum: 1 - default: 1 - required: - - name - - description - - type - responses: - 200: - description: Successful response - content: - application/json: - schema: - $ref: '../model/list_schemas.schema.yaml#/components/schemas/List' - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 409: - description: List already exists response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.gen.ts b/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.gen.ts deleted file mode 100644 index 13b5248b92704..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.gen.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* - * NOTICE: Do not edit this file manually. - * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. - * - * info: - * title: Create list DS API endpoint - * version: 2023-10-31 - */ - -import { z } from '@kbn/zod'; - -export type CreateListIndexResponse = z.infer<typeof CreateListIndexResponse>; -export const CreateListIndexResponse = z.object({ - acknowledged: z.boolean(), -}); diff --git a/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.schema.yaml b/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.schema.yaml deleted file mode 100644 index c775a9c7d873f..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.schema.yaml +++ /dev/null @@ -1,55 +0,0 @@ -openapi: 3.0.0 -info: - title: Create list DS API endpoint - version: '2023-10-31' -paths: - /api/lists/index: - post: - x-labels: [serverless, ess] - operationId: CreateListIndex - x-codegen-enabled: true - summary: Create list data streams - description: Create `.lists` and `.items` data streams in the relevant space. - responses: - 200: - description: Successful response - content: - application/json: - schema: - type: object - properties: - acknowledged: - type: boolean - required: [acknowledged] - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 409: - description: List data stream exists response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.gen.ts b/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.gen.ts deleted file mode 100644 index 4ebafd6568571..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.gen.ts +++ /dev/null @@ -1,38 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* - * NOTICE: Do not edit this file manually. - * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. - * - * info: - * title: Create list item API endpoint - * version: 2023-10-31 - */ - -import { z } from '@kbn/zod'; - -import { ListItemId, ListId, ListItemValue, ListItemMetadata } from '../model/list_common.gen'; -import { ListItem } from '../model/list_schemas.gen'; - -export type CreateListItemRequestBody = z.infer<typeof CreateListItemRequestBody>; -export const CreateListItemRequestBody = z.object({ - id: ListItemId.optional(), - list_id: ListId, - value: ListItemValue, - meta: ListItemMetadata.optional(), - /** - * Determines when changes made by the request are made visible to search - */ - refresh: z.enum(['true', 'false', 'wait_for']).optional(), -}); -export type CreateListItemRequestBodyInput = z.input<typeof CreateListItemRequestBody>; - -export type CreateListItemResponse = z.infer<typeof CreateListItemResponse>; -export const CreateListItemResponse = ListItem; diff --git a/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.schema.yaml b/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.schema.yaml deleted file mode 100644 index 01121d0143925..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.schema.yaml +++ /dev/null @@ -1,82 +0,0 @@ -openapi: 3.0.0 -info: - title: Create list item API endpoint - version: '2023-10-31' -paths: - /api/lists/items: - post: - x-labels: [serverless, ess] - operationId: CreateListItem - x-codegen-enabled: true - summary: Create a list item - description: | - Create a list item and associate it with the specified list. - - All list items in the same list must be the same type. For example, each list item in an `ip` list must define a specific IP address. - > info - > Before creating a list item, you must create a list. - requestBody: - description: List item's properties - required: true - content: - application/json: - schema: - type: object - properties: - id: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListItemId' - list_id: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' - value: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListItemValue' - meta: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListItemMetadata' - refresh: - type: string - enum: - - 'true' - - 'false' - - wait_for - description: Determines when changes made by the request are made visible to search - required: - - list_id - - value - responses: - 200: - description: Successful response - content: - application/json: - schema: - $ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem' - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 409: - description: List item already exists response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.gen.ts b/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.gen.ts deleted file mode 100644 index 109e6c58a1163..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.gen.ts +++ /dev/null @@ -1,37 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* - * NOTICE: Do not edit this file manually. - * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. - * - * info: - * title: Delete list API endpoint - * version: 2023-10-31 - */ - -import { z } from '@kbn/zod'; -import { BooleanFromString } from '@kbn/zod-helpers'; - -import { ListId } from '../model/list_common.gen'; -import { List } from '../model/list_schemas.gen'; - -export type DeleteListRequestQuery = z.infer<typeof DeleteListRequestQuery>; -export const DeleteListRequestQuery = z.object({ - /** - * List's `id` value - */ - id: ListId, - deleteReferences: BooleanFromString.optional().default(false), - ignoreReferences: BooleanFromString.optional().default(false), -}); -export type DeleteListRequestQueryInput = z.input<typeof DeleteListRequestQuery>; - -export type DeleteListResponse = z.infer<typeof DeleteListResponse>; -export const DeleteListResponse = List; diff --git a/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.schema.yaml b/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.schema.yaml deleted file mode 100644 index 7098753636379..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.schema.yaml +++ /dev/null @@ -1,73 +0,0 @@ -openapi: 3.0.0 -info: - title: Delete list API endpoint - version: '2023-10-31' -paths: - /api/lists: - delete: - x-labels: [serverless, ess] - operationId: DeleteList - x-codegen-enabled: true - summary: Delete a list - description: | - Delete a list using the list ID. - > info - > When you delete a list, all of its list items are also deleted. - parameters: - - name: id - in: query - required: true - description: List's `id` value - schema: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' - - name: deleteReferences - in: query - required: false - schema: - type: boolean - default: false - - name: ignoreReferences - in: query - required: false - schema: - type: boolean - default: false - responses: - 200: - description: Successful response - content: - application/json: - schema: - $ref: '../model/list_schemas.schema.yaml#/components/schemas/List' - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 404: - description: List not found response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.gen.ts b/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.gen.ts deleted file mode 100644 index 314c1e81bc6a9..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.gen.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* - * NOTICE: Do not edit this file manually. - * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. - * - * info: - * title: Delete list DS API endpoint - * version: 2023-10-31 - */ - -import { z } from '@kbn/zod'; - -export type DeleteListIndexResponse = z.infer<typeof DeleteListIndexResponse>; -export const DeleteListIndexResponse = z.object({ - acknowledged: z.boolean(), -}); diff --git a/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.schema.yaml b/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.schema.yaml deleted file mode 100644 index 4f4b0f00e8817..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.schema.yaml +++ /dev/null @@ -1,55 +0,0 @@ -openapi: 3.0.0 -info: - title: Delete list DS API endpoint - version: '2023-10-31' -paths: - /api/lists/index: - delete: - x-labels: [serverless, ess] - operationId: DeleteListIndex - x-codegen-enabled: true - summary: Delete list data streams - description: Delete the `.lists` and `.items` data streams. - responses: - 200: - description: Successful response - content: - application/json: - schema: - type: object - properties: - acknowledged: - type: boolean - required: [acknowledged] - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 404: - description: List data stream not found response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.schema.yaml b/packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.schema.yaml deleted file mode 100644 index 28913259387dd..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.schema.yaml +++ /dev/null @@ -1,82 +0,0 @@ -openapi: 3.0.0 -info: - title: Delete list item API endpoint - version: '2023-10-31' -paths: - /api/lists/items: - delete: - x-labels: [serverless, ess] - operationId: DeleteListItem - x-codegen-enabled: true - summary: Delete a list item - description: Delete a list item using its `id`, or its `list_id` and `value` fields. - parameters: - - name: id - in: query - required: false - description: Required if `list_id` and `value` are not specified - schema: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' - - name: list_id - in: query - required: false - description: Required if `id` is not specified - schema: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' - - name: value - in: query - required: false - description: Required if `id` is not specified - schema: - type: string - - name: refresh - in: query - required: false - description: Determines when changes made by the request are made visible to search - schema: - type: string - enum: ['true', 'false', 'wait_for'] - default: 'false' - responses: - 200: - description: Successful response - content: - application/json: - schema: - oneOf: - - $ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem' - - type: array - items: - $ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem' - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 404: - description: List item not found response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.gen.ts b/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.gen.ts deleted file mode 100644 index 4e514abefccc2..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.gen.ts +++ /dev/null @@ -1,30 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* - * NOTICE: Do not edit this file manually. - * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. - * - * info: - * title: Export list items API endpoint - * version: 2023-10-31 - */ - -import { z } from '@kbn/zod'; - -import { ListId } from '../model/list_common.gen'; - -export type ExportListItemsRequestQuery = z.infer<typeof ExportListItemsRequestQuery>; -export const ExportListItemsRequestQuery = z.object({ - /** - * List's id to export - */ - list_id: ListId, -}); -export type ExportListItemsRequestQueryInput = z.input<typeof ExportListItemsRequestQuery>; diff --git a/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.schema.yaml b/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.schema.yaml deleted file mode 100644 index 8d185a23b64c9..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.schema.yaml +++ /dev/null @@ -1,60 +0,0 @@ -openapi: 3.0.0 -info: - title: Export list items API endpoint - version: '2023-10-31' -paths: - /api/lists/items/_export: - post: - x-labels: [serverless, ess] - operationId: ExportListItems - x-codegen-enabled: true - summary: Export list items - description: Export list item values from the specified list. - parameters: - - name: list_id - in: query - required: true - description: List's id to export - schema: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' - responses: - 200: - description: Successful response - content: - application/ndjson: - schema: - type: string - format: binary - description: A `.txt` file containing list items from the specified list - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 404: - description: List not found response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.schema.yaml b/packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.schema.yaml deleted file mode 100644 index 3bb55decacff6..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.schema.yaml +++ /dev/null @@ -1,118 +0,0 @@ -openapi: 3.0.0 -info: - title: Find lists API endpoint - version: '2023-10-31' -paths: - /api/lists/_find: - get: - x-labels: [serverless, ess] - operationId: FindLists - x-codegen-enabled: true - summary: Get lists - description: Get a paginated subset of lists. By default, the first page is returned, with 20 results per page. - parameters: - - name: page - in: query - required: false - description: The page number to return - schema: - type: integer - - name: per_page - in: query - required: false - description: The number of lists to return per page - schema: - type: integer - - name: sort_field - in: query - required: false - description: Determines which field is used to sort the results - schema: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - - name: sort_order - in: query - required: false - description: Determines the sort order, which can be `desc` or `asc` - schema: - type: string - enum: [desc, asc] - - name: cursor - in: query - required: false - description: | - Returns the list that come after the last list returned in the previous call - (use the cursor value returned in the previous call). This parameter uses - the `tie_breaker_id` field to ensure all lists are sorted and returned correctly. - schema: - $ref: '#/components/schemas/FindListsCursor' - - name: filter - in: query - required: false - description: | - Filters the returned results according to the value of the specified field, - using the <field name>:<field value> syntax. - schema: - $ref: '#/components/schemas/FindListsFilter' - responses: - 200: - description: Successful response - content: - application/json: - schema: - type: object - properties: - data: - type: array - items: - $ref: '../model/list_schemas.schema.yaml#/components/schemas/List' - page: - type: integer - minimum: 0 - per_page: - type: integer - minimum: 0 - total: - type: integer - minimum: 0 - cursor: - $ref: '#/components/schemas/FindListsCursor' - required: - - data - - page - - per_page - - total - - cursor - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - -components: - schemas: - FindListsCursor: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - - FindListsFilter: - type: string diff --git a/packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.schema.yaml b/packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.schema.yaml deleted file mode 100644 index 520213e949c1d..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.schema.yaml +++ /dev/null @@ -1,101 +0,0 @@ -openapi: 3.0.0 -info: - title: Import list items API endpoint - version: '2023-10-31' -paths: - /api/lists/items/_import: - post: - x-labels: [serverless, ess] - operationId: ImportListItems - x-codegen-enabled: true - summary: Import list items - description: | - Import list items from a TXT or CSV file. The maximum file size is 9 million bytes. - - You can import items to a new or existing list. - requestBody: - required: true - content: - multipart/form-data: - schema: - type: object - properties: - file: - type: string - format: binary - description: A `.txt` or `.csv` file containing newline separated list items - parameters: - - name: list_id - in: query - required: false - description: | - List's id. - - Required when importing to an existing list. - schema: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' - - name: type - in: query - required: false - description: | - Type of the importing list. - - Required when importing a new list that is `list_id` is not specified. - schema: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListType' - - name: serializer - in: query - required: false - schema: - type: string - - name: deserializer - in: query - required: false - schema: - type: string - - name: refresh - in: query - required: false - description: Determines when changes made by the request are made visible to search - schema: - type: string - enum: ['true', 'false', 'wait_for'] - responses: - 200: - description: Successful response - content: - application/json: - schema: - $ref: '../model/list_schemas.schema.yaml#/components/schemas/List' - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 409: - description: List with specified list_id does not exist response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-lists-common/api/index.ts b/packages/kbn-securitysolution-lists-common/api/index.ts deleted file mode 100644 index 27c70d1628109..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/index.ts +++ /dev/null @@ -1,28 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './model/list_common.gen'; -export * from './model/list_schemas.gen'; -export * from './create_list_index/create_list_index.gen'; -export * from './create_list_item/create_list_item.gen'; -export * from './create_list/create_list.gen'; -export * from './delete_list_index/delete_list_index.gen'; -export * from './delete_list_item/delete_list_item.gen'; -export * from './delete_list/delete_list.gen'; -export * from './find_list_items/find_list_items.gen'; -export * from './find_lists/find_lists.gen'; -export * from './export_list_items/export_list_items.gen'; -export * from './import_list_items/import_list_items.gen'; -export * from './patch_list_item/patch_list_item.gen'; -export * from './patch_list/patch_list.gen'; -export * from './read_list_index/read_list_index.gen'; -export * from './read_list_item/read_list_item.gen'; -export * from './read_list/read_list.gen'; -export * from './update_list_item/update_list_item.gen'; -export * from './update_list/update_list.gen'; diff --git a/packages/kbn-securitysolution-lists-common/api/model/list_common.schema.yaml b/packages/kbn-securitysolution-lists-common/api/model/list_common.schema.yaml deleted file mode 100644 index 6fb160105bb5a..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/model/list_common.schema.yaml +++ /dev/null @@ -1,59 +0,0 @@ -openapi: 3.0.0 -info: - title: Common List Attributes - version: 'not applicable' -paths: {} -components: - schemas: - ListId: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - - ListType: - type: string - enum: - - binary - - boolean - - byte - - date - - date_nanos - - date_range - - double - - double_range - - float - - float_range - - geo_point - - geo_shape - - half_float - - integer - - integer_range - - ip - - ip_range - - keyword - - long - - long_range - - shape - - short - - text - - ListName: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - - ListDescription: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - - ListMetadata: - type: object - additionalProperties: true - - ListItemId: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - - ListItemValue: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - - ListItemDescription: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - - ListItemMetadata: - type: object - additionalProperties: true diff --git a/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.gen.ts b/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.gen.ts deleted file mode 100644 index d7c955e6daac3..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.gen.ts +++ /dev/null @@ -1,36 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* - * NOTICE: Do not edit this file manually. - * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. - * - * info: - * title: Patch list API endpoint - * version: 2023-10-31 - */ - -import { z } from '@kbn/zod'; - -import { ListId, ListName, ListDescription, ListMetadata } from '../model/list_common.gen'; -import { List } from '../model/list_schemas.gen'; - -export type PatchListRequestBody = z.infer<typeof PatchListRequestBody>; -export const PatchListRequestBody = z.object({ - id: ListId, - name: ListName.optional(), - description: ListDescription.optional(), - meta: ListMetadata.optional(), - version: z.number().int().min(1).optional(), - _version: z.string().optional(), -}); -export type PatchListRequestBodyInput = z.input<typeof PatchListRequestBody>; - -export type PatchListResponse = z.infer<typeof PatchListResponse>; -export const PatchListResponse = List; diff --git a/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.schema.yaml b/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.schema.yaml deleted file mode 100644 index b98b34e6347eb..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.schema.yaml +++ /dev/null @@ -1,74 +0,0 @@ -openapi: 3.0.0 -info: - title: Patch list API endpoint - version: '2023-10-31' -paths: - /api/lists: - patch: - x-labels: [serverless, ess] - operationId: PatchList - x-codegen-enabled: true - summary: Patch a list - description: Update specific fields of an existing list using the list ID. - requestBody: - description: List's properties - required: true - content: - application/json: - schema: - type: object - properties: - id: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' - name: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListName' - description: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListDescription' - meta: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListMetadata' - version: - type: integer - minimum: 1 - _version: - type: string - required: - - id - responses: - 200: - description: Successful response - content: - application/json: - schema: - $ref: '../model/list_schemas.schema.yaml#/components/schemas/List' - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 404: - description: List not found response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.gen.ts b/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.gen.ts deleted file mode 100644 index 9943a9999a898..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.gen.ts +++ /dev/null @@ -1,38 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* - * NOTICE: Do not edit this file manually. - * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. - * - * info: - * title: Patch list item API endpoint - * version: 2023-10-31 - */ - -import { z } from '@kbn/zod'; - -import { ListItemId, ListItemValue, ListItemMetadata } from '../model/list_common.gen'; -import { ListItem } from '../model/list_schemas.gen'; - -export type PatchListItemRequestBody = z.infer<typeof PatchListItemRequestBody>; -export const PatchListItemRequestBody = z.object({ - id: ListItemId, - value: ListItemValue.optional(), - meta: ListItemMetadata.optional(), - _version: z.string().optional(), - /** - * Determines when changes made by the request are made visible to search - */ - refresh: z.enum(['true', 'false', 'wait_for']).optional(), -}); -export type PatchListItemRequestBodyInput = z.input<typeof PatchListItemRequestBody>; - -export type PatchListItemResponse = z.infer<typeof PatchListItemResponse>; -export const PatchListItemResponse = ListItem; diff --git a/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.schema.yaml b/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.schema.yaml deleted file mode 100644 index f79efc4691dde..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.schema.yaml +++ /dev/null @@ -1,76 +0,0 @@ -openapi: 3.0.0 -info: - title: Patch list item API endpoint - version: '2023-10-31' -paths: - /api/lists/items: - patch: - x-labels: [serverless, ess] - operationId: PatchListItem - x-codegen-enabled: true - summary: Patch a list item - description: Update specific fields of an existing list item using the list item ID. - requestBody: - description: List item's properties - required: true - content: - application/json: - schema: - type: object - properties: - id: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListItemId' - value: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListItemValue' - meta: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListItemMetadata' - _version: - type: string - refresh: - type: string - enum: - - 'true' - - 'false' - - wait_for - description: Determines when changes made by the request are made visible to search - required: - - id - responses: - 200: - description: Successful response - content: - application/json: - schema: - $ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem' - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 404: - description: List item not found response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-lists-common/api/quickstart_client.gen.ts b/packages/kbn-securitysolution-lists-common/api/quickstart_client.gen.ts deleted file mode 100644 index 7bf343d935f2c..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/quickstart_client.gen.ts +++ /dev/null @@ -1,430 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* - * NOTICE: Do not edit this file manually. - * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. - * - * info: - * title: Lists API client for quickstart - * version: Bundle (no version) - */ - -import type { KbnClient } from '@kbn/test'; -import { ToolingLog } from '@kbn/tooling-log'; -import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; -import { catchAxiosErrorFormatAndThrow } from '@kbn/securitysolution-utils'; - -import type { CreateListIndexResponse } from './create_list_index/create_list_index.gen'; -import type { - CreateListItemRequestBodyInput, - CreateListItemResponse, -} from './create_list_item/create_list_item.gen'; -import type { CreateListRequestBodyInput, CreateListResponse } from './create_list/create_list.gen'; -import type { DeleteListIndexResponse } from './delete_list_index/delete_list_index.gen'; -import type { - DeleteListItemRequestQueryInput, - DeleteListItemResponse, -} from './delete_list_item/delete_list_item.gen'; -import type { - DeleteListRequestQueryInput, - DeleteListResponse, -} from './delete_list/delete_list.gen'; -import type { ExportListItemsRequestQueryInput } from './export_list_items/export_list_items.gen'; -import type { - FindListItemsRequestQueryInput, - FindListItemsResponse, -} from './find_list_items/find_list_items.gen'; -import type { FindListsRequestQueryInput, FindListsResponse } from './find_lists/find_lists.gen'; -import type { - ImportListItemsRequestQueryInput, - ImportListItemsResponse, -} from './import_list_items/import_list_items.gen'; -import type { - PatchListItemRequestBodyInput, - PatchListItemResponse, -} from './patch_list_item/patch_list_item.gen'; -import type { PatchListRequestBodyInput, PatchListResponse } from './patch_list/patch_list.gen'; -import type { ReadListIndexResponse } from './read_list_index/read_list_index.gen'; -import type { - ReadListItemRequestQueryInput, - ReadListItemResponse, -} from './read_list_item/read_list_item.gen'; -import type { ReadListPrivilegesResponse } from './read_list_privileges/read_list_privileges.gen'; -import type { ReadListRequestQueryInput, ReadListResponse } from './read_list/read_list.gen'; -import type { - UpdateListItemRequestBodyInput, - UpdateListItemResponse, -} from './update_list_item/update_list_item.gen'; -import type { UpdateListRequestBodyInput, UpdateListResponse } from './update_list/update_list.gen'; - -export interface ClientOptions { - kbnClient: KbnClient; - log: ToolingLog; -} - -export class Client { - readonly kbnClient: KbnClient; - readonly log: ToolingLog; - - constructor(options: ClientOptions) { - this.kbnClient = options.kbnClient; - this.log = options.log; - } - /** - * Create a new list. - */ - async createList(props: CreateListProps) { - this.log.info(`${new Date().toISOString()} Calling API CreateList`); - return this.kbnClient - .request<CreateListResponse>({ - path: '/api/lists', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'POST', - body: props.body, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Create `.lists` and `.items` data streams in the relevant space. - */ - async createListIndex() { - this.log.info(`${new Date().toISOString()} Calling API CreateListIndex`); - return this.kbnClient - .request<CreateListIndexResponse>({ - path: '/api/lists/index', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'POST', - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Create a list item and associate it with the specified list. - -All list items in the same list must be the same type. For example, each list item in an `ip` list must define a specific IP address. -> info -> Before creating a list item, you must create a list. - - */ - async createListItem(props: CreateListItemProps) { - this.log.info(`${new Date().toISOString()} Calling API CreateListItem`); - return this.kbnClient - .request<CreateListItemResponse>({ - path: '/api/lists/items', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'POST', - body: props.body, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Delete a list using the list ID. -> info -> When you delete a list, all of its list items are also deleted. - - */ - async deleteList(props: DeleteListProps) { - this.log.info(`${new Date().toISOString()} Calling API DeleteList`); - return this.kbnClient - .request<DeleteListResponse>({ - path: '/api/lists', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'DELETE', - - query: props.query, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Delete the `.lists` and `.items` data streams. - */ - async deleteListIndex() { - this.log.info(`${new Date().toISOString()} Calling API DeleteListIndex`); - return this.kbnClient - .request<DeleteListIndexResponse>({ - path: '/api/lists/index', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'DELETE', - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Delete a list item using its `id`, or its `list_id` and `value` fields. - */ - async deleteListItem(props: DeleteListItemProps) { - this.log.info(`${new Date().toISOString()} Calling API DeleteListItem`); - return this.kbnClient - .request<DeleteListItemResponse>({ - path: '/api/lists/items', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'DELETE', - - query: props.query, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Export list item values from the specified list. - */ - async exportListItems(props: ExportListItemsProps) { - this.log.info(`${new Date().toISOString()} Calling API ExportListItems`); - return this.kbnClient - .request({ - path: '/api/lists/items/_export', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'POST', - - query: props.query, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Get all list items in the specified list. - */ - async findListItems(props: FindListItemsProps) { - this.log.info(`${new Date().toISOString()} Calling API FindListItems`); - return this.kbnClient - .request<FindListItemsResponse>({ - path: '/api/lists/items/_find', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'GET', - - query: props.query, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Get a paginated subset of lists. By default, the first page is returned, with 20 results per page. - */ - async findLists(props: FindListsProps) { - this.log.info(`${new Date().toISOString()} Calling API FindLists`); - return this.kbnClient - .request<FindListsResponse>({ - path: '/api/lists/_find', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'GET', - - query: props.query, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Import list items from a TXT or CSV file. The maximum file size is 9 million bytes. - -You can import items to a new or existing list. - - */ - async importListItems(props: ImportListItemsProps) { - this.log.info(`${new Date().toISOString()} Calling API ImportListItems`); - return this.kbnClient - .request<ImportListItemsResponse>({ - path: '/api/lists/items/_import', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'POST', - body: props.attachment, - query: props.query, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Update specific fields of an existing list using the list ID. - */ - async patchList(props: PatchListProps) { - this.log.info(`${new Date().toISOString()} Calling API PatchList`); - return this.kbnClient - .request<PatchListResponse>({ - path: '/api/lists', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'PATCH', - body: props.body, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Update specific fields of an existing list item using the list item ID. - */ - async patchListItem(props: PatchListItemProps) { - this.log.info(`${new Date().toISOString()} Calling API PatchListItem`); - return this.kbnClient - .request<PatchListItemResponse>({ - path: '/api/lists/items', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'PATCH', - body: props.body, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Get the details of a list using the list ID. - */ - async readList(props: ReadListProps) { - this.log.info(`${new Date().toISOString()} Calling API ReadList`); - return this.kbnClient - .request<ReadListResponse>({ - path: '/api/lists', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'GET', - - query: props.query, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Verify that `.lists` and `.items` data streams exist. - */ - async readListIndex() { - this.log.info(`${new Date().toISOString()} Calling API ReadListIndex`); - return this.kbnClient - .request<ReadListIndexResponse>({ - path: '/api/lists/index', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'GET', - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Get the details of a list item. - */ - async readListItem(props: ReadListItemProps) { - this.log.info(`${new Date().toISOString()} Calling API ReadListItem`); - return this.kbnClient - .request<ReadListItemResponse>({ - path: '/api/lists/items', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'GET', - - query: props.query, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - async readListPrivileges() { - this.log.info(`${new Date().toISOString()} Calling API ReadListPrivileges`); - return this.kbnClient - .request<ReadListPrivilegesResponse>({ - path: '/api/lists/privileges', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'GET', - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Update a list using the list ID. The original list is replaced, and all unspecified fields are deleted. -> info -> You cannot modify the `id` value. - - */ - async updateList(props: UpdateListProps) { - this.log.info(`${new Date().toISOString()} Calling API UpdateList`); - return this.kbnClient - .request<UpdateListResponse>({ - path: '/api/lists', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'PUT', - body: props.body, - }) - .catch(catchAxiosErrorFormatAndThrow); - } - /** - * Update a list item using the list item ID. The original list item is replaced, and all unspecified fields are deleted. -> info -> You cannot modify the `id` value. - - */ - async updateListItem(props: UpdateListItemProps) { - this.log.info(`${new Date().toISOString()} Calling API UpdateListItem`); - return this.kbnClient - .request<UpdateListItemResponse>({ - path: '/api/lists/items', - headers: { - [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', - }, - method: 'PUT', - body: props.body, - }) - .catch(catchAxiosErrorFormatAndThrow); - } -} - -export interface CreateListProps { - body: CreateListRequestBodyInput; -} -export interface CreateListItemProps { - body: CreateListItemRequestBodyInput; -} -export interface DeleteListProps { - query: DeleteListRequestQueryInput; -} -export interface DeleteListItemProps { - query: DeleteListItemRequestQueryInput; -} -export interface ExportListItemsProps { - query: ExportListItemsRequestQueryInput; -} -export interface FindListItemsProps { - query: FindListItemsRequestQueryInput; -} -export interface FindListsProps { - query: FindListsRequestQueryInput; -} -export interface ImportListItemsProps { - query: ImportListItemsRequestQueryInput; - attachment: FormData; -} -export interface PatchListProps { - body: PatchListRequestBodyInput; -} -export interface PatchListItemProps { - body: PatchListItemRequestBodyInput; -} -export interface ReadListProps { - query: ReadListRequestQueryInput; -} -export interface ReadListItemProps { - query: ReadListItemRequestQueryInput; -} -export interface UpdateListProps { - body: UpdateListRequestBodyInput; -} -export interface UpdateListItemProps { - body: UpdateListItemRequestBodyInput; -} diff --git a/packages/kbn-securitysolution-lists-common/api/read_list/read_list.gen.ts b/packages/kbn-securitysolution-lists-common/api/read_list/read_list.gen.ts deleted file mode 100644 index d744eb15c9b50..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/read_list/read_list.gen.ts +++ /dev/null @@ -1,34 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* - * NOTICE: Do not edit this file manually. - * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. - * - * info: - * title: Read list API endpoint - * version: 2023-10-31 - */ - -import { z } from '@kbn/zod'; - -import { ListId } from '../model/list_common.gen'; -import { List } from '../model/list_schemas.gen'; - -export type ReadListRequestQuery = z.infer<typeof ReadListRequestQuery>; -export const ReadListRequestQuery = z.object({ - /** - * List's `id` value - */ - id: ListId, -}); -export type ReadListRequestQueryInput = z.input<typeof ReadListRequestQuery>; - -export type ReadListResponse = z.infer<typeof ReadListResponse>; -export const ReadListResponse = List; diff --git a/packages/kbn-securitysolution-lists-common/api/read_list/read_list.schema.yaml b/packages/kbn-securitysolution-lists-common/api/read_list/read_list.schema.yaml deleted file mode 100644 index d932e16f528a5..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/read_list/read_list.schema.yaml +++ /dev/null @@ -1,58 +0,0 @@ -openapi: 3.0.0 -info: - title: Read list API endpoint - version: '2023-10-31' -paths: - /api/lists: - get: - x-labels: [serverless, ess] - operationId: ReadList - x-codegen-enabled: true - summary: Get list details - description: Get the details of a list using the list ID. - parameters: - - name: id - in: query - required: true - description: List's `id` value - schema: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' - responses: - 200: - description: Successful response - content: - application/json: - schema: - $ref: '../model/list_schemas.schema.yaml#/components/schemas/List' - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 404: - description: List not found response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.gen.ts b/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.gen.ts deleted file mode 100644 index 8a5068f72f234..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.gen.ts +++ /dev/null @@ -1,25 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* - * NOTICE: Do not edit this file manually. - * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. - * - * info: - * title: Read list DS existence status API endpoint - * version: 2023-10-31 - */ - -import { z } from '@kbn/zod'; - -export type ReadListIndexResponse = z.infer<typeof ReadListIndexResponse>; -export const ReadListIndexResponse = z.object({ - list_index: z.boolean(), - list_item_index: z.boolean(), -}); diff --git a/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.schema.yaml b/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.schema.yaml deleted file mode 100644 index b675264600157..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.schema.yaml +++ /dev/null @@ -1,57 +0,0 @@ -openapi: 3.0.0 -info: - title: Read list DS existence status API endpoint - version: '2023-10-31' -paths: - /api/lists/index: - get: - x-labels: [serverless, ess] - operationId: ReadListIndex - x-codegen-enabled: true - summary: Get status of list data streams - description: Verify that `.lists` and `.items` data streams exist. - responses: - 200: - description: Successful response - content: - application/json: - schema: - type: object - properties: - list_index: - type: boolean - list_item_index: - type: boolean - required: [list_index, list_item_index] - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 404: - description: List data stream(s) not found response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.gen.ts b/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.gen.ts deleted file mode 100644 index cd0c1d8fca26d..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.gen.ts +++ /dev/null @@ -1,42 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* - * NOTICE: Do not edit this file manually. - * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. - * - * info: - * title: Read list item API endpoint - * version: 2023-10-31 - */ - -import { z } from '@kbn/zod'; - -import { ListId } from '../model/list_common.gen'; -import { ListItem } from '../model/list_schemas.gen'; - -export type ReadListItemRequestQuery = z.infer<typeof ReadListItemRequestQuery>; -export const ReadListItemRequestQuery = z.object({ - /** - * Required if `list_id` and `value` are not specified - */ - id: ListId.optional(), - /** - * Required if `id` is not specified - */ - list_id: ListId.optional(), - /** - * Required if `id` is not specified - */ - value: z.string().optional(), -}); -export type ReadListItemRequestQueryInput = z.input<typeof ReadListItemRequestQuery>; - -export type ReadListItemResponse = z.infer<typeof ReadListItemResponse>; -export const ReadListItemResponse = z.union([ListItem, z.array(ListItem)]); diff --git a/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.schema.yaml b/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.schema.yaml deleted file mode 100644 index 4d686f5452e0c..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.schema.yaml +++ /dev/null @@ -1,74 +0,0 @@ -openapi: 3.0.0 -info: - title: Read list item API endpoint - version: '2023-10-31' -paths: - /api/lists/items: - get: - x-labels: [serverless, ess] - operationId: ReadListItem - x-codegen-enabled: true - summary: Get a list item - description: Get the details of a list item. - parameters: - - name: id - in: query - required: false - description: Required if `list_id` and `value` are not specified - schema: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' - - name: list_id - in: query - required: false - description: Required if `id` is not specified - schema: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' - - name: value - in: query - required: false - description: Required if `id` is not specified - schema: - type: string - responses: - 200: - description: Successful response - content: - application/json: - schema: - oneOf: - - $ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem' - - type: array - items: - $ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem' - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 404: - description: List item not found response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-lists-common/api/update_list/update_list.gen.ts b/packages/kbn-securitysolution-lists-common/api/update_list/update_list.gen.ts deleted file mode 100644 index f5eb085fe4aa5..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/update_list/update_list.gen.ts +++ /dev/null @@ -1,36 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* - * NOTICE: Do not edit this file manually. - * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. - * - * info: - * title: Update list API endpoint - * version: 2023-10-31 - */ - -import { z } from '@kbn/zod'; - -import { ListId, ListName, ListDescription, ListMetadata } from '../model/list_common.gen'; -import { List } from '../model/list_schemas.gen'; - -export type UpdateListRequestBody = z.infer<typeof UpdateListRequestBody>; -export const UpdateListRequestBody = z.object({ - id: ListId, - name: ListName, - description: ListDescription, - meta: ListMetadata.optional(), - version: z.number().int().min(1).optional(), - _version: z.string().optional(), -}); -export type UpdateListRequestBodyInput = z.input<typeof UpdateListRequestBody>; - -export type UpdateListResponse = z.infer<typeof UpdateListResponse>; -export const UpdateListResponse = List; diff --git a/packages/kbn-securitysolution-lists-common/api/update_list/update_list.schema.yaml b/packages/kbn-securitysolution-lists-common/api/update_list/update_list.schema.yaml deleted file mode 100644 index c41b52427b63d..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/update_list/update_list.schema.yaml +++ /dev/null @@ -1,79 +0,0 @@ -openapi: 3.0.0 -info: - title: Update list API endpoint - version: '2023-10-31' -paths: - /api/lists: - put: - x-labels: [serverless, ess] - operationId: UpdateList - x-codegen-enabled: true - summary: Update a list - description: | - Update a list using the list ID. The original list is replaced, and all unspecified fields are deleted. - > info - > You cannot modify the `id` value. - requestBody: - description: List's properties - required: true - content: - application/json: - schema: - type: object - properties: - id: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' - name: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListName' - description: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListDescription' - meta: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListMetadata' - version: - type: integer - minimum: 1 - _version: - type: string - required: - - id - - name - - description - responses: - 200: - description: Successful response - content: - application/json: - schema: - $ref: '../model/list_schemas.schema.yaml#/components/schemas/List' - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 404: - description: List not found response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.gen.ts b/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.gen.ts deleted file mode 100644 index 052c4c979e844..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.gen.ts +++ /dev/null @@ -1,34 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* - * NOTICE: Do not edit this file manually. - * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. - * - * info: - * title: Update list item API endpoint - * version: 2023-10-31 - */ - -import { z } from '@kbn/zod'; - -import { ListItemId, ListItemValue, ListItemMetadata } from '../model/list_common.gen'; -import { ListItem } from '../model/list_schemas.gen'; - -export type UpdateListItemRequestBody = z.infer<typeof UpdateListItemRequestBody>; -export const UpdateListItemRequestBody = z.object({ - id: ListItemId, - value: ListItemValue, - meta: ListItemMetadata.optional(), - _version: z.string().optional(), -}); -export type UpdateListItemRequestBodyInput = z.input<typeof UpdateListItemRequestBody>; - -export type UpdateListItemResponse = z.infer<typeof UpdateListItemResponse>; -export const UpdateListItemResponse = ListItem; diff --git a/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.schema.yaml b/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.schema.yaml deleted file mode 100644 index 6b05e01f35aab..0000000000000 --- a/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.schema.yaml +++ /dev/null @@ -1,73 +0,0 @@ -openapi: 3.0.0 -info: - title: Update list item API endpoint - version: '2023-10-31' -paths: - /api/lists/items: - put: - x-labels: [serverless, ess] - operationId: UpdateListItem - x-codegen-enabled: true - summary: Update a list item - description: | - Update a list item using the list item ID. The original list item is replaced, and all unspecified fields are deleted. - > info - > You cannot modify the `id` value. - requestBody: - description: List item's properties - required: true - content: - application/json: - schema: - type: object - properties: - id: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListItemId' - value: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListItemValue' - meta: - $ref: '../model/list_common.schema.yaml#/components/schemas/ListItemMetadata' - _version: - type: string - required: - - id - - value - responses: - 200: - description: Successful response - content: - application/json: - schema: - $ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem' - 400: - description: Invalid input data response - content: - application/json: - schema: - oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 401: - description: Unsuccessful authentication response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 403: - description: Not enough privileges response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - 404: - description: List item not found response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' - 500: - description: Internal server error response - content: - application/json: - schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-lists-common/package.json b/packages/kbn-securitysolution-lists-common/package.json deleted file mode 100644 index 624c2709ea737..0000000000000 --- a/packages/kbn-securitysolution-lists-common/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "description": "Security Solution Lists common package", - "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0", - "name": "@kbn/securitysolution-lists-common", - "private": true, - "version": "1.0.0", - "scripts": { - "openapi:generate": "node scripts/openapi_generate", - "openapi:bundle": "node scripts/openapi_bundle" - } -} diff --git a/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle.js b/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle.js deleted file mode 100644 index 7a61724759178..0000000000000 --- a/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle.js +++ /dev/null @@ -1,40 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -require('../../../src/setup_node_env'); -const { join, resolve } = require('path'); -const { bundle } = require('@kbn/openapi-bundler'); - -const ROOT = resolve(__dirname, '..'); - -(async () => { - await bundle({ - sourceGlob: join(ROOT, 'api/**/*.schema.yaml'), - outputFilePath: join( - ROOT, - 'docs/openapi/serverless/security_solution_lists_api_{version}.bundled.schema.yaml' - ), - options: { - includeLabels: ['serverless'], - prototypeDocument: join(ROOT, 'scripts/openapi_bundle_info/lists_serverless.info.yaml'), - }, - }); - - await bundle({ - sourceGlob: join(ROOT, 'api/**/*.schema.yaml'), - outputFilePath: join( - ROOT, - 'docs/openapi/ess/security_solution_lists_api_{version}.bundled.schema.yaml' - ), - options: { - includeLabels: ['ess'], - prototypeDocument: join(ROOT, 'scripts/openapi_bundle_info/lists_ess.info.yaml'), - }, - }); -})(); diff --git a/packages/kbn-securitysolution-lists-common/scripts/openapi_generate.js b/packages/kbn-securitysolution-lists-common/scripts/openapi_generate.js deleted file mode 100644 index 7adc36ed32cab..0000000000000 --- a/packages/kbn-securitysolution-lists-common/scripts/openapi_generate.js +++ /dev/null @@ -1,52 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -require('../../../src/setup_node_env'); -const { join, resolve } = require('path'); -const { generate } = require('@kbn/openapi-generator'); -const { REPO_ROOT } = require('@kbn/repo-info'); - -const ROOT = resolve(__dirname, '..'); - -(async () => { - await generate({ - title: 'OpenAPI Lists API Schemas', - rootDir: ROOT, - sourceGlob: './api/**/*.schema.yaml', - templateName: 'zod_operation_schema', - }); - - await generate({ - title: 'Lists API client for tests', - rootDir: ROOT, - sourceGlob: './api/**/*.schema.yaml', - templateName: 'api_client_supertest', - skipLinting: true, - bundle: { - outFile: join( - REPO_ROOT, - 'x-pack/test/api_integration/services/security_solution_lists_api.gen.ts' - ), - }, - }); - - await generate({ - title: 'Lists API client for quickstart', - rootDir: ROOT, - sourceGlob: './api/**/*.schema.yaml', - templateName: 'api_client_quickstart', - skipLinting: true, - bundle: { - outFile: join( - REPO_ROOT, - 'packages/kbn-securitysolution-lists-common/api/quickstart_client.gen.ts' - ), - }, - }); -})(); diff --git a/packages/kbn-securitysolution-lists-common/tsconfig.json b/packages/kbn-securitysolution-lists-common/tsconfig.json deleted file mode 100644 index e8149be083552..0000000000000 --- a/packages/kbn-securitysolution-lists-common/tsconfig.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "compilerOptions": { - "outDir": "target/types", - "types": ["jest", "node"] - }, - "exclude": ["target/**/*"], - "extends": "../../tsconfig.base.json", - "include": ["**/*.ts"], - "kbn_references": [ - "@kbn/zod-helpers", - "@kbn/openapi-common", - "@kbn/test", - "@kbn/tooling-log", - "@kbn/core-http-common", - "@kbn/securitysolution-utils", - "@kbn/zod", - ] -} diff --git a/packages/kbn-securitysolution-rules/tsconfig.json b/packages/kbn-securitysolution-rules/tsconfig.json deleted file mode 100644 index 9bd4f35cf62a7..0000000000000 --- a/packages/kbn-securitysolution-rules/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts" - ], - "exclude": [ - "target/**/*", - ] -} diff --git a/packages/kbn-securitysolution-t-grid/index.ts b/packages/kbn-securitysolution-t-grid/index.ts deleted file mode 100644 index fb5ebc443ccda..0000000000000 --- a/packages/kbn-securitysolution-t-grid/index.ts +++ /dev/null @@ -1,13 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './src/constants'; -export * from './src/utils'; -// eslint-disable-next-line @kbn/imports/no_boundary_crossing -export * from './src/mock'; diff --git a/packages/kbn-securitysolution-t-grid/package.json b/packages/kbn-securitysolution-t-grid/package.json deleted file mode 100644 index b262a21e7dc62..0000000000000 --- a/packages/kbn-securitysolution-t-grid/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@kbn/securitysolution-t-grid", - "version": "1.0.0", - "description": "security solution t-grid packages will allow sharing components between timelines and security_solution plugin until we transfer all functionality to timelines plugin", - "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0", - "private": true -} \ No newline at end of file diff --git a/packages/kbn-securitysolution-t-grid/src/constants/index.ts b/packages/kbn-securitysolution-t-grid/src/constants/index.ts deleted file mode 100644 index 3ff541240a8c0..0000000000000 --- a/packages/kbn-securitysolution-t-grid/src/constants/index.ts +++ /dev/null @@ -1,27 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export const HIGHLIGHTED_DROP_TARGET_CLASS_NAME = 'highlighted-drop-target'; -export const EMPTY_PROVIDERS_GROUP_CLASS_NAME = 'empty-providers-group'; - -/** The draggable will move this many pixels via the keyboard when the arrow key is pressed */ -export const KEYBOARD_DRAG_OFFSET = 20; - -export const DRAGGABLE_KEYBOARD_WRAPPER_CLASS_NAME = 'draggable-keyboard-wrapper'; - -export const ROW_RENDERER_CLASS_NAME = 'row-renderer'; - -export const NOTES_CONTAINER_CLASS_NAME = 'notes-container'; - -export const NOTE_CONTENT_CLASS_NAME = 'note-content'; - -/** This class is added to the document body while dragging */ -export const IS_DRAGGING_CLASS_NAME = 'is-dragging'; - -export const HOVER_ACTIONS_ALWAYS_SHOW_CLASS_NAME = 'hover-actions-always-show'; diff --git a/packages/kbn-securitysolution-t-grid/src/mock/index.ts b/packages/kbn-securitysolution-t-grid/src/mock/index.ts deleted file mode 100644 index 51a5726d914f0..0000000000000 --- a/packages/kbn-securitysolution-t-grid/src/mock/index.ts +++ /dev/null @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './mock_event_details'; diff --git a/packages/kbn-securitysolution-t-grid/src/utils/api/index.ts b/packages/kbn-securitysolution-t-grid/src/utils/api/index.ts deleted file mode 100644 index 8f7588fdeafd3..0000000000000 --- a/packages/kbn-securitysolution-t-grid/src/utils/api/index.ts +++ /dev/null @@ -1,43 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { has } from 'lodash/fp'; - -export interface AppError extends Error { - body: { - message: string; - }; -} - -export interface KibanaError extends AppError { - body: { - message: string; - statusCode: number; - }; -} - -export interface SecurityAppError extends AppError { - body: { - message: string; - status_code: number; - }; -} - -export const isKibanaError = (error: unknown): error is KibanaError => - has('message', error) && has('body.message', error) && has('body.statusCode', error); - -export const isSecurityAppError = (error: unknown): error is SecurityAppError => - has('message', error) && has('body.message', error) && has('body.status_code', error); - -export const isAppError = (error: unknown): error is AppError => - isKibanaError(error) || isSecurityAppError(error); - -export const isNotFoundError = (error: unknown) => - (isKibanaError(error) && error.body.statusCode === 404) || - (isSecurityAppError(error) && error.body.status_code === 404); diff --git a/packages/kbn-securitysolution-t-grid/src/utils/drag_and_drop/index.ts b/packages/kbn-securitysolution-t-grid/src/utils/drag_and_drop/index.ts deleted file mode 100644 index 9b7f4bf6ed7dd..0000000000000 --- a/packages/kbn-securitysolution-t-grid/src/utils/drag_and_drop/index.ts +++ /dev/null @@ -1,134 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { DropResult } from '@hello-pangea/dnd'; - -export const draggableIdPrefix = 'draggableId'; - -export const droppableIdPrefix = 'droppableId'; - -export const draggableContentPrefix = `${draggableIdPrefix}.content.`; - -export const draggableTimelineProvidersPrefix = `${draggableIdPrefix}.timelineProviders.`; - -export const draggableFieldPrefix = `${draggableIdPrefix}.field.`; - -export const droppableContentPrefix = `${droppableIdPrefix}.content.`; - -export const droppableFieldPrefix = `${droppableIdPrefix}.field.`; - -export const droppableTimelineProvidersPrefix = `${droppableIdPrefix}.timelineProviders.`; - -export const droppableTimelineColumnsPrefix = `${droppableIdPrefix}.timelineColumns.`; - -export const droppableTimelineFlyoutBottomBarPrefix = `${droppableIdPrefix}.flyoutButton.`; - -export const getDraggableId = (dataProviderId: string): string => - `${draggableContentPrefix}${dataProviderId}`; - -export const getDraggableFieldId = ({ - contextId, - fieldId, -}: { - contextId: string; - fieldId: string; -}): string => `${draggableFieldPrefix}${escapeContextId(contextId)}.${escapeFieldId(fieldId)}`; - -export const getTimelineProviderDroppableId = ({ - groupIndex, - timelineId, -}: { - groupIndex: number; - timelineId: string; -}): string => `${droppableTimelineProvidersPrefix}${timelineId}.group.${groupIndex}`; - -export const getTimelineProviderDraggableId = ({ - dataProviderId, - groupIndex, - timelineId, -}: { - dataProviderId: string; - groupIndex: number; - timelineId: string; -}): string => - `${draggableTimelineProvidersPrefix}${timelineId}.group.${groupIndex}.${dataProviderId}`; - -export const getDroppableId = (visualizationPlaceholderId: string): string => - `${droppableContentPrefix}${visualizationPlaceholderId}`; - -export const sourceIsContent = (result: DropResult): boolean => - result.source.droppableId.startsWith(droppableContentPrefix); - -export const sourceAndDestinationAreSameTimelineProviders = (result: DropResult): boolean => { - const regex = /^droppableId\.timelineProviders\.(\S+)\./; - const sourceMatches = result.source.droppableId.match(regex) || []; - const destinationMatches = - (result.destination && result.destination.droppableId.match(regex)) || []; - - return ( - sourceMatches.length >= 2 && - destinationMatches.length >= 2 && - sourceMatches[1] === destinationMatches[1] - ); -}; - -export const draggableIsContent = (result: DropResult | { draggableId: string }): boolean => - result.draggableId.startsWith(draggableContentPrefix); - -export const draggableIsField = (result: DropResult | { draggableId: string }): boolean => - result.draggableId.startsWith(draggableFieldPrefix); - -export const reasonIsDrop = (result: DropResult): boolean => result.reason === 'DROP'; - -export const destinationIsTimelineProviders = (result: DropResult): boolean => - result.destination != null && - result.destination.droppableId.startsWith(droppableTimelineProvidersPrefix); - -export const destinationIsTimelineColumns = (result: DropResult): boolean => - result.destination != null && - result.destination.droppableId.startsWith(droppableTimelineColumnsPrefix); - -export const destinationIsTimelineButton = (result: DropResult): boolean => - result.destination != null && - result.destination.droppableId.startsWith(droppableTimelineFlyoutBottomBarPrefix); - -export const getProviderIdFromDraggable = (result: DropResult): string => - result.draggableId.substring(result.draggableId.lastIndexOf('.') + 1); - -export const getFieldIdFromDraggable = (result: DropResult): string => - unEscapeFieldId(result.draggableId.substring(result.draggableId.lastIndexOf('.') + 1)); - -export const escapeDataProviderId = (path: string) => path.replace(/\./g, '_'); - -export const escapeContextId = (path: string) => path.replace(/\./g, '_'); - -export const escapeFieldId = (path: string) => path.replace(/\./g, '!!!DOT!!!'); - -export const unEscapeFieldId = (path: string) => path.replace(/!!!DOT!!!/g, '.'); - -export const providerWasDroppedOnTimeline = (result: DropResult): boolean => - reasonIsDrop(result) && - draggableIsContent(result) && - sourceIsContent(result) && - destinationIsTimelineProviders(result); - -export const userIsReArrangingProviders = (result: DropResult): boolean => - reasonIsDrop(result) && sourceAndDestinationAreSameTimelineProviders(result); - -export const fieldWasDroppedOnTimelineColumns = (result: DropResult): boolean => - reasonIsDrop(result) && draggableIsField(result) && destinationIsTimelineColumns(result); - -/** - * Prevents fields from being dragged or dropped to any area other than column - * header drop zone in the timeline - */ -export const DRAG_TYPE_FIELD = 'drag-type-field'; - -/** This class is added to the document body while timeline field dragging */ -export const IS_TIMELINE_FIELD_DRAGGING_CLASS_NAME = 'is-timeline-field-dragging'; diff --git a/packages/kbn-securitysolution-t-grid/src/utils/index.ts b/packages/kbn-securitysolution-t-grid/src/utils/index.ts deleted file mode 100644 index c921565845e90..0000000000000 --- a/packages/kbn-securitysolution-t-grid/src/utils/index.ts +++ /dev/null @@ -1,11 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './api'; -export * from './drag_and_drop'; diff --git a/packages/kbn-securitysolution-t-grid/tsconfig.json b/packages/kbn-securitysolution-t-grid/tsconfig.json deleted file mode 100644 index 9bd4f35cf62a7..0000000000000 --- a/packages/kbn-securitysolution-t-grid/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts" - ], - "exclude": [ - "target/**/*", - ] -} diff --git a/packages/kbn-securitysolution-utils/index.ts b/packages/kbn-securitysolution-utils/index.ts deleted file mode 100644 index 8769a281e2201..0000000000000 --- a/packages/kbn-securitysolution-utils/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './src/add_remove_id_to_item'; -export * from './src/axios'; -export * from './src/transform_data_to_ndjson'; -export * from './src/path_validations'; -export * from './src/esql'; -export * from './src/debounce_async/debounce_async'; diff --git a/packages/kbn-securitysolution-utils/jest.config.js b/packages/kbn-securitysolution-utils/jest.config.js deleted file mode 100644 index 43e3bc62c156e..0000000000000 --- a/packages/kbn-securitysolution-utils/jest.config.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../..', - roots: ['<rootDir>/packages/kbn-securitysolution-utils'], -}; diff --git a/packages/kbn-securitysolution-utils/package.json b/packages/kbn-securitysolution-utils/package.json deleted file mode 100644 index 2e18ecbc76425..0000000000000 --- a/packages/kbn-securitysolution-utils/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@kbn/securitysolution-utils", - "version": "1.0.0", - "description": "security solution utilities to use across plugins such lists, security_solution, cases, etc...", - "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0", - "private": true, - "sideEffects": false -} \ No newline at end of file diff --git a/packages/kbn-securitysolution-utils/src/add_remove_id_to_item/index.test.ts b/packages/kbn-securitysolution-utils/src/add_remove_id_to_item/index.test.ts deleted file mode 100644 index 462f1245500ec..0000000000000 --- a/packages/kbn-securitysolution-utils/src/add_remove_id_to_item/index.test.ts +++ /dev/null @@ -1,79 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { addIdToItem, removeIdFromItem } from '.'; - -jest.mock('uuid', () => ({ - v4: jest.fn().mockReturnValue('123'), -})); - -describe('add_remove_id_to_item', () => { - afterEach(() => { - jest.clearAllMocks(); - }); - - describe('addIdToItem', () => { - test('it adds an id to an empty item', () => { - expect(addIdToItem({})).toEqual({ id: '123' }); - }); - - test('it adds a complex object', () => { - expect( - addIdToItem({ - field: '', - type: 'mapping', - value: '', - }) - ).toEqual({ - id: '123', - field: '', - type: 'mapping', - value: '', - }); - }); - - test('it adds an id to an existing item', () => { - expect(addIdToItem({ test: '456' })).toEqual({ id: '123', test: '456' }); - }); - - test('it does not change the id if it already exists', () => { - expect(addIdToItem({ id: '456' })).toEqual({ id: '456' }); - }); - - test('it returns the same reference if it has an id already', () => { - const obj = { id: '456' }; - expect(addIdToItem(obj)).toBe(obj); - }); - - test('it returns a new reference if it adds an id to an item', () => { - const obj = { test: '456' }; - expect(addIdToItem(obj)).not.toBe(obj); - }); - }); - - describe('removeIdFromItem', () => { - test('it removes an id from an item', () => { - expect(removeIdFromItem({ id: '456' })).toEqual({}); - }); - - test('it returns a new reference if it removes an id from an item', () => { - const obj = { id: '123', test: '456' }; - expect(removeIdFromItem(obj)).not.toBe(obj); - }); - - test('it does not effect an item without an id', () => { - expect(removeIdFromItem({ test: '456' })).toEqual({ test: '456' }); - }); - - test('it returns the same reference if it does not have an id already', () => { - const obj = { test: '456' }; - expect(removeIdFromItem(obj)).toBe(obj); - }); - }); -}); diff --git a/packages/kbn-securitysolution-utils/src/add_remove_id_to_item/index.ts b/packages/kbn-securitysolution-utils/src/add_remove_id_to_item/index.ts deleted file mode 100644 index b01a0f7db1ec7..0000000000000 --- a/packages/kbn-securitysolution-utils/src/add_remove_id_to_item/index.ts +++ /dev/null @@ -1,52 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { v4 as uuidv4 } from 'uuid'; - -/** - * This is useful for when you have arrays without an ID and need to add one for - * ReactJS keys. I break the types slightly by introducing an id to an arbitrary item - * but then cast it back to the regular type T. - * Usage of this could be considered tech debt as I am adding an ID when the backend - * could be doing the same thing but it depends on how you want to model your data and - * if you view modeling your data with id's to please ReactJS a good or bad thing. - * @param item The item to add an id to. - */ -type NotArray<T> = T extends unknown[] ? never : T; -export const addIdToItem = <T>(item: NotArray<T>): T => { - const maybeId = item as typeof item & { id?: string }; - if (maybeId.id != null) { - return item; - } else { - return { ...item, id: uuidv4() }; - } -}; - -/** - * This is to reverse the id you added to your arrays for ReactJS keys. - * @param item The item to remove the id from. - */ -export const removeIdFromItem = <T>( - item: NotArray<T> -): - | T - | Pick< - T & { - id?: string | undefined; - }, - Exclude<keyof T, 'id'> - > => { - const maybeId = item as typeof item & { id?: string }; - if (maybeId.id != null) { - const { id, ...noId } = maybeId; - return noId; - } else { - return item; - } -}; diff --git a/packages/kbn-securitysolution-utils/src/axios/index.ts b/packages/kbn-securitysolution-utils/src/axios/index.ts deleted file mode 100644 index c5c0bbe9d1fda..0000000000000 --- a/packages/kbn-securitysolution-utils/src/axios/index.ts +++ /dev/null @@ -1,72 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { AxiosError } from 'axios'; - -export class FormattedAxiosError extends Error { - public readonly request: { - method: string; - url: string; - data: unknown; - }; - public readonly response: { - status: number; - statusText: string; - data: any; - }; - - constructor(axiosError: AxiosError) { - const method = axiosError.config?.method ?? ''; - const url = axiosError.config?.url ?? ''; - - super( - `${axiosError.message}${ - axiosError?.response?.data ? `: ${JSON.stringify(axiosError?.response?.data)}` : '' - }${url ? `\n(Request: ${method} ${url})` : ''}` - ); - - this.request = { - method, - url, - data: axiosError.config?.data ?? '', - }; - - this.response = { - status: axiosError?.response?.status ?? 0, - statusText: axiosError?.response?.statusText ?? '', - data: axiosError?.response?.data, - }; - - this.name = this.constructor.name; - } - - toJSON() { - return { - message: this.message, - request: this.request, - response: this.response, - }; - } - - toString() { - return JSON.stringify(this.toJSON(), null, 2); - } -} - -/** - * Used with `promise.catch()`, it will format the Axios error to a new error and will re-throw - * @param error - */ -export const catchAxiosErrorFormatAndThrow = (error: Error): never => { - if (error instanceof AxiosError) { - throw new FormattedAxiosError(error); - } - - throw error; -}; diff --git a/packages/kbn-securitysolution-utils/src/client_concurrency/index.ts b/packages/kbn-securitysolution-utils/src/client_concurrency/index.ts deleted file mode 100644 index d3a479b441021..0000000000000 --- a/packages/kbn-securitysolution-utils/src/client_concurrency/index.ts +++ /dev/null @@ -1,37 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import limit from 'p-limit'; - -/** - * This type is just an async function's type - */ -type RequestFactory<Output> = () => Promise<Output>; - -/** - * Helper function to call a large number of async functions with limited concurrency. - * Example pattern of how to create functions to pass in: - * - * const ruleCopies = duplicateRuleParams(basicRule, 200); - * const functions = ruleCopies.map((rule) => () => detectionsClient.createRule({ body: rule })); - * - * Note that the `map` call in the example returns a *function* that calls detectionsClient.createRule, it doesn't call createRule immediately. - * - * @param functions Async functions to call with limited concurrency - * @param concurrency Maximum number of concurrent function calls - * @returns Results from all functions passed in - */ -export const concurrentlyExec = async <Output>( - requestFactories: Array<RequestFactory<Output>>, - concurrency: number = 10 -) => { - const limiter = limit(concurrency); - const promises = requestFactories.map((f) => limiter(f)); - return Promise.all(promises); -}; diff --git a/packages/kbn-securitysolution-utils/src/debounce_async/debounce_async.ts b/packages/kbn-securitysolution-utils/src/debounce_async/debounce_async.ts deleted file mode 100644 index 99fe653b0e21e..0000000000000 --- a/packages/kbn-securitysolution-utils/src/debounce_async/debounce_async.ts +++ /dev/null @@ -1,43 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/** - * Unlike lodash's debounce, which resolves intermediate calls with the most - * recent value, this implementation waits to resolve intermediate calls until - * the next invocation resolves. - * - * @param fn an async function - * - * @returns A debounced async function that resolves on the next invocation - */ -export function debounceAsync<Args extends unknown[], Result>( - fn: (...args: Args) => Result, - intervalMs: number -): (...args: Args) => Promise<Awaited<Result>> { - let timeoutId: ReturnType<typeof setTimeout> | undefined; - let resolve: (value: Awaited<Result>) => void; - let promise = new Promise<Awaited<Result>>((_resolve) => { - resolve = _resolve; - }); - - return (...args) => { - if (timeoutId) { - clearTimeout(timeoutId); - } - - timeoutId = setTimeout(async () => { - resolve(await fn(...args)); - promise = new Promise((_resolve) => { - resolve = _resolve; - }); - }, intervalMs); - - return promise; - }; -} diff --git a/packages/kbn-securitysolution-utils/src/esql/compute_if_esql_query_aggregating.ts b/packages/kbn-securitysolution-utils/src/esql/compute_if_esql_query_aggregating.ts deleted file mode 100644 index c9b8474b55969..0000000000000 --- a/packages/kbn-securitysolution-utils/src/esql/compute_if_esql_query_aggregating.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { type ESQLAstQueryExpression, parse } from '@kbn/esql-ast'; - -export const isAggregatingQuery = (astExpression: ESQLAstQueryExpression): boolean => - astExpression.commands.some((command) => command.name === 'stats'); - -/** - * compute if esqlQuery is aggregating/grouping, i.e. using STATS...BY command - * @param esqlQuery - * @returns boolean - */ -export const computeIsESQLQueryAggregating = (esqlQuery: string): boolean => { - const { root } = parse(esqlQuery); - return isAggregatingQuery(root); -}; diff --git a/packages/kbn-securitysolution-utils/src/esql/get_index_list_from_esql_query.ts b/packages/kbn-securitysolution-utils/src/esql/get_index_list_from_esql_query.ts deleted file mode 100644 index 7cf69b409d5dc..0000000000000 --- a/packages/kbn-securitysolution-utils/src/esql/get_index_list_from_esql_query.ts +++ /dev/null @@ -1,34 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { getIndexPatternFromESQLQuery } from '@kbn/esql-utils'; - -/** - * parses ES|QL query and returns array of indices - */ -export const getIndexListFromEsqlQuery = (query: string | undefined): string[] => { - try { - const indexString = getIndexPatternFromESQLQuery(query); - - return getIndexListFromIndexString(indexString); - } catch (e) { - return []; - } -}; - -/** - * transforms sting of indices, separated by commas to array - * index*, index2* => [index*, index2*] - */ -export const getIndexListFromIndexString = (indexString: string | undefined): string[] => { - if (!indexString) { - return []; - } - return indexString.split(',').map((index) => index.trim()); -}; diff --git a/packages/kbn-securitysolution-utils/src/esql/index.ts b/packages/kbn-securitysolution-utils/src/esql/index.ts deleted file mode 100644 index 930ff246988ea..0000000000000 --- a/packages/kbn-securitysolution-utils/src/esql/index.ts +++ /dev/null @@ -1,12 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './compute_if_esql_query_aggregating'; -export * from './get_index_list_from_esql_query'; -export * from './parse_esql_query'; diff --git a/packages/kbn-securitysolution-utils/src/path_validations/index.test.ts b/packages/kbn-securitysolution-utils/src/path_validations/index.test.ts deleted file mode 100644 index e6dfded200072..0000000000000 --- a/packages/kbn-securitysolution-utils/src/path_validations/index.test.ts +++ /dev/null @@ -1,760 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { - isPathValid, - hasSimpleExecutableName, - OperatingSystem, - ConditionEntryField, - validateWildcardInput, - validateHasWildcardWithWrongOperator, - validatePotentialWildcardInput, - validateFilePathInput, - WILDCARD_WARNING, - FILEPATH_WARNING, -} from '.'; - -describe('validatePotentialWildcardInput', () => { - it('warns on wildcard when field is file.path.text', () => { - expect( - validatePotentialWildcardInput({ - field: 'file.path.text', - os: OperatingSystem.WINDOWS, - value: 'c:\\path*.exe', - }) - ).toEqual(WILDCARD_WARNING); - }); - it('warns on wildcard when field is not file.path.text', () => { - expect( - validatePotentialWildcardInput({ - field: 'event.category', - os: OperatingSystem.WINDOWS, - value: 'some*value', - }) - ).toEqual(WILDCARD_WARNING); - }); -}); - -describe('validateWildcardInput', () => { - it('warns on wildcard for fields that are not file paths', () => { - expect(validateWildcardInput('*')).toEqual(WILDCARD_WARNING); - }); - it('does not warn if no wildcard', () => { - expect(validateWildcardInput('non-wildcard')).toEqual(undefined); - }); -}); - -describe('validateFilePathInput', () => { - describe('windows', () => { - const os = OperatingSystem.WINDOWS; - - it('does not warn on valid filenames', () => { - expect( - validateFilePathInput({ - os, - value: 'C:\\Windows\\*\\FILENAME.EXE-1231205124.gz', - }) - ).not.toBeDefined(); - expect( - validateFilePathInput({ - os, - value: "C:\\Windows\\*\\test$ as2@13---12!@#A,DS.#$^&$!#~ 'as'd.华语.txt", - }) - ).toEqual(undefined); - }); - - it('warns on wildcard in file name at the end of the path', () => { - expect(validateFilePathInput({ os, value: 'c:\\path*.exe' })).toEqual(WILDCARD_WARNING); - expect( - validateFilePathInput({ - os, - value: 'C:\\Windows\\*\\FILENAME.EXE-*.gz', - }) - ).toEqual(WILDCARD_WARNING); - }); - - it('warns on unix paths or non-windows paths', () => { - expect(validateFilePathInput({ os, value: '/opt/bin' })).toEqual(FILEPATH_WARNING); - }); - - it('warns on malformed paths', () => { - expect(validateFilePathInput({ os, value: 'c:\\path/opt' })).toEqual(FILEPATH_WARNING); - expect(validateFilePathInput({ os, value: '1242' })).toEqual(FILEPATH_WARNING); - expect(validateFilePathInput({ os, value: 'w12efdfa' })).toEqual(FILEPATH_WARNING); - expect(validateFilePathInput({ os, value: 'c:\\folder\\' })).toEqual(FILEPATH_WARNING); - }); - }); - describe('unix paths', () => { - const os = - parseInt((Math.random() * 2).toString(), 10) === 1 - ? OperatingSystem.MAC - : OperatingSystem.LINUX; - - it('does not warn on valid filenames', () => { - expect( - validateFilePathInput({ - os, - value: '/opt/*/FILENAME.EXE-1231205124.gz', - }) - ).not.toEqual(WILDCARD_WARNING); - expect( - validateFilePathInput({ - os, - value: "/opt/*/test$ as2@13---12!@#A,DS.#$^&$!#~ 'as'd.华语.txt", - }) - ).not.toEqual(WILDCARD_WARNING); - }); - it('warns on wildcard in file name at the end of the path', () => { - expect(validateFilePathInput({ os, value: '/opt/bin*' })).toEqual(WILDCARD_WARNING); - expect(validateFilePathInput({ os, value: '/opt/FILENAME.EXE-*.gz' })).toEqual( - WILDCARD_WARNING - ); - }); - - it('warns on windows paths', () => { - expect(validateFilePathInput({ os, value: 'd:\\path\\file.exe' })).toEqual(FILEPATH_WARNING); - }); - - it('warns on malformed paths', () => { - expect(validateFilePathInput({ os, value: 'opt/bin\\file.exe' })).toEqual(FILEPATH_WARNING); - expect(validateFilePathInput({ os, value: '1242' })).toEqual(FILEPATH_WARNING); - expect(validateFilePathInput({ os, value: 'w12efdfa' })).toEqual(FILEPATH_WARNING); - expect(validateFilePathInput({ os, value: '/folder/' })).toEqual(FILEPATH_WARNING); - }); - }); -}); - -describe('Wildcard and invalid operator', () => { - it('should return TRUE when operator is not "WILDCARD" and value contains a wildcard', () => { - expect(validateHasWildcardWithWrongOperator({ operator: 'match', value: 'asdf*' })).toEqual( - true - ); - }); - it('should return FALSE when operator is not "WILDCARD" and value does not contain a wildcard', () => { - expect(validateHasWildcardWithWrongOperator({ operator: 'match', value: 'asdf' })).toEqual( - false - ); - }); - it('should return FALSE when operator is "WILDCARD" and value contains a wildcard', () => { - expect(validateHasWildcardWithWrongOperator({ operator: 'wildcard', value: 'asdf*' })).toEqual( - false - ); - }); - it('should return FALSE when operator is "WILDCARD" and value does not contain a wildcard', () => { - expect(validateHasWildcardWithWrongOperator({ operator: 'wildcard', value: 'asdf' })).toEqual( - false - ); - }); -}); - -describe('No Warnings', () => { - it('should not show warnings on non path entries ', () => { - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.HASH, - type: 'match', - value: '5d5b09f6dcb2d53a5fffc60c4ac0d55fabdf556069d6631545f42aa6e3500f2e', - }) - ).toEqual(true); - - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.SIGNER, - type: 'match', - value: '', - }) - ).toEqual(true); - }); -}); - -describe('Unacceptable Windows wildcard paths', () => { - it('should not accept paths that do not have a folder name with a wildcard ', () => { - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: 'c:\\folder', - }) - ).toEqual(false); - }); - - it('should not accept paths that do not have a file name with a wildcard ', () => { - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: 'c:\\path.exe', - }) - ).toEqual(false); - }); - - it('should not accept nested paths that do not have a wildcard', () => { - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: 'c:\\folder\\path.exe', - }) - ).toEqual(false); - }); - - it('should not accept paths with * wildcard and /', () => { - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: 'c:/**/path.exe', - }) - ).toEqual(false); - }); - - it('should not accept paths with ? wildcard and /', () => { - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: 'C:/?indows/pat?', - }) - ).toEqual(false); - }); -}); - -describe('Acceptable Windows wildcard paths', () => { - it('should accept wildcards for folders', () => { - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: 'c:\\**\\path.exe', - }) - ).toEqual(true); - }); - - it('should accept wildcards for folders and files', () => { - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: 'e:\\**\\*.exe', - }) - ).toEqual(true); - }); - - it('should accept paths with single wildcard', () => { - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: 'f:\\*', - }) - ).toEqual(true); - - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: 'f:\\?', - }) - ).toEqual(true); - }); - - it('should accept paths that have wildcard in filenames', () => { - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: 'a:\\*.*', - }) - ).toEqual(true); - }); - - it('should accept paths with ? as wildcard', () => { - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: 'C:\\?indows\\pat?', - }) - ).toEqual(true); - }); - - it('should accept paths with both ? and * as wildcards', () => { - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: 'C:\\*?', - }) - ).toEqual(true); - }); - - it('should accept paths with multiple wildcards', () => { - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: 'C:\\**', - }) - ).toEqual(true); - - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: 'C:\\??', - }) - ).toEqual(true); - }); -}); - -describe('Acceptable Windows exact paths', () => { - it('should accept paths when it ends with a folder name', () => { - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'match', - value: 'c:\\folder', - }) - ).toEqual(true); - }); - - it('should accept paths when it ends with a file name', () => { - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'match', - value: 'c:\\path.exe', - }) - ).toEqual(true); - }); - - it('should accept paths when it ends with a filename in a folder', () => { - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'match', - value: 'c:\\folder\\path.exe', - }) - ).toEqual(true); - }); -}); - -describe('Acceptable Windows exact paths with hyphens', () => { - it('should accept paths when paths have folder names with hyphens', () => { - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'match', - value: 'c:\\hype-folder-name', - }) - ).toEqual(true); - }); - - it('should accept paths when file names have hyphens', () => { - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'match', - value: 'c:\\file-name.exe', - }) - ).toEqual(true); - }); -}); - -describe('Unacceptable Windows exact paths', () => { - it('should not accept paths with /', () => { - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'match', - value: 'c:/folder/path.exe', - }) - ).toEqual(false); - }); - - it('should not accept paths not having a <char:> in the suffix', () => { - expect( - isPathValid({ - os: OperatingSystem.WINDOWS, - field: ConditionEntryField.PATH, - type: 'match', - value: '\\folder\\path.exe', - }) - ).toEqual(false); - }); -}); - -/// -describe('Unacceptable Mac/Linux wildcard paths', () => { - it('should not accept paths that do not have a folder name with a wildcard ', () => { - expect( - isPathValid({ - os: OperatingSystem.MAC, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: '/folder', - }) - ).toEqual(false); - }); - - it('should not accept paths that do not have a file name with a wildcard ', () => { - expect( - isPathValid({ - os: OperatingSystem.LINUX, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: '/zip.zip', - }) - ).toEqual(false); - }); - - it('should not accept nested paths that do not have a wildcard', () => { - expect( - isPathValid({ - os: OperatingSystem.MAC, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: '/opt/pack.tar', - }) - ).toEqual(false); - }); - - it('should not accept paths with * wildcard and \\', () => { - expect( - isPathValid({ - os: OperatingSystem.LINUX, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: 'c:\\**\\path.exe', - }) - ).toEqual(false); - }); - - it('should not accept paths with ? wildcard and \\', () => { - expect( - isPathValid({ - os: OperatingSystem.LINUX, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: 'C:\\?indows\\pat?', - }) - ).toEqual(false); - }); -}); - -describe('Acceptable Mac/Linux wildcard paths', () => { - it('should accept wildcards for folders', () => { - expect( - isPathValid({ - os: OperatingSystem.MAC, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: '/**/file.', - }) - ).toEqual(true); - }); - - it('should accept wildcards for folders and files', () => { - expect( - isPathValid({ - os: OperatingSystem.LINUX, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: '/usr/bi?/*.js', - }) - ).toEqual(true); - }); - - it('should accept paths with single wildcard', () => { - expect( - isPathValid({ - os: OperatingSystem.MAC, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: '/op*', - }) - ).toEqual(true); - - expect( - isPathValid({ - os: OperatingSystem.LINUX, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: '/op?', - }) - ).toEqual(true); - }); - - it('should accept paths that have wildcard in filenames', () => { - expect( - isPathValid({ - os: OperatingSystem.MAC, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: '/*.*', - }) - ).toEqual(true); - }); - - it('should accept paths with ? as wildcard', () => { - expect( - isPathValid({ - os: OperatingSystem.LINUX, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: '/usr/?inux/pat?', - }) - ).toEqual(true); - }); - - it('should accept paths with both ? and * as wildcards', () => { - expect( - isPathValid({ - os: OperatingSystem.MAC, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: '/usr/*?', - }) - ).toEqual(true); - }); - - it('should accept paths with multiple wildcards', () => { - expect( - isPathValid({ - os: OperatingSystem.LINUX, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: '/usr/**', - }) - ).toEqual(true); - - expect( - isPathValid({ - os: OperatingSystem.MAC, - field: ConditionEntryField.PATH, - type: 'wildcard', - value: '/opt/??', - }) - ).toEqual(true); - }); -}); - -describe('Acceptable Mac/Linux exact paths', () => { - it('should accept paths when it is the root path', () => { - expect( - isPathValid({ - os: OperatingSystem.LINUX, - field: ConditionEntryField.PATH, - type: 'match', - value: '/', - }) - ).toEqual(true); - }); - - it('should accept paths when it ends with a file name', () => { - expect( - isPathValid({ - os: OperatingSystem.MAC, - field: ConditionEntryField.PATH, - type: 'match', - value: '/usr/file.ts', - }) - ).toEqual(true); - }); - - it('should accept paths when it ends with a filename in a folder', () => { - expect( - isPathValid({ - os: OperatingSystem.LINUX, - field: ConditionEntryField.PATH, - type: 'match', - value: '/opt/z.dmg', - }) - ).toEqual(true); - }); -}); - -describe('Acceptable Mac/Linux exact paths with hyphens', () => { - it('should accept paths when paths have folder names with hyphens', () => { - expect( - isPathValid({ - os: OperatingSystem.MAC, - field: ConditionEntryField.PATH, - type: 'match', - value: '/hype-folder-name', - }) - ).toEqual(true); - }); - - it('should accept paths when file names have hyphens', () => { - expect( - isPathValid({ - os: OperatingSystem.LINUX, - field: ConditionEntryField.PATH, - type: 'match', - value: '/file-name.dmg', - }) - ).toEqual(true); - }); -}); - -describe('Unacceptable Mac/Linux exact paths', () => { - it('should not accept paths with \\', () => { - expect( - isPathValid({ - os: OperatingSystem.MAC, - field: ConditionEntryField.PATH, - type: 'match', - value: 'c:\\folder\\path.exe', - }) - ).toEqual(false); - }); - - it('should not accept paths not starting with /', () => { - expect( - isPathValid({ - os: OperatingSystem.LINUX, - field: ConditionEntryField.PATH, - type: 'match', - value: 'opt/bin', - }) - ).toEqual(false); - }); - - it('should not accept paths ending with /', () => { - expect( - isPathValid({ - os: OperatingSystem.MAC, - field: ConditionEntryField.PATH, - type: 'match', - value: '/opt/bin/', - }) - ).toEqual(false); - }); - - it('should not accept file extensions with hyphens', () => { - expect( - isPathValid({ - os: OperatingSystem.LINUX, - field: ConditionEntryField.PATH, - type: 'match', - value: '/opt/bin/file.d-mg', - }) - ).toEqual(false); - }); -}); - -describe('hasSimpleExecutableName', () => { - it('should return TRUE when MAC/LINUX wildcard paths have an executable name', () => { - const os = - parseInt((Math.random() * 2).toString(), 10) === 1 - ? OperatingSystem.MAC - : OperatingSystem.LINUX; - - expect( - hasSimpleExecutableName({ - os, - type: 'wildcard', - value: '/opt/*/app', - }) - ).toEqual(true); - expect( - hasSimpleExecutableName({ - os, - type: 'wildcard', - value: '/op*/**/app.dmg', - }) - ).toEqual(true); - expect( - hasSimpleExecutableName({ - os, - type: 'wildcard', - value: "/sy*/test$ as2@13---12!@#A,DS.#$^&$!#~ 'as'd.华语.txt", - }) - ).toEqual(true); - }); - - it('should return FALSE when MAC/LINUX wildcard paths have a wildcard in executable name', () => { - const os = - parseInt((Math.random() * 2).toString(), 10) === 1 - ? OperatingSystem.MAC - : OperatingSystem.LINUX; - - expect( - hasSimpleExecutableName({ - os, - type: 'wildcard', - value: '/op/*/*pp', - }) - ).toEqual(false); - expect( - hasSimpleExecutableName({ - os, - type: 'wildcard', - value: '/op*/b**/ap.m**', - }) - ).toEqual(false); - }); - - it('should return TRUE when WINDOWS wildcards paths have a executable name', () => { - expect( - hasSimpleExecutableName({ - os: OperatingSystem.WINDOWS, - type: 'wildcard', - value: 'c:\\**\\path.exe', - }) - ).toEqual(true); - expect( - hasSimpleExecutableName({ - os: OperatingSystem.WINDOWS, - type: 'wildcard', - value: 'C:\\*\\file-name.path华语 1234.txt', - }) - ).toEqual(true); - expect( - hasSimpleExecutableName({ - os: OperatingSystem.WINDOWS, - type: 'wildcard', - value: "C:\\*\\test$ as2@13---12!@#A,DS.#$^&$!#~ 'as'd.华语.txt", - }) - ).toEqual(true); - }); - - it('should return FALSE when WINDOWS wildcards paths have a wildcard in executable name', () => { - expect( - hasSimpleExecutableName({ - os: OperatingSystem.WINDOWS, - type: 'wildcard', - value: 'c:\\**\\pa*h.exe', - }) - ).toEqual(false); - }); -}); diff --git a/packages/kbn-securitysolution-utils/src/path_validations/index.ts b/packages/kbn-securitysolution-utils/src/path_validations/index.ts deleted file mode 100644 index 1f1eaf0b01423..0000000000000 --- a/packages/kbn-securitysolution-utils/src/path_validations/index.ts +++ /dev/null @@ -1,245 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { i18n } from '@kbn/i18n'; - -export const WILDCARD_WARNING = i18n.translate('utils.wildcardWarning', { - defaultMessage: `Using wildcards can impact Endpoint performance`, -}); - -export const FILEPATH_WARNING = i18n.translate('utils.filename.pathWarning', { - defaultMessage: `Path may be formed incorrectly; verify value`, -}); - -export enum ConditionEntryField { - HASH = 'process.hash.*', - PATH = 'process.executable.caseless', - SIGNER = 'process.Ext.code_signature', - SIGNER_MAC = 'process.code_signature', -} - -export enum EntryFieldType { - HASH = '.hash.', - EXECUTABLE = '.executable.caseless', - PATH = '.path', - SIGNER = '.code_signature', -} - -export type TrustedAppConditionEntryField = - | 'process.hash.*' - | 'process.executable.caseless' - | 'process.Ext.code_signature' - | 'process.code_signature'; - -export type BlocklistConditionEntryField = - | 'file.hash.*' - | 'file.path' - | 'file.Ext.code_signature' - | 'file.path.caseless'; -export type AllConditionEntryFields = - | TrustedAppConditionEntryField - | BlocklistConditionEntryField - | 'file.path.text'; - -export enum OperatingSystem { - LINUX = 'linux', - MAC = 'macos', - WINDOWS = 'windows', -} - -export type EntryTypes = 'match' | 'wildcard' | 'match_any'; -export type TrustedAppEntryTypes = Extract<EntryTypes, 'match' | 'wildcard'>; -export type EventFiltersTypes = EntryTypes | 'exists' | 'nested'; - -export const validatePotentialWildcardInput = ({ - field = '', - os, - value = '', -}: { - field?: string; - os: OperatingSystem; - value?: string; -}): string | undefined => { - const textInput = value.trim(); - if (field === 'file.path.text') { - return validateFilePathInput({ os, value: textInput }); - } - return validateWildcardInput(textInput); -}; - -export const validateFilePathInput = ({ - os, - value, -}: { - os: OperatingSystem; - value: string; -}): string | undefined => { - const isValidFilePath = isPathValid({ - os, - field: 'file.path.text', - type: 'wildcard', - value, - }); - const hasSimpleFileName = hasSimpleExecutableName({ - os, - type: 'wildcard', - value, - }); - - if (!value.length) { - return FILEPATH_WARNING; - } - - if (isValidFilePath) { - if (hasSimpleFileName !== undefined && !hasSimpleFileName) { - return WILDCARD_WARNING; - } - } else { - return FILEPATH_WARNING; - } -}; - -export const validateWildcardInput = (value: string | string[]): string | undefined => { - const wildcardRegex = /[*?]/; - if (Array.isArray(value)) { - const doesAnyValueContainWildcardInput = value.some((v) => wildcardRegex.test(v)); - if (doesAnyValueContainWildcardInput) { - return WILDCARD_WARNING; - } - } else { - if (wildcardRegex.test(value)) { - return WILDCARD_WARNING; - } - } -}; - -export const validateHasWildcardWithWrongOperator = ({ - operator, - value, -}: { - operator: TrustedAppEntryTypes | EventFiltersTypes; - value: string | string[]; -}): boolean => { - if (operator !== 'wildcard' && validateWildcardInput(value)) { - return true; - } else { - return false; - } -}; - -export const hasSimpleExecutableName = ({ - os, - type, - value, -}: { - os: OperatingSystem; - type: EntryTypes; - value: string; -}): boolean | undefined => { - const separator = os === OperatingSystem.WINDOWS ? '\\' : '/'; - const lastString = value.split(separator).pop(); - if (!lastString) { - return; - } - if (type === 'wildcard') { - return (lastString.split('*').length || lastString.split('?').length) === 1; - } - return true; -}; - -export const isPathValid = ({ - os, - field, - type, - value, -}: { - os: OperatingSystem; - field: AllConditionEntryFields; - type: EntryTypes; - value: string; -}): boolean => { - const pathFields: AllConditionEntryFields[] = [ - 'process.executable.caseless', - 'file.path', - 'file.path.text', - ]; - if (pathFields.includes(field)) { - if (type === 'wildcard') { - return os === OperatingSystem.WINDOWS - ? isWindowsWildcardPathValid(value) - : isLinuxMacWildcardPathValid(value); - } - return doesPathMatchRegex({ value, os }); - } - return true; -}; - -const doesPathMatchRegex = ({ os, value }: { os: OperatingSystem; value: string }): boolean => { - if (os === OperatingSystem.WINDOWS) { - const filePathRegex = - /^[a-z]:(?:|\\\\[^<>:"'/\\|?*]+\\[^<>:"'/\\|?*]+|%\w+%|)[\\](?:[^<>:"'/\\|?*]+[\\/])*([^<>:"'/\\|?*])+$/i; - return filePathRegex.test(value); - } - return /^(\/|(\/[\w\-]+)+|\/[\w\-]+\.[\w]+|(\/[\w-]+)+\/[\w\-]+\.[\w]+)$/i.test(value); -}; - -const isWindowsWildcardPathValid = (path: string): boolean => { - const firstCharacter = path[0]; - const lastCharacter = path.slice(-1); - const trimmedValue = path.trim(); - const hasSlash = /\//.test(trimmedValue); - if (path.length === 0) { - return false; - } else if ( - hasSlash || - trimmedValue.length !== path.length || - firstCharacter === '^' || - lastCharacter === '\\' || - !hasWildcard({ path, isWindowsPath: true }) - ) { - return false; - } else { - return true; - } -}; - -const isLinuxMacWildcardPathValid = (path: string): boolean => { - const firstCharacter = path[0]; - const lastCharacter = path.slice(-1); - const trimmedValue = path.trim(); - if (path.length === 0) { - return false; - } else if ( - trimmedValue.length !== path.length || - firstCharacter !== '/' || - lastCharacter === '/' || - path.length > 1024 === true || - path.includes('//') === true || - !hasWildcard({ path, isWindowsPath: false }) - ) { - return false; - } else { - return true; - } -}; - -const hasWildcard = ({ - path, - isWindowsPath, -}: { - path: string; - isWindowsPath: boolean; -}): boolean => { - for (const pathComponent of path.split(isWindowsPath ? '\\' : '/')) { - if (/[\*|\?]+/.test(pathComponent) === true) { - return true; - } - } - return false; -}; diff --git a/packages/kbn-securitysolution-utils/src/transform_data_to_ndjson/index.test.ts b/packages/kbn-securitysolution-utils/src/transform_data_to_ndjson/index.test.ts deleted file mode 100644 index 8c4e8289b1dd3..0000000000000 --- a/packages/kbn-securitysolution-utils/src/transform_data_to_ndjson/index.test.ts +++ /dev/null @@ -1,85 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { transformDataToNdjson } from '.'; - -export const ANCHOR_DATE = '2020-02-20T03:57:54.037Z'; - -const getRulesSchemaMock = (anchorDate: string = ANCHOR_DATE) => ({ - author: [], - id: '7a7065d7-6e8b-4aae-8d20-c93613dec9f9', - created_at: new Date(anchorDate).toISOString(), - updated_at: new Date(anchorDate).toISOString(), - created_by: 'elastic', - description: 'some description', - enabled: true, - false_positives: ['false positive 1', 'false positive 2'], - from: 'now-6m', - immutable: false, - name: 'Query with a rule id', - query: 'user.name: root or user.name: admin', - references: ['test 1', 'test 2'], - severity: 'high', - severity_mapping: [], - updated_by: 'elastic_kibana', - tags: ['some fake tag 1', 'some fake tag 2'], - to: 'now', - type: 'query', - threat: [], - version: 1, - output_index: '.siem-signals-default', - max_signals: 100, - risk_score: 55, - risk_score_mapping: [], - language: 'kuery', - rule_id: 'query-rule-id', - interval: '5m', - exceptions_list: [], -}); - -describe('transformDataToNdjson', () => { - test('if rules are empty it returns an empty string', () => { - const ruleNdjson = transformDataToNdjson([]); - expect(ruleNdjson).toEqual(''); - }); - - test('single rule will transform with new line ending character for ndjson', () => { - const rule = getRulesSchemaMock(); - const ruleNdjson = transformDataToNdjson([rule]); - expect(ruleNdjson.endsWith('\n')).toBe(true); - }); - - test('multiple rules will transform with two new line ending characters for ndjson', () => { - const result1 = getRulesSchemaMock(); - const result2 = getRulesSchemaMock(); - result2.id = 'some other id'; - result2.rule_id = 'some other id'; - result2.name = 'Some other rule'; - - const ruleNdjson = transformDataToNdjson([result1, result2]); - // this is how we count characters in JavaScript :-) - const count = ruleNdjson.split('\n').length - 1; - expect(count).toBe(2); - }); - - test('you can parse two rules back out without errors', () => { - const result1 = getRulesSchemaMock(); - const result2 = getRulesSchemaMock(); - result2.id = 'some other id'; - result2.rule_id = 'some other id'; - result2.name = 'Some other rule'; - - const ruleNdjson = transformDataToNdjson([result1, result2]); - const ruleStrings = ruleNdjson.split('\n'); - const reParsed1 = JSON.parse(ruleStrings[0]); - const reParsed2 = JSON.parse(ruleStrings[1]); - expect(reParsed1).toEqual(result1); - expect(reParsed2).toEqual(result2); - }); -}); diff --git a/packages/kbn-securitysolution-utils/src/transform_data_to_ndjson/index.ts b/packages/kbn-securitysolution-utils/src/transform_data_to_ndjson/index.ts deleted file mode 100644 index b20606c356efe..0000000000000 --- a/packages/kbn-securitysolution-utils/src/transform_data_to_ndjson/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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export const transformDataToNdjson = (data: unknown[]): string => { - if (data.length !== 0) { - const dataString = data.map((item) => JSON.stringify(item)).join('\n'); - return `${dataString}\n`; - } else { - return ''; - } -}; diff --git a/packages/kbn-securitysolution-utils/tsconfig.json b/packages/kbn-securitysolution-utils/tsconfig.json deleted file mode 100644 index d45b0c973af87..0000000000000 --- a/packages/kbn-securitysolution-utils/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts" - ], - "kbn_references": [ - "@kbn/i18n", - "@kbn/esql-utils", - "@kbn/esql-ast", - "@kbn/esql-validation-autocomplete" - ], - "exclude": [ - "target/**/*", - ] -} diff --git a/packages/kbn-test/src/functional_test_runner/lib/config/run_check_ftr_configs_cli.ts b/packages/kbn-test/src/functional_test_runner/lib/config/run_check_ftr_configs_cli.ts index 5808c88901b11..265bdbe9e0082 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/config/run_check_ftr_configs_cli.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/config/run_check_ftr_configs_cli.ts @@ -25,6 +25,10 @@ const THIS_REL = Path.relative(REPO_ROOT, THIS_PATH); const IGNORED_PATHS = [ THIS_PATH, Path.resolve(REPO_ROOT, 'packages/kbn-test/src/jest/run_check_jest_configs_cli.ts'), + Path.resolve( + REPO_ROOT, + 'x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/playwright.config.ts' + ), ]; export async function runCheckFtrConfigsCli() { diff --git a/packages/kbn-unified-data-table/src/components/data_table.tsx b/packages/kbn-unified-data-table/src/components/data_table.tsx index abaec0f6a98e3..e7680ccc9175f 100644 --- a/packages/kbn-unified-data-table/src/components/data_table.tsx +++ b/packages/kbn-unified-data-table/src/components/data_table.tsx @@ -1198,13 +1198,13 @@ export const UnifiedDataTable = ({ {searchDescription ? ( <FormattedMessage id="unifiedDataTable.searchGenerationWithDescriptionGrid" - defaultMessage="Table generated by search {searchTitle} ({searchDescription})" + defaultMessage="Table generated by Discover session ''{searchTitle}'' ({searchDescription})" values={{ searchTitle, searchDescription }} /> ) : ( <FormattedMessage id="unifiedDataTable.searchGenerationWithDescription" - defaultMessage="Table generated by search {searchTitle}" + defaultMessage="Table generated by Discover session ''{searchTitle}''" values={{ searchTitle }} /> )} diff --git a/packages/kbn-unified-field-list/src/components/field_stats/field_top_values_bucket.tsx b/packages/kbn-unified-field-list/src/components/field_stats/field_top_values_bucket.tsx index a53bbcdebc468..64d4c75e228ce 100755 --- a/packages/kbn-unified-field-list/src/components/field_stats/field_top_values_bucket.tsx +++ b/packages/kbn-unified-field-list/src/components/field_stats/field_top_values_bucket.tsx @@ -211,8 +211,14 @@ const FieldTopValuesBucket: React.FC<FieldTopValuesBucketProps> = ({ ); }; +// copied from x-pack/plugins/banners/server/utils.ts +const hexColorRegexp = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i; +const isHexColor = (color: string) => { + return hexColorRegexp.test(color); +}; + const getPercentageColor = (euiTheme: EuiThemeComputed, color: string) => - euiTheme.themeName?.toLowerCase().includes('borealis') + euiTheme.themeName?.toLowerCase().includes('borealis') && isHexColor(color) ? makeHighContrastColor(color)(euiTheme) : color; // FIXME: remove in 9.x when Borealis becomes the default theme diff --git a/packages/kbn-xstate-utils/kibana.jsonc b/packages/kbn-xstate-utils/kibana.jsonc index 3b1bcf6bf8d76..5638550a862df 100644 --- a/packages/kbn-xstate-utils/kibana.jsonc +++ b/packages/kbn-xstate-utils/kibana.jsonc @@ -4,6 +4,6 @@ "owner": [ "@elastic/obs-ux-logs-team" ], - "group": "observability", - "visibility": "private" + "group": "platform", + "visibility": "shared" } diff --git a/packages/kbn-zod-helpers/README.md b/packages/kbn-zod-helpers/README.md deleted file mode 100644 index 5e622edffefe4..0000000000000 --- a/packages/kbn-zod-helpers/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Helpers and utilities for Zod - -[Zod](https://zod.dev/) is a schema validation library with static type inference for TypeScript. - -Helpers defined in this package: - -- Can be used in other packages and plugins to make it easier to define schemas with Zod, such as API schemas. -- Are already used in `packages/kbn-openapi-generator`. -- Are already used in `x-pack/plugins/security_solution`. - -When you add some helper code to this package, please make sure that: - -- The code is generic and domain-agnostic (doesn't "know" about any domains such as Security or Observability). -- The code is reusable and there are already a few use cases for it. Try to not generalize prematurely. \ No newline at end of file diff --git a/packages/kbn-zod-helpers/jest.config.js b/packages/kbn-zod-helpers/jest.config.js deleted file mode 100644 index 4f66c7eed2eee..0000000000000 --- a/packages/kbn-zod-helpers/jest.config.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../..', - roots: ['<rootDir>/packages/kbn-zod-helpers'], -}; diff --git a/packages/kbn-zod-helpers/tsconfig.json b/packages/kbn-zod-helpers/tsconfig.json deleted file mode 100644 index 9eab856c8c4d2..0000000000000 --- a/packages/kbn-zod-helpers/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "compilerOptions": { - "outDir": "target/types", - "types": ["jest", "node"] - }, - "exclude": ["target/**/*"], - "extends": "../../tsconfig.base.json", - "include": ["**/*.ts"], - "kbn_references": [ - "@kbn/datemath", - "@kbn/core", - "@kbn/zod", - ] -} diff --git a/packages/react/kibana_context/render/render_provider.tsx b/packages/react/kibana_context/render/render_provider.tsx index 233abb42834b9..345a0993bb9e4 100644 --- a/packages/react/kibana_context/render/render_provider.tsx +++ b/packages/react/kibana_context/render/render_provider.tsx @@ -25,11 +25,11 @@ export type KibanaRenderContextProviderProps = Omit<KibanaRootContextProviderPro export const KibanaRenderContextProvider: FC< PropsWithChildren<KibanaRenderContextProviderProps> > = ({ children, ...props }) => { - const { analytics, i18n, theme, userProfile, colorMode, modify } = props; + const { analytics, executionContext, i18n, theme, userProfile, colorMode, modify } = props; return ( <KibanaRootContextProvider globalStyles={false} - {...{ i18n, theme, userProfile, modify, colorMode }} + {...{ executionContext, i18n, theme, userProfile, modify, colorMode }} > <KibanaErrorBoundaryProvider analytics={analytics}> <KibanaErrorBoundary>{children}</KibanaErrorBoundary> diff --git a/packages/react/kibana_context/root/BUILD.bazel b/packages/react/kibana_context/root/BUILD.bazel index 1c47c25bc20a9..fc073da074a61 100644 --- a/packages/react/kibana_context/root/BUILD.bazel +++ b/packages/react/kibana_context/root/BUILD.bazel @@ -26,6 +26,7 @@ DEPS = [ "@npm//tslib", "@npm//@elastic/eui", "//packages/core/base/core-base-common", + "//packages/shared-ux/router/impl:shared-ux-router", ] js_library( diff --git a/packages/react/kibana_context/root/root_provider.test.tsx b/packages/react/kibana_context/root/root_provider.test.tsx index 405823a9b823c..52af9d5654216 100644 --- a/packages/react/kibana_context/root/root_provider.test.tsx +++ b/packages/react/kibana_context/root/root_provider.test.tsx @@ -15,6 +15,8 @@ import { useEuiTheme } from '@elastic/eui'; import type { UseEuiTheme } from '@elastic/eui'; import { mountWithIntl } from '@kbn/test-jest-helpers'; import type { KibanaTheme } from '@kbn/react-kibana-context-common'; +import type { ExecutionContextStart } from '@kbn/core-execution-context-browser'; +import { executionContextServiceMock } from '@kbn/core-execution-context-browser-mocks'; import { i18nServiceMock } from '@kbn/core-i18n-browser-mocks'; import { I18nStart } from '@kbn/core-i18n-browser'; import type { UserProfileService } from '@kbn/core-user-profile-browser'; @@ -25,11 +27,13 @@ describe('KibanaRootContextProvider', () => { let euiTheme: UseEuiTheme | undefined; let i18nMock: I18nStart; let userProfile: UserProfileService; + let executionContext: ExecutionContextStart; beforeEach(() => { euiTheme = undefined; i18nMock = i18nServiceMock.createStartContract(); userProfile = userProfileServiceMock.createStart(); + executionContext = executionContextServiceMock.createStartContract(); }); const flushPromises = async () => { @@ -64,6 +68,7 @@ describe('KibanaRootContextProvider', () => { <KibanaRootContextProvider i18n={i18nMock} userProfile={userProfile} + executionContext={executionContext} theme={{ theme$: of(coreTheme) }} > <InnerComponent /> @@ -82,6 +87,7 @@ describe('KibanaRootContextProvider', () => { <KibanaRootContextProvider i18n={i18nMock} userProfile={userProfile} + executionContext={executionContext} theme={{ theme$: coreTheme$ }} > <InnerComponent /> diff --git a/packages/react/kibana_context/root/root_provider.tsx b/packages/react/kibana_context/root/root_provider.tsx index 386a67fb005e3..be8ddfa3f95ae 100644 --- a/packages/react/kibana_context/root/root_provider.tsx +++ b/packages/react/kibana_context/root/root_provider.tsx @@ -11,6 +11,8 @@ import React, { FC, PropsWithChildren } from 'react'; import type { AnalyticsServiceStart } from '@kbn/core-analytics-browser'; import type { I18nStart } from '@kbn/core-i18n-browser'; +import type { ExecutionContextStart } from '@kbn/core-execution-context-browser'; +import { SharedUXRouterContext } from '@kbn/shared-ux-router'; // @ts-expect-error EUI exports this component internally, but Kibana isn't picking it up its types import { useIsNestedEuiProvider } from '@elastic/eui/lib/components/provider/nested'; @@ -25,6 +27,8 @@ export interface KibanaRootContextProviderProps extends KibanaEuiProviderProps { i18n: I18nStart; /** The `AnalyticsServiceStart` API from `CoreStart`. */ analytics?: Pick<AnalyticsServiceStart, 'reportEvent'>; + /** The `ExecutionContextStart` API from `CoreStart`. */ + executionContext?: ExecutionContextStart; } /** @@ -44,20 +48,26 @@ export interface KibanaRootContextProviderProps extends KibanaEuiProviderProps { export const KibanaRootContextProvider: FC<PropsWithChildren<KibanaRootContextProviderProps>> = ({ children, i18n, + executionContext, ...props }) => { const hasEuiProvider = useIsNestedEuiProvider(); + const rootContextProvider = ( + <SharedUXRouterContext.Provider value={{ services: { executionContext } }}> + <i18n.Context>{children}</i18n.Context> + </SharedUXRouterContext.Provider> + ); if (hasEuiProvider) { emitEuiProviderWarning( 'KibanaRootContextProvider has likely been nested in this React tree, either by direct reference or by KibanaRenderContextProvider. The result of this nesting is a nesting of EuiProvider, which has negative effects. Check your React tree for nested Kibana context providers.' ); - return <i18n.Context>{children}</i18n.Context>; + return rootContextProvider; } else { const { theme, userProfile, globalStyles, colorMode, modify } = props; return ( <KibanaEuiProvider {...{ theme, userProfile, globalStyles, colorMode, modify }}> - <i18n.Context>{children}</i18n.Context> + {rootContextProvider} </KibanaEuiProvider> ); } diff --git a/packages/react/kibana_context/root/tsconfig.json b/packages/react/kibana_context/root/tsconfig.json index a7606025552b8..8035f8379e390 100644 --- a/packages/react/kibana_context/root/tsconfig.json +++ b/packages/react/kibana_context/root/tsconfig.json @@ -24,5 +24,8 @@ "@kbn/core-analytics-browser", "@kbn/core-user-profile-browser", "@kbn/core-user-profile-browser-mocks", + "@kbn/core-execution-context-browser", + "@kbn/core-execution-context-browser-mocks", + "@kbn/shared-ux-router" ] } diff --git a/packages/serverless/settings/security_project/tsconfig.json b/packages/serverless/settings/security_project/tsconfig.json deleted file mode 100644 index 16d6022e3d9bc..0000000000000 --- a/packages/serverless/settings/security_project/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts", - ], - "exclude": [ - "target/**/*" - ], - "kbn_references": [ - "@kbn/management-settings-ids", - ] -} diff --git a/packages/shared-ux/router/impl/BUILD.bazel b/packages/shared-ux/router/impl/BUILD.bazel new file mode 100644 index 0000000000000..224bebcf72e4a --- /dev/null +++ b/packages/shared-ux/router/impl/BUILD.bazel @@ -0,0 +1,34 @@ +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") + +SRCS = glob( + [ + "**/*.ts", + "**/*.tsx", + ], + exclude = [ + "**/test_helpers.ts", + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +DEPS = [ + +] + +js_library( + name = "shared-ux-router", + package_name = "@kbn/shared-ux-router", + srcs = ["package.json"] + SRCS, + deps = DEPS, + visibility = ["//visibility:public"], +) diff --git a/packages/shared-ux/router/impl/__snapshots__/route.test.tsx.snap b/packages/shared-ux/router/impl/__snapshots__/route.test.tsx.snap index 418aa60b7c1f4..b7ef595289233 100644 --- a/packages/shared-ux/router/impl/__snapshots__/route.test.tsx.snap +++ b/packages/shared-ux/router/impl/__snapshots__/route.test.tsx.snap @@ -33,3 +33,5 @@ exports[`Route renders 1`] = ` <MatchPropagator /> </Route> `; + +exports[`Route renders with enableExecutionContextTracking as false 1`] = `<Route />`; diff --git a/packages/shared-ux/router/impl/index.ts b/packages/shared-ux/router/impl/index.ts index a8bef1b8499df..253d42beaa501 100644 --- a/packages/shared-ux/router/impl/index.ts +++ b/packages/shared-ux/router/impl/index.ts @@ -10,3 +10,5 @@ export { Route } from './route'; export { HashRouter, BrowserRouter, MemoryRouter, Router } from './router'; export { Routes } from './routes'; + +export { SharedUXRouterContext } from './services'; diff --git a/packages/shared-ux/router/impl/route.test.tsx b/packages/shared-ux/router/impl/route.test.tsx index 96bb6130387af..9d21690cdcf4f 100644 --- a/packages/shared-ux/router/impl/route.test.tsx +++ b/packages/shared-ux/router/impl/route.test.tsx @@ -9,15 +9,34 @@ import React, { Component, FC } from 'react'; import { shallow } from 'enzyme'; +import { useSharedUXRoutesContext } from './routes_context'; import { Route } from './route'; import { createMemoryHistory } from 'history'; +jest.mock('./routes_context', () => ({ + useSharedUXRoutesContext: jest.fn().mockImplementation(() => ({ + enableExecutionContextTracking: true, + })), +})); + describe('Route', () => { + beforeEach(() => { + jest.restoreAllMocks(); + }); + test('renders', () => { const example = shallow(<Route />); expect(example).toMatchSnapshot(); }); + test('renders with enableExecutionContextTracking as false', () => { + (useSharedUXRoutesContext as jest.Mock).mockImplementationOnce(() => ({ + enableExecutionContextTracking: false, + })); + const example = shallow(<Route />); + expect(example).toMatchSnapshot(); + }); + test('location renders as expected', () => { // create a history const historyLocation = createMemoryHistory(); diff --git a/packages/shared-ux/router/impl/route.tsx b/packages/shared-ux/router/impl/route.tsx index 3535ff7aecec8..5041f872b71b1 100644 --- a/packages/shared-ux/router/impl/route.tsx +++ b/packages/shared-ux/router/impl/route.tsx @@ -15,6 +15,7 @@ import { RouteProps, useRouteMatch, } from 'react-router-dom'; +import { useSharedUXRoutesContext } from './routes_context'; import { useKibanaSharedUX } from './services'; import { useSharedUXExecutionContext } from './use_execution_context'; @@ -30,17 +31,18 @@ export const Route = <T extends {}>({ render, ...rest }: RouteProps<string, { [K: string]: string } & T>) => { + const { enableExecutionContextTracking } = useSharedUXRoutesContext(); const component = useMemo(() => { if (!Component) { return undefined; } return (props: RouteComponentProps) => ( <> - <MatchPropagator /> + {enableExecutionContextTracking && <MatchPropagator />} <Component {...props} /> </> ); - }, [Component]); + }, [Component, enableExecutionContextTracking]); if (component) { return <ReactRouterRoute {...rest} component={component} />; @@ -52,7 +54,7 @@ export const Route = <T extends {}>({ {...rest} render={(props) => ( <> - <MatchPropagator /> + {enableExecutionContextTracking && <MatchPropagator />} {/* @ts-ignore else condition exists if renderFunction is undefined*/} {renderFunction(props)} </> @@ -62,7 +64,7 @@ export const Route = <T extends {}>({ } return ( <ReactRouterRoute {...rest}> - <MatchPropagator /> + {enableExecutionContextTracking && <MatchPropagator />} {children} </ReactRouterRoute> ); @@ -75,6 +77,12 @@ export const MatchPropagator = () => { const { executionContext } = useKibanaSharedUX().services; const match = useRouteMatch(); + if (!executionContext && process.env.NODE_ENV !== 'production') { + throw new Error( + 'Default execution context tracking is enabled but the executionContext service is not available' + ); + } + useSharedUXExecutionContext(executionContext, { type: 'application', page: match.path, diff --git a/packages/shared-ux/router/impl/routes.tsx b/packages/shared-ux/router/impl/routes.tsx index 9c1a97de65830..9377562246276 100644 --- a/packages/shared-ux/router/impl/routes.tsx +++ b/packages/shared-ux/router/impl/routes.tsx @@ -13,6 +13,7 @@ import React, { Children } from 'react'; import { Switch, useRouteMatch } from 'react-router-dom'; import { Routes as ReactRouterRoutes, Route } from 'react-router-dom-v5-compat'; import { Route as LegacyRoute, MatchPropagator } from './route'; +import { SharedUXRoutesContext } from './routes_context'; type RouterElementChildren = Array< React.ReactElement< @@ -28,42 +29,47 @@ type RouterElementChildren = Array< export const Routes = ({ legacySwitch = true, + enableExecutionContextTracking = false, children, }: { legacySwitch?: boolean; + enableExecutionContextTracking?: boolean; children: React.ReactNode; }) => { const match = useRouteMatch(); return legacySwitch ? ( - <Switch>{children}</Switch> + <SharedUXRoutesContext.Provider value={{ enableExecutionContextTracking }}> + <Switch>{children}</Switch> + </SharedUXRoutesContext.Provider> ) : ( - <ReactRouterRoutes> - {Children.map(children as RouterElementChildren, (child) => { - if (React.isValidElement(child) && child.type === LegacyRoute) { - const path = replace(child?.props.path, match.url + '/', ''); - const renderFunction = - typeof child?.props.children === 'function' - ? child?.props.children - : child?.props.render; - - return ( - <Route - path={path} - element={ - <> - <MatchPropagator /> - {(child?.props?.component && <child.props.component />) || - (renderFunction && renderFunction()) || - children} - </> - } - /> - ); - } else { - return child; - } - })} - </ReactRouterRoutes> + <SharedUXRoutesContext.Provider value={{ enableExecutionContextTracking }}> + <ReactRouterRoutes> + {Children.map(children as RouterElementChildren, (child) => { + if (React.isValidElement(child) && child.type === LegacyRoute) { + const path = replace(child?.props.path, match.url + '/', ''); + const renderFunction = + typeof child?.props.children === 'function' + ? child?.props.children + : child?.props.render; + return ( + <Route + path={path} + element={ + <> + {enableExecutionContextTracking && <MatchPropagator />} + {(child?.props?.component && <child.props.component />) || + (renderFunction && renderFunction()) || + children} + </> + } + /> + ); + } else { + return child; + } + })} + </ReactRouterRoutes> + </SharedUXRoutesContext.Provider> ); }; diff --git a/packages/shared-ux/router/impl/routes_context.ts b/packages/shared-ux/router/impl/routes_context.ts new file mode 100644 index 0000000000000..115a5df7780d5 --- /dev/null +++ b/packages/shared-ux/router/impl/routes_context.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { createContext, useContext } from 'react'; +import { SharedUXRoutesContextType } from './types'; + +const defaultContextValue = {}; + +export const SharedUXRoutesContext = createContext<SharedUXRoutesContextType>(defaultContextValue); + +export const useSharedUXRoutesContext = (): SharedUXRoutesContextType => + useContext(SharedUXRoutesContext as unknown as React.Context<SharedUXRoutesContextType>); diff --git a/packages/shared-ux/router/impl/services.ts b/packages/shared-ux/router/impl/services.ts index c3ad2ab06e06d..7cea72f03bd82 100644 --- a/packages/shared-ux/router/impl/services.ts +++ b/packages/shared-ux/router/impl/services.ts @@ -50,7 +50,7 @@ export interface SharedUXExecutionContextSetup { */ export interface SharedUXExecutionContextSetup { /** {@link SharedUXExecutionContextSetup} */ - executionContext: SharedUXExecutionContextStart; + executionContext?: SharedUXExecutionContextStart; } export type KibanaServices = Partial<SharedUXExecutionContextSetup>; @@ -63,12 +63,14 @@ const defaultContextValue = { services: {}, }; -export const sharedUXContext = +export const SharedUXRouterContext = createContext<SharedUXRouterContextValue<KibanaServices>>(defaultContextValue); export const useKibanaSharedUX = <Extra extends object = {}>(): SharedUXRouterContextValue< KibanaServices & Extra > => useContext( - sharedUXContext as unknown as React.Context<SharedUXRouterContextValue<KibanaServices & Extra>> + SharedUXRouterContext as unknown as React.Context< + SharedUXRouterContextValue<KibanaServices & Extra> + > ); diff --git a/packages/shared-ux/router/impl/types.ts b/packages/shared-ux/router/impl/types.ts index 833c5bdd0c816..067677d152cae 100644 --- a/packages/shared-ux/router/impl/types.ts +++ b/packages/shared-ux/router/impl/types.ts @@ -33,3 +33,11 @@ export declare interface SharedUXExecutionContext { /** an inner context spawned from the current context. */ child?: SharedUXExecutionContext; } + +export declare interface SharedUXRoutesContextType { + /** + * This flag is used to enable the default execution context tracking for a specific router. + * Enable this flag in case you don't have a custom implementation for execution context tracking. + * */ + readonly enableExecutionContextTracking?: boolean; +} diff --git a/packages/shared-ux/router/impl/use_execution_context.ts b/packages/shared-ux/router/impl/use_execution_context.ts index d460d4df30805..5e088fc3eac77 100644 --- a/packages/shared-ux/router/impl/use_execution_context.ts +++ b/packages/shared-ux/router/impl/use_execution_context.ts @@ -8,7 +8,7 @@ */ import useDeepCompareEffect from 'react-use/lib/useDeepCompareEffect'; -import { SharedUXExecutionContextSetup } from './services'; +import type { SharedUXExecutionContextSetup } from './services'; import { SharedUXExecutionContext } from './types'; /** diff --git a/scripts/stage_by_owner.js b/scripts/stage_by_owner.js new file mode 100644 index 0000000000000..0ac33b3901a04 --- /dev/null +++ b/scripts/stage_by_owner.js @@ -0,0 +1,11 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +require('../src/setup_node_env'); +require('../src/dev/stage_by_owner'); diff --git a/src/core/public/styles/_index.scss b/src/core/public/styles/_index.scss index cfdb1c7192dcd..c8567498b42ec 100644 --- a/src/core/public/styles/_index.scss +++ b/src/core/public/styles/_index.scss @@ -1,3 +1 @@ @import './base'; -@import './chrome/index'; -@import './rendering/index'; diff --git a/src/core/public/styles/chrome/_banner.scss b/src/core/public/styles/chrome/_banner.scss deleted file mode 100644 index feb69e54a911f..0000000000000 --- a/src/core/public/styles/chrome/_banner.scss +++ /dev/null @@ -1,13 +0,0 @@ -.header__topBanner { - position: fixed; - top: 0; - left: 0; - height: var(--kbnHeaderBannerHeight); - width: 100%; - z-index: $euiZHeader; -} - -.header__topBannerContainer { - height: 100%; - width: 100%; -} diff --git a/src/core/public/styles/chrome/_index.scss b/src/core/public/styles/chrome/_index.scss deleted file mode 100644 index 22390aa5a44b3..0000000000000 --- a/src/core/public/styles/chrome/_index.scss +++ /dev/null @@ -1,45 +0,0 @@ -@import './banner'; - -.euiDataGrid__restrictBody { - .headerGlobalNav, - .kbnQueryBar { - display: none; - } -} - -.euiDataGrid__restrictBody.euiBody--headerIsFixed { - .euiFlyout { - top: 0; - height: 100%; - } -} - -.chrHeaderHelpMenu__version { - text-transform: none; -} - -.chrHeaderBadge__wrapper { - align-self: center; - margin-right: $euiSize; -} - -.header__toggleNavButtonSection { - .euiBody--collapsibleNavIsDocked & { - display: none; - } -} - -.header__breadcrumbsWithExtensionContainer { - overflow: hidden; // enables text-ellipsis in the last breadcrumb - .euiHeaderBreadcrumbs { - // stop breadcrumbs from growing. - // this makes the extension appear right next to the last breadcrumb - flex-grow: 0; - margin-right: 0; - - overflow: hidden; // enables text-ellipsis in the last breadcrumb - } -} -.header__breadcrumbsAppendExtension { - flex-grow: 1; -} diff --git a/src/core/public/styles/rendering/_base.scss b/src/core/public/styles/rendering/_base.scss deleted file mode 100644 index 259115f6a526a..0000000000000 --- a/src/core/public/styles/rendering/_base.scss +++ /dev/null @@ -1,80 +0,0 @@ -@import '../../mixins'; - -/** - * Stretch the root element of the Kibana application to set the base-size that - * flexed children should keep. Only works when paired with root styles applied - * by core service from new platform - */ - -#kibana-body { - // DO NOT ADD ANY OVERFLOW BEHAVIORS HERE - // It will break the sticky navigation - min-height: 100%; - display: flex; - flex-direction: column; -} - -// Affixes a div to restrict the position of charts tooltip to the visible viewport minus the header -#app-fixed-viewport { - pointer-events: none; - visibility: hidden; - position: fixed; - top: var(--kbnAppHeadersOffset, var(--euiFixedHeadersOffset, 0)); - right: 0; - bottom: 0; - left: 0; -} - -.kbnAppWrapper { - // DO NOT ADD ANY OTHER STYLES TO THIS SELECTOR - // This a very nested dependency happnening in "all" apps - display: flex; - flex-flow: column nowrap; - flex-grow: 1; - z-index: 0; // This effectively puts every high z-index inside the scope of this wrapper to it doesn't interfere with the header and/or overlay mask - position: relative; // This is temporary for apps that relied on this being present on `.application` -} - -.kbnBody { - padding-top: var(--euiFixedHeadersOffset, 0); -} - -// Conditionally override :root CSS fixed header variable. Updating `--euiFixedHeadersOffset` -// on the body will cause all child EUI components to automatically update their offsets -.kbnBody--hasHeaderBanner { - --euiFixedHeadersOffset: var(--kbnHeaderOffsetWithBanner); - - // Offset fixed EuiHeaders by the top banner - .euiHeader[data-fixed-header] { - margin-top: var(--kbnHeaderBannerHeight); - } - - // Prevent banners from covering full screen data grids - .euiDataGrid--fullScreen { - height: calc(100vh - var(--kbnHeaderBannerHeight)); - top: var(--kbnHeaderBannerHeight); - } -} - -// Set a body CSS variable for the app container to use - calculates the total -// height of all fixed headers + the sticky action menu toolbar -.kbnBody--hasProjectActionMenu { - --kbnAppHeadersOffset: calc(var(--kbnHeaderOffset) + var(--kbnProjectHeaderAppActionMenuHeight)); - - &.kbnBody--hasHeaderBanner { - --kbnAppHeadersOffset: calc(var(--kbnHeaderOffsetWithBanner) + var(--kbnProjectHeaderAppActionMenuHeight)); - } -} - -.kbnBody--chromeHidden { - // stylelint-disable-next-line length-zero-no-unit - --euiFixedHeadersOffset: 0px; - - &.kbnBody--hasHeaderBanner { - --euiFixedHeadersOffset: var(--kbnHeaderBannerHeight); - } - - &.kbnBody--hasProjectActionMenu { - --kbnAppHeadersOffset: var(--euiFixedHeadersOffset, 0); - } -} diff --git a/src/core/public/styles/rendering/_index.scss b/src/core/public/styles/rendering/_index.scss deleted file mode 100644 index c8567498b42ec..0000000000000 --- a/src/core/public/styles/rendering/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import './base'; diff --git a/src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_01.zip b/src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_01.zip index 5a7ee884b5b06..b096874e6ad32 100644 Binary files a/src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_01.zip and b/src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_01.zip differ diff --git a/src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_02.zip b/src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_02.zip index 180465269c1f0..56f6ab57ca743 100644 Binary files a/src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_02.zip and b/src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_02.zip differ diff --git a/src/core/server/integration_tests/saved_objects/migrations/archives/8.4.0_with_sample_data_logs.zip b/src/core/server/integration_tests/saved_objects/migrations/archives/8.4.0_with_sample_data_logs.zip index 9a48e25275908..7a93adcc12b3c 100644 Binary files a/src/core/server/integration_tests/saved_objects/migrations/archives/8.4.0_with_sample_data_logs.zip and b/src/core/server/integration_tests/saved_objects/migrations/archives/8.4.0_with_sample_data_logs.zip differ diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/actions/actions_test_suite.ts b/src/core/server/integration_tests/saved_objects/migrations/group3/actions/actions_test_suite.ts index 3b7aae9183a54..c6995c6e2d4ca 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group3/actions/actions_test_suite.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group3/actions/actions_test_suite.ts @@ -770,9 +770,10 @@ export const runActionTestSuite = ({ }); }); - // Reindex doesn't return any errors on it's own, so we have to test + // Reindex doesn't return any errors on its own, so we have to test // together with waitForReindexTask - // Failing: See https://github.com/elastic/kibana/issues/166190 + // Flaky: https://github.com/elastic/kibana/issues/166190 + // Reported here: https://github.com/elastic/kibana/issues/167273 describe.skip('reindex & waitForReindexTask', () => { it('resolves right when reindex succeeds without reindex script', async () => { const res = (await reindex({ @@ -1444,8 +1445,7 @@ export const runActionTestSuite = ({ }); }); - // FLAKY: https://github.com/elastic/kibana/issues/166199 - describe.skip('waitForPickupUpdatedMappingsTask', () => { + describe('waitForPickupUpdatedMappingsTask', () => { it('rejects if there are failures', async () => { const res = (await pickupUpdatedMappings( client, diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/incompatible_cluster_routing_allocation.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group3/incompatible_cluster_routing_allocation.test.ts index e8a523b5de50e..8213c880c0fa4 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group3/incompatible_cluster_routing_allocation.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group3/incompatible_cluster_routing_allocation.test.ts @@ -92,8 +92,7 @@ async function updateRoutingAllocations( }); } -// Failing ES promotion: https://github.com/elastic/kibana/issues/158318 -describe.skip('incompatible_cluster_routing_allocation', () => { +describe('incompatible_cluster_routing_allocation', () => { let client: ElasticsearchClient; let root: Root; diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/multiple_es_nodes.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group3/multiple_es_nodes.test.ts index 5be7b4671ef72..6898962077b9c 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group3/multiple_es_nodes.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group3/multiple_es_nodes.test.ts @@ -96,8 +96,7 @@ function createRoot({ logFileName, hosts }: RootConfig) { }); } -// Failing ES promotion: https://github.com/elastic/kibana/issues/167676 -describe.skip('migration v2', () => { +describe('migration v2', () => { let esServer: TestElasticsearchUtils; let root: Root; const migratedIndexAlias = `.kibana_${pkg.version}`; diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/read_batch_size.test.ts b/src/core/server/integration_tests/saved_objects/migrations/group3/read_batch_size.test.ts index 6ebc7ee5a66f6..9f970ed234d71 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group3/read_batch_size.test.ts +++ b/src/core/server/integration_tests/saved_objects/migrations/group3/read_batch_size.test.ts @@ -19,9 +19,7 @@ import { getFips } from 'crypto'; const logFilePath = join(__dirname, 'read_batch_size.log'); -// Failing ES promotion: https://github.com/elastic/kibana/issues/163254 -// Failing ES promotion: https://github.com/elastic/kibana/issues/163255 -describe.skip('migration v2 - read batch size', () => { +describe('migration v2 - read batch size', () => { let esServer: TestElasticsearchUtils; let root: Root; let logs: string; diff --git a/src/dev/build/tasks/os_packages/docker_generator/templates/base/Dockerfile b/src/dev/build/tasks/os_packages/docker_generator/templates/base/Dockerfile index e868cb73cb8db..7d9eaac886964 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/templates/base/Dockerfile +++ b/src/dev/build/tasks/os_packages/docker_generator/templates/base/Dockerfile @@ -114,7 +114,7 @@ EXPOSE 5601 RUN for iter in {1..10}; do \ microdnf update --setopt=tsflags=nodocs -y && \ microdnf install --setopt=tsflags=nodocs -y \ - fontconfig freetype shadow-utils nss findutils && \ + fontconfig liberation-fonts-common freetype shadow-utils nss findutils && \ microdnf clean all && exit_code=0 && break || exit_code=$? && echo "microdnf error: retry $iter in 10s" && \ sleep 10; \ done; \ @@ -126,7 +126,7 @@ RUN for iter in {1..10}; do \ apt-get update && \ apt-get upgrade -y && \ apt-get install -y --no-install-recommends \ - fontconfig libnss3 curl ca-certificates && \ + fontconfig fonts-liberation libnss3 curl ca-certificates && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* && exit_code=0 && break || exit_code=$? && echo "apt-get error: retry $iter in 10s" && \ sleep 10; \ @@ -134,7 +134,7 @@ RUN for iter in {1..10}; do \ (exit $exit_code) {{/ubuntu}} {{#wolfi}} -RUN apk --no-cache add bash curl fontconfig libstdc++ libnss findutils shadow ca-certificates +RUN apk --no-cache add bash curl fontconfig font-liberation libstdc++ libnss findutils shadow ca-certificates {{/wolfi}} # Bring in Kibana from the initial stage. diff --git a/src/dev/code_coverage/docs/team_assignment/README.md b/src/dev/code_coverage/docs/team_assignment/README.md index c5b0db830ec4b..e39d63e751091 100644 --- a/src/dev/code_coverage/docs/team_assignment/README.md +++ b/src/dev/code_coverage/docs/team_assignment/README.md @@ -19,7 +19,7 @@ _notice the coverage delimiter `#CC# ...`_ /x-pack/test/plugin_functional/test_suites/resolver/ @elastic/endpoint-app-team @elastic/siem #CC# /x-pack/legacy/plugins/siem/ @elastic/siem #CC# /x-pack/plugins/siem/ @elastic/siem -#CC# /x-pack/plugins/security_solution/ @elastic/siem +#CC# /x-pack/solutions/security/plugins/security_solution/ @elastic/siem ``` The first 3 lines above fill the usual purpose of the CODEOWNERS file and cause PRs modifying files in these paths to require approval by the listed team(s). They also attribute files in those paths for purpose of code coverage reporting. @@ -29,9 +29,9 @@ The last 3 lines above ONLY attribute files in those paths for purpose of code c We create a data file containing all paths in the repo, with a team assigned. Example Team Assignments Block: ``` -x-pack/plugins/security_solution/common/constants.ts siem -x-pack/plugins/security_solution/common/detection_engine/build_exceptions_query.test.ts siem -x-pack/plugins/security_solution/common/detection_engine/build_exceptions_query.ts siem +x-pack/solutions/security/plugins/security_solution/common/constants.ts siem +x-pack/solutions/security/plugins/security_solution/common/detection_engine/build_exceptions_query.test.ts siem +x-pack/solutions/security/plugins/security_solution/common/detection_engine/build_exceptions_query.ts siem ... ``` @@ -39,5 +39,5 @@ x-pack/plugins/security_solution/common/detection_engine/build_exceptions_query. Subsequently, we use the data file during ingestion. We search the data file, for any given "coveredFilePath" - Given the above assignments block, and lets say the "coveredFilePath" during ingestion is - - `x-pack/plugins/security_solution/common/constants.ts` + - `x-pack/solutions/security/plugins/security_solution/common/constants.ts` - The team assignment would be `siem` in our [Kibana Stats Cluster](https://kibana-stats.elastic.dev/app/dashboards#/view/58b8db70-62f9-11ea-8312-7f2d69b79843?_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow-7d%2Cto%3Anow))) diff --git a/src/dev/code_coverage/ingest_coverage/__tests__/enumerate_patterns.test.js b/src/dev/code_coverage/ingest_coverage/__tests__/enumerate_patterns.test.js index 5faeab1acb539..540b51a294983 100644 --- a/src/dev/code_coverage/ingest_coverage/__tests__/enumerate_patterns.test.js +++ b/src/dev/code_coverage/ingest_coverage/__tests__/enumerate_patterns.test.js @@ -17,13 +17,13 @@ const log = new ToolingLog({ }); describe(`enumeratePatterns`, () => { - it(`should resolve x-pack/plugins/screenshotting/server/browsers/extract/unzip.ts to kibana-screenshotting`, () => { + it(`should resolve x-pack/platform/plugins/shared/screenshotting/server/browsers/extract/unzip.ts to kibana-screenshotting`, () => { const actual = enumeratePatterns(REPO_ROOT)(log)( - new Map([['x-pack/plugins/screenshotting', ['kibana-screenshotting']]]) + new Map([['x-pack/platform/plugins/shared/screenshotting', ['kibana-screenshotting']]]) ); expect(actual.flat()).toContain( - 'x-pack/plugins/screenshotting/server/browsers/extract/unzip.ts kibana-screenshotting' + 'x-pack/platform/plugins/shared/screenshotting/server/browsers/extract/unzip.ts kibana-screenshotting' ); }); it(`should resolve src/plugins/charts/common/static/color_maps/color_maps.ts to kibana-app`, () => { diff --git a/src/dev/precommit_hook/casing_check_config.js b/src/dev/precommit_hook/casing_check_config.js index 313c2bd357dc4..30383559e7fe0 100644 --- a/src/dev/precommit_hook/casing_check_config.js +++ b/src/dev/precommit_hook/casing_check_config.js @@ -44,7 +44,7 @@ export const IGNORE_FILE_GLOBS = [ 'packages/kbn-test/jest-preset.js', 'packages/kbn-test/*/jest-preset.js', 'test/package/Vagrantfile', - 'x-pack/plugins/security_solution/scripts/endpoint/common/vagrant/Vagrantfile', + 'x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/vagrant/Vagrantfile', '**/test/**/fixtures/**/*', 'packages/kbn-router-to-openapispec/openapi-types.d.ts', @@ -98,7 +98,19 @@ export const IGNORE_FILE_GLOBS = [ * * @type {Array} */ -export const KEBAB_CASE_DIRECTORY_GLOBS = ['packages/*', 'x-pack', 'x-pack/packages/*']; +export const KEBAB_CASE_DIRECTORY_GLOBS = [ + 'packages/*', + 'x-pack', + 'x-pack/packages/*', + 'src/core/packages/*/*', + 'src/platform/packages/private/*', + 'src/platform/packages/shared/*', + 'x-pack/platform/packages/private/*', + 'x-pack/platform/packages/shared/*', + 'x-pack/solutions/observability/packages/*', + 'x-pack/solutions/search/packages/*', + 'x-pack/solutions/security/packages/*', +]; /** * These patterns are matched against directories and indicate @@ -170,10 +182,10 @@ export const TEMPORARILY_IGNORED_PATHS = [ 'x-pack/plugins/monitoring/public/icons/health-green.svg', 'x-pack/plugins/monitoring/public/icons/health-red.svg', 'x-pack/plugins/monitoring/public/icons/health-yellow.svg', - 'x-pack/plugins/screenshotting/server/assets/fonts/noto/NotoSansCJKtc-Medium.ttf', - 'x-pack/plugins/screenshotting/server/assets/fonts/noto/NotoSansCJKtc-Regular.ttf', - 'x-pack/plugins/screenshotting/server/assets/fonts/roboto/Roboto-Italic.ttf', - 'x-pack/plugins/screenshotting/server/assets/fonts/roboto/Roboto-Medium.ttf', - 'x-pack/plugins/screenshotting/server/assets/fonts/roboto/Roboto-Regular.ttf', - 'x-pack/plugins/screenshotting/server/assets/img/logo-grey.png', + 'x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/noto/NotoSansCJKtc-Medium.ttf', + 'x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/noto/NotoSansCJKtc-Regular.ttf', + 'x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/roboto/Roboto-Italic.ttf', + 'x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/roboto/Roboto-Medium.ttf', + 'x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/roboto/Roboto-Regular.ttf', + 'x-pack/platform/plugins/shared/screenshotting/server/assets/img/logo-grey.png', ]; diff --git a/src/dev/stage_by_owner.ts b/src/dev/stage_by_owner.ts new file mode 100644 index 0000000000000..7987874da75fe --- /dev/null +++ b/src/dev/stage_by_owner.ts @@ -0,0 +1,96 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import simpleGit from 'simple-git'; + +import { run } from '@kbn/dev-cli-runner'; +import { getOwningTeamsForPath, getCodeOwnersEntries, CodeOwnersEntry } from '@kbn/code-owners'; +import { asyncForEach } from '@kbn/std'; +import { inspect } from 'util'; + +const git = simpleGit(); + +interface File { + path: string; + staged: boolean; +} + +// Function to get the list of changed files +const getChangedFiles = async (): Promise<File[]> => { + const { staged, files } = await git.status(); + return files.map((file) => ({ path: file.path, staged: staged.includes(file.path) })); +}; + +run( + async ({ flags, log }) => { + const { + _: [owner], + } = flags; + + const changedFiles = await getChangedFiles(); + const owners: { staged: Record<string, string[]>; unstaged: Record<string, string[]> } = { + staged: {}, + unstaged: {}, + }; + + let codeOwnersEntries: CodeOwnersEntry[] = []; + + try { + codeOwnersEntries = getCodeOwnersEntries(); + } catch (e) { + log.error('CODEOWNERS cannot be read.'); + process.exit(1); + } + + const getOwners = (file: string) => { + const teams = getOwningTeamsForPath(file, codeOwnersEntries); + + if (teams.length === 0) { + log.warning(`No owner found for ${file}`); + return []; + } + + return teams; + }; + + for (const file of changedFiles) { + const fileOwners = getOwners(file.path); + + if (fileOwners) { + await asyncForEach(fileOwners, async (fileOwner) => { + const loc = file.staged ? 'staged' : 'unstaged'; + + owners[loc][fileOwner] = [ + ...(owners[loc][fileOwner] || []), + file.path + (fileOwners.length > 1 ? ` (+${fileOwners.length - 1})` : ''), + ]; + + if (owner && fileOwner === owner) { + await git.add(file.path); + log.info(`Staged ${file.path}`); + } + }); + } + } + + if (!owner) { + log.info(inspect(owners, { colors: true, depth: null })); + } + + log.info('Done.'); + }, + { + usage: 'node src/dev/stage_by_owner.ts [owner]', + description: ` + This script stages files based on the CODEOWNERS file. + If an owner is provided, it stages the files owned by that owner. + Otherwise, it outputs changed files, grouped by owner. + `, + } +); diff --git a/src/dev/storybook/aliases.ts b/src/dev/storybook/aliases.ts index 2875d8312cc8e..2bf3888ce6cb2 100644 --- a/src/dev/storybook/aliases.ts +++ b/src/dev/storybook/aliases.ts @@ -17,7 +17,8 @@ export const storybookAliases = { canvas: 'x-pack/plugins/canvas/storybook', cases: 'packages/kbn-cases-components/.storybook', cell_actions: 'src/platform/packages/shared/kbn-cell-actions/.storybook', - cloud_security_posture_packages: 'x-pack/packages/kbn-cloud-security-posture/storybook/config', + cloud_security_posture_packages: + 'x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook', cloud: 'packages/cloud/.storybook', coloring: 'packages/kbn-coloring/.storybook', language_documentation_popover: @@ -49,7 +50,7 @@ export const storybookAliases = { inventory: 'x-pack/plugins/observability_solution/inventory/.storybook', investigate: 'x-pack/solutions/observability/plugins/investigate_app/.storybook', kibana_react: 'src/plugins/kibana_react/.storybook', - lists: 'x-pack/plugins/lists/.storybook', + lists: 'x-pack/solutions/security/plugins/lists/.storybook', logs_explorer: 'x-pack/plugins/observability_solution/logs_explorer/.storybook', management: 'packages/kbn-management/storybook/config', observability: 'x-pack/solutions/observability/plugins/observability/.storybook', @@ -59,15 +60,15 @@ export const storybookAliases = { 'x-pack/solutions/observability/plugins/observability_ai_assistant_app/.storybook', observability_inventory: 'x-pack/plugins/observability_solution/inventory/.storybook', observability_shared: 'x-pack/plugins/observability_solution/observability_shared/.storybook', - observability_slo: 'x-pack/plugins/observability_solution/slo/.storybook', + observability_slo: 'x-pack/solutions/observability/plugins/slo/.storybook', presentation: 'src/plugins/presentation_util/storybook', random_sampling: 'x-pack/packages/kbn-random-sampling/.storybook', esql_editor: 'src/platform/packages/private/kbn-esql-editor/.storybook', - security_solution: 'x-pack/plugins/security_solution/.storybook', + security_solution: 'x-pack/solutions/security/plugins/security_solution/.storybook', security_solution_packages: 'x-pack/solutions/security/packages/storybook/config', serverless: 'packages/serverless/storybook/config', shared_ux: 'packages/shared-ux/storybook/config', - slo: 'x-pack/plugins/observability_solution/slo/.storybook', + slo: 'x-pack/solutions/observability/plugins/slo/.storybook', threat_intelligence: 'x-pack/solutions/security/plugins/threat_intelligence/.storybook', triggers_actions_ui: 'x-pack/plugins/triggers_actions_ui/.storybook', ui_actions_enhanced: 'src/plugins/ui_actions_enhanced/.storybook', diff --git a/src/dev/tsconfig.json b/src/dev/tsconfig.json index 87473c1e79e82..0e2e8e94c629b 100644 --- a/src/dev/tsconfig.json +++ b/src/dev/tsconfig.json @@ -44,5 +44,6 @@ "@kbn/core-test-helpers-kbn-server", "@kbn/dev-proc-runner", "@kbn/core-i18n-server-internal", + "@kbn/code-owners", ] } diff --git a/src/platform/packages/shared/deeplinks/observability/locators/apm.ts b/src/platform/packages/shared/deeplinks/observability/locators/apm.ts new file mode 100644 index 0000000000000..64e446e883f1f --- /dev/null +++ b/src/platform/packages/shared/deeplinks/observability/locators/apm.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { SerializableRecord } from '@kbn/utility-types'; + +export const TRANSACTION_DETAILS_BY_TRACE_ID_LOCATOR = 'TRANSACTION_DETAILS_BY_TRACE_ID_LOCATOR'; + +export interface TransactionDetailsByTraceIdLocatorParams extends SerializableRecord { + rangeFrom?: string; + rangeTo?: string; + traceId: string; +} diff --git a/src/platform/packages/shared/deeplinks/observability/locators/index.ts b/src/platform/packages/shared/deeplinks/observability/locators/index.ts index 5d45f66194b6d..3317df2268df3 100644 --- a/src/platform/packages/shared/deeplinks/observability/locators/index.ts +++ b/src/platform/packages/shared/deeplinks/observability/locators/index.ts @@ -7,6 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ +export * from './apm'; export * from './dataset_quality'; export * from './dataset_quality_details'; export * from './logs_explorer'; diff --git a/packages/deeplinks/security/README.md b/src/platform/packages/shared/deeplinks/security/README.md similarity index 100% rename from packages/deeplinks/security/README.md rename to src/platform/packages/shared/deeplinks/security/README.md diff --git a/packages/deeplinks/security/deep_links.ts b/src/platform/packages/shared/deeplinks/security/deep_links.ts similarity index 95% rename from packages/deeplinks/security/deep_links.ts rename to src/platform/packages/shared/deeplinks/security/deep_links.ts index 2f8229def91df..464003abd369c 100644 --- a/packages/deeplinks/security/deep_links.ts +++ b/src/platform/packages/shared/deeplinks/security/deep_links.ts @@ -22,7 +22,7 @@ export enum SecurityPageName { caseCreate = 'cases_create', // must match `CasesDeepLinkId.casesCreate` /* * Warning: Computed values are not permitted in an enum with string valued members - * All cloud security posture page names must match `CloudSecurityPosturePageId` in x-pack/plugins/cloud_security_posture/public/common/navigation/types.ts + * All cloud security posture page names must match `CloudSecurityPosturePageId` in x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/types.ts */ cloudSecurityPostureBenchmarks = 'cloud_security_posture-benchmarks', cloudSecurityPostureDashboard = 'cloud_security_posture-dashboard', @@ -30,7 +30,7 @@ export enum SecurityPageName { cloudSecurityPostureRules = 'cloud_security_posture-rules', /* * Warning: Computed values are not permitted in an enum with string valued members - * All cloud defend page names must match `CloudDefendPageId` in x-pack/plugins/cloud_defend/public/common/navigation/types.ts + * All cloud defend page names must match `CloudDefendPageId` in x-pack/solutions/security/plugins/cloud_defend/public/common/navigation/types.ts */ cloudDefend = 'cloud_defend', cloudDefendPolicies = 'cloud_defend-policies', diff --git a/packages/deeplinks/security/index.ts b/src/platform/packages/shared/deeplinks/security/index.ts similarity index 100% rename from packages/deeplinks/security/index.ts rename to src/platform/packages/shared/deeplinks/security/index.ts diff --git a/src/platform/packages/shared/deeplinks/security/jest.config.js b/src/platform/packages/shared/deeplinks/security/jest.config.js new file mode 100644 index 0000000000000..8e931a6b4d6fc --- /dev/null +++ b/src/platform/packages/shared/deeplinks/security/jest.config.js @@ -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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../..', + roots: ['<rootDir>/src/platform/packages/shared/deeplinks/security'], +}; diff --git a/packages/deeplinks/security/kibana.jsonc b/src/platform/packages/shared/deeplinks/security/kibana.jsonc similarity index 100% rename from packages/deeplinks/security/kibana.jsonc rename to src/platform/packages/shared/deeplinks/security/kibana.jsonc diff --git a/packages/deeplinks/security/package.json b/src/platform/packages/shared/deeplinks/security/package.json similarity index 100% rename from packages/deeplinks/security/package.json rename to src/platform/packages/shared/deeplinks/security/package.json diff --git a/src/platform/packages/shared/deeplinks/security/tsconfig.json b/src/platform/packages/shared/deeplinks/security/tsconfig.json new file mode 100644 index 0000000000000..18d16ae2e8837 --- /dev/null +++ b/src/platform/packages/shared/deeplinks/security/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [] +} diff --git a/src/platform/packages/shared/kbn-esql-ast/src/builder/builder.test.ts b/src/platform/packages/shared/kbn-esql-ast/src/builder/builder.test.ts index 61fdd931ca7bb..b6bab193200c5 100644 --- a/src/platform/packages/shared/kbn-esql-ast/src/builder/builder.test.ts +++ b/src/platform/packages/shared/kbn-esql-ast/src/builder/builder.test.ts @@ -224,12 +224,13 @@ describe('literal', () => { const node = Builder.expression.literal.string('abc'); const text = BasicPrettyPrinter.expression(node); - expect(text).toBe('"""abc"""'); + expect(text).toBe('"abc"'); expect(node).toMatchObject({ type: 'literal', literalType: 'keyword', - name: '"""abc"""', - value: '"""abc"""', + name: '"abc"', + value: '"abc"', + valueUnquoted: 'abc', }); }); }); @@ -260,7 +261,7 @@ describe('literal', () => { }); const text = BasicPrettyPrinter.expression(node); - expect(text).toBe('["""a""", """b""", """c"""]'); + expect(text).toBe('["a", "b", "c"]'); }); test('integer list', () => { diff --git a/src/platform/packages/shared/kbn-esql-ast/src/builder/builder.ts b/src/platform/packages/shared/kbn-esql-ast/src/builder/builder.ts index 44e404609ffd6..7988b0e953559 100644 --- a/src/platform/packages/shared/kbn-esql-ast/src/builder/builder.ts +++ b/src/platform/packages/shared/kbn-esql-ast/src/builder/builder.ts @@ -32,10 +32,10 @@ import { ESQLParamLiteral, ESQLFunction, ESQLAstItem, + ESQLStringLiteral, ESQLBinaryExpression, ESQLUnaryExpression, ESQLTimeInterval, - ESQLStringLiteral, ESQLBooleanLiteral, ESQLNullLiteral, } from '../types'; @@ -368,26 +368,6 @@ export namespace Builder { ) as ESQLDecimalLiteral; }; - export const string = ( - value: string, - template?: Omit<AstNodeTemplate<ESQLStringLiteral>, 'name' | 'literalType'>, - fromParser?: Partial<AstNodeParserFields> - ): ESQLStringLiteral => { - // TODO: Once (https://github.com/elastic/kibana/issues/203445) do not use - // triple quotes and escape the string. - const quotedValue = '"""' + value + '"""'; - const node: ESQLStringLiteral = { - ...template, - ...Builder.parserFields(fromParser), - type: 'literal', - literalType: 'keyword', - name: quotedValue, - value: quotedValue, - }; - - return node; - }; - /** * Constructs "time interval" literal node. * @@ -407,6 +387,38 @@ export namespace Builder { }; }; + export const string = ( + valueUnquoted: string, + template?: Omit< + AstNodeTemplate<ESQLStringLiteral>, + 'name' | 'literalType' | 'value' | 'valueUnquoted' + > & + Partial<Pick<ESQLStringLiteral, 'name'>>, + fromParser?: Partial<AstNodeParserFields> + ): ESQLStringLiteral => { + const value = + '"' + + valueUnquoted + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/\t/g, '\\t') + + '"'; + const name = template?.name ?? value; + const node: ESQLStringLiteral = { + ...template, + ...Builder.parserFields(fromParser), + type: 'literal', + literalType: 'keyword', + name, + value, + valueUnquoted, + }; + + return node; + }; + export const list = ( template: Omit<AstNodeTemplate<ESQLList>, 'name'>, fromParser?: Partial<AstNodeParserFields> diff --git a/src/platform/packages/shared/kbn-esql-ast/src/parser/__tests__/commands.test.ts b/src/platform/packages/shared/kbn-esql-ast/src/parser/__tests__/commands.test.ts index 865d8ef64e272..9fc53e9790c36 100644 --- a/src/platform/packages/shared/kbn-esql-ast/src/parser/__tests__/commands.test.ts +++ b/src/platform/packages/shared/kbn-esql-ast/src/parser/__tests__/commands.test.ts @@ -286,7 +286,9 @@ describe('commands', () => { }, { type: 'literal', - value: '"b"', + literalType: 'keyword', + name: '"b"', + valueUnquoted: 'b', }, { type: 'option', @@ -294,7 +296,9 @@ describe('commands', () => { args: [ { type: 'literal', - value: '"c"', + literalType: 'keyword', + name: '"c"', + valueUnquoted: 'c', }, ], }, @@ -303,6 +307,31 @@ describe('commands', () => { ]); }); + it('DISSECT (no options)', () => { + const query = 'FROM index | DISSECT a "b"'; + const { ast } = parse(query); + + expect(ast).toMatchObject([ + {}, + { + type: 'command', + name: 'dissect', + args: [ + { + type: 'column', + name: 'a', + }, + { + type: 'literal', + literalType: 'keyword', + name: '"b"', + valueUnquoted: 'b', + }, + ], + }, + ]); + }); + it('GROK', () => { const query = 'FROM index | GROK a "b"'; const { ast } = parse(query); @@ -319,7 +348,9 @@ describe('commands', () => { }, { type: 'literal', - value: '"b"', + literalType: 'keyword', + name: '"b"', + valueUnquoted: 'b', }, ], }, diff --git a/src/platform/packages/shared/kbn-esql-ast/src/parser/__tests__/literal.test.ts b/src/platform/packages/shared/kbn-esql-ast/src/parser/__tests__/literal.test.ts index ac2914a55422e..71ae3603c9c20 100644 --- a/src/platform/packages/shared/kbn-esql-ast/src/parser/__tests__/literal.test.ts +++ b/src/platform/packages/shared/kbn-esql-ast/src/parser/__tests__/literal.test.ts @@ -26,8 +26,8 @@ describe('literal expression', () => { it('numeric expression captures "value", and "name" fields', () => { const text = 'ROW 1'; - const { ast } = parse(text); - const literal = ast[0].args[0] as ESQLLiteral; + const { root } = parse(text); + const literal = root.commands[0].args[0] as ESQLLiteral; expect(literal).toMatchObject({ type: 'literal', @@ -39,9 +39,9 @@ describe('literal expression', () => { it('doubles vs integers', () => { const text = 'ROW a(1.0, 1)'; - const { ast } = parse(text); + const { root } = parse(text); - expect(ast[0]).toMatchObject({ + expect(root.commands[0]).toMatchObject({ type: 'command', args: [ { @@ -61,54 +61,117 @@ describe('literal expression', () => { }); }); - // TODO: Un-skip once string parsing fixed: https://github.com/elastic/kibana/issues/203445 - it.skip('single-quoted string', () => { - const text = 'ROW "abc"'; - const { root } = parse(text); + describe('string', () => { + describe('single quoted', () => { + it('empty string', () => { + const text = 'ROW "", 1'; + const { root } = parse(text); - expect(root.commands[0]).toMatchObject({ - type: 'command', - args: [ - { - type: 'literal', - literalType: 'keyword', - value: 'abc', - }, - ], - }); - }); + expect(root.commands[0]).toMatchObject({ + type: 'command', + args: [ + { + type: 'literal', + literalType: 'keyword', + name: '""', + valueUnquoted: '', + }, + {}, + ], + }); + }); - // TODO: Un-skip once string parsing fixed: https://github.com/elastic/kibana/issues/203445 - it.skip('unescapes characters', () => { - const text = 'ROW "a\\nbc"'; - const { root } = parse(text); + it('short string', () => { + const text = 'ROW "abc", 1'; + const { root } = parse(text); - expect(root.commands[0]).toMatchObject({ - type: 'command', - args: [ - { - type: 'literal', - literalType: 'keyword', - value: 'a\nbc', - }, - ], + expect(root.commands[0]).toMatchObject({ + type: 'command', + args: [ + { + type: 'literal', + literalType: 'keyword', + name: '"abc"', + valueUnquoted: 'abc', + }, + {}, + ], + }); + }); + + it('escaped characters', () => { + const text = 'ROW "a\\nb\\tc\\rd\\\\e\\"f", 1'; + const { root } = parse(text); + + expect(root.commands[0]).toMatchObject({ + type: 'command', + args: [ + { + type: 'literal', + literalType: 'keyword', + name: '"a\\nb\\tc\\rd\\\\e\\"f"', + valueUnquoted: 'a\nb\tc\rd\\e"f', + }, + {}, + ], + }); + }); }); - }); - // TODO: Un-skip once string parsing fixed: https://github.com/elastic/kibana/issues/203445 - it.skip('triple-quoted string', () => { - const text = 'ROW """abc"""'; - const { root } = parse(text); + describe('triple quoted', () => { + it('empty string', () => { + const text = 'ROW """""", 1'; + const { root } = parse(text); - expect(root.commands[0]).toMatchObject({ - type: 'command', - args: [ - { - type: 'literal', - literalType: 'keyword', - value: 'abc', - }, - ], + expect(root.commands[0]).toMatchObject({ + type: 'command', + args: [ + { + type: 'literal', + literalType: 'keyword', + name: '""""""', + valueUnquoted: '', + }, + {}, + ], + }); + }); + + it('short string', () => { + const text = 'ROW """abc""", 1'; + const { root } = parse(text); + + expect(root.commands[0]).toMatchObject({ + type: 'command', + args: [ + { + type: 'literal', + literalType: 'keyword', + name: '"""abc"""', + valueUnquoted: 'abc', + }, + {}, + ], + }); + }); + + it('characters are not escaped', () => { + const text = 'ROW """a\\nb\\c\\"d""", 1'; + const { root } = parse(text); + + expect(root.commands[0]).toMatchObject({ + type: 'command', + args: [ + { + type: 'literal', + literalType: 'keyword', + name: '"""a\\nb\\c\\"d"""', + valueUnquoted: 'a\\nb\\c\\"d', + }, + {}, + ], + }); + }); }); }); }); diff --git a/src/platform/packages/shared/kbn-esql-ast/src/parser/esql_ast_builder_listener.ts b/src/platform/packages/shared/kbn-esql-ast/src/parser/esql_ast_builder_listener.ts index e167a55f1b682..ea9201b800721 100644 --- a/src/platform/packages/shared/kbn-esql-ast/src/parser/esql_ast_builder_listener.ts +++ b/src/platform/packages/shared/kbn-esql-ast/src/parser/esql_ast_builder_listener.ts @@ -50,8 +50,6 @@ import { visitByOption, collectAllColumnIdentifiers, visitRenameClauses, - visitDissect, - visitGrok, collectBooleanExpression, visitOrderExpressions, getPolicyName, @@ -60,6 +58,8 @@ import { } from './walkers'; import type { ESQLAst, ESQLAstMetricsCommand } from '../types'; import { createJoinCommand } from './factories/join'; +import { createDissectCommand } from './factories/dissect'; +import { createGrokCommand } from './factories/grok'; export class ESQLAstBuilderListener implements ESQLParserListener { private ast: ESQLAst = []; @@ -262,9 +262,9 @@ export class ESQLAstBuilderListener implements ESQLParserListener { * @param ctx the parse tree */ exitDissectCommand(ctx: DissectCommandContext) { - const command = createCommand('dissect', ctx); + const command = createDissectCommand(ctx); + this.ast.push(command); - command.args.push(...visitDissect(ctx)); } /** @@ -272,9 +272,9 @@ export class ESQLAstBuilderListener implements ESQLParserListener { * @param ctx the parse tree */ exitGrokCommand(ctx: GrokCommandContext) { - const command = createCommand('grok', ctx); + const command = createGrokCommand(ctx); + this.ast.push(command); - command.args.push(...visitGrok(ctx)); } /** diff --git a/src/platform/packages/shared/kbn-esql-ast/src/parser/factories.ts b/src/platform/packages/shared/kbn-esql-ast/src/parser/factories.ts index df30e596993ea..0db09c0f9dfa7 100644 --- a/src/platform/packages/shared/kbn-esql-ast/src/parser/factories.ts +++ b/src/platform/packages/shared/kbn-esql-ast/src/parser/factories.ts @@ -32,6 +32,7 @@ import { InputParamContext, InputNamedOrPositionalParamContext, IdentifierOrParameterContext, + StringContext, } from '../antlr/esql_parser'; import { DOUBLE_TICKS_REGEX, SINGLE_BACKTICK, TICKS_REGEX } from './constants'; import type { @@ -119,6 +120,29 @@ export function createFakeMultiplyLiteral( }; } +export function createLiteralString(ctx: StringContext): ESQLLiteral { + const quotedString = ctx.QUOTED_STRING()?.getText() ?? '""'; + const isTripleQuoted = quotedString.startsWith('"""') && quotedString.endsWith('"""'); + let valueUnquoted = isTripleQuoted ? quotedString.slice(3, -3) : quotedString.slice(1, -1); + + if (!isTripleQuoted) { + valueUnquoted = valueUnquoted + .replace(/\\\\/g, '\\') + .replace(/\\"/g, '"') + .replace(/\\r/g, '\r') + .replace(/\\n/g, '\n') + .replace(/\\t/g, '\t'); + } + + return Builder.expression.literal.string( + valueUnquoted, + { + name: quotedString, + }, + createParserFields(ctx) + ); +} + function isMissingText(text: string) { return /<missing /.test(text); } diff --git a/src/platform/packages/shared/kbn-esql-ast/src/parser/factories/dissect.ts b/src/platform/packages/shared/kbn-esql-ast/src/parser/factories/dissect.ts new file mode 100644 index 0000000000000..ee65347adb496 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-ast/src/parser/factories/dissect.ts @@ -0,0 +1,65 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import esql_parser, { CommandOptionsContext, DissectCommandContext } from '../../antlr/esql_parser'; +import { ESQLCommand, ESQLCommandOption } from '../../types'; +import { + createCommand, + createLiteralString, + createOption, + sanitizeIdentifierString, + textExistsAndIsValid, +} from '../factories'; +import { getConstant, visitPrimaryExpression } from '../walkers'; + +const createDissectOptions = (ctx: CommandOptionsContext | undefined): ESQLCommandOption[] => { + if (!ctx) { + return []; + } + + const options: ESQLCommandOption[] = []; + + for (const optionCtx of ctx.commandOption_list()) { + const option = createOption( + sanitizeIdentifierString(optionCtx.identifier()).toLowerCase(), + optionCtx + ); + options.push(option); + // it can throw while accessing constant for incomplete commands, so try catch it + try { + const optionValue = getConstant(optionCtx.constant()); + if (optionValue != null) { + option.args.push(optionValue); + } + } catch (e) { + // do nothing here + } + } + + return options; +}; + +export const createDissectCommand = (ctx: DissectCommandContext): ESQLCommand => { + const command = createCommand('dissect', ctx); + const primaryExpression = visitPrimaryExpression(ctx.primaryExpression()); + const stringContext = ctx.string_(); + const pattern = stringContext.getToken(esql_parser.QUOTED_STRING, 0); + const doParseStringAndOptions = pattern && textExistsAndIsValid(pattern.getText()); + + command.args.push(primaryExpression); + + if (doParseStringAndOptions) { + const stringNode = createLiteralString(stringContext); + + command.args.push(stringNode); + command.args.push(...createDissectOptions(ctx.commandOptions())); + } + + return command; +}; diff --git a/src/platform/packages/shared/kbn-esql-ast/src/parser/factories/grok.ts b/src/platform/packages/shared/kbn-esql-ast/src/parser/factories/grok.ts new file mode 100644 index 0000000000000..01464641657e6 --- /dev/null +++ b/src/platform/packages/shared/kbn-esql-ast/src/parser/factories/grok.ts @@ -0,0 +1,31 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import esql_parser, { GrokCommandContext } from '../../antlr/esql_parser'; +import { ESQLCommand } from '../../types'; +import { createCommand, createLiteralString, textExistsAndIsValid } from '../factories'; +import { visitPrimaryExpression } from '../walkers'; + +export const createGrokCommand = (ctx: GrokCommandContext): ESQLCommand => { + const command = createCommand('grok', ctx); + const primaryExpression = visitPrimaryExpression(ctx.primaryExpression()); + const stringContext = ctx.string_(); + const pattern = stringContext.getToken(esql_parser.QUOTED_STRING, 0); + const doParseStringAndOptions = pattern && textExistsAndIsValid(pattern.getText()); + + command.args.push(primaryExpression); + + if (doParseStringAndOptions) { + const stringNode = createLiteralString(stringContext); + + command.args.push(stringNode); + } + + return command; +}; diff --git a/src/platform/packages/shared/kbn-esql-ast/src/parser/walkers.ts b/src/platform/packages/shared/kbn-esql-ast/src/parser/walkers.ts index 60dfafa6e3c89..a9f3ac7157a1f 100644 --- a/src/platform/packages/shared/kbn-esql-ast/src/parser/walkers.ts +++ b/src/platform/packages/shared/kbn-esql-ast/src/parser/walkers.ts @@ -18,14 +18,12 @@ import { BooleanLiteralContext, InputParameterContext, BooleanValueContext, - type CommandOptionsContext, ComparisonContext, type ComparisonOperatorContext, type ConstantContext, ConstantDefaultContext, DecimalLiteralContext, DereferenceContext, - type DissectCommandContext, type DropCommandContext, type EnrichCommandContext, type FieldContext, @@ -33,7 +31,6 @@ import { type AggFieldsContext, type FromCommandContext, FunctionContext, - type GrokCommandContext, IntegerLiteralContext, IsNullContext, type KeepCommandContext, @@ -74,7 +71,6 @@ import { createFakeMultiplyLiteral, createList, createNumericLiteral, - sanitizeIdentifierString, computeLocationExtends, createColumnStar, wrapIdentifierAsArray, @@ -86,6 +82,7 @@ import { createOrderExpression, createFunctionCall, createParam, + createLiteralString, } from './factories'; import { @@ -331,7 +328,7 @@ function getBooleanValue(ctx: BooleanLiteralContext | BooleanValueContext) { return createLiteral('boolean', booleanTerminalNode!); } -function getConstant(ctx: ConstantContext): ESQLAstItem { +export function getConstant(ctx: ConstantContext): ESQLAstItem { if (ctx instanceof NullLiteralContext) { return createLiteral('null', ctx.NULL()); } @@ -354,8 +351,7 @@ function getConstant(ctx: ConstantContext): ESQLAstItem { return getBooleanValue(ctx); } if (ctx instanceof StringLiteralContext) { - // String literal covers multiple ES|QL types: text and keyword types - return createLiteral('keyword', ctx.string_().QUOTED_STRING()); + return createLiteralString(ctx.string_()); } if ( ctx instanceof NumericArrayLiteralContext || @@ -374,11 +370,9 @@ function getConstant(ctx: ConstantContext): ESQLAstItem { values.push(getBooleanValue(booleanValue)!); } for (const string of ctx.getTypedRuleContexts(StringContext)) { - // String literal covers multiple ES|QL types: text and keyword types - const literal = createLiteral('keyword', string.QUOTED_STRING()); - if (literal) { - values.push(literal); - } + const literal = createLiteralString(string); + + values.push(literal); } return createList(ctx, values); } @@ -484,10 +478,10 @@ function collectRegexExpression(ctx: BooleanExpressionContext): ESQLFunction[] { const arg = visitValueExpression(regex.valueExpression()); if (arg) { fn.args.push(arg); - const literal = createLiteral('keyword', regex._pattern.QUOTED_STRING()); - if (literal) { - fn.args.push(literal); - } + + const literal = createLiteralString(regex._pattern); + + fn.args.push(literal); } return fn; }) @@ -631,47 +625,3 @@ export function visitOrderExpressions( return ast; } - -export function visitDissect(ctx: DissectCommandContext) { - const pattern = ctx.string_().getToken(esql_parser.QUOTED_STRING, 0); - return [ - visitPrimaryExpression(ctx.primaryExpression()), - ...(pattern && textExistsAndIsValid(pattern.getText()) - ? [createLiteral('keyword', pattern), ...visitDissectOptions(ctx.commandOptions())] - : []), - ].filter(nonNullable); -} - -export function visitGrok(ctx: GrokCommandContext) { - const pattern = ctx.string_().getToken(esql_parser.QUOTED_STRING, 0); - return [ - visitPrimaryExpression(ctx.primaryExpression()), - ...(pattern && textExistsAndIsValid(pattern.getText()) - ? [createLiteral('keyword', pattern)] - : []), - ].filter(nonNullable); -} - -function visitDissectOptions(ctx: CommandOptionsContext | undefined) { - if (!ctx) { - return []; - } - const options: ESQLCommandOption[] = []; - for (const optionCtx of ctx.commandOption_list()) { - const option = createOption( - sanitizeIdentifierString(optionCtx.identifier()).toLowerCase(), - optionCtx - ); - options.push(option); - // it can throw while accessing constant for incomplete commands, so try catch it - try { - const optionValue = getConstant(optionCtx.constant()); - if (optionValue != null) { - option.args.push(optionValue); - } - } catch (e) { - // do nothing here - } - } - return options; -} diff --git a/src/platform/packages/shared/kbn-esql-ast/src/pretty_print/leaf_printer.ts b/src/platform/packages/shared/kbn-esql-ast/src/pretty_print/leaf_printer.ts index 5432fd815ba52..76e6536070b71 100644 --- a/src/platform/packages/shared/kbn-esql-ast/src/pretty_print/leaf_printer.ts +++ b/src/platform/packages/shared/kbn-esql-ast/src/pretty_print/leaf_printer.ts @@ -16,6 +16,7 @@ import { ESQLParamLiteral, ESQLProperNode, ESQLSource, + ESQLStringLiteral, ESQLTimeInterval, } from '../types'; @@ -81,6 +82,21 @@ export const LeafPrinter = { return formatted; }, + string: (node: ESQLStringLiteral) => { + const str = node.valueUnquoted; + const strFormatted = + '"' + + str + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/\t/g, '\\t') + + '"'; + + return strFormatted; + }, + literal: (node: ESQLLiteral) => { switch (node.literalType) { case 'null': { @@ -93,7 +109,7 @@ export const LeafPrinter = { return LeafPrinter.param(node); } case 'keyword': { - return String(node.value); + return LeafPrinter.string(node); } case 'double': { const isRounded = node.value % 1 === 0; diff --git a/src/platform/packages/shared/kbn-esql-ast/src/synth/__tests__/cmd.test.ts b/src/platform/packages/shared/kbn-esql-ast/src/synth/__tests__/cmd.test.ts index 1158c2bf838e0..fdf8477a3bc3b 100644 --- a/src/platform/packages/shared/kbn-esql-ast/src/synth/__tests__/cmd.test.ts +++ b/src/platform/packages/shared/kbn-esql-ast/src/synth/__tests__/cmd.test.ts @@ -46,5 +46,5 @@ test('can compose expressions into commands', () => { const text2 = BasicPrettyPrinter.command(cmd2); expect(text1).toBe('WHERE a.b.c == "asdf"'); - expect(text2).toBe('DISSECT a.b.c """%{date}"""'); + expect(text2).toBe('DISSECT a.b.c "%{date}"'); }); diff --git a/src/platform/packages/shared/kbn-esql-ast/src/synth/__tests__/expr_function.test.ts b/src/platform/packages/shared/kbn-esql-ast/src/synth/__tests__/expr_function.test.ts index a859fbc2c0d3d..0295f6f11fa30 100644 --- a/src/platform/packages/shared/kbn-esql-ast/src/synth/__tests__/expr_function.test.ts +++ b/src/platform/packages/shared/kbn-esql-ast/src/synth/__tests__/expr_function.test.ts @@ -57,7 +57,7 @@ test('can generate a function call expression', () => { { type: 'literal', literalType: 'keyword', - value: '"test"', + valueUnquoted: 'test', }, ], }); diff --git a/src/platform/packages/shared/kbn-esql-ast/src/types.ts b/src/platform/packages/shared/kbn-esql-ast/src/types.ts index d2e2bb8ae775c..9adb7cbe36c5c 100644 --- a/src/platform/packages/shared/kbn-esql-ast/src/types.ts +++ b/src/platform/packages/shared/kbn-esql-ast/src/types.ts @@ -369,6 +369,7 @@ export interface ESQLStringLiteral extends ESQLAstBaseItem { literalType: 'keyword'; value: string; + valueUnquoted: string; } // @internal diff --git a/packages/kbn-openapi-common/README.md b/src/platform/packages/shared/kbn-openapi-common/README.md similarity index 100% rename from packages/kbn-openapi-common/README.md rename to src/platform/packages/shared/kbn-openapi-common/README.md diff --git a/src/platform/packages/shared/kbn-openapi-common/jest.config.js b/src/platform/packages/shared/kbn-openapi-common/jest.config.js new file mode 100644 index 0000000000000..12c38e4154655 --- /dev/null +++ b/src/platform/packages/shared/kbn-openapi-common/jest.config.js @@ -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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../../../../..', + roots: ['<rootDir>/src/platform/packages/shared/kbn-openapi-common'], +}; diff --git a/packages/kbn-openapi-common/kibana.jsonc b/src/platform/packages/shared/kbn-openapi-common/kibana.jsonc similarity index 100% rename from packages/kbn-openapi-common/kibana.jsonc rename to src/platform/packages/shared/kbn-openapi-common/kibana.jsonc diff --git a/packages/kbn-openapi-common/package.json b/src/platform/packages/shared/kbn-openapi-common/package.json similarity index 100% rename from packages/kbn-openapi-common/package.json rename to src/platform/packages/shared/kbn-openapi-common/package.json diff --git a/packages/kbn-openapi-common/schemas/error_responses.gen.ts b/src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.gen.ts similarity index 100% rename from packages/kbn-openapi-common/schemas/error_responses.gen.ts rename to src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.gen.ts diff --git a/packages/kbn-openapi-common/schemas/error_responses.schema.yaml b/src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml similarity index 100% rename from packages/kbn-openapi-common/schemas/error_responses.schema.yaml rename to src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml diff --git a/packages/kbn-openapi-common/schemas/primitives.gen.ts b/src/platform/packages/shared/kbn-openapi-common/schemas/primitives.gen.ts similarity index 100% rename from packages/kbn-openapi-common/schemas/primitives.gen.ts rename to src/platform/packages/shared/kbn-openapi-common/schemas/primitives.gen.ts diff --git a/packages/kbn-openapi-common/schemas/primitives.schema.yaml b/src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml similarity index 100% rename from packages/kbn-openapi-common/schemas/primitives.schema.yaml rename to src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml diff --git a/packages/kbn-openapi-common/schemas/primitives.test.ts b/src/platform/packages/shared/kbn-openapi-common/schemas/primitives.test.ts similarity index 100% rename from packages/kbn-openapi-common/schemas/primitives.test.ts rename to src/platform/packages/shared/kbn-openapi-common/schemas/primitives.test.ts diff --git a/src/platform/packages/shared/kbn-openapi-common/scripts/openapi_generate.js b/src/platform/packages/shared/kbn-openapi-common/scripts/openapi_generate.js new file mode 100644 index 0000000000000..54fa109cfb2cd --- /dev/null +++ b/src/platform/packages/shared/kbn-openapi-common/scripts/openapi_generate.js @@ -0,0 +1,23 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +require('../../../../../setup_node_env'); +const { resolve } = require('path'); +const { generate } = require('@kbn/openapi-generator'); + +const ROOT = resolve(__dirname, '..'); + +(async () => { + await generate({ + title: 'OpenAPI Common Schemas (kbn-openapi-common)', + rootDir: ROOT, + sourceGlob: './schemas/**/*.schema.yaml', + templateName: 'zod_operation_schema', + }); +})(); diff --git a/packages/kbn-openapi-common/shared/index.ts b/src/platform/packages/shared/kbn-openapi-common/shared/index.ts similarity index 100% rename from packages/kbn-openapi-common/shared/index.ts rename to src/platform/packages/shared/kbn-openapi-common/shared/index.ts diff --git a/packages/kbn-openapi-common/shared/path_params_replacer.ts b/src/platform/packages/shared/kbn-openapi-common/shared/path_params_replacer.ts similarity index 100% rename from packages/kbn-openapi-common/shared/path_params_replacer.ts rename to src/platform/packages/shared/kbn-openapi-common/shared/path_params_replacer.ts diff --git a/src/platform/packages/shared/kbn-openapi-common/tsconfig.json b/src/platform/packages/shared/kbn-openapi-common/tsconfig.json new file mode 100644 index 0000000000000..cf3d0ba7804aa --- /dev/null +++ b/src/platform/packages/shared/kbn-openapi-common/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "outDir": "target/types", + "types": ["jest", "node"] + }, + "exclude": ["target/**/*"], + "extends": "../../../../../tsconfig.base.json", + "include": ["**/*.ts"], + "kbn_references": [ + "@kbn/zod", + "@kbn/zod-helpers", + ] +} diff --git a/packages/kbn-securitysolution-es-utils/README.md b/src/platform/packages/shared/kbn-securitysolution-es-utils/README.md similarity index 100% rename from packages/kbn-securitysolution-es-utils/README.md rename to src/platform/packages/shared/kbn-securitysolution-es-utils/README.md diff --git a/packages/kbn-securitysolution-es-utils/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/index.ts diff --git a/src/platform/packages/shared/kbn-securitysolution-es-utils/jest.config.js b/src/platform/packages/shared/kbn-securitysolution-es-utils/jest.config.js new file mode 100644 index 0000000000000..3a654a3a269ea --- /dev/null +++ b/src/platform/packages/shared/kbn-securitysolution-es-utils/jest.config.js @@ -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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/src/platform/packages/shared/kbn-securitysolution-es-utils'], +}; diff --git a/packages/kbn-securitysolution-es-utils/kibana.jsonc b/src/platform/packages/shared/kbn-securitysolution-es-utils/kibana.jsonc similarity index 100% rename from packages/kbn-securitysolution-es-utils/kibana.jsonc rename to src/platform/packages/shared/kbn-securitysolution-es-utils/kibana.jsonc diff --git a/packages/kbn-securitysolution-es-utils/package.json b/src/platform/packages/shared/kbn-securitysolution-es-utils/package.json similarity index 100% rename from packages/kbn-securitysolution-es-utils/package.json rename to src/platform/packages/shared/kbn-securitysolution-es-utils/package.json diff --git a/packages/kbn-securitysolution-es-utils/src/bad_request_error/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/bad_request_error/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/bad_request_error/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/bad_request_error/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/create_boostrap_index/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/create_boostrap_index/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/create_boostrap_index/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/create_boostrap_index/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/create_data_stream/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/create_data_stream/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/create_data_stream/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/create_data_stream/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/decode_version/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/decode_version/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/decode_version/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/decode_version/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/delete_all_index/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/delete_all_index/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/delete_all_index/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/delete_all_index/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/delete_data_stream/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/delete_data_stream/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/delete_data_stream/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/delete_data_stream/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/delete_index_template/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/delete_index_template/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/delete_index_template/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/delete_index_template/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/delete_policy/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/delete_policy/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/delete_policy/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/delete_policy/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/delete_template/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/delete_template/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/delete_template/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/delete_template/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/elasticsearch_client/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/elasticsearch_client/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/elasticsearch_client/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/elasticsearch_client/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/encode_hit_version/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/encode_hit_version/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/encode_hit_version/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/encode_hit_version/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/get_bootstrap_index_exists/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/get_bootstrap_index_exists/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/get_bootstrap_index_exists/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/get_bootstrap_index_exists/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/get_data_stream_exists/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/get_data_stream_exists/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/get_data_stream_exists/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/get_data_stream_exists/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/get_index_aliases/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/get_index_aliases/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/get_index_aliases/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/get_index_aliases/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/get_index_count/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/get_index_count/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/get_index_count/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/get_index_count/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/get_index_exists/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/get_index_exists/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/get_index_exists/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/get_index_exists/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/get_index_template_exists/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/get_index_template_exists/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/get_index_template_exists/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/get_index_template_exists/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/get_policy_exists/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/get_policy_exists/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/get_policy_exists/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/get_policy_exists/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/get_template_exists/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/get_template_exists/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/get_template_exists/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/get_template_exists/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/migrate_to_data_stream/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/migrate_to_data_stream/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/migrate_to_data_stream/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/migrate_to_data_stream/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/put_mappings/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/put_mappings/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/put_mappings/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/put_mappings/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/read_index/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/read_index/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/read_index/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/read_index/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/read_privileges/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/read_privileges/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/read_privileges/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/read_privileges/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/remove_policy_from_index/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/remove_policy_from_index/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/remove_policy_from_index/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/remove_policy_from_index/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/set_index_template/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/set_index_template/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/set_index_template/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/set_index_template/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/set_policy/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/set_policy/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/set_policy/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/set_policy/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/set_template/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/set_template/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/set_template/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/set_template/index.ts diff --git a/packages/kbn-securitysolution-es-utils/src/transform_error/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/transform_error/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/transform_error/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/transform_error/index.test.ts diff --git a/packages/kbn-securitysolution-es-utils/src/transform_error/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/transform_error/index.ts similarity index 100% rename from packages/kbn-securitysolution-es-utils/src/transform_error/index.ts rename to src/platform/packages/shared/kbn-securitysolution-es-utils/src/transform_error/index.ts diff --git a/src/platform/packages/shared/kbn-securitysolution-es-utils/tsconfig.json b/src/platform/packages/shared/kbn-securitysolution-es-utils/tsconfig.json new file mode 100644 index 0000000000000..5a16f6bdaff6c --- /dev/null +++ b/src/platform/packages/shared/kbn-securitysolution-es-utils/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts" + ], + "exclude": [ + "target/**/*", + ], + "kbn_references": [ + "@kbn/zod-helpers", + "@kbn/zod", + ] +} diff --git a/packages/kbn-securitysolution-io-ts-types/README.md b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/README.md similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/README.md rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/README.md diff --git a/packages/kbn-securitysolution-io-ts-types/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/index.ts diff --git a/src/platform/packages/shared/kbn-securitysolution-io-ts-types/jest.config.js b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/jest.config.js new file mode 100644 index 0000000000000..309c3085d7449 --- /dev/null +++ b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/jest.config.js @@ -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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/src/platform/packages/shared/kbn-securitysolution-io-ts-types'], +}; diff --git a/packages/kbn-securitysolution-io-ts-types/kibana.jsonc b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/kibana.jsonc similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/kibana.jsonc rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/kibana.jsonc diff --git a/packages/kbn-securitysolution-io-ts-types/package.json b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/package.json similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/package.json rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/package.json diff --git a/packages/kbn-securitysolution-io-ts-types/src/default_array/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_array/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/default_array/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_array/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/default_array/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_array/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/default_array/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_array/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/default_boolean_false/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_boolean_false/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/default_boolean_false/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_boolean_false/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/default_boolean_false/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_boolean_false/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/default_boolean_false/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_boolean_false/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/default_boolean_true/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_boolean_true/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/default_boolean_true/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_boolean_true/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/default_boolean_true/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_boolean_true/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/default_boolean_true/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_boolean_true/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/default_csv_array/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_csv_array/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/default_csv_array/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_csv_array/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/default_csv_array/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_csv_array/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/default_csv_array/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_csv_array/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/default_empty_string/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_empty_string/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/default_empty_string/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_empty_string/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/default_empty_string/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_empty_string/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/default_empty_string/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_empty_string/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/default_string_array/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_string_array/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/default_string_array/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_string_array/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/default_string_array/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_string_array/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/default_string_array/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_string_array/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/default_string_boolean_false/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_string_boolean_false/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/default_string_boolean_false/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_string_boolean_false/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/default_string_boolean_false/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_string_boolean_false/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/default_string_boolean_false/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_string_boolean_false/index.ts diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/src/default_uuid/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_uuid/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-alerting-types/src/default_uuid/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_uuid/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/default_uuid/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_uuid/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/default_uuid/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_uuid/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/default_value/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_value/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/default_value/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_value/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/default_value/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_value/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/default_value/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_value/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/default_version_number/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_version_number/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/default_version_number/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_version_number/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/default_version_number/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_version_number/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/default_version_number/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/default_version_number/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/empty_string_array/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/empty_string_array/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/empty_string_array/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/empty_string_array/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/empty_string_array/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/empty_string_array/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/empty_string_array/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/empty_string_array/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/enumeration/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/enumeration/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/enumeration/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/enumeration/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/enumeration/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/enumeration/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/enumeration/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/enumeration/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/import_query_schema/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/import_query_schema/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/import_query_schema/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/import_query_schema/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/import_query_schema/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/import_query_schema/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/import_query_schema/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/import_query_schema/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/iso_date_string/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/iso_date_string/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/iso_date_string/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/iso_date_string/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/iso_date_string/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/iso_date_string/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/iso_date_string/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/iso_date_string/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/limited_size_array/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/limited_size_array/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/limited_size_array/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/limited_size_array/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/limited_size_array/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/limited_size_array/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/limited_size_array/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/limited_size_array/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/non_empty_array/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/non_empty_array/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/non_empty_array/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/non_empty_array/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/non_empty_array/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/non_empty_array/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/non_empty_array/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/non_empty_array/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/non_empty_or_nullable_string_array/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/non_empty_or_nullable_string_array/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/non_empty_or_nullable_string_array/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/non_empty_or_nullable_string_array/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/non_empty_or_nullable_string_array/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/non_empty_or_nullable_string_array/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/non_empty_or_nullable_string_array/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/non_empty_or_nullable_string_array/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/non_empty_string/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/non_empty_string/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/non_empty_string/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/non_empty_string/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/non_empty_string/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/non_empty_string/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/non_empty_string/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/non_empty_string/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/non_empty_string_array/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/non_empty_string_array/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/non_empty_string_array/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/non_empty_string_array/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/non_empty_string_array/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/non_empty_string_array/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/non_empty_string_array/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/non_empty_string_array/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/number_between_zero_and_one_inclusive/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/number_between_zero_and_one_inclusive/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/number_between_zero_and_one_inclusive/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/number_between_zero_and_one_inclusive/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/number_between_zero_and_one_inclusive/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/number_between_zero_and_one_inclusive/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/number_between_zero_and_one_inclusive/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/number_between_zero_and_one_inclusive/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/only_false_allowed/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/only_false_allowed/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/only_false_allowed/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/only_false_allowed/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/only_false_allowed/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/only_false_allowed/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/only_false_allowed/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/only_false_allowed/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/operator/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/operator/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/operator/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/operator/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/positive_integer/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/positive_integer/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/positive_integer/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/positive_integer/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/positive_integer/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/positive_integer/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/positive_integer/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/positive_integer/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/positive_integer_greater_than_zero/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/positive_integer_greater_than_zero/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/positive_integer_greater_than_zero/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/positive_integer_greater_than_zero/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/positive_integer_greater_than_zero/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/positive_integer_greater_than_zero/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/positive_integer_greater_than_zero/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/positive_integer_greater_than_zero/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/string_to_positive_number/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/string_to_positive_number/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/string_to_positive_number/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/string_to_positive_number/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/time_duration/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/time_duration/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/time_duration/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/time_duration/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/time_duration/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/time_duration/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/time_duration/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/time_duration/index.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/uuid/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/uuid/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/uuid/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/uuid/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-types/src/uuid/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/uuid/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-types/src/uuid/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/uuid/index.ts diff --git a/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/version/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/version/index.ts new file mode 100644 index 0000000000000..58a37ec155b0c --- /dev/null +++ b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/src/version/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import * as t from 'io-ts'; +import { PositiveIntegerGreaterThanZero } from '../positive_integer_greater_than_zero'; + +/** + * Note this is just a positive number, but we use it as a type here which is still ok. + * This type was originally from "x-pack/solutions/security/plugins/security_solution/common/detection_engine/schemas/common/schemas.ts" + * but is moved here to make things more portable. No unit tests, but see PositiveIntegerGreaterThanZero integer for unit tests. + */ +export const version = PositiveIntegerGreaterThanZero; +export type Version = t.TypeOf<typeof version>; + +export const versionOrUndefined = t.union([version, t.undefined]); +export type VersionOrUndefined = t.TypeOf<typeof versionOrUndefined>; diff --git a/src/platform/packages/shared/kbn-securitysolution-io-ts-types/tsconfig.json b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/tsconfig.json new file mode 100644 index 0000000000000..6bc8a84da337d --- /dev/null +++ b/src/platform/packages/shared/kbn-securitysolution-io-ts-types/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts" + ], + "kbn_references": [ + "@kbn/securitysolution-io-ts-utils" + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/packages/kbn-securitysolution-io-ts-utils/README.md b/src/platform/packages/shared/kbn-securitysolution-io-ts-utils/README.md similarity index 100% rename from packages/kbn-securitysolution-io-ts-utils/README.md rename to src/platform/packages/shared/kbn-securitysolution-io-ts-utils/README.md diff --git a/packages/kbn-securitysolution-io-ts-utils/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-utils/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-utils/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-utils/index.ts diff --git a/src/platform/packages/shared/kbn-securitysolution-io-ts-utils/jest.config.js b/src/platform/packages/shared/kbn-securitysolution-io-ts-utils/jest.config.js new file mode 100644 index 0000000000000..cfa70556f4b89 --- /dev/null +++ b/src/platform/packages/shared/kbn-securitysolution-io-ts-utils/jest.config.js @@ -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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/src/platform/packages/shared/kbn-securitysolution-io-ts-utils'], +}; diff --git a/packages/kbn-securitysolution-io-ts-utils/kibana.jsonc b/src/platform/packages/shared/kbn-securitysolution-io-ts-utils/kibana.jsonc similarity index 100% rename from packages/kbn-securitysolution-io-ts-utils/kibana.jsonc rename to src/platform/packages/shared/kbn-securitysolution-io-ts-utils/kibana.jsonc diff --git a/packages/kbn-securitysolution-io-ts-utils/package.json b/src/platform/packages/shared/kbn-securitysolution-io-ts-utils/package.json similarity index 100% rename from packages/kbn-securitysolution-io-ts-utils/package.json rename to src/platform/packages/shared/kbn-securitysolution-io-ts-utils/package.json diff --git a/packages/kbn-securitysolution-io-ts-utils/src/exact_check/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-utils/src/exact_check/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-utils/src/exact_check/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-utils/src/exact_check/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-utils/src/exact_check/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-utils/src/exact_check/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-utils/src/exact_check/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-utils/src/exact_check/index.ts diff --git a/packages/kbn-securitysolution-io-ts-utils/src/format_errors/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-utils/src/format_errors/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-utils/src/format_errors/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-utils/src/format_errors/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-utils/src/format_errors/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-utils/src/format_errors/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-utils/src/format_errors/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-utils/src/format_errors/index.ts diff --git a/packages/kbn-securitysolution-io-ts-utils/src/parse_schedule_dates/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-utils/src/parse_schedule_dates/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-utils/src/parse_schedule_dates/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-utils/src/parse_schedule_dates/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-utils/src/parse_schedule_dates/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-utils/src/parse_schedule_dates/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-utils/src/parse_schedule_dates/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-utils/src/parse_schedule_dates/index.ts diff --git a/packages/kbn-securitysolution-io-ts-utils/src/test_utils/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-utils/src/test_utils/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-utils/src/test_utils/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-utils/src/test_utils/index.ts diff --git a/packages/kbn-securitysolution-io-ts-utils/src/validate/index.test.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-utils/src/validate/index.test.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-utils/src/validate/index.test.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-utils/src/validate/index.test.ts diff --git a/packages/kbn-securitysolution-io-ts-utils/src/validate/index.ts b/src/platform/packages/shared/kbn-securitysolution-io-ts-utils/src/validate/index.ts similarity index 100% rename from packages/kbn-securitysolution-io-ts-utils/src/validate/index.ts rename to src/platform/packages/shared/kbn-securitysolution-io-ts-utils/src/validate/index.ts diff --git a/src/platform/packages/shared/kbn-securitysolution-io-ts-utils/tsconfig.json b/src/platform/packages/shared/kbn-securitysolution-io-ts-utils/tsconfig.json new file mode 100644 index 0000000000000..ca5354ad56e4f --- /dev/null +++ b/src/platform/packages/shared/kbn-securitysolution-io-ts-utils/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts" + ], + "kbn_references": [ + "@kbn/datemath" + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/packages/kbn-securitysolution-rules/README.md b/src/platform/packages/shared/kbn-securitysolution-rules/README.md similarity index 100% rename from packages/kbn-securitysolution-rules/README.md rename to src/platform/packages/shared/kbn-securitysolution-rules/README.md diff --git a/packages/kbn-securitysolution-rules/index.ts b/src/platform/packages/shared/kbn-securitysolution-rules/index.ts similarity index 100% rename from packages/kbn-securitysolution-rules/index.ts rename to src/platform/packages/shared/kbn-securitysolution-rules/index.ts diff --git a/packages/kbn-securitysolution-rules/kibana.jsonc b/src/platform/packages/shared/kbn-securitysolution-rules/kibana.jsonc similarity index 100% rename from packages/kbn-securitysolution-rules/kibana.jsonc rename to src/platform/packages/shared/kbn-securitysolution-rules/kibana.jsonc diff --git a/packages/kbn-securitysolution-rules/package.json b/src/platform/packages/shared/kbn-securitysolution-rules/package.json similarity index 100% rename from packages/kbn-securitysolution-rules/package.json rename to src/platform/packages/shared/kbn-securitysolution-rules/package.json diff --git a/packages/kbn-securitysolution-rules/src/configuration_constants.ts b/src/platform/packages/shared/kbn-securitysolution-rules/src/configuration_constants.ts similarity index 100% rename from packages/kbn-securitysolution-rules/src/configuration_constants.ts rename to src/platform/packages/shared/kbn-securitysolution-rules/src/configuration_constants.ts diff --git a/packages/kbn-securitysolution-rules/src/rule_type_constants.ts b/src/platform/packages/shared/kbn-securitysolution-rules/src/rule_type_constants.ts similarity index 100% rename from packages/kbn-securitysolution-rules/src/rule_type_constants.ts rename to src/platform/packages/shared/kbn-securitysolution-rules/src/rule_type_constants.ts diff --git a/packages/kbn-securitysolution-rules/src/rule_type_mappings.ts b/src/platform/packages/shared/kbn-securitysolution-rules/src/rule_type_mappings.ts similarity index 100% rename from packages/kbn-securitysolution-rules/src/rule_type_mappings.ts rename to src/platform/packages/shared/kbn-securitysolution-rules/src/rule_type_mappings.ts diff --git a/packages/kbn-securitysolution-rules/src/utils.ts b/src/platform/packages/shared/kbn-securitysolution-rules/src/utils.ts similarity index 100% rename from packages/kbn-securitysolution-rules/src/utils.ts rename to src/platform/packages/shared/kbn-securitysolution-rules/src/utils.ts diff --git a/src/platform/packages/shared/kbn-securitysolution-rules/tsconfig.json b/src/platform/packages/shared/kbn-securitysolution-rules/tsconfig.json new file mode 100644 index 0000000000000..131ff3e6bb433 --- /dev/null +++ b/src/platform/packages/shared/kbn-securitysolution-rules/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts" + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/src/platform/packages/shared/kbn-zod-helpers/README.md b/src/platform/packages/shared/kbn-zod-helpers/README.md new file mode 100644 index 0000000000000..eccc865092294 --- /dev/null +++ b/src/platform/packages/shared/kbn-zod-helpers/README.md @@ -0,0 +1,14 @@ +# Helpers and utilities for Zod + +[Zod](https://zod.dev/) is a schema validation library with static type inference for TypeScript. + +Helpers defined in this package: + +- Can be used in other packages and plugins to make it easier to define schemas with Zod, such as API schemas. +- Are already used in `packages/kbn-openapi-generator`. +- Are already used in `x-pack/solutions/security/plugins/security_solution`. + +When you add some helper code to this package, please make sure that: + +- The code is generic and domain-agnostic (doesn't "know" about any domains such as Security or Observability). +- The code is reusable and there are already a few use cases for it. Try to not generalize prematurely. \ No newline at end of file diff --git a/packages/kbn-zod-helpers/index.ts b/src/platform/packages/shared/kbn-zod-helpers/index.ts similarity index 100% rename from packages/kbn-zod-helpers/index.ts rename to src/platform/packages/shared/kbn-zod-helpers/index.ts diff --git a/src/platform/packages/shared/kbn-zod-helpers/jest.config.js b/src/platform/packages/shared/kbn-zod-helpers/jest.config.js new file mode 100644 index 0000000000000..a24e940983817 --- /dev/null +++ b/src/platform/packages/shared/kbn-zod-helpers/jest.config.js @@ -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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/src/platform/packages/shared/kbn-zod-helpers'], +}; diff --git a/packages/kbn-zod-helpers/kibana.jsonc b/src/platform/packages/shared/kbn-zod-helpers/kibana.jsonc similarity index 100% rename from packages/kbn-zod-helpers/kibana.jsonc rename to src/platform/packages/shared/kbn-zod-helpers/kibana.jsonc diff --git a/packages/kbn-zod-helpers/package.json b/src/platform/packages/shared/kbn-zod-helpers/package.json similarity index 100% rename from packages/kbn-zod-helpers/package.json rename to src/platform/packages/shared/kbn-zod-helpers/package.json diff --git a/packages/kbn-zod-helpers/src/array_from_string.test.ts b/src/platform/packages/shared/kbn-zod-helpers/src/array_from_string.test.ts similarity index 100% rename from packages/kbn-zod-helpers/src/array_from_string.test.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/array_from_string.test.ts diff --git a/packages/kbn-zod-helpers/src/array_from_string.ts b/src/platform/packages/shared/kbn-zod-helpers/src/array_from_string.ts similarity index 100% rename from packages/kbn-zod-helpers/src/array_from_string.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/array_from_string.ts diff --git a/packages/kbn-zod-helpers/src/boolean_from_string.test.ts b/src/platform/packages/shared/kbn-zod-helpers/src/boolean_from_string.test.ts similarity index 100% rename from packages/kbn-zod-helpers/src/boolean_from_string.test.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/boolean_from_string.test.ts diff --git a/packages/kbn-zod-helpers/src/boolean_from_string.ts b/src/platform/packages/shared/kbn-zod-helpers/src/boolean_from_string.ts similarity index 100% rename from packages/kbn-zod-helpers/src/boolean_from_string.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/boolean_from_string.ts diff --git a/packages/kbn-zod-helpers/src/build_route_validation_with_zod.ts b/src/platform/packages/shared/kbn-zod-helpers/src/build_route_validation_with_zod.ts similarity index 100% rename from packages/kbn-zod-helpers/src/build_route_validation_with_zod.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/build_route_validation_with_zod.ts diff --git a/packages/kbn-zod-helpers/src/expect_parse_error.ts b/src/platform/packages/shared/kbn-zod-helpers/src/expect_parse_error.ts similarity index 100% rename from packages/kbn-zod-helpers/src/expect_parse_error.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/expect_parse_error.ts diff --git a/packages/kbn-zod-helpers/src/expect_parse_success.ts b/src/platform/packages/shared/kbn-zod-helpers/src/expect_parse_success.ts similarity index 100% rename from packages/kbn-zod-helpers/src/expect_parse_success.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/expect_parse_success.ts diff --git a/packages/kbn-zod-helpers/src/is_valid_date_math.ts b/src/platform/packages/shared/kbn-zod-helpers/src/is_valid_date_math.ts similarity index 100% rename from packages/kbn-zod-helpers/src/is_valid_date_math.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/is_valid_date_math.ts diff --git a/packages/kbn-zod-helpers/src/non_empty_string.ts b/src/platform/packages/shared/kbn-zod-helpers/src/non_empty_string.ts similarity index 100% rename from packages/kbn-zod-helpers/src/non_empty_string.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/non_empty_string.ts diff --git a/packages/kbn-zod-helpers/src/required_optional.ts b/src/platform/packages/shared/kbn-zod-helpers/src/required_optional.ts similarity index 100% rename from packages/kbn-zod-helpers/src/required_optional.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/required_optional.ts diff --git a/packages/kbn-zod-helpers/src/safe_parse_result.ts b/src/platform/packages/shared/kbn-zod-helpers/src/safe_parse_result.ts similarity index 100% rename from packages/kbn-zod-helpers/src/safe_parse_result.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/safe_parse_result.ts diff --git a/packages/kbn-zod-helpers/src/stringify_zod_error.ts b/src/platform/packages/shared/kbn-zod-helpers/src/stringify_zod_error.ts similarity index 100% rename from packages/kbn-zod-helpers/src/stringify_zod_error.ts rename to src/platform/packages/shared/kbn-zod-helpers/src/stringify_zod_error.ts diff --git a/src/platform/packages/shared/kbn-zod-helpers/tsconfig.json b/src/platform/packages/shared/kbn-zod-helpers/tsconfig.json new file mode 100644 index 0000000000000..d3b33b22966b8 --- /dev/null +++ b/src/platform/packages/shared/kbn-zod-helpers/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "outDir": "target/types", + "types": ["jest", "node"] + }, + "exclude": ["target/**/*"], + "extends": "../../../../../tsconfig.base.json", + "include": ["**/*.ts"], + "kbn_references": [ + "@kbn/datemath", + "@kbn/core", + "@kbn/zod", + ] +} diff --git a/packages/serverless/settings/security_project/README.mdx b/src/platform/packages/shared/serverless/settings/security_project/README.mdx similarity index 100% rename from packages/serverless/settings/security_project/README.mdx rename to src/platform/packages/shared/serverless/settings/security_project/README.mdx diff --git a/packages/serverless/settings/security_project/index.ts b/src/platform/packages/shared/serverless/settings/security_project/index.ts similarity index 100% rename from packages/serverless/settings/security_project/index.ts rename to src/platform/packages/shared/serverless/settings/security_project/index.ts diff --git a/packages/serverless/settings/security_project/kibana.jsonc b/src/platform/packages/shared/serverless/settings/security_project/kibana.jsonc similarity index 100% rename from packages/serverless/settings/security_project/kibana.jsonc rename to src/platform/packages/shared/serverless/settings/security_project/kibana.jsonc diff --git a/packages/serverless/settings/security_project/package.json b/src/platform/packages/shared/serverless/settings/security_project/package.json similarity index 100% rename from packages/serverless/settings/security_project/package.json rename to src/platform/packages/shared/serverless/settings/security_project/package.json diff --git a/src/platform/packages/shared/serverless/settings/security_project/tsconfig.json b/src/platform/packages/shared/serverless/settings/security_project/tsconfig.json new file mode 100644 index 0000000000000..16a9ba9ba4b5d --- /dev/null +++ b/src/platform/packages/shared/serverless/settings/security_project/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/management-settings-ids", + ] +} diff --git a/src/platform/plugins/shared/dev_tools/public/application.tsx b/src/platform/plugins/shared/dev_tools/public/application.tsx index 0b66621fb2e9d..3acbaa21ed5a3 100644 --- a/src/platform/plugins/shared/dev_tools/public/application.tsx +++ b/src/platform/plugins/shared/dev_tools/public/application.tsx @@ -11,9 +11,8 @@ import React, { useEffect, useRef } from 'react'; import ReactDOM from 'react-dom'; import { Redirect, RouteComponentProps } from 'react-router-dom'; import { HashRouter as Router, Routes, Route } from '@kbn/shared-ux-router'; -import { EuiTab, EuiTabs, EuiToolTip, EuiBetaBadge } from '@elastic/eui'; +import { EuiTab, EuiTabs, EuiToolTip, EuiBetaBadge, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { euiThemeVars } from '@kbn/ui-theme'; import type { ApplicationStart, @@ -56,6 +55,7 @@ function DevToolsWrapper({ location, startServices, }: DevToolsWrapperProps) { + const { euiTheme } = useEuiTheme(); const { docTitleService, breadcrumbService } = appServices; const mountedTool = useRef<MountedDevToolDescriptor | null>(null); @@ -75,7 +75,7 @@ function DevToolsWrapper({ return ( <main className="devApp"> - <EuiTabs css={{ paddingLeft: euiThemeVars.euiSizeS }} size="l"> + <EuiTabs css={{ paddingLeft: euiTheme.size.s }} size="l"> {devTools.map((currentDevTool) => ( <EuiTab key={currentDevTool.id} diff --git a/src/platform/plugins/shared/dev_tools/tsconfig.json b/src/platform/plugins/shared/dev_tools/tsconfig.json index a80d3ddcea9f2..7a535e8ea0c7c 100644 --- a/src/platform/plugins/shared/dev_tools/tsconfig.json +++ b/src/platform/plugins/shared/dev_tools/tsconfig.json @@ -9,7 +9,6 @@ "@kbn/url-forwarding-plugin", "@kbn/management-plugin", "@kbn/i18n", - "@kbn/ui-theme", "@kbn/shared-ux-router", "@kbn/deeplinks-devtools", "@kbn/config-schema", diff --git a/src/platform/plugins/shared/esql/jest.integration.config.js b/src/platform/plugins/shared/esql/jest.integration.config.js new file mode 100644 index 0000000000000..33f2103af1ad3 --- /dev/null +++ b/src/platform/plugins/shared/esql/jest.integration.config.js @@ -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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['<rootDir>/src/platform/plugins/shared/esql'], +}; diff --git a/src/platform/plugins/shared/esql/server/index.ts b/src/platform/plugins/shared/esql/server/index.ts index 775da36c43959..c4b769d83e716 100644 --- a/src/platform/plugins/shared/esql/server/index.ts +++ b/src/platform/plugins/shared/esql/server/index.ts @@ -7,7 +7,9 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -export const plugin = async () => { +import type { PluginInitializerContext } from '@kbn/core/server'; + +export const plugin = async (initContext: PluginInitializerContext) => { const { EsqlServerPlugin } = await import('./plugin'); - return new EsqlServerPlugin(); + return new EsqlServerPlugin(initContext); }; diff --git a/src/platform/plugins/shared/esql/server/plugin.ts b/src/platform/plugins/shared/esql/server/plugin.ts index a227c8e95b4af..1b145c2f43411 100644 --- a/src/platform/plugins/shared/esql/server/plugin.ts +++ b/src/platform/plugins/shared/esql/server/plugin.ts @@ -7,13 +7,22 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import type { CoreSetup, CoreStart, Plugin } from '@kbn/core/server'; +import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/server'; import { schema } from '@kbn/config-schema'; import { ContentManagementServerSetup } from '@kbn/content-management-plugin/server'; import { getUiSettings } from './ui_settings'; +import { registerRoutes } from './routes'; export class EsqlServerPlugin implements Plugin { + private readonly initContext: PluginInitializerContext; + + constructor(initContext: PluginInitializerContext) { + this.initContext = { ...initContext }; + } + public setup(core: CoreSetup, plugins: { contentManagement: ContentManagementServerSetup }) { + const { initContext } = this; + core.uiSettings.register(getUiSettings()); plugins.contentManagement.favorites.registerFavoriteType('esql_query', { @@ -23,6 +32,9 @@ export class EsqlServerPlugin implements Plugin { status: schema.string(), }), }); + + registerRoutes(core, initContext); + return {}; } diff --git a/src/platform/plugins/shared/esql/server/routes/get_join_indices.ts b/src/platform/plugins/shared/esql/server/routes/get_join_indices.ts new file mode 100644 index 0000000000000..8fe1b92259d1b --- /dev/null +++ b/src/platform/plugins/shared/esql/server/routes/get_join_indices.ts @@ -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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import type { IRouter, PluginInitializerContext } from '@kbn/core/server'; + +import { EsqlService } from '../services/esql_service'; + +export const registerGetJoinIndicesRoute = ( + router: IRouter, + { logger }: PluginInitializerContext +) => { + router.get( + { + path: '/internal/esql/autocomplete/join/indices', + validate: {}, + }, + async (requestHandlerContext, request, response) => { + try { + const core = await requestHandlerContext.core; + const service = new EsqlService({ client: core.elasticsearch.client.asCurrentUser }); + const result = await service.getJoinIndices(); + + return response.ok({ + body: result, + }); + } catch (error) { + logger.get().debug(error); + throw error; + } + } + ); +}; diff --git a/src/platform/plugins/shared/esql/server/routes/index.ts b/src/platform/plugins/shared/esql/server/routes/index.ts new file mode 100644 index 0000000000000..93947ee1be43d --- /dev/null +++ b/src/platform/plugins/shared/esql/server/routes/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import type { CoreSetup, PluginInitializerContext } from '@kbn/core/server'; + +import { registerGetJoinIndicesRoute } from './get_join_indices'; + +export const registerRoutes = (setup: CoreSetup, initContext: PluginInitializerContext) => { + const router = setup.http.createRouter(); + + registerGetJoinIndicesRoute(router, initContext); +}; diff --git a/src/platform/plugins/shared/esql/server/services/esql_service.ts b/src/platform/plugins/shared/esql/server/services/esql_service.ts new file mode 100644 index 0000000000000..2861d7859ae41 --- /dev/null +++ b/src/platform/plugins/shared/esql/server/services/esql_service.ts @@ -0,0 +1,85 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import type { ElasticsearchClient } from '@kbn/core/server'; +import type { JoinIndexAutocompleteItem, JoinIndicesAutocompleteResult } from './types'; + +export interface EsqlServiceOptions { + client: ElasticsearchClient; +} + +export class EsqlService { + constructor(public readonly options: EsqlServiceOptions) {} + + protected async getIndexAliases(indices: string[]): Promise<Record<string, string[]>> { + const result: Record<string, string[]> = {}; + const { client } = this.options; + + // Execute: GET /<index1,index2,...>/_alias + interface AliasesResponse { + [indexName: string]: { + aliases: { + [aliasName: string]: {}; + }; + }; + } + const response = (await client.indices.getAlias({ + index: indices, + })) as AliasesResponse; + + for (const [indexName, { aliases }] of Object.entries(response)) { + const aliasNames = Object.keys(aliases ?? {}); + + if (aliasNames.length > 0) { + result[indexName] = aliasNames; + } + } + + return result; + } + + public async getJoinIndices(): Promise<JoinIndicesAutocompleteResult> { + const { client } = this.options; + + // Execute: GET /_all/_settings/index.mode,aliases?flat_settings=true + interface IndexModeResponse { + [indexName: string]: { + settings: { + 'index.mode': string; + }; + }; + } + const queryByIndexModeResponse = (await client.indices.getSettings({ + name: 'index.mode', + flat_settings: true, + })) as IndexModeResponse; + + const indices: JoinIndexAutocompleteItem[] = []; + const indexNames: string[] = []; + + for (const [name, { settings }] of Object.entries(queryByIndexModeResponse)) { + if (settings['index.mode'] === 'lookup') { + indexNames.push(name); + indices.push({ name, mode: 'lookup', aliases: [] }); + } + } + + const aliases = await this.getIndexAliases(indexNames); + + for (const index of indices) { + index.aliases = aliases[index.name] ?? []; + } + + const result: JoinIndicesAutocompleteResult = { + indices, + }; + + return result; + } +} diff --git a/src/platform/plugins/shared/esql/server/services/integration_tests/esql_service.test.ts b/src/platform/plugins/shared/esql/server/services/integration_tests/esql_service.test.ts new file mode 100644 index 0000000000000..dc73cfade4e7b --- /dev/null +++ b/src/platform/plugins/shared/esql/server/services/integration_tests/esql_service.test.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { EsqlServiceTestbed } from './testbed'; + +describe('EsqlService', () => { + const testbed = new EsqlServiceTestbed(); + + beforeAll(async () => { + await testbed.start(); + await testbed.setupLookupIndices(); + }); + + afterAll(async () => { + await testbed.stop(); + }); + + it('can load ES|QL Autocomplete/Validation indices for JOIN command', async () => { + const url = '/internal/esql/autocomplete/join/indices'; + const result = await testbed.GET(url).send().expect(200); + + const item1 = result.body.indices.find((item: any) => item.name === 'lookup_index1'); + const item2 = result.body.indices.find((item: any) => item.name === 'lookup_index2'); + + expect(item1).toMatchObject({ + name: 'lookup_index1', + mode: 'lookup', + aliases: [], + }); + + item2.aliases.sort(); + + expect(item2).toMatchObject({ + name: 'lookup_index2', + mode: 'lookup', + aliases: ['lookup_index2_alias1', 'lookup_index2_alias2'], + }); + }); +}); diff --git a/src/platform/plugins/shared/esql/server/services/integration_tests/testbed.ts b/src/platform/plugins/shared/esql/server/services/integration_tests/testbed.ts new file mode 100644 index 0000000000000..95de7fdf562c3 --- /dev/null +++ b/src/platform/plugins/shared/esql/server/services/integration_tests/testbed.ts @@ -0,0 +1,86 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { ElasticsearchClient } from '@kbn/core/server'; +import { + createTestServers, + request, + type TestUtils, + type TestElasticsearchUtils, + type TestKibanaUtils, +} from '@kbn/core-test-helpers-kbn-server'; + +export class EsqlServiceTestbed { + public servers?: TestUtils; + public es?: TestElasticsearchUtils; + public kibana?: TestKibanaUtils; + + public async start() { + this.servers = createTestServers({ adjustTimeout: jest.setTimeout }); + this.es = await this.servers.startES(); + this.kibana = await this.servers.startKibana(); + } + + public async stop() { + await this.kibana?.root?.shutdown(); + await this.kibana?.stop(); + await this.es?.stop(); + } + + public esClient(): ElasticsearchClient { + const client = this.kibana?.coreStart.elasticsearch.client.asInternalUser; + + if (!client) { + throw new Error('ES client not available, make sure to call `.start()`'); + } + + return client; + } + + public async setupLookupIndices() { + const client = this.esClient(); + + await client.indices.create({ + index: 'lookup_index1', + body: { + settings: { + 'index.mode': 'lookup', + }, + mappings: { + properties: { + field1: { type: 'keyword' }, + }, + }, + }, + }); + + // Lookup index with aliases + await client.indices.create({ + index: 'lookup_index2', + body: { + settings: { + 'index.mode': 'lookup', + }, + aliases: { + lookup_index2_alias1: {}, + lookup_index2_alias2: {}, + }, + mappings: { + properties: { + field2: { type: 'keyword' }, + }, + }, + }, + }); + } + + public readonly GET = (path: string) => { + return request.get(this.kibana!.root, path).set('x-elastic-internal-origin', 'esql-test'); + }; +} diff --git a/src/platform/plugins/shared/esql/server/services/types.ts b/src/platform/plugins/shared/esql/server/services/types.ts new file mode 100644 index 0000000000000..025a627653d56 --- /dev/null +++ b/src/platform/plugins/shared/esql/server/services/types.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export interface JoinIndicesAutocompleteResult { + indices: JoinIndexAutocompleteItem[]; +} + +export interface JoinIndexAutocompleteItem { + name: string; + mode: 'lookup' | string; + aliases: string[]; +} diff --git a/src/platform/plugins/shared/esql/server/ui_settings.ts b/src/platform/plugins/shared/esql/server/ui_settings.ts index 1ddae41c9b241..c3520f7adc2a2 100644 --- a/src/platform/plugins/shared/esql/server/ui_settings.ts +++ b/src/platform/plugins/shared/esql/server/ui_settings.ts @@ -21,7 +21,7 @@ export const getUiSettings: () => Record<string, UiSettingsParams> = () => ({ value: true, description: i18n.translate('esql.advancedSettings.enableESQLDescription', { defaultMessage: - 'This setting enables ES|QL in Kibana. By switching it off you will hide the ES|QL user interface from various applications. However, users will be able to access existing ES|QL saved searches, visualizations, etc.', + 'This setting enables ES|QL in Kibana. By switching it off you will hide the ES|QL user interface from various applications. However, users will be able to access existing ES|QL based Discover sessions, visualizations, etc.', }), requiresPageReload: true, schema: schema.boolean(), diff --git a/src/platform/plugins/shared/esql/tsconfig.json b/src/platform/plugins/shared/esql/tsconfig.json index 699fce107f1da..bacd508aa7ea6 100644 --- a/src/platform/plugins/shared/esql/tsconfig.json +++ b/src/platform/plugins/shared/esql/tsconfig.json @@ -26,6 +26,7 @@ "@kbn/usage-collection-plugin", "@kbn/content-management-plugin", "@kbn/kibana-utils-plugin", + "@kbn/core-test-helpers-kbn-server", ], "exclude": [ "target/**/*", diff --git a/src/plugins/dashboard/common/dashboard_container/types.ts b/src/plugins/dashboard/common/dashboard_container/types.ts index dd3f7302038c0..528eff1f96cb8 100644 --- a/src/plugins/dashboard/common/dashboard_container/types.ts +++ b/src/plugins/dashboard/common/dashboard_container/types.ts @@ -8,7 +8,6 @@ */ import { - ViewMode, PanelState, EmbeddableInput, SavedObjectEmbeddableInput, @@ -17,6 +16,7 @@ import { Filter, Query, TimeRange } from '@kbn/es-query'; import type { Reference } from '@kbn/content-management-utils'; import { RefreshInterval } from '@kbn/data-plugin/common'; import { KibanaExecutionContext } from '@kbn/core-execution-context-common'; +import type { ViewMode } from '@kbn/presentation-publishing'; import type { DashboardOptions, GridData } from '../../server/content_management'; @@ -44,7 +44,7 @@ export interface DashboardPanelState< export type DashboardContainerByReferenceInput = SavedObjectEmbeddableInput; -export interface DashboardContainerInput extends EmbeddableInput { +export interface DashboardContainerInput extends Omit<EmbeddableInput, 'viewMode'> { // filter context to be passed to children query: Query; filters: Filter[]; diff --git a/src/plugins/dashboard/public/dashboard_api/get_dashboard_api.ts b/src/plugins/dashboard/public/dashboard_api/get_dashboard_api.ts index 8b29ed8b1d9f0..5fcb6522b0152 100644 --- a/src/plugins/dashboard/public/dashboard_api/get_dashboard_api.ts +++ b/src/plugins/dashboard/public/dashboard_api/get_dashboard_api.ts @@ -87,18 +87,15 @@ export function getDashboardApi({ controlGroupApi$, panelsManager.api.children$ ); + const settingsManager = initializeSettingsManager(initialState); const unifiedSearchManager = initializeUnifiedSearchManager( initialState, controlGroupApi$, + settingsManager.api.timeRestore$, dataLoadingManager.internalApi.waitForPanelsToLoad$, () => unsavedChangesManager.internalApi.getLastSavedState(), creationOptions ); - const settingsManager = initializeSettingsManager({ - initialState, - setTimeRestore: unifiedSearchManager.internalApi.setTimeRestore, - timeRestore$: unifiedSearchManager.internalApi.timeRestore$, - }); const unsavedChangesManager = initializeUnsavedChangesManager({ creationOptions, controlGroupApi$, diff --git a/src/plugins/dashboard/public/dashboard_api/settings_manager.ts b/src/plugins/dashboard/public/dashboard_api/settings_manager.ts index 0b4903a506a90..9cb93269f4b4b 100644 --- a/src/plugins/dashboard/public/dashboard_api/settings_manager.ts +++ b/src/plugins/dashboard/public/dashboard_api/settings_manager.ts @@ -8,25 +8,12 @@ */ import fastIsEqual from 'fast-deep-equal'; -import { - PublishingSubject, - StateComparators, - initializeTitles, -} from '@kbn/presentation-publishing'; +import { StateComparators, initializeTitles } from '@kbn/presentation-publishing'; import { BehaviorSubject } from 'rxjs'; -import { DashboardState } from './types'; +import { DashboardSettings, DashboardState } from './types'; import { DEFAULT_DASHBOARD_INPUT } from '../dashboard_constants'; -import { DashboardStateFromSettingsFlyout } from '../dashboard_container/types'; -export function initializeSettingsManager({ - initialState, - setTimeRestore, - timeRestore$, -}: { - initialState?: DashboardState; - setTimeRestore: (timeRestore: boolean) => void; - timeRestore$: PublishingSubject<boolean | undefined>; -}) { +export function initializeSettingsManager(initialState?: DashboardState) { const syncColors$ = new BehaviorSubject<boolean>( initialState?.syncColors ?? DEFAULT_DASHBOARD_INPUT.syncColors ); @@ -50,6 +37,12 @@ export function initializeSettingsManager({ if (!fastIsEqual(tags, tags$.value)) tags$.next(tags); } const titleManager = initializeTitles(initialState ?? {}); + const timeRestore$ = new BehaviorSubject<boolean | undefined>( + initialState?.timeRestore ?? DEFAULT_DASHBOARD_INPUT.timeRestore + ); + function setTimeRestore(timeRestore: boolean) { + if (timeRestore !== timeRestore$.value) timeRestore$.next(timeRestore); + } const useMargins$ = new BehaviorSubject<boolean>( initialState?.useMargins ?? DEFAULT_DASHBOARD_INPUT.useMargins ); @@ -69,7 +62,7 @@ export function initializeSettingsManager({ }; } - function setSettings(settings: DashboardStateFromSettingsFlyout) { + function setSettings(settings: DashboardSettings) { setSyncColors(settings.syncColors); setSyncCursor(settings.syncCursor); setSyncTooltips(settings.syncTooltips); @@ -100,35 +93,16 @@ export function initializeSettingsManager({ syncColors: [syncColors$, setSyncColors], syncCursor: [syncCursor$, setSyncCursor], syncTooltips: [syncTooltips$, setSyncTooltips], + timeRestore: [timeRestore$, setTimeRestore], useMargins: [useMargins$, setUseMargins], - } as StateComparators< - Pick< - DashboardState, - | 'description' - | 'hidePanelTitles' - | 'syncColors' - | 'syncCursor' - | 'syncTooltips' - | 'title' - | 'useMargins' - > - >, + } as StateComparators<Omit<DashboardSettings, 'tags'>>, internalApi: { - getState: (): Pick< - DashboardState, - | 'description' - | 'hidePanelTitles' - | 'syncColors' - | 'syncCursor' - | 'syncTooltips' - | 'tags' - | 'title' - | 'useMargins' - > => { + getState: (): DashboardSettings => { const settings = getSettings(); return { ...settings, title: settings.title ?? '', + timeRestore: settings.timeRestore ?? DEFAULT_DASHBOARD_INPUT.timeRestore, hidePanelTitles: settings.hidePanelTitles ?? DEFAULT_DASHBOARD_INPUT.hidePanelTitles, }; }, diff --git a/src/plugins/dashboard/public/dashboard_api/types.ts b/src/plugins/dashboard/public/dashboard_api/types.ts index 3805d31df1d22..54b540d575695 100644 --- a/src/plugins/dashboard/public/dashboard_api/types.ts +++ b/src/plugins/dashboard/public/dashboard_api/types.ts @@ -54,15 +54,12 @@ import { PublishesReload } from '@kbn/presentation-publishing/interfaces/fetch/p import { PublishesSearchSession } from '@kbn/presentation-publishing/interfaces/fetch/publishes_search_session'; import { LocatorPublic } from '@kbn/share-plugin/common'; import { DashboardPanelMap, DashboardPanelState } from '../../common'; -import type { DashboardOptions } from '../../server/content_management'; +import type { DashboardAttributes, DashboardOptions } from '../../server/content_management'; import { LoadDashboardReturn, SaveDashboardReturn, } from '../services/dashboard_content_management_service/types'; -import { - DashboardLocatorParams, - DashboardStateFromSettingsFlyout, -} from '../dashboard_container/types'; +import { DashboardLocatorParams } from '../dashboard_container/types'; export const DASHBOARD_API_TYPE = 'dashboard'; @@ -93,23 +90,19 @@ export interface DashboardCreationOptions { getEmbeddableAppContext?: (dashboardId?: string) => EmbeddableAppContext; } -export interface DashboardState extends DashboardOptions { - // filter context to be passed to children +export type DashboardSettings = DashboardOptions & { + description?: DashboardAttributes['description']; + tags: string[]; + timeRestore: DashboardAttributes['timeRestore']; + title: DashboardAttributes['description']; +}; + +export interface DashboardState extends DashboardSettings { query: Query; filters: Filter[]; - timeRestore: boolean; timeRange?: TimeRange; refreshInterval?: RefreshInterval; - - // dashboard meta info - title: string; - tags: string[]; viewMode: ViewMode; - description?: string; - - // settings from DashboardOptions - - // dashboard contents panels: DashboardPanelMap; /** @@ -152,7 +145,7 @@ export type DashboardApi = CanExpandPanels & fullScreenMode$: PublishingSubject<boolean>; focusedPanelId$: PublishingSubject<string | undefined>; forceRefresh: () => void; - getSettings: () => DashboardStateFromSettingsFlyout; + getSettings: () => DashboardSettings; getDashboardPanelFromId: (id: string) => DashboardPanelState; hasOverlays$: PublishingSubject<boolean>; hasUnsavedChanges$: PublishingSubject<boolean>; @@ -173,7 +166,7 @@ export type DashboardApi = CanExpandPanels & setPanels: (panels: DashboardPanelMap) => void; setQuery: (query?: Query | undefined) => void; setScrollToPanelId: (id: string | undefined) => void; - setSettings: (settings: DashboardStateFromSettingsFlyout) => void; + setSettings: (settings: DashboardSettings) => void; setTags: (tags: string[]) => void; setTimeRange: (timeRange?: TimeRange | undefined) => void; unifiedSearchFilters$: PublishesUnifiedSearch['filters$']; diff --git a/src/plugins/dashboard/public/dashboard_api/unified_search_manager.ts b/src/plugins/dashboard/public/dashboard_api/unified_search_manager.ts index 1310f0104a5ea..9d39961778a91 100644 --- a/src/plugins/dashboard/public/dashboard_api/unified_search_manager.ts +++ b/src/plugins/dashboard/public/dashboard_api/unified_search_manager.ts @@ -48,6 +48,7 @@ import { DEFAULT_DASHBOARD_INPUT, GLOBAL_STATE_STORAGE_KEY } from '../dashboard_ export function initializeUnifiedSearchManager( initialState: DashboardState, controlGroupApi$: PublishingSubject<ControlGroupApi | undefined>, + timeRestore$: PublishingSubject<boolean | undefined>, waitForPanelsToLoad$: Observable<void>, getLastSavedState: () => DashboardState | undefined, creationOptions?: DashboardCreationOptions @@ -97,12 +98,6 @@ export function initializeUnifiedSearchManager( timefilterService.setTime(timeRangeOrDefault); } } - const timeRestore$ = new BehaviorSubject<boolean | undefined>( - initialState?.timeRestore ?? DEFAULT_DASHBOARD_INPUT.timeRestore - ); - function setTimeRestore(timeRestore: boolean) { - if (timeRestore !== timeRestore$.value) timeRestore$.next(timeRestore); - } const timeslice$ = new BehaviorSubject<[number, number] | undefined>(undefined); const unifiedSearchFilters$ = new BehaviorSubject<Filter[] | undefined>(initialState.filters); // setAndSyncUnifiedSearchFilters method not needed since filters synced with 2-way data binding @@ -312,9 +307,8 @@ export function initializeUnifiedSearchManager( return true; }, ], - timeRestore: [timeRestore$, setTimeRestore], } as StateComparators< - Pick<DashboardState, 'filters' | 'query' | 'refreshInterval' | 'timeRange' | 'timeRestore'> + Pick<DashboardState, 'filters' | 'query' | 'refreshInterval' | 'timeRange'> >, internalApi: { controlGroupReload$, @@ -325,7 +319,6 @@ export function initializeUnifiedSearchManager( ...lastSavedState.filters, ]); setQuery(lastSavedState.query); - setTimeRestore(lastSavedState.timeRestore); if (lastSavedState.timeRestore) { setAndSyncRefreshInterval(lastSavedState.refreshInterval); setAndSyncTimeRange(lastSavedState.timeRange); @@ -341,8 +334,6 @@ export function initializeUnifiedSearchManager( timeRange: timeRange$.value, timeRestore: timeRestore$.value ?? DEFAULT_DASHBOARD_INPUT.timeRestore, }), - setTimeRestore, - timeRestore$, }, cleanup: () => { controlGroupSubscriptions.unsubscribe(); diff --git a/src/plugins/dashboard/public/dashboard_app/dashboard_app.tsx b/src/plugins/dashboard/public/dashboard_app/dashboard_app.tsx index 06f56669630eb..39616653eea25 100644 --- a/src/plugins/dashboard/public/dashboard_app/dashboard_app.tsx +++ b/src/plugins/dashboard/public/dashboard_app/dashboard_app.tsx @@ -14,10 +14,10 @@ import { debounceTime } from 'rxjs'; import { v4 as uuidv4 } from 'uuid'; import { DASHBOARD_APP_LOCATOR } from '@kbn/deeplinks-analytics'; -import { ViewMode } from '@kbn/embeddable-plugin/public'; import { useExecutionContext } from '@kbn/kibana-react-plugin/public'; import { createKbnUrlStateStorage, withNotifyOnErrors } from '@kbn/kibana-utils-plugin/public'; +import { ViewMode } from '@kbn/presentation-publishing'; import { DashboardApi, DashboardCreationOptions, DashboardRenderer } from '..'; import { SharedDashboardState } from '../../common'; import { @@ -154,7 +154,7 @@ export function DashboardApp({ // if print mode is active, force viewMode.PRINT ...(screenshotModeService.isScreenshotMode() && screenshotModeService.getScreenshotContext('layout') === 'print' - ? { viewMode: ViewMode.PRINT } + ? { viewMode: 'print' as ViewMode } : {}), }; }; diff --git a/src/plugins/dashboard/public/dashboard_app/dashboard_router.tsx b/src/plugins/dashboard/public/dashboard_app/dashboard_router.tsx index f994d9aa20c8e..6b59bf03a4bcd 100644 --- a/src/plugins/dashboard/public/dashboard_app/dashboard_router.tsx +++ b/src/plugins/dashboard/public/dashboard_app/dashboard_router.tsx @@ -10,7 +10,6 @@ import './_dashboard_app.scss'; import { AppMountParameters, CoreStart } from '@kbn/core/public'; -import { ViewMode } from '@kbn/embeddable-plugin/public'; import { createKbnUrlStateStorage, withNotifyOnErrors } from '@kbn/kibana-utils-plugin/public'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; import { Route, Routes } from '@kbn/shared-ux-router'; @@ -72,7 +71,7 @@ export async function mountApp({ if (redirectTo.destination === 'dashboard') { path = redirectTo.id ? createDashboardEditUrl(redirectTo.id) : CREATE_NEW_DASHBOARD_URL; if (redirectTo.editMode) { - state = { viewMode: ViewMode.EDIT }; + state = { viewMode: 'edit' }; } } else { path = createDashboardListingFilterUrl(redirectTo.filter); diff --git a/src/plugins/dashboard/public/dashboard_app/listing_page/dashboard_listing_page.tsx b/src/plugins/dashboard/public/dashboard_app/listing_page/dashboard_listing_page.tsx index 59b3b3926060a..55f8bcabdfea6 100644 --- a/src/plugins/dashboard/public/dashboard_app/listing_page/dashboard_listing_page.tsx +++ b/src/plugins/dashboard/public/dashboard_app/listing_page/dashboard_listing_page.tsx @@ -10,7 +10,6 @@ import React, { useEffect, useState } from 'react'; import { syncGlobalQueryStateWithUrl } from '@kbn/data-plugin/public'; -import { ViewMode } from '@kbn/embeddable-plugin/public'; import type { IKbnUrlStateStorage } from '@kbn/kibana-utils-plugin/public'; import { DashboardRedirect } from '../../dashboard_container/types'; @@ -108,7 +107,7 @@ export const DashboardListingPage = ({ useSessionStorageIntegration={true} initialFilter={initialFilter ?? titleFilter} goToDashboard={(id, viewMode) => { - redirectTo({ destination: 'dashboard', id, editMode: viewMode === ViewMode.EDIT }); + redirectTo({ destination: 'dashboard', id, editMode: viewMode === 'edit' }); }} getDashboardUrl={(id, timeRestore) => { return getDashboardListItemLink(kbnUrlStateStorage, id, timeRestore); diff --git a/src/plugins/dashboard/public/dashboard_app/top_nav/dashboard_editing_toolbar.tsx b/src/plugins/dashboard/public/dashboard_app/top_nav/dashboard_editing_toolbar.tsx index 6f9e0b5892a89..4e2aea60ad758 100644 --- a/src/plugins/dashboard/public/dashboard_app/top_nav/dashboard_editing_toolbar.tsx +++ b/src/plugins/dashboard/public/dashboard_app/top_nav/dashboard_editing_toolbar.tsx @@ -80,12 +80,6 @@ export function DashboardEditingToolbar({ isDisabled }: { isDisabled?: boolean } [dashboardApi] ); - /** - * embeddableFactory: Required, you can get the factory from embeddableStart.getEmbeddableFactory(<embeddable type, i.e. lens>) - * initialInput: Optional, use it in case you want to pass your own input to the factory - * dismissNotification: Optional, if not passed a toast will appear in the dashboard - */ - const controlGroupApi = useStateFromPublishingSubject(dashboardApi.controlGroupApi$); const extraButtons = [ <EditorMenu createNewVisType={createNewVisType} isDisabled={isDisabled} />, diff --git a/src/plugins/dashboard/public/dashboard_app/top_nav/share/show_share_modal.tsx b/src/plugins/dashboard/public/dashboard_app/top_nav/share/show_share_modal.tsx index 41a290844328a..d8b4c341cf678 100644 --- a/src/plugins/dashboard/public/dashboard_app/top_nav/share/show_share_modal.tsx +++ b/src/plugins/dashboard/public/dashboard_app/top_nav/share/show_share_modal.tsx @@ -15,7 +15,6 @@ import { EuiCallOut, EuiCheckboxGroup } from '@elastic/eui'; import type { Capabilities } from '@kbn/core/public'; import { QueryState } from '@kbn/data-plugin/common'; import { DASHBOARD_APP_LOCATOR } from '@kbn/deeplinks-analytics'; -import { ViewMode } from '@kbn/embeddable-plugin/public'; import { i18n } from '@kbn/i18n'; import { getStateFromKbnUrl, setStateToKbnUrl, unhashUrl } from '@kbn/kibana-utils-plugin/public'; @@ -177,7 +176,7 @@ export function ShowShareModal({ dashboardId: savedObjectId, preserveSavedFilters: true, refreshInterval: undefined, // We don't share refresh interval externally - viewMode: ViewMode.VIEW, // For share locators we always load the dashboard in view mode + viewMode: 'view', // For share locators we always load the dashboard in view mode useHash: false, timeRange: dataService.query.timefilter.timefilter.getTime(), ...unsavedStateForLocator, diff --git a/src/plugins/dashboard/public/dashboard_app/top_nav/use_dashboard_menu_items.tsx b/src/plugins/dashboard/public/dashboard_app/top_nav/use_dashboard_menu_items.tsx index 07e29db545e7f..6f3d9c1cf5654 100644 --- a/src/plugins/dashboard/public/dashboard_app/top_nav/use_dashboard_menu_items.tsx +++ b/src/plugins/dashboard/public/dashboard_app/top_nav/use_dashboard_menu_items.tsx @@ -9,7 +9,6 @@ import { Dispatch, SetStateAction, useCallback, useMemo, useState } from 'react'; -import { ViewMode } from '@kbn/embeddable-plugin/public'; import type { TopNavMenuData } from '@kbn/navigation-plugin/public'; import useMountedState from 'react-use/lib/useMountedState'; @@ -97,8 +96,8 @@ export const useDashboardMenuItems = ({ dashboardApi.clearOverlays(); const switchModes = switchToViewMode ? () => { - dashboardApi.setViewMode(ViewMode.VIEW); - getDashboardBackupService().storeViewMode(ViewMode.VIEW); + dashboardApi.setViewMode('view'); + getDashboardBackupService().storeViewMode('view'); } : undefined; if (!hasUnsavedChanges) { @@ -112,7 +111,7 @@ export const useDashboardMenuItems = ({ setIsResetting(false); switchModes?.(); } - }, viewMode as ViewMode); + }, viewMode); }, [dashboardApi, hasUnsavedChanges, viewMode, isMounted] ); @@ -146,8 +145,8 @@ export const useDashboardMenuItems = ({ testId: 'dashboardEditMode', className: 'eui-hideFor--s eui-hideFor--xs', // hide for small screens - editing doesn't work in mobile mode. run: () => { - getDashboardBackupService().storeViewMode(ViewMode.EDIT); - dashboardApi.setViewMode(ViewMode.EDIT); + getDashboardBackupService().storeViewMode('edit'); + dashboardApi.setViewMode('edit'); dashboardApi.clearOverlays(); }, disableButton: disableTopNav, @@ -171,13 +170,13 @@ export const useDashboardMenuItems = ({ testId: 'dashboardInteractiveSaveMenuItem', run: dashboardInteractiveSave, label: - viewMode === ViewMode.VIEW + viewMode === 'view' ? topNavStrings.viewModeInteractiveSave.label : Boolean(lastSavedId) ? topNavStrings.editModeInteractiveSave.label : topNavStrings.quickSave.label, description: - viewMode === ViewMode.VIEW + viewMode === 'view' ? topNavStrings.viewModeInteractiveSave.description : topNavStrings.editModeInteractiveSave.description, } as TopNavMenuData, @@ -232,7 +231,7 @@ export const useDashboardMenuItems = ({ isResetting || !hasUnsavedChanges || hasOverlays || - (viewMode === ViewMode.EDIT && (isSaveInProgress || !lastSavedId)), + (viewMode === 'edit' && (isSaveInProgress || !lastSavedId)), isLoading: isResetting, run: () => resetChanges(), }; diff --git a/src/plugins/dashboard/public/dashboard_app/url/search_sessions_integration.ts b/src/plugins/dashboard/public/dashboard_app/url/search_sessions_integration.ts index 37c9af6944f7a..9992ac661614e 100644 --- a/src/plugins/dashboard/public/dashboard_app/url/search_sessions_integration.ts +++ b/src/plugins/dashboard/public/dashboard_app/url/search_sessions_integration.ts @@ -18,7 +18,6 @@ import { import { replaceUrlHashQuery } from '@kbn/kibana-utils-plugin/common'; import type { Query } from '@kbn/es-query'; import { SearchSessionInfoProvider } from '@kbn/data-plugin/public'; -import type { ViewMode } from '@kbn/embeddable-plugin/common'; import { DASHBOARD_APP_LOCATOR } from '@kbn/deeplinks-analytics'; import { SEARCH_SESSION_ID } from '../../dashboard_constants'; import { DashboardLocatorParams } from '../../dashboard_container'; @@ -73,7 +72,7 @@ function getLocatorParams({ }): DashboardLocatorParams { const savedObjectId = dashboardApi.savedObjectId.value; return { - viewMode: (dashboardApi.viewMode.value as ViewMode) ?? 'view', + viewMode: dashboardApi.viewMode.value ?? 'view', useHash: false, preserveSavedFilters: false, filters: dataService.query.filterManager.getFilters(), diff --git a/src/plugins/dashboard/public/dashboard_constants.ts b/src/plugins/dashboard/public/dashboard_constants.ts index da8c56bd70ee8..190b6653341a1 100644 --- a/src/plugins/dashboard/public/dashboard_constants.ts +++ b/src/plugins/dashboard/public/dashboard_constants.ts @@ -7,7 +7,6 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { ViewMode } from '@kbn/embeddable-plugin/common'; import type { DashboardContainerInput } from '../common'; // ------------------------------------------------------------------ @@ -85,7 +84,7 @@ export const DASHBOARD_CACHE_TTL = 1000 * 60 * 5; // time to live = 5 minutes // Default State // ------------------------------------------------------------------ export const DEFAULT_DASHBOARD_INPUT: Omit<DashboardContainerInput, 'id'> = { - viewMode: ViewMode.VIEW, + viewMode: 'view', timeRestore: false, query: { query: '', language: 'kuery' }, description: '', diff --git a/src/plugins/dashboard/public/dashboard_container/component/empty_screen/dashboard_empty_screen.tsx b/src/plugins/dashboard/public/dashboard_container/component/empty_screen/dashboard_empty_screen.tsx index b7a4facde1c1e..73d225dca3b40 100644 --- a/src/plugins/dashboard/public/dashboard_container/component/empty_screen/dashboard_empty_screen.tsx +++ b/src/plugins/dashboard/public/dashboard_container/component/empty_screen/dashboard_empty_screen.tsx @@ -20,7 +20,6 @@ import { EuiText, } from '@elastic/eui'; import { METRIC_TYPE } from '@kbn/analytics'; -import { ViewMode } from '@kbn/embeddable-plugin/public'; import { useStateFromPublishingSubject } from '@kbn/presentation-publishing'; import { useDashboardApi } from '../../../dashboard_api/use_dashboard_api'; @@ -131,7 +130,7 @@ export function DashboardEmptyScreen() { } if (showWriteControls) { return ( - <EuiButton iconType="pencil" onClick={() => dashboardApi.setViewMode(ViewMode.EDIT)}> + <EuiButton iconType="pencil" onClick={() => dashboardApi.setViewMode('edit')}> {emptyScreenStrings.getEditLinkTitle()} </EuiButton> ); diff --git a/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid.tsx b/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid.tsx index 1f5e48dd7a5df..e521a1bbd276c 100644 --- a/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid.tsx +++ b/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid.tsx @@ -15,8 +15,6 @@ import classNames from 'classnames'; import React, { useState, useMemo, useCallback, useEffect } from 'react'; import { Layout, Responsive as ResponsiveReactGridLayout } from 'react-grid-layout'; -import { ViewMode } from '@kbn/embeddable-plugin/public'; - import { useBatchedPublishingSubjects } from '@kbn/presentation-publishing'; import { useAppFixedViewport } from '@kbn/core-rendering-browser'; import { DashboardPanelState } from '../../../../common'; @@ -106,7 +104,7 @@ export const DashboardGrid = ({ const onLayoutChange = useCallback( (newLayout: Array<Layout & { i: string }>) => { - if (viewMode !== ViewMode.EDIT) return; + if (viewMode !== 'edit') return; const updatedPanels: { [key: string]: DashboardPanelState } = newLayout.reduce( (updatedPanelsAcc, panelLayout) => { @@ -127,8 +125,8 @@ export const DashboardGrid = ({ const classes = classNames({ 'dshLayout-withoutMargins': !useMargins, - 'dshLayout--viewing': viewMode === ViewMode.VIEW, - 'dshLayout--editing': viewMode !== ViewMode.VIEW, + 'dshLayout--viewing': viewMode === 'view', + 'dshLayout--editing': viewMode !== 'view', 'dshLayout--noAnimation': !animatePanelTransforms || delayedIsPanelExpanded, 'dshLayout-isMaximizedPanel': expandedPanelId !== undefined, }); @@ -136,7 +134,7 @@ export const DashboardGrid = ({ const { layouts, breakpoints, columns } = useDashboardGridSettings(panelsInOrder, panels); // in print mode, dashboard layout is not controlled by React Grid Layout - if (viewMode === ViewMode.PRINT) { + if (viewMode === 'print') { return <>{panelComponents}</>; } diff --git a/src/plugins/dashboard/public/dashboard_container/component/grid/use_dashboard_grid_settings.tsx b/src/plugins/dashboard/public/dashboard_container/component/grid/use_dashboard_grid_settings.tsx index 155d7022141db..50481d1a82f72 100644 --- a/src/plugins/dashboard/public/dashboard_container/component/grid/use_dashboard_grid_settings.tsx +++ b/src/plugins/dashboard/public/dashboard_container/component/grid/use_dashboard_grid_settings.tsx @@ -10,7 +10,6 @@ import { useMemo } from 'react'; import { useEuiTheme } from '@elastic/eui'; -import { ViewMode } from '@kbn/embeddable-plugin/public'; import { useStateFromPublishingSubject } from '@kbn/presentation-publishing'; import { DashboardPanelMap } from '../../../../common'; @@ -30,14 +29,14 @@ export const useDashboardGridSettings = (panelsInOrder: string[], panels: Dashbo }, [panels, panelsInOrder]); const breakpoints = useMemo( - () => ({ lg: euiTheme.breakpoint.m, ...(viewMode === ViewMode.VIEW ? { sm: 0 } : {}) }), + () => ({ lg: euiTheme.breakpoint.m, ...(viewMode === 'view' ? { sm: 0 } : {}) }), [viewMode, euiTheme.breakpoint.m] ); const columns = useMemo( () => ({ lg: DASHBOARD_GRID_COLUMN_COUNT, - ...(viewMode === ViewMode.VIEW ? { sm: 1 } : {}), + ...(viewMode === 'view' ? { sm: 1 } : {}), }), [viewMode] ); diff --git a/src/plugins/dashboard/public/dashboard_container/component/settings/index.ts b/src/plugins/dashboard/public/dashboard_container/component/settings/index.ts index 758ea4bf2fd70..970e67e6b8289 100644 --- a/src/plugins/dashboard/public/dashboard_container/component/settings/index.ts +++ b/src/plugins/dashboard/public/dashboard_container/component/settings/index.ts @@ -7,4 +7,4 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -export { DashboardSettings } from './settings_flyout'; +export { DashboardSettingsFlyout } from './settings_flyout'; diff --git a/src/plugins/dashboard/public/dashboard_container/component/settings/settings_flyout.tsx b/src/plugins/dashboard/public/dashboard_container/component/settings/settings_flyout.tsx index 20fd2b93119de..e0de277fc3c06 100644 --- a/src/plugins/dashboard/public/dashboard_container/component/settings/settings_flyout.tsx +++ b/src/plugins/dashboard/public/dashboard_container/component/settings/settings_flyout.tsx @@ -31,7 +31,7 @@ import { import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { DashboardContainerInput } from '../../../../common'; +import { DashboardSettings } from '../../../dashboard_api/types'; import { useDashboardApi } from '../../../dashboard_api/use_dashboard_api'; import { getDashboardContentManagementService } from '../../../services/dashboard_content_management_service'; import { savedObjectsTaggingService } from '../../../services/kibana_services'; @@ -42,7 +42,7 @@ interface DashboardSettingsProps { const DUPLICATE_TITLE_CALLOUT_ID = 'duplicateTitleCallout'; -export const DashboardSettings = ({ onClose }: DashboardSettingsProps) => { +export const DashboardSettingsFlyout = ({ onClose }: DashboardSettingsProps) => { const dashboardApi = useDashboardApi(); const [localSettings, setLocalSettings] = useState(dashboardApi.getSettings()); @@ -81,7 +81,7 @@ export const DashboardSettings = ({ onClose }: DashboardSettingsProps) => { } }; - const updateDashboardSetting = useCallback((newSettings: Partial<DashboardContainerInput>) => { + const updateDashboardSetting = useCallback((newSettings: Partial<DashboardSettings>) => { setLocalSettings((prevSettings) => { return { ...prevSettings, diff --git a/src/plugins/dashboard/public/dashboard_container/component/viewport/dashboard_viewport.tsx b/src/plugins/dashboard/public/dashboard_container/component/viewport/dashboard_viewport.tsx index 32f1f830ba938..0252341b5f4b9 100644 --- a/src/plugins/dashboard/public/dashboard_container/component/viewport/dashboard_viewport.tsx +++ b/src/plugins/dashboard/public/dashboard_container/component/viewport/dashboard_viewport.tsx @@ -13,7 +13,7 @@ import useResizeObserver from 'use-resize-observer/polyfilled'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { EuiPortal } from '@elastic/eui'; -import { ReactEmbeddableRenderer, ViewMode } from '@kbn/embeddable-plugin/public'; +import { ReactEmbeddableRenderer } from '@kbn/embeddable-plugin/public'; import { ExitFullScreenButton } from '@kbn/shared-ux-button-exit-full-screen'; import { @@ -119,7 +119,7 @@ export const DashboardViewport = ({ dashboardContainer }: { dashboardContainer?: 'dshDashboardViewportWrapper--isFullscreen': fullScreenMode, })} > - {viewMode !== ViewMode.PRINT ? ( + {viewMode !== 'print' ? ( <div className={hasControls ? 'dshDashboardViewport-controls' : ''}> <ReactEmbeddableRenderer< ControlGroupSerializedState, diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/api/open_settings_flyout.tsx b/src/plugins/dashboard/public/dashboard_container/embeddable/api/open_settings_flyout.tsx index 0f78bcc96a975..582d19af620f9 100644 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/api/open_settings_flyout.tsx +++ b/src/plugins/dashboard/public/dashboard_container/embeddable/api/open_settings_flyout.tsx @@ -14,14 +14,14 @@ import { toMountPoint } from '@kbn/react-kibana-mount'; import { DashboardApi } from '../../../dashboard_api/types'; import { DashboardContext } from '../../../dashboard_api/use_dashboard_api'; import { coreServices } from '../../../services/kibana_services'; -import { DashboardSettings } from '../../component/settings/settings_flyout'; +import { DashboardSettingsFlyout } from '../../component/settings/settings_flyout'; export function openSettingsFlyout(dashboardApi: DashboardApi) { dashboardApi.openOverlay( coreServices.overlays.openFlyout( toMountPoint( <DashboardContext.Provider value={dashboardApi}> - <DashboardSettings + <DashboardSettingsFlyout onClose={() => { dashboardApi.clearOverlays(); }} diff --git a/src/plugins/dashboard/public/dashboard_container/types.ts b/src/plugins/dashboard/public/dashboard_container/types.ts index eac2a782f11c2..2eff03bf10913 100644 --- a/src/plugins/dashboard/public/dashboard_container/types.ts +++ b/src/plugins/dashboard/public/dashboard_container/types.ts @@ -7,12 +7,11 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import type { ContainerOutput } from '@kbn/embeddable-plugin/public'; import { SerializableRecord } from '@kbn/utility-types'; import { ControlGroupRuntimeState } from '@kbn/controls-plugin/public'; import type { DashboardContainerInput } from '../../common'; -import type { DashboardOptions, DashboardPanel } from '../../server/content_management'; +import type { DashboardPanel } from '../../server/content_management'; export interface UnsavedPanelState { [key: string]: object | undefined; @@ -23,13 +22,6 @@ export type RedirectToProps = | { destination: 'dashboard'; id?: string; useReplace?: boolean; editMode?: boolean } | { destination: 'listing'; filter?: string; useReplace?: boolean }; -export type DashboardStateFromSaveModal = Pick< - DashboardContainerInput, - 'title' | 'description' | 'tags' | 'timeRestore' ->; - -export type DashboardStateFromSettingsFlyout = DashboardStateFromSaveModal & DashboardOptions; - export type DashboardLoadType = | 'sessionFirstLoad' | 'dashboardFirstLoad' @@ -41,12 +33,6 @@ export interface DashboardRenderPerformanceStats { panelsRenderStartTime: number; } -export type DashboardContainerInputWithoutId = Omit<DashboardContainerInput, 'id'>; - -export interface DashboardContainerOutput extends ContainerOutput { - usedDataViewIds?: string[]; -} - export type DashboardLoadedEventStatus = 'done' | 'error'; export interface DashboardLoadedEventMeta { diff --git a/src/plugins/dashboard/public/dashboard_listing/_dashboard_listing_strings.ts b/src/plugins/dashboard/public/dashboard_listing/_dashboard_listing_strings.ts index fcb50542182e3..12a7c2d842c44 100644 --- a/src/plugins/dashboard/public/dashboard_listing/_dashboard_listing_strings.ts +++ b/src/plugins/dashboard/public/dashboard_listing/_dashboard_listing_strings.ts @@ -7,8 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { ViewMode } from '@kbn/embeddable-plugin/public'; import { i18n } from '@kbn/i18n'; +import { ViewMode } from '@kbn/presentation-publishing'; export const dashboardListingErrorStrings = { getErrorDeletingDashboardToast: () => @@ -116,7 +116,7 @@ export const resetConfirmStrings = { defaultMessage: 'Reset dashboard?', }), getResetSubtitle: (viewMode: ViewMode) => - viewMode === ViewMode.EDIT + viewMode === 'edit' ? i18n.translate('dashboard.discardChangesConfirmModal.discardChangesDescription', { defaultMessage: `All unsaved changes will be lost.`, }) diff --git a/src/plugins/dashboard/public/dashboard_listing/confirm_overlays.tsx b/src/plugins/dashboard/public/dashboard_listing/confirm_overlays.tsx index a2adea2470abb..d6e3728df023d 100644 --- a/src/plugins/dashboard/public/dashboard_listing/confirm_overlays.tsx +++ b/src/plugins/dashboard/public/dashboard_listing/confirm_overlays.tsx @@ -21,9 +21,9 @@ import { EuiOutsideClickDetector, EuiText, } from '@elastic/eui'; -import { ViewMode } from '@kbn/embeddable-plugin/public'; import { toMountPoint } from '@kbn/react-kibana-mount'; +import { ViewMode } from '@kbn/presentation-publishing'; import { coreServices } from '../services/kibana_services'; import { createConfirmStrings, resetConfirmStrings } from './_dashboard_listing_strings'; @@ -31,12 +31,12 @@ export type DiscardOrKeepSelection = 'cancel' | 'discard' | 'keep'; export const confirmDiscardUnsavedChanges = ( discardCallback: () => void, - viewMode: ViewMode = ViewMode.EDIT // we want to show the danger modal on the listing page + viewMode: ViewMode = 'edit' // we want to show the danger modal on the listing page ) => { coreServices.overlays .openConfirm(resetConfirmStrings.getResetSubtitle(viewMode), { confirmButtonText: resetConfirmStrings.getResetConfirmButtonText(), - buttonColor: viewMode === ViewMode.EDIT ? 'danger' : 'primary', + buttonColor: viewMode === 'edit' ? 'danger' : 'primary', maxWidth: 500, defaultFocusedButton: EUI_MODAL_CANCEL_BUTTON, title: resetConfirmStrings.getResetTitle(), diff --git a/src/plugins/dashboard/public/dashboard_listing/dashboard_unsaved_listing.test.tsx b/src/plugins/dashboard/public/dashboard_listing/dashboard_unsaved_listing.test.tsx index 74b538d87c207..5cadd610ea2af 100644 --- a/src/plugins/dashboard/public/dashboard_listing/dashboard_unsaved_listing.test.tsx +++ b/src/plugins/dashboard/public/dashboard_listing/dashboard_unsaved_listing.test.tsx @@ -11,7 +11,6 @@ import { ComponentType, mount } from 'enzyme'; import React from 'react'; import { findTestSubject } from '@elastic/eui/lib/test'; -import { ViewMode } from '@kbn/embeddable-plugin/public'; import { I18nProvider } from '@kbn/i18n-react'; import { waitFor } from '@testing-library/react'; @@ -72,7 +71,7 @@ describe('Unsaved listing', () => { expect(getEditButton().length).toEqual(1); }); getEditButton().simulate('click'); - expect(props.goToDashboard).toHaveBeenCalledWith('dashboardUnsavedOne', ViewMode.EDIT); + expect(props.goToDashboard).toHaveBeenCalledWith('dashboardUnsavedOne', 'edit'); }); it('Redirects to new dashboard when continue editing clicked', async () => { @@ -85,7 +84,7 @@ describe('Unsaved listing', () => { expect(getEditButton().length).toBe(1); }); getEditButton().simulate('click'); - expect(props.goToDashboard).toHaveBeenCalledWith(undefined, ViewMode.EDIT); + expect(props.goToDashboard).toHaveBeenCalledWith(undefined, 'edit'); }); it('Shows a warning then clears changes when delete unsaved changes is pressed', async () => { diff --git a/src/plugins/dashboard/public/dashboard_listing/dashboard_unsaved_listing.tsx b/src/plugins/dashboard/public/dashboard_listing/dashboard_unsaved_listing.tsx index 04f40a199e83b..1ab1aecfce916 100644 --- a/src/plugins/dashboard/public/dashboard_listing/dashboard_unsaved_listing.tsx +++ b/src/plugins/dashboard/public/dashboard_listing/dashboard_unsaved_listing.tsx @@ -18,8 +18,7 @@ import { } from '@elastic/eui'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; -import { ViewMode } from '@kbn/embeddable-plugin/public'; - +import { ViewMode } from '@kbn/presentation-publishing'; import type { DashboardAttributes } from '../../server/content_management'; import { DASHBOARD_PANELS_UNSAVED_ID, @@ -124,7 +123,7 @@ export const DashboardUnsavedListing = ({ const onOpen = useCallback( (id?: string) => { - goToDashboard(id, ViewMode.EDIT); + goToDashboard(id, 'edit'); }, [goToDashboard] ); diff --git a/src/plugins/dashboard/public/dashboard_listing/hooks/use_dashboard_listing_table.tsx b/src/plugins/dashboard/public/dashboard_listing/hooks/use_dashboard_listing_table.tsx index e434fe19d7b26..23d29898e49c2 100644 --- a/src/plugins/dashboard/public/dashboard_listing/hooks/use_dashboard_listing_table.tsx +++ b/src/plugins/dashboard/public/dashboard_listing/hooks/use_dashboard_listing_table.tsx @@ -14,9 +14,8 @@ import { ContentInsightsClient } from '@kbn/content-management-content-insights- import { TableListViewTableProps } from '@kbn/content-management-table-list-view-table'; import type { SavedObjectsFindOptionsReference } from '@kbn/core/public'; import { reportPerformanceMetricEvent } from '@kbn/ebt-tools'; -import { ViewMode } from '@kbn/embeddable-plugin/public'; +import { ViewMode } from '@kbn/presentation-publishing'; -import { DashboardContainerInput } from '../../../common'; import type { DashboardSearchOut } from '../../../server/content_management'; import { DASHBOARD_CONTENT_ID, @@ -35,6 +34,7 @@ import { import { confirmCreateWithUnsaved } from '../confirm_overlays'; import { DashboardListingEmptyPrompt } from '../dashboard_listing_empty_prompt'; import { DashboardSavedObjectUserContent } from '../types'; +import { UpdateDashboardMetaProps } from '../../services/dashboard_content_management_service/lib/update_dashboard_meta'; type GetDetailViewLink = TableListViewTableProps<DashboardSavedObjectUserContent>['getDetailViewLink']; @@ -130,7 +130,7 @@ export const useDashboardListingTable = ({ }, [dashboardBackupService, goToDashboard, useSessionStorageIntegration]); const updateItemMeta = useCallback( - async (props: Pick<DashboardContainerInput, 'id' | 'title' | 'description' | 'tags'>) => { + async (props: UpdateDashboardMetaProps) => { await dashboardContentManagementService.updateDashboardMeta(props); setUnsavedDashboardIds(dashboardBackupService.getDashboardIdsWithUnsavedChanges()); @@ -270,7 +270,7 @@ export const useDashboardListingTable = ({ ); const editItem = useCallback( - ({ id }: { id: string | undefined }) => goToDashboard(id, ViewMode.EDIT), + ({ id }: { id: string | undefined }) => goToDashboard(id, 'edit'), [goToDashboard] ); diff --git a/src/plugins/dashboard/public/dashboard_listing/types.ts b/src/plugins/dashboard/public/dashboard_listing/types.ts index 0f5e245366242..84a47012b04ce 100644 --- a/src/plugins/dashboard/public/dashboard_listing/types.ts +++ b/src/plugins/dashboard/public/dashboard_listing/types.ts @@ -9,7 +9,7 @@ import type { PropsWithChildren } from 'react'; import type { UserContentCommonSchema } from '@kbn/content-management-table-list-view-common'; -import type { ViewMode } from '@kbn/embeddable-plugin/public'; +import { ViewMode } from '@kbn/presentation-publishing'; export type DashboardListingProps = PropsWithChildren<{ disableCreateDashboardButton?: boolean; diff --git a/src/plugins/dashboard/public/mocks.tsx b/src/plugins/dashboard/public/mocks.tsx index 1a275d805e5ed..334bf9ee05208 100644 --- a/src/plugins/dashboard/public/mocks.tsx +++ b/src/plugins/dashboard/public/mocks.tsx @@ -9,7 +9,6 @@ import { ControlGroupApi } from '@kbn/controls-plugin/public'; import { BehaviorSubject } from 'rxjs'; -import { ViewMode } from '@kbn/embeddable-plugin/public'; import { DashboardStart } from './plugin'; import { DashboardState } from './dashboard_api/types'; import { getDashboardApi } from './dashboard_api/get_dashboard_api'; @@ -97,7 +96,6 @@ export function buildMockDashboardApi({ dashboardInput: { ...initialState, executionContext: { type: 'dashboard' }, - viewMode: initialState.viewMode as ViewMode, id: savedObjectId ?? '123', } as SavedDashboardInput, references: [], diff --git a/src/plugins/dashboard/public/plugin.tsx b/src/plugins/dashboard/public/plugin.tsx index a8e7cd96f38db..c8b2244d6865b 100644 --- a/src/plugins/dashboard/public/plugin.tsx +++ b/src/plugins/dashboard/public/plugin.tsx @@ -298,7 +298,7 @@ export class DashboardPlugin defaultMessage: 'Analyze data in dashboards.', }), description: i18n.translate('dashboard.featureCatalogue.dashboardDescription', { - defaultMessage: 'Display and share a collection of visualizations and saved searches.', + defaultMessage: 'Display and share a collection of visualizations and search results.', }), icon: 'dashboardApp', path: `/app/${DASHBOARD_APP_ID}#${LANDING_PAGE_PATH}`, diff --git a/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/load_dashboard_state.ts b/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/load_dashboard_state.ts index 9773291b2ca5c..f0fe47b54ba90 100644 --- a/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/load_dashboard_state.ts +++ b/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/load_dashboard_state.ts @@ -11,7 +11,6 @@ import { has } from 'lodash'; import { v4 as uuidv4 } from 'uuid'; import { injectSearchSourceReferences } from '@kbn/data-plugin/public'; -import { ViewMode } from '@kbn/embeddable-plugin/public'; import { Filter, Query } from '@kbn/es-query'; import { SavedObjectNotFound } from '@kbn/kibana-utils-plugin/public'; @@ -188,7 +187,7 @@ export const loadDashboardState = async ({ query, title, - viewMode: ViewMode.VIEW, // dashboards loaded from saved object default to view mode. If it was edited recently, the view mode from session storage will override this. + viewMode: 'view', // dashboards loaded from saved object default to view mode. If it was edited recently, the view mode from session storage will override this. tags: savedObjectsTaggingService?.getTaggingApi()?.ui.getTagIdsFromReferences(references) ?? [], diff --git a/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/update_dashboard_meta.ts b/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/update_dashboard_meta.ts index 90f31cfdc05c6..60f61b64caeec 100644 --- a/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/update_dashboard_meta.ts +++ b/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/update_dashboard_meta.ts @@ -7,16 +7,21 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { DashboardContainerInput } from '../../../../common'; import { DASHBOARD_CONTENT_ID } from '../../../dashboard_constants'; -import type { DashboardUpdateIn, DashboardUpdateOut } from '../../../../server/content_management'; +import type { + DashboardAttributes, + DashboardUpdateIn, + DashboardUpdateOut, +} from '../../../../server/content_management'; import { findDashboardsByIds } from './find_dashboards'; import { contentManagementService, savedObjectsTaggingService } from '../../kibana_services'; -type UpdateDashboardMetaProps = Pick< - DashboardContainerInput, - 'id' | 'title' | 'description' | 'tags' ->; +export interface UpdateDashboardMetaProps { + id: DashboardUpdateIn['id']; + title: DashboardAttributes['title']; + description?: DashboardAttributes['description']; + tags: string[]; +} export const updateDashboardMeta = async ({ id, diff --git a/src/plugins/dashboard/public/services/dashboard_content_management_service/types.ts b/src/plugins/dashboard/public/services/dashboard_content_management_service/types.ts index 1922ed3e30dac..3c0c37afc0cd6 100644 --- a/src/plugins/dashboard/public/services/dashboard_content_management_service/types.ts +++ b/src/plugins/dashboard/public/services/dashboard_content_management_service/types.ts @@ -21,6 +21,7 @@ import { SearchDashboardsResponse, } from './lib/find_dashboards'; import { DashboardState } from '../../dashboard_api/types'; +import { UpdateDashboardMetaProps } from './lib/update_dashboard_meta'; export interface DashboardContentManagementService { findDashboards: FindDashboardsService; @@ -28,9 +29,7 @@ export interface DashboardContentManagementService { loadDashboardState: (props: { id?: string }) => Promise<LoadDashboardReturn>; saveDashboardState: (props: SaveDashboardProps) => Promise<SaveDashboardReturn>; checkForDuplicateDashboardTitle: (meta: DashboardDuplicateTitleCheckProps) => Promise<boolean>; - updateDashboardMeta: ( - props: Pick<DashboardContainerInput, 'id' | 'title' | 'description' | 'tags'> - ) => Promise<void>; + updateDashboardMeta: (props: UpdateDashboardMetaProps) => Promise<void>; } /** diff --git a/src/plugins/data/server/search/search_service.ts b/src/plugins/data/server/search/search_service.ts index 156336e47492d..f4d17f4f640e5 100644 --- a/src/plugins/data/server/search/search_service.ts +++ b/src/plugins/data/server/search/search_service.ts @@ -189,7 +189,7 @@ export class SearchService implements Plugin<ISearchSetup, ISearchStart> { // We don't want to register this because we don't want the client to be able to access this // strategy, but we do want to expose it to other server-side plugins - // see x-pack/plugins/security_solution/server/search_strategy/timeline/index.ts + // see x-pack/solutions/security/plugins/security_solution/server/search_strategy/timeline/index.ts // for example use case this.searchAsInternalUser = enhancedEsSearchStrategyProvider( this.initializerContext.config.legacy.globalConfig$, diff --git a/src/plugins/data/server/ui_settings.ts b/src/plugins/data/server/ui_settings.ts index 8dc58c3ffd637..857de03d4dbd0 100644 --- a/src/plugins/data/server/ui_settings.ts +++ b/src/plugins/data/server/ui_settings.ts @@ -55,7 +55,7 @@ export function getUiSettings( value: true, description: i18n.translate('data.advancedSettings.docTableHighlightText', { defaultMessage: - 'Highlight results in Discover and Saved Searches Dashboard. ' + + 'Highlights search results in Discover and Discover session panels on dashboards. ' + 'Highlighting makes requests slow when working on big documents.', }), category: ['discover'], diff --git a/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/header/__snapshots__/header.test.tsx.snap b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/header/__snapshots__/header.test.tsx.snap index 83a272d88d15b..97486302553f5 100644 --- a/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/header/__snapshots__/header.test.tsx.snap +++ b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/header/__snapshots__/header.test.tsx.snap @@ -7,7 +7,7 @@ exports[`Header should render normally 1`] = ` > <p> <MemoizedFormattedMessage - defaultMessage="Field filters can be used to exclude one or more fields when fetching a document. This happens when viewing a document in the Discover app, or with a table displaying results from a saved search in the Dashboard app. If you have documents with large or unimportant fields you may benefit from filtering those out at this lower level." + defaultMessage="Field filters can be used to exclude one or more fields when fetching a document. This happens when viewing a document in the Discover app, or with a table displaying results from a Discover session in the Dashboard app. If you have documents with large or unimportant fields you may benefit from filtering those out at this lower level." id="indexPatternManagement.editIndexPattern.sourceLabel" /> </p> diff --git a/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/header/header.tsx b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/header/header.tsx index 3530493a7490a..86a77e6512af4 100644 --- a/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/header/header.tsx +++ b/src/plugins/data_view_management/public/components/edit_index_pattern/source_filters_table/components/header/header.tsx @@ -19,7 +19,7 @@ export const Header = () => ( <FormattedMessage id="indexPatternManagement.editIndexPattern.sourceLabel" defaultMessage="Field filters can be used to exclude one or more fields when fetching a document. This happens when - viewing a document in the Discover app, or with a table displaying results from a saved search in the Dashboard app. + viewing a document in the Discover app, or with a table displaying results from a Discover session in the Dashboard app. If you have documents with large or unimportant fields you may benefit from filtering those out at this lower level." /> </p> diff --git a/src/plugins/discover/README.md b/src/plugins/discover/README.md index 6240cd63f3ea3..6f3f17c97e7a0 100644 --- a/src/plugins/discover/README.md +++ b/src/plugins/discover/README.md @@ -16,7 +16,7 @@ One folder for every "route", each folder contains files and folders related onl * **[/not_found](./public/application/not_found)** (Rendered when a route can't be found) * **[/view_alert](./public/application/view_alert)** (Forwarding links in alert notifications) * **[/components](./public/components)** (All React components used in more than just one app) -* **[/embeddable](./public/embeddable)** (Code related to the saved search embeddable, rendered on dashboards) +* **[/embeddable](./public/embeddable)** (Code related to the Discover session embeddable, rendered on dashboards) * **[/hooks](./public/hooks)** (Code containing React hooks) * **[/services](./public/services)** (Services either for external or internal use) * **[/utils](./public/utils)** (All utility functions used across more than one application) diff --git a/src/plugins/discover/public/application/index.tsx b/src/plugins/discover/public/application/index.tsx index 426e388811723..99fc03170a9bb 100644 --- a/src/plugins/discover/public/application/index.tsx +++ b/src/plugins/discover/public/application/index.tsx @@ -37,7 +37,7 @@ export const renderApp = ({ defaultMessage: 'Read only', }), tooltip: i18n.translate('discover.badge.readOnly.tooltip', { - defaultMessage: 'Unable to save searches', + defaultMessage: 'Unable to save Discover sessions', }), iconType: 'glasses', }); diff --git a/src/plugins/discover/public/application/main/components/top_nav/__snapshots__/open_search_panel.test.tsx.snap b/src/plugins/discover/public/application/main/components/top_nav/__snapshots__/open_search_panel.test.tsx.snap index b1b399d1bd736..934e7068e78db 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/__snapshots__/open_search_panel.test.tsx.snap +++ b/src/plugins/discover/public/application/main/components/top_nav/__snapshots__/open_search_panel.test.tsx.snap @@ -14,7 +14,7 @@ exports[`OpenSearchPanel render 1`] = ` > <h2> <MemoizedFormattedMessage - defaultMessage="Open search" + defaultMessage="Open Discover session" id="discover.topNav.openSearchPanel.openSearchTitle" /> </h2> @@ -25,7 +25,7 @@ exports[`OpenSearchPanel render 1`] = ` id="discoverOpenSearch" noItemsMessage={ <Memo(MemoizedFormattedMessage) - defaultMessage="No matching searches found." + defaultMessage="No matching Discover sessions found." id="discover.topNav.openSearchPanel.noSearchesFoundDescription" /> } @@ -34,7 +34,7 @@ exports[`OpenSearchPanel render 1`] = ` Array [ Object { "getIconForSavedObject": [Function], - "name": "Saved search", + "name": "Discover session", "type": "search", }, ] @@ -59,11 +59,11 @@ exports[`OpenSearchPanel render 1`] = ` <EuiButton data-test-subj="manageSearchesBtn" fill={true} - href="/app/management/kibana/objects?initialQuery=type:(search)" + href="/app/management/kibana/objects?initialQuery=type:(\\"discover session\\")" onClick={[MockFunction]} > <MemoizedFormattedMessage - defaultMessage="Manage searches" + defaultMessage="Manage Discover sessions" id="discover.topNav.openSearchPanel.manageSearchesButtonLabel" /> </EuiButton> diff --git a/src/plugins/discover/public/application/main/components/top_nav/app_menu_actions/get_new_search.tsx b/src/plugins/discover/public/application/main/components/top_nav/app_menu_actions/get_new_search.tsx index b67f14f31c56a..a27b1f5753e20 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/app_menu_actions/get_new_search.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/app_menu_actions/get_new_search.tsx @@ -19,11 +19,8 @@ export const getNewSearchAppMenuItem = ({ id: AppMenuActionId.new, type: AppMenuActionType.primary, controlProps: { - label: i18n.translate('discover.localMenu.localMenu.newSearchTitle', { - defaultMessage: 'New', - }), - description: i18n.translate('discover.localMenu.newSearchDescription', { - defaultMessage: 'New Search', + label: i18n.translate('discover.localMenu.localMenu.newDiscoverSessionTitle', { + defaultMessage: 'New session', }), iconType: 'plus', testId: 'discoverNewButton', diff --git a/src/plugins/discover/public/application/main/components/top_nav/app_menu_actions/get_open_search.tsx b/src/plugins/discover/public/application/main/components/top_nav/app_menu_actions/get_open_search.tsx index e8f6c5448d602..0a3d75af893cc 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/app_menu_actions/get_open_search.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/app_menu_actions/get_open_search.tsx @@ -21,11 +21,8 @@ export const getOpenSearchAppMenuItem = ({ id: AppMenuActionId.open, type: AppMenuActionType.primary, controlProps: { - label: i18n.translate('discover.localMenu.openTitle', { - defaultMessage: 'Open', - }), - description: i18n.translate('discover.localMenu.openSavedSearchDescription', { - defaultMessage: 'Open Saved Search', + label: i18n.translate('discover.localMenu.openDiscoverSessionTitle', { + defaultMessage: 'Open session', }), iconType: 'folderOpen', testId: 'discoverOpenButton', diff --git a/src/plugins/discover/public/application/main/components/top_nav/app_menu_actions/get_share.tsx b/src/plugins/discover/public/application/main/components/top_nav/app_menu_actions/get_share.tsx index f1a030a40ea0a..87514e81a063e 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/app_menu_actions/get_share.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/app_menu_actions/get_share.tsx @@ -34,7 +34,7 @@ export const getShareAppMenuItem = ({ defaultMessage: 'Share', }), description: i18n.translate('discover.localMenu.shareSearchDescription', { - defaultMessage: 'Share Search', + defaultMessage: 'Share Discover session', }), iconType: 'share', testId: 'shareTopNavButton', @@ -108,7 +108,7 @@ export const getShareAppMenuItem = ({ objectType: 'search', objectTypeMeta: { title: i18n.translate('discover.share.shareModal.title', { - defaultMessage: 'Share this search', + defaultMessage: 'Share this Discover session', }), }, sharingData: { @@ -119,7 +119,7 @@ export const getShareAppMenuItem = ({ title: savedSearch.title || i18n.translate('discover.localMenu.fallbackReportTitle', { - defaultMessage: 'Untitled discover search', + defaultMessage: 'Untitled Discover session', }), }, isDirty: !savedSearch.id || stateContainer.appState.hasChanged(), diff --git a/src/plugins/discover/public/application/main/components/top_nav/esql_dataview_transition/esql_dataview_transition_modal.tsx b/src/plugins/discover/public/application/main/components/top_nav/esql_dataview_transition/esql_dataview_transition_modal.tsx index 342d8c4f1684b..d52d25064d306 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/esql_dataview_transition/esql_dataview_transition_modal.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/esql_dataview_transition/esql_dataview_transition_modal.tsx @@ -57,7 +57,7 @@ export default function ESQLToDataViewTransitionModal({ <EuiText size="m"> {i18n.translate('discover.esqlToDataviewTransitionModalBody', { defaultMessage: - 'Switching data views removes the current ES|QL query. Save this search to avoid losing work.', + 'Switching data views removes the current ES|QL query. Save this session to avoid losing work.', })} </EuiText> <EuiFlexGroup alignItems="center" justifyContent="flexEnd" gutterSize="xs"> diff --git a/src/plugins/discover/public/application/main/components/top_nav/get_top_nav_badges.tsx b/src/plugins/discover/public/application/main/components/top_nav/get_top_nav_badges.tsx index 13544f7f28dea..9d6a3c8a9912a 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/get_top_nav_badges.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/get_top_nav_badges.tsx @@ -71,7 +71,7 @@ export const getTopNavBadges = ({ getManagedContentBadge( i18n.translate('discover.topNav.managedContentLabel', { defaultMessage: - 'This saved search is managed by Elastic. Changes here must be saved to a new saved search.', + 'This Discover session is managed by Elastic. Changes here must be saved to a new Discover session.', }) ) ); diff --git a/src/plugins/discover/public/application/main/components/top_nav/on_save_search.tsx b/src/plugins/discover/public/application/main/components/top_nav/on_save_search.tsx index 63997c0d7b975..f1a2eff160db9 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/on_save_search.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/on_save_search.tsx @@ -35,7 +35,7 @@ async function saveDataSource({ if (id) { services.toastNotifications.addSuccess({ title: i18n.translate('discover.notifications.savedSearchTitle', { - defaultMessage: `Search ''{savedSearchTitle}'' was saved`, + defaultMessage: `Discover session ''{savedSearchTitle}'' was saved`, values: { savedSearchTitle: savedSearch.title, }, @@ -56,7 +56,7 @@ async function saveDataSource({ function onError(error: Error) { services.toastNotifications.addDanger({ title: i18n.translate('discover.notifications.notSavedSearchTitle', { - defaultMessage: `Search ''{savedSearchTitle}'' was not saved.`, + defaultMessage: `Discover session ''{savedSearchTitle}'' was not saved.`, values: { savedSearchTitle: savedSearch.title, }, @@ -266,7 +266,7 @@ const SaveSearchObjectModal: React.FC<{ label={ <FormattedMessage id="discover.topNav.saveModal.storeTimeWithSearchToggleLabel" - defaultMessage="Store time with saved search" + defaultMessage="Store time with Discover session" /> } /> @@ -289,7 +289,7 @@ const SaveSearchObjectModal: React.FC<{ initialCopyOnSave={initialCopyOnSave} description={description} objectType={i18n.translate('discover.localMenu.saveSaveSearchObjectType', { - defaultMessage: 'search', + defaultMessage: 'Discover session', })} showDescription={true} options={options} @@ -299,7 +299,7 @@ const SaveSearchObjectModal: React.FC<{ managed ? i18n.translate('discover.localMenu.mustCopyOnSave', { defaultMessage: - 'Elastic manages this saved search. Save any changes to a new saved search.', + 'Elastic manages this Discover session. Save any changes to a new Discover session.', }) : undefined } diff --git a/src/plugins/discover/public/application/main/components/top_nav/open_search_panel.tsx b/src/plugins/discover/public/application/main/components/top_nav/open_search_panel.tsx index 7633bea3612b0..bd4163a20d4d7 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/open_search_panel.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/open_search_panel.tsx @@ -20,11 +20,10 @@ import { EuiFlyoutBody, EuiTitle, } from '@elastic/eui'; +import { SavedSearchType, SavedSearchTypeDisplayName } from '@kbn/saved-search-plugin/common'; import { SavedObjectFinder } from '@kbn/saved-objects-finder-plugin/public'; import { useDiscoverServices } from '../../../../hooks/use_discover_services'; -const SEARCH_OBJECT_TYPE = 'search'; - interface OpenSearchPanelProps { onClose: () => void; onOpenSavedSearch: (id: string) => void; @@ -43,7 +42,7 @@ export function OpenSearchPanel(props: OpenSearchPanelProps) { <h2> <FormattedMessage id="discover.topNav.openSearchPanel.openSearchTitle" - defaultMessage="Open search" + defaultMessage="Open Discover session" /> </h2> </EuiTitle> @@ -59,15 +58,15 @@ export function OpenSearchPanel(props: OpenSearchPanelProps) { noItemsMessage={ <FormattedMessage id="discover.topNav.openSearchPanel.noSearchesFoundDescription" - defaultMessage="No matching searches found." + defaultMessage="No matching Discover sessions found." /> } savedObjectMetaData={[ { - type: SEARCH_OBJECT_TYPE, + type: SavedSearchType, getIconForSavedObject: () => 'discoverApp', name: i18n.translate('discover.savedSearch.savedObjectName', { - defaultMessage: 'Saved search', + defaultMessage: 'Discover session', }), }, ]} @@ -88,12 +87,12 @@ export function OpenSearchPanel(props: OpenSearchPanelProps) { onClick={props.onClose} data-test-subj="manageSearchesBtn" href={addBasePath( - `/app/management/kibana/objects?initialQuery=type:(${SEARCH_OBJECT_TYPE})` + `/app/management/kibana/objects?initialQuery=type:("${SavedSearchTypeDisplayName}")` )} > <FormattedMessage id="discover.topNav.openSearchPanel.manageSearchesButtonLabel" - defaultMessage="Manage searches" + defaultMessage="Manage Discover sessions" /> </EuiButton> </EuiFlexItem> diff --git a/src/plugins/discover/public/application/main/components/top_nav/use_top_nav_links.test.tsx b/src/plugins/discover/public/application/main/components/top_nav/use_top_nav_links.test.tsx index a70b200a74346..3db9fb74f0eac 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/use_top_nav_links.test.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/use_top_nav_links.test.tsx @@ -73,25 +73,25 @@ describe('useTopNavLinks', () => { "testId": "openInspectorButton", }, Object { - "description": "New Search", + "description": "New session", "iconOnly": true, "iconType": "plus", "id": "new", - "label": "New", + "label": "New session", "run": [Function], "testId": "discoverNewButton", }, Object { - "description": "Open Saved Search", + "description": "Open session", "iconOnly": true, "iconType": "folderOpen", "id": "open", - "label": "Open", + "label": "Open session", "run": [Function], "testId": "discoverOpenButton", }, Object { - "description": "Share Search", + "description": "Share Discover session", "iconOnly": true, "iconType": "share", "id": "share", @@ -100,7 +100,7 @@ describe('useTopNavLinks', () => { "testId": "shareTopNavButton", }, Object { - "description": "Save Search", + "description": "Save session", "emphasize": true, "iconType": "save", "id": "save", @@ -149,25 +149,25 @@ describe('useTopNavLinks', () => { "testId": "openInspectorButton", }, Object { - "description": "New Search", + "description": "New session", "iconOnly": true, "iconType": "plus", "id": "new", - "label": "New", + "label": "New session", "run": [Function], "testId": "discoverNewButton", }, Object { - "description": "Open Saved Search", + "description": "Open session", "iconOnly": true, "iconType": "folderOpen", "id": "open", - "label": "Open", + "label": "Open session", "run": [Function], "testId": "discoverOpenButton", }, Object { - "description": "Share Search", + "description": "Share Discover session", "iconOnly": true, "iconType": "share", "id": "share", @@ -176,7 +176,7 @@ describe('useTopNavLinks', () => { "testId": "shareTopNavButton", }, Object { - "description": "Save Search", + "description": "Save session", "emphasize": true, "iconType": "save", "id": "save", diff --git a/src/plugins/discover/public/application/main/components/top_nav/use_top_nav_links.tsx b/src/plugins/discover/public/application/main/components/top_nav/use_top_nav_links.tsx index de9686711d104..608442da14088 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/use_top_nav_links.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/use_top_nav_links.tsx @@ -192,7 +192,7 @@ export const useTopNavLinks = ({ defaultMessage: 'Save', }), description: i18n.translate('discover.localMenu.saveSearchDescription', { - defaultMessage: 'Save Search', + defaultMessage: 'Save session', }), testId: 'discoverSaveButton', iconType: 'save', diff --git a/src/plugins/discover/public/components/saved_search_url_conflict_callout/saved_search_url_conflict_callout.ts b/src/plugins/discover/public/components/saved_search_url_conflict_callout/saved_search_url_conflict_callout.ts index 3c42d0301e6dc..4a49a6cb2e073 100644 --- a/src/plugins/discover/public/components/saved_search_url_conflict_callout/saved_search_url_conflict_callout.ts +++ b/src/plugins/discover/public/components/saved_search_url_conflict_callout/saved_search_url_conflict_callout.ts @@ -29,7 +29,7 @@ export const SavedSearchURLConflictCallout = ({ if (otherObjectId) { return spaces.ui.components.getLegacyUrlConflict({ objectNoun: i18n.translate('discover.savedSearchURLConflictCallout.objectNoun', { - defaultMessage: '{savedSearch} search', + defaultMessage: `''{savedSearch}'' Discover session`, values: { savedSearch: savedSearch.title, }, diff --git a/src/plugins/discover/public/context_awareness/README.md b/src/plugins/discover/public/context_awareness/README.md index 31fa5ff9bfcda..ae42038b77aa3 100644 --- a/src/plugins/discover/public/context_awareness/README.md +++ b/src/plugins/discover/public/context_awareness/README.md @@ -54,7 +54,7 @@ The context awareness framework is driven by two main supporting services called Each context level has a dedicated profile service, e.g. `RootProfileService`, which is responsible for accepting profile provider registrations and looping over each provider in order during context resolution to identify a matching profile. Each resolution call can result in only one matching profile, which is the first to return a match based on execution order. -A single `ProfilesManager` is instantiated on Discover load, or one per saved search panel in a dashboard. The profiles manager is responsible for the following: +A single `ProfilesManager` is instantiated on Discover load, or one per Discover session panel in a dashboard. The profiles manager is responsible for the following: - Managing state associated with the current Discover context. - Coordinating profile services and exposing resolution methods for each context level. diff --git a/src/plugins/discover/public/embeddable/constants.ts b/src/plugins/discover/public/embeddable/constants.ts index 313f2bbb99ed1..938caa233b435 100644 --- a/src/plugins/discover/public/embeddable/constants.ts +++ b/src/plugins/discover/public/embeddable/constants.ts @@ -17,9 +17,9 @@ export const SEARCH_EMBEDDABLE_CELL_ACTIONS_TRIGGER_ID = export const SEARCH_EMBEDDABLE_CELL_ACTIONS_TRIGGER: Trigger = { id: SEARCH_EMBEDDABLE_CELL_ACTIONS_TRIGGER_ID, - title: 'Discover saved searches embeddable cell actions', + title: 'Discover session embeddable cell actions', description: - 'This trigger is used to replace the cell actions for Discover saved search embeddable grid.', + 'This trigger is used to replace the cell actions for Discover session embeddable grid.', } as const; export const DEFAULT_HEADER_ROW_HEIGHT_LINES = 3; diff --git a/src/plugins/discover/public/embeddable/get_search_embeddable_factory.tsx b/src/plugins/discover/public/embeddable/get_search_embeddable_factory.tsx index 1f97e2de66390..7c08cdc95e585 100644 --- a/src/plugins/discover/public/embeddable/get_search_embeddable_factory.tsx +++ b/src/plugins/discover/public/embeddable/get_search_embeddable_factory.tsx @@ -152,7 +152,7 @@ export const getSearchEmbeddableFactory = ({ }, getTypeDisplayName: () => i18n.translate('discover.embeddable.search.displayName', { - defaultMessage: 'search', + defaultMessage: 'Discover session', }), canLinkToLibrary: async () => { return ( diff --git a/src/plugins/discover/public/embeddable/initialize_edit_api.ts b/src/plugins/discover/public/embeddable/initialize_edit_api.ts index a99cea0519626..acb489735d053 100644 --- a/src/plugins/discover/public/embeddable/initialize_edit_api.ts +++ b/src/plugins/discover/public/embeddable/initialize_edit_api.ts @@ -75,7 +75,7 @@ export function initializeEditApi< return { getTypeDisplayName: () => i18n.translate('discover.embeddable.search.displayName', { - defaultMessage: 'search', + defaultMessage: 'Discover session', }), onEdit: async () => { const appTarget = await getAppTarget(partialApi, discoverServices); diff --git a/src/plugins/discover/public/hooks/saved_search_alias_match_redirect.test.ts b/src/plugins/discover/public/hooks/saved_search_alias_match_redirect.test.ts index 4e4469188d0b8..81f0ce8e15372 100644 --- a/src/plugins/discover/public/hooks/saved_search_alias_match_redirect.test.ts +++ b/src/plugins/discover/public/hooks/saved_search_alias_match_redirect.test.ts @@ -44,7 +44,7 @@ describe('useSavedSearchAliasMatchRedirect', () => { expect(spaces.ui.redirectLegacyUrl).toHaveBeenCalledWith({ path: '#/view/aliasTargetId?_g=foo', aliasPurpose: 'savedObjectConversion', - objectNoun: 'my-title search', + objectNoun: `'my-title' Discover session`, }); }); diff --git a/src/plugins/discover/public/hooks/saved_search_alias_match_redirect.ts b/src/plugins/discover/public/hooks/saved_search_alias_match_redirect.ts index c4234e40612b8..9bbfebe613c0b 100644 --- a/src/plugins/discover/public/hooks/saved_search_alias_match_redirect.ts +++ b/src/plugins/discover/public/hooks/saved_search_alias_match_redirect.ts @@ -35,7 +35,7 @@ export const useSavedSearchAliasMatchRedirect = ({ path: `${getSavedSearchUrl(aliasTargetId)}${history.location.search}`, aliasPurpose, objectNoun: i18n.translate('discover.savedSearchAliasMatchRedirect.objectNoun', { - defaultMessage: '{savedSearch} search', + defaultMessage: `''{savedSearch}'' Discover session`, values: { savedSearch: savedSearch.title, }, diff --git a/src/plugins/discover/public/plugin.tsx b/src/plugins/discover/public/plugin.tsx index 2529b48246105..08d6f9f6c741a 100644 --- a/src/plugins/discover/public/plugin.tsx +++ b/src/plugins/discover/public/plugin.tsx @@ -429,7 +429,7 @@ export class DiscoverPlugin }, savedObjectType: SavedSearchType, savedObjectName: i18n.translate('discover.savedSearch.savedObjectName', { - defaultMessage: 'Saved search', + defaultMessage: 'Discover session', }), getIconForSavedObject: () => 'discoverApp', }); diff --git a/src/plugins/discover/server/ui_settings.ts b/src/plugins/discover/server/ui_settings.ts index 03625807a8381..9d2b86e57342a 100644 --- a/src/plugins/discover/server/ui_settings.ts +++ b/src/plugins/discover/server/ui_settings.ts @@ -118,7 +118,7 @@ export const getUiSettings: ( description: i18n.translate('discover.advancedSettings.searchOnPageLoadText', { defaultMessage: 'Controls whether a search is executed when Discover first loads. This setting does not ' + - 'have an effect when loading a saved search.', + 'have an effect when loading a Discover session.', }), category: ['discover'], schema: schema.boolean(), @@ -129,7 +129,8 @@ export const getUiSettings: ( }), value: false, description: i18n.translate('discover.advancedSettings.docTableHideTimeColumnText', { - defaultMessage: "Hide the 'Time' column in Discover and in all Saved Searches on Dashboards.", + defaultMessage: + "Hide the 'Time' column in Discover and in all Discover session panels on Dashboards.", }), category: ['discover'], schema: schema.boolean(), diff --git a/src/plugins/embeddable/public/embeddable_panel/embeddable_panel.tsx b/src/plugins/embeddable/public/embeddable_panel/embeddable_panel.tsx deleted file mode 100644 index 8747c78eb3bae..0000000000000 --- a/src/plugins/embeddable/public/embeddable_panel/embeddable_panel.tsx +++ /dev/null @@ -1,93 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { css } from '@emotion/react'; -import { PresentationPanel } from '@kbn/presentation-panel-plugin/public'; -import { PanelCompatibleComponent } from '@kbn/presentation-panel-plugin/public/panel_component/types'; -import { isPromise } from '@kbn/std'; -import React, { ReactNode, useEffect, useImperativeHandle, useMemo, useState, useRef } from 'react'; -import { untilPluginStartServicesReady } from '../kibana_services'; -import { EmbeddablePanelProps } from './types'; - -const getComponentFromEmbeddable = async ( - embeddable: EmbeddablePanelProps['embeddable'], - isMounted: () => boolean -): Promise<PanelCompatibleComponent | null> => { - const startServicesPromise = untilPluginStartServicesReady(); - const embeddablePromise = - typeof embeddable === 'function' ? embeddable() : Promise.resolve(embeddable); - const [, unwrappedEmbeddable] = await Promise.all([startServicesPromise, embeddablePromise]); - if (!isMounted()) { - return null; - } - if (unwrappedEmbeddable.parent) { - await unwrappedEmbeddable.parent.untilEmbeddableLoaded(unwrappedEmbeddable.id); - } - - return React.forwardRef((props, apiRef) => { - const [node, setNode] = useState<ReactNode | undefined>(); - const embeddableRoot: React.RefObject<HTMLDivElement> = useMemo(() => React.createRef(), []); - - // Render legacy embeddable into ref, and destroy on unmount. - useEffect(() => { - if (!embeddableRoot.current) return; - const nextNode = unwrappedEmbeddable.render(embeddableRoot.current) ?? undefined; - if (isPromise(nextNode)) { - nextNode.then((resolved) => setNode(resolved)); - } else { - setNode(nextNode); - } - return () => { - unwrappedEmbeddable.destroy(); - }; - }, [embeddableRoot]); - - useImperativeHandle(apiRef, () => unwrappedEmbeddable); - - return ( - <div css={css(`width: 100%; height: 100%; display:flex`)} ref={embeddableRoot}> - {node} - </div> - ); - }); -}; - -/** - * @deprecated - * Loads and renders a legacy embeddable. - * - * Ancestry chain must use 'key' attribute to reset DOM and state when embeddable changes - * For example <Parent key={embeddableId}><EmbeddablePanel/></Parent> - */ -export const EmbeddablePanel = (props: EmbeddablePanelProps) => { - // can not use useMountedState - // 1. useMountedState defaults mountedRef to false and sets mountedRef to true in useEffect - // 2. embeddable can be an object or a function that returns a promise - // 3. when embeddable is an object, Promise.resolve(embeddable) returns before - // useMountedState useEffect is called and thus isMounted() returns false when component has not been unmounted - const mountedRef = useRef<boolean>(true); - useEffect(() => { - return () => { - mountedRef.current = false; - }; - }, []); - const isMounted = () => { - return mountedRef.current; - }; - const { embeddable, ...passThroughProps } = props; - const componentPromise = useMemo( - () => getComponentFromEmbeddable(embeddable, isMounted), - // Ancestry chain is expected to use 'key' attribute to reset DOM and state - // when embeddable needs to be re-loaded - // empty array is consistent with PresentationPanel useAsync dependency check - // eslint-disable-next-line react-hooks/exhaustive-deps - [] - ); - return <PresentationPanel {...passThroughProps} Component={componentPromise} />; -}; diff --git a/src/plugins/embeddable/public/embeddable_panel/index.ts b/src/plugins/embeddable/public/embeddable_panel/index.ts deleted file mode 100644 index 72f6a47b6af38..0000000000000 --- a/src/plugins/embeddable/public/embeddable_panel/index.ts +++ /dev/null @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export { EmbeddablePanel } from './embeddable_panel'; diff --git a/src/plugins/embeddable/public/embeddable_panel/types.ts b/src/plugins/embeddable/public/embeddable_panel/types.ts deleted file mode 100644 index 385dcb96e33c8..0000000000000 --- a/src/plugins/embeddable/public/embeddable_panel/types.ts +++ /dev/null @@ -1,27 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { PresentationPanelProps } from '@kbn/presentation-panel-plugin/public'; -import { MaybePromise } from '@kbn/utility-types'; -import { ReactNode } from 'react'; -import { EmbeddableInput, EmbeddableOutput, IEmbeddable } from '../lib'; - -export type LegacyCompatibleEmbeddable = IEmbeddable< - EmbeddableInput, - EmbeddableOutput, - MaybePromise<ReactNode> ->; - -export type EmbeddablePanelProps = Omit<PresentationPanelProps, 'Component'> & { - embeddable: LegacyCompatibleEmbeddable | (() => Promise<LegacyCompatibleEmbeddable>); -}; - -export type UnwrappedEmbeddablePanelProps = Omit<EmbeddablePanelProps, 'embeddable'> & { - embeddable: LegacyCompatibleEmbeddable; -}; diff --git a/src/plugins/embeddable/public/index.ts b/src/plugins/embeddable/public/index.ts index 22d845be9c933..c5de8a9d7631f 100644 --- a/src/plugins/embeddable/public/index.ts +++ b/src/plugins/embeddable/public/index.ts @@ -12,11 +12,9 @@ import { EmbeddablePublicPlugin } from './plugin'; export { useAddFromLibraryTypes } from './add_from_library/registry'; export { openAddFromLibraryFlyout } from './add_from_library/open_add_from_library_flyout'; -export { EmbeddablePanel } from './embeddable_panel'; export { cellValueTrigger, CELL_VALUE_TRIGGER, - Container, contextMenuTrigger, CONTEXT_MENU_TRIGGER, defaultEmbeddableFactoryProvider, @@ -58,9 +56,6 @@ export type { Adapters, CellValueContext, ChartActionContext, - ContainerInput, - ContainerOutput, - EmbeddableContainerSettings, EmbeddableContext, EmbeddableEditorState, EmbeddableFactory, @@ -70,11 +65,9 @@ export type { EmbeddableOutput, EmbeddablePackageState, FilterableEmbeddable, - IContainer, IEmbeddable, MultiValueClickContext, OutputSpec, - PanelState, PropertySpec, RangeSelectContext, ReferenceOrValueEmbeddable, @@ -100,9 +93,4 @@ export function plugin(initializerContext: PluginInitializerContext) { return new EmbeddablePublicPlugin(initializerContext); } -export { - embeddableInputToSubject, - embeddableOutputToSubject, -} from './lib/embeddables/compatibility/embeddable_compatibility_utils'; - export { COMMON_EMBEDDABLE_GROUPING } from './lib/embeddables/common/constants'; diff --git a/src/plugins/embeddable/public/lib/containers/container.ts b/src/plugins/embeddable/public/lib/containers/container.ts deleted file mode 100644 index a160c469f05c3..0000000000000 --- a/src/plugins/embeddable/public/lib/containers/container.ts +++ /dev/null @@ -1,615 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import deepEqual from 'fast-deep-equal'; -import { isEqual, xor } from 'lodash'; -import { BehaviorSubject, EMPTY, merge, Subscription } from 'rxjs'; -import { - catchError, - combineLatestWith, - distinctUntilChanged, - map, - mergeMap, - pairwise, - switchMap, - take, -} from 'rxjs'; -import { v4 as uuidv4 } from 'uuid'; - -import { PanelPackage } from '@kbn/presentation-containers'; -import { PresentationContainer } from '@kbn/presentation-containers'; - -import { isSavedObjectEmbeddableInput } from '../../../common/lib/saved_object_embeddable'; -import { EmbeddableStart } from '../../plugin'; -import { - Embeddable, - EmbeddableFactory, - EmbeddableInput, - EmbeddableOutput, - ErrorEmbeddable, - IEmbeddable, - isErrorEmbeddable, -} from '../embeddables'; -import { EmbeddableFactoryNotFoundError, PanelNotFoundError } from '../errors'; -import { - ContainerInput, - ContainerOutput, - EmbeddableContainerSettings, - IContainer, - PanelState, -} from './i_container'; - -const getKeys = <T extends {}>(o: T): Array<keyof T> => Object.keys(o) as Array<keyof T>; - -export abstract class Container< - TChildInput extends Partial<EmbeddableInput> = {}, - TContainerInput extends ContainerInput<TChildInput> = ContainerInput<TChildInput>, - TContainerOutput extends ContainerOutput = ContainerOutput - > - extends Embeddable<TContainerInput, TContainerOutput> - implements IContainer<TChildInput, TContainerInput, TContainerOutput>, PresentationContainer -{ - public readonly isContainer: boolean = true; - - public children$: BehaviorSubject<{ [key: string]: unknown }> = new BehaviorSubject<{ - [key: string]: unknown; - }>({}); - - private subscription: Subscription | undefined; - private readonly anyChildOutputChange$; - - constructor( - input: TContainerInput, - output: TContainerOutput, - protected readonly getFactory: EmbeddableStart['getEmbeddableFactory'], - parent?: IContainer, - settings?: EmbeddableContainerSettings - ) { - super(input, output, parent); - this.getFactory = getFactory; // Currently required for using in storybook due to https://github.com/storybookjs/storybook/issues/13834 - - // if there is no special initialization logic, we can immediately start updating children on input updates. - const awaitingInitialize = Boolean( - settings?.initializeSequentially || settings?.childIdInitializeOrder - ); - - const init$ = this.getInput$().pipe( - take(1), - mergeMap(async (currentInput) => { - if (settings?.untilContainerInitialized) { - await settings.untilContainerInitialized(); - } - const initPromise = this.initializeChildEmbeddables(currentInput, settings); - if (awaitingInitialize) await initPromise; - }) - ); - - // on all subsequent input changes, diff and update children on changes. - const update$ = this.getInput$() - // At each update event, get both the previous and current state. - .pipe(pairwise()); - - this.subscription = init$ - .pipe(combineLatestWith(update$)) - .subscribe(([_, [{ panels: prevPanels }, { panels: currentPanels }]]) => { - this.maybeUpdateChildren(currentPanels, prevPanels); - }); - - this.anyChildOutputChange$ = this.getOutput$().pipe( - map(() => this.getChildIds()), - distinctUntilChanged(deepEqual), - - // children may change, so make sure we subscribe/unsubscribe with switchMap - switchMap((newChildIds: string[]) => - merge( - ...newChildIds.map((childId) => - this.getChild(childId) - .getOutput$() - .pipe( - // Embeddables often throw errors into their output streams. - catchError(() => EMPTY), - map(() => childId) - ) - ) - ) - ) - ); - } - - public getPanelCount() { - return Object.keys(this.getInput().panels).length; - } - - public removePanel(id: string) { - this.removeEmbeddable(id); - } - - public async addNewPanel<ApiType extends unknown = unknown>( - panelPackage: PanelPackage - ): Promise<ApiType | undefined> { - const newEmbeddable = await this.addNewEmbeddable( - panelPackage.panelType, - panelPackage.initialState as Partial<EmbeddableInput> - ); - return newEmbeddable as ApiType; - } - - public async replacePanel(idToRemove: string, { panelType, initialState }: PanelPackage) { - return await this.replaceEmbeddable( - idToRemove, - initialState as Partial<EmbeddableInput>, - panelType, - true - ); - } - - public setChildLoaded(embeddable: IEmbeddable) { - // make sure the panel wasn't removed in the mean time, since the embeddable creation is async - if (!this.input.panels[embeddable.id]) { - embeddable.destroy(); - return; - } - - const currentChildren = this.children$.value; - this.children$.next({ - ...currentChildren, - [embeddable.id]: embeddable, - }); - this.updateOutput({ - embeddableLoaded: { - ...this.output.embeddableLoaded, - [embeddable.id]: true, - }, - } as Partial<TContainerOutput>); - } - - public updateInputForChild<EEI extends EmbeddableInput = EmbeddableInput>( - id: string, - changes: Partial<EEI> - ) { - if (!this.input.panels[id]) { - throw new PanelNotFoundError(); - } - const panels = { - panels: { - ...this.input.panels, - [id]: { - ...this.input.panels[id], - explicitInput: { - ...this.input.panels[id].explicitInput, - ...changes, - }, - }, - }, - }; - this.updateInput(panels as Partial<TContainerInput>); - } - - public reload() { - for (const child of Object.values(this.children$.value)) { - (child as IEmbeddable)?.reload?.(); - } - } - - public async addNewEmbeddable< - EEI extends EmbeddableInput = EmbeddableInput, - EEO extends EmbeddableOutput = EmbeddableOutput, - E extends IEmbeddable<EEI, EEO> = IEmbeddable<EEI, EEO> - >(type: string, explicitInput: Partial<EEI>, attributes?: unknown): Promise<E | ErrorEmbeddable> { - const factory = this.getFactory(type) as EmbeddableFactory<EEI, EEO, E> | undefined; - - if (!factory) { - throw new EmbeddableFactoryNotFoundError(type); - } - - const { newPanel, otherPanels } = this.createNewPanelState<EEI, E>( - factory, - explicitInput, - attributes - ); - - return this.createAndSaveEmbeddable(type, newPanel, otherPanels); - } - - public async replaceEmbeddable< - EEI extends EmbeddableInput = EmbeddableInput, - EEO extends EmbeddableOutput = EmbeddableOutput, - E extends IEmbeddable<EEI, EEO> = IEmbeddable<EEI, EEO> - >( - id: string, - newExplicitInput: Partial<EEI>, - newType?: string, - generateNewId?: boolean - ): Promise<string> { - if (!this.input.panels[id]) { - throw new PanelNotFoundError(); - } - - if (newType && newType !== this.input.panels[id].type) { - const factory = this.getFactory(newType) as EmbeddableFactory<EEI, EEO, E> | undefined; - if (!factory) { - throw new EmbeddableFactoryNotFoundError(newType); - } - } - - const panels = { ...this.input.panels }; - const oldPanel = panels[id]; - - if (generateNewId) { - delete panels[id]; - id = uuidv4(); - } - this.updateInput({ - panels: { - ...panels, - [id]: { - ...oldPanel, - explicitInput: { ...newExplicitInput, id }, - type: newType ?? oldPanel.type, - }, - }, - } as Partial<TContainerInput>); - - await this.untilEmbeddableLoaded<E>(id); - return id; - } - - public removeEmbeddable(embeddableId: string) { - // Just a shortcut for removing the panel from input state, all internal state will get cleaned up naturally - // by the listener. - const panels = this.onRemoveEmbeddable(embeddableId); - this.updateInput({ panels } as Partial<TContainerInput>); - } - - /** - * Control the panels that are pushed to the input stream when an embeddable is - * removed. This can be used if removing one embeddable has knock-on effects, like - * re-ordering embeddables that come after it. - */ - protected onRemoveEmbeddable(embeddableId: string): ContainerInput['panels'] { - const panels = { ...this.input.panels }; - delete panels[embeddableId]; - return panels; - } - - public getChildIds(): string[] { - return Object.keys(this.children$.value); - } - - public getChild<E extends IEmbeddable>(id: string): E { - return this.children$.value[id] as E; - } - - public getInputForChild<TEmbeddableInput extends EmbeddableInput = EmbeddableInput>( - embeddableId: string - ): TEmbeddableInput { - const containerInput: TChildInput = this.getInheritedInput(embeddableId); - const panelState = this.getPanelState(embeddableId); - - const explicitInput = panelState.explicitInput; - const explicitFiltered: { [key: string]: unknown } = {}; - - const keys = getKeys(panelState.explicitInput); - - // If explicit input for a particular value is undefined, and container has that input defined, - // we will use the inherited container input. This way children can set a value to undefined in order - // to default back to inherited input. However, if the particular value is not part of the container, then - // the caller may be trying to explicitly tell the child to clear out a given value, so in that case, we want - // to pass it along. - keys.forEach((key) => { - if (explicitInput[key] === undefined && containerInput[key] !== undefined) { - return; - } - explicitFiltered[key] = explicitInput[key]; - }); - - return { - ...containerInput, - ...explicitFiltered, - // Typescript has difficulties with inferring this type but it is accurate with all - // tests I tried. Could probably be revisted with future releases of TS to see if - // it can accurately infer the type. - } as unknown as TEmbeddableInput; - } - - public getAnyChildOutputChange$() { - return this.anyChildOutputChange$; - } - - public destroy() { - super.destroy(); - for (const child of Object.values(this.children$.value)) { - (child as IEmbeddable)?.destroy?.(); - } - this.subscription?.unsubscribe(); - } - - public async untilEmbeddableLoaded<TEmbeddable extends IEmbeddable>( - id: string - ): Promise<TEmbeddable | ErrorEmbeddable> { - if (!this.input.panels[id]) { - throw new PanelNotFoundError(); - } - - if (this.output.embeddableLoaded[id]) { - return this.children$.value[id] as TEmbeddable; - } - - return new Promise<TEmbeddable>((resolve, reject) => { - const subscription = merge(this.getOutput$(), this.getInput$()).subscribe(() => { - if (this.output.embeddableLoaded[id]) { - subscription.unsubscribe(); - resolve(this.children$.value[id] as TEmbeddable); - } - - // If we hit this, the panel was removed before the embeddable finished loading. - if (this.input.panels[id] === undefined) { - subscription.unsubscribe(); - // @ts-expect-error undefined in not assignable to TEmbeddable | ErrorEmbeddable - resolve(undefined); - } - }); - }); - } - - public async untilReactEmbeddableLoaded<ApiType>(id: string): Promise<ApiType | undefined> { - if (!this.input.panels[id]) { - throw new PanelNotFoundError(); - } - - if (this.children$.value[id]) { - return this.children$.value[id] as ApiType; - } - - return new Promise((resolve, reject) => { - const subscription = merge(this.children$, this.getInput$()).subscribe(() => { - if (this.children$.value[id]) { - subscription.unsubscribe(); - resolve(this.children$.value[id] as ApiType); - } - - // If we hit this, the panel was removed before the embeddable finished loading. - if (this.input.panels[id] === undefined) { - subscription.unsubscribe(); - resolve(undefined); - } - }); - }); - } - - public async getExplicitInputIsEqual(lastInput: TContainerInput) { - const { panels: lastPanels, ...restOfLastInput } = lastInput; - const { panels: currentPanels, ...restOfCurrentInput } = this.getExplicitInput(); - const otherInputIsEqual = isEqual(restOfLastInput, restOfCurrentInput); - if (!otherInputIsEqual) return false; - - const embeddableIdsA = Object.keys(lastPanels); - const embeddableIdsB = Object.keys(currentPanels); - if ( - embeddableIdsA.length !== embeddableIdsB.length || - xor(embeddableIdsA, embeddableIdsB).length > 0 - ) { - return false; - } - // embeddable ids are equal so let's compare individual panels. - for (const id of embeddableIdsA) { - const currentEmbeddable = await this.untilEmbeddableLoaded(id); - const lastPanelInput = lastPanels[id].explicitInput; - if (isErrorEmbeddable(currentEmbeddable)) continue; - if (!(await currentEmbeddable.getExplicitInputIsEqual(lastPanelInput))) { - return false; - } - } - return true; - } - - protected createNewPanelState< - TEmbeddableInput extends EmbeddableInput, - TEmbeddable extends IEmbeddable<TEmbeddableInput, any> - >( - factory: EmbeddableFactory<TEmbeddableInput, any, TEmbeddable>, - partial: Partial<TEmbeddableInput> = {}, - attributes?: unknown - ): { newPanel: PanelState<TEmbeddableInput>; otherPanels: TContainerInput['panels'] } { - const embeddableId = partial.id || uuidv4(); - - const explicitInput = this.createNewExplicitEmbeddableInput<TEmbeddableInput>( - embeddableId, - factory, - partial - ); - - return { - newPanel: { - type: factory.type, - explicitInput: { - ...explicitInput, - id: embeddableId, - version: factory.latestVersion, - } as TEmbeddableInput, - }, - otherPanels: this.getInput().panels, - }; - } - - protected getPanelState<TEmbeddableInput extends EmbeddableInput = EmbeddableInput>( - embeddableId: string - ) { - if (this.input.panels[embeddableId] === undefined) { - throw new PanelNotFoundError(); - } - const panelState: PanelState = this.input.panels[embeddableId]; - return panelState as PanelState<TEmbeddableInput>; - } - - /** - * Return state that comes from the container and is passed down to the child. For instance, time range and - * filters are common inherited input state. Note that state stored in `this.input.panels[embeddableId].explicitInput` - * will override inherited input. - */ - protected abstract getInheritedInput(id: string): TChildInput; - - private async initializeChildEmbeddables( - initialInput: TContainerInput, - initializeSettings?: EmbeddableContainerSettings - ) { - let initializeOrder = Object.keys(initialInput.panels); - if (initializeSettings?.childIdInitializeOrder) { - const initializeOrderSet = new Set<string>(); - - for (const id of [...initializeSettings.childIdInitializeOrder, ...initializeOrder]) { - if (!initializeOrderSet.has(id) && Boolean(this.getInput().panels[id])) { - initializeOrderSet.add(id); - } - } - - initializeOrder = Array.from(initializeOrderSet); - } - - for (const id of initializeOrder) { - if (initializeSettings?.initializeSequentially) { - const embeddable = await this.onPanelAdded(initialInput.panels[id]); - - if (embeddable && !isErrorEmbeddable(embeddable)) { - await this.untilEmbeddableLoaded(id); - } - } else { - this.onPanelAdded(initialInput.panels[id]); - } - } - } - - protected async createAndSaveEmbeddable< - TEmbeddableInput extends EmbeddableInput = EmbeddableInput, - TEmbeddable extends IEmbeddable<TEmbeddableInput> = IEmbeddable<TEmbeddableInput> - >(type: string, panelState: PanelState, otherPanels: TContainerInput['panels']) { - this.updateInput({ - panels: { - ...otherPanels, - [panelState.explicitInput.id]: panelState, - }, - } as Partial<TContainerInput>); - - return await this.untilEmbeddableLoaded<TEmbeddable>(panelState.explicitInput.id); - } - - private createNewExplicitEmbeddableInput< - TEmbeddableInput extends EmbeddableInput = EmbeddableInput, - TEmbeddable extends IEmbeddable< - TEmbeddableInput, - EmbeddableOutput - > = IEmbeddable<TEmbeddableInput> - >( - id: string, - factory: EmbeddableFactory<TEmbeddableInput, any, TEmbeddable>, - partial: Partial<TEmbeddableInput> = {} - ): Partial<TEmbeddableInput> { - const inheritedInput = this.getInheritedInput(id); - const defaults = factory.getDefaultInput(partial); - - // Container input overrides defaults. - const explicitInput: Partial<TEmbeddableInput> = partial; - - getKeys(defaults).forEach((key) => { - // @ts-ignore We know this key might not exist on inheritedInput. - const inheritedValue = inheritedInput[key]; - if (inheritedValue === undefined && explicitInput[key] === undefined) { - explicitInput[key] = defaults[key]; - } - }); - return explicitInput; - } - - private onPanelRemoved(id: string) { - // Clean up - const embeddable = this.getChild(id); - if (embeddable && embeddable.destroy) { - embeddable.destroy(); - - // Remove references. - const nextChildren = this.children$.value; - delete nextChildren[id]; - this.children$.next(nextChildren); - } - - this.updateOutput({ - embeddableLoaded: { - ...this.output.embeddableLoaded, - [id]: undefined, - }, - } as Partial<TContainerOutput>); - } - - private async onPanelAdded(panel: PanelState) { - this.updateOutput({ - embeddableLoaded: { - ...this.output.embeddableLoaded, - [panel.explicitInput.id]: false, - }, - } as Partial<TContainerOutput>); - let embeddable: IEmbeddable | ErrorEmbeddable | undefined; - const inputForChild = this.getInputForChild(panel.explicitInput.id); - try { - const factory = this.getFactory(panel.type); - if (!factory) { - throw new EmbeddableFactoryNotFoundError(panel.type); - } - - // TODO: lets get rid of this distinction with factories, I don't think it will be needed after this change. - embeddable = isSavedObjectEmbeddableInput(inputForChild) - ? await factory.createFromSavedObject(inputForChild.savedObjectId, inputForChild, this) - : await factory.create(inputForChild, this); - } catch (e) { - embeddable = new ErrorEmbeddable(e, { id: panel.explicitInput.id }, this); - } - - // EmbeddableFactory.create can return undefined without throwing an error, which indicates that an embeddable - // can't be created. This logic essentially only exists to support the current use case of - // visualizations being created from the add panel, which redirects the user to the visualize app. Once we - // switch over to inline creation we can probably clean this up, and force EmbeddableFactory.create to always - // return an embeddable, or throw an error. - if (embeddable) { - if (!embeddable.deferEmbeddableLoad) { - this.setChildLoaded(embeddable); - } - } else if (embeddable === undefined) { - this.removeEmbeddable(panel.explicitInput.id); - } - - return embeddable; - } - - private panelHasChanged(currentPanel: PanelState, prevPanel: PanelState) { - if (currentPanel.type !== prevPanel.type) { - return true; - } - } - - private maybeUpdateChildren( - currentPanels: TContainerInput['panels'], - prevPanels: TContainerInput['panels'] - ) { - const allIds = Object.keys({ ...currentPanels, ...this.output.embeddableLoaded }); - allIds.forEach((id) => { - if (currentPanels[id] !== undefined && this.output.embeddableLoaded[id] === undefined) { - return this.onPanelAdded(currentPanels[id]); - } - if (currentPanels[id] === undefined && this.output.embeddableLoaded[id] !== undefined) { - return this.onPanelRemoved(id); - } - // In case of type change, remove and add a panel with the same id - if (currentPanels[id] && prevPanels[id]) { - if (this.panelHasChanged(currentPanels[id], prevPanels[id])) { - this.onPanelRemoved(id); - this.onPanelAdded(currentPanels[id]); - } - } - }); - } -} diff --git a/src/plugins/embeddable/public/lib/containers/i_container.ts b/src/plugins/embeddable/public/lib/containers/i_container.ts deleted file mode 100644 index 9ba8c41e50509..0000000000000 --- a/src/plugins/embeddable/public/lib/containers/i_container.ts +++ /dev/null @@ -1,116 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { - Embeddable, - EmbeddableInput, - EmbeddableOutput, - ErrorEmbeddable, - IEmbeddable, -} from '../embeddables'; -import { PanelState } from '../../../common/types'; - -export type { PanelState }; - -export interface ContainerOutput extends EmbeddableOutput { - embeddableLoaded: { [key: string]: boolean }; -} - -export interface ContainerInput<PanelExplicitInput = {}> extends EmbeddableInput { - hidePanelTitles?: boolean; - panels: { - [key: string]: PanelState<PanelExplicitInput & EmbeddableInput & { id: string }>; - }; -} - -export interface EmbeddableContainerSettings { - /** - * If true, the container will wait for each embeddable to load after creation before loading the next embeddable. - */ - initializeSequentially?: boolean; - /** - * Initialise children in the order specified. If an ID does not match it will be skipped and if a child is not included it will be initialized in the default order after the list of provided IDs. - */ - childIdInitializeOrder?: string[]; - - untilContainerInitialized?: () => Promise<void>; -} - -export interface IContainer< - Inherited extends {} = {}, - I extends ContainerInput<Inherited> = ContainerInput<Inherited>, - O extends ContainerOutput = ContainerOutput -> extends IEmbeddable<I, O> { - /** - * Call if you want to wait until an embeddable with that id has finished loading. - */ - untilEmbeddableLoaded<TEmbeddable extends IEmbeddable>( - id: string - ): Promise<TEmbeddable | ErrorEmbeddable>; - - /** - * Returns the input for the given child. Uses a combination of explicit input - * for the child stored on the parent and derived/inherited input taken from the - * container itself. - * @param id - */ - getInputForChild<EEI extends EmbeddableInput>(id: string): EEI; - - /** - * Changes the input for a given child. Note, this will override all inherited state taken from - * the container itself. - * @param id - * @param changes - */ - updateInputForChild<EEI extends EmbeddableInput>(id: string, changes: Partial<EEI>): void; - - /** - * Returns the child embeddable with the given id. - * @param id - */ - getChild<E extends Embeddable<EmbeddableInput> = Embeddable<EmbeddableInput>>(id: string): E; - - /** - * Embeddables which have deferEmbeddableLoad set to true need to manually call setChildLoaded - * on their parent container to communicate when they have finished loading. - * @param embeddable - the embeddable to set - */ - setChildLoaded<E extends IEmbeddable = IEmbeddable>(embeddable: E): void; - - /** - * Removes the embeddable with the given id. - * @param embeddableId - */ - removeEmbeddable(embeddableId: string): void; - - /** - * Adds a new embeddable to the container. `explicitInput` may partially specify the required embeddable input, - * but the remainder must come from inherited container state. - */ - addNewEmbeddable< - EEI extends EmbeddableInput = EmbeddableInput, - EEO extends EmbeddableOutput = EmbeddableOutput, - E extends Embeddable<EEI, EEO> = Embeddable<EEI, EEO> - >( - type: string, - explicitInput: Partial<EEI>, - attributes?: unknown - ): Promise<E | ErrorEmbeddable>; - - replaceEmbeddable< - EEI extends EmbeddableInput = EmbeddableInput, - EEO extends EmbeddableOutput = EmbeddableOutput, - E extends Embeddable<EEI, EEO> = Embeddable<EEI, EEO> - >( - id: string, - newExplicitInput: Partial<EEI>, - newType?: string, - generateNewId?: boolean - ): Promise<string>; -} diff --git a/src/plugins/embeddable/public/lib/containers/index.ts b/src/plugins/embeddable/public/lib/containers/index.ts deleted file mode 100644 index 2f8a5dcf5d82b..0000000000000 --- a/src/plugins/embeddable/public/lib/containers/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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export type { - IContainer, - PanelState, - ContainerInput, - ContainerOutput, - EmbeddableContainerSettings, -} from './i_container'; -export { Container } from './container'; diff --git a/src/plugins/embeddable/public/lib/embeddables/compatibility/embeddable_compatibility_utils.ts b/src/plugins/embeddable/public/lib/embeddables/compatibility/embeddable_compatibility_utils.ts deleted file mode 100644 index 84b31d5556f42..0000000000000 --- a/src/plugins/embeddable/public/lib/embeddables/compatibility/embeddable_compatibility_utils.ts +++ /dev/null @@ -1,141 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ViewMode } from '@kbn/presentation-publishing'; -import deepEqual from 'fast-deep-equal'; -import { - BehaviorSubject, - distinctUntilChanged, - distinctUntilKeyChanged, - map, - Subscription, -} from 'rxjs'; -import { EmbeddableInput, EmbeddableOutput, IEmbeddable } from '../..'; -import { Container } from '../../containers'; -import { ViewMode as LegacyViewMode } from '../../types'; -import { CommonLegacyEmbeddable } from './legacy_embeddable_to_api'; - -export const embeddableInputToSubject = < - ValueType extends unknown = unknown, - LegacyInput extends EmbeddableInput = EmbeddableInput ->( - subscription: Subscription, - embeddable: IEmbeddable<LegacyInput>, - key: keyof LegacyInput, - useExplicitInput = false -) => { - const subject = new BehaviorSubject<ValueType | undefined>( - embeddable.getExplicitInput()?.[key] as ValueType - ); - if (useExplicitInput && embeddable.parent) { - subscription.add( - embeddable.parent - .getInput$() - .pipe( - distinctUntilChanged((prev, current) => { - const previousValue = (prev.panels[embeddable.id]?.explicitInput as LegacyInput)[key]; - const currentValue = (current.panels[embeddable.id]?.explicitInput as LegacyInput)?.[ - key - ]; - return deepEqual(previousValue, currentValue); - }) - ) - .subscribe(() => subject.next(embeddable.getExplicitInput()?.[key] as ValueType)) - ); - } else { - subscription.add( - embeddable - .getInput$() - .pipe( - distinctUntilKeyChanged(key, (prev, current) => { - return deepEqual(prev, current); - }) - ) - .subscribe(() => subject.next(embeddable.getInput()?.[key] as ValueType)) - ); - } - return subject; -}; - -export const embeddableOutputToSubject = < - ValueType extends unknown = unknown, - LegacyOutput extends EmbeddableOutput = EmbeddableOutput ->( - subscription: Subscription, - embeddable: IEmbeddable<EmbeddableInput, LegacyOutput>, - key: keyof LegacyOutput -) => { - const subject = new BehaviorSubject<ValueType | undefined>( - embeddable.getOutput()[key] as ValueType - ); - subscription.add( - embeddable - .getOutput$() - .pipe(distinctUntilKeyChanged(key)) - .subscribe(() => subject.next(embeddable.getOutput()[key] as ValueType)) - ); - return subject; -}; - -export const mapLegacyViewModeToViewMode = (legacyViewMode?: LegacyViewMode): ViewMode => { - if (!legacyViewMode) return 'view'; - switch (legacyViewMode) { - case LegacyViewMode.VIEW: { - return 'view'; - } - case LegacyViewMode.EDIT: { - return 'edit'; - } - case LegacyViewMode.PREVIEW: { - return 'preview'; - } - case LegacyViewMode.PRINT: { - return 'print'; - } - default: { - return 'view'; - } - } -}; - -export const viewModeToSubject = ( - subscription: Subscription, - embeddable: CommonLegacyEmbeddable -) => { - const subject = new BehaviorSubject<ViewMode>( - mapLegacyViewModeToViewMode(embeddable.getInput().viewMode) - ); - subscription.add( - embeddable - .getInput$() - .pipe( - distinctUntilKeyChanged('viewMode'), - map(({ viewMode }) => mapLegacyViewModeToViewMode(viewMode)) - ) - .subscribe((viewMode: ViewMode) => subject.next(viewMode)) - ); - return subject; -}; - -/** - * Temporarily copying types from dashboard_container.ts because we cannot import it here. - */ -interface DashboardRequiredMethods { - getExpandedPanelId: () => string | undefined; - setExpandedPanelId: (expandedPanelId: string | undefined) => void; -} - -export const hasDashboardRequiredMethods = ( - container: unknown -): container is DashboardRequiredMethods & Container => { - return ( - typeof (container as DashboardRequiredMethods).getExpandedPanelId === 'function' && - typeof (container as DashboardRequiredMethods).setExpandedPanelId === 'function' - ); -}; diff --git a/src/plugins/embeddable/public/lib/embeddables/compatibility/legacy_embeddable_to_api.ts b/src/plugins/embeddable/public/lib/embeddables/compatibility/legacy_embeddable_to_api.ts deleted file mode 100644 index 63c1a6593478b..0000000000000 --- a/src/plugins/embeddable/public/lib/embeddables/compatibility/legacy_embeddable_to_api.ts +++ /dev/null @@ -1,304 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { DataView } from '@kbn/data-views-plugin/common'; -import { - AggregateQuery, - compareFilters, - COMPARE_ALL_OPTIONS, - Filter, - Query, - TimeRange, -} from '@kbn/es-query'; -import type { ErrorLike } from '@kbn/expressions-plugin/common'; -import { i18n } from '@kbn/i18n'; -import { PhaseEvent, PhaseEventType } from '@kbn/presentation-publishing'; -import deepEqual from 'fast-deep-equal'; -import { isNil } from 'lodash'; -import { - BehaviorSubject, - map, - Subscription, - distinct, - combineLatest, - distinctUntilChanged, -} from 'rxjs'; -import { embeddableStart } from '../../../kibana_services'; -import { isFilterableEmbeddable } from '../../filterable_embeddable'; -import { - EmbeddableInput, - EmbeddableOutput, - IEmbeddable, - LegacyEmbeddableAPI, -} from '../i_embeddable'; -import { - embeddableInputToSubject, - embeddableOutputToSubject, - viewModeToSubject, -} from './embeddable_compatibility_utils'; - -export type CommonLegacyInput = EmbeddableInput & { savedObjectId?: string; timeRange: TimeRange }; -export type CommonLegacyOutput = EmbeddableOutput & { indexPatterns: DataView[] }; -export type CommonLegacyEmbeddable = IEmbeddable<CommonLegacyInput, CommonLegacyOutput>; - -type VisualizeEmbeddable = IEmbeddable<{ id: string }, EmbeddableOutput & { visTypeName: string }>; -function isVisualizeEmbeddable( - embeddable: IEmbeddable | VisualizeEmbeddable -): embeddable is VisualizeEmbeddable { - return embeddable.type === 'visualization'; -} - -const getEventStatus = (output: EmbeddableOutput): PhaseEventType => { - if (!isNil(output.error)) { - return 'error'; - } else if (output.rendered === true) { - return 'rendered'; - } else if (output.loading === false) { - return 'loaded'; - } else { - return 'loading'; - } -}; - -export const legacyEmbeddableToApi = ( - embeddable: CommonLegacyEmbeddable -): { api: Omit<LegacyEmbeddableAPI, 'type' | 'getInspectorAdapters'>; destroyAPI: () => void } => { - const subscriptions = new Subscription(); - - /** - * Shortcuts for creating publishing subjects from the input and output subjects - */ - const inputKeyToSubject = <ValueType extends unknown = unknown>( - key: keyof CommonLegacyInput, - useExplicitInput?: boolean - ) => - embeddableInputToSubject<ValueType, CommonLegacyInput>( - subscriptions, - embeddable, - key, - useExplicitInput - ); - const outputKeyToSubject = <ValueType extends unknown = unknown>(key: keyof CommonLegacyOutput) => - embeddableOutputToSubject<ValueType, CommonLegacyOutput>(subscriptions, embeddable, key); - - /** - * Support editing of legacy embeddables - */ - const onEdit = () => { - throw new Error('Edit legacy embeddable not supported'); - }; - const getTypeDisplayName = () => - embeddableStart.getEmbeddableFactory(embeddable.type)?.getDisplayName() ?? - i18n.translate('embeddableApi.compatibility.defaultTypeDisplayName', { - defaultMessage: 'chart', - }); - const isEditingEnabled = () => false; - - /** - * Performance tracking - */ - const phase$ = new BehaviorSubject<PhaseEvent | undefined>(undefined); - - let loadingStartTime = 0; - subscriptions.add( - embeddable - .getOutput$() - .pipe( - // Map loaded event properties - map((output) => { - if (output.loading === true) { - loadingStartTime = performance.now(); - } - return { - id: embeddable.id, - status: getEventStatus(output), - error: output.error, - }; - }), - // Dedupe - distinct((output) => loadingStartTime + output.id + output.status + !!output.error), - // Map loaded event properties - map((output): PhaseEvent => { - return { - ...output, - timeToEvent: performance.now() - loadingStartTime, - }; - }) - ) - .subscribe((statusOutput) => { - phase$.next(statusOutput); - }) - ); - - /** - * Publish state for Presentation panel - */ - const viewMode = viewModeToSubject(subscriptions, embeddable); - const dataLoading = outputKeyToSubject<boolean>('loading'); - - const setHidePanelTitle = (hidePanelTitle?: boolean) => - embeddable.updateInput({ hidePanelTitles: hidePanelTitle }); - const hidePanelTitle = inputKeyToSubject<boolean>('hidePanelTitles'); - - const setPanelTitle = (title?: string) => embeddable.updateInput({ title }); - const panelTitle = inputKeyToSubject<string>('title'); - - const setPanelDescription = (description?: string) => embeddable.updateInput({ description }); - const panelDescription = inputKeyToSubject<string>('description'); - - const defaultPanelTitle = outputKeyToSubject<string>('defaultTitle'); - const defaultPanelDescription = outputKeyToSubject<string>('defaultDescription'); - const disabledActionIds = inputKeyToSubject<string[] | undefined>('disabledActions'); - - function getSavedObjectId(input: { savedObjectId?: string }, output: { savedObjectId?: string }) { - return output.savedObjectId ?? input.savedObjectId; - } - const savedObjectId = new BehaviorSubject<string | undefined>( - getSavedObjectId(embeddable.getInput(), embeddable.getOutput()) - ); - subscriptions.add( - combineLatest([embeddable.getInput$(), embeddable.getOutput$()]) - .pipe( - map(([input, output]) => { - return getSavedObjectId(input, output); - }), - distinctUntilChanged() - ) - .subscribe((nextSavedObjectId) => { - savedObjectId.next(nextSavedObjectId); - }) - ); - - const blockingError = new BehaviorSubject<ErrorLike | undefined>(undefined); - subscriptions.add( - embeddable.getOutput$().subscribe({ - next: (output) => blockingError.next(output.error), - error: (error) => blockingError.next(error), - }) - ); - - const uuid = embeddable.id; - const parentApi = embeddable.parent; - const disableTriggers = embeddable.getInput().disableTriggers; - - /** - * We treat all legacy embeddable types as if they can support local unified search state, because there is no programmatic way - * to tell when given a legacy embeddable what it's input could contain. All existing actions treat these as optional - * so if the Embeddable is incapable of publishing unified search state (i.e. markdown) then it will just be ignored. - */ - const timeRange$ = inputKeyToSubject<TimeRange | undefined>('timeRange', true); - const setTimeRange = (nextTimeRange?: TimeRange) => - embeddable.updateInput({ timeRange: nextTimeRange }); - - const filters$: BehaviorSubject<Filter[] | undefined> = new BehaviorSubject<Filter[] | undefined>( - undefined - ); - - const query$: BehaviorSubject<Query | AggregateQuery | undefined> = new BehaviorSubject< - Query | AggregateQuery | undefined - >(undefined); - // if this embeddable is a legacy filterable embeddable, publish changes to those filters to the panelFilters subject. - if (isFilterableEmbeddable(embeddable)) { - embeddable.untilInitializationFinished().then(() => { - filters$.next(embeddable.getFilters()); - query$.next(embeddable.getQuery()); - - subscriptions.add( - embeddable.getInput$().subscribe(() => { - if ( - !compareFilters( - embeddable.filters$.getValue() ?? [], - embeddable.getFilters(), - COMPARE_ALL_OPTIONS - ) - ) { - filters$.next(embeddable.getFilters()); - } - if (!deepEqual(embeddable.query$.getValue() ?? [], embeddable.getQuery())) { - query$.next(embeddable.getQuery()); - } - }) - ); - }); - } - - const dataViews = outputKeyToSubject<DataView[]>('indexPatterns'); - const isCompatibleWithUnifiedSearch = () => { - const isInputControl = - isVisualizeEmbeddable(embeddable) && - (embeddable as unknown as VisualizeEmbeddable).getOutput().visTypeName === - 'input_control_vis'; - - const isMarkdown = - isVisualizeEmbeddable(embeddable) && - (embeddable as VisualizeEmbeddable).getOutput().visTypeName === 'markdown'; - - const isImage = embeddable.type === 'image'; - const isLinks = embeddable.type === 'links'; - return !isInputControl && !isMarkdown && !isImage && !isLinks; - }; - - const hasLockedHoverActions$ = new BehaviorSubject<boolean>(false); - - return { - api: { - parentApi: parentApi as LegacyEmbeddableAPI['parentApi'], - uuid, - disableTriggers: disableTriggers ?? false, - viewMode, - dataLoading, - blockingError, - - phase$, - - onEdit, - isEditingEnabled, - getTypeDisplayName, - - timeRange$, - setTimeRange, - filters$, - query$, - isCompatibleWithUnifiedSearch, - - dataViews, - disabledActionIds, - setDisabledActionIds: (ids) => disabledActionIds.next(ids), - - hasLockedHoverActions$, - lockHoverActions: (lock: boolean) => hasLockedHoverActions$.next(lock), - - panelTitle, - setPanelTitle, - defaultPanelTitle, - - hidePanelTitle, - setHidePanelTitle, - - setPanelDescription, - panelDescription, - defaultPanelDescription, - - canLinkToLibrary: async () => false, - linkToLibrary: () => { - throw new Error('Link to library not supported for legacy embeddable'); - }, - - canUnlinkFromLibrary: async () => false, - unlinkFromLibrary: () => { - throw new Error('Unlink from library not supported for legacy embeddable'); - }, - - savedObjectId, - }, - destroyAPI: () => { - subscriptions.unsubscribe(); - }, - }; -}; diff --git a/src/plugins/embeddable/public/lib/embeddables/default_embeddable_factory_provider.ts b/src/plugins/embeddable/public/lib/embeddables/default_embeddable_factory_provider.ts index b634c8d507510..13baf96962a3a 100644 --- a/src/plugins/embeddable/public/lib/embeddables/default_embeddable_factory_provider.ts +++ b/src/plugins/embeddable/public/lib/embeddables/default_embeddable_factory_provider.ts @@ -9,7 +9,6 @@ import { SavedObjectAttributes } from '@kbn/core/public'; import type { FinderAttributes } from '@kbn/saved-objects-finder-plugin/common'; -import { IContainer } from '..'; import { EmbeddableFactory } from './embeddable_factory'; import { EmbeddableStateWithType } from '../../../common/types'; import { EmbeddableFactoryDefinition } from './embeddable_factory_definition'; @@ -41,7 +40,7 @@ export const defaultEmbeddableFactoryProvider = < : () => Promise.resolve({}), createFromSavedObject: def.createFromSavedObject ? def.createFromSavedObject.bind(def) - : (savedObjectId: string, input: Partial<I>, parent?: IContainer) => { + : (savedObjectId: string, input: Partial<I>, parent?: unknown) => { throw new Error(`Creation from saved object not supported by type ${def.type}`); }, create: (...args) => { diff --git a/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx b/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx index 9fc3598bcd5ad..f20d65de3d60d 100644 --- a/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx +++ b/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx @@ -13,21 +13,10 @@ import * as Rx from 'rxjs'; import { merge } from 'rxjs'; import { debounceTime, distinctUntilChanged, map, skip } from 'rxjs'; import { RenderCompleteDispatcher } from '@kbn/kibana-utils-plugin/public'; -import { EmbeddableAppContext } from '@kbn/presentation-publishing'; import { Adapters } from '../types'; -import { IContainer } from '../containers'; -import { - EmbeddableError, - EmbeddableOutput, - IEmbeddable, - LegacyEmbeddableAPI, -} from './i_embeddable'; +import { EmbeddableError, EmbeddableOutput, IEmbeddable } from './i_embeddable'; import { EmbeddableInput, ViewMode } from '../../../common/types'; import { genericEmbeddableInputIsEqual, omitGenericEmbeddableInput } from './diff_embeddable_input'; -import { - CommonLegacyEmbeddable, - legacyEmbeddableToApi, -} from './compatibility/legacy_embeddable_to_api'; function getPanelTitle(input: EmbeddableInput, output: EmbeddableOutput) { if (input.hidePanelTitles) return ''; @@ -48,8 +37,6 @@ export abstract class Embeddable< public readonly runtimeId = Embeddable.runtimeId++; - public readonly parent?: IContainer; - public readonly isContainer: boolean = false; public readonly deferEmbeddableLoad: boolean = false; public catchError?(error: EmbeddableError, domNode: HTMLElement | Element): TNode | (() => void); @@ -69,13 +56,9 @@ export abstract class Embeddable< protected renderComplete = new RenderCompleteDispatcher(); - // Listener to parent changes, if this embeddable exists in a parent, in order - // to update input when the parent changes. - private parentSubscription?: Rx.Subscription; - protected destroyed: boolean = false; - constructor(input: TEmbeddableInput, output: TEmbeddableOutput, parent?: IContainer) { + constructor(input: TEmbeddableInput, output: TEmbeddableOutput) { this.id = input.id; this.output = { @@ -93,20 +76,10 @@ export abstract class Embeddable< viewMode: ViewMode.EDIT, ...input, }; - this.parent = parent; this.inputSubject.next(this.input); this.outputSubject.next(this.output); - if (parent) { - this.parentSubscription = Rx.merge(parent.getInput$(), parent.getOutput$()).subscribe(() => { - // Make sure this panel hasn't been removed immediately after it was added, but before it finished loading. - if (!parent.getInput().panels[this.id]) return; - - const newInput = parent.getInputForChild<TEmbeddableInput>(this.id); - this.onResetInput(newInput); - }); - } this.getOutput$() .pipe( map(({ title }) => title || ''), @@ -114,113 +87,20 @@ export abstract class Embeddable< ) .subscribe((title) => this.renderComplete.setTitle(title)); - const { api, destroyAPI } = legacyEmbeddableToApi(this as unknown as CommonLegacyEmbeddable); - this.destroyAPI = destroyAPI; - ({ - uuid: this.uuid, - disableTriggers: this.disableTriggers, - onEdit: this.onEdit, - viewMode: this.viewMode, - dataViews: this.dataViews, - parentApi: this.parentApi, - panelTitle: this.panelTitle, - query$: this.query$, - dataLoading: this.dataLoading, - filters$: this.filters$, - blockingError: this.blockingError, - phase$: this.phase$, - setPanelTitle: this.setPanelTitle, - linkToLibrary: this.linkToLibrary, - hidePanelTitle: this.hidePanelTitle, - timeRange$: this.timeRange$, - isEditingEnabled: this.isEditingEnabled, - panelDescription: this.panelDescription, - defaultPanelDescription: this.defaultPanelDescription, - canLinkToLibrary: this.canLinkToLibrary, - disabledActionIds: this.disabledActionIds, - setDisabledActionIds: this.setDisabledActionIds, - unlinkFromLibrary: this.unlinkFromLibrary, - setHidePanelTitle: this.setHidePanelTitle, - defaultPanelTitle: this.defaultPanelTitle, - setTimeRange: this.setTimeRange, - getTypeDisplayName: this.getTypeDisplayName, - setPanelDescription: this.setPanelDescription, - canUnlinkFromLibrary: this.canUnlinkFromLibrary, - isCompatibleWithUnifiedSearch: this.isCompatibleWithUnifiedSearch, - savedObjectId: this.savedObjectId, - hasLockedHoverActions$: this.hasLockedHoverActions$, - lockHoverActions: this.lockHoverActions, - } = api); - setTimeout(() => { // after the constructor has finished, we initialize this embeddable if it isn't delayed if (!this.deferEmbeddableLoad) this.initializationFinished.complete(); }, 0); } - /** - * Assign compatibility API directly to the Embeddable instance. - */ - private destroyAPI; - public uuid: LegacyEmbeddableAPI['uuid']; - public disableTriggers: LegacyEmbeddableAPI['disableTriggers']; - public onEdit: LegacyEmbeddableAPI['onEdit']; - public viewMode: LegacyEmbeddableAPI['viewMode']; - public parentApi: LegacyEmbeddableAPI['parentApi']; - public dataViews: LegacyEmbeddableAPI['dataViews']; - public query$: LegacyEmbeddableAPI['query$']; - public panelTitle: LegacyEmbeddableAPI['panelTitle']; - public dataLoading: LegacyEmbeddableAPI['dataLoading']; - public filters$: LegacyEmbeddableAPI['filters$']; - public phase$: LegacyEmbeddableAPI['phase$']; - public linkToLibrary: LegacyEmbeddableAPI['linkToLibrary']; - public blockingError: LegacyEmbeddableAPI['blockingError']; - public setPanelTitle: LegacyEmbeddableAPI['setPanelTitle']; - public timeRange$: LegacyEmbeddableAPI['timeRange$']; - public hidePanelTitle: LegacyEmbeddableAPI['hidePanelTitle']; - public isEditingEnabled: LegacyEmbeddableAPI['isEditingEnabled']; - public canLinkToLibrary: LegacyEmbeddableAPI['canLinkToLibrary']; - public panelDescription: LegacyEmbeddableAPI['panelDescription']; - public defaultPanelDescription: LegacyEmbeddableAPI['defaultPanelDescription']; - public disabledActionIds: LegacyEmbeddableAPI['disabledActionIds']; - public setDisabledActionIds: LegacyEmbeddableAPI['setDisabledActionIds']; - public unlinkFromLibrary: LegacyEmbeddableAPI['unlinkFromLibrary']; - public setTimeRange: LegacyEmbeddableAPI['setTimeRange']; - public defaultPanelTitle: LegacyEmbeddableAPI['defaultPanelTitle']; - public setHidePanelTitle: LegacyEmbeddableAPI['setHidePanelTitle']; - public getTypeDisplayName: LegacyEmbeddableAPI['getTypeDisplayName']; - public setPanelDescription: LegacyEmbeddableAPI['setPanelDescription']; - public canUnlinkFromLibrary: LegacyEmbeddableAPI['canUnlinkFromLibrary']; - public isCompatibleWithUnifiedSearch: LegacyEmbeddableAPI['isCompatibleWithUnifiedSearch']; - public savedObjectId: LegacyEmbeddableAPI['savedObjectId']; - public hasLockedHoverActions$: LegacyEmbeddableAPI['hasLockedHoverActions$']; - public lockHoverActions: LegacyEmbeddableAPI['lockHoverActions']; - public async getEditHref(): Promise<string | undefined> { return this.getOutput().editUrl ?? undefined; } - public getAppContext(): EmbeddableAppContext | undefined { - return this.parent?.getAppContext(); - } - public reportsEmbeddableLoad() { return false; } - public refreshInputFromParent() { - if (!this.parent) return; - // Make sure this panel hasn't been removed immediately after it was added, but before it finished loading. - if (!this.parent.getInput().panels[this.id]) return; - - const newInput = this.parent.getInputForChild<TEmbeddableInput>(this.id); - this.onResetInput(newInput); - } - - public getIsContainer(): this is IContainer { - return this.isContainer === true; - } - /** * Reload will be called when there is a request to refresh the data or view, even if the * input data did not change. @@ -274,12 +154,6 @@ export abstract class Embeddable< } public getExplicitInput() { - const root = this.getRoot(); - if (root?.getIsContainer?.()) { - return ( - (root.getInput().panels?.[this.id]?.explicitInput as TEmbeddableInput) ?? this.getInput() - ); - } return this.getInput(); } @@ -299,28 +173,11 @@ export abstract class Embeddable< return this.output.description ?? ''; } - /** - * Returns the top most parent embeddable, or itself if this embeddable - * is not within a parent. - */ - public getRoot(): IEmbeddable | IContainer { - let root: IEmbeddable | IContainer = this; - while (root.parent) { - root = root.parent; - } - return root; - } - public updateInput(changes: Partial<TEmbeddableInput>): void { if (this.destroyed) { throw new Error('Embeddable has been destroyed'); } - if (this.parent) { - // Ensures state changes flow from container downward. - this.parent.updateInputForChild<TEmbeddableInput>(this.id, changes); - } else { - this.onInputChanged(changes); - } + this.onInputChanged(changes); } public render(el: HTMLElement): TNode | void { @@ -350,11 +207,7 @@ export abstract class Embeddable< this.inputSubject.complete(); this.outputSubject.complete(); - this.destroyAPI(); - if (this.parentSubscription) { - this.parentSubscription.unsubscribe(); - } return; } @@ -374,9 +227,6 @@ export abstract class Embeddable< */ protected setInitializationFinished() { if (!this.deferEmbeddableLoad) return; - if (this.deferEmbeddableLoad && this.parent?.isContainer) { - this.parent.setChildLoaded(this); - } this.initializationFinished.complete(); } @@ -399,11 +249,6 @@ export abstract class Embeddable< protected onFatalError(e: Error) { this.fatalError = e; this.outputSubject.error(e); - // if the container is waiting for this embeddable to complete loading, - // a fatal error counts as complete. - if (this.deferEmbeddableLoad && this.parent?.isContainer) { - this.parent.setChildLoaded(this); - } } private onResetInput(newInput: TEmbeddableInput) { diff --git a/src/plugins/embeddable/public/lib/embeddables/embeddable_factory.ts b/src/plugins/embeddable/public/lib/embeddables/embeddable_factory.ts index ec5a849cc2da8..e363af639e252 100644 --- a/src/plugins/embeddable/public/lib/embeddables/embeddable_factory.ts +++ b/src/plugins/embeddable/public/lib/embeddables/embeddable_factory.ts @@ -13,7 +13,6 @@ import type { FinderAttributes } from '@kbn/saved-objects-finder-plugin/common'; import { UiActionsPresentableGrouping } from '@kbn/ui-actions-plugin/public'; import { EmbeddableInput, EmbeddableOutput, IEmbeddable } from './i_embeddable'; import { ErrorEmbeddable } from './error_embeddable'; -import { IContainer } from '../containers/i_container'; import { PropertySpec } from '../types'; import { EmbeddableStateWithType } from '../../../common/types'; @@ -125,7 +124,7 @@ export interface EmbeddableFactory< */ getExplicitInput( initialInput?: Partial<TEmbeddableInput>, - parent?: IContainer + parent?: unknown ): Promise<Partial<TEmbeddableInput> | ExplicitInputWithAttributes>; /** @@ -138,7 +137,7 @@ export interface EmbeddableFactory< createFromSavedObject( savedObjectId: string, input: Partial<TEmbeddableInput>, - parent?: IContainer + parent?: unknown ): Promise<TEmbeddable | ErrorEmbeddable>; /** @@ -147,7 +146,7 @@ export interface EmbeddableFactory< */ create( initialInput: TEmbeddableInput, - parent?: IContainer + parent?: unknown ): Promise<TEmbeddable | ErrorEmbeddable | undefined>; order?: number; diff --git a/src/plugins/embeddable/public/lib/embeddables/error_embeddable.tsx b/src/plugins/embeddable/public/lib/embeddables/error_embeddable.tsx index 52b74215c50e8..b508d5aeb2142 100644 --- a/src/plugins/embeddable/public/lib/embeddables/error_embeddable.tsx +++ b/src/plugins/embeddable/public/lib/embeddables/error_embeddable.tsx @@ -11,7 +11,6 @@ import React, { ReactNode } from 'react'; import { PresentationPanelError } from '@kbn/presentation-panel-plugin/public'; -import { IContainer } from '../containers'; import { Embeddable } from './embeddable'; import { EmbeddableInput, EmbeddableOutput } from './i_embeddable'; @@ -23,8 +22,8 @@ export class ErrorEmbeddable extends Embeddable<EmbeddableInput, EmbeddableOutpu public readonly type = ERROR_EMBEDDABLE_TYPE; public error: Error | string; - constructor(error: Error | string, input: EmbeddableInput, parent?: IContainer) { - super(input, {}, parent); + constructor(error: Error | string, input: EmbeddableInput) { + super(input, {}); this.error = error; } @@ -33,6 +32,14 @@ export class ErrorEmbeddable extends Embeddable<EmbeddableInput, EmbeddableOutpu public render() { const error = typeof this.error === 'string' ? { message: this.error, name: '' } : this.error; - return <PresentationPanelError api={this} error={error} />; + return ( + <PresentationPanelError + api={{ + uuid: this.id, + ...this, + }} + error={error} + /> + ); } } diff --git a/src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts b/src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts index 57cf7eec6eb95..8cac11a075d1a 100644 --- a/src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts +++ b/src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts @@ -8,60 +8,13 @@ */ import { ErrorLike } from '@kbn/expressions-plugin/common'; -import { DefaultPresentationPanelApi } from '@kbn/presentation-panel-plugin/public/panel_component/types'; -import { - HasEditCapabilities, - HasType, - HasDisableTriggers, - PublishesBlockingError, - PublishesDataLoading, - PublishesDataViews, - PublishesDisabledActionIds, - PublishesUnifiedSearch, - HasParentApi, - HasUniqueId, - PublishesViewMode, - PublishesWritablePanelDescription, - PublishesWritablePanelTitle, - PublishesPhaseEvents, - PublishesSavedObjectId, - HasLegacyLibraryTransforms, - EmbeddableAppContext, - CanLockHoverActions, -} from '@kbn/presentation-publishing'; import { Observable } from 'rxjs'; import { EmbeddableInput } from '../../../common/types'; -import { IContainer } from '../containers/i_container'; -import { EmbeddableHasTimeRange } from '../filterable_embeddable/types'; -import { HasInspectorAdapters } from '../inspector'; import { Adapters } from '../types'; export type EmbeddableError = ErrorLike; export type { EmbeddableInput }; -/** - * Types for compatibility between the legacy Embeddable system and the new system - */ -export type LegacyEmbeddableAPI = HasType & - HasUniqueId & - HasDisableTriggers & - PublishesPhaseEvents & - PublishesViewMode & - PublishesDataViews & - HasEditCapabilities & - PublishesDataLoading & - HasInspectorAdapters & - PublishesBlockingError & - PublishesUnifiedSearch & - PublishesDisabledActionIds & - PublishesWritablePanelTitle & - PublishesWritablePanelDescription & - Partial<HasLegacyLibraryTransforms> & - HasParentApi<DefaultPresentationPanelApi['parentApi']> & - EmbeddableHasTimeRange & - PublishesSavedObjectId & - CanLockHoverActions; - export interface EmbeddableOutput { // Whether the embeddable is actively loading. loading?: boolean; @@ -88,19 +41,7 @@ export interface IEmbeddable< I extends EmbeddableInput = EmbeddableInput, O extends EmbeddableOutput = EmbeddableOutput, N = any -> extends LegacyEmbeddableAPI { - /** - * Is this embeddable an instance of a Container class, can it contain - * nested embeddables? - **/ - readonly isContainer: boolean; - - /** - * If this embeddable is nested inside a container, this will contain - * a reference to its parent. - **/ - readonly parent?: IContainer; - +> { /** * The type of embeddable, this is what will be used to take a serialized * embeddable and find the correct factory for which to create an instance of it. @@ -147,12 +88,6 @@ export interface IEmbeddable< */ reportsEmbeddableLoad(): boolean; - /** - * A functional representation of the isContainer variable, but helpful for typescript to - * know the shape if this returns true - */ - getIsContainer(): this is IContainer; - /** * Get the input used to instantiate this embeddable. The input is a serialized representation of * this embeddable instance and can be used to clone or re-instantiate it. Input state: @@ -222,17 +157,6 @@ export interface IEmbeddable< */ getDescription(): string | undefined; - /** - * Returns the top most parent embeddable, or itself if this embeddable - * is not within a parent. - */ - getRoot(): IEmbeddable | IContainer; - - /** - * Returns the context of this embeddable's container, or undefined. - */ - getAppContext(): EmbeddableAppContext | undefined; - /** * Renders the embeddable at the given node. * @param domNode @@ -276,7 +200,5 @@ export interface IEmbeddable< */ getExplicitInputIsEqual(lastInput: Partial<I>): Promise<boolean>; - refreshInputFromParent(): void; - untilInitializationFinished(): Promise<void>; } diff --git a/src/plugins/embeddable/public/lib/index.ts b/src/plugins/embeddable/public/lib/index.ts index bcae2e69ec407..511cc619bd5af 100644 --- a/src/plugins/embeddable/public/lib/index.ts +++ b/src/plugins/embeddable/public/lib/index.ts @@ -11,7 +11,6 @@ export * from './errors'; export * from './embeddables'; export * from './types'; export * from './triggers'; -export * from './containers'; export * from './state_transfer'; export * from './reference_or_value_embeddable'; export * from './self_styled_embeddable'; diff --git a/src/plugins/embeddable/public/store/create_store.test.ts b/src/plugins/embeddable/public/store/create_store.test.ts deleted file mode 100644 index 09413141d71c5..0000000000000 --- a/src/plugins/embeddable/public/store/create_store.test.ts +++ /dev/null @@ -1,243 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -// eslint-disable-next-line max-classes-per-file -import { createAction, createReducer, createSlice, PayloadAction } from '@reduxjs/toolkit'; -import type { Store } from 'redux'; -import { - defaultEmbeddableFactoryProvider, - Container, - ContainerInput, - Embeddable, - EmbeddableInput, - EmbeddableOutput, -} from '../lib'; -import { createStore, State } from './create_store'; -import { input } from './input_slice'; -import { output } from './output_slice'; - -interface TestEmbeddableInput extends EmbeddableInput { - custom?: string; -} - -interface TestEmbeddableOutput extends EmbeddableOutput { - custom?: string; -} - -interface TestContainerInput extends ContainerInput { - custom?: string; -} - -class TestEmbeddable extends Embeddable<TestEmbeddableInput, TestEmbeddableOutput> { - type = 'test'; - reload = jest.fn(); - render = jest.fn(); -} - -class TestContainer extends Container<Partial<TestEmbeddableInput>, TestContainerInput> { - type = 'test'; - - getInheritedInput() { - return { - custom: this.input.custom, - }; - } -} - -describe('createStore', () => { - let embeddable: TestEmbeddable; - let store: Store<State<TestEmbeddable>>; - - beforeEach(() => { - embeddable = new TestEmbeddable({ id: '12345' }, { title: 'Test' }); - store = createStore(embeddable); - }); - - it('should populate the state with the embeddable input', () => { - expect(store.getState()).toHaveProperty('input', expect.objectContaining({ id: '12345' })); - }); - - it('should populate the state with the embeddable output', () => { - expect(store.getState()).toHaveProperty('output', expect.objectContaining({ title: 'Test' })); - }); - - it('should update the embeddable input on action dispatch', () => { - store.dispatch(input.actions.setTitle('Something')); - - expect(store.getState()).toHaveProperty('input.title', 'Something'); - }); - - it('should update the embeddable output on action dispatch', () => { - store.dispatch(output.actions.setTitle('Something')); - - expect(store.getState()).toHaveProperty('output.title', 'Something'); - }); - - it('should group input updates on multiple dispatch calls', async () => { - jest.spyOn(embeddable, 'updateInput'); - store.dispatch(input.actions.setTitle('Something')); - store.dispatch(input.actions.setHidePanelTitles(true)); - await new Promise((resolve) => setTimeout(resolve)); - - expect(embeddable.updateInput).toHaveBeenCalledTimes(1); - expect(embeddable.updateInput).nthCalledWith( - 1, - expect.objectContaining({ title: 'Something', hidePanelTitles: true }) - ); - }); - - it('should group output updates on multiple dispatch calls', async () => { - jest.spyOn(embeddable, 'updateOutput'); - store.dispatch(output.actions.setTitle('Something')); - store.dispatch(output.actions.setLoading(true)); - await new Promise((resolve) => setTimeout(resolve)); - - expect(embeddable.updateOutput).toHaveBeenCalledTimes(1); - expect(embeddable.updateOutput).nthCalledWith( - 1, - expect.objectContaining({ title: 'Something', loading: true }) - ); - }); - - it('should not update input on output changes', async () => { - jest.spyOn(embeddable, 'updateInput'); - store.dispatch(output.actions.setTitle('Something')); - await new Promise((resolve) => setTimeout(resolve)); - - expect(embeddable.updateInput).not.toHaveBeenCalled(); - }); - - it('should sync input changes', () => { - jest.spyOn(embeddable, 'updateInput'); - embeddable.updateInput({ title: 'Something' }); - - expect(embeddable.updateInput).toHaveBeenCalledTimes(1); - expect(store.getState()).toHaveProperty('input.title', 'Something'); - }); - - it('should sync output changes', () => { - jest.spyOn(embeddable, 'updateOutput'); - embeddable.updateOutput({ title: 'Something' }); - - expect(embeddable.updateOutput).toHaveBeenCalledTimes(1); - expect(store.getState()).toHaveProperty('output.title', 'Something'); - }); - - it('should provide a way to use a custom reducer', async () => { - const setCustom = createAction<string>('custom'); - const customStore = createStore(embeddable, { - reducer: { - input: createReducer({} as TestEmbeddableInput, (builder) => - builder.addCase(setCustom, (state, action) => ({ ...state, custom: action.payload })) - ), - }, - }); - - jest.spyOn(embeddable, 'updateInput'); - customStore.dispatch(input.actions.setTitle('Something')); - customStore.dispatch(setCustom('Something else')); - await new Promise((resolve) => setTimeout(resolve)); - - expect(embeddable.updateInput).toHaveBeenCalledWith( - expect.objectContaining({ custom: 'Something else', title: 'Something' }) - ); - }); - - it('should provide a way to use a custom slice', async () => { - const slice = createSlice({ - name: 'test', - initialState: {} as State<TestEmbeddable>, - reducers: { - setCustom(state, action: PayloadAction<TestEmbeddableInput['custom']>) { - state.input.custom = action.payload; - state.output.custom = action.payload; - }, - }, - }); - const customStore = createStore(embeddable, { reducer: slice.reducer }); - - jest.spyOn(embeddable, 'updateInput'); - jest.spyOn(embeddable, 'updateOutput'); - customStore.dispatch(input.actions.setTitle('Something')); - customStore.dispatch(slice.actions.setCustom('Something else')); - await new Promise((resolve) => setTimeout(resolve)); - - expect(embeddable.updateInput).toHaveBeenCalledWith( - expect.objectContaining({ custom: 'Something else', title: 'Something' }) - ); - expect(embeddable.updateOutput).toHaveBeenCalledWith( - expect.objectContaining({ custom: 'Something else' }) - ); - }); - - describe('of a nested embeddable', () => { - const factory = defaultEmbeddableFactoryProvider< - TestEmbeddableInput, - TestEmbeddableOutput, - TestEmbeddable - >({ - type: 'test', - getDisplayName: () => 'Test', - isEditable: async () => true, - create: async (data, parent) => new TestEmbeddable(data, {}, parent), - }); - const getFactory = jest.fn().mockReturnValue(factory); - - let container: TestContainer; - - beforeEach(async () => { - container = new TestContainer( - { custom: 'something', id: 'id', panels: {} }, - { embeddableLoaded: {} }, - getFactory - ); - embeddable = (await container.addNewEmbeddable('test', { id: '12345' })) as TestEmbeddable; - store = createStore(embeddable); - }); - - it('should populate inherited input', () => { - expect(store.getState()).toHaveProperty('input.custom', 'something'); - }); - - it('should override inherited input on dispatch', async () => { - store.dispatch( - input.actions.update({ custom: 'something else' } as Partial<TestEmbeddableInput>) - ); - await new Promise((resolve) => setTimeout(resolve)); - - expect(store.getState()).toHaveProperty('input.custom', 'something else'); - expect(container.getInput()).not.toHaveProperty('input.custom'); - }); - - it('should restore value from the inherited input', async () => { - store.dispatch( - input.actions.update({ custom: 'something else' } as Partial<TestEmbeddableInput>) - ); - await new Promise((resolve) => setTimeout(resolve)); - store.dispatch(input.actions.update({ custom: undefined } as Partial<TestEmbeddableInput>)); - await new Promise((resolve) => setTimeout(resolve)); - - expect(store.getState()).toHaveProperty('input.custom', 'something'); - }); - - it('should not override inherited input on dispatch', async () => { - store.dispatch(input.actions.setTitle('Something')); - await new Promise((resolve) => setTimeout(resolve)); - container.updateInput({ custom: 'something else' }); - - expect(store.getState()).toHaveProperty( - 'input', - expect.objectContaining({ - title: 'Something', - custom: 'something else', - }) - ); - }); - }); -}); diff --git a/src/plugins/embeddable/public/store/create_store.ts b/src/plugins/embeddable/public/store/create_store.ts deleted file mode 100644 index a7b465a3c6db9..0000000000000 --- a/src/plugins/embeddable/public/store/create_store.ts +++ /dev/null @@ -1,133 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { chain, isEmpty, keys } from 'lodash'; -import { combineReducers, Reducer, Store, ReducersMapObject } from 'redux'; -import { configureStore, ConfigureStoreOptions } from '@reduxjs/toolkit'; -import { - debounceTime, - distinctUntilChanged, - filter, - last, - map, - pluck, - share, - takeUntil, - Observable, -} from 'rxjs'; -import reduceReducers from 'reduce-reducers'; -import type { Optional } from 'utility-types'; -import type { IEmbeddable } from '../lib'; -import { input } from './input_slice'; -import { output } from './output_slice'; - -export interface State<E extends IEmbeddable = IEmbeddable> { - input: E extends IEmbeddable<infer I, infer O> ? I : never; - output: E extends IEmbeddable<infer I, infer O> ? O : never; -} - -export interface CreateStoreOptions<S extends State> - extends Omit<ConfigureStoreOptions<S>, 'reducer'> { - reducer?: Reducer<S> | Optional<ReducersMapObject<S>, keyof State>; -} - -function createReducer<S extends State>( - reducer?: CreateStoreOptions<S>['reducer'] -): Reducer<S> | ReducersMapObject<S> { - if (reducer instanceof Function) { - const generic = combineReducers<Pick<S, keyof State>>({ - input: input.reducer, - output: output.reducer, - }) as Reducer<S>; - - return reduceReducers(generic, reducer) as Reducer<S>; - } - - return { - ...(reducer ?? {}), - input: reducer?.input ? reduceReducers(input.reducer, reducer.input) : input.reducer, - output: reducer?.output ? reduceReducers(output.reducer, reducer.output) : output.reducer, - } as ReducersMapObject<S>; -} - -function diff<T extends Record<keyof any, any>>(previous: T, current: T) { - return chain(current) - .keys() - .concat(keys(previous)) - .uniq() - .filter((key) => previous[key] !== current[key]) - .map((key) => [key, current[key]]) - .fromPairs() - .value() as Partial<T>; -} - -/** - * Creates a Redux store for the given embeddable. - * @param embeddable The embeddable instance. - * @param options The custom options to pass to the `configureStore` call. - * @returns The Redux store. - */ -export function createStore<E extends IEmbeddable = IEmbeddable, S extends State<E> = State<E>>( - embeddable: E, - { preloadedState, reducer, ...options }: CreateStoreOptions<S> = {} -): Store<S> { - const store = configureStore({ - ...options, - preloadedState: { - input: embeddable.getInput(), - output: embeddable.getOutput(), - ...(preloadedState ?? {}), - } as NonNullable<typeof preloadedState>, - reducer: createReducer(reducer), - }); - - const state$ = new Observable<S>((subscriber) => { - subscriber.add(store.subscribe(() => subscriber.next(store.getState()))); - }).pipe(share()); - const input$ = embeddable.getInput$(); - const output$ = embeddable.getOutput$(); - - state$ - .pipe( - takeUntil(input$.pipe(last())), - pluck('input'), - distinctUntilChanged(), - map((value) => diff(embeddable.getInput(), value)), - filter((patch) => !isEmpty(patch)), - debounceTime(0) - ) - .subscribe((patch) => embeddable.updateInput(patch)); - - state$ - .pipe( - takeUntil(output$.pipe(last())), - pluck('output'), - distinctUntilChanged(), - map((value) => diff(embeddable.getOutput(), value)), - filter((patch) => !isEmpty(patch)), - debounceTime(0) - ) - .subscribe((patch) => embeddable.updateOutput(patch)); - - input$ - .pipe( - map((value) => diff(store.getState().input, value)), - filter((patch) => !isEmpty(patch)) - ) - .subscribe((patch) => store.dispatch(input.actions.update(patch))); - - output$ - .pipe( - map((value) => diff(store.getState().output, value)), - filter((patch) => !isEmpty(patch)) - ) - .subscribe((patch) => store.dispatch(output.actions.update(patch))); - - return store; -} diff --git a/src/plugins/embeddable/public/store/index.ts b/src/plugins/embeddable/public/store/index.ts deleted file mode 100644 index eb75831b90bef..0000000000000 --- a/src/plugins/embeddable/public/store/index.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { input } from './input_slice'; -import { output } from './output_slice'; - -export type { CreateStoreOptions, State } from './create_store'; -export { createStore } from './create_store'; -export const actions = { - input: input.actions, - output: output.actions, -}; diff --git a/src/plugins/embeddable/public/store/input_slice.ts b/src/plugins/embeddable/public/store/input_slice.ts deleted file mode 100644 index 3b3cf8b8ee588..0000000000000 --- a/src/plugins/embeddable/public/store/input_slice.ts +++ /dev/null @@ -1,60 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { createSlice, PayloadAction } from '@reduxjs/toolkit'; -import type { EmbeddableInput } from '../lib'; - -export const input = createSlice({ - name: 'input', - initialState: {} as EmbeddableInput, - reducers: { - setDisabledActions(state, action: PayloadAction<EmbeddableInput['disabledActions']>) { - state.disabledActions = action.payload; - }, - setDisableTriggers(state, action: PayloadAction<EmbeddableInput['disableTriggers']>) { - state.disableTriggers = action.payload; - }, - setEnhancements(state, action: PayloadAction<EmbeddableInput['enhancements']>) { - state.enhancements = action.payload; - }, - setExecutionContext(state, action: PayloadAction<EmbeddableInput['executionContext']>) { - state.executionContext = action.payload; - }, - setHidePanelTitles(state, action: PayloadAction<EmbeddableInput['hidePanelTitles']>) { - state.hidePanelTitles = action.payload; - }, - setLastReloadRequestTime( - state, - action: PayloadAction<EmbeddableInput['lastReloadRequestTime']> - ) { - state.lastReloadRequestTime = action.payload; - }, - setSearchSessionId(state, action: PayloadAction<EmbeddableInput['searchSessionId']>) { - state.searchSessionId = action.payload; - }, - setSyncColors(state, action: PayloadAction<EmbeddableInput['syncColors']>) { - state.syncColors = action.payload; - }, - setSyncCursor(state, action: PayloadAction<EmbeddableInput['syncCursor']>) { - state.syncCursor = action.payload; - }, - setSyncTooltips(state, action: PayloadAction<EmbeddableInput['syncTooltips']>) { - state.syncTooltips = action.payload; - }, - setTitle(state, action: PayloadAction<EmbeddableInput['title']>) { - state.title = action.payload; - }, - setViewMode(state, action: PayloadAction<EmbeddableInput['viewMode']>) { - state.viewMode = action.payload; - }, - update(state, action: PayloadAction<Partial<EmbeddableInput>>) { - return { ...state, ...action.payload }; - }, - }, -}); diff --git a/src/plugins/embeddable/public/store/output_slice.ts b/src/plugins/embeddable/public/store/output_slice.ts deleted file mode 100644 index df53053d0e4a0..0000000000000 --- a/src/plugins/embeddable/public/store/output_slice.ts +++ /dev/null @@ -1,51 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { createSlice, PayloadAction } from '@reduxjs/toolkit'; -import type { EmbeddableOutput } from '../lib'; - -export const output = createSlice({ - name: 'output', - initialState: {} as EmbeddableOutput, - reducers: { - setLoading(state, action: PayloadAction<EmbeddableOutput['loading']>) { - state.loading = action.payload; - }, - setRendered(state, action: PayloadAction<EmbeddableOutput['rendered']>) { - state.rendered = action.payload; - }, - setError(state, action: PayloadAction<EmbeddableOutput['error']>) { - state.error = action.payload; - }, - setEditUrl(state, action: PayloadAction<EmbeddableOutput['editUrl']>) { - state.editUrl = action.payload; - }, - setEditApp(state, action: PayloadAction<EmbeddableOutput['editApp']>) { - state.editApp = action.payload; - }, - setEditPath(state, action: PayloadAction<EmbeddableOutput['editPath']>) { - state.editPath = action.payload; - }, - setDefaultTitle(state, action: PayloadAction<EmbeddableOutput['defaultTitle']>) { - state.defaultTitle = action.payload; - }, - setTitle(state, action: PayloadAction<EmbeddableOutput['title']>) { - state.title = action.payload; - }, - setEditable(state, action: PayloadAction<EmbeddableOutput['editable']>) { - state.editable = action.payload; - }, - setSavedObjectId(state, action: PayloadAction<EmbeddableOutput['savedObjectId']>) { - state.savedObjectId = action.payload; - }, - update(state, action: PayloadAction<Partial<EmbeddableOutput>>) { - return { ...state, ...action.payload }; - }, - }, -}); diff --git a/src/plugins/embeddable/public/tests/fixtures/hello_world_embeddable.tsx b/src/plugins/embeddable/public/tests/fixtures/hello_world_embeddable.tsx deleted file mode 100644 index b70e1732f1e65..0000000000000 --- a/src/plugins/embeddable/public/tests/fixtures/hello_world_embeddable.tsx +++ /dev/null @@ -1,37 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { Embeddable, EmbeddableInput, IContainer } from '../..'; - -export const HELLO_WORLD_EMBEDDABLE = 'HELLO_WORLD_EMBEDDABLE'; - -export class HelloWorldEmbeddable extends Embeddable { - // The type of this embeddable. This will be used to find the appropriate factory - // to instantiate this kind of embeddable. - public readonly type = HELLO_WORLD_EMBEDDABLE; - - constructor(initialInput: EmbeddableInput, parent?: IContainer) { - super(initialInput, {}, parent); - } - - /** - * Render yourself at the dom node using whatever framework you like, angular, react, or just plain - * vanilla js. - * @param node - */ - public render(node: HTMLElement) { - node.innerHTML = '<div data-test-subj="helloWorldEmbeddable">HELLO WORLD!</div>'; - } - - /** - * This is mostly relevant for time based embeddables which need to update data - * even if EmbeddableInput has not changed at all. - */ - public reload() {} -} diff --git a/src/plugins/embeddable/public/tests/fixtures/hello_world_embeddable_factory.ts b/src/plugins/embeddable/public/tests/fixtures/hello_world_embeddable_factory.ts deleted file mode 100644 index 83c6d94748c56..0000000000000 --- a/src/plugins/embeddable/public/tests/fixtures/hello_world_embeddable_factory.ts +++ /dev/null @@ -1,36 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { i18n } from '@kbn/i18n'; -import { IContainer, EmbeddableInput, EmbeddableFactoryDefinition, EmbeddableFactory } from '../..'; -import { HelloWorldEmbeddable, HELLO_WORLD_EMBEDDABLE } from './hello_world_embeddable'; - -export type HelloWorldEmbeddableFactory = EmbeddableFactory; -export class HelloWorldEmbeddableFactoryDefinition implements EmbeddableFactoryDefinition { - public readonly type = HELLO_WORLD_EMBEDDABLE; - - /** - * In our simple example, we let everyone have permissions to edit this. Most - * embeddables should check the UI Capabilities service to be sure of - * the right permissions. - */ - public async isEditable() { - return true; - } - - public async create(initialInput: EmbeddableInput, parent?: IContainer) { - return new HelloWorldEmbeddable(initialInput, parent); - } - - public getDisplayName() { - return i18n.translate('embeddableApi.helloworld.displayName', { - defaultMessage: 'hello world', - }); - } -} diff --git a/src/plugins/embeddable/public/tests/fixtures/hello_world_embeddable_react.tsx b/src/plugins/embeddable/public/tests/fixtures/hello_world_embeddable_react.tsx deleted file mode 100644 index 42db1d55c4379..0000000000000 --- a/src/plugins/embeddable/public/tests/fixtures/hello_world_embeddable_react.tsx +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { HelloWorldEmbeddable } from './hello_world_embeddable'; - -export class HelloWorldEmbeddableReact extends HelloWorldEmbeddable { - public render() { - return <div data-test-subj="helloWorldEmbeddable">HELLO WORLD!</div>; - } -} diff --git a/src/plugins/embeddable/public/tests/fixtures/index.ts b/src/plugins/embeddable/public/tests/fixtures/index.ts deleted file mode 100644 index 1f6f7a247ed86..0000000000000 --- a/src/plugins/embeddable/public/tests/fixtures/index.ts +++ /dev/null @@ -1,12 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './hello_world_embeddable'; -export * from './hello_world_embeddable_factory'; -export * from './hello_world_embeddable_react'; diff --git a/src/plugins/embeddable/tsconfig.json b/src/plugins/embeddable/tsconfig.json index bf97096d1484b..249612d6d0e49 100644 --- a/src/plugins/embeddable/tsconfig.json +++ b/src/plugins/embeddable/tsconfig.json @@ -19,7 +19,6 @@ "@kbn/saved-objects-finder-plugin", "@kbn/usage-collection-plugin", "@kbn/content-management-plugin", - "@kbn/data-views-plugin", "@kbn/presentation-panel-plugin", "@kbn/presentation-publishing", "@kbn/presentation-containers", diff --git a/src/plugins/guided_onboarding/README.md b/src/plugins/guided_onboarding/README.md index 8190ee82c2008..f5e1ae42e71ab 100755 --- a/src/plugins/guided_onboarding/README.md +++ b/src/plugins/guided_onboarding/README.md @@ -126,7 +126,7 @@ The guided onboarding exposes a function `registerGuideConfig(guideId: GuideId, - enterprise search: `x-pack/plugins/enterprise_search/server/plugin.ts` - observability: `x-pack/solutions/observability/plugins/observability/server/plugin.ts` -- security solution: `x-pack/plugins/security_solution/server/plugin.ts` +- security solution: `x-pack/solutions/security/plugins/security_solution/server/plugin.ts` ## Adding a new guide diff --git a/src/plugins/home/public/services/feature_catalogue/feature_catalogue_registry.test.ts b/src/plugins/home/public/services/feature_catalogue/feature_catalogue_registry.test.ts index ab264d6ff1d15..a9463ca5083fc 100644 --- a/src/plugins/home/public/services/feature_catalogue/feature_catalogue_registry.test.ts +++ b/src/plugins/home/public/services/feature_catalogue/feature_catalogue_registry.test.ts @@ -17,7 +17,7 @@ import { const DASHBOARD_FEATURE: FeatureCatalogueEntry = { id: 'dashboard', title: 'Dashboard', - description: 'Display and share a collection of visualizations and saved searches.', + description: 'Display and share a collection of visualizations and search results.', icon: 'dashboardApp', path: `/app/kibana#dashboard`, showOnHomePage: true, diff --git a/src/plugins/image_embeddable/public/imports.ts b/src/plugins/image_embeddable/public/imports.ts index 1ec91560de8b4..dbe06b00daea9 100644 --- a/src/plugins/image_embeddable/public/imports.ts +++ b/src/plugins/image_embeddable/public/imports.ts @@ -18,11 +18,6 @@ export type { export type { FileImageMetadata } from '@kbn/shared-ux-file-types'; -export type { - IContainer, - EmbeddableInput, - EmbeddableFactoryDefinition, -} from '@kbn/embeddable-plugin/public'; export type { ApplicationStart, OverlayStart, ThemeServiceStart } from '@kbn/core/public'; export type { UiActionsStart, UiActionsSetup } from '@kbn/ui-actions-plugin/public'; diff --git a/src/plugins/inspector/README.md b/src/plugins/inspector/README.md index 99984b53065ad..f9eace25a25c3 100644 --- a/src/plugins/inspector/README.md +++ b/src/plugins/inspector/README.md @@ -14,7 +14,7 @@ a specific view is available depends on the used adapters. ## Inspector Adapters Since the Inspector panel itself is not tied to a specific type of elements (visualizations, -saved searches, etc.), everything you need to open the inspector is a collection +Discover sessions, etc.), everything you need to open the inspector is a collection of so called inspector adapters. A single adapter can be any type of JavaScript class. Most likely an adapter offers some kind of logging capabilities for the element, that diff --git a/src/plugins/saved_objects_management/public/management_section/object_view/components/__snapshots__/not_found_errors.test.tsx.snap b/src/plugins/saved_objects_management/public/management_section/object_view/components/__snapshots__/not_found_errors.test.tsx.snap index 0c5045a1c8662..6e96c51be7be3 100644 --- a/src/plugins/saved_objects_management/public/management_section/object_view/components/__snapshots__/not_found_errors.test.tsx.snap +++ b/src/plugins/saved_objects_management/public/management_section/object_view/components/__snapshots__/not_found_errors.test.tsx.snap @@ -124,7 +124,7 @@ exports[`NotFoundErrors component renders correctly for search type 1`] = ` class="euiText emotion-euiText-s-euiTextColor-default" > <div> - The saved search associated with this object no longer exists. + The Discover session associated with this object no longer exists. </div> <div> If you know what this error means, you can use the diff --git a/src/plugins/saved_objects_management/public/management_section/object_view/components/not_found_errors.test.tsx b/src/plugins/saved_objects_management/public/management_section/object_view/components/not_found_errors.test.tsx index 41919c9172e56..d1d53c0807ba8 100644 --- a/src/plugins/saved_objects_management/public/management_section/object_view/components/not_found_errors.test.tsx +++ b/src/plugins/saved_objects_management/public/management_section/object_view/components/not_found_errors.test.tsx @@ -26,7 +26,7 @@ describe('NotFoundErrors component', () => { const callOut = mounted.find('EuiCallOut'); expect(callOut.render()).toMatchSnapshot(); expect(mounted.text()).toMatchInlineSnapshot( - `"There is a problem with this saved objectThe saved search associated with this object no longer exists.If you know what this error means, you can use the Saved objects APIs(external, opens in a new tab or window) to fix it — otherwise click the delete button above."` + `"There is a problem with this saved objectThe Discover session associated with this object no longer exists.If you know what this error means, you can use the Saved objects APIs(external, opens in a new tab or window) to fix it — otherwise click the delete button above."` ); }); diff --git a/src/plugins/saved_objects_management/public/management_section/object_view/components/not_found_errors.tsx b/src/plugins/saved_objects_management/public/management_section/object_view/components/not_found_errors.tsx index e89762bd2105f..ddee0bb9ee38a 100644 --- a/src/plugins/saved_objects_management/public/management_section/object_view/components/not_found_errors.tsx +++ b/src/plugins/saved_objects_management/public/management_section/object_view/components/not_found_errors.tsx @@ -32,7 +32,7 @@ export const NotFoundErrors = ({ type, docLinks }: NotFoundErrors) => { return ( <FormattedMessage id="savedObjectsManagement.view.savedSearchDoesNotExistErrorMessage" - defaultMessage="The saved search associated with this object no longer exists." + defaultMessage="The Discover session associated with this object no longer exists." /> ); case 'index-pattern': diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_summary.scss b/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_summary.scss index 4b46c1244e246..0dc6b0e3ddc5d 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_summary.scss +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/import_summary.scss @@ -8,11 +8,11 @@ } .savedObjectsManagementImportSummary__createdCount { - color: $euiColorSuccessText; + color: $euiColorTextSuccess; } .savedObjectsManagementImportSummary__errorCount { - color: $euiColorDangerText; + color: $euiColorTextDanger; } .savedObjectsManagementImportSummary__icon { diff --git a/src/plugins/saved_search/README.md b/src/plugins/saved_search/README.md index d2234f04494a1..cf2762c23d23c 100644 --- a/src/plugins/saved_search/README.md +++ b/src/plugins/saved_search/README.md @@ -1,3 +1,4 @@ # Saved search Contains the saved search saved object definition and helpers. +This object is created when a user saves their current session in the Discover app. diff --git a/src/plugins/saved_search/common/constants.ts b/src/plugins/saved_search/common/constants.ts index f30466d220967..cc5fdcebc6dae 100644 --- a/src/plugins/saved_search/common/constants.ts +++ b/src/plugins/saved_search/common/constants.ts @@ -8,6 +8,8 @@ */ export const SavedSearchType = 'search'; +// While the legacy SO name has to stay "search" the display name can be customized. +export const SavedSearchTypeDisplayName = 'discover session'; // visible on Saved Objects page export const LATEST_VERSION = 1; diff --git a/src/plugins/saved_search/common/index.ts b/src/plugins/saved_search/common/index.ts index 1900a7e90d168..c29caaf9bcde7 100644 --- a/src/plugins/saved_search/common/index.ts +++ b/src/plugins/saved_search/common/index.ts @@ -25,6 +25,7 @@ export enum VIEW_MODE { export { SavedSearchType, + SavedSearchTypeDisplayName, LATEST_VERSION, MIN_SAVED_SEARCH_SAMPLE_SIZE, MAX_SAVED_SEARCH_SAMPLE_SIZE, diff --git a/src/plugins/saved_search/public/plugin.ts b/src/plugins/saved_search/public/plugin.ts index 5570e0fc8d5ab..17132a1a7a415 100644 --- a/src/plugins/saved_search/public/plugin.ts +++ b/src/plugins/saved_search/public/plugin.ts @@ -102,7 +102,7 @@ export class SavedSearchPublicPlugin latest: LATEST_VERSION, }, name: i18n.translate('savedSearch.contentManagementType', { - defaultMessage: 'Saved search', + defaultMessage: 'Discover session', }), }); diff --git a/src/plugins/saved_search/public/services/saved_searches/check_for_duplicate_title.ts b/src/plugins/saved_search/public/services/saved_searches/check_for_duplicate_title.ts index 0efc945a867e1..6eb364afec12f 100644 --- a/src/plugins/saved_search/public/services/saved_searches/check_for_duplicate_title.ts +++ b/src/plugins/saved_search/public/services/saved_searches/check_for_duplicate_title.ts @@ -54,7 +54,7 @@ export const checkForDuplicateTitle = async ({ (await hasDuplicatedTitle(title, contentManagement)) ) { onTitleDuplicate(); - return Promise.reject(new Error(`Saved search title already exists: ${title}`)); + return Promise.reject(new Error(`Saved Discover session title already exists: ${title}`)); } return; diff --git a/src/plugins/saved_search/server/saved_objects/search.ts b/src/plugins/saved_search/server/saved_objects/search.ts index 153d95c6d7cb5..90dbd6fbe6206 100644 --- a/src/plugins/saved_search/server/saved_objects/search.ts +++ b/src/plugins/saved_search/server/saved_objects/search.ts @@ -11,6 +11,7 @@ import { ANALYTICS_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server'; import { SavedObjectsType } from '@kbn/core/server'; import { MigrateFunctionsObject } from '@kbn/kibana-utils-plugin/common'; import { getAllMigrations } from './search_migrations'; +import { SavedSearchTypeDisplayName } from '../../common/constants'; import { SCHEMA_SEARCH_V8_8_0, SCHEMA_SEARCH_MODEL_VERSION_1, @@ -32,6 +33,7 @@ export function getSavedSearchObjectType( management: { icon: 'discoverApp', defaultSearchField: 'title', + displayName: SavedSearchTypeDisplayName, importableAndExportable: true, getTitle(obj) { return obj.attributes.title; diff --git a/src/plugins/share/public/components/tabs/embed/embed_content.test.tsx b/src/plugins/share/public/components/tabs/embed/embed_content.test.tsx index ee9fdf01588df..edbb9ebb47995 100644 --- a/src/plugins/share/public/components/tabs/embed/embed_content.test.tsx +++ b/src/plugins/share/public/components/tabs/embed/embed_content.test.tsx @@ -18,12 +18,7 @@ describe('Share modal embed content tab', () => { beforeEach(() => { component = mountWithIntl( - <EmbedContent - isDirty={false} - objectType="dashboard" - setIsNotSaved={() => jest.fn()} - shareableUrl="/home#/" - /> + <EmbedContent isDirty={false} objectType="dashboard" shareableUrl="/home#/" /> ); }); diff --git a/src/plugins/share/public/components/tabs/embed/embed_content.tsx b/src/plugins/share/public/components/tabs/embed/embed_content.tsx index 5a9163097c8dc..a3bc6048e64e5 100644 --- a/src/plugins/share/public/components/tabs/embed/embed_content.tsx +++ b/src/plugins/share/public/components/tabs/embed/embed_content.tsx @@ -34,7 +34,6 @@ type EmbedProps = Pick< | 'objectType' | 'isDirty' > & { - setIsNotSaved: () => void; objectConfig?: ShareContextObjectTypeConfig; }; @@ -55,7 +54,6 @@ export const EmbedContent = ({ shareableUrl, objectType, objectConfig = {}, - setIsNotSaved, isDirty, }: EmbedProps) => { const isMounted = useMountedState(); @@ -67,10 +65,6 @@ export const EmbedContent = ({ const [anonymousAccessParameters] = useState<AnonymousAccessState['accessURLParameters']>(null); const [usePublicUrl] = useState<boolean>(false); - useEffect(() => { - if (objectType !== 'dashboard') setIsNotSaved(); - }, [url, setIsNotSaved, objectType]); - const makeUrlEmbeddable = useCallback((tempUrl: string): string => { const embedParam = '?embed=true'; const urlHasQueryString = tempUrl.indexOf('?') !== -1; diff --git a/src/plugins/share/public/components/tabs/embed/index.tsx b/src/plugins/share/public/components/tabs/embed/index.tsx index 44d61833268cd..3c74ce3fe0b13 100644 --- a/src/plugins/share/public/components/tabs/embed/index.tsx +++ b/src/plugins/share/public/components/tabs/embed/index.tsx @@ -8,35 +8,13 @@ */ import { i18n } from '@kbn/i18n'; -import React, { useCallback } from 'react'; +import React from 'react'; import { type IModalTabDeclaration } from '@kbn/shared-ux-tabbed-modal'; import { EmbedContent } from './embed_content'; import { useShareTabsContext } from '../../context'; -const EMBED_TAB_ACTIONS = { - SET_EMBED_URL: 'SET_EMBED_URL', - SET_IS_NOT_SAVED: 'SET_IS_NOT_SAVED', -}; - type IEmbedTab = IModalTabDeclaration<{ url: string; isNotSaved: boolean }>; -const embedTabReducer: IEmbedTab['reducer'] = (state = { url: '', isNotSaved: false }, action) => { - switch (action.type) { - case EMBED_TAB_ACTIONS.SET_IS_NOT_SAVED: - return { - ...state, - isNotSaved: action.payload, - }; - case EMBED_TAB_ACTIONS.SET_IS_NOT_SAVED: - return { - ...state, - isNotSaved: action.payload, - }; - default: - return state; - } -}; - const EmbedTabContent: NonNullable<IEmbedTab['content']> = ({ state, dispatch }) => { const { embedUrlParamExtensions, @@ -47,13 +25,6 @@ const EmbedTabContent: NonNullable<IEmbedTab['content']> = ({ state, dispatch }) isDirty, } = useShareTabsContext()!; - const setIsNotSaved = useCallback(() => { - dispatch({ - type: EMBED_TAB_ACTIONS.SET_IS_NOT_SAVED, - payload: objectType === 'dashboard' ? isDirty : false, - }); - }, [dispatch, objectType, isDirty]); - return ( <EmbedContent {...{ @@ -62,8 +33,6 @@ const EmbedTabContent: NonNullable<IEmbedTab['content']> = ({ state, dispatch }) shareableUrl, objectType, objectConfig: objectTypeMeta?.config?.embed, - isNotSaved: state?.isNotSaved, - setIsNotSaved, isDirty, }} /> @@ -75,6 +44,5 @@ export const embedTab: IEmbedTab = { name: i18n.translate('share.contextMenu.embedCodeTab', { defaultMessage: 'Embed', }), - reducer: embedTabReducer, content: EmbedTabContent, }; diff --git a/src/plugins/unified_doc_viewer/public/components/doc_viewer_flyout/use_flyout_a11y.tsx b/src/plugins/unified_doc_viewer/public/components/doc_viewer_flyout/use_flyout_a11y.tsx index 84c47cc4bd063..18cc98fb94b89 100644 --- a/src/plugins/unified_doc_viewer/public/components/doc_viewer_flyout/use_flyout_a11y.tsx +++ b/src/plugins/unified_doc_viewer/public/components/doc_viewer_flyout/use_flyout_a11y.tsx @@ -37,7 +37,7 @@ export const useFlyoutA11y = ({ isXlScreen }: { isXlScreen: boolean }) => { a11yProps: { ref: setFlyoutEl, role: isXlScreen ? 'dialog' : undefined, - tabindex: isXlScreen ? 0 : undefined, + tabIndex: isXlScreen ? 0 : undefined, 'aria-describedby': isXlScreen ? descriptionId : undefined, 'data-no-focus-lock': isXlScreen || undefined, }, diff --git a/src/plugins/vis_default_editor/public/components/sidebar/sidebar_title.tsx b/src/plugins/vis_default_editor/public/components/sidebar/sidebar_title.tsx index b83a3330cce2f..41199116837cb 100644 --- a/src/plugins/vis_default_editor/public/components/sidebar/sidebar_title.tsx +++ b/src/plugins/vis_default_editor/public/components/sidebar/sidebar_title.tsx @@ -63,7 +63,7 @@ export function LinkedSearch({ savedSearch, eventEmitter }: LinkedSearchProps) { const linkButtonAriaLabel = i18n.translate( 'visDefaultEditor.sidebar.savedSearch.linkButtonAriaLabel', { - defaultMessage: 'Link to saved search. Click to learn more or break link.', + defaultMessage: 'Link to Discover session. Click to learn more or break link.', } ); @@ -82,7 +82,7 @@ export function LinkedSearch({ savedSearch, eventEmitter }: LinkedSearchProps) { <EuiTitle size="xs" className="eui-textTruncate"> <h2 title={i18n.translate('visDefaultEditor.sidebar.savedSearch.titleAriaLabel', { - defaultMessage: 'Saved search: {title}', + defaultMessage: 'Discover session: {title}', values: { title: savedSearch.title, }, @@ -113,7 +113,7 @@ export function LinkedSearch({ savedSearch, eventEmitter }: LinkedSearchProps) { <EuiPopoverTitle> <FormattedMessage id="visDefaultEditor.sidebar.savedSearch.popoverTitle" - defaultMessage="Linked to saved search" + defaultMessage="Linked to Discover session" /> </EuiPopoverTitle> <div css={{ width: 260 }}> @@ -134,7 +134,7 @@ export function LinkedSearch({ savedSearch, eventEmitter }: LinkedSearchProps) { <p> <FormattedMessage id="visDefaultEditor.sidebar.savedSearch.popoverHelpText" - defaultMessage="Subsequent modifications to this saved search are reflected in the visualization. To disable automatic updates, remove the link." + defaultMessage="Subsequent modifications to this Discover session are reflected in the visualization. To disable automatic updates, remove the link." /> </p> <p> @@ -147,7 +147,7 @@ export function LinkedSearch({ savedSearch, eventEmitter }: LinkedSearchProps) { > <FormattedMessage id="visDefaultEditor.sidebar.savedSearch.unlinkSavedSearchButtonText" - defaultMessage="Remove link to saved search" + defaultMessage="Remove link to Discover session" /> </EuiButton> </p> diff --git a/src/plugins/visualizations/public/index.ts b/src/plugins/visualizations/public/index.ts index 54b37b0a237e1..4c3dc07a9eb5d 100644 --- a/src/plugins/visualizations/public/index.ts +++ b/src/plugins/visualizations/public/index.ts @@ -10,7 +10,7 @@ import { PublicContract } from '@kbn/utility-types'; import { PluginInitializerContext } from '@kbn/core/public'; import { VisualizationsPlugin, VisualizationsSetup, VisualizationsStart } from './plugin'; -import type { VisualizeEmbeddableFactory, VisualizeEmbeddable } from './legacy/embeddable'; +import type { VisualizeEmbeddable } from './legacy/embeddable'; export function plugin(initializerContext: PluginInitializerContext) { return new VisualizationsPlugin(initializerContext); @@ -38,7 +38,6 @@ export type { } from './vis_types'; export type { VisualizeEditorInput } from './embeddable/types'; export type { Vis, SerializedVis, SerializedVisData, VisData } from './vis'; -export type VisualizeEmbeddableFactoryContract = PublicContract<VisualizeEmbeddableFactory>; export type VisualizeEmbeddableContract = PublicContract<VisualizeEmbeddable>; export type { SchemaConfig } from '../common/types'; export { updateOldState } from './legacy/vis_update_state'; diff --git a/src/plugins/visualizations/public/legacy/embeddable/create_vis_embeddable_from_object.ts b/src/plugins/visualizations/public/legacy/embeddable/create_vis_embeddable_from_object.ts index b684bd83402c5..76acb5da63c53 100644 --- a/src/plugins/visualizations/public/legacy/embeddable/create_vis_embeddable_from_object.ts +++ b/src/plugins/visualizations/public/legacy/embeddable/create_vis_embeddable_from_object.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { IContainer, ErrorEmbeddable } from '@kbn/embeddable-plugin/public'; +import { ErrorEmbeddable } from '@kbn/embeddable-plugin/public'; import type { DataView } from '@kbn/data-views-plugin/public'; import { Vis } from '../../types'; import type { @@ -16,10 +16,10 @@ import type { VisualizeByValueInput, VisualizeByReferenceInput, VisualizeSavedObjectAttributes, + VisualizeEmbeddableDeps, } from './visualize_embeddable'; import { getHttp, getTimeFilter, getCapabilities } from '../../services'; import { urlFor } from '../../utils/saved_visualize_utils'; -import { VisualizeEmbeddableFactoryDeps } from './visualize_embeddable_factory'; import { createVisualizeEmbeddableAsync } from './visualize_embeddable_async'; import { AttributeService } from './attribute_service'; @@ -28,7 +28,7 @@ import { AttributeService } from './attribute_service'; * used within the visualize editor. */ export const createVisEmbeddableFromObject = - (deps: VisualizeEmbeddableFactoryDeps) => + (deps: VisualizeEmbeddableDeps) => async ( vis: Vis, input: Partial<VisualizeInput> & { id: string }, @@ -36,8 +36,7 @@ export const createVisEmbeddableFromObject = VisualizeSavedObjectAttributes, VisualizeByValueInput, VisualizeByReferenceInput - >, - parent?: IContainer + > ): Promise<VisualizeEmbeddable | ErrorEmbeddable> => { try { const visId = vis.id as string; @@ -75,11 +74,10 @@ export const createVisEmbeddableFromObject = capabilities, }, input, - attributeService, - parent + attributeService ); } catch (e) { console.error(e); // eslint-disable-line no-console - return new ErrorEmbeddable(e, input, parent); + return new ErrorEmbeddable(e, input); } }; diff --git a/src/plugins/visualizations/public/legacy/embeddable/index.ts b/src/plugins/visualizations/public/legacy/embeddable/index.ts index 979a631f8c665..6aa08f7b847de 100644 --- a/src/plugins/visualizations/public/legacy/embeddable/index.ts +++ b/src/plugins/visualizations/public/legacy/embeddable/index.ts @@ -7,7 +7,6 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -export { VisualizeEmbeddableFactory } from './visualize_embeddable_factory'; export { VISUALIZE_EMBEDDABLE_TYPE, COMMON_VISUALIZATION_GROUPING } from './constants'; export { createVisEmbeddableFromObject } from './create_vis_embeddable_from_object'; diff --git a/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable.tsx b/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable.tsx index bfd87435345e5..3ef1947dc5d3d 100644 --- a/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable.tsx +++ b/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable.tsx @@ -27,7 +27,6 @@ import { EmbeddableInput, EmbeddableOutput, FilterableEmbeddable, - IContainer, ReferenceOrValueEmbeddable, SavedObjectEmbeddableInput, } from '@kbn/embeddable-plugin/public'; @@ -41,18 +40,28 @@ import type { RenderMode } from '@kbn/expressions-plugin/common'; import { DATA_VIEW_SAVED_OBJECT_TYPE } from '@kbn/data-views-plugin/public'; import { mapAndFlattenFilters } from '@kbn/data-plugin/public'; import { isChartSizeEvent } from '@kbn/chart-expressions-common'; +import { StartServicesGetter } from '@kbn/kibana-utils-plugin/public'; import { isFallbackDataView } from '../../visualize_app/utils'; import { VisualizationMissedSavedObjectError } from '../../components/visualization_missed_saved_object_error'; import VisualizationError from '../../components/visualization_error'; import { VISUALIZE_EMBEDDABLE_TYPE } from './constants'; import { SerializedVis, Vis } from '../../vis'; -import { getApplication, getExecutionContext, getExpressions, getUiActions } from '../../services'; +import { getApplication, getExpressions, getUiActions } from '../../services'; import { VIS_EVENT_TO_TRIGGER } from '../../embeddable/events'; -import { VisualizeEmbeddableFactoryDeps } from './visualize_embeddable_factory'; import { getSavedVisualization } from '../../utils/saved_visualize_utils'; import { VisSavedObject } from '../../types'; import { toExpressionAst } from '../../embeddable/to_ast'; import { AttributeService } from './attribute_service'; +import { VisualizationsStartDeps } from '../../plugin'; + +export interface VisualizeEmbeddableDeps { + start: StartServicesGetter< + Pick< + VisualizationsStartDeps, + 'inspector' | 'embeddable' | 'data' | 'savedObjectsTaggingOss' | 'spaces' + > + >; +} export interface VisualizeEmbeddableConfiguration { vis: Vis; @@ -60,7 +69,7 @@ export interface VisualizeEmbeddableConfiguration { editPath: string; editUrl: string; capabilities: { visualizeSave: boolean; dashboardSave: boolean; visualizeOpen: boolean }; - deps: VisualizeEmbeddableFactoryDeps; + deps: VisualizeEmbeddableDeps; } export interface VisualizeInput extends EmbeddableInput { @@ -120,7 +129,7 @@ export class VisualizeEmbeddable private warningDomNode: any; public readonly type = VISUALIZE_EMBEDDABLE_TYPE; private abortController?: AbortController; - private readonly deps: VisualizeEmbeddableFactoryDeps; + private readonly deps: VisualizeEmbeddableDeps; private readonly inspectorAdapters?: Adapters; private attributeService?: AttributeService< VisualizeSavedObjectAttributes, @@ -140,22 +149,17 @@ export class VisualizeEmbeddable VisualizeSavedObjectAttributes, VisualizeByValueInput, VisualizeByReferenceInput - >, - parent?: IContainer + > ) { - super( - initialInput, - { - defaultTitle: vis.title, - defaultDescription: vis.description, - editPath, - editApp: 'visualize', - editUrl, - indexPatterns, - visTypeName: vis.type.name, - }, - parent - ); + super(initialInput, { + defaultTitle: vis.title, + defaultDescription: vis.description, + editPath, + editApp: 'visualize', + editUrl, + indexPatterns, + visTypeName: vis.type.name, + }); this.deps = deps; this.timefilter = timefilter; this.syncColors = this.input.syncColors; @@ -270,8 +274,6 @@ export class VisualizeEmbeddable this.vis.uiState.on('change', this.uiStateChangeHandler); } - } else if (this.parent) { - this.vis.uiState.clearAllKeys(); } } @@ -572,7 +574,6 @@ export class VisualizeEmbeddable }; private getExecutionContext() { - const parentContext = this.parent?.getInput().executionContext || getExecutionContext().get(); const child: KibanaExecutionContext = { type: 'agg_based', name: this.vis.type.name, @@ -582,7 +583,6 @@ export class VisualizeEmbeddable }; return { - ...parentContext, child, }; } diff --git a/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable_factory.test.ts b/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable_factory.test.ts deleted file mode 100644 index 61f5cee020503..0000000000000 --- a/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable_factory.test.ts +++ /dev/null @@ -1,242 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EmbeddableStateWithType } from '@kbn/embeddable-plugin/common'; -import { VisualizeEmbeddableFactory, VisualizeInput } from '.'; -import { VisualizeEmbeddableFactoryDeps } from './visualize_embeddable_factory'; - -describe('visualize_embeddable_factory', () => { - const factory = new VisualizeEmbeddableFactory({} as VisualizeEmbeddableFactoryDeps); - test('extract saved search references for search source state and not store them in state', () => { - const { state, references } = factory.extract({ - savedVis: { - type: 'area', - params: {}, - uiState: {}, - data: { - aggs: [ - { - id: '1', - enabled: true, - type: 'count', - params: {}, - schema: 'metric', - }, - ], - searchSource: { - query: { - query: '', - language: 'kuery', - }, - filter: [], - }, - savedSearchId: '123', - }, - }, - enhancements: {}, - type: 'visualization', - } as unknown as EmbeddableStateWithType); - expect(references).toEqual([ - { - type: 'search', - name: 'search_0', - id: '123', - }, - ]); - expect((state as unknown as VisualizeInput).savedVis?.data.savedSearchId).toBeUndefined(); - }); - - test('extract data view references for search source state and not store them in state', () => { - const { state, references } = factory.extract({ - savedVis: { - type: 'area', - params: {}, - uiState: {}, - data: { - aggs: [ - { - id: '1', - enabled: true, - type: 'count', - params: {}, - schema: 'metric', - }, - ], - searchSource: { - query: { - query: '', - language: 'kuery', - }, - index: '123', - filter: [], - }, - }, - }, - enhancements: {}, - type: 'visualization', - } as unknown as EmbeddableStateWithType); - expect(references).toEqual([ - { - type: 'index-pattern', - name: ( - (state as unknown as VisualizeInput).savedVis?.data.searchSource as { - indexRefName: string; - } - ).indexRefName, - id: '123', - }, - ]); - expect((state as unknown as VisualizeInput).savedVis?.data.searchSource.index).toBeUndefined(); - }); - - test('inject data view references into search source state', () => { - const embeddedState = factory.inject( - { - savedVis: { - type: 'area', - params: {}, - uiState: {}, - data: { - aggs: [ - { - id: '1', - enabled: true, - type: 'count', - params: {}, - schema: 'metric', - }, - ], - searchSource: { - query: { - query: '', - language: 'kuery', - }, - indexRefName: 'x', - filter: [], - }, - }, - }, - enhancements: {}, - type: 'visualization', - } as unknown as EmbeddableStateWithType, - [{ name: 'x', id: '123', type: 'index-pattern' }] - ) as VisualizeInput; - expect(embeddedState.savedVis!.data.searchSource.index).toBe('123'); - expect( - (embeddedState.savedVis!.data.searchSource as { indexRefName: string }).indexRefName - ).toBe(undefined); - }); - - test('inject data view reference into search source state even if it is in injected state already', () => { - const embeddedState = factory.inject( - { - savedVis: { - type: 'area', - params: {}, - uiState: {}, - data: { - aggs: [ - { - id: '1', - enabled: true, - type: 'count', - params: {}, - schema: 'metric', - }, - ], - searchSource: { - query: { - query: '', - language: 'kuery', - }, - index: '456', - filter: [], - }, - }, - }, - enhancements: {}, - type: 'visualization', - } as unknown as EmbeddableStateWithType, - [{ name: 'kibanaSavedObjectMeta.searchSourceJSON.index', id: '123', type: 'index-pattern' }] - ) as VisualizeInput; - expect(embeddedState.savedVis!.data.searchSource.index).toBe('123'); - expect( - (embeddedState.savedVis!.data.searchSource as { indexRefName: string }).indexRefName - ).toBe(undefined); - }); - - test('inject search reference into search source state', () => { - const embeddedState = factory.inject( - { - savedVis: { - type: 'area', - params: {}, - uiState: {}, - data: { - aggs: [ - { - id: '1', - enabled: true, - type: 'count', - params: {}, - schema: 'metric', - }, - ], - searchSource: { - query: { - query: '', - language: 'kuery', - }, - filter: [], - }, - }, - }, - enhancements: {}, - type: 'visualization', - } as unknown as EmbeddableStateWithType, - [{ name: 'search_0', id: '123', type: 'search' }] - ); - expect((embeddedState as VisualizeInput).savedVis!.data.savedSearchId).toBe('123'); - }); - - test('inject search reference into search source state even if it is injected already', () => { - const embeddedState = factory.inject( - { - savedVis: { - type: 'area', - params: {}, - uiState: {}, - data: { - aggs: [ - { - id: '1', - enabled: true, - type: 'count', - params: {}, - schema: 'metric', - }, - ], - searchSource: { - query: { - query: '', - language: 'kuery', - }, - filter: [], - }, - savedSearchId: '789', - }, - }, - enhancements: {}, - type: 'visualization', - } as unknown as EmbeddableStateWithType, - [{ name: 'search_0', id: '123', type: 'search' }] - ); - expect((embeddedState as VisualizeInput).savedVis!.data.savedSearchId).toBe('123'); - }); -}); diff --git a/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable_factory.tsx b/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable_factory.tsx deleted file mode 100644 index 112a8d3b7fd8c..0000000000000 --- a/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable_factory.tsx +++ /dev/null @@ -1,357 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { i18n } from '@kbn/i18n'; -import { first } from 'rxjs'; -import type { OnSaveProps } from '@kbn/saved-objects-plugin/public'; -import type { SavedObjectMetaData } from '@kbn/saved-objects-finder-plugin/public'; -import type { EmbeddableStateWithType } from '@kbn/embeddable-plugin/common'; - -import { - injectSearchSourceReferences, - extractSearchSourceReferences, - SerializedSearchSourceFields, -} from '@kbn/data-plugin/public'; -import type { SavedObjectAttributes, SavedObjectReference } from '@kbn/core/public'; - -import { - EmbeddableFactoryDefinition, - EmbeddableOutput, - ErrorEmbeddable, - IContainer, -} from '@kbn/embeddable-plugin/public'; -import type { StartServicesGetter } from '@kbn/kibana-utils-plugin/public'; -import { AttributeService } from './attribute_service'; -import { checkForDuplicateTitle } from '../../utils/saved_objects_utils/check_for_duplicate_title'; -import type { - VisualizeByReferenceInput, - VisualizeByValueInput, - VisualizeEmbeddable, - VisualizeInput, - VisualizeOutput, - VisualizeSavedObjectAttributes, -} from './visualize_embeddable'; -import { VISUALIZE_EMBEDDABLE_TYPE } from './constants'; -import type { SerializedVis, Vis } from '../../vis'; -import { createVisAsync } from '../../vis_async'; -import { getCapabilities, getTypes } from '../../services'; -import { showNewVisModal } from '../../wizard'; -import { - convertToSerializedVis, - getSavedVisualization, - saveVisualization, - getFullPath, -} from '../../utils/saved_visualize_utils'; -import { - extractControlsReferences, - extractTimeSeriesReferences, - injectTimeSeriesReferences, - injectControlsReferences, -} from '../../utils/saved_visualization_references'; -import { createVisEmbeddableFromObject } from './create_vis_embeddable_from_object'; -import type { VisualizationsStartDeps } from '../../plugin'; - -interface VisualizationAttributes extends SavedObjectAttributes { - title: string; - visState: string; -} - -export interface VisualizeEmbeddableFactoryDeps { - start: StartServicesGetter< - Pick< - VisualizationsStartDeps, - 'inspector' | 'embeddable' | 'data' | 'savedObjectsTaggingOss' | 'spaces' - > - >; -} - -/** @deprecated - * VisualizeEmbeddable is no longer registered with the legacy embeddable system and is only - * used within the visualize editor. - */ -export class VisualizeEmbeddableFactory - implements - EmbeddableFactoryDefinition< - VisualizeInput, - VisualizeOutput | EmbeddableOutput, - VisualizeEmbeddable, - VisualizationAttributes - > -{ - public readonly type = VISUALIZE_EMBEDDABLE_TYPE; - - private attributeService?: AttributeService< - VisualizeSavedObjectAttributes, - VisualizeByValueInput, - VisualizeByReferenceInput - >; - - public readonly savedObjectMetaData: SavedObjectMetaData<VisualizationAttributes> = { - name: i18n.translate('visualizations.savedObjectName', { defaultMessage: 'Visualization' }), - includeFields: ['visState'], - type: 'visualization', - getIconForSavedObject: (savedObject) => { - return ( - getTypes().get(JSON.parse(savedObject.attributes.visState).type)?.icon || 'visualizeApp' - ); - }, - getTooltipForSavedObject: (savedObject) => { - return `${savedObject.attributes.title} (${ - getTypes().get(JSON.parse(savedObject.attributes.visState).type)?.title - })`; - }, - showSavedObject: (savedObject) => { - try { - const typeName: string = JSON.parse(savedObject.attributes.visState).type; - const visType = getTypes().get(typeName); - return Boolean(visType); - } catch { - return false; - } - }, - getSavedObjectSubType: (savedObject) => { - return JSON.parse(savedObject.attributes.visState).type; - }, - }; - - constructor(private readonly deps: VisualizeEmbeddableFactoryDeps) {} - - public async isEditable() { - return getCapabilities().visualize.save as boolean; - } - - public getDisplayName() { - return i18n.translate('visualizations.displayName', { - defaultMessage: 'visualization', - }); - } - - public async getCurrentAppId() { - return this.deps.start().core.application.currentAppId$.pipe(first()).toPromise(); - } - - private async getAttributeService() { - if (!this.attributeService) { - this.attributeService = new AttributeService(this.type, { - saveMethod: this.saveMethod.bind(this), - checkForDuplicateTitle: this.checkTitle.bind(this), - }); - } - return this.attributeService!; - } - - public async createFromSavedObject( - savedObjectId: string, - input: Partial<VisualizeInput> & { id: string }, - parent?: IContainer - ): Promise<VisualizeEmbeddable | ErrorEmbeddable> { - const startDeps = this.deps.start(); - - try { - const savedObject = await getSavedVisualization( - { - search: startDeps.plugins.data.search, - dataViews: startDeps.plugins.data.dataViews, - spaces: startDeps.plugins.spaces, - savedObjectsTagging: startDeps.plugins.savedObjectsTaggingOss?.getTaggingApi(), - ...startDeps.core, - }, - savedObjectId - ); - - if (savedObject.sharingSavedObjectProps?.outcome === 'conflict') { - return new ErrorEmbeddable( - i18n.translate('visualizations.embeddable.legacyURLConflict.errorMessage', { - defaultMessage: `This visualization has the same URL as a legacy alias. Disable the alias to resolve this error : {json}`, - values: { json: savedObject.sharingSavedObjectProps?.errorJSON }, - }), - input, - parent - ); - } - const visState = convertToSerializedVis(savedObject); - const vis = await createVisAsync(savedObject.visState.type, visState); - - return createVisEmbeddableFromObject(this.deps)( - vis, - input, - await this.getAttributeService(), - parent - ); - } catch (e) { - console.error(e); // eslint-disable-line no-console - return new ErrorEmbeddable(e, input, parent); - } - } - - public async create(input: VisualizeInput & { savedVis?: SerializedVis }, parent?: IContainer) { - // TODO: This is a bit of a hack to preserve the original functionality. Ideally we will clean this up - // to allow for in place creation of visualizations without having to navigate away to a new URL. - if (input.savedVis) { - const visState = input.savedVis; - const vis = await createVisAsync(visState.type, visState); - return createVisEmbeddableFromObject(this.deps)( - vis, - input, - await this.getAttributeService(), - parent - ); - } else { - showNewVisModal({ - originatingApp: await this.getCurrentAppId(), - outsideVisualizeApp: true, - }); - return undefined; - } - } - - private async saveMethod(attributes: VisualizeSavedObjectAttributes): Promise<{ id: string }> { - try { - const { title, savedVis } = attributes; - const visObj = attributes.vis; - if (!savedVis) { - throw new Error('No Saved Vis'); - } - const saveOptions = { - confirmOverwrite: false, - returnToOrigin: true, - isTitleDuplicateConfirmed: true, - copyOnSave: false, - }; - savedVis.title = title; - savedVis.description = ''; - savedVis.searchSourceFields = visObj?.data.searchSource?.getSerializedFields(); - savedVis.savedSearchId = visObj?.data.savedSearchId; - const serializedVis = (visObj as unknown as Vis).serialize(); - const { params, data } = serializedVis; - savedVis.visState = { - title, - type: serializedVis.type, - params, - aggs: data.aggs, - }; - if (visObj) { - savedVis.uiStateJSON = visObj?.uiState.toString(); - } - const { core, plugins } = this.deps.start(); - const id = await saveVisualization(savedVis, saveOptions, { - savedObjectsTagging: plugins.savedObjectsTaggingOss?.getTaggingApi(), - ...core, - }); - if (!id || id === '') { - throw new Error( - i18n.translate('visualizations.savingVisualizationFailed.errorMsg', { - defaultMessage: 'Saving a visualization failed', - }) - ); - } - core.chrome.recentlyAccessed.add(getFullPath(id), savedVis.title, String(id)); - return { id }; - } catch (error) { - throw error; - } - } - - public async checkTitle(props: OnSaveProps): Promise<boolean> { - const { core } = this.deps.start(); - - return checkForDuplicateTitle( - { - title: props.newTitle, - lastSavedTitle: '', - getEsType: () => this.type, - }, - false, - props.isTitleDuplicateConfirmed, - props.onTitleDuplicate, - core - ); - } - - public inject(_state: EmbeddableStateWithType, references: SavedObjectReference[]) { - let state = _state as unknown as VisualizeInput; - - const { type, params } = state.savedVis ?? {}; - - if (type && params) { - injectControlsReferences(type, params, references); - injectTimeSeriesReferences(type, params, references); - } - - if (state.savedVis?.data.searchSource) { - let extractedSearchSource = state.savedVis?.data - .searchSource as SerializedSearchSourceFields & { - indexRefName: string; - }; - if (!('indexRefName' in state.savedVis.data.searchSource)) { - // due to a bug in 8.0, some visualizations were saved with an injected state - re-extract in that case and inject the upstream references because they might have changed - extractedSearchSource = extractSearchSourceReferences( - extractedSearchSource - )[0] as SerializedSearchSourceFields & { - indexRefName: string; - }; - } - const injectedSearchSource = injectSearchSourceReferences(extractedSearchSource, references); - state = { - ...state, - savedVis: { - ...state.savedVis, - data: { - ...state.savedVis.data, - searchSource: injectedSearchSource, - savedSearchId: references.find((r) => r.name === 'search_0')?.id, - }, - }, - }; - } - - return state as EmbeddableStateWithType; - } - - public extract(_state: EmbeddableStateWithType) { - let state = _state as unknown as VisualizeInput; - const references = []; - - if (state.savedVis?.data.savedSearchId) { - references.push({ - name: 'search_0', - type: 'search', - id: String(state.savedVis.data.savedSearchId), - }); - } - - if (state.savedVis?.data.searchSource) { - const [extractedSearchSource, searchSourceReferences] = extractSearchSourceReferences( - state.savedVis.data.searchSource - ); - - references.push(...searchSourceReferences); - state = { - ...state, - savedVis: { - ...state.savedVis, - data: { - ...state.savedVis.data, - searchSource: extractedSearchSource, - savedSearchId: undefined, - }, - }, - }; - } - - const { type, params } = state.savedVis ?? {}; - - if (type && params) { - extractControlsReferences(type, params, references, `control_${state.id}`); - extractTimeSeriesReferences(type, params, references, `metrics_${state.id}`); - } - - return { state: state as EmbeddableStateWithType, references }; - } -} diff --git a/src/plugins/visualizations/public/visualize_app/utils/use/use_linked_search_updates.ts b/src/plugins/visualizations/public/visualize_app/utils/use/use_linked_search_updates.ts index 9a5ade9c4c26d..ab2a51b2beef5 100644 --- a/src/plugins/visualizations/public/visualize_app/utils/use/use_linked_search_updates.ts +++ b/src/plugins/visualizations/public/visualize_app/utils/use/use_linked_search_updates.ts @@ -48,7 +48,7 @@ export const useLinkedSearchUpdates = ( if (showToast) { services.toastNotifications.addSuccess( i18n.translate('visualizations.linkedToSearch.unlinkSuccessNotificationText', { - defaultMessage: `Unlinked from saved search ''{searchTitle}''`, + defaultMessage: `Unlinked from Discover session ''{searchTitle}''`, values: { searchTitle: savedSearch.title, }, diff --git a/src/plugins/visualizations/public/wizard/search_selection/search_selection.tsx b/src/plugins/visualizations/public/wizard/search_selection/search_selection.tsx index 62d775dbdc07d..e0647737acb89 100644 --- a/src/plugins/visualizations/public/wizard/search_selection/search_selection.tsx +++ b/src/plugins/visualizations/public/wizard/search_selection/search_selection.tsx @@ -55,17 +55,17 @@ export class SearchSelection extends React.Component<SearchSelectionProps> { noItemsMessage={i18n.translate( 'visualizations.newVisWizard.searchSelection.notFoundLabel', { - defaultMessage: 'No matching indices or saved searches found.', + defaultMessage: 'No matching indices or Discover sessions found.', } )} savedObjectMetaData={[ { type: 'search', - getIconForSavedObject: () => 'search', + getIconForSavedObject: () => 'discoverApp', name: i18n.translate( 'visualizations.newVisWizard.searchSelection.savedObjectType.search', { - defaultMessage: 'Saved search', + defaultMessage: 'Discover session', } ), // ignore the saved searches that have text-based languages queries diff --git a/test/examples/bfetch_explorer/batched_function.ts b/test/examples/bfetch_explorer/batched_function.ts deleted file mode 100644 index 35b4123befc44..0000000000000 --- a/test/examples/bfetch_explorer/batched_function.ts +++ /dev/null @@ -1,82 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import expect from '@kbn/expect'; -import { FtrProviderContext } from '../../functional/ftr_provider_context'; - -// eslint-disable-next-line import/no-default-export -export default function ({ getService }: FtrProviderContext) { - const testSubjects = getService('testSubjects'); - - describe('batchedFunction', () => { - beforeEach(async () => { - await testSubjects.click('count-until'); - await testSubjects.click('double-integers'); - }); - - it('executes all requests in a batch', async () => { - const form = await testSubjects.find('DoubleIntegers'); - const btn = await form.findByCssSelector('button'); - await btn.click(); - await new Promise((r) => setTimeout(r, 4000)); - const pre = await form.findByCssSelector('pre'); - const text = await pre.getVisibleText(); - const json = JSON.parse(text); - - expect(json).to.eql([ - { - num: -1, - error: { - message: 'Invalid number', - }, - }, - { - num: 300, - result: { - num: 600, - }, - }, - { - num: 1000, - result: { - num: 2000, - }, - }, - { - num: 2000, - result: { - num: 4000, - }, - }, - ]); - }); - - it('streams results back', async () => { - const form = await testSubjects.find('DoubleIntegers'); - const btn = await form.findByCssSelector('button'); - await btn.click(); - - await new Promise((r) => setTimeout(r, 500)); - const pre = await form.findByCssSelector('pre'); - - const text1 = await pre.getVisibleText(); - const json1 = JSON.parse(text1); - - expect(json1.length > 0).to.be(true); - expect(json1.length < 4).to.be(true); - - await new Promise((r) => setTimeout(r, 3500)); - - const text2 = await pre.getVisibleText(); - const json2 = JSON.parse(text2); - - expect(json2.length).to.be(4); - }); - }); -} diff --git a/test/examples/bfetch_explorer/index.ts b/test/examples/bfetch_explorer/index.ts deleted file mode 100644 index 19e7cb6f0a0a4..0000000000000 --- a/test/examples/bfetch_explorer/index.ts +++ /dev/null @@ -1,25 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { FtrProviderContext } from '../../functional/ftr_provider_context'; - -// eslint-disable-next-line import/no-default-export -export default function ({ getService, getPageObjects, loadTestFile }: FtrProviderContext) { - const browser = getService('browser'); - const PageObjects = getPageObjects(['common', 'header']); - - describe('bfetch explorer', function () { - before(async () => { - await browser.setWindowSize(1300, 900); - await PageObjects.common.navigateToApp('bfetch-explorer', { insertTimestamp: false }); - }); - - loadTestFile(require.resolve('./batched_function')); - }); -} diff --git a/test/examples/config.js b/test/examples/config.js index cb1dd9dc308e8..7a3f9c4dfd265 100644 --- a/test/examples/config.js +++ b/test/examples/config.js @@ -19,7 +19,6 @@ export default async function ({ readConfigFile }) { rootTags: ['runOutsideOfCiGroups'], testFiles: [ require.resolve('./hello_world'), - require.resolve('./bfetch_explorer'), require.resolve('./ui_actions'), require.resolve('./state_sync'), require.resolve('./routing'), diff --git a/test/plugin_functional/test_suites/core_plugins/rendering.ts b/test/plugin_functional/test_suites/core_plugins/rendering.ts index 87b8fe406263b..1bda105ba07a6 100644 --- a/test/plugin_functional/test_suites/core_plugins/rendering.ts +++ b/test/plugin_functional/test_suites/core_plugins/rendering.ts @@ -128,7 +128,6 @@ export default function ({ getService }: PluginFunctionalProviderContext) { 'data_visualizer.resultLinks.fileBeat.enabled (boolean)', 'dev_tools.deeplinks.navLinkStatus (string?)', 'discover.experimental.enabledProfiles (array?)', - 'enterpriseSearch.canDeployEntSearch (boolean?)', 'enterpriseSearch.host (string?)', 'enterpriseSearch.ui.enabled (boolean?)', 'home.disableWelcomeScreen (boolean?)', diff --git a/tsconfig.base.json b/tsconfig.base.json index 67eebb9aaac4e..6e1e67c3aa148 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -98,8 +98,8 @@ "@kbn/app-link-test-plugin/*": ["test/plugin_functional/plugins/app_link_test/*"], "@kbn/application-usage-test-plugin": ["x-pack/test/usage_collection/plugins/application_usage_test"], "@kbn/application-usage-test-plugin/*": ["x-pack/test/usage_collection/plugins/application_usage_test/*"], - "@kbn/asset-inventory-plugin": ["x-pack/plugins/asset_inventory"], - "@kbn/asset-inventory-plugin/*": ["x-pack/plugins/asset_inventory/*"], + "@kbn/asset-inventory-plugin": ["x-pack/solutions/security/plugins/asset_inventory"], + "@kbn/asset-inventory-plugin/*": ["x-pack/solutions/security/plugins/asset_inventory/*"], "@kbn/audit-log-plugin": ["x-pack/test/security_api_integration/plugins/audit_log"], "@kbn/audit-log-plugin/*": ["x-pack/test/security_api_integration/plugins/audit_log/*"], "@kbn/avc-banner": ["src/platform/packages/shared/kbn-avc-banner"], @@ -118,8 +118,6 @@ "@kbn/bazel-runner/*": ["packages/kbn-bazel-runner/*"], "@kbn/bfetch-error": ["packages/kbn-bfetch-error"], "@kbn/bfetch-error/*": ["packages/kbn-bfetch-error/*"], - "@kbn/bfetch-explorer-plugin": ["examples/bfetch_explorer"], - "@kbn/bfetch-explorer-plugin/*": ["examples/bfetch_explorer/*"], "@kbn/bfetch-plugin": ["src/plugins/bfetch"], "@kbn/bfetch-plugin/*": ["src/plugins/bfetch/*"], "@kbn/calculate-auto": ["packages/kbn-calculate-auto"], @@ -166,8 +164,8 @@ "@kbn/cloud-chat-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_chat/*"], "@kbn/cloud-data-migration-plugin": ["x-pack/platform/plugins/private/cloud_integrations/cloud_data_migration"], "@kbn/cloud-data-migration-plugin/*": ["x-pack/platform/plugins/private/cloud_integrations/cloud_data_migration/*"], - "@kbn/cloud-defend-plugin": ["x-pack/plugins/cloud_defend"], - "@kbn/cloud-defend-plugin/*": ["x-pack/plugins/cloud_defend/*"], + "@kbn/cloud-defend-plugin": ["x-pack/solutions/security/plugins/cloud_defend"], + "@kbn/cloud-defend-plugin/*": ["x-pack/solutions/security/plugins/cloud_defend/*"], "@kbn/cloud-experiments-plugin": ["x-pack/plugins/cloud_integrations/cloud_experiments"], "@kbn/cloud-experiments-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_experiments/*"], "@kbn/cloud-full-story-plugin": ["x-pack/plugins/cloud_integrations/cloud_full_story"], @@ -178,14 +176,14 @@ "@kbn/cloud-links-plugin/*": ["x-pack/plugins/cloud_integrations/cloud_links/*"], "@kbn/cloud-plugin": ["x-pack/plugins/cloud"], "@kbn/cloud-plugin/*": ["x-pack/plugins/cloud/*"], - "@kbn/cloud-security-posture": ["x-pack/packages/kbn-cloud-security-posture/public"], - "@kbn/cloud-security-posture/*": ["x-pack/packages/kbn-cloud-security-posture/public/*"], - "@kbn/cloud-security-posture-common": ["x-pack/packages/kbn-cloud-security-posture/common"], - "@kbn/cloud-security-posture-common/*": ["x-pack/packages/kbn-cloud-security-posture/common/*"], - "@kbn/cloud-security-posture-graph": ["x-pack/packages/kbn-cloud-security-posture/graph"], - "@kbn/cloud-security-posture-graph/*": ["x-pack/packages/kbn-cloud-security-posture/graph/*"], - "@kbn/cloud-security-posture-plugin": ["x-pack/plugins/cloud_security_posture"], - "@kbn/cloud-security-posture-plugin/*": ["x-pack/plugins/cloud_security_posture/*"], + "@kbn/cloud-security-posture": ["x-pack/solutions/security/packages/kbn-cloud-security-posture/public"], + "@kbn/cloud-security-posture/*": ["x-pack/solutions/security/packages/kbn-cloud-security-posture/public/*"], + "@kbn/cloud-security-posture-common": ["x-pack/platform/packages/shared/kbn-cloud-security-posture/common"], + "@kbn/cloud-security-posture-common/*": ["x-pack/platform/packages/shared/kbn-cloud-security-posture/common/*"], + "@kbn/cloud-security-posture-graph": ["x-pack/solutions/security/packages/kbn-cloud-security-posture/graph"], + "@kbn/cloud-security-posture-graph/*": ["x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/*"], + "@kbn/cloud-security-posture-plugin": ["x-pack/solutions/security/plugins/cloud_security_posture"], + "@kbn/cloud-security-posture-plugin/*": ["x-pack/solutions/security/plugins/cloud_security_posture/*"], "@kbn/code-editor": ["packages/shared-ux/code_editor/impl"], "@kbn/code-editor/*": ["packages/shared-ux/code_editor/impl/*"], "@kbn/code-editor-mock": ["packages/shared-ux/code_editor/mocks"], @@ -748,8 +746,8 @@ "@kbn/deeplinks-observability/*": ["src/platform/packages/shared/deeplinks/observability/*"], "@kbn/deeplinks-search": ["packages/deeplinks/search"], "@kbn/deeplinks-search/*": ["packages/deeplinks/search/*"], - "@kbn/deeplinks-security": ["packages/deeplinks/security"], - "@kbn/deeplinks-security/*": ["packages/deeplinks/security/*"], + "@kbn/deeplinks-security": ["src/platform/packages/shared/deeplinks/security"], + "@kbn/deeplinks-security/*": ["src/platform/packages/shared/deeplinks/security/*"], "@kbn/deeplinks-shared": ["packages/deeplinks/shared"], "@kbn/deeplinks-shared/*": ["packages/deeplinks/shared/*"], "@kbn/default-nav-analytics": ["packages/default-nav/analytics"], @@ -1074,8 +1072,8 @@ "@kbn/infra-forge/*": ["x-pack/platform/packages/private/kbn-infra-forge/*"], "@kbn/infra-plugin": ["x-pack/plugins/observability_solution/infra"], "@kbn/infra-plugin/*": ["x-pack/plugins/observability_solution/infra/*"], - "@kbn/ingest-pipelines-plugin": ["x-pack/plugins/ingest_pipelines"], - "@kbn/ingest-pipelines-plugin/*": ["x-pack/plugins/ingest_pipelines/*"], + "@kbn/ingest-pipelines-plugin": ["x-pack/platform/plugins/shared/ingest_pipelines"], + "@kbn/ingest-pipelines-plugin/*": ["x-pack/platform/plugins/shared/ingest_pipelines/*"], "@kbn/input-control-vis-plugin": ["src/plugins/input_control_vis"], "@kbn/input-control-vis-plugin/*": ["src/plugins/input_control_vis/*"], "@kbn/inspector-plugin": ["src/plugins/inspector"], @@ -1134,8 +1132,8 @@ "@kbn/kibana-usage-collection-plugin/*": ["src/plugins/kibana_usage_collection/*"], "@kbn/kibana-utils-plugin": ["src/plugins/kibana_utils"], "@kbn/kibana-utils-plugin/*": ["src/plugins/kibana_utils/*"], - "@kbn/kubernetes-security-plugin": ["x-pack/plugins/kubernetes_security"], - "@kbn/kubernetes-security-plugin/*": ["x-pack/plugins/kubernetes_security/*"], + "@kbn/kubernetes-security-plugin": ["x-pack/solutions/security/plugins/kubernetes_security"], + "@kbn/kubernetes-security-plugin/*": ["x-pack/solutions/security/plugins/kubernetes_security/*"], "@kbn/langchain": ["x-pack/platform/packages/shared/kbn-langchain"], "@kbn/langchain/*": ["x-pack/platform/packages/shared/kbn-langchain/*"], "@kbn/language-documentation": ["src/platform/packages/private/kbn-language-documentation"], @@ -1162,8 +1160,8 @@ "@kbn/lint-packages-cli/*": ["packages/kbn-lint-packages-cli/*"], "@kbn/lint-ts-projects-cli": ["packages/kbn-lint-ts-projects-cli"], "@kbn/lint-ts-projects-cli/*": ["packages/kbn-lint-ts-projects-cli/*"], - "@kbn/lists-plugin": ["x-pack/plugins/lists"], - "@kbn/lists-plugin/*": ["x-pack/plugins/lists/*"], + "@kbn/lists-plugin": ["x-pack/solutions/security/plugins/lists"], + "@kbn/lists-plugin/*": ["x-pack/solutions/security/plugins/lists/*"], "@kbn/llm-tasks-plugin": ["x-pack/platform/plugins/shared/ai_infra/llm_tasks"], "@kbn/llm-tasks-plugin/*": ["x-pack/platform/plugins/shared/ai_infra/llm_tasks/*"], "@kbn/locator-examples-plugin": ["examples/locator_examples"], @@ -1366,8 +1364,8 @@ "@kbn/open-telemetry-instrumented-plugin/*": ["test/common/plugins/otel_metrics/*"], "@kbn/openapi-bundler": ["packages/kbn-openapi-bundler"], "@kbn/openapi-bundler/*": ["packages/kbn-openapi-bundler/*"], - "@kbn/openapi-common": ["packages/kbn-openapi-common"], - "@kbn/openapi-common/*": ["packages/kbn-openapi-common/*"], + "@kbn/openapi-common": ["src/platform/packages/shared/kbn-openapi-common"], + "@kbn/openapi-common/*": ["src/platform/packages/shared/kbn-openapi-common/*"], "@kbn/openapi-generator": ["packages/kbn-openapi-generator"], "@kbn/openapi-generator/*": ["packages/kbn-openapi-generator/*"], "@kbn/optimizer": ["packages/kbn-optimizer"], @@ -1570,8 +1568,8 @@ "@kbn/screenshot-mode-plugin/*": ["src/plugins/screenshot_mode/*"], "@kbn/screenshotting-example-plugin": ["x-pack/examples/screenshotting_example"], "@kbn/screenshotting-example-plugin/*": ["x-pack/examples/screenshotting_example/*"], - "@kbn/screenshotting-plugin": ["x-pack/plugins/screenshotting"], - "@kbn/screenshotting-plugin/*": ["x-pack/plugins/screenshotting/*"], + "@kbn/screenshotting-plugin": ["x-pack/platform/plugins/shared/screenshotting"], + "@kbn/screenshotting-plugin/*": ["x-pack/platform/plugins/shared/screenshotting/*"], "@kbn/screenshotting-server": ["packages/kbn-screenshotting-server"], "@kbn/screenshotting-server/*": ["packages/kbn-screenshotting-server/*"], "@kbn/search-api-keys-components": ["packages/kbn-search-api-keys-components"], @@ -1636,18 +1634,18 @@ "@kbn/security-role-management-model/*": ["x-pack/packages/security/role_management_model/*"], "@kbn/security-solution-distribution-bar": ["x-pack/solutions/security/packages/distribution_bar"], "@kbn/security-solution-distribution-bar/*": ["x-pack/solutions/security/packages/distribution_bar/*"], - "@kbn/security-solution-ess": ["x-pack/plugins/security_solution_ess"], - "@kbn/security-solution-ess/*": ["x-pack/plugins/security_solution_ess/*"], + "@kbn/security-solution-ess": ["x-pack/solutions/security/plugins/security_solution_ess"], + "@kbn/security-solution-ess/*": ["x-pack/solutions/security/plugins/security_solution_ess/*"], "@kbn/security-solution-features": ["x-pack/solutions/security/packages/features"], "@kbn/security-solution-features/*": ["x-pack/solutions/security/packages/features/*"], "@kbn/security-solution-fixtures-plugin": ["x-pack/test/cases_api_integration/common/plugins/security_solution"], "@kbn/security-solution-fixtures-plugin/*": ["x-pack/test/cases_api_integration/common/plugins/security_solution/*"], "@kbn/security-solution-navigation": ["x-pack/solutions/security/packages/navigation"], "@kbn/security-solution-navigation/*": ["x-pack/solutions/security/packages/navigation/*"], - "@kbn/security-solution-plugin": ["x-pack/plugins/security_solution"], - "@kbn/security-solution-plugin/*": ["x-pack/plugins/security_solution/*"], - "@kbn/security-solution-serverless": ["x-pack/plugins/security_solution_serverless"], - "@kbn/security-solution-serverless/*": ["x-pack/plugins/security_solution_serverless/*"], + "@kbn/security-solution-plugin": ["x-pack/solutions/security/plugins/security_solution"], + "@kbn/security-solution-plugin/*": ["x-pack/solutions/security/plugins/security_solution/*"], + "@kbn/security-solution-serverless": ["x-pack/solutions/security/plugins/security_solution_serverless"], + "@kbn/security-solution-serverless/*": ["x-pack/solutions/security/plugins/security_solution_serverless/*"], "@kbn/security-solution-side-nav": ["x-pack/solutions/security/packages/side_nav"], "@kbn/security-solution-side-nav/*": ["x-pack/solutions/security/packages/side_nav/*"], "@kbn/security-solution-storybook-config": ["x-pack/solutions/security/packages/storybook/config"], @@ -1658,46 +1656,46 @@ "@kbn/security-test-endpoints-plugin/*": ["x-pack/test/security_functional/plugins/test_endpoints/*"], "@kbn/security-ui-components": ["x-pack/packages/security/ui_components"], "@kbn/security-ui-components/*": ["x-pack/packages/security/ui_components/*"], - "@kbn/securitysolution-autocomplete": ["packages/kbn-securitysolution-autocomplete"], - "@kbn/securitysolution-autocomplete/*": ["packages/kbn-securitysolution-autocomplete/*"], + "@kbn/securitysolution-autocomplete": ["x-pack/solutions/security/packages/kbn-securitysolution-autocomplete"], + "@kbn/securitysolution-autocomplete/*": ["x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/*"], "@kbn/securitysolution-data-table": ["x-pack/solutions/security/packages/data_table"], "@kbn/securitysolution-data-table/*": ["x-pack/solutions/security/packages/data_table/*"], "@kbn/securitysolution-ecs": ["src/platform/packages/shared/kbn-securitysolution-ecs"], "@kbn/securitysolution-ecs/*": ["src/platform/packages/shared/kbn-securitysolution-ecs/*"], - "@kbn/securitysolution-endpoint-exceptions-common": ["packages/kbn-securitysolution-endpoint-exceptions-common"], - "@kbn/securitysolution-endpoint-exceptions-common/*": ["packages/kbn-securitysolution-endpoint-exceptions-common/*"], - "@kbn/securitysolution-es-utils": ["packages/kbn-securitysolution-es-utils"], - "@kbn/securitysolution-es-utils/*": ["packages/kbn-securitysolution-es-utils/*"], - "@kbn/securitysolution-exception-list-components": ["packages/kbn-securitysolution-exception-list-components"], - "@kbn/securitysolution-exception-list-components/*": ["packages/kbn-securitysolution-exception-list-components/*"], - "@kbn/securitysolution-exceptions-common": ["packages/kbn-securitysolution-exceptions-common"], - "@kbn/securitysolution-exceptions-common/*": ["packages/kbn-securitysolution-exceptions-common/*"], - "@kbn/securitysolution-hook-utils": ["packages/kbn-securitysolution-hook-utils"], - "@kbn/securitysolution-hook-utils/*": ["packages/kbn-securitysolution-hook-utils/*"], - "@kbn/securitysolution-io-ts-alerting-types": ["packages/kbn-securitysolution-io-ts-alerting-types"], - "@kbn/securitysolution-io-ts-alerting-types/*": ["packages/kbn-securitysolution-io-ts-alerting-types/*"], - "@kbn/securitysolution-io-ts-list-types": ["packages/kbn-securitysolution-io-ts-list-types"], - "@kbn/securitysolution-io-ts-list-types/*": ["packages/kbn-securitysolution-io-ts-list-types/*"], - "@kbn/securitysolution-io-ts-types": ["packages/kbn-securitysolution-io-ts-types"], - "@kbn/securitysolution-io-ts-types/*": ["packages/kbn-securitysolution-io-ts-types/*"], - "@kbn/securitysolution-io-ts-utils": ["packages/kbn-securitysolution-io-ts-utils"], - "@kbn/securitysolution-io-ts-utils/*": ["packages/kbn-securitysolution-io-ts-utils/*"], - "@kbn/securitysolution-list-api": ["packages/kbn-securitysolution-list-api"], - "@kbn/securitysolution-list-api/*": ["packages/kbn-securitysolution-list-api/*"], - "@kbn/securitysolution-list-constants": ["packages/kbn-securitysolution-list-constants"], - "@kbn/securitysolution-list-constants/*": ["packages/kbn-securitysolution-list-constants/*"], - "@kbn/securitysolution-list-hooks": ["packages/kbn-securitysolution-list-hooks"], - "@kbn/securitysolution-list-hooks/*": ["packages/kbn-securitysolution-list-hooks/*"], - "@kbn/securitysolution-list-utils": ["packages/kbn-securitysolution-list-utils"], - "@kbn/securitysolution-list-utils/*": ["packages/kbn-securitysolution-list-utils/*"], - "@kbn/securitysolution-lists-common": ["packages/kbn-securitysolution-lists-common"], - "@kbn/securitysolution-lists-common/*": ["packages/kbn-securitysolution-lists-common/*"], - "@kbn/securitysolution-rules": ["packages/kbn-securitysolution-rules"], - "@kbn/securitysolution-rules/*": ["packages/kbn-securitysolution-rules/*"], - "@kbn/securitysolution-t-grid": ["packages/kbn-securitysolution-t-grid"], - "@kbn/securitysolution-t-grid/*": ["packages/kbn-securitysolution-t-grid/*"], - "@kbn/securitysolution-utils": ["packages/kbn-securitysolution-utils"], - "@kbn/securitysolution-utils/*": ["packages/kbn-securitysolution-utils/*"], + "@kbn/securitysolution-endpoint-exceptions-common": ["x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common"], + "@kbn/securitysolution-endpoint-exceptions-common/*": ["x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/*"], + "@kbn/securitysolution-es-utils": ["src/platform/packages/shared/kbn-securitysolution-es-utils"], + "@kbn/securitysolution-es-utils/*": ["src/platform/packages/shared/kbn-securitysolution-es-utils/*"], + "@kbn/securitysolution-exception-list-components": ["x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components"], + "@kbn/securitysolution-exception-list-components/*": ["x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/*"], + "@kbn/securitysolution-exceptions-common": ["x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common"], + "@kbn/securitysolution-exceptions-common/*": ["x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/*"], + "@kbn/securitysolution-hook-utils": ["x-pack/solutions/security/packages/kbn-securitysolution-hook-utils"], + "@kbn/securitysolution-hook-utils/*": ["x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/*"], + "@kbn/securitysolution-io-ts-alerting-types": ["x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types"], + "@kbn/securitysolution-io-ts-alerting-types/*": ["x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/*"], + "@kbn/securitysolution-io-ts-list-types": ["x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types"], + "@kbn/securitysolution-io-ts-list-types/*": ["x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/*"], + "@kbn/securitysolution-io-ts-types": ["src/platform/packages/shared/kbn-securitysolution-io-ts-types"], + "@kbn/securitysolution-io-ts-types/*": ["src/platform/packages/shared/kbn-securitysolution-io-ts-types/*"], + "@kbn/securitysolution-io-ts-utils": ["src/platform/packages/shared/kbn-securitysolution-io-ts-utils"], + "@kbn/securitysolution-io-ts-utils/*": ["src/platform/packages/shared/kbn-securitysolution-io-ts-utils/*"], + "@kbn/securitysolution-list-api": ["x-pack/solutions/security/packages/kbn-securitysolution-list-api"], + "@kbn/securitysolution-list-api/*": ["x-pack/solutions/security/packages/kbn-securitysolution-list-api/*"], + "@kbn/securitysolution-list-constants": ["x-pack/solutions/security/packages/kbn-securitysolution-list-constants"], + "@kbn/securitysolution-list-constants/*": ["x-pack/solutions/security/packages/kbn-securitysolution-list-constants/*"], + "@kbn/securitysolution-list-hooks": ["x-pack/solutions/security/packages/kbn-securitysolution-list-hooks"], + "@kbn/securitysolution-list-hooks/*": ["x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/*"], + "@kbn/securitysolution-list-utils": ["x-pack/solutions/security/packages/kbn-securitysolution-list-utils"], + "@kbn/securitysolution-list-utils/*": ["x-pack/solutions/security/packages/kbn-securitysolution-list-utils/*"], + "@kbn/securitysolution-lists-common": ["x-pack/solutions/security/packages/kbn-securitysolution-lists-common"], + "@kbn/securitysolution-lists-common/*": ["x-pack/solutions/security/packages/kbn-securitysolution-lists-common/*"], + "@kbn/securitysolution-rules": ["src/platform/packages/shared/kbn-securitysolution-rules"], + "@kbn/securitysolution-rules/*": ["src/platform/packages/shared/kbn-securitysolution-rules/*"], + "@kbn/securitysolution-t-grid": ["x-pack/solutions/security/packages/kbn-securitysolution-t-grid"], + "@kbn/securitysolution-t-grid/*": ["x-pack/solutions/security/packages/kbn-securitysolution-t-grid/*"], + "@kbn/securitysolution-utils": ["x-pack/solutions/security/packages/kbn-securitysolution-utils"], + "@kbn/securitysolution-utils/*": ["x-pack/solutions/security/packages/kbn-securitysolution-utils/*"], "@kbn/server-http-tools": ["packages/kbn-server-http-tools"], "@kbn/server-http-tools/*": ["packages/kbn-server-http-tools/*"], "@kbn/server-route-repository": ["src/platform/packages/shared/kbn-server-route-repository"], @@ -1720,16 +1718,16 @@ "@kbn/serverless-search/*": ["x-pack/plugins/serverless_search/*"], "@kbn/serverless-search-settings": ["packages/serverless/settings/search_project"], "@kbn/serverless-search-settings/*": ["packages/serverless/settings/search_project/*"], - "@kbn/serverless-security-settings": ["packages/serverless/settings/security_project"], - "@kbn/serverless-security-settings/*": ["packages/serverless/settings/security_project/*"], + "@kbn/serverless-security-settings": ["src/platform/packages/shared/serverless/settings/security_project"], + "@kbn/serverless-security-settings/*": ["src/platform/packages/shared/serverless/settings/security_project/*"], "@kbn/serverless-storybook-config": ["packages/serverless/storybook/config"], "@kbn/serverless-storybook-config/*": ["packages/serverless/storybook/config/*"], "@kbn/serverless-types": ["packages/serverless/types"], "@kbn/serverless-types/*": ["packages/serverless/types/*"], "@kbn/session-notifications-plugin": ["test/plugin_functional/plugins/session_notifications"], "@kbn/session-notifications-plugin/*": ["test/plugin_functional/plugins/session_notifications/*"], - "@kbn/session-view-plugin": ["x-pack/plugins/session_view"], - "@kbn/session-view-plugin/*": ["x-pack/plugins/session_view/*"], + "@kbn/session-view-plugin": ["x-pack/solutions/security/plugins/session_view"], + "@kbn/session-view-plugin/*": ["x-pack/solutions/security/plugins/session_view/*"], "@kbn/set-map": ["packages/kbn-set-map"], "@kbn/set-map/*": ["packages/kbn-set-map/*"], "@kbn/share-examples-plugin": ["examples/share_examples"], @@ -1838,8 +1836,8 @@ "@kbn/shared-ux-table-persist/*": ["packages/shared-ux/table_persist/*"], "@kbn/shared-ux-utility": ["packages/kbn-shared-ux-utility"], "@kbn/shared-ux-utility/*": ["packages/kbn-shared-ux-utility/*"], - "@kbn/slo-plugin": ["x-pack/plugins/observability_solution/slo"], - "@kbn/slo-plugin/*": ["x-pack/plugins/observability_solution/slo/*"], + "@kbn/slo-plugin": ["x-pack/solutions/observability/plugins/slo"], + "@kbn/slo-plugin/*": ["x-pack/solutions/observability/plugins/slo/*"], "@kbn/slo-schema": ["x-pack/platform/packages/shared/kbn-slo-schema"], "@kbn/slo-schema/*": ["x-pack/platform/packages/shared/kbn-slo-schema/*"], "@kbn/snapshot-restore-plugin": ["x-pack/platform/plugins/private/snapshot_restore"], @@ -2078,8 +2076,8 @@ "@kbn/yarn-lock-validator/*": ["packages/kbn-yarn-lock-validator/*"], "@kbn/zod": ["packages/kbn-zod"], "@kbn/zod/*": ["packages/kbn-zod/*"], - "@kbn/zod-helpers": ["packages/kbn-zod-helpers"], - "@kbn/zod-helpers/*": ["packages/kbn-zod-helpers/*"], + "@kbn/zod-helpers": ["src/platform/packages/shared/kbn-zod-helpers"], + "@kbn/zod-helpers/*": ["src/platform/packages/shared/kbn-zod-helpers/*"], // END AUTOMATED PACKAGE LISTING // Allows for importing from `kibana` package for the exported types. "@emotion/core": ["typings/@emotion"] diff --git a/versions.json b/versions.json index 126e39ed0bad2..e7ca2b8539bf5 100644 --- a/versions.json +++ b/versions.json @@ -19,7 +19,7 @@ "previousMajor": true }, { - "version": "8.16.2", + "version": "8.16.3", "branch": "8.16", "previousMajor": true }, diff --git a/x-pack/.gitignore b/x-pack/.gitignore index 97efbef318c90..a5ef4968bd3bb 100644 --- a/x-pack/.gitignore +++ b/x-pack/.gitignore @@ -6,6 +6,7 @@ /test/functional/apps/**/reports/session /test/reporting/configs/failure_debug/ /plugins/reporting/.chromium/ +/platform/plugins/shared/screenshotting/chromium/ /plugins/screenshotting/chromium/ /plugins/reporting/.phantom/ /.aws-config.json diff --git a/x-pack/.i18nrc.json b/x-pack/.i18nrc.json index f5b38ebec0769..c01b9ef40aed4 100644 --- a/x-pack/.i18nrc.json +++ b/x-pack/.i18nrc.json @@ -20,11 +20,11 @@ "xpack.canvas": "plugins/canvas", "xpack.cases": "plugins/cases", "xpack.cloud": "plugins/cloud", - "xpack.cloudDefend": "plugins/cloud_defend", + "xpack.cloudDefend": "solutions/security/plugins/cloud_defend", "xpack.cloudLinks": "plugins/cloud_integrations/cloud_links", "xpack.cloudDataMigration": "platform/plugins/private/cloud_integrations/cloud_data_migration", "xpack.csp": [ - "plugins/cloud_security_posture", + "solutions/security/plugins/cloud_security_posture", "packages/kbn-cloud-security-posture-common", "packages/kbn-cloud-security-posture" ], @@ -64,18 +64,18 @@ "xpack.logsExplorer": "plugins/observability_solution/logs_explorer", "xpack.logsShared": "plugins/observability_solution/logs_shared", "xpack.fleet": "plugins/fleet", - "xpack.ingestPipelines": "plugins/ingest_pipelines", + "xpack.ingestPipelines": "platform/plugins/shared/ingest_pipelines", "xpack.integrationAssistant": "platform/plugins/shared/integration_assistant", "xpack.inference": "platform/plugins/shared/inference", "xpack.inventory": "plugins/observability_solution/inventory", "xpack.investigate": "solutions/observability/plugins/investigate", "xpack.investigateApp": "solutions/observability/plugins/investigate_app", - "xpack.kubernetesSecurity": "plugins/kubernetes_security", + "xpack.kubernetesSecurity": "solutions/security/plugins/kubernetes_security", "xpack.lens": "plugins/lens", "xpack.licenseApiGuard": "platform/plugins/private/license_api_guard", "xpack.licenseMgmt": "platform/plugins/shared/license_management", "xpack.licensing": "plugins/licensing", - "xpack.lists": "plugins/lists", + "xpack.lists": "solutions/security/plugins/lists", "xpack.logstash": [ "plugins/logstash" ], @@ -128,7 +128,7 @@ "platform/plugins/private/rollup" ], "xpack.runtimeFields": "platform/plugins/private/runtime_fields", - "xpack.screenshotting": "plugins/screenshotting", + "xpack.screenshotting": "platform/plugins/shared/screenshotting", "xpack.searchSharedUI": "packages/search/shared_ui", "xpack.searchHomepage": "plugins/search_homepage", "xpack.searchIndices": "plugins/search_indices", @@ -146,14 +146,14 @@ "xpack.serverless": "plugins/serverless", "xpack.serverlessSearch": "plugins/serverless_search", "xpack.serverlessObservability": "solutions/observability/plugins/serverless_observability", - "xpack.securitySolution": "plugins/security_solution", - "xpack.securitySolutionEss": "plugins/security_solution_ess", - "xpack.securitySolutionServerless": "plugins/security_solution_serverless", - "xpack.sessionView": "plugins/session_view", + "xpack.securitySolution": "solutions/security/plugins/security_solution", + "xpack.securitySolutionEss": "solutions/security/plugins/security_solution_ess", + "xpack.securitySolutionServerless": "solutions/security/plugins/security_solution_serverless", + "xpack.sessionView": "solutions/security/plugins/session_view", "xpack.streams": [ "solutions/observability/plugins/streams_app" ], - "xpack.slo": "plugins/observability_solution/slo", + "xpack.slo": "solutions/observability/plugins/slo", "xpack.snapshotRestore": "platform/plugins/private/snapshot_restore", "xpack.spaces": "plugins/spaces", "xpack.savedObjectsTagging": [ diff --git a/x-pack/README.md b/x-pack/README.md index be925841b0996..0afb180dab1f7 100644 --- a/x-pack/README.md +++ b/x-pack/README.md @@ -100,4 +100,4 @@ See [here](./test/functional/apps/dashboard/reporting/README.md) for more inform #### Running Security Solution Cypress E2E/integration tests -See [here](./plugins/security_solution/cypress/README.md) for information on running this test suite. +See [here](./solutions/security/plugins/security_solution/cypress/README.md) for information on running this test suite. diff --git a/x-pack/packages/kbn-ai-assistant/src/chat/chat_header.tsx b/x-pack/packages/kbn-ai-assistant/src/chat/chat_header.tsx index c4b4fcba0329f..2488323842a10 100644 --- a/x-pack/packages/kbn-ai-assistant/src/chat/chat_header.tsx +++ b/x-pack/packages/kbn-ai-assistant/src/chat/chat_header.tsx @@ -19,7 +19,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { css } from '@emotion/css'; -import { AssistantAvatar } from '@kbn/observability-ai-assistant-plugin/public'; +import { AssistantIcon } from '@kbn/ai-assistant-icon'; import { ChatActionsMenu } from './chat_actions_menu'; import type { UseGenAIConnectorsResult } from '../hooks/use_genai_connectors'; import { FlyoutPositionMode } from './chat_flyout'; @@ -94,7 +94,7 @@ export function ChatHeader({ {loading ? ( <EuiLoadingSpinner size={breakpoint === 'xs' ? 'm' : 'l'} /> ) : ( - <AssistantAvatar size={breakpoint === 'xs' ? 'xs' : 's'} /> + <AssistantIcon size={breakpoint === 'xs' ? 'm' : 'l'} /> )} </EuiFlexItem> diff --git a/x-pack/packages/kbn-ai-assistant/src/chat/chat_item_avatar.tsx b/x-pack/packages/kbn-ai-assistant/src/chat/chat_item_avatar.tsx index ae78d55dd43ff..0c6b6bf5de04d 100644 --- a/x-pack/packages/kbn-ai-assistant/src/chat/chat_item_avatar.tsx +++ b/x-pack/packages/kbn-ai-assistant/src/chat/chat_item_avatar.tsx @@ -7,10 +7,10 @@ import React from 'react'; import { UserAvatar } from '@kbn/user-profile-components'; -import { css } from '@emotion/css'; import { EuiAvatar, EuiLoadingSpinner } from '@elastic/eui'; import type { AuthenticatedUser } from '@kbn/security-plugin/common'; -import { AssistantAvatar, MessageRole } from '@kbn/observability-ai-assistant-plugin/public'; +import { MessageRole } from '@kbn/observability-ai-assistant-plugin/public'; +import { AssistantAvatar } from '@kbn/ai-assistant-icon'; interface ChatAvatarProps { currentUser?: Pick<AuthenticatedUser, 'full_name' | 'username'> | undefined; @@ -18,13 +18,6 @@ interface ChatAvatarProps { loading: boolean; } -const assistantAvatarClassName = css` - svg { - width: 16px; - height: 16px; - } -`; - export function ChatItemAvatar({ currentUser, role, loading }: ChatAvatarProps) { const isLoading = loading || !currentUser; @@ -39,14 +32,7 @@ export function ChatItemAvatar({ currentUser, role, loading }: ChatAvatarProps) case MessageRole.Assistant: case MessageRole.Elastic: case MessageRole.Function: - return ( - <EuiAvatar - name="Elastic Assistant" - iconType={AssistantAvatar} - color="subdued" - className={assistantAvatarClassName} - /> - ); + return <AssistantAvatar name="Elastic Assistant" color="subdued" size="m" />; case MessageRole.System: return <EuiAvatar name="system" iconType="dot" color="subdued" />; diff --git a/x-pack/packages/kbn-ai-assistant/src/chat/welcome_message.tsx b/x-pack/packages/kbn-ai-assistant/src/chat/welcome_message.tsx index 2ce11d16905af..0783c7f64620a 100644 --- a/x-pack/packages/kbn-ai-assistant/src/chat/welcome_message.tsx +++ b/x-pack/packages/kbn-ai-assistant/src/chat/welcome_message.tsx @@ -11,6 +11,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiSpacer, useCurrentEuiBreakpoint } from '@ import type { ActionConnector } from '@kbn/triggers-actions-ui-plugin/public'; import { GenerativeAIForObservabilityConnectorFeatureId } from '@kbn/actions-plugin/common'; import { isSupportedConnectorType } from '@kbn/observability-ai-assistant-plugin/public'; +import { AssistantBeacon } from '@kbn/ai-assistant-icon'; import type { UseKnowledgeBaseResult } from '../hooks/use_knowledge_base'; import type { UseGenAIConnectorsResult } from '../hooks/use_genai_connectors'; import { Disclaimer } from './disclaimer'; @@ -78,9 +79,11 @@ export function WelcomeMessage({ gutterSize="none" className={fullHeightClassName} > + <EuiFlexItem grow={false}> + <AssistantBeacon backgroundColor="ghost" size="xl" /> + </EuiFlexItem> <EuiFlexItem grow className={centerMaxWidthClassName}> <EuiSpacer size={['xl', 'l'].includes(breakpoint!) ? 'l' : 's'} /> - <WelcomeMessageConnectors connectors={connectors} onSetupConnectorClick={handleConnectorClick} @@ -89,10 +92,8 @@ export function WelcomeMessage({ <WelcomeMessageKnowledgeBase connectors={connectors} knowledgeBase={knowledgeBase} /> ) : null} </EuiFlexItem> - <EuiFlexItem grow={false}> <StarterPrompts onSelectPrompt={onSelectPrompt} /> - <EuiSpacer size="l" /> <Disclaimer /> </EuiFlexItem> diff --git a/x-pack/packages/kbn-ai-assistant/tsconfig.json b/x-pack/packages/kbn-ai-assistant/tsconfig.json index 159a38f67f426..c23f92085c28d 100644 --- a/x-pack/packages/kbn-ai-assistant/tsconfig.json +++ b/x-pack/packages/kbn-ai-assistant/tsconfig.json @@ -38,5 +38,6 @@ "@kbn/share-plugin", "@kbn/ai-assistant-common", "@kbn/storybook", + "@kbn/ai-assistant-icon", ] } diff --git a/x-pack/packages/kbn-cloud-security-posture/common/README.md b/x-pack/packages/kbn-cloud-security-posture/common/README.md deleted file mode 100644 index 8f4b7fb4be9d9..0000000000000 --- a/x-pack/packages/kbn-cloud-security-posture/common/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# @kbn/cloud-security-posture-common - -This package provides common code consumed in both the browser, i.e. the -`packages/kbn-cloud-security-posture` package and `plugins/cloud_security_posture` plugin, and on the server, i.e. the -`plugins/cloud_security_posture` plugin. - -## Maintainers - -Maintained by the Cloud Security Team \ No newline at end of file diff --git a/x-pack/packages/kbn-cloud-security-posture/common/jest.config.js b/x-pack/packages/kbn-cloud-security-posture/common/jest.config.js deleted file mode 100644 index 62d5a239b9dc9..0000000000000 --- a/x-pack/packages/kbn-cloud-security-posture/common/jest.config.js +++ /dev/null @@ -1,12 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/packages/kbn-cloud-security-posture/common'], -}; diff --git a/x-pack/packages/kbn-cloud-security-posture/common/schema/graph/v1.ts b/x-pack/packages/kbn-cloud-security-posture/common/schema/graph/v1.ts deleted file mode 100644 index 076c685aca5b9..0000000000000 --- a/x-pack/packages/kbn-cloud-security-posture/common/schema/graph/v1.ts +++ /dev/null @@ -1,100 +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 { schema } from '@kbn/config-schema'; -import { ApiMessageCode } from '../../types/graph/v1'; - -export const graphRequestSchema = schema.object({ - nodesLimit: schema.maybe(schema.number()), - showUnknownTarget: schema.maybe(schema.boolean()), - query: schema.object({ - eventIds: schema.arrayOf(schema.string()), - // TODO: use zod for range validation instead of config schema - start: schema.oneOf([schema.number(), schema.string()]), - end: schema.oneOf([schema.number(), schema.string()]), - esQuery: schema.maybe( - schema.object({ - bool: schema.object({ - filter: schema.maybe(schema.arrayOf(schema.object({}, { unknowns: 'allow' }))), - must: schema.maybe(schema.arrayOf(schema.object({}, { unknowns: 'allow' }))), - should: schema.maybe(schema.arrayOf(schema.object({}, { unknowns: 'allow' }))), - must_not: schema.maybe(schema.arrayOf(schema.object({}, { unknowns: 'allow' }))), - }), - }) - ), - }), -}); - -export const graphResponseSchema = () => - schema.object({ - nodes: schema.arrayOf( - schema.oneOf([entityNodeDataSchema, groupNodeDataSchema, labelNodeDataSchema]) - ), - edges: schema.arrayOf(edgeDataSchema), - messages: schema.maybe( - schema.arrayOf(schema.oneOf([schema.literal(ApiMessageCode.ReachedNodesLimit)])) - ), - }); - -export const colorSchema = schema.oneOf([ - schema.literal('primary'), - schema.literal('danger'), - schema.literal('warning'), -]); - -export const nodeShapeSchema = schema.oneOf([ - schema.literal('hexagon'), - schema.literal('pentagon'), - schema.literal('ellipse'), - schema.literal('rectangle'), - schema.literal('diamond'), - schema.literal('label'), - schema.literal('group'), -]); - -export const nodeBaseDataSchema = schema.object({ - id: schema.string(), - label: schema.maybe(schema.string()), - icon: schema.maybe(schema.string()), -}); - -export const entityNodeDataSchema = schema.allOf([ - nodeBaseDataSchema, - schema.object({ - color: colorSchema, - shape: schema.oneOf([ - schema.literal('hexagon'), - schema.literal('pentagon'), - schema.literal('ellipse'), - schema.literal('rectangle'), - schema.literal('diamond'), - ]), - }), -]); - -export const groupNodeDataSchema = schema.allOf([ - nodeBaseDataSchema, - schema.object({ - shape: schema.literal('group'), - }), -]); - -export const labelNodeDataSchema = schema.allOf([ - nodeBaseDataSchema, - schema.object({ - shape: schema.literal('label'), - parentId: schema.maybe(schema.string()), - color: colorSchema, - }), -]); - -export const edgeDataSchema = schema.object({ - id: schema.string(), - source: schema.string(), - target: schema.string(), - color: colorSchema, -}); diff --git a/x-pack/packages/kbn-cloud-security-posture/common/tsconfig.json b/x-pack/packages/kbn-cloud-security-posture/common/tsconfig.json deleted file mode 100644 index ebec9929559f0..0000000000000 --- a/x-pack/packages/kbn-cloud-security-posture/common/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node", - ] - }, - "include": [ - "**/*.ts", - "**/*.tsx", - ], - "exclude": [ - "target/**/*" - ], - "kbn_references": [ - "@kbn/config-schema", - "@kbn/data-views-plugin", - "@kbn/i18n", - "@kbn/analytics", - "@kbn/usage-collection-plugin", - "@kbn/es-query", - ] -} diff --git a/x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts b/x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts deleted file mode 100644 index ac2e27b70878f..0000000000000 --- a/x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.ts +++ /dev/null @@ -1,171 +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 { QueryDslQueryContainer } from '@kbn/data-views-plugin/common/types'; - -import { i18n } from '@kbn/i18n'; -import type { CspBenchmarkRulesStates } from '../schema/rules/latest'; - -export const defaultErrorMessage = i18n.translate('xpack.csp.common.utils.helpers.unknownError', { - defaultMessage: 'Unknown Error', -}); - -export const extractErrorMessage = (e: unknown, fallbackMessage?: string): string => { - if (e instanceof Error) return e.message; - if (typeof e === 'string') return e; - - return fallbackMessage ?? defaultErrorMessage; -}; - -export const buildMutedRulesFilter = ( - rulesStates: CspBenchmarkRulesStates -): QueryDslQueryContainer[] => { - const mutedRules = Object.fromEntries( - Object.entries(rulesStates).filter(([key, value]) => value.muted === true) - ); - - const mutedRulesFilterQuery = Object.keys(mutedRules).map((key) => { - const rule = mutedRules[key]; - return { - bool: { - must: [ - { term: { 'rule.benchmark.id': rule.benchmark_id } }, - { term: { 'rule.benchmark.version': rule.benchmark_version } }, - { term: { 'rule.benchmark.rule_number': rule.rule_number } }, - ], - }, - }; - }); - - return mutedRulesFilterQuery; -}; - -export const buildGenericEntityFlyoutPreviewQuery = ( - field: string, - queryValue?: string, - status?: string, - queryField?: string -) => { - return { - bool: { - filter: [ - { - bool: { - should: [ - { - term: { - [field]: `${queryValue || ''}`, - }, - }, - ], - minimum_should_match: 1, - }, - }, - status && queryField - ? { - bool: { - should: [ - { - term: { - [queryField]: status, - }, - }, - ], - minimum_should_match: 1, - }, - } - : undefined, - ].filter(Boolean), - }, - }; -}; - -// Higher-order function for Misconfiguration -export const buildMisconfigurationEntityFlyoutPreviewQuery = ( - field: string, - queryValue?: string, - status?: string -) => { - const queryField = 'result.evaluation'; - return buildGenericEntityFlyoutPreviewQuery(field, queryValue, status, queryField); -}; - -// Higher-order function for Vulnerability -export const buildVulnerabilityEntityFlyoutPreviewQuery = ( - field: string, - queryValue?: string, - status?: string -) => { - const queryField = 'vulnerability.severity'; - return buildGenericEntityFlyoutPreviewQuery(field, queryValue, status, queryField); -}; - -export const buildEntityAlertsQuery = ( - field: string, - to: string, - from: string, - queryValue?: string, - size?: number, - severity?: string -) => { - return { - size: size || 0, - _source: false, - fields: [ - '_id', - '_index', - 'kibana.alert.rule.uuid', - 'kibana.alert.severity', - 'kibana.alert.rule.name', - 'kibana.alert.workflow_status', - ], - query: { - bool: { - filter: [ - { - bool: { - should: [ - { - term: { - [field]: `${queryValue || ''}`, - }, - }, - ], - minimum_should_match: 1, - }, - }, - severity - ? { - bool: { - should: [ - { - term: { - 'kibana.alert.severity': severity, - }, - }, - ], - minimum_should_match: 1, - }, - } - : undefined, - { - range: { - '@timestamp': { - gte: from, - lte: to, - }, - }, - }, - { - terms: { - 'kibana.alert.workflow_status': ['open', 'acknowledged'], - }, - }, - ].filter(Boolean), - }, - }, - }; -}; diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/jest.config.js b/x-pack/packages/kbn-cloud-security-posture/graph/jest.config.js deleted file mode 100644 index 3f600bebb30f7..0000000000000 --- a/x-pack/packages/kbn-cloud-security-posture/graph/jest.config.js +++ /dev/null @@ -1,18 +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. - */ - -module.exports = { - preset: '@kbn/test', - roots: ['<rootDir>/x-pack/packages/kbn-cloud-security-posture/graph'], - rootDir: '../../../..', - transform: { - '^.+\\.(js|tsx?)$': - '<rootDir>/x-pack/packages/kbn-cloud-security-posture/storybook/config/babel_with_emotion.ts', - }, - setupFiles: ['jest-canvas-mock'], - setupFilesAfterEnv: ['<rootDir>/x-pack/packages/kbn-cloud-security-posture/graph/setup_tests.ts'], -}; diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/types.ts b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/types.ts deleted file mode 100644 index 328829ee3fabe..0000000000000 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/types.ts +++ /dev/null @@ -1,69 +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 from 'react'; -import type { - EntityNodeDataModel, - GroupNodeDataModel, - LabelNodeDataModel, - EdgeDataModel, - NodeShape, -} from '@kbn/cloud-security-posture-common/types/graph/latest'; -import type { Node, NodeProps as xyNodeProps } from '@xyflow/react'; -import type { Edge, EdgeProps as xyEdgeProps } from '@xyflow/react'; - -export interface Size { - width: number; - height: number; -} - -interface BaseNodeDataViewModel { - interactive?: boolean; -} - -export type NodeClickCallback = (e: React.MouseEvent<HTMLElement>, node: NodeProps) => void; - -export type ExpandButtonClickCallback = ( - e: React.MouseEvent<HTMLElement>, - node: NodeProps, - unToggleCallback: () => void -) => void; - -export interface EntityNodeViewModel - extends Record<string, unknown>, - EntityNodeDataModel, - BaseNodeDataViewModel { - expandButtonClick?: ExpandButtonClickCallback; - nodeClick?: NodeClickCallback; -} - -export interface GroupNodeViewModel - extends Record<string, unknown>, - GroupNodeDataModel, - BaseNodeDataViewModel {} - -export interface LabelNodeViewModel - extends Record<string, unknown>, - LabelNodeDataModel, - BaseNodeDataViewModel { - expandButtonClick?: ExpandButtonClickCallback; -} - -export type NodeViewModel = EntityNodeViewModel | GroupNodeViewModel | LabelNodeViewModel; - -export type NodeProps = xyNodeProps<Node<NodeViewModel>>; - -export interface EdgeViewModel extends Record<string, unknown>, EdgeDataModel {} - -export type EdgeProps = xyEdgeProps< - Edge< - EdgeViewModel & { - sourceShape: NodeShape; - targetShape: NodeShape; - } - > ->; diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/tsconfig.json b/x-pack/packages/kbn-cloud-security-posture/graph/tsconfig.json deleted file mode 100644 index e56b9aabf16a9..0000000000000 --- a/x-pack/packages/kbn-cloud-security-posture/graph/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "**/*.ts", - "**/*.tsx" - ], - "exclude": [ - "target/**/*" - ], - "kbn_references": [ - "@kbn/cloud-security-posture-common", - "@kbn/data-views-plugin", - "@kbn/kibana-react-plugin", - "@kbn/ui-theme", - "@kbn/utility-types", - "@kbn/unified-search-plugin", - "@kbn/es-query", - "@kbn/data-service", - "@kbn/i18n", - ] -} diff --git a/x-pack/packages/kbn-cloud-security-posture/public/jest.config.js b/x-pack/packages/kbn-cloud-security-posture/public/jest.config.js deleted file mode 100644 index 1c1a8c84561c1..0000000000000 --- a/x-pack/packages/kbn-cloud-security-posture/public/jest.config.js +++ /dev/null @@ -1,12 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/packages/kbn-cloud-security-posture/public'], -}; diff --git a/x-pack/packages/kbn-cloud-security-posture/public/tsconfig.json b/x-pack/packages/kbn-cloud-security-posture/public/tsconfig.json deleted file mode 100644 index 8c950553c7cde..0000000000000 --- a/x-pack/packages/kbn-cloud-security-posture/public/tsconfig.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - }, - "include": [ - "**/*.ts", - "**/*.tsx", - ], - "exclude": [ - "target/**/*" - ], - "kbn_references": [ - "@kbn/core", - "@kbn/licensing-plugin", - "@kbn/data-views-plugin", - "@kbn/unified-search-plugin", - "@kbn/ui-actions-plugin", - "@kbn/field-formats-plugin", - "@kbn/data-view-field-editor-plugin", - "@kbn/data-plugin", - "@kbn/kibana-utils-plugin", - "@kbn/charts-plugin", - "@kbn/discover-plugin", - "@kbn/fleet-plugin", - "@kbn/usage-collection-plugin", - "@kbn/share-plugin", - "@kbn/es-query", - "@kbn/cloud-plugin", - "@kbn/spaces-plugin", - "@kbn/kibana-react-plugin", - "@kbn/cloud-security-posture-common", - "@kbn/i18n", - "@kbn/search-types", - "@kbn/ui-theme", - "@kbn/i18n-react", - "@kbn/rison", - "@kbn/core-lifecycle-browser", - ] -} diff --git a/x-pack/packages/kbn-cloud-security-posture/storybook/config/tsconfig.json b/x-pack/packages/kbn-cloud-security-posture/storybook/config/tsconfig.json deleted file mode 100644 index 1f8b2275f5191..0000000000000 --- a/x-pack/packages/kbn-cloud-security-posture/storybook/config/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "../../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node", - "@kbn/ambient-storybook-types", - ] - }, - "include": [ - "**/*.ts" - ], - "kbn_references": [ - "@kbn/storybook", - ], - "exclude": [ - "target/**/*", - ] -} diff --git a/x-pack/packages/observability/logs_overview/kibana.jsonc b/x-pack/packages/observability/logs_overview/kibana.jsonc index 34d8ac98a5253..1709e01f926ed 100644 --- a/x-pack/packages/observability/logs_overview/kibana.jsonc +++ b/x-pack/packages/observability/logs_overview/kibana.jsonc @@ -4,6 +4,6 @@ "owner": [ "@elastic/obs-ux-logs-team" ], - "group": "observability", - "visibility": "private" + "group": "platform", + "visibility": "shared" } diff --git a/x-pack/platform/packages/private/ml/aiops_components/src/document_count_chart/document_count_chart.tsx b/x-pack/platform/packages/private/ml/aiops_components/src/document_count_chart/document_count_chart.tsx index 6e44f01cbbd69..5a6f45f6a6ba3 100644 --- a/x-pack/platform/packages/private/ml/aiops_components/src/document_count_chart/document_count_chart.tsx +++ b/x-pack/platform/packages/private/ml/aiops_components/src/document_count_chart/document_count_chart.tsx @@ -28,6 +28,7 @@ import { getSnappedTimestamps, getSnappedWindowParameters, getWindowParametersForTrigger, + useLogRateAnalysisBarColors, type DocumentCountStatsChangePoint, type LogRateHistogramItem, type WindowParameters, @@ -198,6 +199,7 @@ export const DocumentCountChart: FC<DocumentCountChartProps> = (props) => { const { data, uiSettings, fieldFormats, charts } = dependencies; const chartBaseTheme = charts.theme.useChartsBaseTheme(); + const barColors = useLogRateAnalysisBarColors(); const xAxisFormatter = fieldFormats.deserialize({ id: 'date' }); const useLegacyTimeAxis = uiSettings.get('visualization:useLegacyTimeAxis', false); @@ -422,8 +424,10 @@ export const DocumentCountChart: FC<DocumentCountChartProps> = (props) => { const baselineBadgeMarginLeft = (mlBrushMarginLeft ?? 0) + (windowParametersAsPixels?.baselineMin ?? 0); - const barColor = barColorOverride ? [barColorOverride] : undefined; - const barHighlightColor = barHighlightColorOverride ? [barHighlightColorOverride] : ['orange']; + const barColor = barColorOverride ? [barColorOverride] : barColors.barColor; + const barHighlightColor = barHighlightColorOverride + ? [barHighlightColorOverride] + : [barColors.barHighlightColor]; return ( <> diff --git a/x-pack/platform/packages/private/ml/data_grid/hooks/use_column_chart.test.tsx b/x-pack/platform/packages/private/ml/data_grid/hooks/use_column_chart.test.tsx index 4b8191de1d874..09c118e4d262b 100644 --- a/x-pack/platform/packages/private/ml/data_grid/hooks/use_column_chart.test.tsx +++ b/x-pack/platform/packages/private/ml/data_grid/hooks/use_column_chart.test.tsx @@ -10,6 +10,8 @@ import { render, renderHook } from '@testing-library/react'; import { KBN_FIELD_TYPES } from '@kbn/field-types'; +import type { EuiThemeComputed } from '@elastic/eui'; + import type { NumericChartData, OrdinalChartData, @@ -23,6 +25,10 @@ import { import { getFieldType, getLegendText, getXScaleType, useColumnChart } from './use_column_chart'; +const euiThemeMock = { + size: { base: '16px' }, +} as EuiThemeComputed; + describe('getFieldType()', () => { it('should return the Kibana field type for a given EUI data grid schema', () => { expect(getFieldType('text')).toBe('string'); @@ -103,63 +109,81 @@ describe('isUnsupportedChartData()', () => { describe('getLegendText()', () => { it('should return the chart legend text for unsupported chart types', () => { - expect(getLegendText(validUnsupportedChartData)).toBe('Chart not supported.'); + expect(getLegendText(validUnsupportedChartData, euiThemeMock)).toBe('Chart not supported.'); }); it('should return the chart legend text for empty datasets', () => { - expect(getLegendText(validNumericChartData)).toBe('0 documents contain field.'); + expect(getLegendText(validNumericChartData, euiThemeMock)).toBe('0 documents contain field.'); }); it('should return the chart legend text for boolean chart types', () => { const { getByText } = render( <> - {getLegendText({ - cardinality: 2, - data: [ - { key: 'true', key_as_string: 'true', doc_count: 10 }, - { key: 'false', key_as_string: 'false', doc_count: 20 }, - ], - id: 'the-id', - type: 'boolean', - })} + {getLegendText( + { + cardinality: 2, + data: [ + { key: 'true', key_as_string: 'true', doc_count: 10 }, + { key: 'false', key_as_string: 'false', doc_count: 20 }, + ], + id: 'the-id', + type: 'boolean', + }, + euiThemeMock + )} </> ); expect(getByText('true')).toBeInTheDocument(); expect(getByText('false')).toBeInTheDocument(); }); it('should return the chart legend text for ordinal chart data with less than max categories', () => { - expect(getLegendText({ ...validOrdinalChartData, data: [{ key: 'cat', doc_count: 10 }] })).toBe( - '10 categories' - ); + expect( + getLegendText( + { ...validOrdinalChartData, data: [{ key: 'cat', doc_count: 10 }] }, + euiThemeMock + ) + ).toBe('10 categories'); }); it('should return the chart legend text for ordinal chart data with more than max categories', () => { expect( - getLegendText({ - ...validOrdinalChartData, - cardinality: 30, - data: [{ key: 'cat', doc_count: 10 }], - }) + getLegendText( + { + ...validOrdinalChartData, + cardinality: 30, + data: [{ key: 'cat', doc_count: 10 }], + }, + euiThemeMock + ) ).toBe('top 20 of 30 categories'); }); it('should return the chart legend text for numeric datasets', () => { expect( - getLegendText({ - ...validNumericChartData, - data: [{ key: 1, doc_count: 10 }], - stats: [1, 100], - }) + getLegendText( + { + ...validNumericChartData, + data: [{ key: 1, doc_count: 10 }], + stats: [1, 100], + }, + euiThemeMock + ) ).toBe('1 - 100'); expect( - getLegendText({ - ...validNumericChartData, - data: [{ key: 1, doc_count: 10 }], - stats: [100, 100], - }) + getLegendText( + { + ...validNumericChartData, + data: [{ key: 1, doc_count: 10 }], + stats: [100, 100], + }, + euiThemeMock + ) ).toBe('100'); expect( - getLegendText({ - ...validNumericChartData, - data: [{ key: 1, doc_count: 10 }], - stats: [1.2345, 6.3456], - }) + getLegendText( + { + ...validNumericChartData, + data: [{ key: 1, doc_count: 10 }], + stats: [1.2345, 6.3456], + }, + euiThemeMock + ) ).toBe('1.23 - 6.35'); }); }); diff --git a/x-pack/platform/packages/private/ml/data_grid/hooks/use_column_chart.tsx b/x-pack/platform/packages/private/ml/data_grid/hooks/use_column_chart.tsx index f0ad27d464473..9292f17069e7e 100644 --- a/x-pack/platform/packages/private/ml/data_grid/hooks/use_column_chart.tsx +++ b/x-pack/platform/packages/private/ml/data_grid/hooks/use_column_chart.tsx @@ -12,9 +12,13 @@ import { css } from '@emotion/react'; import useObservable from 'react-use/lib/useObservable'; -import { euiPaletteColorBlind, type EuiDataGridColumn } from '@elastic/eui'; +import { + useEuiTheme, + euiPaletteColorBlind, + type EuiDataGridColumn, + type EuiThemeComputed, +} from '@elastic/eui'; -import { euiThemeVars } from '@kbn/ui-theme'; import { i18n } from '@kbn/i18n'; import { KBN_FIELD_TYPES } from '@kbn/field-types'; @@ -29,14 +33,6 @@ import { isNumericChartData, isOrdinalChartData } from '../lib/field_histograms' import { NON_AGGREGATABLE } from '../lib/common'; import type { DataGridItem } from '../lib/types'; -const cssHistogramLegendBoolean = css({ - width: '100%', - // This was originally $euiButtonMinWidth, but that - // is no longer exported from the EUI package, - // so we're replicating it here inline. - minWidth: `calc(${euiThemeVars.euiSize} * 7)`, -}); - const cssTextAlignCenter = css({ textAlign: 'center', }); @@ -97,6 +93,7 @@ export const getFieldType = (schema: EuiDataGridColumn['schema']): KBN_FIELD_TYP type LegendText = string | JSX.Element; export const getLegendText = ( chartData: ChartData, + euiTheme: EuiThemeComputed, maxChartColumns = MAX_CHART_COLUMNS ): LegendText => { if (chartData.type === 'unsupported') { @@ -112,6 +109,14 @@ export const getLegendText = ( } if (chartData.type === 'boolean') { + const cssHistogramLegendBoolean = css({ + width: '100%', + // This was originally $euiButtonMinWidth, but that + // is no longer exported from the EUI package, + // so we're replicating it here inline. + minWidth: `calc(${euiTheme.size.base} * 7)`, + }); + return ( <table css={cssHistogramLegendBoolean}> <tbody> @@ -171,6 +176,8 @@ export const useColumnChart = ( columnType: EuiDataGridColumn, maxChartColumns?: number ): ColumnChart => { + const { euiTheme } = useEuiTheme(); + const fieldType = getFieldType(columnType.schema); const hoveredRow = useObservable(hoveredRow$); @@ -231,7 +238,7 @@ export const useColumnChart = ( return { data, - legendText: getLegendText(chartData, maxChartColumns), + legendText: getLegendText(chartData, euiTheme, maxChartColumns), xScaleType, }; }; diff --git a/x-pack/platform/packages/private/ml/data_grid/tsconfig.json b/x-pack/platform/packages/private/ml/data_grid/tsconfig.json index db1fefe7ccca0..e2c0a81468556 100644 --- a/x-pack/platform/packages/private/ml/data_grid/tsconfig.json +++ b/x-pack/platform/packages/private/ml/data_grid/tsconfig.json @@ -28,7 +28,6 @@ "@kbn/ml-agg-utils", "@kbn/ml-error-utils", "@kbn/ml-data-frame-analytics-utils", - "@kbn/ui-theme", "@kbn/i18n-react", "@kbn/ml-is-populated-object", "@kbn/ml-date-picker", diff --git a/x-pack/platform/packages/private/ml/field_stats_flyout/field_stats_flyout_provider.tsx b/x-pack/platform/packages/private/ml/field_stats_flyout/field_stats_flyout_provider.tsx index 4e7a501140b01..16eb8a48798b8 100644 --- a/x-pack/platform/packages/private/ml/field_stats_flyout/field_stats_flyout_provider.tsx +++ b/x-pack/platform/packages/private/ml/field_stats_flyout/field_stats_flyout_provider.tsx @@ -7,7 +7,6 @@ import type { PropsWithChildren, FC } from 'react'; import React, { useCallback, useState } from 'react'; -import type { ThemeServiceStart } from '@kbn/core-theme-browser'; import type { DataView } from '@kbn/data-plugin/common'; import type { FieldStatsServices } from '@kbn/unified-field-list/src/components/field_stats'; import type { TimeRange as TimeRangeMs } from '@kbn/ml-date-picker'; @@ -36,7 +35,6 @@ import { PopulatedFieldsCacheManager } from './populated_fields/populated_fields export type FieldStatsFlyoutProviderProps = PropsWithChildren<{ dataView: DataView; fieldStatsServices: FieldStatsServices; - theme: ThemeServiceStart; timeRangeMs?: TimeRangeMs; dslQuery?: FieldStatsProps['dslQuery']; disablePopulatedFields?: boolean; @@ -65,7 +63,6 @@ export const FieldStatsFlyoutProvider: FC<FieldStatsFlyoutProviderProps> = (prop const { dataView, fieldStatsServices, - theme, timeRangeMs, dslQuery, disablePopulatedFields = false, @@ -174,7 +171,6 @@ export const FieldStatsFlyoutProvider: FC<FieldStatsFlyoutProviderProps> = (prop fieldValue, timeRangeMs, populatedFields, - theme, }} > <FieldStatsFlyout diff --git a/x-pack/platform/packages/private/ml/field_stats_flyout/field_stats_info_button.tsx b/x-pack/platform/packages/private/ml/field_stats_flyout/field_stats_info_button.tsx index 6de4e17f649b7..08ec070643fc7 100644 --- a/x-pack/platform/packages/private/ml/field_stats_flyout/field_stats_info_button.tsx +++ b/x-pack/platform/packages/private/ml/field_stats_flyout/field_stats_info_button.tsx @@ -5,13 +5,18 @@ * 2.0. */ -import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiToolTip, EuiText } from '@elastic/eui'; +import { + useEuiTheme, + EuiButtonIcon, + EuiFlexGroup, + EuiFlexItem, + EuiToolTip, + EuiText, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { type FC } from 'react'; import { FieldIcon } from '@kbn/react-field'; import { type Field } from '@kbn/ml-anomaly-utils'; -import { useCurrentEuiThemeVars } from '@kbn/ml-kibana-theme'; -import { useFieldStatsFlyoutThemeVars } from './use_field_stats_flyout_context'; import { getKbnFieldIconType } from './get_kbn_field_icon_types'; @@ -71,8 +76,7 @@ export interface FieldStatsInfoButtonProps { */ export const FieldStatsInfoButton: FC<FieldStatsInfoButtonProps> = (props) => { const { field, label, onButtonClick, disabled, isEmpty, hideTrigger } = props; - const theme = useFieldStatsFlyoutThemeVars(); - const themeVars = useCurrentEuiThemeVars(theme); + const { euiTheme } = useEuiTheme(); const emptyFieldMessage = isEmpty ? ' ' + @@ -100,7 +104,7 @@ export const FieldStatsInfoButton: FC<FieldStatsInfoButtonProps> = (props) => { disabled={disabled === true} size="xs" iconType="fieldStatistics" - css={{ color: isEmpty ? themeVars.euiTheme.euiColorDisabled : undefined }} + css={{ color: isEmpty ? euiTheme.colors.textDisabled : undefined }} onClick={(ev: React.MouseEvent<HTMLButtonElement>) => { if (ev.type === 'click') { ev.currentTarget.focus(); @@ -127,12 +131,12 @@ export const FieldStatsInfoButton: FC<FieldStatsInfoButtonProps> = (props) => { <EuiFlexItem grow={false} css={{ - paddingRight: themeVars.euiTheme.euiSizeXS, + paddingRight: euiTheme.size.xs, }} > {!hideTrigger ? ( <FieldIcon - color={isEmpty ? themeVars.euiTheme.euiColorDisabled : undefined} + color={isEmpty ? euiTheme.colors.textDisabled : undefined} type={getKbnFieldIconType(field.type)} fill="none" /> diff --git a/x-pack/platform/packages/private/ml/field_stats_flyout/options_list_with_stats/option_list_popover_footer.tsx b/x-pack/platform/packages/private/ml/field_stats_flyout/options_list_with_stats/option_list_popover_footer.tsx index 0bed94223b0c5..b1bdb9c3e07d8 100644 --- a/x-pack/platform/packages/private/ml/field_stats_flyout/options_list_with_stats/option_list_popover_footer.tsx +++ b/x-pack/platform/packages/private/ml/field_stats_flyout/options_list_with_stats/option_list_popover_footer.tsx @@ -6,25 +6,26 @@ */ import React from 'react'; import type { FC } from 'react'; -import { EuiPopoverFooter, EuiSwitch, EuiProgress, useEuiBackgroundColor } from '@elastic/eui'; +import { EuiPopoverFooter, EuiSwitch, EuiProgress, useEuiTheme } from '@elastic/eui'; import { css } from '@emotion/react'; import { i18n } from '@kbn/i18n'; -import { euiThemeVars } from '@kbn/ui-theme'; export const OptionsListPopoverFooter: FC<{ showEmptyFields: boolean; setShowEmptyFields: (showEmptyFields: boolean) => void; isLoading?: boolean; }> = ({ showEmptyFields, setShowEmptyFields, isLoading }) => { + const { euiTheme } = useEuiTheme(); + return ( <EuiPopoverFooter paddingSize="none" css={css({ - height: euiThemeVars.euiButtonHeight, - backgroundColor: useEuiBackgroundColor('subdued'), + height: euiTheme.size.xxl, + backgroundColor: euiTheme.colors.backgroundBaseSubdued, alignItems: 'center', display: 'flex', - paddingLeft: euiThemeVars.euiSizeS, + paddingLeft: euiTheme.size.s, })} > {isLoading ? ( diff --git a/x-pack/platform/packages/private/ml/field_stats_flyout/tsconfig.json b/x-pack/platform/packages/private/ml/field_stats_flyout/tsconfig.json index 33e65f0cebcae..1de626e740fc1 100644 --- a/x-pack/platform/packages/private/ml/field_stats_flyout/tsconfig.json +++ b/x-pack/platform/packages/private/ml/field_stats_flyout/tsconfig.json @@ -23,14 +23,11 @@ "@kbn/i18n", "@kbn/react-field", "@kbn/ml-anomaly-utils", - "@kbn/ml-kibana-theme", "@kbn/ml-data-grid", "@kbn/ml-string-hash", "@kbn/ml-is-populated-object", "@kbn/ml-query-utils", "@kbn/ml-is-defined", "@kbn/field-types", - "@kbn/ui-theme", - "@kbn/core-theme-browser", ] } diff --git a/x-pack/platform/packages/private/ml/field_stats_flyout/use_field_stats_flyout_context.ts b/x-pack/platform/packages/private/ml/field_stats_flyout/use_field_stats_flyout_context.ts index 121426352e6e4..2e58dbb1361a2 100644 --- a/x-pack/platform/packages/private/ml/field_stats_flyout/use_field_stats_flyout_context.ts +++ b/x-pack/platform/packages/private/ml/field_stats_flyout/use_field_stats_flyout_context.ts @@ -7,7 +7,6 @@ import { createContext, useContext } from 'react'; import type { TimeRange as TimeRangeMs } from '@kbn/ml-date-picker'; -import type { ThemeServiceStart } from '@kbn/core-theme-browser'; /** * Represents the properties for the MLJobWizardFieldStatsFlyout component. @@ -22,7 +21,6 @@ interface MLJobWizardFieldStatsFlyoutProps { fieldValue?: string | number; timeRangeMs?: TimeRangeMs; populatedFields?: Set<string>; - theme?: ThemeServiceStart; } /** @@ -36,7 +34,6 @@ export const MLFieldStatsFlyoutContext = createContext<MLJobWizardFieldStatsFlyo setFieldValue: () => {}, timeRangeMs: undefined, populatedFields: undefined, - theme: undefined, }); /** @@ -52,17 +49,3 @@ export function useFieldStatsFlyoutContext() { return fieldStatsFlyoutContext; } - -/** - * Retrieves the theme vars from the field stats flyout context. - * @returns The theme vars. - */ -export function useFieldStatsFlyoutThemeVars() { - const { theme } = useFieldStatsFlyoutContext(); - - if (!theme) { - throw new Error('theme must be provided in the MLFieldStatsFlyoutContext'); - } - - return theme; -} diff --git a/x-pack/platform/packages/private/ml/kibana_theme/index.ts b/x-pack/platform/packages/private/ml/kibana_theme/index.ts index 0bd52263c70fb..daa5b6ad8964c 100644 --- a/x-pack/platform/packages/private/ml/kibana_theme/index.ts +++ b/x-pack/platform/packages/private/ml/kibana_theme/index.ts @@ -5,4 +5,4 @@ * 2.0. */ -export { useIsDarkTheme, useCurrentEuiThemeVars, type EuiThemeType } from './src/hooks'; +export { useIsDarkTheme } from './src/hooks'; diff --git a/x-pack/platform/packages/private/ml/kibana_theme/src/hooks.ts b/x-pack/platform/packages/private/ml/kibana_theme/src/hooks.ts index ed156f56f025b..68aa5bb4129a5 100644 --- a/x-pack/platform/packages/private/ml/kibana_theme/src/hooks.ts +++ b/x-pack/platform/packages/private/ml/kibana_theme/src/hooks.ts @@ -8,11 +8,8 @@ import { useMemo } from 'react'; import { of } from 'rxjs'; import useObservable from 'react-use/lib/useObservable'; -import { euiDarkVars as euiThemeDark, euiLightVars as euiThemeLight } from '@kbn/ui-theme'; import type { ThemeServiceStart } from '@kbn/core-theme-browser'; -export type EuiThemeType = typeof euiThemeLight | typeof euiThemeDark; - const themeDefault = { darkMode: false }; /** @@ -28,11 +25,3 @@ export function useIsDarkTheme(theme: ThemeServiceStart): boolean { return darkMode; } - -/** - * Returns an EUI theme definition based on the currently applied theme. - */ -export function useCurrentEuiThemeVars(theme: ThemeServiceStart): { euiTheme: EuiThemeType } { - const isDarkMode = useIsDarkTheme(theme); - return useMemo(() => ({ euiTheme: isDarkMode ? euiThemeDark : euiThemeLight }), [isDarkMode]); -} diff --git a/x-pack/platform/packages/private/ml/kibana_theme/tsconfig.json b/x-pack/platform/packages/private/ml/kibana_theme/tsconfig.json index 263f34ba27581..1342e03481c51 100644 --- a/x-pack/platform/packages/private/ml/kibana_theme/tsconfig.json +++ b/x-pack/platform/packages/private/ml/kibana_theme/tsconfig.json @@ -14,7 +14,6 @@ "target/**/*" ], "kbn_references": [ - "@kbn/ui-theme", "@kbn/core-theme-browser", ] } diff --git a/x-pack/platform/packages/shared/ai-infra/inference-common/index.ts b/x-pack/platform/packages/shared/ai-infra/inference-common/index.ts index 603192fb96db4..134b0f02811fe 100644 --- a/x-pack/platform/packages/shared/ai-infra/inference-common/index.ts +++ b/x-pack/platform/packages/shared/ai-infra/inference-common/index.ts @@ -84,11 +84,14 @@ export { type InferenceTaskErrorEvent, type InferenceTaskInternalError, type InferenceTaskRequestError, + type InferenceTaskAbortedError, createInferenceInternalError, createInferenceRequestError, + createInferenceRequestAbortedError, isInferenceError, isInferenceInternalError, isInferenceRequestError, + isInferenceRequestAbortedError, } from './src/errors'; export { truncateList } from './src/truncate_list'; diff --git a/x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/api.ts b/x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/api.ts index cb91f4e53e8ae..4e29d5f7dad06 100644 --- a/x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/api.ts +++ b/x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/api.ts @@ -93,6 +93,10 @@ export type ChatCompleteOptions< * Function calling mode, defaults to "native". */ functionCalling?: FunctionCallingMode; + /** + * Optional signal that can be used to forcefully abort the request. + */ + abortSignal?: AbortSignal; } & TToolOptions; /** diff --git a/x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts b/x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts index 5a99adc4321d9..472ed50e231f5 100644 --- a/x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts +++ b/x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts @@ -13,6 +13,7 @@ import { InferenceTaskEventBase, InferenceTaskEventType } from './inference_task export enum InferenceTaskErrorCode { internalError = 'internalError', requestError = 'requestError', + abortedError = 'requestAborted', } /** @@ -46,16 +47,37 @@ export type InferenceTaskErrorEvent = InferenceTaskEventBase<InferenceTaskEventT }; }; +/** + * Inference error thrown when an unexpected internal error occurs while handling the request. + */ export type InferenceTaskInternalError = InferenceTaskError< InferenceTaskErrorCode.internalError, Record<string, any> >; +/** + * Inference error thrown when the request was considered invalid. + * + * Some example of reasons for invalid requests would be: + * - no connector matching the provided connectorId + * - invalid connector type for the provided connectorId + */ export type InferenceTaskRequestError = InferenceTaskError< InferenceTaskErrorCode.requestError, { status: number } >; +/** + * Inference error thrown when the request was aborted. + * + * Request abortion occurs when providing an abort signal and firing it + * before the call to the LLM completes. + */ +export type InferenceTaskAbortedError = InferenceTaskError< + InferenceTaskErrorCode.abortedError, + { status: number } +>; + export function createInferenceInternalError( message = 'An internal error occurred', meta?: Record<string, any> @@ -72,16 +94,38 @@ export function createInferenceRequestError( }); } +export function createInferenceRequestAbortedError(): InferenceTaskAbortedError { + return new InferenceTaskError(InferenceTaskErrorCode.abortedError, 'Request was aborted', { + status: 499, + }); +} + +/** + * Check if the given error is an {@link InferenceTaskError} + */ export function isInferenceError( error: unknown ): error is InferenceTaskError<string, Record<string, any> | undefined> { return error instanceof InferenceTaskError; } +/** + * Check if the given error is an {@link InferenceTaskInternalError} + */ export function isInferenceInternalError(error: unknown): error is InferenceTaskInternalError { return isInferenceError(error) && error.code === InferenceTaskErrorCode.internalError; } +/** + * Check if the given error is an {@link InferenceTaskRequestError} + */ export function isInferenceRequestError(error: unknown): error is InferenceTaskRequestError { return isInferenceError(error) && error.code === InferenceTaskErrorCode.requestError; } + +/** + * Check if the given error is an {@link InferenceTaskAbortedError} + */ +export function isInferenceRequestAbortedError(error: unknown): error is InferenceTaskAbortedError { + return isInferenceError(error) && error.code === InferenceTaskErrorCode.abortedError; +} diff --git a/x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts b/x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts index cd90394cd67d3..3ae4a6a07ee29 100644 --- a/x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts +++ b/x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts @@ -96,7 +96,10 @@ export interface OutputOptions< * Defaults to false. */ stream?: TStream; - + /** + * Optional signal that can be used to forcefully abort the request. + */ + abortSignal?: AbortSignal; /** * Optional configuration for retrying the call if an error occurs. */ diff --git a/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/README.md b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/README.md new file mode 100644 index 0000000000000..aa39b20dbbdff --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/README.md @@ -0,0 +1,9 @@ +# @kbn/cloud-security-posture-common + +This package provides common code consumed in both the browser, i.e. the +`packages/kbn-cloud-security-posture` package and `solutions/security/plugins/cloud_security_posture` plugin, and on the server, i.e. the +`solutions/security/plugins/cloud_security_posture` plugin. + +## Maintainers + +Maintained by the Cloud Security Team \ No newline at end of file diff --git a/x-pack/packages/kbn-cloud-security-posture/common/constants.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/constants.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/constants.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/common/index.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/index.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/index.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/index.ts diff --git a/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/jest.config.js b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/jest.config.js new file mode 100644 index 0000000000000..bb188473325e7 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/jest.config.js @@ -0,0 +1,12 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../..', + roots: ['<rootDir>/x-pack/platform/packages/shared/kbn-cloud-security-posture/common'], +}; diff --git a/x-pack/packages/kbn-cloud-security-posture/common/kibana.jsonc b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/kibana.jsonc similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/kibana.jsonc rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/kibana.jsonc diff --git a/x-pack/packages/kbn-cloud-security-posture/common/package.json b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/package.json similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/package.json rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/package.json diff --git a/x-pack/packages/kbn-cloud-security-posture/common/schema/graph/index.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/graph/index.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/schema/graph/index.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/graph/index.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/common/schema/graph/latest.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/graph/latest.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/schema/graph/latest.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/graph/latest.ts diff --git a/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/graph/v1.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/graph/v1.ts new file mode 100644 index 0000000000000..5b1a48cf940b7 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/graph/v1.ts @@ -0,0 +1,102 @@ +/* + * 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 { schema } from '@kbn/config-schema'; +import { ApiMessageCode } from '../../types/graph/v1'; + +export const graphRequestSchema = schema.object({ + nodesLimit: schema.maybe(schema.number()), + showUnknownTarget: schema.maybe(schema.boolean()), + query: schema.object({ + originEventIds: schema.arrayOf( + schema.object({ id: schema.string(), isAlert: schema.boolean() }) + ), + // TODO: use zod for range validation instead of config schema + start: schema.oneOf([schema.number(), schema.string()]), + end: schema.oneOf([schema.number(), schema.string()]), + esQuery: schema.maybe( + schema.object({ + bool: schema.object({ + filter: schema.maybe(schema.arrayOf(schema.object({}, { unknowns: 'allow' }))), + must: schema.maybe(schema.arrayOf(schema.object({}, { unknowns: 'allow' }))), + should: schema.maybe(schema.arrayOf(schema.object({}, { unknowns: 'allow' }))), + must_not: schema.maybe(schema.arrayOf(schema.object({}, { unknowns: 'allow' }))), + }), + }) + ), + }), +}); + +export const graphResponseSchema = () => + schema.object({ + nodes: schema.arrayOf( + schema.oneOf([entityNodeDataSchema, groupNodeDataSchema, labelNodeDataSchema]) + ), + edges: schema.arrayOf(edgeDataSchema), + messages: schema.maybe( + schema.arrayOf(schema.oneOf([schema.literal(ApiMessageCode.ReachedNodesLimit)])) + ), + }); + +export const colorSchema = schema.oneOf([ + schema.literal('primary'), + schema.literal('danger'), + schema.literal('warning'), +]); + +export const nodeShapeSchema = schema.oneOf([ + schema.literal('hexagon'), + schema.literal('pentagon'), + schema.literal('ellipse'), + schema.literal('rectangle'), + schema.literal('diamond'), + schema.literal('label'), + schema.literal('group'), +]); + +export const nodeBaseDataSchema = schema.object({ + id: schema.string(), + label: schema.maybe(schema.string()), + icon: schema.maybe(schema.string()), +}); + +export const entityNodeDataSchema = schema.allOf([ + nodeBaseDataSchema, + schema.object({ + color: colorSchema, + shape: schema.oneOf([ + schema.literal('hexagon'), + schema.literal('pentagon'), + schema.literal('ellipse'), + schema.literal('rectangle'), + schema.literal('diamond'), + ]), + }), +]); + +export const groupNodeDataSchema = schema.allOf([ + nodeBaseDataSchema, + schema.object({ + shape: schema.literal('group'), + }), +]); + +export const labelNodeDataSchema = schema.allOf([ + nodeBaseDataSchema, + schema.object({ + shape: schema.literal('label'), + parentId: schema.maybe(schema.string()), + color: colorSchema, + }), +]); + +export const edgeDataSchema = schema.object({ + id: schema.string(), + source: schema.string(), + target: schema.string(), + color: colorSchema, +}); diff --git a/x-pack/packages/kbn-cloud-security-posture/common/schema/rules/index.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/rules/index.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/schema/rules/index.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/rules/index.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/common/schema/rules/latest.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/rules/latest.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/schema/rules/latest.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/rules/latest.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/common/schema/rules/v1.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/rules/v1.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/schema/rules/v1.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/rules/v1.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/common/schema/rules/v2.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/rules/v2.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/schema/rules/v2.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/rules/v2.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/common/schema/rules/v3.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/rules/v3.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/schema/rules/v3.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/rules/v3.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/common/schema/rules/v4.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/rules/v4.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/schema/rules/v4.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/rules/v4.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/common/schema/rules/v5.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/rules/v5.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/schema/rules/v5.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/rules/v5.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/csp_vulnerability_finding.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/latest.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/latest.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/schema/vulnerabilities/latest.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/schema/vulnerabilities/latest.ts diff --git a/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/tsconfig.json b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/tsconfig.json new file mode 100644 index 0000000000000..681b16eddbd65 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/tsconfig.json @@ -0,0 +1,25 @@ +{ + "extends": "../../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/config-schema", + "@kbn/data-views-plugin", + "@kbn/i18n", + "@kbn/analytics", + "@kbn/usage-collection-plugin", + "@kbn/es-query", + ] +} diff --git a/x-pack/packages/kbn-cloud-security-posture/common/types/benchmark.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/benchmark.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/types/benchmark.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/benchmark.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/common/types/findings.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/findings.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/types/findings.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/findings.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/common/types/graph/index.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/graph/index.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/types/graph/index.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/graph/index.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/common/types/graph/latest.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/graph/latest.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/types/graph/latest.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/graph/latest.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/common/types/graph/v1.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/graph/v1.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/types/graph/v1.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/graph/v1.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/common/types/status.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/types/status.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/status.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/common/types/vulnerabilities.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/vulnerabilities.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/types/vulnerabilities.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/vulnerabilities.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/common/utils/get_abbreviated_number.test.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/get_abbreviated_number.test.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/utils/get_abbreviated_number.test.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/get_abbreviated_number.test.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/common/utils/get_abbreviated_number.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/get_abbreviated_number.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/utils/get_abbreviated_number.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/get_abbreviated_number.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.test.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.test.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/utils/helpers.test.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.test.ts diff --git a/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts new file mode 100644 index 0000000000000..8335fea705069 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/helpers.ts @@ -0,0 +1,174 @@ +/* + * 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 { QueryDslQueryContainer } from '@kbn/data-views-plugin/common/types'; + +import { i18n } from '@kbn/i18n'; +import type { CspBenchmarkRulesStates } from '../schema/rules/latest'; + +export const defaultErrorMessage = i18n.translate( + 'sharedPlatformPackages.csp.common.utils.helpers.unknownError', + { + defaultMessage: 'Unknown Error', + } +); + +export const extractErrorMessage = (e: unknown, fallbackMessage?: string): string => { + if (e instanceof Error) return e.message; + if (typeof e === 'string') return e; + + return fallbackMessage ?? defaultErrorMessage; +}; + +export const buildMutedRulesFilter = ( + rulesStates: CspBenchmarkRulesStates +): QueryDslQueryContainer[] => { + const mutedRules = Object.fromEntries( + Object.entries(rulesStates).filter(([key, value]) => value.muted === true) + ); + + const mutedRulesFilterQuery = Object.keys(mutedRules).map((key) => { + const rule = mutedRules[key]; + return { + bool: { + must: [ + { term: { 'rule.benchmark.id': rule.benchmark_id } }, + { term: { 'rule.benchmark.version': rule.benchmark_version } }, + { term: { 'rule.benchmark.rule_number': rule.rule_number } }, + ], + }, + }; + }); + + return mutedRulesFilterQuery; +}; + +export const buildGenericEntityFlyoutPreviewQuery = ( + field: string, + queryValue?: string, + status?: string, + queryField?: string +) => { + return { + bool: { + filter: [ + { + bool: { + should: [ + { + term: { + [field]: `${queryValue || ''}`, + }, + }, + ], + minimum_should_match: 1, + }, + }, + status && queryField + ? { + bool: { + should: [ + { + term: { + [queryField]: status, + }, + }, + ], + minimum_should_match: 1, + }, + } + : undefined, + ].filter(Boolean), + }, + }; +}; + +// Higher-order function for Misconfiguration +export const buildMisconfigurationEntityFlyoutPreviewQuery = ( + field: string, + queryValue?: string, + status?: string +) => { + const queryField = 'result.evaluation'; + return buildGenericEntityFlyoutPreviewQuery(field, queryValue, status, queryField); +}; + +// Higher-order function for Vulnerability +export const buildVulnerabilityEntityFlyoutPreviewQuery = ( + field: string, + queryValue?: string, + status?: string +) => { + const queryField = 'vulnerability.severity'; + return buildGenericEntityFlyoutPreviewQuery(field, queryValue, status, queryField); +}; + +export const buildEntityAlertsQuery = ( + field: string, + to: string, + from: string, + queryValue?: string, + size?: number, + severity?: string +) => { + return { + size: size || 0, + _source: false, + fields: [ + '_id', + '_index', + 'kibana.alert.rule.uuid', + 'kibana.alert.severity', + 'kibana.alert.rule.name', + 'kibana.alert.workflow_status', + ], + query: { + bool: { + filter: [ + { + bool: { + should: [ + { + term: { + [field]: `${queryValue || ''}`, + }, + }, + ], + minimum_should_match: 1, + }, + }, + severity + ? { + bool: { + should: [ + { + term: { + 'kibana.alert.severity': severity, + }, + }, + ], + minimum_should_match: 1, + }, + } + : undefined, + { + range: { + '@timestamp': { + gte: from, + lte: to, + }, + }, + }, + { + terms: { + 'kibana.alert.workflow_status': ['open', 'acknowledged'], + }, + }, + ].filter(Boolean), + }, + }, + }; +}; diff --git a/x-pack/packages/kbn-cloud-security-posture/common/utils/ui_metrics.ts b/x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/ui_metrics.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/common/utils/ui_metrics.ts rename to x-pack/platform/packages/shared/kbn-cloud-security-posture/common/utils/ui_metrics.ts diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/README.md b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/README.md index 94ab25c8279b7..d02d3cad21eef 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant-common/README.md +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant-common/README.md @@ -1,7 +1,7 @@ # @kbn/elastic-assistant-common This package provides common code consumed in both the browser, i.e. the -`platform/packages/shared/kbn-elastic-assistant` package and `plugins/security_solution` plugin, and on the server, i.e. the +`platform/packages/shared/kbn-elastic-assistant` package and `solutions/security/plugins/security_solution` plugin, and on the server, i.e. the `solutions/security/plugins/elastic_assistant` plugin. For example, the data anonymization functions exported by this package diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/prompt_context/types.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/prompt_context/types.ts index 233e45049333c..7ea1fdbc38bf8 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/prompt_context/types.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/impl/assistant/prompt_context/types.ts @@ -91,7 +91,7 @@ export interface SelectedPromptContext { * initializing it. This is used to provide 'category' options when users create Quick Prompts. * Also, useful for collating all of a solutions' prompts in one place. * - * e.g. see Security Solution's x-pack/plugins/security_solution/public/assistant/prompt_contexts/index.tsx + * e.g. see Security Solution's x-pack/solutions/security/plugins/security_solution/public/assistant/prompt_contexts/index.tsx */ export type PromptContextTemplate = Omit<PromptContext, 'id' | 'getPromptContext'>; diff --git a/x-pack/platform/packages/shared/kbn-elastic-assistant/index.ts b/x-pack/platform/packages/shared/kbn-elastic-assistant/index.ts index 7f9ce6fe36c2f..97cd680fae3af 100644 --- a/x-pack/platform/packages/shared/kbn-elastic-assistant/index.ts +++ b/x-pack/platform/packages/shared/kbn-elastic-assistant/index.ts @@ -136,7 +136,7 @@ export type { PromptContext } from './impl/assistant/prompt_context/types'; * initializing it. This is used to provide 'category' options when users create Quick Prompts. * Also, useful for collating all of a solutions' prompts in one place. * - * e.g. see Security Solution's x-pack/plugins/security_solution/public/assistant/prompt_contexts/index.tsx + * e.g. see Security Solution's x-pack/solutions/security/plugins/security_solution/public/assistant/prompt_contexts/index.tsx */ export type { PromptContextTemplate } from './impl/assistant/prompt_context/types'; diff --git a/x-pack/platform/packages/shared/ml/aiops_log_rate_analysis/constants.ts b/x-pack/platform/packages/shared/ml/aiops_log_rate_analysis/constants.ts index 2d915870ca129..6ae763ef40967 100644 --- a/x-pack/platform/packages/shared/ml/aiops_log_rate_analysis/constants.ts +++ b/x-pack/platform/packages/shared/ml/aiops_log_rate_analysis/constants.ts @@ -5,6 +5,8 @@ * 2.0. */ +import { useEuiTheme } from '@elastic/eui'; + /** Log rate analysis settings */ export const LOG_RATE_ANALYSIS_SETTINGS = { /** @@ -32,7 +34,17 @@ export const LOG_RATE_ANALYSIS_SETTINGS = { export const RANDOM_SAMPLER_SEED = 3867412; /** Highlighting color for charts */ -export const LOG_RATE_ANALYSIS_HIGHLIGHT_COLOR = 'orange'; +export const useLogRateAnalysisBarColors = () => { + const { euiTheme } = useEuiTheme(); + return { + barColor: euiTheme.flags.hasVisColorAdjustment + ? euiTheme.colors.vis.euiColorVis0 + : euiTheme.colors.vis.euiColorVis0, + barHighlightColor: euiTheme.flags.hasVisColorAdjustment + ? 'orange' + : euiTheme.colors.vis.euiColorVis8, + }; +}; /** */ export const EMBEDDABLE_LOG_RATE_ANALYSIS_TYPE = 'aiopsLogRateAnalysisEmbeddable' as const; diff --git a/x-pack/platform/packages/shared/ml/aiops_log_rate_analysis/index.ts b/x-pack/platform/packages/shared/ml/aiops_log_rate_analysis/index.ts index 15762c09684c5..36041bbcca7c7 100644 --- a/x-pack/platform/packages/shared/ml/aiops_log_rate_analysis/index.ts +++ b/x-pack/platform/packages/shared/ml/aiops_log_rate_analysis/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -export { LOG_RATE_ANALYSIS_HIGHLIGHT_COLOR } from './constants'; +export { useLogRateAnalysisBarColors } from './constants'; export { getLogRateAnalysisTypeForHistogram } from './get_log_rate_analysis_type_for_histogram'; export { LOG_RATE_ANALYSIS_TYPE, type LogRateAnalysisType } from './log_rate_analysis_type'; export type { LogRateHistogramItem } from './log_rate_histogram_item'; diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/_index.scss b/x-pack/platform/plugins/private/data_visualizer/public/application/_index.scss deleted file mode 100644 index ecc7a2fce1fa6..0000000000000 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import 'common/components/index'; diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/_index.scss b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/_index.scss deleted file mode 100644 index 232cb369a1d07..0000000000000 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/_index.scss +++ /dev/null @@ -1,2 +0,0 @@ -@import 'stats_table/index'; -@import 'top_values/top_values'; diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/document_count_content/document_count_chart/document_count_chart.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/document_count_content/document_count_chart/document_count_chart.tsx index d6adf432fd575..75d000e8e8a4e 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/document_count_content/document_count_chart/document_count_chart.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/document_count_content/document_count_chart/document_count_chart.tsx @@ -7,7 +7,8 @@ import type { FC } from 'react'; import React, { useCallback, useMemo } from 'react'; -import { i18n } from '@kbn/i18n'; +import moment from 'moment'; + import type { BrushEndListener, ElementClickListener, @@ -15,12 +16,13 @@ import type { XYBrushEvent, } from '@elastic/charts'; import { Axis, HistogramBarSeries, Chart, Position, ScaleType, Settings } from '@elastic/charts'; -import moment from 'moment'; +import { useEuiTheme, EuiFlexGroup, EuiLoadingSpinner, EuiFlexItem } from '@elastic/eui'; + +import { i18n } from '@kbn/i18n'; import { getTimeZone } from '@kbn/visualization-utils'; import { MULTILAYER_TIME_AXIS_STYLE } from '@kbn/charts-plugin/common'; import type { LogRateHistogramItem } from '@kbn/aiops-log-rate-analysis'; -import { EuiFlexGroup, EuiLoadingSpinner, EuiFlexItem } from '@elastic/eui'; import { useDataVisualizerKibana } from '../../../../kibana_context'; interface Props { @@ -50,6 +52,7 @@ export const DocumentCountChart: FC<Props> = ({ interval, loading, }) => { + const { euiTheme } = useEuiTheme(); const { services: { data, uiSettings, fieldFormats, charts }, } = useDataVisualizerKibana(); @@ -154,6 +157,7 @@ export const DocumentCountChart: FC<Props> = ({ yAccessors={['value']} data={adjustedChartPoints} timeZone={timeZone} + color={euiTheme.colors.vis.euiColorVis0} yNice /> </Chart> diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/link_card/link_card.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/link_card/link_card.tsx index b65092514d59a..501b7385fbf67 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/link_card/link_card.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/link_card/link_card.tsx @@ -9,6 +9,7 @@ import type { FC } from 'react'; import React from 'react'; import { + useEuiTheme, EuiIcon, EuiText, EuiTitle, @@ -18,7 +19,6 @@ import { EuiLink, } from '@elastic/eui'; import type { EuiIconType } from '@elastic/eui/src/components/icon/icon'; -import { useCurrentEuiTheme } from '../../hooks/use_current_eui_theme'; export interface LinkCardProps { icon: EuiIconType | string; @@ -43,7 +43,7 @@ export const LinkCard: FC<LinkCardProps> = ({ isDisabled, 'data-test-subj': dataTestSubj, }) => { - const euiTheme = useCurrentEuiTheme(); + const { euiTheme } = useEuiTheme(); const linkHrefAndOnClickProps = { ...(href ? { href } : {}), @@ -67,7 +67,7 @@ export const LinkCard: FC<LinkCardProps> = ({ {...linkHrefAndOnClickProps} > <EuiFlexGroup gutterSize="s" responsive={true}> - <EuiFlexItem grow={false} css={{ paddingTop: euiTheme.euiSizeXS }}> + <EuiFlexItem grow={false} css={{ paddingTop: euiTheme.size.xs }}> <EuiIcon size="m" type={icon} aria-label={iconAreaLabel} /> </EuiFlexItem> <EuiFlexItem> diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/multi_select_picker/multi_select_picker.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/multi_select_picker/multi_select_picker.tsx index feabb32ecadbf..8c3c06ba08ce5 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/multi_select_picker/multi_select_picker.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/multi_select_picker/multi_select_picker.tsx @@ -6,6 +6,7 @@ */ import { + useEuiTheme, EuiFieldSearch, EuiFilterButton, EuiFilterGroup, @@ -21,7 +22,6 @@ import React, { useEffect, useState } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import type { SerializedStyles } from '@emotion/react'; import { css } from '@emotion/react'; -import { useCurrentEuiTheme } from '../../hooks/use_current_eui_theme'; export interface Option { name?: string | ReactNode; @@ -60,7 +60,7 @@ export const MultiSelectPicker: FC<{ postfix?: React.ReactElement; cssStyles?: MultiSelectPickerStyles; }> = ({ options, onChange, title, checkedOptions, dataTestSubj, postfix, cssStyles }) => { - const euiTheme = useCurrentEuiTheme(); + const { euiTheme } = useEuiTheme(); const [items, setItems] = useState<Option[]>(options); const [searchTerm, setSearchTerm] = useState<string>(''); @@ -153,8 +153,8 @@ export const MultiSelectPicker: FC<{ flexDirection: 'row', color: item.disabled === true - ? euiTheme.euiColorDisabledText - : euiTheme.euiTextColor, + ? euiTheme.colors.textDisabled + : euiTheme.colors.textParagraph, }} data-test-subj={`${dataTestSubj}-option-${item.value}${ checked ? '-checked' : '' diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/_index.scss b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/_index.scss deleted file mode 100644 index ccd38b8506a93..0000000000000 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/_index.scss +++ /dev/null @@ -1,2 +0,0 @@ -@import 'components/field_data_expanded_row/index'; -@import 'components/field_data_row/index'; diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/_index.scss b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/_index.scss deleted file mode 100644 index fdc591a140fea..0000000000000 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/_index.scss +++ /dev/null @@ -1 +0,0 @@ -@import 'number_content'; diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/_number_content.scss b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/_number_content.scss deleted file mode 100644 index 1f52b0763cdd3..0000000000000 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/_number_content.scss +++ /dev/null @@ -1,4 +0,0 @@ -.metricDistributionChartContainer { - padding-top: $euiSizeXS; - width: 100%; -} diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/boolean_content.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/boolean_content.tsx index 669c48b1db8bf..6be2d5e9fa285 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/boolean_content.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/boolean_content.tsx @@ -7,20 +7,26 @@ import type { FC } from 'react'; import React, { useMemo } from 'react'; + import { EuiSpacer } from '@elastic/eui'; import { Axis, BarSeries, Chart, Settings, ScaleType, LEGACY_LIGHT_THEME } from '@elastic/charts'; import { FormattedMessage } from '@kbn/i18n-react'; import { roundToDecimalPlace } from '@kbn/ml-number-utils'; import { i18n } from '@kbn/i18n'; + import { TopValues } from '../../../top_values'; + import type { FieldDataRowProps } from '../../types/field_data_row'; -import { ExpandedRowFieldHeader } from '../expanded_row_field_header'; import { getTFPercentage } from '../../utils'; import { useDataVizChartTheme } from '../../hooks'; + +import { ExpandedRowFieldHeader } from '../expanded_row_field_header'; + import { DocumentStatsTable } from './document_stats'; import { ExpandedRowContent } from './expanded_row_content'; import { ExpandedRowPanel } from './expanded_row_panel'; +import { useBarColor } from './use_bar_color'; function getPercentLabel(value: number): string { if (value === 0) { @@ -41,6 +47,8 @@ function getFormattedValue(value: number, totalCount: number): string { const BOOLEAN_DISTRIBUTION_CHART_HEIGHT = 70; export const BooleanContent: FC<FieldDataRowProps> = ({ config, onAddFilter }) => { + const barColor = useBarColor(); + const fieldFormat = 'fieldFormat' in config ? config.fieldFormat : undefined; const formattedPercentages = useMemo(() => getTFPercentage(config), [config]); const theme = useDataVizChartTheme(); @@ -54,7 +62,7 @@ export const BooleanContent: FC<FieldDataRowProps> = ({ config, onAddFilter }) = <TopValues stats={config.stats} fieldFormat={fieldFormat} - barColor="accentSecondary" + barColor={barColor} onAddFilter={onAddFilter} /> diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/ip_content.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/ip_content.tsx index 6baaf8e065d1f..3cd12cb78a454 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/ip_content.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/ip_content.tsx @@ -7,12 +7,18 @@ import type { FC } from 'react'; import React from 'react'; -import type { FieldDataRowProps } from '../../types/field_data_row'; + import { TopValues } from '../../../top_values'; + +import type { FieldDataRowProps } from '../../types/field_data_row'; + import { DocumentStatsTable } from './document_stats'; import { ExpandedRowContent } from './expanded_row_content'; +import { useBarColor } from './use_bar_color'; export const IpContent: FC<FieldDataRowProps> = ({ config, onAddFilter }) => { + const barColor = useBarColor(); + const { stats } = config; if (stats === undefined) return null; const { count, sampleCount, cardinality } = stats; @@ -26,7 +32,7 @@ export const IpContent: FC<FieldDataRowProps> = ({ config, onAddFilter }) => { <TopValues stats={stats} fieldFormat={fieldFormat} - barColor="accentSecondary" + barColor={barColor} onAddFilter={onAddFilter} /> )} diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/keyword_content.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/keyword_content.tsx index ddca9193db2b1..e2be5c86018c2 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/keyword_content.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/keyword_content.tsx @@ -7,16 +7,24 @@ import type { FC } from 'react'; import React, { useEffect, useState } from 'react'; + import type { EMSTermJoinConfig } from '@kbn/maps-plugin/public'; -import type { FieldDataRowProps } from '../../types/field_data_row'; -import { TopValues } from '../../../top_values'; + import { useDataVisualizerKibana } from '../../../../../kibana_context'; + +import { TopValues } from '../../../top_values'; + +import type { FieldDataRowProps } from '../../types/field_data_row'; + import { DocumentStatsTable } from './document_stats'; import { ExpandedRowContent } from './expanded_row_content'; import { ChoroplethMap } from './choropleth_map'; import { ErrorMessageContent } from './error_message'; +import { useBarColor } from './use_bar_color'; export const KeywordContent: FC<FieldDataRowProps> = ({ config, onAddFilter }) => { + const barColor = useBarColor(); + const [suggestion, setSuggestion] = useState<EMSTermJoinConfig | null>(null); const { stats, fieldName } = config; const fieldFormat = 'fieldFormat' in config ? config.fieldFormat : undefined; @@ -62,14 +70,14 @@ export const KeywordContent: FC<FieldDataRowProps> = ({ config, onAddFilter }) = <TopValues stats={stats} fieldFormat={fieldFormat} - barColor="accentSecondary" + barColor={barColor} onAddFilter={onAddFilter} /> {config.stats?.sampledValues && fieldName !== undefined ? ( <TopValues stats={stats} fieldFormat={fieldFormat} - barColor="accentSecondary" + barColor={barColor} onAddFilter={onAddFilter} showSampledValues={true} /> diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/number_content.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/number_content.tsx index 8b121660e3421..db0c2270fedb7 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/number_content.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/number_content.tsx @@ -7,20 +7,34 @@ import type { FC, ReactNode } from 'react'; import React, { useMemo } from 'react'; +import { css } from '@emotion/react'; + import type { HorizontalAlignment } from '@elastic/eui'; -import { EuiBasicTable, EuiFlexItem, EuiText, LEFT_ALIGNMENT, RIGHT_ALIGNMENT } from '@elastic/eui'; +import { + useEuiTheme, + EuiBasicTable, + EuiFlexItem, + EuiText, + LEFT_ALIGNMENT, + RIGHT_ALIGNMENT, +} from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { isDefined } from '@kbn/ml-is-defined'; -import type { FieldDataRowProps } from '../../types/field_data_row'; + +import { TopValues } from '../../../top_values'; import { kibanaFieldFormat, numberAsOrdinal } from '../../../utils'; + +import type { FieldDataRowProps } from '../../types/field_data_row'; + import { MetricDistributionChart, buildChartDataFromStats } from '../metric_distribution_chart'; -import { TopValues } from '../../../top_values'; import { ExpandedRowFieldHeader } from '../expanded_row_field_header'; + import { DocumentStatsTable } from './document_stats'; import { ExpandedRowContent } from './expanded_row_content'; import { ExpandedRowPanel } from './expanded_row_panel'; +import { useBarColor } from './use_bar_color'; const METRIC_DISTRIBUTION_CHART_WIDTH = 260; const METRIC_DISTRIBUTION_CHART_HEIGHT = 200; @@ -32,6 +46,13 @@ interface SummaryTableItem { } export const NumberContent: FC<FieldDataRowProps> = ({ config, onAddFilter }) => { + const { euiTheme } = useEuiTheme(); + + const metricDistributionChartContainer = css({ + paddingTop: euiTheme.size.xs, + width: '100%', + }); + const { stats } = config; const distributionChartData = useMemo( @@ -39,6 +60,8 @@ export const NumberContent: FC<FieldDataRowProps> = ({ config, onAddFilter }) => [stats?.distribution] ); + const barColor = useBarColor(); + if (stats === undefined) return null; const { min, median, max, distribution } = stats; const fieldFormat = 'fieldFormat' in config ? config.fieldFormat : undefined; @@ -119,7 +142,7 @@ export const NumberContent: FC<FieldDataRowProps> = ({ config, onAddFilter }) => <TopValues stats={stats} fieldFormat={fieldFormat} - barColor="accentSecondary" + barColor={barColor} compressed={true} onAddFilter={onAddFilter} /> @@ -141,7 +164,7 @@ export const NumberContent: FC<FieldDataRowProps> = ({ config, onAddFilter }) => </ExpandedRowFieldHeader> </EuiFlexItem> - <EuiFlexItem className={'metricDistributionChartContainer'}> + <EuiFlexItem css={metricDistributionChartContainer}> <MetricDistributionChart width={METRIC_DISTRIBUTION_CHART_WIDTH} height={METRIC_DISTRIBUTION_CHART_HEIGHT} diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/use_bar_color.ts b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/use_bar_color.ts new file mode 100644 index 0000000000000..682bbc7da8daf --- /dev/null +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/use_bar_color.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 { useEuiTheme } from '@elastic/eui'; + +export const useBarColor = () => { + const { euiTheme } = useEuiTheme(); + + return euiTheme.flags.hasVisColorAdjustment ? 'success' : 'vis0'; +}; diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_row/_index.scss b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_row/_index.scss deleted file mode 100644 index 3afa182560e1e..0000000000000 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_row/_index.scss +++ /dev/null @@ -1,3 +0,0 @@ -.dataVisualizerColumnHeaderIcon { - max-width: $euiSizeM; -} diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/data_visualizer_stats_table.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/data_visualizer_stats_table.tsx index e0e43efb694f2..b4db9b26681ef 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/data_visualizer_stats_table.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/data_visualizer_stats_table.tsx @@ -41,7 +41,6 @@ import { BooleanContentPreview } from './components/field_data_row'; import { calculateTableColumnsDimensions } from './utils'; import { DistinctValues } from './components/field_data_row/distinct_values'; import { FieldTypeIcon } from '../field_type_icon'; -import './_index.scss'; import type { FieldStatisticTableEmbeddableProps } from '../../../index_data_visualizer/embeddables/grid_embeddable/types'; import type { DataVisualizerTableItem } from './types'; diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/hooks/use_color_range.ts b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/hooks/use_color_range.ts index d230da125c13e..b929ec9a557db 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/hooks/use_color_range.ts +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/hooks/use_color_range.ts @@ -7,8 +7,7 @@ import d3 from 'd3'; import { i18n } from '@kbn/i18n'; -import { useCurrentEuiTheme } from '../../../hooks/use_current_eui_theme'; - +import { useEuiTheme } from '@elastic/eui'; /** * Custom color scale factory that takes the amount of feature influencers * into account to adjust the contrast of the color range. This is used for @@ -155,16 +154,24 @@ export const useColorRange = ( colorRangeScale = COLOR_RANGE_SCALE.LINEAR, featureCount = 1 ) => { - const euiTheme = useCurrentEuiTheme(); + const { euiTheme } = useEuiTheme(); const colorRanges: Record<COLOR_RANGE, string[]> = { [COLOR_RANGE.BLUE]: [ - d3.rgb(euiTheme.euiColorEmptyShade).toString(), - d3.rgb(euiTheme.euiColorVis1).toString(), + d3.rgb(euiTheme.colors.emptyShade).toString(), + d3 + .rgb( + // Amsterdam: euiTheme.colors.vis.euiColorVis1 + // Borealis: euiTheme.colors.vis.euiColorVis2 + euiTheme.flags.hasVisColorAdjustment + ? euiTheme.colors.vis.euiColorVis1 + : euiTheme.colors.vis.euiColorVis2 + ) + .toString(), ], [COLOR_RANGE.RED]: [ - d3.rgb(euiTheme.euiColorEmptyShade).toString(), - d3.rgb(euiTheme.euiColorDanger).toString(), + d3.rgb(euiTheme.colors.emptyShade).toString(), + d3.rgb(euiTheme.colors.danger).toString(), ], [COLOR_RANGE.RED_GREEN]: ['red', 'green'], [COLOR_RANGE.GREEN_RED]: ['green', 'red'], diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/hooks/use_data_viz_chart_theme.ts b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/hooks/use_data_viz_chart_theme.ts index 269c9b55fc3de..cf21569de6ebb 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/hooks/use_data_viz_chart_theme.ts +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/hooks/use_data_viz_chart_theme.ts @@ -5,18 +5,22 @@ * 2.0. */ -import type { PartialTheme } from '@elastic/charts'; import { useMemo } from 'react'; -import { useCurrentEuiTheme } from '../../../hooks/use_current_eui_theme'; + +import type { PartialTheme } from '@elastic/charts'; +import { useEuiFontSize, useEuiTheme } from '@elastic/eui'; + export const useDataVizChartTheme = (): PartialTheme => { - const euiTheme = useCurrentEuiTheme(); + const { euiTheme } = useEuiTheme(); + const euiFontSizeXS = useEuiFontSize('xs', { unit: 'px' }).fontSize as string; const chartTheme = useMemo<PartialTheme>(() => { - const AREA_SERIES_COLOR = euiTheme.euiColorVis0; + // Amsterdam + Borealis + const AREA_SERIES_COLOR = euiTheme.colors.vis.euiColorVis0; return { axes: { tickLabel: { - fontSize: parseInt(euiTheme.euiFontSizeXS, 10), - fontFamily: euiTheme.euiFontFamily, + fontSize: parseInt(euiFontSizeXS, 10), + fontFamily: euiTheme.font.family, fontStyle: 'italic', }, }, @@ -50,6 +54,6 @@ export const useDataVizChartTheme = (): PartialTheme => { area: { visible: true, opacity: 1 }, }, }; - }, [euiTheme]); + }, [euiFontSizeXS, euiTheme]); return chartTheme; }; diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/top_values/_top_values.scss b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/top_values/_top_values.scss deleted file mode 100644 index bb227dd24d48a..0000000000000 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/top_values/_top_values.scss +++ /dev/null @@ -1,7 +0,0 @@ -.fieldDataTopValuesContainer { - padding-top: $euiSizeXS; -} - -.topValuesValueLabelContainer { - margin-right: $euiSizeM; -} diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/top_values/top_values.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/top_values/top_values.tsx index 35c648e7135bb..d3337a7f676d6 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/top_values/top_values.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/top_values/top_values.tsx @@ -34,7 +34,7 @@ import type { FieldVisStats } from '../../../../../common/types'; import { ExpandedRowPanel } from '../stats_table/components/field_data_expanded_row/expanded_row_panel'; import { EMPTY_EXAMPLE } from '../examples_list/examples_list'; -interface Props { +interface TopValuesProps { stats: FieldVisStats | undefined; fieldFormat?: any; barColor?: EuiProgressProps['color']; @@ -53,7 +53,7 @@ function getPercentLabel(percent: number): string { } } -export const TopValues: FC<Props> = ({ +export const TopValues: FC<TopValuesProps> = ({ stats, fieldFormat, barColor, @@ -72,7 +72,11 @@ export const TopValues: FC<Props> = ({ data: { fieldFormats }, }, } = useDataVisualizerKibana(); - const euiTheme = useEuiTheme(); + const euiThemeContext = useEuiTheme(); + const { euiTheme } = euiThemeContext; + + const fieldDataTopValuesContainer = css({ paddingTop: euiTheme.size.xs }); + const topValuesValueLabelContainer = css({ marginRight: euiTheme.size.m }); if (stats === undefined || !stats.topValues) return null; const { fieldName, sampleCount, approximate } = stats; @@ -175,7 +179,7 @@ export const TopValues: FC<Props> = ({ className={classNames('dvPanel__wrapper', compressed ? 'dvPanel--compressed' : undefined)} css={css` overflow-x: auto; - ${euiScrollBarStyles(euiTheme)} + ${euiScrollBarStyles(euiThemeContext)} `} > <ExpandedRowFieldHeader> @@ -194,7 +198,8 @@ export const TopValues: FC<Props> = ({ <div data-test-subj="dataVisualizerFieldDataTopValuesContent" - className={classNames('fieldDataTopValuesContainer', 'dvTopValues__wrapper')} + className="dvTopValues__wrapper" + css={fieldDataTopValuesContainer} > {Array.isArray(topValues) ? topValues.map((value) => { @@ -210,7 +215,8 @@ export const TopValues: FC<Props> = ({ color={barColor} size="xs" label={value.key ? kibanaFieldFormat(value.key, fieldFormat) : displayValue} - className={classNames('eui-textTruncate', 'topValuesValueLabelContainer')} + className="eui-textTruncate" + css={topValuesValueLabelContainer} valueText={`${value.doc_count}${ totalDocuments !== undefined ? ` (${getPercentLabel(value.percent * 100)})` @@ -289,7 +295,8 @@ export const TopValues: FC<Props> = ({ defaultMessage="Other" /> } - className={classNames('eui-textTruncate', 'topValuesValueLabelContainer')} + className="eui-textTruncate" + css={topValuesValueLabelContainer} valueText={`${topValuesOtherCount}${ totalDocuments !== undefined ? ` (${getPercentLabel(topValuesOtherCountPercent * 100)})` diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/hooks/use_current_eui_theme.ts b/x-pack/platform/plugins/private/data_visualizer/public/application/common/hooks/use_current_eui_theme.ts deleted file mode 100644 index bd2500b1b77e6..0000000000000 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/hooks/use_current_eui_theme.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 { useCurrentEuiThemeVars } from '@kbn/ml-kibana-theme'; -import { useDataVisualizerKibana } from '../../kibana_context'; - -export function useCurrentEuiTheme() { - const { - services: { theme }, - } = useDataVisualizerKibana(); - - return useCurrentEuiThemeVars(theme).euiTheme; -} diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/data_drift/data_drift_overview_table.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/data_drift/data_drift_overview_table.tsx index 7de413c74b4de..ddbc3d4e9efe2 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/data_drift/data_drift_overview_table.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/data_drift/data_drift_overview_table.tsx @@ -20,12 +20,12 @@ import { import { FieldTypeIcon } from '../common/components/field_type_icon'; import { COLLAPSE_ROW, EXPAND_ROW } from '../../../common/i18n_constants'; import { COMPARISON_LABEL, REFERENCE_LABEL } from './constants'; -import { useCurrentEuiTheme } from '../common/hooks/use_current_eui_theme'; import { type DataDriftField, type Feature, FETCH_STATUS } from './types'; import { formatSignificanceLevel } from './data_drift_utils'; import { SingleDistributionChart } from './charts/single_distribution_chart'; import { OverlapDistributionComparison } from './charts/overlap_distribution_chart'; import { DataDriftDistributionChart } from './charts/data_drift_distribution_chart'; +import { useDataDriftColors } from './use_data_drift_colors'; const dataComparisonYesLabel = i18n.translate('xpack.dataVisualizer.dataDrift.fieldTypeYesLabel', { defaultMessage: 'Yes', @@ -47,15 +47,8 @@ export const DataDriftOverviewTable = ({ data: Feature[]; status: FETCH_STATUS; } & UseTableState<Feature>) => { - const euiTheme = useCurrentEuiTheme(); + const colors = useDataDriftColors(); - const colors = useMemo( - () => ({ - referenceColor: euiTheme.euiColorVis2, - comparisonColor: euiTheme.euiColorVis1, - }), - [euiTheme] - ); const [itemIdToExpandedRowMap, setItemIdToExpandedRowMap] = useState<Record<string, ReactNode>>( {} ); diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/data_drift/data_drift_page.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/data_drift/data_drift_page.tsx index 4623e886852d8..229290a1ace2b 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/data_drift/data_drift_page.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/data_drift/data_drift_page.tsx @@ -45,7 +45,6 @@ import { useDataDriftStateManagerContext } from './use_state_manager'; import { useData } from '../common/hooks/use_data'; import type { DVKey, DVStorageMapped } from '../index_data_visualizer/types/storage'; import { DV_FROZEN_TIER_PREFERENCE } from '../index_data_visualizer/types/storage'; -import { useCurrentEuiTheme } from '../common/hooks/use_current_eui_theme'; import type { DataComparisonFullAppState } from './types'; import { getDefaultDataComparisonState } from './types'; import { useDataSource } from '../common/hooks/data_source_context'; @@ -55,6 +54,7 @@ import { COMPARISON_LABEL, REFERENCE_LABEL } from './constants'; import { SearchPanelContent } from '../index_data_visualizer/components/search_panel/search_bar'; import { useSearch } from '../common/hooks/use_search'; import { DocumentCountWithBrush } from './document_count_with_brush'; +import { useDataDriftColors } from './use_data_drift_colors'; const dataViewTitleHeader = css({ minWidth: '300px', @@ -264,12 +264,7 @@ export const DataDriftPage: FC<Props> = ({ initialSettings }) => { }); }, [dataService, searchQueryLanguage, searchString]); - const euiTheme = useCurrentEuiTheme(); - const colors = { - referenceColor: euiTheme.euiColorVis2, - comparisonColor: euiTheme.euiColorVis1, - overlapColor: '#490771', - }; + const colors = useDataDriftColors(); const [brushRanges, setBrushRanges] = useState<WindowParameters | undefined>(); diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/data_drift/document_count_chart_single_brush/document_count_chart_singular.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/data_drift/document_count_chart_single_brush/document_count_chart_singular.tsx index 94de2d2f4390a..71b2cbdd3c2f0 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/data_drift/document_count_chart_single_brush/document_count_chart_singular.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/data_drift/document_count_chart_single_brush/document_count_chart_singular.tsx @@ -19,6 +19,8 @@ import type { BarStyleAccessor, RectAnnotationSpec, } from '@elastic/charts/dist/chart_types/xy_chart/utils/specs'; +import { useEuiTheme } from '@elastic/eui'; + import { getTimeZone } from '@kbn/visualization-utils'; import { i18n } from '@kbn/i18n'; import type { IUiSettingsClient } from '@kbn/core/public'; @@ -27,10 +29,10 @@ import { MULTILAYER_TIME_AXIS_STYLE } from '@kbn/charts-plugin/common'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; import type { ChartsPluginStart } from '@kbn/charts-plugin/public'; import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; - import { DualBrushAnnotation } from '@kbn/aiops-components'; import { FormattedMessage } from '@kbn/i18n-react'; import { EuiText } from '@elastic/eui'; + import { SingleBrush, getSingleBrushWindowParameters, @@ -174,6 +176,8 @@ export const DocumentCountChartWithBrush: FC<DocumentCountChartProps> = (props) const { data, uiSettings, fieldFormats, charts } = dependencies; + const { euiTheme } = useEuiTheme(); + const chartBaseTheme = charts.theme.useChartsBaseTheme(); const xAxisFormatter = fieldFormats.deserialize({ id: 'date' }); @@ -374,7 +378,7 @@ export const DocumentCountChartWithBrush: FC<DocumentCountChartProps> = (props) mlBrushWidth && mlBrushWidth > 0; - const barColor = barColorOverride ? [barColorOverride] : undefined; + const barColor = barColorOverride ? [barColorOverride] : euiTheme.colors.vis.euiColorVis0; const barHighlightColor = barHighlightColorOverride ? [barHighlightColorOverride] : ['orange']; return ( diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/data_drift/use_data_drift_colors.ts b/x-pack/platform/plugins/private/data_visualizer/public/application/data_drift/use_data_drift_colors.ts new file mode 100644 index 0000000000000..7d63ee4c7c259 --- /dev/null +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/data_drift/use_data_drift_colors.ts @@ -0,0 +1,31 @@ +/* + * 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 { useMemo } from 'react'; + +import { useEuiTheme } from '@elastic/eui'; + +export const useDataDriftColors = () => { + const { euiTheme } = useEuiTheme(); + + return useMemo( + () => ({ + // Amsterdam: euiTheme.colors.vis.euiColorVis2 + // Borealis: euiTheme.colors.vis.euiColorVis4 + referenceColor: euiTheme.flags.hasVisColorAdjustment + ? euiTheme.colors.vis.euiColorVis2 + : euiTheme.colors.vis.euiColorVis4, + // Amsterdam: euiTheme.colors.vis.euiColorVis1 + // Borealis: euiTheme.colors.vis.euiColorVis2 + comparisonColor: euiTheme.flags.hasVisColorAdjustment + ? euiTheme.colors.vis.euiColorVis1 + : euiTheme.colors.vis.euiColorVis2, + overlapColor: '#490771', + }), + [euiTheme] + ); +}; diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/about_panel/about_panel.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/about_panel/about_panel.tsx index 64f08822617f4..e76fbf6e65494 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/about_panel/about_panel.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/about_panel/about_panel.tsx @@ -5,12 +5,13 @@ * 2.0. */ +import React, { type FC, useMemo } from 'react'; +import { css } from '@emotion/react'; + +import { useEuiTheme } from '@elastic/eui'; + import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { css } from '@emotion/react'; -import { euiThemeVars } from '@kbn/ui-theme'; -import type { FC } from 'react'; -import React from 'react'; import { EuiFlexGroup, @@ -30,14 +31,20 @@ interface Props { hasPermissionToImport: boolean; } -const aboutPanelContentStyle = css({ - '.euiFilePicker__icon': { - width: euiThemeVars.euiSizeXXL, - height: euiThemeVars.euiSizeXXL, - }, -}); - export const AboutPanel: FC<Props> = ({ onFilePickerChange, hasPermissionToImport }) => { + const { euiTheme } = useEuiTheme(); + + const aboutPanelContentStyle = useMemo( + () => + css({ + '.euiFilePicker__icon': { + width: euiTheme.size.xxl, + height: euiTheme.size.xxl, + }, + }), + [euiTheme] + ); + return ( <EuiPageTemplate.Section alignment="center" data-test-subj="dataVisualizerPageFileUpload"> <EuiFlexGroup gutterSize="xl"> diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/about_panel/welcome_content.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/about_panel/welcome_content.tsx index a5437ad49dc2d..af821dce63ddc 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/about_panel/welcome_content.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/about_panel/welcome_content.tsx @@ -5,33 +5,29 @@ * 2.0. */ -import { FormattedMessage } from '@kbn/i18n-react'; -import type { FC } from 'react'; -import React from 'react'; -import { euiThemeVars } from '@kbn/ui-theme'; +import React, { type FC, useMemo } from 'react'; import { css } from '@emotion/react'; -import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; - -import { useDataVisualizerKibana } from '../../../kibana_context'; +import { + useEuiTheme, + EuiFlexGroup, + EuiFlexItem, + EuiIcon, + EuiSpacer, + EuiText, + EuiTitle, +} from '@elastic/eui'; -const docIconStyle = css({ - marginLeft: euiThemeVars.euiSizeL, - marginTop: euiThemeVars.euiSizeXS, -}); +import { FormattedMessage } from '@kbn/i18n-react'; -const mainIconStyle = css({ - width: '96px', - height: '96px', - marginLeft: euiThemeVars.euiSizeXL, - marginRight: euiThemeVars.euiSizeL, -}); +import { useDataVisualizerKibana } from '../../../kibana_context'; interface Props { hasPermissionToImport: boolean; } export const WelcomeContent: FC<Props> = ({ hasPermissionToImport }) => { + const { euiTheme } = useEuiTheme(); const { services: { fileUpload: { getMaxBytesFormatted, getMaxTikaBytesFormatted }, @@ -40,6 +36,21 @@ export const WelcomeContent: FC<Props> = ({ hasPermissionToImport }) => { const maxFileSize = getMaxBytesFormatted(); const maxTikaFileSize = getMaxTikaBytesFormatted(); + const { docIconStyle, mainIconStyle } = useMemo(() => { + return { + docIconStyle: css({ + marginLeft: euiTheme.size.l, + marginTop: euiTheme.size.xs, + }), + mainIconStyle: css({ + width: '96px', + height: '96px', + marginLeft: euiTheme.size.xl, + marginRight: euiTheme.size.l, + }), + }; + }, [euiTheme]); + return ( <EuiFlexGroup gutterSize="xl" alignItems="center"> <EuiFlexItem grow={false}> diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/doc_count_chart/event_rate_chart.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/doc_count_chart/event_rate_chart.tsx index e8bde09ef24cc..d60ab995d4157 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/doc_count_chart/event_rate_chart.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/doc_count_chart/event_rate_chart.tsx @@ -5,8 +5,8 @@ * 2.0. */ -import type { FC } from 'react'; -import React from 'react'; +import React, { useMemo, type FC } from 'react'; + import type { PartialTheme } from '@elastic/charts'; import { HistogramBarSeries, @@ -16,10 +16,11 @@ import { Tooltip, TooltipType, } from '@elastic/charts'; +import { useEuiTheme } from '@elastic/eui'; + import { i18n } from '@kbn/i18n'; -import { euiLightVars } from '@kbn/ui-theme'; + import { Axes } from './axes'; -import { useCurrentEuiTheme } from '../../../common/hooks/use_current_eui_theme'; export interface LineChartPoint { time: number | string; @@ -33,23 +34,26 @@ interface Props { } export const EventRateChart: FC<Props> = ({ eventRateChartData, height, width }) => { - const { euiColorLightShade } = useCurrentEuiTheme(); - const theme: PartialTheme = { - scales: { histogramPadding: 0.2 }, - background: { - color: 'transparent', - }, - axes: { - gridLine: { - horizontal: { - stroke: euiColorLightShade, - }, - vertical: { - stroke: euiColorLightShade, + const { euiTheme } = useEuiTheme(); + const theme: PartialTheme = useMemo( + () => ({ + scales: { histogramPadding: 0.2 }, + background: { + color: 'transparent', + }, + axes: { + gridLine: { + horizontal: { + stroke: euiTheme.colors.lightShade, + }, + vertical: { + stroke: euiTheme.colors.lightShade, + }, }, }, - }, - }; + }), + [euiTheme] + ); return ( <div @@ -70,7 +74,8 @@ export const EventRateChart: FC<Props> = ({ eventRateChartData, height, width }) xAccessor={'time'} yAccessors={['value']} data={eventRateChartData} - color={euiLightVars.euiColorVis0} + // Amsterdam + Borealis + color={euiTheme.colors.vis.euiColorVis0} /> </Chart> </div> diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/file_contents/field_badge.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/file_contents/field_badge.tsx index 55dea99a40424..4a9caf6948728 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/file_contents/field_badge.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/file_contents/field_badge.tsx @@ -7,11 +7,10 @@ import type { FC } from 'react'; import React from 'react'; -import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui'; +import { useEuiTheme, EuiBadge, EuiFlexGroup, EuiFlexItem, EuiToolTip } from '@elastic/eui'; import { FieldIcon } from '@kbn/react-field'; import { i18n } from '@kbn/i18n'; import { getSupportedFieldType } from '../../../common/components/fields_stats_grid/get_field_names'; -import { useCurrentEuiTheme } from '../../../common/hooks/use_current_eui_theme'; interface Props { type: string | undefined; @@ -20,7 +19,9 @@ interface Props { } export const FieldBadge: FC<Props> = ({ type, value, name }) => { - const { euiColorLightestShade, euiColorLightShade } = useCurrentEuiTheme(); + const { euiTheme } = useEuiTheme(); + const euiColorLightestShade = euiTheme.colors.lightestShade; + const euiColorLightShade = euiTheme.colors.lightShade; const supportedType = getSupportedFieldType(type ?? 'unknown'); const tooltip = type ? i18n.translate('xpack.dataVisualizer.file.fileContents.fieldBadge.tooltip', { diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/file_contents/use_text_parser.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/file_contents/use_text_parser.tsx index 64684c7589499..ba381d10af9b8 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/file_contents/use_text_parser.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/file_contents/use_text_parser.tsx @@ -6,18 +6,17 @@ */ import React, { useMemo } from 'react'; -import { EuiText } from '@elastic/eui'; +import { useEuiTheme, EuiText } from '@elastic/eui'; import type { FindFileStructureResponse } from '@kbn/file-upload-plugin/common'; import { FieldBadge } from './field_badge'; import { useDataVisualizerKibana } from '../../../kibana_context'; -import { useCurrentEuiTheme } from '../../../common/hooks/use_current_eui_theme'; import { GrokHighlighter } from './grok_highlighter'; export function useGrokHighlighter() { const { services: { http }, } = useDataVisualizerKibana(); - const { euiSizeL } = useCurrentEuiTheme(); + const { euiTheme } = useEuiTheme(); const createLines = useMemo( () => @@ -56,7 +55,7 @@ export function useGrokHighlighter() { return ( <EuiText size="s" - css={{ lineHeight: euiSizeL }} + css={{ lineHeight: euiTheme.size.l }} data-test-subj="dataVisualizerHighlightedLine" > <code>{formattedWords}</code> @@ -64,7 +63,7 @@ export function useGrokHighlighter() { ); }); }, - [euiSizeL, http] + [euiTheme, http] ); return createLines; diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/import_summary/failures.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/import_summary/failures.tsx index 2e29b081765cf..15389fc404c7a 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/import_summary/failures.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/import_summary/failures.tsx @@ -6,10 +6,9 @@ */ import { FormattedMessage } from '@kbn/i18n-react'; -import React, { Component } from 'react'; -import { euiThemeVars } from '@kbn/ui-theme'; +import React, { useState, type FC } from 'react'; -import { EuiAccordion, EuiPagination } from '@elastic/eui'; +import { useEuiTheme, EuiAccordion, EuiPagination } from '@elastic/eui'; import { css } from '@emotion/react'; const PAGE_SIZE = 100; @@ -22,63 +21,56 @@ export interface DocFailure { }; } -interface Props { +interface FailuresProps { failedDocs: DocFailure[]; } -interface State { - page: number; -} - const containerStyle = css({ maxHeight: '200px', overflowY: 'auto', }); -const errorStyle = css({ - color: euiThemeVars.euiColorDanger, -}); +export const Failures: FC<FailuresProps> = ({ failedDocs }) => { + const { euiTheme } = useEuiTheme(); -export class Failures extends Component<Props, State> { - state: State = { page: 0 }; + const [page, setPage] = useState(0); - _renderPaginationControl() { - return this.props.failedDocs.length > PAGE_SIZE ? ( - <EuiPagination - pageCount={Math.ceil(this.props.failedDocs.length / PAGE_SIZE)} - activePage={this.state.page} - onPageClick={(page) => this.setState({ page })} - compressed - /> - ) : null; - } + const startIndex = page * PAGE_SIZE; + const endIndex = startIndex + PAGE_SIZE; - render() { - const startIndex = this.state.page * PAGE_SIZE; - const endIndex = startIndex + PAGE_SIZE; - return ( - <EuiAccordion - id="failureList" - buttonContent={ - <FormattedMessage - id="xpack.dataVisualizer.file.importSummary.failedDocumentsButtonLabel" - defaultMessage="Failed documents" + return ( + <EuiAccordion + id="failureList" + buttonContent={ + <FormattedMessage + id="xpack.dataVisualizer.file.importSummary.failedDocumentsButtonLabel" + defaultMessage="Failed documents" + /> + } + paddingSize="m" + > + <div css={containerStyle}> + {failedDocs.length > PAGE_SIZE && ( + <EuiPagination + pageCount={Math.ceil(failedDocs.length / PAGE_SIZE)} + activePage={page} + onPageClick={(newPage) => setPage(newPage)} + compressed /> - } - paddingSize="m" - > - <div css={containerStyle}> - {this._renderPaginationControl()} - {this.props.failedDocs.slice(startIndex, endIndex).map(({ item, reason, doc }) => ( - <div key={item}> - <div css={errorStyle}> - {item}: {reason} - </div> - <div>{JSON.stringify(doc)}</div> + )} + {failedDocs.slice(startIndex, endIndex).map(({ item, reason, doc }) => ( + <div key={item}> + <div + css={{ + color: euiTheme.colors.danger, + }} + > + {item}: {reason} </div> - ))} - </div> - </EuiAccordion> - ); - } -} + <div>{JSON.stringify(doc)}</div> + </div> + ))} + </div> + </EuiAccordion> + ); +}; diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/file_data_visualizer.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/file_data_visualizer.tsx index 6289a73e2a664..c8dbb53d68f47 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/file_data_visualizer.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/file_data_visualizer.tsx @@ -4,7 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import '../_index.scss'; import type { FC, PropsWithChildren } from 'react'; import React from 'react'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_esql.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_esql.tsx index 5953144e715fb..2f601498c8487 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_esql.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_esql.tsx @@ -16,6 +16,7 @@ import { ESQLLangEditor } from '@kbn/esql/public'; import type { AggregateQuery } from '@kbn/es-query'; import { + useEuiTheme, useEuiBreakpoint, useIsWithinMaxBreakpoint, EuiFlexGroup, @@ -29,7 +30,6 @@ import { import type { DataView } from '@kbn/data-views-plugin/common'; import { getIndexPatternFromESQLQuery } from '@kbn/esql-utils'; import { getOrCreateDataViewByIndexPattern } from '../../search_strategy/requests/get_data_view_by_index_pattern'; -import { useCurrentEuiTheme } from '../../../common/hooks/use_current_eui_theme'; import { DATA_VISUALIZER_INDEX_VIEWER } from '../../constants/index_data_visualizer_viewer'; import { useDataVisualizerKibana } from '../../../kibana_context'; import type { GetAdditionalLinks } from '../../../common/components/results_links'; @@ -58,7 +58,7 @@ const DEFAULT_ESQL_QUERY = { esql: '' }; export const IndexDataVisualizerESQL: FC<IndexDataVisualizerESQLProps> = (dataVisualizerProps) => { const { services } = useDataVisualizerKibana(); const { data } = services; - const euiTheme = useCurrentEuiTheme(); + const { euiTheme } = useEuiTheme(); // Query that has been typed, but has not submitted with cmd + enter const [localQuery, setLocalQuery] = useState<ESQLQuery>(DEFAULT_ESQL_QUERY); @@ -281,9 +281,9 @@ export const IndexDataVisualizerESQL: FC<IndexDataVisualizerESQLProps> = (dataVi grow={false} data-test-subj="DataVisualizerESQLEditor" css={css({ - borderTop: euiTheme.euiBorderThin, - borderLeft: euiTheme.euiBorderThin, - borderRight: euiTheme.euiBorderThin, + borderTop: euiTheme.border.thin, + borderLeft: euiTheme.border.thin, + borderRight: euiTheme.border.thin, })} > <ESQLLangEditor diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx index fedddbce01c5c..5f1f78af90073 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/components/index_data_visualizer_view/index_data_visualizer_view.tsx @@ -12,6 +12,7 @@ import type { Required } from 'utility-types'; import { getEsQueryConfig } from '@kbn/data-plugin/common'; import { + useEuiTheme, useEuiBreakpoint, useIsWithinMaxBreakpoint, EuiFlexGroup, @@ -37,7 +38,6 @@ import { useStorage } from '@kbn/ml-local-storage'; import type { SavedSearch } from '@kbn/saved-search-plugin/public'; import { SEARCH_QUERY_LANGUAGE, type SearchQueryLanguage } from '@kbn/ml-query-utils'; import { kbnTypeToSupportedType } from '../../../common/util/field_types_utils'; -import { useCurrentEuiTheme } from '../../../common/hooks/use_current_eui_theme'; import { DV_FROZEN_TIER_PREFERENCE, DV_RANDOM_SAMPLER_PREFERENCE, @@ -108,7 +108,7 @@ export interface IndexDataVisualizerViewProps { } export const IndexDataVisualizerView: FC<IndexDataVisualizerViewProps> = (dataVisualizerProps) => { - const euiTheme = useCurrentEuiTheme(); + const { euiTheme } = useEuiTheme(); const [savedRandomSamplerPreference, saveRandomSamplerPreference] = useStorage< DVKey, @@ -520,7 +520,7 @@ export const IndexDataVisualizerView: FC<IndexDataVisualizerViewProps> = (dataVi data-test-subj="dataViewTitleHeader" direction="row" alignItems="center" - css={{ padding: `${euiTheme.euiSizeS} 0`, marginRight: `${euiTheme.euiSize}` }} + css={{ padding: `${euiTheme.size.s} 0`, marginRight: `${euiTheme.size.base}` }} > <EuiTitle size={'s'}> <h2>{currentDataView.getName()}</h2> diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/components/search_panel/field_type_filter.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/components/search_panel/field_type_filter.tsx index 2c9faf9d9a854..b7e3790620e3f 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/components/search_panel/field_type_filter.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/components/search_panel/field_type_filter.tsx @@ -7,11 +7,10 @@ import type { FC } from 'react'; import React, { useMemo } from 'react'; -import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { useEuiTheme, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { css } from '@emotion/react'; import { getFieldTypeName } from '@kbn/field-utils'; -import { useCurrentEuiTheme } from '../../../common/hooks/use_current_eui_theme'; import { FieldTypesHelpPopover } from '../../../common/components/field_types_filter/field_types_help_popover'; import { FieldTypeIcon } from '../../../common/components/field_type_icon'; import type { Option } from '../../../common/components/multi_select_picker'; @@ -22,7 +21,7 @@ export const DataVisualizerFieldTypeFilter: FC<{ setVisibleFieldTypes(q: string[]): void; visibleFieldTypes: string[]; }> = ({ indexedFieldTypes, setVisibleFieldTypes, visibleFieldTypes }) => { - const euiTheme = useCurrentEuiTheme(); + const { euiTheme } = useEuiTheme(); const options: Option[] = useMemo(() => { return indexedFieldTypes.map((indexedFieldName) => { const label = getFieldTypeName(indexedFieldName) ?? indexedFieldName; @@ -61,7 +60,7 @@ export const DataVisualizerFieldTypeFilter: FC<{ postfix={<FieldTypesHelpPopover fieldTypes={indexedFieldTypes} />} cssStyles={{ filterGroup: css` - margin-left: ${euiTheme.euiSizeS}; + margin-left: ${euiTheme.size.s}; `, }} /> diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/embeddables/field_stats/field_stats_initializer.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/embeddables/field_stats/field_stats_initializer.tsx index eb829e9a20cd8..4f53fc3891409 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/embeddables/field_stats/field_stats_initializer.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/embeddables/field_stats/field_stats_initializer.tsx @@ -6,6 +6,8 @@ */ import { + mathWithUnits, + useEuiTheme, EuiButton, EuiButtonEmpty, EuiCodeBlock, @@ -28,7 +30,6 @@ import React, { useMemo, useState, useCallback } from 'react'; import { ENABLE_ESQL, getESQLAdHocDataview } from '@kbn/esql-utils'; import type { AggregateQuery } from '@kbn/es-query'; import { css } from '@emotion/react'; -import { euiThemeVars } from '@kbn/ui-theme'; import { useDataVisualizerKibana } from '../../../kibana_context'; import { FieldStatsESQLEditor } from './field_stats_esql_editor'; import type { @@ -61,6 +62,12 @@ export const FieldStatisticsInitializer: FC<FieldStatsInitializerProps> = ({ onPreview, isNewPanel, }) => { + const euiContext = useEuiTheme(); + const { euiTheme } = euiContext; + + // FIXME: add a token for this on euiTheme.components. https://github.com/elastic/eui/issues/8217 + const formMaxWidth = mathWithUnits(euiTheme.size.base, (x) => x * 25); + const { data: { dataViews }, unifiedSearch: { @@ -130,7 +137,7 @@ export const FieldStatisticsInitializer: FC<FieldStatsInitializerProps> = ({ hasBorder={true} css={css` pointer-events: auto; - background-color: ${euiThemeVars.euiColorEmptyShade}; + background-color: ${euiTheme.colors.emptyShade}; `} data-test-subj="editFlyoutHeader" > @@ -171,8 +178,8 @@ export const FieldStatisticsInitializer: FC<FieldStatsInitializerProps> = ({ css={css` // styles needed to display extra drop targets that are outside of the config panel main area overflow-y: auto; - padding-left: ${euiThemeVars.euiFormMaxWidth}; - margin-left: -${euiThemeVars.euiFormMaxWidth}; + padding-left: ${formMaxWidth}; + margin-left: -${formMaxWidth}; pointer-events: none; .euiFlyoutBody__overflow { -webkit-mask-image: none; @@ -190,7 +197,7 @@ export const FieldStatisticsInitializer: FC<FieldStatsInitializerProps> = ({ padding: 0; block-size: 100%; } - border-bottom: 2px solid ${euiThemeVars.euiBorderColor}; + border-bottom: 2px solid ${euiTheme.border.color}; `} > <EuiFlexGroup @@ -234,7 +241,7 @@ export const FieldStatisticsInitializer: FC<FieldStatsInitializerProps> = ({ defaultMessage: 'Data view', } )} - css={css({ padding: euiThemeVars.euiSizeM })} + css={css({ padding: euiTheme.size.m })} > <IndexPatternSelect autoFocus={!dataViewId} diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx index 8a5e34f58a10f..6573afe24c862 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/index_data_visualizer/index_data_visualizer.tsx @@ -4,7 +4,6 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import '../_index.scss'; import { pick } from 'lodash'; import type { FC } from 'react'; import React, { useCallback, useEffect, useState, useMemo } from 'react'; @@ -200,7 +199,7 @@ const DataVisualizerStateContextProvider: FC<DataVisualizerStateContextProviderP } catch (e) { toasts.addError(e, { title: i18n.translate('xpack.dataVisualizer.index.savedSearchErrorMessage', { - defaultMessage: 'Error retrieving saved search {savedSearchId}', + defaultMessage: 'Error retrieving Discover session {savedSearchId}', values: { savedSearchId }, }), }); diff --git a/x-pack/platform/plugins/private/data_visualizer/tsconfig.json b/x-pack/platform/plugins/private/data_visualizer/tsconfig.json index 3253012c7299b..452257efbbd5e 100644 --- a/x-pack/platform/plugins/private/data_visualizer/tsconfig.json +++ b/x-pack/platform/plugins/private/data_visualizer/tsconfig.json @@ -52,7 +52,6 @@ "@kbn/ml-in-memory-table", "@kbn/ml-is-defined", "@kbn/ml-is-populated-object", - "@kbn/ml-kibana-theme", "@kbn/ml-local-storage", "@kbn/ml-nested-property", "@kbn/ml-number-utils", @@ -68,7 +67,6 @@ "@kbn/test-jest-helpers", "@kbn/esql", "@kbn/ui-actions-plugin", - "@kbn/ui-theme", "@kbn/unified-search-plugin", "@kbn/usage-collection-plugin", "@kbn/utility-types", diff --git a/x-pack/platform/plugins/private/transform/common/types/es_ingest_pipeline.ts b/x-pack/platform/plugins/private/transform/common/types/es_ingest_pipeline.ts index 61dc8effa3657..aa487f9358b09 100644 --- a/x-pack/platform/plugins/private/transform/common/types/es_ingest_pipeline.ts +++ b/x-pack/platform/plugins/private/transform/common/types/es_ingest_pipeline.ts @@ -7,7 +7,7 @@ // This interface doesn't cover a full ingest pipeline spec, // just what's necessary to make it work in the transform creation wizard. -// The full interface can be found in x-pack/plugins/ingest_pipelines/common/types.ts +// The full interface can be found in x-pack/platform/plugins/shared/ingest_pipelines/common/types.ts export interface EsIngestPipeline { name: string; } diff --git a/x-pack/platform/plugins/private/transform/public/alerting/transform_health_rule_type/transform_selector_control.test.tsx b/x-pack/platform/plugins/private/transform/public/alerting/transform_health_rule_type/transform_selector_control.test.tsx new file mode 100644 index 0000000000000..79d21ca95d4ef --- /dev/null +++ b/x-pack/platform/plugins/private/transform/public/alerting/transform_health_rule_type/transform_selector_control.test.tsx @@ -0,0 +1,62 @@ +/* + * 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 { render, fireEvent } from '@testing-library/react'; +import type { TransformSelectorControlProps } from './transform_selector_control'; +import { TransformSelectorControl } from './transform_selector_control'; + +describe('TransformSelectorControl', () => { + const defaultProps: TransformSelectorControlProps = { + label: 'Select Transforms', + errors: [], + onChange: jest.fn(), + selectedOptions: [], + options: ['transform1', 'transform2'], + allowSelectAll: true, + }; + + it('renders without crashing', () => { + const { getByLabelText } = render(<TransformSelectorControl {...defaultProps} />); + expect(getByLabelText('Select Transforms')).toBeInTheDocument(); + }); + + it('displays options correctly', () => { + const { getByText } = render(<TransformSelectorControl {...defaultProps} />); + fireEvent.click(getByText('Select Transforms')); + expect(getByText('transform1')).toBeInTheDocument(); + expect(getByText('transform2')).toBeInTheDocument(); + expect(getByText('*')).toBeInTheDocument(); + }); + + it('calls onChange with selected options', () => { + const { getByText } = render(<TransformSelectorControl {...defaultProps} />); + fireEvent.click(getByText('Select Transforms')); + fireEvent.click(getByText('transform1')); + expect(defaultProps.onChange).toHaveBeenCalledWith(['transform1']); + }); + + it('only allows wildcards as custom options', () => { + const { getByText, getByTestId } = render(<TransformSelectorControl {...defaultProps} />); + fireEvent.click(getByText('Select Transforms')); + const input = getByTestId('comboBoxSearchInput'); + + fireEvent.change(input, { target: { value: 'custom' } }); + fireEvent.keyDown(input, { key: 'Enter', code: 'Enter' }); + expect(defaultProps.onChange).not.toHaveBeenCalledWith(['custom']); + + fireEvent.change(input, { target: { value: 'custom*' } }); + fireEvent.keyDown(input, { key: 'Enter', code: 'Enter' }); + expect(defaultProps.onChange).toHaveBeenCalledWith(['custom*']); + }); + + it('displays errors correctly', () => { + const errorProps = { ...defaultProps, errors: ['Error message'] }; + const { getByText } = render(<TransformSelectorControl {...errorProps} />); + expect(getByText('Error message')).toBeInTheDocument(); + }); +}); diff --git a/x-pack/platform/plugins/private/transform/public/alerting/transform_health_rule_type/transform_selector_control.tsx b/x-pack/platform/plugins/private/transform/public/alerting/transform_health_rule_type/transform_selector_control.tsx index 97c7c74823c0a..bbb1c77e50ed3 100644 --- a/x-pack/platform/plugins/private/transform/public/alerting/transform_health_rule_type/transform_selector_control.tsx +++ b/x-pack/platform/plugins/private/transform/public/alerting/transform_health_rule_type/transform_selector_control.tsx @@ -5,11 +5,12 @@ * 2.0. */ -import type { EuiComboBoxProps } from '@elastic/eui'; +import type { EuiComboBoxOptionsListProps, EuiComboBoxProps } from '@elastic/eui'; import { EuiComboBox, EuiFormRow } from '@elastic/eui'; import type { FC } from 'react'; -import React, { useMemo } from 'react'; +import React, { useMemo, useState } from 'react'; import { isDefined } from '@kbn/ml-is-defined'; +import { i18n } from '@kbn/i18n'; import { ALL_TRANSFORMS_SELECTION } from '../../../common/constants'; export interface TransformSelectorControlProps { @@ -33,6 +34,8 @@ export const TransformSelectorControl: FC<TransformSelectorControlProps> = ({ options, allowSelectAll = false, }) => { + const [allowCustomOptions, setAllowCustomOptions] = useState(false); + const onSelectionChange: EuiComboBoxProps<string>['onChange'] = ((selectionUpdate) => { if (!selectionUpdate?.length) { onChange([]); @@ -50,6 +53,12 @@ export const TransformSelectorControl: FC<TransformSelectorControlProps> = ({ ); }) as Exclude<EuiComboBoxProps<string>['onChange'], undefined>; + const onCreateOption = allowCustomOptions + ? (((searchValue) => { + onChange([...selectedOptions, searchValue]); + }) as EuiComboBoxOptionsListProps<string>['onCreateOption']) + : undefined; + const selectedOptionsEui = useMemo(() => convertToEuiOptions(selectedOptions), [selectedOptions]); const optionsEui = useMemo(() => { return convertToEuiOptions(allowSelectAll ? [ALL_TRANSFORMS_SELECTION, ...options] : options); @@ -58,6 +67,17 @@ export const TransformSelectorControl: FC<TransformSelectorControlProps> = ({ return ( <EuiFormRow fullWidth label={label} isInvalid={!!errors?.length} error={errors}> <EuiComboBox<string> + onSearchChange={(searchValue, hasMatchingOption) => { + setAllowCustomOptions(!hasMatchingOption && searchValue.includes('*')); + }} + onCreateOption={onCreateOption} + customOptionText={i18n.translate( + 'xpack.transform.alertTypes.transformHealth.customOptionText', + { + defaultMessage: 'Include {searchValuePlaceholder} wildcard', + values: { searchValuePlaceholder: '{searchValue}' }, + } + )} singleSelection={false} selectedOptions={selectedOptionsEui} options={optionsEui} diff --git a/x-pack/platform/plugins/private/transform/public/app/hooks/use_search_items/use_search_items.ts b/x-pack/platform/plugins/private/transform/public/app/hooks/use_search_items/use_search_items.ts index ed3b291a2d7f8..eee262d26f1e2 100644 --- a/x-pack/platform/plugins/private/transform/public/app/hooks/use_search_items/use_search_items.ts +++ b/x-pack/platform/plugins/private/transform/public/app/hooks/use_search_items/use_search_items.ts @@ -52,7 +52,7 @@ export const useSearchItems = (defaultSavedObjectId: string | undefined) => { if (!isDataView(fetchedDataView) && fetchedSavedSearch === undefined) { setError( i18n.translate('xpack.transform.searchItems.errorInitializationTitle', { - defaultMessage: `An error occurred initializing the Kibana data view or saved search.`, + defaultMessage: `An error occurred initializing the Kibana data view or Discover session.`, }) ); return; diff --git a/x-pack/platform/plugins/private/transform/public/app/sections/create_transform/components/step_define/step_define_form.tsx b/x-pack/platform/plugins/private/transform/public/app/sections/create_transform/components/step_define/step_define_form.tsx index 92300d5580cbb..43efc8b1b4cad 100644 --- a/x-pack/platform/plugins/private/transform/public/app/sections/create_transform/components/step_define/step_define_form.tsx +++ b/x-pack/platform/plugins/private/transform/public/app/sections/create_transform/components/step_define/step_define_form.tsx @@ -377,8 +377,8 @@ export const StepDefineForm: FC<StepDefineFormProps> = React.memo((props) => { fullWidth label={ searchItems?.savedSearch?.id !== undefined - ? i18n.translate('xpack.transform.stepDefineForm.savedSearchLabel', { - defaultMessage: 'Saved search', + ? i18n.translate('xpack.transform.stepDefineForm.discoverSessionLabel', { + defaultMessage: 'Discover session', }) : i18n.translate('xpack.transform.stepDefineForm.searchFilterLabel', { defaultMessage: 'Search filter', diff --git a/x-pack/platform/plugins/private/transform/public/app/sections/create_transform/components/step_define/step_define_summary.tsx b/x-pack/platform/plugins/private/transform/public/app/sections/create_transform/components/step_define/step_define_summary.tsx index b284eb3e1a021..9fc938cd2028e 100644 --- a/x-pack/platform/plugins/private/transform/public/app/sections/create_transform/components/step_define/step_define_summary.tsx +++ b/x-pack/platform/plugins/private/transform/public/app/sections/create_transform/components/step_define/step_define_summary.tsx @@ -141,8 +141,8 @@ export const StepDefineSummary: FC<Props> = ({ {searchItems.savedSearch !== undefined && searchItems.savedSearch.id !== undefined && ( <EuiFormRow - label={i18n.translate('xpack.transform.stepDefineSummary.savedSearchLabel', { - defaultMessage: 'Saved search', + label={i18n.translate('xpack.transform.stepDefineSummary.discoverSessionLabel', { + defaultMessage: 'Discover session', })} > <span>{searchItems.savedSearch.title}</span> diff --git a/x-pack/platform/plugins/private/transform/public/app/sections/create_transform/components/wizard/wizard.tsx b/x-pack/platform/plugins/private/transform/public/app/sections/create_transform/components/wizard/wizard.tsx index 2c078f93627cc..ab2865b85eb8a 100644 --- a/x-pack/platform/plugins/private/transform/public/app/sections/create_transform/components/wizard/wizard.tsx +++ b/x-pack/platform/plugins/private/transform/public/app/sections/create_transform/components/wizard/wizard.tsx @@ -111,7 +111,7 @@ export const CreateTransformWizardContext = createContext<{ export const Wizard: FC<WizardProps> = React.memo(({ cloneConfig, searchItems }) => { const { showNodeInfo } = useEnabledFeatures(); const appDependencies = useAppDependencies(); - const { uiSettings, data, fieldFormats, charts, theme } = appDependencies; + const { uiSettings, data, fieldFormats, charts } = appDependencies; const { dataView } = searchItems; // The current WIZARD_STEP @@ -247,7 +247,6 @@ export const Wizard: FC<WizardProps> = React.memo(({ cloneConfig, searchItems }) fieldStatsServices={fieldStatsServices} timeRangeMs={stepDefineState.timeRangeMs} dslQuery={transformConfig.source.query} - theme={theme} > <CreateTransformWizardContext.Provider value={{ dataView, runtimeMappings: stepDefineState.runtimeMappings }} diff --git a/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/components/search_selection/search_selection.tsx b/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/components/search_selection/search_selection.tsx index 7ebb8702669b9..1d4c120db0529 100644 --- a/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/components/search_selection/search_selection.tsx +++ b/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/components/search_selection/search_selection.tsx @@ -55,17 +55,17 @@ export const SearchSelection: FC<SearchSelectionProps> = ({ noItemsMessage={i18n.translate( 'xpack.transform.newTransform.searchSelection.notFoundLabel', { - defaultMessage: 'No matching indices or saved searches found.', + defaultMessage: 'No matching indices or saved Discover sessions found.', } )} savedObjectMetaData={[ { type: 'search', - getIconForSavedObject: () => 'search', + getIconForSavedObject: () => 'discoverApp', name: i18n.translate( - 'xpack.transform.newTransform.searchSelection.savedObjectType.search', + 'xpack.transform.newTransform.searchSelection.savedObjectType.discoverSession', { - defaultMessage: 'Saved search', + defaultMessage: 'Discover session', } ), showSavedObject: (savedObject: SavedObject) => diff --git a/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/components/transform_list/expanded_row_json_pane.tsx b/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/components/transform_list/expanded_row_json_pane.tsx index 48e17d9157226..60c47ecc81f8b 100644 --- a/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/components/transform_list/expanded_row_json_pane.tsx +++ b/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/components/transform_list/expanded_row_json_pane.tsx @@ -16,6 +16,12 @@ interface Props { } export const ExpandedRowJsonPane: FC<Props> = ({ json }) => { + // exclude alerting rules from the JSON + if ('alerting_rules' in json) { + const { alerting_rules: alertingRules, ...rest } = json; + json = rest; + } + return ( <div data-test-subj="transformJsonTabContent"> <EuiFlexGroup> diff --git a/x-pack/platform/plugins/private/transform/server/lib/alerting/transform_health_rule_type/transform_health_service.test.ts b/x-pack/platform/plugins/private/transform/server/lib/alerting/transform_health_rule_type/transform_health_service.test.ts index ff502c9fcdc2e..a799fbe0499ff 100644 --- a/x-pack/platform/plugins/private/transform/server/lib/alerting/transform_health_rule_type/transform_health_service.test.ts +++ b/x-pack/platform/plugins/private/transform/server/lib/alerting/transform_health_rule_type/transform_health_service.test.ts @@ -5,16 +5,18 @@ * 2.0. */ -import { transformHealthServiceProvider } from './transform_health_service'; -import type { ElasticsearchClient } from '@kbn/core/server'; -import type { RulesClient } from '@kbn/alerting-plugin/server'; -import type { FieldFormatsRegistry } from '@kbn/field-formats-plugin/common'; -import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; -import { rulesClientMock } from '@kbn/alerting-plugin/server/rules_client.mock'; import type { TransformGetTransformResponse, TransformGetTransformStatsResponse, + TransformGetTransformTransformSummary, } from '@elastic/elasticsearch/lib/api/types'; +import type { FindResult, RulesClient } from '@kbn/alerting-plugin/server'; +import { rulesClientMock } from '@kbn/alerting-plugin/server/rules_client.mock'; +import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; +import type { ElasticsearchClient } from '@kbn/core/server'; +import type { FieldFormatsRegistry } from '@kbn/field-formats-plugin/common'; +import { transformHealthServiceProvider } from './transform_health_service'; +import type { TransformHealthRuleParams } from './schema'; describe('transformHealthServiceProvider', () => { let esClient: jest.Mocked<ElasticsearchClient>; @@ -24,20 +26,48 @@ describe('transformHealthServiceProvider', () => { beforeEach(() => { esClient = elasticsearchServiceMock.createClusterClient().asInternalUser; - (esClient.transform.getTransform as jest.Mock).mockResolvedValue({ - count: 3, - transforms: [ - // Mock continuous transforms - ...new Array(102).fill(null).map((_, i) => ({ - id: `transform${i}`, - sync: true, - })), - { - id: 'transform102', - sync: false, - }, - ], - } as unknown as TransformGetTransformResponse); + (esClient.transform.getTransform as jest.Mock).mockImplementation( + async ({ transform_id: transformId }) => { + if (transformId === 'transform4,transform6,transform6*') { + // arrangement for exclude transforms + return { + transforms: [ + { + id: `transform4`, + sync: true, + }, + { + id: `transform6`, + sync: true, + }, + ...new Array(10).fill(null).map((_, i) => ({ + id: `transform6${i}`, + sync: true, + })), + ], + } as unknown as TransformGetTransformResponse; + } else { + return { + transforms: [ + // Mock continuous transforms + ...new Array(102).fill(null).map((_, i) => ({ + id: `transform${i}`, + sync: { + time: { + field: 'order_date', + delay: '60s', + }, + }, + })), + { + id: 'transform102', + }, + ], + } as unknown as TransformGetTransformResponse; + } + } + ); + (esClient.transform.getTransformStats as jest.Mock).mockResolvedValue({ count: 2, transforms: [{}], @@ -57,19 +87,27 @@ describe('transformHealthServiceProvider', () => { const service = transformHealthServiceProvider({ esClient, rulesClient, fieldFormatsRegistry }); const result = await service.getHealthChecksResults({ includeTransforms: ['*'], - excludeTransforms: ['transform4', 'transform6', 'transform62'], + excludeTransforms: ['transform4', 'transform6', 'transform6*'], testsConfig: null, }); + expect(esClient.transform.getTransform).toHaveBeenCalledTimes(2); + + expect(esClient.transform.getTransform).toHaveBeenCalledWith({ + allow_no_match: true, + size: 1000, + }); expect(esClient.transform.getTransform).toHaveBeenCalledWith({ + transform_id: 'transform4,transform6,transform6*', allow_no_match: true, size: 1000, }); + expect(esClient.transform.getTransformStats).toHaveBeenCalledTimes(1); expect(esClient.transform.getTransformStats).toHaveBeenNthCalledWith(1, { basic: true, transform_id: - 'transform0,transform1,transform2,transform3,transform5,transform7,transform8,transform9,transform10,transform11,transform12,transform13,transform14,transform15,transform16,transform17,transform18,transform19,transform20,transform21,transform22,transform23,transform24,transform25,transform26,transform27,transform28,transform29,transform30,transform31,transform32,transform33,transform34,transform35,transform36,transform37,transform38,transform39,transform40,transform41,transform42,transform43,transform44,transform45,transform46,transform47,transform48,transform49,transform50,transform51,transform52,transform53,transform54,transform55,transform56,transform57,transform58,transform59,transform60,transform61,transform63,transform64,transform65,transform66,transform67,transform68,transform69,transform70,transform71,transform72,transform73,transform74,transform75,transform76,transform77,transform78,transform79,transform80,transform81,transform82,transform83,transform84,transform85,transform86,transform87,transform88,transform89,transform90,transform91,transform92,transform93,transform94,transform95,transform96,transform97,transform98,transform99,transform100,transform101', + 'transform0,transform1,transform2,transform3,transform5,transform7,transform8,transform9,transform10,transform11,transform12,transform13,transform14,transform15,transform16,transform17,transform18,transform19,transform20,transform21,transform22,transform23,transform24,transform25,transform26,transform27,transform28,transform29,transform30,transform31,transform32,transform33,transform34,transform35,transform36,transform37,transform38,transform39,transform40,transform41,transform42,transform43,transform44,transform45,transform46,transform47,transform48,transform49,transform50,transform51,transform52,transform53,transform54,transform55,transform56,transform57,transform58,transform59,transform70,transform71,transform72,transform73,transform74,transform75,transform76,transform77,transform78,transform79,transform80,transform81,transform82,transform83,transform84,transform85,transform86,transform87,transform88,transform89,transform90,transform91,transform92,transform93,transform94,transform95,transform96,transform97,transform98,transform99,transform100,transform101', }); expect(result).toBeDefined(); @@ -126,4 +164,131 @@ describe('transformHealthServiceProvider', () => { 'Transform transform_with_a_very_long_id_that_result_in_long_url_for_sure_0, transform_with_a_very_long_id_that_result_in_long_url_for_sure_1, transform_with_a_very_long_id_that_result_in_long_url_for_sure_2, transform_with_a_very_long_id_that_result_in_long_url_for_sure_3, transform_with_a_very_long_id_that_result_in_long_url_for_sure_4, transform_with_a_very_long_id_that_result_in_long_url_for_sure_5, transform_with_a_very_long_id_that_result_in_long_url_for_sure_6, transform_with_a_very_long_id_that_result_in_long_url_for_sure_7, transform_with_a_very_long_id_that_result_in_long_url_for_sure_8, transform_with_a_very_long_id_that_result_in_long_url_for_sure_9, transform_with_a_very_long_id_that_result_in_long_url_for_sure_10, transform_with_a_very_long_id_that_result_in_long_url_for_sure_11, transform_with_a_very_long_id_that_result_in_long_url_for_sure_12, transform_with_a_very_long_id_that_result_in_long_url_for_sure_13, transform_with_a_very_long_id_that_result_in_long_url_for_sure_14, transform_with_a_very_long_id_that_result_in_long_url_for_sure_15, transform_with_a_very_long_id_that_result_in_long_url_for_sure_16, transform_with_a_very_long_id_that_result_in_long_url_for_sure_17, transform_with_a_very_long_id_that_result_in_long_url_for_sure_18, transform_with_a_very_long_id_that_result_in_long_url_for_sure_19, transform_with_a_very_long_id_that_result_in_long_url_for_sure_20, transform_with_a_very_long_id_that_result_in_long_url_for_sure_21, transform_with_a_very_long_id_that_result_in_long_url_for_sure_22, transform_with_a_very_long_id_that_result_in_long_url_for_sure_23, transform_with_a_very_long_id_that_result_in_long_url_for_sure_24, transform_with_a_very_long_id_that_result_in_long_url_for_sure_25, transform_with_a_very_long_id_that_result_in_long_url_for_sure_26, transform_with_a_very_long_id_that_result_in_long_url_for_sure_27, transform_with_a_very_long_id_that_result_in_long_url_for_sure_28, transform_with_a_very_long_id_that_result_in_long_url_for_sure_29, transform_with_a_very_long_id_that_result_in_long_url_for_sure_30, transform_with_a_very_long_id_that_result_in_long_url_for_sure_31, transform_with_a_very_long_id_that_result_in_long_url_for_sure_32, transform_with_a_very_long_id_that_result_in_long_url_for_sure_33, transform_with_a_very_long_id_that_result_in_long_url_for_sure_34, transform_with_a_very_long_id_that_result_in_long_url_for_sure_35, transform_with_a_very_long_id_that_result_in_long_url_for_sure_36, transform_with_a_very_long_id_that_result_in_long_url_for_sure_37, transform_with_a_very_long_id_that_result_in_long_url_for_sure_38, transform_with_a_very_long_id_that_result_in_long_url_for_sure_39, transform_with_a_very_long_id_that_result_in_long_url_for_sure_40, transform_with_a_very_long_id_that_result_in_long_url_for_sure_41, transform_with_a_very_long_id_that_result_in_long_url_for_sure_42, transform_with_a_very_long_id_that_result_in_long_url_for_sure_43, transform_with_a_very_long_id_that_result_in_long_url_for_sure_44, transform_with_a_very_long_id_that_result_in_long_url_for_sure_45, transform_with_a_very_long_id_that_result_in_long_url_for_sure_46, transform_with_a_very_long_id_that_result_in_long_url_for_sure_47, transform_with_a_very_long_id_that_result_in_long_url_for_sure_48, transform_with_a_very_long_id_that_result_in_long_url_for_sure_49, transform_with_a_very_long_id_that_result_in_long_url_for_sure_50, transform_with_a_very_long_id_that_result_in_long_url_for_sure_51, transform_with_a_very_long_id_that_result_in_long_url_for_sure_52, transform_with_a_very_long_id_that_result_in_long_url_for_sure_53, transform_with_a_very_long_id_that_result_in_long_url_for_sure_54, transform_with_a_very_long_id_that_result_in_long_url_for_sure_55, transform_with_a_very_long_id_that_result_in_long_url_for_sure_56, transform_with_a_very_long_id_that_result_in_long_url_for_sure_57, transform_with_a_very_long_id_that_result_in_long_url_for_sure_58, transform_with_a_very_long_id_that_result_in_long_url_for_sure_59 are not started.' ); }); + + describe('populateTransformsWithAssignedRules', () => { + it('should throw an error if rulesClient is missing', async () => { + const service = transformHealthServiceProvider({ esClient, fieldFormatsRegistry }); + + await expect(service.populateTransformsWithAssignedRules([])).rejects.toThrow( + 'Rules client is missing' + ); + }); + + it('should return an empty list if no transforms are provided', async () => { + const service = transformHealthServiceProvider({ + esClient, + rulesClient, + fieldFormatsRegistry, + }); + + const result = await service.populateTransformsWithAssignedRules([]); + expect(result).toEqual([]); + }); + + it('should return transforms with associated alerting rules', async () => { + const transforms = [ + { id: 'transform1', sync: {} }, + { id: 'transform2', sync: {} }, + { id: 'transform3', sync: {} }, + ] as TransformGetTransformTransformSummary[]; + + const rules = [ + { + id: 'rule1', + params: { + includeTransforms: ['transform1', 'transform2'], + excludeTransforms: [], + }, + }, + { + id: 'rule2', + params: { + includeTransforms: ['transform3'], + excludeTransforms: null, + }, + }, + ]; + + rulesClient.find.mockResolvedValue({ data: rules } as FindResult<TransformHealthRuleParams>); + + const service = transformHealthServiceProvider({ + esClient, + rulesClient, + fieldFormatsRegistry, + }); + + const result = await service.populateTransformsWithAssignedRules(transforms); + + expect(result).toEqual([ + { + id: 'transform1', + sync: {}, + alerting_rules: [rules[0]], + }, + { + id: 'transform2', + sync: {}, + alerting_rules: [rules[0]], + }, + { + id: 'transform3', + sync: {}, + alerting_rules: [rules[1]], + }, + ]); + }); + + it('should exclude transforms based on excludeTransforms parameter', async () => { + const transforms = [ + { id: 'transform1', sync: {} }, + { id: 'transform2', sync: {} }, + { id: 'transform3', sync: {} }, + ] as TransformGetTransformTransformSummary[]; + + const rules = [ + { + id: 'rule1', + params: { + includeTransforms: ['transform*'], + excludeTransforms: ['transform2'], + }, + }, + { + id: 'rule2', + params: { + includeTransforms: ['*'], + excludeTransforms: [], + }, + }, + ]; + + rulesClient.find.mockResolvedValue({ data: rules } as FindResult<TransformHealthRuleParams>); + + const service = transformHealthServiceProvider({ + esClient, + rulesClient, + fieldFormatsRegistry, + }); + + const result = await service.populateTransformsWithAssignedRules(transforms); + + expect(result).toEqual([ + { + id: 'transform1', + sync: {}, + alerting_rules: [rules[0], rules[1]], + }, + { + id: 'transform2', + sync: {}, + alerting_rules: [rules[1]], + }, + { + id: 'transform3', + sync: {}, + alerting_rules: [rules[0], rules[1]], + }, + ]); + }); + }); }); diff --git a/x-pack/platform/plugins/private/transform/server/lib/alerting/transform_health_rule_type/transform_health_service.ts b/x-pack/platform/plugins/private/transform/server/lib/alerting/transform_health_rule_type/transform_health_service.ts index 939d4e01a6f1d..288cb86842db0 100644 --- a/x-pack/platform/plugins/private/transform/server/lib/alerting/transform_health_rule_type/transform_health_service.ts +++ b/x-pack/platform/plugins/private/transform/server/lib/alerting/transform_health_rule_type/transform_health_service.ts @@ -38,11 +38,7 @@ interface TestResult { context: TransformHealthAlertContext; } -type Transform = estypes.TransformGetTransformTransformSummary & { - id: string; - description?: string; - sync: object; -}; +type Transform = estypes.TransformGetTransformTransformSummary; type TransformWithAlertingRules = Transform & { alerting_rules: TransformHealthAlertRule[] }; @@ -63,40 +59,44 @@ export function transformHealthServiceProvider({ * Resolves result transform selection. Only continuously running transforms are included. * @param includeTransforms * @param excludeTransforms - * @param skipIDsCheck */ const getResultsTransformIds = async ( includeTransforms: string[], - excludeTransforms: string[] | null, - skipIDsCheck = false + excludeTransforms: string[] | null ): Promise<Set<string>> => { const includeAll = includeTransforms.some((id) => id === ALL_TRANSFORMS_SELECTION); let resultTransformIds: string[] = []; - if (skipIDsCheck) { - resultTransformIds = includeTransforms; - } else { - // Fetch transforms to make sure assigned transforms exists. - const transformsResponse = ( - await esClient.transform.getTransform({ - ...(includeAll ? {} : { transform_id: includeTransforms.join(',') }), - allow_no_match: true, - size: 1000, - }) - ).transforms as Transform[]; - - transformsResponse.forEach((t) => { - transformsDict.set(t.id, t); - // Include only continuously running transforms. - if (t.sync) { - resultTransformIds.push(t.id); - } - }); - } + // Fetch transforms to make sure assigned transforms exists. + const transformsResponse = ( + await esClient.transform.getTransform({ + ...(includeAll ? {} : { transform_id: includeTransforms.join(',') }), + allow_no_match: true, + size: 1000, + }) + ).transforms as Transform[]; + + transformsResponse.forEach((t) => { + transformsDict.set(t.id, t); + // Include only continuously running transforms. + if (isContinuousTransform(t)) { + resultTransformIds.push(t.id); + } + }); if (excludeTransforms && excludeTransforms.length > 0) { - const excludeIdsSet = new Set(excludeTransforms); + let excludeIdsSet = new Set(excludeTransforms); + if (excludeTransforms.some((id) => id.includes('*'))) { + const excludeTransformResponse = ( + await esClient.transform.getTransform({ + transform_id: excludeTransforms.join(','), + allow_no_match: true, + size: 1000, + }) + ).transforms as Transform[]; + excludeIdsSet = new Set(excludeTransformResponse.map((t) => t.id)); + } resultTransformIds = resultTransformIds.filter((id) => !excludeIdsSet.has(id)); } @@ -381,13 +381,19 @@ export function transformHealthServiceProvider({ async populateTransformsWithAssignedRules( transforms: Transform[] ): Promise<TransformWithAlertingRules[]> { - const newList = transforms.filter(isContinuousTransform) as TransformWithAlertingRules[]; + const continuousTransforms = transforms.filter( + isContinuousTransform + ) as TransformWithAlertingRules[]; if (!rulesClient) { throw new Error('Rules client is missing'); } - const transformMap = keyBy(newList, 'id'); + if (!continuousTransforms.length) { + return transforms as TransformWithAlertingRules[]; + } + + const transformMap = keyBy(continuousTransforms, 'id'); const transformAlertingRules = await rulesClient.find<TransformHealthRuleParams>({ options: { @@ -398,12 +404,23 @@ export function transformHealthServiceProvider({ for (const ruleInstance of transformAlertingRules.data) { // Retrieve result transform IDs - const resultTransformIds = await getResultsTransformIds( - ruleInstance.params.includeTransforms.includes(ALL_TRANSFORMS_SELECTION) - ? Object.keys(transformMap) - : ruleInstance.params.includeTransforms, - ruleInstance.params.excludeTransforms, - true + const { includeTransforms, excludeTransforms } = ruleInstance.params; + + const resultTransformIds = new Set( + transforms + .filter( + (t) => + includeTransforms.some((includedTransformId) => + new RegExp(includedTransformId.replace(/\*/g, '.*')).test(t.id) + ) && + (Array.isArray(excludeTransforms) && excludeTransforms.length > 0 + ? excludeTransforms.every( + (excludedTransformId) => + new RegExp(excludedTransformId.replace(/\*/g, '.*')).test(t.id) === false + ) + : true) + ) + .map((t) => t.id) ); resultTransformIds.forEach((transformId) => { @@ -419,7 +436,7 @@ export function transformHealthServiceProvider({ }); } - return newList; + return continuousTransforms; }, }; } diff --git a/x-pack/platform/plugins/private/translations/translations/fr-FR.json b/x-pack/platform/plugins/private/translations/translations/fr-FR.json index e55adb9fe6df6..82df2e0b71b51 100644 --- a/x-pack/platform/plugins/private/translations/translations/fr-FR.json +++ b/x-pack/platform/plugins/private/translations/translations/fr-FR.json @@ -1454,7 +1454,6 @@ "dashboard.emptyScreen.noPermissionsTitle": "Ce tableau de bord est vide.", "dashboard.emptyScreen.viewModeSubtitle": "Accédez au mode de modification, puis commencez à ajouter vos visualisations.", "dashboard.emptyScreen.viewModeTitle": "Ajouter des visualisations à votre tableau de bord", - "dashboard.featureCatalogue.dashboardDescription": "Affichez et partagez une collection de visualisations et de recherches enregistrées.", "dashboard.featureCatalogue.dashboardSubtitle": "Analysez des données à l’aide de tableaux de bord.", "dashboard.featureCatalogue.dashboardTitle": "Dashboard", "dashboard.labs.enableLabsDescription": "Cet indicateur détermine si l'utilisateur a accès au bouton Ateliers, moyen rapide d'activer et de désactiver les fonctionnalités de la version d'évaluation technique dans le tableau de bord.", @@ -1582,7 +1581,6 @@ "data.advancedSettings.courier.requestPreferenceTitle": "Préférence de requête", "data.advancedSettings.defaultIndexText": "Utilisé par Discover et Visualisations lorsqu'une vue de données n'est pas définie.", "data.advancedSettings.defaultIndexTitle": "Vue de données par défaut", - "data.advancedSettings.docTableHighlightText": "Cela permet de mettre les résultats en surbrillance dans le tableau de bord Discover ainsi que dans les recherches enregistrées. À noter que la mise en surbrillance ralentit les requêtes dans le cas de documents volumineux.", "data.advancedSettings.docTableHighlightTitle": "Mettre les résultats en surbrillance", "data.advancedSettings.histogram.barTargetText": "Tente de générer ce nombre de compartiments lorsque l’intervalle \"auto\" est utilisé dans des histogrammes numériques et de date.", "data.advancedSettings.histogram.barTargetTitle": "Nombre de compartiments cible", @@ -2511,7 +2509,6 @@ "discover.advancedSettings.discover.showFieldStatisticsDescription": "Activez le {fieldStatisticsDocs} pour afficher des détails tels que les valeurs minimale et maximale d'un champ numérique ou une carte d'un champ géographique. Cette fonctionnalité est en version bêta et susceptible d'être modifiée.", "discover.advancedSettings.discover.showMultifields": "Afficher les champs multiples", "discover.advancedSettings.discover.showMultifieldsDescription": "Détermine si les {multiFields} doivent s'afficher dans la fenêtre de document étendue. Dans la plupart des cas, les champs multiples sont les mêmes que les champs d'origine. Cette option est uniquement disponible lorsque le paramètre `searchFieldsFromSource` est désactivé.", - "discover.advancedSettings.docTableHideTimeColumnText": "Permet de masquer la colonne ''Time'' dans Discover et dans toutes les recherches enregistrées des tableaux de bord.", "discover.advancedSettings.docTableHideTimeColumnTitle": "Masquer la colonne ''Time''", "discover.advancedSettings.fieldsPopularLimitText": "Les N champs les plus populaires à afficher", "discover.advancedSettings.fieldsPopularLimitTitle": "Limite de champs populaires", @@ -2523,7 +2520,6 @@ "discover.advancedSettings.sampleRowsPerPageTitle": "Lignes par page", "discover.advancedSettings.sampleSizeText": "Définit le nombre maximum de lignes pour l'ensemble du tableau de documents.", "discover.advancedSettings.sampleSizeTitle": "Lignes max. par tableau", - "discover.advancedSettings.searchOnPageLoadText": "Détermine si une recherche est exécutée lors du premier chargement de Discover. Ce paramètre n'a pas d'effet lors du chargement d’une recherche enregistrée.", "discover.advancedSettings.searchOnPageLoadTitle": "Recherche au chargement de la page", "discover.advancedSettings.sortDefaultOrderText": "Détermine le sens de tri par défaut pour les vues de données temporelles dans l'application Discover.", "discover.advancedSettings.sortDefaultOrderTitle": "Sens de tri par défaut", @@ -2533,7 +2529,6 @@ "discover.alerts.manageRulesAndConnectors": "Gérer les règles et les connecteurs", "discover.alerts.missedTimeFieldToolTip": "La vue de données ne possède pas de champ temporel.", "discover.badge.readOnly.text": "Lecture seule", - "discover.badge.readOnly.tooltip": "Impossible d’enregistrer les recherches", "discover.context.breadcrumb": "Documents relatifs", "discover.context.contextOfTitle": "Les documents relatifs à #{anchorId}", "discover.context.failedToLoadAnchorDocumentDescription": "Échec de chargement du document ancré", @@ -2581,7 +2576,6 @@ "discover.dropZoneTableLabel": "Abandonner la zone pour ajouter un champ en tant que colonne dans la table", "discover.embeddable.inspectorRequestDescription": "Cette requête interroge Elasticsearch afin de récupérer les données pour la recherche.", "discover.embeddable.search.dataViewError": "Vue de données {indexPatternId} manquante", - "discover.embeddable.search.displayName": "rechercher", "discover.errorCalloutESQLReferenceButtonLabel": "Ouvrir la référence ES|QL", "discover.errorCalloutShowErrorMessage": "Afficher les détails", "discover.esqlMode.selectedColumnsCallout": "Affichage de {selectedColumnsNumber} champs sur {esqlQueryColumnsNumber}. Ajoutez-en d’autres depuis la liste des champs disponibles.", @@ -2590,7 +2584,6 @@ "discover.esqlToDataViewTransitionModal.feedbackLink": "Soumettre des commentaires ES|QL", "discover.esqlToDataViewTransitionModal.saveButtonLabel": "Sauvegarder et basculer", "discover.esqlToDataViewTransitionModal.title": "Modifications non enregistrées", - "discover.esqlToDataviewTransitionModalBody": "Un changement de vue de données supprime la requête ES|QL en cours. Sauvegardez cette recherche pour éviter de perdre votre travail.", "discover.fieldChooser.availableFieldsTooltip": "Champs disponibles pour l'affichage dans le tableau.", "discover.fieldChooser.discoverField.addFieldTooltip": "Ajouter le champ en tant que colonne", "discover.fieldChooser.discoverField.removeFieldTooltip": "Supprimer le champ du tableau", @@ -2618,19 +2611,10 @@ "discover.loadingDocuments": "Chargement des documents", "discover.localMenu.alertsDescription": "Alertes", "discover.localMenu.esqlTooltipLabel": "ES|QL est le nouveau langage de requête canalisé puissant d'Elastic.", - "discover.localMenu.fallbackReportTitle": "Recherche Discover sans titre", "discover.localMenu.inspectTitle": "Inspecter", "discover.localMenu.localMenu.alertsTitle": "Alertes", - "discover.localMenu.localMenu.newSearchTitle": "Nouveauté", - "discover.localMenu.mustCopyOnSave": "Elastic gère cette recherche enregistrée. Enregistrez les modifications dans une nouvelle recherche enregistrée.", - "discover.localMenu.newSearchDescription": "Nouvelle recherche", "discover.localMenu.openInspectorForSearchDescription": "Ouvrir l'inspecteur de recherche", - "discover.localMenu.openSavedSearchDescription": "Ouvrir une recherche enregistrée", - "discover.localMenu.openTitle": "Ouvrir", - "discover.localMenu.saveSaveSearchObjectType": "rechercher", - "discover.localMenu.saveSearchDescription": "Enregistrer la recherche", "discover.localMenu.saveTitle": "Enregistrer", - "discover.localMenu.shareSearchDescription": "Partager la recherche", "discover.localMenu.shareTitle": "Partager", "discover.localMenu.switchToClassicTitle": "Basculer vers le classique", "discover.localMenu.switchToClassicTooltipLabel": "Passez à la syntaxe KQL ou Lucene.", @@ -2696,8 +2680,6 @@ "discover.noResults.suggestion.tryText": "Voici quelques solutions à essayer :", "discover.notifications.invalidTimeRangeText": "La plage temporelle spécifiée n'est pas valide. (de : \"{from}\" à \"{to}\")", "discover.notifications.invalidTimeRangeTitle": "Plage temporelle non valide", - "discover.notifications.notSavedSearchTitle": "La recherche \"{savedSearchTitle}\" n'a pas été enregistrée.", - "discover.notifications.savedSearchTitle": "La recherche \"{savedSearchTitle}\" a été enregistrée", "discover.pageTitleWithoutSavedSearch": "Discover - Recherche non encore enregistrée", "discover.pageTitleWithSavedSearch": "Discover - {savedSearchTitle}", "discover.panelsToggle.hideChartButton": "Masquer le graphique", @@ -2706,24 +2688,15 @@ "discover.panelsToggle.showSidebarButton": "Afficher la barre latérale", "discover.rootBreadcrumb": "Discover", "discover.sampleData.viewLinkLabel": "Discover", - "discover.savedSearch.savedObjectName": "Recherche enregistrée", - "discover.savedSearchAliasMatchRedirect.objectNoun": "Recherche {savedSearch}", "discover.savedSearchEmbeddable.action.viewSavedSearch.displayName": "Ouvrir dans Discover", - "discover.savedSearchURLConflictCallout.objectNoun": "Recherche {savedSearch}", "discover.searchingTitle": "Recherche", "discover.serverLocatorExtension.titleFromLocatorUnknown": "Recherche inconnue", - "discover.share.shareModal.title": "Partager cette recherche", "discover.showingDefaultDataViewWarningDescription": "Affichage de la vue de données par défaut : \"{loadedDataViewTitle}\" ({loadedDataViewId})", "discover.showingSavedDataViewWarningDescription": "Affichage de la vue de données enregistrée : \"{ownDataViewTitle}\" ({ownDataViewId})", "discover.singleDocRoute.errorMessage": "Aucune donnée correspondante pour l'ID {dataViewId}", "discover.singleDocRoute.errorTitle": "Une erreur s'est produite", "discover.skipToBottomButtonLabel": "Atteindre la fin du tableau", - "discover.topNav.managedContentLabel": "Cette recherche sauvegardée est gérée par Elastic. Les modifications effectuées ici doivent être enregistrées dans une nouvelle recherche sauvegardée.", - "discover.topNav.openSearchPanel.manageSearchesButtonLabel": "Gérer les recherches", - "discover.topNav.openSearchPanel.noSearchesFoundDescription": "Aucune recherche correspondante trouvée.", - "discover.topNav.openSearchPanel.openSearchTitle": "Ouvrir une recherche", "discover.topNav.saveModal.storeTimeWithSearchToggleDescription": "Mettez à jour le filtre temporel et actualisez l'intervalle pour afficher la sélection actuelle lors de l'utilisation de cette recherche.", - "discover.topNav.saveModal.storeTimeWithSearchToggleLabel": "Stocker la durée avec la recherche enregistrée", "discover.uninitializedRefreshButtonText": "Actualiser les données", "discover.uninitializedText": "Saisissez une requête, ajoutez quelques filtres, ou cliquez simplement sur Actualiser afin d’extraire les résultats pour la requête en cours.", "discover.uninitializedTitle": "Commencer la recherche", @@ -2799,13 +2772,11 @@ "embeddableApi.common.constants.grouping.annotations": "Annotations et Navigation", "embeddableApi.common.constants.grouping.legacy": "Hérité", "embeddableApi.common.constants.grouping.other": "Autre", - "embeddableApi.compatibility.defaultTypeDisplayName": "graphique", "embeddableApi.contextMenuTrigger.description": "Une nouvelle action sera ajoutée au menu contextuel du panneau", "embeddableApi.contextMenuTrigger.title": "Menu contextuel", "embeddableApi.errors.embeddableFactoryNotFound": "Impossible de charger {type}. Veuillez effectuer une mise à niveau vers la distribution par défaut d'Elasticsearch et de Kibana avec la licence appropriée.", "embeddableApi.errors.paneldoesNotExist": "Panneau introuvable", "embeddableApi.errors.panelIncompatibleError": "L'API du panneau n'est pas compatible", - "embeddableApi.helloworld.displayName": "bonjour", "embeddableApi.multiValueClickTrigger.description": "Sélection de plusieurs valeurs d'une même dimension dans la visualisation", "embeddableApi.multiValueClickTrigger.title": "Clics multiples", "embeddableApi.panelBadgeTrigger.description": "Des actions apparaissent dans la barre de titre lorsqu'un élément pouvant être intégré est chargé dans un panneau.", @@ -2845,7 +2816,6 @@ "embeddableExamples.unifiedFieldList.displayName": "Liste des champs", "embeddableExamples.unifiedFieldList.noDefaultDataViewErrorMessage": "La liste de champs doit être utilisée avec au moins une vue de données présente", "embeddableExamples.unifiedFieldList.selectDataViewMessage": "Veuillez sélectionner une vue de données", - "esql.advancedSettings.enableESQLDescription": "Ce paramètre active ES|QL dans Kibana. En le désactivant, vous cacherez l'interface utilisateur ES|QL de diverses applications. Cependant, les utilisateurs pourront accéder aux recherches enregistrées ES|QL, en plus des visualisations, etc.", "esql.advancedSettings.enableESQLTitle": "Activer ES|QL", "esql.triggers.updateEsqlQueryTrigger": "Mettre à jour la requête ES|QL", "esql.triggers.updateEsqlQueryTriggerDescription": "Mettre à jour la requête ES|QL en utilisant une nouvelle requête", @@ -5075,7 +5045,6 @@ "indexPatternManagement.editIndexPattern.source.table.matchesHeader": "Correspondances", "indexPatternManagement.editIndexPattern.source.table.notMatchedLabel": "Le filtre source ne correspond à aucun champ connu.", "indexPatternManagement.editIndexPattern.source.table.saveAria": "Enregistrer", - "indexPatternManagement.editIndexPattern.sourceLabel": "Les filtres de champ peuvent être utilisés pour exclure un ou plusieurs champs lors de la récupération d'un document. Cela se produit lors de l'affichage d'un document dans l'application Discover ou avec un tableau affichant les résultats d'une recherche enregistrée dans l'application Dashboard. Si vous avez des documents avec des champs de grande taille ou peu importants, il pourrait être utile de filtrer ces champs à ce niveau plus bas.", "indexPatternManagement.editIndexPattern.sourcePlaceholder": "filtre de champ, accepte les caractères génériques (par ex. `user*` pour filtrer les champs commençant par `user`)", "indexPatternManagement.editIndexPattern.tabs.fieldsHeader": "Champs", "indexPatternManagement.editIndexPattern.tabs.relationshipsHeader": "Relations ({count})", @@ -6668,9 +6637,7 @@ "savedObjectsManagement.view.inspectCodeEditorAriaLabel": "inspecter { title }", "savedObjectsManagement.view.inspectItemTitle": "Inspecter {title}", "savedObjectsManagement.view.savedObjectProblemErrorMessage": "Un problème est survenu avec cet objet enregistré.", - "savedObjectsManagement.view.savedSearchDoesNotExistErrorMessage": "La recherche enregistrée associée à cet objet n'existe plus.", "savedObjectsManagement.view.viewItemButtonLabel": "Afficher {title}", - "savedSearch.contentManagementType": "Recherche enregistrée", "savedSearch.kibana_context.filters.help": "Spécifier des filtres génériques Kibana", "savedSearch.kibana_context.help": "Met à jour le contexte général de Kibana.", "savedSearch.kibana_context.q.help": "Spécifier une recherche en texte libre Kibana", @@ -7293,6 +7260,14 @@ "securitySolutionPackages.alertSuppressionRuleDetails.upsell": "La suppression d'alertes est configurée mais elle ne sera pas appliquée en raison d'une licence insuffisante", "securitySolutionPackages.alertSuppressionRuleForm.upsell": "La suppression d'alertes est activée avec la licence {requiredLicense} ou supérieure", "securitySolutionPackages.beta.label": "Bêta", + "securitySolutionPackages.csp.cspEvaluationBadge.failLabel": "Échec", + "securitySolutionPackages.csp.cspEvaluationBadge.naLabel": "S. O.", + "securitySolutionPackages.csp.cspEvaluationBadge.passLabel": "Réussite", + "securitySolutionPackages.csp.findings.findingsErrorToast.searchFailedTitle": "Échec de la recherche", + "securitySolutionPackages.csp.navigation.dashboardNavItemLabel": "Niveau de sécurité du cloud", + "securitySolutionPackages.csp.navigation.findingsNavItemLabel": "Résultats", + "securitySolutionPackages.csp.navigation.rulesNavItemLabel": "Règles", + "securitySolutionPackages.csp.navigation.vulnerabilityDashboardNavItemLabel": "Gestion des vulnérabilités natives du cloud", "securitySolutionPackages.dataTable.ariaLabel": "Alertes", "securitySolutionPackages.dataTable.columnHeaders.flyout.pane.removeColumnButtonLabel": "Supprimer la colonne", "securitySolutionPackages.dataTable.eventRenderedView.eventSummary.column": "Résumé des événements", @@ -7622,6 +7597,7 @@ "share.urlService.redirect.RedirectManager.missingParamLocator": "ID du localisateur non spécifié. Spécifiez le paramètre de recherche \"l\" dans l'URL ; ce devrait être un ID de localisateur existant.", "share.urlService.redirect.RedirectManager.missingParamParams": "Paramètres du localisateur non spécifiés. Spécifiez le paramètre de recherche \"p\" dans l'URL ; ce devrait être un objet sérialisé JSON des paramètres du localisateur.", "share.urlService.redirect.RedirectManager.missingParamVersion": "Version des paramètres du localisateur non spécifiée. Spécifiez le paramètre de recherche \"v\" dans l'URL ; ce devrait être la version de Kibana au moment de la génération des paramètres du localisateur.", + "sharedPlatformPackages.csp.common.utils.helpers.unknownError": "Erreur inconnue", "sharedUXPackages.buttonToolbar.buttons.addFromLibrary.libraryButtonLabel": "Ajouter depuis la bibliothèque", "sharedUXPackages.buttonToolbar.toolbar.errorToolbarText": "Il y a plus de 120 boutons supplémentaires. Nous vous invitons à limiter le nombre de boutons.", "sharedUXPackages.card.noData.description": "Utilisez Elastic Agent pour collecter de manière simple et unifiée les données de vos machines.", @@ -8074,8 +8050,6 @@ "unifiedDataTable.rowHeight.single": "Unique", "unifiedDataTable.rowHeightLabel": "Hauteur de ligne de cellule", "unifiedDataTable.sampleSizeSettings.sampleSizeLabel": "Taille de l'échantillon", - "unifiedDataTable.searchGenerationWithDescription": "Tableau généré par la recherche {searchTitle}", - "unifiedDataTable.searchGenerationWithDescriptionGrid": "Tableau généré par la recherche {searchTitle} ({searchDescription})", "unifiedDataTable.selectAllDocs": "Tout sélectionner ({rowsCount})", "unifiedDataTable.selectAllRowsOnPageColumnHeader": "Sélectionner toutes les lignes visibles", "unifiedDataTable.selectColumnHeader": "Sélectionner la colonne", @@ -8646,11 +8620,6 @@ "visDefaultEditor.sidebar.errorButtonTooltip": "Les erreurs dans les champs mis en évidence doivent être corrigées.", "visDefaultEditor.sidebar.indexPatternAriaLabel": "Modèle d'indexation : {title}", "visDefaultEditor.sidebar.savedSearch.goToDiscoverButtonText": "Afficher cette recherche dans Discover", - "visDefaultEditor.sidebar.savedSearch.linkButtonAriaLabel": "Lier à la recherche enregistrée. Cliquez pour en savoir plus ou rompre le lien.", - "visDefaultEditor.sidebar.savedSearch.popoverHelpText": "Les modifications apportées ultérieurement à cette recherche enregistrée sont reflétées dans la visualisation. Pour désactiver les mises à jour automatiques, supprimez le lien.", - "visDefaultEditor.sidebar.savedSearch.popoverTitle": "Lié à la recherche enregistrée", - "visDefaultEditor.sidebar.savedSearch.titleAriaLabel": "Recherche enregistrée : {title}", - "visDefaultEditor.sidebar.savedSearch.unlinkSavedSearchButtonText": "Supprimer le lien avec la recherche enregistrée", "visDefaultEditor.sidebar.tabs.dataLabel": "Données", "visDefaultEditor.sidebar.tabs.optionsLabel": "Options", "visDefaultEditor.sidebar.updateChartButtonLabel": "Mettre à jour", @@ -9620,7 +9589,6 @@ "visualizations.editVisualization.readOnlyErrorMessage": "Les visualisations {visTypeTitle} sont en lecture seule et ne peuvent pas être ouvertes dans l'éditeur", "visualizations.embeddable.errorTitle": "Impossible de charger la visualisation", "visualizations.embeddable.inspectorTitle": "Inspecteur", - "visualizations.embeddable.legacyURLConflict.errorMessage": "Cette visualisation a la même URL qu'un alias hérité. Désactiver l'alias pour résoudre cette erreur : {json}", "visualizations.embeddable.placeholderTitle": "Titre de l'espace réservé", "visualizations.embeddable.tsdbRollupWarning": "La visualisation utilise une fonction qui n'est pas prise en charge par les données cumulées. Sélectionnez une autre fonction ou modifiez la plage temporelle.", "visualizations.experimentalVisInfoText": "Elle pourra être modifiée ou supprimée totalement dans une prochaine version. Elastic s'efforcera de corriger tous les problèmes, mais les fonctionnalités en version d'évaluation technique ne sont pas soumises aux accords de niveau de service d'assistance des fonctionnalités officielles en disponibilité générale. Pour apporter des commentaires, veuillez créer une entrée dans {githubLink}.", @@ -9642,7 +9610,6 @@ "visualizations.helpMenu.appName": "Bibliothèque Visualize", "visualizations.legacyCharts.conditionalMessage.noPermissions": "Contactez votre administrateur système pour passer à l'ancienne bibliothèque.", "visualizations.legacyUrlConflict.objectNoun": "Visualisation {visName}", - "visualizations.linkedToSearch.unlinkSuccessNotificationText": "Dissocié de la recherche enregistrée \"{searchTitle}\"", "visualizations.listing.betaTitle": "Bêta", "visualizations.listing.betaTooltip": "Cette visualisation est en version bêta et susceptible d'être modifiée. La conception et le code sont moins matures que les fonctionnalités officielles en disponibilité générale et sont fournis tels quels sans aucune garantie. Les fonctionnalités bêta ne sont pas soumises aux accords de niveau de service d'assistance des fonctionnalités officielles en disponibilité générale", "visualizations.listing.breadcrumb": "Bibliothèque Visualize", @@ -9675,9 +9642,7 @@ "visualizations.newVisWizard.learnMoreText": "Envie d'en savoir plus ?", "visualizations.newVisWizard.newVisTypeTitle": "Nouveau {visTypeName}", "visualizations.newVisWizard.resultsFound": "{resultCount, plural, one {type trouvé} other {types trouvés}}", - "visualizations.newVisWizard.searchSelection.notFoundLabel": "Aucun recherche enregistrée ni aucun index correspondants n'ont été trouvés.", "visualizations.newVisWizard.searchSelection.savedObjectType.dataView": "Vue de données", - "visualizations.newVisWizard.searchSelection.savedObjectType.search": "Recherche enregistrée", "visualizations.newVisWizard.title": "Nouvelle visualisation", "visualizations.noDataView.label": "vue de données", "visualizations.noMatchRoute.bannerText": "L'application Visualize ne reconnaît pas cet itinéraire : {route}.", @@ -9689,9 +9654,7 @@ "visualizations.pageHeading": "Visualisation {chartType} {chartName}", "visualizations.readOnlyLegacyVisMessage": "Ces détails ne peuvent pas être modifiés, car cette visualisation n'est plus prise en charge.", "visualizations.reporting.defaultReportTitle": "Visualisation [{date}]", - "visualizations.savedObjectName": "Visualisation", "visualizations.saveDuplicateRejectedDescription": "La confirmation d'enregistrement avec un doublon de titre a été rejetée.", - "visualizations.savingVisualizationFailed.errorMsg": "L'enregistrement de la visualisation a échoué", "visualizations.search.label": "Recherche", "visualizations.share.shareModal.title": "Partager la visualisation", "visualizations.tonNavMenu.tryItBadgeText": "Essayer", @@ -9985,7 +9948,6 @@ "xpack.aiops.correlations.veryLowImpactText": "Très bas", "xpack.aiops.dataGrid.field.documentCountChart.seriesLabel": "compte du document", "xpack.aiops.dataGrid.field.documentCountChartSplit.seriesLabel": "Autre compte du document", - "xpack.aiops.dataSourceContext.errorTitle": "Impossible de récupérer la vue de données ou la recherche enregistrée", "xpack.aiops.dataViewNotBasedOnTimeSeriesWarning.title": "La vue de données \"{dataViewTitle}\" n'est pas basée sur une série temporelle.", "xpack.aiops.documentCountChart.baselineBadgeLabel": "Référence de base", "xpack.aiops.documentCountChart.deviationBadgeLabel": "général", @@ -12678,7 +12640,6 @@ "xpack.canvas.functions.savedMap.args.titleHelpText": "Titre de la carte", "xpack.canvas.functions.savedMap.args.zoomHelpText": "Niveau de zoom de la carte", "xpack.canvas.functions.savedMapHelpText": "Renvoie un objet incorporable pour un objet de carte enregistré.", - "xpack.canvas.functions.savedSearchHelpText": "Renvoie un objet incorporable pour un objet de recherche enregistré", "xpack.canvas.functions.savedVisualization.args.colorsHelpText": "Définit la couleur à utiliser pour une série spécifique", "xpack.canvas.functions.savedVisualization.args.hideLegendHelpText": "Spécifie l'option pour masquer la légende", "xpack.canvas.functions.savedVisualization.args.idHelpText": "ID de l'objet de visualisation enregistré", @@ -14644,7 +14605,6 @@ "xpack.csp.cnvmDashboardTable.section.topVulnerableResources.column.vulnerabilities": "Vulnérabilités", "xpack.csp.cnvmDashboardTable.section.topVulnerableResources.column.vulnerabilityCount": "Vulnérabilités", "xpack.csp.common.component.multiSelectFilter.searchWord": "Recherche", - "xpack.csp.common.utils.helpers.unknownError": "Erreur inconnue", "xpack.csp.compactFormattedNumber.naTitle": "S. O.", "xpack.csp.complianceScoreBar.tooltipTitle": "{failed} échecs et {passed} réussites de résultats", "xpack.csp.complianceScoreChart.counterButtonLink.failedFindingsTooltip": "Échec des résultats", @@ -14659,9 +14619,6 @@ "xpack.csp.createPackagePolicy.customAssetsTab.rulesViewLabel": "Afficher les règles CSP", "xpack.csp.createPackagePolicy.customAssetsTab.vulnerabilityDashboardViewLabel": "Afficher le tableau de bord CNVM", "xpack.csp.createPackagePolicy.customAssetsTab.vulnerabilityFindingsViewLabel": "Afficher les résultats des vulnérabilités", - "xpack.csp.cspEvaluationBadge.failLabel": "Échec", - "xpack.csp.cspEvaluationBadge.naLabel": "S. O.", - "xpack.csp.cspEvaluationBadge.passLabel": "Réussite", "xpack.csp.cspIntegration.gcpCloudCredentials.cloudFormationSupportedMessage": "La fonctionnalité Lancer Cloud Shell pour obtenir les informations d'identification de façon automatisée n’est pas pris en charge dans la version d'intégration actuelle. Veuillez effectuer une mise à niveau vers la dernière version pour activer Lancer Cloud Shell pour les informations d'identification automatisées.", "xpack.csp.cspmIntegration.awsOption.benchmarkTitle": "CIS AWS", "xpack.csp.cspmIntegration.awsOption.nameTitle": "AWS", @@ -14745,7 +14702,6 @@ "xpack.csp.findings.distributionBar.totalPassedLabel": "Réussite des résultats", "xpack.csp.findings.errorCallout.pageSearchErrorTitle": "Une erreur s’est produite lors de la récupération des résultats de recherche.", "xpack.csp.findings.errorCallout.showErrorButtonLabel": "Afficher le message d'erreur", - "xpack.csp.findings.findingsErrorToast.searchFailedTitle": "Échec de la recherche", "xpack.csp.findings.findingsFlyout.calloutTitle": "Certains champs ne sont pas fournis par {vendor}", "xpack.csp.findings.findingsFlyout.flyoutDescriptionList.resourceId": "ID ressource", "xpack.csp.findings.findingsFlyout.flyoutDescriptionList.resourceName": "Nom de ressource", @@ -14915,11 +14871,6 @@ "xpack.csp.kspmIntegration.integration.shortNameTitle": "KSPM", "xpack.csp.kspmIntegration.vanillaOption.benchmarkTitle": "CIS Kubernetes", "xpack.csp.kspmIntegration.vanillaOption.nameTitle": "Autogéré", - "xpack.csp.navigation.dashboardNavItemLabel": "Niveau de sécurité du cloud", - "xpack.csp.navigation.findingsNavItemLabel": "Résultats", - "xpack.csp.navigation.myBenchmarksNavItemLabel": "Benchmarks", - "xpack.csp.navigation.rulesNavItemLabel": "Règles", - "xpack.csp.navigation.vulnerabilityDashboardNavItemLabel": "Gestion des vulnérabilités natives du cloud", "xpack.csp.noFindingsStates.indexing.indexingButtonTitle": "Évaluation du niveau en cours", "xpack.csp.noFindingsStates.indexing.indexingDescription": "En attente de la collecte et de l'indexation des données. Revenez plus tard pour voir vos résultats", "xpack.csp.noFindingsStates.indexTimeout.indexTimeoutDescription": "La collecte des résultats prend plus de temps que prévu. {docs}.", @@ -15580,7 +15531,6 @@ "xpack.dataVisualizer.index.lensChart.countLabel": "Décompte", "xpack.dataVisualizer.index.lensChart.maximumOfLabel": "Maximum de {fieldName}", "xpack.dataVisualizer.index.lensChart.topValuesLabel": "Valeurs les plus élevées", - "xpack.dataVisualizer.index.savedSearchErrorMessage": "Erreur lors de la récupération de la recherche enregistrée {savedSearchId}", "xpack.dataVisualizer.multiSelectPicker.NoFiltersFoundMessage": "Aucun filtre trouvé", "xpack.dataVisualizer.nameCollisionMsg": "\"{name}\" existe déjà, veuillez fournir un nom unique", "xpack.dataVisualizer.noData": "Aucune donnée", @@ -19780,7 +19730,6 @@ "xpack.features.ossFeatures.discoverSearchSessionsFeatureName": "Stocker les sessions de recherche", "xpack.features.ossFeatures.discoverShortUrlSubFeatureName": "URL courtes", "xpack.features.ossFeatures.discoverStoreSearchSessionsPrivilegeName": "Stocker les sessions de recherche", - "xpack.features.ossFeatures.reporting.dashboardDownloadCSV": "Générer les rapports CSV depuis les panneaux des recherches enregistrées", "xpack.features.ossFeatures.reporting.dashboardGenerateScreenshot": "Générer des rapports PDF ou PNG", "xpack.features.ossFeatures.reporting.discoverGenerateCSV": "Générer des rapports CSV", "xpack.features.ossFeatures.reporting.reportingTitle": "Reporting", @@ -20765,7 +20714,6 @@ "xpack.fleet.epm.assetTitles.mlModules": "Configurations de la détection d'anomalies", "xpack.fleet.epm.assetTitles.osqueryPackAssets": "Packs Osquery", "xpack.fleet.epm.assetTitles.osquerySavedQuery": "Requêtes Osquery enregistrées", - "xpack.fleet.epm.assetTitles.savedSearches": "Recherches enregistrées", "xpack.fleet.epm.assetTitles.securityRules": "Règles de sécurité", "xpack.fleet.epm.assetTitles.tag": "Balises", "xpack.fleet.epm.assetTitles.transforms": "Transformations", @@ -22389,8 +22337,6 @@ "xpack.idxMgmt.goToDiscover.discoverIndexButtonLabel": "Découvrir les index", "xpack.idxMgmt.goToDiscover.showIndexToolTip": "Montrer {indexName} dans Discover", "xpack.idxMgmt.home.appTitle": "Gestion des index", - "xpack.idxMgmt.home.componentTemplates.checkingPrivilegesDescription": "Vérification des privilèges…", - "xpack.idxMgmt.home.componentTemplates.checkingPrivilegesErrorMessage": "Erreur lors de la récupération des privilèges utilisateur depuis le serveur.", "xpack.idxMgmt.home.componentTemplates.confirmButtonLabel": "Supprimer {numComponentTemplatesToDelete, plural, one {le modèle de composant} other {les modèles de composants} }", "xpack.idxMgmt.home.componentTemplates.deleteModal.cancelButtonLabel": "Annuler", "xpack.idxMgmt.home.componentTemplates.deleteModal.deleteDescription": "Vous êtes sur le point de supprimer {numComponentTemplatesToDelete, plural, one {ce modèle de composant} other {ces modèles de composants} } :", @@ -22399,8 +22345,6 @@ "xpack.idxMgmt.home.componentTemplates.deleteModal.multipleErrorsNotificationMessageText": "Erreur lors de la suppression de {count} modèles de composants", "xpack.idxMgmt.home.componentTemplates.deleteModal.successDeleteMultipleNotificationMessageText": "{numSuccesses, plural, one {# modèle de composant supprimé} other {# modèles de composants supprimés}}", "xpack.idxMgmt.home.componentTemplates.deleteModal.successDeleteSingleNotificationMessageText": "Le modèle de composant \"{componentTemplateName}\" a bien été supprimé", - "xpack.idxMgmt.home.componentTemplates.deniedPrivilegeDescription": "Pour utiliser les modèles de composants, vous devez posséder {privilegesCount, plural, one {ce privilège de cluster} other {ces privilèges de cluster}} : {missingPrivileges}.", - "xpack.idxMgmt.home.componentTemplates.deniedPrivilegeTitle": "Privilèges de cluster requis", "xpack.idxMgmt.home.componentTemplates.emptyPromptButtonLabel": "Créer un modèle de composant", "xpack.idxMgmt.home.componentTemplates.emptyPromptDescription": "Par exemple, vous pouvez créer un modèle de composant pour les paramètres d'index réutilisables dans tous les modèles d'index.", "xpack.idxMgmt.home.componentTemplates.emptyPromptDocumentionLink": "En savoir plus.", @@ -24338,8 +24282,6 @@ "xpack.infra.logsPage.toolbar.logFilterErrorToastTitle": "Erreur de filtrage du log", "xpack.infra.logsSettingsPage.loadingButtonLabel": "Chargement", "xpack.infra.logsStreamEmbeddable.deprecationWarningDescription": "La maintenance des panneaux de flux de logs n'est plus assurée. Essayez d'utiliser {savedSearchDocsLink} pour une visualisation similaire.", - "xpack.infra.logsStreamEmbeddable.deprecationWarningDescription.savedSearchesLinkLabel": "recherches enregistrées", - "xpack.infra.logStreamEmbeddable.description": "Ajoutez un tableau de logs de diffusion en direct. Pour une expérience plus efficace, nous vous recommandons d'utiliser la page Découvrir pour créer une recherche enregistrée au lieu d'utiliser Logs Stream.", "xpack.infra.logStreamEmbeddable.displayName": "Logs Stream (déclassé)", "xpack.infra.logStreamEmbeddable.title": "Flux de log", "xpack.infra.logStreamPageTemplate.backtoLogsStream": "Retour au flux de logs", @@ -29116,15 +29058,10 @@ "xpack.ml.dataframe.analytics.create.resultsFieldHelpText": "Définissez le nom du champ dans lequel les résultats de l'analyse doivent être stockés. La valeur par défaut est ml.", "xpack.ml.dataframe.analytics.create.resultsFieldInputAriaLabel": "Nom du champ dans lequel les résultats de l'analyse doivent être stockés.", "xpack.ml.dataframe.analytics.create.resultsFieldLabel": "Champ de résultats", - "xpack.ml.dataframe.analytics.create.savedSearchLabel": "Recherche enregistrée", "xpack.ml.dataframe.analytics.create.scatterplotMatrixLabel": "Matrice de nuages de points", "xpack.ml.dataframe.analytics.create.scatterplotMatrixLabelHelpText": "Permet de visualiser les relations entre les paires de champs inclus sélectionnés.", - "xpack.ml.dataFrame.analytics.create.searchSelection.CcsErrorCallOutBody": "La recherche enregistrée \"{savedSearchTitle}\" utilise la vue de données \"{dataViewName}\".", "xpack.ml.dataFrame.analytics.create.searchSelection.CcsErrorCallOutTitle": "Les vues de données utilisant la recherche inter-clusters ne sont pas prises en charge.", - "xpack.ml.dataFrame.analytics.create.searchSelection.errorGettingDataViewTitle": "Erreur lors du chargement de la vue de données utilisée par la recherche enregistrée", - "xpack.ml.dataFrame.analytics.create.searchSelection.notFoundLabel": "Aucun recherche enregistrée ni aucun index correspondants n'ont été trouvés.", "xpack.ml.dataFrame.analytics.create.searchSelection.savedObjectType.dataView": "Vue de données", - "xpack.ml.dataFrame.analytics.create.searchSelection.savedObjectType.search": "Recherche enregistrée", "xpack.ml.dataframe.analytics.create.softTreeDepthLimitInputAriaLabel": "Les arbres de décision dépassant cette profondeur sont pénalisés dans les calculs de perte.", "xpack.ml.dataframe.analytics.create.softTreeDepthLimitLabel": "Limite de profondeur d'arborescence non stricte", "xpack.ml.dataframe.analytics.create.softTreeDepthLimitText": "Les arbres de décision dépassant cette profondeur sont pénalisés dans les calculs de perte. Doit être supérieur ou égal à 0.", @@ -29417,7 +29354,6 @@ "xpack.ml.dataGridChart.notEnoughData": "0 document contient le champ.", "xpack.ml.dataGridChart.singleCategoryLegend": "{cardinality, plural, one {# catégorie} other {# catégories}}", "xpack.ml.dataGridChart.topCategoriesLegend": "Premières {maxChartColumns} des catégories {cardinality}", - "xpack.ml.dataSourceContext.errorTitle": "Impossible de récupérer la vue de données ou la recherche enregistrée", "xpack.ml.dataViewNotBasedOnTimeSeriesNotificationDescription": "La détection des anomalies ne s'exécute que sur des index temporels", "xpack.ml.dataViewNotBasedOnTimeSeriesNotificationTitle": "La vue de données {dataViewIndexPattern} n'est pas basée sur une série temporelle", "xpack.ml.dataViewUtils.createDataViewSwitchLabel": "Créer une vue de données", @@ -29660,7 +29596,6 @@ "xpack.ml.feature.reserved.description": "Pour accorder l'accès aux utilisateurs, vous devez également affecter le rôle machine_learning_user ou machine_learning_admin.", "xpack.ml.featureFeedbackButton.tellUsWhatYouThinkLink": "Dites-nous ce que vous pensez !", "xpack.ml.featureRegistry.mlFeatureName": "Machine Learning", - "xpack.ml.featureRegistry.privilegesTooltip": "L'octroi des privilèges de fonctionnalité Tout ou Lire au Machine Learning accordera également les privilèges de fonctionnalité équivalents à certains types d'objets Kibana enregistrés, à savoir les modèles d'indexation, les tableaux de bord, les recherches et visualisations enregistrées ainsi que les tâches de Machine Learning, les modèles entraînés et les objets de modules enregistrés.", "xpack.ml.fieldTypeIcon.booleanTypeAriaLabel": "type booléen", "xpack.ml.fieldTypeIcon.dateTypeAriaLabel": "type de données", "xpack.ml.fieldTypeIcon.geoPointTypeAriaLabel": "Type {geoPointParam}", @@ -30461,7 +30396,6 @@ "xpack.ml.newJob.recognize.running.startedAriaLabel": "Démarré", "xpack.ml.newJob.recognize.running.startFailedAriaLabel": "Échec du démarrage", "xpack.ml.newJob.recognize.runningLabel": "En cours d'exécution", - "xpack.ml.newJob.recognize.savedSearchPageTitle": "recherche enregistrée {savedSearchTitle}", "xpack.ml.newJob.recognize.saveJobOverrideLabel": "Enregistrer", "xpack.ml.newJob.recognize.searchesLabel": "Recherches", "xpack.ml.newJob.recognize.searchWillBeOverwrittenLabel": "La recherche sera écrasée", @@ -30470,7 +30404,6 @@ "xpack.ml.newJob.recognize.startDatafeedAfterSaveLabel": "Démarrer le flux de données après l'enregistrement", "xpack.ml.newJob.recognize.useDedicatedIndexLabel": "Utiliser l'index dédié", "xpack.ml.newJob.recognize.useFullDataLabel": "Utiliser l'ensemble des données {dataViewIndexPattern}", - "xpack.ml.newJob.recognize.usingSavedSearchDescription": "L'utilisation d'une recherche enregistrée signifie que la recherche utilisée dans les flux de données sera différente de celles par défaut que nous fournissons dans le module {moduleId}.", "xpack.ml.newJob.recognize.viewResultsAriaLabel": "Afficher les résultats", "xpack.ml.newJob.recognize.viewResultsLinkText": "Afficher les résultats", "xpack.ml.newJob.recognize.visualizationsLabel": "Visualisations", @@ -30490,7 +30423,6 @@ "xpack.ml.newJob.wizard.datafeedStep.dataView.description": "La vue de données actuellement utilisée pour cette tâche.", "xpack.ml.newJob.wizard.datafeedStep.dataView.step0.title": "Changer de vue de données", "xpack.ml.newJob.wizard.datafeedStep.dataView.step1.dataView": "Vue de données", - "xpack.ml.newJob.wizard.datafeedStep.dataView.step1.noMatchingError": "Aucun recherche enregistrée ni aucun index correspondants n'ont été trouvés.", "xpack.ml.newJob.wizard.datafeedStep.dataView.step1.title": "Sélectionner une nouvelle vue de données pour la tâche", "xpack.ml.newJob.wizard.datafeedStep.dataView.step2.ApplyButton": "Appliquer", "xpack.ml.newJob.wizard.datafeedStep.dataView.step2.backButton": "Retour", @@ -30600,8 +30532,6 @@ "xpack.ml.newJob.wizard.jobType.rareAriaLabel": "Tâche rare", "xpack.ml.newJob.wizard.jobType.rareDescription": "Détectez les valeurs rares dans les données temporelles.", "xpack.ml.newJob.wizard.jobType.rareTitle": "Rare", - "xpack.ml.newJob.wizard.jobType.savedSearchPageTitleLabel": "recherche enregistrée {savedSearchTitle}", - "xpack.ml.newJob.wizard.jobType.selectDifferentIndexLinkText": "Sélectionnez une autre vue de données ou une autre recherche enregistrée.", "xpack.ml.newJob.wizard.jobType.singleMetricAriaLabel": "Tâche à indicateur unique", "xpack.ml.newJob.wizard.jobType.singleMetricDescription": "Détectez les anomalies dans une série temporelle unique.", "xpack.ml.newJob.wizard.jobType.singleMetricTitle": "Indicateur unique", @@ -30611,7 +30541,6 @@ "xpack.ml.newJob.wizard.jsonFlyout.autoSetJobCreatorTimeRange.error": "Erreur lors de la récupération des heures de début et de fin de l'index", "xpack.ml.newJob.wizard.jsonFlyout.closeButton": "Fermer", "xpack.ml.newJob.wizard.jsonFlyout.datafeed.title": "JSON de configuration du flux de données", - "xpack.ml.newJob.wizard.jsonFlyout.indicesChange.calloutText": "Vous ne pouvez pas altérer les index utilisés par le flux de données. Pour sélectionner une autre vue de données ou une autre recherche enregistrée, accédez à l’étape 1 de l’assistant et sélectionnez l’option permettant de changer de vue de données.", "xpack.ml.newJob.wizard.jsonFlyout.indicesChange.calloutTitle": "Les index ont été modifiés", "xpack.ml.newJob.wizard.jsonFlyout.job.title": "JSON de configuration de la tâche", "xpack.ml.newJob.wizard.jsonFlyout.saveButton": "Enregistrer", @@ -30743,10 +30672,7 @@ "xpack.ml.newJob.wizard.revertModelSnapshotFlyout.title": "Restaurer le snapshot du modèle {ssId}", "xpack.ml.newJob.wizard.revertModelSnapshotFlyout.warningCallout.contents": "Tous les résultats de détection des anomalies postérieurs au {date} seront supprimés.", "xpack.ml.newJob.wizard.revertModelSnapshotFlyout.warningCallout.title": "Les données d'anomalie seront supprimées", - "xpack.ml.newJob.wizard.searchSelection.notFoundLabel": "Aucune vue de données ni recherche enregistrée correspondante détectée.", "xpack.ml.newJob.wizard.searchSelection.savedObjectType.dataView": "Vue de données", - "xpack.ml.newJob.wizard.searchSelection.savedObjectType.search": "Recherche enregistrée", - "xpack.ml.newJob.wizard.selectDataViewOrSavedSearch": "Sélectionner une vue de données ou une recherche enregistrée", "xpack.ml.newJob.wizard.shopValidationButton": "Ignorer la validation", "xpack.ml.newJob.wizard.step.configureDatafeedTitle": "Configurer le flux de données", "xpack.ml.newJob.wizard.step.jobDetailsTitle": "Détails de la tâche", @@ -30758,7 +30684,6 @@ "xpack.ml.newJob.wizard.stepComponentWrapper.jobDetailsTitle": "Détails de la tâche", "xpack.ml.newJob.wizard.stepComponentWrapper.pickFieldsTitle": "Choisir les champs", "xpack.ml.newJob.wizard.stepComponentWrapper.summaryTitleDataView": "Nouvelle tâche de la vue de données {dataViewName}", - "xpack.ml.newJob.wizard.stepComponentWrapper.summaryTitleSavedSearch": "Nouvelle tâche de la recherche enregistrée {title}", "xpack.ml.newJob.wizard.stepComponentWrapper.timeRangeTitle": "Plage temporelle", "xpack.ml.newJob.wizard.stepComponentWrapper.validationTitle": "Validation", "xpack.ml.newJob.wizard.summaryStep.convertToAdvancedButton": "Convertir en tâche avancée", @@ -37596,7 +37521,6 @@ "xpack.securitySolution.detectionEngine.body.summary.message": "La règle {ruleName} a généré {signalsCount} alertes", "xpack.securitySolution.detectionEngine.buttonManageRules": "Gérer les règles", "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkActionConfirmationCloseButtonLabel": "Fermer", - "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditConfirmation.confirmButtonLabel": "Modifier {customRulesCount, plural, =1 {# règle personnalisée} other {# règles personnalisées}}", "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditConfirmationCancelButtonLabel": "Annuler", "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addIndexPatternsComboboxHelpText": "Entrez le modèle des index Elasticsearch que vous souhaitez ajouter. Par défaut, le menu déroulant comprend des modèles d'indexation définis dans les paramètres avancés de la solution Security.", "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addIndexPatternsComboboxLabel": "Ajouter des modèles d'indexation pour les règles sélectionnées", @@ -37630,8 +37554,6 @@ "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.setInvestigationFieldsWarningCallout": "Vous êtes sur le point d'écraser des champs en surbrillance personnalisés pour {rulesCount, plural, one {la règle sélectionnée} other {les # règles sélectionnées}}. Pour appliquer et enregistrer les modifications, cliquez sur Enregistrer.", "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.setTagsWarningCallout": "Vous êtes sur le point d'écraser les balises pour {rulesCount, plural, one {# règle sélectionnée} other {# règles sélectionnées}}. Sélectionnez Enregistrer pour appliquer les modifications.", "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.tagsComoboxRequiredErrorMessage": "Au moins une balise est requise.", - "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkExportConfirmation.confirmButtonLabel": "Exporter {customRulesCount, plural, =1 {# règle personnalisée} other {# règles personnalisées}}", - "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkManualRuleRunConfirmation.confirmButtonLabel": "Planifier {customRulesCount, plural, =1 {# règle personnalisée} other {# règles personnalisées}}", "xpack.securitySolution.detectionEngine.components.allRules.bulkDeleteConfirmationTitle": "Confirmer la suppression groupée", "xpack.securitySolution.detectionEngine.components.allRules.deleteConfirmationCancel": "Annuler", "xpack.securitySolution.detectionEngine.components.allRules.deleteConfirmationConfirm": "Supprimer", @@ -37780,7 +37702,6 @@ "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.multiSelectFields.placeholderText": "Sélectionner un champ", "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.newTermsField.placeholderText": "Sélectionner un champ", "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.newTermsFieldsLabel": "Champs", - "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.newTermsFieldsMin": "Au moins un champ est requis.", "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.referencesUrlInvalidError": "Le format de l’URL n’est pas valide.", "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.resetDefaultIndicesButton": "Réinitialiser sur les modèles d'indexation par défaut", "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.rulePreviewTitle": "Aperçu de la règle", @@ -38853,7 +38774,6 @@ "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.addRuleActionsTitle": "Ajouter des actions sur les règles", "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.addTagsTitle": "Ajouter des balises", "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.applyTimelineTemplateTitle": "Appliquer le modèle de chronologie", - "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkActionConfirmationPartlyTitle": "L'action peut être appliquée uniquement à {customRulesCount, plural, =1 {# règle personnalisée} other {# règles personnalisées}}", "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkEditConfirmationDeniedTitle": "Impossible de modifier {rulesCount, plural, =1 {# règle} other {# règles}}.", "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkEditWarningToastDescription": "{rulesCount, plural, =1 {# règle est} other {# règles sont}} en cours de mise à jour.", "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkEditWarningToastNotifyButtonLabel": "M'envoyer une notification à la fin", @@ -39086,7 +39006,6 @@ "xpack.securitySolution.detectionEngine.userUnauthenticatedMsgBody": "Vous ne disposez pas des autorisations requises pour visualiser le moteur de détection. Pour une aide supplémentaire, contactez votre administrateur.", "xpack.securitySolution.detectionEngine.userUnauthenticatedTitle": "Autorisations de moteur de détection requises", "xpack.securitySolution.detectionEngine.validations.stepDefineRule.historyWindowSize.errMin": "La taille de la fenêtre d'historique doit être supérieure à 0.", - "xpack.securitySolution.detectionEngine.validations.stepDefineRule.newTermsFieldsMax": "Le nombre de champs doit être de 3 au maximum.", "xpack.securitySolution.detectionEngine.validations.thresholdCardinalityFieldFieldData.thresholdCardinalityFieldNotSuppliedMessage": "Un champ Cardinalité est requis.", "xpack.securitySolution.detectionEngine.validations.thresholdCardinalityValueFieldData.numberGreaterThanOrEqualOneErrorMessage": "La valeur doit être supérieure ou égale à un.", "xpack.securitySolution.detectionEngine.validations.thresholdFieldFieldData.arrayLengthGreaterThanMaxErrorMessage": "Le nombre de champs doit être de 3 au maximum.", @@ -42387,7 +42306,6 @@ "xpack.securitySolution.timelines.components.templateFilter.elasticTitle": "Modèles Elastic", "xpack.securitySolution.timelines.discoverInTimeline.save_saved_search_error": "Erreur pendant l'enregistrement de la recherche Discover", "xpack.securitySolution.timelines.discoverInTimeline.save_saved_search_unknown_error": "Erreur inconnue pendant l'enregistrement de la recherche Discover", - "xpack.securitySolution.timelines.discoverInTimeline.savedSearchTitle": "Recherche sauvegardée pour la chronologie – {title}", "xpack.securitySolution.timelines.newTemplateTimelineButtonLabel": "Créer un nouveau modèle de chronologie", "xpack.securitySolution.timelines.newTimelineButtonLabel": "Créer une nouvelle chronologie", "xpack.securitySolution.timelines.pageTitle": "Chronologies", @@ -42802,7 +42720,7 @@ "xpack.serverlessSearch.languages.php": "PHP", "xpack.serverlessSearch.languages.php.githubLink": "elasticsearch-serverless-php", "xpack.serverlessSearch.languages.python": "Python", - "xpack.serverlessSearch.languages.python.githubLabel": "elasticsearch-serverless-python", + "xpack.serverlessSearch.languages.python.githubLabel": "elasticsearch-py", "xpack.serverlessSearch.languages.ruby": "Ruby", "xpack.serverlessSearch.languages.ruby.githubLabel": "elasticsearch-serverless-ruby", "xpack.serverlessSearch.learnMore": "En savoir plus", @@ -44388,7 +44306,6 @@ "xpack.spaces.management.copyToSpace.copyModeControl.createNewCopies.disabledTitle": "Rechercher les objets existants", "xpack.spaces.management.copyToSpace.copyModeControl.createNewCopies.enabledText": "Utilisez cette option pour créer une ou plusieurs copies de l'objet dans le même espace.", "xpack.spaces.management.copyToSpace.copyModeControl.createNewCopies.enabledTitle": "Créer de nouveaux objets avec des ID aléatoires", - "xpack.spaces.management.copyToSpace.copyModeControl.includeRelated.text": "Copier cet objet et ses objets associés. Pour les tableaux de bord, les visualisations associées, modèles d'indexation et recherches enregistrées sont également copiés.", "xpack.spaces.management.copyToSpace.copyModeControl.includeRelated.title": "Inclure les objets associés", "xpack.spaces.management.copyToSpace.copyModeControl.overwrite.disabledLabel": "Demander une action en cas de conflit", "xpack.spaces.management.copyToSpace.copyModeControl.overwrite.enabledLabel": "Écraser automatiquement les conflits", @@ -47161,15 +47078,12 @@ "xpack.transform.newTransform.chooseSourceTitle": "Choisir une source", "xpack.transform.newTransform.newTransformTitle": "Nouvelle transformation", "xpack.transform.newTransform.searchSelection.createADataView": "Créer une vue de données", - "xpack.transform.newTransform.searchSelection.notFoundLabel": "Aucun recherche enregistrée ni aucun index correspondants n'ont été trouvés.", "xpack.transform.newTransform.searchSelection.savedObjectType.dataView": "Vue de données", - "xpack.transform.newTransform.searchSelection.savedObjectType.search": "Recherche enregistrée", "xpack.transform.pivotPreview.copyClipboardTooltip": "Copier la déclaration Dev Console de l'aperçu de la transformation dans le presse-papiers.", "xpack.transform.pivotPreview.PivotPreviewIncompleteConfigCalloutBody": "Veuillez choisir au moins un champ Regrouper par et une agrégation.", "xpack.transform.pivotPreview.PivotPreviewNoDataCalloutBody": "La requête d'aperçu n'a renvoyé aucune donnée. Veuillez vous assurer que la requête facultative renvoie des données et que les valeurs existent pour le champ utilisé par le champ Regrouper par et le champ d'agrégation.", "xpack.transform.pivotPreview.transformPreviewTitle": "Aperçu de la transformation", "xpack.transform.progress": "Progression", - "xpack.transform.searchItems.errorInitializationTitle": "Une erreur s'est produite lors de l'initialisation de la vue de données Kibana ou de la recherche enregistrée.", "xpack.transform.statsBar.batchTransformsLabel": "Lot", "xpack.transform.statsBar.continuousTransformsLabel": "Continu", "xpack.transform.statsBar.failedTransformsLabel": "Échoué", @@ -47251,7 +47165,6 @@ "xpack.transform.stepDefineForm.runtimeEditorSwitchModalTitle": "Les modifications seront perdues", "xpack.transform.stepDefineForm.runtimeFieldsLabel": "Champs de temps d'exécution", "xpack.transform.stepDefineForm.runtimeFieldsListLabel": "{runtimeFields}", - "xpack.transform.stepDefineForm.savedSearchLabel": "Recherche enregistrée", "xpack.transform.stepDefineForm.searchFilterLabel": "Filtre de recherche", "xpack.transform.stepDefineForm.sortFieldOptionsEmptyError": "Aucun champ de date n'est disponible pour effectuer le tri. Pour utiliser un autre type de champ, copiez la configuration dans le presse-papiers et continuez à créer la transformation dans la Console.", "xpack.transform.stepDefineForm.sortHelpText": "Sélectionnez le champ de date à utiliser pour identifier le document le plus récent.", @@ -47264,7 +47177,6 @@ "xpack.transform.stepDefineSummary.groupByLabel": "Regrouper par", "xpack.transform.stepDefineSummary.queryCodeBlockLabel": "Recherche", "xpack.transform.stepDefineSummary.queryLabel": "Requête", - "xpack.transform.stepDefineSummary.savedSearchLabel": "Recherche enregistrée", "xpack.transform.stepDefineSummary.timeRangeLabel": "Plage temporelle", "xpack.transform.stepDetailsForm.advancedSettingsAccordionButtonContent": "Paramètres avancés", "xpack.transform.stepDetailsForm.continuousModeAriaLabel": "Choisissez un retard.", diff --git a/x-pack/platform/plugins/private/translations/translations/ja-JP.json b/x-pack/platform/plugins/private/translations/translations/ja-JP.json index 18a4ea7485487..225937ebae1b4 100644 --- a/x-pack/platform/plugins/private/translations/translations/ja-JP.json +++ b/x-pack/platform/plugins/private/translations/translations/ja-JP.json @@ -1454,7 +1454,6 @@ "dashboard.emptyScreen.noPermissionsTitle": "このダッシュボードは空です。", "dashboard.emptyScreen.viewModeSubtitle": "編集モードに切り替えて、ビジュアライゼーションの追加を開始します。", "dashboard.emptyScreen.viewModeTitle": "ダッシュボードにビジュアライゼーションを追加", - "dashboard.featureCatalogue.dashboardDescription": "ビジュアライゼーションと保存された検索のコレクションの表示と共有を行います。", "dashboard.featureCatalogue.dashboardSubtitle": "ダッシュボードでデータを分析します。", "dashboard.featureCatalogue.dashboardTitle": "ダッシュボード", "dashboard.labs.enableLabsDescription": "このフラグはビューアーで[ラボ]ボタンを使用できるかどうかを決定します。ダッシュボードで実験的機能を有効および無効にするための簡単な方法です。", @@ -1581,7 +1580,6 @@ "data.advancedSettings.courier.requestPreferenceTitle": "リクエスト設定", "data.advancedSettings.defaultIndexText": "データビューが設定されていないときに、検索とビジュアライゼーションによって使用されます。", "data.advancedSettings.defaultIndexTitle": "デフォルトのデータビュー", - "data.advancedSettings.docTableHighlightText": "Discover と保存された検索ダッシュボードの結果をハイライトします。ハイライトすることで、大きなドキュメントを扱う際にリクエストが遅くなります。", "data.advancedSettings.docTableHighlightTitle": "結果をハイライト", "data.advancedSettings.histogram.barTargetText": "日付ヒストグラムで「自動」間隔を使用する際、この数に近いバケットの作成を試みます", "data.advancedSettings.histogram.barTargetTitle": "目標バケット数", @@ -2510,7 +2508,6 @@ "discover.advancedSettings.discover.showFieldStatisticsDescription": "{fieldStatisticsDocs}を有効にすると、数値フィールドの最大/最小値やジオフィールドの地図といった詳細が表示されます。この機能はベータ段階で、変更される可能性があります。", "discover.advancedSettings.discover.showMultifields": "マルチフィールドを表示", "discover.advancedSettings.discover.showMultifieldsDescription": "拡張ドキュメントビューに{multiFields}が表示されるかどうかを制御します。ほとんどの場合、マルチフィールドは元のフィールドと同じです。「searchFieldsFromSource」がオフのときにのみこのオプションを使用できます。", - "discover.advancedSettings.docTableHideTimeColumnText": "Discover と、ダッシュボードのすべての保存された検索で、「時刻」列を非表示にします。", "discover.advancedSettings.docTableHideTimeColumnTitle": "「時刻」列を非表示", "discover.advancedSettings.fieldsPopularLimitText": "最も頻繁に使用されるフィールドのトップNを表示します", "discover.advancedSettings.fieldsPopularLimitTitle": "頻繁に使用されるフィールドの制限", @@ -2522,7 +2519,6 @@ "discover.advancedSettings.sampleRowsPerPageTitle": "ページごとの行数", "discover.advancedSettings.sampleSizeText": "ドキュメントテーブル全体の最大行数を設定します。", "discover.advancedSettings.sampleSizeTitle": "テーブルごとの最大行数", - "discover.advancedSettings.searchOnPageLoadText": "Discover の最初の読み込み時に検索を実行するかを制御します。この設定は、保存された検索の読み込み時には影響しません。", "discover.advancedSettings.searchOnPageLoadTitle": "ページの読み込み時の検索", "discover.advancedSettings.sortDefaultOrderText": "Discover アプリのデータビューに基づく時刻のデフォルトの並べ替え方向をコントロールします。", "discover.advancedSettings.sortDefaultOrderTitle": "デフォルトの並べ替え方向", @@ -2532,7 +2528,6 @@ "discover.alerts.manageRulesAndConnectors": "ルールとコネクターの管理", "discover.alerts.missedTimeFieldToolTip": "データビューには時間フィールドがありません。", "discover.badge.readOnly.text": "読み取り専用", - "discover.badge.readOnly.tooltip": "検索を保存できません", "discover.context.breadcrumb": "周りのドキュメント", "discover.context.contextOfTitle": "#{anchorId}の周りのドキュメント", "discover.context.failedToLoadAnchorDocumentDescription": "アンカードキュメントの読み込みに失敗しました", @@ -2580,7 +2575,6 @@ "discover.dropZoneTableLabel": "フィールドを列として表に追加するには、ゾーンをドロップします", "discover.embeddable.inspectorRequestDescription": "このリクエストはElasticsearchにクエリーをかけ、検索データを取得します。", "discover.embeddable.search.dataViewError": "データビュー{indexPatternId}が見つかりません", - "discover.embeddable.search.displayName": "検索", "discover.errorCalloutESQLReferenceButtonLabel": "ES|QL参照を開く", "discover.errorCalloutShowErrorMessage": "詳細を表示", "discover.esqlMode.selectedColumnsCallout": "{esqlQueryColumnsNumber}フィールド中{selectedColumnsNumber}フィールドを表示中です。利用可能なフィールドリストからさらに追加します。", @@ -2589,7 +2583,6 @@ "discover.esqlToDataViewTransitionModal.feedbackLink": "ES|QLフィードバックを送信", "discover.esqlToDataViewTransitionModal.saveButtonLabel": "保存して切り替え", "discover.esqlToDataViewTransitionModal.title": "保存されていない変更", - "discover.esqlToDataviewTransitionModalBody": "データビューを切り替えると、現在のES|QLクエリが削除されます。作業が失われないようにするには、この検索を保存してください。", "discover.fieldChooser.availableFieldsTooltip": "フィールドをテーブルに表示できます。", "discover.fieldChooser.discoverField.addFieldTooltip": "フィールドを列として追加", "discover.fieldChooser.discoverField.removeFieldTooltip": "フィールドを表から削除", @@ -2617,19 +2610,10 @@ "discover.loadingDocuments": "ドキュメントを読み込み中", "discover.localMenu.alertsDescription": "アラート", "discover.localMenu.esqlTooltipLabel": "ES|QLはElasticの強力な新しいパイプクエリ言語です。", - "discover.localMenu.fallbackReportTitle": "無題のDiscover検索", "discover.localMenu.inspectTitle": "検査", "discover.localMenu.localMenu.alertsTitle": "アラート", - "discover.localMenu.localMenu.newSearchTitle": "新規", - "discover.localMenu.mustCopyOnSave": "Elasticはこの保存された検索を管理します。変更は新しい保存された検索に保存されます。", - "discover.localMenu.newSearchDescription": "新規検索", "discover.localMenu.openInspectorForSearchDescription": "検索用にインスペクターを開きます", - "discover.localMenu.openSavedSearchDescription": "保存された検索を開きます", - "discover.localMenu.openTitle": "開く", - "discover.localMenu.saveSaveSearchObjectType": "検索", - "discover.localMenu.saveSearchDescription": "検索を保存します", "discover.localMenu.saveTitle": "保存", - "discover.localMenu.shareSearchDescription": "検索を共有します", "discover.localMenu.shareTitle": "共有", "discover.localMenu.switchToClassicTitle": "クラシックに切り替える", "discover.localMenu.switchToClassicTooltipLabel": "KQLまたはLucene構文に切り替えます。", @@ -2695,8 +2679,6 @@ "discover.noResults.suggestion.tryText": "次の方法を試してください:", "discover.notifications.invalidTimeRangeText": "指定された時間範囲が無効です。(開始:''{from}''、終了:''{to}'')", "discover.notifications.invalidTimeRangeTitle": "無効な時間範囲", - "discover.notifications.notSavedSearchTitle": "検索''{savedSearchTitle}''は保存されませんでした。", - "discover.notifications.savedSearchTitle": "検索''{savedSearchTitle}''が保存されました。", "discover.pageTitleWithoutSavedSearch": "Discover - 検索は保存されていません", "discover.pageTitleWithSavedSearch": "Discover - {savedSearchTitle}", "discover.panelsToggle.hideChartButton": "グラフを非表示", @@ -2705,24 +2687,15 @@ "discover.panelsToggle.showSidebarButton": "サイドバーを表示", "discover.rootBreadcrumb": "Discover", "discover.sampleData.viewLinkLabel": "Discover", - "discover.savedSearch.savedObjectName": "保存検索", - "discover.savedSearchAliasMatchRedirect.objectNoun": "{savedSearch}検索", "discover.savedSearchEmbeddable.action.viewSavedSearch.displayName": "Discoverで開く", - "discover.savedSearchURLConflictCallout.objectNoun": "{savedSearch}検索", "discover.searchingTitle": "検索中", "discover.serverLocatorExtension.titleFromLocatorUnknown": "不明な検索", - "discover.share.shareModal.title": "この検索を共有", "discover.showingDefaultDataViewWarningDescription": "デフォルトデータビューを表示しています:\"{loadedDataViewTitle}\" ({loadedDataViewId})", "discover.showingSavedDataViewWarningDescription": "保存されたデータビューを表示しています:\"{ownDataViewTitle}\" ({ownDataViewId})", "discover.singleDocRoute.errorMessage": "ID {dataViewId}の一致するデータビューが見つかりません", "discover.singleDocRoute.errorTitle": "エラーが発生しました", "discover.skipToBottomButtonLabel": "テーブルの最後に移動", - "discover.topNav.managedContentLabel": "この保存された検索は、Elasticによって管理されます。この変更は、新しく保存された検索に保存する必要があります。", - "discover.topNav.openSearchPanel.manageSearchesButtonLabel": "検索の管理", - "discover.topNav.openSearchPanel.noSearchesFoundDescription": "一致する検索が見つかりませんでした。", - "discover.topNav.openSearchPanel.openSearchTitle": "検索を開く", "discover.topNav.saveModal.storeTimeWithSearchToggleDescription": "この検索を使用するときには、時間フィルターを更新し、現在の選択に合わせて間隔を更新します。", - "discover.topNav.saveModal.storeTimeWithSearchToggleLabel": "保存された検索で時間を保存", "discover.uninitializedRefreshButtonText": "データを更新", "discover.uninitializedText": "クエリーを作成、フィルターを追加、または[更新]をクリックして、現在のクエリーの結果を取得します。", "discover.uninitializedTitle": "検索開始", @@ -2794,13 +2767,11 @@ "embeddableApi.common.constants.grouping.annotations": "注釈とナビゲーション", "embeddableApi.common.constants.grouping.legacy": "レガシー", "embeddableApi.common.constants.grouping.other": "Other", - "embeddableApi.compatibility.defaultTypeDisplayName": "チャート", "embeddableApi.contextMenuTrigger.description": "新しいアクションがパネルのコンテキストメニューに追加されます", "embeddableApi.contextMenuTrigger.title": "コンテキストメニュー", "embeddableApi.errors.embeddableFactoryNotFound": "{type} を読み込めません。Elasticsearch と Kibanaのデフォルトのディストリビューションを適切なライセンスでアップグレードしてください。", "embeddableApi.errors.paneldoesNotExist": "パネルが見つかりません", "embeddableApi.errors.panelIncompatibleError": "パネルAPIに互換性がありません", - "embeddableApi.helloworld.displayName": "こんにちは", "embeddableApi.multiValueClickTrigger.description": "ビジュアライゼーションの1つのディメンションの複数値を選択しています", "embeddableApi.multiValueClickTrigger.title": "マルチクリック", "embeddableApi.panelBadgeTrigger.description": "パネルに埋め込み可能なファイルが読み込まれるときに、アクションがタイトルバーに表示されます。", @@ -2840,7 +2811,6 @@ "embeddableExamples.unifiedFieldList.displayName": "フィールドリスト", "embeddableExamples.unifiedFieldList.noDefaultDataViewErrorMessage": "フィールドリストは、1つ以上のデータビューで使用する必要があります。", "embeddableExamples.unifiedFieldList.selectDataViewMessage": "データビューを選択してください", - "esql.advancedSettings.enableESQLDescription": "この設定はKibanaのES|QLを有効にします。オフにすると、さまざまなアプリケーションからES|QLユーザーインターフェースが非表示になります。ただし、ユーザーは、既存のES|QLで保存された検索、ビジュアライゼーションなどにアクセスできます。", "esql.advancedSettings.enableESQLTitle": "ES|QLを有効化", "esql.triggers.updateEsqlQueryTrigger": "ES|QLクエリを更新", "esql.triggers.updateEsqlQueryTriggerDescription": "ES|QLクエリを新しいクエリで更新", @@ -5070,7 +5040,6 @@ "indexPatternManagement.editIndexPattern.source.table.matchesHeader": "一致", "indexPatternManagement.editIndexPattern.source.table.notMatchedLabel": "ソースフィルターが既知のフィールドと一致しません。", "indexPatternManagement.editIndexPattern.source.table.saveAria": "保存", - "indexPatternManagement.editIndexPattern.sourceLabel": "フィールドフィルターは、ドキュメントの取得時に 1 つまたは複数のフィールドを除外するのに使用される場合もあります。これは Discover アプリでのドキュメントの表示中、またはダッシュボードアプリの保存された検索の結果を表示する表で起こります。ドキュメントに大きなフィールドや重要ではないフィールドが含まれている場合、この程度の低いレベルでフィルターにより除外すると良いかもしれません。", "indexPatternManagement.editIndexPattern.sourcePlaceholder": "フィールドフィルター、ワイルドカード使用可(例:「user*」と入力して「user」で始まるフィールドをフィルタリング)", "indexPatternManagement.editIndexPattern.tabs.fieldsHeader": "フィールド", "indexPatternManagement.editIndexPattern.tabs.relationshipsHeader": "関係({count})", @@ -6548,9 +6517,7 @@ "savedObjectsManagement.view.inspectCodeEditorAriaLabel": "{ title }の検査", "savedObjectsManagement.view.inspectItemTitle": "{title}の検査", "savedObjectsManagement.view.savedObjectProblemErrorMessage": "この保存されたオブジェクトに問題があります", - "savedObjectsManagement.view.savedSearchDoesNotExistErrorMessage": "このオブジェクトに関連付けられた保存された検索は現在存在しません。", "savedObjectsManagement.view.viewItemButtonLabel": "{title}を表示", - "savedSearch.contentManagementType": "保存検索", "savedSearch.kibana_context.filters.help": "Kibana ジェネリックフィルターを指定します", "savedSearch.kibana_context.help": "Kibana グローバルコンテキストを更新します", "savedSearch.kibana_context.q.help": "自由形式の Kibana テキストクエリーを指定します", @@ -7171,6 +7138,14 @@ "securitySolutionPackages.alertSuppressionRuleDetails.upsell": "アラート非表示が構成されていますが、ライセンス不足のため適用されません", "securitySolutionPackages.alertSuppressionRuleForm.upsell": "アラートの非表示は、{requiredLicense}ライセンス以上で有効です", "securitySolutionPackages.beta.label": "ベータ", + "securitySolutionPackages.csp.cspEvaluationBadge.failLabel": "失敗", + "securitySolutionPackages.csp.cspEvaluationBadge.naLabel": "N/A", + "securitySolutionPackages.csp.cspEvaluationBadge.passLabel": "合格", + "securitySolutionPackages.csp.findings.findingsErrorToast.searchFailedTitle": "検索失敗", + "securitySolutionPackages.csp.navigation.dashboardNavItemLabel": "クラウドセキュリティ態勢", + "securitySolutionPackages.csp.navigation.findingsNavItemLabel": "調査結果", + "securitySolutionPackages.csp.navigation.rulesNavItemLabel": "ルール", + "securitySolutionPackages.csp.navigation.vulnerabilityDashboardNavItemLabel": "Cloud Native Vulnerability Management", "securitySolutionPackages.dataTable.ariaLabel": "アラート", "securitySolutionPackages.dataTable.columnHeaders.flyout.pane.removeColumnButtonLabel": "列を削除", "securitySolutionPackages.dataTable.eventRenderedView.eventSummary.column": "イベント概要", @@ -7499,6 +7474,7 @@ "share.urlService.redirect.RedirectManager.missingParamLocator": "ロケーターIDが指定されていません。URLで「l」検索パラメーターを指定します。これは既存のロケーターIDにしてください。", "share.urlService.redirect.RedirectManager.missingParamParams": "ロケーターパラメーターが指定されていません。URLで「p」検索パラメーターを指定します。これはロケーターパラメーターのJSONシリアル化オブジェクトにしてください。", "share.urlService.redirect.RedirectManager.missingParamVersion": "ロケーターパラメーターバージョンが指定されていません。URLで「v」検索パラメーターを指定します。これはロケーターパラメーターが生成されたときのKibanaのリリースバージョンです。", + "sharedPlatformPackages.csp.common.utils.helpers.unknownError": "不明なエラー", "sharedUXPackages.buttonToolbar.buttons.addFromLibrary.libraryButtonLabel": "ライブラリから追加", "sharedUXPackages.buttonToolbar.toolbar.errorToolbarText": "120以上のボタンがあります。ボタンの数を制限することを検討してください。", "sharedUXPackages.card.noData.description": "Elasticエージェントを使用すると、シンプルで統一された方法でコンピューターからデータを収集するできます。", @@ -7950,8 +7926,6 @@ "unifiedDataTable.rowHeight.single": "単一", "unifiedDataTable.rowHeightLabel": "セル行高さ", "unifiedDataTable.sampleSizeSettings.sampleSizeLabel": "サンプルサイズ", - "unifiedDataTable.searchGenerationWithDescription": "検索{searchTitle}で生成されたテーブル", - "unifiedDataTable.searchGenerationWithDescriptionGrid": "検索{searchTitle}で生成されたテーブル({searchDescription})", "unifiedDataTable.selectAllDocs": "すべての{rowsCount}を選択", "unifiedDataTable.selectAllRowsOnPageColumnHeader": "すべての表示行を選択", "unifiedDataTable.selectColumnHeader": "列を選択", @@ -8522,11 +8496,6 @@ "visDefaultEditor.sidebar.errorButtonTooltip": "ハイライトされたフィールドのエラーを解決する必要があります。", "visDefaultEditor.sidebar.indexPatternAriaLabel": "インデックスパターン:{title}", "visDefaultEditor.sidebar.savedSearch.goToDiscoverButtonText": "Discover にこの検索を表示", - "visDefaultEditor.sidebar.savedSearch.linkButtonAriaLabel": "保存された検索へのリンク。クリックして詳細を確認するかリンクを解除します。", - "visDefaultEditor.sidebar.savedSearch.popoverHelpText": "保存したこの検索に今後加える修正は、ビジュアライゼーションに反映されます。自動更新を無効にするには、リンクを削除します。", - "visDefaultEditor.sidebar.savedSearch.popoverTitle": "保存された検索にリンクされています", - "visDefaultEditor.sidebar.savedSearch.titleAriaLabel": "保存された検索:{title}", - "visDefaultEditor.sidebar.savedSearch.unlinkSavedSearchButtonText": "保存された検索へのリンクを削除", "visDefaultEditor.sidebar.tabs.dataLabel": "データ", "visDefaultEditor.sidebar.tabs.optionsLabel": "オプション", "visDefaultEditor.sidebar.updateChartButtonLabel": "更新", @@ -9495,7 +9464,6 @@ "visualizations.editVisualization.readOnlyErrorMessage": "{visTypeTitle}ビジュアライゼーションは読み取り専用であり、エディターで開くことができません。", "visualizations.embeddable.errorTitle": "ビジュアライゼーションを読み込めません", "visualizations.embeddable.inspectorTitle": "インスペクター", - "visualizations.embeddable.legacyURLConflict.errorMessage": "このビジュアライゼーションにはレガシーエイリアスと同じURLがあります。このエラーを解決するには、エイリアスを無効にしてください:{json}", "visualizations.embeddable.placeholderTitle": "プレースホルダータイトル", "visualizations.embeddable.tsdbRollupWarning": "ビジュアライゼーションは、ロールアップされたデータによってサポートされていない関数を使用しています。別の関数を選択するか、時間範囲を選択してください。", "visualizations.experimentalVisInfoText": "将来のリリースでは、変更されるか、完全に削除される場合があります。Elasticはすべての問題の修正に努めますが、テクニカルプレビュー中の機能には正式なGA機能のサポートSLAが適用されません。フィードバックがある場合は、{githubLink}で問題を報告してください。", @@ -9517,7 +9485,6 @@ "visualizations.helpMenu.appName": "Visualizeライブラリ", "visualizations.legacyCharts.conditionalMessage.noPermissions": "古いライブラリに切り替えるには、システム管理者に連絡してください。", "visualizations.legacyUrlConflict.objectNoun": "{visName}ビジュアライゼーション", - "visualizations.linkedToSearch.unlinkSuccessNotificationText": "保存された検索''{searchTitle}''からリンクが解除されました", "visualizations.listing.betaTitle": "ベータ", "visualizations.listing.betaTooltip": "このビジュアライゼーションはベータ段階で、変更される可能性があります。デザインとコードはオフィシャルGA機能よりも完成度が低く、現状のまま保証なしで提供されています。ベータ機能にはオフィシャルGA機能のSLAが適用されません", "visualizations.listing.breadcrumb": "Visualizeライブラリ", @@ -9550,9 +9517,7 @@ "visualizations.newVisWizard.learnMoreText": "詳細について", "visualizations.newVisWizard.newVisTypeTitle": "新規 {visTypeName}", "visualizations.newVisWizard.resultsFound": "{resultCount, plural, other {個のタイプ}} が見つかりました", - "visualizations.newVisWizard.searchSelection.notFoundLabel": "一致インデックスまたは保存した検索が見つかりません。", "visualizations.newVisWizard.searchSelection.savedObjectType.dataView": "データビュー", - "visualizations.newVisWizard.searchSelection.savedObjectType.search": "保存検索", "visualizations.newVisWizard.title": "新規ビジュアライゼーション", "visualizations.noDataView.label": "データビュー", "visualizations.noMatchRoute.bannerText": "Visualizeアプリケーションはこのルートを認識できません。{route}", @@ -9564,9 +9529,7 @@ "visualizations.pageHeading": "{chartName} {chartType}ビジュアライゼーション", "visualizations.readOnlyLegacyVisMessage": "これらの詳細は編集できません。このビジュアライゼーションはサポートされていません。", "visualizations.reporting.defaultReportTitle": "ビジュアライゼーション[{date}]", - "visualizations.savedObjectName": "ビジュアライゼーション", "visualizations.saveDuplicateRejectedDescription": "重複ファイルの保存確認が拒否されました", - "visualizations.savingVisualizationFailed.errorMsg": "ビジュアライゼーションの保存が失敗しました", "visualizations.search.label": "検索", "visualizations.share.shareModal.title": "このビジュアライゼーションを共有", "visualizations.tonNavMenu.tryItBadgeText": "お試しください", @@ -9861,7 +9824,6 @@ "xpack.aiops.correlations.veryLowImpactText": "非常に低い", "xpack.aiops.dataGrid.field.documentCountChart.seriesLabel": "ドキュメントカウント", "xpack.aiops.dataGrid.field.documentCountChartSplit.seriesLabel": "他のドキュメントカウント", - "xpack.aiops.dataSourceContext.errorTitle": "データビューまたは保存された検索を取得できません", "xpack.aiops.dataViewNotBasedOnTimeSeriesWarning.title": "データビュー\"{dataViewTitle}\"は時系列に基づいていません。", "xpack.aiops.documentCountChart.baselineBadgeLabel": "ベースライン", "xpack.aiops.documentCountChart.deviationBadgeLabel": "偏差", @@ -12548,7 +12510,6 @@ "xpack.canvas.functions.savedMap.args.titleHelpText": "マップのタイトル", "xpack.canvas.functions.savedMap.args.zoomHelpText": "マップのズームレベル", "xpack.canvas.functions.savedMapHelpText": "保存されたマップオブジェクトの埋め込み可能なオブジェクトを返します。", - "xpack.canvas.functions.savedSearchHelpText": "保存検索オブジェクトの埋め込み可能なオブジェクトを返します", "xpack.canvas.functions.savedVisualization.args.colorsHelpText": "特定のシリーズに使用する色を指定します", "xpack.canvas.functions.savedVisualization.args.hideLegendHelpText": "凡例を非表示にするオプションを指定します", "xpack.canvas.functions.savedVisualization.args.idHelpText": "保存されたビジュアライゼーションオブジェクトのID", @@ -14511,7 +14472,6 @@ "xpack.csp.cnvmDashboardTable.section.topVulnerableResources.column.vulnerabilities": "脆弱性", "xpack.csp.cnvmDashboardTable.section.topVulnerableResources.column.vulnerabilityCount": "脆弱性", "xpack.csp.common.component.multiSelectFilter.searchWord": "検索", - "xpack.csp.common.utils.helpers.unknownError": "不明なエラー", "xpack.csp.compactFormattedNumber.naTitle": "N/A", "xpack.csp.complianceScoreBar.tooltipTitle": "{failed}が失敗し、{passed}が調査結果に合格しました", "xpack.csp.complianceScoreChart.counterButtonLink.failedFindingsTooltip": "失敗した調査結果", @@ -14526,9 +14486,6 @@ "xpack.csp.createPackagePolicy.customAssetsTab.rulesViewLabel": "CSPルールを表示", "xpack.csp.createPackagePolicy.customAssetsTab.vulnerabilityDashboardViewLabel": "CNVMダッシュボードを表示", "xpack.csp.createPackagePolicy.customAssetsTab.vulnerabilityFindingsViewLabel": "脆弱性の調査結果を表示", - "xpack.csp.cspEvaluationBadge.failLabel": "失敗", - "xpack.csp.cspEvaluationBadge.naLabel": "N/A", - "xpack.csp.cspEvaluationBadge.passLabel": "合格", "xpack.csp.cspIntegration.gcpCloudCredentials.cloudFormationSupportedMessage": "Launch Cloud ShellLaunch Cloud Formation for Automated Credentialsは、現在の統合バージョンではサポートされていません。Launch Cloud Shell for Automated Credentialsを有効化するには、最新バージョンにアップグレードしてください。", "xpack.csp.cspmIntegration.awsOption.benchmarkTitle": "CIS AWS", "xpack.csp.cspmIntegration.awsOption.nameTitle": "AWS", @@ -14611,7 +14568,6 @@ "xpack.csp.findings.distributionBar.totalPassedLabel": "合格した調査結果", "xpack.csp.findings.errorCallout.pageSearchErrorTitle": "検索結果の取得中にエラーが発生しました", "xpack.csp.findings.errorCallout.showErrorButtonLabel": "エラーメッセージを表示", - "xpack.csp.findings.findingsErrorToast.searchFailedTitle": "検索失敗", "xpack.csp.findings.findingsFlyout.calloutTitle": "一部のフィールドは{vendor}によって提供されていません", "xpack.csp.findings.findingsFlyout.flyoutDescriptionList.resourceId": "リソースID", "xpack.csp.findings.findingsFlyout.flyoutDescriptionList.resourceName": "リソース名", @@ -14780,11 +14736,6 @@ "xpack.csp.kspmIntegration.integration.shortNameTitle": "KSPM", "xpack.csp.kspmIntegration.vanillaOption.benchmarkTitle": "CIS Kubernetes", "xpack.csp.kspmIntegration.vanillaOption.nameTitle": "自己管理", - "xpack.csp.navigation.dashboardNavItemLabel": "クラウドセキュリティ態勢", - "xpack.csp.navigation.findingsNavItemLabel": "調査結果", - "xpack.csp.navigation.myBenchmarksNavItemLabel": "ベンチマーク", - "xpack.csp.navigation.rulesNavItemLabel": "ルール", - "xpack.csp.navigation.vulnerabilityDashboardNavItemLabel": "Cloud Native Vulnerability Management", "xpack.csp.noFindingsStates.indexing.indexingButtonTitle": "態勢評価中", "xpack.csp.noFindingsStates.indexing.indexingDescription": "データの収集とインデックス作成を待機しています。結果を表示するには、しばらくたってから確認してください", "xpack.csp.noFindingsStates.indexTimeout.indexTimeoutDescription": "調査結果の収集に想定よりも時間がかかっています。{docs}。", @@ -15443,7 +15394,6 @@ "xpack.dataVisualizer.index.lensChart.countLabel": "カウント", "xpack.dataVisualizer.index.lensChart.maximumOfLabel": "{fieldName}の最大", "xpack.dataVisualizer.index.lensChart.topValuesLabel": "トップの値", - "xpack.dataVisualizer.index.savedSearchErrorMessage": "保存された検索{savedSearchId}の取得エラー", "xpack.dataVisualizer.multiSelectPicker.NoFiltersFoundMessage": "フィルターが見つかりません", "xpack.dataVisualizer.nameCollisionMsg": "「{name}」はすでに存在します。一意の名前を入力してください。", "xpack.dataVisualizer.noData": "データなし", @@ -19637,7 +19587,6 @@ "xpack.features.ossFeatures.discoverSearchSessionsFeatureName": "検索セッションの保存", "xpack.features.ossFeatures.discoverShortUrlSubFeatureName": "短い URL", "xpack.features.ossFeatures.discoverStoreSearchSessionsPrivilegeName": "検索セッションの保存", - "xpack.features.ossFeatures.reporting.dashboardDownloadCSV": "保存された検索パネルからCSVレポートを生成", "xpack.features.ossFeatures.reporting.dashboardGenerateScreenshot": "PDFまたはPNGレポートを生成", "xpack.features.ossFeatures.reporting.discoverGenerateCSV": "CSVレポートを生成", "xpack.features.ossFeatures.reporting.reportingTitle": "レポート", @@ -20623,7 +20572,6 @@ "xpack.fleet.epm.assetTitles.mlModules": "異常検知構成", "xpack.fleet.epm.assetTitles.osqueryPackAssets": "Osqueryパック", "xpack.fleet.epm.assetTitles.osquerySavedQuery": "Osqueryの保存されたクエリー", - "xpack.fleet.epm.assetTitles.savedSearches": "保存された検索", "xpack.fleet.epm.assetTitles.securityRules": "セキュリティルール", "xpack.fleet.epm.assetTitles.tag": "タグ", "xpack.fleet.epm.assetTitles.transforms": "トランスフォーム", @@ -22247,8 +22195,6 @@ "xpack.idxMgmt.goToDiscover.discoverIndexButtonLabel": "Discoverインデックス", "xpack.idxMgmt.goToDiscover.showIndexToolTip": "Discoverで{indexName}を表示", "xpack.idxMgmt.home.appTitle": "インデックス管理", - "xpack.idxMgmt.home.componentTemplates.checkingPrivilegesDescription": "権限を確認中…", - "xpack.idxMgmt.home.componentTemplates.checkingPrivilegesErrorMessage": "サーバーからユーザー特権を取得中にエラーが発生。", "xpack.idxMgmt.home.componentTemplates.confirmButtonLabel": "{numComponentTemplatesToDelete, plural, other {個のコンポーネントテンプレート} }を削除", "xpack.idxMgmt.home.componentTemplates.deleteModal.cancelButtonLabel": "キャンセル", "xpack.idxMgmt.home.componentTemplates.deleteModal.deleteDescription": "{numComponentTemplatesToDelete, plural, one {このコンポーネントテンプレート} other {これらのコンポーネントテンプレート} }を削除しようとしています。", @@ -22257,8 +22203,6 @@ "xpack.idxMgmt.home.componentTemplates.deleteModal.multipleErrorsNotificationMessageText": "{count}個のコンポーネントテンプレートの削除エラー", "xpack.idxMgmt.home.componentTemplates.deleteModal.successDeleteMultipleNotificationMessageText": "{numSuccesses, plural, other {# 個のコンポーネントテンプレート}}を削除しました", "xpack.idxMgmt.home.componentTemplates.deleteModal.successDeleteSingleNotificationMessageText": "コンポーネントテンプレート''{componentTemplateName}''を削除しました", - "xpack.idxMgmt.home.componentTemplates.deniedPrivilegeDescription": "コンポーネントテンプレートを使用するには、{privilegesCount, plural, one {このクラスター特権} other {これらのクラスター特権}}が必要です:{missingPrivileges}。", - "xpack.idxMgmt.home.componentTemplates.deniedPrivilegeTitle": "クラスターの権限が必要です", "xpack.idxMgmt.home.componentTemplates.emptyPromptButtonLabel": "コンポーネントテンプレートを作成", "xpack.idxMgmt.home.componentTemplates.emptyPromptDescription": "たとえば、インデックステンプレート全体で再利用できるインデックス設定のコンポーネントテンプレートを作成できます。", "xpack.idxMgmt.home.componentTemplates.emptyPromptDocumentionLink": "詳細情報", @@ -24199,8 +24143,6 @@ "xpack.infra.logsPage.toolbar.logFilterErrorToastTitle": "ログフィルターエラー", "xpack.infra.logsSettingsPage.loadingButtonLabel": "読み込み中", "xpack.infra.logsStreamEmbeddable.deprecationWarningDescription": "ログストリームパネルは管理されていません。{savedSearchDocsLink}を同様の視覚化に活用してください。", - "xpack.infra.logsStreamEmbeddable.deprecationWarningDescription.savedSearchesLinkLabel": "保存された検索", - "xpack.infra.logStreamEmbeddable.description": "ライブストリーミングログのテーブルを追加します。体験を効率化するために、ログストリームを使用するのではなく、検出ページを使用して、保存された検索を作成することをお勧めします。", "xpack.infra.logStreamEmbeddable.displayName": "ログストリーム(廃止予定)", "xpack.infra.logStreamEmbeddable.title": "ログストリーム", "xpack.infra.logStreamPageTemplate.backtoLogsStream": "ログストリームに戻る", @@ -28977,15 +28919,10 @@ "xpack.ml.dataframe.analytics.create.resultsFieldHelpText": "分析の結果を格納するフィールドの名前を定義します。デフォルトはmlです。", "xpack.ml.dataframe.analytics.create.resultsFieldInputAriaLabel": "分析の結果を格納するフィールドの名前。", "xpack.ml.dataframe.analytics.create.resultsFieldLabel": "結果フィールド", - "xpack.ml.dataframe.analytics.create.savedSearchLabel": "保存検索", "xpack.ml.dataframe.analytics.create.scatterplotMatrixLabel": "散布図マトリックス", "xpack.ml.dataframe.analytics.create.scatterplotMatrixLabelHelpText": "選択した分析対象フィールドのペアの間の関係を可視化します。", - "xpack.ml.dataFrame.analytics.create.searchSelection.CcsErrorCallOutBody": "保存された検索''{savedSearchTitle}''はデータビュー''{dataViewName}''を使用しています。", "xpack.ml.dataFrame.analytics.create.searchSelection.CcsErrorCallOutTitle": "クラスター横断検索を使用するデータビューはサポートされていません。", - "xpack.ml.dataFrame.analytics.create.searchSelection.errorGettingDataViewTitle": "保存された検索で使用されているデータビューの読み込みエラー", - "xpack.ml.dataFrame.analytics.create.searchSelection.notFoundLabel": "一致インデックスまたは保存した検索が見つかりません。", "xpack.ml.dataFrame.analytics.create.searchSelection.savedObjectType.dataView": "データビュー", - "xpack.ml.dataFrame.analytics.create.searchSelection.savedObjectType.search": "保存検索", "xpack.ml.dataframe.analytics.create.softTreeDepthLimitInputAriaLabel": "この深さを超える決定木は、損失計算でペナルティがあります。", "xpack.ml.dataframe.analytics.create.softTreeDepthLimitLabel": "ソフトツリー深さ上限値", "xpack.ml.dataframe.analytics.create.softTreeDepthLimitText": "この深さを超える決定木は、損失計算でペナルティがあります。0以上でなければなりません。", @@ -29277,7 +29214,6 @@ "xpack.ml.dataGridChart.notEnoughData": "0個のドキュメントにフィールドが含まれます。", "xpack.ml.dataGridChart.singleCategoryLegend": "{cardinality, plural, other {# カテゴリ}}", "xpack.ml.dataGridChart.topCategoriesLegend": "上位 {maxChartColumns}/{cardinality} カテゴリ", - "xpack.ml.dataSourceContext.errorTitle": "データビューまたは保存された検索を取得できません", "xpack.ml.dataViewNotBasedOnTimeSeriesNotificationDescription": "異常検知は時間ベースのインデックスでのみ実行されます", "xpack.ml.dataViewNotBasedOnTimeSeriesNotificationTitle": "データビュー{dataViewIndexPattern}は時系列に基づいていません。", "xpack.ml.dataViewUtils.createDataViewSwitchLabel": "データビューを作成", @@ -29521,7 +29457,6 @@ "xpack.ml.feature.reserved.description": "ユーザーアクセスを許可するには、machine_learning_user か machine_learning_admin ロールのどちらかを割り当てる必要があります。", "xpack.ml.featureFeedbackButton.tellUsWhatYouThinkLink": "ご意見をお聞かせください。", "xpack.ml.featureRegistry.mlFeatureName": "機械学習", - "xpack.ml.featureRegistry.privilegesTooltip": "機械学習にすべてまたは読み取り機能権限を付与すると、特定のタイプのKibanaで保存されたオブジェクト(インデックスパターン、ダッシュボード、保存された検索、ビジュアライゼーション、機械学習ジョブ、学習済みモデル、モジュールで保存されたオブジェクト)にも同等の機能権限が付与されます。", "xpack.ml.fieldTypeIcon.booleanTypeAriaLabel": "ブールタイプ", "xpack.ml.fieldTypeIcon.dateTypeAriaLabel": "日付タイプ", "xpack.ml.fieldTypeIcon.geoPointTypeAriaLabel": "{geoPointParam} タイプ", @@ -30324,7 +30259,6 @@ "xpack.ml.newJob.recognize.running.startedAriaLabel": "開始", "xpack.ml.newJob.recognize.running.startFailedAriaLabel": "開始に失敗", "xpack.ml.newJob.recognize.runningLabel": "実行中", - "xpack.ml.newJob.recognize.savedSearchPageTitle": "saved search {savedSearchTitle}", "xpack.ml.newJob.recognize.saveJobOverrideLabel": "保存", "xpack.ml.newJob.recognize.searchesLabel": "検索", "xpack.ml.newJob.recognize.searchWillBeOverwrittenLabel": "検索は上書きされます", @@ -30333,7 +30267,6 @@ "xpack.ml.newJob.recognize.startDatafeedAfterSaveLabel": "保存後データフィードを開始", "xpack.ml.newJob.recognize.useDedicatedIndexLabel": "専用インデックスを使用", "xpack.ml.newJob.recognize.useFullDataLabel": "完全な{dataViewIndexPattern}データを使用", - "xpack.ml.newJob.recognize.usingSavedSearchDescription": "保存検索を使用すると、データフィードで使用されるクエリーが、{moduleId} モジュールでデフォルトで提供されるものと異なるものになります。", "xpack.ml.newJob.recognize.viewResultsAriaLabel": "結果を表示", "xpack.ml.newJob.recognize.viewResultsLinkText": "結果を表示", "xpack.ml.newJob.recognize.visualizationsLabel": "ビジュアライゼーション", @@ -30353,7 +30286,6 @@ "xpack.ml.newJob.wizard.datafeedStep.dataView.description": "現在このジョブで使用されているデータビュー。", "xpack.ml.newJob.wizard.datafeedStep.dataView.step0.title": "データビューを変更", "xpack.ml.newJob.wizard.datafeedStep.dataView.step1.dataView": "データビュー", - "xpack.ml.newJob.wizard.datafeedStep.dataView.step1.noMatchingError": "一致インデックスまたは保存した検索が見つかりません。", "xpack.ml.newJob.wizard.datafeedStep.dataView.step1.title": "ジョブの新しいデータビューを選択", "xpack.ml.newJob.wizard.datafeedStep.dataView.step2.ApplyButton": "適用", "xpack.ml.newJob.wizard.datafeedStep.dataView.step2.backButton": "戻る", @@ -30463,8 +30395,6 @@ "xpack.ml.newJob.wizard.jobType.rareAriaLabel": "まれなジョブ", "xpack.ml.newJob.wizard.jobType.rareDescription": "時系列データでまれな値を検出します。", "xpack.ml.newJob.wizard.jobType.rareTitle": "ほとんどない", - "xpack.ml.newJob.wizard.jobType.savedSearchPageTitleLabel": "saved search {savedSearchTitle}", - "xpack.ml.newJob.wizard.jobType.selectDifferentIndexLinkText": "別のデータビューまたは保存された検索を選択", "xpack.ml.newJob.wizard.jobType.singleMetricAriaLabel": "シングルメトリックジョブ", "xpack.ml.newJob.wizard.jobType.singleMetricDescription": "単独の時系列の異常を検知します。", "xpack.ml.newJob.wizard.jobType.singleMetricTitle": "シングルメトリック", @@ -30474,7 +30404,6 @@ "xpack.ml.newJob.wizard.jsonFlyout.autoSetJobCreatorTimeRange.error": "インデックスの開始時刻と終了時刻の取得中にエラーが発生しました", "xpack.ml.newJob.wizard.jsonFlyout.closeButton": "閉じる", "xpack.ml.newJob.wizard.jsonFlyout.datafeed.title": "データフィード構成 JSON", - "xpack.ml.newJob.wizard.jsonFlyout.indicesChange.calloutText": "データフィードで使用されているインデックスはここで変更できません。別のデータビューまたは保存された検索を選択するには、ウィザードのステップ1に進み、[インデックスパターンを変更]オプションを選択します。", "xpack.ml.newJob.wizard.jsonFlyout.indicesChange.calloutTitle": "インデックスが変更されました", "xpack.ml.newJob.wizard.jsonFlyout.job.title": "ジョブ構成 JSON", "xpack.ml.newJob.wizard.jsonFlyout.saveButton": "保存", @@ -30606,10 +30535,7 @@ "xpack.ml.newJob.wizard.revertModelSnapshotFlyout.title": "モデルスナップショット{ssId}に戻す", "xpack.ml.newJob.wizard.revertModelSnapshotFlyout.warningCallout.contents": "{date}後のすべての異常検知結果は削除されます。", "xpack.ml.newJob.wizard.revertModelSnapshotFlyout.warningCallout.title": "異常値データが削除されます", - "xpack.ml.newJob.wizard.searchSelection.notFoundLabel": "一致データビューまたは保存された検索が見つかりません。", "xpack.ml.newJob.wizard.searchSelection.savedObjectType.dataView": "データビュー", - "xpack.ml.newJob.wizard.searchSelection.savedObjectType.search": "保存検索", - "xpack.ml.newJob.wizard.selectDataViewOrSavedSearch": "データビューまたは保存された検索を選択", "xpack.ml.newJob.wizard.shopValidationButton": "検証をスキップ", "xpack.ml.newJob.wizard.step.configureDatafeedTitle": "データフィードの構成", "xpack.ml.newJob.wizard.step.jobDetailsTitle": "ジョブの詳細", @@ -30621,7 +30547,6 @@ "xpack.ml.newJob.wizard.stepComponentWrapper.jobDetailsTitle": "ジョブの詳細", "xpack.ml.newJob.wizard.stepComponentWrapper.pickFieldsTitle": "フィールドを選択", "xpack.ml.newJob.wizard.stepComponentWrapper.summaryTitleDataView": "データビュー{dataViewName}の新しいジョブ", - "xpack.ml.newJob.wizard.stepComponentWrapper.summaryTitleSavedSearch": "保存された検索 {title} からの新規ジョブ", "xpack.ml.newJob.wizard.stepComponentWrapper.timeRangeTitle": "時間範囲", "xpack.ml.newJob.wizard.stepComponentWrapper.validationTitle": "検証", "xpack.ml.newJob.wizard.summaryStep.convertToAdvancedButton": "高度なジョブに変換", @@ -37454,7 +37379,6 @@ "xpack.securitySolution.detectionEngine.body.summary.message": "ルール{ruleName}は{signalsCount}件のアラートを生成しました", "xpack.securitySolution.detectionEngine.buttonManageRules": "ルールの管理", "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkActionConfirmationCloseButtonLabel": "閉じる", - "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditConfirmation.confirmButtonLabel": "{customRulesCount, plural, other {# 個のカスタムルール}}を編集", "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditConfirmationCancelButtonLabel": "キャンセル", "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addIndexPatternsComboboxHelpText": "追加するElasticsearchインデックスのパターンを入力します。デフォルトでは、ドロップダウンには、セキュリティソリューション詳細設定で定義されたインデックスパターンが含まれます。", "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addIndexPatternsComboboxLabel": "選択したルールのインデックスパターンを追加", @@ -37488,8 +37412,6 @@ "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.setInvestigationFieldsWarningCallout": "選択した{rulesCount, plural, other {#個のルール}}のカスタムハイライトされたフィールドを上書きしようとしています。変更を適用して、保存するには、[保存]をクリックします。", "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.setTagsWarningCallout": "{rulesCount, plural, other {# 個の選択したルール}}のタグを上書きしようとしています。[保存]をクリックすると、変更が適用されます。\n", "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.tagsComoboxRequiredErrorMessage": "1つ以上のタグが必要です。", - "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkExportConfirmation.confirmButtonLabel": "{customRulesCount, plural, other {# 個のカスタムルール}}をエクスポート", - "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkManualRuleRunConfirmation.confirmButtonLabel": "{customRulesCount, plural, other {# 個のカスタムルール}}をスケジュール", "xpack.securitySolution.detectionEngine.components.allRules.bulkDeleteConfirmationTitle": "一括削除の確認", "xpack.securitySolution.detectionEngine.components.allRules.deleteConfirmationCancel": "キャンセル", "xpack.securitySolution.detectionEngine.components.allRules.deleteConfirmationConfirm": "削除", @@ -37638,7 +37560,6 @@ "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.multiSelectFields.placeholderText": "フィールドを選択", "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.newTermsField.placeholderText": "フィールドを選択", "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.newTermsFieldsLabel": "フィールド", - "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.newTermsFieldsMin": "1つ以上のフィールドが必要です。", "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.referencesUrlInvalidError": "URLの形式が無効です", "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.resetDefaultIndicesButton": "デフォルトインデックスパターンにリセット", "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.rulePreviewTitle": "ルールプレビュー", @@ -38710,7 +38631,6 @@ "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.addRuleActionsTitle": "ルールアクションを追加", "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.addTagsTitle": "タグを追加", "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.applyTimelineTemplateTitle": "タイムラインテンプレートを適用", - "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkActionConfirmationPartlyTitle": "このアクションは、{customRulesCount, plural, other {#個のカスタムルール}}にのみ適用できます", "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkEditConfirmationDeniedTitle": "{rulesCount, plural, other {# 個のルール}}を編集できません", "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkEditWarningToastDescription": "{rulesCount, plural, other {#個のルール}}を更新しています。", "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkEditWarningToastNotifyButtonLabel": "完了時に通知", @@ -38943,7 +38863,6 @@ "xpack.securitySolution.detectionEngine.userUnauthenticatedMsgBody": "検出エンジンを表示するための必要なアクセス権がありません。ヘルプについては、管理者にお問い合わせください。", "xpack.securitySolution.detectionEngine.userUnauthenticatedTitle": "検出エンジンアクセス権が必要です", "xpack.securitySolution.detectionEngine.validations.stepDefineRule.historyWindowSize.errMin": "履歴ウィンドウサイズは0よりも大きい値でなければなりません。", - "xpack.securitySolution.detectionEngine.validations.stepDefineRule.newTermsFieldsMax": "フィールド数は3以下でなければなりません。", "xpack.securitySolution.detectionEngine.validations.thresholdCardinalityFieldFieldData.thresholdCardinalityFieldNotSuppliedMessage": "カーディナリティフィールドは必須です。", "xpack.securitySolution.detectionEngine.validations.thresholdCardinalityValueFieldData.numberGreaterThanOrEqualOneErrorMessage": "値は 1 以上でなければなりません。", "xpack.securitySolution.detectionEngine.validations.thresholdFieldFieldData.arrayLengthGreaterThanMaxErrorMessage": "フィールド数は3以下でなければなりません。", @@ -42245,7 +42164,6 @@ "xpack.securitySolution.timelines.components.templateFilter.elasticTitle": "Elasticテンプレート", "xpack.securitySolution.timelines.discoverInTimeline.save_saved_search_error": "Discover検索の保存エラー", "xpack.securitySolution.timelines.discoverInTimeline.save_saved_search_unknown_error": "Discover検索の保存中に不明なエラーが発生しました", - "xpack.securitySolution.timelines.discoverInTimeline.savedSearchTitle": "タイムラインの保存された検索 - {title}", "xpack.securitySolution.timelines.newTemplateTimelineButtonLabel": "新規タイムラインテンプレートを作成", "xpack.securitySolution.timelines.newTimelineButtonLabel": "新規タイムラインを作成", "xpack.securitySolution.timelines.pageTitle": "タイムライン", @@ -42659,7 +42577,7 @@ "xpack.serverlessSearch.languages.php": "PHP", "xpack.serverlessSearch.languages.php.githubLink": "elasticsearch-serverless-php", "xpack.serverlessSearch.languages.python": "Python", - "xpack.serverlessSearch.languages.python.githubLabel": "elasticsearch-serverless-python", + "xpack.serverlessSearch.languages.python.githubLabel": "elasticsearch-py", "xpack.serverlessSearch.languages.ruby": "Ruby", "xpack.serverlessSearch.languages.ruby.githubLabel": "elasticsearch-serverless-ruby", "xpack.serverlessSearch.learnMore": "詳細", @@ -44239,7 +44157,6 @@ "xpack.spaces.management.copyToSpace.copyModeControl.createNewCopies.disabledTitle": "既存のオブジェクトを確認", "xpack.spaces.management.copyToSpace.copyModeControl.createNewCopies.enabledText": "このオプションを使用すると、同じ場所でオブジェクトの1つ以上のコピーを作成します。", "xpack.spaces.management.copyToSpace.copyModeControl.createNewCopies.enabledTitle": "ランダムIDで新しいオブジェクトを作成", - "xpack.spaces.management.copyToSpace.copyModeControl.includeRelated.text": "このオブジェクトと関連するオブジェクトをコピーします。ダッシュボードでは、関連するビジュアライゼーション、インデックスパターン、および保存された検索もコピーされます。", "xpack.spaces.management.copyToSpace.copyModeControl.includeRelated.title": "関連オブジェクトを含める", "xpack.spaces.management.copyToSpace.copyModeControl.overwrite.disabledLabel": "競合時にアクションを要求", "xpack.spaces.management.copyToSpace.copyModeControl.overwrite.enabledLabel": "自動的に競合を上書き", @@ -47011,15 +46928,12 @@ "xpack.transform.newTransform.chooseSourceTitle": "ソースの選択", "xpack.transform.newTransform.newTransformTitle": "新規トランスフォーム", "xpack.transform.newTransform.searchSelection.createADataView": "データビューを作成", - "xpack.transform.newTransform.searchSelection.notFoundLabel": "一致インデックスまたは保存した検索が見つかりません。", "xpack.transform.newTransform.searchSelection.savedObjectType.dataView": "データビュー", - "xpack.transform.newTransform.searchSelection.savedObjectType.search": "保存検索", "xpack.transform.pivotPreview.copyClipboardTooltip": "トランスフォームプレビューの開発コンソールステートメントをクリップボードにコピーします。", "xpack.transform.pivotPreview.PivotPreviewIncompleteConfigCalloutBody": "group-by フィールドと集約を 1 つ以上選んでください。", "xpack.transform.pivotPreview.PivotPreviewNoDataCalloutBody": "プレビューリクエストはデータを返しませんでした。オプションのクエリがデータを返し、グループ分け基準により使用されるフィールドと集約フィールドに値が存在することを確認してください。", "xpack.transform.pivotPreview.transformPreviewTitle": "トランスフォームプレビュー", "xpack.transform.progress": "進捗", - "xpack.transform.searchItems.errorInitializationTitle": "Kibanaデータビューまたは保存された検索を初期化するときにエラーが発生しました。", "xpack.transform.statsBar.batchTransformsLabel": "バッチ", "xpack.transform.statsBar.continuousTransformsLabel": "実行中", "xpack.transform.statsBar.failedTransformsLabel": "失敗", @@ -47100,7 +47014,6 @@ "xpack.transform.stepDefineForm.runtimeEditorSwitchModalTitle": "編集内容は失われます", "xpack.transform.stepDefineForm.runtimeFieldsLabel": "ランタイムフィールド", "xpack.transform.stepDefineForm.runtimeFieldsListLabel": "{runtimeFields}", - "xpack.transform.stepDefineForm.savedSearchLabel": "保存検索", "xpack.transform.stepDefineForm.searchFilterLabel": "検索フィルター", "xpack.transform.stepDefineForm.sortFieldOptionsEmptyError": "並べ替えの条件にする日付フィールドがありません。別のフィールド型を使用するには、構成をクリップボードにコピーして、コンソールでトランスフォームを作成し続けます。", "xpack.transform.stepDefineForm.sortHelpText": "最新のドキュメントを特定するために使用する日付フィールドを選択してます。", @@ -47113,7 +47026,6 @@ "xpack.transform.stepDefineSummary.groupByLabel": "グループ分けの条件", "xpack.transform.stepDefineSummary.queryCodeBlockLabel": "クエリー", "xpack.transform.stepDefineSummary.queryLabel": "クエリー", - "xpack.transform.stepDefineSummary.savedSearchLabel": "保存検索", "xpack.transform.stepDefineSummary.timeRangeLabel": "時間範囲", "xpack.transform.stepDetailsForm.advancedSettingsAccordionButtonContent": "高度な設定", "xpack.transform.stepDetailsForm.continuousModeAriaLabel": "遅延を選択してください。", diff --git a/x-pack/platform/plugins/private/translations/translations/zh-CN.json b/x-pack/platform/plugins/private/translations/translations/zh-CN.json index 285f889c557b2..1de6205358242 100644 --- a/x-pack/platform/plugins/private/translations/translations/zh-CN.json +++ b/x-pack/platform/plugins/private/translations/translations/zh-CN.json @@ -1467,7 +1467,6 @@ "dashboard.emptyScreen.noPermissionsTitle": "此仪表板是空的。", "dashboard.emptyScreen.viewModeSubtitle": "进入编辑模式,然后开始添加可视化。", "dashboard.emptyScreen.viewModeTitle": "将可视化添加到仪表板", - "dashboard.featureCatalogue.dashboardDescription": "显示和共享可视化和已保存搜索的集合。", "dashboard.featureCatalogue.dashboardSubtitle": "在仪表板中分析数据。", "dashboard.featureCatalogue.dashboardTitle": "仪表板", "dashboard.labs.enableLabsDescription": "此标志决定查看者是否有权访问用于在仪表板中快速启用和禁用技术预览功能的'实验'按钮。", @@ -1593,7 +1592,6 @@ "data.advancedSettings.courier.requestPreferenceTitle": "请求首选项", "data.advancedSettings.defaultIndexText": "未设置数据视图时,供 Discover 和可视化使用。", "data.advancedSettings.defaultIndexTitle": "默认数据视图", - "data.advancedSettings.docTableHighlightText": "在 Discover 和已保存搜索仪表板中突出显示结果。处理大文档时,突出显示会使请求变慢。", "data.advancedSettings.docTableHighlightTitle": "突出显示结果", "data.advancedSettings.histogram.barTargetText": "在日期和数值直方图中使用'auto'时间间隔时尝试生成大约此数目的存储桶", "data.advancedSettings.histogram.barTargetTitle": "目标存储桶", @@ -2501,7 +2499,6 @@ "discover.advancedSettings.discover.showFieldStatisticsDescription": "启用 {fieldStatisticsDocs} 以显示详细信息,如数字字段的最小和最大值,或地理字段的地图。此功能为公测版,可能会进行更改。", "discover.advancedSettings.discover.showMultifields": "显示多字段", "discover.advancedSettings.discover.showMultifieldsDescription": "控制 {multiFields} 是否显示在展开的文档视图中。多数情况下,多字段与原始字段相同。此选项仅在 `searchFieldsFromSource` 关闭时可用。", - "discover.advancedSettings.docTableHideTimeColumnText": "在 Discover 中和仪表板上的所有已保存搜索中隐藏'时间'列。", "discover.advancedSettings.docTableHideTimeColumnTitle": "隐藏'时间'列", "discover.advancedSettings.fieldsPopularLimitText": "要显示的排名前 N 最常见字段", "discover.advancedSettings.fieldsPopularLimitTitle": "常见字段限制", @@ -2513,7 +2510,6 @@ "discover.advancedSettings.sampleRowsPerPageTitle": "每页行数", "discover.advancedSettings.sampleSizeText": "设置整个文档表的最大行数。", "discover.advancedSettings.sampleSizeTitle": "每个表的最大行数", - "discover.advancedSettings.searchOnPageLoadText": "控制在 Discover 首次加载时是否执行搜索。加载已保存搜索时,此设置无效。", "discover.advancedSettings.searchOnPageLoadTitle": "在页面加载时搜索", "discover.advancedSettings.sortDefaultOrderText": "在 Discover 应用中控制基于时间的数据视图的默认排序方向。", "discover.advancedSettings.sortDefaultOrderTitle": "默认排序方向", @@ -2523,7 +2519,6 @@ "discover.alerts.manageRulesAndConnectors": "管理规则和连接器", "discover.alerts.missedTimeFieldToolTip": "数据视图没有时间字段。", "discover.badge.readOnly.text": "只读", - "discover.badge.readOnly.tooltip": "无法保存搜索", "discover.context.breadcrumb": "周围文档", "discover.context.contextOfTitle": "#{anchorId} 周围的文档", "discover.context.failedToLoadAnchorDocumentDescription": "无法加载定位点文档", @@ -2571,7 +2566,6 @@ "discover.dropZoneTableLabel": "放置区域以将字段作为列添加到表中", "discover.embeddable.inspectorRequestDescription": "此请求将查询 Elasticsearch 以获取搜索的数据。", "discover.embeddable.search.dataViewError": "缺少数据视图 {indexPatternId}", - "discover.embeddable.search.displayName": "搜索", "discover.errorCalloutESQLReferenceButtonLabel": "打开 ES|QL 参考", "discover.errorCalloutShowErrorMessage": "查看详情", "discover.esqlMode.selectedColumnsCallout": "正在显示 {selectedColumnsNumber} 个字段,共 {esqlQueryColumnsNumber} 个。从可用字段列表中添加更多字段。", @@ -2580,7 +2574,6 @@ "discover.esqlToDataViewTransitionModal.feedbackLink": "提交 ES|QL 反馈", "discover.esqlToDataViewTransitionModal.saveButtonLabel": "保存并切换", "discover.esqlToDataViewTransitionModal.title": "未保存的更改", - "discover.esqlToDataviewTransitionModalBody": "切换数据视图会移除当前的 ES|QL 查询。保存此搜索以避免丢失工作。", "discover.fieldChooser.availableFieldsTooltip": "适用于在表中显示的字段。", "discover.fieldChooser.discoverField.addFieldTooltip": "将字段添加为列", "discover.fieldChooser.discoverField.removeFieldTooltip": "从表中移除字段", @@ -2608,19 +2601,10 @@ "discover.loadingDocuments": "正在加载文档", "discover.localMenu.alertsDescription": "告警", "discover.localMenu.esqlTooltipLabel": "ES|QL 是 Elastic 支持的功能强大的全新管道查询语言。", - "discover.localMenu.fallbackReportTitle": "未命名 Discover 搜索", "discover.localMenu.inspectTitle": "检查", "discover.localMenu.localMenu.alertsTitle": "告警", - "discover.localMenu.localMenu.newSearchTitle": "新建", - "discover.localMenu.mustCopyOnSave": "Elastic 将管理此已保存搜索。将任何更改保存到新的已保存搜索。", - "discover.localMenu.newSearchDescription": "新搜索", "discover.localMenu.openInspectorForSearchDescription": "打开 Inspector 以进行搜索", - "discover.localMenu.openSavedSearchDescription": "打开已保存搜索", - "discover.localMenu.openTitle": "打开", - "discover.localMenu.saveSaveSearchObjectType": "搜索", - "discover.localMenu.saveSearchDescription": "保存搜索", "discover.localMenu.saveTitle": "保存", - "discover.localMenu.shareSearchDescription": "共享搜索", "discover.localMenu.shareTitle": "共享", "discover.localMenu.switchToClassicTitle": "切换到经典模式", "discover.localMenu.switchToClassicTooltipLabel": "切换到 KQL 或 Lucene 语法。", @@ -2693,22 +2677,13 @@ "discover.panelsToggle.showSidebarButton": "显示侧边栏", "discover.rootBreadcrumb": "Discover", "discover.sampleData.viewLinkLabel": "Discover", - "discover.savedSearch.savedObjectName": "已保存搜索", - "discover.savedSearchAliasMatchRedirect.objectNoun": "{savedSearch} 搜索", "discover.savedSearchEmbeddable.action.viewSavedSearch.displayName": "在 Discover 中打开", - "discover.savedSearchURLConflictCallout.objectNoun": "{savedSearch} 搜索", "discover.searchingTitle": "正在搜索", "discover.serverLocatorExtension.titleFromLocatorUnknown": "未知搜索", - "discover.share.shareModal.title": "共享此搜索", "discover.singleDocRoute.errorMessage": "没有与 ID {dataViewId} 相匹配的数据视图", "discover.singleDocRoute.errorTitle": "发生错误", "discover.skipToBottomButtonLabel": "转到表尾", - "discover.topNav.managedContentLabel": "此已保存搜索由 Elastic 托管。此处的更改必须保存到新的已保存搜索。", - "discover.topNav.openSearchPanel.manageSearchesButtonLabel": "管理搜索", - "discover.topNav.openSearchPanel.noSearchesFoundDescription": "未找到匹配的搜索。", - "discover.topNav.openSearchPanel.openSearchTitle": "打开搜索", "discover.topNav.saveModal.storeTimeWithSearchToggleDescription": "在使用此搜索时更新时间筛选并将时间间隔刷新到当前选择。", - "discover.topNav.saveModal.storeTimeWithSearchToggleLabel": "将时间与已保存搜索一起存储", "discover.uninitializedRefreshButtonText": "刷新数据", "discover.uninitializedText": "编写查询,添加一些筛选,或只需单击'刷新'来检索当前查询的结果。", "discover.uninitializedTitle": "开始搜索", @@ -2784,13 +2759,11 @@ "embeddableApi.common.constants.grouping.annotations": "标注和导航", "embeddableApi.common.constants.grouping.legacy": "旧版", "embeddableApi.common.constants.grouping.other": "其他", - "embeddableApi.compatibility.defaultTypeDisplayName": "图表", "embeddableApi.contextMenuTrigger.description": "会将一个新操作添加到该面板的上下文菜单", "embeddableApi.contextMenuTrigger.title": "上下文菜单", "embeddableApi.errors.embeddableFactoryNotFound": "{type} 无法加载。请升级到具有适当许可的默认 Elasticsearch 和 Kibana 分发。", "embeddableApi.errors.paneldoesNotExist": "未找到面板", "embeddableApi.errors.panelIncompatibleError": "面板 API 不兼容", - "embeddableApi.helloworld.displayName": "hello world", "embeddableApi.multiValueClickTrigger.description": "在可视化上选择多个单一维度的值", "embeddableApi.multiValueClickTrigger.title": "多次单击", "embeddableApi.panelBadgeTrigger.description": "可嵌入对象在面板加载后,操作便显示在标题栏中。", @@ -2830,7 +2803,6 @@ "embeddableExamples.unifiedFieldList.displayName": "字段列表", "embeddableExamples.unifiedFieldList.noDefaultDataViewErrorMessage": "字段列表必须至少与一个存在的数据视图搭配使用", "embeddableExamples.unifiedFieldList.selectDataViewMessage": "请选择数据视图", - "esql.advancedSettings.enableESQLDescription": "此设置将在 Kibana 中启用 ES|QL。通过将其关闭,您将从各种应用程序中隐藏 ES|QL 用户界面。但是,用户将能够访问现有 ES|QL 已保存的搜索及可视化等。", "esql.advancedSettings.enableESQLTitle": "启用 ES|QL", "esql.triggers.updateEsqlQueryTrigger": "更新 ES|QL 查询", "esql.triggers.updateEsqlQueryTriggerDescription": "使用新查询更新 ES|QL 查询", @@ -5034,7 +5006,6 @@ "indexPatternManagement.editIndexPattern.source.table.matchesHeader": "匹配", "indexPatternManagement.editIndexPattern.source.table.notMatchedLabel": "源筛选不匹配任何已知字段。", "indexPatternManagement.editIndexPattern.source.table.saveAria": "保存", - "indexPatternManagement.editIndexPattern.sourceLabel": "字段筛选可用于在提取文档时排除一个或多个字段。在 Discover 应用中查看文档时会使用字段筛选,表在 Dashboard 应用中显示已保存搜索的结果时也会使用字段筛选。如果您的文档含有较大或不重要的字段,则通过在此较低层级筛除这些字段可能会更好。", "indexPatternManagement.editIndexPattern.sourcePlaceholder": "字段筛选,接受通配符(例如'user*'用于筛选以'user'开头的字段)", "indexPatternManagement.editIndexPattern.tabs.fieldsHeader": "字段", "indexPatternManagement.editIndexPattern.tabs.relationshipsHeader": "关系 ({count})", @@ -6494,8 +6465,6 @@ "savedObjectsManagement.view.inspectCodeEditorAriaLabel": "检查 { title }", "savedObjectsManagement.view.inspectItemTitle": "检查 {title}", "savedObjectsManagement.view.savedObjectProblemErrorMessage": "此已保存对象有问题", - "savedObjectsManagement.view.savedSearchDoesNotExistErrorMessage": "与此对象关联的已保存搜索已不存在。", - "savedSearch.contentManagementType": "已保存搜索", "savedSearch.kibana_context.filters.help": "指定 Kibana 常规筛选", "savedSearch.kibana_context.help": "更新 kibana 全局上下文", "savedSearch.kibana_context.q.help": "指定 Kibana 自由格式文本查询", @@ -7053,6 +7022,14 @@ "securitySolutionPackages.alertSuppressionRuleDetails.upsell": "已配置告警阻止,但由于许可不足而无法应用", "securitySolutionPackages.alertSuppressionRuleForm.upsell": "告警阻止通过{requiredLicense}或更高级许可证启用", "securitySolutionPackages.beta.label": "公测版", + "securitySolutionPackages.csp.cspEvaluationBadge.failLabel": "失败", + "securitySolutionPackages.csp.cspEvaluationBadge.naLabel": "不可用", + "securitySolutionPackages.csp.cspEvaluationBadge.passLabel": "通过", + "securitySolutionPackages.csp.findings.findingsErrorToast.searchFailedTitle": "搜索失败", + "securitySolutionPackages.csp.navigation.dashboardNavItemLabel": "云安全态势", + "securitySolutionPackages.csp.navigation.findingsNavItemLabel": "结果", + "securitySolutionPackages.csp.navigation.rulesNavItemLabel": "规则", + "securitySolutionPackages.csp.navigation.vulnerabilityDashboardNavItemLabel": "云原生漏洞管理", "securitySolutionPackages.dataTable.ariaLabel": "告警", "securitySolutionPackages.dataTable.columnHeaders.flyout.pane.removeColumnButtonLabel": "移除列", "securitySolutionPackages.dataTable.eventRenderedView.eventSummary.column": "事件摘要", @@ -7382,6 +7359,7 @@ "share.urlService.redirect.RedirectManager.missingParamLocator": "未指定定位器 ID。在 URL 中指定'l'搜索参数,其应为现有定位器 ID。", "share.urlService.redirect.RedirectManager.missingParamParams": "定位器参数未指定。在 URL 中指定'p'搜索参数,其应为定位器参数的 JSON 序列化对象。", "share.urlService.redirect.RedirectManager.missingParamVersion": "定位器参数版本未指定。在 URL 中指定'v'搜索参数,其应为生成定位器参数时 Kibana 的版本。", + "sharedPlatformPackages.csp.common.utils.helpers.unknownError": "未知错误", "sharedUXPackages.buttonToolbar.buttons.addFromLibrary.libraryButtonLabel": "从库中添加", "sharedUXPackages.buttonToolbar.toolbar.errorToolbarText": "有 120 多个附加按钮。请考虑限制按钮数量。", "sharedUXPackages.card.noData.description": "使用 Elastic 代理以简单统一的方式从您的计算机中收集数据。", @@ -7827,8 +7805,6 @@ "unifiedDataTable.rowHeight.single": "单个", "unifiedDataTable.rowHeightLabel": "单元格行高", "unifiedDataTable.sampleSizeSettings.sampleSizeLabel": "样例大小", - "unifiedDataTable.searchGenerationWithDescription": "搜索 {searchTitle} 生成的表", - "unifiedDataTable.searchGenerationWithDescriptionGrid": "搜索 {searchTitle} 生成的表({searchDescription})", "unifiedDataTable.selectAllDocs": "选择所有 {rowsCount} 行", "unifiedDataTable.selectAllRowsOnPageColumnHeader": "选择所有可见行", "unifiedDataTable.selectColumnHeader": "选择列", @@ -8382,11 +8358,6 @@ "visDefaultEditor.sidebar.errorButtonTooltip": "需要解决突出显示的字段中的错误。", "visDefaultEditor.sidebar.indexPatternAriaLabel": "索引模式:{title}", "visDefaultEditor.sidebar.savedSearch.goToDiscoverButtonText": "在 Discover 中查看此搜索", - "visDefaultEditor.sidebar.savedSearch.linkButtonAriaLabel": "链接到已保存搜索。单击以了解详情或断开链接。", - "visDefaultEditor.sidebar.savedSearch.popoverHelpText": "对此已保存搜索的后续修改将反映在可视化中。要禁用自动更新,请移除该链接。", - "visDefaultEditor.sidebar.savedSearch.popoverTitle": "已链接到已保存搜索", - "visDefaultEditor.sidebar.savedSearch.titleAriaLabel": "已保存搜索:{title}", - "visDefaultEditor.sidebar.savedSearch.unlinkSavedSearchButtonText": "移除已保存搜索的链接", "visDefaultEditor.sidebar.tabs.dataLabel": "数据", "visDefaultEditor.sidebar.tabs.optionsLabel": "选项", "visDefaultEditor.sidebar.updateChartButtonLabel": "更新", @@ -9347,7 +9318,6 @@ "visualizations.editVisualization.readOnlyErrorMessage": "{visTypeTitle} 可视化为只读状态,无法在编辑器中打开", "visualizations.embeddable.errorTitle": "无法加载可视化", "visualizations.embeddable.inspectorTitle": "检查器", - "visualizations.embeddable.legacyURLConflict.errorMessage": "此可视化具有与旧版别名相同的 URL。请禁用别名以解决此错误:{json}", "visualizations.embeddable.placeholderTitle": "占位符标题", "visualizations.embeddable.tsdbRollupWarning": "可视化使用的函数不受汇总/打包数据支持。请选择其他函数,或更改时间范围。", "visualizations.experimentalVisInfoText": "在未来版本中可能会更改或完全移除。Elastic 将努力修复任何问题,但处于技术预览状态的功能不受正式 GA 功能支持 SLA 的约束。如欲提供反馈,请在 {githubLink} 中创建问题。", @@ -9401,9 +9371,7 @@ "visualizations.newVisWizard.learnMoreText": "希望了解详情?", "visualizations.newVisWizard.newVisTypeTitle": "新建{visTypeName}", "visualizations.newVisWizard.resultsFound": "{resultCount, plural, other {类型}}已找到", - "visualizations.newVisWizard.searchSelection.notFoundLabel": "未找到匹配的索引或已保存搜索。", "visualizations.newVisWizard.searchSelection.savedObjectType.dataView": "数据视图", - "visualizations.newVisWizard.searchSelection.savedObjectType.search": "已保存搜索", "visualizations.newVisWizard.title": "新建可视化", "visualizations.noDataView.label": "数据视图", "visualizations.noMatchRoute.bannerText": "Visualize 应用程序无法识别此路由:{route}。", @@ -9415,9 +9383,7 @@ "visualizations.pageHeading": "{chartName} {chartType} 可视化", "visualizations.readOnlyLegacyVisMessage": "无法编辑这些详情,因为不再支持此可视化。", "visualizations.reporting.defaultReportTitle": "可视化 [{date}]", - "visualizations.savedObjectName": "可视化", "visualizations.saveDuplicateRejectedDescription": "已拒绝使用重复标题保存确认", - "visualizations.savingVisualizationFailed.errorMsg": "保存可视化失败", "visualizations.search.label": "搜索", "visualizations.share.shareModal.title": "共享此可视化", "visualizations.tonNavMenu.tryItBadgeText": "试用", @@ -9698,7 +9664,6 @@ "xpack.aiops.correlations.veryLowImpactText": "极低", "xpack.aiops.dataGrid.field.documentCountChart.seriesLabel": "文档计数", "xpack.aiops.dataGrid.field.documentCountChartSplit.seriesLabel": "其他文档计数", - "xpack.aiops.dataSourceContext.errorTitle": "无法提取数据视图或已保存搜索", "xpack.aiops.documentCountChart.baselineBadgeLabel": "基线", "xpack.aiops.documentCountChart.deviationBadgeLabel": "偏差", "xpack.aiops.embeddableChangePointChart.dataViewLabel": "数据视图", @@ -12332,7 +12297,6 @@ "xpack.canvas.functions.savedMap.args.titleHelpText": "地图的标题", "xpack.canvas.functions.savedMap.args.zoomHelpText": "地图的缩放级别", "xpack.canvas.functions.savedMapHelpText": "返回已保存地图对象的可嵌入对象。", - "xpack.canvas.functions.savedSearchHelpText": "为已保存搜索对象返回可嵌入对象", "xpack.canvas.functions.savedVisualization.args.colorsHelpText": "定义用于特定序列的颜色", "xpack.canvas.functions.savedVisualization.args.hideLegendHelpText": "指定用于隐藏图例的选项", "xpack.canvas.functions.savedVisualization.args.idHelpText": "已保存可视化对象的 ID", @@ -14238,7 +14202,6 @@ "xpack.csp.cnvmDashboardTable.section.topVulnerableResources.column.vulnerabilities": "漏洞", "xpack.csp.cnvmDashboardTable.section.topVulnerableResources.column.vulnerabilityCount": "漏洞", "xpack.csp.common.component.multiSelectFilter.searchWord": "搜索", - "xpack.csp.common.utils.helpers.unknownError": "未知错误", "xpack.csp.compactFormattedNumber.naTitle": "不可用", "xpack.csp.complianceScoreBar.tooltipTitle": "{failed} 个失败和 {passed} 个通过的结果", "xpack.csp.complianceScoreChart.counterButtonLink.failedFindingsTooltip": "失败的结果", @@ -14253,9 +14216,6 @@ "xpack.csp.createPackagePolicy.customAssetsTab.rulesViewLabel": "查看 CSP 规则", "xpack.csp.createPackagePolicy.customAssetsTab.vulnerabilityDashboardViewLabel": "查看 CNVM 仪表板", "xpack.csp.createPackagePolicy.customAssetsTab.vulnerabilityFindingsViewLabel": "查看漏洞结果", - "xpack.csp.cspEvaluationBadge.failLabel": "失败", - "xpack.csp.cspEvaluationBadge.naLabel": "不可用", - "xpack.csp.cspEvaluationBadge.passLabel": "通过", "xpack.csp.cspIntegration.gcpCloudCredentials.cloudFormationSupportedMessage": "当前集成版本不支持为自动化凭据启动 Cloud Shell。请升级到最新版本以启用为自动化凭据启动 Cloud Shell。", "xpack.csp.cspmIntegration.awsOption.benchmarkTitle": "CIS AWS", "xpack.csp.cspmIntegration.awsOption.nameTitle": "AWS", @@ -14339,7 +14299,6 @@ "xpack.csp.findings.distributionBar.totalPassedLabel": "通过的结果", "xpack.csp.findings.errorCallout.pageSearchErrorTitle": "检索搜索结果时遇到问题", "xpack.csp.findings.errorCallout.showErrorButtonLabel": "显示错误消息", - "xpack.csp.findings.findingsErrorToast.searchFailedTitle": "搜索失败", "xpack.csp.findings.findingsFlyout.calloutTitle": "{vendor} 未提供某些字段", "xpack.csp.findings.findingsFlyout.flyoutDescriptionList.resourceId": "资源 ID", "xpack.csp.findings.findingsFlyout.flyoutDescriptionList.resourceName": "资源名称", @@ -14509,11 +14468,6 @@ "xpack.csp.kspmIntegration.integration.shortNameTitle": "KSPM", "xpack.csp.kspmIntegration.vanillaOption.benchmarkTitle": "CIS Kubernetes", "xpack.csp.kspmIntegration.vanillaOption.nameTitle": "自管型", - "xpack.csp.navigation.dashboardNavItemLabel": "云安全态势", - "xpack.csp.navigation.findingsNavItemLabel": "结果", - "xpack.csp.navigation.myBenchmarksNavItemLabel": "基准", - "xpack.csp.navigation.rulesNavItemLabel": "规则", - "xpack.csp.navigation.vulnerabilityDashboardNavItemLabel": "云原生漏洞管理", "xpack.csp.noFindingsStates.indexing.indexingButtonTitle": "正进行态势评估", "xpack.csp.noFindingsStates.indexing.indexingDescription": "正在等待要收集和索引的数据。请稍后返回检查以查看结果", "xpack.csp.noFindingsStates.indexTimeout.indexTimeoutDescription": "收集结果所需的时间长于预期。{docs}。", @@ -15169,7 +15123,6 @@ "xpack.dataVisualizer.index.lensChart.countLabel": "计数", "xpack.dataVisualizer.index.lensChart.maximumOfLabel": "{fieldName} 的最大值", "xpack.dataVisualizer.index.lensChart.topValuesLabel": "排名最前值", - "xpack.dataVisualizer.index.savedSearchErrorMessage": "检索已保存搜索 {savedSearchId} 时出错", "xpack.dataVisualizer.multiSelectPicker.NoFiltersFoundMessage": "未找到任何筛选", "xpack.dataVisualizer.noData": "无数据", "xpack.dataVisualizer.randomSamplerPreference.offLabel": "关闭", @@ -19330,7 +19283,6 @@ "xpack.features.ossFeatures.discoverSearchSessionsFeatureName": "存储搜索会话", "xpack.features.ossFeatures.discoverShortUrlSubFeatureName": "短 URL", "xpack.features.ossFeatures.discoverStoreSearchSessionsPrivilegeName": "存储搜索会话", - "xpack.features.ossFeatures.reporting.dashboardDownloadCSV": "从已保存搜索面板生成 CSV 报告", "xpack.features.ossFeatures.reporting.dashboardGenerateScreenshot": "生成 PDF 或 PNG 报告", "xpack.features.ossFeatures.reporting.discoverGenerateCSV": "生成 CSV 报告", "xpack.features.ossFeatures.reporting.reportingTitle": "Reporting", @@ -20300,7 +20252,6 @@ "xpack.fleet.epm.assetTitles.mlModules": "异常检测配置", "xpack.fleet.epm.assetTitles.osqueryPackAssets": "Osquery 包", "xpack.fleet.epm.assetTitles.osquerySavedQuery": "Osquery 已保存查询", - "xpack.fleet.epm.assetTitles.savedSearches": "已保存的搜索", "xpack.fleet.epm.assetTitles.securityRules": "安全规则", "xpack.fleet.epm.assetTitles.tag": "标签", "xpack.fleet.epm.assetTitles.transforms": "转换", @@ -21890,16 +21841,12 @@ "xpack.idxMgmt.goToDiscover.discoverIndexButtonLabel": "Discover 索引", "xpack.idxMgmt.goToDiscover.showIndexToolTip": "在 Discover 中显示 {indexName}", "xpack.idxMgmt.home.appTitle": "索引管理", - "xpack.idxMgmt.home.componentTemplates.checkingPrivilegesDescription": "正在检查权限……", - "xpack.idxMgmt.home.componentTemplates.checkingPrivilegesErrorMessage": "从服务器获取用户权限时出错。", "xpack.idxMgmt.home.componentTemplates.confirmButtonLabel": "删除{numComponentTemplatesToDelete, plural, other {组件模板} }", "xpack.idxMgmt.home.componentTemplates.deleteModal.cancelButtonLabel": "取消", "xpack.idxMgmt.home.componentTemplates.deleteModal.deleteDescription": "您即将删除{numComponentTemplatesToDelete, plural, other {以下组件模板} }:", "xpack.idxMgmt.home.componentTemplates.deleteModal.modalTitleText": "删除{numComponentTemplatesToDelete, plural, one {组件模板} other { # 个组件模板}}", "xpack.idxMgmt.home.componentTemplates.deleteModal.multipleErrorsNotificationMessageText": "删除 {count} 个组件模板时出错", "xpack.idxMgmt.home.componentTemplates.deleteModal.successDeleteMultipleNotificationMessageText": "已删除 {numSuccesses, plural, other {# 个组件模板}}", - "xpack.idxMgmt.home.componentTemplates.deniedPrivilegeDescription": "要使用'组件模板',必须具有{privilegesCount, plural, other {以下集群权限}}:{missingPrivileges}。", - "xpack.idxMgmt.home.componentTemplates.deniedPrivilegeTitle": "需要集群权限", "xpack.idxMgmt.home.componentTemplates.emptyPromptButtonLabel": "创建组件模板", "xpack.idxMgmt.home.componentTemplates.emptyPromptDescription": "例如,您可以为可在多个索引模板上重复使用的索引设置创建组件模板。", "xpack.idxMgmt.home.componentTemplates.emptyPromptDocumentionLink": "了解详情。", @@ -23813,8 +23760,6 @@ "xpack.infra.logsPage.toolbar.logFilterErrorToastTitle": "日志筛选错误", "xpack.infra.logsSettingsPage.loadingButtonLabel": "正在加载", "xpack.infra.logsStreamEmbeddable.deprecationWarningDescription": "将不再维护日志流面板。尝试将 {savedSearchDocsLink} 用于类似可视化。", - "xpack.infra.logsStreamEmbeddable.deprecationWarningDescription.savedSearchesLinkLabel": "已保存的搜索", - "xpack.infra.logStreamEmbeddable.description": "添加实时流式传输日志的表。为了获得更高效的体验,建议使用 Discover 页面创建已保存搜索,而不是使用日志流。", "xpack.infra.logStreamEmbeddable.displayName": "日志流(已过时)", "xpack.infra.logStreamEmbeddable.title": "日志流", "xpack.infra.logStreamPageTemplate.backtoLogsStream": "返回到日志流", @@ -28506,14 +28451,10 @@ "xpack.ml.dataframe.analytics.create.resultsFieldHelpText": "定义用于存储分析结果的字段的名称。默认为 ml。", "xpack.ml.dataframe.analytics.create.resultsFieldInputAriaLabel": "用于存储分析结果的字段的名称。", "xpack.ml.dataframe.analytics.create.resultsFieldLabel": "结果字段", - "xpack.ml.dataframe.analytics.create.savedSearchLabel": "已保存搜索", "xpack.ml.dataframe.analytics.create.scatterplotMatrixLabel": "散点图矩阵", "xpack.ml.dataframe.analytics.create.scatterplotMatrixLabelHelpText": "可视化选定包括字段对之间的关系。", "xpack.ml.dataFrame.analytics.create.searchSelection.CcsErrorCallOutTitle": "不支持使用跨集群搜索的数据视图。", - "xpack.ml.dataFrame.analytics.create.searchSelection.errorGettingDataViewTitle": "加载已保存搜索所使用的数据视图时出错", - "xpack.ml.dataFrame.analytics.create.searchSelection.notFoundLabel": "未找到匹配的索引或已保存搜索。", "xpack.ml.dataFrame.analytics.create.searchSelection.savedObjectType.dataView": "数据视图", - "xpack.ml.dataFrame.analytics.create.searchSelection.savedObjectType.search": "已保存搜索", "xpack.ml.dataframe.analytics.create.softTreeDepthLimitInputAriaLabel": "超过此深度的决策树将在损失计算中被罚分。", "xpack.ml.dataframe.analytics.create.softTreeDepthLimitLabel": "软性树深度限制", "xpack.ml.dataframe.analytics.create.softTreeDepthLimitText": "超过此深度的决策树将在损失计算中被罚分。必须大于或等于 0。", @@ -28802,7 +28743,6 @@ "xpack.ml.dataGridChart.notEnoughData": "0 个文档包含字段。", "xpack.ml.dataGridChart.singleCategoryLegend": "{cardinality, plural, other {# 个类别}}", "xpack.ml.dataGridChart.topCategoriesLegend": "{cardinality} 个类别中的排名前 {maxChartColumns} 个", - "xpack.ml.dataSourceContext.errorTitle": "无法提取数据视图或已保存搜索", "xpack.ml.dataViewNotBasedOnTimeSeriesNotificationDescription": "仅针对基于时间的索引运行异常检测", "xpack.ml.dataViewNotBasedOnTimeSeriesNotificationTitle": "数据视图 {dataViewIndexPattern} 并非基于时间序列", "xpack.ml.dataViewUtils.createDataViewSwitchLabel": "创建数据视图", @@ -29045,7 +28985,6 @@ "xpack.ml.feature.reserved.description": "要向用户授予访问权限,还应分配 machine_learning_user 或 machine_learning_admin 角色。", "xpack.ml.featureFeedbackButton.tellUsWhatYouThinkLink": "告诉我们您的看法!", "xpack.ml.featureRegistry.mlFeatureName": "Machine Learning", - "xpack.ml.featureRegistry.privilegesTooltip": "为 Machine Learning 授予所有或读取功能权限还会向某些类型的 Kibana 已保存对象(即索引模式、仪表板、已保存搜索和可视化,以及 Machine Learning 作业、已训练模型和模块已保存对象)授予对等功能权限。", "xpack.ml.fieldTypeIcon.booleanTypeAriaLabel": "布尔类型", "xpack.ml.fieldTypeIcon.dateTypeAriaLabel": "日期类型", "xpack.ml.fieldTypeIcon.geoPointTypeAriaLabel": "{geoPointParam} 类型", @@ -29847,7 +29786,6 @@ "xpack.ml.newJob.recognize.running.startedAriaLabel": "已启动", "xpack.ml.newJob.recognize.running.startFailedAriaLabel": "启动失败", "xpack.ml.newJob.recognize.runningLabel": "正在运行", - "xpack.ml.newJob.recognize.savedSearchPageTitle": "已保存搜索 {savedSearchTitle}", "xpack.ml.newJob.recognize.saveJobOverrideLabel": "保存", "xpack.ml.newJob.recognize.searchesLabel": "搜索", "xpack.ml.newJob.recognize.searchWillBeOverwrittenLabel": "搜索将被覆盖", @@ -29856,7 +29794,6 @@ "xpack.ml.newJob.recognize.startDatafeedAfterSaveLabel": "保存后启动数据馈送", "xpack.ml.newJob.recognize.useDedicatedIndexLabel": "使用专用索引", "xpack.ml.newJob.recognize.useFullDataLabel": "使用完整的 {dataViewIndexPattern} 数据", - "xpack.ml.newJob.recognize.usingSavedSearchDescription": "使用已保存搜索意味着在数据馈送中使用的查询会与我们在 {moduleId} 模块中提供的默认查询不同。", "xpack.ml.newJob.recognize.viewResultsAriaLabel": "查看结果", "xpack.ml.newJob.recognize.viewResultsLinkText": "查看结果", "xpack.ml.newJob.recognize.visualizationsLabel": "可视化", @@ -29876,7 +29813,6 @@ "xpack.ml.newJob.wizard.datafeedStep.dataView.description": "当前用于此作业的数据视图。", "xpack.ml.newJob.wizard.datafeedStep.dataView.step0.title": "更改数据视图", "xpack.ml.newJob.wizard.datafeedStep.dataView.step1.dataView": "数据视图", - "xpack.ml.newJob.wizard.datafeedStep.dataView.step1.noMatchingError": "未找到匹配的索引或已保存搜索。", "xpack.ml.newJob.wizard.datafeedStep.dataView.step1.title": "为该作业选择新数据视图", "xpack.ml.newJob.wizard.datafeedStep.dataView.step2.ApplyButton": "应用", "xpack.ml.newJob.wizard.datafeedStep.dataView.step2.backButton": "返回", @@ -29986,8 +29922,6 @@ "xpack.ml.newJob.wizard.jobType.rareAriaLabel": "罕见作业", "xpack.ml.newJob.wizard.jobType.rareDescription": "检测时间序列数据中的罕见值。", "xpack.ml.newJob.wizard.jobType.rareTitle": "极少", - "xpack.ml.newJob.wizard.jobType.savedSearchPageTitleLabel": "已保存搜索 {savedSearchTitle}", - "xpack.ml.newJob.wizard.jobType.selectDifferentIndexLinkText": "选择不同数据视图或已保存搜索", "xpack.ml.newJob.wizard.jobType.singleMetricAriaLabel": "单一指标作业", "xpack.ml.newJob.wizard.jobType.singleMetricDescription": "检测单个时序中的异常。", "xpack.ml.newJob.wizard.jobType.singleMetricTitle": "单一指标", @@ -29997,7 +29931,6 @@ "xpack.ml.newJob.wizard.jsonFlyout.autoSetJobCreatorTimeRange.error": "检索索引的开始和结束时间时出错", "xpack.ml.newJob.wizard.jsonFlyout.closeButton": "关闭", "xpack.ml.newJob.wizard.jsonFlyout.datafeed.title": "数据馈送配置 JSON", - "xpack.ml.newJob.wizard.jsonFlyout.indicesChange.calloutText": "在此处无法更改数据馈送正在使用的索引。要选择不同数据视图或已保存搜索,请前往向导的第 1 步,然后选择更改数据视图选项。", "xpack.ml.newJob.wizard.jsonFlyout.indicesChange.calloutTitle": "索引已更改", "xpack.ml.newJob.wizard.jsonFlyout.job.title": "作业配置 JSON", "xpack.ml.newJob.wizard.jsonFlyout.saveButton": "保存", @@ -30128,10 +30061,7 @@ "xpack.ml.newJob.wizard.revertModelSnapshotFlyout.title": "恢复到模型快照 {ssId}", "xpack.ml.newJob.wizard.revertModelSnapshotFlyout.warningCallout.contents": "将删除 {date} 后的所有异常检测结果。", "xpack.ml.newJob.wizard.revertModelSnapshotFlyout.warningCallout.title": "将删除异常数据", - "xpack.ml.newJob.wizard.searchSelection.notFoundLabel": "未找到匹配的数据视图或已保存搜索。", "xpack.ml.newJob.wizard.searchSelection.savedObjectType.dataView": "数据视图", - "xpack.ml.newJob.wizard.searchSelection.savedObjectType.search": "已保存搜索", - "xpack.ml.newJob.wizard.selectDataViewOrSavedSearch": "选择数据视图或已保存搜索", "xpack.ml.newJob.wizard.shopValidationButton": "跳过验证", "xpack.ml.newJob.wizard.step.configureDatafeedTitle": "配置数据馈送", "xpack.ml.newJob.wizard.step.jobDetailsTitle": "作业详情", @@ -30143,7 +30073,6 @@ "xpack.ml.newJob.wizard.stepComponentWrapper.jobDetailsTitle": "作业详情", "xpack.ml.newJob.wizard.stepComponentWrapper.pickFieldsTitle": "选择字段", "xpack.ml.newJob.wizard.stepComponentWrapper.summaryTitleDataView": "从数据视图 {dataViewName} 新建作业", - "xpack.ml.newJob.wizard.stepComponentWrapper.summaryTitleSavedSearch": "从已保存搜索 {title} 新建作业", "xpack.ml.newJob.wizard.stepComponentWrapper.timeRangeTitle": "时间范围", "xpack.ml.newJob.wizard.stepComponentWrapper.validationTitle": "验证", "xpack.ml.newJob.wizard.summaryStep.convertToAdvancedButton": "转换成高级作业", @@ -36883,7 +36812,6 @@ "xpack.securitySolution.detectionEngine.body.summary.message": "规则 {ruleName} 生成了 {signalsCount} 个告警", "xpack.securitySolution.detectionEngine.buttonManageRules": "管理规则", "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkActionConfirmationCloseButtonLabel": "关闭", - "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditConfirmation.confirmButtonLabel": "编辑 {customRulesCount, plural, other {# 个定制规则}}", "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditConfirmationCancelButtonLabel": "取消", "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addIndexPatternsComboboxHelpText": "输入要添加的 Elasticsearch 索引的模式。默认情况下,下拉列表将包括 Security Solution 高级设置中定义的索引模式。", "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addIndexPatternsComboboxLabel": "为选定规则添加索引模式", @@ -36917,8 +36845,6 @@ "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.setInvestigationFieldsWarningCallout": "您即将覆盖选定的 {rulesCount, plural, other {# 个规则}}的突出显示的定制字段。要应用并保存更改,请单击'保存'。", "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.setTagsWarningCallout": "您即将覆盖 {rulesCount, plural, other {# 个选定规则}}的标签,按'保存'可应用更改。", "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.tagsComoboxRequiredErrorMessage": "至少需要一个标签。", - "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkExportConfirmation.confirmButtonLabel": "导出 {customRulesCount, plural, other {# 个定制规则}}", - "xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkManualRuleRunConfirmation.confirmButtonLabel": "计划 {customRulesCount, plural, other {# 个定制规则}}", "xpack.securitySolution.detectionEngine.components.allRules.bulkDeleteConfirmationTitle": "确认批量删除", "xpack.securitySolution.detectionEngine.components.allRules.deleteConfirmationCancel": "取消", "xpack.securitySolution.detectionEngine.components.allRules.deleteConfirmationConfirm": "删除", @@ -37066,7 +36992,6 @@ "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.multiSelectFields.placeholderText": "选择字段", "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.newTermsField.placeholderText": "选择字段", "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.newTermsFieldsLabel": "字段", - "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.newTermsFieldsMin": "至少需要一个字段。", "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.referencesUrlInvalidError": "URL 的格式无效", "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.resetDefaultIndicesButton": "重置为默认索引模式", "xpack.securitySolution.detectionEngine.createRule.stepDefineRule.rulePreviewTitle": "规则预览", @@ -38136,7 +38061,6 @@ "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.addRuleActionsTitle": "添加规则操作", "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.addTagsTitle": "添加标签", "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.applyTimelineTemplateTitle": "应用时间线模板", - "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkActionConfirmationPartlyTitle": "只能对 {customRulesCount, plural, other {# 个定制规则}}应用此操作", "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkEditConfirmationDeniedTitle": "无法编辑 {rulesCount, plural, other {# 个规则}}", "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkEditWarningToastDescription": "{rulesCount, plural, other {# 个规则}}正在更新。", "xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkEditWarningToastNotifyButtonLabel": "在完成时通知我", @@ -38366,7 +38290,6 @@ "xpack.securitySolution.detectionEngine.userUnauthenticatedMsgBody": "您没有所需的权限,无法查看检测引擎。若需要更多帮助,请联系您的管理员。", "xpack.securitySolution.detectionEngine.userUnauthenticatedTitle": "需要检测引擎权限", "xpack.securitySolution.detectionEngine.validations.stepDefineRule.historyWindowSize.errMin": "历史记录窗口大小必须大于 0。", - "xpack.securitySolution.detectionEngine.validations.stepDefineRule.newTermsFieldsMax": "字段数目不得超过 3 个。", "xpack.securitySolution.detectionEngine.validations.thresholdCardinalityFieldFieldData.thresholdCardinalityFieldNotSuppliedMessage": "基数字段必填。", "xpack.securitySolution.detectionEngine.validations.thresholdCardinalityValueFieldData.numberGreaterThanOrEqualOneErrorMessage": "值必须大于或等于 1。", "xpack.securitySolution.detectionEngine.validations.thresholdFieldFieldData.arrayLengthGreaterThanMaxErrorMessage": "字段数目不得超过 3 个。", @@ -41632,7 +41555,6 @@ "xpack.securitySolution.timelines.components.templateFilter.elasticTitle": "Elastic 模板", "xpack.securitySolution.timelines.discoverInTimeline.save_saved_search_error": "保存 Discover 搜索时出错", "xpack.securitySolution.timelines.discoverInTimeline.save_saved_search_unknown_error": "保存 Discover 搜索时出现未知错误", - "xpack.securitySolution.timelines.discoverInTimeline.savedSearchTitle": "时间线的已保存搜索 - {title}", "xpack.securitySolution.timelines.newTemplateTimelineButtonLabel": "创建新时间线模板", "xpack.securitySolution.timelines.newTimelineButtonLabel": "创建新时间线", "xpack.securitySolution.timelines.pageTitle": "时间线", @@ -42041,7 +41963,7 @@ "xpack.serverlessSearch.languages.php": "PHP", "xpack.serverlessSearch.languages.php.githubLink": "elasticsearch-serverless-php", "xpack.serverlessSearch.languages.python": "Python", - "xpack.serverlessSearch.languages.python.githubLabel": "elasticsearch-serverless-python", + "xpack.serverlessSearch.languages.python.githubLabel": "elasticsearch-py", "xpack.serverlessSearch.languages.ruby": "Ruby", "xpack.serverlessSearch.languages.ruby.githubLabel": "elasticsearch-serverless-ruby", "xpack.serverlessSearch.learnMore": "了解详情", @@ -43592,7 +43514,6 @@ "xpack.spaces.management.copyToSpace.copyModeControl.createNewCopies.disabledTitle": "检查现有对象", "xpack.spaces.management.copyToSpace.copyModeControl.createNewCopies.enabledText": "使用此选项可在相同的工作区中创建该对象的一个或多个副本。", "xpack.spaces.management.copyToSpace.copyModeControl.createNewCopies.enabledTitle": "使用随机 ID 创建新对象", - "xpack.spaces.management.copyToSpace.copyModeControl.includeRelated.text": "复制此对象及其相关对象。对于仪表板,还将复制相关可视化、索引模式和已保存的搜索。", "xpack.spaces.management.copyToSpace.copyModeControl.includeRelated.title": "包括相关对象", "xpack.spaces.management.copyToSpace.copyModeControl.overwrite.disabledLabel": "冲突时请求操作", "xpack.spaces.management.copyToSpace.copyModeControl.overwrite.enabledLabel": "自动覆盖冲突", @@ -46320,15 +46241,12 @@ "xpack.transform.newTransform.chooseSourceTitle": "选择源", "xpack.transform.newTransform.newTransformTitle": "新转换", "xpack.transform.newTransform.searchSelection.createADataView": "创建数据视图", - "xpack.transform.newTransform.searchSelection.notFoundLabel": "未找到匹配的索引或已保存搜索。", "xpack.transform.newTransform.searchSelection.savedObjectType.dataView": "数据视图", - "xpack.transform.newTransform.searchSelection.savedObjectType.search": "已保存搜索", "xpack.transform.pivotPreview.copyClipboardTooltip": "将转换预览的开发控制台语句复制到剪贴板。", "xpack.transform.pivotPreview.PivotPreviewIncompleteConfigCalloutBody": "请至少选择一个分组依据字段和聚合。", "xpack.transform.pivotPreview.PivotPreviewNoDataCalloutBody": "预览请求未返回任何数据。请确保可选查询返回数据且分组依据和聚合字段使用的字段的值存在。", "xpack.transform.pivotPreview.transformPreviewTitle": "转换预览", "xpack.transform.progress": "进度", - "xpack.transform.searchItems.errorInitializationTitle": "初始化 Kibana 数据视图或已保存搜索时发生错误。", "xpack.transform.statsBar.batchTransformsLabel": "批量", "xpack.transform.statsBar.continuousTransformsLabel": "连续", "xpack.transform.statsBar.failedTransformsLabel": "失败", @@ -46405,7 +46323,6 @@ "xpack.transform.stepDefineForm.runtimeEditorSwitchModalTitle": "编辑将会丢失", "xpack.transform.stepDefineForm.runtimeFieldsLabel": "运行时字段", "xpack.transform.stepDefineForm.runtimeFieldsListLabel": "{runtimeFields}", - "xpack.transform.stepDefineForm.savedSearchLabel": "已保存搜索", "xpack.transform.stepDefineForm.searchFilterLabel": "搜索筛选", "xpack.transform.stepDefineForm.sortFieldOptionsEmptyError": "没有日期字段可用于排序。要使用其他字段类型,请将配置复制到剪贴板,然后继续在控制台中创建转换。", "xpack.transform.stepDefineForm.sortHelpText": "选择要用于标识最新文档的日期字段。", @@ -46418,7 +46335,6 @@ "xpack.transform.stepDefineSummary.groupByLabel": "分组依据", "xpack.transform.stepDefineSummary.queryCodeBlockLabel": "查询", "xpack.transform.stepDefineSummary.queryLabel": "查询", - "xpack.transform.stepDefineSummary.savedSearchLabel": "已保存搜索", "xpack.transform.stepDefineSummary.timeRangeLabel": "时间范围", "xpack.transform.stepDetailsForm.advancedSettingsAccordionButtonContent": "高级设置", "xpack.transform.stepDetailsForm.continuousModeAriaLabel": "选择延迟。", diff --git a/x-pack/platform/plugins/shared/aiops/public/components/change_point_detection/fields_config.tsx b/x-pack/platform/plugins/shared/aiops/public/components/change_point_detection/fields_config.tsx index 90d356809acf5..fb1a51c311668 100644 --- a/x-pack/platform/plugins/shared/aiops/public/components/change_point_detection/fields_config.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/components/change_point_detection/fields_config.tsx @@ -638,7 +638,7 @@ export const FieldsControls: FC<PropsWithChildren<FieldsControlsProps>> = ({ }) => { const { splitFieldsOptions, combinedQuery } = useChangePointDetectionContext(); const { dataView } = useDataSource(); - const { data, uiSettings, fieldFormats, charts, fieldStats, theme } = useAiopsAppContext(); + const { data, uiSettings, fieldFormats, charts, fieldStats } = useAiopsAppContext(); const timefilter = useTimefilter(); // required in order to trigger state updates useTimeRangeUpdates(); @@ -677,7 +677,6 @@ export const FieldsControls: FC<PropsWithChildren<FieldsControlsProps>> = ({ } : undefined } - theme={theme} > <EuiFlexGroup alignItems={'center'} responsive={true} wrap={true} gutterSize={'m'}> <EuiFlexItem grow={false} css={{ width: '200px' }}> diff --git a/x-pack/platform/plugins/shared/aiops/public/components/field_stats_popover/field_stats_popover.tsx b/x-pack/platform/plugins/shared/aiops/public/components/field_stats_popover/field_stats_popover.tsx index 342485f68441b..fe18686e93d18 100644 --- a/x-pack/platform/plugins/shared/aiops/public/components/field_stats_popover/field_stats_popover.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/components/field_stats_popover/field_stats_popover.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { EuiButtonIcon, EuiToolTip } from '@elastic/eui'; +import { useEuiTheme, EuiButtonIcon, EuiToolTip } from '@elastic/eui'; import React, { useCallback, useMemo, useState } from 'react'; import { i18n } from '@kbn/i18n'; import { isDefined } from '@kbn/ml-is-defined'; @@ -19,7 +19,6 @@ import { } from '@kbn/unified-field-list/src/components/field_popover'; import type { DataView } from '@kbn/data-views-plugin/common'; import type { TimeRange as TimeRangeMs } from '@kbn/ml-date-picker'; -import { useEuiTheme } from '../../hooks/use_eui_theme'; import { FieldStatsContent } from './field_stats_content'; export function FieldStatsPopover({ @@ -38,7 +37,7 @@ export function FieldStatsPopover({ timeRangeMs?: TimeRangeMs; }) { const [infoIsOpen, setInfoOpen] = useState(false); - const euiTheme = useEuiTheme(); + const { euiTheme } = useEuiTheme(); const closePopover = useCallback(() => setInfoOpen(false), []); @@ -62,7 +61,7 @@ export function FieldStatsPopover({ defaultMessage: 'Show top field values', })} data-test-subj={'aiopsContextPopoverButton'} - css={{ marginLeft: euiTheme.euiSizeXS }} + css={{ marginLeft: euiTheme.size.xs }} /> </EuiToolTip> ); diff --git a/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/category_table/category_table.tsx b/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/category_table/category_table.tsx index 2a9591bb415a6..06ba0d128a9b4 100644 --- a/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/category_table/category_table.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/category_table/category_table.tsx @@ -10,6 +10,7 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react' import type { EuiBasicTableColumn, EuiTableSelectionType } from '@elastic/eui'; import { + useEuiTheme, useEuiBackgroundColor, EuiInMemoryTable, EuiButtonIcon, @@ -24,8 +25,6 @@ import type { UseTableState } from '@kbn/ml-in-memory-table'; import { css } from '@emotion/react'; import type { Category } from '@kbn/aiops-log-pattern-analysis/types'; -import { useEuiTheme } from '../../../hooks/use_eui_theme'; - import { MiniHistogram } from '../../mini_histogram'; import type { EventRate } from '../use_categorize_request'; @@ -63,7 +62,7 @@ export const CategoryTable: FC<Props> = ({ selectable = true, onRenderComplete, }) => { - const euiTheme = useEuiTheme(); + const { euiTheme } = useEuiTheme(); const primaryBackgroundColor = useEuiBackgroundColor('primary'); const { onTableChange, pagination, sorting } = tableState; @@ -221,12 +220,12 @@ export const CategoryTable: FC<Props> = ({ if (mouseOver.highlightedCategory && mouseOver.highlightedCategory.key === category.key) { return { - backgroundColor: euiTheme.euiColorLightestShade, + backgroundColor: euiTheme.colors.lightestShade, }; } return { - backgroundColor: euiTheme.euiColorEmptyShade, + backgroundColor: euiTheme.colors.emptyShade, }; }; @@ -235,8 +234,8 @@ export const CategoryTable: FC<Props> = ({ position: 'sticky', insetBlockStart: 0, zIndex: 1, - backgroundColor: euiTheme.euiColorEmptyShade, - boxShadow: `inset 0 0px 0, inset 0 -1px 0 ${euiTheme.euiBorderColor}`, + backgroundColor: euiTheme.colors.emptyShade, + boxShadow: `inset 0 0px 0, inset 0 -1px 0 ${euiTheme.border.color}`, }, }); diff --git a/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/category_table/table_header.tsx b/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/category_table/table_header.tsx index 9157b4994adb4..82a8d99f7337e 100644 --- a/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/category_table/table_header.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/category_table/table_header.tsx @@ -7,10 +7,16 @@ import type { FC, PropsWithChildren } from 'react'; import React from 'react'; -import { EuiFlexGroup, EuiFlexItem, EuiText, EuiButtonEmpty, EuiToolTip } from '@elastic/eui'; +import { + useEuiTheme, + EuiFlexGroup, + EuiFlexItem, + EuiText, + EuiButtonEmpty, + EuiToolTip, +} from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { QUERY_MODE } from '@kbn/aiops-log-pattern-analysis/get_category_query'; -import { useEuiTheme } from '../../../hooks/use_eui_theme'; import type { OpenInDiscover } from './use_open_in_discover'; interface Props { @@ -24,9 +30,9 @@ export const TableHeader: FC<Props> = ({ selectedCategoriesCount, openInDiscover, }) => { - const euiTheme = useEuiTheme(); + const { euiTheme } = useEuiTheme(); return ( - <EuiFlexGroup gutterSize="none" alignItems="center" css={{ minHeight: euiTheme.euiSizeXL }}> + <EuiFlexGroup gutterSize="none" alignItems="center" css={{ minHeight: euiTheme.size.xl }}> <EuiFlexItem> <EuiText size="s" data-test-subj="aiopsLogPatternsFoundCount"> <FormattedMessage diff --git a/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/format_category.test.tsx b/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/format_category.test.tsx index c93a2de548620..fa2d7830de3f3 100644 --- a/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/format_category.test.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/format_category.test.tsx @@ -9,7 +9,7 @@ import type { Category } from '@kbn/aiops-log-pattern-analysis/types'; import { useCreateFormattedExample } from './format_category'; import { renderHook } from '@testing-library/react'; -jest.mock('../../hooks/use_eui_theme', () => ({ +jest.mock('../../hooks/use_is_dark_theme', () => ({ useIsDarkTheme: () => false, })); diff --git a/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/format_category.tsx b/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/format_category.tsx index 5af9478349642..bd8c16f8f8f76 100644 --- a/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/format_category.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/components/log_categorization/format_category.tsx @@ -11,7 +11,7 @@ import { EuiText, EuiHorizontalRule } from '@elastic/eui'; import type { SerializedStyles } from '@emotion/react'; import { css } from '@emotion/react'; import type { Category } from '@kbn/aiops-log-pattern-analysis/types'; -import { useIsDarkTheme } from '../../hooks/use_eui_theme'; +import { useIsDarkTheme } from '../../hooks/use_is_dark_theme'; interface Props { category: Category; diff --git a/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis/log_rate_analysis_content/log_rate_analysis_content.tsx b/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis/log_rate_analysis_content/log_rate_analysis_content.tsx index fb3c17634fd31..37b3d796f4891 100644 --- a/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis/log_rate_analysis_content/log_rate_analysis_content.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis/log_rate_analysis_content/log_rate_analysis_content.tsx @@ -17,7 +17,7 @@ import { getWindowParametersForTrigger, getSnappedTimestamps, getSnappedWindowParameters, - LOG_RATE_ANALYSIS_HIGHLIGHT_COLOR, + useLogRateAnalysisBarColors, LOG_RATE_ANALYSIS_TYPE, type WindowParameters, } from '@kbn/aiops-log-rate-analysis'; @@ -130,7 +130,7 @@ export const LogRateAnalysisContent: FC<LogRateAnalysisContentProps> = ({ const barStyle = { rect: { opacity: 1, - fill: LOG_RATE_ANALYSIS_HIGHLIGHT_COLOR, + fill: useLogRateAnalysisBarColors().barHighlightColor, }, }; diff --git a/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis/log_rate_analysis_info_popover.tsx b/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis/log_rate_analysis_info_popover.tsx index afa1fd27ac99c..ec11caa24a72e 100644 --- a/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis/log_rate_analysis_info_popover.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis/log_rate_analysis_info_popover.tsx @@ -7,14 +7,12 @@ import React, { useState, type FC } from 'react'; -import { EuiBadge, EuiPopover, EuiPopoverTitle, EuiText } from '@elastic/eui'; +import { useEuiTheme, EuiBadge, EuiPopover, EuiPopoverTitle, EuiText } from '@elastic/eui'; import { LOG_RATE_ANALYSIS_TYPE } from '@kbn/aiops-log-rate-analysis'; import { useAppSelector } from '@kbn/aiops-log-rate-analysis/state'; import { i18n } from '@kbn/i18n'; -import { useEuiTheme } from '../../hooks/use_eui_theme'; - export const LogRateAnalysisInfoPopoverButton: FC<{ onClick: React.MouseEventHandler<HTMLButtonElement>; label: string; @@ -37,7 +35,7 @@ export const LogRateAnalysisInfoPopoverButton: FC<{ }; export const LogRateAnalysisInfoPopover: FC = () => { - const euiTheme = useEuiTheme(); + const { euiTheme } = useEuiTheme(); const showInfoPopover = useAppSelector( (s) => s.logRateAnalysisResults.significantItems.length > 0 @@ -117,7 +115,7 @@ export const LogRateAnalysisInfoPopover: FC = () => { </EuiPopoverTitle> )} - <EuiText size="s" css={{ maxWidth: `calc(${euiTheme.euiSizeXL} * 15);` }}> + <EuiText size="s" css={{ maxWidth: `calc(${euiTheme.size.xl} * 15);` }}> <p> {infoContent} {fieldSelectionMessage && ` ${fieldSelectionMessage}`} diff --git a/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis_results_table/log_rate_analysis_results_table.tsx b/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis_results_table/log_rate_analysis_results_table.tsx index ded175a89dfbc..816d7654444e4 100644 --- a/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis_results_table/log_rate_analysis_results_table.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis_results_table/log_rate_analysis_results_table.tsx @@ -11,7 +11,7 @@ import { orderBy, isEqual } from 'lodash'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { Criteria, EuiTableSortingType } from '@elastic/eui'; -import { useEuiBackgroundColor, EuiBasicTable } from '@elastic/eui'; +import { useEuiTheme, useEuiBackgroundColor, EuiBasicTable } from '@elastic/eui'; import type { SignificantItem } from '@kbn/ml-agg-utils'; import { @@ -22,7 +22,6 @@ import { } from '@kbn/aiops-log-rate-analysis/state'; import type { GroupTableItemGroup } from '@kbn/aiops-log-rate-analysis/state'; -import { useEuiTheme } from '../../hooks/use_eui_theme'; import { useColumns, LOG_RATE_ANALYSIS_RESULTS_TABLE_TYPE } from './use_columns'; const PAGINATION_SIZE_OPTIONS = [5, 10, 20, 50]; @@ -48,7 +47,7 @@ export const LogRateAnalysisResultsTable: FC<LogRateAnalysisResultsTableProps> = barHighlightColorOverride, skippedColumns, }) => { - const euiTheme = useEuiTheme(); + const { euiTheme } = useEuiTheme(); const primaryBackgroundColor = useEuiBackgroundColor('primary'); const allItems = useAppSelector((s) => s.logRateAnalysisResults.significantItems); @@ -227,12 +226,12 @@ export const LogRateAnalysisResultsTable: FC<LogRateAnalysisResultsTableProps> = selectedSignificantItem.fieldValue === significantItem.fieldValue ) { return { - backgroundColor: euiTheme.euiColorLightestShade, + backgroundColor: euiTheme.colors.lightestShade, }; } return { - backgroundColor: euiTheme.euiColorEmptyShade, + backgroundColor: euiTheme.colors.emptyShade, }; }; diff --git a/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis_results_table/use_columns.tsx b/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis_results_table/use_columns.tsx index c5b7a83e33641..a9657c907f938 100644 --- a/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis_results_table/use_columns.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis_results_table/use_columns.tsx @@ -7,6 +7,7 @@ import React, { useMemo, useCallback } from 'react'; import { + useEuiTheme, type EuiBasicTableColumn, EuiBadge, EuiCode, @@ -35,7 +36,6 @@ import { getFailedTransactionsCorrelationImpactLabel } from './get_failed_transa import { FieldStatsPopover } from '../field_stats_popover'; import { useAiopsAppContext } from '../../hooks/use_aiops_app_context'; import { useDataSource } from '../../hooks/use_data_source'; -import { useEuiTheme } from '../../hooks/use_eui_theme'; import { useViewInDiscoverAction } from './use_view_in_discover_action'; import { useViewInLogPatternAnalysisAction } from './use_view_in_log_pattern_analysis_action'; import { useCopyToClipboardAction } from './use_copy_to_clipboard_action'; @@ -159,7 +159,7 @@ export const useColumns = ( ): Array<EuiBasicTableColumn<SignificantItem>> => { const { data, uiSettings, fieldFormats, charts } = useAiopsAppContext(); const { dataView } = useDataSource(); - const euiTheme = useEuiTheme(); + const { euiTheme } = useEuiTheme(); const viewInDiscoverAction = useViewInDiscoverAction(dataView.id); const viewInLogPatternAnalysisAction = useViewInLogPatternAnalysisAction(dataView.id); const copyToClipBoardAction = useCopyToClipboardAction(); @@ -265,8 +265,8 @@ export const useColumns = ( <span // match the margins of the FieldStatsPopover button css={{ - marginLeft: euiTheme.euiSizeS, - marginRight: euiTheme.euiSizeXS, + marginLeft: euiTheme.size.s, + marginRight: euiTheme.size.xs, }} > <EuiIconTip diff --git a/x-pack/platform/plugins/shared/aiops/public/components/mini_histogram/mini_histogram.tsx b/x-pack/platform/plugins/shared/aiops/public/components/mini_histogram/mini_histogram.tsx index 9ac2f991c96ad..963eb31e29d40 100644 --- a/x-pack/platform/plugins/shared/aiops/public/components/mini_histogram/mini_histogram.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/components/mini_histogram/mini_histogram.tsx @@ -11,15 +11,14 @@ import { css } from '@emotion/react'; import type { PartialTheme } from '@elastic/charts'; import { Chart, BarSeries, ScaleType, Settings, Tooltip, TooltipType } from '@elastic/charts'; -import { EuiLoadingChart, EuiTextColor } from '@elastic/eui'; +import { useEuiTheme, EuiLoadingChart, EuiTextColor } from '@elastic/eui'; -import { LOG_RATE_ANALYSIS_HIGHLIGHT_COLOR } from '@kbn/aiops-log-rate-analysis'; +import { useLogRateAnalysisBarColors } from '@kbn/aiops-log-rate-analysis'; import { FormattedMessage } from '@kbn/i18n-react'; import type { SignificantItemHistogramItem } from '@kbn/ml-agg-utils'; import { i18n } from '@kbn/i18n'; import { useAiopsAppContext } from '../../hooks/use_aiops_app_context'; -import { useEuiTheme } from '../../hooks/use_eui_theme'; interface MiniHistogramProps { chartData?: SignificantItemHistogramItem[]; @@ -40,8 +39,9 @@ export const MiniHistogram: FC<MiniHistogramProps> = ({ }) => { const { charts } = useAiopsAppContext(); - const euiTheme = useEuiTheme(); + const { euiTheme } = useEuiTheme(); const chartBaseTheme = charts.theme.useChartsBaseTheme(); + const barColors = useLogRateAnalysisBarColors(); const miniHistogramChartTheme: PartialTheme = { chartMargins: { @@ -66,7 +66,7 @@ export const MiniHistogram: FC<MiniHistogramProps> = ({ const cssChartSize = css({ width: '80px', - height: euiTheme.euiSizeL, + height: euiTheme.size.l, margin: '0px', }); @@ -94,10 +94,10 @@ export const MiniHistogram: FC<MiniHistogramProps> = ({ ); } - const barColor = barColorOverride ? [barColorOverride] : undefined; + const barColor = barColorOverride ? [barColorOverride] : barColors.barColor; const barHighlightColor = barHighlightColorOverride ? [barHighlightColorOverride] - : [LOG_RATE_ANALYSIS_HIGHLIGHT_COLOR]; + : [barColors.barHighlightColor]; return ( <div css={cssChartSize}> diff --git a/x-pack/platform/plugins/shared/aiops/public/embeddables/change_point_chart/change_point_chart_initializer.tsx b/x-pack/platform/plugins/shared/aiops/public/embeddables/change_point_chart/change_point_chart_initializer.tsx index e69511fe45f92..f98714d6338aa 100644 --- a/x-pack/platform/plugins/shared/aiops/public/embeddables/change_point_chart/change_point_chart_initializer.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/embeddables/change_point_chart/change_point_chart_initializer.tsx @@ -211,7 +211,7 @@ export const FormControls: FC<{ onChange: (update: FormControlsProps) => void; onValidationChange: (isValid: boolean) => void; }> = ({ formInput, onChange, onValidationChange }) => { - const { charts, data, fieldFormats, theme, uiSettings } = useAiopsAppContext(); + const { charts, data, fieldFormats, uiSettings } = useAiopsAppContext(); const { dataView } = useDataSource(); const { combinedQuery } = useChangePointDetectionContext(); const { metricFieldOptions, splitFieldsOptions } = useChangePointDetectionControlsContext(); @@ -290,7 +290,6 @@ export const FormControls: FC<{ } : undefined } - theme={theme} > <EuiFormRow fullWidth diff --git a/x-pack/platform/plugins/shared/aiops/public/embeddables/log_rate_analysis/log_rate_analysis_embeddable_initializer.tsx b/x-pack/platform/plugins/shared/aiops/public/embeddables/log_rate_analysis/log_rate_analysis_embeddable_initializer.tsx index bf53f07677739..329c202780bdc 100644 --- a/x-pack/platform/plugins/shared/aiops/public/embeddables/log_rate_analysis/log_rate_analysis_embeddable_initializer.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/embeddables/log_rate_analysis/log_rate_analysis_embeddable_initializer.tsx @@ -11,6 +11,7 @@ import { pick } from 'lodash'; import useMountedState from 'react-use/lib/useMountedState'; import { + useEuiTheme, EuiFlyoutHeader, EuiTitle, EuiFlyoutBody, @@ -25,7 +26,6 @@ import { } from '@elastic/eui'; import type { IndexPatternSelectProps } from '@kbn/unified-search-plugin/public'; -import { euiThemeVars } from '@kbn/ui-theme'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { isPopulatedObject } from '@kbn/ml-is-populated-object'; @@ -56,6 +56,7 @@ export const LogRateAnalysisEmbeddableInitializer: FC< onPreview, isNewPanel, }) => { + const { euiTheme } = useEuiTheme(); const isMounted = useMountedState(); const [formInput, setFormInput] = useState<LogRateAnalysisEmbeddableRuntimeState>( @@ -136,7 +137,7 @@ export const LogRateAnalysisEmbeddableInitializer: FC< hasBorder={true} css={{ pointerEvents: 'auto', - backgroundColor: euiThemeVars.euiColorEmptyShade, + backgroundColor: euiTheme.colors.emptyShade, }} > <EuiTitle size="s" data-test-subj="inlineEditingFlyoutLabel"> diff --git a/x-pack/platform/plugins/shared/aiops/public/embeddables/pattern_analysis/pattern_analysis_initializer.tsx b/x-pack/platform/plugins/shared/aiops/public/embeddables/pattern_analysis/pattern_analysis_initializer.tsx index ef185518638b8..684ab9b988ed5 100644 --- a/x-pack/platform/plugins/shared/aiops/public/embeddables/pattern_analysis/pattern_analysis_initializer.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/embeddables/pattern_analysis/pattern_analysis_initializer.tsx @@ -6,6 +6,7 @@ */ import { + useEuiTheme, EuiFlyoutHeader, EuiTitle, EuiFlyoutBody, @@ -19,7 +20,6 @@ import { EuiFlyoutFooter, EuiCallOut, } from '@elastic/eui'; -import { euiThemeVars } from '@kbn/ui-theme'; import { i18n } from '@kbn/i18n'; import type { FC } from 'react'; import React, { useEffect, useMemo, useState, useCallback } from 'react'; @@ -62,6 +62,7 @@ export const PatternAnalysisEmbeddableInitializer: FC<PatternAnalysisInitializer onPreview, isNewPanel, }) => { + const { euiTheme } = useEuiTheme(); const { data: { dataViews }, unifiedSearch: { @@ -128,7 +129,7 @@ export const PatternAnalysisEmbeddableInitializer: FC<PatternAnalysisInitializer hasBorder={true} css={{ pointerEvents: 'auto', - backgroundColor: euiThemeVars.euiColorEmptyShade, + backgroundColor: euiTheme.colors.emptyShade, }} > <EuiTitle size="s" data-test-subj="inlineEditingFlyoutLabel"> diff --git a/x-pack/platform/plugins/shared/aiops/public/hooks/use_data_source.tsx b/x-pack/platform/plugins/shared/aiops/public/hooks/use_data_source.tsx index ef574a348b928..7acdc24e069fa 100644 --- a/x-pack/platform/plugins/shared/aiops/public/hooks/use_data_source.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/hooks/use_data_source.tsx @@ -100,7 +100,7 @@ export const DataSourceContextProvider: FC<PropsWithChildren<DataSourceContextPr <h2> <FormattedMessage id="xpack.aiops.dataSourceContext.errorTitle" - defaultMessage="Unable to fetch data view or saved search" + defaultMessage="Unable to fetch data view or Discover session" /> </h2> } diff --git a/x-pack/platform/plugins/shared/aiops/public/hooks/use_eui_theme.ts b/x-pack/platform/plugins/shared/aiops/public/hooks/use_eui_theme.ts deleted file mode 100644 index 7da2bd6be954a..0000000000000 --- a/x-pack/platform/plugins/shared/aiops/public/hooks/use_eui_theme.ts +++ /dev/null @@ -1,19 +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 { useCurrentEuiThemeVars, useIsDarkTheme as useIsDarkThemeMl } from '@kbn/ml-kibana-theme'; -import { useAiopsAppContext } from './use_aiops_app_context'; - -export function useEuiTheme() { - const { theme } = useAiopsAppContext(); - return useCurrentEuiThemeVars(theme).euiTheme; -} - -export function useIsDarkTheme() { - const { theme } = useAiopsAppContext(); - return useIsDarkThemeMl(theme); -} diff --git a/x-pack/platform/plugins/shared/aiops/public/hooks/use_is_dark_theme.ts b/x-pack/platform/plugins/shared/aiops/public/hooks/use_is_dark_theme.ts new file mode 100644 index 0000000000000..6dc15ffa9e25f --- /dev/null +++ b/x-pack/platform/plugins/shared/aiops/public/hooks/use_is_dark_theme.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 { useIsDarkTheme as useIsDarkThemeMl } from '@kbn/ml-kibana-theme'; +import { useAiopsAppContext } from './use_aiops_app_context'; + +export function useIsDarkTheme() { + const { theme } = useAiopsAppContext(); + return useIsDarkThemeMl(theme); +} diff --git a/x-pack/platform/plugins/shared/aiops/tsconfig.json b/x-pack/platform/plugins/shared/aiops/tsconfig.json index afee86051b7a0..1069dfde96226 100644 --- a/x-pack/platform/plugins/shared/aiops/tsconfig.json +++ b/x-pack/platform/plugins/shared/aiops/tsconfig.json @@ -75,7 +75,6 @@ "@kbn/usage-collection-plugin", "@kbn/utility-types", "@kbn/observability-ai-assistant-plugin", - "@kbn/ui-theme", "@kbn/apm-utils", "@kbn/ml-field-stats-flyout", ], diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/instance_as_filter.test.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/instance_as_filter.test.ts new file mode 100644 index 0000000000000..bd39257ac72e7 --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/instance_as_filter.test.ts @@ -0,0 +1,183 @@ +/* + * 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 { EntityV2 } from '@kbn/entities-schema'; +import { instanceAsFilter } from './instance_as_filter'; +import { readSourceDefinitions } from './source_definition'; +import { loggerMock } from '@kbn/logging-mocks'; +import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; +import { EntitySourceDefinition } from '../types'; +import { UnknownEntityType } from '../errors/unknown_entity_type'; +import { InvalidEntityInstance } from '../errors/invalid_entity_instance'; + +const readSourceDefinitionsMock = readSourceDefinitions as jest.Mock; +jest.mock('./source_definition', () => ({ + readSourceDefinitions: jest.fn(), +})); +const esClientMock = elasticsearchServiceMock.createClusterClient(); +const logger = loggerMock.create(); + +describe('instanceAsFilter', () => { + it('throws if no sources are found for the type', async () => { + const instance: EntityV2 = { + 'entity.type': 'my_type', + 'entity.id': 'whatever', + 'entity.display_name': 'Whatever', + }; + + const sources: EntitySourceDefinition[] = []; + readSourceDefinitionsMock.mockResolvedValue(sources); + + await expect(instanceAsFilter(instance, esClientMock, logger)).rejects.toThrowError( + UnknownEntityType + ); + }); + + it('throws if the instance cannot match any sources due to missing identity fields', async () => { + const instance: EntityV2 = { + 'entity.type': 'my_type', + 'entity.id': 'whatever', + 'entity.display_name': 'Whatever', + }; + + const sources: EntitySourceDefinition[] = [ + { + id: 'my_source', + type_id: 'my_type', + identity_fields: ['host.name'], + index_patterns: [], + metadata_fields: [], + filters: [], + }, + ]; + readSourceDefinitionsMock.mockResolvedValue(sources); + + await expect(instanceAsFilter(instance, esClientMock, logger)).rejects.toThrowError( + InvalidEntityInstance + ); + }); + + it('creates a single source filter for a single identity field', async () => { + const instance: EntityV2 = { + 'entity.type': 'my_type', + 'entity.id': 'whatever', + 'entity.display_name': 'Whatever', + 'host.name': 'my_host', + }; + + const sources: EntitySourceDefinition[] = [ + { + id: 'my_source', + type_id: 'my_type', + identity_fields: ['host.name'], + index_patterns: [], + metadata_fields: [], + filters: [], + }, + ]; + readSourceDefinitionsMock.mockResolvedValue(sources); + + await expect(instanceAsFilter(instance, esClientMock, logger)).resolves.toBe( + '(host.name: "my_host")' + ); + }); + + it('creates a single source filter for multiple identity field', async () => { + const instance: EntityV2 = { + 'entity.type': 'my_type', + 'entity.id': 'whatever', + 'entity.display_name': 'Whatever', + 'host.name': 'my_host', + 'host.os': 'my_os', + }; + + const sources: EntitySourceDefinition[] = [ + { + id: 'my_source', + type_id: 'my_type', + identity_fields: ['host.name', 'host.os'], + index_patterns: [], + metadata_fields: [], + filters: [], + }, + ]; + readSourceDefinitionsMock.mockResolvedValue(sources); + + await expect(instanceAsFilter(instance, esClientMock, logger)).resolves.toBe( + '(host.name: "my_host" AND host.os: "my_os")' + ); + }); + + it('creates multiple source filters for a single identity field', async () => { + const instance: EntityV2 = { + 'entity.type': 'my_type', + 'entity.id': 'whatever', + 'entity.display_name': 'Whatever', + 'host.name': 'my_host', + 'host.os': 'my_os', + }; + + const sources: EntitySourceDefinition[] = [ + { + id: 'my_source_host', + type_id: 'my_type', + identity_fields: ['host.name'], + index_patterns: [], + metadata_fields: [], + filters: [], + }, + { + id: 'my_source_os', + type_id: 'my_type', + identity_fields: ['host.os'], + index_patterns: [], + metadata_fields: [], + filters: [], + }, + ]; + readSourceDefinitionsMock.mockResolvedValue(sources); + + await expect(instanceAsFilter(instance, esClientMock, logger)).resolves.toBe( + '(host.name: "my_host") OR (host.os: "my_os")' + ); + }); + + it('creates multiple source filters for multiple identity field', async () => { + const instance: EntityV2 = { + 'entity.type': 'my_type', + 'entity.id': 'whatever', + 'entity.display_name': 'Whatever', + 'host.name': 'my_host', + 'host.os': 'my_os', + 'host.arch': 'my_arch', + }; + + const sources: EntitySourceDefinition[] = [ + { + id: 'my_source_host', + type_id: 'my_type', + identity_fields: ['host.name', 'host.arch'], + index_patterns: [], + metadata_fields: [], + filters: [], + }, + { + id: 'my_source_os', + type_id: 'my_type', + identity_fields: ['host.os', 'host.arch'], + index_patterns: [], + metadata_fields: [], + filters: [], + }, + ]; + readSourceDefinitionsMock.mockResolvedValue(sources); + + await expect(instanceAsFilter(instance, esClientMock, logger)).resolves.toBe( + '(host.name: "my_host" AND host.arch: "my_arch") OR (host.os: "my_os" AND host.arch: "my_arch")' + ); + }); +}); diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/instance_as_filter.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/instance_as_filter.ts new file mode 100644 index 0000000000000..c936277db8e25 --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/instance_as_filter.ts @@ -0,0 +1,56 @@ +/* + * 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 { EntityV2 } from '@kbn/entities-schema'; +import { Logger } from '@kbn/core/server'; +import { compact } from 'lodash'; +import { readSourceDefinitions } from './source_definition'; +import { InternalClusterClient } from '../types'; +import { UnknownEntityType } from '../errors/unknown_entity_type'; +import { InvalidEntityInstance } from '../errors/invalid_entity_instance'; + +export async function instanceAsFilter( + instance: EntityV2, + clusterClient: InternalClusterClient, + logger: Logger +) { + const sources = await readSourceDefinitions(clusterClient, logger, { + type: instance['entity.type'], + }); + + if (sources.length === 0) { + throw new UnknownEntityType(`No sources found for type ${instance['entity.type']}`); + } + + const sourceFilters = compact<string>( + sources.map((source) => { + const { identity_fields: identityFields } = source; + + const instanceHasRequiredFields = identityFields.every((identityField) => + instance[identityField] ? true : false + ); + + if (!instanceHasRequiredFields) { + return undefined; + } + + const fieldFilters = identityFields.map( + (identityField) => `${identityField}: "${instance[identityField]}"` + ); + + return `(${fieldFilters.join(' AND ')})`; + }) + ); + + if (sourceFilters.length === 0) { + throw new InvalidEntityInstance( + `Entity ${instance['entity.id']} of type ${instance['entity.type']} is missing some identity fields, no sources could match` + ); + } + + return sourceFilters.join(' OR '); +} diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/errors/invalid_entity_instance.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/errors/invalid_entity_instance.ts new file mode 100644 index 0000000000000..12b0a94fe3ebb --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/errors/invalid_entity_instance.ts @@ -0,0 +1,13 @@ +/* + * 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. + */ + +export class InvalidEntityInstance extends Error { + constructor(message: string) { + super(message); + this.name = 'InvalidEntityInstance'; + } +} diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/entity_instances.test.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/entity_instances.test.ts index e7fa8882bfcb9..8836b7635ff36 100644 --- a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/entity_instances.test.ts +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/entity_instances.test.ts @@ -28,7 +28,7 @@ describe('getEntityInstancesQuery', () => { expect(query).toEqual( 'FROM logs-*, metrics-* | ' + - 'STATS host.name = TOP(host.name::keyword, 10, "ASC"), entity.last_seen_timestamp = MAX(custom_timestamp_field), service.id = MAX(service.id::keyword) BY service.name::keyword | ' + + 'STATS host.name = VALUES(host.name::keyword), entity.last_seen_timestamp = MAX(custom_timestamp_field), service.id = MAX(service.id::keyword) BY service.name::keyword | ' + 'RENAME `service.name::keyword` AS service.name | ' + 'EVAL entity.type = "service", entity.id = service.name, entity.display_name = COALESCE(service.id, entity.id) | ' + 'SORT entity.id DESC | ' + diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/entity_instances.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/entity_instances.ts index dc79d815abd37..c9a5948b55dc1 100644 --- a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/entity_instances.ts +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/entity_instances.ts @@ -46,7 +46,7 @@ const dslFilter = ({ const statsCommand = ({ source }: { source: EntitySourceDefinition }) => { const aggs = source.metadata_fields .filter((field) => !source.identity_fields.some((idField) => idField === field)) - .map((field) => `${field} = TOP(${asKeyword(field)}, 10, "ASC")`); + .map((field) => `${field} = VALUES(${asKeyword(field)})`); if (source.timestamp_field) { aggs.push(`entity.last_seen_timestamp = MAX(${source.timestamp_field})`); diff --git a/x-pack/platform/plugins/shared/entity_manager/server/plugin.ts b/x-pack/platform/plugins/shared/entity_manager/server/plugin.ts index fed5b1c4df458..8799c7f365bf7 100644 --- a/x-pack/platform/plugins/shared/entity_manager/server/plugin.ts +++ b/x-pack/platform/plugins/shared/entity_manager/server/plugin.ts @@ -40,11 +40,15 @@ import { READ_ENTITIES_PRIVILEGE, } from './lib/v2/constants'; import { installBuiltInDefinitions } from './lib/v2/definitions/install_built_in_definitions'; +import { instanceAsFilter } from './lib/v2/definitions/instance_as_filter'; // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface EntityManagerServerPluginSetup {} export interface EntityManagerServerPluginStart { getScopedClient: (options: { request: KibanaRequest }) => Promise<EntityClient>; + v2: { + instanceAsFilter: typeof instanceAsFilter; + }; } export const config: PluginConfigDescriptor<EntityManagerConfig> = { @@ -197,6 +201,9 @@ export class EntityManagerServerPlugin getScopedClient: async ({ request }: { request: KibanaRequest }) => { return this.getScopedClient({ request, coreStart: core }); }, + v2: { + instanceAsFilter, + }, }; } diff --git a/x-pack/platform/plugins/shared/entity_manager/tsconfig.json b/x-pack/platform/plugins/shared/entity_manager/tsconfig.json index beb8097502b2b..0fc46870ea472 100644 --- a/x-pack/platform/plugins/shared/entity_manager/tsconfig.json +++ b/x-pack/platform/plugins/shared/entity_manager/tsconfig.json @@ -38,5 +38,6 @@ "@kbn/es-types", "@kbn/apm-utils", "@kbn/features-plugin", + "@kbn/core-elasticsearch-server-mocks", ] } diff --git a/x-pack/platform/plugins/shared/inference/README.md b/x-pack/platform/plugins/shared/inference/README.md index bba5b4cdcfc27..a52e589a9deab 100644 --- a/x-pack/platform/plugins/shared/inference/README.md +++ b/x-pack/platform/plugins/shared/inference/README.md @@ -221,6 +221,75 @@ const toolCall = toolCalls[0]; // process the tool call and eventually continue the conversation with the LLM ``` +#### Request cancellation + +Request cancellation can be done by passing an abort signal when calling the API. Firing the signal +before the request completes will cause the abortion, and the API call will throw an error. + +```ts +const abortController = new AbortController(); + +const chatResponse = await inferenceClient.chatComplete({ + connectorId: 'some-gen-ai-connector', + abortSignal: abortController.signal, + messages: [{ role: MessageRole.User, content: 'Do something' }], +}); + +// from elsewhere / before the request completes and the promise resolves: + +abortController.abort(); +``` + +The `isInferenceRequestAbortedError` helper function, exposed from `@kbn/inference-common`, can be used easily identify those errors: + +```ts +import { isInferenceRequestAbortedError } from '@kbn/inference-common'; + +try { + const abortController = new AbortController(); + const chatResponse = await inferenceClient.chatComplete({ + connectorId: 'some-gen-ai-connector', + abortSignal: abortController.signal, + messages: [{ role: MessageRole.User, content: 'Do something' }], + }); +} catch(e) { + if(isInferenceRequestAbortedError(e)) { + // request was aborted, do something + } else { + // was another error, do something else + } +} +``` + +The approach is very similar for stream mode: + +```ts +import { isInferenceRequestAbortedError } from '@kbn/inference-common'; + +const abortController = new AbortController(); +const events$ = inferenceClient.chatComplete({ + stream: true, + connectorId: 'some-gen-ai-connector', + abortSignal: abortController.signal, + messages: [{ role: MessageRole.User, content: 'Do something' }], +}); + +events$.subscribe({ + next: (event) => { + // do something + }, + error: (err) => { + if(isInferenceRequestAbortedError(e)) { + // request was aborted, do something + } else { + // was another error, do something else + } + } +}); + +abortController.abort(); +``` + ### `output` API `output` is a wrapper around the `chatComplete` API that is catered towards a specific use case: having the LLM output a structured response, based on a schema. diff --git a/x-pack/platform/plugins/shared/inference/common/output/create_output_api.test.ts b/x-pack/platform/plugins/shared/inference/common/output/create_output_api.test.ts index c65720aae2e48..d29f88009f8e5 100644 --- a/x-pack/platform/plugins/shared/inference/common/output/create_output_api.test.ts +++ b/x-pack/platform/plugins/shared/inference/common/output/create_output_api.test.ts @@ -196,4 +196,26 @@ describe('createOutputApi', () => { ).toThrowError('Retry options are not supported in streaming mode'); }); }); + + it('propagates the abort signal when provided', async () => { + chatComplete.mockResolvedValue(Promise.resolve({ content: 'content', toolCalls: [] })); + + const output = createOutputApi(chatComplete); + + const abortController = new AbortController(); + + await output({ + id: 'id', + connectorId: '.my-connector', + input: 'input message', + abortSignal: abortController.signal, + }); + + expect(chatComplete).toHaveBeenCalledTimes(1); + expect(chatComplete).toHaveBeenCalledWith( + expect.objectContaining({ + abortSignal: abortController.signal, + }) + ); + }); }); diff --git a/x-pack/platform/plugins/shared/inference/common/output/create_output_api.ts b/x-pack/platform/plugins/shared/inference/common/output/create_output_api.ts index 3e65cb283dd45..7cd7e9cad144e 100644 --- a/x-pack/platform/plugins/shared/inference/common/output/create_output_api.ts +++ b/x-pack/platform/plugins/shared/inference/common/output/create_output_api.ts @@ -34,6 +34,7 @@ export function createOutputApi(chatCompleteApi: ChatCompleteAPI) { previousMessages, functionCalling, stream, + abortSignal, retry, }: DefaultOutputOptions): OutputCompositeResponse<string, ToolSchema | undefined, boolean> { if (stream && retry !== undefined) { @@ -52,6 +53,7 @@ export function createOutputApi(chatCompleteApi: ChatCompleteAPI) { connectorId, stream, functionCalling, + abortSignal, system, messages, ...(schema @@ -113,6 +115,7 @@ export function createOutputApi(chatCompleteApi: ChatCompleteAPI) { input, schema, system, + abortSignal, previousMessages: messages.concat( { role: MessageRole.Assistant as const, diff --git a/x-pack/platform/plugins/shared/inference/common/tasks/nl_to_esql/ast/corrections/like.ts b/x-pack/platform/plugins/shared/inference/common/tasks/nl_to_esql/ast/corrections/like.ts index be61bd216284b..6ee068339b776 100644 --- a/x-pack/platform/plugins/shared/inference/common/tasks/nl_to_esql/ast/corrections/like.ts +++ b/x-pack/platform/plugins/shared/inference/common/tasks/nl_to_esql/ast/corrections/like.ts @@ -43,6 +43,9 @@ function checkLikeNode(node: ESQLLikeOperator): QueryCorrection[] { likeExpression.value = likeExpression.value .replaceAll(/(?<!\\)%/g, '*') .replaceAll(/(?<!\\)_/g, '?'); + likeExpression.valueUnquoted = likeExpression.valueUnquoted + .replaceAll(/(?<!\\)%/g, '*') + .replaceAll(/(?<!\\)_/g, '?'); if (likeExpression.value !== initialValue) { likeExpression.name = likeExpression.value; diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/bedrock/bedrock_claude_adapter.test.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/bedrock/bedrock_claude_adapter.test.ts index 565727b7f57fe..c6114c3b09e95 100644 --- a/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/bedrock/bedrock_claude_adapter.test.ts +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/bedrock/bedrock_claude_adapter.test.ts @@ -325,5 +325,24 @@ describe('bedrockClaudeAdapter', () => { expect(tools).toEqual([]); expect(system).toEqual(addNoToolUsageDirective('some system instruction')); }); + + it('propagates the abort signal when provided', () => { + const abortController = new AbortController(); + + bedrockClaudeAdapter.chatComplete({ + logger, + executor: executorMock, + messages: [{ role: MessageRole.User, content: 'question' }], + abortSignal: abortController.signal, + }); + + expect(executorMock.invoke).toHaveBeenCalledTimes(1); + expect(executorMock.invoke).toHaveBeenCalledWith({ + subAction: 'invokeStream', + subActionParams: expect.objectContaining({ + signal: abortController.signal, + }), + }); + }); }); }); diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/bedrock/bedrock_claude_adapter.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/bedrock/bedrock_claude_adapter.ts index e73d9c9344c98..e34605a4c96ad 100644 --- a/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/bedrock/bedrock_claude_adapter.ts +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/bedrock/bedrock_claude_adapter.ts @@ -26,7 +26,7 @@ import { processCompletionChunks } from './process_completion_chunks'; import { addNoToolUsageDirective } from './prompts'; export const bedrockClaudeAdapter: InferenceConnectorAdapter = { - chatComplete: ({ executor, system, messages, toolChoice, tools }) => { + chatComplete: ({ executor, system, messages, toolChoice, tools, abortSignal }) => { const noToolUsage = toolChoice === ToolChoiceType.none; const subActionParams = { @@ -36,6 +36,7 @@ export const bedrockClaudeAdapter: InferenceConnectorAdapter = { toolChoice: toolChoiceToBedrock(toolChoice), temperature: 0, stopSequences: ['\n\nHuman:'], + signal: abortSignal, }; return from( diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/gemini/gemini_adapter.test.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/gemini/gemini_adapter.test.ts index 95a46f73d5d1f..5024bd1f4c87e 100644 --- a/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/gemini/gemini_adapter.test.ts +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/gemini/gemini_adapter.test.ts @@ -402,5 +402,24 @@ describe('geminiAdapter', () => { expect(tapFn).toHaveBeenCalledWith({ chunk: 1 }); expect(tapFn).toHaveBeenCalledWith({ chunk: 2 }); }); + + it('propagates the abort signal when provided', () => { + const abortController = new AbortController(); + + geminiAdapter.chatComplete({ + logger, + executor: executorMock, + messages: [{ role: MessageRole.User, content: 'question' }], + abortSignal: abortController.signal, + }); + + expect(executorMock.invoke).toHaveBeenCalledTimes(1); + expect(executorMock.invoke).toHaveBeenCalledWith({ + subAction: 'invokeStream', + subActionParams: expect.objectContaining({ + signal: abortController.signal, + }), + }); + }); }); }); diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/gemini/gemini_adapter.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/gemini/gemini_adapter.ts index 80d0439449066..aa62f7006eac7 100644 --- a/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/gemini/gemini_adapter.ts +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/gemini/gemini_adapter.ts @@ -22,7 +22,7 @@ import { processVertexStream } from './process_vertex_stream'; import type { GenerateContentResponseChunk, GeminiMessage, GeminiToolConfig } from './types'; export const geminiAdapter: InferenceConnectorAdapter = { - chatComplete: ({ executor, system, messages, toolChoice, tools }) => { + chatComplete: ({ executor, system, messages, toolChoice, tools, abortSignal }) => { return from( executor.invoke({ subAction: 'invokeStream', @@ -32,6 +32,7 @@ export const geminiAdapter: InferenceConnectorAdapter = { tools: toolsToGemini(tools), toolConfig: toolChoiceToConfig(toolChoice), temperature: 0, + signal: abortSignal, stopSequences: ['\n\nHuman:'], }, }) diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/openai/openai_adapter.test.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/openai/openai_adapter.test.ts index 48544f1bb0fb1..9b7fbc388024f 100644 --- a/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/openai/openai_adapter.test.ts +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/openai/openai_adapter.test.ts @@ -77,6 +77,7 @@ describe('openAIAdapter', () => { }; }); }); + it('correctly formats messages ', () => { openAIAdapter.chatComplete({ ...defaultArgs, @@ -254,6 +255,25 @@ describe('openAIAdapter', () => { expect(getRequest().stream).toBe(true); expect(getRequest().body.stream).toBe(true); }); + + it('propagates the abort signal when provided', () => { + const abortController = new AbortController(); + + openAIAdapter.chatComplete({ + logger, + executor: executorMock, + messages: [{ role: MessageRole.User, content: 'question' }], + abortSignal: abortController.signal, + }); + + expect(executorMock.invoke).toHaveBeenCalledTimes(1); + expect(executorMock.invoke).toHaveBeenCalledWith({ + subAction: 'stream', + subActionParams: expect.objectContaining({ + signal: abortController.signal, + }), + }); + }); }); describe('when handling the response', () => { diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/openai/openai_adapter.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/openai/openai_adapter.ts index 49b6bb5142023..0529820b1bfbf 100644 --- a/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/openai/openai_adapter.ts +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/openai/openai_adapter.ts @@ -43,7 +43,16 @@ import { } from '../../simulated_function_calling'; export const openAIAdapter: InferenceConnectorAdapter = { - chatComplete: ({ executor, system, messages, toolChoice, tools, functionCalling, logger }) => { + chatComplete: ({ + executor, + system, + messages, + toolChoice, + tools, + functionCalling, + logger, + abortSignal, + }) => { const stream = true; const simulatedFunctionCalling = functionCalling === 'simulated'; @@ -73,6 +82,7 @@ export const openAIAdapter: InferenceConnectorAdapter = { subAction: 'stream', subActionParams: { body: JSON.stringify(request), + signal: abortSignal, stream, }, }) diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/api.test.mocks.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/api.test.mocks.ts new file mode 100644 index 0000000000000..e3248b79af406 --- /dev/null +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/api.test.mocks.ts @@ -0,0 +1,26 @@ +/* + * 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. + */ + +export const getInferenceAdapterMock = jest.fn(); + +jest.doMock('./adapters', () => { + const actual = jest.requireActual('./adapters'); + return { + ...actual, + getInferenceAdapter: getInferenceAdapterMock, + }; +}); + +export const getInferenceExecutorMock = jest.fn(); + +jest.doMock('./utils', () => { + const actual = jest.requireActual('./utils'); + return { + ...actual, + getInferenceExecutor: getInferenceExecutorMock, + }; +}); diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/api.test.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/api.test.ts new file mode 100644 index 0000000000000..7d557ec512fcc --- /dev/null +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/api.test.ts @@ -0,0 +1,237 @@ +/* + * 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 { getInferenceExecutorMock, getInferenceAdapterMock } from './api.test.mocks'; + +import { of, Subject, isObservable, toArray, firstValueFrom } from 'rxjs'; +import { loggerMock, type MockedLogger } from '@kbn/logging-mocks'; +import { httpServerMock } from '@kbn/core/server/mocks'; +import { actionsMock } from '@kbn/actions-plugin/server/mocks'; +import { + type ChatCompleteAPI, + type ChatCompletionChunkEvent, + MessageRole, +} from '@kbn/inference-common'; +import { + createInferenceConnectorAdapterMock, + createInferenceConnectorMock, + createInferenceExecutorMock, + chunkEvent, +} from '../test_utils'; +import { createChatCompleteApi } from './api'; + +describe('createChatCompleteApi', () => { + let request: ReturnType<typeof httpServerMock.createKibanaRequest>; + let logger: MockedLogger; + let actions: ReturnType<typeof actionsMock.createStart>; + let inferenceAdapter: ReturnType<typeof createInferenceConnectorAdapterMock>; + let inferenceConnector: ReturnType<typeof createInferenceConnectorMock>; + let inferenceExecutor: ReturnType<typeof createInferenceExecutorMock>; + + let chatComplete: ChatCompleteAPI; + + beforeEach(() => { + request = httpServerMock.createKibanaRequest(); + logger = loggerMock.create(); + actions = actionsMock.createStart(); + + chatComplete = createChatCompleteApi({ request, actions, logger }); + + inferenceAdapter = createInferenceConnectorAdapterMock(); + inferenceAdapter.chatComplete.mockReturnValue(of(chunkEvent('chunk-1'))); + getInferenceAdapterMock.mockReturnValue(inferenceAdapter); + + inferenceConnector = createInferenceConnectorMock(); + + inferenceExecutor = createInferenceExecutorMock({ connector: inferenceConnector }); + getInferenceExecutorMock.mockResolvedValue(inferenceExecutor); + }); + + afterEach(() => { + getInferenceExecutorMock.mockReset(); + getInferenceAdapterMock.mockReset(); + }); + + it('calls `getInferenceExecutor` with the right parameters', async () => { + await chatComplete({ + connectorId: 'connectorId', + messages: [{ role: MessageRole.User, content: 'question' }], + }); + + expect(getInferenceExecutorMock).toHaveBeenCalledTimes(1); + expect(getInferenceExecutorMock).toHaveBeenCalledWith({ + connectorId: 'connectorId', + request, + actions, + }); + }); + + it('calls `getInferenceAdapter` with the right parameters', async () => { + await chatComplete({ + connectorId: 'connectorId', + messages: [{ role: MessageRole.User, content: 'question' }], + }); + + expect(getInferenceAdapterMock).toHaveBeenCalledTimes(1); + expect(getInferenceAdapterMock).toHaveBeenCalledWith(inferenceConnector.type); + }); + + it('calls `inferenceAdapter.chatComplete` with the right parameters', async () => { + await chatComplete({ + connectorId: 'connectorId', + messages: [{ role: MessageRole.User, content: 'question' }], + }); + + expect(inferenceAdapter.chatComplete).toHaveBeenCalledTimes(1); + expect(inferenceAdapter.chatComplete).toHaveBeenCalledWith({ + messages: [{ role: MessageRole.User, content: 'question' }], + executor: inferenceExecutor, + logger, + }); + }); + + it('throws if the connector is not compatible', async () => { + getInferenceAdapterMock.mockReturnValue(undefined); + + await expect( + chatComplete({ + connectorId: 'connectorId', + messages: [{ role: MessageRole.User, content: 'question' }], + }) + ).rejects.toThrowErrorMatchingInlineSnapshot(`"Adapter for type .gen-ai not implemented"`); + }); + + describe('response mode', () => { + it('returns a promise resolving with the response', async () => { + inferenceAdapter.chatComplete.mockReturnValue( + of(chunkEvent('chunk-1'), chunkEvent('chunk-2')) + ); + + const response = await chatComplete({ + connectorId: 'connectorId', + messages: [{ role: MessageRole.User, content: 'question' }], + }); + + expect(response).toEqual({ + content: 'chunk-1chunk-2', + toolCalls: [], + }); + }); + + describe('request cancellation', () => { + it('passes the abortSignal down to `inferenceAdapter.chatComplete`', async () => { + const abortController = new AbortController(); + + await chatComplete({ + connectorId: 'connectorId', + messages: [{ role: MessageRole.User, content: 'question' }], + abortSignal: abortController.signal, + }); + + expect(inferenceAdapter.chatComplete).toHaveBeenCalledTimes(1); + expect(inferenceAdapter.chatComplete).toHaveBeenCalledWith({ + messages: [{ role: MessageRole.User, content: 'question' }], + executor: inferenceExecutor, + abortSignal: abortController.signal, + logger, + }); + }); + + it('throws an error when the signal is triggered', async () => { + const abortController = new AbortController(); + + const subject = new Subject<ChatCompletionChunkEvent>(); + inferenceAdapter.chatComplete.mockReturnValue(subject.asObservable()); + + subject.next(chunkEvent('chunk-1')); + + let caughtError: any; + + const promise = chatComplete({ + connectorId: 'connectorId', + messages: [{ role: MessageRole.User, content: 'question' }], + abortSignal: abortController.signal, + }).catch((err) => { + caughtError = err; + }); + + abortController.abort(); + + await promise; + + expect(caughtError).toBeInstanceOf(Error); + expect(caughtError.message).toContain('Request was aborted'); + }); + }); + }); + + describe('stream mode', () => { + it('returns an observable of events', async () => { + inferenceAdapter.chatComplete.mockReturnValue( + of(chunkEvent('chunk-1'), chunkEvent('chunk-2')) + ); + + const events$ = chatComplete({ + stream: true, + connectorId: 'connectorId', + messages: [{ role: MessageRole.User, content: 'question' }], + }); + + expect(isObservable(events$)).toBe(true); + + const events = await firstValueFrom(events$.pipe(toArray())); + expect(events).toEqual([ + { + content: 'chunk-1', + tool_calls: [], + type: 'chatCompletionChunk', + }, + { + content: 'chunk-2', + tool_calls: [], + type: 'chatCompletionChunk', + }, + { + content: 'chunk-1chunk-2', + toolCalls: [], + type: 'chatCompletionMessage', + }, + ]); + }); + + describe('request cancellation', () => { + it('throws an error when the signal is triggered', async () => { + const abortController = new AbortController(); + + const subject = new Subject<ChatCompletionChunkEvent>(); + inferenceAdapter.chatComplete.mockReturnValue(subject.asObservable()); + + subject.next(chunkEvent('chunk-1')); + + let caughtError: any; + + const events$ = chatComplete({ + stream: true, + connectorId: 'connectorId', + messages: [{ role: MessageRole.User, content: 'question' }], + abortSignal: abortController.signal, + }); + + events$.subscribe({ + error: (err: any) => { + caughtError = err; + }, + }); + + abortController.abort(); + + expect(caughtError).toBeInstanceOf(Error); + expect(caughtError.message).toContain('Request was aborted'); + }); + }); + }); +}); diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/api.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/api.ts index e58c94759e165..0e58c255bd608 100644 --- a/x-pack/platform/plugins/shared/inference/server/chat_complete/api.ts +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/api.ts @@ -6,7 +6,7 @@ */ import { last, omit } from 'lodash'; -import { defer, switchMap, throwError } from 'rxjs'; +import { defer, switchMap, throwError, identity } from 'rxjs'; import type { Logger } from '@kbn/logging'; import type { KibanaRequest } from '@kbn/core-http-server'; import { @@ -17,9 +17,13 @@ import { ChatCompleteOptions, } from '@kbn/inference-common'; import type { PluginStartContract as ActionsPluginStart } from '@kbn/actions-plugin/server'; -import { getConnectorById } from '../util/get_connector_by_id'; import { getInferenceAdapter } from './adapters'; -import { createInferenceExecutor, chunksIntoMessage, streamToResponse } from './utils'; +import { + getInferenceExecutor, + chunksIntoMessage, + streamToResponse, + handleCancellation, +} from './utils'; interface CreateChatCompleteApiOptions { request: KibanaRequest; @@ -37,18 +41,16 @@ export function createChatCompleteApi({ request, actions, logger }: CreateChatCo system, functionCalling, stream, + abortSignal, }: ChatCompleteOptions<ToolOptions, boolean>): ChatCompleteCompositeResponse< ToolOptions, boolean > => { - const obs$ = defer(async () => { - const actionsClient = await actions.getActionsClientWithRequest(request); - const connector = await getConnectorById({ connectorId, actionsClient }); - const executor = createInferenceExecutor({ actionsClient, connector }); - return { executor, connector }; + const inference$ = defer(async () => { + return await getInferenceExecutor({ connectorId, request, actions }); }).pipe( - switchMap(({ executor, connector }) => { - const connectorType = connector.type; + switchMap((executor) => { + const connectorType = executor.getConnector().type; const inferenceAdapter = getInferenceAdapter(connectorType); const messagesWithoutData = messages.map((message) => omit(message, 'data')); @@ -80,21 +82,20 @@ export function createChatCompleteApi({ request, actions, logger }: CreateChatCo tools, logger, functionCalling, + abortSignal, }); }), chunksIntoMessage({ - toolOptions: { - toolChoice, - tools, - }, + toolOptions: { toolChoice, tools }, logger, - }) + }), + abortSignal ? handleCancellation(abortSignal) : identity ); if (stream) { - return obs$; + return inference$; } else { - return streamToResponse(obs$); + return streamToResponse(inference$); } }; } diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/types.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/types.ts index 64cc542ff6119..498afb9a2a17f 100644 --- a/x-pack/platform/plugins/shared/inference/server/chat_complete/types.ts +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/types.ts @@ -29,6 +29,7 @@ export interface InferenceConnectorAdapter { messages: Message[]; system?: string; functionCalling?: FunctionCallingMode; + abortSignal?: AbortSignal; logger: Logger; } & ToolOptions ) => Observable<InferenceConnectorAdapterChatCompleteEvent>; diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/handle_cancellation.test.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/handle_cancellation.test.ts new file mode 100644 index 0000000000000..7fd464a7051c6 --- /dev/null +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/handle_cancellation.test.ts @@ -0,0 +1,53 @@ +/* + * 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 { of, Subject, toArray, firstValueFrom } from 'rxjs'; +import { InferenceTaskError, InferenceTaskErrorCode } from '@kbn/inference-common'; +import { handleCancellation } from './handle_cancellation'; + +describe('handleCancellation', () => { + it('mirrors the source when the abort signal is not triggered', async () => { + const abortController = new AbortController(); + + const source$ = of(1, 2, 3); + + const output$ = source$.pipe(handleCancellation(abortController.signal)); + + const events = await firstValueFrom(output$.pipe(toArray())); + expect(events).toEqual([1, 2, 3]); + }); + + it('causes the observable to error when the signal fires', () => { + const abortController = new AbortController(); + + const source$ = new Subject<number>(); + + const output$ = source$.pipe(handleCancellation(abortController.signal)); + + let thrownError: any; + const values: number[] = []; + + output$.subscribe({ + next: (value) => { + values.push(value); + }, + error: (err) => { + thrownError = err; + }, + }); + + source$.next(1); + source$.next(2); + abortController.abort(); + source$.next(3); + + expect(values).toEqual([1, 2]); + expect(thrownError).toBeInstanceOf(InferenceTaskError); + expect(thrownError.code).toBe(InferenceTaskErrorCode.abortedError); + expect(thrownError.message).toContain('Request was aborted'); + }); +}); diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/handle_cancellation.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/handle_cancellation.ts new file mode 100644 index 0000000000000..640172b150e4e --- /dev/null +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/handle_cancellation.ts @@ -0,0 +1,39 @@ +/* + * 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 { OperatorFunction, Observable, Subject, takeUntil } from 'rxjs'; +import { createInferenceRequestAbortedError } from '@kbn/inference-common'; + +export function handleCancellation<T>(abortSignal: AbortSignal): OperatorFunction<T, T> { + return (source$) => { + const stop$ = new Subject<void>(); + if (abortSignal.aborted) { + stop$.next(); + } + abortSignal.addEventListener('abort', () => { + stop$.next(); + }); + + return new Observable<T>((subscriber) => { + return source$.pipe(takeUntil(stop$)).subscribe({ + next: (value) => { + subscriber.next(value); + }, + error: (err) => { + subscriber.error(err); + }, + complete: () => { + if (abortSignal.aborted) { + subscriber.error(createInferenceRequestAbortedError()); + } else { + subscriber.complete(); + } + }, + }); + }); + }; +} diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/index.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/index.ts index d3dc2010cba3a..4314a554589dd 100644 --- a/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/index.ts +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/index.ts @@ -6,10 +6,11 @@ */ export { - createInferenceExecutor, + getInferenceExecutor, type InferenceInvokeOptions, type InferenceInvokeResult, type InferenceExecutor, } from './inference_executor'; export { chunksIntoMessage } from './chunks_into_message'; export { streamToResponse } from './stream_to_response'; +export { handleCancellation } from './handle_cancellation'; diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/inference_executor.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/inference_executor.ts index 736beb82aa685..c461e6b6cdfb7 100644 --- a/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/inference_executor.ts +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/inference_executor.ts @@ -5,9 +5,14 @@ * 2.0. */ +import type { KibanaRequest } from '@kbn/core-http-server'; import type { ActionTypeExecutorResult } from '@kbn/actions-plugin/common'; -import type { ActionsClient } from '@kbn/actions-plugin/server'; +import type { + ActionsClient, + PluginStartContract as ActionsPluginStart, +} from '@kbn/actions-plugin/server'; import type { InferenceConnector } from '../../../common/connectors'; +import { getConnectorById } from '../../util/get_connector_by_id'; export interface InferenceInvokeOptions { subAction: string; @@ -22,6 +27,7 @@ export type InferenceInvokeResult<Data = unknown> = ActionTypeExecutorResult<Dat * In practice, for now it's just a thin abstraction around the action client. */ export interface InferenceExecutor { + getConnector: () => InferenceConnector; invoke(params: InferenceInvokeOptions): Promise<InferenceInvokeResult>; } @@ -33,6 +39,7 @@ export const createInferenceExecutor = ({ actionsClient: ActionsClient; }): InferenceExecutor => { return { + getConnector: () => connector, async invoke({ subAction, subActionParams }): Promise<InferenceInvokeResult> { return await actionsClient.execute({ actionId: connector.connectorId, @@ -44,3 +51,17 @@ export const createInferenceExecutor = ({ }, }; }; + +export const getInferenceExecutor = async ({ + connectorId, + actions, + request, +}: { + connectorId: string; + actions: ActionsPluginStart; + request: KibanaRequest; +}) => { + const actionsClient = await actions.getActionsClientWithRequest(request); + const connector = await getConnectorById({ connectorId, actionsClient }); + return createInferenceExecutor({ actionsClient, connector }); +}; diff --git a/x-pack/platform/plugins/shared/inference/server/routes/chat_complete.ts b/x-pack/platform/plugins/shared/inference/server/routes/chat_complete.ts index 84e3dd57cded1..06ca5381cd83a 100644 --- a/x-pack/platform/plugins/shared/inference/server/routes/chat_complete.ts +++ b/x-pack/platform/plugins/shared/inference/server/routes/chat_complete.ts @@ -109,6 +109,9 @@ export function registerChatCompleteRoute({ .getStartServices() .then(([coreStart, pluginsStart]) => pluginsStart.actions); + const abortController = new AbortController(); + request.events.aborted$.subscribe(() => abortController.abort()); + const client = createInferenceClient({ request, actions, logger }); const { connectorId, messages, system, toolChoice, tools, functionCalling } = request.body; @@ -121,6 +124,7 @@ export function registerChatCompleteRoute({ tools, functionCalling, stream, + abortSignal: abortController.signal, }); } diff --git a/x-pack/platform/plugins/shared/inference/server/test_utils/index.ts b/x-pack/platform/plugins/shared/inference/server/test_utils/index.ts new file mode 100644 index 0000000000000..2eafe20bfdcaf --- /dev/null +++ b/x-pack/platform/plugins/shared/inference/server/test_utils/index.ts @@ -0,0 +1,11 @@ +/* + * 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. + */ + +export { chunkEvent, tokensEvent, messageEvent } from './chat_complete_events'; +export { createInferenceConnectorMock } from './inference_connector'; +export { createInferenceConnectorAdapterMock } from './inference_connector_adapter'; +export { createInferenceExecutorMock } from './inference_executor'; diff --git a/x-pack/platform/plugins/shared/inference/server/test_utils/inference_connector.ts b/x-pack/platform/plugins/shared/inference/server/test_utils/inference_connector.ts new file mode 100644 index 0000000000000..af7f35115325d --- /dev/null +++ b/x-pack/platform/plugins/shared/inference/server/test_utils/inference_connector.ts @@ -0,0 +1,19 @@ +/* + * 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 { InferenceConnector, InferenceConnectorType } from '../../common/connectors'; + +export const createInferenceConnectorMock = ( + parts: Partial<InferenceConnector> = {} +): InferenceConnector => { + return { + type: InferenceConnectorType.OpenAI, + name: 'Inference connector', + connectorId: 'connector-id', + ...parts, + }; +}; diff --git a/x-pack/platform/plugins/shared/inference/server/test_utils/inference_connector_adapter.ts b/x-pack/platform/plugins/shared/inference/server/test_utils/inference_connector_adapter.ts new file mode 100644 index 0000000000000..9e2c4516f4f1c --- /dev/null +++ b/x-pack/platform/plugins/shared/inference/server/test_utils/inference_connector_adapter.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 type { InferenceConnectorAdapter } from '../chat_complete/types'; + +export const createInferenceConnectorAdapterMock = (): jest.Mocked<InferenceConnectorAdapter> => { + return { + chatComplete: jest.fn(), + }; +}; diff --git a/x-pack/platform/plugins/shared/inference/server/test_utils/inference_executor.ts b/x-pack/platform/plugins/shared/inference/server/test_utils/inference_executor.ts new file mode 100644 index 0000000000000..64b5100a9db3d --- /dev/null +++ b/x-pack/platform/plugins/shared/inference/server/test_utils/inference_executor.ts @@ -0,0 +1,19 @@ +/* + * 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 { InferenceConnector } from '../../common/connectors'; +import { InferenceExecutor } from '../chat_complete/utils'; +import { createInferenceConnectorMock } from './inference_connector'; + +export const createInferenceExecutorMock = ({ + connector = createInferenceConnectorMock(), +}: { connector?: InferenceConnector } = {}): jest.Mocked<InferenceExecutor> => { + return { + getConnector: jest.fn().mockReturnValue(connector), + invoke: jest.fn(), + }; +}; diff --git a/x-pack/plugins/ingest_pipelines/README.md b/x-pack/platform/plugins/shared/ingest_pipelines/README.md similarity index 100% rename from x-pack/plugins/ingest_pipelines/README.md rename to x-pack/platform/plugins/shared/ingest_pipelines/README.md diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/fixtures.ts b/x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/fixtures.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/__jest__/client_integration/fixtures.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/fixtures.ts diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/http_requests.ts b/x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/helpers/http_requests.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/http_requests.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/helpers/http_requests.ts diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/helpers/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/helpers/index.ts diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/manage_processors.helpers.ts b/x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/helpers/manage_processors.helpers.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/manage_processors.helpers.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/helpers/manage_processors.helpers.ts diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipeline_form.helpers.ts b/x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/helpers/pipeline_form.helpers.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipeline_form.helpers.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/helpers/pipeline_form.helpers.ts diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_clone.helpers.ts b/x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/helpers/pipelines_clone.helpers.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_clone.helpers.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/helpers/pipelines_clone.helpers.ts diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_create.helpers.ts b/x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/helpers/pipelines_create.helpers.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_create.helpers.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/helpers/pipelines_create.helpers.ts diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_create_from_csv.helpers.ts b/x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/helpers/pipelines_create_from_csv.helpers.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_create_from_csv.helpers.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/helpers/pipelines_create_from_csv.helpers.ts diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_edit.helpers.ts b/x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/helpers/pipelines_edit.helpers.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_edit.helpers.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/helpers/pipelines_edit.helpers.ts diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_list.helpers.ts b/x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/helpers/pipelines_list.helpers.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/pipelines_list.helpers.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/helpers/pipelines_list.helpers.ts diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/setup_environment.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/helpers/setup_environment.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/__jest__/client_integration/helpers/setup_environment.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/helpers/setup_environment.tsx diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/ingest_pipelines_clone.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/ingest_pipelines_clone.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/__jest__/client_integration/ingest_pipelines_clone.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/ingest_pipelines_clone.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/ingest_pipelines_create.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/ingest_pipelines_create.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/__jest__/client_integration/ingest_pipelines_create.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/ingest_pipelines_create.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/ingest_pipelines_create_from_csv.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/ingest_pipelines_create_from_csv.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/__jest__/client_integration/ingest_pipelines_create_from_csv.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/ingest_pipelines_create_from_csv.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/ingest_pipelines_edit.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/ingest_pipelines_edit.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/__jest__/client_integration/ingest_pipelines_edit.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/ingest_pipelines_edit.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/ingest_pipelines_list.test.ts b/x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/ingest_pipelines_list.test.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/__jest__/client_integration/ingest_pipelines_list.test.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/ingest_pipelines_list.test.ts diff --git a/x-pack/plugins/ingest_pipelines/__jest__/client_integration/manage_processors.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/manage_processors.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/__jest__/client_integration/manage_processors.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/__jest__/client_integration/manage_processors.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/common/constants.ts b/x-pack/platform/plugins/shared/ingest_pipelines/common/constants.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/common/constants.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/common/constants.ts diff --git a/x-pack/plugins/ingest_pipelines/common/lib/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/common/lib/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/common/lib/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/common/lib/index.ts diff --git a/x-pack/plugins/ingest_pipelines/common/lib/pipeline_serialization.test.ts b/x-pack/platform/plugins/shared/ingest_pipelines/common/lib/pipeline_serialization.test.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/common/lib/pipeline_serialization.test.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/common/lib/pipeline_serialization.test.ts diff --git a/x-pack/plugins/ingest_pipelines/common/lib/pipeline_serialization.ts b/x-pack/platform/plugins/shared/ingest_pipelines/common/lib/pipeline_serialization.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/common/lib/pipeline_serialization.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/common/lib/pipeline_serialization.ts diff --git a/x-pack/plugins/ingest_pipelines/common/types.ts b/x-pack/platform/plugins/shared/ingest_pipelines/common/types.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/common/types.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/common/types.ts diff --git a/x-pack/platform/plugins/shared/ingest_pipelines/jest.config.js b/x-pack/platform/plugins/shared/ingest_pipelines/jest.config.js new file mode 100644 index 0000000000000..36819e3814d56 --- /dev/null +++ b/x-pack/platform/plugins/shared/ingest_pipelines/jest.config.js @@ -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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/platform/plugins/shared/ingest_pipelines'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/platform/plugins/shared/ingest_pipelines', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/platform/plugins/shared/ingest_pipelines/{common,public,server}/**/*.{ts,tsx}', + ], +}; diff --git a/x-pack/plugins/ingest_pipelines/kibana.jsonc b/x-pack/platform/plugins/shared/ingest_pipelines/kibana.jsonc similarity index 100% rename from x-pack/plugins/ingest_pipelines/kibana.jsonc rename to x-pack/platform/plugins/shared/ingest_pipelines/kibana.jsonc diff --git a/x-pack/plugins/ingest_pipelines/public/application/app.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/app.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/app.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/app.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/README.md b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/README.md similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/README.md rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/README.md diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/constants.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/constants.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/constants.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/constants.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/http_requests.helpers.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/http_requests.helpers.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/http_requests.helpers.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/http_requests.helpers.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/pipeline_processors_editor.helpers.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/pipeline_processors_editor.helpers.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/pipeline_processors_editor.helpers.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/pipeline_processors_editor.helpers.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/pipeline_processors_editor.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/pipeline_processors_editor.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/pipeline_processors_editor.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/pipeline_processors_editor.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/append.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/append.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/append.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/append.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/attachment.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/attachment.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/attachment.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/attachment.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/bytes.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/bytes.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/bytes.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/bytes.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/circle.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/circle.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/circle.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/circle.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/common_processor_fields.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/common_processor_fields.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/common_processor_fields.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/common_processor_fields.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/community_id.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/community_id.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/community_id.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/community_id.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/convert.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/convert.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/convert.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/convert.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/csv.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/csv.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/csv.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/csv.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/date.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/date.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/date.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/date.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/date_index.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/date_index.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/date_index.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/date_index.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/dot_expander.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/dot_expander.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/dot_expander.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/dot_expander.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/enrich.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/enrich.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/enrich.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/enrich.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/fail.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/fail.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/fail.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/fail.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/fingerprint.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/fingerprint.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/fingerprint.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/fingerprint.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/foreach.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/foreach.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/foreach.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/foreach.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/geo_grid.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/geo_grid.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/geo_grid.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/geo_grid.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/grok.test.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/grok.test.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/grok.test.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/grok.test.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/inference.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/inference.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/inference.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/inference.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/network_direction.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/network_direction.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/network_direction.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/network_direction.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/pipeline.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/pipeline.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/pipeline.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/pipeline.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/processor.helpers.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/processor.helpers.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/processor.helpers.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/processor.helpers.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/processor_form.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/processor_form.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/processor_form.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/processor_form.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/redact.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/redact.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/redact.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/redact.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/registered_domain.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/registered_domain.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/registered_domain.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/registered_domain.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/reroute.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/reroute.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/reroute.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/reroute.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/script.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/script.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/script.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/script.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/set.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/set.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/set.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/set.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/uri_parts.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/uri_parts.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/uri_parts.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/uri_parts.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/user_agent.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/user_agent.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/user_agent.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors/user_agent.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors_editor.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors_editor.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors_editor.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/processors_editor.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.helpers.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.helpers.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.helpers.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.helpers.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/__jest__/test_pipeline.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/_shared.scss b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/_shared.scss similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/_shared.scss rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/_shared.scss diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/add_processor_button.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/add_processor_button.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/add_processor_button.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/add_processor_button.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/button.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/button.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/button.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/button.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/modal_provider.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/modal_provider.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/modal_provider.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/modal_provider.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/modal_provider.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/modal_provider.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/modal_provider.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/load_from_json/modal_provider.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/on_failure_processors_title.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/on_failure_processors_title.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/on_failure_processors_title.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/on_failure_processors_title.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/context_menu.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/context_menu.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/context_menu.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/context_menu.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/i18n_texts.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/i18n_texts.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/i18n_texts.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/i18n_texts.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/pipeline_processors_editor_item.container.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/pipeline_processors_editor_item.container.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/pipeline_processors_editor_item.container.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/pipeline_processors_editor_item.container.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/pipeline_processors_editor_item.scss b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/pipeline_processors_editor_item.scss similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/pipeline_processors_editor_item.scss rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/pipeline_processors_editor_item.scss diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/pipeline_processors_editor_item.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/pipeline_processors_editor_item.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/pipeline_processors_editor_item.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/pipeline_processors_editor_item.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/types.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/types.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/types.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item/types.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item_status.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item_status.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item_status.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item_status.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item_tooltip/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item_tooltip/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item_tooltip/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item_tooltip/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item_tooltip/pipeline_processors_editor_item_toolip.scss b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item_tooltip/pipeline_processors_editor_item_toolip.scss similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item_tooltip/pipeline_processors_editor_item_toolip.scss rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item_tooltip/pipeline_processors_editor_item_toolip.scss diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item_tooltip/pipeline_processors_editor_item_tooltip.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item_tooltip/pipeline_processors_editor_item_tooltip.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item_tooltip/pipeline_processors_editor_item_tooltip.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item_tooltip/pipeline_processors_editor_item_tooltip.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item_tooltip/processor_information.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item_tooltip/processor_information.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item_tooltip/processor_information.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/pipeline_processors_editor_item_tooltip/processor_information.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/add_processor_form.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/add_processor_form.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/add_processor_form.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/add_processor_form.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/documentation_button.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/documentation_button.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/documentation_button.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/documentation_button.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/edit_processor_form.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/edit_processor_form.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/edit_processor_form.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/edit_processor_form.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/drag_and_drop_text_list.scss b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/drag_and_drop_text_list.scss similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/drag_and_drop_text_list.scss rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/drag_and_drop_text_list.scss diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/drag_and_drop_text_list.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/drag_and_drop_text_list.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/drag_and_drop_text_list.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/drag_and_drop_text_list.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/input_list.scss b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/input_list.scss similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/input_list.scss rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/input_list.scss diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/input_list.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/input_list.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/input_list.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/input_list.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/text_editor.scss b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/text_editor.scss similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/text_editor.scss rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/text_editor.scss diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/text_editor.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/text_editor.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/text_editor.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/text_editor.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/xjson_editor.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/xjson_editor.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/xjson_editor.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/field_components/xjson_editor.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processor_form.container.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processor_form.container.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processor_form.container.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processor_form.container.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processor_output/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processor_output/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processor_output/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processor_output/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processor_output/processor_output.scss b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processor_output/processor_output.scss similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processor_output/processor_output.scss rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processor_output/processor_output.scss diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processor_output/processor_output.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processor_output/processor_output.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processor_output/processor_output.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processor_output/processor_output.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processor_settings_fields.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processor_settings_fields.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processor_settings_fields.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processor_settings_fields.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/append.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/append.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/append.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/append.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/attachment.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/attachment.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/attachment.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/attachment.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/bytes.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/bytes.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/bytes.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/bytes.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/circle.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/circle.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/circle.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/circle.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/common_processor_fields.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/common_processor_fields.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/common_processor_fields.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/common_processor_fields.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/field_name_field.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/field_name_field.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/field_name_field.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/field_name_field.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/ignore_missing_field.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/ignore_missing_field.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/ignore_missing_field.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/ignore_missing_field.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/processor_type_field.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/processor_type_field.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/processor_type_field.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/processor_type_field.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/properties_field.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/properties_field.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/properties_field.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/properties_field.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/target_field.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/target_field.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/target_field.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/common_fields/target_field.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/community_id.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/community_id.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/community_id.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/community_id.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/convert.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/convert.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/convert.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/convert.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/csv.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/csv.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/csv.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/csv.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/custom.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/custom.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/custom.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/custom.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/date.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/date.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/date.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/date.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/date_index_name.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/date_index_name.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/date_index_name.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/date_index_name.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/dissect.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/dissect.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/dissect.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/dissect.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/dot_expander.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/dot_expander.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/dot_expander.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/dot_expander.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/drop.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/drop.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/drop.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/drop.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/enrich.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/enrich.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/enrich.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/enrich.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/fail.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/fail.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/fail.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/fail.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/fingerprint.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/fingerprint.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/fingerprint.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/fingerprint.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/foreach.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/foreach.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/foreach.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/foreach.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/geogrid.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/geogrid.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/geogrid.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/geogrid.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/geoip.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/geoip.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/geoip.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/geoip.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/grok.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/grok.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/grok.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/grok.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/gsub.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/gsub.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/gsub.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/gsub.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/html_strip.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/html_strip.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/html_strip.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/html_strip.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/inference.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/inference.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/inference.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/inference.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/ip_location.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/ip_location.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/ip_location.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/ip_location.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/join.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/join.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/join.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/join.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/json.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/json.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/json.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/json.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/kv.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/kv.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/kv.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/kv.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/lowercase.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/lowercase.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/lowercase.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/lowercase.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/network_direction.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/network_direction.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/network_direction.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/network_direction.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/pipeline.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/pipeline.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/pipeline.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/pipeline.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/redact.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/redact.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/redact.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/redact.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/registered_domain.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/registered_domain.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/registered_domain.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/registered_domain.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/remove.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/remove.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/remove.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/remove.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/rename.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/rename.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/rename.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/rename.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/reroute.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/reroute.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/reroute.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/reroute.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/script.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/script.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/script.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/script.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/set.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/set.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/set.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/set.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/set_security_user.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/set_security_user.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/set_security_user.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/set_security_user.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/shared.test.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/shared.test.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/shared.test.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/shared.test.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/shared.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/shared.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/shared.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/shared.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/sort.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/sort.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/sort.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/sort.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/split.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/split.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/split.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/split.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/trim.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/trim.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/trim.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/trim.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/uppercase.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/uppercase.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/uppercase.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/uppercase.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/uri_parts.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/uri_parts.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/uri_parts.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/uri_parts.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/url_decode.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/url_decode.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/url_decode.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/url_decode.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/user_agent.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/user_agent.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/user_agent.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_form/processors/user_agent.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_remove_modal.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_remove_modal.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processor_remove_modal.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processor_remove_modal.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_empty_prompt.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processors_empty_prompt.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_empty_prompt.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processors_empty_prompt.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_header.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processors_header.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_header.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processors_header.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/components/drop_zone_button.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/components/drop_zone_button.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/components/drop_zone_button.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/components/drop_zone_button.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/components/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/components/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/components/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/components/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/components/private_tree.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/components/private_tree.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/components/private_tree.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/components/private_tree.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/components/tree_node.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/components/tree_node.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/components/tree_node.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/components/tree_node.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/processors_tree.scss b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/processors_tree.scss similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/processors_tree.scss rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/processors_tree.scss diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/processors_tree.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/processors_tree.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/processors_tree.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/processors_tree.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/utils.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/utils.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/utils.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/processors_tree/utils.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/shared/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/shared/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/map_processor_type_to_form.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/shared/map_processor_type_to_form.tsx similarity index 99% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/map_processor_type_to_form.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/shared/map_processor_type_to_form.tsx index 4d4e244ac25a4..31dec6ab573dc 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/map_processor_type_to_form.tsx +++ b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/shared/map_processor_type_to_form.tsx @@ -481,7 +481,7 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = { ip_location: { category: processorCategories.DATA_ENRICHMENT, FieldsComponent: IpLocation, - docLinkPath: '/geoip-processor.html', + docLinkPath: '/ip-location-processor.html', label: i18n.translate('xpack.ingestPipelines.processors.label.ipLocation', { defaultMessage: 'IP Location', }), diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/status_icons/error_icon.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/shared/status_icons/error_icon.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/status_icons/error_icon.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/shared/status_icons/error_icon.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/status_icons/error_ignored_icon.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/shared/status_icons/error_ignored_icon.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/status_icons/error_ignored_icon.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/shared/status_icons/error_ignored_icon.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/status_icons/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/shared/status_icons/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/status_icons/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/shared/status_icons/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/status_icons/skipped_icon.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/shared/status_icons/skipped_icon.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/status_icons/skipped_icon.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/shared/status_icons/skipped_icon.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/stringify_value_description.test.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/shared/stringify_value_description.test.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/stringify_value_description.test.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/shared/stringify_value_description.test.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/stringify_value_description.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/shared/stringify_value_description.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/shared/stringify_value_description.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/shared/stringify_value_description.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/add_documents_button.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/add_documents_button.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/add_documents_button.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/add_documents_button.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/documents_dropdown/documents_dropdown.scss b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/documents_dropdown/documents_dropdown.scss similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/documents_dropdown/documents_dropdown.scss rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/documents_dropdown/documents_dropdown.scss diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/documents_dropdown/documents_dropdown.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/documents_dropdown/documents_dropdown.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/documents_dropdown/documents_dropdown.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/documents_dropdown/documents_dropdown.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/documents_dropdown/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/documents_dropdown/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/documents_dropdown/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/documents_dropdown/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_output_button.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_output_button.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_output_button.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_output_button.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_actions.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_actions.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_actions.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_actions.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_flyout.container.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_flyout.container.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_flyout.container.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_flyout.container.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_flyout.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_flyout.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_flyout.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_flyout.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/add_docs_accordion/add_docs_accordion.scss b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/add_docs_accordion/add_docs_accordion.scss similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/add_docs_accordion/add_docs_accordion.scss rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/add_docs_accordion/add_docs_accordion.scss diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/add_docs_accordion/add_docs_accordion.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/add_docs_accordion/add_docs_accordion.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/add_docs_accordion/add_docs_accordion.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/add_docs_accordion/add_docs_accordion.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/add_docs_accordion/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/add_docs_accordion/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/add_docs_accordion/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/add_docs_accordion/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/add_document_form.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/add_document_form.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/add_document_form.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/add_document_form.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/reset_documents_modal.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/reset_documents_modal.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/reset_documents_modal.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/reset_documents_modal.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/tab_documents.scss b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/tab_documents.scss similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/tab_documents.scss rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/tab_documents.scss diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/tab_documents.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/tab_documents.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/tab_documents.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_documents/tab_documents.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_output.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_output.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_output.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/tab_output.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/test_pipeline_tabs.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/test_pipeline_tabs.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/test_pipeline_tabs.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/test_pipeline/test_pipeline_tabs/test_pipeline_tabs.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/constants.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/constants.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/constants.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/constants.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/context/context.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/context/context.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/context/context.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/context/context.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/context/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/context/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/context/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/context/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/context/processors_context.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/context/processors_context.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/context/processors_context.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/context/processors_context.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/context/test_pipeline_context.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/context/test_pipeline_context.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/context/test_pipeline_context.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/context/test_pipeline_context.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/deserialize.test.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/deserialize.test.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/deserialize.test.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/deserialize.test.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/deserialize.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/deserialize.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/deserialize.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/deserialize.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/editors/global_on_failure_processors_editor.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/editors/global_on_failure_processors_editor.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/editors/global_on_failure_processors_editor.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/editors/global_on_failure_processors_editor.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/editors/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/editors/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/editors/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/editors/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/editors/processors_editor.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/editors/processors_editor.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/editors/processors_editor.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/editors/processors_editor.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/pipeline_editor.scss b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/pipeline_editor.scss similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/pipeline_editor.scss rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/pipeline_editor.scss diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/pipeline_editor.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/pipeline_editor.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/pipeline_editor.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/pipeline_editor.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/processors_reducer/constants.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/processors_reducer/constants.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/processors_reducer/constants.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/processors_reducer/constants.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/processors_reducer/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/processors_reducer/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/processors_reducer/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/processors_reducer/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/processors_reducer/processors_reducer.test.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/processors_reducer/processors_reducer.test.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/processors_reducer/processors_reducer.test.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/processors_reducer/processors_reducer.test.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/processors_reducer/processors_reducer.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/processors_reducer/processors_reducer.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/processors_reducer/processors_reducer.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/processors_reducer/processors_reducer.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/processors_reducer/utils.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/processors_reducer/utils.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/processors_reducer/utils.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/processors_reducer/utils.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/serialize.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/serialize.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/serialize.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/serialize.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/types.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/types.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/types.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/types.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/use_is_mounted.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/use_is_mounted.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/use_is_mounted.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/use_is_mounted.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/utils.test.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/utils.test.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/utils.test.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/utils.test.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/utils.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/utils.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_editor/utils.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/utils.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/bulk_request_panel.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/bulk_request_panel.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/bulk_request_panel.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/bulk_request_panel.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/collapsible_panel.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/collapsible_panel.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/collapsible_panel.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/collapsible_panel.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/pipeline_form.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/pipeline_form.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_error/error_utils.test.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_error/error_utils.test.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_error/error_utils.test.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_error/error_utils.test.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_error/error_utils.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_error/error_utils.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_error/error_utils.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_error/error_utils.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_error/i18n_texts.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_error/i18n_texts.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_error/i18n_texts.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_error/i18n_texts.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_error/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_error/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_error/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_error/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_error/pipeline_form_error.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_error/pipeline_form_error.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_error/pipeline_form_error.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_error/pipeline_form_error.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_request_flyout/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/pipeline_request_flyout/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_request_flyout/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/pipeline_request_flyout/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_request_flyout/pipeline_request_flyout.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/pipeline_request_flyout/pipeline_request_flyout.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_request_flyout/pipeline_request_flyout.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/pipeline_request_flyout/pipeline_request_flyout.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/schema.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/schema.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/schema.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/schema.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/types.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/types.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/types.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/types.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/utils.test.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/utils.test.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/utils.test.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/utils.test.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/utils.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/utils.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/utils.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_form/utils.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/constants/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/constants/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/constants/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/constants/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/hooks/index.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/hooks/index.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/hooks/index.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/hooks/index.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/hooks/redirect_path.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/hooks/redirect_path.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/hooks/redirect_path.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/hooks/redirect_path.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/hooks/redirect_path.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/hooks/redirect_path.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/hooks/redirect_path.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/hooks/redirect_path.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/index.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/index.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/index.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/index.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/lib/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/lib/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/lib/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/lib/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/lib/utils.test.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/lib/utils.test.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/lib/utils.test.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/lib/utils.test.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/lib/utils.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/lib/utils.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/lib/utils.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/lib/utils.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/mount_management_section.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/mount_management_section.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/mount_management_section.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/mount_management_section.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/add_database_modal.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/add_database_modal.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/add_database_modal.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/add_database_modal.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/constants.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/constants.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/constants.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/constants.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/delete_database_modal.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/delete_database_modal.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/delete_database_modal.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/delete_database_modal.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/empty_list.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/empty_list.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/empty_list.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/empty_list.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/geoip_list.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/geoip_list.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/geoip_list.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/geoip_list.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/get_error_message.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/get_error_message.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/get_error_message.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/get_error_message.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/manage_processors.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/manage_processors.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/manage_processors.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/manage_processors.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/use_check_manage_processors_privileges.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/use_check_manage_processors_privileges.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/use_check_manage_processors_privileges.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/use_check_manage_processors_privileges.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/utils.test.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/utils.test.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/utils.test.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/utils.test.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/utils.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/utils.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/manage_processors/utils.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/manage_processors/utils.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_clone/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_clone/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_clone/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_clone/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_clone/pipelines_clone.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_clone/pipelines_clone.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_clone/pipelines_clone.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_clone/pipelines_clone.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_create/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_create/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create/pipelines_create.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_create/pipelines_create.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create/pipelines_create.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_create/pipelines_create.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/error_display.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_create_from_csv/error_display.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/error_display.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_create_from_csv/error_display.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_create_from_csv/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_create_from_csv/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/instructions.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_create_from_csv/instructions.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/instructions.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_create_from_csv/instructions.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/main.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_create_from_csv/main.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/main.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_create_from_csv/main.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/pipelines_csv_uploader.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_create_from_csv/pipelines_csv_uploader.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/pipelines_csv_uploader.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_create_from_csv/pipelines_csv_uploader.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/pipelines_preview.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_create_from_csv/pipelines_preview.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_create_from_csv/pipelines_preview.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_create_from_csv/pipelines_preview.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_edit/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_edit/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_edit/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_edit/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_edit/pipelines_edit.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_edit/pipelines_edit.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_edit/pipelines_edit.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_edit/pipelines_edit.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/delete_modal.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_list/delete_modal.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/delete_modal.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_list/delete_modal.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/details_flyout.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_list/details_flyout.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/details_flyout.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_list/details_flyout.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/details_json_block.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_list/details_json_block.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/details_json_block.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_list/details_json_block.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/empty_list.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_list/empty_list.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/empty_list.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_list/empty_list.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_list/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_list/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/main.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_list/main.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/main.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_list/main.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/not_found_flyout.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_list/not_found_flyout.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/not_found_flyout.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_list/not_found_flyout.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/serializers.test.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_list/serializers.test.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/serializers.test.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_list/serializers.test.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/table.tsx b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_list/table.tsx similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/table.tsx rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/sections/pipelines_list/table.tsx diff --git a/x-pack/plugins/ingest_pipelines/public/application/services/api.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/services/api.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/services/api.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/services/api.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/services/breadcrumbs.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/services/breadcrumbs.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/services/breadcrumbs.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/services/breadcrumbs.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/services/documentation.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/services/documentation.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/services/documentation.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/services/documentation.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/services/file_reader.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/services/file_reader.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/services/file_reader.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/services/file_reader.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/services/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/services/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/services/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/services/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/services/navigation.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/services/navigation.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/services/navigation.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/services/navigation.ts diff --git a/x-pack/plugins/ingest_pipelines/public/application/services/ui_metric.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/application/services/ui_metric.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/application/services/ui_metric.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/application/services/ui_metric.ts diff --git a/x-pack/plugins/ingest_pipelines/public/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/index.ts diff --git a/x-pack/plugins/ingest_pipelines/public/locator.test.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/locator.test.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/locator.test.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/locator.test.ts diff --git a/x-pack/plugins/ingest_pipelines/public/locator.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/locator.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/locator.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/locator.ts diff --git a/x-pack/plugins/ingest_pipelines/public/plugin.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/plugin.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/plugin.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/plugin.ts diff --git a/x-pack/plugins/ingest_pipelines/public/shared_imports.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/shared_imports.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/shared_imports.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/shared_imports.ts diff --git a/x-pack/plugins/ingest_pipelines/public/types.ts b/x-pack/platform/plugins/shared/ingest_pipelines/public/types.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/public/types.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/public/types.ts diff --git a/x-pack/plugins/ingest_pipelines/server/config.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/config.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/config.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/config.ts diff --git a/x-pack/plugins/ingest_pipelines/server/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/index.ts diff --git a/x-pack/plugins/ingest_pipelines/server/lib/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/lib/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/lib/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/lib/index.ts diff --git a/x-pack/plugins/ingest_pipelines/server/lib/mapper.test.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/lib/mapper.test.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/lib/mapper.test.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/lib/mapper.test.ts diff --git a/x-pack/plugins/ingest_pipelines/server/lib/mapper.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/lib/mapper.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/lib/mapper.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/lib/mapper.ts diff --git a/x-pack/plugins/ingest_pipelines/server/plugin.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/plugin.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/plugin.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/plugin.ts diff --git a/x-pack/plugins/ingest_pipelines/server/routes/api/create.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/create.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/routes/api/create.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/create.ts diff --git a/x-pack/plugins/ingest_pipelines/server/routes/api/database/create.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/database/create.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/routes/api/database/create.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/database/create.ts diff --git a/x-pack/plugins/ingest_pipelines/server/routes/api/database/delete.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/database/delete.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/routes/api/database/delete.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/database/delete.ts diff --git a/x-pack/plugins/ingest_pipelines/server/routes/api/database/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/database/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/routes/api/database/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/database/index.ts diff --git a/x-pack/plugins/ingest_pipelines/server/routes/api/database/list.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/database/list.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/routes/api/database/list.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/database/list.ts diff --git a/x-pack/plugins/ingest_pipelines/server/routes/api/database/normalize_database_name.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/database/normalize_database_name.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/routes/api/database/normalize_database_name.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/database/normalize_database_name.ts diff --git a/x-pack/plugins/ingest_pipelines/server/routes/api/database/serialization.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/database/serialization.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/routes/api/database/serialization.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/database/serialization.ts diff --git a/x-pack/plugins/ingest_pipelines/server/routes/api/delete.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/delete.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/routes/api/delete.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/delete.ts diff --git a/x-pack/plugins/ingest_pipelines/server/routes/api/documents.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/documents.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/routes/api/documents.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/documents.ts diff --git a/x-pack/plugins/ingest_pipelines/server/routes/api/get.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/get.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/routes/api/get.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/get.ts diff --git a/x-pack/plugins/ingest_pipelines/server/routes/api/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/routes/api/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/index.ts diff --git a/x-pack/plugins/ingest_pipelines/server/routes/api/parse_csv.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/parse_csv.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/routes/api/parse_csv.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/parse_csv.ts diff --git a/x-pack/plugins/ingest_pipelines/server/routes/api/privileges.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/privileges.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/routes/api/privileges.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/privileges.ts diff --git a/x-pack/plugins/ingest_pipelines/server/routes/api/shared/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/shared/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/routes/api/shared/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/shared/index.ts diff --git a/x-pack/plugins/ingest_pipelines/server/routes/api/shared/pipeline_schema.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/shared/pipeline_schema.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/routes/api/shared/pipeline_schema.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/shared/pipeline_schema.ts diff --git a/x-pack/plugins/ingest_pipelines/server/routes/api/simulate.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/simulate.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/routes/api/simulate.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/simulate.ts diff --git a/x-pack/plugins/ingest_pipelines/server/routes/api/update.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/update.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/routes/api/update.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/routes/api/update.ts diff --git a/x-pack/plugins/ingest_pipelines/server/routes/index.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/routes/index.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/routes/index.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/routes/index.ts diff --git a/x-pack/plugins/ingest_pipelines/server/shared_imports.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/shared_imports.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/shared_imports.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/shared_imports.ts diff --git a/x-pack/plugins/ingest_pipelines/server/types.ts b/x-pack/platform/plugins/shared/ingest_pipelines/server/types.ts similarity index 100% rename from x-pack/plugins/ingest_pipelines/server/types.ts rename to x-pack/platform/plugins/shared/ingest_pipelines/server/types.ts diff --git a/x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.json b/x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.json new file mode 100644 index 0000000000000..b2bfeccf6733a --- /dev/null +++ b/x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.json @@ -0,0 +1,46 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*", + "__jest__/**/*", + "../../../../../typings/**/*" + ], + "kbn_references": [ + "@kbn/core", + "@kbn/licensing-plugin", + "@kbn/features-plugin", + "@kbn/security-plugin", + "@kbn/file-upload-plugin", + "@kbn/es-ui-shared-plugin", + "@kbn/kibana-react-plugin", + "@kbn/management-plugin", + "@kbn/share-plugin", + "@kbn/usage-collection-plugin", + "@kbn/utility-types", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/analytics", + "@kbn/monaco", + "@kbn/test-jest-helpers", + "@kbn/config-schema", + "@kbn/shared-ux-router", + "@kbn/core-ui-settings-browser", + "@kbn/code-editor", + "@kbn/react-kibana-context-render", + "@kbn/console-plugin", + "@kbn/react-kibana-context-theme", + "@kbn/unsaved-changes-prompt", + "@kbn/core-http-browser-mocks", + "@kbn/shared-ux-table-persist", + "@kbn/core-http-browser", + "@kbn/core-plugins-server" + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/x-pack/platform/plugins/shared/ml/common/util/group_color_utils.ts b/x-pack/platform/plugins/shared/ml/common/util/group_color_utils.ts index 77d16b8aaad50..1e58ce6e67eae 100644 --- a/x-pack/platform/plugins/shared/ml/common/util/group_color_utils.ts +++ b/x-pack/platform/plugins/shared/ml/common/util/group_color_utils.ts @@ -5,28 +5,29 @@ * 2.0. */ -import { euiDarkVars as euiVars } from '@kbn/ui-theme'; +import type { EuiThemeComputed } from '@elastic/eui'; import { stringHash } from '@kbn/ml-string-hash'; -const COLORS = [ - euiVars.euiColorVis0, - euiVars.euiColorVis1, - euiVars.euiColorVis2, - euiVars.euiColorVis3, - euiVars.euiColorVis4, - euiVars.euiColorVis5, - euiVars.euiColorVis6, - euiVars.euiColorVis7, - euiVars.euiColorVis8, - euiVars.euiColorVis9, - euiVars.euiColorDarkShade, - euiVars.euiColorPrimary, -]; - const colorMap: Record<string, string> = Object.create(null); -export function tabColor(name: string): string { +export function tabColor(name: string, euiTheme: EuiThemeComputed): string { + const COLORS = [ + // Amsterdam + Borealis + euiTheme.colors.vis.euiColorVis0, + euiTheme.colors.vis.euiColorVis1, + euiTheme.colors.vis.euiColorVis2, + euiTheme.colors.vis.euiColorVis3, + euiTheme.colors.vis.euiColorVis4, + euiTheme.colors.vis.euiColorVis5, + euiTheme.colors.vis.euiColorVis6, + euiTheme.colors.vis.euiColorVis7, + euiTheme.colors.vis.euiColorVis8, + euiTheme.colors.vis.euiColorVis9, + euiTheme.colors.darkShade, + euiTheme.colors.primary, + ]; + if (colorMap[name] === undefined) { const n = stringHash(name); const color = COLORS[n % COLORS.length]; diff --git a/x-pack/platform/plugins/shared/ml/public/application/components/anomalies_table/links_menu.tsx b/x-pack/platform/plugins/shared/ml/public/application/components/anomalies_table/links_menu.tsx index 1f81a94227611..dd963136f29ce 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/components/anomalies_table/links_menu.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/components/anomalies_table/links_menu.tsx @@ -13,6 +13,7 @@ import React, { useEffect, useMemo, useState } from 'react'; import useMountedState from 'react-use/lib/useMountedState'; import { + useEuiTheme, EuiButtonIcon, EuiContextMenuItem, EuiContextMenuPanel, @@ -80,6 +81,7 @@ interface LinksMenuProps { } export const LinksMenuUI = (props: LinksMenuProps) => { + const { euiTheme } = useEuiTheme(); const isMounted = useMountedState(); const [dataViewId, setDataViewId] = useState<string | null>(null); @@ -195,7 +197,8 @@ export const LinksMenuUI = (props: LinksMenuProps) => { ) => { // Create a layer for each of the geoFields const initialLayers = getInitialSourceIndexFieldLayers( - sourceIndicesWithGeoFields[anomaly.jobId] + sourceIndicesWithGeoFields[anomaly.jobId], + euiTheme ); // Widen the timerange by one bucket span on start/end to increase chances of always having data on the map const anomalyBucketStartMoment = moment(anomaly.source.timestamp).tz( diff --git a/x-pack/platform/plugins/shared/ml/public/application/components/chart_tooltip/chart_tooltip_styles.ts b/x-pack/platform/plugins/shared/ml/public/application/components/chart_tooltip/chart_tooltip_styles.ts index c53bdb5242f3c..be4735abb2148 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/components/chart_tooltip/chart_tooltip_styles.ts +++ b/x-pack/platform/plugins/shared/ml/public/application/components/chart_tooltip/chart_tooltip_styles.ts @@ -7,29 +7,23 @@ import { css } from '@emotion/react'; -import { mathWithUnits, transparentize, useEuiTheme } from '@elastic/eui'; +import { mathWithUnits, transparentize, useEuiFontSize, useEuiTheme } from '@elastic/eui'; // @ts-expect-error style types not defined import { euiToolTipStyles } from '@elastic/eui/lib/components/tool_tip/tool_tip.styles'; -import { useCurrentEuiThemeVars } from '@kbn/ml-kibana-theme'; - -import { useMlKibana } from '../../contexts/kibana'; - export const useChartTooltipStyles = () => { - const euiThemeContext = useEuiTheme(); - const { - services: { theme }, - } = useMlKibana(); - const { euiTheme } = useCurrentEuiThemeVars(theme); - const euiStyles = euiToolTipStyles(euiThemeContext); + const theme = useEuiTheme(); + const { euiTheme } = theme; + const euiStyles = euiToolTipStyles(theme); + const euiFontSizeXS = useEuiFontSize('xs').fontSize; return { mlChartTooltip: css([ euiStyles.euiToolTip, { - fontSize: euiTheme.euiFontSizeXS, + fontSize: euiFontSizeXS, padding: 0, - transition: `opacity ${euiTheme.euiAnimSpeedNormal}`, + transition: `opacity ${euiTheme.animation.normal}`, pointerEvents: 'none', userSelect: 'none', maxWidth: '512px', @@ -37,26 +31,26 @@ export const useChartTooltipStyles = () => { }, ]), mlChartTooltipList: css({ - margin: euiTheme.euiSizeXS, - paddingBottom: euiTheme.euiSizeXS, + margin: euiTheme.size.xs, + paddingBottom: euiTheme.size.xs, }), mlChartTooltipHeader: css({ - fontWeight: euiTheme.euiFontWeightBold, - padding: `${euiTheme.euiSizeXS} ${mathWithUnits(euiTheme.euiSizeS, (x) => x * 2)}`, - marginBottom: euiTheme.euiSizeXS, - borderBottom: `1px solid ${transparentize(euiTheme.euiBorderColor, 0.8)}`, + fontWeight: euiTheme.font.weight.bold, + padding: `${euiTheme.size.xs} ${mathWithUnits(euiTheme.size.xs, (x) => x * 2)}`, + marginBottom: euiTheme.size.xs, + borderBottom: `1px solid ${transparentize(euiTheme.border.color, 0.8)}`, }), mlChartTooltipItem: css({ display: 'flex', padding: '3px', boxSizing: 'border-box', - borderLeft: `${euiTheme.euiSizeXS} solid transparent`, + borderLeft: `${euiTheme.size.xs} solid transparent`, }), mlChartTooltipLabel: css({ minWidth: '1px', }), mlChartTooltipValue: css({ - fontWeight: euiTheme.euiFontWeightBold, + fontWeight: euiTheme.font.weight.bold, textAlign: 'right', fontFeatureSettings: 'tnum', marginLeft: '8px', diff --git a/x-pack/platform/plugins/shared/ml/public/application/components/collapsible_panel/collapsible_panel.tsx b/x-pack/platform/plugins/shared/ml/public/application/components/collapsible_panel/collapsible_panel.tsx index b33d056467d1a..8d91d6eae009f 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/components/collapsible_panel/collapsible_panel.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/components/collapsible_panel/collapsible_panel.tsx @@ -6,6 +6,7 @@ */ import { + useEuiTheme, EuiBadge, EuiButtonIcon, EuiFlexGroup, @@ -18,7 +19,6 @@ import type { PropsWithChildren } from 'react'; import React, { type FC } from 'react'; import { i18n } from '@kbn/i18n'; import { PanelHeaderItems } from './panel_header_items'; -import { useCurrentThemeVars } from '../../contexts/kibana'; export interface CollapsiblePanelProps { isOpen: boolean; @@ -36,15 +36,15 @@ export const CollapsiblePanel: FC<PropsWithChildren<CollapsiblePanelProps>> = ({ headerItems, ariaLabel, }) => { - const { euiTheme } = useCurrentThemeVars(); + const { euiTheme } = useEuiTheme(); return ( <EuiSplitPanel.Outer grow hasShadow={false} css={{ - border: `${euiTheme.euiBorderWidthThin} solid ${ - isOpen ? euiTheme.euiBorderColor : 'transparent' + border: `${euiTheme.border.width.thin} solid ${ + isOpen ? euiTheme.border.color : 'transparent' }`, }} > @@ -88,7 +88,7 @@ export const CollapsiblePanel: FC<PropsWithChildren<CollapsiblePanelProps>> = ({ </EuiSplitPanel.Inner> {isOpen ? ( <EuiSplitPanel.Inner - css={{ borderTop: `${euiTheme.euiBorderWidthThin} solid ${euiTheme.euiBorderColor}` }} + css={{ borderTop: `${euiTheme.border.width.thin} solid ${euiTheme.border.color}` }} grow={false} > {children} diff --git a/x-pack/platform/plugins/shared/ml/public/application/components/collapsible_panel/panel_header_items.tsx b/x-pack/platform/plugins/shared/ml/public/application/components/collapsible_panel/panel_header_items.tsx index 75d43e6ebe6f5..bd657a6a58285 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/components/collapsible_panel/panel_header_items.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/components/collapsible_panel/panel_header_items.tsx @@ -6,9 +6,8 @@ */ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { css } from '@emotion/react'; import React, { type FC } from 'react'; -import { useCurrentThemeVars } from '../../contexts/kibana'; +import { useEuiTheme } from '@elastic/eui'; export interface PanelHeaderItems { headerItems: React.ReactElement[]; @@ -16,7 +15,7 @@ export interface PanelHeaderItems { } export const PanelHeaderItems: FC<PanelHeaderItems> = ({ headerItems, compressed = false }) => { - const { euiTheme } = useCurrentThemeVars(); + const { euiTheme } = useEuiTheme(); return ( <EuiFlexGroup gutterSize={compressed ? 's' : 'l'} alignItems={'center'}> @@ -26,12 +25,10 @@ export const PanelHeaderItems: FC<PanelHeaderItems> = ({ headerItems, compressed <div css={ i < headerItems?.length - 1 - ? css` - border-right: ${euiTheme.euiBorderWidthThin} solid ${euiTheme.euiBorderColor}; - padding-right: ${compressed - ? euiTheme.euiPanelPaddingModifiers.paddingSmall - : euiTheme.euiPanelPaddingModifiers.paddingLarge}; - ` + ? { + borderRight: euiTheme.border.thin, + paddingRight: compressed ? euiTheme.size.s : euiTheme.size.l, + } : null } > diff --git a/x-pack/platform/plugins/shared/ml/public/application/components/color_range_legend/color_range_legend.tsx b/x-pack/platform/plugins/shared/ml/public/application/components/color_range_legend/color_range_legend.tsx index 9c121853cf6b4..4051b0632c2c0 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/components/color_range_legend/color_range_legend.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/components/color_range_legend/color_range_legend.tsx @@ -6,36 +6,43 @@ */ import type { FC } from 'react'; -import React, { useEffect, useRef } from 'react'; +import React, { useEffect, useMemo, useRef } from 'react'; import { css } from '@emotion/react'; import d3 from 'd3'; -import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; - -import { euiThemeVars } from '@kbn/ui-theme'; +import { useEuiFontSize, useEuiTheme, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; const COLOR_RANGE_RESOLUTION = 10; // Overrides for d3/svg default styles -const cssOverride = css({ - // Override default font size and color for axis - text: { - fontSize: `calc(${euiThemeVars.euiFontSizeXS} - 2px)`, - fill: euiThemeVars.euiColorDarkShade, - }, - // Override default styles for axis lines - '.axis': { - path: { - fill: 'none', - stroke: 'none', - }, - line: { - fill: 'none', - stroke: euiThemeVars.euiColorMediumShade, - shapeRendering: 'crispEdges', - }, - }, -}); +const useCssOverride = () => { + const { euiTheme } = useEuiTheme(); + const euiFontSizeXS = useEuiFontSize('xs', { unit: 'px' }).fontSize as string; + + return useMemo( + () => + css({ + // Override default font size and color for axis + text: { + fontSize: `calc(${euiFontSizeXS} - 2px)`, + fill: euiTheme.colors.darkShade, + }, + // Override default styles for axis lines + '.axis': { + path: { + fill: 'none', + stroke: 'none', + }, + line: { + fill: 'none', + stroke: euiTheme.colors.mediumShade, + shapeRendering: 'crispEdges', + }, + }, + }), + [euiFontSizeXS, euiTheme] + ); +}; interface ColorRangeLegendProps { colorRange: (d: number) => string; @@ -60,6 +67,7 @@ export const ColorRangeLegend: FC<ColorRangeLegendProps> = ({ title, width = 250, }) => { + const cssOverride = useCssOverride(); const d3Container = useRef<null | SVGSVGElement>(null); const scale = d3.range(COLOR_RANGE_RESOLUTION + 1).map((d) => ({ diff --git a/x-pack/platform/plugins/shared/ml/public/application/components/color_range_legend/index.ts b/x-pack/platform/plugins/shared/ml/public/application/components/color_range_legend/index.ts index 8e0549fb522fb..f614b5ae4ac4b 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/components/color_range_legend/index.ts +++ b/x-pack/platform/plugins/shared/ml/public/application/components/color_range_legend/index.ts @@ -6,7 +6,6 @@ */ export { ColorRangeLegend } from './color_range_legend'; -export type { EuiThemeType } from './use_color_range'; export { colorRangeOptions, colorRangeScaleOptions, diff --git a/x-pack/platform/plugins/shared/ml/public/application/components/color_range_legend/use_color_range.ts b/x-pack/platform/plugins/shared/ml/public/application/components/color_range_legend/use_color_range.ts index 4e4e92b5352f3..49662ab00e510 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/components/color_range_legend/use_color_range.ts +++ b/x-pack/platform/plugins/shared/ml/public/application/components/color_range_legend/use_color_range.ts @@ -6,10 +6,10 @@ */ import d3 from 'd3'; -import type { euiDarkVars as euiThemeDark, euiLightVars as euiThemeLight } from '@kbn/ui-theme'; + +import { useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { useCurrentThemeVars } from '../../contexts/kibana'; /** * Custom color scale factory that takes the amount of feature influencers @@ -148,16 +148,24 @@ export const useColorRange = ( colorRangeScale = COLOR_RANGE_SCALE.LINEAR, featureCount = 1 ) => { - const { euiTheme } = useCurrentThemeVars(); + const { euiTheme } = useEuiTheme(); const colorRanges: Record<COLOR_RANGE, string[]> = { [COLOR_RANGE.BLUE]: [ - d3.rgb(euiTheme.euiColorEmptyShade).toString(), - d3.rgb(euiTheme.euiColorVis1).toString(), + d3.rgb(euiTheme.colors.emptyShade).toString(), + d3 + .rgb( + // Amsterdam: euiTheme.colors.vis.euiColorVis1 + // Borealis: euiTheme.colors.vis.euiColorVis2 + euiTheme.flags.hasVisColorAdjustment + ? euiTheme.colors.vis.euiColorVis1 + : euiTheme.colors.vis.euiColorVis2 + ) + .toString(), ], [COLOR_RANGE.RED]: [ - d3.rgb(euiTheme.euiColorEmptyShade).toString(), - d3.rgb(euiTheme.euiColorDanger).toString(), + d3.rgb(euiTheme.colors.emptyShade).toString(), + d3.rgb(euiTheme.colors.danger).toString(), ], [COLOR_RANGE.RED_GREEN]: ['red', 'green'], [COLOR_RANGE.GREEN_RED]: ['green', 'red'], @@ -184,5 +192,3 @@ export const useColorRange = ( return scaleTypes[colorRangeScale]; }; - -export type EuiThemeType = typeof euiThemeLight | typeof euiThemeDark; diff --git a/x-pack/platform/plugins/shared/ml/public/application/components/influencers_list/influencers_list_styles.ts b/x-pack/platform/plugins/shared/ml/public/application/components/influencers_list/influencers_list_styles.ts index 5a0732ceb8d70..d54eb495a0a33 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/components/influencers_list/influencers_list_styles.ts +++ b/x-pack/platform/plugins/shared/ml/public/application/components/influencers_list/influencers_list_styles.ts @@ -6,24 +6,24 @@ */ import { css } from '@emotion/react'; -import { useCurrentEuiThemeVars } from '@kbn/ml-kibana-theme'; + +import { useEuiFontSize, useEuiTheme } from '@elastic/eui'; + import { mlColors } from '../../styles'; -import { useMlKibana } from '../../contexts/kibana'; export const useInfluencersListStyles = () => { - const { - services: { theme }, - } = useMlKibana(); - const { euiTheme } = useCurrentEuiThemeVars(theme); + const { euiTheme } = useEuiTheme(); + const euiFontSizeXS = useEuiFontSize('xs').fontSize; + const euiFontSizeS = useEuiFontSize('s').fontSize; return { influencersList: css({ lineHeight: 1.45, }), fieldLabel: css({ - fontSize: euiTheme.euiFontSizeXS, + fontSize: euiFontSizeXS, textAlign: 'left', - maxHeight: euiTheme.euiFontSizeS, + maxHeight: euiFontSizeS, maxWidth: 'calc(100% - 102px)', }), progress: css({ @@ -32,7 +32,7 @@ export const useInfluencersListStyles = () => { height: '22px', minWidth: '70px', marginBottom: 0, - color: euiTheme.euiColorDarkShade, + color: euiTheme.colors.darkShade, backgroundColor: 'transparent', }), progressBarHolder: css({ @@ -40,9 +40,9 @@ export const useInfluencersListStyles = () => { }), progressBar: (severity: string, barScore: number) => css({ - height: `calc(${euiTheme.euiSizeXS} / 2)`, + height: `calc(${euiTheme.size.xs} / 2)`, float: 'left', - marginTop: euiTheme.euiSizeM, + marginTop: euiTheme.size.m, textAlign: 'right', lineHeight: '18px', display: 'inline-block', @@ -62,8 +62,8 @@ export const useInfluencersListStyles = () => { textAlign: 'center', lineHeight: '14px', whiteSpace: 'nowrap', - fontSize: euiTheme.euiFontSizeXS, - marginLeft: euiTheme.euiSizeXS, + fontSize: euiFontSizeXS, + marginLeft: euiTheme.size.xs, display: 'inline', borderColor: severity === 'critical' @@ -75,16 +75,16 @@ export const useInfluencersListStyles = () => { : mlColors.warning, }), totalScoreLabel: css({ - width: euiTheme.euiSizeXL, + width: euiTheme.size.xl, verticalAlign: 'top', textAlign: 'center', - color: euiTheme.euiColorDarkShade, + color: euiTheme.colors.darkShade, fontSize: '11px', lineHeight: '14px', - borderRadius: euiTheme.euiBorderRadius, - padding: `calc(${euiTheme.euiSizeXS} / 2)`, + borderRadius: euiTheme.border.radius.small, + padding: `calc(${euiTheme.size.xs} / 2)`, display: 'inline-block', - border: euiTheme.euiBorderThin, + border: euiTheme.border.thin, }), }; }; diff --git a/x-pack/platform/plugins/shared/ml/public/application/components/job_selector/job_selector_badge/job_selector_badge.tsx b/x-pack/platform/plugins/shared/ml/public/application/components/job_selector/job_selector_badge/job_selector_badge.tsx index 8b277b84fac25..f3561944e6845 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/components/job_selector/job_selector_badge/job_selector_badge.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/components/job_selector/job_selector_badge/job_selector_badge.tsx @@ -8,7 +8,7 @@ import type { FC } from 'react'; import React from 'react'; import type { EuiBadgeProps } from '@elastic/eui'; -import { EuiBadge } from '@elastic/eui'; +import { useEuiTheme, EuiBadge } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { tabColor } from '../../../../../common/util/group_color_utils'; @@ -27,7 +27,8 @@ export const JobSelectorBadge: FC<JobSelectorBadgeProps> = ({ numJobs, removeId, }) => { - const color = isGroup ? tabColor(id) : 'hollow'; + const { euiTheme } = useEuiTheme(); + const color = isGroup ? tabColor(id, euiTheme) : 'hollow'; let props = { color } as EuiBadgeProps; let jobCount; diff --git a/x-pack/platform/plugins/shared/ml/public/application/components/ml_inference/components/test_pipeline.tsx b/x-pack/platform/plugins/shared/ml/public/application/components/ml_inference/components/test_pipeline.tsx index 10b02310b39d8..b2b46d5d59ace 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/components/ml_inference/components/test_pipeline.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/components/ml_inference/components/test_pipeline.tsx @@ -8,10 +8,10 @@ import type { FC } from 'react'; import React, { memo, useEffect, useCallback, useMemo, useState } from 'react'; import { css } from '@emotion/react'; -import { euiThemeVars } from '@kbn/ui-theme'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { + useEuiTheme, EuiAccordion, EuiButton, EuiButtonEmpty, @@ -58,6 +58,7 @@ interface Props { } export const TestPipeline: FC<Props> = memo(({ state, sourceIndex, mode }) => { + const { euiTheme } = useEuiTheme(); const [simulatePipelineResult, setSimulatePipelineResult] = useState< undefined | estypes.IngestSimulateResponse >(); @@ -391,7 +392,7 @@ export const TestPipeline: FC<Props> = memo(({ state, sourceIndex, mode }) => { <EuiResizableContainer direction={isSmallerViewport ? 'vertical' : 'horizontal'} css={css` - min-height: calc(${euiThemeVars.euiSizeXL} * 10); + min-height: calc(${euiTheme.size.xl} * 10); `} > {(EuiResizablePanel, EuiResizableButton) => ( diff --git a/x-pack/platform/plugins/shared/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/create_calendar.tsx b/x-pack/platform/plugins/shared/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/create_calendar.tsx index e4f87e7fa4acc..3c3abdc4d9950 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/create_calendar.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/components/model_snapshots/revert_model_snapshot_flyout/create_calendar.tsx @@ -12,6 +12,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import moment from 'moment'; import type { BrushEndListener, XYBrushEvent } from '@elastic/charts'; import { + useEuiTheme, EuiButtonIcon, EuiDatePicker, EuiFieldText, @@ -21,7 +22,6 @@ import { EuiPanel, EuiSpacer, } from '@elastic/eui'; -import { useCurrentThemeVars } from '../../../contexts/kibana'; import { EventRateChart } from '../../../jobs/new_job/pages/components/charts/event_rate_chart/event_rate_chart'; import type { Anomaly } from '../../../jobs/new_job/common/results_loader/results_loader'; import type { LineChartPoint } from '../../../jobs/new_job/common/chart_loader/chart_loader'; @@ -54,7 +54,7 @@ export const CreateCalendar: FC<Props> = ({ const maxSelectableTimeMoment = moment(maxSelectableTimeStamp); const minSelectableTimeMoment = moment(minSelectableTimeStamp); - const { euiTheme } = useCurrentThemeVars(); + const { euiTheme } = useEuiTheme(); const onBrushEnd = useCallback( ({ x }: XYBrushEvent) => { @@ -155,7 +155,7 @@ export const CreateCalendar: FC<Props> = ({ end: c.end!.valueOf(), }))} onBrushEnd={onBrushEnd} - overlayColor={euiTheme.euiColorPrimary} + overlayColor={euiTheme.colors.primary} /> <EuiSpacer size="s" /> @@ -226,7 +226,7 @@ export const CreateCalendar: FC<Props> = ({ <EuiFlexItem grow={false} style={{ - borderLeft: `1px solid ${euiTheme.euiColorLightShade}`, + borderLeft: `1px solid ${euiTheme.colors.lightShade}`, marginRight: '0px', }} /> diff --git a/x-pack/platform/plugins/shared/ml/public/application/components/scatterplot_matrix/scatterplot_matrix.test.tsx b/x-pack/platform/plugins/shared/ml/public/application/components/scatterplot_matrix/scatterplot_matrix.test.tsx index 3fd25534134ae..2388920a178fa 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/components/scatterplot_matrix/scatterplot_matrix.test.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/components/scatterplot_matrix/scatterplot_matrix.test.tsx @@ -10,8 +10,6 @@ import { render, waitFor, screen } from '@testing-library/react'; import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; -import { euiLightVars as euiThemeLight } from '@kbn/ui-theme'; - import { createFilterManagerMock } from '@kbn/data-plugin/public/query/filter_manager/filter_manager.mock'; import { ScatterplotMatrix } from './scatterplot_matrix'; @@ -22,8 +20,6 @@ const mockEsSearch = jest.fn((body) => ({ hits: { hits: [{ fields: { x: [1], y: [2] } }, { fields: { x: [2], y: [3] } }] }, })); -const mockEuiTheme = euiThemeLight; - jest.mock('../../contexts/kibana', () => ({ useMlApi: () => ({ esSearch: mockEsSearch, @@ -48,9 +44,6 @@ jest.mock('../../contexts/kibana', () => ({ }, }, }), - useCurrentThemeVars: () => ({ - euiTheme: mockEuiTheme, - }), })); // Mocking VegaChart to avoid a jest/canvas related error diff --git a/x-pack/platform/plugins/shared/ml/public/application/components/scatterplot_matrix/scatterplot_matrix.tsx b/x-pack/platform/plugins/shared/ml/public/application/components/scatterplot_matrix/scatterplot_matrix.tsx index 763addd4aaa87..bd79731f22e0f 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/components/scatterplot_matrix/scatterplot_matrix.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/components/scatterplot_matrix/scatterplot_matrix.tsx @@ -12,6 +12,8 @@ import { css } from '@emotion/react'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import type { EuiComboBoxOptionOption } from '@elastic/eui'; import { + useEuiFontSize, + useEuiTheme, EuiCallOut, EuiComboBox, EuiFlexGroup, @@ -36,9 +38,8 @@ import { type RuntimeMappings, } from '@kbn/ml-runtime-field-utils'; import { getProcessedFields } from '@kbn/ml-data-grid'; -import { euiThemeVars } from '@kbn/ui-theme'; -import { useCurrentThemeVars, useMlApi, useMlKibana } from '../../contexts/kibana'; +import { useMlApi, useMlKibana } from '../../contexts/kibana'; // Separate imports for lazy loadable VegaChart and related code import { VegaChart } from '../vega_chart'; @@ -50,17 +51,22 @@ import { OUTLIER_SCORE_FIELD, } from './scatterplot_matrix_vega_lite_spec'; -const cssOverrides = css({ - // Prevent the chart from overflowing the container - overflowX: 'auto', - // Overrides for the outlier threshold slider - '.vega-bind': { - span: { - fontSize: euiThemeVars.euiFontSizeXS, - padding: `0 ${euiThemeVars.euiSizeXS}`, +const useCssOverrides = () => { + const { euiTheme } = useEuiTheme(); + const euiFontSizeXS = useEuiFontSize('xs').fontSize; + + return css({ + // Prevent the chart from overflowing the container + overflowX: 'auto', + // Overrides for the outlier threshold slider + '.vega-bind': { + span: { + fontSize: euiFontSizeXS, + padding: `0 ${euiTheme.size.xs}`, + }, }, - }, -}); + }); +}; const SCATTERPLOT_MATRIX_DEFAULT_FIELDS = 4; const SCATTERPLOT_MATRIX_DEFAULT_FETCH_SIZE = 1000; @@ -161,7 +167,7 @@ export const ScatterplotMatrix: FC<ScatterplotMatrixProps> = ({ { items: any[]; backgroundItems: any[]; columns: string[]; messages: string[] } | undefined >(); - const { euiTheme } = useCurrentThemeVars(); + const { euiTheme } = useEuiTheme(); // formats the array of field names for EuiComboBox const fieldOptions = useMemo( @@ -418,6 +424,8 @@ export const ScatterplotMatrix: FC<ScatterplotMatrixProps> = ({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [resultsField, splom, color, legendType, dynamicSize]); + const cssOverrides = useCssOverrides(); + return ( <> {splom === undefined || vegaSpec === undefined ? ( diff --git a/x-pack/platform/plugins/shared/ml/public/application/components/scatterplot_matrix/scatterplot_matrix_vega_lite_spec.test.ts b/x-pack/platform/plugins/shared/ml/public/application/components/scatterplot_matrix/scatterplot_matrix_vega_lite_spec.test.ts index e2322ff7dd2b3..0ed09b2c9489c 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/components/scatterplot_matrix/scatterplot_matrix_vega_lite_spec.test.ts +++ b/x-pack/platform/plugins/shared/ml/public/application/components/scatterplot_matrix/scatterplot_matrix_vega_lite_spec.test.ts @@ -10,7 +10,7 @@ import 'jest-canvas-mock'; // @ts-ignore import { compile } from 'vega-lite/build/vega-lite'; -import { euiLightVars as euiThemeLight } from '@kbn/ui-theme'; +import type { EuiThemeComputed } from '@elastic/eui'; import { LEGEND_TYPES } from '../vega_chart/common'; @@ -25,9 +25,17 @@ import { SINGLE_POINT_CLICK, } from './scatterplot_matrix_vega_lite_spec'; +const euiThemeMock = { + colors: { + lighestShade: '#f0f0f0', + lightShade: '#d3dae6', + textSubdued: '#6a7170', + }, +} as unknown as EuiThemeComputed; + describe('getColorSpec()', () => { it('should return only user selection conditions and the default color for non-outlier specs', () => { - const colorSpec = getColorSpec(false, euiThemeLight); + const colorSpec = getColorSpec(false); expect(colorSpec).toEqual({ condition: [{ selection: USER_SELECTION }, { selection: SINGLE_POINT_CLICK }], @@ -36,7 +44,7 @@ describe('getColorSpec()', () => { }); it('should return user selection condition and conditional spec for outliers', () => { - const colorSpec = getColorSpec(false, euiThemeLight, 'outlier_score'); + const colorSpec = getColorSpec(false, 'outlier_score'); expect(colorSpec).toEqual({ condition: { @@ -54,13 +62,7 @@ describe('getColorSpec()', () => { it('should return user selection condition and a field based spec for non-outlier specs with legendType supplied', () => { const colorName = 'the-color-field'; - const colorSpec = getColorSpec( - false, - euiThemeLight, - undefined, - colorName, - LEGEND_TYPES.NOMINAL - ); + const colorSpec = getColorSpec(false, undefined, colorName, LEGEND_TYPES.NOMINAL); expect(colorSpec).toEqual({ condition: { @@ -137,7 +139,7 @@ describe('getScatterplotMatrixVegaLiteSpec()', () => { data, [], ['x', 'y'], - euiThemeLight + euiThemeMock ); const specForegroundLayer = vegaLiteSpec.spec.layer[0]; @@ -172,7 +174,7 @@ describe('getScatterplotMatrixVegaLiteSpec()', () => { data, [], ['x', 'y'], - euiThemeLight, + euiThemeMock, 'ml' ); const specForegroundLayer = vegaLiteSpec.spec.layer[0]; @@ -221,7 +223,7 @@ describe('getScatterplotMatrixVegaLiteSpec()', () => { data, [], ['x', 'y'], - euiThemeLight, + euiThemeMock, undefined, 'the-color-field', LEGEND_TYPES.NOMINAL @@ -267,7 +269,7 @@ describe('getScatterplotMatrixVegaLiteSpec()', () => { data, [], ['x.a', 'y[a]'], - euiThemeLight, + euiThemeMock, undefined, 'the-color-field', LEGEND_TYPES.NOMINAL diff --git a/x-pack/platform/plugins/shared/ml/public/application/components/scatterplot_matrix/scatterplot_matrix_vega_lite_spec.ts b/x-pack/platform/plugins/shared/ml/public/application/components/scatterplot_matrix/scatterplot_matrix_vega_lite_spec.ts index e7d7066339847..95ede4edcc9eb 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/components/scatterplot_matrix/scatterplot_matrix_vega_lite_spec.ts +++ b/x-pack/platform/plugins/shared/ml/public/application/components/scatterplot_matrix/scatterplot_matrix_vega_lite_spec.ts @@ -9,9 +9,12 @@ // @ts-ignore import type { TopLevelSpec } from 'vega-lite/build/vega-lite'; -import type { euiLightVars as euiThemeLight } from '@kbn/ui-theme'; - -import { euiPaletteColorBlind, euiPaletteRed, euiPaletteGreen } from '@elastic/eui'; +import { + euiPaletteColorBlind, + euiPaletteRed, + euiPaletteGreen, + type EuiThemeComputed, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -34,7 +37,6 @@ const CUSTOM_VIS_FIELDS_PATH = 'fields'; export const getColorSpec = ( forCustomVisLink: boolean, - euiTheme: typeof euiThemeLight, escapedOutlierScoreField?: string, color?: string, legendType?: LegendType @@ -280,7 +282,7 @@ export const getScatterplotMatrixVegaLiteSpec = ( values: VegaValue[], backgroundValues: VegaValue[], columns: string[], - euiTheme: typeof euiThemeLight, + euiTheme: EuiThemeComputed, resultsField?: string, color?: string, legendType?: LegendType, @@ -296,7 +298,6 @@ export const getScatterplotMatrixVegaLiteSpec = ( const colorSpec = getColorSpec( forCustomVisLink, - euiTheme, resultsField && escapedOutlierScoreField, color, legendType @@ -309,20 +310,20 @@ export const getScatterplotMatrixVegaLiteSpec = ( // for repeated charts, it seems to be fixed for facets but not repeat. // This causes #ddd lines to stand out in dark mode. // See: https://github.com/vega/vega-lite/issues/5908 - view: { fill: 'transparent', stroke: euiTheme.euiColorLightestShade }, + view: { fill: 'transparent', stroke: euiTheme.colors.lightestShade }, padding: 10, config: { axis: { - domainColor: euiTheme.euiColorLightShade, - gridColor: euiTheme.euiColorLightestShade, - tickColor: euiTheme.euiColorLightestShade, - labelColor: euiTheme.euiTextSubduedColor, - titleColor: euiTheme.euiTextSubduedColor, + domainColor: euiTheme.colors.lightShade, + gridColor: euiTheme.colors.lightestShade, + tickColor: euiTheme.colors.lightestShade, + labelColor: euiTheme.colors.textSubdued, + titleColor: euiTheme.colors.textSubdued, }, legend: { orient: 'right', - labelColor: euiTheme.euiTextSubduedColor, - titleColor: euiTheme.euiTextSubduedColor, + labelColor: euiTheme.colors.textSubdued, + titleColor: euiTheme.colors.textSubdued, }, }, repeat: { diff --git a/x-pack/platform/plugins/shared/ml/public/application/contexts/kibana/index.ts b/x-pack/platform/plugins/shared/ml/public/application/contexts/kibana/index.ts index 47836e6495c06..e8c6c081d6e12 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/contexts/kibana/index.ts +++ b/x-pack/platform/plugins/shared/ml/public/application/contexts/kibana/index.ts @@ -14,5 +14,4 @@ export { useNotifications } from './use_notifications_context'; export { useMlLocator, useMlLink } from './use_create_url'; export { useMlApi } from './use_ml_api_context'; export { useFieldFormatter } from './use_field_formatter'; -export { useCurrentThemeVars } from './use_current_theme'; export { useMlLicenseInfo } from './use_ml_license'; diff --git a/x-pack/platform/plugins/shared/ml/public/application/contexts/kibana/use_current_theme.ts b/x-pack/platform/plugins/shared/ml/public/application/contexts/kibana/use_current_theme.ts deleted file mode 100644 index 906fd599af75a..0000000000000 --- a/x-pack/platform/plugins/shared/ml/public/application/contexts/kibana/use_current_theme.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 { useCurrentEuiThemeVars } from '@kbn/ml-kibana-theme'; -import { useMlKibana } from './kibana_context'; - -export function useCurrentThemeVars() { - const { - services: { theme }, - } = useMlKibana(); - return useCurrentEuiThemeVars(theme); -} diff --git a/x-pack/platform/plugins/shared/ml/public/application/contexts/ml/data_source_context.tsx b/x-pack/platform/plugins/shared/ml/public/application/contexts/ml/data_source_context.tsx index 1c94200794a81..5855325f5918f 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/contexts/ml/data_source_context.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/contexts/ml/data_source_context.tsx @@ -120,7 +120,7 @@ export const DataSourceContextProvider: FC<PropsWithChildren<unknown>> = ({ chil <h2> <FormattedMessage id="xpack.ml.dataSourceContext.errorTitle" - defaultMessage="Unable to fetch data view or saved search" + defaultMessage="Unable to fetch data view or saved Discover session" /> </h2> } diff --git a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx index 7fd678e98f6fd..3e8933a5330aa 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx @@ -576,7 +576,6 @@ export const ConfigurationStepForm: FC<ConfigurationStepProps> = ({ fieldStatsServices={fieldStatsServices} timeRangeMs={indexData.timeRangeMs} dslQuery={jobConfigQuery} - theme={services.theme} > <Fragment> <Messages messages={requestMessages} /> @@ -603,8 +602,8 @@ export const ConfigurationStepForm: FC<ConfigurationStepProps> = ({ <Fragment> {savedSearchQuery !== null && ( <EuiText> - {i18n.translate('xpack.ml.dataframe.analytics.create.savedSearchLabel', { - defaultMessage: 'Saved search', + {i18n.translate('xpack.ml.dataframe.analytics.create.discoverSessionLabel', { + defaultMessage: 'Discover session', })} </EuiText> )} diff --git a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/evaluate_panel.tsx b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/evaluate_panel.tsx index 0d30b0371a027..2b0002896e1ca 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/evaluate_panel.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/evaluate_panel.tsx @@ -10,6 +10,7 @@ import React, { useEffect, useState } from 'react'; import type { EuiDataGridCellValueElementProps } from '@elastic/eui'; import { + useEuiTheme, EuiButtonEmpty, EuiDataGrid, EuiFlexGroup, @@ -27,7 +28,7 @@ import { type DataFrameTaskStateType, } from '@kbn/ml-data-frame-analytics-utils'; -import { useCurrentThemeVars, useMlKibana } from '../../../../../contexts/kibana'; +import { useMlKibana } from '../../../../../contexts/kibana'; // Separate imports for lazy loadable VegaChart and related code import { VegaChart } from '../../../../../components/vega_chart'; @@ -111,7 +112,7 @@ export const EvaluatePanel: FC<EvaluatePanelProps> = ({ jobConfig, jobStatus, se const { services: { docLinks }, } = useMlKibana(); - const { euiTheme } = useCurrentThemeVars(); + const { euiTheme } = useEuiTheme(); const [columns, setColumns] = useState<ConfusionMatrixColumn[]>([]); const [columnsData, setColumnsData] = useState<ConfusionMatrixColumnData[]>([]); diff --git a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/get_roc_curve_chart_vega_lite_spec.tsx b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/get_roc_curve_chart_vega_lite_spec.tsx index 3bfdfa03a302e..1d148daac9e52 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/get_roc_curve_chart_vega_lite_spec.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/classification_exploration/get_roc_curve_chart_vega_lite_spec.tsx @@ -9,9 +9,8 @@ // @ts-ignore import type { TopLevelSpec } from 'vega-lite/build/vega-lite'; -import { euiPaletteColorBlind, euiPaletteGray } from '@elastic/eui'; +import { euiPaletteColorBlind, euiPaletteGray, type EuiThemeComputed } from '@elastic/eui'; -import type { euiLightVars as euiThemeLight } from '@kbn/ui-theme'; import { i18n } from '@kbn/i18n'; import type { RocCurveItem } from '@kbn/ml-data-frame-analytics-utils'; @@ -44,7 +43,7 @@ export const getRocCurveChartVegaLiteSpec = ( classificationClasses: string[], data: RocCurveDataRow[], legendTitle: string, - euiTheme: typeof euiThemeLight + euiTheme: EuiThemeComputed ): TopLevelSpec => { // we append two rows which make up the data for the diagonal baseline data.push({ tpr: 0, fpr: 0, threshold: 1, class_name: BASELINE }); @@ -60,8 +59,8 @@ export const getRocCurveChartVegaLiteSpec = ( config: { legend: { orient: 'right', - labelColor: euiTheme.euiTextSubduedColor, - titleColor: euiTheme.euiTextSubduedColor, + labelColor: euiTheme.colors.textSubdued, + titleColor: euiTheme.colors.textSubdued, }, view: { continuousHeight: SIZE, @@ -104,9 +103,9 @@ export const getRocCurveChartVegaLiteSpec = ( type: 'quantitative', axis: { tickColor: GRAY, - labelColor: euiTheme.euiTextSubduedColor, + labelColor: euiTheme.colors.textSubdued, domainColor: GRAY, - titleColor: euiTheme.euiTextSubduedColor, + titleColor: euiTheme.colors.textSubdued, }, }, y: { @@ -117,9 +116,9 @@ export const getRocCurveChartVegaLiteSpec = ( type: 'quantitative', axis: { tickColor: GRAY, - labelColor: euiTheme.euiTextSubduedColor, + labelColor: euiTheme.colors.textSubdued, domainColor: GRAY, - titleColor: euiTheme.euiTextSubduedColor, + titleColor: euiTheme.colors.textSubdued, }, }, tooltip: [ diff --git a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/decision_path_chart.tsx b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/decision_path_chart.tsx index b2532b225db2b..d6e64b6e8acda 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/decision_path_chart.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/feature_importance/decision_path_chart.tsx @@ -23,51 +23,16 @@ import { Settings, LEGACY_LIGHT_THEME, } from '@elastic/charts'; -import { EuiIcon } from '@elastic/eui'; +import { useEuiTheme, EuiIcon } from '@elastic/eui'; import React, { useCallback, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { euiLightVars as euiVars } from '@kbn/ui-theme'; import { type FeatureImportanceBaseline, isRegressionFeatureImportanceBaseline, } from '@kbn/ml-data-frame-analytics-utils'; import type { DecisionPathPlotData } from './use_classification_path_data'; import { formatSingleValue } from '../../../../../formatters/format_value'; -const { euiColorFullShade, euiColorMediumShade } = euiVars; -const axisColor = euiColorMediumShade; - -const baselineStyle: LineAnnotationStyle = { - line: { - strokeWidth: 1, - stroke: euiColorFullShade, - opacity: 0.75, - }, -}; - -const axes: RecursivePartial<AxisStyle> = { - axisLine: { - stroke: axisColor, - }, - tickLabel: { - fontSize: 10, - fill: axisColor, - }, - tickLine: { - stroke: axisColor, - }, - gridLine: { - horizontal: { - dash: [1, 2], - }, - vertical: { - strokeWidth: 0, - }, - }, -}; -const theme: PartialTheme = { - axes, -}; interface DecisionPathChartProps { decisionPathData: DecisionPathPlotData; @@ -88,6 +53,49 @@ export const DecisionPathChart = ({ maxDomain, baseline, }: DecisionPathChartProps) => { + const { euiTheme } = useEuiTheme(); + + const { baselineStyle, theme } = useMemo<{ + baselineStyle: LineAnnotationStyle; + theme: PartialTheme; + }>(() => { + const euiColorFullShade = euiTheme.colors.fullShade; + const euiColorMediumShade = euiTheme.colors.mediumShade; + const axisColor = euiColorMediumShade; + + const axes: RecursivePartial<AxisStyle> = { + axisLine: { + stroke: axisColor, + }, + tickLabel: { + fontSize: 10, + fill: axisColor, + }, + tickLine: { + stroke: axisColor, + }, + gridLine: { + horizontal: { + dash: [1, 2], + }, + vertical: { + strokeWidth: 0, + }, + }, + }; + + return { + baselineStyle: { + line: { + strokeWidth: 1, + stroke: euiColorFullShade, + opacity: 0.75, + }, + }, + theme: { axes }, + }; + }, [euiTheme]); + const regressionBaselineData: LineAnnotationDatum[] | undefined = useMemo( () => baseline && isRegressionFeatureImportanceBaseline(baseline) diff --git a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/total_feature_importance_summary/feature_importance_summary.tsx b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/total_feature_importance_summary/feature_importance_summary.tsx index 9e7371580b12d..8a3ac185ef0ea 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/total_feature_importance_summary/feature_importance_summary.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/total_feature_importance_summary/feature_importance_summary.tsx @@ -8,7 +8,7 @@ import type { FC } from 'react'; import React, { useCallback, useMemo } from 'react'; -import { EuiButtonEmpty, EuiSpacer, EuiText, EuiCallOut } from '@elastic/eui'; +import { useEuiTheme, EuiButtonEmpty, EuiSpacer, EuiText, EuiCallOut } from '@elastic/eui'; import type { RecursivePartial, AxisStyle, PartialTheme, BarSeriesProps } from '@elastic/charts'; import { Chart, @@ -22,7 +22,6 @@ import { import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; -import { euiLightVars as euiVars } from '@kbn/ui-theme'; import { getAnalysisType, isClassificationAnalysis, @@ -40,40 +39,6 @@ import { useMlKibana } from '../../../../../contexts/kibana'; import { ExpandableSection } from '../expandable_section'; -const { euiColorMediumShade } = euiVars; -const axisColor = euiColorMediumShade; - -const axes: RecursivePartial<AxisStyle> = { - axisLine: { - stroke: axisColor, - }, - tickLabel: { - fontSize: 12, - fill: axisColor, - }, - tickLine: { - stroke: axisColor, - }, - gridLine: { - horizontal: { - dash: [1, 2], - }, - vertical: { - strokeWidth: 0, - }, - }, -}; -const theme: PartialTheme = { - axes, - legend: { - /** - * Added buffer between label and value. - * Smaller values render a more compact legend - */ - spacingBuffer: 100, - }, -}; - export interface FeatureImportanceSummaryPanelProps { totalFeatureImportance: TotalFeatureImportance[]; jobConfig: DataFrameAnalyticsConfig; @@ -94,21 +59,60 @@ const calculateTotalMeanImportance = (featureClass: ClassificationTotalFeatureIm ); }; +interface Datum { + featureName: string; + meanImportance: number; + className?: FeatureImportanceClassName; +} +type PlotData = Datum[]; +type SeriesProps = Omit<BarSeriesProps, 'id' | 'xScaleType' | 'yScaleType' | 'data'>; + export const FeatureImportanceSummaryPanel: FC<FeatureImportanceSummaryPanelProps> = ({ totalFeatureImportance, jobConfig, }) => { + const { euiTheme } = useEuiTheme(); const { services: { docLinks }, } = useMlKibana(); - interface Datum { - featureName: string; - meanImportance: number; - className?: FeatureImportanceClassName; - } - type PlotData = Datum[]; - type SeriesProps = Omit<BarSeriesProps, 'id' | 'xScaleType' | 'yScaleType' | 'data'>; + const theme: PartialTheme = useMemo(() => { + const euiColorMediumShade = euiTheme.colors.mediumShade; + const axisColor = euiColorMediumShade; + + const axes: RecursivePartial<AxisStyle> = { + axisLine: { + stroke: axisColor, + }, + tickLabel: { + fontSize: 12, + fill: axisColor, + }, + tickLine: { + stroke: axisColor, + }, + gridLine: { + horizontal: { + dash: [1, 2], + }, + vertical: { + strokeWidth: 0, + }, + }, + }; + + return { + axes, + legend: { + /** + * Added buffer between label and value. + * Smaller values render a more compact legend + */ + spacingBuffer: 100, + }, + }; + }, [euiTheme]); + const [plotData, barSeriesSpec, showLegend, chartHeight] = useMemo< [plotData: PlotData, barSeriesSpec: SeriesProps, showLegend?: boolean, chartHeight?: number] >(() => { diff --git a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx index c17490f4506d9..6c3508db1db32 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.test.tsx @@ -203,7 +203,7 @@ describe('Data Frame Analytics: <SourceSelection />', () => { ).toBeInTheDocument(); expect( screen.queryByText( - `The saved search 'the-remote-saved-search-title' uses the data view 'my_remote_cluster:index-pattern-title'.` + `The saved Discover session 'the-remote-saved-search-title' uses the data view 'my_remote_cluster:index-pattern-title'.` ) ).toBeInTheDocument(); expect(mockNavigateToPath).toHaveBeenCalledTimes(0); diff --git a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx index ff173c47a5320..86245a73f89f8 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/source_selection/source_selection.tsx @@ -67,7 +67,7 @@ export const SourceSelection: FC = () => { i18n.translate( 'xpack.ml.dataFrame.analytics.create.searchSelection.errorGettingDataViewTitle', { - defaultMessage: 'Error loading data view used by the saved search', + defaultMessage: 'Error loading data view used by the saved Discover session', } ) ); @@ -82,7 +82,7 @@ export const SourceSelection: FC = () => { i18n.translate( 'xpack.ml.dataFrame.analytics.create.searchSelection.CcsErrorCallOutBody', { - defaultMessage: `The saved search ''{savedSearchTitle}'' uses the data view ''{dataViewName}''.`, + defaultMessage: `The saved Discover session ''{savedSearchTitle}'' uses the data view ''{dataViewName}''.`, values: { savedSearchTitle: getNestedProperty(savedObject, 'attributes.title'), dataViewName, @@ -132,17 +132,17 @@ export const SourceSelection: FC = () => { noItemsMessage={i18n.translate( 'xpack.ml.dataFrame.analytics.create.searchSelection.notFoundLabel', { - defaultMessage: 'No matching indices or saved searches found.', + defaultMessage: 'No matching indices or saved Discover sessions found.', } )} savedObjectMetaData={[ { type: 'search', - getIconForSavedObject: () => 'search', + getIconForSavedObject: () => 'discoverApp', name: i18n.translate( - 'xpack.ml.dataFrame.analytics.create.searchSelection.savedObjectType.search', + 'xpack.ml.dataFrame.analytics.create.searchSelection.savedObjectType.discoverSession', { - defaultMessage: 'Saved search', + defaultMessage: 'Discover session', } ), showSavedObject: (savedObject: SavedObject) => diff --git a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/job_map/components/cytoscape.tsx b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/job_map/components/cytoscape.tsx index 16811a8429d18..de890ad9f9f98 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/job_map/components/cytoscape.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/job_map/components/cytoscape.tsx @@ -11,8 +11,7 @@ import { css } from '@emotion/react'; import cytoscape, { type Stylesheet } from 'cytoscape'; // @ts-ignore no declaration file import dagre from 'cytoscape-dagre'; -import { getCytoscapeOptions } from './cytoscape_options'; -import type { EuiThemeType } from '../../../../components/color_range_legend'; +import { useCytoscapeOptions } from './cytoscape_options'; cytoscape.use(dagre); @@ -20,7 +19,6 @@ export const CytoscapeContext = createContext<cytoscape.Core | undefined>(undefi interface CytoscapeProps { elements: cytoscape.ElementDefinition[]; - theme: EuiThemeType; height: number; itemsDeleted: boolean; resetCy: boolean; @@ -70,21 +68,21 @@ function getLayoutOptions(width: number, height: number) { export function Cytoscape({ children, elements, - theme, height, itemsDeleted, resetCy, style, width, }: PropsWithChildren<CytoscapeProps>) { - const cytoscapeOptions = useMemo(() => { + const cytoscapeOptions = useCytoscapeOptions(); + const cytoscapeOptionsWithElements = useMemo(() => { return { - ...getCytoscapeOptions(theme), + ...cytoscapeOptions, elements, }; - }, [theme, elements]); + }, [cytoscapeOptions, elements]); - const [ref, cy] = useCytoscape(cytoscapeOptions); + const [ref, cy] = useCytoscape(cytoscapeOptionsWithElements); // Add the height to the div style. The height is a separate prop because it // is required and can trigger rendering when changed. diff --git a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/job_map/components/cytoscape_options.tsx b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/job_map/components/cytoscape_options.tsx index 6877767907594..9eca6585ac2b3 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/job_map/components/cytoscape_options.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/job_map/components/cytoscape_options.tsx @@ -5,9 +5,13 @@ * 2.0. */ +import { useMemo } from 'react'; import type cytoscape from 'cytoscape'; + +import { useEuiFontSize, useEuiTheme, type EuiThemeComputed } from '@elastic/eui'; + import { ANALYSIS_CONFIG_TYPE, JOB_MAP_NODE_TYPES } from '@kbn/ml-data-frame-analytics-utils'; -import type { EuiThemeType } from '../../../../components/color_range_legend'; + import classificationJobIcon from './icons/ml_classification_job.svg'; import outlierDetectionJobIcon from './icons/ml_outlier_detection_job.svg'; import regressionJobIcon from './icons/ml_regression_job.svg'; @@ -57,85 +61,106 @@ function iconForNode(el: cytoscape.NodeSingular) { } } -function borderColorForNode(el: cytoscape.NodeSingular, theme: EuiThemeType) { +function borderColorForNode(el: cytoscape.NodeSingular, euiTheme: EuiThemeComputed) { if (el.selected()) { - return theme.euiColorPrimary; + return euiTheme.colors.primary; } const type = el.data('type'); switch (type) { case JOB_MAP_NODE_TYPES.ANALYTICS_JOB_MISSING: - return theme.euiColorFullShade; + return euiTheme.colors.fullShade; case JOB_MAP_NODE_TYPES.ANALYTICS: - return theme.euiColorVis0; + // Amsterdam + Borealis + return euiTheme.colors.vis.euiColorVis0; case JOB_MAP_NODE_TYPES.TRANSFORM: - return theme.euiColorVis1; + // Amsterdam: euiTheme.colors.vis.euiColorVis1 + // Borealis: euiTheme.colors.vis.euiColorVis2 + return euiTheme.flags.hasVisColorAdjustment + ? euiTheme.colors.vis.euiColorVis1 + : euiTheme.colors.vis.euiColorVis2; case JOB_MAP_NODE_TYPES.INDEX: - return theme.euiColorVis2; + // Amsterdam: euiTheme.colors.vis.euiColorVis2 + // Borealis: euiTheme.colors.vis.euiColorVis4 + return euiTheme.flags.hasVisColorAdjustment + ? euiTheme.colors.vis.euiColorVis2 + : euiTheme.colors.vis.euiColorVis4; case JOB_MAP_NODE_TYPES.TRAINED_MODEL: - return theme.euiColorVis3; + // Amsterdam: euiTheme.colors.vis.euiColorVis3 + // Borealis: euiTheme.colors.vis.euiColorVis5 + return euiTheme.flags.hasVisColorAdjustment + ? euiTheme.colors.vis.euiColorVis3 + : euiTheme.colors.vis.euiColorVis5; case JOB_MAP_NODE_TYPES.INGEST_PIPELINE: - return theme.euiColorVis7; + // Amsterdam: euiTheme.colors.vis.euiColorVis7 + // Borealis: euiTheme.colors.vis.euiColorVis8 + return euiTheme.flags.hasVisColorAdjustment + ? euiTheme.colors.vis.euiColorVis7 + : euiTheme.colors.vis.euiColorVis8; default: - return theme.euiColorMediumShade; + return euiTheme.colors.mediumShade; } } -export const getCytoscapeOptions = (theme: EuiThemeType): cytoscape.CytoscapeOptions => { - const lineColor = theme.euiColorLightShade; +export const useCytoscapeOptions = (): cytoscape.CytoscapeOptions => { + const { euiTheme } = useEuiTheme(); + const euiFontSizeXS = useEuiFontSize('xs', { unit: 'px' }).fontSize as string; - return { - autoungrabify: true, - boxSelectionEnabled: false, - maxZoom: 3, - minZoom: 0.2, - style: [ - { - selector: 'node', - style: { - 'background-color': (el: cytoscape.NodeSingular) => - el.data('isRoot') ? theme.euiColorWarning : theme.euiColorGhost, - 'background-height': '60%', - 'background-width': '60%', - 'border-color': (el: cytoscape.NodeSingular) => borderColorForNode(el, theme), - 'border-style': 'solid', - // @ts-ignore - 'background-image': (el: cytoscape.NodeSingular) => iconForNode(el), - 'border-width': (el: cytoscape.NodeSingular) => (el.selected() ? 4 : 3), - color: theme.euiTextColor, - 'font-family': 'Inter UI, Segoe UI, Helvetica, Arial, sans-serif', - 'font-size': theme.euiFontSizeXS, - 'min-zoomed-font-size': parseInt(theme.euiSizeL, 10), - label: 'data(label)', - shape: (el: cytoscape.NodeSingular) => shapeForNode(el), - 'text-background-color': theme.euiColorLightestShade, - 'text-background-opacity': 0, - 'text-background-padding': theme.euiSizeXS, - 'text-background-shape': 'roundrectangle', - 'text-margin-y': parseInt(theme.euiSizeS, 10), - 'text-max-width': '200px', - 'text-valign': 'bottom', - 'text-wrap': 'wrap', + return useMemo( + () => ({ + autoungrabify: true, + boxSelectionEnabled: false, + maxZoom: 3, + minZoom: 0.2, + style: [ + { + selector: 'node', + style: { + 'background-color': (el: cytoscape.NodeSingular) => + el.data('isRoot') ? euiTheme.colors.warning : euiTheme.colors.ghost, + 'background-height': '60%', + 'background-width': '60%', + 'border-color': (el: cytoscape.NodeSingular) => borderColorForNode(el, euiTheme), + 'border-style': 'solid', + // @ts-ignore + 'background-image': (el: cytoscape.NodeSingular) => iconForNode(el), + 'border-width': (el: cytoscape.NodeSingular) => (el.selected() ? 4 : 3), + color: euiTheme.colors.textParagraph, + 'font-family': 'Inter UI, Segoe UI, Helvetica, Arial, sans-serif', + 'font-size': euiFontSizeXS, + 'min-zoomed-font-size': parseInt(euiTheme.size.l, 10), + label: 'data(label)', + shape: (el: cytoscape.NodeSingular) => shapeForNode(el), + 'text-background-color': euiTheme.colors.lightestShade, + 'text-background-opacity': 0, + 'text-background-padding': euiTheme.size.xs, + 'text-background-shape': 'roundrectangle', + 'text-margin-y': parseInt(euiTheme.size.s, 10), + 'text-max-width': '200px', + 'text-valign': 'bottom', + 'text-wrap': 'wrap', + }, }, - }, - { - selector: 'edge', - style: { - 'curve-style': 'taxi', - // @ts-ignore - 'taxi-direction': 'rightward', - 'line-color': lineColor, - 'overlay-opacity': 0, - 'target-arrow-color': lineColor, - 'target-arrow-shape': 'triangle', - // @ts-ignore - 'target-distance-from-node': theme.euiSizeXS, - width: 1, - 'source-arrow-shape': 'none', + { + selector: 'edge', + style: { + 'curve-style': 'taxi', + // @ts-ignore + 'taxi-direction': 'rightward', + 'line-color': euiTheme.colors.lightShade, + 'overlay-opacity': 0, + 'target-arrow-color': euiTheme.colors.lightShade, + 'target-arrow-shape': 'triangle', + // @ts-ignore + 'target-distance-from-node': euiTheme.size.xs, + width: 1, + 'source-arrow-shape': 'none', + }, }, - }, - ], - }; + ], + }), + [euiFontSizeXS, euiTheme] + ); }; diff --git a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/job_map/components/legend.tsx b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/job_map/components/legend.tsx index cf22e9a3f2750..0a706aa7a82b2 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/job_map/components/legend.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/job_map/components/legend.tsx @@ -9,6 +9,7 @@ import type { FC } from 'react'; import React, { useState, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { + useEuiTheme, EuiButtonIcon, EuiFlexGroup, EuiFlexItem, @@ -19,7 +20,6 @@ import { } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { JOB_MAP_NODE_TYPES } from '@kbn/ml-data-frame-analytics-utils'; -import type { EuiThemeType } from '../../../../components/color_range_legend'; const getJobTypeList = () => ( <> @@ -33,21 +33,48 @@ const getJobTypeList = () => ( </> ); -export const JobMapLegend: FC<{ hasMissingJobNode: boolean; theme: EuiThemeType }> = ({ - hasMissingJobNode, - theme, -}) => { +export const JobMapLegend: FC<{ hasMissingJobNode: boolean }> = ({ hasMissingJobNode }) => { + const { euiTheme } = useEuiTheme(); + const [showJobTypes, setShowJobTypes] = useState<boolean>(false); - const { - euiSizeM, - euiSizeS, - euiColorGhost, - euiColorWarning, - euiBorderThin, - euiBorderRadius, - euiBorderRadiusSmall, - euiBorderWidthThick, - } = theme; + + const euiSizeM = euiTheme.size.m; + const euiSizeS = euiTheme.size.s; + const euiColorFullShade = euiTheme.colors.fullShade; + const euiColorGhost = euiTheme.colors.ghost; + const euiColorWarning = euiTheme.colors.warning; + const euiBorderThin = euiTheme.border.thin; + const euiBorderRadius = euiTheme.border.radius.medium; + const euiBorderRadiusSmall = euiTheme.border.radius.small; + const euiBorderWidthThick = euiTheme.border.width.thick; + const euiPageBackgroundColor = euiTheme.colors.backgroundBasePlain; + + // Amsterdam: euiTheme.colors.vis.euiColorVis2 + // Borealis: euiTheme.colors.vis.euiColorVis4 + const borderColorIndexPattern = euiTheme.flags.hasVisColorAdjustment + ? euiTheme.colors.vis.euiColorVis2 + : euiTheme.colors.vis.euiColorVis4; + + // Amsterdam: euiTheme.colors.vis.euiColorVis7 + // Borealis: euiTheme.colors.vis.euiColorVis8 + const borderColorIngestPipeline = euiTheme.flags.hasVisColorAdjustment + ? euiTheme.colors.vis.euiColorVis7 + : euiTheme.colors.vis.euiColorVis8; + + // Amsterdam: euiTheme.colors.vis.euiColorVis1 + // Borealis: euiTheme.colors.vis.euiColorVis2 + const borderColorTransform = euiTheme.flags.hasVisColorAdjustment + ? euiTheme.colors.vis.euiColorVis1 + : euiTheme.colors.vis.euiColorVis2; + + // Amsterdam: euiTheme.colors.vis.euiColorVis3 + // Borealis: euiTheme.colors.vis.euiColorVis5 + const borderBottomColorTrainedModel = euiTheme.flags.hasVisColorAdjustment + ? euiTheme.colors.vis.euiColorVis3 + : euiTheme.colors.vis.euiColorVis5; + + // Amsterdam + Borealis + const borderColorAnalytics = euiTheme.colors.vis.euiColorVis0; const cssOverrideBase = useMemo( () => ({ @@ -91,7 +118,7 @@ export const JobMapLegend: FC<{ hasMissingJobNode: boolean; theme: EuiThemeType data-test-subj="mlJobMapLegend__indexPattern" css={{ ...cssOverrideBase, - border: `${euiBorderWidthThick} solid ${theme.euiColorVis2}`, + border: `${euiBorderWidthThick} solid ${borderColorIndexPattern}`, transform: 'rotate(45deg)', }} /> @@ -113,7 +140,7 @@ export const JobMapLegend: FC<{ hasMissingJobNode: boolean; theme: EuiThemeType data-test-subj="mlJobMapLegend__ingestPipeline" css={{ ...cssOverrideBase, - border: `${euiBorderWidthThick} solid ${theme.euiColorVis7}`, + border: `${euiBorderWidthThick} solid ${borderColorIngestPipeline}`, borderRadius: euiBorderRadiusSmall, }} /> @@ -135,7 +162,7 @@ export const JobMapLegend: FC<{ hasMissingJobNode: boolean; theme: EuiThemeType data-test-subj="mlJobMapLegend__transform" css={{ ...cssOverrideBase, - border: `${euiBorderWidthThick} solid ${theme.euiColorVis1}`, + border: `${euiBorderWidthThick} solid ${borderColorTransform}`, }} /> </EuiFlexItem> @@ -154,9 +181,9 @@ export const JobMapLegend: FC<{ hasMissingJobNode: boolean; theme: EuiThemeType display: 'inline-block', width: '0px', height: '0px', - borderLeft: `${euiSizeS} solid ${theme.euiPageBackgroundColor}`, - borderRight: `${euiSizeS} solid ${theme.euiPageBackgroundColor}`, - borderBottom: `${euiSizeM} solid ${theme.euiColorVis3}`, + borderLeft: `${euiSizeS} solid ${euiPageBackgroundColor}`, + borderRight: `${euiSizeS} solid ${euiPageBackgroundColor}`, + borderBottom: `${euiSizeM} solid ${borderBottomColorTrainedModel}`, }} /> </EuiFlexItem> @@ -178,7 +205,7 @@ export const JobMapLegend: FC<{ hasMissingJobNode: boolean; theme: EuiThemeType data-test-subj="mlJobMapLegend__analyticsMissing" css={{ ...cssOverrideBase, - border: `${euiBorderWidthThick} solid ${theme.euiColorFullShade}`, + border: `${euiBorderWidthThick} solid ${euiColorFullShade}`, borderRadius: '50%', }} /> @@ -201,7 +228,7 @@ export const JobMapLegend: FC<{ hasMissingJobNode: boolean; theme: EuiThemeType data-test-subj="mlJobMapLegend__analytics" css={{ ...cssOverrideBase, - border: `${euiBorderWidthThick} solid ${theme.euiColorVis0}`, + border: `${euiBorderWidthThick} solid ${borderColorAnalytics}`, borderRadius: '50%', }} /> diff --git a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/job_map/job_map.tsx b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/job_map/job_map.tsx index d03b62bf934a5..49a64f7dd5fae 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/job_map/job_map.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/job_map/job_map.tsx @@ -9,32 +9,38 @@ import type { FC } from 'react'; import React, { useEffect, useMemo, useState } from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; +import { + useEuiTheme, + EuiButtonEmpty, + EuiFlexGroup, + EuiFlexItem, + EuiSpacer, + type EuiThemeComputed, +} from '@elastic/eui'; import { JOB_MAP_NODE_TYPES } from '@kbn/ml-data-frame-analytics-utils'; -import { useCurrentThemeVars, useMlKibana, useMlLocator } from '../../../contexts/kibana'; +import { useMlKibana, useMlLocator } from '../../../contexts/kibana'; import { Controls, Cytoscape, JobMapLegend } from './components'; import { ML_PAGES } from '../../../../../common/constants/locator'; -import type { EuiThemeType } from '../../../components/color_range_legend'; import { useRefresh } from '../../../routing/use_refresh'; import { useRefDimensions } from './components/use_ref_dimensions'; import { useFetchAnalyticsMapData } from './use_fetch_analytics_map_data'; -const getCytoscapeDivStyle = (theme: EuiThemeType) => ({ +const getCytoscapeDivStyle = (theme: EuiThemeComputed) => ({ background: `linear-gradient( 90deg, - ${theme.euiPageBackgroundColor} - calc(${theme.euiSizeL} - calc(${theme.euiSizeXS} / 2)), + ${theme.colors.backgroundBasePlain} + calc(${theme.size.l} - calc(${theme.size.xs} / 2)), transparent 1% ) center, linear-gradient( - ${theme.euiPageBackgroundColor} - calc(${theme.euiSizeL} - calc(${theme.euiSizeXS} / 2)), + ${theme.colors.backgroundBasePlain} + calc(${theme.size.l} - calc(${theme.size.xs} / 2)), transparent 1% ) center, -${theme.euiColorLightShade}`, - backgroundSize: `${theme.euiSizeL} ${theme.euiSizeL}`, +${theme.colors.lightShade}`, + backgroundSize: `${theme.size.l} ${theme.size.l}`, marginTop: 0, }); @@ -67,7 +73,7 @@ export const JobMap: FC<Props> = ({ defaultHeight, analyticsId, modelId, forceRe }, } = useMlKibana(); const locator = useMlLocator()!; - const { euiTheme } = useCurrentThemeVars(); + const { euiTheme } = useEuiTheme(); const refresh = useRefresh(); const redirectToAnalyticsManagementPage = async () => { @@ -162,7 +168,7 @@ export const JobMap: FC<Props> = ({ defaultHeight, analyticsId, modelId, forceRe <EuiSpacer size="m" /> <EuiFlexGroup direction="row" gutterSize="none" justifyContent="spaceBetween"> <EuiFlexItem> - <JobMapLegend theme={euiTheme} hasMissingJobNode={hasMissingJobNode} /> + <JobMapLegend hasMissingJobNode={hasMissingJobNode} /> </EuiFlexItem> <EuiFlexItem grow={false}> <EuiButtonEmpty @@ -178,9 +184,8 @@ export const JobMap: FC<Props> = ({ defaultHeight, analyticsId, modelId, forceRe </EuiButtonEmpty> </EuiFlexItem> </EuiFlexGroup> - <div style={{ height: h - parseInt(euiTheme.euiSizeL, 10) - 20 }} ref={ref}> + <div style={{ height: h - parseInt(euiTheme.size.l, 10) - 20 }} ref={ref}> <Cytoscape - theme={euiTheme} height={h - 20} elements={elements} width={width} diff --git a/x-pack/platform/plugins/shared/ml/public/application/datavisualizer/data_drift/index_patterns_picker.tsx b/x-pack/platform/plugins/shared/ml/public/application/datavisualizer/data_drift/index_patterns_picker.tsx index 6a8c09d000cc3..78628558cfafc 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/datavisualizer/data_drift/index_patterns_picker.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/datavisualizer/data_drift/index_patterns_picker.tsx @@ -48,7 +48,7 @@ export const DataDriftIndexOrSearchRedirect: FC = () => { <MlPageHeader> <FormattedMessage id="xpack.ml.newJob.wizard.selectDataViewOrSavedSearch" - defaultMessage="Select data view or saved search" + defaultMessage="Select data view or saved Discover session" /> </MlPageHeader> <EuiPanel hasShadow={false} hasBorder> @@ -58,16 +58,16 @@ export const DataDriftIndexOrSearchRedirect: FC = () => { onChoose={onObjectSelection} showFilter noItemsMessage={i18n.translate('xpack.ml.newJob.wizard.searchSelection.notFoundLabel', { - defaultMessage: 'No matching data views or saved searches found.', + defaultMessage: 'No matching data views or saved Discover sessions found.', })} savedObjectMetaData={[ { type: 'search', - getIconForSavedObject: () => 'search', + getIconForSavedObject: () => 'discoverApp', name: i18n.translate( - 'xpack.ml.newJob.wizard.searchSelection.savedObjectType.search', + 'xpack.ml.newJob.wizard.searchSelection.savedObjectType.discoverSession', { - defaultMessage: 'Saved search', + defaultMessage: 'Discover session', } ), showSavedObject: (savedObject: SavedObject) => diff --git a/x-pack/platform/plugins/shared/ml/public/application/explorer/annotation_timeline.tsx b/x-pack/platform/plugins/shared/ml/public/application/explorer/annotation_timeline.tsx index 3d12c55e05e16..5ab414fd8c310 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/explorer/annotation_timeline.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/explorer/annotation_timeline.tsx @@ -8,8 +8,11 @@ import React, { type FC, type PropsWithChildren, useEffect } from 'react'; import d3 from 'd3'; import { scaleTime } from 'd3-scale'; + +import { useEuiFontSize, useEuiTheme } from '@elastic/eui'; + import { type ChartTooltipService, type TooltipData } from '../components/chart_tooltip'; -import { useCurrentThemeVars } from '../contexts/kibana'; + import { Y_AXIS_LABEL_PADDING, Y_AXIS_LABEL_WIDTH } from './constants'; export interface AnnotationTimelineProps<T extends { timestamp: number; end_timestamp?: number }> { @@ -39,7 +42,8 @@ export const AnnotationTimeline = <T extends { timestamp: number; end_timestamp? getTooltipContent, }: PropsWithChildren<AnnotationTimelineProps<T>>): ReturnType<FC> => { const canvasRef = React.useRef<HTMLDivElement | null>(null); - const { euiTheme } = useCurrentThemeVars(); + const { euiTheme } = useEuiTheme(); + const euiFontSizeXS = useEuiFontSize('xs', { unit: 'px' }).fontSize as string; useEffect( function renderChart() { @@ -69,8 +73,8 @@ export const AnnotationTimeline = <T extends { timestamp: number; end_timestamp? .attr('x', Y_AXIS_LABEL_WIDTH - Y_AXIS_LABEL_PADDING) .attr('y', ANNOTATION_CONTAINER_HEIGHT / 2) .attr('dominant-baseline', 'middle') - .style('fill', euiTheme.euiTextSubduedColor) - .style('font-size', euiTheme.euiFontSizeXS); + .style('fill', euiTheme.colors.textSubdued) + .style('font-size', euiFontSizeXS); // Add border svg @@ -79,7 +83,7 @@ export const AnnotationTimeline = <T extends { timestamp: number; end_timestamp? .attr('y', 0) .attr('height', ANNOTATION_CONTAINER_HEIGHT) .attr('width', endingXPos - startingXPos) - .style('stroke', euiTheme.euiBorderColor) + .style('stroke', euiTheme.border.color) .style('fill', 'none') .style('stroke-width', 1); @@ -166,17 +170,7 @@ export const AnnotationTimeline = <T extends { timestamp: number; end_timestamp? .on('mouseout', () => tooltipService.hide()); }); }, - [ - chartWidth, - domain, - data, - tooltipService, - label, - euiTheme.euiTextSubduedColor, - euiTheme.euiFontSizeXS, - euiTheme.euiBorderColor, - getTooltipContent, - ] + [chartWidth, domain, data, tooltipService, label, euiTheme, euiFontSizeXS, getTooltipContent] ); return <div ref={canvasRef} />; diff --git a/x-pack/platform/plugins/shared/ml/public/application/explorer/swimlane_annotation_container.tsx b/x-pack/platform/plugins/shared/ml/public/application/explorer/swimlane_annotation_container.tsx index ce506e03dae31..ec480da717675 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/explorer/swimlane_annotation_container.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/explorer/swimlane_annotation_container.tsx @@ -9,13 +9,18 @@ import type { FC } from 'react'; import React, { useEffect } from 'react'; import d3 from 'd3'; import { scaleTime } from 'd3-scale'; -import { i18n } from '@kbn/i18n'; import moment from 'moment'; -import { useCurrentThemeVars } from '../contexts/kibana'; + +import { useEuiFontSize, useEuiTheme } from '@elastic/eui'; + +import { i18n } from '@kbn/i18n'; + import type { Annotation, AnnotationsTable } from '../../../common/types/annotations'; + import type { ChartTooltipService } from '../components/chart_tooltip'; +import { useAnnotationStyles } from '../timeseriesexplorer/styles'; + import { Y_AXIS_LABEL_PADDING, Y_AXIS_LABEL_WIDTH } from './constants'; -import { getAnnotationStyles } from '../timeseriesexplorer/styles'; const ANNOTATION_CONTAINER_HEIGHT = 12; const ANNOTATION_MIN_WIDTH = 8; @@ -30,16 +35,16 @@ interface SwimlaneAnnotationContainerProps { tooltipService: ChartTooltipService; } -const annotationStyles = getAnnotationStyles(); - export const SwimlaneAnnotationContainer: FC<SwimlaneAnnotationContainerProps> = ({ chartWidth, domain, annotationsData, tooltipService, }) => { + const annotationStyles = useAnnotationStyles(); const canvasRef = React.useRef<HTMLDivElement | null>(null); - const { euiTheme } = useCurrentThemeVars(); + const { euiTheme } = useEuiTheme(); + const euiFontSizeXS = useEuiFontSize('xs', { unit: 'px' }).fontSize as string; useEffect(() => { if (canvasRef.current !== null && Array.isArray(annotationsData)) { @@ -71,8 +76,8 @@ export const SwimlaneAnnotationContainer: FC<SwimlaneAnnotationContainerProps> = .attr('x', Y_AXIS_LABEL_WIDTH - Y_AXIS_LABEL_PADDING) .attr('y', ANNOTATION_CONTAINER_HEIGHT / 2) .attr('dominant-baseline', 'middle') - .style('fill', euiTheme.euiTextSubduedColor) - .style('font-size', euiTheme.euiFontSizeXS); + .style('fill', euiTheme.colors.textSubdued) + .style('font-size', euiFontSizeXS); // Add border svg @@ -81,7 +86,7 @@ export const SwimlaneAnnotationContainer: FC<SwimlaneAnnotationContainerProps> = .attr('y', 0) .attr('height', ANNOTATION_CONTAINER_HEIGHT) .attr('width', endingXPos - startingXPos) - .style('stroke', euiTheme.euiBorderColor) + .style('stroke', euiTheme.border.color) .style('fill', 'none') .style('stroke-width', 1); diff --git a/x-pack/platform/plugins/shared/ml/public/application/explorer/swimlane_container.tsx b/x-pack/platform/plugins/shared/ml/public/application/explorer/swimlane_container.tsx index 5dd1440d7d817..7c1118b33cb6d 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/explorer/swimlane_container.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/explorer/swimlane_container.tsx @@ -7,13 +7,17 @@ import type { FC } from 'react'; import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; + import { + useEuiFontSize, + useEuiTheme, EuiFlexGroup, EuiFlexItem, EuiLoadingChart, EuiResizeObserver, EuiText, } from '@elastic/eui'; + import { throttle } from 'lodash'; import type { BrushEndListener, @@ -62,7 +66,7 @@ import { FormattedTooltip } from '../components/chart_tooltip/chart_tooltip'; import './_explorer.scss'; import { EMPTY_FIELD_VALUE_LABEL } from '../timeseriesexplorer/components/entity_control/entity_control'; import { SWIM_LANE_LABEL_WIDTH, Y_AXIS_LABEL_PADDING } from './constants'; -import { useCurrentThemeVars, useMlKibana } from '../contexts/kibana'; +import { useMlKibana } from '../contexts/kibana'; declare global { interface Window { @@ -205,7 +209,7 @@ export const SwimlaneContainer: FC<SwimlaneProps> = ({ } = useMlKibana(); const isDarkTheme = useIsDarkTheme(themeService); - const { euiTheme } = useCurrentThemeVars(); + const { euiTheme } = useEuiTheme(); // Holds the container height for previously fetched data const containerHeightRef = useRef<number>(); @@ -297,18 +301,20 @@ export const SwimlaneContainer: FC<SwimlaneProps> = ({ const showBrush = !!onCellsSelection; + const euiFontSizeXS = useEuiFontSize('xs', { unit: 'px' }).fontSize as string; + const themeOverrides = useMemo<PartialTheme>(() => { if (!showSwimlane) return {}; const theme: PartialTheme = { background: { - color: euiTheme.euiPanelBackgroundColorModifiers.plain, + color: euiTheme.colors.backgroundBasePlain, }, heatmap: { grid: { stroke: { width: BORDER_WIDTH, - color: euiTheme.euiBorderColor, + color: euiTheme.border.color, }, }, cell: { @@ -318,21 +324,21 @@ export const SwimlaneContainer: FC<SwimlaneProps> = ({ visible: false, }, border: { - stroke: euiTheme.euiBorderColor, + stroke: euiTheme.colors.borderBasePlain, strokeWidth: 0, }, }, yAxisLabel: { visible: showYAxis, width: yAxisWidth, - textColor: euiTheme.euiTextSubduedColor, + textColor: euiTheme.colors.textSubdued, padding: Y_AXIS_LABEL_PADDING, - fontSize: parseInt(euiTheme.euiFontSizeXS, 10), + fontSize: parseInt(euiFontSizeXS, 10), }, xAxisLabel: { visible: showTimeline, - textColor: euiTheme.euiTextSubduedColor, - fontSize: parseInt(euiTheme.euiFontSizeXS, 10), + textColor: euiTheme.colors.textSubdued, + fontSize: parseInt(euiFontSizeXS, 10), }, brushMask: { visible: showBrush, diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/datafeed_chart_flyout/datafeed_chart_flyout.tsx b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/datafeed_chart_flyout/datafeed_chart_flyout.tsx index a2f271f243b1c..bc7b4b4d3a2fb 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/datafeed_chart_flyout/datafeed_chart_flyout.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/datafeed_chart_flyout/datafeed_chart_flyout.tsx @@ -11,6 +11,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import moment from 'moment'; import { + useEuiTheme, EuiButtonEmpty, EuiCheckbox, EuiDatePicker, @@ -60,7 +61,7 @@ import type { import type { JobMessage } from '../../../../../../common/types/audit_message'; import type { LineAnnotationDatumWithModelSnapshot } from '../../../../../../common/types/results'; import { useToastNotificationService } from '../../../../services/toast_notification_service'; -import { useCurrentThemeVars, useMlApi } from '../../../../contexts/kibana'; +import { useMlApi } from '../../../../contexts/kibana'; import { RevertModelSnapshotFlyout } from '../../../../components/model_snapshots/revert_model_snapshot_flyout'; import { JobMessagesPane } from '../job_details/job_messages_pane'; import { EditQueryDelay } from './edit_query_delay'; @@ -146,7 +147,7 @@ export const DatafeedChartFlyout: FC<DatafeedChartFlyoutProps> = ({ results: { getDatafeedResultChartData }, } = useMlApi(); const { displayErrorToast } = useToastNotificationService(); - const { euiTheme } = useCurrentThemeVars(); + const { euiTheme } = useEuiTheme(); const handleChange = (date: moment.Moment) => setEndDate(date); const handleEndDateChange = (direction: ChartDirectionType) => { if (data.bucketSpan === undefined) return; @@ -479,7 +480,7 @@ export const DatafeedChartFlyout: FC<DatafeedChartFlyoutProps> = ({ style={{ line: { strokeWidth: 3, - stroke: euiTheme.euiColorDangerText, + stroke: euiTheme.colors.textDanger, opacity: 0.5, }, }} @@ -494,7 +495,7 @@ export const DatafeedChartFlyout: FC<DatafeedChartFlyoutProps> = ({ defaultMessage: 'Annotations rectangle result', } )} - style={{ fill: euiTheme.euiColorDangerText }} + style={{ fill: euiTheme.colors.textDanger }} /> </> ) : null} @@ -514,7 +515,11 @@ export const DatafeedChartFlyout: FC<DatafeedChartFlyoutProps> = ({ style={{ line: { strokeWidth: 3, - stroke: euiTheme.euiColorVis1, + // Amsterdam: euiTheme.colors.vis.euiColorVis1 + // Borealis: euiTheme.colors.vis.euiColorVis2 + stroke: euiTheme.flags.hasVisColorAdjustment + ? euiTheme.colors.vis.euiColorVis1 + : euiTheme.colors.vis.euiColorVis2, opacity: 0.5, }, }} @@ -537,7 +542,7 @@ export const DatafeedChartFlyout: FC<DatafeedChartFlyoutProps> = ({ style={{ line: { strokeWidth: 3, - stroke: euiTheme.euiColorAccent, + stroke: euiTheme.colors.accent, opacity: 0.5, }, }} @@ -546,7 +551,7 @@ export const DatafeedChartFlyout: FC<DatafeedChartFlyoutProps> = ({ ) : null} <LineSeries key={'source-results'} - color={euiTheme.euiColorPrimary} + color={euiTheme.colors.primary} id={i18n.translate('xpack.ml.jobsList.datafeedChart.sourceSeriesId', { defaultMessage: 'Source indices document count', })} @@ -559,7 +564,7 @@ export const DatafeedChartFlyout: FC<DatafeedChartFlyoutProps> = ({ /> <LineSeries key={'job-results'} - color={euiTheme.euiColorAccentText} + color={euiTheme.colors.textAccent} id={i18n.translate('xpack.ml.jobsList.datafeedChart.bucketSeriesId', { defaultMessage: 'Datafeed document count', })} diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_job_flyout.js b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_job_flyout.js index 4659121fd8306..31c523855e6e9 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_job_flyout.js +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/edit_job_flyout.js @@ -26,7 +26,7 @@ import { EuiSpacer, } from '@elastic/eui'; -import { JobDetails, Detectors, Datafeed } from './tabs'; +import { EditJobDetailsTab, EditDetectorsTab, EditDatafeedTab } from './tabs'; import { saveJob } from './edit_utils'; import { loadFullJob } from '../utils'; import { validateModelMemoryLimit, validateGroupNames } from '../validate_job'; @@ -340,7 +340,8 @@ export class EditJobFlyoutUI extends Component { defaultMessage: 'Job details', }), content: ( - <JobDetails + <EditJobDetailsTab + euiTheme={this.props.euiTheme} jobClosed={jobClosed} datafeedRunning={datafeedRunning} jobDescription={jobDescription} @@ -361,7 +362,7 @@ export class EditJobFlyoutUI extends Component { defaultMessage: 'Detectors', }), content: ( - <Detectors + <EditDetectorsTab jobDetectors={jobDetectors} jobDetectorDescriptions={jobDetectorDescriptions} setDetectorDescriptions={this.setDetectorDescriptions} @@ -375,7 +376,7 @@ export class EditJobFlyoutUI extends Component { defaultMessage: 'Datafeed', }), content: ( - <Datafeed + <EditDatafeedTab datafeedQuery={datafeedQuery} datafeedQueryDelay={datafeedQueryDelay} datafeedFrequency={datafeedFrequency} @@ -515,6 +516,7 @@ export class EditJobFlyoutUI extends Component { } EditJobFlyoutUI.propTypes = { + euiTheme: PropTypes.object.isRequired, setShowFunction: PropTypes.func.isRequired, unsetShowFunction: PropTypes.func.isRequired, refreshJobs: PropTypes.func.isRequired, diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/datafeed.js b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/datafeed.js deleted file mode 100644 index 5f6ba8f6c89be..0000000000000 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/datafeed.js +++ /dev/null @@ -1,175 +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 PropTypes from 'prop-types'; -import React, { Component } from 'react'; - -import { - EuiFieldText, - EuiForm, - EuiFormRow, - EuiSpacer, - EuiFieldNumber, - EuiCallOut, -} from '@elastic/eui'; - -import { FormattedMessage } from '@kbn/i18n-react'; -import { parseInterval } from '@kbn/ml-parse-interval'; - -import { calculateDatafeedFrequencyDefaultSeconds } from '../../../../../../../common/util/job_utils'; -import { getNewJobDefaults } from '../../../../../services/ml_server_info'; -import { MLJobEditor, ML_EDITOR_MODE } from '../../ml_job_editor'; - -function getDefaults(bucketSpan, jobDefaults) { - const bucketSpanSeconds = bucketSpan !== undefined ? parseInterval(bucketSpan).asSeconds() : ''; - return { - queryDelay: '60s', - frequency: calculateDatafeedFrequencyDefaultSeconds(bucketSpanSeconds) + 's', - scrollSize: jobDefaults.datafeeds.scroll_size, - }; -} - -export class Datafeed extends Component { - constructor(props) { - super(props); - - this.state = { - query: '', - queryDelay: '', - frequency: '', - scrollSize: '', - defaults: { - queryDelay: '', - frequency: '', - scrollSize: 0, - }, - jobDefaults: getNewJobDefaults(), - }; - - this.setDatafeed = props.setDatafeed; - } - - static getDerivedStateFromProps(props, state) { - return { - query: props.datafeedQuery, - queryDelay: props.datafeedQueryDelay, - frequency: props.datafeedFrequency, - scrollSize: props.datafeedScrollSize, - defaults: getDefaults(props.jobBucketSpan, state.jobDefaults), - }; - } - - onQueryChange = (query) => { - this.setDatafeed({ datafeedQuery: query }); - }; - - onQueryDelayChange = (e) => { - this.setDatafeed({ datafeedQueryDelay: e.target.value }); - }; - - onFrequencyChange = (e) => { - this.setDatafeed({ datafeedFrequency: e.target.value }); - }; - - onScrollSizeChange = (e) => { - this.setDatafeed({ datafeedScrollSize: +e.target.value }); - }; - - render() { - const { query, queryDelay, frequency, scrollSize, defaults } = this.state; - const { datafeedRunning } = this.props; - return ( - <React.Fragment> - <EuiSpacer size="m" /> - {datafeedRunning && ( - <> - <EuiCallOut color="warning"> - <FormattedMessage - id="xpack.ml.jobsList.editJobFlyout.datafeed.readOnlyCalloutText" - defaultMessage="Datafeed settings cannot be edited while the datafeed is running. Please stop the job if you wish to edit these settings." - /> - </EuiCallOut> - <EuiSpacer size="l" /> - </> - )} - <EuiForm> - <EuiFormRow - label={ - <FormattedMessage - id="xpack.ml.jobsList.editJobFlyout.datafeed.queryLabel" - defaultMessage="Query" - /> - } - style={{ maxWidth: 'inherit' }} - > - <MLJobEditor - mode={ML_EDITOR_MODE.XJSON} - value={query} - onChange={this.onQueryChange} - height="200px" - readOnly={datafeedRunning} - /> - </EuiFormRow> - <EuiFormRow - label={ - <FormattedMessage - id="xpack.ml.jobsList.editJobFlyout.datafeed.queryDelayLabel" - defaultMessage="Query delay" - /> - } - > - <EuiFieldText - value={queryDelay} - placeholder={defaults.queryDelay} - onChange={this.onQueryDelayChange} - disabled={datafeedRunning} - /> - </EuiFormRow> - <EuiFormRow - label={ - <FormattedMessage - id="xpack.ml.jobsList.editJobFlyout.datafeed.frequencyLabel" - defaultMessage="Frequency" - /> - } - > - <EuiFieldText - value={frequency} - placeholder={defaults.frequency} - onChange={this.onFrequencyChange} - disabled={datafeedRunning} - /> - </EuiFormRow> - <EuiFormRow - label={ - <FormattedMessage - id="xpack.ml.jobsList.editJobFlyout.datafeed.scrollSizeLabel" - defaultMessage="Scroll size" - /> - } - > - <EuiFieldNumber - value={scrollSize} - placeholder={defaults.scrollSize} - onChange={this.onScrollSizeChange} - disabled={datafeedRunning} - /> - </EuiFormRow> - </EuiForm> - </React.Fragment> - ); - } -} -Datafeed.propTypes = { - datafeedRunning: PropTypes.bool.isRequired, - datafeedQuery: PropTypes.string.isRequired, - datafeedQueryDelay: PropTypes.string.isRequired, - datafeedFrequency: PropTypes.string.isRequired, - datafeedScrollSize: PropTypes.number.isRequired, - jobBucketSpan: PropTypes.string.isRequired, - setDatafeed: PropTypes.func.isRequired, -}; diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/detectors.js b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/detectors.js deleted file mode 100644 index 0dcc57d30fb01..0000000000000 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/detectors.js +++ /dev/null @@ -1,74 +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 PropTypes from 'prop-types'; -import React, { Component } from 'react'; - -import { EuiFieldText, EuiForm, EuiFormRow, EuiSpacer, EuiTitle } from '@elastic/eui'; - -import { FormattedMessage } from '@kbn/i18n-react'; -import { context } from '@kbn/kibana-react-plugin/public'; - -import { detectorToString } from '../../../../../util/string_utils'; - -export class Detectors extends Component { - static contextType = context; - - constructor(props, constructorContext) { - super(props, constructorContext); - - this.state = { - detectors: [], - detectorDescriptions: [], - }; - - this.setDetectorDescriptions = props.setDetectorDescriptions; - } - - static getDerivedStateFromProps(props) { - return { - detectors: props.jobDetectors, - detectorDescriptions: props.jobDetectorDescriptions, - }; - } - - onDescriptionChange = (e, i) => { - const jobDetectorDescriptions = this.state.detectorDescriptions; - jobDetectorDescriptions[i] = e.target.value; - this.setDetectorDescriptions({ jobDetectorDescriptions }); - }; - - render() { - const { detectors, detectorDescriptions } = this.state; - return ( - <> - <EuiSpacer size="m" /> - <EuiTitle size="xs"> - <h4> - <FormattedMessage - id="xpack.ml.jobsList.editJobFlyout.detectors.title" - defaultMessage="Edit detector descriptions" - /> - </h4> - </EuiTitle> - <EuiSpacer size="m" /> - <EuiForm> - {detectorDescriptions.map((d, i) => ( - <EuiFormRow label={detectorToString(detectors[i])} key={i}> - <EuiFieldText value={d} onChange={(e) => this.onDescriptionChange(e, i)} /> - </EuiFormRow> - ))} - </EuiForm> - </> - ); - } -} -Detectors.propTypes = { - jobDetectors: PropTypes.array.isRequired, - jobDetectorDescriptions: PropTypes.array.isRequired, - setDetectorDescriptions: PropTypes.func.isRequired, -}; diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/edit_datafeed_tab.js b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/edit_datafeed_tab.js new file mode 100644 index 0000000000000..7c779f57710f3 --- /dev/null +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/edit_datafeed_tab.js @@ -0,0 +1,175 @@ +/* + * 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 PropTypes from 'prop-types'; +import React, { Component } from 'react'; + +import { + EuiFieldText, + EuiForm, + EuiFormRow, + EuiSpacer, + EuiFieldNumber, + EuiCallOut, +} from '@elastic/eui'; + +import { FormattedMessage } from '@kbn/i18n-react'; +import { parseInterval } from '@kbn/ml-parse-interval'; + +import { calculateDatafeedFrequencyDefaultSeconds } from '../../../../../../../common/util/job_utils'; +import { getNewJobDefaults } from '../../../../../services/ml_server_info'; +import { MLJobEditor, ML_EDITOR_MODE } from '../../ml_job_editor'; + +function getDefaults(bucketSpan, jobDefaults) { + const bucketSpanSeconds = bucketSpan !== undefined ? parseInterval(bucketSpan).asSeconds() : ''; + return { + queryDelay: '60s', + frequency: calculateDatafeedFrequencyDefaultSeconds(bucketSpanSeconds) + 's', + scrollSize: jobDefaults.datafeeds.scroll_size, + }; +} + +export class EditDatafeedTab extends Component { + constructor(props) { + super(props); + + this.state = { + query: '', + queryDelay: '', + frequency: '', + scrollSize: '', + defaults: { + queryDelay: '', + frequency: '', + scrollSize: 0, + }, + jobDefaults: getNewJobDefaults(), + }; + + this.setDatafeed = props.setDatafeed; + } + + static getDerivedStateFromProps(props, state) { + return { + query: props.datafeedQuery, + queryDelay: props.datafeedQueryDelay, + frequency: props.datafeedFrequency, + scrollSize: props.datafeedScrollSize, + defaults: getDefaults(props.jobBucketSpan, state.jobDefaults), + }; + } + + onQueryChange = (query) => { + this.setDatafeed({ datafeedQuery: query }); + }; + + onQueryDelayChange = (e) => { + this.setDatafeed({ datafeedQueryDelay: e.target.value }); + }; + + onFrequencyChange = (e) => { + this.setDatafeed({ datafeedFrequency: e.target.value }); + }; + + onScrollSizeChange = (e) => { + this.setDatafeed({ datafeedScrollSize: +e.target.value }); + }; + + render() { + const { query, queryDelay, frequency, scrollSize, defaults } = this.state; + const { datafeedRunning } = this.props; + return ( + <React.Fragment> + <EuiSpacer size="m" /> + {datafeedRunning && ( + <> + <EuiCallOut color="warning"> + <FormattedMessage + id="xpack.ml.jobsList.editJobFlyout.datafeed.readOnlyCalloutText" + defaultMessage="Datafeed settings cannot be edited while the datafeed is running. Please stop the job if you wish to edit these settings." + /> + </EuiCallOut> + <EuiSpacer size="l" /> + </> + )} + <EuiForm> + <EuiFormRow + label={ + <FormattedMessage + id="xpack.ml.jobsList.editJobFlyout.datafeed.queryLabel" + defaultMessage="Query" + /> + } + style={{ maxWidth: 'inherit' }} + > + <MLJobEditor + mode={ML_EDITOR_MODE.XJSON} + value={query} + onChange={this.onQueryChange} + height="200px" + readOnly={datafeedRunning} + /> + </EuiFormRow> + <EuiFormRow + label={ + <FormattedMessage + id="xpack.ml.jobsList.editJobFlyout.datafeed.queryDelayLabel" + defaultMessage="Query delay" + /> + } + > + <EuiFieldText + value={queryDelay} + placeholder={defaults.queryDelay} + onChange={this.onQueryDelayChange} + disabled={datafeedRunning} + /> + </EuiFormRow> + <EuiFormRow + label={ + <FormattedMessage + id="xpack.ml.jobsList.editJobFlyout.datafeed.frequencyLabel" + defaultMessage="Frequency" + /> + } + > + <EuiFieldText + value={frequency} + placeholder={defaults.frequency} + onChange={this.onFrequencyChange} + disabled={datafeedRunning} + /> + </EuiFormRow> + <EuiFormRow + label={ + <FormattedMessage + id="xpack.ml.jobsList.editJobFlyout.datafeed.scrollSizeLabel" + defaultMessage="Scroll size" + /> + } + > + <EuiFieldNumber + value={scrollSize} + placeholder={defaults.scrollSize} + onChange={this.onScrollSizeChange} + disabled={datafeedRunning} + /> + </EuiFormRow> + </EuiForm> + </React.Fragment> + ); + } +} +EditDatafeedTab.propTypes = { + datafeedRunning: PropTypes.bool.isRequired, + datafeedQuery: PropTypes.string.isRequired, + datafeedQueryDelay: PropTypes.string.isRequired, + datafeedFrequency: PropTypes.string.isRequired, + datafeedScrollSize: PropTypes.number.isRequired, + jobBucketSpan: PropTypes.string.isRequired, + setDatafeed: PropTypes.func.isRequired, +}; diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/edit_detectors_tab.js b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/edit_detectors_tab.js new file mode 100644 index 0000000000000..149b94ca9beb7 --- /dev/null +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/edit_detectors_tab.js @@ -0,0 +1,74 @@ +/* + * 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 PropTypes from 'prop-types'; +import React, { Component } from 'react'; + +import { EuiFieldText, EuiForm, EuiFormRow, EuiSpacer, EuiTitle } from '@elastic/eui'; + +import { FormattedMessage } from '@kbn/i18n-react'; +import { context } from '@kbn/kibana-react-plugin/public'; + +import { detectorToString } from '../../../../../util/string_utils'; + +export class EditDetectorsTab extends Component { + static contextType = context; + + constructor(props, constructorContext) { + super(props, constructorContext); + + this.state = { + detectors: [], + detectorDescriptions: [], + }; + + this.setDetectorDescriptions = props.setDetectorDescriptions; + } + + static getDerivedStateFromProps(props) { + return { + detectors: props.jobDetectors, + detectorDescriptions: props.jobDetectorDescriptions, + }; + } + + onDescriptionChange = (e, i) => { + const jobDetectorDescriptions = this.state.detectorDescriptions; + jobDetectorDescriptions[i] = e.target.value; + this.setDetectorDescriptions({ jobDetectorDescriptions }); + }; + + render() { + const { detectors, detectorDescriptions } = this.state; + return ( + <> + <EuiSpacer size="m" /> + <EuiTitle size="xs"> + <h4> + <FormattedMessage + id="xpack.ml.jobsList.editJobFlyout.detectors.title" + defaultMessage="Edit detector descriptions" + /> + </h4> + </EuiTitle> + <EuiSpacer size="m" /> + <EuiForm> + {detectorDescriptions.map((d, i) => ( + <EuiFormRow label={detectorToString(detectors[i])} key={i}> + <EuiFieldText value={d} onChange={(e) => this.onDescriptionChange(e, i)} /> + </EuiFormRow> + ))} + </EuiForm> + </> + ); + } +} +EditDetectorsTab.propTypes = { + jobDetectors: PropTypes.array.isRequired, + jobDetectorDescriptions: PropTypes.array.isRequired, + setDetectorDescriptions: PropTypes.func.isRequired, +}; diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/edit_job_details_tab.js b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/edit_job_details_tab.js new file mode 100644 index 0000000000000..a56868f8b022d --- /dev/null +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/edit_job_details_tab.js @@ -0,0 +1,274 @@ +/* + * 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 PropTypes from 'prop-types'; +import React, { Component } from 'react'; + +import { + EuiFieldText, + EuiForm, + EuiFormRow, + EuiSpacer, + EuiComboBox, + EuiFieldNumber, +} from '@elastic/eui'; + +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { withKibana } from '@kbn/kibana-react-plugin/public'; + +import { tabColor } from '../../../../../../../common/util/group_color_utils'; + +export class EditJobDetailsTabUI extends Component { + constructor(props) { + super(props); + + this.state = { + description: '', + groups: [], + selectedGroups: [], + mml: '', + mmlValidationError: '', + groupsValidationError: '', + modelSnapshotRetentionDays: 1, + dailyModelSnapshotRetentionAfterDays: 1, + }; + + this.setJobDetails = props.setJobDetails; + } + + componentDidMount() { + const euiTheme = this.props.euiTheme; + const mlApi = this.props.kibana.services.mlServices.mlApi; + // load groups to populate the select options + mlApi.jobs + .groups() + .then((resp) => { + const groups = resp.map((g) => ({ label: g.id, color: tabColor(g.id, euiTheme) })); + this.setState({ groups }); + }) + .catch((error) => { + console.error('Could not load groups', error); + }); + } + + static getDerivedStateFromProps(props) { + const selectedGroups = + props.jobGroups !== undefined + ? props.jobGroups.map((g) => ({ label: g, color: tabColor(g, props.euiTheme) })) + : []; + + const { datafeedRunning, jobClosed } = props; + + let mmlHelpText = null; + if (!jobClosed) { + mmlHelpText = ( + <FormattedMessage + id="xpack.ml.jobsList.editJobFlyout.jobDetails.modelMemoryLimitJobOpenLabelHelp" + defaultMessage="Model memory limit cannot be edited while the job is open." + /> + ); + } + + if (datafeedRunning) { + mmlHelpText = ( + <FormattedMessage + id="xpack.ml.jobsList.editJobFlyout.jobDetails.modelMemoryLimitLabelHelp" + defaultMessage="Model memory limit cannot be edited while the datafeed is running." + /> + ); + } + + return { + description: props.jobDescription, + selectedGroups, + mml: props.jobModelMemoryLimit, + mmlHelpText, + mmlValidationError: props.jobModelMemoryLimitValidationError, + groupsValidationError: props.jobGroupsValidationError, + modelSnapshotRetentionDays: props.jobModelSnapshotRetentionDays, + dailyModelSnapshotRetentionAfterDays: props.jobDailyModelSnapshotRetentionAfterDays, + }; + } + + onDescriptionChange = (e) => { + this.setJobDetails({ jobDescription: e.target.value }); + }; + + onMmlChange = (e) => { + this.setJobDetails({ jobModelMemoryLimit: e.target.value }); + }; + + onModelSnapshotRetentionDaysChange = (e) => { + const jobModelSnapshotRetentionDays = Math.floor(+e.target.value); + + this.setJobDetails({ + jobModelSnapshotRetentionDays, + ...(this.state.dailyModelSnapshotRetentionAfterDays > jobModelSnapshotRetentionDays + ? { jobDailyModelSnapshotRetentionAfterDays: jobModelSnapshotRetentionDays } + : {}), + }); + }; + + onDailyModelSnapshotRetentionAfterDaysChange = (e) => { + const jobDailyModelSnapshotRetentionAfterDays = Math.floor(+e.target.value); + if (jobDailyModelSnapshotRetentionAfterDays <= this.state.modelSnapshotRetentionDays) { + this.setJobDetails({ jobDailyModelSnapshotRetentionAfterDays }); + } + }; + + onGroupsChange = (selectedGroups) => { + this.setJobDetails({ jobGroups: selectedGroups.map((g) => g.label) }); + }; + + onCreateGroup = (input, flattenedOptions) => { + const normalizedSearchValue = input.trim().toLowerCase(); + + if (!normalizedSearchValue) { + return; + } + + const newGroup = { + label: input, + }; + + const groups = this.state.groups; + // Create the option if it doesn't exist. + if ( + flattenedOptions.findIndex( + (option) => option.label.trim().toLowerCase() === normalizedSearchValue + ) === -1 + ) { + groups.push(newGroup); + } + + const selectedGroups = this.state.selectedGroups.concat(newGroup); + + // update the groups in local state and call onGroupsChange to + // update the selected groups in the component above which manages this + // component's state + this.setState({ groups }, () => this.onGroupsChange(selectedGroups)); + }; + + render() { + const { + description, + selectedGroups, + mml, + groups, + mmlValidationError, + groupsValidationError, + modelSnapshotRetentionDays, + dailyModelSnapshotRetentionAfterDays, + mmlHelpText, + } = this.state; + + const { datafeedRunning, jobClosed } = this.props; + + return ( + <React.Fragment> + <EuiSpacer size="m" /> + <EuiForm> + <EuiFormRow + label={ + <FormattedMessage + id="xpack.ml.jobsList.editJobFlyout.jobDetails.jobDescriptionLabel" + defaultMessage="Job description" + /> + } + > + <EuiFieldText value={description} onChange={this.onDescriptionChange} /> + </EuiFormRow> + <EuiFormRow + label={ + <FormattedMessage + id="xpack.ml.jobsList.editJobFlyout.jobDetails.jobGroupsLabel" + defaultMessage="Job groups" + /> + } + isInvalid={groupsValidationError !== ''} + error={groupsValidationError} + > + <EuiComboBox + placeholder={i18n.translate( + 'xpack.ml.jobsList.editJobFlyout.jobDetails.jobGroupsPlaceholder', + { + defaultMessage: 'Select or create groups', + } + )} + options={groups} + selectedOptions={selectedGroups} + onChange={this.onGroupsChange} + onCreateOption={this.onCreateGroup} + isClearable={true} + isInvalid={groupsValidationError !== ''} + error={groupsValidationError} + /> + </EuiFormRow> + <EuiFormRow + label={ + <FormattedMessage + id="xpack.ml.jobsList.editJobFlyout.jobDetails.modelMemoryLimitLabel" + defaultMessage="Model memory limit" + /> + } + helpText={mmlHelpText} + isInvalid={mmlValidationError !== ''} + error={mmlValidationError} + > + <EuiFieldText + value={mml} + onChange={this.onMmlChange} + isInvalid={mmlValidationError !== ''} + error={mmlValidationError} + disabled={datafeedRunning || !jobClosed} + /> + </EuiFormRow> + <EuiFormRow + label={ + <FormattedMessage + id="xpack.ml.jobsList.editJobFlyout.jobDetails.modelSnapshotRetentionDaysLabel" + defaultMessage="Model snapshot retention days" + /> + } + > + <EuiFieldNumber + min={0} + value={modelSnapshotRetentionDays} + onChange={this.onModelSnapshotRetentionDaysChange} + /> + </EuiFormRow> + <EuiFormRow + label={ + <FormattedMessage + id="xpack.ml.jobsList.editJobFlyout.jobDetails.dailyModelSnapshotRetentionAfterDaysLabel" + defaultMessage="Daily model snapshot retention after days" + /> + } + > + <EuiFieldNumber + min={0} + max={modelSnapshotRetentionDays} + value={dailyModelSnapshotRetentionAfterDays} + onChange={this.onDailyModelSnapshotRetentionAfterDaysChange} + /> + </EuiFormRow> + </EuiForm> + </React.Fragment> + ); + } +} +EditJobDetailsTabUI.propTypes = { + datafeedRunning: PropTypes.bool.isRequired, + euiTheme: PropTypes.object.isRequired, + jobDescription: PropTypes.string.isRequired, + jobGroups: PropTypes.array.isRequired, + jobModelMemoryLimit: PropTypes.string.isRequired, + setJobDetails: PropTypes.func.isRequired, +}; + +export const EditJobDetailsTab = withKibana(EditJobDetailsTabUI); diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/index.js b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/index.js index 9ea9b3448541a..3b99a6ca59f5b 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/index.js +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/index.js @@ -5,6 +5,6 @@ * 2.0. */ -export { JobDetails } from './job_details'; -export { Detectors } from './detectors'; -export { Datafeed } from './datafeed'; +export { EditJobDetailsTab } from './edit_job_details_tab'; +export { EditDetectorsTab } from './edit_detectors_tab'; +export { EditDatafeedTab } from './edit_datafeed_tab'; diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/job_details.js b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/job_details.js deleted file mode 100644 index 322221045b652..0000000000000 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/edit_job_flyout/tabs/job_details.js +++ /dev/null @@ -1,272 +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 PropTypes from 'prop-types'; -import React, { Component } from 'react'; - -import { - EuiFieldText, - EuiForm, - EuiFormRow, - EuiSpacer, - EuiComboBox, - EuiFieldNumber, -} from '@elastic/eui'; - -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { withKibana } from '@kbn/kibana-react-plugin/public'; - -import { tabColor } from '../../../../../../../common/util/group_color_utils'; - -export class JobDetailsUI extends Component { - constructor(props) { - super(props); - - this.state = { - description: '', - groups: [], - selectedGroups: [], - mml: '', - mmlValidationError: '', - groupsValidationError: '', - modelSnapshotRetentionDays: 1, - dailyModelSnapshotRetentionAfterDays: 1, - }; - - this.setJobDetails = props.setJobDetails; - } - - componentDidMount() { - const mlApi = this.props.kibana.services.mlServices.mlApi; - // load groups to populate the select options - mlApi.jobs - .groups() - .then((resp) => { - const groups = resp.map((g) => ({ label: g.id, color: tabColor(g.id) })); - this.setState({ groups }); - }) - .catch((error) => { - console.error('Could not load groups', error); - }); - } - - static getDerivedStateFromProps(props) { - const selectedGroups = - props.jobGroups !== undefined - ? props.jobGroups.map((g) => ({ label: g, color: tabColor(g) })) - : []; - - const { datafeedRunning, jobClosed } = props; - - let mmlHelpText = null; - if (!jobClosed) { - mmlHelpText = ( - <FormattedMessage - id="xpack.ml.jobsList.editJobFlyout.jobDetails.modelMemoryLimitJobOpenLabelHelp" - defaultMessage="Model memory limit cannot be edited while the job is open." - /> - ); - } - - if (datafeedRunning) { - mmlHelpText = ( - <FormattedMessage - id="xpack.ml.jobsList.editJobFlyout.jobDetails.modelMemoryLimitLabelHelp" - defaultMessage="Model memory limit cannot be edited while the datafeed is running." - /> - ); - } - - return { - description: props.jobDescription, - selectedGroups, - mml: props.jobModelMemoryLimit, - mmlHelpText, - mmlValidationError: props.jobModelMemoryLimitValidationError, - groupsValidationError: props.jobGroupsValidationError, - modelSnapshotRetentionDays: props.jobModelSnapshotRetentionDays, - dailyModelSnapshotRetentionAfterDays: props.jobDailyModelSnapshotRetentionAfterDays, - }; - } - - onDescriptionChange = (e) => { - this.setJobDetails({ jobDescription: e.target.value }); - }; - - onMmlChange = (e) => { - this.setJobDetails({ jobModelMemoryLimit: e.target.value }); - }; - - onModelSnapshotRetentionDaysChange = (e) => { - const jobModelSnapshotRetentionDays = Math.floor(+e.target.value); - - this.setJobDetails({ - jobModelSnapshotRetentionDays, - ...(this.state.dailyModelSnapshotRetentionAfterDays > jobModelSnapshotRetentionDays - ? { jobDailyModelSnapshotRetentionAfterDays: jobModelSnapshotRetentionDays } - : {}), - }); - }; - - onDailyModelSnapshotRetentionAfterDaysChange = (e) => { - const jobDailyModelSnapshotRetentionAfterDays = Math.floor(+e.target.value); - if (jobDailyModelSnapshotRetentionAfterDays <= this.state.modelSnapshotRetentionDays) { - this.setJobDetails({ jobDailyModelSnapshotRetentionAfterDays }); - } - }; - - onGroupsChange = (selectedGroups) => { - this.setJobDetails({ jobGroups: selectedGroups.map((g) => g.label) }); - }; - - onCreateGroup = (input, flattenedOptions) => { - const normalizedSearchValue = input.trim().toLowerCase(); - - if (!normalizedSearchValue) { - return; - } - - const newGroup = { - label: input, - }; - - const groups = this.state.groups; - // Create the option if it doesn't exist. - if ( - flattenedOptions.findIndex( - (option) => option.label.trim().toLowerCase() === normalizedSearchValue - ) === -1 - ) { - groups.push(newGroup); - } - - const selectedGroups = this.state.selectedGroups.concat(newGroup); - - // update the groups in local state and call onGroupsChange to - // update the selected groups in the component above which manages this - // component's state - this.setState({ groups }, () => this.onGroupsChange(selectedGroups)); - }; - - render() { - const { - description, - selectedGroups, - mml, - groups, - mmlValidationError, - groupsValidationError, - modelSnapshotRetentionDays, - dailyModelSnapshotRetentionAfterDays, - mmlHelpText, - } = this.state; - - const { datafeedRunning, jobClosed } = this.props; - - return ( - <React.Fragment> - <EuiSpacer size="m" /> - <EuiForm> - <EuiFormRow - label={ - <FormattedMessage - id="xpack.ml.jobsList.editJobFlyout.jobDetails.jobDescriptionLabel" - defaultMessage="Job description" - /> - } - > - <EuiFieldText value={description} onChange={this.onDescriptionChange} /> - </EuiFormRow> - <EuiFormRow - label={ - <FormattedMessage - id="xpack.ml.jobsList.editJobFlyout.jobDetails.jobGroupsLabel" - defaultMessage="Job groups" - /> - } - isInvalid={groupsValidationError !== ''} - error={groupsValidationError} - > - <EuiComboBox - placeholder={i18n.translate( - 'xpack.ml.jobsList.editJobFlyout.jobDetails.jobGroupsPlaceholder', - { - defaultMessage: 'Select or create groups', - } - )} - options={groups} - selectedOptions={selectedGroups} - onChange={this.onGroupsChange} - onCreateOption={this.onCreateGroup} - isClearable={true} - isInvalid={groupsValidationError !== ''} - error={groupsValidationError} - /> - </EuiFormRow> - <EuiFormRow - label={ - <FormattedMessage - id="xpack.ml.jobsList.editJobFlyout.jobDetails.modelMemoryLimitLabel" - defaultMessage="Model memory limit" - /> - } - helpText={mmlHelpText} - isInvalid={mmlValidationError !== ''} - error={mmlValidationError} - > - <EuiFieldText - value={mml} - onChange={this.onMmlChange} - isInvalid={mmlValidationError !== ''} - error={mmlValidationError} - disabled={datafeedRunning || !jobClosed} - /> - </EuiFormRow> - <EuiFormRow - label={ - <FormattedMessage - id="xpack.ml.jobsList.editJobFlyout.jobDetails.modelSnapshotRetentionDaysLabel" - defaultMessage="Model snapshot retention days" - /> - } - > - <EuiFieldNumber - min={0} - value={modelSnapshotRetentionDays} - onChange={this.onModelSnapshotRetentionDaysChange} - /> - </EuiFormRow> - <EuiFormRow - label={ - <FormattedMessage - id="xpack.ml.jobsList.editJobFlyout.jobDetails.dailyModelSnapshotRetentionAfterDaysLabel" - defaultMessage="Daily model snapshot retention after days" - /> - } - > - <EuiFieldNumber - min={0} - max={modelSnapshotRetentionDays} - value={dailyModelSnapshotRetentionAfterDays} - onChange={this.onDailyModelSnapshotRetentionAfterDaysChange} - /> - </EuiFormRow> - </EuiForm> - </React.Fragment> - ); - } -} -JobDetailsUI.propTypes = { - datafeedRunning: PropTypes.bool.isRequired, - jobDescription: PropTypes.string.isRequired, - jobGroups: PropTypes.array.isRequired, - jobModelMemoryLimit: PropTypes.string.isRequired, - setJobDetails: PropTypes.func.isRequired, -}; - -export const JobDetails = withKibana(JobDetailsUI); diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/job_group/job_group.tsx b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/job_group/job_group.tsx index 562d0c9bc4406..5989c35230e82 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/job_group/job_group.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/job_group/job_group.tsx @@ -7,11 +7,17 @@ import type { FC } from 'react'; import React from 'react'; -import { EuiBadge } from '@elastic/eui'; + +import { useEuiTheme, EuiBadge } from '@elastic/eui'; + import { tabColor } from '../../../../../../common/util/group_color_utils'; -export const JobGroup: FC<{ name: string }> = ({ name }) => ( - <EuiBadge key={`${name}-id`} data-test-subj="mlJobGroup" color={tabColor(name)}> - {name} - </EuiBadge> -); +export const JobGroup: FC<{ name: string }> = ({ name }) => { + const { euiTheme } = useEuiTheme(); + + return ( + <EuiBadge key={`${name}-id`} data-test-subj="mlJobGroup" color={tabColor(name, euiTheme)}> + {name} + </EuiBadge> + ); +}; diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/jobs_list_view/jobs_list_view.js b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/jobs_list_view/jobs_list_view.js index b80ad9bcc0e5a..9748d88899599 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/jobs_list_view/jobs_list_view.js +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/components/jobs_list_view/jobs_list_view.js @@ -5,6 +5,7 @@ * 2.0. */ +import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; @@ -505,6 +506,7 @@ export class JobsListViewUI extends Component { ) : null} <EditJobFlyout + euiTheme={this.props.euiTheme} setShowFunction={this.setShowEditJobFlyoutFunction} unsetShowFunction={this.unsetShowEditJobFlyoutFunction} refreshJobs={() => this.refreshJobSummaryList()} @@ -557,4 +559,8 @@ export class JobsListViewUI extends Component { } } +JobsListViewUI.propTypes = { + euiTheme: PropTypes.object.isRequired, +}; + export const JobsListView = withKibana(JobsListViewUI); diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/jobs.tsx b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/jobs.tsx index 0516fa1b7986d..6507480557704 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/jobs.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/jobs_list/jobs.tsx @@ -7,6 +7,7 @@ import type { FC } from 'react'; import React from 'react'; +import { useEuiTheme } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { usePageUrlState } from '@kbn/ml-url-state'; import type { ListingPageUrlState } from '@kbn/ml-url-state'; @@ -44,6 +45,7 @@ export const JobsPage: FC<JobsPageProps> = ({ isMlEnabledInSpace, lastRefresh }) const { services: { docLinks }, } = useMlKibana(); + const { euiTheme } = useEuiTheme(); const { showNodeInfo } = useEnabledFeatures(); const helpLink = docLinks.links.ml.anomalyDetection; @@ -56,6 +58,7 @@ export const JobsPage: FC<JobsPageProps> = ({ isMlEnabledInSpace, lastRefresh }) <JobsActionMenu /> </HeaderMenuPortal> <JobsListView + euiTheme={euiTheme} isMlEnabledInSpace={isMlEnabledInSpace} lastRefresh={lastRefresh} jobsViewState={pageState} diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/common/components/job_groups_input.tsx b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/common/components/job_groups_input.tsx index 67ae2c5011bcf..ba1f2b2fc3fea 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/common/components/job_groups_input.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/common/components/job_groups_input.tsx @@ -8,7 +8,7 @@ import type { FC } from 'react'; import React, { memo } from 'react'; import { i18n } from '@kbn/i18n'; -import type { EuiComboBoxOptionOption } from '@elastic/eui'; +import { useEuiTheme, type EuiComboBoxOptionOption } from '@elastic/eui'; import { EuiComboBox } from '@elastic/eui'; import type { Validation } from '../job_validator'; import { tabColor } from '../../../../../../common/util/group_color_utils'; @@ -23,14 +23,16 @@ export interface JobGroupsInputProps { export const JobGroupsInput: FC<JobGroupsInputProps> = memo( ({ existingGroups, selectedGroups, onChange, validation }) => { + const { euiTheme } = useEuiTheme(); + const options = existingGroups.map<EuiComboBoxOptionOption>((g) => ({ label: g, - color: tabColor(g), + color: tabColor(g, euiTheme), })); const selectedOptions = selectedGroups.map<EuiComboBoxOptionOption>((g) => ({ label: g, - color: tabColor(g), + color: tabColor(g, euiTheme), })); function onChangeCallback(optionsIn: EuiComboBoxOptionOption[]) { @@ -46,7 +48,7 @@ export const JobGroupsInput: FC<JobGroupsInputProps> = memo( const newGroup: EuiComboBoxOptionOption = { label: input, - color: tabColor(input), + color: tabColor(input, euiTheme), }; if ( diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/components/charts/common/settings.ts b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/components/charts/common/settings.ts index 6f46aabef8aa2..38b25b33e0025 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/components/charts/common/settings.ts +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/components/charts/common/settings.ts @@ -8,18 +8,18 @@ import type { IUiSettingsClient } from '@kbn/core/public'; import type { TimeBuckets } from '@kbn/ml-time-buckets'; import type { AreaSeriesStyle, LineSeriesStyle, RecursivePartial } from '@elastic/charts'; -import { useCurrentThemeVars } from '../../../../../../contexts/kibana'; +import { useEuiTheme } from '@elastic/eui'; import type { JobCreatorType } from '../../../../common/job_creator'; import { isMultiMetricJobCreator, isPopulationJobCreator } from '../../../../common/job_creator'; import { getTimeBucketsFromCache } from '../../../../../../util/get_time_buckets_from_cache'; export function useChartColors() { - const { euiTheme } = useCurrentThemeVars(); + const { euiTheme } = useEuiTheme(); return { - LINE_COLOR: euiTheme.euiColorPrimary, - MODEL_COLOR: euiTheme.euiColorPrimary, - EVENT_RATE_COLOR: euiTheme.euiColorPrimary, - EVENT_RATE_COLOR_WITH_ANOMALIES: euiTheme.euiColorLightShade, + LINE_COLOR: euiTheme.colors.primary, + MODEL_COLOR: euiTheme.colors.primary, + EVENT_RATE_COLOR: euiTheme.colors.primary, + EVENT_RATE_COLOR_WITH_ANOMALIES: euiTheme.colors.lightShade, }; } diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/components/charts/event_rate_chart/overlay_range.tsx b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/components/charts/event_rate_chart/overlay_range.tsx index f9351ac783525..40d495b762901 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/components/charts/event_rate_chart/overlay_range.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/components/charts/event_rate_chart/overlay_range.tsx @@ -7,10 +7,9 @@ import type { FC } from 'react'; import React from 'react'; -import { EuiIcon } from '@elastic/eui'; +import { useEuiTheme, EuiIcon } from '@elastic/eui'; import { timeFormatter } from '@kbn/ml-date-utils'; import { AnnotationDomainType, LineAnnotation, Position, RectAnnotation } from '@elastic/charts'; -import { useCurrentThemeVars } from '../../../../../../contexts/kibana'; interface Props { overlayKey: number; @@ -21,7 +20,7 @@ interface Props { } export const OverlayRange: FC<Props> = ({ overlayKey, start, end, color, showMarker = true }) => { - const { euiTheme } = useCurrentThemeVars(); + const { euiTheme } = useEuiTheme(); return ( <> @@ -57,7 +56,7 @@ export const OverlayRange: FC<Props> = ({ overlayKey, start, end, color, showMar marker={showMarker ? <EuiIcon type="arrowUp" /> : undefined} markerBody={ showMarker ? ( - <div style={{ fontWeight: 'normal', color: euiTheme.euiTextColor }}> + <div style={{ fontWeight: 'normal', color: euiTheme.colors.textParagraph }}> {timeFormatter(start)} </div> ) : undefined diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/components/common/json_editor_flyout/json_editor_flyout.tsx b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/components/common/json_editor_flyout/json_editor_flyout.tsx index 6c128bcef12a0..467a8e1e66b85 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/components/common/json_editor_flyout/json_editor_flyout.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/components/common/json_editor_flyout/json_editor_flyout.tsx @@ -230,7 +230,7 @@ export const JsonEditorFlyout: FC<Props> = ({ isDisabled, jobEditorMode, datafee > <FormattedMessage id="xpack.ml.newJob.wizard.jsonFlyout.indicesChange.calloutText" - defaultMessage="You cannot alter the indices being used by the datafeed here. To select a different data view or saved search, go to step 1 of the wizard and select the Change data view option." + defaultMessage="You cannot alter the indices being used by the datafeed here. To select a different data view or saved Discover session, go to step 1 of the wizard and select the Change data view option." /> </EuiCallOut> </> diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx index eaad9b8ceeac8..95755b86de936 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/components/datafeed_step/components/data_view/change_data_view.tsx @@ -153,7 +153,7 @@ export const ChangeDataViewModal: FC<Props> = ({ onClose }) => { noItemsMessage={i18n.translate( 'xpack.ml.newJob.wizard.datafeedStep.dataView.step1.noMatchingError', { - defaultMessage: 'No matching indices or saved searches found.', + defaultMessage: 'No matching data views found.', } )} savedObjectMetaData={[ diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/components/job_details_step/components/groups/groups_input.tsx b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/components/job_details_step/components/groups/groups_input.tsx index 601ce327a0316..f3946b825cec9 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/components/job_details_step/components/groups/groups_input.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/components/job_details_step/components/groups/groups_input.tsx @@ -7,7 +7,7 @@ import type { FC } from 'react'; import React, { useState, useContext, useEffect, useMemo } from 'react'; -import type { EuiComboBoxOptionOption } from '@elastic/eui'; +import { useEuiTheme, type EuiComboBoxOptionOption } from '@elastic/eui'; import { EuiComboBox } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { JobCreatorContext } from '../../../job_creator_context'; @@ -15,6 +15,8 @@ import { tabColor } from '../../../../../../../../../common/util/group_color_uti import { Description } from './description'; export const GroupsInput: FC = () => { + const { euiTheme } = useEuiTheme(); + const { jobCreator, jobCreatorUpdate, jobValidator, jobValidatorUpdated } = useContext(JobCreatorContext); const { existingJobsAndGroups } = useContext(JobCreatorContext); @@ -42,12 +44,12 @@ export const GroupsInput: FC = () => { const options: EuiComboBoxOptionOption[] = existingJobsAndGroups.groupIds.map((g: string) => ({ label: g, - color: tabColor(g), + color: tabColor(g, euiTheme), })); const selectedOptions: EuiComboBoxOptionOption[] = selectedGroups.map((g: string) => ({ label: g, - color: tabColor(g), + color: tabColor(g, euiTheme), })); function onChange(optionsIn: EuiComboBoxOptionOption[]) { @@ -63,7 +65,7 @@ export const GroupsInput: FC = () => { const newGroup: EuiComboBoxOptionOption = { label: input, - color: tabColor(input), + color: tabColor(input, euiTheme), }; if ( diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/index_or_search/page.tsx b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/index_or_search/page.tsx index e0c3e39182afa..5423c443dabcd 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/index_or_search/page.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/index_or_search/page.tsx @@ -51,7 +51,7 @@ export const Page: FC<PageProps> = ({ <MlPageHeader> <FormattedMessage id="xpack.ml.newJob.wizard.selectDataViewOrSavedSearch" - defaultMessage="Select data view or saved search" + defaultMessage="Select data view or saved Discover session" /> </MlPageHeader> <EuiPanel hasShadow={false} hasBorder> @@ -61,16 +61,16 @@ export const Page: FC<PageProps> = ({ onChoose={onObjectSelection} showFilter noItemsMessage={i18n.translate('xpack.ml.newJob.wizard.searchSelection.notFoundLabel', { - defaultMessage: 'No matching data views or saved searches found.', + defaultMessage: 'No matching data views or saved Discover sessions found.', })} savedObjectMetaData={[ { type: 'search', - getIconForSavedObject: () => 'search', + getIconForSavedObject: () => 'discoverApp', name: i18n.translate( - 'xpack.ml.newJob.wizard.searchSelection.savedObjectType.search', + 'xpack.ml.newJob.wizard.searchSelection.savedObjectType.discoverSession', { - defaultMessage: 'Saved search', + defaultMessage: 'Discover session', } ), showSavedObject: (savedObject: SavedObject) => diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/job_type/page.tsx b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/job_type/page.tsx index 2d49f1f17727e..42b5623605ec0 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/job_type/page.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/job_type/page.tsx @@ -95,7 +95,7 @@ export const Page: FC = () => { const pageTitleLabel = selectedSavedSearch ? i18n.translate('xpack.ml.newJob.wizard.jobType.savedSearchPageTitleLabel', { - defaultMessage: 'saved search {savedSearchTitle}', + defaultMessage: 'Discover session {savedSearchTitle}', values: { savedSearchTitle: selectedSavedSearch.title ?? '' }, }) : i18n.translate('xpack.ml.newJob.wizard.jobType.dataViewPageTitleLabel', { @@ -285,7 +285,7 @@ export const Page: FC = () => { <EuiLink onClick={onSelectDifferentIndex}> <FormattedMessage id="xpack.ml.newJob.wizard.jobType.selectDifferentIndexLinkText" - defaultMessage="Select a different data view or saved search" + defaultMessage="Select a different data view or saved Discover session" /> </EuiLink> </EuiCallOut> diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/new_job/wizard_steps.tsx b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/new_job/wizard_steps.tsx index b44c523bc57cf..5a00613afa829 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/new_job/wizard_steps.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/pages/new_job/wizard_steps.tsx @@ -74,7 +74,7 @@ export const WizardSteps: FC<Props> = ({ currentStep, setCurrentStep }) => { function getSummaryStepTitle() { if (dataSourceContext.selectedSavedSearch) { return i18n.translate('xpack.ml.newJob.wizard.stepComponentWrapper.summaryTitleSavedSearch', { - defaultMessage: 'New job from saved search {title}', + defaultMessage: 'New job from saved Discover session {title}', values: { title: dataSourceContext.selectedSavedSearch.title ?? '' }, }); } else if (dataSourceContext.selectedDataView.id !== undefined) { @@ -123,7 +123,6 @@ export const WizardSteps: FC<Props> = ({ currentStep, setCurrentStep }) => { fieldStatsServices={fieldStatsServices} timeRangeMs={timeRangeMs} dslQuery={jobCreator.query} - theme={services.theme} > <> <EuiFlexGroup gutterSize="s"> diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/recognize/components/job_item.tsx b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/recognize/components/job_item.tsx index a60fa07fdee8e..3e706f0e231d1 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/recognize/components/job_item.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/recognize/components/job_item.tsx @@ -8,6 +8,7 @@ import type { FC } from 'react'; import React, { memo } from 'react'; import { + useEuiTheme, EuiBadge, EuiButtonIcon, EuiFlexGroup, @@ -35,6 +36,8 @@ interface JobItemProps { export const JobItem: FC<JobItemProps> = memo( ({ job, jobOverride, isSaving, jobPrefix, onEditRequest }) => { + const { euiTheme } = useEuiTheme(); + const { id, config: { description, groups }, @@ -90,7 +93,7 @@ export const JobItem: FC<JobItemProps> = memo( <EuiFlexGroup wrap responsive={false} gutterSize="xs"> {(jobGroups ?? []).map((group) => ( <EuiFlexItem grow={false} key={group}> - <EuiBadge color={tabColor(group)}>{group}</EuiBadge> + <EuiBadge color={tabColor(group, euiTheme)}>{group}</EuiBadge> </EuiFlexItem> ))} </EuiFlexGroup> diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/recognize/page.tsx b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/recognize/page.tsx index c65f9b83f8595..c2ea2999eee4d 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/recognize/page.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/recognize/page.tsx @@ -94,7 +94,7 @@ export const Page: FC<PageProps> = ({ moduleId, existingGroupIds }) => { const { selectedSavedSearch, selectedDataView: dataView, combinedQuery } = useDataSource(); const pageTitle = selectedSavedSearch ? i18n.translate('xpack.ml.newJob.recognize.savedSearchPageTitle', { - defaultMessage: 'saved search {savedSearchTitle}', + defaultMessage: 'Discover session {savedSearchTitle}', values: { savedSearchTitle: selectedSavedSearch.title ?? '' }, }) : i18n.translate('xpack.ml.newJob.recognize.dataViewPageTitle', { @@ -310,7 +310,7 @@ export const Page: FC<PageProps> = ({ moduleId, existingGroupIds }) => { <EuiText size="s"> <FormattedMessage id="xpack.ml.newJob.recognize.usingSavedSearchDescription" - defaultMessage="Using a saved search will mean the query used in the datafeeds will be different from the default ones we supply in the {moduleId} module." + defaultMessage="Using a saved Discover session will mean the query used in the datafeeds will be different from the default ones we supply in the {moduleId} module." values={{ moduleId }} /> </EuiText> diff --git a/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/ner/ner_output.test.tsx b/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/ner/ner_output.test.tsx new file mode 100644 index 0000000000000..772fe59965130 --- /dev/null +++ b/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/ner/ner_output.test.tsx @@ -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 { getClassColor, getClassLabel, getClassIcon } from './ner_output'; + +describe('NER output', () => { + describe('getClassIcon', () => { + test('returns the correct icon for class PER', () => { + expect(getClassIcon('PER')).toBe('user'); + }); + + test('returns the correct icon for class LOC', () => { + expect(getClassIcon('LOC')).toBe('visMapCoordinate'); + }); + + test('returns the correct icon for class ORG', () => { + expect(getClassIcon('ORG')).toBe('home'); + }); + + test('returns the correct icon for class MISC', () => { + expect(getClassIcon('MISC')).toBe('questionInCircle'); + }); + + test('returns the default icon for an unknown class', () => { + expect(getClassIcon('UNKNOWN')).toBe('questionInCircle'); + }); + }); + + describe('getClassLabel', () => { + test('returns the correct label for class PER', () => { + expect(getClassLabel('PER')).toBe('Person'); + }); + + test('returns the correct label for class LOC', () => { + expect(getClassLabel('LOC')).toBe('Location'); + }); + + test('returns the correct label for class ORG', () => { + expect(getClassLabel('ORG')).toBe('Organization'); + }); + + test('returns the correct label for class MISC', () => { + expect(getClassLabel('MISC')).toBe('Miscellaneous'); + }); + + test('returns the class name for an unknown class', () => { + expect(getClassLabel('UNKNOWN')).toBe('UNKNOWN'); + }); + }); + + describe('getClassColor', () => { + test('returns the correct color for class PER', () => { + expect(getClassColor('PER', true)).toBe('#f1d86f'); + }); + + test('returns the correct color for class LOC', () => { + expect(getClassColor('LOC', true)).toBe('#79aad9'); + }); + + test('returns the correct color for class ORG', () => { + expect(getClassColor('ORG', true)).toBe('#6dccb1'); + }); + + test('returns the correct color for class MISC', () => { + expect(getClassColor('MISC', true)).toBe('#f5a35c'); + }); + + test('returns the default color for an unknown class', () => { + expect(getClassColor('UNKNOWN', true)).toBe('#f1d86f'); + }); + }); +}); diff --git a/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/ner/ner_output.tsx b/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/ner/ner_output.tsx index 5582a383fe713..aa79f40dac7c8 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/ner/ner_output.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/ner/ner_output.tsx @@ -11,6 +11,10 @@ import React from 'react'; import useObservable from 'react-use/lib/useObservable'; import { FormattedMessage } from '@kbn/i18n-react'; import { + euiPaletteColorBlind, + euiPaletteColorBlindBehindText, + useEuiFontSize, + useEuiTheme, EuiBadge, EuiFlexGroup, EuiFlexItem, @@ -18,48 +22,71 @@ import { EuiIcon, EuiToolTip, } from '@elastic/eui'; -import { useCurrentThemeVars } from '../../../../contexts/kibana'; -import type { EuiThemeType } from '../../../../components/color_range_legend/use_color_range'; import type { NerInference, NerResponse } from './ner_inference'; import { INPUT_TYPE } from '../inference_base'; +const badgeColorPaletteBorder = euiPaletteColorBlind(); +const badgeColorPaletteBehindText = euiPaletteColorBlindBehindText(); + const ICON_PADDING = '2px'; const PROBABILITY_SIG_FIGS = 3; -const ENTITY_TYPES = { +interface EntityType { + label: string; + icon: string; + colorIndex: number; +} + +const ENTITY_TYPE_NAMES = ['PER', 'LOC', 'ORG', 'MISC'] as const; +const isEntityTypeName = (name: string): name is EntityTypeName => + ENTITY_TYPE_NAMES.includes(name as EntityTypeName); +type EntityTypeName = (typeof ENTITY_TYPE_NAMES)[number]; + +const ENTITY_TYPES: Record<EntityTypeName, EntityType> = { PER: { label: 'Person', icon: 'user', - color: 'euiColorVis5_behindText', - borderColor: 'euiColorVis5', + // Amsterdam color + colorIndex: 5, }, LOC: { label: 'Location', icon: 'visMapCoordinate', - color: 'euiColorVis1_behindText', - borderColor: 'euiColorVis1', + // Amsterdam color + colorIndex: 1, }, ORG: { label: 'Organization', icon: 'home', - color: 'euiColorVis0_behindText', - borderColor: 'euiColorVis0', + // Amsterdam color + colorIndex: 0, }, MISC: { label: 'Miscellaneous', icon: 'questionInCircle', - color: 'euiColorVis7_behindText', - borderColor: 'euiColorVis7', + // Amsterdam color + colorIndex: 7, }, }; -const UNKNOWN_ENTITY_TYPE = { +const UNKNOWN_ENTITY_TYPE: EntityType = { label: '', icon: 'questionInCircle', - color: 'euiColorVis5_behindText', - borderColor: 'euiColorVis5', + // Amsterdam color + colorIndex: 5, }; +// Amsterdam +// ['#6dccb1', '#79aad9', '#ee789d', '#a987d1', '#e4a6c7', '#f1d86f', '#d2c0a0', '#f5a35c', '#c47c6c', '#ff7e62'] +// Borealis +// ['#00BEB8', '#98E6E2', '#599DFF', '#B4D5FF', '#ED6BA2', '#FFBED5', '#F66D64', '#FFC0B8', '#E6AB01', '#FCD279'] +const amsterdam2BorealisColorMap = new Map<number, number>([ + [0, 0], + [1, 2], + [5, 9], + [7, 8], +]); + export const getNerOutputComponent = (inferrer: NerInference) => <NerOutput inferrer={inferrer} />; const NerOutput: FC<{ inferrer: NerInference }> = ({ inferrer }) => { @@ -86,7 +113,7 @@ const NerOutput: FC<{ inferrer: NerInference }> = ({ inferrer }) => { }; const Lines: FC<{ result: NerResponse }> = ({ result }) => { - const { euiTheme } = useCurrentThemeVars(); + const euiFontSizeXS = useEuiFontSize('xs', { unit: 'px' }).fontSize as string; const lineSplit: JSX.Element[] = []; result.response.forEach(({ value, entity }) => { if (entity === null) { @@ -110,7 +137,7 @@ const Lines: FC<{ result: NerResponse }> = ({ result }) => { {value} </div> <EuiHorizontalRule margin="none" /> - <div style={{ fontSize: euiTheme.euiFontSizeXS, marginTop: ICON_PADDING }}> + <div style={{ fontSize: euiFontSizeXS, marginTop: ICON_PADDING }}> <div> <FormattedMessage id="xpack.ml.trainedModels.testModelsFlyout.ner.output.typeTitle" @@ -143,16 +170,26 @@ const EntityBadge = ({ }: PropsWithChildren<{ entity: estypes.MlTrainedModelEntities; }>) => { - const { euiTheme } = useCurrentThemeVars(); + const { euiTheme } = useEuiTheme(); + const euiFontSizeXS = useEuiFontSize('xs').fontSize; + return ( <EuiBadge - // @ts-expect-error colors are correct in ENTITY_TYPES - color={getClassColor(euiTheme, entity.class_name)} + color={getClassColor(entity.class_name, euiTheme.flags.hasVisColorAdjustment)} style={{ marginRight: ICON_PADDING, marginTop: `-${ICON_PADDING}`, - border: `1px solid ${getClassColor(euiTheme, entity.class_name, true)}`, - fontSize: euiTheme.euiFontSizeXS, + // For Amsterdam, add a border to the badge to improve contrast with the background. + ...(euiTheme.flags.hasVisColorAdjustment + ? { + border: `1px solid ${getClassColor( + entity.class_name, + euiTheme.flags.hasVisColorAdjustment, + true + )}`, + } + : {}), + fontSize: euiFontSizeXS, padding: '0px 6px', pointerEvents: 'none', }} @@ -171,21 +208,31 @@ const EntityBadge = ({ ); }; -function getClassIcon(className: string) { +export function getClassIcon(className: string) { const entity = ENTITY_TYPES[className as keyof typeof ENTITY_TYPES]; return entity?.icon ?? UNKNOWN_ENTITY_TYPE.icon; } -function getClassLabel(className: string) { +export function getClassLabel(className: string) { const entity = ENTITY_TYPES[className as keyof typeof ENTITY_TYPES]; return entity?.label ?? className; } -function getClassColor(euiTheme: EuiThemeType, className: string, border: boolean = false) { - const entity = ENTITY_TYPES[className as keyof typeof ENTITY_TYPES]; - let color = entity?.color ?? UNKNOWN_ENTITY_TYPE.color; - if (border) { - color = entity?.borderColor ?? UNKNOWN_ENTITY_TYPE.borderColor; - } - return euiTheme[color as keyof typeof euiTheme]; +export function getClassColor( + className: string, + hasVisColorAdjustment: boolean, + border: boolean = false +) { + const colorIndex = isEntityTypeName(className) + ? ENTITY_TYPES[className].colorIndex + : UNKNOWN_ENTITY_TYPE.colorIndex; + + // map colors from Amsterdam to Borealis if necessary + const themeColorIndex = hasVisColorAdjustment + ? colorIndex + : amsterdam2BorealisColorMap.get(colorIndex) ?? colorIndex; + + return border + ? badgeColorPaletteBorder[themeColorIndex] + : badgeColorPaletteBehindText[themeColorIndex]; } diff --git a/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/question_answering/question_answering_output.tsx b/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/question_answering/question_answering_output.tsx index 11f2dfd0de546..58fd02f7b5e00 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/question_answering/question_answering_output.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/question_answering/question_answering_output.tsx @@ -8,8 +8,7 @@ import type { FC, PropsWithChildren } from 'react'; import React from 'react'; import useObservable from 'react-use/lib/useObservable'; -import { EuiBadge, EuiHorizontalRule } from '@elastic/eui'; -import { useCurrentThemeVars } from '../../../../contexts/kibana'; +import { useEuiFontSize, useEuiTheme, EuiBadge, EuiHorizontalRule } from '@elastic/eui'; import type { FormattedQuestionAnsweringResult, QuestionAnsweringInference, @@ -59,15 +58,26 @@ function insertHighlighting(result: FormattedQuestionAnsweringResult, inputText: } const ResultBadge: FC<PropsWithChildren<unknown>> = ({ children }) => { - const { euiTheme } = useCurrentThemeVars(); + const { euiTheme } = useEuiTheme(); + const euiFontSizeXS = useEuiFontSize('xs').fontSize; + + // For Amsterdam, use a `_behindText` variant. Borealis doesn't need it because of updated contrasts. + const badgeColor = euiTheme.flags.hasVisColorAdjustment + ? // @ts-expect-error _behindText is not defined in EuiThemeComputed after Borealis update + euiTheme.colors.vis.euiColorVis5_behindText + : euiTheme.colors.vis.euiColorVis9; + return ( <EuiBadge - color={euiTheme.euiColorVis5_behindText} + color={badgeColor} style={{ marginRight: ICON_PADDING, marginTop: `-${ICON_PADDING}`, - border: `1px solid ${euiTheme.euiColorVis5}`, - fontSize: euiTheme.euiFontSizeXS, + // For Amsterdam, add a border to the badge to improve contrast with the background. + ...(euiTheme.flags.hasVisColorAdjustment + ? { border: `1px solid ${euiTheme.colors.vis.euiColorVis5}` } + : {}), + fontSize: euiFontSizeXS, padding: '0px 6px', pointerEvents: 'none', }} diff --git a/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/text_expansion/text_expansion_output.tsx b/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/text_expansion/text_expansion_output.tsx index 46e5342c33f45..7e830cd2a2435 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/text_expansion/text_expansion_output.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/text_expansion/text_expansion_output.tsx @@ -8,6 +8,7 @@ import React, { type FC } from 'react'; import useObservable from 'react-use/lib/useObservable'; import { + useEuiTheme, EuiAccordion, EuiHorizontalRule, EuiIcon, @@ -21,7 +22,6 @@ import { import { roundToDecimalPlace } from '@kbn/ml-number-utils'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { useCurrentThemeVars } from '../../../../contexts/kibana'; import type { TextExpansionInference, FormattedTextExpansionResponse } from '.'; const MAX_TOKENS = 5; @@ -198,14 +198,12 @@ interface ResultStatFormatting { const useResultStatFormatting = ( response: FormattedTextExpansionResponse ): ResultStatFormatting => { - const { - euiTheme: { euiColorMediumShade, euiTextSubduedColor, euiTextColor }, - } = useCurrentThemeVars(); + const { euiTheme } = useEuiTheme(); if (response.score >= 5) { return { color: 'success', - textColor: euiTextColor, + textColor: euiTheme.colors.textParagraph, icon: 'check', text: i18n.translate( 'xpack.ml.trainedModels.testModelsFlyout.textExpansion.output.goodMatch', @@ -216,16 +214,16 @@ const useResultStatFormatting = ( if (response.score > 0) { return { - color: euiTextSubduedColor, - textColor: euiTextColor, + color: euiTheme.colors.textSubdued, + textColor: euiTheme.colors.textParagraph, text: null, icon: null, }; } return { - color: euiColorMediumShade, - textColor: euiColorMediumShade, + color: euiTheme.colors.mediumShade, + textColor: euiTheme.colors.mediumShade, text: null, icon: null, }; diff --git a/x-pack/platform/plugins/shared/ml/public/application/services/ml_api_service/trained_models.ts b/x-pack/platform/plugins/shared/ml/public/application/services/ml_api_service/trained_models.ts index 9e473658bc769..04d815082c547 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/services/ml_api_service/trained_models.ts +++ b/x-pack/platform/plugins/shared/ml/public/application/services/ml_api_service/trained_models.ts @@ -31,7 +31,6 @@ import type { export interface InferenceQueryParams { from?: number; - include_model_definition?: boolean; size?: number; tags?: string; include?: 'total_feature_importance' | 'feature_importance_baseline' | string; diff --git a/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecasts_list.js b/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecasts_list.js index 52ce2b201dd8d..349b7406d9d77 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecasts_list.js +++ b/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/components/forecasting_modal/forecasts_list.js @@ -12,12 +12,11 @@ import PropTypes from 'prop-types'; import React from 'react'; -import { EuiButtonIcon, EuiIconTip, EuiInMemoryTable, EuiText } from '@elastic/eui'; +import { useEuiTheme, EuiButtonIcon, EuiIconTip, EuiInMemoryTable, EuiText } from '@elastic/eui'; import { formatHumanReadableDateTimeSeconds } from '@kbn/ml-date-utils'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { useCurrentThemeVars } from '../../../contexts/kibana'; function getColumns(viewForecast) { return [ @@ -77,7 +76,7 @@ function getColumns(viewForecast) { } export function ForecastsList({ forecasts, viewForecast, selectedForecastId }) { - const { euiTheme } = useCurrentThemeVars(); + const { euiTheme } = useEuiTheme(); const getRowProps = (item) => { return { @@ -85,7 +84,7 @@ export function ForecastsList({ forecasts, viewForecast, selectedForecastId }) { ...(item.forecast_id === selectedForecastId ? { style: { - backgroundColor: `${euiTheme.euiPanelBackgroundColorModifiers.primary}`, + backgroundColor: `${euiTheme.colors.backgroundBasePrimary}`, }, } : {}), diff --git a/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/styles.ts b/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/styles.ts index 74ddf08503803..7c4315e01688b 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/styles.ts +++ b/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/styles.ts @@ -5,9 +5,11 @@ * 2.0. */ +import { useMemo } from 'react'; import { css } from '@emotion/react'; -import { euiThemeVars } from '@kbn/ui-theme'; -import { transparentize } from '@elastic/eui'; + +import { useEuiFontSize, useEuiTheme, transparentize } from '@elastic/eui'; + import { mlColors } from '../styles'; // Annotations constants @@ -15,318 +17,341 @@ const mlAnnotationBorderWidth = '2px'; const mlAnnotationRectDefaultStrokeOpacity = 0.2; const mlAnnotationRectDefaultFillOpacity = 0.05; -export const getTimeseriesExplorerStyles = () => - css({ - color: euiThemeVars.euiColorDarkShade, - - '.ml-timeseries-chart': { - svg: { - fontSize: euiThemeVars.euiFontSizeXS, - fontFamily: euiThemeVars.euiFontFamily, - }, - - '.axis': { - 'path, line': { - fill: 'none', - stroke: euiThemeVars.euiBorderColor, - shapeRendering: 'crispEdges', - pointerEvents: 'none', - }, +export const useTimeseriesExplorerStyles = () => { + const { euiTheme } = useEuiTheme(); + const { fontSize: euiFontSizeXS } = useEuiFontSize('xs', { unit: 'px' }); + const { fontSize: euiFontSizeS } = useEuiFontSize('s', { unit: 'px' }); + + // Amsterdam: euiTheme.colors.vis.euiColorVis5 + // Borealis: euiTheme.colors.vis.euiColorVis9 + const forecastColor = euiTheme.flags.hasVisColorAdjustment + ? euiTheme.colors.vis.euiColorVis5 + : euiTheme.colors.vis.euiColorVis9; + + return useMemo( + () => + css({ + color: euiTheme.colors.darkShade, + + '.ml-timeseries-chart': { + svg: { + fontSize: euiFontSizeXS, + fontFamily: euiTheme.font.family, + }, - text: { - fill: euiThemeVars.euiTextColor, - }, + '.axis': { + 'path, line': { + fill: 'none', + stroke: euiTheme.colors.borderBasePlain, + shapeRendering: 'crispEdges', + pointerEvents: 'none', + }, - '.tick line': { - stroke: euiThemeVars.euiColorLightShade, - }, - }, + text: { + fill: euiTheme.colors.textParagraph, + }, - '.chart-border': { - stroke: euiThemeVars.euiBorderColor, - fill: 'none', - strokeWidth: 1, - shapeRendering: 'crispEdges', - }, + '.tick line': { + stroke: euiTheme.colors.lightShade, + }, + }, - '.chart-border-highlight': { - stroke: euiThemeVars.euiColorDarkShade, - strokeWidth: 2, + '.chart-border': { + stroke: euiTheme.colors.borderBasePlain, + fill: 'none', + strokeWidth: 1, + shapeRendering: 'crispEdges', + }, - '&:hover': { - opacity: 1, - }, - }, + '.chart-border-highlight': { + stroke: euiTheme.colors.darkShade, + strokeWidth: 2, - '.area': { - strokeWidth: 1, + '&:hover': { + opacity: 1, + }, + }, - '&.bounds': { - fill: transparentize(euiThemeVars.euiColorPrimary, 0.2), - pointerEvents: 'none', - }, + '.area': { + strokeWidth: 1, - '&.forecast': { - fill: transparentize(euiThemeVars.euiColorVis5, 0.3), - pointerEvents: 'none', - }, - }, + '&.bounds': { + fill: transparentize(euiTheme.colors.primary, 0.2), + pointerEvents: 'none', + }, - '.values-line': { - fill: 'none', - stroke: euiThemeVars.euiColorPrimary, - strokeWidth: 2, - pointerEvents: 'none', + '&.forecast': { + fill: transparentize(forecastColor, 0.3), + pointerEvents: 'none', + }, + }, - '&.forecast': { - stroke: euiThemeVars.euiColorVis5, - pointerEvents: 'none', - }, - }, - - '.hidden': { - visibility: 'hidden', - }, - - '.values-dots circle': { - fill: euiThemeVars.euiColorPrimary, - strokeWidth: 0, - }, - - '.metric-value': { - opacity: 1, - fill: 'transparent', - stroke: euiThemeVars.euiColorPrimary, - strokeWidth: 0, - }, - - '.anomaly-marker': { - strokeWidth: 1, - stroke: euiThemeVars.euiColorMediumShade, - - '&.critical': { - fill: mlColors.critical, - }, + '.values-line': { + fill: 'none', + stroke: euiTheme.colors.primary, + strokeWidth: 2, + pointerEvents: 'none', - '&.major': { - fill: mlColors.major, - }, + '&.forecast': { + stroke: forecastColor, + pointerEvents: 'none', + }, + }, - '&.minor': { - fill: mlColors.minor, - }, + '.hidden': { + visibility: 'hidden', + }, - '&.warning': { - fill: mlColors.warning, - }, + '.values-dots circle': { + fill: euiTheme.colors.primary, + strokeWidth: 0, + }, - '&.low': { - fill: mlColors.lowWarning, - }, - }, - - '.metric-value:hover, .anomaly-marker:hover, .anomaly-marker.highlighted': { - strokeWidth: 6, - strokeOpacity: 0.65, - stroke: euiThemeVars.euiColorPrimary, - }, - - 'rect.scheduled-event-marker': { - strokeWidth: 1, - stroke: euiThemeVars.euiColorDarkShade, - fill: euiThemeVars.euiColorLightShade, - }, - - '.forecast': { - '.metric-value, .metric-value:hover': { - stroke: euiThemeVars.euiColorVis5, - }, - }, + '.metric-value': { + opacity: 1, + fill: 'transparent', + stroke: euiTheme.colors.primary, + strokeWidth: 0, + }, - '.focus-chart': { - '.x-axis-background': { - line: { - fill: 'none', - shapeRendering: 'crispEdges', - stroke: euiThemeVars.euiColorLightestShade, + '.anomaly-marker': { + strokeWidth: 1, + stroke: euiTheme.colors.mediumShade, + + '&.critical': { + fill: mlColors.critical, + }, + + '&.major': { + fill: mlColors.major, + }, + + '&.minor': { + fill: mlColors.minor, + }, + + '&.warning': { + fill: mlColors.warning, + }, + + '&.low': { + fill: mlColors.lowWarning, + }, }, - rect: { - fill: euiThemeVars.euiColorLightestShade, + + '.metric-value:hover, .anomaly-marker:hover, .anomaly-marker.highlighted': { + strokeWidth: 6, + strokeOpacity: 0.65, + stroke: euiTheme.colors.primary, }, - }, - '.focus-zoom': { - fill: euiThemeVars.euiColorDarkShade, - a: { - text: { - fill: euiThemeVars.euiColorPrimary, - cursor: 'pointer', + + 'rect.scheduled-event-marker': { + strokeWidth: 1, + stroke: euiTheme.colors.darkShade, + fill: euiTheme.colors.lightShade, + }, + + '.forecast': { + '.metric-value, .metric-value:hover': { + stroke: forecastColor, }, - '&:hover, &:active, &:focus': { - textDecoration: 'underline', - fill: euiThemeVars.euiColorPrimary, + }, + + '.focus-chart': { + '.x-axis-background': { + line: { + fill: 'none', + shapeRendering: 'crispEdges', + stroke: euiTheme.colors.lightestShade, + }, + rect: { + fill: euiTheme.colors.lightestShade, + }, + }, + '.focus-zoom': { + fill: euiTheme.colors.darkShade, + a: { + text: { + fill: euiTheme.colors.primary, + cursor: 'pointer', + }, + '&:hover, &:active, &:focus': { + textDecoration: 'underline', + fill: euiTheme.colors.primary, + }, + }, }, }, - }, - }, - '.context-chart': { - '.x.axis path': { - display: 'none', - }, - '.axis text': { - fontSize: '10px', - fill: euiThemeVars.euiTextColor, - }, - '.values-line': { - strokeWidth: 1, - }, - '.mask': { - polygon: { - fillOpacity: 0.1, + '.context-chart': { + '.x.axis path': { + display: 'none', + }, + '.axis text': { + fontSize: '10px', + fill: euiTheme.colors.textParagraph, + }, + '.values-line': { + strokeWidth: 1, + }, + '.mask': { + polygon: { + fillOpacity: 0.1, + }, + '.area.bounds': { + fill: euiTheme.colors.lightShade, + }, + '.values-line': { + strokeWidth: 1, + stroke: euiTheme.colors.mediumShade, + }, + }, + }, + + '.swimlane .axis text': { + display: 'none', }, - '.area.bounds': { - fill: euiThemeVars.euiColorLightShade, + + '.swimlane rect.swimlane-cell-hidden': { + display: 'none', }, - '.values-line': { + + '.brush .extent': { + fillOpacity: 0, + shapeRendering: 'crispEdges', + stroke: euiTheme.colors.darkShade, + strokeWidth: 2, + cursor: 'move', + '&:hover': { + opacity: 1, + }, + }, + + '.top-border': { + fill: euiTheme.colors.emptyShade, + }, + + 'foreignObject.brush-handle': { + pointerEvents: 'none', + paddingTop: '1px', + }, + + 'div.brush-handle-inner': { + border: `1px solid ${euiTheme.colors.darkShade}`, + backgroundColor: euiTheme.colors.lightShade, + height: '70px', + width: '10px', + textAlign: 'center', + cursor: 'ew-resize', + marginTop: '9px', + fontSize: euiFontSizeS, + fill: euiTheme.colors.darkShade, + }, + + 'div.brush-handle-inner-left': { + borderRadius: `${euiTheme.border.radius.small} 0 0 ${euiTheme.border.radius.small}`, + }, + + 'div.brush-handle-inner-right': { + borderRadius: `0 ${euiTheme.border.radius.small} ${euiTheme.border.radius.small} 0`, + }, + + 'rect.brush-handle': { strokeWidth: 1, - stroke: euiThemeVars.euiColorMediumShade, + stroke: euiTheme.colors.darkShade, + fill: euiTheme.colors.lightShade, + pointerEvents: 'none', + '&:hover': { + opacity: 1, + }, }, }, - }, - - '.swimlane .axis text': { - display: 'none', - }, - - '.swimlane rect.swimlane-cell-hidden': { - display: 'none', - }, - - '.brush .extent': { - fillOpacity: 0, - shapeRendering: 'crispEdges', - stroke: euiThemeVars.euiColorDarkShade, - strokeWidth: 2, - cursor: 'move', - '&:hover': { - opacity: 1, - }, - }, - - '.top-border': { - fill: euiThemeVars.euiColorEmptyShade, - }, - - 'foreignObject.brush-handle': { - pointerEvents: 'none', - paddingTop: '1px', - }, - - 'div.brush-handle-inner': { - border: `1px solid ${euiThemeVars.euiColorDarkShade}`, - backgroundColor: euiThemeVars.euiColorLightShade, - height: '70px', - width: '10px', - textAlign: 'center', - cursor: 'ew-resize', - marginTop: '9px', - fontSize: euiThemeVars.euiFontSizeS, - fill: euiThemeVars.euiColorDarkShade, - }, - - 'div.brush-handle-inner-left': { - borderRadius: `${euiThemeVars.euiBorderRadius} 0 0 ${euiThemeVars.euiBorderRadius}`, - }, - - 'div.brush-handle-inner-right': { - borderRadius: `0 ${euiThemeVars.euiBorderRadius} ${euiThemeVars.euiBorderRadius} 0`, - }, - - 'rect.brush-handle': { - strokeWidth: 1, - stroke: euiThemeVars.euiColorDarkShade, - fill: euiThemeVars.euiColorLightShade, - pointerEvents: 'none', - '&:hover': { - opacity: 1, - }, - }, - }, - }); - -export const getAnnotationStyles = () => - css({ - '.ml-annotation': { - '&__brush': { - '.extent': { - stroke: euiThemeVars.euiColorLightShade, - strokeWidth: mlAnnotationBorderWidth, - strokeDasharray: '2 2', - fill: euiThemeVars.euiColorLightestShade, - shapeRendering: 'geometricPrecision', - }, - }, - - '&__rect': { - stroke: euiThemeVars.euiColorFullShade, - strokeWidth: mlAnnotationBorderWidth, - strokeOpacity: mlAnnotationRectDefaultStrokeOpacity, - fill: euiThemeVars.euiColorFullShade, - fillOpacity: mlAnnotationRectDefaultFillOpacity, - shapeRendering: 'geometricPrecision', - transition: `stroke-opacity ${euiThemeVars.euiAnimSpeedFast}, fill-opacity ${euiThemeVars.euiAnimSpeedFast}`, - - '&--highlight': { - strokeOpacity: mlAnnotationRectDefaultStrokeOpacity * 2, - fillOpacity: mlAnnotationRectDefaultFillOpacity * 2, - }, + }), + [euiTheme, euiFontSizeS, euiFontSizeXS, forecastColor] + ); +}; + +export const useAnnotationStyles = () => { + const { euiTheme } = useEuiTheme(); + const euiFontSizeXS = useEuiFontSize('xs', { unit: 'px' }).fontSize as string; + + return useMemo( + () => + css({ + '.ml-annotation': { + '&__brush': { + '.extent': { + stroke: euiTheme.colors.lightShade, + strokeWidth: mlAnnotationBorderWidth, + strokeDasharray: '2 2', + fill: euiTheme.colors.lightestShade, + shapeRendering: 'geometricPrecision', + }, + }, - '&--blur': { - strokeOpacity: mlAnnotationRectDefaultStrokeOpacity / 2, - fillOpacity: mlAnnotationRectDefaultFillOpacity / 2, - }, - }, - - '&__text': { - textAnchor: 'middle', - fontSize: euiThemeVars.euiFontSizeXS, - fontFamily: euiThemeVars.euiFontFamily, - fontWeight: euiThemeVars.euiFontWeightMedium, - fill: euiThemeVars.euiColorFullShade, - transition: `fill ${euiThemeVars.euiAnimSpeedFast}`, - userSelect: 'none', - - '&--blur': { - fill: euiThemeVars.euiColorMediumShade, - }, - }, + '&__rect': { + stroke: euiTheme.colors.fullShade, + strokeWidth: mlAnnotationBorderWidth, + strokeOpacity: mlAnnotationRectDefaultStrokeOpacity, + fill: euiTheme.colors.fullShade, + fillOpacity: mlAnnotationRectDefaultFillOpacity, + shapeRendering: 'geometricPrecision', + transition: `stroke-opacity ${euiTheme.animation.fast}, fill-opacity ${euiTheme.animation.fast}`, + + '&--highlight': { + strokeOpacity: mlAnnotationRectDefaultStrokeOpacity * 2, + fillOpacity: mlAnnotationRectDefaultFillOpacity * 2, + }, - '&__text-rect': { - fill: euiThemeVars.euiColorLightShade, - transition: `fill ${euiThemeVars.euiAnimSpeedFast}`, + '&--blur': { + strokeOpacity: mlAnnotationRectDefaultStrokeOpacity / 2, + fillOpacity: mlAnnotationRectDefaultFillOpacity / 2, + }, + }, - '&--blur': { - fill: euiThemeVars.euiColorLightestShade, - }, - }, - - '&--hidden': { - display: 'none', - }, - - '&__context-rect': { - stroke: euiThemeVars.euiColorFullShade, - strokeWidth: mlAnnotationBorderWidth, - strokeOpacity: mlAnnotationRectDefaultStrokeOpacity, - fill: euiThemeVars.euiColorFullShade, - fillOpacity: mlAnnotationRectDefaultFillOpacity, - transition: `stroke-opacity ${euiThemeVars.euiAnimSpeedFast}, fill-opacity ${euiThemeVars.euiAnimSpeedFast}`, - shapeRendering: 'geometricPrecision', - - '&--blur': { - strokeOpacity: mlAnnotationRectDefaultStrokeOpacity / 2, - fillOpacity: mlAnnotationRectDefaultFillOpacity / 2, + '&__text': { + textAnchor: 'middle', + fontSize: euiFontSizeXS, + fontFamily: euiTheme.font.family, + fontWeight: euiTheme.font.weight.medium, + fill: euiTheme.colors.fullShade, + transition: `fill ${euiTheme.animation.fast}`, + userSelect: 'none', + + '&--blur': { + fill: euiTheme.colors.mediumShade, + }, + }, + + '&__text-rect': { + fill: euiTheme.colors.lightShade, + transition: `fill ${euiTheme.animation.fast}`, + + '&--blur': { + fill: euiTheme.colors.lightestShade, + }, + }, + + '&--hidden': { + display: 'none', + }, + + '&__context-rect': { + stroke: euiTheme.colors.fullShade, + strokeWidth: mlAnnotationBorderWidth, + strokeOpacity: mlAnnotationRectDefaultStrokeOpacity, + fill: euiTheme.colors.fullShade, + fillOpacity: mlAnnotationRectDefaultFillOpacity, + transition: `stroke-opacity ${euiTheme.animation.fast}, fill-opacity ${euiTheme.animation.fast}`, + shapeRendering: 'geometricPrecision', + + '&--blur': { + strokeOpacity: mlAnnotationRectDefaultStrokeOpacity / 2, + fillOpacity: mlAnnotationRectDefaultFillOpacity / 2, + }, + }, }, - }, - }, - }); + }), + [euiTheme, euiFontSizeXS] + ); +}; diff --git a/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/timeseriesexplorer_page.tsx b/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/timeseriesexplorer_page.tsx index c998dda0bcd91..a3be4319de78d 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/timeseriesexplorer_page.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/timeseriesexplorer_page.tsx @@ -19,7 +19,7 @@ import { HelpMenu } from '../components/help_menu'; import { useMlKibana } from '../contexts/kibana'; import { MlPageHeader } from '../components/page_header'; import { PageTitle } from '../components/page_title'; -import { getAnnotationStyles, getTimeseriesExplorerStyles } from './styles'; +import { useAnnotationStyles, useTimeseriesExplorerStyles } from './styles'; interface TimeSeriesExplorerPageProps { dateFormatTz?: string; @@ -35,9 +35,6 @@ interface TimeSeriesExplorerPageProps { selectedJobId?: string[]; } -const timeseriesExplorerStyles = getTimeseriesExplorerStyles(); -const annotationStyles = getAnnotationStyles(); - export const TimeSeriesExplorerPage: FC<PropsWithChildren<TimeSeriesExplorerPageProps>> = ({ children, dateFormatTz, @@ -53,6 +50,9 @@ export const TimeSeriesExplorerPage: FC<PropsWithChildren<TimeSeriesExplorerPage const casesPermissions = cases?.helpers.canUseCases(); const helpLink = docLinks.links.ml.anomalyDetection; + const timeseriesExplorerStyles = useTimeseriesExplorerStyles(); + const annotationStyles = useAnnotationStyles(); + return ( <> <div diff --git a/x-pack/platform/plugins/shared/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable_factory.tsx b/x-pack/platform/plugins/shared/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable_factory.tsx index 3f5afc4065e1f..fe844ae26905b 100644 --- a/x-pack/platform/plugins/shared/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable_factory.tsx +++ b/x-pack/platform/plugins/shared/ml/public/embeddables/anomaly_charts/anomaly_charts_embeddable_factory.tsx @@ -32,7 +32,7 @@ import { useReactEmbeddableExecutionContext } from '../common/use_embeddable_exe import { initializeAnomalyChartsControls } from './initialize_anomaly_charts_controls'; import { LazyAnomalyChartsContainer } from './lazy_anomaly_charts_container'; import { getAnomalyChartsServiceDependencies } from './get_anomaly_charts_services_dependencies'; -import { buildDataViewPublishingApi } from '../common/anomaly_detection_embeddable'; +import { buildDataViewPublishingApi } from '../common/build_data_view_publishing_api'; export const getAnomalyChartsReactEmbeddableFactory = ( getStartServices: StartServicesAccessor<MlStartDependencies, MlPluginStart> diff --git a/x-pack/platform/plugins/shared/ml/public/embeddables/anomaly_swimlane/anomaly_swimlane_embeddable_factory.tsx b/x-pack/platform/plugins/shared/ml/public/embeddables/anomaly_swimlane/anomaly_swimlane_embeddable_factory.tsx index 464b5bd196675..6969f43c105f3 100644 --- a/x-pack/platform/plugins/shared/ml/public/embeddables/anomaly_swimlane/anomaly_swimlane_embeddable_factory.tsx +++ b/x-pack/platform/plugins/shared/ml/public/embeddables/anomaly_swimlane/anomaly_swimlane_embeddable_factory.tsx @@ -41,7 +41,7 @@ import { import { HttpService } from '../../application/services/http_service'; import type { MlPluginStart, MlStartDependencies } from '../../plugin'; import { SWIM_LANE_SELECTION_TRIGGER } from '../../ui_actions'; -import { buildDataViewPublishingApi } from '../common/anomaly_detection_embeddable'; +import { buildDataViewPublishingApi } from '../common/build_data_view_publishing_api'; import { useReactEmbeddableExecutionContext } from '../common/use_embeddable_execution_context'; import { initializeSwimLaneControls } from './initialize_swim_lane_controls'; import { initializeSwimLaneDataFetcher } from './initialize_swim_lane_data_fetcher'; diff --git a/x-pack/platform/plugins/shared/ml/public/embeddables/common/anomaly_detection_embeddable.ts b/x-pack/platform/plugins/shared/ml/public/embeddables/common/anomaly_detection_embeddable.ts deleted file mode 100644 index a4e1d423f94d8..0000000000000 --- a/x-pack/platform/plugins/shared/ml/public/embeddables/common/anomaly_detection_embeddable.ts +++ /dev/null @@ -1,123 +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 { type DataView } from '@kbn/data-views-plugin/common'; -import { type DataViewsContract } from '@kbn/data-views-plugin/public'; -import type { IContainer } from '@kbn/embeddable-plugin/public'; -import { - Embeddable, - type EmbeddableInput, - type EmbeddableOutput, -} from '@kbn/embeddable-plugin/public'; -import type { PublishingSubject } from '@kbn/presentation-publishing'; -import type { Subscription } from 'rxjs'; -import { BehaviorSubject, firstValueFrom, forkJoin, from, map, switchMap } from 'rxjs'; -import { type AnomalyDetectorService } from '../../application/services/anomaly_detector_service'; -import type { JobId } from '../../../common/types/anomaly_detection_jobs'; -import type { AnomalySwimLaneEmbeddableApi } from '../anomaly_swimlane/types'; - -export type CommonInput = { jobIds: string[] } & EmbeddableInput; - -export type CommonOutput = { indexPatterns?: DataView[] } & EmbeddableOutput; - -export const buildDataViewPublishingApi = ( - services: { anomalyDetectorService: AnomalyDetectorService; dataViewsService: DataViewsContract }, - api: Pick<AnomalySwimLaneEmbeddableApi, 'jobIds'>, - subscription: Subscription -): PublishingSubject<DataView[] | undefined> => { - const dataViews$ = new BehaviorSubject<DataView[] | undefined>(undefined); - - subscription.add( - api.jobIds - .pipe( - // Get job definitions - switchMap((jobIds) => services.anomalyDetectorService.getJobs$(jobIds)), - // Get unique indices from the datafeed configs - map((jobs) => [...new Set(jobs.map((j) => j.datafeed_config!.indices).flat())]), - switchMap((indices) => - forkJoin( - indices.map((indexName) => - from( - services.dataViewsService.find(`"${indexName}"`).then((r) => { - const dView = r.find((obj) => - obj.getIndexPattern().toLowerCase().includes(indexName.toLowerCase()) - ); - - return dView; - }) - ) - ) - ) - ), - map((results) => { - return results.flat().filter((dView) => dView !== undefined) as DataView[]; - }) - ) - .subscribe(dataViews$) - ); - - return dataViews$; -}; - -export abstract class AnomalyDetectionEmbeddable< - Input extends CommonInput, - Output extends CommonOutput -> extends Embeddable<Input, Output> { - // Need to defer embeddable load in order to resolve data views - deferEmbeddableLoad = true; - - // API - public abstract jobIds: BehaviorSubject<JobId[] | undefined>; - - protected constructor( - initialInput: Input, - private anomalyDetectorService: AnomalyDetectorService, - private dataViewsService: DataViewsContract, - parent?: IContainer - ) { - super(initialInput, {} as Output, parent); - - this.initializeOutput(initialInput).finally(() => { - this.setInitializationFinished(); - }); - } - - protected async initializeOutput(initialInput: CommonInput) { - const { jobIds } = initialInput; - - try { - const jobs = await firstValueFrom(this.anomalyDetectorService.getJobs$(jobIds)); - - // First get list of unique indices from the selected jobs - const indices = new Set(jobs.map((j) => j.datafeed_config!.indices).flat()); - // Then find the data view assuming the data view title matches the index name - const indexPatterns: Record<string, DataView> = {}; - for (const indexName of indices) { - const response = await this.dataViewsService.find(`"${indexName}"`); - const indexPattern = response.find((obj) => - obj.getIndexPattern().toLowerCase().includes(indexName.toLowerCase()) - ); - - if (indexPattern !== undefined) { - indexPatterns[indexPattern.id!] = indexPattern; - } - } - - this.updateOutput({ - ...this.getOutput(), - indexPatterns: Object.values(indexPatterns), - }); - } catch (e) { - // Unable to find and load data view but we can ignore the error - // as we only load it to support the filter & query bar - // the visualizations should still work correctly - - // eslint-disable-next-line no-console - console.error(`Unable to load data views for ${jobIds}`, e); - } - } -} diff --git a/x-pack/platform/plugins/shared/ml/public/embeddables/common/build_data_view_publishing_api.ts b/x-pack/platform/plugins/shared/ml/public/embeddables/common/build_data_view_publishing_api.ts new file mode 100644 index 0000000000000..62f14602f3af3 --- /dev/null +++ b/x-pack/platform/plugins/shared/ml/public/embeddables/common/build_data_view_publishing_api.ts @@ -0,0 +1,53 @@ +/* + * 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 DataView } from '@kbn/data-views-plugin/common'; +import { type DataViewsContract } from '@kbn/data-views-plugin/public'; +import type { PublishingSubject } from '@kbn/presentation-publishing'; +import type { Subscription } from 'rxjs'; +import { BehaviorSubject, forkJoin, from, map, switchMap } from 'rxjs'; +import { type AnomalyDetectorService } from '../../application/services/anomaly_detector_service'; +import type { AnomalySwimLaneEmbeddableApi } from '../anomaly_swimlane/types'; + +export const buildDataViewPublishingApi = ( + services: { anomalyDetectorService: AnomalyDetectorService; dataViewsService: DataViewsContract }, + api: Pick<AnomalySwimLaneEmbeddableApi, 'jobIds'>, + subscription: Subscription +): PublishingSubject<DataView[] | undefined> => { + const dataViews$ = new BehaviorSubject<DataView[] | undefined>(undefined); + + subscription.add( + api.jobIds + .pipe( + // Get job definitions + switchMap((jobIds) => services.anomalyDetectorService.getJobs$(jobIds)), + // Get unique indices from the datafeed configs + map((jobs) => [...new Set(jobs.map((j) => j.datafeed_config!.indices).flat())]), + switchMap((indices) => + forkJoin( + indices.map((indexName) => + from( + services.dataViewsService.find(`"${indexName}"`).then((r) => { + const dView = r.find((obj) => + obj.getIndexPattern().toLowerCase().includes(indexName.toLowerCase()) + ); + + return dView; + }) + ) + ) + ) + ), + map((results) => { + return results.flat().filter((dView) => dView !== undefined) as DataView[]; + }) + ) + .subscribe(dataViews$) + ); + + return dataViews$; +}; diff --git a/x-pack/platform/plugins/shared/ml/public/maps/util.ts b/x-pack/platform/plugins/shared/ml/public/maps/util.ts index 8563380da5642..1ea899fe5faae 100644 --- a/x-pack/platform/plugins/shared/ml/public/maps/util.ts +++ b/x-pack/platform/plugins/shared/ml/public/maps/util.ts @@ -7,7 +7,7 @@ import type { FeatureCollection, Feature, Geometry } from 'geojson'; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { htmlIdGenerator } from '@elastic/eui'; +import { htmlIdGenerator, type EuiThemeComputed } from '@elastic/eui'; import type { LayerDescriptor } from '@kbn/maps-plugin/common'; import { FIELD_ORIGIN, STYLE_TYPE } from '@kbn/maps-plugin/common'; import type { @@ -116,14 +116,17 @@ export function getInitialAnomaliesLayers(jobId: string) { return initialLayers; } -export function getInitialSourceIndexFieldLayers(sourceIndexWithGeoFields: SourceIndexGeoFields) { +export function getInitialSourceIndexFieldLayers( + sourceIndexWithGeoFields: SourceIndexGeoFields, + euiTheme: EuiThemeComputed +) { const initialLayers = [] as unknown as LayerDescriptor[] & SerializableRecord; for (const index in sourceIndexWithGeoFields) { if (Object.hasOwn(sourceIndexWithGeoFields, index)) { const { dataViewId, geoFields } = sourceIndexWithGeoFields[index]; geoFields.forEach((geoField) => { - const color = tabColor(geoField); + const color = tabColor(geoField, euiTheme); initialLayers.push({ id: htmlIdGenerator()(), diff --git a/x-pack/platform/plugins/shared/ml/public/shared_components/single_metric_viewer/single_metric_viewer.tsx b/x-pack/platform/plugins/shared/ml/public/shared_components/single_metric_viewer/single_metric_viewer.tsx index 39f22e2e988db..1ab62d914078f 100644 --- a/x-pack/platform/plugins/shared/ml/public/shared_components/single_metric_viewer/single_metric_viewer.tsx +++ b/x-pack/platform/plugins/shared/ml/public/shared_components/single_metric_viewer/single_metric_viewer.tsx @@ -32,8 +32,8 @@ import type { SingleMetricViewerEmbeddableApi, } from '../../embeddables/types'; import { - getTimeseriesExplorerStyles, - getAnnotationStyles, + useTimeseriesExplorerStyles, + useAnnotationStyles, } from '../../application/timeseriesexplorer/styles'; const containerPadding = 20; @@ -88,9 +88,6 @@ export interface SingleMetricViewerProps { type Zoom = AppStateZoom | undefined; type ForecastId = string | undefined; -const timeseriesExplorerStyles = getTimeseriesExplorerStyles(); -const annotationStyles = getAnnotationStyles(); - const SingleMetricViewerWrapper: FC<SingleMetricViewerPropsWithDeps> = ({ // Component dependencies api, @@ -111,6 +108,8 @@ const SingleMetricViewerWrapper: FC<SingleMetricViewerPropsWithDeps> = ({ shouldShowForecastButton, uuid, }) => { + const timeseriesExplorerStyles = useTimeseriesExplorerStyles(); + const annotationStyles = useAnnotationStyles(); const [chartDimensions, setChartDimensions] = useState<{ width: number; height: number }>({ width: 0, height: 0, diff --git a/x-pack/platform/plugins/shared/ml/server/plugin.ts b/x-pack/platform/plugins/shared/ml/server/plugin.ts index e40bed733f0da..beeab9767d951 100644 --- a/x-pack/platform/plugins/shared/ml/server/plugin.ts +++ b/x-pack/platform/plugins/shared/ml/server/plugin.ts @@ -138,7 +138,7 @@ export class MlServerPlugin catalogue: [PLUGIN_ID, `${PLUGIN_ID}_file_data_visualizer`], privilegesTooltip: i18n.translate('xpack.ml.featureRegistry.privilegesTooltip', { defaultMessage: - 'Granting All or Read feature privilege for Machine Learning will also grant the equivalent feature privileges to certain types of Kibana saved objects, namely index patterns, dashboards, saved searches and visualizations as well as machine learning job, trained model and module saved objects.', + 'Granting All or Read feature privilege for Machine Learning will also grant the equivalent feature privileges to certain types of Kibana saved objects, namely index patterns, dashboards, saved Discover sessions and visualizations as well as machine learning job, trained model and module saved objects.', }), management: { insightsAndAlerting: ['jobsListLink', 'triggersActions'], diff --git a/x-pack/platform/plugins/shared/ml/tsconfig.json b/x-pack/platform/plugins/shared/ml/tsconfig.json index b65618569ec71..dce8710d648f3 100644 --- a/x-pack/platform/plugins/shared/ml/tsconfig.json +++ b/x-pack/platform/plugins/shared/ml/tsconfig.json @@ -128,7 +128,6 @@ "@kbn/test-jest-helpers", "@kbn/triggers-actions-ui-plugin", "@kbn/ui-actions-plugin", - "@kbn/ui-theme", "@kbn/unified-field-list", "@kbn/unified-search-plugin", "@kbn/usage-collection-plugin", diff --git a/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/assistant_avatar.stories.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/assistant_avatar.stories.tsx deleted file mode 100644 index 3d1d770488491..0000000000000 --- a/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/assistant_avatar.stories.tsx +++ /dev/null @@ -1,33 +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 from 'react'; -import { ComponentStory } from '@storybook/react'; - -import { AssistantAvatar as Component, AssistantAvatarProps } from './assistant_avatar'; - -export default { - component: Component, - title: 'app/Atoms/AssistantAvatar', - argTypes: { - size: { - options: ['xs', 's', 'm', 'l', 'xl'], - control: { type: 'radio' }, - }, - }, -}; - -const Template: ComponentStory<typeof Component> = (props: AssistantAvatarProps) => ( - <Component {...props} /> -); - -const defaultProps = { - size: 'm' as const, -}; - -export const AssistantAvatar = Template.bind({}); -AssistantAvatar.args = defaultProps; diff --git a/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/insight/insight_base.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/insight/insight_base.tsx index ed7f13b936507..d8fa1e71ce01c 100644 --- a/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/insight/insight_base.tsx +++ b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/insight/insight_base.tsx @@ -21,7 +21,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { useState } from 'react'; -import { AssistantAvatar } from '../assistant_avatar'; +import { AssistantIcon } from '@kbn/ai-assistant-icon'; export interface InsightBaseProps { title: string; @@ -66,7 +66,7 @@ export function InsightBase({ <EuiFlexGroup wrap responsive={false} gutterSize="m" data-test-subj={dataTestSubj}> <EuiFlexItem grow={false}> <EuiSpacer size="xs" /> - <AssistantAvatar size="xs" /> + <AssistantIcon size="m" /> </EuiFlexItem> <EuiFlexItem> <EuiFlexGroup gutterSize="s" alignItems="center"> diff --git a/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/utils/recall/score_suggestions.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/utils/recall/score_suggestions.ts index 7d1a19463cceb..b57e5928ce0ba 100644 --- a/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/utils/recall/score_suggestions.ts +++ b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/utils/recall/score_suggestions.ts @@ -102,7 +102,7 @@ export async function scoreSuggestions({ type: 'string', }, }, - required: ['score'], + required: ['scores'], } as const, }; diff --git a/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/tsconfig.json b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/tsconfig.json index db9c1cddae90a..1f484e645912c 100644 --- a/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/tsconfig.json +++ b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/tsconfig.json @@ -49,7 +49,8 @@ "@kbn/inference-plugin", "@kbn/core-lifecycle-server", "@kbn/server-route-repository-utils", - "@kbn/inference-plugin" + "@kbn/inference-plugin", + "@kbn/ai-assistant-icon" ], "exclude": ["target/**/*"] } diff --git a/x-pack/platform/plugins/shared/osquery/package.json b/x-pack/platform/plugins/shared/osquery/package.json index 20aa1af1c4314..fda5a3830020b 100644 --- a/x-pack/platform/plugins/shared/osquery/package.json +++ b/x-pack/platform/plugins/shared/osquery/package.json @@ -7,13 +7,13 @@ "scripts": { "cypress:burn": "yarn cypress:run --env burn=2 --headed", "cypress:changed-specs-only": "yarn cypress:run --changed-specs-only --env burn=2", - "cypress": "NODE_OPTIONS=--openssl-legacy-provider node ../../../../plugins/security_solution/scripts/start_cypress_parallel --config-file ../../platform/plugins/shared/osquery/cypress/serverless_cypress.config.ts --ftr-config-file ../../../../../x-pack/test/osquery_cypress/cli_config", + "cypress": "NODE_OPTIONS=--openssl-legacy-provider node ../../../../solutions/security/plugins/security_solution/scripts/start_cypress_parallel --config-file ../../platform/plugins/shared/osquery/cypress/serverless_cypress.config.ts --ftr-config-file ../../../../../x-pack/test/osquery_cypress/cli_config", "cypress:open": "yarn cypress open", "cypress:run": "yarn cypress run", - "cypress:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ../../../../plugins/security_solution/scripts/start_cypress_parallel --config-file ../../platform/plugins/shared/osquery/cypress/serverless_cypress.config.ts --ftr-config-file ../../../../../x-pack/test/osquery_cypress/serverless_cli_config", + "cypress:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ../../../../solutions/security/plugins/security_solution/scripts/start_cypress_parallel --config-file ../../platform/plugins/shared/osquery/cypress/serverless_cypress.config.ts --ftr-config-file ../../../../../x-pack/test/osquery_cypress/serverless_cli_config", "cypress:serverless:open": "yarn cypress:serverless open", "cypress:serverless:run": "yarn cypress:serverless run", - "cypress:qa:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ../../../../plugins/security_solution/scripts/start_cypress_parallel_serverless --config-file ../../platform/plugins/shared/osquery/cypress/serverless_cypress.config.ts --onBeforeHook ../../../../test/osquery_cypress/runner_qa.ts", + "cypress:qa:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ../../../../solutions/security/plugins/security_solution/scripts/start_cypress_parallel_serverless --config-file ../../platform/plugins/shared/osquery/cypress/serverless_cypress.config.ts --onBeforeHook ../../../../test/osquery_cypress/runner_qa.ts", "cypress:qa:serverless:run": "yarn cypress:qa:serverless run", "nyc": "../../../../../node_modules/.bin/nyc report --reporter=text-summary", "junit:merge": "../../../../../node_modules/.bin/mochawesome-merge ../../../target/kibana-osquery/cypress/results/mochawesome*.json > ../../../target/kibana-osquery/cypress/results/output.json && ../../../node_modules/.bin/marge ../../../target/kibana-osquery/cypress/results/output.json --reportDir ../../../target/kibana-osquery/cypress/results && yarn junit:transform && mkdir -p ../../../target/junit && cp ../../../target/kibana-osquery/cypress/results/*.xml ../../../target/junit/", diff --git a/x-pack/platform/plugins/shared/screenshotting/README.md b/x-pack/platform/plugins/shared/screenshotting/README.md new file mode 100644 index 0000000000000..b129bbb5ad9a1 --- /dev/null +++ b/x-pack/platform/plugins/shared/screenshotting/README.md @@ -0,0 +1,156 @@ +# Kibana Screenshotting + +This plugin provides functionality to take screenshots of the Kibana pages. +It uses Chromium and Puppeteer underneath to run the browser in headless mode. + +## Capabilities +- Canvas workpads screenshots. +- Dashboards screenshots. +- Expressions screenshots. +- PDF generation. +- Batch screenshotting. + +## Usage + +### Getting started +After listing the `screenshotting` plugin in your dependencies, the plugin will be intitalized on the setup stage. +The intitalization process downloads (if it is not already present) and verifies the Chromium build. + +The start contract exposes a public API to interact with the plugin. +Apart from the actual screenshotting functionality, it also provides a way for self-diagnostics. + +Here is an example of how you can take a screenshot of a Kibana URL. + +```typescript +import { lastValueFrom } from 'rxjs'; +import type { CoreSetup, Plugin } from 'src/core/server'; +import type { ScreenshottingStart } from 'x-pack/platform/plugins/shared/screenshotting/server'; + + +interface StartDeps { + screenshotting: ScreenshottingStart; +} + +class ExamplePlugin implements Plugin<void, void, void, StartDeps> { + setup({ http, getStartServices }: CoreSetup<StartDeps>) { + const router = http.createRouter(); + + router.get( + { + path: '/api/capture', + validate: { + query: schema.object({ + id: schema.string(), + }), + }, + }, + async (context, request, response) => { + const [, { screenshotting }] = await getStartServices(); + const { metrics, results } = await lastValueFrom( + screenshotting.getScreenshots({ + request, + urls: [`http://localhost/app/canvas#/workpad/workpad-${request.query.id}`], + }) + ); + + return response.ok({ + body: JSON.stringify({ + metrics, + image: results[0]?.screenshots[0]?.data.toString('base64'), + errors: results[0]?.renderErrors, + } as ScreenshottingExpressionResponse), + }); + } + ); + } + + start() {} +} + +export function plugin() { + return new ExamplePlugin(); +} +``` + +### API +Please use automatically generated API reference or generated TypeDoc comments to find the complete documentation. + +#### `getScreenshots(options): Observable` +Takes screenshots of multiple pages or an expression and returns an observable with the screenshotting results. + +The `options` parameter is an object with parameters of the screenshotting session. +Option | Required | Default | Description +--- | :---: | --- | --- +`browserTimezone` | no | _none_ | The browser timezone that will be emulated in the browser instance. This option should be used to keep timezone on server and client in sync. +`expression` | no | _none_ | An expression to capture screenshot of. Mutually exclusive with the `urls` parameter. +`format` | no | `'png'` | An output format. It can either be PDF or PNG. In case of capturing multiple URLs, all the screenshots will be combined into one document for PDF format. For PNG format, an array of screenshots will be returned. +`headers` | no | _none_ | Custom headers to be sent with each request. The headers will be used for authorization. +`input` | no | `undefined` | The expression input. +`layout` | no | `{}` | Page layout parameters describing characteristics of the capturing screenshot (e.g., dimensions, zoom, etc.). +`request` | no | _none_ | Kibana Request reference to extract headers from. +`timeouts` | no | _none_ | Timeouts for each phase of the screenshot. +`timeouts.openUrl` | no | (kibana.yml setting) | The timeout in milliseconds to allow the Chromium browser to wait for the "Loading…" screen to dismiss and find the initial data for the page. If the time is exceeded, a screenshot is captured showing the current page, and the result structure contains an error message. +`timeouts.renderComplete` | no | (kibana.yml setting) | The timeout in milliseconds to allow the Chromium browser to wait for all visualizations to fetch and render the data. If the time is exceeded, a screenshot is captured showing the current page, and the result structure contains an error message. +`timeouts.waitForElements` | no | (kibana.yml setting) | The timeout in milliseconds to allow the Chromium browser to wait for all visualization panels to load on the page. If the time is exceeded, a screenshot is captured showing the current page, and the result structure contains an error message. +`urls` | no | `[]` | The list or URL to take screenshots of. Every item can either be a string or a tuple containing a URL and a context. The contextual data can be gathered using the screenshot mode plugin. Mutually exclusive with the `expression` parameter. + +#### `diagnose(flags?: string[]): Observable` +Runs browser diagnostics. +The diagnostic implementation launches Chromium and emits the output in the resulting observable. + +There is a way to override some Chromium command line arguments using the `flags` parameter. + +### Configuration +Option | Default | Description +--- | --- | --- +`xpack.screenshotting.networkPolicy.enabled` | `true` | Capturing a screenshot from a Kibana page involves sending out requests for all the linked web assets. For example, a Markdown visualization can show an image from a remote server. +`xpack.screenshotting.networkPolicy.rules` | Allow http, https, ws, wss, and data. | A policy is specified as an array of objects that describe what to allow or deny based on a host or protocol. If a host or protocol is not specified, the rule matches any host or protocol. +`xpack.screenshotting.browser.autoDownload` | Depends on the `dist` parameter. | Flag to automatically download chromium distribution. +`xpack.screenshotting.browser.chromium.disableSandbox` | Defaults to `false` for all operating systems except Debian and Red Hat Linux, which use `true`. | It is recommended that you research the feasibility of enabling unprivileged user namespaces. An exception is if you are running Kibana in Docker because the container runs in a user namespace with the built-in seccomp/bpf filters. For more information, refer to [Chromium sandbox](https://chromium.googlesource.com/chromium/src/+/HEAD/docs/linux/sandboxing.md). +`xpack.screenshotting.browser.chromium.proxy.enabled` | `false` | Enables the proxy for Chromium to use. +`xpack.screenshotting.browser.chromium.proxy.server` | _none_ | The uri for the proxy server. Providing the username and password for the proxy server via the uri is not supported. +`xpack.screenshotting.browser.chromium.proxy.bypass` | `[]` | An array of hosts that should not go through the proxy server and should use a direct connection instead. Examples of valid entries are "elastic.co", "*.elastic.co", ".elastic.co", ".elastic.co:5601". + +## How It Works +```mermaid +sequenceDiagram + participant User + participant Screenshotting + participant Browser + + User ->> Screenshotting: API call + Screenshotting ->> Browser: Launch browser + activate Browser + Screenshotting ->> Browser: Create page + Screenshotting ->> Browser: Set parameters + Note over Screenshotting,Browser: timezone + + Screenshotting ->> Browser: Open URL + Screenshotting ->> Browser: Set contextual data + Note over Screenshotting,Browser: custom context, screenshot mode flag + Browser ->> Screenshotting: Rendering + + Screenshotting ->> Browser: Wait for visualizations + Note over Screenshotting,Browser: poll for a number of DOM nodes to match <br> the number of dashboard elements + Screenshotting ->> Browser: Wait for render completion + Note over Screenshotting,Browser: poll for selectors indicating rendering completion + Browser ->> Screenshotting: Page is ready + + Screenshotting ->> Browser: Take screenshot + Browser ->> Screenshotting: Return PNG buffer + Screenshotting ->> User: Return screenshot +``` + +## Testing +### Integration +There is an example plugin that demonstrates integration with the screenshotting plugin. That plugin utilizes expression capturing. + +### Chromium Downloads +To download all Chromium browsers for all platforms and architectures: + +```bash +cd x-pack +npx gulp downloadChromium +``` + +This command is used to provision CI workspaces so that Chromium does not need to be downloaded for every CI run. diff --git a/x-pack/plugins/screenshotting/common/errors.ts b/x-pack/platform/plugins/shared/screenshotting/common/errors.ts similarity index 100% rename from x-pack/plugins/screenshotting/common/errors.ts rename to x-pack/platform/plugins/shared/screenshotting/common/errors.ts diff --git a/x-pack/plugins/screenshotting/common/expression.ts b/x-pack/platform/plugins/shared/screenshotting/common/expression.ts similarity index 100% rename from x-pack/plugins/screenshotting/common/expression.ts rename to x-pack/platform/plugins/shared/screenshotting/common/expression.ts diff --git a/x-pack/plugins/screenshotting/common/index.ts b/x-pack/platform/plugins/shared/screenshotting/common/index.ts similarity index 100% rename from x-pack/plugins/screenshotting/common/index.ts rename to x-pack/platform/plugins/shared/screenshotting/common/index.ts diff --git a/x-pack/plugins/screenshotting/common/layout.ts b/x-pack/platform/plugins/shared/screenshotting/common/layout.ts similarity index 100% rename from x-pack/plugins/screenshotting/common/layout.ts rename to x-pack/platform/plugins/shared/screenshotting/common/layout.ts diff --git a/x-pack/plugins/screenshotting/common/types.ts b/x-pack/platform/plugins/shared/screenshotting/common/types.ts similarity index 100% rename from x-pack/plugins/screenshotting/common/types.ts rename to x-pack/platform/plugins/shared/screenshotting/common/types.ts diff --git a/x-pack/platform/plugins/shared/screenshotting/jest.config.js b/x-pack/platform/plugins/shared/screenshotting/jest.config.js new file mode 100644 index 0000000000000..0fd6d74a1d655 --- /dev/null +++ b/x-pack/platform/plugins/shared/screenshotting/jest.config.js @@ -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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/platform/plugins/shared/screenshotting'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/platform/plugins/shared/screenshotting', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['<rootDir>/x-pack/platform/plugins/shared/screenshotting/server/**/*.{ts}'], +}; diff --git a/x-pack/platform/plugins/shared/screenshotting/jest.integration.config.js b/x-pack/platform/plugins/shared/screenshotting/jest.integration.config.js new file mode 100644 index 0000000000000..d0694061ed92b --- /dev/null +++ b/x-pack/platform/plugins/shared/screenshotting/jest.integration.config.js @@ -0,0 +1,12 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/platform/plugins/shared/screenshotting'], +}; diff --git a/x-pack/plugins/screenshotting/kibana.jsonc b/x-pack/platform/plugins/shared/screenshotting/kibana.jsonc similarity index 100% rename from x-pack/plugins/screenshotting/kibana.jsonc rename to x-pack/platform/plugins/shared/screenshotting/kibana.jsonc diff --git a/x-pack/plugins/screenshotting/public/app/app.scss b/x-pack/platform/plugins/shared/screenshotting/public/app/app.scss similarity index 100% rename from x-pack/plugins/screenshotting/public/app/app.scss rename to x-pack/platform/plugins/shared/screenshotting/public/app/app.scss diff --git a/x-pack/plugins/screenshotting/public/app/app.tsx b/x-pack/platform/plugins/shared/screenshotting/public/app/app.tsx similarity index 100% rename from x-pack/plugins/screenshotting/public/app/app.tsx rename to x-pack/platform/plugins/shared/screenshotting/public/app/app.tsx diff --git a/x-pack/plugins/screenshotting/public/app/index.ts b/x-pack/platform/plugins/shared/screenshotting/public/app/index.ts similarity index 100% rename from x-pack/plugins/screenshotting/public/app/index.ts rename to x-pack/platform/plugins/shared/screenshotting/public/app/index.ts diff --git a/x-pack/plugins/screenshotting/public/app/screenshot_mode_context.ts b/x-pack/platform/plugins/shared/screenshotting/public/app/screenshot_mode_context.ts similarity index 100% rename from x-pack/plugins/screenshotting/public/app/screenshot_mode_context.ts rename to x-pack/platform/plugins/shared/screenshotting/public/app/screenshot_mode_context.ts diff --git a/x-pack/plugins/screenshotting/public/index.ts b/x-pack/platform/plugins/shared/screenshotting/public/index.ts similarity index 100% rename from x-pack/plugins/screenshotting/public/index.ts rename to x-pack/platform/plugins/shared/screenshotting/public/index.ts diff --git a/x-pack/plugins/screenshotting/public/plugin.tsx b/x-pack/platform/plugins/shared/screenshotting/public/plugin.tsx similarity index 100% rename from x-pack/plugins/screenshotting/public/plugin.tsx rename to x-pack/platform/plugins/shared/screenshotting/public/plugin.tsx diff --git a/x-pack/plugins/screenshotting/server/__mocks__/puppeteer.ts b/x-pack/platform/plugins/shared/screenshotting/server/__mocks__/puppeteer.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/__mocks__/puppeteer.ts rename to x-pack/platform/plugins/shared/screenshotting/server/__mocks__/puppeteer.ts diff --git a/x-pack/plugins/screenshotting/server/assets/fonts/noto/LICENSE_OFL.txt b/x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/noto/LICENSE_OFL.txt similarity index 100% rename from x-pack/plugins/screenshotting/server/assets/fonts/noto/LICENSE_OFL.txt rename to x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/noto/LICENSE_OFL.txt diff --git a/x-pack/plugins/screenshotting/server/assets/fonts/noto/NotoSansCJKtc-Medium.ttf b/x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/noto/NotoSansCJKtc-Medium.ttf similarity index 100% rename from x-pack/plugins/screenshotting/server/assets/fonts/noto/NotoSansCJKtc-Medium.ttf rename to x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/noto/NotoSansCJKtc-Medium.ttf diff --git a/x-pack/plugins/screenshotting/server/assets/fonts/noto/NotoSansCJKtc-Regular.ttf b/x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/noto/NotoSansCJKtc-Regular.ttf similarity index 100% rename from x-pack/plugins/screenshotting/server/assets/fonts/noto/NotoSansCJKtc-Regular.ttf rename to x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/noto/NotoSansCJKtc-Regular.ttf diff --git a/x-pack/plugins/screenshotting/server/assets/fonts/noto/index.js b/x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/noto/index.js similarity index 100% rename from x-pack/plugins/screenshotting/server/assets/fonts/noto/index.js rename to x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/noto/index.js diff --git a/x-pack/plugins/screenshotting/server/assets/fonts/roboto/LICENSE.txt b/x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/roboto/LICENSE.txt similarity index 100% rename from x-pack/plugins/screenshotting/server/assets/fonts/roboto/LICENSE.txt rename to x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/roboto/LICENSE.txt diff --git a/x-pack/plugins/screenshotting/server/assets/fonts/roboto/Roboto-Italic.ttf b/x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/roboto/Roboto-Italic.ttf similarity index 100% rename from x-pack/plugins/screenshotting/server/assets/fonts/roboto/Roboto-Italic.ttf rename to x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/roboto/Roboto-Italic.ttf diff --git a/x-pack/plugins/screenshotting/server/assets/fonts/roboto/Roboto-Medium.ttf b/x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/roboto/Roboto-Medium.ttf similarity index 100% rename from x-pack/plugins/screenshotting/server/assets/fonts/roboto/Roboto-Medium.ttf rename to x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/roboto/Roboto-Medium.ttf diff --git a/x-pack/plugins/screenshotting/server/assets/fonts/roboto/Roboto-Regular.ttf b/x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/roboto/Roboto-Regular.ttf similarity index 100% rename from x-pack/plugins/screenshotting/server/assets/fonts/roboto/Roboto-Regular.ttf rename to x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/roboto/Roboto-Regular.ttf diff --git a/x-pack/plugins/screenshotting/server/assets/img/logo-grey.png b/x-pack/platform/plugins/shared/screenshotting/server/assets/img/logo-grey.png similarity index 100% rename from x-pack/plugins/screenshotting/server/assets/img/logo-grey.png rename to x-pack/platform/plugins/shared/screenshotting/server/assets/img/logo-grey.png diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/driver.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/driver.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/chromium/driver.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/driver.test.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/driver.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/driver.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/chromium/driver.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/driver.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/index.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/driver_factory/index.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/index.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/driver_factory/index.test.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/index.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/driver_factory/index.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/index.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/driver_factory/index.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/metrics.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/driver_factory/metrics.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/metrics.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/driver_factory/metrics.test.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/metrics.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/driver_factory/metrics.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/metrics.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/driver_factory/metrics.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/index.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/index.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/chromium/index.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/index.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/integration_tests/downloads.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/integration_tests/downloads.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/chromium/integration_tests/downloads.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/integration_tests/downloads.test.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/strip_unsafe_headers.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/strip_unsafe_headers.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/chromium/strip_unsafe_headers.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/strip_unsafe_headers.test.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/strip_unsafe_headers.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/strip_unsafe_headers.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/chromium/strip_unsafe_headers.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/strip_unsafe_headers.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/templates/footer.handlebars.html b/x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/templates/footer.handlebars.html similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/chromium/templates/footer.handlebars.html rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/templates/footer.handlebars.html diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/templates/header.handlebars.html b/x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/templates/header.handlebars.html similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/chromium/templates/header.handlebars.html rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/templates/header.handlebars.html diff --git a/x-pack/plugins/screenshotting/server/browsers/chromium/templates/index.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/templates/index.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/chromium/templates/index.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/templates/index.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/download/checksum.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/download/checksum.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/download/checksum.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/download/checksum.test.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/download/checksum.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/download/checksum.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/download/checksum.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/download/checksum.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/download/fetch.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/download/fetch.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/download/fetch.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/download/fetch.test.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/download/fetch.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/download/fetch.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/download/fetch.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/download/fetch.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/download/index.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/download/index.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/download/index.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/download/index.test.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/download/index.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/download/index.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/download/index.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/download/index.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/extract/__fixtures__/file.md b/x-pack/platform/plugins/shared/screenshotting/server/browsers/extract/__fixtures__/file.md similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/extract/__fixtures__/file.md rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/extract/__fixtures__/file.md diff --git a/x-pack/plugins/screenshotting/server/browsers/extract/__fixtures__/file.md.zip b/x-pack/platform/plugins/shared/screenshotting/server/browsers/extract/__fixtures__/file.md.zip similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/extract/__fixtures__/file.md.zip rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/extract/__fixtures__/file.md.zip diff --git a/x-pack/plugins/screenshotting/server/browsers/extract/extract.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/extract/extract.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/extract/extract.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/extract/extract.test.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/extract/extract.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/extract/extract.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/extract/extract.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/extract/extract.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/extract/extract_error.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/extract/extract_error.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/extract/extract_error.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/extract/extract_error.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/extract/index.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/extract/index.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/extract/index.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/extract/index.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/extract/unzip.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/extract/unzip.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/extract/unzip.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/extract/unzip.test.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/extract/unzip.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/extract/unzip.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/extract/unzip.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/extract/unzip.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/index.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/index.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/index.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/index.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/install.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/install.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/install.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/install.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/mock.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/mock.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/mock.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/mock.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/network_policy.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/network_policy.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/network_policy.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/network_policy.test.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/network_policy.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/network_policy.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/network_policy.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/network_policy.ts diff --git a/x-pack/plugins/screenshotting/server/browsers/safe_child_process.ts b/x-pack/platform/plugins/shared/screenshotting/server/browsers/safe_child_process.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/browsers/safe_child_process.ts rename to x-pack/platform/plugins/shared/screenshotting/server/browsers/safe_child_process.ts diff --git a/x-pack/plugins/screenshotting/server/cloud/index.ts b/x-pack/platform/plugins/shared/screenshotting/server/cloud/index.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/cloud/index.ts rename to x-pack/platform/plugins/shared/screenshotting/server/cloud/index.ts diff --git a/x-pack/plugins/screenshotting/server/config/schema.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/config/schema.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/config/schema.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/config/schema.test.ts diff --git a/x-pack/plugins/screenshotting/server/constants.ts b/x-pack/platform/plugins/shared/screenshotting/server/constants.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/constants.ts rename to x-pack/platform/plugins/shared/screenshotting/server/constants.ts diff --git a/x-pack/plugins/screenshotting/server/formats/index.ts b/x-pack/platform/plugins/shared/screenshotting/server/formats/index.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/formats/index.ts rename to x-pack/platform/plugins/shared/screenshotting/server/formats/index.ts diff --git a/x-pack/plugins/screenshotting/server/formats/pdf/index.ts b/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/index.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/formats/pdf/index.ts rename to x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/index.ts diff --git a/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/README.md b/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/README.md similarity index 100% rename from x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/README.md rename to x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/README.md diff --git a/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/constants.ts b/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/constants.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/constants.ts rename to x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/constants.ts diff --git a/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/get_doc_options.ts b/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/get_doc_options.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/get_doc_options.ts rename to x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/get_doc_options.ts diff --git a/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/get_font.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/get_font.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/get_font.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/get_font.test.ts diff --git a/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/get_font.ts b/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/get_font.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/get_font.ts rename to x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/get_font.ts diff --git a/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/get_template.ts b/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/get_template.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/get_template.ts rename to x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/get_template.ts diff --git a/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/index.ts b/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/index.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/index.ts rename to x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/index.ts diff --git a/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/integration_tests/buggy_worker.js b/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/integration_tests/buggy_worker.js similarity index 100% rename from x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/integration_tests/buggy_worker.js rename to x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/integration_tests/buggy_worker.js diff --git a/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/integration_tests/memory_leak_worker.js b/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/integration_tests/memory_leak_worker.js similarity index 100% rename from x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/integration_tests/memory_leak_worker.js rename to x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/integration_tests/memory_leak_worker.js diff --git a/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/integration_tests/pdfmaker.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/integration_tests/pdfmaker.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/integration_tests/pdfmaker.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/integration_tests/pdfmaker.test.ts diff --git a/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/pdfmaker.ts b/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/pdfmaker.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/pdfmaker.ts rename to x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/pdfmaker.ts diff --git a/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/types.ts b/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/types.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/types.ts rename to x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/types.ts diff --git a/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/worker.ts b/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/worker.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/worker.ts rename to x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/worker.ts diff --git a/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/worker_dependencies.ts b/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/worker_dependencies.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/worker_dependencies.ts rename to x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/worker_dependencies.ts diff --git a/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/worker_src_harness.js b/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/worker_src_harness.js similarity index 90% rename from x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/worker_src_harness.js rename to x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/worker_src_harness.js index ca319ace9d027..05a6c8eaa9759 100644 --- a/x-pack/plugins/screenshotting/server/formats/pdf/pdf_maker/worker_src_harness.js +++ b/x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/worker_src_harness.js @@ -11,6 +11,6 @@ */ // eslint-disable-next-line @kbn/imports/no_boundary_crossing -require('../../../../../../../src/setup_node_env'); +require('../../../../../../../../../src/setup_node_env'); // eslint-disable-next-line @kbn/imports/uniform_imports require('./worker.ts'); diff --git a/x-pack/plugins/screenshotting/server/formats/png.ts b/x-pack/platform/plugins/shared/screenshotting/server/formats/png.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/formats/png.ts rename to x-pack/platform/plugins/shared/screenshotting/server/formats/png.ts diff --git a/x-pack/plugins/screenshotting/server/index.ts b/x-pack/platform/plugins/shared/screenshotting/server/index.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/index.ts rename to x-pack/platform/plugins/shared/screenshotting/server/index.ts diff --git a/x-pack/plugins/screenshotting/server/layouts/base_layout.ts b/x-pack/platform/plugins/shared/screenshotting/server/layouts/base_layout.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/layouts/base_layout.ts rename to x-pack/platform/plugins/shared/screenshotting/server/layouts/base_layout.ts diff --git a/x-pack/plugins/screenshotting/server/layouts/canvas_layout.ts b/x-pack/platform/plugins/shared/screenshotting/server/layouts/canvas_layout.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/layouts/canvas_layout.ts rename to x-pack/platform/plugins/shared/screenshotting/server/layouts/canvas_layout.ts diff --git a/x-pack/plugins/screenshotting/server/layouts/create_layout.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/layouts/create_layout.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/layouts/create_layout.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/layouts/create_layout.test.ts diff --git a/x-pack/plugins/screenshotting/server/layouts/create_layout.ts b/x-pack/platform/plugins/shared/screenshotting/server/layouts/create_layout.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/layouts/create_layout.ts rename to x-pack/platform/plugins/shared/screenshotting/server/layouts/create_layout.ts diff --git a/x-pack/plugins/screenshotting/server/layouts/index.ts b/x-pack/platform/plugins/shared/screenshotting/server/layouts/index.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/layouts/index.ts rename to x-pack/platform/plugins/shared/screenshotting/server/layouts/index.ts diff --git a/x-pack/plugins/screenshotting/server/layouts/mock.ts b/x-pack/platform/plugins/shared/screenshotting/server/layouts/mock.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/layouts/mock.ts rename to x-pack/platform/plugins/shared/screenshotting/server/layouts/mock.ts diff --git a/x-pack/plugins/screenshotting/server/layouts/preserve_layout.css b/x-pack/platform/plugins/shared/screenshotting/server/layouts/preserve_layout.css similarity index 100% rename from x-pack/plugins/screenshotting/server/layouts/preserve_layout.css rename to x-pack/platform/plugins/shared/screenshotting/server/layouts/preserve_layout.css diff --git a/x-pack/plugins/screenshotting/server/layouts/preserve_layout.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/layouts/preserve_layout.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/layouts/preserve_layout.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/layouts/preserve_layout.test.ts diff --git a/x-pack/plugins/screenshotting/server/layouts/preserve_layout.ts b/x-pack/platform/plugins/shared/screenshotting/server/layouts/preserve_layout.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/layouts/preserve_layout.ts rename to x-pack/platform/plugins/shared/screenshotting/server/layouts/preserve_layout.ts diff --git a/x-pack/plugins/screenshotting/server/layouts/print_layout.ts b/x-pack/platform/plugins/shared/screenshotting/server/layouts/print_layout.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/layouts/print_layout.ts rename to x-pack/platform/plugins/shared/screenshotting/server/layouts/print_layout.ts diff --git a/x-pack/plugins/screenshotting/server/mock.ts b/x-pack/platform/plugins/shared/screenshotting/server/mock.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/mock.ts rename to x-pack/platform/plugins/shared/screenshotting/server/mock.ts diff --git a/x-pack/plugins/screenshotting/server/plugin.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/plugin.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/plugin.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/plugin.test.ts diff --git a/x-pack/plugins/screenshotting/server/plugin.ts b/x-pack/platform/plugins/shared/screenshotting/server/plugin.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/plugin.ts rename to x-pack/platform/plugins/shared/screenshotting/server/plugin.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/__snapshots__/index.test.ts.snap b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/__snapshots__/index.test.ts.snap similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/__snapshots__/index.test.ts.snap rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/__snapshots__/index.test.ts.snap diff --git a/x-pack/plugins/screenshotting/server/screenshots/constants.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/constants.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/constants.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/constants.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/event_logger/index.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/event_logger/index.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/event_logger/index.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/event_logger/index.test.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/event_logger/index.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/event_logger/index.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/event_logger/index.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/event_logger/index.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/get_element_position_data.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_element_position_data.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/get_element_position_data.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_element_position_data.test.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/get_element_position_data.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_element_position_data.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/get_element_position_data.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_element_position_data.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/get_number_of_items.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_number_of_items.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/get_number_of_items.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_number_of_items.test.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/get_number_of_items.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_number_of_items.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/get_number_of_items.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_number_of_items.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/get_pdf.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_pdf.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/get_pdf.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_pdf.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/get_render_errors.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_render_errors.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/get_render_errors.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_render_errors.test.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/get_render_errors.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_render_errors.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/get_render_errors.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_render_errors.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/get_screenshots.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_screenshots.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/get_screenshots.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_screenshots.test.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/get_screenshots.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_screenshots.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/get_screenshots.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_screenshots.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/get_time_range.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_time_range.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/get_time_range.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_time_range.test.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/get_time_range.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_time_range.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/get_time_range.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/get_time_range.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/index.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/index.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/index.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/index.test.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/index.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/index.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/index.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/index.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/inject_css.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/inject_css.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/inject_css.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/inject_css.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/mock.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/mock.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/mock.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/mock.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/observable.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/observable.test.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/observable.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/observable.test.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/observable.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/observable.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/observable.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/observable.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/open_url.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/open_url.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/open_url.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/open_url.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/screenshots.test.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/screenshots.test.ts similarity index 98% rename from x-pack/plugins/screenshotting/server/screenshots/screenshots.test.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/screenshots.test.ts index 4f217ef96c611..95261626e15fa 100644 --- a/x-pack/plugins/screenshotting/server/screenshots/screenshots.test.ts +++ b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/screenshots.test.ts @@ -30,7 +30,8 @@ describe('class Screenshots', () => { let mockLogger: Logger; let mockScreenshotModeSetup: ScreenshotModePluginSetup; - const mockBinaryPath = '/kibana/x-pack/plugins/screenshotting/chromium/linux/headless_shell'; + const mockBinaryPath = + '/kibana/x-pack/platform/plugins/shared/screenshotting/chromium/linux/headless_shell'; const mockBasePath = '/kibanaTest1'; beforeEach(() => { diff --git a/x-pack/plugins/screenshotting/server/screenshots/screenshots.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/screenshots.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/screenshots.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/screenshots.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/types.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/types.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/types.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/types.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/wait_for_render.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/wait_for_render.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/wait_for_render.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/wait_for_render.ts diff --git a/x-pack/plugins/screenshotting/server/screenshots/wait_for_visualizations.ts b/x-pack/platform/plugins/shared/screenshotting/server/screenshots/wait_for_visualizations.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/screenshots/wait_for_visualizations.ts rename to x-pack/platform/plugins/shared/screenshotting/server/screenshots/wait_for_visualizations.ts diff --git a/x-pack/plugins/screenshotting/server/utils.ts b/x-pack/platform/plugins/shared/screenshotting/server/utils.ts similarity index 100% rename from x-pack/plugins/screenshotting/server/utils.ts rename to x-pack/platform/plugins/shared/screenshotting/server/utils.ts diff --git a/x-pack/platform/plugins/shared/screenshotting/tsconfig.json b/x-pack/platform/plugins/shared/screenshotting/tsconfig.json new file mode 100644 index 0000000000000..200c6d9c2592e --- /dev/null +++ b/x-pack/platform/plugins/shared/screenshotting/tsconfig.json @@ -0,0 +1,33 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*", + "../../../../../typings/**/*" + ], + "kbn_references": [ + "@kbn/core", + { "path": "../../../../../src/setup_node_env/tsconfig.json" }, + "@kbn/expressions-plugin", + "@kbn/screenshot-mode-plugin", + "@kbn/cloud-plugin", + "@kbn/utility-types", + "@kbn/logging", + "@kbn/std", + "@kbn/i18n", + "@kbn/utils", + "@kbn/core-logging-server-mocks", + "@kbn/logging-mocks", + "@kbn/core-http-server", + "@kbn/core-plugins-server", + "@kbn/task-manager-plugin", + "@kbn/screenshotting-server", + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/x-pack/plugins/actions/server/lib/gen_ai_token_tracking.ts b/x-pack/plugins/actions/server/lib/gen_ai_token_tracking.ts index d73610892098d..ff73095ac2427 100644 --- a/x-pack/plugins/actions/server/lib/gen_ai_token_tracking.ts +++ b/x-pack/plugins/actions/server/lib/gen_ai_token_tracking.ts @@ -295,4 +295,7 @@ export const getGenAiTokenTracking = async ({ }; export const shouldTrackGenAiToken = (actionTypeId: string) => - actionTypeId === '.gen-ai' || actionTypeId === '.bedrock' || actionTypeId === '.gemini'; + actionTypeId === '.gen-ai' || + actionTypeId === '.bedrock' || + actionTypeId === '.gemini' || + actionTypeId === '.inference'; diff --git a/x-pack/plugins/asset_inventory/README.md b/x-pack/plugins/asset_inventory/README.md deleted file mode 100755 index e1dd9d4ac8900..0000000000000 --- a/x-pack/plugins/asset_inventory/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Asset Inventory Kibana Plugin - -Centralized asset inventory experience within the Elastic Security solution. A central place for users to view and manage all their assets from different environments. - ---- - -## Development - -See the [kibana contributing guide](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md) for instructions setting up your development environment. - -## Testing - -For general guidelines, read [Kibana Testing Guide](https://www.elastic.co/guide/en/kibana/current/development-tests.html) for more details diff --git a/x-pack/plugins/asset_inventory/tsconfig.json b/x-pack/plugins/asset_inventory/tsconfig.json deleted file mode 100644 index dc669eb3a6943..0000000000000 --- a/x-pack/plugins/asset_inventory/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "common/**/*.ts", - "common/**/*.json", - "public/**/*.ts", - "public/**/*.tsx", - "public/**/*.json", - "server/**/*.ts", - "server/**/*.json", - "../../../typings/**/*" - ], - "exclude": ["target/**/*"], - "kbn_references": [ - "@kbn/core", - "@kbn/i18n-react", - "@kbn/shared-ux-router", - "@kbn/securitysolution-es-utils" - ] -} diff --git a/x-pack/plugins/canvas/i18n/functions/dict/saved_search.ts b/x-pack/plugins/canvas/i18n/functions/dict/saved_search.ts index 7cdac8909c6ec..d00ea3cf79b74 100644 --- a/x-pack/plugins/canvas/i18n/functions/dict/saved_search.ts +++ b/x-pack/plugins/canvas/i18n/functions/dict/saved_search.ts @@ -12,9 +12,9 @@ import { FunctionFactory } from '../../../types'; export const help: FunctionHelp<FunctionFactory<typeof savedSearch>> = { help: i18n.translate('xpack.canvas.functions.savedSearchHelpText', { - defaultMessage: `Returns an embeddable for a saved search object`, + defaultMessage: `Returns an embeddable for a saved Discover session object`, }), args: { - id: 'The id of the saved search object', + id: 'The id of the saved Discover session object', }, }; diff --git a/x-pack/plugins/cases/server/services/alerts/index.test.ts b/x-pack/plugins/cases/server/services/alerts/index.test.ts index a18681c6478a3..450efd67c9e12 100644 --- a/x-pack/plugins/cases/server/services/alerts/index.test.ts +++ b/x-pack/plugins/cases/server/services/alerts/index.test.ts @@ -16,11 +16,19 @@ describe('updateAlertsStatus', () => { const alertsClient = alertsClientMock.create(); let alertService: AlertService; - beforeEach(async () => { + beforeEach(() => { + jest.useFakeTimers(); + jest.setSystemTime(new Date('2022-02-21T17:35:00Z')); + alertService = new AlertService(esClient, logger, alertsClient); jest.clearAllMocks(); }); + afterEach(() => { + jest.runOnlyPendingTimers(); + jest.useRealTimers(); + }); + describe('happy path', () => { it('updates the status of the alert correctly', async () => { const args = [{ id: 'alert-id-1', index: '.siem-signals', status: CaseStatuses.closed }]; @@ -41,7 +49,8 @@ describe('updateAlertsStatus', () => { "script": Object { "lang": "painless", "source": "if (ctx._source['kibana.alert.workflow_status'] != null) { - ctx._source['kibana.alert.workflow_status'] = 'closed' + ctx._source['kibana.alert.workflow_status'] = 'closed'; + ctx._source['kibana.alert.workflow_status_updated_at'] = '2022-02-21T17:35:00.000Z'; } if (ctx._source.signal != null && ctx._source.signal.status != null) { ctx._source.signal.status = 'closed' @@ -80,7 +89,8 @@ describe('updateAlertsStatus', () => { "script": Object { "lang": "painless", "source": "if (ctx._source['kibana.alert.workflow_status'] != null) { - ctx._source['kibana.alert.workflow_status'] = 'closed' + ctx._source['kibana.alert.workflow_status'] = 'closed'; + ctx._source['kibana.alert.workflow_status_updated_at'] = '2022-02-21T17:35:00.000Z'; } if (ctx._source.signal != null && ctx._source.signal.status != null) { ctx._source.signal.status = 'closed' @@ -115,7 +125,8 @@ describe('updateAlertsStatus', () => { "script": Object { "lang": "painless", "source": "if (ctx._source['kibana.alert.workflow_status'] != null) { - ctx._source['kibana.alert.workflow_status'] = 'acknowledged' + ctx._source['kibana.alert.workflow_status'] = 'acknowledged'; + ctx._source['kibana.alert.workflow_status_updated_at'] = '2022-02-21T17:35:00.000Z'; } if (ctx._source.signal != null && ctx._source.signal.status != null) { ctx._source.signal.status = 'acknowledged' @@ -154,7 +165,8 @@ describe('updateAlertsStatus', () => { "script": Object { "lang": "painless", "source": "if (ctx._source['kibana.alert.workflow_status'] != null) { - ctx._source['kibana.alert.workflow_status'] = 'closed' + ctx._source['kibana.alert.workflow_status'] = 'closed'; + ctx._source['kibana.alert.workflow_status_updated_at'] = '2022-02-21T17:35:00.000Z'; } if (ctx._source.signal != null && ctx._source.signal.status != null) { ctx._source.signal.status = 'closed' @@ -183,7 +195,8 @@ describe('updateAlertsStatus', () => { "script": Object { "lang": "painless", "source": "if (ctx._source['kibana.alert.workflow_status'] != null) { - ctx._source['kibana.alert.workflow_status'] = 'open' + ctx._source['kibana.alert.workflow_status'] = 'open'; + ctx._source['kibana.alert.workflow_status_updated_at'] = '2022-02-21T17:35:00.000Z'; } if (ctx._source.signal != null && ctx._source.signal.status != null) { ctx._source.signal.status = 'open' @@ -222,7 +235,8 @@ describe('updateAlertsStatus', () => { "script": Object { "lang": "painless", "source": "if (ctx._source['kibana.alert.workflow_status'] != null) { - ctx._source['kibana.alert.workflow_status'] = 'closed' + ctx._source['kibana.alert.workflow_status'] = 'closed'; + ctx._source['kibana.alert.workflow_status_updated_at'] = '2022-02-21T17:35:00.000Z'; } if (ctx._source.signal != null && ctx._source.signal.status != null) { ctx._source.signal.status = 'closed' @@ -251,7 +265,8 @@ describe('updateAlertsStatus', () => { "script": Object { "lang": "painless", "source": "if (ctx._source['kibana.alert.workflow_status'] != null) { - ctx._source['kibana.alert.workflow_status'] = 'open' + ctx._source['kibana.alert.workflow_status'] = 'open'; + ctx._source['kibana.alert.workflow_status_updated_at'] = '2022-02-21T17:35:00.000Z'; } if (ctx._source.signal != null && ctx._source.signal.status != null) { ctx._source.signal.status = 'open' diff --git a/x-pack/plugins/cases/server/services/alerts/index.ts b/x-pack/plugins/cases/server/services/alerts/index.ts index 50a8e286cea4e..94694b7f243b5 100644 --- a/x-pack/plugins/cases/server/services/alerts/index.ts +++ b/x-pack/plugins/cases/server/services/alerts/index.ts @@ -10,7 +10,10 @@ import { isEmpty } from 'lodash'; import type { ElasticsearchClient, Logger } from '@kbn/core/server'; import type { STATUS_VALUES } from '@kbn/rule-registry-plugin/common/technical_rule_data_field_names'; -import { ALERT_WORKFLOW_STATUS } from '@kbn/rule-registry-plugin/common/technical_rule_data_field_names'; +import { + ALERT_WORKFLOW_STATUS, + ALERT_WORKFLOW_STATUS_UPDATED_AT, +} from '@kbn/rule-registry-plugin/common/technical_rule_data_field_names'; import type { MgetResponse } from '@elastic/elasticsearch/lib/api/types'; import type { AlertsClient } from '@kbn/rule-registry-plugin/server'; import type { PublicMethodsOf } from '@kbn/utility-types'; @@ -169,7 +172,8 @@ export class AlertService { body: { script: { source: `if (ctx._source['${ALERT_WORKFLOW_STATUS}'] != null) { - ctx._source['${ALERT_WORKFLOW_STATUS}'] = '${status}' + ctx._source['${ALERT_WORKFLOW_STATUS}'] = '${status}'; + ctx._source['${ALERT_WORKFLOW_STATUS_UPDATED_AT}'] = '${new Date().toISOString()}'; } if (ctx._source.signal != null && ctx._source.signal.status != null) { ctx._source.signal.status = '${status}' diff --git a/x-pack/plugins/cloud_defend/README.md b/x-pack/plugins/cloud_defend/README.md deleted file mode 100755 index 9df1a13d328d2..0000000000000 --- a/x-pack/plugins/cloud_defend/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# Cloud Defend (for containers) - -This plugin currently only exists to provide custom fleet policy UX for a set of new BPF LSM features. The first feature being container "drift prevention". - -Drift prevention is a way to block when executables are created or modified. Our agent service detects these events, and applies a set of selectors and responses configured to either block, alert or both. - -## Example configuration -``` -selectors: - # default selector (user can modify or remove if they want) - - name: default - operation: [createExecutable, modifyExecutable, execMemFd] - - # example custom selector - - name: nginxOnly - containerImageName: - - nginx - - # example selector used for exclude - - name: excludeCustomNginxBuild - containerImageTag: - - staging - -# responses are evaluated from top to bottom -# only the first response with a match will run its actions -responses: - - match: [nginxOnly] - exclude: [excludeCustomNginxBuild] - actions: [alert, block] - - # default response - # delete this if no default response needed - - match: [default] - actions: [alert] -``` - ---- - -## Development - -## pre commit checks - -``` -node scripts/type_check.js --project x-pack/plugins/cloud_defend/tsconfig.json -node scripts/eslint.js x-pack/plugins/cloud_defend -yarn test:jest x-pack/plugins/cloud_defend -``` - -See the [kibana contributing guide](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md) for instructions setting up your development environment. diff --git a/x-pack/plugins/cloud_defend/jest.config.js b/x-pack/plugins/cloud_defend/jest.config.js deleted file mode 100644 index 144b2f1ad9e19..0000000000000 --- a/x-pack/plugins/cloud_defend/jest.config.js +++ /dev/null @@ -1,18 +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. - */ - -/** @type {import('@jest/types').Config.InitialOptions} */ -module.exports = { - preset: '@kbn/test', - rootDir: '../../..', - roots: ['<rootDir>/x-pack/plugins/cloud_defend'], - coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/cloud_defend', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/cloud_defend/{common,public,server}/**/*.{ts,tsx}', - ], -}; diff --git a/x-pack/plugins/cloud_defend/public/common/navigation/types.ts b/x-pack/plugins/cloud_defend/public/common/navigation/types.ts deleted file mode 100644 index 38906f645536f..0000000000000 --- a/x-pack/plugins/cloud_defend/public/common/navigation/types.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. - */ -export interface CloudDefendNavigationItem { - readonly name: string; - readonly path: string; - readonly disabled?: boolean; -} - -export interface CloudDefendPageNavigationItem extends CloudDefendNavigationItem { - id: CloudDefendPageId; -} - -export type CloudDefendPage = 'policies' | 'dashboard'; - -/** - * All the IDs for the cloud defend pages. - * This needs to match the cloud defend page entries in `SecurityPageName` in `x-pack/plugins/security_solution/common/constants.ts`. - */ -export type CloudDefendPageId = 'cloud_defend-policies' | 'kubernetes_security-dashboard'; diff --git a/x-pack/plugins/cloud_defend/server/lib/telemetry/collectors/types.ts b/x-pack/plugins/cloud_defend/server/lib/telemetry/collectors/types.ts deleted file mode 100644 index 32de2548cf7c2..0000000000000 --- a/x-pack/plugins/cloud_defend/server/lib/telemetry/collectors/types.ts +++ /dev/null @@ -1,121 +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. - */ -// for some reason we can't reference common/index.ts because -// the `node scripts/check_telemetry.js --fix` command fails with the error -// ERROR Error: Error extracting collector in x-pack/plugins/cloud_defend/server/lib/telemetry/collectors/register.ts -// Error: Unable to find identifier in source Selector -// at createFailError (dev_cli_errors.ts:27:24) -// at parseUsageCollection (ts_parser.ts:226:32) -// at parseUsageCollection.next (<anonymous>) -// at extractCollectors (extract_collectors.ts:58:32) -// at extractCollectors.next (<anonymous>) -// at Task.task (extract_collectors_task.ts:43:53) -// at runMicrotasks (<anonymous>) -// at processTicksAndRejections (node:internal/process/task_queues:96:5) -// -// I guess the intermediate import/export is causing problems -// for now we will just point to the current version (v1) -import type { - Selector, - Response, - SelectorType, - SelectorCondition, - ResponseAction, -} from '../../../../common/v1'; - -export interface CloudDefendUsage { - indices: CloudDefendIndicesStats; - pods_stats: CloudDefendPodsStats[]; - accounts_stats: CloudDefendAccountsStats[]; - installation_stats: CloudDefendInstallationStats[]; -} - -export interface PackageSetupStatus { - status: string; - installedPackagePolicies: number; - healthyAgents: number; -} - -export interface CloudDefendIndicesStats { - alerts: IndexStats | {}; - file: IndexStats | {}; - process: IndexStats | {}; - latestPackageVersion: string; - packageStatus: PackageSetupStatus; -} - -export interface IndexStats { - doc_count: number; - deleted: number; - size_in_bytes: number; - last_doc_timestamp: string | null; -} - -export interface CloudDefendPodsStats { - account_id: string; - pod_name: string; - container_image_name: string; - container_image_tag: string; - total_doc_count: number; - file_doc_count: number; - process_doc_count: number; - alert_doc_count: number; -} - -export interface CloudDefendAccountsStats { - account_id: string; - total_doc_count: number; - cloud_provider: string; - kubernetes_version: string | null; - file_doc_count: number; - process_doc_count: number; - alert_doc_count: number; - agents_count: number; - nodes_count: number; - pods_count: number; -} - -export type CloudDefendSelectorTypeCounts = { - [key in SelectorType]: number; -}; - -export type CloudDefendResponseTypeCounts = { - [key in SelectorType]: number; -}; - -export type CloudDefendConditionsCounts = { - [key in SelectorCondition]?: number; -}; - -export type CloudDefendActionCounts = { - [key in ResponseAction]?: number; -}; - -export interface CloudDefendPolicyYamlStats { - policy_yaml: string; - policy_json: string; // to be used for further digging in BigQuery - selector_counts: CloudDefendSelectorTypeCounts; - response_counts: CloudDefendResponseTypeCounts; - selector_conditions_counts: CloudDefendConditionsCounts; - response_actions_counts: CloudDefendActionCounts; - response_match_names: string[]; - response_exclude_names: string[]; -} - -type CloudDefendSelector = Omit<Selector, 'hasErrors'>; -type CloudDefendResponse = Omit<Response, 'hasErrors'>; - -export interface CloudDefendInstallationStats { - package_policy_id: string; - package_version: string; - agent_policy_id: string; - created_at: string; - agent_count: number; - policy_yaml: string; - selectors: CloudDefendSelector[]; - responses: CloudDefendResponse[]; -} diff --git a/x-pack/plugins/cloud_defend/tsconfig.json b/x-pack/plugins/cloud_defend/tsconfig.json deleted file mode 100755 index 9b87f53f7c7b6..0000000000000 --- a/x-pack/plugins/cloud_defend/tsconfig.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - "../../../typings/**/*", - "public/**/*.json", - "server/**/*.json" - ], - "kbn_references": [ - "@kbn/core", - "@kbn/data-plugin", - "@kbn/security-plugin", - "@kbn/fleet-plugin", - "@kbn/i18n-react", - "@kbn/config-schema", - "@kbn/licensing-plugin", - "@kbn/data-plugin", - "@kbn/kibana-react-plugin", - "@kbn/monaco", - "@kbn/i18n", - "@kbn/usage-collection-plugin", - "@kbn/cloud-plugin", - "@kbn/shared-ux-router", - "@kbn/shared-ux-link-redirect-app", - "@kbn/core-logging-server-mocks", - "@kbn/securitysolution-es-utils", - "@kbn/es-types", - "@kbn/data-views-plugin", - "@kbn/utility-types", - "@kbn/kubernetes-security-plugin", - "@kbn/core-http-router-server-mocks", - "@kbn/core-elasticsearch-server", - "@kbn/code-editor", - "@kbn/code-editor-mock", - "@kbn/core-security-common" - ], - "exclude": ["target/**/*"] -} diff --git a/x-pack/plugins/cloud_security_posture/README.md b/x-pack/plugins/cloud_security_posture/README.md deleted file mode 100755 index f608a614fca1c..0000000000000 --- a/x-pack/plugins/cloud_security_posture/README.md +++ /dev/null @@ -1,147 +0,0 @@ -# Cloud Security Posture Kibana Plugin - -Cloud Posture automates the identification and remediation of risks across cloud infrastructures - ---- - -## Development - -Read [Kibana Contributing Guide](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md) for more details - -## Testing - -For general guidelines, read [Kibana Testing Guide](https://www.elastic.co/guide/en/kibana/current/development-tests.html) for more details - -### Tests - -1. Unit Tests (Jest) - located in sibling files to the source code -1. [API Integration Tests](../../test/api_integration/apis/cloud_security_posture/config.ts) -1. [Telemetry Integration Tests](../../test/cloud_security_posture_api/config.ts) -1. [End-to-End Tests](../../test/cloud_security_posture_functional/config.ts) -1. [Serverless API Integration tests](../../test_serverless/api_integration/test_suites/security/config.ts) -1. [Serverless End-to-End Tests](../../test_serverless/functional/test_suites/security/config.ts) -1. [Cypress End-to-End Tests](../../test/security_solution_cypress/cypress/e2e/cloud_security_posture) - - -### Tools - -Run **TypeScript**: - -```bash -node scripts/type_check.js --project=x-pack/plugins/cloud_security_posture/tsconfig.json -``` - -Run **ESLint**: - -```bash -yarn lint:es x-pack/plugins/cloud_security_posture -``` - -Run **i18n check**: -```bash -node scripts/i18n_check.js -``` - -> **Note** -> -> i18n should run on project scope as it checks translations files outside of our plugin. -> -> Fixes can be applied using the --fix flag - -Run [**Unit Tests**](https://www.elastic.co/guide/en/kibana/current/development-tests.html#_unit_testing): - -```bash -yarn test:jest --config x-pack/plugins/cloud_security_posture/jest.config.js -``` - -> **Note** -> -> for a coverage report, add the `--coverage` flag, and run `open target/kibana-coverage/jest/x-pack/plugins/cloud_security_posture/index.html` - -Run [**Integration Tests**](https://docs.elastic.dev/kibana-dev-docs/tutorials/testing-plugins#): - -```bash -yarn test:ftr --config x-pack/test/api_integration/config.ts -``` - -Run [**End-to-End Tests**](https://www.elastic.co/guide/en/kibana/current/development-tests.html#_running_functional_tests): - -```bash -yarn test:ftr --config x-pack/test/cloud_security_posture_functional/config.ts -yarn test:ftr --config x-pack/test/api_integration/apis/cloud_security_posture/config.ts -yarn test:ftr --config x-pack/test/cloud_security_posture_api/config.ts -yarn test:ftr --config x-pack/test_serverless/api_integration/test_suites/security/config.ts --include-tag=cloud_security_posture -yarn test:ftr --config x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture.ts -``` - -Run [**End-to-End Cypress Tests**](https://github.com/elastic/kibana/tree/main/x-pack/test/security_solution_cypress/cypress): -> **Note** -> -> Run this from security_solution_cypress folder -```bash -yarn cypress:open:serverless -yarn cypress:open:ess -yarn cypress:cloud_security_posture:run:serverless -yarn cypress:cloud_security_posture:run:ess -``` - -#### Run **FTR tests (integration or e2e) for development** - -Functional test runner (FTR) can be used separately with `ftr:runner` and `ftr:server`. This is convenient while developing tests. - -For example, - -run ESS (stateful) api integration tests: -```bash -yarn test:ftr:server --config x-pack/test/api_integration/config.ts -yarn test:ftr:runner --config x-pack/test/api_integration/apis/cloud_security_posture/config.ts -``` - -run ESS (stateful) telemetry integration tests: -```bash -yarn test:ftr:server --config x-pack/test/cloud_security_posture_api/config.ts -yarn test:ftr:runner --config x-pack/test/cloud_security_posture_api/config.ts -``` - -run ESS (stateful) e2e tests: -```bash -yarn test:ftr:server --config x-pack/test/cloud_security_posture_functional/config.ts -yarn test:ftr:runner --config x-pack/test/cloud_security_posture_functional/config.ts -``` - -run serverless api integration tests: -```bash -yarn test:ftr:server --config x-pack/test_serverless/api_integration/test_suites/security/config.ts -yarn test:ftr:runner --config x-pack/test_serverless/api_integration/test_suites/security/config.ts --include-tag=cloud_security_posture -``` - -run serverless e2e tests: -```bash -yarn test:ftr:server --config x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture.ts -yarn test:ftr:runner ---config x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture.ts -``` - -#### Run **Cypress tests (e2e) for development** -When developing feature outside our plugin folder, instead of using FTRs for e2e test, we may use Cypress. Before running cypress, make sure you have installed it first. Like FTRs, we can run cypress in different environment, for example: - -run ess e2e tests: -```bash -yarn cypress:open:ess -``` - -run ess Cloud Security Posture e2e tests: -```bash -yarn cypress:cloud_security_posture:run:ess -``` - -run serverless e2e tests: -```bash -yarn cypress:open:serverless -``` - -run serverless Cloud Security Posture e2e tests: -```bash -yarn cypress:cloud_security_posture:run:serverless -``` - -Unlike FTR where we have to set server and runner separately, Cypress handles everything in 1 go, so just running the above the script is enough to get it running \ No newline at end of file diff --git a/x-pack/plugins/cloud_security_posture/common/dev_docs/__auto_generated_csp_requirements_test_coverage.md b/x-pack/plugins/cloud_security_posture/common/dev_docs/__auto_generated_csp_requirements_test_coverage.md deleted file mode 100644 index 495400272ac43..0000000000000 --- a/x-pack/plugins/cloud_security_posture/common/dev_docs/__auto_generated_csp_requirements_test_coverage.md +++ /dev/null @@ -1,993 +0,0 @@ -# Cloud Security Posture - Requirements Test Coverage - -<!-- This file is auto-generated. Any changes will be overwritten. -->This document provides a summary of the requirements test coverage for Cloud Security Posture. - -You can also check out the dedicated app view, which enables easier search and filter functionalities. -[Requirement test coverage app](https://vxgs2c.csb.app/) - -## Directory: x-pack/packages/kbn-cloud-security-posture - -**Total Tests:** 10 | **Skipped:** 0 (0.00%) | **Todo:** 0 (0.00%) - -![](https://img.shields.io/badge/KBN-PACKAGE-blueviolet) - -<details> -<summary>Test Details</summary> - -| Test Label | Type | Skipped | Todo | -|------------|------|---------|------| -| [test helper methods](x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts) | describe | | | -| [extractErrorMessage Test](x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts) | describe | | | -| [should return error message if input is instance of Error](x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts) | it | | | -| [should return string if input is string](x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts) | it | | | -| [should return fallbackMessage is input is not string nor instance of Error](x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts) | it | | | -| [should return default message when input is not string nor instance of Error and fallbackMessage is not provided](x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts) | it | | | -| [buildMutedRulesFilter Test](x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts) | describe | | | -| [should return an empty array if no rules are muted](x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts) | it | | | -| [should return the correct query for a single muted rule](x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts) | it | | | -| [should return the correct queries for multiple muted rules](x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts) | it | | | -</details> - -## Directory: x-pack/plugins/cloud_security_posture - -**Total Tests:** 463 | **Skipped:** 7 (1.51%) | **Todo:** 0 (0.00%) - -![](https://img.shields.io/badge/UT-brightgreen) ![](https://img.shields.io/badge/HAS-SKIP-yellow) - -<details> -<summary>Test Details</summary> - -| Test Label | Type | Skipped | Todo | -|------------|------|---------|------| -| [Detection rules utils](x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | describe | | | -| [should convert tags to KQL format with AND operator](x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | -| [Should convert tags to KQL format with AND Operator (empty array)](x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | -| [should convert tags to KQL format with OR Operator](x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | -| [Should convert tags to KQL format with OR Operator (empty array)](x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | -| [Should generate search tags for a CSP benchmark rule](x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | -| [Should handle undefined benchmark object gracefully](x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | -| [Should handle undefined rule number gracefully](x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | -| [Should generate search tags for a CSP benchmark rule given an array of Benchmarks](x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | -| [Should handle undefined benchmark object gracefully given an array of empty benchmark](x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | -| [Should generate tags for a CSPM benchmark rule](x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | -| [Should generate tags for a KSPM benchmark rule](x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | -| [test helper methods](x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts) | describe | | | -| [get default integration type from inputs with multiple enabled types](x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | -| [get default integration type from inputs without any enabled types](x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | -| [get EKS integration type](x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | -| [get Vanilla K8S integration type](x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | -| [get benchmark type filter based on a benchmark id](x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | -| [should return a string with the correct filter when given a benchmark type and section](x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | -| [get benchmark filter query based on a benchmark Id, version](x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | -| [get benchmark filter query based on a benchmark Id, version and multiple sections and rule numbers](x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | -| [get benchmark filter query based on a benchmark Id, version and just sections](x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | -| [get benchmark filter query based on a benchmark Id, version and just rule numbers](x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | -| [cleanupCredentials](x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts) | describe | | | -| [cleans unused aws credential methods, except role_arn when using assume_role](x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | -| [cleans unused aws credential methods, when using cloud formation](x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | -| [cleans unused aws credential methods, when using direct_access_keys method ](x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | -| [when aws credential type is undefined, return unchanged policy](x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | -| [cleans unused gcp credential methods, when using credentials-file method ](x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | -| [when gcp credential type is undefined, return unchanged policy](x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | -| [isSubscriptionAllowed](x-pack/plugins/cloud_security_posture/common/utils/subscription.test.ts) | describe | | | -| [should allow any cloud subscription](x-pack/plugins/cloud_security_posture/common/utils/subscription.test.ts) | it | | | -| [should allow enterprise and trial licenses for on-prem](x-pack/plugins/cloud_security_posture/common/utils/subscription.test.ts) | it | | | -| [should not allow enterprise and trial licenses for on-prem](x-pack/plugins/cloud_security_posture/common/utils/subscription.test.ts) | it | | | -| [CspRouter](x-pack/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | describe | | | -| [happy path](x-pack/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | describe | | | -| [should render Findings](x-pack/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | it | | | -| [should render Dashboards](x-pack/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | it | | | -| [should render the Vulnerability Dashboard](x-pack/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | it | | | -| [should render Benchmarks](x-pack/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | it | | | -| [should render Rules](x-pack/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | it | | | -| [unhappy path](x-pack/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | describe | | | -| [should redirect base path to dashboard](x-pack/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | it | | | -| [CspRoute](x-pack/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | describe | | | -| [should not render disabled path](x-pack/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | it | | | -| [should render SpyRoute for static paths](x-pack/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | it | | | -| [should not render SpyRoute for dynamic paths](x-pack/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | it | | | -| [useBenchmarkDynamicValues](x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.test.ts) | describe | | | -| [should return the correct dynamic benchmark values for each provided benchmark ID](x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.test.ts) | it | | | -| [should return the correct resource plurals based on the provided resource count](x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.test.ts) | it | | | -| [useNavigateFindings](x-pack/plugins/cloud_security_posture/public/common/hooks/use_navigate_findings.test.ts) | describe | | | -| [creates a URL to findings page with correct path, filter and dataViewId](x-pack/plugins/cloud_security_posture/public/common/hooks/use_navigate_findings.test.ts) | it | | | -| [creates a URL to findings page with correct path and negated filter](x-pack/plugins/cloud_security_posture/public/common/hooks/use_navigate_findings.test.ts) | it | | | -| [creates a URL to vulnerabilities page with correct path, filter and dataViewId](x-pack/plugins/cloud_security_posture/public/common/hooks/use_navigate_findings.test.ts) | it | | | -| [useUrlQuery](x-pack/plugins/cloud_security_posture/public/common/hooks/use_url_query.test.ts) | describe | | | -| [uses default query when no query is provided](x-pack/plugins/cloud_security_posture/public/common/hooks/use_url_query.test.ts) | it | | | -| [merges default query, partial first query and partial second query](x-pack/plugins/cloud_security_posture/public/common/hooks/use_url_query.test.ts) | it | | | -| [getSecuritySolutionLink](x-pack/plugins/cloud_security_posture/public/common/navigation/security_solution_links.test.ts) | describe | | | -| [gets the correct link properties](x-pack/plugins/cloud_security_posture/public/common/navigation/security_solution_links.test.ts) | it | | | -| [getAbbreviatedNumber](x-pack/plugins/cloud_security_posture/public/common/utils/get_abbreviated_number.test.ts) | describe | | | -| [should return the same value if it is less than 1000](x-pack/plugins/cloud_security_posture/public/common/utils/get_abbreviated_number.test.ts) | it | | | -| [should use numeral to format the value if it is greater than or equal to 1000](x-pack/plugins/cloud_security_posture/public/common/utils/get_abbreviated_number.test.ts) | it | | | -| [should return 0 if the value is NaN](x-pack/plugins/cloud_security_posture/public/common/utils/get_abbreviated_number.test.ts) | it | | | -| [getCvsScoreColor](x-pack/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | describe | | | -| [returns correct color for low severity score](x-pack/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | it | | | -| [returns correct color for medium severity score](x-pack/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | it | | | -| [returns correct color for high severity score](x-pack/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | it | | | -| [returns correct color for critical severity score](x-pack/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | it | | | -| [returns correct color for low severity score for undefined value](x-pack/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | it | | | -| [getSeverityStatusColor](x-pack/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | describe | | | -| [should return the correct color for LOW severity](x-pack/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | it | | | -| [should return the correct color for MEDIUM severity](x-pack/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | it | | | -| [should return the correct color for HIGH severity](x-pack/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | it | | | -| [should return the correct color for CRITICAL severity](x-pack/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | it | | | -| [should return #aaa for an unknown severity](x-pack/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | it | | | -| [AccountsEvaluatedWidget](x-pack/plugins/cloud_security_posture/public/components/accounts_evaluated_widget.test.tsx) | describe | | | -| [renders the component with benchmark data correctly](x-pack/plugins/cloud_security_posture/public/components/accounts_evaluated_widget.test.tsx) | it | | | -| [calls navToFindingsByCloudProvider when a benchmark with provider is clicked](x-pack/plugins/cloud_security_posture/public/components/accounts_evaluated_widget.test.tsx) | it | | | -| [calls navToFindingsByCisBenchmark when a benchmark with benchmarkId is clicked](x-pack/plugins/cloud_security_posture/public/components/accounts_evaluated_widget.test.tsx) | it | | | -| [<ChartPanel />](x-pack/plugins/cloud_security_posture/public/components/chart_panel.test.tsx) | describe | | | -| [renders loading state](x-pack/plugins/cloud_security_posture/public/components/chart_panel.test.tsx) | it | | | -| [renders error state](x-pack/plugins/cloud_security_posture/public/components/chart_panel.test.tsx) | it | | | -| [renders chart component](x-pack/plugins/cloud_security_posture/public/components/chart_panel.test.tsx) | it | | | -| [<CloudPosturePage />](x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx) | describe | | | -| [renders children if setup status is indexed](x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx) | it | | | -| [renders default loading text when query isLoading](x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx) | it | | | -| [renders default loading text when query is idle](x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx) | it | | | -| [renders default error texts when query isError](x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx) | it | | | -| [prefers custom error render](x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx) | it | | | -| [prefers custom loading render](x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx) | it | | | -| [renders no data prompt when query data is undefined](x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx) | it | | | -| [prefers custom no data prompt](x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx) | it | | | -| [CloudSecurityDataTable](x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.test.tsx) | describe | | | -| [renders loading state](x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.test.tsx) | it | | | -| [renders empty state when no rows are present](x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.test.tsx) | it | | | -| [renders data table with rows](x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.test.tsx) | it | | | -| [renders data table with actions button](x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.test.tsx) | it | | | -| [renders data table without actions button](x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.test.tsx) | it | | | -| [FieldsSelectorTable](x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | describe | | | -| [renders the table with data correctly](x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | -| [calls onAddColumn when a checkbox is checked](x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | -| [calls onRemoveColumn when a checkbox is unchecked](x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | -| [View selected](x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | describe | | | -| [should show "view all" option by default](x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | -| [should render "view selected" option when previous selection was "view selected"](x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | -| [should show "view all" option after the "view all" is selected](x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | -| [should show only selected columns after the "view selected" option is selected](x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | -| [should show all columns available after the "view all" option is selected](x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | -| [should open the view selector with button click](x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | -| [Searching columns](x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | describe | | | -| [should find all columns match the search term](x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | -| [should find all columns match the search term and are selected](x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | -| [firstNonNullValue](x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.test.ts) | describe | | | -| [returns the value itself for non-null single value](x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.test.ts) | it | | | -| [returns undefined for a null single value](x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.test.ts) | it | | | -| [returns undefined for an array of all null values](x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.test.ts) | it | | | -| [returns the first non-null value in an array of mixed values](x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.test.ts) | it | | | -| [returns the first value in an array of all non-null values](x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.test.ts) | it | | | -| [returns undefined for an empty array](x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.test.ts) | it | | | -| [DetectionRuleCounter](x-pack/plugins/cloud_security_posture/public/components/detection_rule_counter.test.tsx) | describe | | | -| [should render loading skeleton when both rules and alerts are loading](x-pack/plugins/cloud_security_posture/public/components/detection_rule_counter.test.tsx) | it | | | -| [should render create rule link when no rules exist](x-pack/plugins/cloud_security_posture/public/components/detection_rule_counter.test.tsx) | it | | | -| [should render alert and rule count when rules exist](x-pack/plugins/cloud_security_posture/public/components/detection_rule_counter.test.tsx) | it | | | -| [should show loading spinner when creating a rule](x-pack/plugins/cloud_security_posture/public/components/detection_rule_counter.test.tsx) | it | | | -| [<CspPolicyTemplateForm />](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | describe | | | -| [shows license block if subscription is not allowed](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [license block renders with license url locator](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [license block renders without license url locator](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [updates package policy namespace to default when it changes](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders and updates name field](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders and updates description field](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders KSPM input selector](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [updates selected KSPM input](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders CSPM input selector](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders disabled KSPM input when editing](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders disabled CSPM input when editing](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [selects default KSPM input selector](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [selects default VULN_MGMT input selector](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [selects default CSPM input selector](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [K8S](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | describe | | | -| [K8S or KSPM Vanilla should not render any Setup Access option](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [EKS Credentials input fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | describe | | | -| [documentation Hyperlink should have correct URL to redirect users to AWS page](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders ${CLOUDBEAT_EKS} Assume Role fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [updates ${CLOUDBEAT_EKS} Assume Role fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders ${CLOUDBEAT_EKS} Direct Access Keys fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [updates ${CLOUDBEAT_EKS} Direct Access Keys fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders ${CLOUDBEAT_EKS} Temporary Keys fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [updates ${CLOUDBEAT_EKS} Temporary Keys fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders ${CLOUDBEAT_EKS} Shared Credentials fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [updates ${CLOUDBEAT_EKS} Shared Credentials fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [AWS Credentials input fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | describe | | | -| [renders ${CLOUDBEAT_AWS} Account Type field, AWS Organization is enabled for supported versions](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [${CLOUDBEAT_AWS} form displays upgrade message for unsupported versions and aws organization option is disabled](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [${CLOUDBEAT_AWS} form do not displays upgrade message for supported versions and aws organization option is enabled](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [Getting started Hyperlink should have correct URL to redirect users to elastic page](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [documentation Hyperlink should have correct URL to redirect users to elastic page if user chose Manual](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [documentation Hyperlink should have correct URL to redirect users to AWS page if user chose Cloudformation](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders ${CLOUDBEAT_AWS} Assume Role fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [updates ${CLOUDBEAT_AWS} Assume Role fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders ${CLOUDBEAT_AWS} Direct Access Keys fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [updates ${CLOUDBEAT_AWS} Direct Access Keys fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders ${CLOUDBEAT_AWS} Temporary Keys fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [updates ${CLOUDBEAT_AWS} Temporary Keys fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders ${CLOUDBEAT_AWS} Shared Credentials fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [updates ${CLOUDBEAT_AWS} Shared Credentials fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [Vuln Mgmt](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | describe | | | -| [Update Agent Policy CloudFormation template from vars](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [Additional Charge Callout message should be rendered](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [GCP Credentials input fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | describe | | | -| [renders ${CLOUDBEAT_GCP} Not supported when version is not at least version 1.5.2](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [documentation Hyperlink should have correct URL to redirect users to elastic page](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders Google Cloud Shell forms when Setup Access is set to Google Cloud Shell](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders ${CLOUDBEAT_GCP} Credentials File fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [updates ${CLOUDBEAT_GCP} Credentials File fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [${CLOUDBEAT_GCP} form do not displays upgrade message for supported versions and gcp organization option is enabled](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders ${CLOUDBEAT_GCP} Organization fields when account type is Organization and Setup Access is Google Cloud Shell](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders ${CLOUDBEAT_GCP} Organization fields when account type is Organization and Setup Access is manual](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [Should not render ${CLOUDBEAT_GCP} Organization fields when account type is Single](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [updates ${CLOUDBEAT_GCP} organization id](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [Azure Credentials input fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | describe | | | -| [renders ${CLOUDBEAT_AZURE} Not supported when version is not at least version 1.6.0](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [doesnt render ${CLOUDBEAT_AZURE} Manual fields when version is not at least version 1.7.0](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [selects default ${CLOUDBEAT_AZURE} fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders ${CLOUDBEAT_AZURE} Service Principal with Client Secret fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [updates ${CLOUDBEAT_AZURE} Service Principal with Client Secret fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [Agentless](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | describe | | | -| [should not render setup technology selector if agentless is not available and CSPM integration supports agentless](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [should render setup technology selector for AWS and allow to select agentless](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [should render setup technology selector for GCP for organisation account type](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [should render setup technology selector for GCP for single-account](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [should render setup technology selector for Azure for Organisation type](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [should render setup technology selector for Azure for Single Subscription type](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [should not render setup technology selector for KSPM](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [should not render setup technology selector for CNVM](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders Service principal with Client Certificate fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [updates Service principal with Client Certificate fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [should not render Service principal with Client Username and Password option](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | -| [renders Service principal with Client Username and Password fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [updates Service principal with Client Username and Password fields](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [useSetupTechnology](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | describe | | | -| [create page flow](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | describe | | | -| [initializes with AGENT_BASED technology](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | -| [sets to AGENT-BASED when agentless is available and AWS cloud](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | -| [sets to AGENT-BASED when agentless is available and GCP cloud](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | -| [sets to AGENT-BASED when agentless is available and Azure cloud](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | -| [sets to AGENT_BASED when agentless is available but input is not supported for agentless](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | -| [sets to AGENT_BASED when isAgentlessEnabled is false](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | -| [calls handleSetupTechnologyChange when setupTechnology changes](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | -| [edit page flow](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | describe | | | -| [initializes with AGENT_BASED technology](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | -| [initializes with agentless when is in edit mode and is agentless selected](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | -| [should not call handleSetupTechnologyChange when setupTechnology changes](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | -| [should not update setupTechnology when agentlessPolicyId becomes available](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | -| [getPosturePolicy](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | describe | | | -| [updates package policy with hidden vars for ${name}](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [updates package policy required vars (posture/deployment)](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [updates package policy with a single enabled input](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [should correctly increment cspm package name](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [should return correctly increment vuln_mgmt package name](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [should return correctly increment kspm package name](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [should return package name with -1 when no matching package policies are found](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [should return empty string when policy_templates is missing](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [should return empty string when policy_templates.name is not cspm](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [should return empty string when policy_templates.inputs is missing](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [should return empty string when policy_templates.inputs is empty](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [should return empty string when policy_templates.inputs is undefined](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [should return empty string when policy_templates.inputs.vars does not have cloud_shell_url](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [should return empty string when policy_templates.inputs.varshave cloud_shell_url but no default](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [should cloud shell url when policy_templates.inputs.vars have cloud_shell_url](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [should return "direct_access_key" for agentless](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [should return "assume_role" for agent-based, when cloudformation is not available](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [should return "cloud_formation" for agent-based, when cloudformation is available](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [should return "service_principal_with_client_secret" for agentless](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [shold return "arm_template" for agent-based, when arm_template is available](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [should return "managed_identity" for agent-based, when arm_template is not available](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [should return manual credentials-json credentials type for agentless](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [should return google_cloud_shell setup access for agent-based if cloud_shell_url is available](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [should return manual setup access for agent-based if cloud_shell_url is not available](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [Should return var item when key exist](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [Should return undefined when key is invalid](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [Should return undefined when datastream is undefined](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [Should return undefined when stream is undefined](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [Should return undefined when stream.var is invalid](x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | -| [NoFindingsStates](x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx) | describe | | | -| [shows integrations installation prompt with installation links when integration is not-installed](x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx) | it | | | -| [shows install agent prompt with install agent link when status is not-deployed](x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx) | it | | | -| [shows install agent prompt with install agent link when status is not-deployed and postureType is KSPM](x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx) | it | | | -| [shows indexing message when status is indexing](x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx) | it | | | -| [shows timeout message when status is index-timeout](x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx) | it | | | -| [shows unprivileged message when status is unprivileged](x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx) | it | | | -| [renders empty container when the status does not match a no finding status](x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx) | it | | | -| [<BenchmarksTable />](x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx) | describe | | | -| [renders cis integration name](x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx) | it | | | -| [renders benchmark version](x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx) | it | | | -| [renders applicable to](x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx) | it | | | -| [renders evaluated](x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx) | it | | | -| [renders compliance](x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx) | it | | | -| [<Benchmarks />](x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx) | describe | | | -| [renders the page header](x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx) | it | | | -| [renders the "add integration" button](x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx) | it | | | -| [renders error state while there is an error](x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx) | it | | | -| [renders the benchmarks table](x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx) | it | | | -| [getTopRisks](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.test.ts) | describe | | | -| [returns sorted by posture score](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.test.ts) | it | | | -| [return sorted array with the correct number of elements](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.test.ts) | it | | | -| [<ComplianceDashboard />](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | describe | | | -| [shows package not installed page instead of tabs](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [no findings state: not-deployed - shows NotDeployed instead of dashboard](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [no findings state: indexing - shows Indexing instead of dashboard](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [no findings state: indexing - shows Indexing instead of dashboard when waiting_for_results](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [no findings state: index-timeout - shows IndexTimeout instead of dashboard](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [no findings state: unprivileged - shows Unprivileged instead of dashboard](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [shows dashboard when there are findings in latest findings index](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [Show Kubernetes dashboard if there are KSPM findings](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [Show Cloud dashboard if there are CSPM findings](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [Show Cloud dashboard "no findings prompt" if the CSPM integration is installed without findings](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [Show Kubernetes dashboard "no findings prompt" if the KSPM integration is installed without findings](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [Prefer Cloud dashboard if both integration are installed](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [Prefer Cloud dashboard if both integration have findings](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [Show CSPM installation prompt if CSPM is not installed and KSPM is installed ,NO AGENT](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [Show KSPM installation prompt if KSPM is not installed and CSPM is installed , NO AGENT](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [getDefaultTab](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | describe | | | -| [returns CSPM tab if only CSPM has findings](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [returns CSPM tab if both CSPM and KSPM has findings](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [returns KSPM tab if only KSPM has findings](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [when no findings preffers CSPM tab unless not-installed or unprivileged](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [should returns undefined when plugin status and cspm stats is not provided](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [should return undefined is plugin status and csp status is not provided ](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [should return undefined when plugins status or cspm stats data is not provided](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | -| [<BenchmarksSection />](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.test.tsx) | describe | | | -| [Sorting](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.test.tsx) | describe | | | -| [sorts by ascending order of compliance scores](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.test.tsx) | it | | | -| [toggles sort order when clicking Posture Score](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.test.tsx) | it | | | -| [<CloudSummarySection />](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.test.tsx) | describe | | | -| [renders all counter cards](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.test.tsx) | it | | | -| [renders counters content according to mock](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.test.tsx) | it | | | -| [renders counters value in compact abbreviation if its above one million](x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.test.tsx) | it | | | -| [<Findings />](x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | describe | | | -| [renders integrations installation prompt if integration is not installed and there are no findings](x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | it | | | -| [SearchBar](x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | describe | | | -| [set search query](x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | it | | | -| [renders no results message and reset button when search query does not match](x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | it | | | -| [add filter](x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | it | | | -| [remove filter](x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | it | | | -| [DistributionBar](x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | describe | | | -| [renders the distribution bar](x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | it | | | -| [filters by passed findings when clicking on the passed findings button](x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | it | | | -| [filters by failed findings when clicking on the failed findings button](x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | it | | | -| [<FindingsFlyout/>](x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | describe | | | -| [Overview Tab](x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | describe | | | -| [details and remediation accordions are open](x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | -| [displays text details summary info](x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | -| [displays missing info callout when data source is not CSP](x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | -| [does not display missing info callout when data source is CSP](x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | -| [Rule Tab](x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | describe | | | -| [displays rule text details](x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | -| [displays missing info callout when data source is not CSP](x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | -| [does not display missing info callout when data source is CSP](x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | -| [Table Tab](x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | describe | | | -| [displays resource name and id](x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | -| [does not display missing info callout for 3Ps](x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | -| [JSON Tab](x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | describe | | | -| [does not display missing info callout for 3Ps](x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | -| [should allow pagination with next](x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | -| [should allow pagination with previous](x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | -| [Get Filters](x-pack/plugins/cloud_security_posture/public/pages/configurations/utils/get_filters.test.ts) | describe | | | -| [negate an existing filter](x-pack/plugins/cloud_security_posture/public/pages/configurations/utils/get_filters.test.ts) | it | | | -| [<RulesContainer />](x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx) | describe | | | -| [displays rules with their initial state](x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx) | it | | | -| [<Rules />](x-pack/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx) | describe | | | -| [calls Benchmark API](x-pack/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx) | it | | | -| [Display success state when result request is resolved](x-pack/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx) | it | | | -| [use_change_csp_rule_state](x-pack/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx) | describe | | | -| [should call http.post with the correct parameters](x-pack/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx) | it | | | -| [should cancel queries and update query data onMutate](x-pack/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx) | it | | | -| [should invalidate queries onSettled](x-pack/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx) | it | | | -| [should restore previous query data onError](x-pack/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx) | it | | | -| [creates the new set of cache rules in a muted state when calling createRulesWithUpdatedState](x-pack/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx) | it | | | -| [creates the new cache with rules in a unmute state](x-pack/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx) | it | | | -| [<VulnerabilityFindingFlyout/>](x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | describe | | | -| [Header Info](x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | describe | | | -| [displays text details flyout header info](x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | it | | | -| [JSON Tab](x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | describe | | | -| [show display Vulnerability JSON Tab](x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | it | | | -| [Overview Summary Details Tab](x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | describe | | | -| [show display Vulnerability details in a Overview Tab](x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | it | | | -| [show empty state for no fixes](x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | it | | | -| [Flyout Pagination](x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | -| [should allow pagination with next](x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [should allow pagination with previous](x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [<Vulnerabilities />](x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx) | describe | | | -| [No vulnerabilities state: not-deployed - shows NotDeployed instead of vulnerabilities ](x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx) | it | | | -| [No vulnerabilities state: indexing - shows Indexing instead of vulnerabilities ](x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx) | it | | | -| [No vulnerabilities state: index-timeout - shows IndexTimeout instead of vulnerabilities ](x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx) | it | | | -| [No vulnerabilities state: unprivileged - shows Unprivileged instead of vulnerabilities ](x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx) | it | | | -| [renders vuln_mgmt integrations installation prompt if vuln_mgmt integration is not installed](x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx) | it | | | -| [<VulnerabilityDashboard />](x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx) | describe | | | -| [renders vuln_mgmt integrations installation prompt if vuln_mgmt integration is not installed](x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx) | it | | | -| [No vulnerabilities state: not-deployed - shows NotDeployed instead of vulnerabilities ](x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx) | it | | | -| [No vulnerabilities state: indexing - shows Indexing instead of vulnerabilities ](x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx) | it | | | -| [No vulnerabilities state: index-timeout - shows IndexTimeout instead of vulnerabilities ](x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx) | it | | | -| [No vulnerabilities state: unprivileged - shows Unprivileged instead of vulnerabilities ](x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx) | it | | | -| [Vulnerabilities state: indexed - renders dashboard container on indexed state ](x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx) | it | | | -| [createBenchmarkScoreIndex](x-pack/plugins/cloud_security_posture/server/create_indices/create_indices.test.ts) | describe | | | -| [should delete old index template from prev verions first](x-pack/plugins/cloud_security_posture/server/create_indices/create_indices.test.ts) | it | | | -| [should create index template with the correct index pattern, index name and default ingest pipeline](x-pack/plugins/cloud_security_posture/server/create_indices/create_indices.test.ts) | it | | | -| [should create index template the correct index patter, index name and default ingest pipeline but without lifecycle in serverless](x-pack/plugins/cloud_security_posture/server/create_indices/create_indices.test.ts) | it | | | -| [should create index if does not exist](x-pack/plugins/cloud_security_posture/server/create_indices/create_indices.test.ts) | it | | | -| [should updat index mapping if index exists](x-pack/plugins/cloud_security_posture/server/create_indices/create_indices.test.ts) | it | | | -| [createTransformIfNotExist](x-pack/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts) | describe | | | -| [expect not to create if already exists](x-pack/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts) | it | | | -| [expect to create if does not already exist](x-pack/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts) | it | | | -| [expect not to create if get error is not 404](x-pack/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts) | it | | | -| [startTransformIfNotStarted](x-pack/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts) | describe | | | -| [expect not to start if state is ${state}](x-pack/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts) | it | | | -| [expect not to start if transform not found](x-pack/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts) | it | | | -| [expect to start if state is stopped](x-pack/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts) | it | | | -| [expect to attempt restart if state is failed](x-pack/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts) | it | | | -| [Benchmark Field Key Functions](x-pack/plugins/cloud_security_posture/server/lib/mapping_field_util.test.ts) | describe | | | -| [toBenchmarkDocFieldKey should keep the same benchmark id and version key for benchmark document](x-pack/plugins/cloud_security_posture/server/lib/mapping_field_util.test.ts) | it | | | -| [toBenchmarkDocFieldKey should convert benchmark version with . delimiter correctly](x-pack/plugins/cloud_security_posture/server/lib/mapping_field_util.test.ts) | it | | | -| [toBenchmarkMappingFieldKey should convert benchmark version with _ delimiter correctly](x-pack/plugins/cloud_security_posture/server/lib/mapping_field_util.test.ts) | it | | | -| [toBenchmarkMappingFieldKey should handle benchmark version with dots correctly](x-pack/plugins/cloud_security_posture/server/lib/mapping_field_util.test.ts) | it | | | -| [MAPPING_VERSION_DELIMITER should be an underscore](x-pack/plugins/cloud_security_posture/server/lib/mapping_field_util.test.ts) | it | | | -| [Cloud Security Posture Plugin](x-pack/plugins/cloud_security_posture/server/plugin.test.ts) | describe | | | -| [start()](x-pack/plugins/cloud_security_posture/server/plugin.test.ts) | describe | | | -| [should initialize when package installed](x-pack/plugins/cloud_security_posture/server/plugin.test.ts) | it | | | -| [should not initialize when package is not installed](x-pack/plugins/cloud_security_posture/server/plugin.test.ts) | it | | | -| [should not initialize when other package is created](x-pack/plugins/cloud_security_posture/server/plugin.test.ts) | it | | | -| [packagePolicyPostCreate should return the same received policy](x-pack/plugins/cloud_security_posture/server/plugin.test.ts) | it | | | -| [getSortedCspBenchmarkRules](x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts) | describe | | | -| [sorts by metadata.benchmark.rule_number, invalid semantic version still should still get sorted and empty values should be sorted last](x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts) | it | | | -| [edge case - returns empty array if input is empty](x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts) | it | | | -| [edge case - returns sorted array even if input only has one element](x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts) | it | | | -| [returns sorted array even with undefined or null properties](x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts) | it | | | -| [returns sorted array with invalid semantic versions](x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts) | it | | | -| [benchmarks API](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | describe | | | -| [validate the API route path](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | -| [should accept to a user with fleet.all privilege](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | -| [should reject to a user without fleet.all privilege](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | -| [test input schema](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | describe | | | -| [expect to find default values](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | -| [expect to find package_policy_name](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | -| [should throw when page field is not a positive integer](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | -| [should throw when per_page field is not a positive integer](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | -| [should throw when sort_field is not string](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | -| [should not throw when sort_field is a string](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | -| [should throw when sort_order is not ](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | -| [should not throw when ](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | -| [should not throw when ](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | -| [should not throw when fields is a known string literal](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | -| [test benchmarks utils](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | describe | | | -| [test getAgentPolicies](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | describe | | | -| [should return one agent policy id when there is duplication](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | -| [should return full policy ids list when there is no id duplication](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | -| [test addPackagePolicyCspBenchmarkRule](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | describe | | | -| [should retrieve the rules count by the filtered benchmark type](x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | -| [compliance dashboard permissions API](x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.test.ts) | describe | | | -| [should accept to a user with fleet.all privilege](x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.test.ts) | it | | | -| [should reject to a user without fleet.all privilege](x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.test.ts) | it | | | -| [getBenchmarksFromAggs](x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_benchmarks.test.ts) | describe | | | -| [should return value matching ComplianceDashboardDataV2["benchmarks"]](x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_benchmarks.test.ts) | it | | | -| [getClustersFromAggs](x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts) | describe | | | -| [should return value matching ComplianceDashboardData["clusters"]](x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts) | it | | | -| [getPostureStatsFromAggs](x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_grouped_findings_evaluation.test.ts) | describe | | | -| [should return value matching ComplianceDashboardData["resourcesTypes"]](x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_grouped_findings_evaluation.test.ts) | it | | | -| [roundScore](x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts) | describe | | | -| [should return decimal values with one fraction digit](x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts) | it | | | -| [calculatePostureScore](x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts) | describe | | | -| [should return calculated posture score](x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts) | it | | | -| [getStatsFromFindingsEvaluationsAggs](x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts) | describe | | | -| [should throw error in case no findings were found](x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts) | it | | | -| [should return value matching ComplianceDashboardData["stats"]](x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts) | it | | | -| [checks for stability in case one of the values is zero](x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts) | it | | | -| [should return zero on all stats if there are no failed or passed findings](x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts) | it | | | -| [getTrendsFromQueryResult](x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.test.ts) | describe | | | -| [should return value matching Trends type definition, in descending order, and with postureScore](x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.test.ts) | it | | | -| [calculateIntegrationStatus for cspm](x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts) | describe | | | -| [Verify status when CSP package is not installed](x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | -| [Verify status when there are no permission for cspm](x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | -| [Verify status when there are no findings, no healthy agents and no installed policy templates](x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | -| [Verify status when there are findings and installed policies but no healthy agents](x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | -| [Verify status when there are findings ,installed policies and healthy agents](x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | -| [Verify status when there are no findings ,installed policies and no healthy agents](x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | -| [Verify status when there are installed policies, healthy agents and no findings](x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | -| [Verify status when there are installed policies, healthy agents and no findings and been more than 10 minutes](x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | -| [Verify status when there are installed policies, healthy agents past findings but no recent findings](x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | -| [calculateIntegrationStatus for vul_mgmt](x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts) | describe | | | -| [Verify status when there are no permission for vul_mgmt](x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | -| [Verify status when there are no vul_mgmt findings, no healthy agents and no installed policy templates](x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | -| [Verify status when there are vul_mgmt findings and installed policies but no healthy agents](x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | -| [Verify status when there are vul_mgmt findings ,installed policies and healthy agents](x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | -| [Verify status when there are no vul_mgmt findings ,installed policies and no healthy agents](x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | -| [Verify status when there are installed policies, healthy agents and no vul_mgmt findings](x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | -| [Verify status when there are installed policies, healthy agents and no vul_mgmt findings and been more than 10 minutes](x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | -| [Verify status when there are installed policies, healthy agents and no vul_mgmt findings and been more than 1 hour](x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | -| [Verify status when there are installed policies, healthy agents past vul_mgmt findings but no recent findings](x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | -| [finding stats task state](x-pack/plugins/cloud_security_posture/server/tasks/task_state.test.ts) | describe | | | -| [v1](x-pack/plugins/cloud_security_posture/server/tasks/task_state.test.ts) | describe | | | -| [should work on empty object when running the up migration](x-pack/plugins/cloud_security_posture/server/tasks/task_state.test.ts) | it | | | -| [shouldn](x-pack/plugins/cloud_security_posture/server/tasks/task_state.test.ts) | it | | | -| [should drop unknown properties when running the up migration](x-pack/plugins/cloud_security_posture/server/tasks/task_state.test.ts) | it | | | -</details> - -## Directory: x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture - -**Total Tests:** 43 | **Skipped:** 6 (13.95%) | **Todo:** 0 (0.00%) - -![](https://img.shields.io/badge/FTR-blue) ![](https://img.shields.io/badge/SERVERLESS-pink) ![](https://img.shields.io/badge/API-INTEGRATION-purple) ![](https://img.shields.io/badge/HAS-SKIP-yellow) - -<details> -<summary>Test Details</summary> - -| Test Label | Type | Skipped | Todo | -|------------|------|---------|------| -| [GET /internal/cloud_security_posture/benchmark](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/benchmark/v1.ts) | describe | | | -| [Should return non-empty array filled with Rules if user has CSP integrations](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/benchmark/v1.ts) | it | | | -| [Should return array size 2 when we set per page to be only 2 (total element is still 3)](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/benchmark/v1.ts) | it | | | -| [Should return array size 2 when we set per page to be only 2 (total element is still 3)](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/benchmark/v1.ts) | it | | | -| [Should return empty array when we set page to be above the last page number](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/benchmark/v1.ts) | it | | | -| [GET /internal/cloud_security_posture/benchmark](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/benchmark/v2.ts) | describe | | | -| [Should return all benchmarks if user has CSP integrations](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/benchmark/v2.ts) | it | | | -| [GET internal/cloud_security_posture/rules/_find](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts) | describe | | | -| [Should return 500 error code when not provide package policy id or benchmark id](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | -| [Should return 500 error code when provide both package policy id and benchmark id](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | -| [Should return 404 status code when the package policy ID does not exist](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | -| [Should return 200 status code and filter rules by benchmarkId](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | -| [Should return 200 status code, and only requested fields in the response](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | -| [Should return 200 status code, items sorted by metadata.section field](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | -| [Should return 200 status code and paginate rules with a limit of PerPage](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | -| [cloud_security_posture](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/index.ts) | describe | | | -| [Intercept the usage API request sent by the metering background task manager](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/serverless_metering/cloud_security_metering.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Should intercept usage API request for CSPM](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/serverless_metering/cloud_security_metering.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Should intercept usage API request for KSPM](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/serverless_metering/cloud_security_metering.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Should intercept usage API request for CNVM](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/serverless_metering/cloud_security_metering.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Should intercept usage API request for Defend for Containers](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/serverless_metering/cloud_security_metering.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Should intercept usage API request with all integrations usage records](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/serverless_metering/cloud_security_metering.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [GET /internal/cloud_security_posture/status](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_indexed.ts) | describe | | | -| [STATUS = INDEXED TEST](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_indexed.ts) | describe | | | -| [Return kspm status indexed when logs-cloud_security_posture.findings_latest-default contains new kspm documents](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_indexed.ts) | it | | | -| [Return cspm status indexed when logs-cloud_security_posture.findings_latest-default contains new cspm documents](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_indexed.ts) | it | | | -| [Return vuln status indexed when logs-cloud_security_posture.vulnerabilities_latest-default contains new documents](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_indexed.ts) | it | | | -| [GET /internal/cloud_security_posture/status](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_indexing.ts) | describe | | | -| [STATUS = INDEXING TEST](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_indexing.ts) | describe | | | -| [Return kspm status indexing when logs-cloud_security_posture.findings_latest-default doesn](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_indexing.ts) | it | | | -| [Return cspm status indexing when logs-cloud_security_posture.findings_latest-default doesn](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_indexing.ts) | it | | | -| [Return vuln status indexing when logs-cloud_security_posture.vulnerabilities_latest-default doesn](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_indexing.ts) | it | | | -| [GET /internal/cloud_security_posture/status](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_not_deployed_not_installed.ts) | describe | | | -| [STATUS = NOT-DEPLOYED and STATUS = NOT-INSTALLED TEST](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_not_deployed_not_installed.ts) | describe | | | -| [Should return not-deployed when installed kspm, no findings on either indices and no healthy agents](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_not_deployed_not_installed.ts) | it | | | -| [Should return not-deployed when installed cspm, no findings on either indices and no healthy agents](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_not_deployed_not_installed.ts) | it | | | -| [Should return not-deployed when installed cnvm, no findings on either indices and no healthy agents](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_not_deployed_not_installed.ts) | it | | | -| [Verify cloud_security_posture telemetry payloads](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/telemetry.ts) | describe | | | -| [includes only KSPM findings](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/telemetry.ts) | it | | | -| [includes only CSPM findings](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/telemetry.ts) | it | | | -| [includes CSPM and KSPM findings](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/telemetry.ts) | it | | | -| [](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/telemetry.ts) | it | | | -| [includes KSPM findings without posture_type and CSPM findings as well](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/telemetry.ts) | it | | | -</details> - -## Directory: x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture - -**Total Tests:** 33 | **Skipped:** 3 (9.09%) | **Todo:** 0 (0.00%) - -![](https://img.shields.io/badge/FTR-blue) ![](https://img.shields.io/badge/SERVERLESS-pink) ![](https://img.shields.io/badge/HAS-SKIP-yellow) - -<details> -<summary>Test Details</summary> - -| Test Label | Type | Skipped | Todo | -|------------|------|---------|------| -| [Agentless API Serverless](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless_api/create_agent.ts) | describe | | | -| [should create agentless-agent](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless_api/create_agent.ts) | it | | | -| [should create default agent-based agent](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless_api/create_agent.ts) | it | | | -| [cloud_security_posture](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless_api/index.ts) | describe | | | -| [Serverless - Agentless CIS Integration Page](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | describe | | | -| [Serverless - Agentless CIS_AWS Single Account Launch Cloud formation](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | describe | | | -| [should show CIS_AWS Launch Cloud formation button when credentials selector is direct access keys and package version is ${CLOUD_CREDENTIALS_PACKAGE_VERSION}](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | it | | | -| [should hide CIS_AWS Launch Cloud formation button when credentials selector is temporary keys and package version is less than ${previousPackageVersion}](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | it | | | -| [Serverless - Agentless CIS_AWS ORG Account Launch Cloud formation](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | describe | | | -| [should show CIS_AWS Launch Cloud formation button when credentials selector is direct access keys and package version is ${CLOUD_CREDENTIALS_PACKAGE_VERSION}](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [should hide CIS_AWS Launch Cloud formation button when credentials selector is temporary keys and package version is less than ${previousPackageVersion}](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | it | | | -| [Serverless - Agentless CIS_AWS edit flow](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | describe | | | -| [user should save and edit agentless integration policy](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | it | | | -| [Serverless - Agentless CIS_AWS Create flow](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | -| [user should save agentless integration policy when there are no api or validation errors and button is not disabled](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Agentless CIS Integration Page](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_gcp.ts) | describe | | | -| [Agentless CIS_GCP Single Account Launch Cloud shell](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_gcp.ts) | describe | | | -| [should show CIS_GCP Launch Cloud Shell button when package version is ${CLOUD_CREDENTIALS_PACKAGE_VERSION}](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_gcp.ts) | it | | | -| [should hide CIS_GCP Launch Cloud Shell button when package version is less than ${CLOUD_CREDENTIALS_PACKAGE_VERSION}](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_gcp.ts) | it | | | -| [Agentless CIS_GCP ORG Account Launch Cloud Shell](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_gcp.ts) | describe | | | -| [should show CIS_GCP Launch Cloud Shell button when package version is ${CLOUD_CREDENTIALS_PACKAGE_VERSION}](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_gcp.ts) | it | | | -| [should hide CIS_GCP Launch Cloud shell button when package version is ${previousPackageVersion}](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_gcp.ts) | it | | | -| [Serverless - Agentless CIS_GCP edit flow](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_gcp.ts) | describe | | | -| [user should save and edit agentless integration policy](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_gcp.ts) | it | | | -| [cloud_security_posture](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/index.ts) | describe | | | -| [Cloud Posture Dashboard Page](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/compliance_dashboard.ts) | describe | | | -| [Kubernetes Dashboard](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/compliance_dashboard.ts) | describe | | | -| [displays accurate summary compliance score](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/compliance_dashboard.ts) | it | | | -| [[Essentials PLI] Test Cloud Security Posture Integrations on Serverless](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/csp_integrations_form.essentials.ts) | describe | | | -| [[Essentials PLI] Integration installation form should be available with Essentials or Complete PLI](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/csp_integrations_form.essentials.ts) | it | | | -| [Test Cloud Security Posture Integrations on Serverless](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/csp_integrations_form.ts) | describe | | | -| [Integration installation form should not be available without required PLI](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/csp_integrations_form.ts) | it | | | -| [cloud_security_posture](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/index.ts) | describe | | | -</details> - -## Directory: x-pack/test/api_integration/apis/cloud_security_posture - -**Total Tests:** 65 | **Skipped:** 0 (0.00%) | **Todo:** 0 (0.00%) - -![](https://img.shields.io/badge/FTR-blue) ![](https://img.shields.io/badge/API-INTEGRATION-purple) - -<details> -<summary>Test Details</summary> - -| Test Label | Type | Skipped | Todo | -|------------|------|---------|------| -| [GET /internal/cloud_security_posture/benchmark](x-pack/test/api_integration/apis/cloud_security_posture/benchmark/v1.ts) | describe | | | -| [Should return non-empty array filled with Rules if user has CSP integrations](x-pack/test/api_integration/apis/cloud_security_posture/benchmark/v1.ts) | it | | | -| [Should return array size 2 when we set per page to be only 2 (total element is still 3)](x-pack/test/api_integration/apis/cloud_security_posture/benchmark/v1.ts) | it | | | -| [Should return array size 2 when we set per page to be only 2 (total element is still 3)](x-pack/test/api_integration/apis/cloud_security_posture/benchmark/v1.ts) | it | | | -| [Should return empty array when we set page to be above the last page number](x-pack/test/api_integration/apis/cloud_security_posture/benchmark/v1.ts) | it | | | -| [GET /internal/cloud_security_posture/benchmark](x-pack/test/api_integration/apis/cloud_security_posture/benchmark/v2.ts) | describe | | | -| [Should return all benchmarks if user has CSP integrations](x-pack/test/api_integration/apis/cloud_security_posture/benchmark/v2.ts) | it | | | -| [GET internal/cloud_security_posture/rules/_find](x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts) | describe | | | -| [Should return 500 error code when not provide package policy id or benchmark id](x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | -| [Should return 500 error code when provide both package policy id and benchmark id](x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | -| [Should return 404 status code when the package policy ID does not exist](x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | -| [Should return 200 status code and filter rules by benchmarkId](x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | -| [Should return 200 status code, and only requested fields in the response](x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | -| [Should return 200 status code, items sorted by metadata.section field](x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | -| [Should return 200 status code and paginate rules with a limit of PerPage](x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | -| [cloud_security_posture](x-pack/test/api_integration/apis/cloud_security_posture/index.ts) | describe | | | -| [GET internal/cloud_security_posture/rules/_find](x-pack/test/api_integration/apis/cloud_security_posture/rules/v1.ts) | describe | | | -| [Should return 500 error code when not provide package policy id or benchmark id](x-pack/test/api_integration/apis/cloud_security_posture/rules/v1.ts) | it | | | -| [Should return 500 error code when provide both package policy id and benchmark id](x-pack/test/api_integration/apis/cloud_security_posture/rules/v1.ts) | it | | | -| [Should return 404 status code when the package policy ID does not exist](x-pack/test/api_integration/apis/cloud_security_posture/rules/v1.ts) | it | | | -| [Should return 200 status code and filter rules by benchmarkId](x-pack/test/api_integration/apis/cloud_security_posture/rules/v1.ts) | it | | | -| [Should return 200 status code, and only requested fields in the response](x-pack/test/api_integration/apis/cloud_security_posture/rules/v1.ts) | it | | | -| [Should return 200 status code, items sorted by metadata.section field](x-pack/test/api_integration/apis/cloud_security_posture/rules/v1.ts) | it | | | -| [Should return 200 status code and paginate rules with a limit of PerPage](x-pack/test/api_integration/apis/cloud_security_posture/rules/v1.ts) | it | | | -| [GET internal/cloud_security_posture/rules/_find](x-pack/test/api_integration/apis/cloud_security_posture/rules/v2.ts) | describe | | | -| [Should return 500 error code when not provide benchmark id](x-pack/test/api_integration/apis/cloud_security_posture/rules/v2.ts) | it | | | -| [Should return 200 status code and filter rules by benchmarkId and benchmarkVersion](x-pack/test/api_integration/apis/cloud_security_posture/rules/v2.ts) | it | | | -| [Should return 200 status code, and only requested fields in the response](x-pack/test/api_integration/apis/cloud_security_posture/rules/v2.ts) | it | | | -| [Should return 200 status code, items sorted by metadata.section field](x-pack/test/api_integration/apis/cloud_security_posture/rules/v2.ts) | it | | | -| [Should return 200 status code and paginate rules with a limit of PerPage](x-pack/test/api_integration/apis/cloud_security_posture/rules/v2.ts) | it | | | -| [GET /internal/cloud_security_posture/status](x-pack/test/api_integration/apis/cloud_security_posture/status/status_index_timeout.ts) | describe | | | -| [STATUS = INDEX_TIMEOUT TEST](x-pack/test/api_integration/apis/cloud_security_posture/status/status_index_timeout.ts) | describe | | | -| [Should return index-timeout when installed kspm, has findings only on logs-cloud_security_posture.findings-default* and it has been more than 10 minutes since the installation](x-pack/test/api_integration/apis/cloud_security_posture/status/status_index_timeout.ts) | it | | | -| [Should return index-timeout when installed cspm, has findings only on logs-cloud_security_posture.findings-default* and it has been more than 10 minutes since the installation](x-pack/test/api_integration/apis/cloud_security_posture/status/status_index_timeout.ts) | it | | | -| [Should return index-timeout when installed cnvm, has findings only on logs-cloud_security_posture.vulnerabilities-default* and it has been more than 4 hours minutes since the installation](x-pack/test/api_integration/apis/cloud_security_posture/status/status_index_timeout.ts) | it | | | -| [GET /internal/cloud_security_posture/status](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexed.ts) | describe | | | -| [STATUS = INDEXED TEST](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexed.ts) | describe | | | -| [Return hasMisconfigurationsFindings true when there are latest findings but no installed integrations](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexed.ts) | it | | | -| [Return hasMisconfigurationsFindings true when there are only findings in third party index](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexed.ts) | it | | | -| [Return hasMisconfigurationsFindings false when there are no findings](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexed.ts) | it | | | -| [Return kspm status indexed when logs-cloud_security_posture.findings_latest-default contains new kspm documents](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexed.ts) | it | | | -| [Return cspm status indexed when logs-cloud_security_posture.findings_latest-default contains new cspm documents](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexed.ts) | it | | | -| [Return vuln status indexed when logs-cloud_security_posture.vulnerabilities_latest-default contains new documents](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexed.ts) | it | | | -| [GET /internal/cloud_security_posture/status](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexing.ts) | describe | | | -| [STATUS = INDEXING TEST](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexing.ts) | describe | | | -| [Return kspm status indexing when logs-cloud_security_posture.findings_latest-default doesn](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexing.ts) | it | | | -| [Return cspm status indexing when logs-cloud_security_posture.findings_latest-default doesn](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexing.ts) | it | | | -| [Return vuln status indexing when logs-cloud_security_posture.vulnerabilities_latest-default doesn](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexing.ts) | it | | | -| [GET /internal/cloud_security_posture/status](x-pack/test/api_integration/apis/cloud_security_posture/status/status_not_deployed_not_installed.ts) | describe | | | -| [STATUS = NOT-DEPLOYED and STATUS = NOT-INSTALLED TEST](x-pack/test/api_integration/apis/cloud_security_posture/status/status_not_deployed_not_installed.ts) | describe | | | -| [Should return not-deployed when installed kspm, no findings on either indices and no healthy agents](x-pack/test/api_integration/apis/cloud_security_posture/status/status_not_deployed_not_installed.ts) | it | | | -| [Should return not-deployed when installed cspm, no findings on either indices and no healthy agents](x-pack/test/api_integration/apis/cloud_security_posture/status/status_not_deployed_not_installed.ts) | it | | | -| [Should return not-deployed when installed cnvm, no findings on either indices and no healthy agents](x-pack/test/api_integration/apis/cloud_security_posture/status/status_not_deployed_not_installed.ts) | it | | | -| [GET /internal/cloud_security_posture/status](x-pack/test/api_integration/apis/cloud_security_posture/status/status_unprivileged.ts) | describe | | | -| [STATUS = UNPRIVILEGED TEST](x-pack/test/api_integration/apis/cloud_security_posture/status/status_unprivileged.ts) | describe | | | -| [Return unprivileged for cspm, kspm, vuln_mgmt when users don](x-pack/test/api_integration/apis/cloud_security_posture/status/status_unprivileged.ts) | it | | | -| [status = unprivileged test indices](x-pack/test/api_integration/apis/cloud_security_posture/status/status_unprivileged.ts) | describe | | | -| [Return unprivileged when missing access to findings_latest index](x-pack/test/api_integration/apis/cloud_security_posture/status/status_unprivileged.ts) | it | | | -| [Return unprivileged when missing access to score index](x-pack/test/api_integration/apis/cloud_security_posture/status/status_unprivileged.ts) | it | | | -| [Return unprivileged when missing access to vulnerabilities_latest index](x-pack/test/api_integration/apis/cloud_security_posture/status/status_unprivileged.ts) | it | | | -| [GET /internal/cloud_security_posture/status](x-pack/test/api_integration/apis/cloud_security_posture/status/status_waiting_for_results.ts) | describe | | | -| [STATUS = WAITING_FOR_RESULT TEST](x-pack/test/api_integration/apis/cloud_security_posture/status/status_waiting_for_results.ts) | describe | | | -| [Should return waiting_for_result when installed kspm, has no findings and it has been less than 10 minutes since the installation](x-pack/test/api_integration/apis/cloud_security_posture/status/status_waiting_for_results.ts) | it | | | -| [Should return waiting_for_result when installed cspm, has no findings and it has been less than 10 minutes since the installation](x-pack/test/api_integration/apis/cloud_security_posture/status/status_waiting_for_results.ts) | it | | | -| [Should return waiting_for_result when installed cnvm, has no findings and it has been less than 4 hours minutes since the installation](x-pack/test/api_integration/apis/cloud_security_posture/status/status_waiting_for_results.ts) | it | | | -</details> - -## Directory: x-pack/test/cloud_security_posture_api - -**Total Tests:** 58 | **Skipped:** 2 (3.45%) | **Todo:** 0 (0.00%) - -![](https://img.shields.io/badge/FTR-blue) ![](https://img.shields.io/badge/API-INTEGRATION-purple) ![](https://img.shields.io/badge/HAS-SKIP-yellow) - -<details> -<summary>Test Details</summary> - -| Test Label | Type | Skipped | Todo | -|------------|------|---------|------| -| [GET /internal/cloud_security_posture/benchmarks](x-pack/test/cloud_security_posture_api/routes/benchmarks.ts) | describe | | | -| [Get Benchmark API](x-pack/test/cloud_security_posture_api/routes/benchmarks.ts) | describe | | | -| [Verify cspm benchmark score is updated when muting rules](x-pack/test/cloud_security_posture_api/routes/benchmarks.ts) | it | | | -| [Verify kspm benchmark score is updated when muting rules](x-pack/test/cloud_security_posture_api/routes/benchmarks.ts) | it | | | -| [Get Benchmark API](x-pack/test/cloud_security_posture_api/routes/benchmarks.ts) | describe | | | -| [Calling Benchmark API as User with no read access to Security](x-pack/test/cloud_security_posture_api/routes/benchmarks.ts) | it | | | -| [Calling Benchmark API as User with read access to Security](x-pack/test/cloud_security_posture_api/routes/benchmarks.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Verify update csp rules states API](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts) | describe | | | -| [mute benchmark rules successfully](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts) | it | | | -| [unmute rules successfully](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts) | it | | | -| [verify new rules are added and existing rules are set.](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts) | it | | | -| [mute detection rule successfully](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts) | it | | | -| [Expect to mute two benchmark rules and one detection rule](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts) | it | | | -| [Expect to save rules states when requesting to update empty object](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts) | it | | | -| [set wrong action input](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts) | it | | | -| [users without read privileges on cloud security should not be able to mute](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts) | it | | | -| [users with all privileges on cloud security should be able to mute](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts) | it | | | -| [Tests get rules states API](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_get_states.ts) | describe | | | -| [get rules states successfully](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_get_states.ts) | it | | | -| [get empty object when rules states not exists](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_get_states.ts) | it | | | -| [GET rules states API with user with read access](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_get_states.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [GET rules states API API with user without read access](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_get_states.ts) | it | | | -| [/internal/cloud_security_posture/detection_engine_rules/alerts/_status](x-pack/test/cloud_security_posture_api/routes/get_detection_engine_alerts_count_by_rule_tags.ts) | describe | | | -| [GET detection_engine_rules API with user that has specific access](x-pack/test/cloud_security_posture_api/routes/get_detection_engine_alerts_count_by_rule_tags.ts) | describe | | | -| [GET detection_engine_rules API with user with read access](x-pack/test/cloud_security_posture_api/routes/get_detection_engine_alerts_count_by_rule_tags.ts) | it | | | -| [GET detection_engine_rules API with user without read access](x-pack/test/cloud_security_posture_api/routes/get_detection_engine_alerts_count_by_rule_tags.ts) | it | | | -| [Cloud Security Posture](x-pack/test/cloud_security_posture_api/routes/index.ts) | describe | | | -| [GET /internal/cloud_security_posture/stats](x-pack/test/cloud_security_posture_api/routes/stats.ts) | describe | | | -| [CSPM Compliance Dashboard Stats API](x-pack/test/cloud_security_posture_api/routes/stats.ts) | describe | | | -| [should return CSPM cluster V1 ](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | -| [should return CSPM benchmarks V2 ](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | -| [KSPM Compliance Dashboard Stats API](x-pack/test/cloud_security_posture_api/routes/stats.ts) | describe | | | -| [should return KSPM clusters V1 ](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | -| [should return KSPM benchmarks V2](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | -| [should return KSPM benchmarks V2](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | -| [Compliance dashboard based on enabled rules](x-pack/test/cloud_security_posture_api/routes/stats.ts) | describe | | | -| [should calculate cspm benchmarks posture score based only on enabled rules](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | -| [should calculate kspm benchmarks posture score based only on enabled rules](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | -| [GET stats API with user that has specific access](x-pack/test/cloud_security_posture_api/routes/stats.ts) | describe | | | -| [GET stats API V1 with user with read access](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | -| [GET stats API V1 with user with read access](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | -| [GET stats API V2 with user with read access](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | -| [GET stats API V2 with user without read access](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | -| [GET /internal/cloud_security_posture/status](x-pack/test/cloud_security_posture_api/routes/status.ts) | describe | | | -| [GET status API with user that has specific access](x-pack/test/cloud_security_posture_api/routes/status.ts) | describe | | | -| [GET stats API with user with read access](x-pack/test/cloud_security_posture_api/routes/status.ts) | it | | | -| [GET status API with user without read access](x-pack/test/cloud_security_posture_api/routes/status.ts) | it | | | -| [Vulnerability Dashboard API](x-pack/test/cloud_security_posture_api/routes/vulnerabilities_dashboard.ts) | describe | | | -| [responds with a 200 status code and matching data mock](x-pack/test/cloud_security_posture_api/routes/vulnerabilities_dashboard.ts) | it | | | -| [returns a 400 error when necessary indices are nonexistent](x-pack/test/cloud_security_posture_api/routes/vulnerabilities_dashboard.ts) | it | | | -| [GET vulnerabilities dashboard API with users with read access to cloud security posture](x-pack/test/cloud_security_posture_api/routes/vulnerabilities_dashboard.ts) | it | | | -| [GET vulnerabilities dashboard API with users without read access to cloud security posture](x-pack/test/cloud_security_posture_api/routes/vulnerabilities_dashboard.ts) | it | | | -| [Verify cloud_security_posture telemetry payloads](x-pack/test/cloud_security_posture_api/telemetry/telemetry.ts) | describe | | | -| [includes only KSPM findings](x-pack/test/cloud_security_posture_api/telemetry/telemetry.ts) | it | | | -| [includes only CSPM findings](x-pack/test/cloud_security_posture_api/telemetry/telemetry.ts) | it | | | -| [includes CSPM and KSPM findings](x-pack/test/cloud_security_posture_api/telemetry/telemetry.ts) | it | | | -| [](x-pack/test/cloud_security_posture_api/telemetry/telemetry.ts) | it | | | -| [includes KSPM findings without posture_type and CSPM findings as well](x-pack/test/cloud_security_posture_api/telemetry/telemetry.ts) | it | | | -</details> - -## Directory: x-pack/test/cloud_security_posture_functional - -**Total Tests:** 223 | **Skipped:** 69 (30.94%) | **Todo:** 3 (1.35%) - -![](https://img.shields.io/badge/FTR-blue) ![](https://img.shields.io/badge/HAS-SKIP-yellow) ![](https://img.shields.io/badge/HAS-TODO-green) - -<details> -<summary>Test Details</summary> - -| Test Label | Type | Skipped | Todo | -|------------|------|---------|------| -| [Agentless cloud](x-pack/test/cloud_security_posture_functional/agentless/create_agent.ts) | describe | | | -| [should create agentless-agent](x-pack/test/cloud_security_posture_functional/agentless/create_agent.ts) | it | | | -| [should create default agent-based agent](x-pack/test/cloud_security_posture_functional/agentless/create_agent.ts) | it | | | -| [Benchmark Page - Sanity Tests](x-pack/test/cloud_security_posture_functional/cloud_tests/benchmark_sanity.ts) | describe | | | -| [Benchmark table exists](x-pack/test/cloud_security_posture_functional/cloud_tests/benchmark_sanity.ts) | it | | | -| [Benchmarks count is more than 0](x-pack/test/cloud_security_posture_functional/cloud_tests/benchmark_sanity.ts) | it | | | -| [For each benchmark, evaluation and complience are not empty](x-pack/test/cloud_security_posture_functional/cloud_tests/benchmark_sanity.ts) | it | | | -| [Cloud Posture Dashboard Page - Sanity Tests](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | describe | | | -| [Cloud Dashboard](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | describe | | | -| [displays compliance score greater than 40](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | it | | | -| [displays all compliance scores](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | it | | | -| [displays a number of resources evaluated greater than 1500](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | it | | | -| [Compliance By CIS sections have non empty values](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | it | | | -| [Navigation to Findings page](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | it | | | -| [Kubernetes Dashboard](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | describe | | | -| [displays compliance score greater than 80](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | it | | | -| [displays a number of resources evaluated greater than 150](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | it | | | -| [Compliance By CIS sections have non empty values](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | it | | | -| [Navigation to Findings page](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | it | | | -| [Findings Page - Sanity Tests](x-pack/test/cloud_security_posture_functional/cloud_tests/findings_sanity.ts) | describe | | | -| [Findings - Querying data](x-pack/test/cloud_security_posture_functional/cloud_tests/findings_sanity.ts) | describe | | | -| [Querying ${provider} provider data](x-pack/test/cloud_security_posture_functional/cloud_tests/findings_sanity.ts) | it | | | -| [Paginating and sorting data](x-pack/test/cloud_security_posture_functional/cloud_tests/findings_sanity.ts) | it | | | -| [Cloud Security Posture](x-pack/test/cloud_security_posture_functional/cloud_tests/index.ts) | describe | | | -| [Data Views](x-pack/test/cloud_security_posture_functional/data_views/data_views.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Verify data view is created once user reach the findings page - default space](x-pack/test/cloud_security_posture_functional/data_views/data_views.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Verify data view is created once user reach the dashboard page - default space](x-pack/test/cloud_security_posture_functional/data_views/data_views.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Verify data view is created once user reach the findings page - non default space](x-pack/test/cloud_security_posture_functional/data_views/data_views.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Verify data view is created once user reach the dashboard page - non default space](x-pack/test/cloud_security_posture_functional/data_views/data_views.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Verify data view is created once user with read permissions reach the dashboard page](x-pack/test/cloud_security_posture_functional/data_views/data_views.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Cloud Security Posture](x-pack/test/cloud_security_posture_functional/data_views/index.ts) | describe | | | -| [Access with custom roles](x-pack/test/cloud_security_posture_functional/pages/benchmark.ts) | describe | | | -| [Access with valid user role](x-pack/test/cloud_security_posture_functional/pages/benchmark.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Access with invalid user role](x-pack/test/cloud_security_posture_functional/pages/benchmark.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Access with custom roles - rule page](x-pack/test/cloud_security_posture_functional/pages/benchmark.ts) | describe | | | -| [Access with valid user role](x-pack/test/cloud_security_posture_functional/pages/benchmark.ts) | it | | | -| [Access with invalid user role](x-pack/test/cloud_security_posture_functional/pages/benchmark.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Test adding Cloud Security Posture Integrations CNVM](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cnvm/cis_integration_cnvm.ts) | describe | | | -| [CNVM AWS](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cnvm/cis_integration_cnvm.ts) | describe | | | -| [Hyperlink on PostInstallation Modal should have the correct URL](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cnvm/cis_integration_cnvm.ts) | it | | | -| [On Add Agent modal there should be modal that has Cloud Formation details as well as button that redirects user to Cloud formation page on AWS upon clicking them ](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cnvm/cis_integration_cnvm.ts) | it | | | -| [Clicking on Launch CloudFormation on post intall modal should lead user to Cloud Formation page](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cnvm/cis_integration_cnvm.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Test adding Cloud Security Posture Integrations CSPM AWS](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | | | -| [CIS_AWS Organization Cloud Formation](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | | | -| [Initial form state, AWS Org account, and CloudFormation should be selected by default](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | -| [Hyperlink on PostInstallation Modal should have the correct URL](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | -| [On Add Agent modal there should be modal that has Cloud Formation details as well as button that redirects user to Cloud formation page on AWS upon clicking them ](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | -| [Clicking on Launch CloudFormation on post intall modal should lead user to Cloud Formation page](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | -| [CIS_AWS Organization Manual Assume Role](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | -| [CIS_AWS Organization Manual Assume Role Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [CIS_AWS Organization Manual Direct Access](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | | | -| [CIS_AWS Organization Manual Direct Access Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | -| [CIS_AWS Organization Manual Temporary Keys](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | | | -| [CIS_AWS Organization Manual Temporary Keys Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | -| [CIS_AWS Organization Manual Shared Access](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | | | -| [CIS_AWS Organization Manual Shared Access Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | -| [CIS_AWS Single Cloud Formation](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | | | -| [CIS_AWS Single Cloud Formation workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | -| [CIS_AWS Single Manual Assume Role](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | | | -| [CIS_AWS Single Manual Assume Role Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | -| [CIS_AWS Single Manual Direct Access](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | | | -| [CIS_AWS Single Manual Direct Access Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | -| [CIS_AWS Single Manual Temporary Keys](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | | | -| [CIS_AWS Single Manual Temporary Keys Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | -| [CIS_AWS Single Manual Shared Access](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | | | -| [CIS_AWS Single Manual Shared Access Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | -| [Test adding Cloud Security Posture Integrations CSPM AZURE](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | describe | | | -| [Azure Organization ARM Template](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | describe | | | -| [Azure Organization ARM Template Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | it | | | -| [Azure Organization Manual Managed Identity](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | describe | | | -| [Azure Organization Manual Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | it | | | -| [Azure Organization Manual Service Principle with Client Secret](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | describe | | | -| [Azure Organization Manual Service Principle with Client Secret Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | it | | | -| [Azure Organization Manual Service Principle with Client Certificate](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | describe | | | -| [Azure Organization Manual Service Principle with Client Certificate Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | it | | | -| [Azure Single ARM Template](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | describe | | | -| [Azure Single ARM Template Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | it | | | -| [Azure Single Manual Managed Identity](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | describe | | | -| [Azure Single Manual Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | it | | | -| [Azure Single Manual Service Principle with Client Secret](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | describe | | | -| [Azure Single Manual Service Principle with Client Secret Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | it | | | -| [Azure Single Manual Service Principle with Client Certificate](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | describe | | | -| [Azure Single Manual Service Principle with Client Certificate Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | it | | | -| [Test adding Cloud Security Posture Integrations CSPM GCP](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | describe | | | -| [CIS_GCP Organization](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Switch between Manual and Google cloud shell](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Post Installation Google Cloud Shell modal pops up after user clicks on Save button when adding integration, when there are no Project ID or Organization ID provided, it should use default value](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Post Installation Google Cloud Shell modal pops up after user clicks on Save button when adding integration, when there are Project ID or Organization ID provided, it should use that value](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Add Agent FLyout - Post Installation Google Cloud Shell modal pops up after user clicks on Save button when adding integration, when there are Project ID or Organization ID provided, it should use that value](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Organization ID field on cloud shell command should only be shown if user chose Google Cloud Shell, if user chose Single Account it shouldn not show up](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Hyperlink on PostInstallation Modal should have the correct URL](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Clicking on Launch CloudShell on post intall modal should lead user to CloudShell page](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [CIS_GCP Organization Credentials File](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | -| [CIS_GCP Organization Credentials File workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [CIS_GCP Organization Credentials JSON](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | describe | | | -| [CIS_GCP Organization Credentials JSON workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | | | -| [CIS_GCP Single](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Post Installation Google Cloud Shell modal pops up after user clicks on Save button when adding integration, when there are no Project ID, it should use default value](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Post Installation Google Cloud Shell modal pops up after user clicks on Save button when adding integration, when there are Project ID, it should use that value](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Add Agent FLyout - Organization ID field on cloud shell command should only be shown if user chose Google Cloud Shell, if user chose Single Account it shouldn not show up](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [On add agent modal, if user chose Google Cloud Shell as their setup access; a google cloud shell modal should show up and clicking on the launch button will redirect user to Google cloud shell page](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Users are able to add CIS_GCP Integration with Manual settings using Credentials File](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Users are able to switch credentials_type from/to Credential JSON fields ](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Users are able to add CIS_GCP Integration with Manual settings using Credentials JSON](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Users are able to switch credentials_type from/to Credential File fields ](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Test adding Cloud Security Posture Integrations KSPM EKS](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts) | describe | | | -| [KSPM EKS Assume Role](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts) | describe | | | -| [KSPM EKS Assume Role workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts) | it | | | -| [KSPM EKS Direct Access](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts) | describe | | | -| [KSPM EKS Direct Access Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts) | it | | | -| [KSPM EKS Temporary Keys](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts) | describe | | | -| [KSPM EKS Temporary Keys Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts) | it | | | -| [KSPM EKS Shared Credentials](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts) | describe | | | -| [KSPM EKS Shared Credentials Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts) | it | | | -| [Test adding Cloud Security Posture Integrations KSPM K8S](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_k8s.ts) | describe | | | -| [KSPM K8S](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_k8s.ts) | describe | | | -| [KSPM K8S Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_k8s.ts) | it | | | -| [Cloud Posture Dashboard Page](x-pack/test/cloud_security_posture_functional/pages/compliance_dashboard.ts) | describe | | | -| [Kubernetes Dashboard](x-pack/test/cloud_security_posture_functional/pages/compliance_dashboard.ts) | describe | | | -| [displays accurate summary compliance score](x-pack/test/cloud_security_posture_functional/pages/compliance_dashboard.ts) | it | | | -| [TODO - Cloud Dashboard](x-pack/test/cloud_security_posture_functional/pages/compliance_dashboard.ts) | describe | | ![](https://img.shields.io/badge/todo-green) | -| [todo - displays accurate summary compliance score](x-pack/test/cloud_security_posture_functional/pages/compliance_dashboard.ts) | it | | ![](https://img.shields.io/badge/todo-green) | -| [Access with custom roles](x-pack/test/cloud_security_posture_functional/pages/compliance_dashboard.ts) | describe | | | -| [Access with valid user role](x-pack/test/cloud_security_posture_functional/pages/compliance_dashboard.ts) | it | | | -| [todo - Access with invalid user role](x-pack/test/cloud_security_posture_functional/pages/compliance_dashboard.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | ![](https://img.shields.io/badge/todo-green) | -| [Findings Page - Alerts](x-pack/test/cloud_security_posture_functional/pages/findings_alerts.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Create detection rule](x-pack/test/cloud_security_posture_functional/pages/findings_alerts.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Creates a detection rule from the Take Action button and navigates to rule page](x-pack/test/cloud_security_posture_functional/pages/findings_alerts.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Creates a detection rule from the Alerts section and navigates to rule page](x-pack/test/cloud_security_posture_functional/pages/findings_alerts.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Rule details](x-pack/test/cloud_security_posture_functional/pages/findings_alerts.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | -| [The rule page contains the expected matching data](x-pack/test/cloud_security_posture_functional/pages/findings_alerts.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Navigation](x-pack/test/cloud_security_posture_functional/pages/findings_alerts.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Clicking on count of Rules should navigate to the rules page with benchmark tags as a filter](x-pack/test/cloud_security_posture_functional/pages/findings_alerts.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Clicking on count of Alerts should navigate to the alerts page](x-pack/test/cloud_security_posture_functional/pages/findings_alerts.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Findings Page - Grouping](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | describe | | | -| [Default Grouping](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | describe | | | -| [groups findings by resource and sort by compliance score desc](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | it | | | -| [groups findings by rule name and sort by compliance score desc](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | it | | | -| [groups findings by cloud account and sort by compliance score desc](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | it | | | -| [groups findings by Kubernetes cluster and sort by compliance score desc](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | it | | | -| [SearchBar](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | describe | | | -| [add filter](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | it | | | -| [remove filter](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | it | | | -| [set search query](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | it | | | -| [Group table](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | describe | | | -| [shows findings table when expanding](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | it | | | -| [Default Grouping - support muting rules](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | describe | | | -| [groups findings by resource after muting rule](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | it | | | -| [Old Data](x-pack/test/cloud_security_posture_functional/pages/findings_old_data.ts) | describe | | | -| [Findings page with old data](x-pack/test/cloud_security_posture_functional/pages/findings_old_data.ts) | describe | | | -| [returns no Findings KSPM](x-pack/test/cloud_security_posture_functional/pages/findings_old_data.ts) | it | | | -| [returns no Findings CSPM](x-pack/test/cloud_security_posture_functional/pages/findings_old_data.ts) | it | | | -| [Findings Page onboarding](x-pack/test/cloud_security_posture_functional/pages/findings_onboarding.ts) | describe | | | -| [clicking on the ](x-pack/test/cloud_security_posture_functional/pages/findings_onboarding.ts) | it | | | -| [clicking on the ](x-pack/test/cloud_security_posture_functional/pages/findings_onboarding.ts) | it | | | -| [clicking on the ](x-pack/test/cloud_security_posture_functional/pages/findings_onboarding.ts) | it | | | -| [Findings Page - DataTable](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | describe | | | -| [Table Sort](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | describe | | | -| [sorts by a column, should be case sensitive/insensitive depending on the column](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | it | | | -| [Findings - Fields selector](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | describe | | | -| [Add fields to the Findings DataTable](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | it | | | -| [Remove fields from the Findings DataTable](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | it | | | -| [Reset fields to default](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | it | | | -| [Findings Page - support muting rules](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | describe | | | -| [verify only enabled rules appears](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | it | | | -| [Access with custom roles](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | describe | | | -| [Access with valid user role](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | it | | | -| [Access with invalid user role](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | it | | | -| [Cloud Security Posture](x-pack/test/cloud_security_posture_functional/pages/index.ts) | describe | | | -| [Cloud Posture Rules Page](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Rules Page - Rules Counters](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Shows posture score when there are findings](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Clicking the posture score button leads to the dashboard](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Shows integrations count when there are findings](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Clicking the integrations counter button leads to the integration page](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Shows the failed findings counter when there are findings](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Clicking the failed findings button leads to the findings page](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Shows the disabled rules count](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Clicking the disabled rules button shows enables the disabled filter](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Shows empty state when there are no findings](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Rules Page - Bulk Action buttons](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | -| [It should disable Enable option when there are all rules selected are already enabled ](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [It should disable both Enable and Disable options when there are no rules selected](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [It should disable Disable option when there are all rules selected are already Disabled](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Both option should not be disabled if selected rules contains both enabled and disabled rules](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Rules Page - Enable Rules and Disabled Rules Filter Toggle](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Should only display Enabled rules when Enabled Rules filter is ON](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Should only display Disabled rules when Disabled Rules filter is ON](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Rules Page - CIS Section & Rule Number filters](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Table should only show result that has the same section as in the Section filter](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Table should only show result that has the same section as in the Rule number filter](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Table should only show result that passes both Section and Rule number filter](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Rules Page - Flyout](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Users are able to Enable/Disable Rule from Switch on Rule Flyout](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Alerts section of Rules Flyout shows Disabled text when Rules are disabled](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Users are able to Enable/Disable Rule from Take Action on Rule Flyout](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Alerts section of Rules Flyout shows Detection Rule Counter component when Rules are enabled](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | -| [Vulnerabilities Page - Grouping](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | describe | | | -| [Default Grouping](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | describe | | | -| [groups vulnerabilities by cloud account and sort by number of vulnerabilities desc](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | it | | | -| [groups vulnerabilities by CVE and sort by number of vulnerabilities desc](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | it | | | -| [groups vulnerabilities by resource and sort by number of vulnerabilities desc](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | it | | | -| [SearchBar](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | describe | | | -| [add filter](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | it | | | -| [remove filter](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | it | | | -| [set search query](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | it | | | -| [Group table](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | describe | | | -| [shows vulnerabilities table when expanding](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | it | | | -| [Vulnerabilities Page - DataTable](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities.ts) | describe | | | -| [SearchBar](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities.ts) | describe | | | -| [add filter](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities.ts) | it | | | -| [remove filter](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities.ts) | it | | | -| [set search query](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities.ts) | it | | | -| [Vulnerabilities - Fields selector](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities.ts) | describe | | | -| [Add fields to the Vulnerabilities DataTable](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities.ts) | it | | | -| [Remove fields from the Vulnerabilities DataTable](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities.ts) | it | | | -| [Reset fields to default](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities.ts) | it | | | -| [Vulnerability Dashboard Page](x-pack/test/cloud_security_posture_functional/pages/vulnerability_dashboard.ts) | describe | | | -| [Vulnerability Dashboard](x-pack/test/cloud_security_posture_functional/pages/vulnerability_dashboard.ts) | describe | | | -| [Page Header renders on startup](x-pack/test/cloud_security_posture_functional/pages/vulnerability_dashboard.ts) | it | | | -| [Stats render accurate output](x-pack/test/cloud_security_posture_functional/pages/vulnerability_dashboard.ts) | it | | | -| [should navigate to vulnerability findings page with high severity filter](x-pack/test/cloud_security_posture_functional/pages/vulnerability_dashboard.ts) | it | | | -| [should navigate to vulnerability findings page with critical severity filter and no high severity filter](x-pack/test/cloud_security_posture_functional/pages/vulnerability_dashboard.ts) | it | | | -</details> - diff --git a/x-pack/plugins/cloud_security_posture/jest.config.js b/x-pack/plugins/cloud_security_posture/jest.config.js deleted file mode 100644 index 82ecbd0c85592..0000000000000 --- a/x-pack/plugins/cloud_security_posture/jest.config.js +++ /dev/null @@ -1,27 +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. - */ - -/** @type {import('@jest/types').Config.InitialOptions} */ -module.exports = { - preset: '@kbn/test', - rootDir: '../../..', - roots: ['<rootDir>/x-pack/plugins/cloud_security_posture'], - coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/cloud_security_posture', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/cloud_security_posture/{common,public,server}/**/*.{ts,tsx}', - ], - // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation - transformIgnorePatterns: [ - // ignore all node_modules except the modules below (monaco-editor, monaco-yaml, react-monaco-editor, etc) which requires babel transforms to handle dynamic import() - // since ESM modules are not natively supported in Jest yet (https://github.com/facebook/jest/issues/4842) - '[/\\\\]node_modules(?![\\/\\\\](byte-size|monaco-editor|monaco-yaml|monaco-languageserver-types|monaco-marker-data-provider|monaco-worker-manager|vscode-languageserver-types|react-monaco-editor|d3-interpolate|d3-color|langchain|langsmith|@cfworker|gpt-tokenizer|flat|@langchain|msw|@bundled-es-modules))[/\\\\].+\\.js$', - 'packages/kbn-pm/dist/index.js', - '[/\\\\]node_modules(?![\\/\\\\](langchain|langsmith|@langchain))/dist/[/\\\\].+\\.js$', - '[/\\\\]node_modules(?![\\/\\\\](langchain|langsmith|@langchain))/dist/util/[/\\\\].+\\.js$', - ], -}; diff --git a/x-pack/plugins/cloud_security_posture/public/common/navigation/types.ts b/x-pack/plugins/cloud_security_posture/public/common/navigation/types.ts deleted file mode 100644 index f436558e085d9..0000000000000 --- a/x-pack/plugins/cloud_security_posture/public/common/navigation/types.ts +++ /dev/null @@ -1,37 +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. - */ -export interface CspNavigationItem { - readonly name: string; - readonly path: string; - readonly disabled?: boolean; -} - -export interface CspPageNavigationItem extends CspNavigationItem { - id: CloudSecurityPosturePageId; -} - -export type CspPage = - | 'dashboard' - | 'cspm_dashboard' - | 'kspm_dashboard' - | 'vulnerability_dashboard' - | 'findings' - | 'benchmarks'; -export type CspBenchmarksPage = 'rules'; - -/** - * All the IDs for the cloud security posture pages. - * This needs to match the cloud security posture page entries in `SecurityPageName` in `x-pack/plugins/security_solution/common/constants.ts`. - */ -export type CloudSecurityPosturePageId = - | 'cloud_security_posture-dashboard' - | 'cloud_security_posture-cspm-dashboard' - | 'cloud_security_posture-kspm-dashboard' - | 'cloud_security_posture-vulnerability_dashboard' - | 'cloud_security_posture-findings' - | 'cloud_security_posture-benchmarks' - | 'cloud_security_posture-benchmarks-rules'; diff --git a/x-pack/plugins/cloud_security_posture/server/routes/graph/v1.ts b/x-pack/plugins/cloud_security_posture/server/routes/graph/v1.ts deleted file mode 100644 index b14a2ba3e06a9..0000000000000 --- a/x-pack/plugins/cloud_security_posture/server/routes/graph/v1.ts +++ /dev/null @@ -1,424 +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 { castArray } from 'lodash'; -import { v4 as uuidv4 } from 'uuid'; -import type { Logger, IScopedClusterClient } from '@kbn/core/server'; -import { ApiMessageCode } from '@kbn/cloud-security-posture-common/types/graph/latest'; -import type { - Color, - EdgeDataModel, - EntityNodeDataModel, - GraphRequest, - GraphResponse, - GroupNodeDataModel, - LabelNodeDataModel, - NodeDataModel, -} from '@kbn/cloud-security-posture-common/types/graph/v1'; -import type { EsqlToRecords } from '@elastic/elasticsearch/lib/helpers'; -import type { Writable } from '@kbn/utility-types'; - -type EsQuery = GraphRequest['query']['esQuery']; - -interface GraphEdge { - badge: number; - ips?: string[] | string; - hosts?: string[] | string; - users?: string[] | string; - actorIds: string[] | string; - action: string; - targetIds: string[] | string; - eventOutcome: string; - isAlert: boolean; -} - -interface LabelEdges { - source: string; - target: string; -} - -interface GraphContextServices { - logger: Logger; - esClient: IScopedClusterClient; -} - -interface GetGraphParams { - services: GraphContextServices; - query: { - eventIds: string[]; - spaceId?: string; - start: string | number; - end: string | number; - esQuery?: EsQuery; - }; - showUnknownTarget: boolean; - nodesLimit?: number; -} - -export const getGraph = async ({ - services: { esClient, logger }, - query: { eventIds, spaceId = 'default', start, end, esQuery }, - showUnknownTarget, - nodesLimit, -}: GetGraphParams): Promise<Pick<GraphResponse, 'nodes' | 'edges' | 'messages'>> => { - logger.trace(`Fetching graph for [eventIds: ${eventIds.join(', ')}] in [spaceId: ${spaceId}]`); - - const results = await fetchGraph({ - esClient, - showUnknownTarget, - logger, - start, - end, - eventIds, - esQuery, - }); - - // Convert results into set of nodes and edges - return parseRecords(logger, results.records, nodesLimit); -}; - -interface ParseContext { - readonly nodesLimit?: number; - readonly nodesMap: Record<string, NodeDataModel>; - readonly edgesMap: Record<string, EdgeDataModel>; - readonly edgeLabelsNodes: Record<string, string[]>; - readonly labelEdges: Record<string, LabelEdges>; - readonly messages: ApiMessageCode[]; - readonly logger: Logger; -} - -const parseRecords = ( - logger: Logger, - records: GraphEdge[], - nodesLimit?: number -): Pick<GraphResponse, 'nodes' | 'edges' | 'messages'> => { - const ctx: ParseContext = { - nodesLimit, - logger, - nodesMap: {}, - edgeLabelsNodes: {}, - edgesMap: {}, - labelEdges: {}, - messages: [], - }; - - logger.trace(`Parsing records [length: ${records.length}] [nodesLimit: ${nodesLimit ?? 'none'}]`); - - createNodes(records, ctx); - createEdgesAndGroups(ctx); - - logger.trace( - `Parsed [nodes: ${Object.keys(ctx.nodesMap).length}, edges: ${ - Object.keys(ctx.edgesMap).length - }]` - ); - - // Sort groups to be first (fixes minor layout issue) - const nodes = sortNodes(ctx.nodesMap); - - return { - nodes, - edges: Object.values(ctx.edgesMap), - messages: ctx.messages.length > 0 ? ctx.messages : undefined, - }; -}; - -const fetchGraph = async ({ - esClient, - logger, - start, - end, - eventIds, - showUnknownTarget, - esQuery, -}: { - esClient: IScopedClusterClient; - logger: Logger; - start: string | number; - end: string | number; - eventIds: string[]; - showUnknownTarget: boolean; - esQuery?: EsQuery; -}): Promise<EsqlToRecords<GraphEdge>> => { - const query = `from logs-* -| WHERE event.action IS NOT NULL AND actor.entity.id IS NOT NULL -| EVAL isAlert = ${ - eventIds.length > 0 - ? `event.id in (${eventIds.map((_id, idx) => `?al_id${idx}`).join(', ')})` - : 'false' - } -| STATS badge = COUNT(*), - ips = VALUES(related.ip), - // hosts = VALUES(related.hosts), - users = VALUES(related.user) - by actorIds = actor.entity.id, - action = event.action, - targetIds = target.entity.id, - eventOutcome = event.outcome, - isAlert -| LIMIT 1000 -| SORT isAlert DESC`; - - logger.trace(`Executing query [${query}]`); - - return await esClient.asCurrentUser.helpers - .esql({ - columnar: false, - filter: buildDslFilter(eventIds, showUnknownTarget, start, end, esQuery), - query, - // @ts-ignore - types are not up to date - params: [...eventIds.map((id, idx) => ({ [`al_id${idx}`]: id }))], - }) - .toRecords<GraphEdge>(); -}; - -const buildDslFilter = ( - eventIds: string[], - showUnknownTarget: boolean, - start: string | number, - end: string | number, - esQuery?: EsQuery -) => ({ - bool: { - filter: [ - { - range: { - '@timestamp': { - gte: start, - lte: end, - }, - }, - }, - ...(showUnknownTarget - ? [] - : [ - { - exists: { - field: 'target.entity.id', - }, - }, - ]), - { - bool: { - should: [ - ...(esQuery?.bool.filter?.length || - esQuery?.bool.must?.length || - esQuery?.bool.should?.length || - esQuery?.bool.must_not?.length - ? [esQuery] - : []), - { - terms: { - 'event.id': eventIds, - }, - }, - ], - minimum_should_match: 1, - }, - }, - ], - }, -}); - -const createNodes = (records: GraphEdge[], context: Omit<ParseContext, 'edgesMap'>) => { - const { nodesMap, edgeLabelsNodes, labelEdges } = context; - - for (const record of records) { - if (context.nodesLimit !== undefined && Object.keys(nodesMap).length >= context.nodesLimit) { - context.logger.debug( - `Reached nodes limit [limit: ${context.nodesLimit}] [current: ${ - Object.keys(nodesMap).length - }]` - ); - context.messages.push(ApiMessageCode.ReachedNodesLimit); - break; - } - - const { ips, hosts, users, actorIds, action, targetIds, isAlert, eventOutcome } = record; - const actorIdsArray = castArray(actorIds); - const targetIdsArray = castArray(targetIds); - const unknownTargets: string[] = []; - - // Ensure all targets has an id (target can return null from the query) - targetIdsArray.forEach((id, idx) => { - if (!id) { - targetIdsArray[idx] = `unknown ${uuidv4()}`; - unknownTargets.push(targetIdsArray[idx]); - } - }); - - // Create entity nodes - [...actorIdsArray, ...targetIdsArray].forEach((id) => { - if (nodesMap[id] === undefined) { - nodesMap[id] = { - id, - label: unknownTargets.includes(id) ? 'Unknown' : undefined, - color: isAlert ? 'danger' : 'primary', - ...determineEntityNodeShape( - id, - castArray(ips ?? []), - castArray(hosts ?? []), - castArray(users ?? []) - ), - }; - } - }); - - // Create label nodes - for (const actorId of actorIdsArray) { - for (const targetId of targetIdsArray) { - const edgeId = `a(${actorId})-b(${targetId})`; - - if (edgeLabelsNodes[edgeId] === undefined) { - edgeLabelsNodes[edgeId] = []; - } - - const labelNode: LabelNodeDataModel = { - id: edgeId + `label(${action})outcome(${eventOutcome})`, - label: action, - color: isAlert ? 'danger' : eventOutcome === 'failed' ? 'warning' : 'primary', - shape: 'label', - }; - - nodesMap[labelNode.id] = labelNode; - edgeLabelsNodes[edgeId].push(labelNode.id); - labelEdges[labelNode.id] = { source: actorId, target: targetId }; - } - } - } -}; - -const determineEntityNodeShape = ( - actorId: string, - ips: string[], - hosts: string[], - users: string[] -): { - shape: EntityNodeDataModel['shape']; - icon: string; -} => { - // If actor is a user return ellipse - if (users.includes(actorId)) { - return { shape: 'ellipse', icon: 'user' }; - } - - // If actor is a host return hexagon - if (hosts.includes(actorId)) { - return { shape: 'hexagon', icon: 'storage' }; - } - - // If actor is an IP return diamond - if (ips.includes(actorId)) { - return { shape: 'diamond', icon: 'globe' }; - } - - return { shape: 'hexagon', icon: 'questionInCircle' }; -}; - -const sortNodes = (nodesMap: Record<string, NodeDataModel>) => { - const groupNodes = []; - const otherNodes = []; - - for (const node of Object.values(nodesMap)) { - if (node.shape === 'group') { - groupNodes.push(node); - } else { - otherNodes.push(node); - } - } - - return [...groupNodes, ...otherNodes]; -}; - -const createEdgesAndGroups = (context: ParseContext) => { - const { edgeLabelsNodes, edgesMap, nodesMap, labelEdges } = context; - - Object.entries(edgeLabelsNodes).forEach(([edgeId, edgeLabelsIds]) => { - // When there's more than one edge label, create a group node - if (edgeLabelsIds.length === 1) { - const edgeLabelId = edgeLabelsIds[0]; - - connectEntitiesAndLabelNode( - edgesMap, - nodesMap, - labelEdges[edgeLabelId].source, - edgeLabelId, - labelEdges[edgeLabelId].target - ); - } else { - const groupNode: GroupNodeDataModel = { - id: `grp(${edgeId})`, - shape: 'group', - }; - nodesMap[groupNode.id] = groupNode; - let groupEdgesColor: Color = 'primary'; - - edgeLabelsIds.forEach((edgeLabelId) => { - (nodesMap[edgeLabelId] as Writable<LabelNodeDataModel>).parentId = groupNode.id; - connectEntitiesAndLabelNode(edgesMap, nodesMap, groupNode.id, edgeLabelId, groupNode.id); - - if ((nodesMap[edgeLabelId] as LabelNodeDataModel).color === 'danger') { - groupEdgesColor = 'danger'; - } else if ( - (nodesMap[edgeLabelId] as LabelNodeDataModel).color === 'warning' && - groupEdgesColor !== 'danger' - ) { - // Use warning only if there's no danger color - groupEdgesColor = 'warning'; - } - }); - - connectEntitiesAndLabelNode( - edgesMap, - nodesMap, - labelEdges[edgeLabelsIds[0]].source, - groupNode.id, - labelEdges[edgeLabelsIds[0]].target, - groupEdgesColor - ); - } - }); -}; - -const connectEntitiesAndLabelNode = ( - edgesMap: Record<string, EdgeDataModel>, - nodesMap: Record<string, NodeDataModel>, - sourceNodeId: string, - labelNodeId: string, - targetNodeId: string, - colorOverride?: Color -) => { - [ - connectNodes(nodesMap, sourceNodeId, labelNodeId, colorOverride), - connectNodes(nodesMap, labelNodeId, targetNodeId, colorOverride), - ].forEach((edge) => { - edgesMap[edge.id] = edge; - }); -}; - -const connectNodes = ( - nodesMap: Record<string, NodeDataModel>, - sourceNodeId: string, - targetNodeId: string, - colorOverride?: Color -): EdgeDataModel => { - const sourceNode = nodesMap[sourceNodeId]; - const targetNode = nodesMap[targetNodeId]; - const color = - sourceNode.shape !== 'group' && targetNode.shape !== 'label' - ? sourceNode.color - : targetNode.shape !== 'group' - ? targetNode.color - : 'primary'; - - return { - id: `a(${sourceNodeId})-b(${targetNodeId})`, - source: sourceNodeId, - target: targetNodeId, - color: colorOverride ?? color, - }; -}; diff --git a/x-pack/plugins/cloud_security_posture/tsconfig.json b/x-pack/plugins/cloud_security_posture/tsconfig.json deleted file mode 100755 index f3883e0fc43c6..0000000000000 --- a/x-pack/plugins/cloud_security_posture/tsconfig.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - "scripts/**/*", - // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 - "server/**/*.json", - "public/**/*.json", - "../../../typings/**/*" - ], - "kbn_references": [ - "@kbn/core", - "@kbn/data-plugin", - "@kbn/fleet-plugin", - "@kbn/fleet-plugin", - "@kbn/task-manager-plugin", - "@kbn/security-plugin", - "@kbn/config-schema", - "@kbn/licensing-plugin", - "@kbn/kibana-react-plugin", - "@kbn/shared-ux-link-redirect-app", - "@kbn/usage-collection-plugin", - "@kbn/cloud-plugin", - "@kbn/unified-search-plugin", - "@kbn/charts-plugin", - "@kbn/discover-plugin", - "@kbn/i18n", - "@kbn/ui-theme", - "@kbn/i18n-react", - "@kbn/es-query", - "@kbn/data-views-plugin", - "@kbn/std", - "@kbn/monaco", - "@kbn/utility-types", - "@kbn/core-logging-server-mocks", - "@kbn/securitysolution-es-utils", - "@kbn/core-elasticsearch-client-server-mocks", - "@kbn/core-elasticsearch-server", - "@kbn/core-saved-objects-api-server", - "@kbn/shared-ux-router", - "@kbn/core-saved-objects-server", - "@kbn/share-plugin", - "@kbn/core-http-server", - "@kbn/core-http-browser", - "@kbn/discover-utils", - "@kbn/unified-data-table", - "@kbn/cell-actions", - "@kbn/unified-field-list", - "@kbn/unified-doc-viewer", - "@kbn/kibana-utils-plugin", - "@kbn/ui-actions-plugin", - "@kbn/core-http-server-mocks", - "@kbn/data-view-field-editor-plugin", - "@kbn/grouping", - "@kbn/alerting-plugin", - "@kbn/code-editor", - "@kbn/code-editor-mock", - "@kbn/search-types", - "@kbn/react-kibana-mount", - "@kbn/spaces-plugin", - "@kbn/cloud-security-posture-common", - "@kbn/cloud-security-posture", - "@kbn/analytics", - ], - "exclude": ["target/**/*"] -} diff --git a/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts b/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts index 0f5a12d862d7e..c8e775ab4db6c 100644 --- a/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts +++ b/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts @@ -7,15 +7,10 @@ import { coreMock } from '@kbn/core/public/mocks'; import { DataView } from '@kbn/data-views-plugin/common'; import { DiscoverAppLocator } from '@kbn/discover-plugin/common'; -import { ViewMode } from '@kbn/embeddable-plugin/public'; import type { Filter, RangeFilter } from '@kbn/es-query'; import { i18n } from '@kbn/i18n'; -import { ViewMode as ViewModeType } from '@kbn/presentation-publishing'; +import { ViewMode } from '@kbn/presentation-publishing'; import { sharePluginMock } from '@kbn/share-plugin/public/mocks'; -import { - VisualizeEmbeddableContract, - VISUALIZE_EMBEDDABLE_TYPE, -} from '@kbn/visualizations-plugin/public'; import { BehaviorSubject } from 'rxjs'; import { Params, PluginDeps } from './abstract_explore_data_action'; import { ExploreDataChartAction, ExploreDataChartActionContext } from './explore_data_chart_action'; @@ -70,18 +65,18 @@ const setup = ( }; const action = new ExploreDataChartAction(params); - const embeddable: VisualizeEmbeddableContract = { - type: VISUALIZE_EMBEDDABLE_TYPE, - dataViews: new BehaviorSubject([ + const embeddable = { + type: 'anyEmbeddable', + dataViews: new BehaviorSubject<undefined | DataView[]>([ { id: 'index-ptr-foo', - }, + } as DataView, ]), - filters$: new BehaviorSubject([]), + filters$: new BehaviorSubject<Filter[]>([]), parentApi: { - viewMode: new BehaviorSubject(ViewMode.VIEW), + viewMode: new BehaviorSubject<ViewMode>('view'), }, - } as unknown as VisualizeEmbeddableContract; + }; const context = { filters, @@ -138,11 +133,11 @@ describe('"Explore underlying data" panel action', () => { embeddable.dataViews = new BehaviorSubject<undefined | DataView[]>([ { id: 'index-ptr-foo', - }, + } as DataView, { id: 'index-ptr-bar', - }, - ] as any as DataView[]); + } as DataView, + ]); const isCompatible = await action.isCompatible(context); @@ -171,7 +166,7 @@ describe('"Explore underlying data" panel action', () => { test('returns false if dashboard is in edit mode', async () => { const { action, embeddable, context } = setup(); if (embeddable.parentApi) { - embeddable.parentApi.viewMode = new BehaviorSubject<ViewModeType>(ViewMode.EDIT); + embeddable.parentApi.viewMode = new BehaviorSubject<ViewMode>('edit'); } const isCompatible = await action.isCompatible(context); diff --git a/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.test.ts b/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.test.ts index d2b84b6ddb7bf..abe0776d57f5f 100644 --- a/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.test.ts +++ b/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.test.ts @@ -8,14 +8,9 @@ import { coreMock } from '@kbn/core/public/mocks'; import { DataView } from '@kbn/data-views-plugin/common'; import { DiscoverAppLocator } from '@kbn/discover-plugin/common'; -import { ViewMode } from '@kbn/embeddable-plugin/public'; import { i18n } from '@kbn/i18n'; -import { ViewMode as ViewModeType } from '@kbn/presentation-publishing'; +import { ViewMode } from '@kbn/presentation-publishing'; import { sharePluginMock } from '@kbn/share-plugin/public/mocks'; -import { - VisualizeEmbeddableContract, - VISUALIZE_EMBEDDABLE_TYPE, -} from '@kbn/visualizations-plugin/public'; import { BehaviorSubject } from 'rxjs'; import { Params, PluginDeps } from './abstract_explore_data_action'; import { ExploreDataContextMenuAction } from './explore_data_context_menu_action'; @@ -60,18 +55,17 @@ const setup = () => { }; const action = new ExploreDataContextMenuAction(params); - const embeddable: VisualizeEmbeddableContract = { - type: VISUALIZE_EMBEDDABLE_TYPE, - dataViews: new BehaviorSubject([ + const embeddable = { + type: 'anyEmbeddable', + dataViews: new BehaviorSubject<undefined | DataView[]>([ { id: 'index-ptr-foo', - }, + } as DataView, ]), parentApi: { - viewMode: new BehaviorSubject(ViewMode.VIEW), - localFilters: new BehaviorSubject([]), + viewMode: new BehaviorSubject<ViewMode>('view'), }, - } as unknown as VisualizeEmbeddableContract; + }; const context = { embeddable, @@ -126,11 +120,11 @@ describe('"Explore underlying data" panel action', () => { embeddable.dataViews = new BehaviorSubject<undefined | DataView[]>([ { id: 'index-ptr-foo', - }, + } as DataView, { id: 'index-ptr-bar', - }, - ] as any as DataView[]); + } as DataView, + ]); const isCompatible = await action.isCompatible(context); @@ -159,7 +153,7 @@ describe('"Explore underlying data" panel action', () => { test('returns false if dashboard is in edit mode', async () => { const { action, embeddable, context } = setup(); if (embeddable.parentApi) { - embeddable.parentApi.viewMode = new BehaviorSubject<ViewModeType>(ViewMode.EDIT); + embeddable.parentApi.viewMode = new BehaviorSubject<ViewMode>('edit'); } const isCompatible = await action.isCompatible(context); diff --git a/x-pack/plugins/discover_enhanced/tsconfig.json b/x-pack/plugins/discover_enhanced/tsconfig.json index 6839f4c2c18e1..79dad79381e97 100644 --- a/x-pack/plugins/discover_enhanced/tsconfig.json +++ b/x-pack/plugins/discover_enhanced/tsconfig.json @@ -13,7 +13,6 @@ "@kbn/lens-plugin", "@kbn/usage-collection-plugin", "@kbn/embeddable-plugin", - "@kbn/visualizations-plugin", "@kbn/ui-actions-plugin", "@kbn/i18n", "@kbn/es-query", diff --git a/x-pack/plugins/enterprise_search/common/constants.ts b/x-pack/plugins/enterprise_search/common/constants.ts index 638e292ff0e25..8e69b80564802 100644 --- a/x-pack/plugins/enterprise_search/common/constants.ts +++ b/x-pack/plugins/enterprise_search/common/constants.ts @@ -235,7 +235,7 @@ export const ENTERPRISE_SEARCH_DOCUMENTS_DEFAULT_DOC_COUNT = 25; export const ENTERPRISE_SEARCH_CONNECTOR_CRAWLER_SERVICE_TYPE = 'elastic-crawler'; -export const DEFAULT_PIPELINE_NAME = 'ent-search-generic-ingestion'; +export const DEFAULT_PIPELINE_NAME = 'search-default-ingestion'; export const DEFAULT_PIPELINE_VALUES: IngestPipelineParams = { extract_binary_content: true, name: DEFAULT_PIPELINE_NAME, diff --git a/x-pack/plugins/enterprise_search/common/types/index.ts b/x-pack/plugins/enterprise_search/common/types/index.ts index 1d9fb9b2cb0c1..364008ef18b49 100644 --- a/x-pack/plugins/enterprise_search/common/types/index.ts +++ b/x-pack/plugins/enterprise_search/common/types/index.ts @@ -62,7 +62,6 @@ export interface Meta { } export interface ClientConfigType { - canDeployEntSearch: boolean; host?: string; ui: { enabled: boolean; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/crawler_domain_detail/authentication_panel/authentication_panel_actions.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/crawler_domain_detail/authentication_panel/authentication_panel_actions.tsx index ba6e9d2c19316..49d15c041f145 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/crawler_domain_detail/authentication_panel/authentication_panel_actions.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/crawler_domain_detail/authentication_panel/authentication_panel_actions.tsx @@ -61,7 +61,7 @@ export const AuthenticationPanelActions: React.FC = () => { ) : currentAuth === null ? ( <EuiButton data-telemetry-id="entSearchContent-crawler-domainDetail-authentication-addCredentials" - color="success" + color="primary" iconType="plusInCircle" size="s" onClick={() => enableEditing(currentAuth)} diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/domain_management/domains_panel.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/domain_management/domains_panel.tsx index 41af7db78b6be..60f2e52211972 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/domain_management/domains_panel.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/crawler/domain_management/domains_panel.tsx @@ -47,7 +47,7 @@ export const DomainsPanel: React.FC = () => { data-telemetry-id="entSearchContent-crawler-domainManagement-addDomain-addDomain" onClick={openFlyout} size="s" - color="success" + color="primary" iconType="plusInCircle" > {i18n.translate('xpack.enterpriseSearch.crawler.addDomainFlyout.openButtonLabel', { diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_button.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_button.tsx index 1f8bc30e2903c..c7c296a443ebf 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_button.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/add_ml_inference_button.tsx @@ -79,7 +79,7 @@ const AddButton: React.FC<{ <EuiButton fullWidth data-telemetry-id={`entSearchContent-${ingestionMethod}-pipelines-addInferencePipeline`} - color={disabled ? undefined : 'success'} + color={disabled ? undefined : 'primary'} disabled={disabled} iconType={disabled ? 'lock' : 'plusInCircle'} onClick={onClick} diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/text_expansion_callout/deploy_model.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/text_expansion_callout/deploy_model.tsx index 018ee27500949..c666b5f5adaf6 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/text_expansion_callout/deploy_model.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/ml_inference/text_expansion_callout/deploy_model.tsx @@ -38,12 +38,12 @@ export const DeployModel = ({ const { createTextExpansionModel } = useActions(TextExpansionCalloutLogic); return ( - <EuiCallOut color="success"> + <EuiCallOut color="primary"> <EuiFlexGroup direction="column" gutterSize="s"> <EuiFlexItem> <EuiFlexGroup direction="row" gutterSize="s" alignItems="center"> <EuiFlexItem grow={false}> - <EuiBadge color="success"> + <EuiBadge color="primary"> <FormattedMessage id="xpack.enterpriseSearch.content.index.pipelines.textExpansionCallOut.titleBadge" defaultMessage="New" @@ -51,7 +51,7 @@ export const DeployModel = ({ </EuiBadge> </EuiFlexItem> <EuiFlexItem grow> - <EuiText color="success" size="xs"> + <EuiText color="primary" size="xs"> <h3> {i18n.translate( 'xpack.enterpriseSearch.content.index.pipelines.textExpansionCallOut.title', @@ -87,7 +87,7 @@ export const DeployModel = ({ > <EuiFlexItem grow={false}> <EuiButton - color="success" + color="primary" data-telemetry-id={`entSearchContent-${ingestionMethod}-pipelines-textExpansionCallOut-deployModel`} disabled={isCreateButtonDisabled} iconType="launch" 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 40b7c9596cb3a..4ea807262d20b 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 @@ -190,7 +190,7 @@ export const SearchIndexPipelines: React.FC = () => { hasIndexIngestionPipeline ? ( <EuiFlexGroup alignItems="center" gutterSize="xs" justifyContent="center"> <EuiFlexItem grow={false}> - <EuiBadge color="success"> + <EuiBadge color="accent"> {i18n.translate( 'xpack.enterpriseSearch.content.indices.pipelines.ingestionPipeline.customBadge', { defaultMessage: 'Custom' } diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.test.ts index 6fbeffd30b714..367cf8631676f 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_json_configurations_logic.test.ts @@ -53,7 +53,7 @@ describe('IndexPipelinesConfigurationsLogic', () => { }); it('fetchIndexPipelinesDataSuccess selects index ingest pipeline if found', async () => { const pipelines = { - 'ent-search-generic-ingest': { + 'search-default-ingest': { version: 1, }, [indexName]: { @@ -68,7 +68,7 @@ describe('IndexPipelinesConfigurationsLogic', () => { }); it('fetchIndexPipelinesDataSuccess selects first pipeline as default pipeline', async () => { const pipelines = { - 'ent-search-generic-ingest': { + 'search-default-ingest': { version: 1, }, }; @@ -76,7 +76,7 @@ describe('IndexPipelinesConfigurationsLogic', () => { await nextTick(); expect(IndexPipelinesConfigurationsLogic.values.selectedPipelineId).toEqual( - 'ent-search-generic-ingest' + 'search-default-ingest' ); }); }); @@ -84,7 +84,7 @@ describe('IndexPipelinesConfigurationsLogic', () => { describe('selectors', () => { it('pipelineNames returns names of pipelines', async () => { const pipelines = { - 'ent-search-generic-ingest': { + 'search-default-ingest': { version: 1, }, [indexName]: { @@ -96,13 +96,13 @@ describe('IndexPipelinesConfigurationsLogic', () => { await nextTick(); expect(IndexPipelinesConfigurationsLogic.values.pipelineNames).toEqual([ - 'ent-search-generic-ingest', + 'search-default-ingest', indexName, ]); }); it('selectedPipeline returns full pipeline', async () => { const pipelines = { - 'ent-search-generic-ingest': { + 'search-default-ingest': { version: 1, }, foo: { diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_logic.test.ts index bacde5895073e..597b22f15049f 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/search_index/pipelines/pipelines_logic.test.ts @@ -21,7 +21,7 @@ import { PipelinesLogic } from './pipelines_logic'; const DEFAULT_PIPELINE_VALUES = { extract_binary_content: true, - name: 'ent-search-generic-ingestion', + name: 'search-default-ingestion', reduce_whitespace: true, run_ml_inference: true, }; diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/header_actions/syncs_context_menu.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/header_actions/syncs_context_menu.tsx index bdae6e0e2853c..b0c887a4c2228 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/header_actions/syncs_context_menu.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/header_actions/syncs_context_menu.tsx @@ -80,9 +80,7 @@ export const SyncsContextMenu: React.FC<SyncsContextMenuProps> = ({ disabled = f const shouldShowIncrementalSync = productFeatures.hasIncrementalSyncEnabled && hasIncrementalSyncFeature; - const isEnterpriseSearchNotAvailable = Boolean( - config.host && config.canDeployEntSearch && errorConnectingMessage - ); + const isEnterpriseSearchNotAvailable = Boolean(config.host && errorConnectingMessage); const isSyncsDisabled = (connector?.is_native && isEnterpriseSearchNotAvailable) || ingestionStatus === IngestionStatus.INCOMPLETE || diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/header_actions/syncs_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/header_actions/syncs_logic.test.ts index 5406622ff9f3c..88f1f2663a951 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/header_actions/syncs_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/shared/header_actions/syncs_logic.test.ts @@ -126,7 +126,7 @@ const mockConnector: Connector = { name: 'test', pipeline: { extract_binary_content: true, - name: 'ent-search-generic-ingestion', + name: 'search-default-ingestion', reduce_whitespace: true, run_ml_inference: true, }, diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/index.test.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/index.test.tsx index a32062256eec5..dbbc6a746ee51 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/index.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/index.test.tsx @@ -29,20 +29,13 @@ describe('EnterpriseSearchContent', () => { it('renders EnterpriseSearchContentConfigured when config.host is set & available', () => { setMockValues({ - config: { canDeployEntSearch: true, host: 'some.url' }, + config: { host: 'some.url' }, errorConnectingMessage: '', }); const wrapper = shallow(<EnterpriseSearchContent />); expect(wrapper.find(EnterpriseSearchContentConfigured)).toHaveLength(1); }); - - it('renders EnterpriseSearchContentConfigured when config.host is not set & Ent Search cannot be deployed', () => { - setMockValues({ config: { canDeployEntSearch: false, host: '' }, errorConnectingMessage: '' }); - const wrapper = shallow(<EnterpriseSearchContent />); - - expect(wrapper.find(EnterpriseSearchContentConfigured)).toHaveLength(1); - }); }); describe('EnterpriseSearchContentConfigured', () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/enterprise_search_product_card.test.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/enterprise_search_product_card.test.tsx index 74be43ab32253..b1c0394e80235 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/enterprise_search_product_card.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/enterprise_search_product_card.test.tsx @@ -17,7 +17,7 @@ import { WorkplaceSearchProductCard } from './workplace_search_product_card'; describe('EnterpriseSearchProductCard', () => { beforeEach(() => { - setMockValues({ config: { canDeployEntSearch: true, host: 'localhost' } }); + setMockValues({ config: { host: 'localhost' } }); }); it('renders both services with access', () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.test.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.test.tsx index 3718a495cd17b..b8f7ba1d354d5 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_overview/components/product_selector/product_selector.test.tsx @@ -19,14 +19,14 @@ import { ProductSelector } from '.'; describe('ProductSelector', () => { it('renders the overview page, product cards, & setup guide CTAs with no host set', () => { - setMockValues({ config: { canDeployEntSearch: true, host: '' } }); + setMockValues({ config: { host: '' } }); const wrapper = shallow(<ProductSelector />); expect(wrapper.find(ElasticsearchProductCard)).toHaveLength(1); }); it('renders the trial callout', () => { - setMockValues({ config: { canDeployEntSearch: true, host: 'localhost' } }); + setMockValues({ config: { host: 'localhost' } }); const wrapper = shallow(<ProductSelector />); expect(wrapper.find(TrialCallout)).toHaveLength(1); @@ -34,7 +34,7 @@ describe('ProductSelector', () => { describe('access checks when host is set', () => { beforeEach(() => { - setMockValues({ config: { canDeployEntSearch: true, host: 'localhost' } }); + setMockValues({ config: { host: 'localhost' } }); }); it('does not render the Setup CTA when there is a host', () => { diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/search_labs_banner/search_labs_banner.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/search_labs_banner/search_labs_banner.tsx index d9f1be314a56e..a1b3302cd35a8 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/search_labs_banner/search_labs_banner.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/search_labs_banner/search_labs_banner.tsx @@ -36,10 +36,11 @@ export const SearchLabsBanner: React.FC = () => { <EuiPanel hasBorder hasShadow - color="success" + color="accentSecondary" css={css` background-image: url(${backgroundImagePath}); background-repeat: no-repeat; + background-size: cover; `} > <SearchLabsLogo diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/inline_editable_table.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/inline_editable_table.tsx index d14acc91ac581..df53a0dc26a39 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/inline_editable_table.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/tables/inline_editable_table/inline_editable_table.tsx @@ -140,7 +140,7 @@ export const InlineEditableTableContents = <Item extends ItemWithAnID>({ iconType="plusInCircle" disabled={isEditing} onClick={editNewItem} - color="success" + color="primary" data-test-subj="inlineEditableTableActionButton" > {addButtonText || diff --git a/x-pack/plugins/enterprise_search/public/applications/test_helpers/test_utils.test_helper.tsx b/x-pack/plugins/enterprise_search/public/applications/test_helpers/test_utils.test_helper.tsx index e046bfa904e55..13694a3f7db64 100644 --- a/x-pack/plugins/enterprise_search/public/applications/test_helpers/test_utils.test_helper.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/test_helpers/test_utils.test_helper.tsx @@ -44,7 +44,6 @@ export const mockKibanaProps: KibanaLogicProps = { isCloudEnabled: false, }, config: { - canDeployEntSearch: true, host: 'http://localhost:3002', ui: { enabled: true, diff --git a/x-pack/plugins/enterprise_search/public/applications/vector_search/components/dev_tools_console_code_block/dev_tools_console_code_block.tsx b/x-pack/plugins/enterprise_search/public/applications/vector_search/components/dev_tools_console_code_block/dev_tools_console_code_block.tsx index d48011d54cdff..46a60456be7cc 100644 --- a/x-pack/plugins/enterprise_search/public/applications/vector_search/components/dev_tools_console_code_block/dev_tools_console_code_block.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/vector_search/components/dev_tools_console_code_block/dev_tools_console_code_block.tsx @@ -39,7 +39,7 @@ export const DevToolsConsoleCodeBlock: React.FC<DevToolsConsoleCodeBlockProps> = return ( <EuiThemeProvider colorMode="dark"> - <EuiPanel hasShadow={false}> + <EuiPanel hasShadow={false} hasBorder> <EuiFlexGroup direction="column" gutterSize="xs"> <EuiFlexGroup direction="rowReverse" diff --git a/x-pack/plugins/enterprise_search/public/plugin.ts b/x-pack/plugins/enterprise_search/public/plugin.ts index 0f90f60d29749..0a472cd2aa564 100644 --- a/x-pack/plugins/enterprise_search/public/plugin.ts +++ b/x-pack/plugins/enterprise_search/public/plugin.ts @@ -441,55 +441,53 @@ export class EnterpriseSearchPlugin implements Plugin { registerLocators(share!); - if (config.canDeployEntSearch) { - core.application.register({ - appRoute: APP_SEARCH_PLUGIN.URL, - category: DEFAULT_APP_CATEGORIES.enterpriseSearch, - deepLinks: appSearchLinks, - euiIconType: ENTERPRISE_SEARCH_OVERVIEW_PLUGIN.LOGO, - id: APP_SEARCH_PLUGIN.ID, - mount: async (params: AppMountParameters) => { - const kibanaDeps = await this.getKibanaDeps(core, params, cloud); - const { chrome, http } = kibanaDeps.core; - chrome.docTitle.change(APP_SEARCH_PLUGIN.NAME); + core.application.register({ + appRoute: APP_SEARCH_PLUGIN.URL, + category: DEFAULT_APP_CATEGORIES.enterpriseSearch, + deepLinks: appSearchLinks, + euiIconType: ENTERPRISE_SEARCH_OVERVIEW_PLUGIN.LOGO, + id: APP_SEARCH_PLUGIN.ID, + mount: async (params: AppMountParameters) => { + const kibanaDeps = await this.getKibanaDeps(core, params, cloud); + const { chrome, http } = kibanaDeps.core; + chrome.docTitle.change(APP_SEARCH_PLUGIN.NAME); - await this.getInitialData(http); - const pluginData = this.getPluginData(); + await this.getInitialData(http); + const pluginData = this.getPluginData(); - const { renderApp } = await import('./applications'); - const { AppSearch } = await import('./applications/app_search'); + const { renderApp } = await import('./applications'); + const { AppSearch } = await import('./applications/app_search'); - return renderApp(AppSearch, kibanaDeps, pluginData); - }, - title: APP_SEARCH_PLUGIN.NAME, - visibleIn: [], - }); + return renderApp(AppSearch, kibanaDeps, pluginData); + }, + title: APP_SEARCH_PLUGIN.NAME, + visibleIn: [], + }); - core.application.register({ - appRoute: WORKPLACE_SEARCH_PLUGIN.URL, - category: DEFAULT_APP_CATEGORIES.enterpriseSearch, - euiIconType: ENTERPRISE_SEARCH_OVERVIEW_PLUGIN.LOGO, - id: WORKPLACE_SEARCH_PLUGIN.ID, - mount: async (params: AppMountParameters) => { - const kibanaDeps = await this.getKibanaDeps(core, params, cloud); - const { chrome, http } = kibanaDeps.core; - chrome.docTitle.change(WORKPLACE_SEARCH_PLUGIN.NAME); - - // The Workplace Search Personal dashboard needs the chrome hidden. We hide it globally - // here first to prevent a flash of chrome on the Personal dashboard and unhide it for admin routes. - if (this.config.host) chrome.setIsVisible(false); - await this.getInitialData(http); - const pluginData = this.getPluginData(); - - const { renderApp } = await import('./applications'); - const { WorkplaceSearch } = await import('./applications/workplace_search'); - - return renderApp(WorkplaceSearch, kibanaDeps, pluginData); - }, - title: WORKPLACE_SEARCH_PLUGIN.NAME, - visibleIn: [], - }); - } + core.application.register({ + appRoute: WORKPLACE_SEARCH_PLUGIN.URL, + category: DEFAULT_APP_CATEGORIES.enterpriseSearch, + euiIconType: ENTERPRISE_SEARCH_OVERVIEW_PLUGIN.LOGO, + id: WORKPLACE_SEARCH_PLUGIN.ID, + mount: async (params: AppMountParameters) => { + const kibanaDeps = await this.getKibanaDeps(core, params, cloud); + const { chrome, http } = kibanaDeps.core; + chrome.docTitle.change(WORKPLACE_SEARCH_PLUGIN.NAME); + + // The Workplace Search Personal dashboard needs the chrome hidden. We hide it globally + // here first to prevent a flash of chrome on the Personal dashboard and unhide it for admin routes. + if (this.config.host) chrome.setIsVisible(false); + await this.getInitialData(http); + const pluginData = this.getPluginData(); + + const { renderApp } = await import('./applications'); + const { WorkplaceSearch } = await import('./applications/workplace_search'); + + return renderApp(WorkplaceSearch, kibanaDeps, pluginData); + }, + title: WORKPLACE_SEARCH_PLUGIN.NAME, + visibleIn: [], + }); if (plugins.home) { plugins.home.featureCatalogue.registerSolution({ @@ -511,27 +509,25 @@ export class EnterpriseSearchPlugin implements Plugin { title: ANALYTICS_PLUGIN.NAME, }); - if (config.canDeployEntSearch) { - plugins.home.featureCatalogue.register({ - category: 'data', - description: APP_SEARCH_PLUGIN.DESCRIPTION, - icon: 'appSearchApp', - id: APP_SEARCH_PLUGIN.ID, - path: APP_SEARCH_PLUGIN.URL, - showOnHomePage: false, - title: APP_SEARCH_PLUGIN.NAME, - }); + plugins.home.featureCatalogue.register({ + category: 'data', + description: APP_SEARCH_PLUGIN.DESCRIPTION, + icon: 'appSearchApp', + id: APP_SEARCH_PLUGIN.ID, + path: APP_SEARCH_PLUGIN.URL, + showOnHomePage: false, + title: APP_SEARCH_PLUGIN.NAME, + }); - plugins.home.featureCatalogue.register({ - category: 'data', - description: WORKPLACE_SEARCH_PLUGIN.DESCRIPTION, - icon: 'workplaceSearchApp', - id: WORKPLACE_SEARCH_PLUGIN.ID, - path: WORKPLACE_SEARCH_PLUGIN.URL, - showOnHomePage: false, - title: WORKPLACE_SEARCH_PLUGIN.NAME, - }); - } + plugins.home.featureCatalogue.register({ + category: 'data', + description: WORKPLACE_SEARCH_PLUGIN.DESCRIPTION, + icon: 'workplaceSearchApp', + id: WORKPLACE_SEARCH_PLUGIN.ID, + path: WORKPLACE_SEARCH_PLUGIN.URL, + showOnHomePage: false, + title: WORKPLACE_SEARCH_PLUGIN.NAME, + }); plugins.home.featureCatalogue.register({ category: 'data', diff --git a/x-pack/plugins/enterprise_search/server/index.ts b/x-pack/plugins/enterprise_search/server/index.ts index 53d8cbca7f540..9efaa123ea996 100644 --- a/x-pack/plugins/enterprise_search/server/index.ts +++ b/x-pack/plugins/enterprise_search/server/index.ts @@ -16,7 +16,6 @@ export const plugin = async (initializerContext: PluginInitializerContext) => { export const configSchema = schema.object({ accessCheckTimeout: schema.number({ defaultValue: 5000 }), accessCheckTimeoutWarning: schema.number({ defaultValue: 300 }), - canDeployEntSearch: schema.boolean({ defaultValue: true }), customHeaders: schema.maybe(schema.object({}, { unknowns: 'allow' })), enabled: schema.boolean({ defaultValue: true }), hasConnectors: schema.boolean({ defaultValue: true }), @@ -44,8 +43,8 @@ export const configSchema = schema.object({ export type ConfigType = TypeOf<typeof configSchema>; export const config: PluginConfigDescriptor<ConfigType> = { + deprecations: ({ unused }) => [unused('canDeployEntSearch', { level: 'warning' })], exposeToBrowser: { - canDeployEntSearch: true, host: true, ui: true, }, diff --git a/x-pack/plugins/enterprise_search/server/lib/check_access.test.ts b/x-pack/plugins/enterprise_search/server/lib/check_access.test.ts index ab4b27ed1f1c2..ef956ae85f689 100644 --- a/x-pack/plugins/enterprise_search/server/lib/check_access.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/check_access.test.ts @@ -50,7 +50,6 @@ describe('checkAccess', () => { const mockDependencies = { request: { auth: { isAuthenticated: true } }, config: { - canDeployEntSearch: true, host: 'http://localhost:3002', }, globalConfigService: new GlobalConfigService(), diff --git a/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts b/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts index 5190bd6144bfa..0a193d5b03554 100644 --- a/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts +++ b/x-pack/plugins/enterprise_search/server/lib/connectors/add_connector.test.ts @@ -52,7 +52,7 @@ describe('addConnector lib function', () => { _meta: { pipeline: { default_extract_binary_content: true, - default_name: 'ent-search-generic-ingestion', + default_name: 'search-default-ingestion', default_reduce_whitespace: true, default_run_ml_inference: true, }, @@ -89,7 +89,7 @@ describe('addConnector lib function', () => { name: 'index_name', pipeline: { extract_binary_content: true, - name: 'ent-search-generic-ingestion', + name: 'search-default-ingestion', reduce_whitespace: true, run_ml_inference: true, }, @@ -134,7 +134,7 @@ describe('addConnector lib function', () => { name: 'index_name', pipeline: { extract_binary_content: true, - name: 'ent-search-generic-ingestion', + name: 'search-default-ingestion', reduce_whitespace: true, run_ml_inference: true, }, @@ -264,7 +264,7 @@ describe('addConnector lib function', () => { name: '', pipeline: { extract_binary_content: true, - name: 'ent-search-generic-ingestion', + name: 'search-default-ingestion', reduce_whitespace: true, run_ml_inference: true, }, diff --git a/x-pack/plugins/enterprise_search/server/plugin.ts b/x-pack/plugins/enterprise_search/server/plugin.ts index 9120db1b93ac1..1d4ba5e6dfd1f 100644 --- a/x-pack/plugins/enterprise_search/server/plugin.ts +++ b/x-pack/plugins/enterprise_search/server/plugin.ts @@ -58,10 +58,19 @@ import { databaseSearchGuideConfig, } from '../common/guided_onboarding/search_guide_config'; -import { registerTelemetryUsageCollector as registerASTelemetryUsageCollector } from './collectors/app_search/telemetry'; +import { + AS_TELEMETRY_NAME, + registerTelemetryUsageCollector as registerASTelemetryUsageCollector, +} from './collectors/app_search/telemetry'; import { registerTelemetryUsageCollector as registerCNTelemetryUsageCollector } from './collectors/connectors/telemetry'; -import { registerTelemetryUsageCollector as registerESTelemetryUsageCollector } from './collectors/enterprise_search/telemetry'; -import { registerTelemetryUsageCollector as registerWSTelemetryUsageCollector } from './collectors/workplace_search/telemetry'; +import { + ES_TELEMETRY_NAME, + registerTelemetryUsageCollector as registerESTelemetryUsageCollector, +} from './collectors/enterprise_search/telemetry'; +import { + WS_TELEMETRY_NAME, + registerTelemetryUsageCollector as registerWSTelemetryUsageCollector, +} from './collectors/workplace_search/telemetry'; import { registerEnterpriseSearchIntegrations } from './integrations'; import { entSearchHttpAgent } from './lib/enterprise_search_http_agent'; @@ -160,7 +169,8 @@ export class EnterpriseSearchPlugin implements Plugin { ENTERPRISE_SEARCH_OVERVIEW_PLUGIN.ID, ENTERPRISE_SEARCH_CONTENT_PLUGIN.ID, ELASTICSEARCH_PLUGIN.ID, - ...(config.canDeployEntSearch ? [APP_SEARCH_PLUGIN.ID, WORKPLACE_SEARCH_PLUGIN.ID] : []), + APP_SEARCH_PLUGIN.ID, + WORKPLACE_SEARCH_PLUGIN.ID, SEARCH_EXPERIENCES_PLUGIN.ID, VECTOR_SEARCH_PLUGIN.ID, SEMANTIC_SEARCH_PLUGIN.ID, @@ -194,8 +204,8 @@ export class EnterpriseSearchPlugin implements Plugin { api: [], catalogue: PLUGIN_IDS, savedObject: { - all: [], - read: [], + all: [ES_TELEMETRY_NAME, AS_TELEMETRY_NAME, WS_TELEMETRY_NAME], + read: [ES_TELEMETRY_NAME, AS_TELEMETRY_NAME, WS_TELEMETRY_NAME], }, ui: [], }, @@ -291,9 +301,9 @@ export class EnterpriseSearchPlugin implements Plugin { }; registerConfigDataRoute(dependencies); - if (config.canDeployEntSearch) registerAppSearchRoutes(dependencies); + registerAppSearchRoutes(dependencies); registerEnterpriseSearchRoutes(dependencies); - if (config.canDeployEntSearch) registerWorkplaceSearchRoutes(dependencies); + registerWorkplaceSearchRoutes(dependencies); // Enterprise Search Routes if (config.hasConnectors) registerConnectorRoutes(dependencies); if (config.hasWebCrawler) registerCrawlerRoutes(dependencies); @@ -310,10 +320,8 @@ export class EnterpriseSearchPlugin implements Plugin { * Bootstrap the routes, saved objects, and collector for telemetry */ savedObjects.registerType(enterpriseSearchTelemetryType); - if (config.canDeployEntSearch) { - savedObjects.registerType(appSearchTelemetryType); - savedObjects.registerType(workplaceSearchTelemetryType); - } + savedObjects.registerType(appSearchTelemetryType); + savedObjects.registerType(workplaceSearchTelemetryType); let savedObjectsStarted: SavedObjectsServiceStart; void getStartServices().then(([coreStart]) => { @@ -322,10 +330,8 @@ export class EnterpriseSearchPlugin implements Plugin { if (usageCollection) { registerESTelemetryUsageCollector(usageCollection, savedObjectsStarted, this.logger); registerCNTelemetryUsageCollector(usageCollection, this.logger); - if (config.canDeployEntSearch) { - registerASTelemetryUsageCollector(usageCollection, savedObjectsStarted, this.logger); - registerWSTelemetryUsageCollector(usageCollection, savedObjectsStarted, this.logger); - } + registerASTelemetryUsageCollector(usageCollection, savedObjectsStarted, this.logger); + registerWSTelemetryUsageCollector(usageCollection, savedObjectsStarted, this.logger); } }); registerTelemetryRoute({ ...dependencies, getSavedObjectsService: () => savedObjectsStarted }); @@ -361,9 +367,7 @@ export class EnterpriseSearchPlugin implements Plugin { /** * Register a config for the search guide */ - if (config.canDeployEntSearch) { - guidedOnboarding?.registerGuideConfig(appSearchGuideId, appSearchGuideConfig); - } + guidedOnboarding?.registerGuideConfig(appSearchGuideId, appSearchGuideConfig); if (config.hasWebCrawler) { guidedOnboarding?.registerGuideConfig(websiteSearchGuideId, websiteSearchGuideConfig); } diff --git a/x-pack/plugins/enterprise_search/server/utils/search_result_provider.test.ts b/x-pack/plugins/enterprise_search/server/utils/search_result_provider.test.ts index 3e7a0777dad23..b3709df9ef5bd 100644 --- a/x-pack/plugins/enterprise_search/server/utils/search_result_provider.test.ts +++ b/x-pack/plugins/enterprise_search/server/utils/search_result_provider.test.ts @@ -292,7 +292,6 @@ describe('Search search provider', () => { it('does not return results for legacy app search', () => { const searchProvider = getSearchResultProvider( { - canDeployEntSearch: true, hasConnectors: false, hasWebCrawler: false, } as any, @@ -315,7 +314,6 @@ describe('Search search provider', () => { it('does not return results for legacy workplace search', () => { const searchProvider = getSearchResultProvider( { - canDeployEntSearch: true, hasConnectors: false, hasWebCrawler: false, } as any, diff --git a/x-pack/plugins/features/server/__snapshots__/oss_features.test.ts.snap b/x-pack/plugins/features/server/__snapshots__/oss_features.test.ts.snap index 140d20f8ebdb8..cc32fa26b475d 100644 --- a/x-pack/plugins/features/server/__snapshots__/oss_features.test.ts.snap +++ b/x-pack/plugins/features/server/__snapshots__/oss_features.test.ts.snap @@ -434,7 +434,7 @@ Array [ "reporting", ], }, - "name": "Generate CSV reports from Saved Search panels", + "name": "Generate CSV reports from Discover session panels", "savedObject": Object { "all": Array [], "read": Array [], diff --git a/x-pack/plugins/features/server/oss_features.ts b/x-pack/plugins/features/server/oss_features.ts index 12978c35777e7..d0596a59ca507 100644 --- a/x-pack/plugins/features/server/oss_features.ts +++ b/x-pack/plugins/features/server/oss_features.ts @@ -636,7 +636,7 @@ const reportingFeatures: { { id: 'download_csv_report', name: i18n.translate('xpack.features.ossFeatures.reporting.dashboardDownloadCSV', { - defaultMessage: 'Generate CSV reports from Saved Search panels', + defaultMessage: 'Generate CSV reports from Discover session panels', }), includeIn: 'all', savedObject: { all: [], read: [] }, diff --git a/x-pack/plugins/fleet/common/constants/plugin.ts b/x-pack/plugins/fleet/common/constants/plugin.ts index f9f71fb1608fa..2efb4ab11b949 100644 --- a/x-pack/plugins/fleet/common/constants/plugin.ts +++ b/x-pack/plugins/fleet/common/constants/plugin.ts @@ -8,3 +8,4 @@ export const PLUGIN_ID = 'fleet' as const; export const INTEGRATIONS_PLUGIN_ID = 'integrations' as const; export const TRANSFORM_PLUGIN_ID = 'transform' as const; +export const ELASTICSEARCH_PLUGIN_ID = 'elasticsearch' as const; diff --git a/x-pack/plugins/fleet/common/experimental_features.ts b/x-pack/plugins/fleet/common/experimental_features.ts index 1c42bf3ab2afe..1cf35952904aa 100644 --- a/x-pack/plugins/fleet/common/experimental_features.ts +++ b/x-pack/plugins/fleet/common/experimental_features.ts @@ -10,7 +10,6 @@ export type ExperimentalFeatures = typeof allowedExperimentalValues; const _allowedExperimentalValues = { createPackagePolicyMultiPageLayout: true, packageVerification: true, - showDevtoolsRequest: true, diagnosticFileUploadEnabled: true, displayAgentMetrics: true, showIntegrationsSubcategories: true, diff --git a/x-pack/plugins/fleet/common/types/models/epm.ts b/x-pack/plugins/fleet/common/types/models/epm.ts index 36a83c1c0a09e..bcae5230aab52 100644 --- a/x-pack/plugins/fleet/common/types/models/epm.ts +++ b/x-pack/plugins/fleet/common/types/models/epm.ts @@ -207,6 +207,15 @@ export interface DeploymentsModes { default?: DeploymentsModesDefault; } +type Action = 'action'; +type NextStep = 'next_step'; +export interface ConfigurationLink { + title: string; + url: string; + type: Action | NextStep; + content?: string; +} + export enum RegistryPolicyTemplateKeys { categories = 'categories', data_streams = 'data_streams', @@ -223,6 +232,7 @@ export enum RegistryPolicyTemplateKeys { icons = 'icons', screenshots = 'screenshots', deployment_modes = 'deployment_modes', + configuration_links = 'configuration_links', } interface BaseTemplate { [RegistryPolicyTemplateKeys.name]: string; @@ -232,6 +242,7 @@ interface BaseTemplate { [RegistryPolicyTemplateKeys.screenshots]?: RegistryImage[]; [RegistryPolicyTemplateKeys.multiple]?: boolean; [RegistryPolicyTemplateKeys.deployment_modes]?: DeploymentsModes; + [RegistryPolicyTemplateKeys.configuration_links]?: ConfigurationLink[]; } export interface RegistryPolicyIntegrationTemplate extends BaseTemplate { [RegistryPolicyTemplateKeys.categories]?: Array<PackageSpecCategory | undefined>; diff --git a/x-pack/plugins/fleet/dev_docs/fleet_ui_extensions.md b/x-pack/plugins/fleet/dev_docs/fleet_ui_extensions.md index 46788ecac5da0..d361a425450d6 100644 --- a/x-pack/plugins/fleet/dev_docs/fleet_ui_extensions.md +++ b/x-pack/plugins/fleet/dev_docs/fleet_ui_extensions.md @@ -61,7 +61,7 @@ export class Plugin { } ``` -> The code above lives in `x-pack/plugins/security_solution/public/plugin.tsx` +> The code above lives in `x-pack/solutions/security/plugins/security_solution/public/plugin.tsx` For a list of supported Fleet UI extensions, see the `UIExtensionPoint` and associated Union types defined here: `x-pack/plugins/fleet/public/types/ui_extensions.ts`. diff --git a/x-pack/plugins/fleet/dev_docs/integrations_overview.md b/x-pack/plugins/fleet/dev_docs/integrations_overview.md index b6ce0f5ce9917..19d0564cf6f2a 100644 --- a/x-pack/plugins/fleet/dev_docs/integrations_overview.md +++ b/x-pack/plugins/fleet/dev_docs/integrations_overview.md @@ -143,7 +143,7 @@ Contains screenshots rendered on the integrations detail page for the integratio ## `kibana` directory -Contains top level Kibana assets (dashboards, visualizations, saved searches etc) for the integration. +Contains top level Kibana assets (dashboards, visualizations, Discover sessions etc) for the integration. ## Relationship diagram diff --git a/x-pack/plugins/fleet/package.json b/x-pack/plugins/fleet/package.json index dc0bc6a6bcacb..0dfbd1f0ded73 100644 --- a/x-pack/plugins/fleet/package.json +++ b/x-pack/plugins/fleet/package.json @@ -5,17 +5,17 @@ "private": true, "license": "Elastic License 2.0", "scripts": { - "cypress_space_awareness": "NODE_OPTIONS=--openssl-legacy-provider node ../security_solution/scripts/start_cypress_parallel --config-file ../fleet/cypress.config.space_awareness.ts --ftr-config-file ../../../x-pack/test/fleet_cypress/cli_config.space_awareness", + "cypress_space_awareness": "NODE_OPTIONS=--openssl-legacy-provider node ../../solutions/security/plugins/security_solution/scripts/start_cypress_parallel --config-file ../../plugins/fleet/cypress.config.space_awareness.ts --ftr-config-file ../../../x-pack/test/fleet_cypress/cli_config.space_awareness", "cypress_space_awareness:open": "yarn cypress_space_awareness open", "cypress_space_awareness:run": "yarn cypress_space_awareness run", - "cypress_space_awareness:run:reporter": "yarn cypress_space_awareness run --reporter ../../../node_modules/cypress-multi-reporters --reporter-options configFile=../fleet/cypress/reporter_config.json", - "cypress": "NODE_OPTIONS=--openssl-legacy-provider node ../security_solution/scripts/start_cypress_parallel --config-file ../fleet/cypress.config.ts --ftr-config-file ../../../x-pack/test/fleet_cypress/cli_config", + "cypress_space_awareness:run:reporter": "yarn cypress_space_awareness run --reporter ../../../node_modules/cypress-multi-reporters --reporter-options configFile=cypress/reporter_config.json", + "cypress": "NODE_OPTIONS=--openssl-legacy-provider node ../../solutions/security/plugins/security_solution/scripts/start_cypress_parallel --config-file ../../plugins/fleet/cypress.config.ts --ftr-config-file ../../../x-pack/test/fleet_cypress/cli_config", "cypress:open": "yarn cypress open", "cypress:run": "yarn cypress run", - "cypress:run:reporter": "yarn cypress run --reporter ../../../node_modules/cypress-multi-reporters --reporter-options configFile=../fleet/cypress/reporter_config.json", + "cypress:run:reporter": "yarn cypress run --reporter ../../../node_modules/cypress-multi-reporters --reporter-options configFile=cypress/reporter_config.json", "junit:merge": "../../../node_modules/.bin/mochawesome-merge ../../../target/kibana-fleet/cypress/results/mochawesome*.json > ../../../target/kibana-fleet/cypress/results/output.json && ../../../node_modules/.bin/marge ../../../target/kibana-fleet/cypress/results/output.json --reportDir ../../../target/kibana-fleet/cypress/results && mkdir -p ../../../target/junit && cp ../../../target/kibana-fleet/cypress/results/*.xml ../../../target/junit/", "openapi:build": "npx @redocly/openapi-cli bundle --ext yaml --output ./common/openapi/bundled.yaml ./common/openapi/entrypoint.yaml && npx @redocly/openapi-cli bundle --ext json --output ./common/openapi/bundled.json ./common/openapi/entrypoint.yaml", "openapi:lint": "npx @redocly/cli lint ./common/openapi/bundled.yaml", "openapi:speccy": "npx speccy lint ./common/openapi/bundled.yaml" } -} +} \ No newline at end of file diff --git a/x-pack/plugins/fleet/public/applications/fleet/app.tsx b/x-pack/plugins/fleet/public/applications/fleet/app.tsx index 8a4edef8dc87c..0041ffa091051 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/app.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/app.tsx @@ -247,7 +247,7 @@ const FleetTopNav = memo( const readOnlyBtnClass = React.useMemo(() => { return css` - color: ${euiTheme.colors.text}; + color: ${euiTheme.colors.textParagraph}; `; }, [euiTheme]); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_hosts.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_hosts.test.tsx index dd3945664bd6f..a0329a1c9ce0a 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_hosts.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/components/steps/step_select_hosts.test.tsx @@ -42,7 +42,8 @@ jest.mock('../../../../../hooks', () => { }; }); -describe('StepSelectHosts', () => { +// FLAKY: https://github.com/elastic/kibana/issues/203307 +describe.skip('StepSelectHosts', () => { const packageInfo: PackageInfo = { name: 'apache', version: '1.0.0', diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/components/horizontal_page_steps.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/components/horizontal_page_steps.tsx index 752b49431dadb..a00ef9118b857 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/components/horizontal_page_steps.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/components/horizontal_page_steps.tsx @@ -7,31 +7,7 @@ import React from 'react'; import { EuiStepsHorizontal } from '@elastic/eui'; import type { EuiStepsHorizontalProps } from '@elastic/eui'; -import styled from 'styled-components'; -// polyfill until https://github.com/elastic/eui/discussions/5836 implemented -const NumberlessHorizontalSteps = styled(EuiStepsHorizontal)` - .euiStepNumber { - color: transparent; - width: 16px; - height: 16px; - outline-color: #07c; - } - .euiStepHorizontal::before { - width: calc(50% - 8px); - top: 32px; - } - .euiStepHorizontal::after { - width: calc(50% - 8px); - top: 32px; - } - .euiStepHorizontal { - padding: 25px 16px 16px; - } - .euiStepHorizontal[data-step-status='incomplete'] .euiStepHorizontal__title { - color: #69707d; - } -`; const getStepStatus = (currentStep: number, stepIndex: number, currentStepComplete: boolean) => { if (currentStep === stepIndex) { if (currentStepComplete) return 'complete'; @@ -58,5 +34,5 @@ export const PageSteps: React.FC<{ }; }) as EuiStepsHorizontalProps['steps']; - return <NumberlessHorizontalSteps steps={steps} />; + return <EuiStepsHorizontal size="xs" steps={steps} />; }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/devtools_request.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/devtools_request.tsx index 91ca089f2ffe3..81f2304efee99 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/devtools_request.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/devtools_request.tsx @@ -11,7 +11,6 @@ import { i18n } from '@kbn/i18n'; import { omit } from 'lodash'; import { set } from '@kbn/safer-lodash-set'; -import { ExperimentalFeaturesService } from '../../../../../services'; import { generateCreatePackagePolicyDevToolsRequest, generateCreateAgentPolicyDevToolsRequest, @@ -39,12 +38,7 @@ export function useDevToolsRequest({ packageInfo?: PackageInfo; packagePolicyId?: string; }) { - const { showDevtoolsRequest: isShowDevtoolRequestExperimentEnabled } = - ExperimentalFeaturesService.get(); - - const showDevtoolsRequest = - !HIDDEN_API_REFERENCE_PACKAGES.includes(packageInfo?.name ?? '') && - isShowDevtoolRequestExperimentEnabled; + const showDevtoolsRequest = !HIDDEN_API_REFERENCE_PACKAGES.includes(packageInfo?.name ?? ''); const [devtoolRequest, devtoolRequestDescription] = useMemo(() => { if (selectedPolicyTab === SelectedPolicyTab.NEW) { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/settings/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/settings/index.tsx index 50baac84ff4a0..efb7066b0d5e0 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/settings/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/details_page/components/settings/index.tsx @@ -40,7 +40,6 @@ import { ConfirmDeployAgentPolicyModal, } from '../../../components'; import { DevtoolsRequestFlyoutButton } from '../../../../../components'; -import { ExperimentalFeaturesService } from '../../../../../services'; import { generateUpdateAgentPolicyDevToolsRequest } from '../../../services'; import { UNKNOWN_SPACE } from '../../../../../../../../common/constants'; @@ -155,7 +154,6 @@ export const SettingsView = memo<{ agentPolicy: AgentPolicy }>( setIsLoading(false); }; - const { showDevtoolsRequest } = ExperimentalFeaturesService.get(); const devtoolRequest = useMemo( () => generateUpdateAgentPolicyDevToolsRequest( @@ -235,28 +233,26 @@ export const SettingsView = memo<{ agentPolicy: AgentPolicy }>( /> </EuiButtonEmpty> </EuiFlexItem> - {showDevtoolsRequest ? ( - <EuiFlexItem grow={false}> - <DevtoolsRequestFlyoutButton - isDisabled={ - isLoading || - Object.keys(validation).length > 0 || - hasAdvancedSettingsErrors || - hasInvalidSpaceError + <EuiFlexItem grow={false}> + <DevtoolsRequestFlyoutButton + isDisabled={ + isLoading || + Object.keys(validation).length > 0 || + hasAdvancedSettingsErrors || + hasInvalidSpaceError + } + btnProps={{ + color: 'text', + }} + description={i18n.translate( + 'xpack.fleet.editAgentPolicy.devtoolsRequestDescription', + { + defaultMessage: 'This Kibana request updates an agent policy.', } - btnProps={{ - color: 'text', - }} - description={i18n.translate( - 'xpack.fleet.editAgentPolicy.devtoolsRequestDescription', - { - defaultMessage: 'This Kibana request updates an agent policy.', - } - )} - request={devtoolRequest} - /> - </EuiFlexItem> - ) : null} + )} + request={devtoolRequest} + /> + </EuiFlexItem> <EuiFlexItem grow={false}> <EuiButton onClick={onSubmit} diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/components/create_agent_policy.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/components/create_agent_policy.tsx index a5538e7e0fa30..f7a6246643401 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/components/create_agent_policy.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/list_page/components/create_agent_policy.tsx @@ -31,7 +31,6 @@ import { useAuthz, useStartServices, sendCreateAgentPolicy } from '../../../../h import { AgentPolicyForm, agentPolicyFormValidation } from '../../components'; import { DevtoolsRequestFlyoutButton } from '../../../../components'; import { generateCreateAgentPolicyDevToolsRequest } from '../../services'; -import { ExperimentalFeaturesService } from '../../../../services'; import { generateNewAgentPolicyWithDefaults } from '../../../../../../../common/services/generate_new_agent_policy'; const FlyoutWithHigherZIndex = styled(EuiFlyout)` @@ -109,7 +108,6 @@ export const CreateAgentPolicyFlyout: React.FunctionComponent<Props> = ({ /> </EuiFlyoutBody> ); - const { showDevtoolsRequest } = ExperimentalFeaturesService.get(); const agentPolicyContent = useMemo( () => generateCreateAgentPolicyDevToolsRequest(agentPolicy, withSysMonitoring), [agentPolicy, withSysMonitoring] @@ -128,25 +126,23 @@ export const CreateAgentPolicyFlyout: React.FunctionComponent<Props> = ({ </EuiFlexItem> <EuiFlexItem grow={false}> <EuiFlexGroup gutterSize="none"> - {showDevtoolsRequest ? ( - <EuiFlexItem grow={false}> - <DevtoolsRequestFlyoutButton - isDisabled={ - isLoading || - Object.keys(validation).length > 0 || - hasAdvancedSettingsErrors || - hasInvalidSpaceError + <EuiFlexItem grow={false}> + <DevtoolsRequestFlyoutButton + isDisabled={ + isLoading || + Object.keys(validation).length > 0 || + hasAdvancedSettingsErrors || + hasInvalidSpaceError + } + description={i18n.translate( + 'xpack.fleet.createAgentPolicy.devtoolsRequestDescription', + { + defaultMessage: 'This Kibana request creates a new agent policy.', } - description={i18n.translate( - 'xpack.fleet.createAgentPolicy.devtoolsRequestDescription', - { - defaultMessage: 'This Kibana request creates a new agent policy.', - } - )} - request={agentPolicyContent} - /> - </EuiFlexItem> - ) : null} + )} + request={agentPolicyContent} + /> + </EuiFlexItem> <EuiFlexItem grow={false}> <EuiButton fill diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/activity_item.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/activity_item.tsx index 06300480dfa50..f95e81de6d3d1 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/activity_item.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/activity_item.tsx @@ -16,25 +16,22 @@ import { EuiText, EuiPanel, EuiSpacer, + useEuiTheme, } from '@elastic/eui'; import type { ActionStatus } from '../../../../../types'; import { ViewErrors } from '../view_errors'; -import { - formattedTime, - getAction, - inProgressDescription, - inProgressTitle, - inProgressTitleColor, -} from './helpers'; +import { formattedTime, getAction, inProgressDescription, inProgressTitle } from './helpers'; import { ViewAgentsButton } from './view_agents_button'; export const ActivityItem: React.FunctionComponent<{ action: ActionStatus; onClickViewAgents: (action: ActionStatus) => void; }> = ({ action, onClickViewAgents }) => { + const theme = useEuiTheme(); + const completeTitle = action.type === 'POLICY_CHANGE' && action.nbAgentsActioned === 0 ? ( <EuiText> @@ -104,18 +101,21 @@ export const ActivityItem: React.FunctionComponent<{ IN_PROGRESS: { icon: <EuiLoadingSpinner size="m" />, title: <EuiText>{inProgressTitle(action)}</EuiText>, - titleColor: inProgressTitleColor, + titleColor: theme.euiTheme.colors.textPrimary, description: <EuiText color="subdued">{inProgressDescription(action.creationTime)}</EuiText>, }, ROLLOUT_PASSED: { icon: action.nbAgentsFailed > 0 ? ( - <EuiIcon size="m" type="warning" color="red" /> + <EuiIcon size="m" type="warning" color="danger" /> ) : ( - <EuiIcon size="m" type="checkInCircleFilled" color="green" /> + <EuiIcon size="m" type="checkInCircleFilled" color="success" /> ), title: completeTitle, - titleColor: action.nbAgentsFailed > 0 ? 'red' : 'green', + titleColor: + action.nbAgentsFailed > 0 + ? theme.euiTheme.colors.textDanger + : theme.euiTheme.colors.textSuccess, description: action.nbAgentsFailed > 0 ? ( failedDescription @@ -124,9 +124,9 @@ export const ActivityItem: React.FunctionComponent<{ ), }, COMPLETE: { - icon: <EuiIcon size="m" type="checkInCircleFilled" color="green" />, + icon: <EuiIcon size="m" type="checkInCircleFilled" color="success" />, title: completeTitle, - titleColor: 'green', + titleColor: theme.euiTheme.colors.textSuccess, description: action.type === 'POLICY_REASSIGN' && action.newPolicyId ? ( <EuiText color="subdued"> @@ -160,14 +160,14 @@ export const ActivityItem: React.FunctionComponent<{ ), }, FAILED: { - icon: <EuiIcon size="m" type="warning" color="red" />, + icon: <EuiIcon size="m" type="warning" color="danger" />, title: completeTitle, - titleColor: 'red', + titleColor: theme.euiTheme.colors.textDanger, description: failedDescription, }, CANCELLED: { - icon: <EuiIcon size="m" type="warning" color="grey" />, - titleColor: 'grey', + icon: <EuiIcon size="m" type="warning" color="subdued" />, + titleColor: theme.euiTheme.colors.textSubdued, title: ( <EuiText> <FormattedMessage @@ -192,8 +192,8 @@ export const ActivityItem: React.FunctionComponent<{ ), }, EXPIRED: { - icon: <EuiIcon size="m" type="warning" color="grey" />, - titleColor: 'grey', + icon: <EuiIcon size="m" type="warning" color="subdued" />, + titleColor: theme.euiTheme.colors.textSubdued, title: ( <EuiText> <FormattedMessage diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/helpers.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/helpers.tsx index e37452da2ac5d..f7ac1c266c7ce 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/helpers.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/helpers.tsx @@ -10,8 +10,6 @@ import { FormattedDate, FormattedMessage, FormattedTime } from '@kbn/i18n-react' import type { ActionStatus } from '../../../../../types'; -export const inProgressTitleColor = '#0077CC'; - const actionNames: { [key: string]: { inProgressText: string; completedText: string; cancelledText: string }; } = { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/upgrade_in_progress_activity_item.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/upgrade_in_progress_activity_item.tsx index 6cc10cdd6b6bd..864005fceaa5f 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/upgrade_in_progress_activity_item.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_activity_flyout/upgrade_in_progress_activity_item.tsx @@ -15,6 +15,7 @@ import { EuiPanel, EuiButton, EuiLink, + useEuiTheme, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -22,12 +23,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import type { ActionStatus } from '../../../../../types'; import { useStartServices } from '../../../../../hooks'; -import { - formattedTime, - inProgressDescription, - inProgressTitle, - inProgressTitleColor, -} from './helpers'; +import { formattedTime, inProgressDescription, inProgressTitle } from './helpers'; import { ViewAgentsButton } from './view_agents_button'; export const UpgradeInProgressActivityItem: React.FunctionComponent<{ @@ -36,6 +32,8 @@ export const UpgradeInProgressActivityItem: React.FunctionComponent<{ onClickViewAgents: (action: ActionStatus) => void; }> = ({ action, abortUpgrade, onClickViewAgents }) => { const { docLinks } = useStartServices(); + const theme = useEuiTheme(); + const [isAborting, setIsAborting] = useState(false); const onClickAbortUpgrade = useCallback(async () => { try { @@ -69,7 +67,10 @@ export const UpgradeInProgressActivityItem: React.FunctionComponent<{ {isScheduled ? <EuiIcon type="clock" /> : <EuiLoadingSpinner size="m" />} </EuiFlexItem> <EuiFlexItem> - <EuiText color={inProgressTitleColor} data-test-subj="upgradeInProgressTitle"> + <EuiText + color={theme.euiTheme.colors.textPrimary} + data-test-subj="upgradeInProgressTitle" + > {isScheduled && action.startTime ? ( <FormattedMessage id="xpack.fleet.agentActivityFlyout.scheduleTitle" diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/status_badges.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/status_badges.tsx index 44363d12088d1..21ff0e22505bf 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/status_badges.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/status_badges.tsx @@ -5,7 +5,13 @@ * 2.0. */ -import { EuiFlexGroup, EuiHealth, EuiNotificationBadge, EuiFlexItem } from '@elastic/eui'; +import { + EuiFlexGroup, + EuiHealth, + EuiNotificationBadge, + EuiFlexItem, + useEuiTheme, +} from '@elastic/eui'; import React, { memo } from 'react'; import { @@ -31,9 +37,10 @@ export const AgentStatusBadges: React.FC<{ const AgentStatusBadge: React.FC<{ status: SimplifiedAgentStatus; count: number }> = memo( ({ status, count }) => { + const { euiTheme } = useEuiTheme(); return ( <> - <EuiHealth color={getColorForAgentStatus(status)}> + <EuiHealth color={getColorForAgentStatus(status, euiTheme)}> <EuiFlexGroup alignItems="center" gutterSize="s"> <EuiFlexItem grow={false}>{getLabelForAgentStatus(status)}</EuiFlexItem> <EuiFlexItem grow={false}> diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/status_bar.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/status_bar.tsx index f4fc01204267b..429702e6b7dc6 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/status_bar.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/status_bar.tsx @@ -6,7 +6,7 @@ */ import styled from 'styled-components'; -import { EuiColorPaletteDisplay, EuiSpacer } from '@elastic/eui'; +import { EuiColorPaletteDisplay, EuiSpacer, useEuiTheme } from '@elastic/eui'; import React, { useMemo } from 'react'; import { AGENT_STATUSES, getColorForAgentStatus } from '../../services/agent_status'; @@ -25,16 +25,17 @@ const StyledEuiColorPaletteDisplay = styled(EuiColorPaletteDisplay)` export const AgentStatusBar: React.FC<{ agentStatus: { [k in SimplifiedAgentStatus]: number }; }> = ({ agentStatus }) => { + const { euiTheme } = useEuiTheme(); const palette = useMemo(() => { return AGENT_STATUSES.reduce((acc, status) => { const previousStop = acc.length > 0 ? acc[acc.length - 1].stop : 0; acc.push({ stop: previousStop + (agentStatus[status] || 0), - color: getColorForAgentStatus(status), + color: getColorForAgentStatus(status, euiTheme), }); return acc; }, [] as Array<{ stop: number; color: string }>); - }, [agentStatus]); + }, [agentStatus, euiTheme]); const hasNoAgent = palette[palette.length - 1].stop === 0; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/view_errors.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/view_errors.tsx index e73d7778d1405..4a15f99638db0 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/view_errors.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/view_errors.tsx @@ -8,7 +8,7 @@ import styled from 'styled-components'; import React from 'react'; import type { EuiBasicTableProps } from '@elastic/eui'; -import { EuiAccordion, EuiToolTip, EuiText, EuiBasicTable } from '@elastic/eui'; +import { EuiAccordion, EuiToolTip, EuiText, EuiBasicTable, useEuiTheme } from '@elastic/eui'; import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app'; import moment from 'moment'; @@ -33,6 +33,7 @@ const TruncatedEuiText = styled(EuiText)` export const ViewErrors: React.FunctionComponent<{ action: ActionStatus }> = ({ action }) => { const coreStart = useStartServices(); + const theme = useEuiTheme(); const getLogsButton = (agentId: string, timestamp: string) => { const start = moment(timestamp).subtract(5, 'm').toISOString(); @@ -70,7 +71,11 @@ export const ViewErrors: React.FunctionComponent<{ action: ActionStatus }> = ({ }), render: (error: string) => ( <EuiToolTip content={error}> - <TruncatedEuiText size="s" color="red" data-test-subj="errorText"> + <TruncatedEuiText + size="s" + color={theme.euiTheme.colors.textDanger} + data-test-subj="errorText" + > {error} </TruncatedEuiText> </EuiToolTip> diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/es_requirements_page.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/es_requirements_page.tsx index 969f9357a21db..3128b05f3af85 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/es_requirements_page.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_requirements_page/es_requirements_page.tsx @@ -20,9 +20,10 @@ import { EuiCode, EuiCodeBlock, EuiLink, + useEuiTheme, } from '@elastic/eui'; -import styled from 'styled-components'; +import { css } from '@emotion/react'; import { WithoutHeaderLayout } from '../../../layouts'; import type { GetFleetStatusResponse } from '../../../types'; @@ -50,20 +51,21 @@ export const RequirementItem: React.FunctionComponent<{ ); }; -const borderColor = '#d3dae6'; - -const StyledPageBody = styled(EuiPageBody)` - border: 1px solid ${borderColor}; - border-radius: 5px; -`; - export const MissingESRequirementsPage: React.FunctionComponent<{ missingRequirements: GetFleetStatusResponse['missing_requirements']; }> = ({ missingRequirements }) => { const { docLinks } = useStartServices(); + const theme = useEuiTheme(); + return ( <WithoutHeaderLayout> - <StyledPageBody restrictWidth={820}> + <EuiPageBody + restrictWidth={820} + css={css` + border: ${theme.euiTheme.border.thin}}; + border-radius: 5px; + `} + > <EuiPageSection color="transparent"> <EuiCallOut title={i18n.translate('xpack.fleet.setupPage.missingRequirementsCalloutTitle', { @@ -150,7 +152,7 @@ xpack.security.authc.api_key.enabled: true`} }} /> </EuiPageSection> - </StyledPageBody> + </EuiPageBody> </WithoutHeaderLayout> ); }; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/donut_chart.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/donut_chart.tsx deleted file mode 100644 index 6f3d865b22843..0000000000000 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/donut_chart.tsx +++ /dev/null @@ -1,66 +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, { useEffect, useRef } from 'react'; -import d3 from 'd3'; -import { EuiFlexItem } from '@elastic/eui'; - -interface DonutChartProps { - data: { - [key: string]: number; - }; - height: number; - width: number; -} - -export const DonutChart = ({ height, width, data }: DonutChartProps) => { - const chartElement = useRef<SVGSVGElement | null>(null); - - useEffect(() => { - if (chartElement.current !== null) { - // we must remove any existing paths before painting - d3.selectAll('g').remove(); - const svgElement = d3 - .select(chartElement.current) - .append('g') - .attr('transform', `translate(${width / 2}, ${height / 2})`); - const color = d3.scale - .ordinal() - // @ts-ignore - .domain(data) - .range(['#017D73', '#98A2B3', '#BD271E', '#F5A700']); - const pieGenerator = d3.layout - .pie() - .value(({ value }: any) => value) - // these start/end angles will reverse the direction of the pie, - // which matches our design - .startAngle(2 * Math.PI) - .endAngle(0); - - svgElement - .selectAll('g') - // @ts-ignore - .data(pieGenerator(d3.entries(data))) - .enter() - .append('path') - .attr( - 'd', - // @ts-ignore attr does not expect a param of type Arc<Arc> but it behaves as desired - d3.svg - .arc() - .innerRadius(width * 0.36) - .outerRadius(Math.min(width, height) / 2) - ) - .attr('fill', (d: any) => color(d.data.key) as any); - } - }, [data, height, width]); - return ( - <EuiFlexItem grow={false}> - <svg ref={chartElement} width={width} height={height} /> - </EuiFlexItem> - ); -}; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/tags.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/tags.test.tsx index a7d70a3b4e7ef..02884d8528c65 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/tags.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/tags.test.tsx @@ -10,7 +10,8 @@ import { render, screen, fireEvent, waitFor } from '@testing-library/react'; import { Tags } from './tags'; -describe('Tags', () => { +// FLAKY: https://github.com/elastic/kibana/issues/204465 +describe.skip('Tags', () => { describe('when list is short', () => { it('renders a comma-separated list of tags', () => { const tags = ['tag1', 'tag2']; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/hooks/use_fleet_server_unhealthy.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/hooks/use_fleet_server_unhealthy.test.tsx index c4caa7e47c07b..830582d1aeb22 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/hooks/use_fleet_server_unhealthy.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/hooks/use_fleet_server_unhealthy.test.tsx @@ -19,7 +19,8 @@ jest.mock('../../../../../hooks/use_authz', () => ({ }), })); -describe('useFleetServerUnhealthy', () => { +// FLAKY: https://github.com/elastic/kibana/issues/202359 +describe.skip('useFleetServerUnhealthy', () => { const testRenderer = createFleetTestRendererMock(); it('should return isUnHealthy:false with an online fleet server', async () => { diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/services/agent_status.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/services/agent_status.tsx index b69da08105759..6b12331d7034c 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/services/agent_status.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/services/agent_status.tsx @@ -5,24 +5,11 @@ * 2.0. */ -import { euiPaletteColorBlindBehindText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { euiLightVars } from '@kbn/ui-theme'; -import type { SimplifiedAgentStatus } from '../../../types'; +import type { EuiThemeComputed } from '@elastic/eui-theme-common'; -const visColors = euiPaletteColorBlindBehindText(); -const colorToHexMap = { - // using variables as mentioned here https://elastic.github.io/eui/#/guidelines/getting-started - default: euiLightVars.euiColorLightShade, - primary: visColors[1], - success: visColors[0], - accent: visColors[2], - warning: visColors[5], - danger: visColors[9], - inactive: euiLightVars.euiColorDarkShade, - lightest: euiLightVars.euiColorDisabled, -}; +import type { SimplifiedAgentStatus } from '../../../types'; export const AGENT_STATUSES: SimplifiedAgentStatus[] = [ 'healthy', @@ -33,20 +20,23 @@ export const AGENT_STATUSES: SimplifiedAgentStatus[] = [ 'unenrolled', ]; -export function getColorForAgentStatus(agentStatus: SimplifiedAgentStatus): string { +export function getColorForAgentStatus( + agentStatus: SimplifiedAgentStatus, + euiTheme: EuiThemeComputed<{}> +): string { switch (agentStatus) { case 'healthy': - return colorToHexMap.success; + return euiTheme.colors.backgroundFilledSuccess; case 'offline': - return colorToHexMap.default; + return euiTheme.colors.lightShade; case 'inactive': - return colorToHexMap.inactive; + return euiTheme.colors.darkShade; case 'unhealthy': - return colorToHexMap.warning; + return euiTheme.colors.backgroundFilledWarning; case 'updating': - return colorToHexMap.primary; + return euiTheme.colors.backgroundFilledPrimary; case 'unenrolled': - return colorToHexMap.lightest; + return euiTheme.colors.backgroundBaseDisabled; default: throw new Error(`Unsupported Agent status ${agentStatus}`); } diff --git a/x-pack/plugins/fleet/public/applications/integrations/components/header/header.tsx b/x-pack/plugins/fleet/public/applications/integrations/components/header/header.tsx index 30fc0f0d4965f..f9a8ad22cddc5 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/components/header/header.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/components/header/header.tsx @@ -34,7 +34,7 @@ export const IntegrationsHeader = ({ const { euiTheme } = useEuiTheme(); const readOnlyBtnClass = React.useMemo(() => { return css` - color: ${euiTheme.colors.text}; + color: ${euiTheme.colors.textParagraph}; `; }, [euiTheme]); const isReadOnly = useIsReadOnly(); diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_card.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_card.tsx index 52a3a90ae641e..2bf1f58a6e12b 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_card.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/components/package_card.tsx @@ -6,7 +6,6 @@ */ import React from 'react'; -import styled from 'styled-components'; import { EuiBadge, EuiButton, @@ -15,6 +14,7 @@ import { EuiFlexItem, EuiSpacer, EuiToolTip, + useEuiTheme, } from '@elastic/eui'; import { css } from '@emotion/react'; @@ -43,15 +43,6 @@ import { export type PackageCardProps = IntegrationCardItem; -// Min-height is roughly 3 lines of content. -// This keeps the cards from looking overly unbalanced because of content differences. -const Card = styled(EuiCard)<{ isquickstart?: boolean; $maxCardHeight?: number }>` - min-height: 127px; - border-color: ${({ isquickstart }) => (isquickstart ? '#ba3d76' : null)}; - ${({ $maxCardHeight }) => - $maxCardHeight ? `max-height: ${$maxCardHeight}px; overflow: hidden;` : ''}; -`; - export function PackageCard({ description, name, @@ -78,6 +69,8 @@ export function PackageCard({ descriptionLineClamp, maxCardHeight, }: PackageCardProps) { + const theme = useEuiTheme(); + let releaseBadge: React.ReactNode | null = null; if (release && release !== 'ga') { releaseBadge = ( @@ -202,8 +195,10 @@ export function PackageCard({ tourOffset={10} > <TrackApplicationView viewId={testid}> - <Card + <EuiCard // EUI TODO: Custom component CSS + // Min-height is roughly 3 lines of content. + // This keeps the cards from looking overly unbalanced because of content differences. css={css` position: relative; [class*='euiCard__content'] { @@ -224,9 +219,13 @@ export function PackageCard({ [class*='euiCard__titleButton'] { ${getLineClampStyles(titleLineClamp)} } + + min-height: 127px; + border-color: ${isQuickstart ? theme.euiTheme.colors.accent : null}; + max-height: ${maxCardHeight ? `${maxCardHeight}px` : null}; + overflow: ${maxCardHeight ? 'hidden' : null}; `} data-test-subj={testid} - isquickstart={isQuickstart} betaBadgeProps={quickstartBadge(isQuickstart)} layout="horizontal" title={title || ''} @@ -243,7 +242,6 @@ export function PackageCard({ /> } onClick={onClickProp ?? onCardClick} - $maxCardHeight={maxCardHeight} > <EuiFlexGroup gutterSize="xs" wrap={true}> {showLabels && extraLabelsBadges ? extraLabelsBadges : null} @@ -258,7 +256,7 @@ export function PackageCard({ showInstallationStatus={showInstallationStatus} /> </EuiFlexGroup> - </Card> + </EuiCard> </TrackApplicationView> </WithGuidedOnboardingTour> ); diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/constants.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/constants.tsx index 03f0b0b5cee81..c65e5c8d56440 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/constants.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/constants.tsx @@ -36,7 +36,7 @@ export const AssetTitleMap: Record< defaultMessage: 'Visualizations', }), search: i18n.translate('xpack.fleet.epm.assetTitles.savedSearches', { - defaultMessage: 'Saved searches', + defaultMessage: 'Discover sessions', }), 'index-pattern': i18n.translate('xpack.fleet.epm.assetTitles.indexPatterns', { defaultMessage: 'Data views', diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/policies/components/agent_based_table.test.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/policies/components/agent_based_table.test.tsx index 77ce5720b294d..2926caae9e7fb 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/policies/components/agent_based_table.test.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/policies/components/agent_based_table.test.tsx @@ -55,7 +55,8 @@ const mockPagination = { pageSizeOptions: [10, 20, 50], }; -describe('AgentBasedPackagePoliciesTable', () => { +// FLAKY: https://github.com/elastic/kibana/issues/201837 +describe.skip('AgentBasedPackagePoliciesTable', () => { it('renders the table with package policies', async () => { const renderer = createIntegrationsTestRendererMock(); const result = renderer.render( diff --git a/x-pack/plugins/fleet/public/components/agentless_enrollment_flyout/index.tsx b/x-pack/plugins/fleet/public/components/agentless_enrollment_flyout/index.tsx index 0fbf8d278fab8..da08a8ea0d749 100644 --- a/x-pack/plugins/fleet/public/components/agentless_enrollment_flyout/index.tsx +++ b/x-pack/plugins/fleet/public/components/agentless_enrollment_flyout/index.tsx @@ -185,6 +185,7 @@ export const AgentlessEnrollmentFlyout = ({ <AgentlessStepConfirmData agent={agentData} packagePolicy={packagePolicy} + policyTemplates={packageInfoData?.item.policy_templates} setConfirmDataStatus={setConfirmDataStatus} /> ) : ( diff --git a/x-pack/plugins/fleet/public/components/agentless_enrollment_flyout/next_steps.tsx b/x-pack/plugins/fleet/public/components/agentless_enrollment_flyout/next_steps.tsx new file mode 100644 index 0000000000000..e068dc5311ea7 --- /dev/null +++ b/x-pack/plugins/fleet/public/components/agentless_enrollment_flyout/next_steps.tsx @@ -0,0 +1,150 @@ +/* + * 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, useMemo } from 'react'; +import { + EuiSpacer, + EuiFlexItem, + EuiCard, + EuiFlexGroup, + EuiButton, + EuiHorizontalRule, +} from '@elastic/eui'; + +import { i18n } from '@kbn/i18n'; + +import { useStartServices } from '../../hooks'; +import type { PackagePolicy, RegistryPolicyTemplate } from '../../types'; +import { ELASTICSEARCH_PLUGIN_ID } from '../../../common/constants/plugin'; + +export const NextSteps = ({ + packagePolicy, + policyTemplates, +}: { + packagePolicy: PackagePolicy; + policyTemplates?: RegistryPolicyTemplate[]; +}) => { + const { application } = useStartServices(); + + const configurationLinks = useMemo(() => { + if (policyTemplates) { + return policyTemplates + ?.filter( + (template) => template?.configuration_links && template.configuration_links.length > 0 + ) + .flatMap((template) => template.configuration_links); + } + return []; + }, [policyTemplates]); + + const parseKbnLink = (url: string) => { + // matching strings with format kbn:/app/appId/path/optionalsubpath + const matches = url.match(/kbn:\/app\/(\w*)\/(\w*\/*)*/); + if (matches && matches.length > 0) { + const appId = matches[1]; + const path = matches[2]; + return { appId, path }; + } + return undefined; + }; + + const isExternal = (url: string) => url.startsWith('http') || url.startsWith('https'); + const onClickLink = useCallback( + (url?: string) => { + if (!url) return undefined; + + if (isExternal(url)) { + application.navigateToUrl(`${url}`); + } else if (url.startsWith('kbn:/')) { + const parsedLink = parseKbnLink(url); + if (parsedLink) { + const { appId, path } = parsedLink; + application.navigateToApp(appId, { + path, + }); + } + } + }, + [application] + ); + + const nextStepsCards = configurationLinks + .filter((link) => link?.type === 'next_step') + .map((link, index) => { + return ( + <EuiFlexItem key={index}> + <EuiCard + data-test-subj={`agentlessStepConfirmData.connectorCard.${link?.title}`} + title={`${link?.title}`} + description={`${link?.content}`} + onClick={() => onClickLink(link?.url)} + /> + </EuiFlexItem> + ); + }); + + const connectorCards = packagePolicy.inputs + .filter((input) => !!input?.vars?.connector_id.value || !!input?.vars?.connector_name.value) + .map((input, index) => { + return ( + <EuiFlexItem key={index}> + <EuiCard + data-test-subj={`agentlessStepConfirmData.connectorCard.${input?.vars?.connector_name.value}`} + title={`${input?.vars?.connector_name.value}`} + description={i18n.translate( + 'xpack.fleet.agentlessStepConfirmData.connectorCard.description', + { + defaultMessage: 'Configure Connector', + } + )} + onClick={() => { + application.navigateToApp(ELASTICSEARCH_PLUGIN_ID, { + path: input?.vars?.connector_id.value + ? `content/connectors/${input?.vars?.connector_id.value}` + : `content/connectors`, + }); + }} + /> + </EuiFlexItem> + ); + }); + + const actionButtons = configurationLinks + .filter((link) => !!link && link?.type === 'action') + .map((link, index) => { + return ( + <EuiFlexItem key={index} grow={false}> + <EuiButton + data-test-subj={`agentlessStepConfirmData.connectorCard.${link?.title}`} + iconType="link" + onClick={() => onClickLink(link?.url)} + > + {link?.title} + </EuiButton> + </EuiFlexItem> + ); + }); + + return ( + <> + <EuiSpacer size="m" /> + {nextStepsCards.length > 0 && ( + <EuiFlexGroup alignItems="center" direction="row" wrap={true}> + {nextStepsCards} + {connectorCards} + </EuiFlexGroup> + )} + <EuiSpacer size="m" /> + <EuiHorizontalRule /> + {actionButtons.length > 0 && ( + <EuiFlexGroup alignItems="center" direction="row" wrap={true}> + {actionButtons} + </EuiFlexGroup> + )} + </> + ); +}; diff --git a/x-pack/plugins/fleet/public/components/agentless_enrollment_flyout/step_confirm_data.tsx b/x-pack/plugins/fleet/public/components/agentless_enrollment_flyout/step_confirm_data.tsx index 34e69d8ef839a..0775716eefd1b 100644 --- a/x-pack/plugins/fleet/public/components/agentless_enrollment_flyout/step_confirm_data.tsx +++ b/x-pack/plugins/fleet/public/components/agentless_enrollment_flyout/step_confirm_data.tsx @@ -12,20 +12,24 @@ import type { EuiStepStatus } from '@elastic/eui'; import { EuiText, EuiLink, EuiSpacer, EuiCallOut } from '@elastic/eui'; import { useStartServices } from '../../hooks'; -import type { Agent, PackagePolicy } from '../../types'; +import type { Agent, PackagePolicy, RegistryPolicyTemplate } from '../../types'; import { usePollingIncomingData, POLLING_TIMEOUT_MS, } from '../agent_enrollment_flyout/use_get_agent_incoming_data'; +import { NextSteps } from './next_steps'; + export const AgentlessStepConfirmData = ({ agent, packagePolicy, setConfirmDataStatus, + policyTemplates, }: { agent: Agent; packagePolicy: PackagePolicy; setConfirmDataStatus: (status: EuiStepStatus) => void; + policyTemplates?: RegistryPolicyTemplate[]; }) => { const { docLinks } = useStartServices(); const [overallState, setOverallState] = useState<'pending' | 'success' | 'failure'>('pending'); @@ -53,13 +57,17 @@ export const AgentlessStepConfirmData = ({ if (overallState === 'success') { return ( - <EuiCallOut - color="success" - title={i18n.translate('xpack.fleet.agentlessEnrollmentFlyout.confirmData.successText', { - defaultMessage: 'Incoming data received from agentless integration', - })} - iconType="check" - /> + <> + <EuiCallOut + color="success" + title={i18n.translate('xpack.fleet.agentlessEnrollmentFlyout.confirmData.successText', { + defaultMessage: 'Incoming data received from agentless integration', + })} + iconType="check" + /> + <EuiSpacer size="m" /> + <NextSteps packagePolicy={packagePolicy} policyTemplates={policyTemplates} /> + </> ); } else if (overallState === 'failure') { return ( diff --git a/x-pack/plugins/fleet/public/components/danger_eui_context_menu_item.tsx b/x-pack/plugins/fleet/public/components/danger_eui_context_menu_item.tsx index 87fb523121cfe..b7983ac255fb6 100644 --- a/x-pack/plugins/fleet/public/components/danger_eui_context_menu_item.tsx +++ b/x-pack/plugins/fleet/public/components/danger_eui_context_menu_item.tsx @@ -5,9 +5,19 @@ * 2.0. */ -import styled from 'styled-components'; -import { EuiContextMenuItem } from '@elastic/eui'; +import React from 'react'; +import { css } from '@emotion/react'; +import type { EuiContextMenuItemProps } from '@elastic/eui'; +import { EuiContextMenuItem, useEuiTheme } from '@elastic/eui'; -export const DangerEuiContextMenuItem = styled(EuiContextMenuItem)` - color: ${(props) => props.theme.eui.euiColorDangerText}; -`; +export const DangerEuiContextMenuItem = (props: EuiContextMenuItemProps) => { + const theme = useEuiTheme(); + return ( + <EuiContextMenuItem + {...props} + css={css` + color: ${theme.euiTheme.colors.textDanger}; + `} + /> + ); +}; diff --git a/x-pack/plugins/fleet/public/components/enrollment_instructions/standalone/index.tsx b/x-pack/plugins/fleet/public/components/enrollment_instructions/standalone/index.tsx index dd8eafec86ec4..8901c3b5f0883 100644 --- a/x-pack/plugins/fleet/public/components/enrollment_instructions/standalone/index.tsx +++ b/x-pack/plugins/fleet/public/components/enrollment_instructions/standalone/index.tsx @@ -22,24 +22,24 @@ export const StandaloneInstructions = ({ const { windows: windowsDownloadSourceProxyArgs, curl: curlDownloadSourceProxyArgs } = getDownloadSourceProxyArgs(downloadSourceProxy); - const linuxDebCommand = `curl -L -O ${downloadBaseUrl}/downloads/beats/elastic-agent/elastic-agent-${agentVersion}-amd64.deb ${curlDownloadSourceProxyArgs} + const linuxDebCommand = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-amd64.deb ${curlDownloadSourceProxyArgs} sudo dpkg -i elastic-agent-${agentVersion}-amd64.deb \nsudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent`; - const linuxRpmCommand = `curl -L -O ${downloadBaseUrl}/downloads/beats/elastic-agent/elastic-agent-${agentVersion}-x86_64.rpm ${curlDownloadSourceProxyArgs} + const linuxRpmCommand = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-x86_64.rpm ${curlDownloadSourceProxyArgs} sudo rpm -vi elastic-agent-${agentVersion}-x86_64.rpm \nsudo systemctl enable elastic-agent \nsudo systemctl start elastic-agent`; - const linuxCommand = `curl -L -O ${downloadBaseUrl}/downloads/beats/elastic-agent/elastic-agent-${agentVersion}-linux-x86_64.tar.gz ${curlDownloadSourceProxyArgs} + const linuxCommand = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-linux-x86_64.tar.gz ${curlDownloadSourceProxyArgs} tar xzvf elastic-agent-${agentVersion}-linux-x86_64.tar.gz cd elastic-agent-${agentVersion}-linux-x86_64 sudo ./elastic-agent install`; - const macCommand = `curl -L -O ${downloadBaseUrl}/downloads/beats/elastic-agent/elastic-agent-${agentVersion}-darwin-aarch64.tar.gz ${curlDownloadSourceProxyArgs} + const macCommand = `curl -L -O ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-darwin-aarch64.tar.gz ${curlDownloadSourceProxyArgs} tar xzvf elastic-agent-${agentVersion}-darwin-aarch64.tar.gz cd elastic-agent-${agentVersion}-darwin-aarch64 sudo ./elastic-agent install`; const windowsCommand = `$ProgressPreference = 'SilentlyContinue' -Invoke-WebRequest -Uri ${downloadBaseUrl}/downloads/beats/elastic-agent/elastic-agent-${agentVersion}-windows-x86_64.zip -OutFile elastic-agent-${agentVersion}-windows-x86_64.zip ${windowsDownloadSourceProxyArgs} +Invoke-WebRequest -Uri ${downloadBaseUrl}/beats/elastic-agent/elastic-agent-${agentVersion}-windows-x86_64.zip -OutFile elastic-agent-${agentVersion}-windows-x86_64.zip ${windowsDownloadSourceProxyArgs} Expand-Archive .\elastic-agent-${agentVersion}-windows-x86_64.zip -DestinationPath . cd elastic-agent-${agentVersion}-windows-x86_64 .\\elastic-agent.exe install`; diff --git a/x-pack/plugins/fleet/public/components/multiple_agent_policy_summary_line.test.tsx b/x-pack/plugins/fleet/public/components/multiple_agent_policy_summary_line.test.tsx index 22efe3f84d435..dca3da4a012d9 100644 --- a/x-pack/plugins/fleet/public/components/multiple_agent_policy_summary_line.test.tsx +++ b/x-pack/plugins/fleet/public/components/multiple_agent_policy_summary_line.test.tsx @@ -15,7 +15,8 @@ import type { AgentPolicy } from '../types'; import { MultipleAgentPoliciesSummaryLine } from './multiple_agent_policy_summary_line'; -describe('MultipleAgentPolicySummaryLine', () => { +// FLAKY: https://github.com/elastic/kibana/issues/200786 +describe.skip('MultipleAgentPolicySummaryLine', () => { let testRenderer: TestRenderer; const render = (agentPolicies: AgentPolicy[]) => diff --git a/x-pack/plugins/fleet/server/constants/fleet_es_assets.ts b/x-pack/plugins/fleet/server/constants/fleet_es_assets.ts index 621adc5b3b81c..384a77afd112e 100644 --- a/x-pack/plugins/fleet/server/constants/fleet_es_assets.ts +++ b/x-pack/plugins/fleet/server/constants/fleet_es_assets.ts @@ -11,7 +11,7 @@ import { getESAssetMetadata } from '../services/epm/elasticsearch/meta'; const meta = getESAssetMetadata(); -export const FLEET_INSTALL_FORMAT_VERSION = '1.3.0'; +export const FLEET_INSTALL_FORMAT_VERSION = '1.4.0'; export const FLEET_AGENT_POLICIES_SCHEMA_VERSION = '1.1.1'; diff --git a/x-pack/plugins/fleet/server/services/agents/status.ts b/x-pack/plugins/fleet/server/services/agents/status.ts index e960a7b955fea..384c7b1252554 100644 --- a/x-pack/plugins/fleet/server/services/agents/status.ts +++ b/x-pack/plugins/fleet/server/services/agents/status.ts @@ -271,7 +271,7 @@ export async function getIncomingDataByAgentsId({ } catch (error) { logger.debug(`Error getting incoming data for agents: ${error}`); throw new FleetError( - `Unable to retrive incoming data for agents due to error: ${error.message}` + `Unable to retrieve incoming data for agents due to error: ${error.message}` ); } } diff --git a/x-pack/plugins/fleet/server/services/backfill_agentless.test.ts b/x-pack/plugins/fleet/server/services/backfill_agentless.test.ts new file mode 100644 index 0000000000000..b0fd41fe83295 --- /dev/null +++ b/x-pack/plugins/fleet/server/services/backfill_agentless.test.ts @@ -0,0 +1,66 @@ +/* + * 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 { backfillPackagePolicySupportsAgentless } from './backfill_agentless'; +import { packagePolicyService } from './package_policy'; + +jest.mock('.', () => ({ + appContextService: { + getLogger: () => ({ + debug: jest.fn(), + }), + getInternalUserSOClientForSpaceId: jest.fn(), + getInternalUserSOClientWithoutSpaceExtension: () => ({ + find: jest.fn().mockImplementation((options) => { + if (options.type === 'ingest-agent-policies') { + return { + saved_objects: [{ id: 'agent_policy_1' }, { id: 'agent_policy_2' }], + }; + } else { + return { + saved_objects: [ + { + id: 'package_policy_1', + attributes: { + inputs: [], + policy_ids: ['agent_policy_1'], + supports_agentless: false, + }, + }, + ], + }; + } + }), + }), + }, +})); + +jest.mock('./package_policy', () => ({ + packagePolicyService: { + update: jest.fn(), + }, + getPackagePolicySavedObjectType: jest.fn().mockResolvedValue('ingest-package-policies'), +})); + +describe('backfill agentless package policies', () => { + it('should backfill package policies missing supports_agentless', async () => { + await backfillPackagePolicySupportsAgentless(undefined as any); + + expect(packagePolicyService.update).toHaveBeenCalledWith( + undefined, + undefined, + 'package_policy_1', + { + enabled: undefined, + inputs: [], + name: undefined, + policy_ids: ['agent_policy_1'], + supports_agentless: true, + } + ); + }); +}); diff --git a/x-pack/plugins/fleet/server/services/backfill_agentless.ts b/x-pack/plugins/fleet/server/services/backfill_agentless.ts new file mode 100644 index 0000000000000..b61265bd53c30 --- /dev/null +++ b/x-pack/plugins/fleet/server/services/backfill_agentless.ts @@ -0,0 +1,99 @@ +/* + * 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 { ElasticsearchClient } from '@kbn/core/server'; + +import pMap from 'p-map'; + +import { MAX_CONCURRENT_AGENT_POLICIES_OPERATIONS, SO_SEARCH_LIMIT } from '../constants'; + +import type { AgentPolicySOAttributes, PackagePolicy, PackagePolicySOAttributes } from '../types'; + +import { getAgentPolicySavedObjectType } from './agent_policy'; + +import { appContextService } from '.'; +import { getPackagePolicySavedObjectType, packagePolicyService } from './package_policy'; +import { mapPackagePolicySavedObjectToPackagePolicy } from './package_policies'; + +export async function backfillPackagePolicySupportsAgentless(esClient: ElasticsearchClient) { + const apSavedObjectType = await getAgentPolicySavedObjectType(); + const internalSoClientWithoutSpaceExtension = + appContextService.getInternalUserSOClientWithoutSpaceExtension(); + const findRes = await internalSoClientWithoutSpaceExtension.find<AgentPolicySOAttributes>({ + type: apSavedObjectType, + page: 1, + perPage: SO_SEARCH_LIMIT, + filter: `${apSavedObjectType}.attributes.supports_agentless:true`, + fields: [`id`], + namespaces: ['*'], + }); + + const agentPolicyIds = findRes.saved_objects.map((so) => so.id); + + if (agentPolicyIds.length === 0) { + return; + } + + const savedObjectType = await getPackagePolicySavedObjectType(); + const packagePoliciesToUpdate = ( + await appContextService + .getInternalUserSOClientWithoutSpaceExtension() + .find<PackagePolicySOAttributes>({ + type: savedObjectType, + fields: [ + 'name', + 'policy_ids', + 'supports_agentless', + 'enabled', + 'policy_ids', + 'inputs', + 'package', + ], + filter: `${savedObjectType}.attributes.package.name:cloud_security_posture AND (NOT ${savedObjectType}.attributes.supports_agentless:true) AND ${savedObjectType}.attributes.policy_ids:(${agentPolicyIds.join( + ' OR ' + )})`, + perPage: SO_SEARCH_LIMIT, + namespaces: ['*'], + }) + ).saved_objects.map((so) => mapPackagePolicySavedObjectToPackagePolicy(so, so.namespaces)); + + appContextService + .getLogger() + .debug( + `Backfilling supports_agentless on package policies: ${packagePoliciesToUpdate.map( + (policy) => policy.id + )}` + ); + + if (packagePoliciesToUpdate.length > 0) { + const getPackagePolicyUpdate = (packagePolicy: PackagePolicy) => ({ + name: packagePolicy.name, + enabled: packagePolicy.enabled, + policy_ids: packagePolicy.policy_ids, + inputs: packagePolicy.inputs, + supports_agentless: true, + }); + + await pMap( + packagePoliciesToUpdate, + (packagePolicy) => { + const soClient = appContextService.getInternalUserSOClientForSpaceId( + packagePolicy.spaceIds?.[0] + ); + return packagePolicyService.update( + soClient, + esClient, + packagePolicy.id, + getPackagePolicyUpdate(packagePolicy) + ); + }, + { + concurrency: MAX_CONCURRENT_AGENT_POLICIES_OPERATIONS, + } + ); + } +} diff --git a/x-pack/plugins/fleet/server/services/epm/archive/parse.ts b/x-pack/plugins/fleet/server/services/epm/archive/parse.ts index 8cccfe9982457..136bceb9355aa 100644 --- a/x-pack/plugins/fleet/server/services/epm/archive/parse.ts +++ b/x-pack/plugins/fleet/server/services/epm/archive/parse.ts @@ -59,7 +59,7 @@ const DEFAULT_INGEST_PIPELINE_VALUE = 'default'; const DEFAULT_INGEST_PIPELINE_FILE_NAME_YML = 'default.yml'; const DEFAULT_INGEST_PIPELINE_FILE_NAME_JSON = 'default.json'; -// Borrowed from https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/common/utils/expand_dotted.ts +// Borrowed from https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/common/utils/expand_dotted.ts // with some alterations around non-object values. The package registry service expands some dotted fields from manifest files, // so we need to do the same here. const expandDottedField = (dottedFieldName: string, val: unknown): object => { 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 9fc5383902ff3..e42c92b7f0cd4 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 @@ -816,6 +816,84 @@ describe('EPM template', () => { expect(mappings).toEqual(objectFieldWithPropertyReversedMapping); }); + it('tests processing object field with more specific properties without wildcard', () => { + const objectFieldWithPropertyReversedLiteralYml = ` +- name: labels + type: object + object_type: keyword + object_type_mapping_type: '*' +- name: labels.count + type: long +`; + const objectFieldWithPropertyReversedMapping = { + dynamic_templates: [ + { + labels: { + path_match: 'labels.*', + match_mapping_type: '*', + mapping: { + type: 'keyword', + }, + }, + }, + ], + properties: { + labels: { + dynamic: true, + type: 'object', + properties: { + count: { + type: 'long', + }, + }, + }, + }, + }; + const fields: Field[] = load(objectFieldWithPropertyReversedLiteralYml); + const processedFields = processFields(fields); + const mappings = generateMappings(processedFields); + expect(mappings).toEqual(objectFieldWithPropertyReversedMapping); + }); + + it('tests processing object field with more specific properties with wildcard', () => { + const objectFieldWithPropertyReversedLiteralYml = ` +- name: labels.* + type: object + object_type: keyword + object_type_mapping_type: '*' +- name: labels.count + type: long +`; + const objectFieldWithPropertyReversedMapping = { + dynamic_templates: [ + { + 'labels.*': { + path_match: 'labels.*', + match_mapping_type: '*', + mapping: { + type: 'keyword', + }, + }, + }, + ], + properties: { + labels: { + dynamic: true, + type: 'object', + properties: { + count: { + type: 'long', + }, + }, + }, + }, + }; + const fields: Field[] = load(objectFieldWithPropertyReversedLiteralYml); + const processedFields = processFields(fields); + const mappings = generateMappings(processedFields); + expect(mappings).toEqual(objectFieldWithPropertyReversedMapping); + }); + it('tests processing object field with subobjects set to false (case B)', () => { const objectFieldWithPropertyReversedLiteralYml = ` - name: b.labels.* 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 d44cd57a2c5ba..93695c68add0a 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 @@ -310,6 +310,124 @@ function _generateMappings( } } + function addObjectAsDynamicMapping(field: Field) { + const path = ctx.groupFieldName ? `${ctx.groupFieldName}.${field.name}` : field.name; + const pathMatch = path.includes('*') ? path : `${path}.*`; + + let dynProperties: Properties = getDefaultProperties(field); + let matchingType: string | undefined; + switch (field.object_type) { + case 'histogram': + dynProperties = histogram(field); + matchingType = field.object_type_mapping_type ?? '*'; + break; + case 'ip': + case 'keyword': + case 'match_only_text': + case 'text': + case 'wildcard': + dynProperties.type = field.object_type; + matchingType = field.object_type_mapping_type ?? 'string'; + break; + case 'scaled_float': + dynProperties = scaledFloat(field); + matchingType = field.object_type_mapping_type ?? '*'; + break; + case 'aggregate_metric_double': + dynProperties.type = field.object_type; + dynProperties.metrics = field.metrics; + dynProperties.default_metric = field.default_metric; + matchingType = field.object_type_mapping_type ?? '*'; + break; + case 'double': + case 'float': + case 'half_float': + dynProperties.type = field.object_type; + if (isIndexModeTimeSeries) { + dynProperties.time_series_metric = field.metric_type; + } + matchingType = field.object_type_mapping_type ?? 'double'; + break; + case 'byte': + case 'long': + case 'short': + case 'unsigned_long': + dynProperties.type = field.object_type; + if (isIndexModeTimeSeries) { + dynProperties.time_series_metric = field.metric_type; + } + matchingType = field.object_type_mapping_type ?? 'long'; + break; + case 'integer': + // Map integers as long, as in other cases. + dynProperties.type = 'long'; + if (isIndexModeTimeSeries) { + dynProperties.time_series_metric = field.metric_type; + } + matchingType = field.object_type_mapping_type ?? 'long'; + break; + case 'boolean': + dynProperties.type = field.object_type; + if (isIndexModeTimeSeries) { + dynProperties.time_series_metric = field.metric_type; + } + matchingType = field.object_type_mapping_type ?? field.object_type; + break; + case 'group': + if (!field?.fields) { + break; + } + const subFields = field.fields.map((subField) => ({ + ...subField, + type: 'object', + object_type: subField.object_type ?? subField.type, + })); + const mappings = _generateMappings( + subFields, + { + ...ctx, + groupFieldName: ctx.groupFieldName ? `${ctx.groupFieldName}.${field.name}` : field.name, + }, + isIndexModeTimeSeries + ); + if (mappings.hasDynamicTemplateMappings) { + hasDynamicTemplateMappings = true; + } + break; + case 'flattened': + dynProperties.type = field.object_type; + matchingType = field.object_type_mapping_type ?? 'object'; + break; + default: + throw new PackageInvalidArchiveError( + `No dynamic mapping generated for field ${path} of type ${field.object_type}` + ); + } + + if (field.dimension && isIndexModeTimeSeries) { + dynProperties.time_series_dimension = field.dimension; + } + + // When a wildcard field specifies the subobjects setting, + // the parent intermediate object should set the subobjects + // setting. + // + // For example, if a wildcard field `foo.*` has subobjects, + // we should set subobjects on the intermediate object `foo`. + // + if (field.subobjects !== undefined && path.includes('*')) { + subobjects = field.subobjects; + } + + if (dynProperties && matchingType) { + addDynamicMappingWithIntermediateObjects(path, pathMatch, matchingType, dynProperties); + + // Add the parent object as static property, this is needed for + // index templates not using `"dynamic": true`. + addParentObjectAsStaticProperty(field); + } + } + // TODO: this can happen when the fields property in fields.yml is present but empty // Maybe validation should be moved to fields/field.ts if (fields) { @@ -371,123 +489,7 @@ function _generateMappings( } if (type === 'object' && field.object_type) { - const path = ctx.groupFieldName ? `${ctx.groupFieldName}.${field.name}` : field.name; - const pathMatch = path.includes('*') ? path : `${path}.*`; - - let dynProperties: Properties = getDefaultProperties(field); - let matchingType: string | undefined; - switch (field.object_type) { - case 'histogram': - dynProperties = histogram(field); - matchingType = field.object_type_mapping_type ?? '*'; - break; - case 'ip': - case 'keyword': - case 'match_only_text': - case 'text': - case 'wildcard': - dynProperties.type = field.object_type; - matchingType = field.object_type_mapping_type ?? 'string'; - break; - case 'scaled_float': - dynProperties = scaledFloat(field); - matchingType = field.object_type_mapping_type ?? '*'; - break; - case 'aggregate_metric_double': - dynProperties.type = field.object_type; - dynProperties.metrics = field.metrics; - dynProperties.default_metric = field.default_metric; - matchingType = field.object_type_mapping_type ?? '*'; - break; - case 'double': - case 'float': - case 'half_float': - dynProperties.type = field.object_type; - if (isIndexModeTimeSeries) { - dynProperties.time_series_metric = field.metric_type; - } - matchingType = field.object_type_mapping_type ?? 'double'; - break; - case 'byte': - case 'long': - case 'short': - case 'unsigned_long': - dynProperties.type = field.object_type; - if (isIndexModeTimeSeries) { - dynProperties.time_series_metric = field.metric_type; - } - matchingType = field.object_type_mapping_type ?? 'long'; - break; - case 'integer': - // Map integers as long, as in other cases. - dynProperties.type = 'long'; - if (isIndexModeTimeSeries) { - dynProperties.time_series_metric = field.metric_type; - } - matchingType = field.object_type_mapping_type ?? 'long'; - break; - case 'boolean': - dynProperties.type = field.object_type; - if (isIndexModeTimeSeries) { - dynProperties.time_series_metric = field.metric_type; - } - matchingType = field.object_type_mapping_type ?? field.object_type; - break; - case 'group': - if (!field?.fields) { - break; - } - const subFields = field.fields.map((subField) => ({ - ...subField, - type: 'object', - object_type: subField.object_type ?? subField.type, - })); - const mappings = _generateMappings( - subFields, - { - ...ctx, - groupFieldName: ctx.groupFieldName - ? `${ctx.groupFieldName}.${field.name}` - : field.name, - }, - isIndexModeTimeSeries - ); - if (mappings.hasDynamicTemplateMappings) { - hasDynamicTemplateMappings = true; - } - break; - case 'flattened': - dynProperties.type = field.object_type; - matchingType = field.object_type_mapping_type ?? 'object'; - break; - default: - throw new PackageInvalidArchiveError( - `No dynamic mapping generated for field ${path} of type ${field.object_type}` - ); - } - - if (field.dimension && isIndexModeTimeSeries) { - dynProperties.time_series_dimension = field.dimension; - } - - // When a wildcard field specifies the subobjects setting, - // the parent intermediate object should set the subobjects - // setting. - // - // For example, if a wildcard field `foo.*` has subobjects, - // we should set subobjects on the intermediate object `foo`. - // - if (field.subobjects !== undefined && path.includes('*')) { - subobjects = field.subobjects; - } - - if (dynProperties && matchingType) { - addDynamicMappingWithIntermediateObjects(path, pathMatch, matchingType, dynProperties); - - // Add the parent object as static property, this is needed for - // index templates not using `"dynamic": true`. - addParentObjectAsStaticProperty(field); - } + addObjectAsDynamicMapping(field); } else { let fieldProps = getDefaultProperties(field); @@ -503,6 +505,12 @@ function _generateMappings( }, isIndexModeTimeSeries ); + if (field.object_type) { + // A group can have an object_type if it has been merged with an object during deduplication, + // generate also the dynamic mapping for the object. + addObjectAsDynamicMapping(field); + mappings.hasDynamicTemplateMappings = true; + } if (mappings.hasNonDynamicTemplateMappings) { fieldProps = { properties: diff --git a/x-pack/plugins/fleet/server/services/epm/packages/install_state_machine/steps/step_save_system_object.test.ts b/x-pack/plugins/fleet/server/services/epm/packages/install_state_machine/steps/step_save_system_object.test.ts index 8d80c236aefb0..c4ae211c58fc5 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/install_state_machine/steps/step_save_system_object.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/install_state_machine/steps/step_save_system_object.test.ts @@ -13,14 +13,12 @@ import { } from '@kbn/core/server/mocks'; import { DEFAULT_SPACE_ID } from '@kbn/spaces-plugin/common/constants'; +import { FLEET_INSTALL_FORMAT_VERSION } from '../../../../../constants'; import { PACKAGES_SAVED_OBJECT_TYPE } from '../../../../../../common/constants'; - import { appContextService } from '../../../../app_context'; import { createAppContextStartContractMock } from '../../../../../mocks'; - import { auditLoggingService } from '../../../../audit_logging'; import { packagePolicyService } from '../../../../package_policy'; - import { createArchiveIteratorFromMap } from '../../../archive/archive_iterator'; import { stepSaveSystemObject } from './step_save_system_object'; @@ -94,7 +92,7 @@ describe('updateLatestExecutedState', () => { 'epm-packages', 'test-integration', { - install_format_schema_version: '1.3.0', + install_format_schema_version: FLEET_INSTALL_FORMAT_VERSION, install_status: 'installed', install_version: '1.0.0', latest_install_failed_attempts: [], @@ -161,7 +159,7 @@ describe('updateLatestExecutedState', () => { 'epm-packages', 'test-integration', { - install_format_schema_version: '1.3.0', + install_format_schema_version: FLEET_INSTALL_FORMAT_VERSION, install_status: 'installed', install_version: '1.0.0', latest_install_failed_attempts: [], diff --git a/x-pack/plugins/fleet/server/services/setup.test.ts b/x-pack/plugins/fleet/server/services/setup.test.ts index 8add6942e9da7..d145f264ec3e8 100644 --- a/x-pack/plugins/fleet/server/services/setup.test.ts +++ b/x-pack/plugins/fleet/server/services/setup.test.ts @@ -33,6 +33,7 @@ jest.mock('./epm/elasticsearch/template/install', () => { ...jest.requireActual('./epm/elasticsearch/template/install'), }; }); +jest.mock('./backfill_agentless'); const mockedMethodThrowsError = (mockFn: jest.Mock) => mockFn.mockImplementation(() => { diff --git a/x-pack/plugins/fleet/server/services/setup.ts b/x-pack/plugins/fleet/server/services/setup.ts index 24d655a4cae16..e17d8222cfd0a 100644 --- a/x-pack/plugins/fleet/server/services/setup.ts +++ b/x-pack/plugins/fleet/server/services/setup.ts @@ -62,6 +62,7 @@ import { ensureDeleteUnenrolledAgentsSetting, getPreconfiguredDeleteUnenrolledAgentsSettingFromConfig, } from './preconfiguration/delete_unenrolled_agent_setting'; +import { backfillPackagePolicySupportsAgentless } from './backfill_agentless'; export interface SetupStatus { isInitialized: boolean; @@ -305,6 +306,9 @@ async function createSetupSideEffects( await ensureAgentPoliciesFleetServerKeysAndPolicies({ soClient, esClient, logger }); stepSpan?.end(); + logger.debug('Backfilling package policy supports_agentless field'); + await backfillPackagePolicySupportsAgentless(esClient); + const nonFatalErrors = [ ...preconfiguredPackagesNonFatalErrors, ...(messageSigningServiceNonFatalError ? [messageSigningServiceNonFatalError] : []), diff --git a/x-pack/plugins/fleet/server/telemetry/sender.ts b/x-pack/plugins/fleet/server/telemetry/sender.ts index bdecd6cc8d0bf..0823fbe5c36f1 100644 --- a/x-pack/plugins/fleet/server/telemetry/sender.ts +++ b/x-pack/plugins/fleet/server/telemetry/sender.ts @@ -23,7 +23,7 @@ import { TelemetryQueue } from './queue'; import type { FleetTelemetryChannel, FleetTelemetryChannelEvents } from './types'; /** - * Simplified version of https://github.com/elastic/kibana/blob/master/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts + * Simplified version of https://github.com/elastic/kibana/blob/master/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/sender.ts * Sends batched events to telemetry v3 api */ export class TelemetryEventsSender { diff --git a/x-pack/plugins/index_management/__jest__/client_integration/helpers/setup_environment.tsx b/x-pack/plugins/index_management/__jest__/client_integration/helpers/setup_environment.tsx index 24f641ae2833f..535e0219bf823 100644 --- a/x-pack/plugins/index_management/__jest__/client_integration/helpers/setup_environment.tsx +++ b/x-pack/plugins/index_management/__jest__/client_integration/helpers/setup_environment.tsx @@ -95,6 +95,7 @@ const appDependencies = { monitor: true, manageEnrich: true, monitorEnrich: true, + manageIndexTemplates: true, }, } as any; diff --git a/x-pack/plugins/index_management/public/application/app_context.tsx b/x-pack/plugins/index_management/public/application/app_context.tsx index 3573ae33812d9..1019d580dec5d 100644 --- a/x-pack/plugins/index_management/public/application/app_context.tsx +++ b/x-pack/plugins/index_management/public/application/app_context.tsx @@ -84,6 +84,7 @@ export interface AppDependencies { monitor: boolean; manageEnrich: boolean; monitorEnrich: boolean; + manageIndexTemplates: boolean; }; } diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/auth_provider.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/auth_provider.tsx deleted file mode 100644 index 88da23007a4f6..0000000000000 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/auth_provider.tsx +++ /dev/null @@ -1,26 +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 from 'react'; - -import { AuthorizationProvider } from '../shared_imports'; -import { useComponentTemplatesContext } from '../component_templates_context'; - -export const ComponentTemplatesAuthProvider: React.FunctionComponent<{ - children?: React.ReactNode; -}> = ({ children }) => { - const { httpClient, apiBasePath } = useComponentTemplatesContext(); - - return ( - <AuthorizationProvider - privilegesEndpoint={`${apiBasePath}/component_templates/privileges`} - httpClient={httpClient} - > - {children} - </AuthorizationProvider> - ); -}; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/component_template_list_container.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/component_template_list_container.tsx index 30cec15545610..e3583b41c1108 100644 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/component_template_list_container.tsx +++ b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/component_template_list_container.tsx @@ -11,8 +11,6 @@ import { RouteComponentProps } from 'react-router-dom'; import qs from 'query-string'; import { useExecutionContext } from '../shared_imports'; import { useComponentTemplatesContext } from '../component_templates_context'; -import { ComponentTemplatesAuthProvider } from './auth_provider'; -import { ComponentTemplatesWithPrivileges } from './with_privileges'; import { ComponentTemplateList } from './component_template_list'; interface MatchParams { @@ -39,14 +37,10 @@ export const ComponentTemplateListContainer: React.FunctionComponent< const filter = urlParams.filter ?? ''; return ( - <ComponentTemplatesAuthProvider> - <ComponentTemplatesWithPrivileges> - <ComponentTemplateList - componentTemplateName={componentTemplateName} - history={history} - filter={String(filter)} - /> - </ComponentTemplatesWithPrivileges> - </ComponentTemplatesAuthProvider> + <ComponentTemplateList + componentTemplateName={componentTemplateName} + history={history} + filter={String(filter)} + /> ); }; diff --git a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/with_privileges.tsx b/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/with_privileges.tsx deleted file mode 100644 index 5ae9b2f14ec82..0000000000000 --- a/x-pack/plugins/index_management/public/application/components/component_templates/component_template_list/with_privileges.tsx +++ /dev/null @@ -1,83 +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 { FormattedMessage } from '@kbn/i18n-react'; -import React, { FunctionComponent } from 'react'; - -import { - PageLoading, - PageError, - useAuthorizationContext, - WithPrivileges, - NotAuthorizedSection, -} from '../shared_imports'; -import { APP_CLUSTER_REQUIRED_PRIVILEGES } from '../constants'; - -export const ComponentTemplatesWithPrivileges: FunctionComponent<{ - children?: React.ReactNode; -}> = ({ children }) => { - const { apiError } = useAuthorizationContext(); - - if (apiError) { - return ( - <PageError - title={ - <FormattedMessage - id="xpack.idxMgmt.home.componentTemplates.checkingPrivilegesErrorMessage" - defaultMessage="Error fetching user privileges from the server." - /> - } - error={apiError} - /> - ); - } - - return ( - <WithPrivileges - privileges={APP_CLUSTER_REQUIRED_PRIVILEGES.map((privilege) => `cluster.${privilege}`)} - > - {({ isLoading, hasPrivileges, privilegesMissing }) => { - if (isLoading) { - return ( - <PageLoading> - <FormattedMessage - id="xpack.idxMgmt.home.componentTemplates.checkingPrivilegesDescription" - defaultMessage="Checking privileges…" - /> - </PageLoading> - ); - } - - if (!hasPrivileges) { - return ( - <NotAuthorizedSection - title={ - <FormattedMessage - id="xpack.idxMgmt.home.componentTemplates.deniedPrivilegeTitle" - defaultMessage="Cluster privileges required" - /> - } - message={ - <FormattedMessage - id="xpack.idxMgmt.home.componentTemplates.deniedPrivilegeDescription" - defaultMessage="To use Component Templates, you must have {privilegesCount, - plural, one {this cluster privilege} other {these cluster privileges}}: {missingPrivileges}." - values={{ - missingPrivileges: privilegesMissing.cluster!.join(', '), - privilegesCount: privilegesMissing.cluster!.length, - }} - /> - } - /> - ); - } - - return <>{children}</>; - }} - </WithPrivileges> - ); -}; diff --git a/x-pack/plugins/index_management/public/application/mount_management_section.ts b/x-pack/plugins/index_management/public/application/mount_management_section.ts index 83cf620a0e8e0..003f5279ae520 100644 --- a/x-pack/plugins/index_management/public/application/mount_management_section.ts +++ b/x-pack/plugins/index_management/public/application/mount_management_section.ts @@ -73,7 +73,8 @@ export function getIndexManagementDependencies({ }): AppDependencies { const { docLinks, application, uiSettings, settings } = core; const { url } = startDependencies.share; - const { monitor, manageEnrich, monitorEnrich } = application.capabilities.index_management; + const { monitor, manageEnrich, monitorEnrich, manageIndexTemplates } = + application.capabilities.index_management; return { core: { @@ -109,6 +110,7 @@ export function getIndexManagementDependencies({ monitor: !!monitor, manageEnrich: !!manageEnrich, monitorEnrich: !!monitorEnrich, + manageIndexTemplates: !!manageIndexTemplates, }, }; } diff --git a/x-pack/plugins/index_management/public/application/sections/home/home.tsx b/x-pack/plugins/index_management/public/application/sections/home/home.tsx index 2d0fc7d4ec108..53ef500f597e0 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/home.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/home.tsx @@ -66,7 +66,10 @@ export const IndexManagementHome: React.FunctionComponent<RouteComponentProps<Ma /> ), }, - { + ]; + + if (privs.manageIndexTemplates) { + tabs.push({ id: Section.ComponentTemplates, name: ( <FormattedMessage @@ -74,8 +77,8 @@ export const IndexManagementHome: React.FunctionComponent<RouteComponentProps<Ma defaultMessage="Component Templates" /> ), - }, - ]; + }); + } if (privs.monitorEnrich) { tabs.push({ @@ -139,14 +142,16 @@ export const IndexManagementHome: React.FunctionComponent<RouteComponentProps<Ma path={[`/${Section.IndexTemplates}`, `/${Section.IndexTemplates}/:templateName?`]} component={TemplateList} /> - <Route - exact - path={[ - `/${Section.ComponentTemplates}`, - `/${Section.ComponentTemplates}/:componentTemplateName?`, - ]} - component={ComponentTemplateList} - /> + {privs.manageIndexTemplates && ( + <Route + exact + path={[ + `/${Section.ComponentTemplates}`, + `/${Section.ComponentTemplates}/:componentTemplateName?`, + ]} + component={ComponentTemplateList} + /> + )} {privs.monitorEnrich && ( <Route exact path={`/${Section.EnrichPolicies}`} component={EnrichPoliciesList} /> )} diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/aliases_details.tsx b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/aliases_details.tsx index 934c7c31cdbfa..ae644b78e2840 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/aliases_details.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/aliases_details.tsx @@ -7,7 +7,6 @@ import React, { FunctionComponent, useState } from 'react'; import { css } from '@emotion/react'; -import { euiThemeVars } from '@kbn/ui-theme'; import { i18n } from '@kbn/i18n'; import { EuiBadge, @@ -23,6 +22,7 @@ import { EuiText, EuiTextColor, EuiTitle, + useEuiFontSize, } from '@elastic/eui'; import { Index } from '../../../../../../../common'; @@ -31,6 +31,7 @@ import { OverviewCard } from './overview_card'; const MAX_VISIBLE_ALIASES = 3; export const AliasesDetails: FunctionComponent<{ aliases: Index['aliases'] }> = ({ aliases }) => { + const largeFontSize = useEuiFontSize('l').fontSize; const [isShowingAliases, setIsShowingAliases] = useState<boolean>(false); if (!Array.isArray(aliases)) { return null; @@ -58,7 +59,7 @@ export const AliasesDetails: FunctionComponent<{ aliases: Index['aliases'] }> = <EuiFlexItem grow={false}> <EuiText css={css` - font-size: ${euiThemeVars.euiFontSizeL}; + font-size: ${largeFontSize}; `} > {aliases.length} diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/data_stream_details.tsx b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/data_stream_details.tsx index a9b2768e140bb..68d61d086a5f7 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/data_stream_details.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/data_stream_details.tsx @@ -7,9 +7,16 @@ import React, { FunctionComponent, ReactNode } from 'react'; import { i18n } from '@kbn/i18n'; -import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiIcon, EuiText, EuiTextColor } from '@elastic/eui'; +import { + EuiButton, + EuiFlexGroup, + EuiFlexItem, + EuiIcon, + EuiText, + EuiTextColor, + useEuiFontSize, +} from '@elastic/eui'; import { css } from '@emotion/react'; -import { euiThemeVars } from '@kbn/ui-theme'; import { SectionLoading } from '@kbn/es-ui-shared-plugin/public'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -22,6 +29,7 @@ import { OverviewCard } from './overview_card'; export const DataStreamDetails: FunctionComponent<{ dataStreamName: string }> = ({ dataStreamName, }) => { + const largeFontSize = useEuiFontSize('l').fontSize; const { error, data: dataStream, isLoading, resendRequest } = useLoadDataStream(dataStreamName); const { core: { getUrlForApp }, @@ -32,7 +40,7 @@ export const DataStreamDetails: FunctionComponent<{ dataStreamName: string }> = <EuiFlexItem grow={false}> <EuiText css={css` - font-size: ${euiThemeVars.euiFontSizeL}; + font-size: ${largeFontSize}; `} > {dataStream?.generation} diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/overview_card.tsx b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/overview_card.tsx index 4aa6c804dc40b..07e4b45c3a69c 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/overview_card.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/overview_card.tsx @@ -7,8 +7,14 @@ import React, { FunctionComponent, ReactNode } from 'react'; import { css } from '@emotion/react'; -import { euiThemeVars } from '@kbn/ui-theme'; -import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiSplitPanel, EuiTitle } from '@elastic/eui'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiSpacer, + EuiSplitPanel, + EuiTitle, + useEuiTheme, +} from '@elastic/eui'; interface Props { title: string; @@ -29,6 +35,7 @@ export const OverviewCard: FunctionComponent<Props> = ({ footer: { left: footerLeft, right: footerRight } = {}, 'data-test-subj': dataTestSubj, }) => { + const { euiTheme } = useEuiTheme(); return ( <EuiFlexItem> <EuiSplitPanel.Outer grow hasBorder={true} data-test-subj={dataTestSubj}> @@ -43,7 +50,7 @@ export const OverviewCard: FunctionComponent<Props> = ({ wrap={true} alignItems="center" css={css` - min-height: ${euiThemeVars.euiButtonHeightSmall}; + min-height: ${euiTheme.size.xl}; `} > <EuiFlexItem grow={false}>{contentLeft}</EuiFlexItem> diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/size_doc_count_details.tsx b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/size_doc_count_details.tsx index 40294d76b2698..617fb0f975cb3 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/size_doc_count_details.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/size_doc_count_details.tsx @@ -7,9 +7,15 @@ import React, { FunctionComponent } from 'react'; import { css } from '@emotion/react'; -import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiText, EuiTextColor } from '@elastic/eui'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiIcon, + EuiText, + EuiTextColor, + useEuiFontSize, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { euiThemeVars } from '@kbn/ui-theme'; import type { Index } from '../../../../../../../common'; import { useAppContext } from '../../../../../app_context'; import { OverviewCard } from './overview_card'; @@ -18,6 +24,7 @@ export const SizeDocCountDetails: FunctionComponent<{ size: Index['size']; documents: Index['documents']; }> = ({ size, documents }) => { + const largeFontSize = useEuiFontSize('l').fontSize; const { config } = useAppContext(); if (!config.enableSizeAndDocCount) { return null; @@ -34,7 +41,7 @@ export const SizeDocCountDetails: FunctionComponent<{ <EuiFlexItem grow={false}> <EuiText css={css` - font-size: ${euiThemeVars.euiFontSizeL}; + font-size: ${largeFontSize}; `} > {size} diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/status_details.tsx b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/status_details.tsx index 8895daceceaf9..82531bfda797c 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/status_details.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/status_details.tsx @@ -15,9 +15,9 @@ import { EuiText, EuiTextColor, EuiBadgeProps, + useEuiFontSize, } from '@elastic/eui'; import { css } from '@emotion/react'; -import { euiThemeVars } from '@kbn/ui-theme'; import { useAppContext } from '../../../../../app_context'; import { Index } from '../../../../../../../common'; @@ -54,6 +54,7 @@ export const StatusDetails: FunctionComponent<{ status: Index['status']; health: Index['health']; }> = ({ documents, documentsDeleted, status, health }) => { + const largeFontSize = useEuiFontSize('l').fontSize; const { config } = useAppContext(); if (!config.enableIndexStats || !health) { return null; @@ -72,7 +73,7 @@ export const StatusDetails: FunctionComponent<{ <EuiText color={status === 'close' ? 'danger' : 'success'} css={css` - font-size: ${euiThemeVars.euiFontSizeL}; + font-size: ${largeFontSize}; `} > {status === 'close' diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/storage_details.tsx b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/storage_details.tsx index 22b47815ce957..1d90b86d4b4b5 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/storage_details.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_overview/storage_details.tsx @@ -8,8 +8,14 @@ import React, { FunctionComponent } from 'react'; import { css } from '@emotion/react'; import { i18n } from '@kbn/i18n'; -import { euiThemeVars } from '@kbn/ui-theme'; -import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiText, EuiTextColor } from '@elastic/eui'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiIcon, + EuiText, + EuiTextColor, + useEuiFontSize, +} from '@elastic/eui'; import { useAppContext } from '../../../../../app_context'; import { Index } from '../../../../../../../common'; @@ -21,6 +27,7 @@ export const StorageDetails: FunctionComponent<{ primary: Index['primary']; replica: Index['replica']; }> = ({ primarySize, size, primary, replica }) => { + const largeFontSize = useEuiFontSize('l').fontSize; const { config } = useAppContext(); if (!config.enableIndexStats) { return null; @@ -37,7 +44,7 @@ export const StorageDetails: FunctionComponent<{ <EuiFlexItem grow={false}> <EuiText css={css` - font-size: ${euiThemeVars.euiFontSizeL}; + font-size: ${largeFontSize}; `} > {primarySize} @@ -57,7 +64,7 @@ export const StorageDetails: FunctionComponent<{ <EuiFlexItem grow={false}> <EuiText css={css` - font-size: ${euiThemeVars.euiFontSizeL}; + font-size: ${largeFontSize}; `} > {size} diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/semantic_text_banner.tsx b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/semantic_text_banner.tsx index b07886c4526f5..2ebcde354bab3 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/semantic_text_banner.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/semantic_text_banner.tsx @@ -57,10 +57,10 @@ export function SemanticTextBanner({ return isSemanticTextBannerDisplayable && isSemanticTextEnabled ? ( <> - <EuiPanel color="success" data-test-subj="indexDetailsMappingsSemanticTextBanner"> + <EuiPanel color="accentSecondary" data-test-subj="indexDetailsMappingsSemanticTextBanner"> <EuiFlexGroup> <EuiFlexItem> - <EuiText size="m" color="success"> + <EuiText size="m" color="primary"> {isPlatinumLicense ? platinumLicenseMessage : defaultLicenseMessage} </EuiText> </EuiFlexItem> diff --git a/x-pack/plugins/index_management/public/plugin.ts b/x-pack/plugins/index_management/public/plugin.ts index 06adcc75d80b3..35996a43e2cd6 100644 --- a/x-pack/plugins/index_management/public/plugin.ts +++ b/x-pack/plugins/index_management/public/plugin.ts @@ -105,8 +105,12 @@ export class IndexMgmtUIPlugin const { fleet, usageCollection, management, cloud } = plugins; this.capabilities$.subscribe((capabilities) => { - const { monitor, manageEnrich, monitorEnrich } = capabilities.index_management; - if (this.config.isIndexManagementUiEnabled && (monitor || manageEnrich || monitorEnrich)) { + const { monitor, manageEnrich, monitorEnrich, manageIndexTemplates } = + capabilities.index_management; + if ( + this.config.isIndexManagementUiEnabled && + (monitor || manageEnrich || monitorEnrich || manageIndexTemplates) + ) { management.sections.section.data.registerApp({ id: PLUGIN.id, title: i18n.translate('xpack.idxMgmt.appTitle', { defaultMessage: 'Index Management' }), diff --git a/x-pack/plugins/index_management/server/plugin.ts b/x-pack/plugins/index_management/server/plugin.ts index ab6b058cddc78..d6689f02255bc 100644 --- a/x-pack/plugins/index_management/server/plugin.ts +++ b/x-pack/plugins/index_management/server/plugin.ts @@ -46,6 +46,10 @@ export class IndexMgmtServerPlugin implements Plugin<IndexManagementPluginSetup, requiredClusterPrivileges: ['manage_enrich'], ui: ['manageEnrich'], }, + { + requiredClusterPrivileges: ['manage_index_templates'], + ui: ['manageIndexTemplates'], + }, { // manage_index_templates is also required, but we will disable specific parts of the // UI if this privilege is missing. diff --git a/x-pack/plugins/index_management/server/routes/api/component_templates/index.ts b/x-pack/plugins/index_management/server/routes/api/component_templates/index.ts index 535d6c9352a73..be1891e3069c9 100644 --- a/x-pack/plugins/index_management/server/routes/api/component_templates/index.ts +++ b/x-pack/plugins/index_management/server/routes/api/component_templates/index.ts @@ -11,7 +11,6 @@ import { registerGetAllRoute } from './register_get_route'; import { registerCreateRoute } from './register_create_route'; import { registerUpdateRoute } from './register_update_route'; import { registerDeleteRoute } from './register_delete_route'; -import { registerPrivilegesRoute } from './register_privileges_route'; import { registerGetDatastreams, registerReferencedIndexTemplateMeta, @@ -24,5 +23,4 @@ export function registerComponentTemplateRoutes(dependencies: RouteDependencies) registerGetDatastreams(dependencies); registerReferencedIndexTemplateMeta(dependencies); registerDeleteRoute(dependencies); - registerPrivilegesRoute(dependencies); } diff --git a/x-pack/plugins/index_management/server/routes/api/component_templates/register_privileges_route.test.ts b/x-pack/plugins/index_management/server/routes/api/component_templates/register_privileges_route.test.ts deleted file mode 100644 index e4a9f34cca4c7..0000000000000 --- a/x-pack/plugins/index_management/server/routes/api/component_templates/register_privileges_route.test.ts +++ /dev/null @@ -1,155 +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 { httpServerMock, httpServiceMock } from '@kbn/core/server/mocks'; -import { kibanaResponseFactory, RequestHandlerContext, RequestHandler } from '@kbn/core/server'; - -import { IndexDataEnricher } from '../../../services/index_data_enricher'; - -import { registerPrivilegesRoute } from './register_privileges_route'; - -jest.mock('../../../services/index_data_enricher'); - -const httpService = httpServiceMock.createSetupContract(); - -const mockedIndexDataEnricher = new IndexDataEnricher(); - -const mockRouteContext = ({ hasPrivileges }: { hasPrivileges: unknown }): RequestHandlerContext => { - const routeContextMock = { - core: { - elasticsearch: { - client: { - asCurrentUser: { - security: { - hasPrivileges, - }, - }, - }, - }, - }, - } as unknown as RequestHandlerContext; - - return routeContextMock; -}; - -describe('GET privileges', () => { - let routeHandler: RequestHandler<any, any, any>; - - beforeEach(() => { - const router = httpService.createRouter(); - - registerPrivilegesRoute({ - router, - config: { - isSecurityEnabled: () => true, - isLegacyTemplatesEnabled: true, - isIndexStatsEnabled: true, - isSizeAndDocCountEnabled: false, - isDataStreamStatsEnabled: true, - enableMappingsSourceFieldSection: true, - enableTogglingDataRetention: true, - enableProjectLevelRetentionChecks: false, - }, - indexDataEnricher: mockedIndexDataEnricher, - lib: { - handleEsError: jest.fn(), - }, - }); - - routeHandler = router.get.mock.calls[0][1]; - }); - - it('should return the correct response when a user has privileges', async () => { - const privilegesResponseMock = { - username: 'elastic', - has_all_requested: true, - cluster: { manage_index_templates: true }, - index: {}, - application: {}, - }; - - const routeContextMock = mockRouteContext({ - hasPrivileges: jest.fn().mockResolvedValueOnce(privilegesResponseMock), - }); - - const request = httpServerMock.createKibanaRequest(); - const response = await routeHandler(routeContextMock, request, kibanaResponseFactory); - - expect(response.payload).toEqual({ - hasAllPrivileges: true, - missingPrivileges: { - cluster: [], - }, - }); - }); - - it('should return the correct response when a user does not have privileges', async () => { - const privilegesResponseMock = { - username: 'elastic', - has_all_requested: false, - cluster: { manage_index_templates: false }, - index: {}, - application: {}, - }; - - const routeContextMock = mockRouteContext({ - hasPrivileges: jest.fn().mockResolvedValueOnce(privilegesResponseMock), - }); - - const request = httpServerMock.createKibanaRequest(); - const response = await routeHandler(routeContextMock, request, kibanaResponseFactory); - - expect(response.payload).toEqual({ - hasAllPrivileges: false, - missingPrivileges: { - cluster: ['manage_index_templates'], - }, - }); - }); - - describe('With security disabled', () => { - beforeEach(() => { - const router = httpService.createRouter(); - - registerPrivilegesRoute({ - router, - config: { - isSecurityEnabled: () => false, - isLegacyTemplatesEnabled: true, - isIndexStatsEnabled: true, - isSizeAndDocCountEnabled: false, - isDataStreamStatsEnabled: true, - enableMappingsSourceFieldSection: true, - enableTogglingDataRetention: true, - enableProjectLevelRetentionChecks: false, - }, - indexDataEnricher: mockedIndexDataEnricher, - lib: { - handleEsError: jest.fn(), - }, - }); - - routeHandler = router.get.mock.calls[0][1]; - }); - - it('should return the default privileges response', async () => { - const routeContextMock = mockRouteContext({ - hasPrivileges: jest.fn(), - }); - - const request = httpServerMock.createKibanaRequest(); - const response = await routeHandler(routeContextMock, request, kibanaResponseFactory); - - expect(response.payload).toEqual({ - hasAllPrivileges: true, - missingPrivileges: { - cluster: [], - }, - }); - }); - }); -}); diff --git a/x-pack/plugins/index_management/server/routes/api/component_templates/register_privileges_route.ts b/x-pack/plugins/index_management/server/routes/api/component_templates/register_privileges_route.ts deleted file mode 100644 index a053eb44657cb..0000000000000 --- a/x-pack/plugins/index_management/server/routes/api/component_templates/register_privileges_route.ts +++ /dev/null @@ -1,64 +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 type { Privileges } from '@kbn/es-ui-shared-plugin/public'; -import { RouteDependencies } from '../../../types'; -import { addBasePath } from '..'; - -const extractMissingPrivileges = (privilegesObject: { [key: string]: boolean } = {}): string[] => - Object.keys(privilegesObject).reduce((privileges: string[], privilegeName: string): string[] => { - if (!privilegesObject[privilegeName]) { - privileges.push(privilegeName); - } - return privileges; - }, []); - -export const registerPrivilegesRoute = ({ - router, - config, - lib: { handleEsError }, -}: RouteDependencies) => { - router.get( - { - path: addBasePath('/component_templates/privileges'), - validate: false, - }, - async (context, request, response) => { - const privilegesResult: Privileges = { - hasAllPrivileges: true, - missingPrivileges: { - cluster: [], - }, - }; - - // Skip the privileges check if security is not enabled - if (!config.isSecurityEnabled()) { - return response.ok({ body: privilegesResult }); - } - - const { client } = (await context.core).elasticsearch; - - try { - const { has_all_requested: hasAllPrivileges, cluster } = - await client.asCurrentUser.security.hasPrivileges({ - body: { - cluster: ['manage_index_templates'], - }, - }); - - if (!hasAllPrivileges) { - privilegesResult.missingPrivileges.cluster = extractMissingPrivileges(cluster); - } - - privilegesResult.hasAllPrivileges = hasAllPrivileges; - return response.ok({ body: privilegesResult }); - } catch (error) { - return handleEsError({ error, response }); - } - } - ); -}; diff --git a/x-pack/plugins/index_management/tsconfig.json b/x-pack/plugins/index_management/tsconfig.json index eac67aa620973..48b40c9376157 100644 --- a/x-pack/plugins/index_management/tsconfig.json +++ b/x-pack/plugins/index_management/tsconfig.json @@ -40,7 +40,6 @@ "@kbn/core-http-browser", "@kbn/search-api-panels", "@kbn/cloud-plugin", - "@kbn/ui-theme", "@kbn/code-editor", "@kbn/monaco", "@kbn/console-plugin", diff --git a/x-pack/plugins/ingest_pipelines/jest.config.js b/x-pack/plugins/ingest_pipelines/jest.config.js deleted file mode 100644 index e3e76e54a610d..0000000000000 --- a/x-pack/plugins/ingest_pipelines/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../..', - roots: ['<rootDir>/x-pack/plugins/ingest_pipelines'], - coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/ingest_pipelines', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/ingest_pipelines/{common,public,server}/**/*.{ts,tsx}', - ], -}; diff --git a/x-pack/plugins/ingest_pipelines/tsconfig.json b/x-pack/plugins/ingest_pipelines/tsconfig.json deleted file mode 100644 index 5792ac1b9fda1..0000000000000 --- a/x-pack/plugins/ingest_pipelines/tsconfig.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - "__jest__/**/*", - "../../../typings/**/*" - ], - "kbn_references": [ - "@kbn/core", - "@kbn/licensing-plugin", - "@kbn/features-plugin", - "@kbn/security-plugin", - "@kbn/file-upload-plugin", - "@kbn/es-ui-shared-plugin", - "@kbn/kibana-react-plugin", - "@kbn/management-plugin", - "@kbn/share-plugin", - "@kbn/usage-collection-plugin", - "@kbn/utility-types", - "@kbn/i18n", - "@kbn/i18n-react", - "@kbn/analytics", - "@kbn/monaco", - "@kbn/test-jest-helpers", - "@kbn/config-schema", - "@kbn/shared-ux-router", - "@kbn/core-ui-settings-browser", - "@kbn/code-editor", - "@kbn/react-kibana-context-render", - "@kbn/console-plugin", - "@kbn/react-kibana-context-theme", - "@kbn/unsaved-changes-prompt", - "@kbn/core-http-browser-mocks", - "@kbn/shared-ux-table-persist", - "@kbn/core-http-browser", - "@kbn/core-plugins-server" - ], - "exclude": [ - "target/**/*", - ] -} diff --git a/x-pack/plugins/kubernetes_security/jest.config.js b/x-pack/plugins/kubernetes_security/jest.config.js deleted file mode 100644 index d42855eeab9de..0000000000000 --- a/x-pack/plugins/kubernetes_security/jest.config.js +++ /dev/null @@ -1,18 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../..', - roots: ['<rootDir>/x-pack/plugins/kubernetes_security'], - coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/kubernetes_security', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/kubernetes_security/{common,public,server}/**/*.{ts,tsx}', - ], - setupFiles: ['jest-canvas-mock'], -}; diff --git a/x-pack/plugins/kubernetes_security/package.json b/x-pack/plugins/kubernetes_security/package.json deleted file mode 100644 index 0f322f0649f66..0000000000000 --- a/x-pack/plugins/kubernetes_security/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "author": "Elastic", - "name": "@kbn/kubernetes-security-plugin", - "version": "1.0.0", - "private": true, - "license": "Elastic License 2.0", - "scripts": { - "test:jest": "node ../../scripts/jest", - "test:coverage": "node ../../scripts/jest --coverage" - } -} diff --git a/x-pack/plugins/kubernetes_security/tsconfig.json b/x-pack/plugins/kubernetes_security/tsconfig.json deleted file mode 100644 index cf3d895eb40b9..0000000000000 --- a/x-pack/plugins/kubernetes_security/tsconfig.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - }, - "include": [ - // add all the folders containg files to be compiled - "common/**/*", - "public/**/*", - "server/**/*", - "server/**/*.json", - "scripts/**/*", - "package.json", - "storybook/**/*", - "../../../typings/**/*" - ], - "kbn_references": [ - "@kbn/core", - // add references to other TypeScript projects the plugin depends on - - // requiredPlugins from ./kibana.json - "@kbn/data-plugin", - - // optionalPlugins from ./kibana.json - - // requiredBundles from ./kibana.json - "@kbn/kibana-react-plugin", - "@kbn/rule-registry-plugin", - "@kbn/session-view-plugin", - "@kbn/i18n", - "@kbn/timelines-plugin", - "@kbn/es-query", - "@kbn/ui-theme", - "@kbn/i18n-react", - "@kbn/config-schema", - "@kbn/shared-ux-router", - "@kbn/securitysolution-es-utils", - ], - "exclude": [ - "target/**/*", - ] -} diff --git a/x-pack/plugins/lens/public/app_plugin/share_action.ts b/x-pack/plugins/lens/public/app_plugin/share_action.ts index dbb5d9d61eda9..e9e0c73cd5d67 100644 --- a/x-pack/plugins/lens/public/app_plugin/share_action.ts +++ b/x-pack/plugins/lens/public/app_plugin/share_action.ts @@ -31,7 +31,7 @@ interface ShareableConfiguration export const DEFAULT_LENS_LAYOUT_DIMENSIONS = { width: 1793, // this is a magic number from the reporting tool implementation - // see: x-pack/plugins/screenshotting/server/browsers/chromium/driver_factory/index.ts#L146 + // see: x-pack/platform/plugins/shared/screenshotting/server/browsers/chromium/driver_factory/index.ts#L146 height: 1086, }; diff --git a/x-pack/plugins/lens/public/react_embeddable/data_loader.ts b/x-pack/plugins/lens/public/react_embeddable/data_loader.ts index ac69b79b42230..a1d2e713d3f81 100644 --- a/x-pack/plugins/lens/public/react_embeddable/data_loader.ts +++ b/x-pack/plugins/lens/public/react_embeddable/data_loader.ts @@ -22,13 +22,7 @@ import { import fastIsEqual from 'fast-deep-equal'; import { pick } from 'lodash'; import { getEditPath } from '../../common/constants'; -import type { - GetStateType, - LensApi, - LensInternalApi, - LensPublicCallbacks, - VisualizationContextHelper, -} from './types'; +import type { GetStateType, LensApi, LensInternalApi, LensPublicCallbacks } from './types'; import { getExpressionRendererParams } from './expressions/expression_params'; import type { LensEmbeddableStartServices } from './types'; import { prepareCallbacks } from './expressions/callbacks'; @@ -84,7 +78,6 @@ export function loadEmbeddableData( parentApi: unknown, internalApi: LensInternalApi, services: LensEmbeddableStartServices, - { getVisualizationContext, updateVisualizationContext }: VisualizationContextHelper, metaInfo?: SharingSavedObjectProps ) { const { onLoad, onBeforeBadgesRender, ...callbacks } = apiHasLensComponentCallbacks(parentApi) @@ -103,7 +96,6 @@ export function loadEmbeddableData( } = buildUserMessagesHelpers( api, internalApi, - getVisualizationContext, services, onBeforeBadgesRender, services.spaces, @@ -174,7 +166,7 @@ export function loadEmbeddableData( }; const onDataCallback = (adapters: Partial<DefaultInspectorAdapters> | undefined) => { - updateVisualizationContext({ + internalApi.updateVisualizationContext({ activeData: adapters?.tables?.tables, }); // data has loaded @@ -243,8 +235,8 @@ export function loadEmbeddableData( // update the visualization context before anything else // as it will be used to compute blocking errors also in case of issues - updateVisualizationContext({ - doc: currentState.attributes, + internalApi.updateVisualizationContext({ + activeAttributes: currentState.attributes, mergedSearchContext: params?.searchContext || {}, ...rest, }); diff --git a/x-pack/plugins/lens/public/react_embeddable/helper.ts b/x-pack/plugins/lens/public/react_embeddable/helper.ts index 3ee63d907068d..bc0b7c957b9d4 100644 --- a/x-pack/plugins/lens/public/react_embeddable/helper.ts +++ b/x-pack/plugins/lens/public/react_embeddable/helper.ts @@ -40,7 +40,7 @@ export function createEmptyLensState( query: query || { query: '', language: 'kuery' }, filters: filters || [], internalReferences: [], - datasourceStates: { ...(isTextBased ? { text_based: {} } : { form_based: {} }) }, + datasourceStates: { ...(isTextBased ? { textBased: {} } : { formBased: {} }) }, visualization: {}, }, }, diff --git a/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_actions.test.ts b/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_actions.test.ts index 016bc0e87f11d..d7a073f10e024 100644 --- a/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_actions.test.ts +++ b/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_actions.test.ts @@ -13,8 +13,8 @@ import { getLensApiMock, makeEmbeddableServices, getLensRuntimeStateMock, - getVisualizationContextHelperMock, createUnifiedSearchApi, + getLensInternalApiMock, } from '../mocks'; import { createEmptyLensState } from '../helper'; const DATAVIEW_ID = 'myDataView'; @@ -40,11 +40,17 @@ function setupActionsApi( ) { const services = makeEmbeddableServices(undefined, undefined, { visOverrides: { id: 'lnsXY' }, - dataOverrides: { id: 'form_based' }, + dataOverrides: { id: 'formBased' }, }); const uuid = faker.string.uuid(); const runtimeState = getLensRuntimeStateMock(stateOverrides); const apiMock = getLensApiMock(); + // create the internal API and customize internal state + const internalApi = getLensInternalApiMock(); + internalApi.updateVisualizationContext({ + ...contextOverrides, + activeAttributes: runtimeState.attributes, + }); const { api } = initializeActionApi( uuid, @@ -53,7 +59,7 @@ function setupActionsApi( createUnifiedSearchApi(), pick(apiMock, ['timeRange$']), pick(apiMock, ['panelTitle']), - getVisualizationContextHelperMock(stateOverrides?.attributes, contextOverrides), + internalApi, { ...services, data: { @@ -85,6 +91,7 @@ describe('Dashboard actions', () => { describe('Explore in Discover', () => { // make it pass the basic check on viewUnderlyingData const visualizationContextMockOverrides = { + activeAttributes: undefined, mergedSearchContext: {}, indexPatterns: { [DATAVIEW_ID]: { diff --git a/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_actions.ts b/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_actions.ts index 65fd13c8fca50..ac6739d9ded1c 100644 --- a/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_actions.ts +++ b/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_actions.ts @@ -34,10 +34,10 @@ import { buildObservableVariable, isTextBasedLanguage } from '../helper'; import type { GetStateType, LensEmbeddableStartServices, + LensInternalApi, LensRuntimeState, ViewInDiscoverCallbacks, ViewUnderlyingDataArgs, - VisualizationContextHelper, } from '../types'; import { getActiveDatasourceIdFromDoc, getActiveVisualizationIdFromDoc } from '../../utils'; @@ -120,7 +120,7 @@ function getViewUnderlyingDataArgs({ function loadViewUnderlyingDataArgs( state: LensRuntimeState, - { getVisualizationContext }: VisualizationContextHelper, + { getVisualizationContext }: LensInternalApi, searchContextApi: { timeRange$: PublishingSubject<TimeRange | undefined> }, parentApi: unknown, { @@ -132,16 +132,21 @@ function loadViewUnderlyingDataArgs( visualizationMap, }: LensEmbeddableStartServices ) { - const { doc, activeData, activeDatasourceState, activeVisualizationState, indexPatterns } = - getVisualizationContext(); - const activeVisualizationId = getActiveVisualizationIdFromDoc(doc); - const activeDatasourceId = getActiveDatasourceIdFromDoc(doc); + const { + activeAttributes, + activeData, + activeDatasourceState, + activeVisualizationState, + indexPatterns, + } = getVisualizationContext(); + const activeVisualizationId = getActiveVisualizationIdFromDoc(activeAttributes); + const activeDatasourceId = getActiveDatasourceIdFromDoc(activeAttributes); const activeVisualization = activeVisualizationId ? visualizationMap[activeVisualizationId] : undefined; const activeDatasource = activeDatasourceId ? datasourceMap[activeDatasourceId] : undefined; if ( - !doc || + !activeAttributes || !activeData || !activeDatasource || !activeDatasourceState || @@ -199,7 +204,7 @@ function loadViewUnderlyingDataArgs( function createViewUnderlyingDataApis( getState: GetStateType, - visualizationContextHelper: VisualizationContextHelper, + internalApi: LensInternalApi, searchContextApi: { timeRange$: PublishingSubject<TimeRange | undefined> }, parentApi: unknown, services: LensEmbeddableStartServices @@ -213,7 +218,7 @@ function createViewUnderlyingDataApis( loadViewUnderlyingData: () => { viewUnderlyingDataArgs = loadViewUnderlyingDataArgs( getState(), - visualizationContextHelper, + internalApi, searchContextApi, parentApi, services @@ -237,7 +242,7 @@ export function initializeActionApi( parentApi: unknown, searchContextApi: { timeRange$: PublishingSubject<TimeRange | undefined> }, titleApi: { panelTitle: PublishingSubject<string | undefined> }, - visualizationContextHelper: VisualizationContextHelper, + internalApi: LensInternalApi, services: LensEmbeddableStartServices ): { api: ViewInDiscoverCallbacks & HasDynamicActions; @@ -257,7 +262,7 @@ export function initializeActionApi( ...(isTextBasedLanguage(initialState) ? {} : dynamicActionsApi?.dynamicActionsApi ?? {}), ...createViewUnderlyingDataApis( getLatestState, - visualizationContextHelper, + internalApi, searchContextApi, parentApi, services diff --git a/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_internal_api.ts b/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_internal_api.ts index e366c24a6c0e0..2c89ed463e1c5 100644 --- a/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_internal_api.ts +++ b/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_internal_api.ts @@ -15,6 +15,7 @@ import type { LensInternalApi, LensOverrides, LensRuntimeState, + VisualizationContext, } from '../types'; import { apiHasAbortController, apiHasLensComponentProps } from '../type_guards'; import type { UserMessage } from '../../types'; @@ -52,6 +53,18 @@ export function initializeInternalApi( // the isNewPanel won't be serialized so it will be always false after the edit panel closes applying the changes const isNewlyCreated$ = new BehaviorSubject<boolean>(initialState.isNewPanel || false); + const visualizationContext$ = new BehaviorSubject<VisualizationContext>({ + // doc can point to a different set of attributes for the visualization + // i.e. when inline editing or applying a suggestion + activeAttributes: initialState.attributes, + mergedSearchContext: {}, + indexPatterns: {}, + indexPatternRefs: [], + activeVisualizationState: undefined, + activeDatasourceState: undefined, + activeData: undefined, + }); + // No need to expose anything at public API right now, that would happen later on // where each initializer will pick what it needs and publish it return { @@ -65,6 +78,8 @@ export function initializeInternalApi( renderCount$, isNewlyCreated$, dataViews: dataViews$, + messages$, + validationMessages$, dispatchError: () => { hasRenderCompleted$.next(true); renderCount$.next(renderCount$.getValue() + 1); @@ -82,9 +97,7 @@ export function initializeInternalApi( updateAbortController: (abortController: AbortController | undefined) => expressionAbortController$.next(abortController), updateDataViews: (dataViews: DataView[] | undefined) => dataViews$.next(dataViews), - messages$, updateMessages: (newMessages: UserMessage[]) => messages$.next(newMessages), - validationMessages$, updateValidationMessages: (newMessages: UserMessage[]) => validationMessages$.next(newMessages), resetAllMessages: () => { messages$.next([]); @@ -116,5 +129,12 @@ export function initializeInternalApi( return displayOptions; }, + getVisualizationContext: () => visualizationContext$.getValue(), + updateVisualizationContext: (newVisualizationContext: Partial<VisualizationContext>) => { + visualizationContext$.next({ + ...visualizationContext$.getValue(), + ...newVisualizationContext, + }); + }, }; } diff --git a/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_visualization_context.ts b/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_visualization_context.ts deleted file mode 100644 index 93d544013e710..0000000000000 --- a/x-pack/plugins/lens/public/react_embeddable/initializers/initialize_visualization_context.ts +++ /dev/null @@ -1,32 +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 type { LensInternalApi, VisualizationContext, VisualizationContextHelper } from '../types'; - -export function initializeVisualizationContext( - internalApi: LensInternalApi -): VisualizationContextHelper { - // TODO: this will likely be merged together with the state$ observable - let visualizationContext: VisualizationContext = { - doc: internalApi.attributes$.getValue(), - mergedSearchContext: {}, - indexPatterns: {}, - indexPatternRefs: [], - activeVisualizationState: undefined, - activeDatasourceState: undefined, - activeData: undefined, - }; - return { - getVisualizationContext: () => visualizationContext, - updateVisualizationContext: (newVisualizationContext: Partial<VisualizationContext>) => { - visualizationContext = { - ...visualizationContext, - ...newVisualizationContext, - }; - }, - }; -} diff --git a/x-pack/plugins/lens/public/react_embeddable/lens_embeddable.tsx b/x-pack/plugins/lens/public/react_embeddable/lens_embeddable.tsx index 074ae451115b5..2fc1928dc40c8 100644 --- a/x-pack/plugins/lens/public/react_embeddable/lens_embeddable.tsx +++ b/x-pack/plugins/lens/public/react_embeddable/lens_embeddable.tsx @@ -22,7 +22,6 @@ import { initializeInspector } from './initializers/initialize_inspector'; import { initializeDashboardServices } from './initializers/initialize_dashboard_services'; import { initializeInternalApi } from './initializers/initialize_internal_api'; import { initializeSearchContext } from './initializers/initialize_search_context'; -import { initializeVisualizationContext } from './initializers/initialize_visualization_context'; import { initializeActionApi } from './initializers/initialize_actions'; import { initializeIntegrations } from './initializers/initialize_integrations'; import { initializeStateManagement } from './initializers/initialize_state_management'; @@ -61,8 +60,6 @@ export const createLensEmbeddableFactory = ( */ const internalApi = initializeInternalApi(initialState, parentApi, services); - const visualizationContextHelper = initializeVisualizationContext(internalApi); - /** * Initialize various configurations required to build all the required * parts for the Lens embeddable. @@ -108,7 +105,7 @@ export const createLensEmbeddableFactory = ( parentApi, searchContextConfig.api, dashboardConfig.api, - visualizationContextHelper, + internalApi, services ); @@ -165,8 +162,7 @@ export const createLensEmbeddableFactory = ( api, parentApi, internalApi, - services, - visualizationContextHelper + services ); const onUnmount = () => { diff --git a/x-pack/plugins/lens/public/react_embeddable/mocks/index.tsx b/x-pack/plugins/lens/public/react_embeddable/mocks/index.tsx index 30a0920f9557d..96ba1b547a5d4 100644 --- a/x-pack/plugins/lens/public/react_embeddable/mocks/index.tsx +++ b/x-pack/plugins/lens/public/react_embeddable/mocks/index.tsx @@ -32,19 +32,9 @@ import { LensSerializedState, VisualizationContext, } from '../types'; -import { - createMockDatasource, - createMockVisualization, - defaultDoc, - makeDefaultServices, -} from '../../mocks'; -import { - Datasource, - DatasourceMap, - UserMessage, - Visualization, - VisualizationMap, -} from '../../types'; +import { createMockDatasource, createMockVisualization, makeDefaultServices } from '../../mocks'; +import { Datasource, DatasourceMap, Visualization, VisualizationMap } from '../../types'; +import { initializeInternalApi } from '../initializers/initialize_internal_api'; const LensApiMock: LensApi = { // Static props @@ -263,7 +253,7 @@ export function createExpressionRendererMock(): jest.Mock< )); } -function getValidExpressionParams( +export function getValidExpressionParams( overrides: Partial<ExpressionWrapperProps> = {} ): ExpressionWrapperProps { return { @@ -284,34 +274,11 @@ function getValidExpressionParams( }; } -const LensInternalApiMock: LensInternalApi = { - dataViews: new BehaviorSubject<DataView[] | undefined>(undefined), - attributes$: new BehaviorSubject<LensRuntimeState['attributes']>(defaultDoc), - overrides$: new BehaviorSubject<LensRuntimeState['overrides']>(undefined), - disableTriggers$: new BehaviorSubject<LensRuntimeState['disableTriggers']>(undefined), - dataLoading$: new BehaviorSubject<boolean | undefined>(undefined), - hasRenderCompleted$: new BehaviorSubject<boolean>(true), - expressionParams$: new BehaviorSubject<ExpressionWrapperProps | null>(getValidExpressionParams()), - expressionAbortController$: new BehaviorSubject<AbortController | undefined>(undefined), - renderCount$: new BehaviorSubject<number>(0), - messages$: new BehaviorSubject<UserMessage[]>([]), - validationMessages$: new BehaviorSubject<UserMessage[]>([]), - isNewlyCreated$: new BehaviorSubject<boolean>(true), - updateAttributes: jest.fn(), - updateOverrides: jest.fn(), - dispatchRenderStart: jest.fn(), - dispatchRenderComplete: jest.fn(), - updateDataLoading: jest.fn(), - updateExpressionParams: jest.fn(), - updateAbortController: jest.fn(), - updateDataViews: jest.fn(), - updateMessages: jest.fn(), - resetAllMessages: jest.fn(), - dispatchError: jest.fn(), - updateValidationMessages: jest.fn(), - setAsCreated: jest.fn(), - getDisplayOptions: jest.fn(() => ({})), -}; +const LensInternalApiMock = initializeInternalApi( + getLensRuntimeStateMock(), + {}, + makeEmbeddableServices() +); export function getLensInternalApiMock(overrides: Partial<LensInternalApi> = {}): LensInternalApi { return { @@ -326,6 +293,7 @@ export function getVisualizationContextHelperMock( ) { return { getVisualizationContext: jest.fn(() => ({ + activeAttributes: getLensAttributesMock(attributesOverrides), mergedSearchContext: {}, indexPatterns: {}, indexPatternRefs: [], @@ -333,7 +301,6 @@ export function getVisualizationContextHelperMock( activeDatasourceState: undefined, activeData: undefined, ...contextOverrides, - doc: getLensAttributesMock(attributesOverrides), })), updateVisualizationContext: jest.fn(), }; diff --git a/x-pack/plugins/lens/public/react_embeddable/renderer/lens_embeddable_component.test.tsx b/x-pack/plugins/lens/public/react_embeddable/renderer/lens_embeddable_component.test.tsx index f444f429250ba..fd6d271e2c9bb 100644 --- a/x-pack/plugins/lens/public/react_embeddable/renderer/lens_embeddable_component.test.tsx +++ b/x-pack/plugins/lens/public/react_embeddable/renderer/lens_embeddable_component.test.tsx @@ -6,7 +6,7 @@ */ import { render, screen } from '@testing-library/react'; -import { getLensApiMock, getLensInternalApiMock } from '../mocks'; +import { getLensApiMock, getLensInternalApiMock, getValidExpressionParams } from '../mocks'; import { LensApi, LensInternalApi } from '../types'; import { BehaviorSubject } from 'rxjs'; import { PublishingSubject } from '@kbn/presentation-publishing'; @@ -25,6 +25,9 @@ function getDefaultProps({ internalApiOverrides = undefined, apiOverrides = undefined, }: { internalApiOverrides?: Partial<LensInternalApi>; apiOverrides?: Partial<LensApi> } = {}) { + const internalApi = getLensInternalApiMock(internalApiOverrides); + // provide a valid expression to render + internalApi.updateExpressionParams(getValidExpressionParams()); return { internalApi: getLensInternalApiMock(internalApiOverrides), api: getLensApiMock(apiOverrides), diff --git a/x-pack/plugins/lens/public/react_embeddable/types.ts b/x-pack/plugins/lens/public/react_embeddable/types.ts index 1a4bf45b11f17..98b85860f414f 100644 --- a/x-pack/plugins/lens/public/react_embeddable/types.ts +++ b/x-pack/plugins/lens/public/react_embeddable/types.ts @@ -100,8 +100,12 @@ interface LensApiProps {} export type LensSavedObjectAttributes = Omit<LensDocument, 'savedObjectId' | 'type'>; +/** + * This visualization context can have a different attributes than the + * one stored in the Lens API attributes + */ export interface VisualizationContext { - doc: LensDocument | undefined; + activeAttributes: LensDocument | undefined; mergedSearchContext: ExecutionContextSearch; indexPatterns: IndexPatternMap; indexPatternRefs: IndexPatternRef[]; @@ -111,6 +115,7 @@ export interface VisualizationContext { } export interface VisualizationContextHelper { + // the doc prop here is a convenience reference to the internalApi.attributes getVisualizationContext: () => VisualizationContext; updateVisualizationContext: (newContext: Partial<VisualizationContext>) => void; } @@ -399,7 +404,8 @@ export type LensApi = Simplify< // there's some overlapping between this and the LensApi but they are shared references export type LensInternalApi = Simplify< Pick<IntegrationCallbacks, 'updateAttributes' | 'updateOverrides'> & - PublishesDataViews & { + PublishesDataViews & + VisualizationContextHelper & { attributes$: PublishingSubject<LensRuntimeState['attributes']>; overrides$: PublishingSubject<LensOverrides['overrides']>; disableTriggers$: PublishingSubject<LensPanelProps['disableTriggers']>; diff --git a/x-pack/plugins/lens/public/react_embeddable/user_messages/api.ts b/x-pack/plugins/lens/public/react_embeddable/user_messages/api.ts index 90061cfb7c2fe..8058f79619555 100644 --- a/x-pack/plugins/lens/public/react_embeddable/user_messages/api.ts +++ b/x-pack/plugins/lens/public/react_embeddable/user_messages/api.ts @@ -28,7 +28,6 @@ import { import { LensPublicCallbacks, LensEmbeddableStartServices, - VisualizationContext, VisualizationContextHelper, LensApi, LensInternalApi, @@ -43,7 +42,7 @@ function getUpdatedState( datasourceMap: LensEmbeddableStartServices['datasourceMap'] ) { const { - doc, + activeAttributes, mergedSearchContext, indexPatterns, indexPatternRefs, @@ -51,15 +50,15 @@ function getUpdatedState( activeDatasourceState, activeData, } = getVisualizationContext(); - const activeVisualizationId = getActiveVisualizationIdFromDoc(doc); - const activeDatasourceId = getActiveDatasourceIdFromDoc(doc); + const activeVisualizationId = getActiveVisualizationIdFromDoc(activeAttributes); + const activeDatasourceId = getActiveDatasourceIdFromDoc(activeAttributes); const activeDatasource = activeDatasourceId ? datasourceMap[activeDatasourceId] : null; const activeVisualization = activeVisualizationId ? visualizationMap[activeVisualizationId] : undefined; const dataViewObject = getInitialDataViewsObject(indexPatterns, indexPatternRefs); return { - doc, + activeAttributes, mergedSearchContext, activeDatasource, activeVisualization, @@ -100,7 +99,6 @@ function getWarningMessages( export function buildUserMessagesHelpers( api: LensApi, internalApi: LensInternalApi, - getVisualizationContext: () => VisualizationContext, { coreStart, data, visualizationMap, datasourceMap }: LensEmbeddableStartServices, onBeforeBadgesRender: LensPublicCallbacks['onBeforeBadgesRender'], spaces?: SpacesApi, @@ -131,7 +129,7 @@ export function buildUserMessagesHelpers( const getUserMessages: UserMessagesGetter = (locationId, filters) => { const { - doc, + activeAttributes, activeVisualizationState, activeVisualization, activeVisualizationId, @@ -141,12 +139,12 @@ export function buildUserMessagesHelpers( dataViewObject, mergedSearchContext, activeData, - } = getUpdatedState(getVisualizationContext, visualizationMap, datasourceMap); + } = getUpdatedState(internalApi.getVisualizationContext, visualizationMap, datasourceMap); const userMessages: UserMessage[] = []; userMessages.push( ...getApplicationUserMessages({ - visualizationType: doc?.visualizationType, + visualizationType: activeAttributes?.visualizationType, visualizationState: { state: activeVisualizationState, activeId: activeVisualizationId, @@ -162,7 +160,7 @@ export function buildUserMessagesHelpers( }) ); - if (!doc || !activeDatasourceState || !activeVisualizationState) { + if (!activeAttributes || !activeDatasourceState || !activeVisualizationState) { return userMessages; } @@ -178,7 +176,7 @@ export function buildUserMessagesHelpers( datasourceMap, dataViewObject.indexPatterns ), - query: doc.state.query, + query: activeAttributes.state.query, filters: mergedSearchContext.filters ?? [], dateRange: { fromDate: mergedSearchContext.timeRange?.from ?? '', @@ -278,7 +276,7 @@ export function buildUserMessagesHelpers( updateWarnings: () => { addUserMessages( getWarningMessages( - getUpdatedState(getVisualizationContext, visualizationMap, datasourceMap), + getUpdatedState(internalApi.getVisualizationContext, visualizationMap, datasourceMap), api.adapters$.getValue(), data ) diff --git a/x-pack/plugins/lists/README.md b/x-pack/plugins/lists/README.md deleted file mode 100644 index 02be757303417..0000000000000 --- a/x-pack/plugins/lists/README.md +++ /dev/null @@ -1,238 +0,0 @@ -README.md for developers working on the backend lists on how to get started -using the CURL scripts in the scripts folder. - -The scripts rely on CURL and jq: - -- [CURL](https://curl.haxx.se) -- [jq](https://stedolan.github.io/jq/) - -Install curl and jq (mac instructions) - -```sh -brew update -brew install curl -brew install jq -``` - -Open `$HOME/.zshrc` or `${HOME}.bashrc` depending on your SHELL output from `echo $SHELL` -and add these environment variables: - -```sh -export ELASTICSEARCH_USERNAME=${user} -export ELASTICSEARCH_PASSWORD=${password} -export ELASTICSEARCH_URL=https://${ip}:9200 -export KIBANA_URL=http://localhost:5601 -export TASK_MANAGER_INDEX=.kibana-task-manager-${your user id} -export KIBANA_INDEX=.kibana-${your user id} -``` - -source `$HOME/.zshrc` or `${HOME}.bashrc` to ensure variables are set: - -```sh -source ~/.zshrc -``` - -Open your `kibana.dev.yml` file and add these lines with your name: - -```sh -xpack.lists.listIndex: '.lists-your-name' -xpack.lists.listItemIndex: '.items-your-name' -``` - -Restart Kibana and ensure that you are using `--no-base-path` as changing the base path is a feature but will -get in the way of the CURL scripts written as is. - -Go to the scripts folder `cd kibana/x-pack/plugins/lists/server/scripts` and run: - -```sh -./hard_reset.sh -./post_list.sh -``` - -which will: - -- Delete any existing lists you have -- Delete any existing list items you have -- Delete any existing exception lists you have -- Delete any existing exception list items you have -- Delete any existing mapping, policies, and templates, you might have previously had. -- Add the latest list and list item index and its mappings using your settings from `kibana.dev.yml` environment variable of `xpack.lists.listIndex` and `xpack.lists.listItemIndex`. -- Posts the sample list from `./lists/new/ip_list.json` - -Now you can run - -```sh -./post_list.sh -``` - -You should see the new list created like so: - -```sh -{ - "id": "ip_list", - "created_at": "2020-05-28T19:15:22.344Z", - "created_by": "yo", - "description": "This list describes bad internet ip", - "name": "Simple list with an ip", - "tie_breaker_id": "c57efbc4-4977-4a32-995f-cfd296bed521", - "type": "ip", - "updated_at": "2020-05-28T19:15:22.344Z", - "updated_by": "yo" -} -``` - -You can add a list item like so: - -```sh - ./post_list_item.sh -``` - -You should see the new list item created and attached to the above list like so: - -```sh -{ - "id": "hand_inserted_item_id", - "type": "ip", - "value": "127.0.0.1", - "created_at": "2020-05-28T19:15:49.790Z", - "created_by": "yo", - "list_id": "ip_list", - "tie_breaker_id": "a881bf2e-1e17-4592-bba8-d567cb07d234", - "updated_at": "2020-05-28T19:15:49.790Z", - "updated_by": "yo" -} -``` - -If you want to post an exception list it would be like so: - -```sh -./post_exception_list.sh -``` - -You should see the new exception list created like so: - -```sh -{ - "created_at": "2020-05-28T19:16:31.052Z", - "created_by": "yo", - "description": "This is a sample endpoint type exception", - "id": "bcb94680-a117-11ea-ad9d-c71f4820e65b", - "list_id": "endpoint_list", - "name": "Sample Endpoint Exception List", - "namespace_type": "single", - "tags": [ - "user added string for a tag", - "malware" - ], - "tie_breaker_id": "86e08c8c-c970-4b08-a6e2-cdba7bb4e023", - "type": "endpoint", - "updated_at": "2020-05-28T19:16:31.080Z", - "updated_by": "yo" -} -``` - -And you can attach exception list items like so: - -```ts -{ - "comments": [], - "created_at": "2020-05-28T19:17:21.099Z", - "created_by": "yo", - "description": "This is a sample endpoint type exception", - "entries": [ - { - "field": "actingProcess.file.signer", - "operator": "included", - "type": "match", - "value": "Elastic, N.V." - }, - { - "field": "event.category", - "operator": "included", - "type": "match_any", - "value": [ - "process", - "malware" - ] - } - ], - "id": "da8d3b30-a117-11ea-ad9d-c71f4820e65b", - "item_id": "endpoint_list_item", - "list_id": "endpoint_list", - "name": "Sample Endpoint Exception List", - "namespace_type": "single", - "os_types": ["linux"], - "tags": [ - "user added string for a tag", - "malware" - ], - "tie_breaker_id": "21f84703-9476-4af8-a212-aad31e18dcb9", - "type": "simple", - "updated_at": "2020-05-28T19:17:21.123Z", - "updated_by": "yo" -} -``` - -You can then do find for each one like so: - -```sh -./find_lists.sh -``` - -```sh -{ - "cursor": "WzIwLFsiYzU3ZWZiYzQtNDk3Ny00YTMyLTk5NWYtY2ZkMjk2YmVkNTIxIl1d", - "data": [ - { - "id": "ip_list", - "created_at": "2020-05-28T19:15:22.344Z", - "created_by": "yo", - "description": "This list describes bad internet ip", - "name": "Simple list with an ip", - "tie_breaker_id": "c57efbc4-4977-4a32-995f-cfd296bed521", - "type": "ip", - "updated_at": "2020-05-28T19:15:22.344Z", - "updated_by": "yo" - } - ], - "page": 1, - "per_page": 20, - "total": 1 -} -``` - -or for finding exception lists: - -```sh -./find_exception_lists.sh -``` - -```sh -{ - "data": [ - { - "created_at": "2020-05-28T19:16:31.052Z", - "created_by": "yo", - "description": "This is a sample endpoint type exception", - "id": "bcb94680-a117-11ea-ad9d-c71f4820e65b", - "list_id": "endpoint_list", - "name": "Sample Endpoint Exception List", - "namespace_type": "single", - "os_types": ["linux"], - "tags": [ - "user added string for a tag", - "malware" - ], - "tie_breaker_id": "86e08c8c-c970-4b08-a6e2-cdba7bb4e023", - "type": "endpoint", - "updated_at": "2020-05-28T19:16:31.080Z", - "updated_by": "yo" - } - ], - "page": 1, - "per_page": 20, - "total": 1 -} -``` - -See the full scripts folder for all the capabilities. diff --git a/x-pack/plugins/lists/jest.config.js b/x-pack/plugins/lists/jest.config.js deleted file mode 100644 index cb9832920183f..0000000000000 --- a/x-pack/plugins/lists/jest.config.js +++ /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. - */ - -module.exports = { - collectCoverageFrom: ['<rootDir>/x-pack/plugins/lists/{common,public,server}/**/*.{ts,tsx}'], - coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/lists', - coverageReporters: ['text', 'html'], - preset: '@kbn/test', - rootDir: '../../..', - roots: ['<rootDir>/x-pack/plugins/lists'], -}; diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts b/x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts deleted file mode 100644 index 2c0f8b198b384..0000000000000 --- a/x-pack/plugins/lists/public/exceptions/components/builder/helpers.test.ts +++ /dev/null @@ -1,1966 +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 { - EntryExists, - EntryList, - EntryMatch, - EntryMatchAny, - EntryNested, - ListOperatorEnum as OperatorEnum, - ListOperatorTypeEnum as OperatorTypeEnum, -} from '@kbn/securitysolution-io-ts-list-types'; -import { - ALL_OPERATORS, - BuilderEntry, - DETECTION_ENGINE_EXCEPTION_OPERATORS, - EXCEPTION_OPERATORS_SANS_LISTS, - EmptyEntry, - ExceptionsBuilderExceptionItem, - ExceptionsBuilderReturnExceptionItem, - FormattedBuilderEntry, - OperatorOption, - doesNotExistOperator, - doesNotMatchOperator, - existsOperator, - filterExceptionItems, - getCorrespondingKeywordField, - getEntryFromOperator, - getEntryOnFieldChange, - getEntryOnListChange, - getEntryOnMatchAnyChange, - getEntryOnMatchChange, - getEntryOnOperatorChange, - getEntryValue, - getExceptionOperatorSelect, - getFilteredIndexPatterns, - getFormattedBuilderEntries, - getFormattedBuilderEntry, - getNewExceptionItem, - getOperatorOptions, - getOperatorType, - getUpdatedEntriesOnDelete, - isEntryNested, - isInListOperator, - isNotInListOperator, - isNotOneOfOperator, - isNotOperator, - isOneOfOperator, - isOperator, - matchesOperator, -} from '@kbn/securitysolution-list-utils'; -import { DataViewBase, DataViewFieldBase } from '@kbn/es-query'; -import { fields, getField } from '@kbn/data-plugin/common/mocks'; -import type { FieldSpec } from '@kbn/data-plugin/common'; - -import { ENTRIES_WITH_IDS } from '../../../../common/constants.mock'; -import { getEntryExistsMock } from '../../../../common/schemas/types/entry_exists.mock'; -import { getExceptionListItemSchemaMock } from '../../../../common/schemas/response/exception_list_item_schema.mock'; -import { getEntryNestedMock } from '../../../../common/schemas/types/entry_nested.mock'; -import { getEntryMatchMock } from '../../../../common/schemas/types/entry_match.mock'; -import { getEntryMatchAnyMock } from '../../../../common/schemas/types/entry_match_any.mock'; -import { getListResponseMock } from '../../../../common/schemas/response/list_schema.mock'; -import { getEntryListMock } from '../../../../common/schemas/types/entry_list.mock'; - -// TODO: ALL THESE TESTS SHOULD BE MOVED TO @kbn/securitysolution-list-utils for its helper. The only reason why they're here is due to missing other packages we hae to create or missing things from kbn packages such as mocks from kibana core - -jest.mock('uuid', () => ({ - v4: jest.fn().mockReturnValue('123'), -})); - -const getEntryExistsWithIdMock = (): EntryExists & { id: string } => ({ - ...getEntryExistsMock(), - id: '123', -}); - -const getEntryNestedWithIdMock = (): EntryNested & { id: string } => ({ - ...getEntryNestedMock(), - id: '123', -}); - -const getEntryMatchWithIdMock = (): EntryMatch & { id: string } => ({ - ...getEntryMatchMock(), - id: '123', -}); - -const getEntryMatchAnyWithIdMock = (): EntryMatchAny & { id: string } => ({ - ...getEntryMatchAnyMock(), - id: '123', -}); - -const getMockIndexPattern = (): DataViewBase => ({ - fields, - id: '1234', - title: 'logstash-*', -}); - -const getMockBuilderEntry = (): FormattedBuilderEntry => ({ - correspondingKeywordField: undefined, - entryIndex: 0, - field: getField('ip'), - id: '123', - nested: undefined, - operator: isOperator, - parent: undefined, - value: 'some value', -}); - -const getMockNestedBuilderEntry = (): FormattedBuilderEntry => ({ - correspondingKeywordField: undefined, - entryIndex: 0, - field: getField('nestedField.child'), - id: '123', - nested: 'child', - operator: isOperator, - parent: { - parent: { - ...getEntryNestedWithIdMock(), - entries: [{ ...getEntryMatchWithIdMock(), field: 'child' }], - field: 'nestedField', - }, - parentIndex: 0, - }, - value: 'some value', -}); - -const getMockNestedParentBuilderEntry = (): FormattedBuilderEntry => ({ - correspondingKeywordField: undefined, - entryIndex: 0, - field: { - ...getField('nestedField.child'), - esTypes: ['nested'], - name: 'nestedField', - } as FieldSpec, - id: '123', - nested: 'parent', - operator: isOperator, - parent: undefined, - value: undefined, -}); - -const mockEndpointFields = [ - { - aggregatable: false, - count: 0, - esTypes: ['keyword'], - name: 'file.path.caseless', - readFromDocValues: false, - scripted: false, - searchable: true, - type: 'string', - }, - { - aggregatable: false, - count: 0, - esTypes: ['text'], - name: 'file.Ext.code_signature.status', - readFromDocValues: false, - scripted: false, - searchable: true, - subType: { nested: { path: 'file.Ext.code_signature' } }, - type: 'string', - }, -]; - -export const getEndpointField = (name: string): DataViewFieldBase => - mockEndpointFields.find((field) => field.name === name) as DataViewFieldBase; - -describe('Exception builder helpers', () => { - describe('#getFilteredIndexPatterns', () => { - describe('list type detections', () => { - test('it returns nested fields that match parent value when "item.nested" is "child"', () => { - const payloadIndexPattern = getMockIndexPattern(); - const payloadItem: FormattedBuilderEntry = getMockNestedBuilderEntry(); - const output = getFilteredIndexPatterns(payloadIndexPattern, payloadItem); - const expected: DataViewBase = { - fields: [{ ...getField('nestedField.child'), name: 'child' }], - id: '1234', - title: 'logstash-*', - }; - expect(output).toEqual(expected); - }); - - test('it returns only parent nested field when "item.nested" is "parent" and nested parent field is not undefined', () => { - const payloadIndexPattern = getMockIndexPattern(); - const payloadItem: FormattedBuilderEntry = getMockNestedParentBuilderEntry(); - const output = getFilteredIndexPatterns(payloadIndexPattern, payloadItem); - const expected: DataViewBase & { fields: Array<Partial<FieldSpec>> } = { - fields: [{ ...getField('nestedField.child'), esTypes: ['nested'], name: 'nestedField' }], - id: '1234', - title: 'logstash-*', - }; - expect(output).toEqual(expected); - }); - - test('it returns only nested fields when "item.nested" is "parent" and nested parent field is undefined', () => { - const payloadIndexPattern = getMockIndexPattern(); - const payloadItem: FormattedBuilderEntry = { - ...getMockNestedParentBuilderEntry(), - field: undefined, - }; - const output = getFilteredIndexPatterns(payloadIndexPattern, payloadItem); - const expected: DataViewBase = { - fields: [ - { ...getField('nestedField.child') }, - { ...getField('nestedField.nestedChild.doublyNestedChild') }, - ], - id: '1234', - title: 'logstash-*', - }; - expect(output).toEqual(expected); - }); - - test('it returns all fields unfiltered if "item.nested" is not "child" or "parent"', () => { - const payloadIndexPattern = getMockIndexPattern(); - const payloadItem: FormattedBuilderEntry = getMockBuilderEntry(); - const output = getFilteredIndexPatterns(payloadIndexPattern, payloadItem); - const expected: DataViewBase = { - fields: [...fields], - id: '1234', - title: 'logstash-*', - }; - expect(output).toEqual(expected); - }); - }); - - describe('list type endpoint', () => { - let payloadIndexPattern = getMockIndexPattern(); - - beforeAll(() => { - payloadIndexPattern = { - ...payloadIndexPattern, - fields: [...payloadIndexPattern.fields, ...mockEndpointFields], - }; - }); - - test('it returns nested fields that match parent value when "item.nested" is "child"', () => { - const payloadItem: FormattedBuilderEntry = { - correspondingKeywordField: undefined, - entryIndex: 0, - field: getEndpointField('file.Ext.code_signature.status'), - id: '123', - nested: 'child', - operator: isOperator, - parent: { - parent: { - ...getEntryNestedWithIdMock(), - entries: [{ ...getEntryMatchWithIdMock(), field: 'child' }], - field: 'file.Ext.code_signature', - }, - parentIndex: 0, - }, - value: 'some value', - }; - const output = getFilteredIndexPatterns(payloadIndexPattern, payloadItem); - const expected: DataViewBase = { - fields: [{ ...getEndpointField('file.Ext.code_signature.status'), name: 'status' }], - id: '1234', - title: 'logstash-*', - }; - expect(output).toEqual(expected); - }); - - test('it returns only parent nested field when "item.nested" is "parent" and nested parent field is not undefined', () => { - const field: FieldSpec = { - ...getEndpointField('file.Ext.code_signature.status'), - esTypes: ['nested'], - name: 'file.Ext.code_signature', - } as FieldSpec; - const payloadItem: FormattedBuilderEntry = { - ...getMockNestedParentBuilderEntry(), - field, - }; - const output = getFilteredIndexPatterns(payloadIndexPattern, payloadItem); - const fieldsExpected: FieldSpec[] = [ - { - aggregatable: false, - count: 0, - esTypes: ['nested'], - name: 'file.Ext.code_signature', - readFromDocValues: false, - scripted: false, - searchable: true, - subType: { - nested: { - path: 'file.Ext.code_signature', - }, - }, - type: 'string', - }, - ]; - const expected: DataViewBase = { - fields: fieldsExpected, - id: '1234', - title: 'logstash-*', - }; - expect(output).toEqual(expected); - }); - - test('it returns only nested fields when "item.nested" is "parent" and nested parent field is undefined', () => { - const payloadItem: FormattedBuilderEntry = { - ...getMockNestedParentBuilderEntry(), - field: undefined, - }; - const output = getFilteredIndexPatterns(payloadIndexPattern, payloadItem); - const expected: DataViewBase = { - fields: [ - { ...getField('nestedField.child') }, - { ...getField('nestedField.nestedChild.doublyNestedChild') }, - getEndpointField('file.Ext.code_signature.status'), - ], - id: '1234', - title: 'logstash-*', - }; - expect(output).toEqual(expected); - }); - }); - }); - - describe('#getEntryFromOperator', () => { - test('it returns current value when switching from "is" to "is not"', () => { - const payloadOperator: OperatorOption = isNotOperator; - const payloadEntry: FormattedBuilderEntry = { - ...getMockBuilderEntry(), - value: 'I should stay the same', - }; - const output = getEntryFromOperator(payloadOperator, payloadEntry); - const expected: EntryMatch & { id?: string } = { - field: 'ip', - id: '123', - operator: 'excluded', - type: OperatorTypeEnum.MATCH, - value: 'I should stay the same', - }; - expect(output).toEqual(expected); - }); - - test('it returns current value when switching from "is not" to "is"', () => { - const payloadOperator: OperatorOption = isOperator; - const payloadEntry: FormattedBuilderEntry = { - ...getMockBuilderEntry(), - operator: isNotOperator, - value: 'I should stay the same', - }; - const output = getEntryFromOperator(payloadOperator, payloadEntry); - const expected: EntryMatch & { id?: string } = { - field: 'ip', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH, - value: 'I should stay the same', - }; - expect(output).toEqual(expected); - }); - - test('it returns empty value when switching operator types to "match"', () => { - const payloadOperator: OperatorOption = isOperator; - const payloadEntry: FormattedBuilderEntry = { - ...getMockBuilderEntry(), - operator: isNotOneOfOperator, - value: ['I should stay the same'], - }; - const output = getEntryFromOperator(payloadOperator, payloadEntry); - const expected: EntryMatch & { id?: string } = { - field: 'ip', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH, - value: '', - }; - expect(output).toEqual(expected); - }); - - test('it returns current value when switching from "is one of" to "is not one of"', () => { - const payloadOperator: OperatorOption = isNotOneOfOperator; - const payloadEntry: FormattedBuilderEntry = { - ...getMockBuilderEntry(), - operator: isOneOfOperator, - value: ['I should stay the same'], - }; - const output = getEntryFromOperator(payloadOperator, payloadEntry); - const expected: EntryMatchAny & { id?: string } = { - field: 'ip', - id: '123', - operator: 'excluded', - type: OperatorTypeEnum.MATCH_ANY, - value: ['I should stay the same'], - }; - expect(output).toEqual(expected); - }); - - test('it returns current value when switching from "is not one of" to "is one of"', () => { - const payloadOperator: OperatorOption = isOneOfOperator; - const payloadEntry: FormattedBuilderEntry = { - ...getMockBuilderEntry(), - operator: isNotOneOfOperator, - value: ['I should stay the same'], - }; - const output = getEntryFromOperator(payloadOperator, payloadEntry); - const expected: EntryMatchAny & { id?: string } = { - field: 'ip', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH_ANY, - value: ['I should stay the same'], - }; - expect(output).toEqual(expected); - }); - - test('it returns empty value when switching operator types to "match_any"', () => { - const payloadOperator: OperatorOption = isOneOfOperator; - const payloadEntry: FormattedBuilderEntry = { - ...getMockBuilderEntry(), - operator: isOperator, - value: 'I should stay the same', - }; - const output = getEntryFromOperator(payloadOperator, payloadEntry); - const expected: EntryMatchAny & { id?: string } = { - field: 'ip', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH_ANY, - value: [], - }; - expect(output).toEqual(expected); - }); - - test('it returns current value when switching from "exists" to "does not exist"', () => { - const payloadOperator: OperatorOption = doesNotExistOperator; - const payloadEntry: FormattedBuilderEntry = { - ...getMockBuilderEntry(), - operator: existsOperator, - }; - const output = getEntryFromOperator(payloadOperator, payloadEntry); - const expected: EntryExists & { id?: string } = { - field: 'ip', - id: '123', - operator: 'excluded', - type: 'exists', - }; - expect(output).toEqual(expected); - }); - - test('it returns current value when switching from "does not exist" to "exists"', () => { - const payloadOperator: OperatorOption = existsOperator; - const payloadEntry: FormattedBuilderEntry = { - ...getMockBuilderEntry(), - operator: doesNotExistOperator, - }; - const output = getEntryFromOperator(payloadOperator, payloadEntry); - const expected: EntryExists & { id?: string } = { - field: 'ip', - id: '123', - operator: OperatorEnum.INCLUDED, - type: 'exists', - }; - expect(output).toEqual(expected); - }); - - test('it returns empty value when switching operator types to "exists"', () => { - const payloadOperator: OperatorOption = existsOperator; - const payloadEntry: FormattedBuilderEntry = { - ...getMockBuilderEntry(), - operator: isOperator, - value: 'I should stay the same', - }; - const output = getEntryFromOperator(payloadOperator, payloadEntry); - const expected: EntryExists & { id?: string } = { - field: 'ip', - id: '123', - operator: OperatorEnum.INCLUDED, - type: 'exists', - }; - expect(output).toEqual(expected); - }); - - test('it returns empty value when switching operator types to "list"', () => { - const payloadOperator: OperatorOption = isInListOperator; - const payloadEntry: FormattedBuilderEntry = { - ...getMockBuilderEntry(), - operator: isOperator, - value: 'I should stay the same', - }; - const output = getEntryFromOperator(payloadOperator, payloadEntry); - const expected: EntryList & { id?: string } = { - field: 'ip', - id: '123', - list: { id: '', type: 'ip' }, - operator: OperatorEnum.INCLUDED, - type: 'list', - }; - expect(output).toEqual(expected); - }); - }); - - describe('#getOperatorOptions', () => { - test('it returns "isOperator" when field type is nested but field itself has not yet been selected', () => { - const payloadItem: FormattedBuilderEntry = getMockNestedParentBuilderEntry(); - const output = getOperatorOptions(payloadItem, 'endpoint', false); - const expected: OperatorOption[] = [isOperator]; - expect(output).toEqual(expected); - }); - - test('it returns "isOperator" if no field selected', () => { - const payloadItem: FormattedBuilderEntry = { ...getMockBuilderEntry(), field: undefined }; - const output = getOperatorOptions(payloadItem, 'endpoint', false); - const expected: OperatorOption[] = [isOperator]; - expect(output).toEqual(expected); - }); - - describe('"endpoint" list type', () => { - test('it returns operators "is", "isOneOf", "matches" and "doesNotMatch" if item is nested and field supports "matches"', () => { - const payloadItem: FormattedBuilderEntry = getMockNestedBuilderEntry(); - const output = getOperatorOptions(payloadItem, 'endpoint', false); - const expected: OperatorOption[] = [ - isOperator, - isOneOfOperator, - matchesOperator, - doesNotMatchOperator, - ]; - expect(output).toEqual(expected); - }); - - test('it returns operators "is" and "isOneOf" if item is nested and field does not support "matches"', () => { - const payloadItem: FormattedBuilderEntry = { - ...getMockNestedBuilderEntry(), - field: getField('ip'), - }; - const output = getOperatorOptions(payloadItem, 'endpoint', false); - const expected: OperatorOption[] = [isOperator, isOneOfOperator]; - expect(output).toEqual(expected); - }); - - test('it returns operators "is", "isOneOf", "matches" and "doesNotMatch" if field supports "matches"', () => { - const payloadItem: FormattedBuilderEntry = { - ...getMockBuilderEntry(), - field: getField('@tags'), - }; - const output = getOperatorOptions(payloadItem, 'endpoint', false); - const expected: OperatorOption[] = [ - isOperator, - isOneOfOperator, - matchesOperator, - doesNotMatchOperator, - ]; - expect(output).toEqual(expected); - }); - - test('it returns "isOperator" and "isOneOfOperator" if field does not support "matches"', () => { - const payloadItem: FormattedBuilderEntry = getMockBuilderEntry(); - const output = getOperatorOptions(payloadItem, 'endpoint', false); - const expected: OperatorOption[] = [isOperator, isOneOfOperator]; - expect(output).toEqual(expected); - }); - - test('it returns "isOperator" and field type is boolean', () => { - const payloadItem: FormattedBuilderEntry = getMockBuilderEntry(); - const output = getOperatorOptions(payloadItem, 'endpoint', true); - const expected: OperatorOption[] = [isOperator]; - expect(output).toEqual(expected); - }); - }); - - test('it returns "isOperator", "isOneOfOperator", and "existsOperator" if item is nested and "listType" is "detection"', () => { - const payloadItem: FormattedBuilderEntry = getMockNestedBuilderEntry(); - const output = getOperatorOptions(payloadItem, 'detection', false); - const expected: OperatorOption[] = [isOperator, isOneOfOperator, existsOperator]; - expect(output).toEqual(expected); - }); - - test('it returns "isOperator" and "existsOperator" if item is nested, "listType" is "detection", and field type is boolean', () => { - const payloadItem: FormattedBuilderEntry = getMockNestedBuilderEntry(); - const output = getOperatorOptions(payloadItem, 'detection', true); - const expected: OperatorOption[] = [isOperator, existsOperator]; - expect(output).toEqual(expected); - }); - - test('it returns "isOperator", "isNotOperator", "doesNotExistOperator" and "existsOperator" if field type is boolean', () => { - const payloadItem: FormattedBuilderEntry = getMockBuilderEntry(); - const output = getOperatorOptions(payloadItem, 'detection', true); - const expected: OperatorOption[] = [ - isOperator, - isNotOperator, - existsOperator, - doesNotExistOperator, - ]; - expect(output).toEqual(expected); - }); - - test('it returns list operators if specified to', () => { - const payloadItem: FormattedBuilderEntry = getMockBuilderEntry(); - const output = getOperatorOptions(payloadItem, 'detection', false, true); - expect(output.some((operator) => operator.value === 'is_not_in_list')).toBeTruthy(); - expect(output.some((operator) => operator.value === 'is_in_list')).toBeTruthy(); - }); - - test('it does not return list operators if specified not to', () => { - const payloadItem: FormattedBuilderEntry = { - ...getMockBuilderEntry(), - field: getField('@tags'), - }; - const output = getOperatorOptions(payloadItem, 'detection', false, false); - expect(output).toEqual(EXCEPTION_OPERATORS_SANS_LISTS); - }); - - test('it returns all possible operators if list type is not "detection"', () => { - const payloadItem: FormattedBuilderEntry = getMockBuilderEntry(); - const output = getOperatorOptions(payloadItem, 'endpoint_events', false, true); - expect(output).toEqual(ALL_OPERATORS); - }); - - test('it returns all operators supported by detection engine if list type is "detection"', () => { - const payloadItem: FormattedBuilderEntry = { - ...getMockBuilderEntry(), - field: getField('@tags'), - }; - const output = getOperatorOptions(payloadItem, 'detection', false, true); - expect(output).toEqual(DETECTION_ENGINE_EXCEPTION_OPERATORS); - }); - - test('it excludes wildcard operators if list type is "detection" and field is not a string', () => { - const payloadItem: FormattedBuilderEntry = getMockBuilderEntry(); - const output = getOperatorOptions(payloadItem, 'detection', false, true); - const expected: OperatorOption[] = [ - isOperator, - isNotOperator, - isOneOfOperator, - isNotOneOfOperator, - existsOperator, - doesNotExistOperator, - isInListOperator, - isNotInListOperator, - ]; - expect(output).toEqual(expected); - }); - }); - - describe('#getEntryOnFieldChange', () => { - test('it returns nested entry with single new subentry when "item.nested" is "parent"', () => { - const payloadItem: FormattedBuilderEntry = getMockNestedParentBuilderEntry(); - const payloadIFieldType = getField('nestedField.child'); - const output = getEntryOnFieldChange(payloadItem, payloadIFieldType); - const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { - index: 0, - updatedEntry: { - entries: [ - { - field: 'child', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH, - value: '', - }, - ], - field: 'nestedField', - id: '123', - type: OperatorTypeEnum.NESTED, - }, - }; - expect(output).toEqual(expected); - }); - - test('it returns nested entry with newly selected field value when "item.nested" is "child"', () => { - const payloadItem: FormattedBuilderEntry = { - ...getMockNestedBuilderEntry(), - parent: { - parent: { - ...getEntryNestedWithIdMock(), - entries: [ - { ...getEntryMatchWithIdMock(), field: 'child' }, - getEntryMatchAnyWithIdMock(), - ], - field: 'nestedField', - }, - parentIndex: 0, - }, - }; - const payloadIFieldType = getField('nestedField.child'); - const output = getEntryOnFieldChange(payloadItem, payloadIFieldType); - const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { - index: 0, - updatedEntry: { - entries: [ - { - field: 'child', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH, - value: '', - }, - getEntryMatchAnyWithIdMock(), - ], - field: 'nestedField', - id: '123', - type: OperatorTypeEnum.NESTED, - }, - }; - expect(output).toEqual(expected); - }); - - test('it returns field of type "match" with updated field if not a nested entry', () => { - const payloadItem: FormattedBuilderEntry = getMockBuilderEntry(); - const payloadIFieldType = getField('ip'); - const output = getEntryOnFieldChange(payloadItem, payloadIFieldType); - const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { - index: 0, - updatedEntry: { - field: 'ip', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH, - value: '', - }, - }; - expect(output).toEqual(expected); - }); - }); - - describe('#getEntryOnOperatorChange', () => { - test('it returns updated subentry preserving its value when entry is not switching operator types', () => { - const payloadItem: FormattedBuilderEntry = getMockBuilderEntry(); - const payloadOperator: OperatorOption = isNotOperator; - const output = getEntryOnOperatorChange(payloadItem, payloadOperator); - const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { - index: 0, - updatedEntry: { - field: 'ip', - id: '123', - operator: 'excluded', - type: OperatorTypeEnum.MATCH, - value: 'some value', - }, - }; - expect(output).toEqual(expected); - }); - - test('it returns updated subentry resetting its value when entry is switching operator types', () => { - const payloadItem: FormattedBuilderEntry = getMockBuilderEntry(); - const payloadOperator: OperatorOption = isOneOfOperator; - const output = getEntryOnOperatorChange(payloadItem, payloadOperator); - const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { - index: 0, - updatedEntry: { - field: 'ip', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH_ANY, - value: [], - }, - }; - expect(output).toEqual(expected); - }); - - test('it returns updated subentry preserving its value when entry is nested and not switching operator types', () => { - const payloadItem: FormattedBuilderEntry = getMockNestedBuilderEntry(); - const payloadOperator: OperatorOption = isNotOperator; - const output = getEntryOnOperatorChange(payloadItem, payloadOperator); - const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { - index: 0, - updatedEntry: { - entries: [ - { - field: 'child', - id: '123', - operator: OperatorEnum.EXCLUDED, - type: OperatorTypeEnum.MATCH, - value: 'some value', - }, - ], - field: 'nestedField', - id: '123', - type: OperatorTypeEnum.NESTED, - }, - }; - expect(output).toEqual(expected); - }); - - test('it returns updated subentry resetting its value when entry is nested and switching operator types', () => { - const payloadItem: FormattedBuilderEntry = getMockNestedBuilderEntry(); - const payloadOperator: OperatorOption = isOneOfOperator; - const output = getEntryOnOperatorChange(payloadItem, payloadOperator); - const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { - index: 0, - updatedEntry: { - entries: [ - { - field: 'child', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH_ANY, - value: [], - }, - ], - field: 'nestedField', - id: '123', - type: OperatorTypeEnum.NESTED, - }, - }; - expect(output).toEqual(expected); - }); - }); - - describe('#getEntryOnMatchChange', () => { - test('it returns entry with updated value', () => { - const payload: FormattedBuilderEntry = getMockBuilderEntry(); - const output = getEntryOnMatchChange(payload, 'jibber jabber'); - const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { - index: 0, - updatedEntry: { - field: 'ip', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH, - value: 'jibber jabber', - }, - }; - expect(output).toEqual(expected); - }); - - test('it returns entry with updated value and "field" of empty string if entry does not have a "field" defined', () => { - const payload: FormattedBuilderEntry = { ...getMockBuilderEntry(), field: undefined }; - const output = getEntryOnMatchChange(payload, 'jibber jabber'); - const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { - index: 0, - updatedEntry: { - field: '', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH, - value: 'jibber jabber', - }, - }; - expect(output).toEqual(expected); - }); - - test('it returns nested entry with updated value', () => { - const payload: FormattedBuilderEntry = getMockNestedBuilderEntry(); - const output = getEntryOnMatchChange(payload, 'jibber jabber'); - const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { - index: 0, - updatedEntry: { - entries: [ - { - field: 'child', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH, - value: 'jibber jabber', - }, - ], - field: 'nestedField', - id: '123', - type: OperatorTypeEnum.NESTED, - }, - }; - expect(output).toEqual(expected); - }); - - test('it returns nested entry with updated value and "field" of empty string if entry does not have a "field" defined', () => { - const payload: FormattedBuilderEntry = { ...getMockNestedBuilderEntry(), field: undefined }; - const output = getEntryOnMatchChange(payload, 'jibber jabber'); - const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { - index: 0, - updatedEntry: { - entries: [ - { - field: '', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH, - value: 'jibber jabber', - }, - ], - field: 'nestedField', - id: '123', - type: OperatorTypeEnum.NESTED, - }, - }; - expect(output).toEqual(expected); - }); - }); - - describe('#getEntryOnMatchAnyChange', () => { - test('it returns entry with updated value', () => { - const payload: FormattedBuilderEntry = { - ...getMockBuilderEntry(), - operator: isOneOfOperator, - value: ['some value'], - }; - const output = getEntryOnMatchAnyChange(payload, ['jibber jabber']); - const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { - index: 0, - updatedEntry: { - field: 'ip', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH_ANY, - value: ['jibber jabber'], - }, - }; - expect(output).toEqual(expected); - }); - - test('it returns entry with updated value and "field" of empty string if entry does not have a "field" defined', () => { - const payload: FormattedBuilderEntry = { - ...getMockBuilderEntry(), - field: undefined, - operator: isOneOfOperator, - value: ['some value'], - }; - const output = getEntryOnMatchAnyChange(payload, ['jibber jabber']); - const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { - index: 0, - updatedEntry: { - field: '', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH_ANY, - value: ['jibber jabber'], - }, - }; - expect(output).toEqual(expected); - }); - - test('it returns nested entry with updated value', () => { - const payload: FormattedBuilderEntry = { - ...getMockNestedBuilderEntry(), - parent: { - parent: { - ...getEntryNestedWithIdMock(), - entries: [{ ...getEntryMatchAnyWithIdMock(), field: 'child' }], - field: 'nestedField', - }, - parentIndex: 0, - }, - }; - const output = getEntryOnMatchAnyChange(payload, ['jibber jabber']); - const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { - index: 0, - updatedEntry: { - entries: [ - { - field: 'child', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH_ANY, - value: ['jibber jabber'], - }, - ], - field: 'nestedField', - id: '123', - type: OperatorTypeEnum.NESTED, - }, - }; - expect(output).toEqual(expected); - }); - - test('it returns nested entry with updated value and "field" of empty string if entry does not have a "field" defined', () => { - const payload: FormattedBuilderEntry = { - ...getMockNestedBuilderEntry(), - field: undefined, - parent: { - parent: { - ...getEntryNestedWithIdMock(), - entries: [{ ...getEntryMatchAnyWithIdMock(), field: 'child' }], - field: 'nestedField', - }, - parentIndex: 0, - }, - }; - const output = getEntryOnMatchAnyChange(payload, ['jibber jabber']); - const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { - index: 0, - updatedEntry: { - entries: [ - { - field: '', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH_ANY, - value: ['jibber jabber'], - }, - ], - field: 'nestedField', - id: '123', - type: OperatorTypeEnum.NESTED, - }, - }; - expect(output).toEqual(expected); - }); - }); - - describe('#getEntryOnListChange', () => { - test('it returns entry with updated value', () => { - const payload: FormattedBuilderEntry = { - ...getMockBuilderEntry(), - operator: isOneOfOperator, - value: '1234', - }; - const output = getEntryOnListChange(payload, getListResponseMock()); - const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { - index: 0, - updatedEntry: { - field: 'ip', - id: '123', - list: { id: 'some-list-id', type: 'ip' }, - operator: OperatorEnum.INCLUDED, - type: 'list', - }, - }; - expect(output).toEqual(expected); - }); - - test('it returns entry with updated value and "field" of empty string if entry does not have a "field" defined', () => { - const payload: FormattedBuilderEntry = { - ...getMockBuilderEntry(), - field: undefined, - operator: isOneOfOperator, - value: '1234', - }; - const output = getEntryOnListChange(payload, getListResponseMock()); - const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { - index: 0, - updatedEntry: { - field: '', - id: '123', - list: { id: 'some-list-id', type: 'ip' }, - operator: OperatorEnum.INCLUDED, - type: 'list', - }, - }; - expect(output).toEqual(expected); - }); - }); - - describe('#getFormattedBuilderEntries', () => { - test('it returns formatted entry with field undefined if it unable to find a matching index pattern field and "allowCustomFieldOptions" is "false"', () => { - const payloadIndexPattern = getMockIndexPattern(); - const payloadItems: BuilderEntry[] = [getEntryMatchWithIdMock()]; - const output = getFormattedBuilderEntries(payloadIndexPattern, payloadItems, false); - const expected: FormattedBuilderEntry[] = [ - { - correspondingKeywordField: undefined, - entryIndex: 0, - field: undefined, - id: '123', - nested: undefined, - operator: isOperator, - parent: undefined, - value: 'some host name', - }, - ]; - expect(output).toEqual(expected); - }); - - test('it returns formatted entry with field even if it is unable to find a matching index pattern field and "allowCustomFieldOptions" is "true"', () => { - const payloadIndexPattern = getMockIndexPattern(); - const payloadItems: BuilderEntry[] = [getEntryMatchWithIdMock()]; - const output = getFormattedBuilderEntries(payloadIndexPattern, payloadItems, true); - const expected: FormattedBuilderEntry[] = [ - { - correspondingKeywordField: undefined, - entryIndex: 0, - field: { - name: 'host.name', - type: 'keyword', - }, - id: '123', - nested: undefined, - operator: isOperator, - parent: undefined, - value: 'some host name', - }, - ]; - expect(output).toEqual(expected); - }); - - test('it returns formatted entries when no nested entries exist', () => { - const payloadIndexPattern = getMockIndexPattern(); - const payloadItems: BuilderEntry[] = [ - { ...getEntryMatchWithIdMock(), field: 'ip', value: 'some ip' }, - { ...getEntryMatchAnyWithIdMock(), field: 'extension', value: ['some extension'] }, - ]; - const output = getFormattedBuilderEntries(payloadIndexPattern, payloadItems, false); - const field1: FieldSpec = { - aggregatable: true, - count: 0, - esTypes: ['ip'], - name: 'ip', - readFromDocValues: true, - scripted: false, - searchable: true, - type: 'ip', - }; - const field2: FieldSpec = { - aggregatable: true, - count: 0, - esTypes: ['keyword'], - name: 'extension', - readFromDocValues: true, - scripted: false, - searchable: true, - type: 'string', - }; - const expected: FormattedBuilderEntry[] = [ - { - correspondingKeywordField: undefined, - entryIndex: 0, - field: field1, - id: '123', - nested: undefined, - operator: isOperator, - parent: undefined, - value: 'some ip', - }, - { - correspondingKeywordField: undefined, - entryIndex: 1, - field: field2, - id: '123', - nested: undefined, - operator: isOneOfOperator, - parent: undefined, - value: ['some extension'], - }, - ]; - expect(output).toEqual(expected); - }); - - test('it returns formatted entries when nested entries exist', () => { - const payloadIndexPattern = getMockIndexPattern(); - const payloadParent: EntryNested = { - ...getEntryNestedWithIdMock(), - entries: [{ ...getEntryMatchWithIdMock(), field: 'child' }], - field: 'nestedField', - }; - const payloadItems: BuilderEntry[] = [ - { ...getEntryMatchWithIdMock(), field: 'ip', value: 'some ip' }, - { ...payloadParent }, - ]; - - const output = getFormattedBuilderEntries(payloadIndexPattern, payloadItems, false); - const field1: FieldSpec = { - aggregatable: true, - count: 0, - esTypes: ['ip'], - name: 'ip', - readFromDocValues: true, - scripted: false, - searchable: true, - type: 'ip', - }; - const field2: FieldSpec = { - aggregatable: false, - esTypes: ['nested'], - name: 'nestedField', - searchable: false, - type: 'string', - }; - const field3: FieldSpec = { - aggregatable: false, - count: 0, - esTypes: ['text'], - name: 'child', - readFromDocValues: false, - scripted: false, - searchable: true, - subType: { - nested: { - path: 'nestedField', - }, - }, - type: 'string', - }; - const expected: FormattedBuilderEntry[] = [ - { - correspondingKeywordField: undefined, - entryIndex: 0, - field: field1, - id: '123', - nested: undefined, - operator: isOperator, - parent: undefined, - value: 'some ip', - }, - { - correspondingKeywordField: undefined, - entryIndex: 1, - field: field2, - id: '123', - nested: 'parent', - operator: isOperator, - parent: undefined, - value: undefined, - }, - { - correspondingKeywordField: undefined, - entryIndex: 0, - field: field3, - id: '123', - nested: 'child', - operator: isOperator, - parent: { - parent: { - entries: [ - { - field: 'child', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH, - value: 'some host name', - }, - ], - field: 'nestedField', - id: '123', - type: OperatorTypeEnum.NESTED, - }, - parentIndex: 1, - }, - value: 'some host name', - }, - ]; - expect(output).toEqual(expected); - }); - }); - - describe('#getUpdatedEntriesOnDelete', () => { - test('it removes entry corresponding to "entryIndex"', () => { - const payloadItem: ExceptionsBuilderExceptionItem = { - ...getExceptionListItemSchemaMock(), - entries: ENTRIES_WITH_IDS, - }; - const output = getUpdatedEntriesOnDelete(payloadItem, 0, null); - const expected: ExceptionsBuilderExceptionItem = { - ...getExceptionListItemSchemaMock(), - entries: [ - { - field: 'some.not.nested.field', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH, - value: 'some value', - }, - ], - }; - expect(output).toEqual(expected); - }); - - test('it removes nested entry of "entryIndex" with corresponding parent index', () => { - const payloadItem: ExceptionsBuilderExceptionItem = { - ...getExceptionListItemSchemaMock(), - entries: [ - { - ...getEntryNestedWithIdMock(), - entries: [{ ...getEntryExistsWithIdMock() }, { ...getEntryMatchAnyWithIdMock() }], - }, - ], - }; - const output = getUpdatedEntriesOnDelete(payloadItem, 0, 0); - const expected: ExceptionsBuilderExceptionItem = { - ...getExceptionListItemSchemaMock(), - entries: [ - { ...getEntryNestedWithIdMock(), entries: [{ ...getEntryMatchAnyWithIdMock() }] }, - ], - }; - expect(output).toEqual(expected); - }); - - test('it removes entire nested entry if after deleting specified nested entry, there are no more nested entries left', () => { - const payloadItem: ExceptionsBuilderExceptionItem = { - ...getExceptionListItemSchemaMock(), - entries: [ - { - ...getEntryNestedWithIdMock(), - entries: [{ ...getEntryExistsWithIdMock() }], - }, - ], - }; - const output = getUpdatedEntriesOnDelete(payloadItem, 0, 0); - const expected: ExceptionsBuilderExceptionItem = { - ...getExceptionListItemSchemaMock(), - entries: [], - }; - expect(output).toEqual(expected); - }); - }); - - describe('#getFormattedBuilderEntry', () => { - test('it returns entry with a value for "correspondingKeywordField" when "item.field" is of type "text" and matching keyword field exists', () => { - const payloadIndexPattern: DataViewBase = { - ...getMockIndexPattern(), - fields: [ - ...fields, - { - aggregatable: false, - count: 0, - esTypes: ['text'], - name: 'machine.os.raw.text', - readFromDocValues: true, - scripted: false, - searchable: false, - type: 'string', - }, - ], - }; - const payloadItem: BuilderEntry = { - ...getEntryMatchWithIdMock(), - field: 'machine.os.raw.text', - value: 'some os', - }; - const output = getFormattedBuilderEntry( - payloadIndexPattern, - payloadItem, - 0, - undefined, - undefined, - false - ); - const field: FieldSpec = { - aggregatable: false, - count: 0, - esTypes: ['text'], - name: 'machine.os.raw.text', - readFromDocValues: true, - scripted: false, - searchable: false, - type: 'string', - }; - const expected: FormattedBuilderEntry = { - correspondingKeywordField: getField('machine.os.raw'), - entryIndex: 0, - field, - id: '123', - nested: undefined, - operator: isOperator, - parent: undefined, - value: 'some os', - }; - expect(output).toEqual(expected); - }); - - test('it returns entry with field value undefined if "allowCustomFieldOptions" is "false" and no matching field found', () => { - const payloadIndexPattern: DataViewBase = { - ...getMockIndexPattern(), - fields: [ - ...fields, - { - aggregatable: false, - count: 0, - esTypes: ['text'], - name: 'machine.os.raw.text', - readFromDocValues: true, - scripted: false, - searchable: false, - type: 'string', - }, - ], - }; - const payloadItem: BuilderEntry = { - ...getEntryMatchWithIdMock(), - field: 'custom.text', - value: 'some os', - }; - const output = getFormattedBuilderEntry( - payloadIndexPattern, - payloadItem, - 0, - undefined, - undefined, - false - ); - const expected: FormattedBuilderEntry = { - correspondingKeywordField: undefined, - entryIndex: 0, - field: undefined, - id: '123', - nested: undefined, - operator: isOperator, - parent: undefined, - value: 'some os', - }; - expect(output).toEqual(expected); - }); - - test('it returns entry with custom field value if "allowCustomFieldOptions" is "true" and no matching field found', () => { - const payloadIndexPattern: DataViewBase = { - ...getMockIndexPattern(), - fields: [ - ...fields, - { - aggregatable: false, - count: 0, - esTypes: ['text'], - name: 'machine.os.raw.text', - readFromDocValues: true, - scripted: false, - searchable: false, - type: 'string', - }, - ], - }; - const payloadItem: BuilderEntry = { - ...getEntryMatchWithIdMock(), - field: 'custom.text', - value: 'some os', - }; - const output = getFormattedBuilderEntry( - payloadIndexPattern, - payloadItem, - 0, - undefined, - undefined, - true - ); - const expected: FormattedBuilderEntry = { - correspondingKeywordField: undefined, - entryIndex: 0, - field: { - name: 'custom.text', - type: 'keyword', - }, - id: '123', - nested: undefined, - operator: isOperator, - parent: undefined, - value: 'some os', - }; - expect(output).toEqual(expected); - }); - - test('it returns "FormattedBuilderEntry" with value "nested" of "child" when "parent" and "parentIndex" are defined', () => { - const payloadIndexPattern = getMockIndexPattern(); - const payloadItem: BuilderEntry = { ...getEntryMatchWithIdMock(), field: 'child' }; - const payloadParent: EntryNested = { - ...getEntryNestedWithIdMock(), - entries: [{ ...getEntryMatchWithIdMock(), field: 'child' }], - field: 'nestedField', - }; - const output = getFormattedBuilderEntry( - payloadIndexPattern, - payloadItem, - 0, - payloadParent, - 1, - false - ); - const field: FieldSpec = { - aggregatable: false, - count: 0, - esTypes: ['text'], - name: 'child', - readFromDocValues: false, - scripted: false, - searchable: true, - subType: { - nested: { - path: 'nestedField', - }, - }, - type: 'string', - }; - const expected: FormattedBuilderEntry = { - correspondingKeywordField: undefined, - entryIndex: 0, - field, - id: '123', - nested: 'child', - operator: isOperator, - parent: { - parent: { - entries: [{ ...payloadItem }], - field: 'nestedField', - id: '123', - type: OperatorTypeEnum.NESTED, - }, - parentIndex: 1, - }, - value: 'some host name', - }; - expect(output).toEqual(expected); - }); - - test('it returns non nested "FormattedBuilderEntry" when "parent" and "parentIndex" are not defined', () => { - const payloadIndexPattern = getMockIndexPattern(); - const payloadItem: BuilderEntry = { - ...getEntryMatchWithIdMock(), - field: 'ip', - value: 'some ip', - }; - const output = getFormattedBuilderEntry( - payloadIndexPattern, - payloadItem, - 0, - undefined, - undefined, - false - ); - const field: FieldSpec = { - aggregatable: true, - count: 0, - esTypes: ['ip'], - name: 'ip', - readFromDocValues: true, - scripted: false, - searchable: true, - type: 'ip', - }; - const expected: FormattedBuilderEntry = { - correspondingKeywordField: undefined, - entryIndex: 0, - field, - id: '123', - nested: undefined, - operator: isOperator, - parent: undefined, - value: 'some ip', - }; - expect(output).toEqual(expected); - }); - }); - - describe('#isEntryNested', () => { - test('it returns "false" if payload is not of type EntryNested', () => { - const payload: BuilderEntry = getEntryMatchWithIdMock(); - const output = isEntryNested(payload); - const expected = false; - expect(output).toEqual(expected); - }); - - test('it returns "true if payload is of type EntryNested', () => { - const payload: EntryNested = getEntryNestedWithIdMock(); - const output = isEntryNested(payload); - const expected = true; - expect(output).toEqual(expected); - }); - }); - - describe('#getCorrespondingKeywordField', () => { - test('it returns matching keyword field if "selectedFieldIsTextType" is true and keyword field exists', () => { - const output = getCorrespondingKeywordField({ - fields, - selectedField: 'machine.os.raw.text', - }); - - expect(output).toEqual(getField('machine.os.raw')); - }); - - test('it returns undefined if "selectedFieldIsTextType" is false', () => { - const output = getCorrespondingKeywordField({ - fields, - selectedField: 'machine.os.raw', - }); - - expect(output).toEqual(undefined); - }); - - test('it returns undefined if "selectedField" is empty string', () => { - const output = getCorrespondingKeywordField({ - fields, - selectedField: '', - }); - - expect(output).toEqual(undefined); - }); - - test('it returns undefined if "selectedField" is undefined', () => { - const output = getCorrespondingKeywordField({ - fields, - selectedField: undefined, - }); - - expect(output).toEqual(undefined); - }); - }); - - describe('#getOperatorType', () => { - test('returns operator type "match" if entry.type is "match"', () => { - const payload = getEntryMatchMock(); - const operatorType = getOperatorType(payload); - - expect(operatorType).toEqual(OperatorTypeEnum.MATCH); - }); - - test('returns operator type "match_any" if entry.type is "match_any"', () => { - const payload = getEntryMatchAnyMock(); - const operatorType = getOperatorType(payload); - - expect(operatorType).toEqual(OperatorTypeEnum.MATCH_ANY); - }); - - test('returns operator type "list" if entry.type is "list"', () => { - const payload = getEntryListMock(); - const operatorType = getOperatorType(payload); - - expect(operatorType).toEqual(OperatorTypeEnum.LIST); - }); - - test('returns operator type "exists" if entry.type is "exists"', () => { - const payload = getEntryExistsMock(); - const operatorType = getOperatorType(payload); - - expect(operatorType).toEqual(OperatorTypeEnum.EXISTS); - }); - }); - - describe('#getExceptionOperatorSelect', () => { - test('it returns "isOperator" when "operator" is "included" and operator type is "match"', () => { - const payload = getEntryMatchMock(); - const result = getExceptionOperatorSelect(payload); - - expect(result).toEqual(isOperator); - }); - - test('it returns "isNotOperator" when "operator" is "excluded" and operator type is "match"', () => { - const payload = getEntryMatchMock(); - payload.operator = 'excluded'; - const result = getExceptionOperatorSelect(payload); - - expect(result).toEqual(isNotOperator); - }); - - test('it returns "isOneOfOperator" when "operator" is "included" and operator type is "match_any"', () => { - const payload = getEntryMatchAnyMock(); - const result = getExceptionOperatorSelect(payload); - - expect(result).toEqual(isOneOfOperator); - }); - - test('it returns "isNotOneOfOperator" when "operator" is "excluded" and operator type is "match_any"', () => { - const payload = getEntryMatchAnyMock(); - payload.operator = 'excluded'; - const result = getExceptionOperatorSelect(payload); - - expect(result).toEqual(isNotOneOfOperator); - }); - - test('it returns "existsOperator" when "operator" is "included" and no operator type is provided', () => { - const payload = getEntryExistsMock(); - const result = getExceptionOperatorSelect(payload); - - expect(result).toEqual(existsOperator); - }); - - test('it returns "doesNotExistsOperator" when "operator" is "excluded" and no operator type is provided', () => { - const payload = getEntryExistsMock(); - payload.operator = 'excluded'; - const result = getExceptionOperatorSelect(payload); - - expect(result).toEqual(doesNotExistOperator); - }); - - test('it returns "isInList" when "operator" is "included" and operator type is "list"', () => { - const payload = getEntryListMock(); - const result = getExceptionOperatorSelect(payload); - - expect(result).toEqual(isInListOperator); - }); - - test('it returns "isNotInList" when "operator" is "excluded" and operator type is "list"', () => { - const payload = getEntryListMock(); - payload.operator = 'excluded'; - const result = getExceptionOperatorSelect(payload); - - expect(result).toEqual(isNotInListOperator); - }); - }); - - describe('#filterExceptionItems', () => { - // Please see `x-pack/plugins/lists/public/exceptions/transforms.ts` doc notes - // for context around the temporary `id` - test('it correctly validates entries that include a temporary `id`', () => { - const output: ExceptionsBuilderReturnExceptionItem[] = filterExceptionItems([ - { ...getExceptionListItemSchemaMock(), entries: ENTRIES_WITH_IDS }, - ]); - - expect(output).toEqual([{ ...getExceptionListItemSchemaMock(), entries: ENTRIES_WITH_IDS }]); - }); - - test('it removes entry items with "value" of "undefined"', () => { - const { entries, ...rest } = getExceptionListItemSchemaMock(); - const mockEmptyException: EmptyEntry = { - field: 'host.name', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH, - value: undefined, - }; - const exceptions = filterExceptionItems([ - { - ...rest, - entries: [...entries, mockEmptyException], - }, - ]); - - expect(exceptions).toEqual([getExceptionListItemSchemaMock()]); - }); - - test('it removes "match" entry items with "value" of empty string', () => { - const { entries, ...rest } = { ...getExceptionListItemSchemaMock() }; - const mockEmptyException: EmptyEntry = { - field: 'host.name', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH, - value: '', - }; - const output: ExceptionsBuilderReturnExceptionItem[] = filterExceptionItems([ - { - ...rest, - entries: [...entries, mockEmptyException], - }, - ]); - - expect(output).toEqual([{ ...getExceptionListItemSchemaMock() }]); - }); - - test('it removes "match" entry items with "field" of empty string', () => { - const { entries, ...rest } = { ...getExceptionListItemSchemaMock() }; - const mockEmptyException: EmptyEntry = { - field: '', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH, - value: 'some value', - }; - const output: ExceptionsBuilderReturnExceptionItem[] = filterExceptionItems([ - { - ...rest, - entries: [...entries, mockEmptyException], - }, - ]); - - expect(output).toEqual([{ ...getExceptionListItemSchemaMock() }]); - }); - - test('it removes "match_any" entry items with "field" of empty string', () => { - const { entries, ...rest } = { ...getExceptionListItemSchemaMock() }; - const mockEmptyException: EmptyEntry = { - field: '', - id: '123', - operator: OperatorEnum.INCLUDED, - type: OperatorTypeEnum.MATCH_ANY, - value: ['some value'], - }; - const output: ExceptionsBuilderReturnExceptionItem[] = filterExceptionItems([ - { - ...rest, - entries: [...entries, mockEmptyException], - }, - ]); - - expect(output).toEqual([{ ...getExceptionListItemSchemaMock() }]); - }); - - test('it removes "nested" entry items with "field" of empty string', () => { - const { entries, ...rest } = { ...getExceptionListItemSchemaMock() }; - const mockEmptyException: EntryNested = { - entries: [getEntryMatchMock()], - field: '', - type: OperatorTypeEnum.NESTED, - }; - const output: ExceptionsBuilderReturnExceptionItem[] = filterExceptionItems([ - { - ...rest, - entries: [...entries, mockEmptyException], - }, - ]); - - expect(output).toEqual([{ ...getExceptionListItemSchemaMock() }]); - }); - - test('it removes the "nested" entry entries with "value" of empty string', () => { - const { entries, ...rest } = { ...getExceptionListItemSchemaMock() }; - const mockEmptyException: EntryNested = { - entries: [getEntryMatchMock(), { ...getEntryMatchMock(), value: '' }], - field: 'host.name', - type: OperatorTypeEnum.NESTED, - }; - const output: ExceptionsBuilderReturnExceptionItem[] = filterExceptionItems([ - { - ...rest, - entries: [...entries, mockEmptyException], - }, - ]); - - expect(output).toEqual([ - { - ...getExceptionListItemSchemaMock(), - entries: [ - ...getExceptionListItemSchemaMock().entries, - { ...mockEmptyException, entries: [getEntryMatchMock()] }, - ], - }, - ]); - }); - - test('it removes the "nested" entry item if all its entries are invalid', () => { - const { entries, ...rest } = { ...getExceptionListItemSchemaMock() }; - const mockEmptyException: EntryNested = { - entries: [{ ...getEntryMatchMock(), value: '' }], - field: 'host.name', - type: OperatorTypeEnum.NESTED, - }; - const output: ExceptionsBuilderReturnExceptionItem[] = filterExceptionItems([ - { - ...rest, - entries: [...entries, mockEmptyException], - }, - ]); - - expect(output).toEqual([{ ...getExceptionListItemSchemaMock() }]); - }); - - test('it removes `temporaryId` from "createExceptionListItemSchema" items', () => { - const { meta, ...rest } = getNewExceptionItem({ - listId: '123', - name: 'rule name', - namespaceType: 'single', - }); - const exceptions = filterExceptionItems([{ ...rest, entries: [getEntryMatchMock()], meta }]); - - expect(exceptions).toEqual([{ ...rest, entries: [getEntryMatchMock()], meta: undefined }]); - }); - - test('it removes `temporaryId` from "createRuleExceptionListItemSchema" items', () => { - const { meta, ...rest } = getNewExceptionItem({ - listId: undefined, - name: 'rule name', - namespaceType: undefined, - }); - const exceptions = filterExceptionItems([{ ...rest, entries: [getEntryMatchMock()], meta }]); - - expect(exceptions).toEqual([{ ...rest, entries: [getEntryMatchMock()], meta: undefined }]); - }); - }); - - describe('#getNewExceptionItem', () => { - it('returns new item with updated name', () => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { meta, ...rest } = getNewExceptionItem({ - listId: '123', - name: 'My Item Name', - namespaceType: 'single', - }); - - expect(rest.name).toEqual('My Item Name'); - }); - - it('returns new item with list_id if one is passed in', () => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { meta, ...rest } = getNewExceptionItem({ - listId: '123', - name: 'My Item Name', - namespaceType: 'single', - }); - - expect(rest).toEqual({ - comments: [], - description: 'Exception list item', - entries: [{ field: '', id: '123', operator: 'included', type: 'match', value: '' }], - item_id: undefined, - list_id: '123', - name: 'My Item Name', - namespace_type: 'single', - tags: [], - type: 'simple', - }); - }); - - it('returns new item without list_id if none is passed in', () => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { meta, ...rest } = getNewExceptionItem({ - listId: undefined, - name: 'My Item Name', - namespaceType: 'single', - }); - - expect(rest).toEqual({ - comments: [], - description: 'Exception list item', - entries: [{ field: '', id: '123', operator: 'included', type: 'match', value: '' }], - item_id: undefined, - list_id: undefined, - name: 'My Item Name', - namespace_type: 'single', - tags: [], - type: 'simple', - }); - }); - - it('returns new item with namespace_type if one is passed in', () => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { meta, ...rest } = getNewExceptionItem({ - listId: '123', - name: 'My Item Name', - namespaceType: 'single', - }); - - expect(rest).toEqual({ - comments: [], - description: 'Exception list item', - entries: [{ field: '', id: '123', operator: 'included', type: 'match', value: '' }], - item_id: undefined, - list_id: '123', - name: 'My Item Name', - namespace_type: 'single', - tags: [], - type: 'simple', - }); - }); - - it('returns new item without namespace_type if none is passed in', () => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { meta, ...rest } = getNewExceptionItem({ - listId: '123', - name: 'My Item Name', - namespaceType: undefined, - }); - - expect(rest).toEqual({ - comments: [], - description: 'Exception list item', - entries: [{ field: '', id: '123', operator: 'included', type: 'match', value: '' }], - item_id: undefined, - list_id: '123', - name: 'My Item Name', - namespace_type: undefined, - tags: [], - type: 'simple', - }); - }); - }); - - describe('#getEntryValue', () => { - it('returns "match" entry value', () => { - const payload = getEntryMatchMock(); - const result = getEntryValue(payload); - const expected = 'some host name'; - expect(result).toEqual(expected); - }); - - it('returns "match any" entry values', () => { - const payload = getEntryMatchAnyMock(); - const result = getEntryValue(payload); - const expected = ['some host name']; - expect(result).toEqual(expected); - }); - - it('returns "exists" entry value', () => { - const payload = getEntryExistsMock(); - const result = getEntryValue(payload); - const expected = undefined; - expect(result).toEqual(expected); - }); - - it('returns "list" entry value', () => { - const payload = getEntryListMock(); - const result = getEntryValue(payload); - const expected = 'some-list-id'; - expect(result).toEqual(expected); - }); - }); -}); diff --git a/x-pack/plugins/lists/tsconfig.json b/x-pack/plugins/lists/tsconfig.json deleted file mode 100644 index 61229d39bdbdd..0000000000000 --- a/x-pack/plugins/lists/tsconfig.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 - "server/**/*.json" - ], - "kbn_references": [ - "@kbn/core", - "@kbn/spaces-plugin", - "@kbn/security-plugin", - "@kbn/unified-search-plugin", - "@kbn/securitysolution-io-ts-list-types", - "@kbn/securitysolution-list-constants", - "@kbn/securitysolution-list-hooks", - "@kbn/securitysolution-list-api", - "@kbn/securitysolution-lists-common", - "@kbn/securitysolution-exceptions-common", - "@kbn/securitysolution-endpoint-exceptions-common", - "@kbn/kibana-react-plugin", - "@kbn/i18n", - "@kbn/data-plugin", - "@kbn/securitysolution-list-utils", - "@kbn/securitysolution-utils", - "@kbn/es-query", - "@kbn/i18n-react", - "@kbn/securitysolution-autocomplete", - "@kbn/config-schema", - "@kbn/securitysolution-io-ts-utils", - "@kbn/core-http-server", - "@kbn/securitysolution-es-utils", - "@kbn/securitysolution-io-ts-types", - "@kbn/std", - "@kbn/utils", - "@kbn/logging-mocks", - "@kbn/utility-types", - "@kbn/core-elasticsearch-client-server-mocks", - "@kbn/core-saved-objects-server", - "@kbn/zod-helpers", - "@kbn/core-security-server", - "@kbn/core-http-server-mocks", - "@kbn/core-http-server-utils" - ], - "exclude": ["target/**/*"] -} diff --git a/x-pack/plugins/observability_solution/apm/common/service_health_status.ts b/x-pack/plugins/observability_solution/apm/common/service_health_status.ts index 7f5530aa7fa05..65427caba7473 100644 --- a/x-pack/plugins/observability_solution/apm/common/service_health_status.ts +++ b/x-pack/plugins/observability_solution/apm/common/service_health_status.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { EuiTheme } from '@kbn/kibana-react-plugin/common'; +import type { EuiThemeComputed } from '@elastic/eui'; import { ML_ANOMALY_SEVERITY } from '@kbn/ml-anomaly-utils/anomaly_severity'; export enum ServiceHealthStatus { @@ -34,29 +34,35 @@ export function getServiceHealthStatus({ severity }: { severity: ML_ANOMALY_SEVE } } -export function getServiceHealthStatusColor(theme: EuiTheme, status: ServiceHealthStatus) { +export function getServiceHealthStatusColor( + euiTheme: EuiThemeComputed, + status: ServiceHealthStatus +) { switch (status) { case ServiceHealthStatus.healthy: - return theme.eui.euiColorVis0; + return euiTheme.colors.success; case ServiceHealthStatus.warning: - return theme.eui.euiColorVis5; + return euiTheme.colors.warning; case ServiceHealthStatus.critical: - return theme.eui.euiColorVis9; + return euiTheme.colors.danger; case ServiceHealthStatus.unknown: - return theme.eui.euiColorMediumShade; + return euiTheme.colors.mediumShade; } } -export function getServiceHealthStatusBadgeColor(theme: EuiTheme, status: ServiceHealthStatus) { +export function getServiceHealthStatusBadgeColor( + euiTheme: EuiThemeComputed, + status: ServiceHealthStatus +) { switch (status) { case ServiceHealthStatus.healthy: - return theme.eui.euiColorVis0_behindText; + return euiTheme.colors.success; case ServiceHealthStatus.warning: - return theme.eui.euiColorVis5_behindText; + return euiTheme.colors.warning; case ServiceHealthStatus.critical: - return theme.eui.euiColorVis9_behindText; + return euiTheme.colors.danger; case ServiceHealthStatus.unknown: - return theme.eui.euiColorMediumShade; + return euiTheme.colors.mediumShade; } } diff --git a/x-pack/plugins/observability_solution/apm/kibana.jsonc b/x-pack/plugins/observability_solution/apm/kibana.jsonc index bcb0801fc6394..0b8e8bd70a9a6 100644 --- a/x-pack/plugins/observability_solution/apm/kibana.jsonc +++ b/x-pack/plugins/observability_solution/apm/kibana.jsonc @@ -39,6 +39,7 @@ "uiActions", "logsDataAccess", "savedSearch", + "entityManager" ], "optionalPlugins": [ "actions", diff --git a/x-pack/plugins/observability_solution/apm/public/assistant_functions/get_apm_timeseries.tsx b/x-pack/plugins/observability_solution/apm/public/assistant_functions/get_apm_timeseries.tsx index 16d5d077a9b4a..9c29bb936db8a 100644 --- a/x-pack/plugins/observability_solution/apm/public/assistant_functions/get_apm_timeseries.tsx +++ b/x-pack/plugins/observability_solution/apm/public/assistant_functions/get_apm_timeseries.tsx @@ -20,7 +20,6 @@ import type { GetApmTimeseriesFunctionResponse, } from '../../server/assistant_functions/get_apm_timeseries'; import { Coordinate, TimeSeries } from '../../typings/timeseries'; -import { ApmThemeProvider } from '../components/routing/app_root'; import { ChartType, getTimeSeriesColor, @@ -54,101 +53,99 @@ export function registerGetApmTimeseriesFunction({ return ( <ChartPointerEventContextProvider> - <ApmThemeProvider> - <EuiFlexGroup direction="column"> - {Object.values(groupedSeries).map((groupSeries) => { - const groupId = groupSeries[0].group; - - const maxY = getMaxY(groupSeries); - const latencyFormatter = getDurationFormatter(maxY, 10, 1000); - - let yLabelFormat: (value: number) => string; - - const firstStat = groupSeries[0].stat; - - switch (firstStat.timeseries.name) { - case 'transaction_throughput': - case 'exit_span_throughput': - case 'error_event_rate': - yLabelFormat = asTransactionRate; - break; - - case 'transaction_latency': - case 'exit_span_latency': - yLabelFormat = getResponseTimeTickFormatter(latencyFormatter); - break; - - case 'transaction_failure_rate': - case 'exit_span_failure_rate': - yLabelFormat = (y) => asPercent(y || 0, 100); - break; - } - - const timeseries: Array<TimeSeries<Coordinate>> = groupSeries.map( - (series): TimeSeries<Coordinate> => { - let chartType: ChartType; - - const data = series.data; - - switch (series.stat.timeseries.name) { - case 'transaction_throughput': - case 'exit_span_throughput': - chartType = ChartType.THROUGHPUT; - break; - - case 'transaction_failure_rate': - case 'exit_span_failure_rate': - chartType = ChartType.FAILED_TRANSACTION_RATE; - break; - - case 'transaction_latency': - if (series.stat.timeseries.function === LatencyAggregationType.p99) { - chartType = ChartType.LATENCY_P99; - } else if (series.stat.timeseries.function === LatencyAggregationType.p95) { - chartType = ChartType.LATENCY_P95; - } else { - chartType = ChartType.LATENCY_AVG; - } - break; - - case 'exit_span_latency': + <EuiFlexGroup direction="column"> + {Object.values(groupedSeries).map((groupSeries) => { + const groupId = groupSeries[0].group; + + const maxY = getMaxY(groupSeries); + const latencyFormatter = getDurationFormatter(maxY, 10, 1000); + + let yLabelFormat: (value: number) => string; + + const firstStat = groupSeries[0].stat; + + switch (firstStat.timeseries.name) { + case 'transaction_throughput': + case 'exit_span_throughput': + case 'error_event_rate': + yLabelFormat = asTransactionRate; + break; + + case 'transaction_latency': + case 'exit_span_latency': + yLabelFormat = getResponseTimeTickFormatter(latencyFormatter); + break; + + case 'transaction_failure_rate': + case 'exit_span_failure_rate': + yLabelFormat = (y) => asPercent(y || 0, 100); + break; + } + + const timeseries: Array<TimeSeries<Coordinate>> = groupSeries.map( + (series): TimeSeries<Coordinate> => { + let chartType: ChartType; + + const data = series.data; + + switch (series.stat.timeseries.name) { + case 'transaction_throughput': + case 'exit_span_throughput': + chartType = ChartType.THROUGHPUT; + break; + + case 'transaction_failure_rate': + case 'exit_span_failure_rate': + chartType = ChartType.FAILED_TRANSACTION_RATE; + break; + + case 'transaction_latency': + if (series.stat.timeseries.function === LatencyAggregationType.p99) { + chartType = ChartType.LATENCY_P99; + } else if (series.stat.timeseries.function === LatencyAggregationType.p95) { + chartType = ChartType.LATENCY_P95; + } else { chartType = ChartType.LATENCY_AVG; - break; - - case 'error_event_rate': - chartType = ChartType.ERROR_OCCURRENCES; - break; - } - - return { - title: series.id, - type: 'line', - color: getTimeSeriesColor(chartType!).currentPeriodColor, - data, - }; + } + break; + + case 'exit_span_latency': + chartType = ChartType.LATENCY_AVG; + break; + + case 'error_event_rate': + chartType = ChartType.ERROR_OCCURRENCES; + break; } - ); - - return ( - <EuiFlexItem grow={false} key={groupId}> - <EuiFlexGroup direction="column" gutterSize="s"> - <EuiFlexItem> - <EuiText size="m">{groupId}</EuiText> - <TimeseriesChart - comparisonEnabled={false} - fetchStatus={FETCH_STATUS.SUCCESS} - id={groupId} - timeZone={timeZone} - timeseries={timeseries} - yLabelFormat={yLabelFormat!} - /> - </EuiFlexItem> - </EuiFlexGroup> - </EuiFlexItem> - ); - })} - </EuiFlexGroup> - </ApmThemeProvider> + + return { + title: series.id, + type: 'line', + color: getTimeSeriesColor(chartType!).currentPeriodColor, + data, + }; + } + ); + + return ( + <EuiFlexItem grow={false} key={groupId}> + <EuiFlexGroup direction="column" gutterSize="s"> + <EuiFlexItem> + <EuiText size="m">{groupId}</EuiText> + <TimeseriesChart + comparisonEnabled={false} + fetchStatus={FETCH_STATUS.SUCCESS} + id={groupId} + timeZone={timeZone} + timeseries={timeseries} + yLabelFormat={yLabelFormat!} + /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + ); + })} + </EuiFlexGroup> </ChartPointerEventContextProvider> ); }); diff --git a/x-pack/plugins/observability_solution/apm/public/components/alerting/ui_components/chart_preview/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/alerting/ui_components/chart_preview/index.tsx index 8e7cce37b5be4..0136fcfb88f39 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/alerting/ui_components/chart_preview/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/alerting/ui_components/chart_preview/index.tsx @@ -10,6 +10,8 @@ import { Axis, BarSeries, Chart, + LIGHT_THEME, + DARK_THEME, LineAnnotation, Position, RectAnnotation, @@ -20,7 +22,7 @@ import { Tooltip, niceTimeFormatter, } from '@elastic/charts'; -import { EuiSpacer } from '@elastic/eui'; +import { COLOR_MODES_STANDARD, EuiSpacer, useEuiTheme } from '@elastic/eui'; import React, { useMemo } from 'react'; import { IUiSettingsClient } from '@kbn/core/public'; import { TimeUnitChar } from '@kbn/observability-plugin/common'; @@ -28,7 +30,6 @@ import { UI_SETTINGS } from '@kbn/data-plugin/public'; import moment from 'moment'; import { i18n } from '@kbn/i18n'; import { Coordinate } from '../../../../../typings/timeseries'; -import { useTheme } from '../../../../hooks/use_theme'; import { getTimeZone } from '../../../shared/charts/helper/timezone'; import { TimeLabelForData, TIME_LABELS, getDomain } from './chart_preview_helper'; import { ALERT_PREVIEW_BUCKET_SIZE } from '../../utils/helper'; @@ -52,15 +53,15 @@ export function ChartPreview({ timeUnit = 'm', totalGroups, }: ChartPreviewProps) { - const theme = useTheme(); + const theme = useEuiTheme(); const thresholdOpacity = 0.3; const DEFAULT_DATE_FORMAT = 'Y-MM-DD HH:mm:ss'; const style = { - fill: theme.eui.euiColorVis2, + fill: theme.euiTheme.colors.vis.euiColorVis2, line: { strokeWidth: 2, - stroke: theme.eui.euiColorVis2, + stroke: theme.euiTheme.colors.vis.euiColorVis2, opacity: 1, }, opacity: thresholdOpacity, @@ -121,6 +122,7 @@ export function ChartPreview({ legendPosition={'bottom'} legendSize={legendSize} locale={i18n.getLocale()} + theme={theme.colorMode === COLOR_MODES_STANDARD.dark ? DARK_THEME : LIGHT_THEME} /> <LineAnnotation dataValues={[{ dataValue: threshold }]} diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/correlations/context_popover/field_stats_popover.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/correlations/context_popover/field_stats_popover.tsx index 33351f2104397..387c517d8b24a 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/correlations/context_popover/field_stats_popover.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/correlations/context_popover/field_stats_popover.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { EuiButtonIcon, EuiToolTip } from '@elastic/eui'; +import { EuiButtonIcon, EuiToolTip, useEuiTheme } from '@elastic/eui'; import React, { useCallback, useMemo, useState } from 'react'; import { i18n } from '@kbn/i18n'; import { @@ -29,6 +29,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { fromKueryExpression, toElasticsearchQuery } from '@kbn/es-query'; import numeral from '@elastic/numeral'; +import { css } from '@emotion/react'; import { termQuery } from '../../../../../common/utils/term_query'; import { SERVICE_NAME, @@ -40,7 +41,6 @@ import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plug import { useFetchParams } from '../use_fetch_params'; import type { ApmPluginStartDeps } from '../../../../plugin'; import { useAdHocApmDataView } from '../../../../hooks/use_adhoc_apm_data_view'; -import { useTheme } from '../../../../hooks/use_theme'; import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher'; const HIGHLIGHTED_BUCKET_PROPS = { @@ -205,7 +205,7 @@ export function FieldStatsPopover({ const field = dataView?.getFieldByName(fieldName); const closePopover = useCallback(() => setInfoOpen(false), []); - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); const params = useFetchParams(); @@ -280,7 +280,9 @@ export function FieldStatsPopover({ } )} data-test-subj={'apmCorrelationsContextPopoverButton'} - style={{ marginLeft: theme.eui.euiSizeXS }} + css={css` + margin-left: ${euiTheme.size.xs}; + `} /> </EuiToolTip> ); diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/correlations/correlations_table.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/correlations/correlations_table.tsx index ea79b1ef198bc..8524a29fb4b60 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/correlations/correlations_table.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/correlations/correlations_table.tsx @@ -7,13 +7,12 @@ import React, { useCallback, useMemo, useState } from 'react'; import { debounce } from 'lodash'; -import { EuiBasicTable, EuiBasicTableColumn } from '@elastic/eui'; +import { EuiBasicTable, EuiBasicTableColumn, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import type { EuiTableSortingType } from '@elastic/eui/src/components/basic_table/table_types'; import type { Criteria } from '@elastic/eui/src/components/basic_table/basic_table'; import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { FETCH_STATUS } from '../../../hooks/use_fetcher'; -import { useTheme } from '../../../hooks/use_theme'; import type { FieldValuePair } from '../../../../common/correlations/types'; const PAGINATION_SIZE_OPTIONS = [5, 10, 20, 50]; @@ -43,7 +42,7 @@ export function CorrelationsTable<T extends FieldValuePair>({ sorting, rowHeader, }: CorrelationsTableProps<T>) { - const euiTheme = useTheme(); + const { euiTheme } = useEuiTheme(); const trackApmEvent = useUiTracker({ app: 'apm' }); const trackSelectSignificantCorrelationTerm = useCallback( () => debounce(() => trackApmEvent({ metric: 'select_significant_term' }), 1000), @@ -105,7 +104,7 @@ export function CorrelationsTable<T extends FieldValuePair>({ selectedTerm.fieldValue === term.fieldValue && selectedTerm.fieldName === term.fieldName ? { - backgroundColor: euiTheme.eui.euiColorLightestShade, + backgroundColor: euiTheme.colors.lightestShade, } : null, }; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/correlations/failed_transactions_correlations.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/correlations/failed_transactions_correlations.tsx index d02eed810acd0..e6c6ce65dfffd 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/correlations/failed_transactions_correlations.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/correlations/failed_transactions_correlations.tsx @@ -18,6 +18,7 @@ import { EuiBadge, EuiSwitch, EuiIconTip, + useEuiTheme, } from '@elastic/eui'; import type { EuiTableSortingType } from '@elastic/eui/src/components/basic_table/table_types'; import type { Direction } from '@elastic/eui/src/services/sort/sort_direction'; @@ -34,7 +35,6 @@ import { FailedTransactionsCorrelation } from '../../../../common/correlations/f import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; import { useLocalStorage } from '../../../hooks/use_local_storage'; import { FETCH_STATUS } from '../../../hooks/use_fetcher'; -import { useTheme } from '../../../hooks/use_theme'; import { push } from '../../shared/links/url_helpers'; import { CorrelationsTable } from './correlations_table'; @@ -54,7 +54,7 @@ import { MIN_TAB_TITLE_HEIGHT } from '../../shared/charts/duration_distribution_ import { TotalDocCountLabel } from '../../shared/charts/duration_distribution_chart/total_doc_count_label'; export function FailedTransactionsCorrelations({ onFilter }: { onFilter: () => void }) { - const euiTheme = useTheme(); + const { euiTheme } = useEuiTheme(); const { core: { notifications }, @@ -456,7 +456,7 @@ export function FailedTransactionsCorrelations({ onFilter }: { onFilter: () => v style={{ display: 'flex', flexDirection: 'row', - paddingLeft: euiTheme.eui.euiSizeS, + paddingLeft: euiTheme.size.s, }} > <EuiSwitch @@ -473,7 +473,7 @@ export function FailedTransactionsCorrelations({ onFilter }: { onFilter: () => v <EuiIconTip size="m" iconProps={{ - style: { marginLeft: euiTheme.eui.euiSizeXS }, + css: { marginLeft: euiTheme.size.xs }, }} content={i18n.translate( 'xpack.apm.correlations.latencyCorrelations.advancedStatisticsTooltipContent', diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/correlations/get_transaction_distribution_chart_data.ts b/x-pack/plugins/observability_solution/apm/public/components/app/correlations/get_transaction_distribution_chart_data.ts index 1e1fbda896f24..a9be40a81579c 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/correlations/get_transaction_distribution_chart_data.ts +++ b/x-pack/plugins/observability_solution/apm/public/components/app/correlations/get_transaction_distribution_chart_data.ts @@ -6,7 +6,7 @@ */ import { i18n } from '@kbn/i18n'; -import { EuiTheme } from '@kbn/kibana-react-plugin/common'; +import type { EuiThemeComputed } from '@elastic/eui'; import type { HistogramItem } from '../../../../common/correlations/types'; import { DurationDistributionChartData } from '../../shared/charts/duration_distribution_chart'; import { LatencyCorrelation } from '../../../../common/correlations/latency_correlations/types'; @@ -18,7 +18,7 @@ export function getTransactionDistributionChartData({ failedTransactionsHistogram, selectedTerm, }: { - euiTheme: EuiTheme; + euiTheme: EuiThemeComputed; allTransactionsHistogram?: HistogramItem[]; failedTransactionsHistogram?: HistogramItem[]; selectedTerm?: LatencyCorrelation | FailedTransactionsCorrelation | undefined; @@ -31,7 +31,7 @@ export function getTransactionDistributionChartData({ defaultMessage: 'All transactions', }), histogram: allTransactionsHistogram, - areaSeriesColor: euiTheme.eui.euiColorVis1, + areaSeriesColor: euiTheme.colors.vis.euiColorVis1, }); } @@ -41,7 +41,7 @@ export function getTransactionDistributionChartData({ defaultMessage: 'Failed transactions', }), histogram: failedTransactionsHistogram, - areaSeriesColor: euiTheme.eui.euiColorVis7, + areaSeriesColor: euiTheme.colors.vis.euiColorVis7, }); } @@ -49,7 +49,7 @@ export function getTransactionDistributionChartData({ transactionDistributionChartData.push({ id: `${selectedTerm.fieldName}:${selectedTerm.fieldValue}`, histogram: selectedTerm.histogram, - areaSeriesColor: euiTheme.eui.euiColorVis2, + areaSeriesColor: euiTheme.colors.vis.euiColorVis2, }); } diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/correlations/latency_correlations.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/correlations/latency_correlations.tsx index 8144dbd548410..92a1e996f65ad 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/correlations/latency_correlations.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/correlations/latency_correlations.tsx @@ -17,6 +17,7 @@ import { EuiTitle, EuiBadge, EuiIconTip, + useEuiTheme, } from '@elastic/eui'; import { Direction } from '@elastic/eui/src/services/sort/sort_direction'; import { EuiTableSortingType } from '@elastic/eui/src/components/basic_table/table_types'; @@ -47,7 +48,6 @@ import { CorrelationsProgressControls } from './progress_controls'; import { OnAddFilter } from './context_popover/field_stats_popover'; import { useLatencyCorrelations } from './use_latency_correlations'; import { getTransactionDistributionChartData } from './get_transaction_distribution_chart_data'; -import { useTheme } from '../../../hooks/use_theme'; import { ChartTitleToolTip } from './chart_title_tool_tip'; import { getLatencyCorrelationImpactLabel } from './utils/get_failed_transactions_correlation_impact_label'; import { MIN_TAB_TITLE_HEIGHT } from '../../shared/charts/duration_distribution_chart_with_scrubber'; @@ -68,7 +68,7 @@ export function LatencyCorrelations({ onFilter }: { onFilter: () => void }) { core: { notifications }, } = useApmPluginContext(); - const euiTheme = useTheme(); + const { euiTheme } = useEuiTheme(); const { progress, response, startFetch, cancelFetch } = useLatencyCorrelations(); const { overallHistogram, hasData, status } = getOverallHistogram(response, progress.isRunning); diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/dependency_operation_detail_view/dependency_operation_distribution_chart.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/dependency_operation_detail_view/dependency_operation_distribution_chart.tsx index 3f8b8728fd483..f7cd26fab3f81 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/dependency_operation_detail_view/dependency_operation_distribution_chart.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/dependency_operation_detail_view/dependency_operation_distribution_chart.tsx @@ -7,11 +7,11 @@ import { i18n } from '@kbn/i18n'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; import React from 'react'; +import { useEuiTheme } from '@elastic/eui'; import { DEFAULT_PERCENTILE_THRESHOLD } from '../../../../common/correlations/constants'; import { useApmParams } from '../../../hooks/use_apm_params'; import { useFetcher } from '../../../hooks/use_fetcher'; import { useSampleChartSelection } from '../../../hooks/use_sample_chart_selection'; -import { useTheme } from '../../../hooks/use_theme'; import { useTimeRange } from '../../../hooks/use_time_range'; import { DurationDistributionChartData } from '../../shared/charts/duration_distribution_chart'; import { DurationDistributionChartWithScrubber } from '../../shared/charts/duration_distribution_chart_with_scrubber'; @@ -22,7 +22,7 @@ export function DependencyOperationDistributionChart() { // there is no "current" event in the dependency operation detail view const markerCurrentEvent = undefined; - const euiTheme = useTheme(); + const { euiTheme } = useEuiTheme(); const { query: { @@ -67,14 +67,14 @@ export function DependencyOperationDistributionChart() { const chartData: DurationDistributionChartData[] = [ { - areaSeriesColor: euiTheme.eui.euiColorVis1, + areaSeriesColor: euiTheme.colors.vis.euiColorVis1, histogram: data?.allSpansDistribution.overallHistogram ?? [], id: i18n.translate('xpack.apm.dependencyOperationDistributionChart.allSpansLegendLabel', { defaultMessage: 'All spans', }), }, { - areaSeriesColor: euiTheme.eui.euiColorVis7, + areaSeriesColor: euiTheme.colors.vis.euiColorVis7, histogram: data?.failedSpansDistribution?.overallHistogram ?? [], id: i18n.translate('xpack.apm.dependencyOperationDistributionChart.failedSpansLegendLabel', { defaultMessage: 'Failed spans', diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/entities/entity_link/entity_link.test.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/entities/entity_link/entity_link.test.tsx index cdf6f23eb53d9..7bbfb43af71b8 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/entities/entity_link/entity_link.test.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/entities/entity_link/entity_link.test.tsx @@ -17,7 +17,6 @@ import { fromQuery } from '../../../shared/links/url_helpers'; import { APIReturnType } from '../../../../services/rest/create_call_apm_api'; import { Redirect } from 'react-router-dom'; import { ApmPluginContextValue } from '../../../../context/apm_plugin/apm_plugin_context'; -import { ApmThemeProvider } from '../../../routing/app_root'; import * as useEntityCentricExperienceSetting from '../../../../hooks/use_entity_centric_experience_setting'; jest.mock('react-router-dom', () => ({ @@ -85,9 +84,7 @@ const renderEntityLink = ({ } as unknown as ApmPluginContextValue } > - <ApmThemeProvider> - <EntityLink /> - </ApmThemeProvider> + <EntityLink /> </MockApmPluginContextWrapper> ); return { rerender, ...tools }; @@ -173,7 +170,9 @@ describe('Entity link', () => { renderEntityLink({ isEntityCentricExperienceEnabled: true, serviceEntitySummaryMockReturnValue: { - serviceEntitySummary: { dataStreamTypes: ['metrics'] } as unknown as ServiceEntitySummary, + serviceEntitySummary: { + ['data_stream.type']: ['metrics'], + } as unknown as ServiceEntitySummary, serviceEntitySummaryStatus: FETCH_STATUS.SUCCESS, }, hasApmDataFetcherMockReturnValue: { @@ -200,7 +199,9 @@ describe('Entity link', () => { renderEntityLink({ isEntityCentricExperienceEnabled: true, serviceEntitySummaryMockReturnValue: { - serviceEntitySummary: { dataStreamTypes: ['metrics'] } as unknown as ServiceEntitySummary, + serviceEntitySummary: { + ['data_stream.type']: ['metrics'], + } as unknown as ServiceEntitySummary, serviceEntitySummaryStatus: FETCH_STATUS.SUCCESS, }, hasApmDataFetcherMockReturnValue: { diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/entities/entity_link/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/entities/entity_link/index.tsx index 2ea10868957b5..7ad5661159fd5 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/entities/entity_link/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/entities/entity_link/index.tsx @@ -5,7 +5,14 @@ * 2.0. */ -import { EuiButtonEmpty, EuiEmptyPrompt, EuiImage, EuiLink, EuiLoadingSpinner } from '@elastic/eui'; +import { + EuiButtonEmpty, + EuiEmptyPrompt, + EuiImage, + EuiLink, + EuiLoadingSpinner, + useEuiTheme, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '@kbn/kibana-react-plugin/public'; @@ -18,7 +25,6 @@ import { useApmParams } from '../../../../hooks/use_apm_params'; import { useApmRouter } from '../../../../hooks/use_apm_router'; import { useEntityCentricExperienceSetting } from '../../../../hooks/use_entity_centric_experience_setting'; import { FETCH_STATUS, isPending, useFetcher } from '../../../../hooks/use_fetcher'; -import { useTheme } from '../../../../hooks/use_theme'; import { ApmPluginStartDeps } from '../../../../plugin'; const pageHeader = { @@ -27,7 +33,7 @@ const pageHeader = { export function EntityLink() { const router = useApmRouter({ prependBasePath: false }); - const theme = useTheme(); + const { colorMode } = useEuiTheme(); const { services } = useKibana<ApmPluginStartDeps>(); const { observabilityShared, data } = services; const timeRange = data.query.timefilter.timefilter.getTime(); @@ -65,7 +71,7 @@ export function EntityLink() { icon={ <EuiImage size="fullWidth" - src={theme.darkMode ? dashboardsDark : dashboardsLight} + src={colorMode === 'DARK' ? dashboardsDark : dashboardsLight} alt="" /> } diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/error_group_details/distribution/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/error_group_details/distribution/index.tsx index b8902b30dcff2..47101471a551a 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/error_group_details/distribution/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/error_group_details/distribution/index.tsx @@ -18,14 +18,13 @@ import { DARK_THEME, LegendValue, } from '@elastic/charts'; -import { EuiTitle } from '@elastic/eui'; +import { EuiTitle, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context'; import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params'; import { FETCH_STATUS } from '../../../../hooks/use_fetcher'; import { usePreviousPeriodLabel } from '../../../../hooks/use_previous_period_text'; -import { useTheme } from '../../../../hooks/use_theme'; import { APIReturnType } from '../../../../services/rest/create_call_apm_api'; import { ChartContainer } from '../../../shared/charts/chart_container'; import { ChartType, getTimeSeriesColor } from '../../../shared/charts/helper/get_timeseries_color'; @@ -42,7 +41,7 @@ interface Props { export function ErrorDistribution({ distribution, title, fetchStatus }: Props) { const { core } = useApmPluginContext(); - const theme = useTheme(); + const { colorMode } = useEuiTheme(); const { urlParams } = useLegacyUrlParams(); const { comparisonEnabled } = urlParams; @@ -97,7 +96,7 @@ export function ErrorDistribution({ distribution, title, fetchStatus }: Props) { showLegend legendValues={[LegendValue.CurrentAndLastValue]} legendPosition={Position.Bottom} - theme={theme.darkMode ? DARK_THEME : LIGHT_THEME} + theme={colorMode === 'DARK' ? DARK_THEME : LIGHT_THEME} locale={i18n.getLocale()} /> <Axis diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/error_group_details/error_sampler/error_sample_detail.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/error_group_details/error_sampler/error_sample_detail.tsx index 2edb2c1a3fea6..a1a2962b8067a 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/error_group_details/error_sampler/error_sample_detail.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/error_group_details/error_sampler/error_sample_detail.tsx @@ -22,7 +22,7 @@ import { EuiToolTip, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { ObservabilityTriggerId } from '@kbn/observability-shared-plugin/common'; import { getContextMenuItemsFromActions } from '@kbn/observability-shared-plugin/public'; import { first } from 'lodash'; @@ -56,8 +56,8 @@ import { ExceptionStacktrace } from './exception_stacktrace'; import { SampleSummary } from './sample_summary'; import { ErrorSampleContextualInsight } from './error_sample_contextual_insight'; -const TransactionLinkName = euiStyled.div` - margin-left: ${({ theme }) => theme.eui.euiSizeS}; +const TransactionLinkName = styled.div` + margin-left: ${({ theme }) => theme.euiTheme.size.s}; display: inline-block; vertical-align: middle; `; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/error_group_details/error_sampler/exception_stacktrace.test.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/error_group_details/error_sampler/exception_stacktrace.test.tsx index a4c23555edda3..3740edcbfe7d4 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/error_group_details/error_sampler/exception_stacktrace.test.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/error_group_details/error_sampler/exception_stacktrace.test.tsx @@ -8,6 +8,7 @@ import { composeStories } from '@storybook/testing-react'; import React from 'react'; import { mount } from 'enzyme'; +import { EuiThemeProvider } from '@elastic/eui'; import * as stories from './exception_stacktrace.stories'; import { ExceptionStackTraceTitleProps } from './exception_stacktrace_title'; @@ -17,10 +18,16 @@ describe('ExceptionStacktrace', () => { describe('render', () => { describe('with stacktraces', () => { it('renders the stacktraces', () => { - expect(mount(<JavaWithLongLines />).find('Stacktrace')).toHaveLength(3); + expect( + mount(<JavaWithLongLines />, { + wrappingComponent: EuiThemeProvider, + }).find('Stacktrace') + ).toHaveLength(3); }); it('should have the title in a specific format', function () { - const wrapper = mount(<JavaWithLongLines />).find('ExceptionStacktraceTitle'); + const wrapper = mount(<JavaWithLongLines />, { + wrappingComponent: EuiThemeProvider, + }).find('ExceptionStacktraceTitle'); expect(wrapper).toHaveLength(1); const { type, message } = wrapper.props() as ExceptionStackTraceTitleProps; expect(wrapper.text()).toContain(`${type}: ${message}`); @@ -29,7 +36,11 @@ describe('ExceptionStacktrace', () => { describe('with more than one stack trace', () => { it('renders cause stacktraces', () => { - expect(mount(<JavaWithLongLines />).find('CauseStacktrace')).toHaveLength(2); + expect( + mount(<JavaWithLongLines />, { + wrappingComponent: EuiThemeProvider, + }).find('CauseStacktrace') + ).toHaveLength(2); }); }); }); diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/error_group_details/error_sampler/sample_summary.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/error_group_details/error_sampler/sample_summary.tsx index c7acbfee7e45e..40d9a21bee352 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/error_group_details/error_sampler/sample_summary.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/error_group_details/error_sampler/sample_summary.tsx @@ -4,17 +4,17 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { EuiText, EuiSpacer, EuiCodeBlock } from '@elastic/eui'; +import { EuiText, EuiSpacer, EuiCodeBlock, useEuiFontSize } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { APMError } from '../../../../../typings/es_schemas/ui/apm_error'; import { NOT_AVAILABLE_LABEL } from '../../../../../common/i18n'; -const Label = euiStyled.div` - margin-bottom: ${({ theme }) => theme.eui.euiSizeXS}; - font-size: ${({ theme }) => theme.eui.euiFontSizeS}; - color: ${({ theme }) => theme.eui.euiColorDarkestShade}; +const Label = styled.div` + margin-bottom: ${({ theme }) => theme.euiTheme.size.xs}; + font-size: ${() => useEuiFontSize('s').fontSize}; + color: ${({ theme }) => theme.euiTheme.colors.darkestShade}; `; interface Props { diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/error_group_overview/error_group_list/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/error_group_overview/error_group_list/index.tsx index 51377d5e37709..c6593806191f4 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/error_group_overview/error_group_list/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/error_group_overview/error_group_list/index.tsx @@ -7,7 +7,7 @@ import { EuiBadge, EuiIconTip, EuiToolTip, RIGHT_ALIGNMENT } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import React, { useMemo, useState } from 'react'; import { apmEnableTableSearchBar } from '@kbn/observability-plugin/common'; import { isPending } from '../../../../hooks/use_fetcher'; @@ -30,25 +30,25 @@ import { isTimeComparison } from '../../../shared/time_comparison/get_comparison import { ErrorGroupItem, useErrorGroupListData } from './use_error_group_list_data'; import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context'; -const GroupIdLink = euiStyled(ErrorDetailLink)` - font-family: ${({ theme }) => theme.eui.euiCodeFontFamily}; +const GroupIdLink = styled(ErrorDetailLink)` + font-family: ${({ theme }) => theme.euiTheme.font.familyCode}; `; -const MessageAndCulpritCell = euiStyled.div` +const MessageAndCulpritCell = styled.div` ${truncate('100%')}; `; -const ErrorLink = euiStyled(ErrorOverviewLink)` +const ErrorLink = styled(ErrorOverviewLink)` ${truncate('100%')}; `; -const MessageLink = euiStyled(ErrorDetailLink)` - font-family: ${({ theme }) => theme.eui.euiCodeFontFamily}; +const MessageLink = styled(ErrorDetailLink)` + font-family: ${({ theme }) => theme.euiTheme.font.familyCode}; ${truncate('100%')}; `; -const Culprit = euiStyled.div` - font-family: ${({ theme }) => theme.eui.euiCodeFontFamily}; +const Culprit = styled.div` + font-family: ${({ theme }) => theme.euiTheme.font.familyCode}; `; interface Props { diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/help_popover/help_popover.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/help_popover/help_popover.tsx index c883376cac4e1..cfb50f983fdbe 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/help_popover/help_popover.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/help_popover/help_popover.tsx @@ -16,9 +16,9 @@ import { EuiPopoverTitle, EuiText, } from '@elastic/eui'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; -const PopoverContent = euiStyled(EuiText)` +const PopoverContent = styled(EuiText)` max-width: 480px; max-height: 40vh; `; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/infra_overview/infra_tabs/empty_prompt.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/infra_overview/infra_tabs/empty_prompt.tsx index 293dff7b60800..0d212682145f1 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/infra_overview/infra_tabs/empty_prompt.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/infra_overview/infra_tabs/empty_prompt.tsx @@ -11,12 +11,12 @@ import { EuiDescriptionListTitle, EuiEmptyPrompt, EuiImage, + useEuiTheme, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; import noResultsIllustrationDark from '../../../../assets/no_results_dark.svg'; import noResultsIllustrationLight from '../../../../assets/no_results_light.svg'; -import { useTheme } from '../../../../hooks/use_theme'; export function EmptyPrompt() { return ( @@ -52,9 +52,10 @@ export function EmptyPrompt() { } function NoResultsIllustration() { - const theme = useTheme(); + const { colorMode } = useEuiTheme(); - const illustration = theme.darkMode ? noResultsIllustrationDark : noResultsIllustrationLight; + const illustration = + colorMode === 'DARK' ? noResultsIllustrationDark : noResultsIllustrationLight; return ( <EuiImage alt={noResultsIllustrationAlternativeText} size="fullWidth" src={illustration} /> diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/metrics/jvm_metrics_overview/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/metrics/jvm_metrics_overview/index.tsx index 63a1dac2017b3..a936ec601ebea 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/metrics/jvm_metrics_overview/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/metrics/jvm_metrics_overview/index.tsx @@ -7,7 +7,7 @@ import { EuiToolTip, EuiIcon } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { getServiceNodeName, SERVICE_NODE_NAME_MISSING } from '../../../../../common/service_nodes'; import { asDynamicBytes, asInteger, asPercent } from '../../../../../common/utils/formatters'; import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context'; @@ -21,7 +21,7 @@ import { ITableColumn, ManagedTable } from '../../../shared/managed_table'; const INITIAL_SORT_FIELD = 'cpu'; const INITIAL_SORT_DIRECTION = 'desc'; -const ServiceNodeName = euiStyled.div` +const ServiceNodeName = styled.div` ${truncate(8 * unit)} `; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/metrics/serverless_metrics/serverless_function_name_link.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/metrics/serverless_metrics/serverless_function_name_link.tsx index 2de5991b19b47..eb1ab41f1dfa0 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/metrics/serverless_metrics/serverless_function_name_link.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/metrics/serverless_metrics/serverless_function_name_link.tsx @@ -5,14 +5,16 @@ * 2.0. */ import { EuiLink } from '@elastic/eui'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import React from 'react'; import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context'; import { useApmParams } from '../../../../hooks/use_apm_params'; import { useApmRouter } from '../../../../hooks/use_apm_router'; import { truncate } from '../../../../utils/style'; -const StyledLink = euiStyled(EuiLink)`${truncate('100%')};`; +const StyledLink = styled(EuiLink)` + ${truncate('100%')}; +`; interface Props { serverlessFunctionName: string; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/metrics/serverless_metrics/serverless_summary.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/metrics/serverless_metrics/serverless_summary.tsx index ab662e53d9d82..30544489eb0da 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/metrics/serverless_metrics/serverless_summary.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/metrics/serverless_metrics/serverless_summary.tsx @@ -15,7 +15,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import styled from 'styled-components'; +import styled from '@emotion/styled'; import { asMillisecondDuration, asPercent } from '../../../../../common/utils/formatters'; import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context'; import { useApmParams } from '../../../../hooks/use_apm_params'; @@ -34,7 +34,7 @@ const CentralizedContainer = styled.div` const Border = styled.div` height: 55px; - border-right: 1px solid ${({ theme }) => theme.eui.euiColorLightShade}; + border-right: ${({ theme }) => theme.euiTheme.border.thin}; `; function VerticalRule() { diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/metrics_details/service_node_metrics/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/metrics_details/service_node_metrics/index.tsx index 89ffc3b0be3f2..e01dc55447f27 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/metrics_details/service_node_metrics/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/metrics_details/service_node_metrics/index.tsx @@ -20,7 +20,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import React from 'react'; import { ApmDocumentType } from '../../../../../common/document_type'; import { getServiceNodeName, SERVICE_NODE_NAME_MISSING } from '../../../../../common/service_nodes'; @@ -42,7 +42,7 @@ const INITIAL_DATA = { containerId: '', }; -const Truncate = euiStyled.span` +const Truncate = styled.span` display: block; ${truncate(unit * 12)} `; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/errors_and_crashes_overview/crash_group_list/crash_group_list.test.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/errors_and_crashes_overview/crash_group_list/crash_group_list.test.tsx index cd1d4110e32fc..aab5a3a3af208 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/errors_and_crashes_overview/crash_group_list/crash_group_list.test.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/errors_and_crashes_overview/crash_group_list/crash_group_list.test.tsx @@ -6,14 +6,14 @@ */ import { composeStories } from '@storybook/testing-react'; -import { render } from '@testing-library/react'; import React from 'react'; import * as stories from './crash_group_list.stories'; +import { renderWithTheme } from '../../../../../utils/test_helpers'; const { Example } = composeStories(stories); describe('MobileCrashGroupList', () => { it('renders', () => { - expect(() => render(<Example />)).not.toThrowError(); + expect(() => renderWithTheme(<Example />)).not.toThrowError(); }); }); diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/errors_and_crashes_overview/crash_group_list/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/errors_and_crashes_overview/crash_group_list/index.tsx index 4923ed35a6d4b..403a5ff03db7f 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/errors_and_crashes_overview/crash_group_list/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/errors_and_crashes_overview/crash_group_list/index.tsx @@ -7,7 +7,7 @@ import { EuiToolTip, RIGHT_ALIGNMENT, LEFT_ALIGNMENT, EuiIconTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import React, { useMemo } from 'react'; import { NOT_AVAILABLE_LABEL } from '../../../../../../common/i18n'; import { asInteger } from '../../../../../../common/utils/formatters'; @@ -25,20 +25,20 @@ import { ITableColumn, ManagedTable } from '../../../../shared/managed_table'; import { TimestampTooltip } from '../../../../shared/timestamp_tooltip'; import { isTimeComparison } from '../../../../shared/time_comparison/get_comparison_options'; -const MessageAndCulpritCell = euiStyled.div` +const MessageAndCulpritCell = styled.div` ${truncate('100%')}; `; -const ErrorLink = euiStyled(ErrorOverviewLink)` +const ErrorLink = styled(ErrorOverviewLink)` ${truncate('100%')}; `; -const GroupIdLink = euiStyled(CrashDetailLink)` - font-family: ${({ theme }) => theme.eui.euiCodeFontFamily}; +const GroupIdLink = styled(CrashDetailLink)` + font-family: ${({ theme }) => theme.euiTheme.font.familyCode}; `; -const MessageLink = euiStyled(CrashDetailLink)` - font-family: ${({ theme }) => theme.eui.euiCodeFontFamily}; +const MessageLink = styled(CrashDetailLink)` + font-family: ${({ theme }) => theme.euiTheme.font.familyCode}; ${truncate('100%')}; `; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/errors_and_crashes_overview/error_group_list/error_group_list.test.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/errors_and_crashes_overview/error_group_list/error_group_list.test.tsx index 278825c25c68c..92cad40623c0b 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/errors_and_crashes_overview/error_group_list/error_group_list.test.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/errors_and_crashes_overview/error_group_list/error_group_list.test.tsx @@ -6,14 +6,14 @@ */ import { composeStories } from '@storybook/testing-react'; -import { render } from '@testing-library/react'; import React from 'react'; import * as stories from './error_group_list.stories'; +import { renderWithTheme } from '../../../../../utils/test_helpers'; const { Example } = composeStories(stories); describe('ErrorGroupList', () => { it('renders', () => { - expect(() => render(<Example />)).not.toThrowError(); + expect(() => renderWithTheme(<Example />)).not.toThrowError(); }); }); diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/errors_and_crashes_overview/error_group_list/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/errors_and_crashes_overview/error_group_list/index.tsx index 0938c97d737d2..7153b673b3195 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/errors_and_crashes_overview/error_group_list/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/errors_and_crashes_overview/error_group_list/index.tsx @@ -7,7 +7,7 @@ import { EuiBadge, EuiToolTip, RIGHT_ALIGNMENT, LEFT_ALIGNMENT, EuiIconTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import React, { useMemo } from 'react'; import { NOT_AVAILABLE_LABEL } from '../../../../../../common/i18n'; import { asInteger } from '../../../../../../common/utils/formatters'; @@ -25,20 +25,20 @@ import { ITableColumn, ManagedTable } from '../../../../shared/managed_table'; import { TimestampTooltip } from '../../../../shared/timestamp_tooltip'; import { isTimeComparison } from '../../../../shared/time_comparison/get_comparison_options'; -const GroupIdLink = euiStyled(ErrorDetailLink)` - font-family: ${({ theme }) => theme.eui.euiCodeFontFamily}; +const GroupIdLink = styled(ErrorDetailLink)` + font-family: ${({ theme }) => theme.euiTheme.font.familyCode}; `; -const MessageAndCulpritCell = euiStyled.div` +const MessageAndCulpritCell = styled.div` ${truncate('100%')}; `; -const ErrorLink = euiStyled(ErrorOverviewLink)` +const ErrorLink = styled(ErrorOverviewLink)` ${truncate('100%')}; `; -const MessageLink = euiStyled(ErrorDetailLink)` - font-family: ${({ theme }) => theme.eui.euiCodeFontFamily}; +const MessageLink = styled(ErrorDetailLink)` + font-family: ${({ theme }) => theme.euiTheme.font.familyCode}; ${truncate('100%')}; `; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/stats/location_stats.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/stats/location_stats.tsx index 47451fac265c9..b514277a5dc91 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/stats/location_stats.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/stats/location_stats.tsx @@ -6,9 +6,8 @@ */ import { MetricDatum, MetricTrendShape } from '@elastic/charts'; import { i18n } from '@kbn/i18n'; -import { EuiIcon, EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui'; +import { EuiIcon, EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner, useEuiTheme } from '@elastic/eui'; import React, { useCallback } from 'react'; -import { useTheme } from '@kbn/observability-shared-plugin/public'; import { useFetcher, isPending, FETCH_STATUS } from '../../../../../hooks/use_fetcher'; import { CLIENT_GEO_COUNTRY_NAME } from '../../../../../../common/es_fields/apm'; import { NOT_AVAILABLE_LABEL } from '../../../../../../common/i18n'; @@ -45,7 +44,7 @@ export function MobileLocationStats({ environment: string; comparisonEnabled: boolean; }) { - const euiTheme = useTheme(); + const { euiTheme } = useEuiTheme(); const previousPeriodLabel = usePreviousPeriodLabel(); @@ -107,7 +106,7 @@ export function MobileLocationStats({ const metrics: MetricDatum[] = [ { - color: euiTheme.eui.euiColorLightestShade, + color: euiTheme.colors.lightestShade, title: i18n.translate('xpack.apm.mobile.location.metrics.http.requests.title', { defaultMessage: 'Most used in', }), @@ -121,7 +120,7 @@ export function MobileLocationStats({ trendShape: MetricTrendShape.Area, }, { - color: euiTheme.eui.euiColorLightestShade, + color: euiTheme.colors.lightestShade, title: i18n.translate('xpack.apm.mobile.location.metrics.mostCrashes', { defaultMessage: 'Most crashes', }), @@ -135,7 +134,7 @@ export function MobileLocationStats({ trendShape: MetricTrendShape.Area, }, { - color: euiTheme.eui.euiColorLightestShade, + color: euiTheme.colors.lightestShade, title: i18n.translate('xpack.apm.mobile.location.metrics.sessions', { defaultMessage: 'Most sessions', }), @@ -149,7 +148,7 @@ export function MobileLocationStats({ trendShape: MetricTrendShape.Area, }, { - color: euiTheme.eui.euiColorLightestShade, + color: euiTheme.colors.lightestShade, title: i18n.translate('xpack.apm.mobile.location.metrics.launches', { defaultMessage: 'Most launches', }), diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/stats/stats.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/stats/stats.tsx index 59f6020d61c33..4376eeccab5c3 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/stats/stats.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/stats/stats.tsx @@ -6,9 +6,8 @@ */ import { MetricDatum, MetricTrendShape } from '@elastic/charts'; import { i18n } from '@kbn/i18n'; -import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiLoadingSpinner } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiLoadingSpinner, useEuiTheme } from '@elastic/eui'; import React, { useCallback } from 'react'; -import { useTheme } from '@kbn/observability-shared-plugin/public'; import { NOT_AVAILABLE_LABEL } from '../../../../../../common/i18n'; import { useAnyOfApmParams } from '../../../../../hooks/use_apm_params'; import { FETCH_STATUS, isPending, useFetcher } from '../../../../../hooks/use_fetcher'; @@ -20,7 +19,7 @@ const valueFormatter = (value: number, suffix = '') => { }; export function MobileStats({ start, end, kuery }: { start: string; end: string; kuery: string }) { - const euiTheme = useTheme(); + const { euiTheme } = useEuiTheme(); const { path: { serviceName }, @@ -77,7 +76,7 @@ export function MobileStats({ start, end, kuery }: { start: string; end: string; const metrics: MetricDatum[] = [ { - color: euiTheme.eui.euiColorLightestShade, + color: euiTheme.colors.lightestShade, title: i18n.translate('xpack.apm.mobile.metrics.crash.rate', { defaultMessage: 'Crash rate', }), @@ -92,7 +91,7 @@ export function MobileStats({ start, end, kuery }: { start: string; end: string; trendShape: MetricTrendShape.Area, }, { - color: euiTheme.eui.euiColorLightestShade, + color: euiTheme.colors.lightestShade, title: i18n.translate('xpack.apm.mobile.metrics.load.time', { defaultMessage: 'Average app load time', }), @@ -105,7 +104,7 @@ export function MobileStats({ start, end, kuery }: { start: string; end: string; trendShape: MetricTrendShape.Area, }, { - color: euiTheme.eui.euiColorLightestShade, + color: euiTheme.colors.lightestShade, title: i18n.translate('xpack.apm.mobile.metrics.sessions', { defaultMessage: 'Sessions', }), @@ -118,7 +117,7 @@ export function MobileStats({ start, end, kuery }: { start: string; end: string; trendShape: MetricTrendShape.Area, }, { - color: euiTheme.eui.euiColorLightestShade, + color: euiTheme.colors.lightestShade, title: i18n.translate('xpack.apm.mobile.metrics.http.requests', { defaultMessage: 'HTTP requests', }), diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_dashboards/empty_dashboards.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_dashboards/empty_dashboards.tsx index 9b7ace008206b..bf4c234060996 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_dashboards/empty_dashboards.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_dashboards/empty_dashboards.tsx @@ -5,17 +5,16 @@ * 2.0. */ import React from 'react'; -import { EuiEmptyPrompt, EuiImage } from '@elastic/eui'; +import { EuiEmptyPrompt, EuiImage, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { dashboardsDark, dashboardsLight } from '@kbn/shared-svg'; -import { useTheme } from '../../../hooks/use_theme'; interface Props { actions: React.ReactNode; } export function EmptyDashboards({ actions }: Props) { - const theme = useTheme(); + const { colorMode } = useEuiTheme(); return ( <> @@ -25,7 +24,7 @@ export function EmptyDashboards({ actions }: Props) { icon={ <EuiImage size="fullWidth" - src={theme.darkMode ? dashboardsDark : dashboardsLight} + src={colorMode === 'DARK' ? dashboardsDark : dashboardsLight} alt="" /> } diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_groups/service_group_save/select_services.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_groups/service_group_save/select_services.tsx index b6a901bac8d2f..38f681921a6c6 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_groups/service_group_save/select_services.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_groups/service_group_save/select_services.tsx @@ -23,7 +23,7 @@ import { import { i18n } from '@kbn/i18n'; import { css } from '@emotion/react'; import React, { useEffect, useState, useMemo } from 'react'; -import styled from 'styled-components'; +import styled from '@emotion/styled'; import { isEmpty } from 'lodash'; import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher'; import { KueryBar } from '../../../shared/kuery_bar'; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_inventory/service_list/health_badge.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_inventory/service_list/health_badge.tsx index aa4299006cc48..1c21826c80d3b 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_inventory/service_list/health_badge.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_inventory/service_list/health_badge.tsx @@ -6,19 +6,18 @@ */ import React from 'react'; -import { EuiBadge } from '@elastic/eui'; +import { EuiBadge, useEuiTheme } from '@elastic/eui'; import { getServiceHealthStatusBadgeColor, getServiceHealthStatusLabel, ServiceHealthStatus, } from '../../../../../common/service_health_status'; -import { useTheme } from '../../../../hooks/use_theme'; export function HealthBadge({ healthStatus }: { healthStatus: ServiceHealthStatus }) { - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); return ( - <EuiBadge color={getServiceHealthStatusBadgeColor(theme, healthStatus)}> + <EuiBadge color={getServiceHealthStatusBadgeColor(euiTheme, healthStatus)}> {getServiceHealthStatusLabel(healthStatus)} </EuiBadge> ); diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/controls.test.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/controls.test.tsx index 21d7bbf6d1201..71d3f7aa271d0 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/controls.test.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/controls.test.tsx @@ -5,15 +5,13 @@ * 2.0. */ -import { euiLightVars as lightTheme } from '@kbn/ui-theme'; -import { render } from '@testing-library/react'; import cytoscape from 'cytoscape'; import React, { ReactNode } from 'react'; import { MemoryRouter } from 'react-router-dom'; -import { ThemeContext } from 'styled-components'; import { MockApmPluginContextWrapper } from '../../../context/apm_plugin/mock_apm_plugin_context'; import { Controls } from './controls'; import { CytoscapeContext } from './cytoscape'; +import { renderWithTheme } from '../../../utils/test_helpers'; const cy = cytoscape({ elements: [{ classes: 'primary', data: { id: 'test node' } }], @@ -27,11 +25,8 @@ function Wrapper({ children }: { children?: ReactNode }) { '/service-map?rangeFrom=now-15m&rangeTo=now&environment=ENVIRONMENT_ALL&kuery=', ]} > - <MockApmPluginContextWrapper> - <ThemeContext.Provider value={{ eui: lightTheme }}>{children}</ThemeContext.Provider> - </MockApmPluginContextWrapper> + <MockApmPluginContextWrapper>{children}</MockApmPluginContextWrapper> </MemoryRouter> - s </CytoscapeContext.Provider> ); } @@ -39,7 +34,7 @@ function Wrapper({ children }: { children?: ReactNode }) { describe('Controls', () => { describe('with a primary node', () => { it('links to the full map', async () => { - const result = render(<Controls />, { wrapper: Wrapper }); + const result = renderWithTheme(<Controls />, { wrapper: Wrapper }); const { findByTestId } = result; const button = await findByTestId('viewFullMapButton'); diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/controls.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/controls.tsx index ac15281d61212..e3a293a279e2c 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/controls.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/controls.tsx @@ -5,12 +5,11 @@ * 2.0. */ -import { EuiButtonIcon, EuiPanel, EuiToolTip } from '@elastic/eui'; +import { EuiButtonIcon, EuiPanel, EuiToolTip, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { useContext, useEffect, useState } from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; -import { useTheme } from '../../../hooks/use_theme'; import { getLegacyApmHref } from '../../shared/links/apm/apm_link'; import { useLegacyUrlParams } from '../../../context/url_params_context/use_url_params'; import { APMQueryParams } from '../../shared/links/url_helpers'; @@ -18,24 +17,24 @@ import { CytoscapeContext } from './cytoscape'; import { getAnimationOptions, getNodeHeight } from './cytoscape_options'; import { useAnyOfApmParams } from '../../../hooks/use_apm_params'; -const ControlsContainer = euiStyled('div')` - left: ${({ theme }) => theme.eui.euiSize}; +const ControlsContainer = styled('div')` + left: ${({ theme }) => theme.euiTheme.size.base}; position: absolute; - top: ${({ theme }) => theme.eui.euiSizeS}; + top: ${({ theme }) => theme.euiTheme.size.s}; z-index: 1; /* The element containing the cytoscape canvas has z-index = 0. */ `; -const Button = euiStyled(EuiButtonIcon)` +const Button = styled(EuiButtonIcon)` display: block; - margin: ${({ theme }) => theme.eui.euiSizeXS}; + margin: ${({ theme }) => theme.euiTheme.size.xs}; `; -const ZoomInButton = euiStyled(Button)` - margin-bottom: ${({ theme }) => theme.eui.euiSizeS}; +const ZoomInButton = styled(Button)` + margin-bottom: ${({ theme }) => theme.euiTheme.size.s}; `; -const Panel = euiStyled(EuiPanel)` - margin-bottom: ${({ theme }) => theme.eui.euiSizeS}; +const Panel = styled(EuiPanel)` + margin-bottom: ${({ theme }) => theme.euiTheme.size.s}; `; const steps = 5; @@ -97,7 +96,7 @@ function useDebugDownloadUrl(cy?: cytoscape.Core) { export function Controls() { const { core } = useApmPluginContext(); const { basePath } = core.http; - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); const cy = useContext(CytoscapeContext); const { urlParams } = useLegacyUrlParams(); @@ -110,7 +109,7 @@ export function Controls() { ); const [zoom, setZoom] = useState((cy && cy.zoom()) || 1); - const duration = parseInt(theme.eui.euiAnimSpeedFast, 10); + const duration = euiTheme.animation.fast ? parseInt(euiTheme.animation.fast, 10) : 0; const downloadUrl = useDebugDownloadUrl(cy); const viewFullMapUrl = getLegacyApmHref({ basePath, @@ -140,9 +139,9 @@ export function Controls() { if (cy) { const eles = cy.nodes(); cy.animate({ - ...getAnimationOptions(theme), + ...getAnimationOptions(euiTheme), center: { eles }, - fit: { eles, padding: getNodeHeight(theme) }, + fit: { eles, padding: getNodeHeight(euiTheme) }, }); } } diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/cytoscape.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/cytoscape.tsx index 8535c483529a9..eacd67e6dabe8 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/cytoscape.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/cytoscape.tsx @@ -17,7 +17,7 @@ import React, { useRef, useState, } from 'react'; -import { useTheme } from '../../../hooks/use_theme'; +import { useEuiTheme } from '@elastic/eui'; import { useTraceExplorerEnabledSetting } from '../../../hooks/use_trace_explorer_enabled_setting'; import { getCytoscapeOptions } from './cytoscape_options'; import { useCytoscapeEventHandlers } from './use_cytoscape_event_handlers'; @@ -57,13 +57,13 @@ function useCytoscape(options: cytoscape.CytoscapeOptions) { } function CytoscapeComponent({ children, elements, height, serviceName, style }: CytoscapeProps) { - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); const isTraceExplorerEnabled = useTraceExplorerEnabledSetting(); const [ref, cy] = useCytoscape({ - ...getCytoscapeOptions(theme, isTraceExplorerEnabled), + ...getCytoscapeOptions(euiTheme, isTraceExplorerEnabled), elements, }); - useCytoscapeEventHandlers({ cy, serviceName, theme }); + useCytoscapeEventHandlers({ cy, serviceName, euiTheme }); // Add items from the elements prop to the cytoscape collection and remove // items that no longer are in the list, then trigger an event to notify diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/cytoscape_options.ts b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/cytoscape_options.ts index af0befbc06165..fa6fdbce3c76c 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/cytoscape_options.ts +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/cytoscape_options.ts @@ -7,7 +7,7 @@ import cytoscape from 'cytoscape'; import { CSSProperties } from 'react'; -import { EuiTheme } from '@kbn/kibana-react-plugin/common'; +import type { EuiThemeComputed } from '@elastic/eui'; import { ServiceAnomalyStats } from '../../../../common/anomaly_detection'; import { SERVICE_NAME, SPAN_DESTINATION_SERVICE_RESOURCE } from '../../../../common/es_fields/apm'; import { @@ -26,21 +26,21 @@ function getServiceAnomalyStats(el: cytoscape.NodeSingular) { } function getBorderColorFn( - theme: EuiTheme + euiTheme: EuiThemeComputed ): cytoscape.Css.MapperFunction<cytoscape.NodeSingular, string> { return (el: cytoscape.NodeSingular) => { const hasAnomalyDetectionJob = el.data('serviceAnomalyStats') !== undefined; const anomalyStats = getServiceAnomalyStats(el); if (hasAnomalyDetectionJob) { return getServiceHealthStatusColor( - theme, + euiTheme, anomalyStats?.healthStatus ?? ServiceHealthStatus.unknown ); } if (el.hasClass('primary') || el.selected()) { - return theme.eui.euiColorPrimary; + return euiTheme.colors.primary; } - return theme.eui.euiColorMediumShade; + return euiTheme.colors.mediumShade; }; } @@ -79,10 +79,10 @@ function getBorderWidth(el: cytoscape.NodeSingular) { // @ts-expect-error `documentMode` is not recognized as a valid property of `document`. const isIE11 = !!window.MSInputMethodContext && !!document.documentMode; -export const getAnimationOptions = (theme: EuiTheme): cytoscape.AnimationOptions => ({ - duration: parseInt(theme.eui.euiAnimSpeedNormal, 10), +export const getAnimationOptions = (euiTheme: EuiThemeComputed): cytoscape.AnimationOptions => ({ + duration: euiTheme.animation.normal ? parseInt(euiTheme.animation.normal, 10) : 0, // @ts-expect-error The cubic-bezier options here are not recognized by the cytoscape types - easing: theme.eui.euiAnimSlightBounce, + easing: euiTheme.animation.bounce, }); const zIndexNode = 200; @@ -90,14 +90,18 @@ const zIndexEdge = 100; const zIndexEdgeHighlight = 110; const zIndexEdgeHover = 120; -export const getNodeHeight = (theme: EuiTheme): number => parseInt(theme.eui.euiSizeXXL, 10); +export const getNodeHeight = (euiTheme: EuiThemeComputed): number => + parseInt(euiTheme.size.xxl, 10); function isService(el: cytoscape.NodeSingular) { return el.data(SERVICE_NAME) !== undefined; } -const getStyle = (theme: EuiTheme, isTraceExplorerEnabled: boolean): cytoscape.Stylesheet[] => { - const lineColor = theme.eui.euiColorMediumShade; +const getStyle = ( + euiTheme: EuiThemeComputed, + isTraceExplorerEnabled: boolean +): cytoscape.Stylesheet[] => { + const lineColor = euiTheme.colors.mediumShade; return [ { selector: 'core', @@ -107,46 +111,46 @@ const getStyle = (theme: EuiTheme, isTraceExplorerEnabled: boolean): cytoscape.S { selector: 'node', style: { - 'background-color': theme.eui.euiColorGhost, + 'background-color': euiTheme.colors.backgroundBasePlain, // The DefinitelyTyped definitions don't specify that a function can be // used here. 'background-image': (el: cytoscape.NodeSingular) => iconForNode(el), 'background-height': (el: cytoscape.NodeSingular) => (isService(el) ? '60%' : '40%'), 'background-width': (el: cytoscape.NodeSingular) => (isService(el) ? '60%' : '40%'), - 'border-color': getBorderColorFn(theme), + 'border-color': getBorderColorFn(euiTheme), 'border-style': getBorderStyle, 'border-width': getBorderWidth, color: (el: cytoscape.NodeSingular) => el.hasClass('primary') || el.selected() - ? theme.eui.euiColorPrimaryText - : theme.eui.euiTextColor, + ? euiTheme.colors.textPrimary + : euiTheme.colors.textParagraph, // theme.euiFontFamily doesn't work here for some reason, so we're just // specifying a subset of the fonts for the label text. 'font-family': 'Inter UI, Segoe UI, Helvetica, Arial, sans-serif', - 'font-size': theme.eui.euiFontSizeS, + 'font-size': euiTheme.size.s, ghost: 'yes', 'ghost-offset-x': 0, 'ghost-offset-y': 2, 'ghost-opacity': 0.15, - height: getNodeHeight(theme), + height: getNodeHeight(euiTheme), label: (el: cytoscape.NodeSingular) => isService(el) ? el.data(SERVICE_NAME) : el.data('label') || el.data(SPAN_DESTINATION_SERVICE_RESOURCE), - 'min-zoomed-font-size': parseInt(theme.eui.euiSizeS, 10), + 'min-zoomed-font-size': parseInt(euiTheme.size.s, 10), 'overlay-opacity': 0, shape: (el: cytoscape.NodeSingular) => isService(el) ? (isIE11 ? 'rectangle' : 'ellipse') : 'diamond', - 'text-background-color': theme.eui.euiColorPrimary, + 'text-background-color': euiTheme.colors.primary, 'text-background-opacity': (el: cytoscape.NodeSingular) => el.hasClass('primary') || el.selected() ? 0.1 : 0, - 'text-background-padding': theme.eui.euiSizeXS, + 'text-background-padding': euiTheme.size.xs, 'text-background-shape': 'roundrectangle', - 'text-margin-y': parseInt(theme.eui.euiSizeS, 10), + 'text-margin-y': parseInt(euiTheme.size.s, 10), 'text-max-width': '200px', 'text-valign': 'bottom', 'text-wrap': 'ellipsis', - width: theme.eui.euiSizeXXL, + width: euiTheme.size.xxl, 'z-index': zIndexNode, }, }, @@ -162,7 +166,7 @@ const getStyle = (theme: EuiTheme, isTraceExplorerEnabled: boolean): cytoscape.S // fairly new. // // @ts-expect-error - 'target-distance-from-node': isIE11 ? undefined : theme.eui.euiSizeXS, + 'target-distance-from-node': isIE11 ? undefined : euiTheme.size.xs, width: 1, 'source-arrow-shape': 'none', 'z-index': zIndexEdge, @@ -175,8 +179,8 @@ const getStyle = (theme: EuiTheme, isTraceExplorerEnabled: boolean): cytoscape.S 'source-arrow-color': lineColor, 'target-arrow-shape': isIE11 ? 'none' : 'triangle', // @ts-expect-error - 'source-distance-from-node': isIE11 ? undefined : parseInt(theme.eui.euiSizeXS, 10), - 'target-distance-from-node': isIE11 ? undefined : parseInt(theme.eui.euiSizeXS, 10), + 'source-distance-from-node': isIE11 ? undefined : parseInt(euiTheme.size.xs, 10), + 'target-distance-from-node': isIE11 ? undefined : parseInt(euiTheme.size.xs, 10), }, }, { @@ -190,9 +194,9 @@ const getStyle = (theme: EuiTheme, isTraceExplorerEnabled: boolean): cytoscape.S style: { width: 4, 'z-index': zIndexEdgeHover, - 'line-color': theme.eui.euiColorDarkShade, - 'source-arrow-color': theme.eui.euiColorDarkShade, - 'target-arrow-color': theme.eui.euiColorDarkShade, + 'line-color': euiTheme.colors.darkShade, + 'source-arrow-color': euiTheme.colors.darkShade, + 'target-arrow-color': euiTheme.colors.darkShade, }, }, ...(isTraceExplorerEnabled @@ -202,9 +206,9 @@ const getStyle = (theme: EuiTheme, isTraceExplorerEnabled: boolean): cytoscape.S style: { width: 4, 'z-index': zIndexEdgeHover, - 'line-color': theme.eui.euiColorDarkShade, - 'source-arrow-color': theme.eui.euiColorDarkShade, - 'target-arrow-color': theme.eui.euiColorDarkShade, + 'line-color': euiTheme.colors.darkShade, + 'source-arrow-color': euiTheme.colors.darkShade, + 'target-arrow-color': euiTheme.colors.darkShade, }, }, ] @@ -219,9 +223,9 @@ const getStyle = (theme: EuiTheme, isTraceExplorerEnabled: boolean): cytoscape.S selector: 'edge.highlight', style: { width: 4, - 'line-color': theme.eui.euiColorPrimary, - 'source-arrow-color': theme.eui.euiColorPrimary, - 'target-arrow-color': theme.eui.euiColorPrimary, + 'line-color': euiTheme.colors.primary, + 'source-arrow-color': euiTheme.colors.primary, + 'target-arrow-color': euiTheme.colors.primary, 'z-index': zIndexEdgeHighlight, }, }, @@ -230,32 +234,35 @@ const getStyle = (theme: EuiTheme, isTraceExplorerEnabled: boolean): cytoscape.S // The CSS styles for the div containing the cytoscape element. Makes a // background grid of dots. -export const getCytoscapeDivStyle = (theme: EuiTheme, status: FETCH_STATUS): CSSProperties => ({ +export const getCytoscapeDivStyle = ( + euiTheme: EuiThemeComputed, + status: FETCH_STATUS +): CSSProperties => ({ background: `linear-gradient( 90deg, - ${theme.eui.euiPageBackgroundColor} - calc(${theme.eui.euiSizeL} - calc(${theme.eui.euiSizeXS} / 2)), + ${euiTheme.colors.backgroundBasePlain} + calc(${euiTheme.size.l} - calc(${euiTheme.size.xs} / 2)), transparent 1% ) center, linear-gradient( - ${theme.eui.euiPageBackgroundColor} - calc(${theme.eui.euiSizeL} - calc(${theme.eui.euiSizeXS} / 2)), + ${euiTheme.colors.backgroundBasePlain} + calc(${euiTheme.size.l} - calc(${euiTheme.size.xs} / 2)), transparent 1% ) center, -${theme.eui.euiColorLightShade}`, - backgroundSize: `${theme.eui.euiSizeL} ${theme.eui.euiSizeL}`, +${euiTheme.colors.lightShade}`, + backgroundSize: `${euiTheme.size.l} ${euiTheme.size.l}`, cursor: `${status === FETCH_STATUS.LOADING ? 'wait' : 'grab'}`, marginTop: 0, }); export const getCytoscapeOptions = ( - theme: EuiTheme, + euiTheme: EuiThemeComputed, isTraceExplorerEnabled: boolean ): cytoscape.CytoscapeOptions => ({ boxSelectionEnabled: false, maxZoom: 3, minZoom: 0.2, - style: getStyle(theme, isTraceExplorerEnabled), + style: getStyle(euiTheme, isTraceExplorerEnabled), }); diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/empty_banner.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/empty_banner.tsx index 7d419baecc9eb..9de1e54861411 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/empty_banner.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/empty_banner.tsx @@ -6,26 +6,22 @@ */ import React, { useContext, useEffect, useState } from 'react'; -import { EuiCallOut, EuiLink } from '@elastic/eui'; +import { EuiCallOut, EuiLink, useEuiTheme } from '@elastic/eui'; +import styled from '@emotion/styled'; import { i18n } from '@kbn/i18n'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { CytoscapeContext } from './cytoscape'; -import { useTheme } from '../../../hooks/use_theme'; import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; -const EmptyBannerContainer = euiStyled.div` - margin: ${({ theme }) => theme.eui.euiSizeS}; +const EmptyBannerContainer = styled.div` + margin: ${({ theme }) => theme.euiTheme.size.s}; /* Add some extra margin so it displays to the right of the controls. */ - left: calc( - ${({ theme }) => theme.eui.euiSizeXXL} + - ${({ theme }) => theme.eui.euiSizeS} - ); + left: calc(${({ theme }) => theme.euiTheme.size.xxl} + ${({ theme }) => theme.euiTheme.size.s}); position: absolute; z-index: 1; `; export function EmptyBanner() { - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); const cy = useContext(CytoscapeContext); const [nodeCount, setNodeCount] = useState(0); const { docLinks } = useApmPluginContext().core; @@ -51,7 +47,7 @@ export function EmptyBanner() { // Since we're absolutely positioned, we need to get the full width and // subtract the space for controls and margins. - const width = cy.width() - parseInt(theme.eui.euiSizeXXL, 10) - parseInt(theme.eui.euiSizeL, 10); + const width = cy.width() - parseInt(euiTheme.size.xxl, 10) - parseInt(euiTheme.size.l, 10); return ( <EmptyBannerContainer style={{ width }}> diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/index.tsx index 113be5407c070..7d6bcbe69cfac 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/index.tsx @@ -6,14 +6,13 @@ */ import { usePerformanceContext } from '@kbn/ebt-tools'; -import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner, EuiPanel } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner, EuiPanel, useEuiTheme } from '@elastic/eui'; import React, { ReactNode } from 'react'; import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; import { isActivePlatinumLicense } from '../../../../common/license_check'; import { invalidLicenseMessage, SERVICE_MAP_TIMEOUT_ERROR } from '../../../../common/service_map'; import { FETCH_STATUS, useFetcher } from '../../../hooks/use_fetcher'; import { useLicenseContext } from '../../../context/license/use_license_context'; -import { useTheme } from '../../../hooks/use_theme'; import { LicensePrompt } from '../../shared/license_prompt'; import { Controls } from './controls'; import { Cytoscape } from './cytoscape'; @@ -103,7 +102,7 @@ export function ServiceMap({ end: string; serviceGroupId?: string; }) { - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); const license = useLicenseContext(); const serviceName = useServiceName(); const { config } = useApmPluginContext(); @@ -200,7 +199,7 @@ export function ServiceMap({ elements={data.elements} height={heightWithPadding} serviceName={serviceName} - style={getCytoscapeDivStyle(theme, status)} + style={getCytoscapeDivStyle(euiTheme, status)} > <Controls /> {serviceName && <EmptyBanner />} diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/anomaly_detection.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/anomaly_detection.tsx index 307887148e3e8..562093976177a 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/anomaly_detection.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/anomaly_detection.tsx @@ -5,10 +5,18 @@ * 2.0. */ -import { EuiFlexGroup, EuiFlexItem, EuiHealth, EuiIconTip, EuiTitle } from '@elastic/eui'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiHealth, + EuiIconTip, + EuiTitle, + useEuiFontSize, + useEuiTheme, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { getSeverity, ServiceAnomalyStats } from '../../../../../common/anomaly_detection'; import { getServiceHealthStatus, @@ -16,32 +24,31 @@ import { } from '../../../../../common/service_health_status'; import { TRANSACTION_REQUEST } from '../../../../../common/transaction_types'; import { asDuration, asInteger } from '../../../../../common/utils/formatters'; -import { useTheme } from '../../../../hooks/use_theme'; import { MLSingleMetricLink } from '../../../shared/links/machine_learning_links/mlsingle_metric_link'; import { popoverWidth } from '../cytoscape_options'; -const HealthStatusTitle = euiStyled(EuiTitle)` +const HealthStatusTitle = styled(EuiTitle)` display: inline; text-transform: uppercase; `; -const VerticallyCentered = euiStyled.div` +const VerticallyCentered = styled.div` display: flex; align-items: center; `; -const SubduedText = euiStyled.span` - color: ${({ theme }) => theme.eui.euiTextSubduedColor}; +const SubduedText = styled.span` + color: ${({ theme }) => theme.euiTheme.colors.textSubdued}; `; -const EnableText = euiStyled.section` - color: ${({ theme }) => theme.eui.euiTextSubduedColor}; +const EnableText = styled.section` + color: ${({ theme }) => theme.euiTheme.colors.textSubdued}; line-height: 1.4; - font-size: ${({ theme }) => theme.eui.euiFontSizeS}; + font-size: ${() => useEuiFontSize('s').fontSize}; width: ${popoverWidth}px; `; -export const ContentLine = euiStyled.section` +export const ContentLine = styled.section` line-height: 2; `; @@ -50,7 +57,7 @@ interface Props { serviceAnomalyStats: ServiceAnomalyStats | undefined; } export function AnomalyDetection({ serviceName, serviceAnomalyStats }: Props) { - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); const anomalyScore = serviceAnomalyStats?.anomalyScore; const severity = getSeverity(anomalyScore); @@ -76,7 +83,7 @@ export function AnomalyDetection({ serviceName, serviceAnomalyStats }: Props) { <EuiFlexGroup> <EuiFlexItem> <VerticallyCentered> - <EuiHealth color={getServiceHealthStatusColor(theme, healthStatus)} /> + <EuiHealth color={getServiceHealthStatusColor(euiTheme, healthStatus)} /> <SubduedText>{ANOMALY_DETECTION_SCORE_METRIC}</SubduedText> </VerticallyCentered> </EuiFlexItem> diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/externals_list_contents.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/externals_list_contents.tsx index 523a4e1ea415e..a81df94c3d6f0 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/externals_list_contents.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/externals_list_contents.tsx @@ -12,7 +12,7 @@ import { EuiFlexItem, } from '@elastic/eui'; import React, { Fragment } from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { NodeDataDefinition } from 'cytoscape'; import { ContentsProps } from '.'; import { @@ -22,7 +22,7 @@ import { } from '../../../../../common/es_fields/apm'; import { ExternalConnectionNode } from '../../../../../common/service_map'; -const ExternalResourcesList = euiStyled.section` +const ExternalResourcesList = styled.section` max-height: 360px; overflow: auto; `; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/index.tsx index a66f77909072d..827ea59015f26 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/index.tsx @@ -13,6 +13,7 @@ import { EuiTitle, EuiToolTip, EuiIcon, + useEuiTheme, } from '@elastic/eui'; import cytoscape from 'cytoscape'; import React, { @@ -27,7 +28,6 @@ import React, { import { i18n } from '@kbn/i18n'; import { SERVICE_NAME, SPAN_TYPE } from '../../../../../common/es_fields/apm'; import { Environment } from '../../../../../common/environment_rt'; -import { useTheme } from '../../../../hooks/use_theme'; import { useTraceExplorerEnabledSetting } from '../../../../hooks/use_trace_explorer_enabled_setting'; import { CytoscapeContext } from '../cytoscape'; import { getAnimationOptions, popoverWidth } from '../cytoscape_options'; @@ -83,7 +83,7 @@ interface PopoverProps { } export function Popover({ focusedServiceName, environment, kuery, start, end }: PopoverProps) { - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); const cy = useContext(CytoscapeContext); const [selectedElement, setSelectedElement] = useState< cytoscape.NodeSingular | cytoscape.EdgeSingular | undefined @@ -164,12 +164,12 @@ export function Popover({ focusedServiceName, environment, kuery, start, end }: event.preventDefault(); if (cy) { cy.animate({ - ...getAnimationOptions(theme), + ...getAnimationOptions(euiTheme), center: { eles: cy.getElementById(selectedElementId) }, }); } }, - [cy, selectedElementId, theme] + [cy, selectedElementId, euiTheme] ); const isAlreadyFocused = focusedServiceName === selectedElementId; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/popover.test.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/popover.test.tsx index 2bafca33d06f8..1e8f1f7b5d0ee 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/popover.test.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/popover.test.tsx @@ -6,16 +6,17 @@ */ import { composeStories } from '@storybook/testing-react'; -import { render, screen, waitFor } from '@testing-library/react'; +import { screen, waitFor } from '@testing-library/react'; import React from 'react'; import * as stories from './popover.stories'; +import { renderWithTheme } from '../../../../utils/test_helpers'; const { Dependency, ExternalsList, Resource, Service } = composeStories(stories); describe('Popover', () => { describe('with dependency data', () => { it('renders a dependency link', async () => { - render(<Dependency />); + renderWithTheme(<Dependency />); await waitFor(() => { expect(screen.getByRole('link', { name: /Dependency Details/i })).toBeInTheDocument(); @@ -25,7 +26,7 @@ describe('Popover', () => { describe('with externals list data', () => { it('renders an externals list', async () => { - render(<ExternalsList />); + renderWithTheme(<ExternalsList />); await waitFor(() => { expect(screen.getByText(/813-mam-392.mktoresp.com:443/)).toBeInTheDocument(); @@ -35,7 +36,7 @@ describe('Popover', () => { describe('with resource data', () => { it('renders with no buttons', async () => { - render(<Resource />); + renderWithTheme(<Resource />); await waitFor(() => { expect(screen.queryByRole('link')).not.toBeInTheDocument(); @@ -45,7 +46,7 @@ describe('Popover', () => { describe('with service data', () => { it('renders contents for a service', async () => { - render(<Service />); + renderWithTheme(<Service />); await waitFor(() => { expect(screen.getByRole('link', { name: /service details/i })).toBeInTheDocument(); diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/resource_contents.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/resource_contents.tsx index fb1414382ed57..272a5e97dfd1a 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/resource_contents.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/popover/resource_contents.tsx @@ -8,18 +8,18 @@ import { EuiDescriptionListDescription, EuiDescriptionListTitle } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { NodeDataDefinition } from 'cytoscape'; import type { ContentsProps } from '.'; import { SPAN_SUBTYPE, SPAN_TYPE } from '../../../../../common/es_fields/apm'; -const ItemRow = euiStyled.div` +const ItemRow = styled.div` line-height: 2; `; -const SubduedDescriptionListTitle = euiStyled(EuiDescriptionListTitle)` +const SubduedDescriptionListTitle = styled(EuiDescriptionListTitle)` &&& { - color: ${({ theme }) => theme.eui.euiTextSubduedColor}; + color: ${({ theme }) => theme.euiTheme.colors.textSubdued}; } `; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/use_cytoscape_event_handlers.test.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/use_cytoscape_event_handlers.test.tsx index 31604d8934019..c7df75312c79b 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/use_cytoscape_event_handlers.test.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/use_cytoscape_event_handlers.test.tsx @@ -8,24 +8,25 @@ import { renderHook } from '@testing-library/react'; import cytoscape from 'cytoscape'; import dagre from 'cytoscape-dagre'; -import { EuiTheme } from '@kbn/kibana-react-plugin/common'; import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { useCytoscapeEventHandlers } from './use_cytoscape_event_handlers'; import lodash from 'lodash'; +import type { EuiThemeComputed } from '@elastic/eui'; jest.mock('@kbn/observability-shared-plugin/public'); cytoscape.use(dagre); -const theme = { - eui: { avatarSizing: { l: { size: 10 } } }, -} as unknown as EuiTheme; +const euiTheme = { + size: { avatarSizing: { l: { size: 10 } } }, + animation: { normal: '1s' }, +} as unknown as EuiThemeComputed; describe('useCytoscapeEventHandlers', () => { describe('when cytoscape is undefined', () => { it('runs', () => { expect(() => { - renderHook(() => useCytoscapeEventHandlers({ cy: undefined, theme })); + renderHook(() => useCytoscapeEventHandlers({ cy: undefined, euiTheme })); }).not.toThrowError(); }); }); @@ -45,7 +46,7 @@ describe('useCytoscapeEventHandlers', () => { } as unknown as cytoscape.CollectionReturnValue), } as unknown as cytoscape.CollectionReturnValue); - renderHook(() => useCytoscapeEventHandlers({ serviceName: 'test', cy, theme })); + renderHook(() => useCytoscapeEventHandlers({ serviceName: 'test', cy, euiTheme })); cy.trigger('custom:data'); expect(cy.getElementById('test').hasClass('primary')).toEqual(true); @@ -66,7 +67,7 @@ describe('useCytoscapeEventHandlers', () => { } as unknown as cytoscape.CollectionReturnValue), } as unknown as cytoscape.CollectionReturnValue); - renderHook(() => useCytoscapeEventHandlers({ cy, theme })); + renderHook(() => useCytoscapeEventHandlers({ cy, euiTheme })); cy.trigger('custom:data'); expect(run).toHaveBeenCalled(); @@ -85,7 +86,7 @@ describe('useCytoscapeEventHandlers', () => { const edge = cy.getElementById('test'); const style = jest.spyOn(edge, 'style'); - renderHook(() => useCytoscapeEventHandlers({ cy, theme })); + renderHook(() => useCytoscapeEventHandlers({ cy, euiTheme })); cy.trigger('layoutstop'); expect(style).toHaveBeenCalledWith('control-point-distances', [-0, 0]); @@ -97,7 +98,7 @@ describe('useCytoscapeEventHandlers', () => { const cy = cytoscape({ elements: [{ data: { id: 'test' } }] }); const node = cy.getElementById('test'); - renderHook(() => useCytoscapeEventHandlers({ cy, theme })); + renderHook(() => useCytoscapeEventHandlers({ cy, euiTheme })); node.trigger('drag'); expect(node.data('hasBeenDragged')).toEqual(true); @@ -110,7 +111,7 @@ describe('useCytoscapeEventHandlers', () => { }); const node = cy.getElementById('test'); - renderHook(() => useCytoscapeEventHandlers({ cy, theme })); + renderHook(() => useCytoscapeEventHandlers({ cy, euiTheme })); node.trigger('drag'); expect(node.data('hasBeenDragged')).toEqual(true); @@ -126,7 +127,7 @@ describe('useCytoscapeEventHandlers', () => { } as unknown as HTMLElement; jest.spyOn(cy, 'container').mockReturnValueOnce(container); - renderHook(() => useCytoscapeEventHandlers({ cy, theme })); + renderHook(() => useCytoscapeEventHandlers({ cy, euiTheme })); cy.getElementById('test').trigger('dragfree'); expect(container.style.cursor).toEqual('pointer'); @@ -140,7 +141,7 @@ describe('useCytoscapeEventHandlers', () => { }); const node = cy.getElementById('test'); - renderHook(() => useCytoscapeEventHandlers({ cy, theme })); + renderHook(() => useCytoscapeEventHandlers({ cy, euiTheme })); node.trigger('mouseover'); expect(node.hasClass('hover')).toEqual(true); @@ -153,7 +154,7 @@ describe('useCytoscapeEventHandlers', () => { } as unknown as HTMLElement; jest.spyOn(cy, 'container').mockReturnValueOnce(container); - renderHook(() => useCytoscapeEventHandlers({ cy, theme })); + renderHook(() => useCytoscapeEventHandlers({ cy, euiTheme })); cy.getElementById('test').trigger('mouseover'); expect(container.style.cursor).toEqual('pointer'); @@ -168,7 +169,7 @@ describe('useCytoscapeEventHandlers', () => { return fn; }); - renderHook(() => useCytoscapeEventHandlers({ cy, theme })); + renderHook(() => useCytoscapeEventHandlers({ cy, euiTheme })); cy.getElementById('test').trigger('mouseover'); expect(trackApmEvent).toHaveBeenCalledWith({ @@ -184,7 +185,7 @@ describe('useCytoscapeEventHandlers', () => { }); const node = cy.getElementById('test'); - renderHook(() => useCytoscapeEventHandlers({ cy, theme })); + renderHook(() => useCytoscapeEventHandlers({ cy, euiTheme })); node.trigger('mouseout'); expect(node.hasClass('hover')).toEqual(false); @@ -197,7 +198,7 @@ describe('useCytoscapeEventHandlers', () => { } as unknown as HTMLElement; jest.spyOn(cy, 'container').mockReturnValueOnce(container); - renderHook(() => useCytoscapeEventHandlers({ cy, theme })); + renderHook(() => useCytoscapeEventHandlers({ cy, euiTheme })); cy.getElementById('test').trigger('mouseout'); expect(container.style.cursor).toEqual('grab'); @@ -218,7 +219,7 @@ describe('useCytoscapeEventHandlers', () => { } as unknown as HTMLElement; jest.spyOn(cy, 'container').mockReturnValueOnce(container); - renderHook(() => useCytoscapeEventHandlers({ cy, theme })); + renderHook(() => useCytoscapeEventHandlers({ cy, euiTheme })); cy.getElementById('test').trigger('mouseover'); expect(container.style.cursor).toEqual('default'); @@ -235,7 +236,7 @@ describe('useCytoscapeEventHandlers', () => { return fn; }); - renderHook(() => useCytoscapeEventHandlers({ cy, theme })); + renderHook(() => useCytoscapeEventHandlers({ cy, euiTheme })); cy.getElementById('test').trigger('select'); expect(trackApmEvent).toHaveBeenCalledWith({ @@ -258,7 +259,7 @@ describe('useCytoscapeEventHandlers', () => { useCytoscapeEventHandlers({ serviceName: 'test', cy, - theme, + euiTheme, }) ); cy.getElementById('test').trigger('unselect'); @@ -275,7 +276,7 @@ describe('useCytoscapeEventHandlers', () => { } as unknown as HTMLElement; jest.spyOn(cy, 'container').mockReturnValueOnce(container); - renderHook(() => useCytoscapeEventHandlers({ cy, theme })); + renderHook(() => useCytoscapeEventHandlers({ cy, euiTheme })); cy.trigger('tapstart'); expect(container.style.cursor).toEqual('grabbing'); @@ -289,7 +290,7 @@ describe('useCytoscapeEventHandlers', () => { } as unknown as HTMLElement; jest.spyOn(cy, 'container').mockReturnValueOnce(container); - renderHook(() => useCytoscapeEventHandlers({ cy, theme })); + renderHook(() => useCytoscapeEventHandlers({ cy, euiTheme })); cy.getElementById('test').trigger('tapstart'); expect(container.style.cursor).toEqual('grab'); @@ -305,7 +306,7 @@ describe('useCytoscapeEventHandlers', () => { } as unknown as HTMLElement; jest.spyOn(cy, 'container').mockReturnValueOnce(container); - renderHook(() => useCytoscapeEventHandlers({ cy, theme })); + renderHook(() => useCytoscapeEventHandlers({ cy, euiTheme })); cy.trigger('tapend'); expect(container.style.cursor).toEqual('grab'); @@ -319,7 +320,7 @@ describe('useCytoscapeEventHandlers', () => { } as unknown as HTMLElement; jest.spyOn(cy, 'container').mockReturnValueOnce(container); - renderHook(() => useCytoscapeEventHandlers({ cy, theme })); + renderHook(() => useCytoscapeEventHandlers({ cy, euiTheme })); cy.getElementById('test').trigger('tapend'); expect(container.style.cursor).toEqual('pointer'); @@ -334,7 +335,7 @@ describe('useCytoscapeEventHandlers', () => { jest.spyOn(Storage.prototype, 'getItem').mockReturnValueOnce('true'); const debug = jest.spyOn(window.console, 'debug').mockReturnValueOnce(undefined); - renderHook(() => useCytoscapeEventHandlers({ cy, theme })); + renderHook(() => useCytoscapeEventHandlers({ cy, euiTheme })); cy.getElementById('test').trigger('select'); expect(debug).toHaveBeenCalled(); diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/use_cytoscape_event_handlers.ts b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/use_cytoscape_event_handlers.ts index e40ee3e80eaaa..fdf607c340fe2 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_map/use_cytoscape_event_handlers.ts +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_map/use_cytoscape_event_handlers.ts @@ -8,8 +8,8 @@ import cytoscape from 'cytoscape'; import { debounce } from 'lodash'; import { useEffect } from 'react'; -import { EuiTheme } from '@kbn/kibana-react-plugin/common'; import { useUiTracker } from '@kbn/observability-shared-plugin/public'; +import type { EuiThemeComputed } from '@elastic/eui'; import { getAnimationOptions, getNodeHeight } from './cytoscape_options'; /* @@ -39,13 +39,13 @@ function applyCubicBezierStyles(edges: cytoscape.EdgeCollection) { function getLayoutOptions({ fit = false, nodeHeight, - theme, + euiTheme, }: { fit?: boolean; nodeHeight: number; - theme: EuiTheme; + euiTheme: EuiThemeComputed; }): cytoscape.LayoutOptions { - const animationOptions = getAnimationOptions(theme); + const animationOptions = getAnimationOptions(euiTheme); return { animationDuration: animationOptions.duration, @@ -82,16 +82,16 @@ function resetConnectedEdgeStyle(cytoscapeInstance: cytoscape.Core, node?: cytos export function useCytoscapeEventHandlers({ cy, serviceName, - theme, + euiTheme, }: { cy?: cytoscape.Core; serviceName?: string; - theme: EuiTheme; + euiTheme: EuiThemeComputed; }) { const trackApmEvent = useUiTracker({ app: 'apm' }); useEffect(() => { - const nodeHeight = getNodeHeight(theme); + const nodeHeight = getNodeHeight(euiTheme); const dataHandler: cytoscape.EventHandler = (event, fit) => { if (serviceName) { @@ -111,7 +111,7 @@ export function useCytoscapeEventHandlers({ event.cy .elements('[!hasBeenDragged]') .difference('node:selected') - .layout(getLayoutOptions({ fit, nodeHeight, theme })) + .layout(getLayoutOptions({ fit, nodeHeight, euiTheme })) .run(); }; @@ -216,5 +216,5 @@ export function useCytoscapeEventHandlers({ cy.removeListener('tapend', undefined, tapendHandler); } }; - }, [cy, serviceName, trackApmEvent, theme]); + }, [cy, serviceName, trackApmEvent, euiTheme]); } diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview.test.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview.test.tsx index 98cdc1e65c3a2..71974cfbe75bd 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview.test.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview.test.tsx @@ -6,10 +6,11 @@ */ import { composeStories } from '@storybook/testing-react'; -import { render, screen } from '@testing-library/react'; +import { screen } from '@testing-library/react'; import React from 'react'; import * as stories from './service_overview.stories'; import * as useAdHocApmDataView from '../../../hooks/use_adhoc_apm_data_view'; +import { renderWithTheme } from '../../../utils/test_helpers'; const { Example } = composeStories(stories); @@ -32,7 +33,7 @@ describe('ServiceOverview', () => { jest.clearAllMocks(); }); it('renders', async () => { - render(<Example />); + renderWithTheme(<Example />); expect(await screen.findByRole('heading', { name: 'Latency' })).toBeInTheDocument(); }); diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview_instances_table/intance_details.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview_instances_table/intance_details.tsx index f2682b2cce2d0..bd9ade55866e9 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview_instances_table/intance_details.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_overview/service_overview_instances_table/intance_details.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { EuiFlexGroup, EuiFlexItem, EuiSkeletonText } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiSkeletonText, useEuiTheme } from '@elastic/eui'; import { CloudProvider, getAgentIcon, getCloudProviderIcon } from '@kbn/custom-icons'; import { i18n } from '@kbn/i18n'; import { get } from 'lodash'; @@ -35,7 +35,6 @@ import { } from '../../../../../common/es_fields/infra_metrics'; import { isPending } from '../../../../hooks/use_fetcher'; -import { useTheme } from '../../../../hooks/use_theme'; import { APIReturnType } from '../../../../services/rest/create_call_apm_api'; import { KeyValueFilterList } from '../../../shared/key_value_filter_list'; import { pushNewItemToKueryBar } from '../../../shared/kuery_bar/utils'; @@ -89,7 +88,7 @@ const cloudDetailsKeys = [ ]; export function InstanceDetails({ serviceName, serviceNodeName, kuery }: Props) { - const theme = useTheme(); + const { colorMode } = useEuiTheme(); const history = useHistory(); const { data, status } = useInstanceDetailsFetcher({ @@ -132,6 +131,8 @@ export function InstanceDetails({ serviceName, serviceNodeName, kuery }: Props) }); const containerType = data.kubernetes?.pod?.name ? 'Kubernetes' : 'Docker'; + + const isDarkMode = colorMode === 'DARK'; return ( <EuiFlexGroup direction="column" responsive={false}> <EuiFlexItem> @@ -140,7 +141,7 @@ export function InstanceDetails({ serviceName, serviceNodeName, kuery }: Props) title={i18n.translate('xpack.apm.serviceOverview.instanceTable.details.serviceTitle', { defaultMessage: 'Service', })} - icon={getAgentIcon(data.agent?.name, theme.darkMode)} + icon={getAgentIcon(data.agent?.name, isDarkMode)} keyValueList={serviceDetailsKeyValuePairs} onClickFilter={addKueryBarFilter} /> diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/settings/agent_configurations/list/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/settings/agent_configurations/list/index.tsx index ae36d8b0434d7..ddd74716ceefb 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/settings/agent_configurations/list/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/settings/agent_configurations/list/index.tsx @@ -13,6 +13,7 @@ import { EuiHealth, EuiToolTip, RIGHT_ALIGNMENT, + useEuiTheme, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { isEmpty } from 'lodash'; @@ -22,7 +23,6 @@ import { APIReturnType } from '../../../../../services/rest/create_call_apm_api' import { getOptionLabel } from '../../../../../../common/agent_configuration/all_option'; import { useApmPluginContext } from '../../../../../context/apm_plugin/use_apm_plugin_context'; import { FETCH_STATUS } from '../../../../../hooks/use_fetcher'; -import { useTheme } from '../../../../../hooks/use_theme'; import { LoadingStatePrompt } from '../../../../shared/loading_state_prompt'; import { ITableColumn, ManagedTable } from '../../../../shared/managed_table'; import { TimestampTooltip } from '../../../../shared/timestamp_tooltip'; @@ -40,7 +40,7 @@ interface Props { export function AgentConfigurationList({ status, configurations, refetch }: Props) { const { core } = useApmPluginContext(); const canSave = core.application.capabilities.apm['settings:save']; - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); const [configToBeDeleted, setConfigToBeDeleted] = useState<Config | null>(null); const apmRouter = useApmRouter(); @@ -110,7 +110,7 @@ export function AgentConfigurationList({ status, configurations, refetch }: Prop { field: 'applied_by_agent', align: 'center', - width: theme.eui.euiSizeXL, + width: euiTheme.size.xl, name: '', sortable: true, render: (_, { applied_by_agent: appliedByAgent }) => ( @@ -125,7 +125,7 @@ export function AgentConfigurationList({ status, configurations, refetch }: Prop }) } > - <EuiHealth color={appliedByAgent ? 'success' : theme.eui.euiColorLightShade} /> + <EuiHealth color={appliedByAgent ? 'success' : euiTheme.colors.lightShade} /> </EuiToolTip> ), }, @@ -172,12 +172,14 @@ export function AgentConfigurationList({ status, configurations, refetch }: Prop ...(canSave ? [ { - width: theme.eui.euiSizeXL, + width: euiTheme.size.xl, name: '', render: (config: Config) => ( <EuiButtonIcon data-test-subj="apmColumnsButton" - aria-label="Edit" + aria-label={i18n.translate('xpack.apm.columns.euiButtonIcon.editLabel', { + defaultMessage: 'Edit', + })} iconType="pencil" href={apmRouter.link('/settings/agent-configuration/edit', { query: { @@ -189,12 +191,14 @@ export function AgentConfigurationList({ status, configurations, refetch }: Prop ), }, { - width: theme.eui.euiSizeXL, + width: euiTheme.size.xl, name: '', render: (config: Config) => ( <EuiButtonIcon data-test-subj="apmColumnsButton" - aria-label="Delete" + aria-label={i18n.translate('xpack.apm.columns.euiButtonIcon.deleteLabel', { + defaultMessage: 'Delete', + })} iconType="trash" onClick={() => setConfigToBeDeleted(config)} /> diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/settings/custom_link/create_edit_custom_link_flyout/delete_button.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/settings/custom_link/create_edit_custom_link_flyout/delete_button.tsx index 02ef3b97222b0..564381f78a4a3 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/settings/custom_link/create_edit_custom_link_flyout/delete_button.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/settings/custom_link/create_edit_custom_link_flyout/delete_button.tsx @@ -5,13 +5,12 @@ * 2.0. */ -import { EuiButtonEmpty } from '@elastic/eui'; +import { EuiButtonEmpty, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { NotificationsStart } from '@kbn/core/public'; import React, { useState } from 'react'; import { callApmApi } from '../../../../../services/rest/create_call_apm_api'; import { useApmPluginContext } from '../../../../../context/apm_plugin/use_apm_plugin_context'; -import { useTheme } from '../../../../../hooks/use_theme'; interface Props { onDelete: () => void; @@ -21,7 +20,7 @@ interface Props { export function DeleteButton({ onDelete, customLinkId }: Props) { const [isDeleting, setIsDeleting] = useState(false); const { toasts } = useApmPluginContext().core.notifications; - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); return ( <EuiButtonEmpty @@ -35,7 +34,7 @@ export function DeleteButton({ onDelete, customLinkId }: Props) { setIsDeleting(false); onDelete(); }} - style={{ marginRight: theme.eui.euiSize }} + style={{ marginRight: euiTheme.size.base }} > {i18n.translate('xpack.apm.settings.customLink.delete', { defaultMessage: 'Delete', diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/storage_explorer/summary_stats.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/storage_explorer/summary_stats.tsx index bd76025d96062..30053480eb4e6 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/storage_explorer/summary_stats.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/storage_explorer/summary_stats.tsx @@ -204,7 +204,7 @@ function SummaryMetric({ css={css` ${xlFontSize} font-weight: ${euiTheme.font.weight.bold}; - color: ${euiTheme.colors.text}; + color: ${euiTheme.colors.textParagraph}; `} > {value} diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/top_traces_overview/trace_list.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/top_traces_overview/trace_list.tsx index 9b3d54d4efad5..74461fcb7920f 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/top_traces_overview/trace_list.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/top_traces_overview/trace_list.tsx @@ -5,12 +5,12 @@ * 2.0. */ -import { EuiIcon, EuiToolTip, RIGHT_ALIGNMENT } from '@elastic/eui'; +import { EuiIcon, EuiToolTip, RIGHT_ALIGNMENT, useEuiFontSize } from '@elastic/eui'; import { usePerformanceContext } from '@kbn/ebt-tools'; import { TypeOf } from '@kbn/typed-react-router-config'; import { i18n } from '@kbn/i18n'; import React, { useEffect, useMemo } from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { ApmRoutes } from '../../routing/apm_route_config'; import { asMillisecondDuration, asTransactionRate } from '../../../../common/utils/formatters'; import { useApmParams } from '../../../hooks/use_apm_params'; @@ -25,8 +25,8 @@ import { ServiceLink } from '../../shared/links/apm/service_link'; import { TruncateWithTooltip } from '../../shared/truncate_with_tooltip'; import { NOT_AVAILABLE_LABEL } from '../../../../common/i18n'; -const StyledTransactionLink = euiStyled(TransactionDetailLink)` - font-size: ${({ theme }) => theme.eui.euiFontSizeS}; +const StyledTransactionLink = styled(TransactionDetailLink)` + font-size: ${() => useEuiFontSize('s').fontSize}; ${truncate('100%')}; `; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/trace_link/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/trace_link/index.tsx index 74b3975335c90..b1d1b0f8d745b 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/trace_link/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/trace_link/index.tsx @@ -9,7 +9,7 @@ import { EuiEmptyPrompt } from '@elastic/eui'; import React from 'react'; import { i18n } from '@kbn/i18n'; import { Redirect } from 'react-router-dom'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { FETCH_STATUS, useFetcher } from '../../../hooks/use_fetcher'; import { getRedirectToTransactionDetailPageUrl } from './get_redirect_to_transaction_detail_page_url'; @@ -18,7 +18,7 @@ import { useApmParams } from '../../../hooks/use_apm_params'; import { useTimeRange } from '../../../hooks/use_time_range'; import { ApmPluginStartDeps } from '../../../plugin'; -const CentralizedContainer = euiStyled.div` +const CentralizedContainer = styled.div` height: 100%; display: flex; `; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/distribution/use_transaction_distribution_chart_data.ts b/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/distribution/use_transaction_distribution_chart_data.ts index 66f346f36a5fe..25acce3e56798 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/distribution/use_transaction_distribution_chart_data.ts +++ b/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/distribution/use_transaction_distribution_chart_data.ts @@ -7,6 +7,7 @@ import { useEffect } from 'react'; import { i18n } from '@kbn/i18n'; +import { useEuiTheme } from '@elastic/eui'; import { DEFAULT_PERCENTILE_THRESHOLD } from '../../../../../common/correlations/constants'; import { EVENT_OUTCOME } from '../../../../../common/es_fields/apm'; import { EventOutcome } from '../../../../../common/event_outcome'; @@ -16,11 +17,10 @@ import { useFetcher, FETCH_STATUS } from '../../../../hooks/use_fetcher'; import { isErrorMessage } from '../../correlations/utils/is_error_message'; import { useFetchParams } from '../../correlations/use_fetch_params'; import { getTransactionDistributionChartData } from '../../correlations/get_transaction_distribution_chart_data'; -import { useTheme } from '../../../../hooks/use_theme'; export const useTransactionDistributionChartData = () => { const params = useFetchParams(); - const euiTheme = useTheme(); + const { euiTheme } = useEuiTheme(); const { core: { notifications }, diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/accordion_waterfall.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/accordion_waterfall.tsx index a6520f964c7b8..41d11ba74e2e1 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/accordion_waterfall.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/accordion_waterfall.tsx @@ -7,20 +7,19 @@ import { EuiAccordion, - EuiAccordionProps, EuiFlexGroup, EuiFlexItem, EuiIcon, EuiText, EuiToolTip, + useEuiTheme, } from '@elastic/eui'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { transparentize } from 'polished'; import React, { useEffect, useRef } from 'react'; import { WindowScroller, AutoSizer } from 'react-virtualized'; import { areEqual, ListChildComponentProps, VariableSizeList as List } from 'react-window'; +import { css } from '@emotion/react'; import { asBigNumber } from '../../../../../../../common/utils/formatters'; -import { useTheme } from '../../../../../../hooks/use_theme'; import { Margins } from '../../../../../shared/charts/timeline'; import { IWaterfallNodeFlatten, @@ -53,38 +52,6 @@ interface WaterfallNodeProps extends WaterfallProps { const ACCORDION_HEIGHT = 48; -const StyledAccordion = euiStyled(EuiAccordion).withConfig({ - shouldForwardProp: (prop) => !['marginLeftLevel', 'hasError'].includes(prop), -})< - EuiAccordionProps & { - marginLeftLevel: number; - hasError: boolean; - } ->` - - border-top: 1px solid ${({ theme }) => theme.eui.euiColorLightShade}; - - ${(props) => { - const borderLeft = props.hasError - ? `2px solid ${props.theme.eui.euiColorDanger};` - : `1px solid ${props.theme.eui.euiColorLightShade};`; - return `.button_${props.id} { - width: 100%; - height: ${ACCORDION_HEIGHT}px; - margin-left: ${props.marginLeftLevel}px; - border-left: ${borderLeft} - &:hover { - background-color: ${props.theme.eui.euiColorLightestShade}; - } - }`; - }} - - .accordion__buttonContent { - width: 100%; - height: 100%; - } -`; - export function AccordionWaterfall({ maxLevelOpen, showCriticalPath, @@ -176,7 +143,7 @@ const VirtualRow = React.memo( ); const WaterfallNode = React.memo((props: WaterfallNodeProps) => { - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); const { duration, waterfallItemId, onClickWaterfallItem, timelineMargins, node } = props; const { criticalPathSegmentsById, getErrorCount, updateTreeNode, showCriticalPath } = useWaterfallContext(); @@ -190,7 +157,7 @@ const WaterfallNode = React.memo((props: WaterfallNodeProps) => { ?.filter((segment) => segment.self) .map((segment) => ({ id: segment.item.id, - color: theme.eui.euiColorAccent, + color: euiTheme.colors.accent, left: (segment.offset - node.item.offset - node.item.skew) / node.item.duration, width: segment.duration / node.item.duration, })); @@ -203,14 +170,14 @@ const WaterfallNode = React.memo((props: WaterfallNodeProps) => { onClickWaterfallItem(node.item, flyoutDetailTab); }; + const hasError = node.item.doc.event?.outcome === 'failure'; + return ( - <StyledAccordion + <EuiAccordion data-test-subj="waterfallItem" style={{ position: 'relative' }} buttonClassName={`button_${node.item.id}`} id={node.item.id} - hasError={node.item.doc.event?.outcome === 'failure'} - marginLeftLevel={marginLeftLevel} buttonContentClassName="accordion__buttonContent" buttonContent={ <EuiFlexGroup gutterSize="none" responsive={false}> @@ -243,6 +210,24 @@ const WaterfallNode = React.memo((props: WaterfallNodeProps) => { initialIsOpen forceState={node.expanded ? 'open' : 'closed'} onToggle={toggleAccordion} + css={css` + border-top: ${euiTheme.border.thin}; + .button_${node.item.id} { + width: 100%; + height: ${ACCORDION_HEIGHT}px; + margin-left: ${marginLeftLevel}px; + border-left: ${hasError + ? `${euiTheme.border.width.thick} solid ${euiTheme.colors.danger};` + : `${euiTheme.border.thin};`}; + &:hover { + background-color: ${euiTheme.colors.lightestShade}; + } + } + .accordion__buttonContent { + width: 100%; + height: 100%; + } + `} /> ); }); diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/failure_badge.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/failure_badge.tsx index 29dd5ffde6547..91f60fd9df842 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/failure_badge.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/failure_badge.tsx @@ -6,18 +6,17 @@ */ import React from 'react'; -import { EuiBadge, EuiToolTip } from '@elastic/eui'; +import { EuiBadge, EuiToolTip, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { EventOutcome } from '../../../../../../../typings/es_schemas/raw/fields/event_outcome'; -import { useTheme } from '../../../../../../hooks/use_theme'; -const ResetLineHeight = euiStyled.span` +const ResetLineHeight = styled.span` line-height: initial; `; export function FailureBadge({ outcome }: { outcome?: EventOutcome }) { - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); if (outcome !== 'failure') { return null; @@ -30,7 +29,11 @@ export function FailureBadge({ outcome }: { outcome?: EventOutcome }) { defaultMessage: 'event.outcome = failure', })} > - <EuiBadge color={theme.eui.euiColorDanger}>failure</EuiBadge> + <EuiBadge color={euiTheme.colors.danger}> + {i18n.translate('xpack.apm.failure_badge.label', { + defaultMessage: 'failure', + })} + </EuiBadge> </EuiToolTip> </ResetLineHeight> ); diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/index.tsx index dbdc877742e1c..56a5367a4cfa6 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/index.tsx @@ -5,14 +5,13 @@ * 2.0. */ -import { EuiButtonEmpty, EuiCallOut } from '@elastic/eui'; +import { EuiButtonEmpty, EuiCallOut, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { History } from 'history'; import React, { useMemo, useState } from 'react'; import { useHistory } from 'react-router-dom'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { css } from '@emotion/react'; -import { useTheme } from '../../../../../../hooks/use_theme'; import { VerticalLinesContainer, TimelineAxisContainer, @@ -24,7 +23,7 @@ import { AccordionWaterfall } from './accordion_waterfall'; import { WaterfallFlyout } from './waterfall_flyout'; import { IWaterfall, IWaterfallItem } from './waterfall_helpers/waterfall_helpers'; -const Container = euiStyled.div` +const Container = styled.div` transition: 0.1s padding ease; position: relative; `; @@ -48,8 +47,8 @@ const toggleFlyout = ({ }); }; -const WaterfallItemsContainer = euiStyled.div` - border-bottom: 1px solid ${({ theme }) => theme.eui.euiColorMediumShade}; +const WaterfallItemsContainer = styled.div` + border-bottom: 1px solid ${({ theme }) => theme.euiTheme.colors.mediumShade}; `; interface Props { @@ -90,7 +89,7 @@ const MAX_DEPTH_OPEN_LIMIT = 2; export function Waterfall({ waterfall, waterfallItemId, showCriticalPath }: Props) { const history = useHistory(); - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); const [isAccordionOpen, setIsAccordionOpen] = useState(true); const { duration } = waterfall; @@ -134,16 +133,16 @@ export function Waterfall({ waterfall, waterfallItemId, showCriticalPath }: Prop display: flex; position: sticky; top: var(--euiFixedHeadersOffset, 0); - z-index: ${theme.eui.euiZLevel2}; - background-color: ${theme.eui.euiColorEmptyShade}; - border-bottom: 1px solid ${theme.eui.euiColorMediumShade}; + z-index: ${euiTheme.levels.content}; + background-color: ${euiTheme.colors.emptyShade}; + border-bottom: 1px solid ${euiTheme.colors.mediumShade}; `} > <EuiButtonEmpty data-test-subj="apmWaterfallButton" css={css` position: absolute; - z-index: ${theme.eui.euiZLevel2}; + z-index: ${euiTheme.levels.content}; `} iconType={isAccordionOpen ? 'fold' : 'unfold'} onClick={() => { diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/responsive_flyout.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/responsive_flyout.tsx index 16a80ce09efd0..3c3440b7833cf 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/responsive_flyout.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/responsive_flyout.tsx @@ -5,10 +5,21 @@ * 2.0. */ -import { EuiFlyout } from '@elastic/eui'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import React from 'react'; +import { EuiFlyout, EuiFlyoutProps } from '@elastic/eui'; +import styled, { type StyledComponent } from '@emotion/styled'; -export const ResponsiveFlyout = euiStyled(EuiFlyout)` +// The return type of this component needs to be specified because the inferred +// return type depends on types that are not exported from EUI. You get a TS4023 +// error if the return type is not specified. +export const ResponsiveFlyout: StyledComponent<EuiFlyoutProps> = styled( + ({ + className, + ...flyoutProps + }: { + className?: string; + } & EuiFlyoutProps) => <EuiFlyout {...flyoutProps} className={className} /> +)` width: 100%; @media (min-width: 800px) { diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/index.tsx index e4c9f0cf2816e..f412df0b099bb 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/index.tsx @@ -21,7 +21,7 @@ import { EuiToolTip, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { ProcessorEvent } from '@kbn/observability-plugin/common'; import { isEmpty } from 'lodash'; import React, { Fragment } from 'react'; @@ -80,10 +80,10 @@ function getSpanTypes(span: Span) { }; } -const ContainerWithMarginRight = euiStyled.div` +const ContainerWithMarginRight = styled.div` /* add margin to all direct descendants */ & > * { - margin-right: ${({ theme }) => theme.eui.euiSizeXS}; + margin-right: ${({ theme }) => theme.euiTheme.size.xs}; } `; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/truncate_height_section.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/truncate_height_section.tsx index 6416b6f24cf67..214cc8841b2c2 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/truncate_height_section.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/span_flyout/truncate_height_section.tsx @@ -8,10 +8,10 @@ import { EuiIcon, EuiLink } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { Fragment, ReactNode, useEffect, useRef, useState } from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; -const ToggleButtonContainer = euiStyled.div` - margin-top: ${({ theme }) => theme.eui.euiSizeS} +const ToggleButtonContainer = styled.div` + margin-top: ${({ theme }) => theme.euiTheme.size.s} user-select: none; `; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_item.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_item.tsx index 11d0f9bba9298..296c98705294c 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_item.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall/waterfall_item.tsx @@ -5,11 +5,10 @@ * 2.0. */ -import { EuiBadge, EuiIcon, EuiText, EuiTitle, EuiToolTip } from '@elastic/eui'; +import { EuiBadge, EuiIcon, EuiText, EuiTitle, EuiToolTip, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { ReactNode, useRef, useEffect, useState } from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; -import { useTheme } from '../../../../../../hooks/use_theme'; +import styled from '@emotion/styled'; import { isMobileAgentName, isRumAgentName } from '../../../../../../../common/agent_name'; import { TRACE_ID, TRANSACTION_ID } from '../../../../../../../common/es_fields/apm'; import { asDuration } from '../../../../../../../common/utils/formatters'; @@ -37,68 +36,68 @@ interface IBarStyleProps { color: string; } -const Container = euiStyled.div<IContainerStyleProps>` +const Container = styled.div<IContainerStyleProps>` position: relative; display: block; user-select: none; - padding-top: ${({ theme }) => theme.eui.euiSizeS}; - padding-bottom: ${({ theme }) => theme.eui.euiSizeM}; + padding-top: ${({ theme }) => theme.euiTheme.size.s}; + padding-bottom: ${({ theme }) => theme.euiTheme.size.m}; margin-right: ${(props) => props.timelineMargins.right}px; margin-left: ${(props) => props.hasToggle ? props.timelineMargins.left - 30 // fix margin if there is a toggle - : props.timelineMargins.left}px ; + : props.timelineMargins.left}px; background-color: ${({ isSelected, theme }) => - isSelected ? theme.eui.euiColorLightestShade : 'initial'}; + isSelected ? theme.euiTheme.colors.lightestShade : 'initial'}; cursor: pointer; &:hover { - background-color: ${({ theme }) => theme.eui.euiColorLightestShade}; + background-color: ${({ theme }) => theme.euiTheme.colors.lightestShade}; } `; -const ItemBar = euiStyled.div<IBarStyleProps>` +const ItemBar = styled.div<IBarStyleProps>` box-sizing: border-box; position: relative; - height: ${({ theme }) => theme.eui.euiSize}; + height: ${({ theme }) => theme.euiTheme.size.base}; min-width: 2px; background-color: ${(props) => props.color}; `; -const ItemText = euiStyled.span` +const ItemText = styled.span` position: absolute; right: 0; display: flex; align-items: center; - height: ${({ theme }) => theme.eui.euiSizeL}; + height: ${({ theme }) => theme.euiTheme.size.l}; max-width: 100%; /* add margin to all direct descendants */ & > * { - margin-right: ${({ theme }) => theme.eui.euiSizeS}; + margin-right: ${({ theme }) => theme.euiTheme.size.s}; white-space: nowrap; } `; -const CriticalPathItemBar = euiStyled.div` +const CriticalPathItemBar = styled.div` box-sizing: border-box; position: relative; - height: ${({ theme }) => theme.eui.euiSizeS}; - top : ${({ theme }) => theme.eui.euiSizeS}; + height: ${({ theme }) => theme.euiTheme.size.s}; + top: ${({ theme }) => theme.euiTheme.size.s}; min-width: 2px; background-color: transparent; display: flex; flex-direction: row; `; -const CriticalPathItemSegment = euiStyled.div<{ +const CriticalPathItemSegment = styled.div<{ left: number; width: number; color: string; }>` box-sizing: border-box; position: absolute; - height: ${({ theme }) => theme.eui.euiSizeS}; + height: ${({ theme }) => theme.euiTheme.size.s}; left: ${(props) => props.left * 100}%; width: ${(props) => props.width * 100}%; min-width: 2px; @@ -311,7 +310,7 @@ function RelatedErrors({ errorCount: number; }) { const apmRouter = useApmRouter(); - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); const { query } = useAnyOfApmParams( '/services/{serviceName}/transactions/view', '/mobile-services/{serviceName}/transactions/view', @@ -348,7 +347,7 @@ function RelatedErrors({ <div onClick={(e: React.MouseEvent) => e.stopPropagation()}> <EuiBadge href={isMobileAgentName(item.doc.agent.name) ? mobileHref : href} - color={theme.eui.euiColorDanger} + color={euiTheme.colors.danger} iconType="arrowRight" > {i18n.translate('xpack.apm.waterfall.errorCount', { diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall_container.test.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall_container.test.tsx index 4a46d708bb823..e14f185e2f6f9 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall_container.test.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/transaction_details/waterfall_with_summary/waterfall_container/waterfall_container.test.tsx @@ -6,9 +6,9 @@ */ import { composeStories } from '@storybook/testing-react'; -import { render, waitFor } from '@testing-library/react'; +import { waitFor } from '@testing-library/react'; import React from 'react'; -import { disableConsoleWarning } from '../../../../../utils/test_helpers'; +import { disableConsoleWarning, renderWithTheme } from '../../../../../utils/test_helpers'; import * as stories from './waterfall_container.stories'; const { Example } = composeStories(stories); @@ -25,7 +25,7 @@ describe('WaterfallContainer', () => { }); it('expands and contracts the accordion', async () => { - const { getAllByRole } = render(<Example />); + const { getAllByRole } = renderWithTheme(<Example />); const buttons = await waitFor(() => getAllByRole('button')); const parentItem = buttons[1]; const childItem = buttons[2]; diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/transaction_link/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/transaction_link/index.tsx index 74ad3ffbe3d15..d05085f0b8231 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/transaction_link/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/transaction_link/index.tsx @@ -7,14 +7,15 @@ import { EuiEmptyPrompt } from '@elastic/eui'; import React from 'react'; +import { i18n } from '@kbn/i18n'; import { Redirect } from 'react-router-dom'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { FETCH_STATUS, useFetcher } from '../../../hooks/use_fetcher'; import { getRedirectToTransactionDetailPageUrl } from '../trace_link/get_redirect_to_transaction_detail_page_url'; import { useApmParams } from '../../../hooks/use_apm_params'; import { useTimeRange } from '../../../hooks/use_time_range'; -const CentralizedContainer = euiStyled.div` +const CentralizedContainer = styled.div` height: 100%; display: flex; `; @@ -67,7 +68,16 @@ export function TransactionLink() { return ( <CentralizedContainer> - <EuiEmptyPrompt iconType="apmTrace" title={<h2>Fetching transaction...</h2>} /> + <EuiEmptyPrompt + iconType="apmTrace" + title={ + <h2> + {i18n.translate('xpack.apm.transactionLink.h2.fetchingTransactionLabel', { + defaultMessage: 'Fetching transaction...', + })} + </h2> + } + /> </CentralizedContainer> ); } diff --git a/x-pack/plugins/observability_solution/apm/public/components/fleet_integration/apm_agents/agent_instructions_accordion.tsx b/x-pack/plugins/observability_solution/apm/public/components/fleet_integration/apm_agents/agent_instructions_accordion.tsx index bd87c7b616312..4889f33b3f0db 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/fleet_integration/apm_agents/agent_instructions_accordion.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/fleet_integration/apm_agents/agent_instructions_accordion.tsx @@ -16,7 +16,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { ComponentType } from 'react'; -import styled from 'styled-components'; +import styled from '@emotion/styled'; import { useKibana } from '@kbn/kibana-react-plugin/public'; import { Markdown } from '@kbn/shared-ux-markdown'; import { AgentIcon } from '@kbn/custom-icons'; diff --git a/x-pack/plugins/observability_solution/apm/public/components/fleet_integration/apm_policy_form/settings_form/form_row_setting.tsx b/x-pack/plugins/observability_solution/apm/public/components/fleet_integration/apm_policy_form/settings_form/form_row_setting.tsx index 00e6c0265fdf6..20d018e273628 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/fleet_integration/apm_policy_form/settings_form/form_row_setting.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/fleet_integration/apm_policy_form/settings_form/form_row_setting.tsx @@ -15,7 +15,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import styled from 'styled-components'; +import styled from '@emotion/styled'; import { CodeEditor } from '@kbn/code-editor'; import { FormRowOnChange } from '.'; import { SettingsRow } from '../typings'; diff --git a/x-pack/plugins/observability_solution/apm/public/components/routing/app_root/apm_header_action_menu/anomaly_detection_setup_link.tsx b/x-pack/plugins/observability_solution/apm/public/components/routing/app_root/apm_header_action_menu/anomaly_detection_setup_link.tsx index 8d7091e17a4ac..2441dd7893cd9 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/routing/app_root/apm_header_action_menu/anomaly_detection_setup_link.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/routing/app_root/apm_header_action_menu/anomaly_detection_setup_link.tsx @@ -7,7 +7,7 @@ import { EuiLoadingSpinner } from '@elastic/eui'; import { IconType } from '@elastic/eui'; -import { EuiHeaderLink, EuiIcon, EuiToolTip } from '@elastic/eui'; +import { EuiHeaderLink, EuiIcon, EuiToolTip, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; import { AnomalyDetectionSetupState } from '../../../../../common/anomaly_detection/get_anomaly_detection_setup_state'; @@ -18,7 +18,6 @@ import { import { useAnomalyDetectionJobsContext } from '../../../../context/anomaly_detection_jobs/use_anomaly_detection_jobs_context'; import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context'; import { useApmParams } from '../../../../hooks/use_apm_params'; -import { useTheme } from '../../../../hooks/use_theme'; import { getLegacyApmHref } from '../../../shared/links/apm/apm_link'; export function AnomalyDetectionSetupLink() { @@ -29,12 +28,12 @@ export function AnomalyDetectionSetupLink() { const { core } = useApmPluginContext(); const { basePath } = core.http; - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); const { anomalyDetectionSetupState } = useAnomalyDetectionJobsContext(); let tooltipText: string = ''; - let color: 'warning' | 'text' | 'success' | 'danger' = 'text'; + let color: 'warning' | 'text' | 'accentSecondary' | 'danger' = 'text'; let icon: IconType | undefined; if (anomalyDetectionSetupState === AnomalyDetectionSetupState.Failure) { @@ -51,7 +50,7 @@ export function AnomalyDetectionSetupLink() { tooltipText = getNoJobsMessage(anomalyDetectionSetupState, environment); icon = 'machineLearningApp'; } else if (anomalyDetectionSetupState === AnomalyDetectionSetupState.UpgradeableJobs) { - color = 'success'; + color = 'accentSecondary'; tooltipText = i18n.translate('xpack.apm.anomalyDetectionSetup.upgradeableJobsText', { defaultMessage: 'Updates available for existing anomaly detection jobs.', }); @@ -74,7 +73,7 @@ export function AnomalyDetectionSetupLink() { data-test-subj="apmAnomalyDetectionHeaderLink" > {pre} - <span style={{ marginInlineStart: theme.eui.euiSizeS }}>{ANOMALY_DETECTION_LINK_LABEL}</span> + <span style={{ marginInlineStart: euiTheme.size.s }}>{ANOMALY_DETECTION_LINK_LABEL}</span> </EuiHeaderLink> ); diff --git a/x-pack/plugins/observability_solution/apm/public/components/routing/app_root/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/routing/app_root/index.tsx index 69ea154538d6b..2b709e2077470 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/routing/app_root/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/routing/app_root/index.tsx @@ -7,7 +7,7 @@ import { PerformanceContextProvider } from '@kbn/ebt-tools'; import { APP_WRAPPER_CLASS } from '@kbn/core/public'; -import { KibanaContextProvider, useDarkMode } from '@kbn/kibana-react-plugin/public'; +import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app'; import { Storage } from '@kbn/kibana-utils-plugin/public'; import { @@ -16,9 +16,7 @@ import { } from '@kbn/observability-shared-plugin/public'; import { Route } from '@kbn/shared-ux-router'; import { RouteRenderer, RouterProvider } from '@kbn/typed-react-router-config'; -import { euiDarkVars, euiLightVars } from '@kbn/ui-theme'; import React from 'react'; -import { DefaultTheme, ThemeProvider } from 'styled-components'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { KibanaEnvironmentContextProvider } from '../../../context/kibana_environment_context/kibana_environment_context'; import { AnomalyDetectionJobsContextProvider } from '../../../context/anomaly_detection_jobs/anomaly_detection_jobs_context'; @@ -84,11 +82,9 @@ export function ApmAppRoot({ <LicenseProvider> <AnomalyDetectionJobsContextProvider> <InspectorContextProvider> - <ApmThemeProvider> - <MountApmHeaderActionMenu /> - <Route component={ScrollToTopOnPathChange} /> - <RouteRenderer /> - </ApmThemeProvider> + <MountApmHeaderActionMenu /> + <Route component={ScrollToTopOnPathChange} /> + <RouteRenderer /> </InspectorContextProvider> </AnomalyDetectionJobsContextProvider> </LicenseProvider> @@ -128,19 +124,3 @@ function MountApmHeaderActionMenu() { </HeaderMenuPortal> ); } - -export function ApmThemeProvider({ children }: { children: React.ReactNode }) { - const darkMode = useDarkMode(false); - - return ( - <ThemeProvider - theme={(outerTheme?: DefaultTheme) => ({ - ...outerTheme, - eui: darkMode ? euiDarkVars : euiLightVars, - darkMode, - })} - > - {children} - </ThemeProvider> - ); -} diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/breakdown_chart/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/breakdown_chart/index.tsx index 8103f729f375a..e0ad710a14d9e 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/breakdown_chart/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/breakdown_chart/index.tsx @@ -21,7 +21,7 @@ import { Tooltip, LegendValue, } from '@elastic/charts'; -import { EuiIcon } from '@elastic/eui'; +import { EuiIcon, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import moment from 'moment'; import React from 'react'; @@ -36,7 +36,6 @@ import { import { Coordinate, TimeSeries } from '../../../../../typings/timeseries'; import { useChartPointerEventContext } from '../../../../context/chart_pointer_event/use_chart_pointer_event_context'; import { FETCH_STATUS } from '../../../../hooks/use_fetcher'; -import { useTheme } from '../../../../hooks/use_theme'; import { unit } from '../../../../utils/style'; import { ChartContainer } from '../chart_container'; import { isTimeseriesEmpty, onBrushEnd } from '../helper/helper'; @@ -74,7 +73,7 @@ export function BreakdownChart({ const { query: { rangeFrom, rangeTo }, } = useAnyOfApmParams('/services/{serviceName}', '/mobile-services/{serviceName}'); - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); const { start, end } = useTimeRange({ rangeFrom, rangeTo }); const min = moment.utc(start).valueOf(); @@ -82,7 +81,7 @@ export function BreakdownChart({ const xFormatter = niceTimeFormatter([min, max]); - const annotationColor = theme.eui.euiColorSuccess; + const annotationColor = euiTheme.colors.accentSecondary; const isEmpty = isTimeseriesEmpty(timeseries); diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/duration_distribution_chart/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/duration_distribution_chart/index.tsx index 1a88bf8b48c0b..65f22d78adf99 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/duration_distribution_chart/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/duration_distribution_chart/index.tsx @@ -25,7 +25,7 @@ import { TickFormatter, } from '@elastic/charts'; -import { euiPaletteColorBlind } from '@elastic/eui'; +import { euiPaletteColorBlind, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -37,7 +37,6 @@ import type { HistogramItem } from '../../../../../common/correlations/types'; import { DEFAULT_PERCENTILE_THRESHOLD } from '../../../../../common/correlations/constants'; import { FETCH_STATUS } from '../../../../hooks/use_fetcher'; -import { useTheme } from '../../../../hooks/use_theme'; import { ChartContainer } from '../chart_container'; @@ -109,7 +108,7 @@ export function DurationDistributionChart({ eventType, }: DurationDistributionChartProps) { const chartThemes = useChartThemes(); - const euiTheme = useTheme(); + const { euiTheme } = useEuiTheme(); const markerPercentile = DEFAULT_PERCENTILE_THRESHOLD; const annotationsDataValues: LineAnnotationDatum[] = [ @@ -188,7 +187,7 @@ export function DurationDistributionChart({ }, tickLabel: { fontSize: 10, - fill: euiTheme.eui.euiColorMediumShade, + fill: euiTheme.colors.mediumShade, padding: 0, }, }, @@ -207,8 +206,8 @@ export function DurationDistributionChart({ id="rect_annotation_1" style={{ strokeWidth: 1, - stroke: euiTheme.eui.euiColorLightShade, - fill: euiTheme.eui.euiColorLightShade, + stroke: euiTheme.colors.lightShade, + fill: euiTheme.colors.lightShade, opacity: 0.9, }} hideTooltips={true} diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/helper/get_chart_anomaly_timeseries.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/helper/get_chart_anomaly_timeseries.tsx index 56b61cb02d8b9..74179489aceb2 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/helper/get_chart_anomaly_timeseries.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/helper/get_chart_anomaly_timeseries.tsx @@ -7,11 +7,11 @@ import { i18n } from '@kbn/i18n'; import { rgba } from 'polished'; -import { EuiTheme } from '@kbn/kibana-react-plugin/common'; import { getSeverity } from '@kbn/ml-anomaly-utils/get_severity'; import { ML_ANOMALY_SEVERITY } from '@kbn/ml-anomaly-utils/anomaly_severity'; import { ML_ANOMALY_THRESHOLD } from '@kbn/ml-anomaly-utils/anomaly_threshold'; import type { AreaSeriesStyle, RecursivePartial } from '@elastic/charts'; +import type { EuiThemeComputed } from '@elastic/eui'; import { getSeverityColor } from '../../../../../common/anomaly_detection'; import { ServiceAnomalyTimeseries } from '../../../../../common/anomaly_detection/service_anomaly_timeseries'; import { APMChartSpec } from '../../../../../typings/timeseries'; @@ -21,11 +21,11 @@ export const expectedBoundsTitle = i18n.translate('xpack.apm.comparison.expected }); export function getChartAnomalyTimeseries({ anomalyTimeseries, - theme, + euiTheme, anomalyTimeseriesColor, }: { anomalyTimeseries?: ServiceAnomalyTimeseries; - theme: EuiTheme; + euiTheme: EuiThemeComputed; anomalyTimeseriesColor?: string; }): | { @@ -48,7 +48,7 @@ export function getChartAnomalyTimeseries({ opacity: 0, }, }, - color: anomalyTimeseriesColor ?? rgba(theme.eui.euiColorVis1, 0.5), + color: anomalyTimeseriesColor ?? rgba(euiTheme.colors.vis.euiColorVis1, 0.5), yAccessors: ['y1'], y0Accessors: ['y0'], data: anomalyTimeseries.bounds, diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/instances_latency_distribution_chart/custom_tooltip.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/instances_latency_distribution_chart/custom_tooltip.tsx index f12f367eab8e9..8e0c24162f2a6 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/instances_latency_distribution_chart/custom_tooltip.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/instances_latency_distribution_chart/custom_tooltip.tsx @@ -6,13 +6,12 @@ */ import { TooltipInfo } from '@elastic/charts'; -import { EuiIcon } from '@elastic/eui'; +import { EuiIcon, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; import { APIReturnType } from '../../../../services/rest/create_call_apm_api'; import { getServiceNodeName } from '../../../../../common/service_nodes'; import { asTransactionRate, TimeFormatter } from '../../../../../common/utils/formatters'; -import { useTheme } from '../../../../hooks/use_theme'; type ServiceInstanceMainStatistics = APIReturnType<'GET /internal/apm/services/{serviceName}/service_overview_instances/main_statistics'>; @@ -92,7 +91,7 @@ function MultipleInstanceCustomTooltip({ latencyFormatter, values, }: TooltipInfo & { latencyFormatter: TimeFormatter }) { - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); return ( <> @@ -127,10 +126,7 @@ function MultipleInstanceCustomTooltip({ > <div className="echTooltip__item--color" style={{ backgroundColor: color }} /> </div> - <div - className="echTooltip__item--container" - style={{ paddingLeft: theme.eui.euiSizeS }} - > + <div className="echTooltip__item--container" style={{ paddingLeft: euiTheme.size.s }}> <span className="echTooltip__label">{latencyLabel}</span> <span className="echTooltip__value">{latencyFormatter(latency).formatted}</span> </div> @@ -142,10 +138,7 @@ function MultipleInstanceCustomTooltip({ > <div className="echTooltip__item--color" style={{ backgroundColor: color }} /> </div> - <div - className="echTooltip__item--container" - style={{ paddingLeft: theme.eui.euiSizeS }} - > + <div className="echTooltip__item--container" style={{ paddingLeft: euiTheme.size.s }}> <span className="echTooltip__label">{throughputLabel}</span> <span className="echTooltip__value">{asTransactionRate(throughput)}</span> </div> @@ -166,7 +159,7 @@ function MultipleInstanceCustomTooltip({ */ export function CustomTooltip(props: TooltipInfo & { latencyFormatter: TimeFormatter }) { const { values } = props; - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); return ( <div className="echTooltip"> @@ -175,7 +168,7 @@ export function CustomTooltip(props: TooltipInfo & { latencyFormatter: TimeForma ) : ( <SingleInstanceCustomTooltip {...props} /> )} - <div style={{ padding: theme.eui.euiSizeXS }}> + <div style={{ padding: euiTheme.size.xs }}> <EuiIcon type="filter" /> {clickToFilterDescription} </div> </div> diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/instances_latency_distribution_chart/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/instances_latency_distribution_chart/index.tsx index fec3fc4cfe2dd..6e5ce28e8cd22 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/instances_latency_distribution_chart/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/instances_latency_distribution_chart/index.tsx @@ -19,7 +19,7 @@ import { TooltipType, Tooltip, } from '@elastic/charts'; -import { EuiPanel, EuiTitle } from '@elastic/eui'; +import { EuiPanel, EuiTitle, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; import { useHistory } from 'react-router-dom'; @@ -28,7 +28,6 @@ import { usePreviousPeriodLabel } from '../../../../hooks/use_previous_period_te import { SERVICE_NODE_NAME } from '../../../../../common/es_fields/apm'; import { asTransactionRate, getDurationFormatter } from '../../../../../common/utils/formatters'; import { FETCH_STATUS } from '../../../../hooks/use_fetcher'; -import { useTheme } from '../../../../hooks/use_theme'; import { APIReturnType } from '../../../../services/rest/create_call_apm_api'; import * as urlHelpers from '../../links/url_helpers'; import { ChartContainer } from '../chart_container'; @@ -54,7 +53,7 @@ export function InstancesLatencyDistributionChart({ const history = useHistory(); const hasData = items.length > 0; - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); const chartThemes = useChartThemes(); const maxLatency = Math.max(...items.map((item) => item.latency ?? 0)); @@ -130,7 +129,7 @@ export function InstancesLatencyDistributionChart({ locale={i18n.getLocale()} /> <BubbleSeries - color={theme.eui.euiColorVis0} + color={euiTheme.colors.vis.euiColorVis0} data={items} id={i18n.translate('xpack.apm.instancesLatencyDistributionChartLegend', { defaultMessage: 'Instances', @@ -143,7 +142,7 @@ export function InstancesLatencyDistributionChart({ point: { strokeWidth: 0, radius: 4, - fill: theme.eui.euiColorVis0, + fill: euiTheme.colors.vis.euiColorVis0, }, }} /> @@ -156,13 +155,13 @@ export function InstancesLatencyDistributionChart({ xScaleType={ScaleType.Linear} yAccessors={[(item) => item.latency]} yScaleType={ScaleType.Linear} - color={theme.eui.euiColorMediumShade} + color={euiTheme.colors.mediumShade} bubbleSeriesStyle={{ point: { shape: 'square', radius: 4, - fill: theme.eui.euiColorLightestShade, - stroke: theme.eui.euiColorMediumShade, + fill: euiTheme.colors.lightestShade, + stroke: euiTheme.colors.mediumShade, strokeWidth: 2, }, }} diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/spark_plot/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/spark_plot/index.tsx index 84e2e6cb056d0..b18fd70d0d2ca 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/spark_plot/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/spark_plot/index.tsx @@ -16,12 +16,11 @@ import { Settings, Tooltip, } from '@elastic/charts'; -import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiLoadingChart } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiLoadingChart, useEuiTheme } from '@elastic/eui'; import React from 'react'; import { useChartThemes } from '@kbn/observability-shared-plugin/public'; import { i18n } from '@kbn/i18n'; import { Coordinate } from '../../../../../typings/timeseries'; -import { useTheme } from '../../../../hooks/use_theme'; import { unit } from '../../../../utils/style'; import { getComparisonChartTheme } from '../../time_comparison/get_comparison_chart_theme'; @@ -93,7 +92,7 @@ export function SparkPlotItem({ comparisonSeries?: Coordinate[]; comparisonSeriesColor?: string; }) { - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); const defaultChartThemes = useChartThemes(); const comparisonChartTheme = getComparisonChartTheme(); const hasComparisonSeries = !!comparisonSeries?.length; @@ -110,7 +109,7 @@ export function SparkPlotItem({ }; const chartSize = { - height: theme.eui.euiSizeL, + height: euiTheme.size.l, width: compact ? unit * 4 : unit * 5, }; @@ -201,7 +200,7 @@ export function SparkPlotItem({ justifyContent: 'center', }} > - <EuiIcon type="visLine" color={theme.eui.euiColorMediumShade} /> + <EuiIcon type="visLine" color={euiTheme.colors.mediumShade} /> </div> ); } diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/__snapshots__/timeline.test.tsx.snap b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/__snapshots__/timeline.test.tsx.snap index 2630a6c7862c0..09b48cc47b302 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/__snapshots__/timeline.test.tsx.snap +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/__snapshots__/timeline.test.tsx.snap @@ -1,11 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Timeline TimelineAxisContainer should render with data 1`] = ` -.c0 { - position: absolute; - bottom: 0; -} - <div style={ Object { @@ -37,7 +32,7 @@ exports[`Timeline TimelineAxisContainer should render with data 1`] = ` transform="translate(0 80)" > <text - fill="#69707d" + fill="#69707D" fontSize={11} textAnchor="middle" x={50} @@ -46,7 +41,7 @@ exports[`Timeline TimelineAxisContainer should render with data 1`] = ` 0 μs </text> <text - fill="#69707d" + fill="#69707D" fontSize={11} textAnchor="middle" x={30} @@ -55,7 +50,7 @@ exports[`Timeline TimelineAxisContainer should render with data 1`] = ` 200 μs </text> <text - fill="#69707d" + fill="#69707D" fontSize={11} textAnchor="middle" x={10} @@ -64,7 +59,7 @@ exports[`Timeline TimelineAxisContainer should render with data 1`] = ` 400 μs </text> <text - fill="#69707d" + fill="#69707D" fontSize={11} textAnchor="middle" x={-10} @@ -73,7 +68,7 @@ exports[`Timeline TimelineAxisContainer should render with data 1`] = ` 600 μs </text> <text - fill="#69707d" + fill="#69707D" fontSize={11} textAnchor="middle" x={-30} @@ -91,8 +86,9 @@ exports[`Timeline TimelineAxisContainer should render with data 1`] = ` </text> </g> </svg> + <div - className="c0" + className="css-cdm8xt" style={ Object { "left": -9955.5, @@ -100,55 +96,31 @@ exports[`Timeline TimelineAxisContainer should render with data 1`] = ` } > - .c0 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - font-size: 14px; - color: #69707d; - cursor: pointer; - opacity: 1; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.c1 { - width: 11px; - height: 11px; - margin-right: 0; - background: #98a2b3; - border-radius: 100%; -} - -<span + <span className="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock" onKeyDown={[Function]} onMouseOut={[Function]} onMouseOver={[Function]} > + <div - className="c0" + className="css-dncsr3" disabled={false} onBlur={[Function]} onFocus={[Function]} > + <span - className="c1" - color="#98a2b3" + className="css-18bonuo" + color="#98A2B3" shape="circle" /> </div> </span> </div> + <div - className="c0" + className="css-cdm8xt" style={ Object { "left": -10955.5, @@ -156,55 +128,31 @@ exports[`Timeline TimelineAxisContainer should render with data 1`] = ` } > - .c0 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - font-size: 14px; - color: #69707d; - cursor: pointer; - opacity: 1; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.c1 { - width: 11px; - height: 11px; - margin-right: 0; - background: #98a2b3; - border-radius: 100%; -} - -<span + <span className="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock" onKeyDown={[Function]} onMouseOut={[Function]} onMouseOver={[Function]} > + <div - className="c0" + className="css-dncsr3" disabled={false} onBlur={[Function]} onFocus={[Function]} > + <span - className="c1" - color="#98a2b3" + className="css-18bonuo" + color="#98A2B3" shape="circle" /> </div> </span> </div> + <div - className="c0" + className="css-cdm8xt" style={ Object { "left": -18955.5, @@ -212,48 +160,23 @@ exports[`Timeline TimelineAxisContainer should render with data 1`] = ` } > - .c0 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - font-size: 14px; - color: #69707d; - cursor: pointer; - opacity: 1; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.c1 { - width: 11px; - height: 11px; - margin-right: 0; - background: #98a2b3; - border-radius: 100%; -} - -<span + <span className="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock" onKeyDown={[Function]} onMouseOut={[Function]} onMouseOver={[Function]} > + <div - className="c0" + className="css-dncsr3" disabled={false} onBlur={[Function]} onFocus={[Function]} > + <span - className="c1" - color="#98a2b3" + className="css-18bonuo" + color="#98A2B3" shape="circle" /> </div> @@ -287,70 +210,70 @@ exports[`Timeline VerticalLinesContainer should render with data 1`] = ` transform="translate(0 100)" > <line - stroke="#f5f7fa" + stroke="#F1F4FA" x1={50} x2={50} y1={0} y2="100%" /> <line - stroke="#f5f7fa" + stroke="#F1F4FA" x1={30} x2={30} y1={0} y2="100%" /> <line - stroke="#f5f7fa" + stroke="#F1F4FA" x1={10} x2={10} y1={0} y2="100%" /> <line - stroke="#f5f7fa" + stroke="#F1F4FA" x1={-10} x2={-10} y1={0} y2="100%" /> <line - stroke="#f5f7fa" + stroke="#F1F4FA" x1={-30} x2={-30} y1={0} y2="100%" /> <line - stroke="#f5f7fa" + stroke="#F1F4FA" x1={-50} x2={-50} y1={0} y2="100%" /> <line - stroke="#98a2b3" + stroke="#98A2B3" x1={-9950} x2={-9950} y1={0} y2="100%" /> <line - stroke="#98a2b3" + stroke="#98A2B3" x1={-10950} x2={-10950} y1={0} y2="100%" /> <line - stroke="#98a2b3" + stroke="#98A2B3" x1={-18950} x2={-18950} y1={0} y2="100%" /> <line - stroke="#98a2b3" + stroke="#98A2B3" x1={-50} x2={-50} y1={0} diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/legend.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/legend.tsx index 131d82f4cb428..a674d70ee0d08 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/legend.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/legend.tsx @@ -6,8 +6,8 @@ */ import React from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; -import { useTheme } from '../../../../hooks/use_theme'; +import styled from '@emotion/styled'; +import { useEuiFontSize, useEuiTheme } from '@elastic/eui'; export enum Shape { circle = 'circle', @@ -20,11 +20,11 @@ interface ContainerProps { disabled: boolean; } -const Container = euiStyled.div<ContainerProps>` +const Container = styled.div<ContainerProps>` display: flex; align-items: center; - font-size: ${({ theme }) => theme.eui.euiFontSizeS}; - color: ${({ theme }) => theme.eui.euiColorDarkShade}; + font-size: ${() => useEuiFontSize('s').fontSize}; + color: ${({ theme }) => theme.euiTheme.colors.darkShade}; cursor: ${(props) => (props.clickable ? 'pointer' : 'initial')}; opacity: ${(props) => (props.disabled ? 0.4 : 1)}; user-select: none; @@ -38,7 +38,7 @@ interface IndicatorProps { const radius = 11; -export const Indicator = euiStyled.span<IndicatorProps>` +export const Indicator = styled.span<IndicatorProps>` width: ${radius}px; height: ${radius}px; margin-right: ${(props) => (props.withMargin ? `${radius / 2}px` : 0)}; @@ -68,8 +68,8 @@ export function Legend({ indicator, ...rest }: Props) { - const theme = useTheme(); - const indicatorColor = color || theme.eui.euiColorVis1; + const { euiTheme } = useEuiTheme(); + const indicatorColor = color || euiTheme.colors.vis.euiColorVis1; return ( <Container diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/marker/__snapshots__/index.test.tsx.snap b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/marker/__snapshots__/index.test.tsx.snap index 5657732eb241b..4eac5fe807dbe 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/marker/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/marker/__snapshots__/index.test.tsx.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Marker renders agent marker 1`] = ` -<styled.div +<Styled(div) style={ Object { "left": 4.5, @@ -18,11 +18,11 @@ exports[`Marker renders agent marker 1`] = ` } } /> -</styled.div> +</Styled(div)> `; exports[`Marker renders error marker 1`] = ` -<styled.div +<Styled(div) style={ Object { "left": 4.5, @@ -54,5 +54,5 @@ exports[`Marker renders error marker 1`] = ` } } /> -</styled.div> +</Styled(div)> `; diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/marker/agent_marker.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/marker/agent_marker.tsx index 37ddfbda58c3b..1ee668fb5765f 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/marker/agent_marker.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/marker/agent_marker.tsx @@ -5,22 +5,21 @@ * 2.0. */ -import { EuiToolTip } from '@elastic/eui'; +import { EuiToolTip, useEuiTheme } from '@elastic/eui'; import React from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { asDuration } from '../../../../../../common/utils/formatters'; -import { useTheme } from '../../../../../hooks/use_theme'; import { AgentMark } from '../../../../app/transaction_details/waterfall_with_summary/waterfall_container/marks/get_agent_marks'; import { Legend } from '../legend'; -const NameContainer = euiStyled.div` - border-bottom: 1px solid ${({ theme }) => theme.eui.euiColorMediumShade}; - padding-bottom: ${({ theme }) => theme.eui.euiSizeS}; +const NameContainer = styled.div` + border-bottom: 1px solid ${({ theme }) => theme.euiTheme.colors.mediumShade}; + padding-bottom: ${({ theme }) => theme.euiTheme.size.s}; `; -const TimeContainer = euiStyled.div` - color: ${({ theme }) => theme.eui.euiColorMediumShade}; - padding-top: ${({ theme }) => theme.eui.euiSizeS}; +const TimeContainer = styled.div` + color: ${({ theme }) => theme.euiTheme.colors.mediumShade}; + padding-top: ${({ theme }) => theme.euiTheme.size.s}; `; interface Props { @@ -28,7 +27,7 @@ interface Props { } export function AgentMarker({ mark }: Props) { - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); return ( <> @@ -42,7 +41,7 @@ export function AgentMarker({ mark }: Props) { </div> } > - <Legend clickable color={theme.eui.euiColorMediumShade} /> + <Legend clickable color={euiTheme.colors.mediumShade} /> </EuiToolTip> </> ); diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/marker/error_marker.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/marker/error_marker.tsx index faff0a073fe6b..14b2a277c3931 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/marker/error_marker.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/marker/error_marker.tsx @@ -5,13 +5,12 @@ * 2.0. */ -import { EuiPopover, EuiText } from '@elastic/eui'; +import { EuiPopover, EuiText, useEuiTheme } from '@elastic/eui'; import React, { useState } from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { TRACE_ID, TRANSACTION_ID } from '../../../../../../common/es_fields/apm'; import { asDuration } from '../../../../../../common/utils/formatters'; import { useLegacyUrlParams } from '../../../../../context/url_params_context/use_url_params'; -import { useTheme } from '../../../../../hooks/use_theme'; import { ErrorMark } from '../../../../app/transaction_details/waterfall_with_summary/waterfall_container/marks/get_error_marks'; import { ErrorDetailLink } from '../../../links/apm/error_detail_link'; import { Legend, Shape } from '../legend'; @@ -20,21 +19,21 @@ interface Props { mark: ErrorMark; } -const Popover = euiStyled.div` +const Popover = styled.div` max-width: 280px; `; -const TimeLegend = euiStyled(Legend)` - margin-bottom: ${({ theme }) => theme.eui.euiSize}; +const TimeLegend = styled(Legend)` + margin-bottom: ${({ theme }) => theme.euiTheme.size.base}; `; -const ErrorLink = euiStyled(ErrorDetailLink)` +const ErrorLink = styled(ErrorDetailLink)` display: block; - margin: ${({ theme }) => `${theme.eui.euiSizeS} 0 ${theme.eui.euiSizeS} 0`}; + margin: ${({ theme }) => `${theme.euiTheme.size.s} 0 ${theme.euiTheme.size.s} 0`}; overflow-wrap: break-word; `; -const Button = euiStyled(Legend)` +const Button = styled(Legend)` height: 20px; display: flex; align-items: flex-end; @@ -51,7 +50,7 @@ function truncateMessage(errorMessage?: string) { } export function ErrorMarker({ mark }: Props) { - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); const { urlParams } = useLegacyUrlParams(); const [isPopoverOpen, showPopover] = useState(false); @@ -61,7 +60,7 @@ export function ErrorMarker({ mark }: Props) { <Button data-test-subj="popover" clickable - color={theme.eui.euiColorDanger} + color={euiTheme.colors.danger} shape={Shape.square} onClick={togglePopover} /> @@ -94,7 +93,7 @@ export function ErrorMarker({ mark }: Props) { <Popover> <TimeLegend text={asDuration(mark.offset)} - indicator={<div style={{ marginRight: theme.eui.euiSizeXS }}>@</div>} + indicator={<div style={{ marginRight: euiTheme.size.xs }}>@</div>} /> <Legend key={mark.serviceColor} diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/marker/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/marker/index.tsx index fbcda12de2f45..4499f06558db6 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/marker/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/marker/index.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { AgentMark } from '../../../../app/transaction_details/waterfall_with_summary/waterfall_container/marks/get_agent_marks'; import { ErrorMark } from '../../../../app/transaction_details/waterfall_with_summary/waterfall_container/marks/get_error_marks'; import { AgentMarker } from './agent_marker'; @@ -17,7 +17,7 @@ interface Props { x: number; } -const MarkerContainer = euiStyled.div` +const MarkerContainer = styled.div` position: absolute; bottom: 0; `; diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/timeline_axis.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/timeline_axis.tsx index 96bc7da552f90..ebaa3d231dfa1 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/timeline_axis.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/timeline_axis.tsx @@ -7,8 +7,8 @@ import { inRange } from 'lodash'; import React from 'react'; +import { useEuiTheme } from '@elastic/eui'; import { getDurationFormatter } from '../../../../../common/utils/formatters'; -import { useTheme } from '../../../../hooks/use_theme'; import { Mark } from '.'; import { Marker } from './marker'; import { PlotValues } from './plot_utils'; @@ -36,7 +36,7 @@ interface TimelineAxisProps { } export function TimelineAxis({ plotValues, marks = [], topTraceDuration }: TimelineAxisProps) { - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); const { margins, tickValues, width, xMax, xScale } = plotValues; const tickFormatter = getDurationFormatter(xMax); @@ -65,7 +65,7 @@ export function TimelineAxis({ plotValues, marks = [], topTraceDuration }: Timel x={position} y={0} textAnchor="middle" - fill={theme.eui.euiColorDarkShade} + fill={euiTheme.colors.darkShade} fontSize={11} > {label} @@ -76,7 +76,7 @@ export function TimelineAxis({ plotValues, marks = [], topTraceDuration }: Timel key="topTrace" x={topTraceDurationPosition} y={0} - fill={theme.eui.euiTextColor} + fill={euiTheme.colors.textParagraph} textAnchor="middle" > {tickFormatter(topTraceDuration).formatted} diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/vertical_lines.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/vertical_lines.tsx index 96ab6a51e49f3..1f2a929084bea 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/vertical_lines.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeline/vertical_lines.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { useTheme } from '../../../../hooks/use_theme'; +import { useEuiTheme } from '@elastic/eui'; import { Mark } from '../../../app/transaction_details/waterfall_with_summary/waterfall_container/marks'; import { PlotValues } from './plot_utils'; @@ -21,7 +21,7 @@ export function VerticalLines({ topTraceDuration, plotValues, marks = [] }: Vert const markTimes = marks.filter((mark) => mark.verticalLine).map(({ offset }) => offset); - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); const tickPositions = tickValues.reduce<number[]>((positions, tick) => { const position = xScale(tick); @@ -53,7 +53,7 @@ export function VerticalLines({ topTraceDuration, plotValues, marks = [] }: Vert x2={position} y1={0} y2="100%" - stroke={theme.eui.euiColorLightestShade} + stroke={euiTheme.colors.lightestShade} /> ))} {markPositions.map((position) => ( @@ -63,7 +63,7 @@ export function VerticalLines({ topTraceDuration, plotValues, marks = [] }: Vert x2={position} y1={0} y2="100%" - stroke={theme.eui.euiColorMediumShade} + stroke={euiTheme.colors.mediumShade} /> ))} {Number.isFinite(topTraceDurationPosition) && ( @@ -73,7 +73,7 @@ export function VerticalLines({ topTraceDuration, plotValues, marks = [] }: Vert x2={topTraceDurationPosition} y1={0} y2="100%" - stroke={theme.eui.euiColorMediumShade} + stroke={euiTheme.colors.mediumShade} /> )} </g> diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeseries_chart.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeseries_chart.tsx index 7b90aeb3ee03c..5f08befb46a3a 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeseries_chart.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeseries_chart.tsx @@ -25,7 +25,7 @@ import { Tooltip, SettingsSpec, } from '@elastic/charts'; -import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiSpacer } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiSpacer, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { ReactElement } from 'react'; import { useHistory } from 'react-router-dom'; @@ -33,7 +33,6 @@ import { useChartThemes } from '@kbn/observability-shared-plugin/public'; import { isExpectedBoundsComparison } from '../time_comparison/get_comparison_options'; import { useChartPointerEventContext } from '../../../context/chart_pointer_event/use_chart_pointer_event_context'; -import { useTheme } from '../../../hooks/use_theme'; import { unit } from '../../../utils/style'; import { ChartContainer } from './chart_container'; import { @@ -75,11 +74,11 @@ export function TimeseriesChart({ }: TimeseriesChartProps) { const history = useHistory(); const { chartRef, updatePointerEvent } = useChartPointerEventContext(); - const theme = useTheme(); + const { euiTheme, colorMode } = useEuiTheme(); const chartThemes = useChartThemes(); const anomalyChartTimeseries = getChartAnomalyTimeseries({ anomalyTimeseries, - theme, + euiTheme, anomalyTimeseriesColor: anomalyTimeseries?.color, }); const isEmpty = isTimeseriesEmpty(timeseries); @@ -115,12 +114,13 @@ export function TimeseriesChart({ } : undefined; - const endZoneColor = theme.darkMode ? theme.eui.euiColorLightShade : theme.eui.euiColorDarkShade; + const isDarkMode = colorMode === 'DARK'; + const endZoneColor = isDarkMode ? euiTheme.colors.lightShade : euiTheme.colors.darkShade; const endZoneRectAnnotationStyle: Partial<RectAnnotationStyle> = { stroke: endZoneColor, fill: endZoneColor, strokeWidth: 0, - opacity: theme.darkMode ? 0.6 : 0.2, + opacity: isDarkMode ? 0.6 : 0.2, }; function getChartType(type: string) { diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeseries_chart_with_context.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeseries_chart_with_context.tsx index e9ec46610fe25..5f08e7375788e 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeseries_chart_with_context.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/timeseries_chart_with_context.tsx @@ -13,7 +13,7 @@ import { YDomainRange, } from '@elastic/charts'; import React from 'react'; -import { EuiIcon } from '@elastic/eui'; +import { EuiIcon, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { asAbsoluteDateTime } from '../../../../common/utils/formatters'; import { useAnnotationsContext } from '../../../context/annotations/use_annotations_context'; @@ -25,7 +25,6 @@ import { FETCH_STATUS } from '../../../hooks/use_fetcher'; import { unit } from '../../../utils/style'; import { getTimeZone } from './helper/timezone'; import { TimeseriesChart } from './timeseries_chart'; -import { useTheme } from '../../../hooks/use_theme'; interface AnomalyTimeseries extends ServiceAnomalyTimeseries { color?: string; @@ -69,8 +68,8 @@ export function TimeseriesChartWithContext({ } = useAnyOfApmParams('/services', '/dependencies/*', '/services/{serviceName}'); const { core } = useApmPluginContext(); const timeZone = getTimeZone(core.uiSettings); - const theme = useTheme(); - const annotationColor = theme.eui.euiColorSuccess; + const { euiTheme } = useEuiTheme(); + const annotationColor = euiTheme.colors.accentSecondary; const { annotations } = useAnnotationsContext(); const timeseriesAnnotations = [ diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/transaction_charts/ml_header.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/transaction_charts/ml_header.tsx index 814dfd3d77982..e25803c98622c 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/transaction_charts/ml_header.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/transaction_charts/ml_header.tsx @@ -9,7 +9,7 @@ import { EuiFlexItem, EuiIconTip, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { isEmpty } from 'lodash'; import React from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context'; import { useAnyOfApmParams } from '../../../../hooks/use_apm_params'; import { MLSingleMetricLink } from '../../links/machine_learning_links/mlsingle_metric_link'; @@ -19,14 +19,14 @@ interface Props { mlJobId?: string; } -const ShiftedIconWrapper = euiStyled.span` +const ShiftedIconWrapper = styled.span` padding-right: 5px; position: relative; top: -1px; display: inline-block; `; -const ShiftedEuiText = euiStyled(EuiText)` +const ShiftedEuiText = styled(EuiText)` position: relative; top: 5px; `; @@ -45,7 +45,9 @@ export function MLHeader({ hasValidMlLicense, mlJobId }: Props) { const hasKuery = !isEmpty(kuery); const icon = hasKuery ? ( <EuiIconTip - aria-label="Warning" + aria-label={i18n.translate('xpack.apm.mLHeader.euiIconTip.warningLabel', { + defaultMessage: 'Warning', + })} type="warning" color="warning" content={i18n.translate( diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/transaction_coldstart_rate_chart/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/transaction_coldstart_rate_chart/index.tsx index ffce66c797cb0..701c5eaa12db3 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/charts/transaction_coldstart_rate_chart/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/charts/transaction_coldstart_rate_chart/index.tsx @@ -5,7 +5,14 @@ * 2.0. */ -import { EuiPanel, EuiTitle, EuiFlexGroup, EuiFlexItem, EuiIconTip } from '@elastic/eui'; +import { + EuiPanel, + EuiTitle, + EuiFlexGroup, + EuiFlexItem, + EuiIconTip, + useEuiTheme, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; import { usePreviousPeriodLabel } from '../../../../hooks/use_previous_period_text'; @@ -13,7 +20,6 @@ import { isTimeComparison } from '../../time_comparison/get_comparison_options'; import { APIReturnType } from '../../../../services/rest/create_call_apm_api'; import { asPercent } from '../../../../../common/utils/formatters'; import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher'; -import { useTheme } from '../../../../hooks/use_theme'; import { TimeseriesChartWithContext } from '../timeseries_chart_with_context'; import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context'; import { getComparisonChartTheme } from '../../time_comparison/get_comparison_chart_theme'; @@ -57,7 +63,7 @@ export function TransactionColdstartRateChart({ comparisonEnabled, offset, }: Props) { - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); const { query: { rangeFrom, rangeTo }, @@ -117,7 +123,7 @@ export function TransactionColdstartRateChart({ { data: data?.currentPeriod?.transactionColdstartRate ?? [], type: 'linemark', - color: theme.eui.euiColorVis5, + color: euiTheme.colors.vis.euiColorVis5, title: i18n.translate('xpack.apm.coldstartRate.chart.coldstartRate', { defaultMessage: 'Cold start rate (avg.)', }), @@ -127,7 +133,7 @@ export function TransactionColdstartRateChart({ { data: data?.previousPeriod?.transactionColdstartRate ?? [], type: 'area', - color: theme.eui.euiColorMediumShade, + color: euiTheme.colors.mediumShade, title: previousPeriodLabel, }, ] diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/errors_table/get_columns.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/errors_table/get_columns.tsx index 61b30aa89ac55..1cbd4c108509a 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/errors_table/get_columns.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/errors_table/get_columns.tsx @@ -9,7 +9,7 @@ import { EuiBasicTableColumn, RIGHT_ALIGNMENT, CENTER_ALIGNMENT } from '@elastic import { i18n } from '@kbn/i18n'; import { TypeOf } from '@kbn/typed-react-router-config'; import React from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { isTimeComparison } from '../time_comparison/get_comparison_options'; import { asInteger } from '../../../../common/utils/formatters'; import { APIReturnType } from '../../../services/rest/create_call_apm_api'; @@ -22,7 +22,7 @@ import { TruncateWithTooltip } from '../truncate_with_tooltip'; import { ChartType, getTimeSeriesColor } from '../charts/helper/get_timeseries_color'; import { ApmRoutes } from '../../routing/apm_route_config'; -const ErrorLink = euiStyled(ErrorOverviewLink)` +const ErrorLink = styled(ErrorOverviewLink)` ${truncate('100%')}; `; diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/key_value_filter_list/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/key_value_filter_list/index.tsx index bc32b3c395a1d..cb1ce7b0b51be 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/key_value_filter_list/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/key_value_filter_list/index.tsx @@ -18,7 +18,7 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { Fragment } from 'react'; -import styled from 'styled-components'; +import styled from '@emotion/styled'; import { isEmpty } from 'lodash'; interface KeyValue { @@ -35,7 +35,8 @@ const StyledEuiAccordion = styled(EuiAccordion)` `; const StyledEuiDescriptionList = styled(EuiDescriptionList)` - margin: ${({ theme }) => `${theme.eui.euiSizeS} ${theme.eui.euiSizeS} 0 ${theme.eui.euiSizeS}`}; + margin: ${({ theme }) => + `${theme.euiTheme.size.s} ${theme.euiTheme.size.s} 0 ${theme.euiTheme.size.s}`}; .descriptionList__title, .descriptionList__description { margin-top: 0; diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/key_value_table/formatted_value.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/key_value_table/formatted_value.tsx index 1b1c5c3c59a70..a3baef9a802ba 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/key_value_table/formatted_value.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/key_value_table/formatted_value.tsx @@ -7,11 +7,11 @@ import { isBoolean, isNumber, isObject } from 'lodash'; import React from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { NOT_AVAILABLE_LABEL } from '../../../../common/i18n'; -const EmptyValue = euiStyled.span` - color: ${({ theme }) => theme.eui.euiColorMediumShade}; +const EmptyValue = styled.span` + color: ${({ theme }) => theme.euiTheme.colors.mediumShade}; text-align: left; `; diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/kuery_bar/typeahead/suggestion.js b/x-pack/plugins/observability_solution/apm/public/components/shared/kuery_bar/typeahead/suggestion.js index 841b74a37a409..625b19f923424 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/kuery_bar/typeahead/suggestion.js +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/kuery_bar/typeahead/suggestion.js @@ -7,72 +7,73 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; -import { EuiIcon } from '@elastic/eui'; +import styled from '@emotion/styled'; +import { EuiIcon, useEuiFontSize } from '@elastic/eui'; import { unit } from '../../../../utils/style'; import { tint } from 'polished'; function getIconColor(type, theme) { switch (type) { case 'field': - return theme.eui.euiColorVis7; + return theme.euiTheme.colors.vis.euiColorVis7; case 'value': - return theme.eui.euiColorVis0; + return theme.euiTheme.colors.vis.euiColorVis0; case 'operator': - return theme.eui.euiColorVis1; + return theme.euiTheme.colors.vis.euiColorVis1; case 'conjunction': - return theme.eui.euiColorVis3; + return theme.euiTheme.colors.vis.euiColorVis3; case 'recentSearch': - return theme.eui.euiColorMediumShade; + return theme.euiTheme.colors.mediumShade; } } -const Description = euiStyled.div` - color: ${({ theme }) => theme.eui.euiColorDarkShade}; +const Description = styled.div` + color: ${({ theme }) => theme.euiTheme.colors.darkShade}; p { display: inline; span { - font-family: ${({ theme }) => theme.eui.euiCodeFontFamily}; - color: ${({ theme }) => theme.eui.euiColorFullShade}; - padding: 0 ${({ theme }) => theme.eui.euiSizeXS}; + font-family: ${({ theme }) => theme.euiTheme.font.familyCode}; + color: ${({ theme }) => theme.euiTheme.colors.fullShade}; + padding: 0 ${({ theme }) => theme.euiTheme.size.xs}; display: inline-block; } } `; -const ListItem = euiStyled.li` - font-size: ${({ theme }) => theme.eui.euiFontSizeXS}; - height: ${({ theme }) => theme.eui.euiSizeXL}; +const ListItem = styled.li` + font-size: ${() => useEuiFontSize('xs').fontSize}; + height: ${({ theme }) => theme.euiTheme.size.xl}; align-items: center; display: flex; - background: ${({ selected, theme }) => (selected ? theme.eui.euiColorLightestShade : 'initial')}; + background: ${({ selected, theme }) => + selected ? theme.euiTheme.colors.lightestShade : 'initial'}; cursor: pointer; - border-radius: ${({ theme }) => theme.eui.euiBorderRadiusSmall}; + border-radius: ${({ theme }) => theme.euiTheme.border.radius.small}; ${Description} { p span { background: ${({ selected, theme }) => - selected ? theme.eui.euiColorEmptyShade : theme.eui.euiColorLightestShade}; + selected ? theme.euiTheme.colors.emptyShade : theme.euiTheme.colors.lightestShade}; } } `; -const Icon = euiStyled.div` - flex: 0 0 ${({ theme }) => theme.eui.euiSizeXL}; +const Icon = styled.div` + flex: 0 0 ${({ theme }) => theme.euiTheme.size.xl}; background: ${({ type, theme }) => tint(0.9, getIconColor(type, theme))}; color: ${({ type, theme }) => getIconColor(type, theme)}; width: 100%; height: 100%; text-align: center; - line-height: ${({ theme }) => theme.eui.euiSizeXL}; + line-height: ${({ theme }) => theme.euiTheme.size.xl}; `; -const TextValue = euiStyled.div` +const TextValue = styled.div` flex: 0 0 ${unit * 16}px; - color: ${({ theme }) => theme.eui.euiColorDarkestShade}; - padding: 0 ${({ theme }) => theme.eui.euiSizeS}; + color: ${({ theme }) => theme.euiTheme.colors.darkestShade}; + padding: 0 ${({ theme }) => theme.euiTheme.size.s}; `; function getEuiIconType(type) { diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/kuery_bar/typeahead/suggestions.js b/x-pack/plugins/observability_solution/apm/public/components/shared/kuery_bar/typeahead/suggestions.js index 1cedd94a86be1..3c07b8f608bad 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/kuery_bar/typeahead/suggestions.js +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/kuery_bar/typeahead/suggestions.js @@ -9,18 +9,22 @@ import { isEmpty } from 'lodash'; import { tint } from 'polished'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { unit } from '../../../../utils/style'; import Suggestion from './suggestion'; -const List = euiStyled.ul` +const List = styled.ul` width: 100%; - border: 1px solid ${({ theme }) => theme.eui.euiColorLightShade}; - border-radius: ${({ theme }) => theme.eui.euiBorderRadiusSmall}; - box-shadow: 0 ${({ theme }) => - `${theme.eui.euiSizeXS} ${theme.eui.euiSizeXL} ${tint(0.9, theme.eui.euiColorFullShade)}`}; + border: 1px solid ${({ theme }) => theme.euiTheme.colors.lightShade}; + border-radius: ${({ theme }) => theme.euiTheme.border.radius.small}; + box-shadow: 0 + ${({ theme }) => + `${theme.euiTheme.size.xs} ${theme.euiTheme.size.xl} ${tint( + 0.9, + theme.euiTheme.colors.fullShade + )}`}; position: absolute; - background: ${({ theme }) => theme.eui.euiColorEmptyShade}; + background: ${({ theme }) => theme.euiTheme.colors.emptyShade}; z-index: 10; left: 0; max-height: ${unit * 20}px; diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/links/apm/service_link/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/links/apm/service_link/index.tsx index 4baf94c6f0559..b6d7d1789fac9 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/links/apm/service_link/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/links/apm/service_link/index.tsx @@ -8,7 +8,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiLink, EuiText } from '@elastic/eui'; import { AgentIcon } from '@kbn/custom-icons'; import { i18n } from '@kbn/i18n'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { TypeOf } from '@kbn/typed-react-router-config'; import React from 'react'; import { isMobileAgentName } from '../../../../../../common/agent_name'; @@ -21,7 +21,9 @@ import { PopoverTooltip } from '../../../popover_tooltip'; import { TruncateWithTooltip } from '../../../truncate_with_tooltip'; import { MaxGroupsMessage, OTHER_SERVICE_NAME } from '../max_groups_message'; -const StyledLink = euiStyled(EuiLink)`${truncate('100%')};`; +const StyledLink = styled(EuiLink)` + ${truncate('100%')}; +`; function formatString(value?: string | null) { return value || NOT_AVAILABLE_LABEL; diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/links/dependency_link.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/links/dependency_link.tsx index 696f987ea2b63..d202c1cb770b7 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/links/dependency_link.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/links/dependency_link.tsx @@ -8,19 +8,21 @@ import { EuiFlexGroup, EuiFlexItem, EuiLink } from '@elastic/eui'; import { TypeOf } from '@kbn/typed-react-router-config'; import React from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { useApmRouter } from '../../../hooks/use_apm_router'; import { truncate } from '../../../utils/style'; import { ApmRoutes } from '../../routing/apm_route_config'; import { SpanIcon } from '../span_icon'; -const StyledLink = euiStyled(EuiLink)`${truncate('100%')};`; +const StyledLink = styled(EuiLink)` + ${truncate('100%')}; +`; interface Props { query: TypeOf<ApmRoutes, '/dependencies/overview'>['query']; subtype?: string; type?: string; - onClick?: React.ComponentProps<typeof EuiLink>['onClick']; + onClick?: React.MouseEventHandler<HTMLAnchorElement>; } export function DependencyLink({ query, subtype, type, onClick }: Props) { diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/overview_table_container/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/overview_table_container/index.tsx index c77c3e7cc7a92..8c2f62f7998b3 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/overview_table_container/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/overview_table_container/index.tsx @@ -6,7 +6,7 @@ */ import React, { ReactNode } from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { useBreakpoints } from '../../../hooks/use_breakpoints'; /** @@ -24,7 +24,7 @@ const tableHeight = 282; * * Hide the empty message when we don't yet have any items and are still not initiated. */ -const OverviewTableContainerDiv = euiStyled.div<{ +const OverviewTableContainerDiv = styled.div<{ fixedHeight?: boolean; isEmptyAndNotInitiated: boolean; shouldUseMobileLayout: boolean; diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/service_icons/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/service_icons/index.tsx index e6780927e755b..a7c4b2311508a 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/service_icons/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/service_icons/index.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { CloudProvider, @@ -14,7 +14,6 @@ import { getServerlessIcon, } from '@kbn/custom-icons'; import React, { ReactChild, useState } from 'react'; -import { useTheme } from '../../../hooks/use_theme'; import { ContainerType } from '../../../../common/service_metadata'; import { FETCH_STATUS, useFetcher } from '../../../hooks/use_fetcher'; import { CloudDetails } from './cloud_details'; @@ -81,7 +80,8 @@ export interface PopoverItem { export function ServiceIcons({ start, end, serviceName, environment }: Props) { const [selectedIconPopover, setSelectedIconPopover] = useState<Icons | null>(); - const theme = useTheme(); + const { colorMode } = useEuiTheme(); + const isDarkMode = colorMode === 'DARK'; const { data: icons, status: iconsFetchStatus } = useFetcher( (callApmApi) => { @@ -122,7 +122,7 @@ export function ServiceIcons({ start, end, serviceName, environment }: Props) { { key: 'service', icon: { - type: getAgentIcon(icons?.agentName, theme.darkMode) || 'node', + type: getAgentIcon(icons?.agentName, isDarkMode) || 'node', }, isVisible: !!icons?.agentName, title: i18n.translate('xpack.apm.serviceIcons.service', { @@ -133,7 +133,7 @@ export function ServiceIcons({ start, end, serviceName, environment }: Props) { { key: 'opentelemetry', icon: { - type: getAgentIcon('opentelemetry', theme.darkMode), + type: getAgentIcon('opentelemetry', isDarkMode), }, isVisible: !!icons?.agentName && isOpenTelemetryAgentName(icons.agentName), title: i18n.translate('xpack.apm.serviceIcons.opentelemetry', { diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/cause_stacktrace.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/cause_stacktrace.tsx index 549509dc96f52..d36a5bf422160 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/cause_stacktrace.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/cause_stacktrace.tsx @@ -8,29 +8,29 @@ import { EuiAccordion, EuiTitle } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { Stacktrace } from '.'; import { Stackframe } from '../../../../typings/es_schemas/raw/fields/stackframe'; -const Accordion = euiStyled(EuiAccordion)` - border-top: ${({ theme }) => theme.eui.euiBorderThin}; - margin-top: ${({ theme }) => theme.eui.euiSizeS}; +const Accordion = styled(EuiAccordion)` + border-top: ${({ theme }) => theme.euiTheme.border.thin}; + margin-top: ${({ theme }) => theme.euiTheme.size.s}; `; -const CausedByContainer = euiStyled('h5')` - padding: ${({ theme }) => theme.eui.euiSizeS} 0; +const CausedByContainer = styled('h5')` + padding: ${({ theme }) => theme.euiTheme.size.s} 0; `; -const CausedByHeading = euiStyled('span')` - color: ${({ theme }) => theme.eui.euiTextSubduedColor}; +const CausedByHeading = styled('span')` + color: ${({ theme }) => theme.euiTheme.colors.textSubdued}; display: block; - font-size: ${({ theme }) => theme.eui.euiFontSizeXS}; - font-weight: ${({ theme }) => theme.eui.euiFontWeightBold}; + font-size: ${({ theme }) => theme.euiTheme.size.xs}; + font-weight: ${({ theme }) => theme.euiTheme.font.weight.bold}; text-transform: uppercase; `; -const FramesContainer = euiStyled('div')` - padding-left: ${({ theme }) => theme.eui.euiSizeM}; +const FramesContainer = styled('div')` + padding-left: ${({ theme }) => theme.euiTheme.size.m}; `; function CausedBy({ message }: { message: string }) { diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/context.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/context.tsx index 3abd577733651..a79b5529d2cde 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/context.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/context.tsx @@ -13,66 +13,66 @@ import javascript from 'react-syntax-highlighter/dist/cjs/languages/hljs/javascr import python from 'react-syntax-highlighter/dist/cjs/languages/hljs/python'; import ruby from 'react-syntax-highlighter/dist/cjs/languages/hljs/ruby'; import xcode from 'react-syntax-highlighter/dist/cjs/styles/hljs/xcode'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { StackframeWithLineContext } from '../../../../typings/es_schemas/raw/fields/stackframe'; SyntaxHighlighter.registerLanguage('javascript', javascript); SyntaxHighlighter.registerLanguage('python', python); SyntaxHighlighter.registerLanguage('ruby', ruby); -const ContextContainer = euiStyled.div` +const ContextContainer = styled.div` position: relative; - border-radius: ${({ theme }) => theme.eui.euiBorderRadiusSmall}; + border-radius: ${({ theme }) => theme.euiTheme.border.radius.small}; `; const LINE_HEIGHT = 18; -const LineHighlight = euiStyled.div<{ lineNumber: number }>` +const LineHighlight = styled.div<{ lineNumber: number }>` position: absolute; width: 100%; height: ${LINE_HEIGHT}px; top: ${(props) => props.lineNumber * LINE_HEIGHT}px; pointer-events: none; - background-color: ${({ theme }) => tint(0.9, theme.eui.euiColorWarning)}; + background-color: ${({ theme }) => tint(0.9, theme.euiTheme.colors.warning)}; `; -const LineNumberContainer = euiStyled.div<{ isLibraryFrame: boolean }>` +const LineNumberContainer = styled.div<{ isLibraryFrame: boolean }>` position: absolute; top: 0; left: 0; - border-radius: ${({ theme }) => theme.eui.euiBorderRadiusSmall}; + border-radius: ${({ theme }) => theme.euiTheme.border.radius.small}; background: ${({ isLibraryFrame, theme }) => - isLibraryFrame ? theme.eui.euiColorEmptyShade : theme.eui.euiColorLightestShade}; + isLibraryFrame ? theme.euiTheme.colors.emptyShade : theme.euiTheme.colors.lightestShade}; `; -const LineNumber = euiStyled.div<{ highlight: boolean }>` +const LineNumber = styled.div<{ highlight: boolean }>` position: relative; min-width: 42px; - padding-left: ${({ theme }) => theme.eui.euiSizeS}; - padding-right: ${({ theme }) => theme.eui.euiSizeXS}; - color: ${({ theme }) => theme.eui.euiColorMediumShade}; + padding-left: ${({ theme }) => theme.euiTheme.size.s}; + padding-right: ${({ theme }) => theme.euiTheme.size.xs}; + color: ${({ theme }) => theme.euiTheme.colors.mediumShade}; line-height: ${LINE_HEIGHT}px; text-align: right; - border-right: 1px solid ${({ theme }) => theme.eui.euiColorLightShade}; + border-right: ${({ theme }) => theme.euiTheme.border.thin}; background-color: ${({ highlight, theme }) => - highlight ? tint(0.9, theme.eui.euiColorWarning) : null}; + highlight ? tint(0.9, theme.euiTheme.colors.warning) : null}; &:last-of-type { - border-radius: 0 0 0 ${({ theme }) => theme.eui.euiBorderRadiusSmall}; + border-radius: 0 0 0 ${({ theme }) => theme.euiTheme.border.radius.small}; } `; -const LineContainer = euiStyled.div` +const LineContainer = styled.div` overflow: auto; margin: 0 0 0 42px; padding: 0; - background-color: ${({ theme }) => theme.eui.euiColorEmptyShade}; + background-color: ${({ theme }) => theme.euiTheme.colors.emptyShade}; &:last-of-type { - border-radius: 0 0 ${({ theme }) => theme.eui.euiBorderRadiusSmall} 0; + border-radius: 0 0 ${({ theme }) => theme.euiTheme.border.radius.small} 0; } `; -const Line = euiStyled.pre` +const Line = styled.pre` // Override all styles margin: 0; color: inherit; @@ -84,7 +84,7 @@ const Line = euiStyled.pre` line-height: ${LINE_HEIGHT}px; `; -const Code = euiStyled.code` +const Code = styled.code` position: relative; padding: 0; margin: 0; diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/frame_heading.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/frame_heading.tsx index 00aac84b83731..734ac85cf40e6 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/frame_heading.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/frame_heading.tsx @@ -6,7 +6,8 @@ */ import React, { ComponentType } from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; +import { useEuiFontSize } from '@elastic/eui'; import { Stackframe } from '../../../../typings/es_schemas/raw/fields/stackframe'; import { CSharpFrameHeadingRenderer, @@ -18,21 +19,21 @@ import { PhpFrameHeadingRenderer, } from './frame_heading_renderers'; -const FileDetails = euiStyled.div` - color: ${({ theme }) => theme.eui.euiColorDarkShade}; +const FileDetails = styled.div` + color: ${({ theme }) => theme.euiTheme.colors.darkShade}; line-height: 1.5; /* matches the line-hight of the accordion container button */ padding: 2px 0; - font-family: ${({ theme }) => theme.eui.euiCodeFontFamily}; - font-size: ${({ theme }) => theme.eui.euiFontSizeS}; + font-family: ${({ theme }) => theme.euiTheme.font.familyCode}; + font-size: ${({ theme }) => useEuiFontSize('s').fontSize}; `; -const LibraryFrameFileDetail = euiStyled.span` - color: ${({ theme }) => theme.eui.euiColorDarkShade}; +const LibraryFrameFileDetail = styled.span` + color: ${({ theme }) => theme.euiTheme.colors.darkShade}; word-break: break-word; `; -const AppFrameFileDetail = euiStyled.span` - color: ${({ theme }) => theme.eui.euiColorFullShade}; +const AppFrameFileDetail = styled.span` + color: ${({ theme }) => theme.euiTheme.colors.fullShade}; word-break: break-word; `; diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/library_stacktrace.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/library_stacktrace.tsx index 8c9bc4e5cdd4e..b5fe38b6eb663 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/library_stacktrace.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/library_stacktrace.tsx @@ -8,12 +8,12 @@ import { EuiAccordion } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { Stackframe } from '../../../../typings/es_schemas/raw/fields/stackframe'; import { Stackframe as StackframeComponent } from './stackframe'; -const LibraryStacktraceAccordion = euiStyled(EuiAccordion)` - margin: ${({ theme }) => theme.eui.euiSizeXS} 0; +const LibraryStacktraceAccordion = styled(EuiAccordion)` + margin: ${({ theme }) => theme.euiTheme.size.xs} 0; `; interface Props { diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/stackframe.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/stackframe.tsx index 61692b3dbf967..1180b1c9ed05c 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/stackframe.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/stackframe.tsx @@ -7,7 +7,7 @@ import { EuiAccordion } from '@elastic/eui'; import React from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { Stackframe as StackframeType, StackframeWithLineContext, @@ -16,18 +16,18 @@ import { Context } from './context'; import { FrameHeading } from './frame_heading'; import { Variables } from './variables'; -const ContextContainer = euiStyled.div<{ isLibraryFrame: boolean }>` +const ContextContainer = styled.div<{ isLibraryFrame: boolean }>` position: relative; - font-family: ${({ theme }) => theme.eui.euiCodeFontFamily}; - font-size: ${({ theme }) => theme.eui.euiFontSizeS}; - border: 1px solid ${({ theme }) => theme.eui.euiColorLightShade}; - border-radius: ${({ theme }) => theme.eui.euiBorderRadiusSmall}; + font-family: ${({ theme }) => theme.euiTheme.font.familyCode}; + font-size: ${({ theme }) => theme.euiTheme.size.s}; + border: 1px solid ${({ theme }) => theme.euiTheme.colors.lightShade}; + border-radius: ${({ theme }) => theme.euiTheme.border.radius.small}; background: ${({ isLibraryFrame, theme }) => - isLibraryFrame ? theme.eui.euiColorEmptyShade : theme.eui.euiColorLightestShade}; + isLibraryFrame ? theme.euiTheme.colors.emptyShade : theme.euiTheme.colors.lightestShade}; `; // Indent the non-context frames the same amount as the accordion control -const NoContextFrameHeadingWrapper = euiStyled.div` +const NoContextFrameHeadingWrapper = styled.div` margin-left: 28px; `; diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/variables.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/variables.tsx index 5dc9a8a5073ba..e59d6e9bc5c12 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/variables.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/stacktrace/variables.tsx @@ -8,16 +8,16 @@ import { EuiAccordion } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { Stackframe } from '../../../../typings/es_schemas/raw/fields/stackframe'; import { KeyValueTable } from '../key_value_table'; import { flattenObject } from '../../../../common/utils/flatten_object'; -const VariablesContainer = euiStyled.div` - background: ${({ theme }) => theme.eui.euiColorEmptyShade}; - border-radius: 0 0 ${({ theme }) => - `${theme.eui.euiBorderRadiusSmall} ${theme.eui.euiBorderRadiusSmall}`}; - padding: ${({ theme }) => `${theme.eui.euiSizeS} ${theme.eui.euiSizeM}`}; +const VariablesContainer = styled.div` + background: ${({ theme }) => theme.euiTheme.colors.emptyShade}; + border-radius: 0 0 + ${({ theme }) => `${theme.euiTheme.border.radius.small} ${theme.euiTheme.border.radius.small}`}; + padding: ${({ theme }) => `${theme.euiTheme.size.s} ${theme.euiTheme.size.m}`}; `; interface Props { diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/sticky_properties/__snapshots__/sticky_properties.test.tsx.snap b/x-pack/plugins/observability_solution/apm/public/components/shared/sticky_properties/__snapshots__/sticky_properties.test.tsx.snap index f8799874408e3..61921adf27413 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/sticky_properties/__snapshots__/sticky_properties.test.tsx.snap +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/sticky_properties/__snapshots__/sticky_properties.test.tsx.snap @@ -24,9 +24,9 @@ exports[`StickyProperties should render entire component 1`] = ` <PropertyLabel> <EuiToolTip content={ - <styled.span> + <Styled(span)> url.full - </styled.span> + </Styled(span)> } delay="regular" display="inlineBlock" @@ -43,9 +43,9 @@ exports[`StickyProperties should render entire component 1`] = ` display="inlineBlock" position="top" > - <styled.span> + <Styled(span)> https://www.elastic.co/test - </styled.span> + </Styled(span)> </EuiToolTip> </EuiFlexItem> <EuiFlexItem @@ -61,9 +61,9 @@ exports[`StickyProperties should render entire component 1`] = ` <PropertyLabel> <EuiToolTip content={ - <styled.span> + <Styled(span)> http.request.method - </styled.span> + </Styled(span)> } delay="regular" display="inlineBlock" @@ -91,9 +91,9 @@ exports[`StickyProperties should render entire component 1`] = ` <PropertyLabel> <EuiToolTip content={ - <styled.span> + <Styled(span)> error.exception.handled - </styled.span> + </Styled(span)> } delay="regular" display="inlineBlock" @@ -121,9 +121,9 @@ exports[`StickyProperties should render entire component 1`] = ` <PropertyLabel> <EuiToolTip content={ - <styled.span> + <Styled(span)> user.id - </styled.span> + </Styled(span)> } delay="regular" display="inlineBlock" diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/sticky_properties/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/sticky_properties/index.tsx index f620c97984ca7..024f05e493a2a 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/sticky_properties/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/sticky_properties/index.tsx @@ -5,10 +5,10 @@ * 2.0. */ -import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, useEuiFontSize } from '@elastic/eui'; import { EuiToolTip } from '@elastic/eui'; import React from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { truncate } from '../../../utils/style'; export interface IStickyProperty { @@ -19,14 +19,14 @@ export interface IStickyProperty { truncated?: boolean; } -const TooltipFieldName = euiStyled.span` - font-family: ${({ theme }) => theme.eui.euiCodeFontFamily}; +const TooltipFieldName = styled.span` + font-family: ${({ theme }) => theme.euiTheme.font.familyCode}; `; -const PropertyLabel = euiStyled.div` - margin-bottom: ${({ theme }) => theme.eui.euiSizeS}; - font-size: ${({ theme }) => theme.eui.euiFontSizeXS}; - color: ${({ theme }) => theme.eui.euiColorMediumShade}; +const PropertyLabel = styled.div` + margin-bottom: ${({ theme }) => theme.euiTheme.size.s}; + font-size: ${() => useEuiFontSize('xs').fontSize}; + color: ${({ theme }) => theme.euiTheme.colors.mediumShade}; span { cursor: help; @@ -35,13 +35,13 @@ const PropertyLabel = euiStyled.div` PropertyLabel.displayName = 'PropertyLabel'; const propertyValueLineHeight = 1.2; -const PropertyValue = euiStyled.div` +const PropertyValue = styled.div` display: inline-block; line-height: ${propertyValueLineHeight}; `; PropertyValue.displayName = 'PropertyValue'; -const PropertyValueTruncated = euiStyled.span` +const PropertyValueTruncated = styled.span` display: inline-block; line-height: ${propertyValueLineHeight}; ${truncate('100%')}; diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/sticky_properties/sticky_properties.test.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/sticky_properties/sticky_properties.test.tsx index 02289485e12d0..09effede911f9 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/sticky_properties/sticky_properties.test.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/sticky_properties/sticky_properties.test.tsx @@ -56,7 +56,7 @@ describe('StickyProperties', () => { const wrapper = shallow(<StickyProperties stickyProperties={stickyProperties} />) .find('PropertyValue') - .dive() + .render() .text(); expect(wrapper).toEqual('1337'); diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/summary/error_count_summary_item_badge.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/summary/error_count_summary_item_badge.tsx index 9de373d2189e2..2eb502feb99ec 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/summary/error_count_summary_item_badge.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/summary/error_count_summary_item_badge.tsx @@ -7,18 +7,17 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { EuiBadge } from '@elastic/eui'; -import { useTheme } from '../../../hooks/use_theme'; +import { EuiBadge, useEuiTheme } from '@elastic/eui'; interface Props { count: number; } export function ErrorCountSummaryItemBadge({ count }: Props) { - const theme = useTheme(); + const { euiTheme } = useEuiTheme(); return ( - <EuiBadge color={theme.eui.euiColorDanger} style={{ maxWidth: '200px' }}> + <EuiBadge color={euiTheme.colors.danger} style={{ maxWidth: '200px' }}> {i18n.translate('xpack.apm.transactionDetails.errorCount', { defaultMessage: '{errorCount, number} {errorCount, plural, one {Error} other {Errors}}', values: { errorCount: count }, diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/summary/http_info_summary_item/http_info_summary_item.test.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/summary/http_info_summary_item/http_info_summary_item.test.tsx index 6091a6ff8c73d..2d5e1cfeb41e1 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/summary/http_info_summary_item/http_info_summary_item.test.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/summary/http_info_summary_item/http_info_summary_item.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { shallow, mount } from 'enzyme'; import { HttpInfoSummaryItem } from '.'; import * as exampleTransactions from '../__fixtures__/transactions'; -import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; +import { EuiThemeProvider } from '@elastic/eui'; describe('HttpInfoSummaryItem', () => { describe('render', () => { diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/summary/http_info_summary_item/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/summary/http_info_summary_item/index.tsx index 7eee907d05264..5732c426e2610 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/summary/http_info_summary_item/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/summary/http_info_summary_item/index.tsx @@ -8,15 +8,15 @@ import { EuiBadge, EuiToolTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { truncate, unit } from '../../../../utils/style'; import { HttpStatusBadge } from '../http_status_badge'; -const HttpInfoBadge = euiStyled(EuiBadge)` - margin-right: ${({ theme }) => theme.eui.euiSizeXS}; +const HttpInfoBadge = styled(EuiBadge)` + margin-right: ${({ theme }) => theme.euiTheme.size.xs}; `; -const Url = euiStyled('span')` +const Url = styled('span')` display: inline-block; vertical-align: bottom; ${truncate(unit * 24)}; @@ -27,7 +27,7 @@ interface HttpInfoProps { url: string; } -const Span = euiStyled('span')` +const Span = styled('span')` white-space: nowrap; `; diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/summary/user_agent_summary_item.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/summary/user_agent_summary_item.tsx index dcfaae3f9b255..9a2f3e041bf1c 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/summary/user_agent_summary_item.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/summary/user_agent_summary_item.tsx @@ -6,15 +6,15 @@ */ import React from 'react'; -import { EuiToolTip } from '@elastic/eui'; +import { EuiToolTip, useEuiFontSize } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { UserAgent } from '../../../../typings/es_schemas/raw/fields/user_agent'; type UserAgentSummaryItemProps = UserAgent; -const Version = euiStyled('span')` - font-size: ${({ theme }) => theme.eui.euiFontSizeS}; +const Version = styled('span')` + font-size: ${() => useEuiFontSize('s').fontSize}; `; export function UserAgentSummaryItem({ name, version }: UserAgentSummaryItemProps) { diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/time_comparison/index.test.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/time_comparison/index.test.tsx index a8caf46850203..9fffd11600c81 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/time_comparison/index.test.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/time_comparison/index.test.tsx @@ -8,7 +8,6 @@ import { render } from '@testing-library/react'; import React, { ReactNode } from 'react'; import { MemoryRouter } from 'react-router-dom'; -import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; import { expectTextsInDocument, expectTextsNotInDocument } from '../../../utils/test_helpers'; import { TimeComparison } from '.'; import * as urlHelpers from '../links/url_helpers'; @@ -24,6 +23,7 @@ import type { ApmPluginContextValue } from '../../../context/apm_plugin/apm_plug import { merge } from 'lodash'; import type { ApmMlJob } from '../../../../common/anomaly_detection/apm_ml_job'; import { FETCH_STATUS } from '../../../hooks/use_fetcher'; +import { EuiThemeProvider } from '@elastic/eui'; const ML_AD_JOBS = { jobs: [ diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/time_comparison/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/time_comparison/index.tsx index 54894b3f536c2..57e3fa94b5ba8 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/time_comparison/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/time_comparison/index.tsx @@ -9,7 +9,7 @@ import { EuiCheckbox, EuiSelect } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { useMemo } from 'react'; import { useHistory, useLocation } from 'react-router-dom'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { useUiTracker } from '@kbn/observability-shared-plugin/public'; import { useApmRouter } from '../../../hooks/use_apm_router'; import { useEnvironmentsContext } from '../../../context/environments_context/use_environments_context'; @@ -21,12 +21,12 @@ import { useTimeRange } from '../../../hooks/use_time_range'; import * as urlHelpers from '../links/url_helpers'; import { getComparisonOptions, TimeRangeComparisonEnum } from './get_comparison_options'; -const PrependContainer = euiStyled.div` +const PrependContainer = styled.div` display: flex; justify-content: center; align-items: center; - background-color: ${({ theme }) => theme.eui.euiFormInputGroupLabelBackground}; - padding: 0 ${({ theme }) => theme.eui.euiSizeM}; + background-color: ${({ theme }) => theme.euiTheme.colors.backgroundBaseFormsPrepend}; + padding: 0 ${({ theme }) => theme.euiTheme.size.m}; `; export function TimeComparison() { diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/transaction_type_select.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/transaction_type_select.tsx index 292aaaed816af..f6e2a1a52b535 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/transaction_type_select.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/transaction_type_select.tsx @@ -8,7 +8,7 @@ import { EuiSelect } from '@elastic/eui'; import React, { FormEvent, useCallback } from 'react'; import { useHistory } from 'react-router-dom'; -import styled from 'styled-components'; +import styled from '@emotion/styled'; import { useApmServiceContext } from '../../context/apm_service/use_apm_service_context'; import { useBreakpoints } from '../../hooks/use_breakpoints'; import * as urlHelpers from './links/url_helpers'; diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/truncate_with_tooltip/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/truncate_with_tooltip/index.tsx index 5e1c450e336d6..02e04ed098038 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/truncate_with_tooltip/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/truncate_with_tooltip/index.tsx @@ -7,12 +7,12 @@ import { EuiToolTip } from '@elastic/eui'; import React from 'react'; -import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import styled from '@emotion/styled'; import { truncate } from '../../../utils/style'; const tooltipAnchorClassname = '_apm_truncate_tooltip_anchor_'; -const TooltipWrapper = euiStyled.div` +const TooltipWrapper = styled.div` width: 100%; .${tooltipAnchorClassname} { width: 100% !important; @@ -20,7 +20,7 @@ const TooltipWrapper = euiStyled.div` } `; -const ContentWrapper = euiStyled.div` +const ContentWrapper = styled.div` ${truncate('100%')} `; diff --git a/x-pack/plugins/observability_solution/apm/public/embeddable/embeddable_context.tsx b/x-pack/plugins/observability_solution/apm/public/embeddable/embeddable_context.tsx index 43ccf990257ba..8458a4c9d4466 100644 --- a/x-pack/plugins/observability_solution/apm/public/embeddable/embeddable_context.tsx +++ b/x-pack/plugins/observability_solution/apm/public/embeddable/embeddable_context.tsx @@ -9,7 +9,6 @@ import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { KibanaThemeProvider } from '@kbn/react-kibana-context-theme'; import { ApmPluginContext, ApmPluginContextValue } from '../context/apm_plugin/apm_plugin_context'; import { createCallApmApi } from '../services/rest/create_call_apm_api'; -import { ApmThemeProvider } from '../components/routing/app_root'; import { ChartPointerEventContextProvider } from '../context/chart_pointer_event/chart_pointer_event_context'; import { EmbeddableDeps } from './types'; import { TimeRangeMetadataContextProvider } from '../context/time_range_metadata/time_range_metadata_context'; @@ -54,19 +53,17 @@ export function ApmEmbeddableContext({ <I18nContext> <ApmPluginContext.Provider value={services}> <KibanaThemeProvider theme={deps.coreStart.theme}> - <ApmThemeProvider> - <KibanaContextProvider services={deps.coreStart}> - <TimeRangeMetadataContextProvider - uiSettings={deps.coreStart.uiSettings} - start={rangeFrom} - end={rangeTo} - kuery={kuery} - useSpanName={false} - > - <ChartPointerEventContextProvider>{children}</ChartPointerEventContextProvider> - </TimeRangeMetadataContextProvider> - </KibanaContextProvider> - </ApmThemeProvider> + <KibanaContextProvider services={deps.coreStart}> + <TimeRangeMetadataContextProvider + uiSettings={deps.coreStart.uiSettings} + start={rangeFrom} + end={rangeTo} + kuery={kuery} + useSpanName={false} + > + <ChartPointerEventContextProvider>{children}</ChartPointerEventContextProvider> + </TimeRangeMetadataContextProvider> + </KibanaContextProvider> </KibanaThemeProvider> </ApmPluginContext.Provider> </I18nContext> diff --git a/x-pack/plugins/observability_solution/apm/public/hooks/use_entity_centric_experience_setting.tsx b/x-pack/plugins/observability_solution/apm/public/hooks/use_entity_centric_experience_setting.tsx index 32e68c40788fc..e5290bb25dbba 100644 --- a/x-pack/plugins/observability_solution/apm/public/hooks/use_entity_centric_experience_setting.tsx +++ b/x-pack/plugins/observability_solution/apm/public/hooks/use_entity_centric_experience_setting.tsx @@ -13,7 +13,7 @@ export function useEntityCentricExperienceSetting() { const isEntityCentricExperienceEnabled = core.uiSettings.get<boolean>( entityCentricExperience, - true + false ); return { isEntityCentricExperienceEnabled }; diff --git a/x-pack/plugins/observability_solution/apm/public/hooks/use_theme.tsx b/x-pack/plugins/observability_solution/apm/public/hooks/use_theme.tsx deleted file mode 100644 index 8c18ac38efc33..0000000000000 --- a/x-pack/plugins/observability_solution/apm/public/hooks/use_theme.tsx +++ /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 { useContext } from 'react'; -import { ThemeContext } from 'styled-components'; -import { EuiTheme } from '@kbn/kibana-react-plugin/common'; - -export function useTheme(): EuiTheme { - const theme = useContext(ThemeContext); - return theme; -} diff --git a/x-pack/plugins/observability_solution/apm/public/tutorial/config_agent/index.tsx b/x-pack/plugins/observability_solution/apm/public/tutorial/config_agent/index.tsx index cd10f07f2475e..129f15a3355cd 100644 --- a/x-pack/plugins/observability_solution/apm/public/tutorial/config_agent/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/tutorial/config_agent/index.tsx @@ -8,7 +8,7 @@ import { EuiLoadingSpinner } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { HttpStart } from '@kbn/core/public'; import React, { useEffect, useMemo, useState } from 'react'; -import styled from 'styled-components'; +import styled from '@emotion/styled'; import { APIReturnType } from '../../services/rest/create_call_apm_api'; import { AgentConfigInstructions } from './agent_config_instructions'; import { getPolicyOptions, PolicyOption } from './get_policy_options'; diff --git a/x-pack/plugins/observability_solution/apm/public/tutorial/tutorial_fleet_instructions/index.tsx b/x-pack/plugins/observability_solution/apm/public/tutorial/tutorial_fleet_instructions/index.tsx index 8924999f4821f..6796c6576ab03 100644 --- a/x-pack/plugins/observability_solution/apm/public/tutorial/tutorial_fleet_instructions/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/tutorial/tutorial_fleet_instructions/index.tsx @@ -18,7 +18,7 @@ import { import { i18n } from '@kbn/i18n'; import { HttpStart } from '@kbn/core/public'; import React, { useEffect, useState } from 'react'; -import styled from 'styled-components'; +import styled from '@emotion/styled'; import { APIReturnType } from '../../services/rest/create_call_apm_api'; interface Props { diff --git a/x-pack/plugins/observability_solution/apm/public/utils/test_helpers.tsx b/x-pack/plugins/observability_solution/apm/public/utils/test_helpers.tsx index 76a6b868300cf..a5d6f67829081 100644 --- a/x-pack/plugins/observability_solution/apm/public/utils/test_helpers.tsx +++ b/x-pack/plugins/observability_solution/apm/public/utils/test_helpers.tsx @@ -18,8 +18,8 @@ import moment from 'moment'; import { Moment } from 'moment-timezone'; import React from 'react'; import { MemoryRouter } from 'react-router-dom'; -import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; +import { EuiThemeProvider } from '@elastic/eui'; import { MockApmPluginContextWrapper } from '../context/apm_plugin/mock_apm_plugin_context'; import { UrlParamsProvider } from '../context/url_params_context/url_params_context'; @@ -112,17 +112,13 @@ export function expectTextsInDocument(output: any, texts: string[]) { }); } -export function renderWithTheme( - component: React.ReactNode, - params?: any, - { darkMode = false } = {} -) { - return render(<EuiThemeProvider darkMode={darkMode}>{component}</EuiThemeProvider>, params); +export function renderWithTheme(component: React.ReactNode, params?: any) { + return render(<EuiThemeProvider>{component}</EuiThemeProvider>, params); } -export function mountWithTheme(tree: React.ReactElement<any>, { darkMode = false } = {}) { +export function mountWithTheme(tree: React.ReactElement<any>) { function WrappingThemeProvider(props: any) { - return <EuiThemeProvider darkMode={darkMode}>{props.children}</EuiThemeProvider>; + return <EuiThemeProvider>{props.children}</EuiThemeProvider>; } return mount(tree, { diff --git a/x-pack/plugins/observability_solution/apm/server/routes/entities/get_entities.ts b/x-pack/plugins/observability_solution/apm/server/routes/entities/get_entities.ts deleted file mode 100644 index 6cedb09efa7c2..0000000000000 --- a/x-pack/plugins/observability_solution/apm/server/routes/entities/get_entities.ts +++ /dev/null @@ -1,67 +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 type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { - ENTITY_FIRST_SEEN, - ENTITY_LAST_SEEN, -} from '@kbn/observability-shared-plugin/common/field_names/elasticsearch'; -import type { EntitiesESClient } from '../../lib/helpers/create_es_client/create_entities_es_client/create_entities_es_client'; -import { getEntityLatestServices } from './get_entity_latest_services'; -import type { EntityLatestServiceRaw } from './types'; - -export function entitiesRangeQuery(start?: number, end?: number): QueryDslQueryContainer[] { - if (!start || !end) { - return []; - } - - return [ - { - range: { - [ENTITY_LAST_SEEN]: { - gte: start, - }, - }, - }, - { - range: { - [ENTITY_FIRST_SEEN]: { - lte: end, - }, - }, - }, - ]; -} - -export async function getEntities({ - entitiesESClient, - start, - end, - environment, - kuery, - size, - serviceName, -}: { - entitiesESClient: EntitiesESClient; - start: number; - end: number; - environment: string; - kuery?: string; - size: number; - serviceName?: string; -}): Promise<EntityLatestServiceRaw[]> { - const entityLatestServices = await getEntityLatestServices({ - entitiesESClient, - start, - end, - environment, - kuery, - size, - serviceName, - }); - - return entityLatestServices; -} diff --git a/x-pack/plugins/observability_solution/apm/server/routes/entities/get_entity_latest_services.ts b/x-pack/plugins/observability_solution/apm/server/routes/entities/get_entity_latest_services.ts deleted file mode 100644 index e08be75072b6f..0000000000000 --- a/x-pack/plugins/observability_solution/apm/server/routes/entities/get_entity_latest_services.ts +++ /dev/null @@ -1,59 +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 { kqlQuery, termQuery } from '@kbn/observability-plugin/server'; -import { - ENTITY, - ENTITY_TYPE, - SOURCE_DATA_STREAM_TYPE, -} from '@kbn/observability-shared-plugin/common/field_names/elasticsearch'; -import { AGENT_NAME, SERVICE_ENVIRONMENT, SERVICE_NAME } from '../../../common/es_fields/apm'; -import { environmentQuery } from '../../../common/utils/environment_query'; -import { EntitiesESClient } from '../../lib/helpers/create_es_client/create_entities_es_client/create_entities_es_client'; -import { entitiesRangeQuery } from './get_entities'; -import { EntityLatestServiceRaw, EntityType } from './types'; - -export async function getEntityLatestServices({ - entitiesESClient, - start, - end, - environment, - kuery, - size, - serviceName, -}: { - entitiesESClient: EntitiesESClient; - start?: number; - end?: number; - environment: string; - kuery?: string; - size: number; - serviceName?: string; -}): Promise<EntityLatestServiceRaw[]> { - const latestEntityServices = ( - await entitiesESClient.searchLatest<EntityLatestServiceRaw>(`get_entity_latest_services`, { - body: { - size, - track_total_hits: false, - _source: [AGENT_NAME, ENTITY, SOURCE_DATA_STREAM_TYPE, SERVICE_NAME, SERVICE_ENVIRONMENT], - query: { - bool: { - filter: [ - ...kqlQuery(kuery), - ...environmentQuery(environment, SERVICE_ENVIRONMENT), - ...entitiesRangeQuery(start, end), - ...termQuery(ENTITY_TYPE, EntityType.SERVICE), - ...termQuery(SERVICE_NAME, serviceName), - ], - }, - }, - }, - }) - ).hits.hits.map((hit) => hit._source); - - return latestEntityServices; -} diff --git a/x-pack/plugins/observability_solution/apm/server/routes/entities/services/get_service_entities.ts b/x-pack/plugins/observability_solution/apm/server/routes/entities/services/get_service_entities.ts deleted file mode 100644 index 9e6bb34bceafe..0000000000000 --- a/x-pack/plugins/observability_solution/apm/server/routes/entities/services/get_service_entities.ts +++ /dev/null @@ -1,61 +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 { errors } from '@elastic/elasticsearch'; -import { Logger } from '@kbn/core/server'; -import { WrappedElasticsearchClientError } from '@kbn/observability-plugin/server'; -import { EntitiesESClient } from '../../../lib/helpers/create_es_client/create_entities_es_client/create_entities_es_client'; -import { withApmSpan } from '../../../utils/with_apm_span'; -import { getEntities } from '../get_entities'; -import { mergeEntities } from '../utils/merge_entities'; - -export const MAX_NUMBER_OF_SERVICES = 1_000; - -export async function getServiceEntities({ - entitiesESClient, - start, - end, - kuery, - environment, - logger, -}: { - entitiesESClient: EntitiesESClient; - start: number; - end: number; - kuery: string; - environment: string; - logger: Logger; -}) { - return withApmSpan('get_service_entities', async () => { - try { - const entities = await getEntities({ - entitiesESClient, - start, - end, - kuery, - environment, - size: MAX_NUMBER_OF_SERVICES, - }); - - return mergeEntities({ entities }); - } catch (error) { - // If the index does not exist, handle it gracefully - if ( - error instanceof WrappedElasticsearchClientError && - error.originalError instanceof errors.ResponseError - ) { - const type = error.originalError.body.error.type; - - if (type === 'index_not_found_exception') { - logger.error(`Entities index does not exist. Unable to fetch services.`); - return []; - } - } - - throw error; - } - }); -} diff --git a/x-pack/plugins/observability_solution/apm/server/routes/entities/services/get_service_entity_summary.ts b/x-pack/plugins/observability_solution/apm/server/routes/entities/services/get_service_entity_summary.ts index 3ab3b907f5be2..90a44a9b609e6 100644 --- a/x-pack/plugins/observability_solution/apm/server/routes/entities/services/get_service_entity_summary.ts +++ b/x-pack/plugins/observability_solution/apm/server/routes/entities/services/get_service_entity_summary.ts @@ -5,28 +5,31 @@ * 2.0. */ -import type { EntitiesESClient } from '../../../lib/helpers/create_es_client/create_entities_es_client/create_entities_es_client'; +import { SERVICE_NAME, AGENT_NAME, SERVICE_ENVIRONMENT } from '@kbn/apm-types'; +import { BUILT_IN_ENTITY_TYPES, DATA_STREAM_TYPE } from '@kbn/observability-shared-plugin/common'; +import moment from 'moment'; +import type { EntityClient } from '@kbn/entityManager-plugin/server/lib/entity_client'; import { withApmSpan } from '../../../utils/with_apm_span'; -import { getEntityLatestServices } from '../get_entity_latest_services'; import { mergeEntities } from '../utils/merge_entities'; -import { MAX_NUMBER_OF_SERVICES } from './get_service_entities'; interface Params { - entitiesESClient: EntitiesESClient; + entityManagerClient: EntityClient; serviceName: string; environment: string; } -export function getServiceEntitySummary({ entitiesESClient, environment, serviceName }: Params) { +export function getServiceEntitySummary({ entityManagerClient, environment, serviceName }: Params) { return withApmSpan('get_service_entity_summary', async () => { - const entityLatestServices = await getEntityLatestServices({ - entitiesESClient, - environment, - size: MAX_NUMBER_OF_SERVICES, - serviceName, + const serviceEntitySummary = await entityManagerClient.v2.searchEntities({ + start: moment().subtract(15, 'm').toISOString(), + end: moment().toISOString(), + type: BUILT_IN_ENTITY_TYPES.SERVICE_V2, + filters: [`${SERVICE_NAME}: "${serviceName}"`], + limit: 1, + metadata_fields: [DATA_STREAM_TYPE, AGENT_NAME, SERVICE_ENVIRONMENT], }); - const serviceEntity = mergeEntities({ entities: entityLatestServices }); + const serviceEntity = mergeEntities({ entities: serviceEntitySummary?.entities }); return serviceEntity[0]; }); } diff --git a/x-pack/plugins/observability_solution/apm/server/routes/entities/services/routes.ts b/x-pack/plugins/observability_solution/apm/server/routes/entities/services/routes.ts index ab89f9417ec88..e3d44645ad394 100644 --- a/x-pack/plugins/observability_solution/apm/server/routes/entities/services/routes.ts +++ b/x-pack/plugins/observability_solution/apm/server/routes/entities/services/routes.ts @@ -6,10 +6,8 @@ */ import * as t from 'io-ts'; import { environmentQuery } from '../../../../common/utils/environment_query'; -import { createEntitiesESClient } from '../../../lib/helpers/create_es_client/create_entities_es_client/create_entities_es_client'; import { createApmServerRoute } from '../../apm_routes/create_apm_server_route'; import { environmentRt, kueryRt, rangeRt } from '../../default_api_types'; -import { getServiceEntities } from './get_service_entities'; import { getServiceEntitySummary } from './get_service_entity_summary'; const serviceEntitiesSummaryRoute = createApmServerRoute({ @@ -20,52 +18,20 @@ const serviceEntitiesSummaryRoute = createApmServerRoute({ }), security: { authz: { requiredPrivileges: ['apm'] } }, async handler(resources) { - const { context, params, request } = resources; - const coreContext = await context.core; - - const entitiesESClient = await createEntitiesESClient({ - request, - esClient: coreContext.elasticsearch.client.asCurrentUser, - }); + const { params, request, plugins } = resources; + const entityManagerStart = await plugins.entityManager.start(); + const entityManagerClient = await entityManagerStart.getScopedClient({ request }); const { serviceName } = params.path; const { environment } = params.query; - return getServiceEntitySummary({ - entitiesESClient, + const serviceEntitySummary = await getServiceEntitySummary({ + entityManagerClient, serviceName, environment, }); - }, -}); - -const servicesEntitiesRoute = createApmServerRoute({ - endpoint: 'GET /internal/apm/entities/services', - params: t.type({ - query: t.intersection([environmentRt, kueryRt, rangeRt]), - }), - security: { authz: { requiredPrivileges: ['apm'] } }, - async handler(resources) { - const { context, params, request } = resources; - const coreContext = await context.core; - - const entitiesESClient = await createEntitiesESClient({ - request, - esClient: coreContext.elasticsearch.client.asCurrentUser, - }); - - const { start, end, kuery, environment } = params.query; - - const services = await getServiceEntities({ - entitiesESClient, - start, - end, - kuery, - environment, - logger: resources.logger, - }); - return { services }; + return serviceEntitySummary; }, }); @@ -137,7 +103,6 @@ const serviceLogErrorRateTimeseriesRoute = createApmServerRoute({ }); export const servicesEntitiesRoutesRepository = { - ...servicesEntitiesRoute, ...serviceLogRateTimeseriesRoute, ...serviceLogErrorRateTimeseriesRoute, ...serviceEntitiesSummaryRoute, diff --git a/x-pack/plugins/observability_solution/apm/server/routes/entities/types.ts b/x-pack/plugins/observability_solution/apm/server/routes/entities/types.ts index 833e565ec00ef..c65af1a05a26a 100644 --- a/x-pack/plugins/observability_solution/apm/server/routes/entities/types.ts +++ b/x-pack/plugins/observability_solution/apm/server/routes/entities/types.ts @@ -4,28 +4,10 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { AgentName } from '../../../typings/es_schemas/ui/fields/agent'; +import type { EntityMetadata, EntityV2 } from '@kbn/entities-schema'; export enum EntityType { SERVICE = 'service', } -export interface EntityLatestServiceRaw { - agent: { - name: AgentName[]; - }; - source_data_stream: { - type: string[]; - }; - service: { - name: string; - environment?: string; - }; - entity: Entity; -} - -interface Entity { - id: string; - last_seen_timestamp: string; - identity_fields: string[]; -} +export type EntityLatestServiceRaw = EntityV2 & EntityMetadata; diff --git a/x-pack/plugins/observability_solution/apm/server/routes/entities/utils/merge_entities.test.ts b/x-pack/plugins/observability_solution/apm/server/routes/entities/utils/merge_entities.test.ts index e3dd0ef5e0d4e..91f1eff244def 100644 --- a/x-pack/plugins/observability_solution/apm/server/routes/entities/utils/merge_entities.test.ts +++ b/x-pack/plugins/observability_solution/apm/server/routes/entities/utils/merge_entities.test.ts @@ -13,17 +13,14 @@ describe('mergeEntities', () => { it('modifies one service', () => { const entities: EntityLatestServiceRaw[] = [ { - service: { - name: 'service-1', - environment: 'test', - }, - agent: { name: ['nodejs'] }, - source_data_stream: { type: ['metrics', 'logs'] }, - entity: { - last_seen_timestamp: '2024-06-05T10:34:40.810Z', - identity_fields: ['service.name', 'service.environment'], - id: 'service-1:test', - }, + 'data_stream.type': ['metrics', 'logs'], + 'agent.name': 'nodejs', + 'service.environment': 'test', + 'entity.last_seen_timestamp': '2024-12-13T14:52:35.461Z', + 'service.name': 'service-1', + 'entity.type': 'built_in_services_from_ecs_data', + 'entity.id': 'service-1', + 'entity.display_name': 'service-1', }, ]; const result = mergeEntities({ entities }); @@ -32,7 +29,7 @@ describe('mergeEntities', () => { agentName: 'nodejs' as AgentName, dataStreamTypes: ['metrics', 'logs'], environments: ['test'], - lastSeenTimestamp: '2024-06-05T10:34:40.810Z', + lastSeenTimestamp: '2024-12-13T14:52:35.461Z', serviceName: 'service-1', }, ]); @@ -41,56 +38,44 @@ describe('mergeEntities', () => { it('joins two service with the same name ', () => { const entities: EntityLatestServiceRaw[] = [ { - service: { - name: 'service-1', - environment: 'env-service-1', - }, - agent: { name: ['nodejs'] }, - source_data_stream: { type: ['foo'] }, - entity: { - last_seen_timestamp: '2024-03-05T10:34:40.810Z', - identity_fields: ['service.name', 'service.environment'], - id: 'service-1:env-service-1', - }, + 'data_stream.type': ['foo'], + 'agent.name': 'nodejs', + 'service.environment': 'env-service-1', + 'entity.last_seen_timestamp': '2024-12-13T14:52:35.461Z', + 'service.name': 'service-1', + 'entity.type': 'built_in_services_from_ecs_data', + 'entity.id': 'service-1:env-service-1', + 'entity.display_name': 'service-1', }, { - service: { - name: 'service-1', - environment: 'env-service-2', - }, - agent: { name: ['nodejs'] }, - source_data_stream: { type: ['bar'] }, - entity: { - last_seen_timestamp: '2024-03-05T10:34:40.810Z', - identity_fields: ['service.name', 'service.environment'], - id: 'apm-only-1:synthtrace-env-2', - }, + 'data_stream.type': ['bar'], + 'agent.name': 'nodejs', + 'service.environment': 'env-service-2', + 'entity.last_seen_timestamp': '2024-12-13T14:52:35.461Z', + 'service.name': 'service-1', + 'entity.type': 'built_in_services_from_ecs_data', + 'entity.id': 'service-1:env-service-2', + 'entity.display_name': 'service-1', }, { - service: { - name: 'service-2', - environment: 'env-service-3', - }, - agent: { name: ['java'] }, - source_data_stream: { type: ['baz'] }, - entity: { - last_seen_timestamp: '2024-06-05T10:34:40.810Z', - identity_fields: ['service.name', 'service.environment'], - id: 'service-2:env-service-3', - }, + 'data_stream.type': ['baz'], + 'agent.name': 'java', + 'service.environment': 'env-service-3', + 'entity.last_seen_timestamp': '2024-12-13T14:52:35.461Z', + 'service.name': 'service-2', + 'entity.type': 'built_in_services_from_ecs_data', + 'entity.id': 'service-2:env-service-3', + 'entity.display_name': 'service-2', }, { - service: { - name: 'service-2', - environment: 'env-service-4', - }, - agent: { name: ['java'] }, - source_data_stream: { type: ['baz'] }, - entity: { - last_seen_timestamp: '2024-06-05T10:34:40.810Z', - identity_fields: ['service.name', 'service.environment'], - id: 'service-2:env-service-3', - }, + 'data_stream.type': ['baz'], + 'agent.name': ['java'], + 'service.environment': 'env-service-4', + 'entity.last_seen_timestamp': '2024-12-13T14:52:35.461Z', + 'service.name': 'service-2', + 'entity.type': 'built_in_services_from_ecs_data', + 'entity.id': 'service-2:env-service-4', + 'entity.display_name': 'service-2', }, ]; @@ -100,14 +85,14 @@ describe('mergeEntities', () => { agentName: 'nodejs' as AgentName, dataStreamTypes: ['foo', 'bar'], environments: ['env-service-1', 'env-service-2'], - lastSeenTimestamp: '2024-03-05T10:34:40.810Z', + lastSeenTimestamp: '2024-12-13T14:52:35.461Z', serviceName: 'service-1', }, { agentName: 'java' as AgentName, dataStreamTypes: ['baz'], environments: ['env-service-3', 'env-service-4'], - lastSeenTimestamp: '2024-06-05T10:34:40.810Z', + lastSeenTimestamp: '2024-12-13T14:52:35.461Z', serviceName: 'service-2', }, ]); @@ -115,43 +100,34 @@ describe('mergeEntities', () => { it('handles duplicate environments and data streams', () => { const entities: EntityLatestServiceRaw[] = [ { - service: { - name: 'service-1', - environment: 'test', - }, - agent: { name: ['nodejs'] }, - source_data_stream: { type: ['metrics', 'logs'] }, - entity: { - last_seen_timestamp: '2024-06-05T10:34:40.810Z', - identity_fields: ['service.name', 'service.environment'], - id: 'service-1:test', - }, + 'data_stream.type': ['metrics', 'logs'], + 'agent.name': ['nodejs'], + 'service.environment': 'test', + 'entity.last_seen_timestamp': '2024-12-13T14:52:35.461Z', + 'service.name': 'service-1', + 'entity.type': 'built_in_services_from_ecs_data', + 'entity.id': 'service-1:test', + 'entity.display_name': 'service-1', }, { - service: { - name: 'service-1', - environment: 'test', - }, - agent: { name: ['nodejs'] }, - source_data_stream: { type: ['metrics', 'logs'] }, - entity: { - last_seen_timestamp: '2024-06-05T10:34:40.810Z', - identity_fields: ['service.name', 'service.environment'], - id: 'service-1:test', - }, + 'data_stream.type': ['metrics', 'logs'], + 'agent.name': ['nodejs'], + 'service.environment': 'test', + 'entity.last_seen_timestamp': '2024-12-13T14:52:35.461Z', + 'service.name': 'service-1', + 'entity.type': 'built_in_services_from_ecs_data', + 'entity.id': 'service-1:test', + 'entity.display_name': 'service-1', }, { - service: { - name: 'service-1', - environment: 'prod', - }, - agent: { name: ['nodejs'] }, - source_data_stream: { type: ['foo'] }, - entity: { - last_seen_timestamp: '2024-23-05T10:34:40.810Z', - identity_fields: ['service.name', 'service.environment'], - id: 'service-1:prod', - }, + 'data_stream.type': ['foo'], + 'agent.name': ['nodejs'], + 'service.environment': 'prod', + 'entity.last_seen_timestamp': '2024-12-13T14:52:35.461Z', + 'service.name': 'service-1', + 'entity.type': 'built_in_services_from_ecs_data', + 'entity.id': 'service-1:prod', + 'entity.display_name': 'service-1', }, ]; const result = mergeEntities({ entities }); @@ -160,7 +136,7 @@ describe('mergeEntities', () => { agentName: 'nodejs' as AgentName, dataStreamTypes: ['metrics', 'logs', 'foo'], environments: ['test', 'prod'], - lastSeenTimestamp: '2024-23-05T10:34:40.810Z', + lastSeenTimestamp: '2024-12-13T14:52:35.461Z', serviceName: 'service-1', }, ]); @@ -168,17 +144,14 @@ describe('mergeEntities', () => { it('handles null environment', () => { const entity: EntityLatestServiceRaw[] = [ { - service: { - name: 'service-1', - environment: undefined, - }, - agent: { name: ['nodejs'] }, - source_data_stream: { type: [] }, - entity: { - last_seen_timestamp: '2024-06-05T10:34:40.810Z', - identity_fields: ['service.name'], - id: 'service-1:test', - }, + 'data_stream.type': [], + 'agent.name': ['nodejs'], + 'service.environment': null, + 'entity.last_seen_timestamp': '2024-12-13T14:52:35.461Z', + 'service.name': 'service-1', + 'entity.type': 'built_in_services_from_ecs_data', + 'entity.id': 'service-1:test', + 'entity.display_name': 'service-1', }, ]; const entityResult = mergeEntities({ entities: entity }); @@ -187,35 +160,31 @@ describe('mergeEntities', () => { agentName: 'nodejs' as AgentName, dataStreamTypes: [], environments: [], - lastSeenTimestamp: '2024-06-05T10:34:40.810Z', + lastSeenTimestamp: '2024-12-13T14:52:35.461Z', serviceName: 'service-1', }, ]); const entities: EntityLatestServiceRaw[] = [ { - service: { - name: 'service-1', - }, - agent: { name: ['nodejs'] }, - source_data_stream: { type: [] }, - entity: { - last_seen_timestamp: '2024-06-05T10:34:40.810Z', - identity_fields: ['service.name'], - id: 'service-1:test', - }, + 'data_stream.type': [], + 'agent.name': ['nodejs'], + 'service.environment': null, + 'entity.last_seen_timestamp': '2024-12-13T14:52:35.461Z', + 'service.name': 'service-1', + 'entity.type': 'built_in_services_from_ecs_data', + 'entity.id': 'service-1:test', + 'entity.display_name': 'service-1', }, { - service: { - name: 'service-1', - }, - agent: { name: ['nodejs'] }, - source_data_stream: { type: [] }, - entity: { - last_seen_timestamp: '2024-06-05T10:34:40.810Z', - identity_fields: ['service.name'], - id: 'service-1:test', - }, + 'data_stream.type': [], + 'agent.name': ['nodejs'], + 'service.environment': null, + 'entity.last_seen_timestamp': '2024-12-13T14:52:35.461Z', + 'service.name': 'service-1', + 'entity.type': 'built_in_services_from_ecs_data', + 'entity.id': 'service-1:test', + 'entity.display_name': 'service-1', }, ]; const result = mergeEntities({ entities }); @@ -224,7 +193,7 @@ describe('mergeEntities', () => { agentName: 'nodejs' as AgentName, dataStreamTypes: [], environments: [], - lastSeenTimestamp: '2024-06-05T10:34:40.810Z', + lastSeenTimestamp: '2024-12-13T14:52:35.461Z', serviceName: 'service-1', }, ]); @@ -233,16 +202,13 @@ describe('mergeEntities', () => { it('handles undefined environment', () => { const entity: EntityLatestServiceRaw[] = [ { - service: { - name: 'service-1', - }, - agent: { name: ['nodejs'] }, - source_data_stream: { type: [] }, - entity: { - last_seen_timestamp: '2024-06-05T10:34:40.810Z', - identity_fields: ['service.name'], - id: 'service-1:test', - }, + 'data_stream.type': [], + 'agent.name': ['nodejs'], + 'entity.last_seen_timestamp': '2024-12-13T14:52:35.461Z', + 'service.name': 'service-1', + 'entity.type': 'built_in_services_from_ecs_data', + 'entity.id': 'service-1:test', + 'entity.display_name': 'service-1', }, ]; const entityResult = mergeEntities({ entities: entity }); @@ -251,35 +217,29 @@ describe('mergeEntities', () => { agentName: 'nodejs', dataStreamTypes: [], environments: [], - lastSeenTimestamp: '2024-06-05T10:34:40.810Z', + lastSeenTimestamp: '2024-12-13T14:52:35.461Z', serviceName: 'service-1', }, ]); const entities: EntityLatestServiceRaw[] = [ { - service: { - name: 'service-1', - }, - agent: { name: ['nodejs'] }, - source_data_stream: { type: [] }, - entity: { - last_seen_timestamp: '2024-06-05T10:34:40.810Z', - identity_fields: ['service.name'], - id: 'service-1:test', - }, + 'data_stream.type': [], + 'agent.name': ['nodejs'], + 'entity.last_seen_timestamp': '2024-12-13T14:52:35.461Z', + 'service.name': 'service-1', + 'entity.type': 'built_in_services_from_ecs_data', + 'entity.id': 'service-1:test', + 'entity.display_name': 'service-1', }, { - service: { - name: 'service-1', - }, - agent: { name: ['nodejs'] }, - source_data_stream: { type: [] }, - entity: { - last_seen_timestamp: '2024-06-05T10:34:40.810Z', - identity_fields: ['service.name'], - id: 'service-1:test', - }, + 'data_stream.type': [], + 'agent.name': ['nodejs'], + 'entity.last_seen_timestamp': '2024-12-13T14:52:35.461Z', + 'service.name': 'service-1', + 'entity.type': 'built_in_services_from_ecs_data', + 'entity.id': 'service-1:test', + 'entity.display_name': 'service-1', }, ]; const result = mergeEntities({ entities }); @@ -288,7 +248,7 @@ describe('mergeEntities', () => { agentName: 'nodejs', dataStreamTypes: [], environments: [], - lastSeenTimestamp: '2024-06-05T10:34:40.810Z', + lastSeenTimestamp: '2024-12-13T14:52:35.461Z', serviceName: 'service-1', }, ]); @@ -297,17 +257,14 @@ describe('mergeEntities', () => { it('has no logs when log rate is not returned', () => { const entities: EntityLatestServiceRaw[] = [ { - service: { - name: 'service-1', - environment: 'test', - }, - agent: { name: ['nodejs'] }, - source_data_stream: { type: ['metrics'] }, - entity: { - last_seen_timestamp: '2024-06-05T10:34:40.810Z', - identity_fields: ['service.name', 'service.environment'], - id: 'service-1:test', - }, + 'data_stream.type': ['metrics'], + 'agent.name': ['nodejs'], + 'entity.last_seen_timestamp': '2024-12-13T14:52:35.461Z', + 'service.name': 'service-1', + 'service.environment': 'test', + 'entity.type': 'built_in_services_from_ecs_data', + 'entity.id': 'service-1:test', + 'entity.display_name': 'service-1', }, ]; const result = mergeEntities({ entities }); @@ -316,7 +273,31 @@ describe('mergeEntities', () => { agentName: 'nodejs' as AgentName, dataStreamTypes: ['metrics'], environments: ['test'], - lastSeenTimestamp: '2024-06-05T10:34:40.810Z', + lastSeenTimestamp: '2024-12-13T14:52:35.461Z', + serviceName: 'service-1', + }, + ]); + }); + it('has multiple duplicate environments and data stream types', () => { + const entities: EntityLatestServiceRaw[] = [ + { + 'data_stream.type': ['metrics', 'metrics', 'logs', 'logs'], + 'agent.name': ['nodejs', 'nodejs'], + 'entity.last_seen_timestamp': '2024-12-13T14:52:35.461Z', + 'service.name': 'service-1', + 'service.environment': ['test', 'test', 'test'], + 'entity.type': 'built_in_services_from_ecs_data', + 'entity.id': 'service-1:test', + 'entity.display_name': 'service-1', + }, + ]; + const result = mergeEntities({ entities }); + expect(result).toEqual([ + { + agentName: 'nodejs' as AgentName, + dataStreamTypes: ['metrics', 'logs'], + environments: ['test'], + lastSeenTimestamp: '2024-12-13T14:52:35.461Z', serviceName: 'service-1', }, ]); diff --git a/x-pack/plugins/observability_solution/apm/server/routes/entities/utils/merge_entities.ts b/x-pack/plugins/observability_solution/apm/server/routes/entities/utils/merge_entities.ts index 2f33c4728bd1a..1e95656cb1f8e 100644 --- a/x-pack/plugins/observability_solution/apm/server/routes/entities/utils/merge_entities.ts +++ b/x-pack/plugins/observability_solution/apm/server/routes/entities/utils/merge_entities.ts @@ -23,7 +23,7 @@ export function mergeEntities({ entities: EntityLatestServiceRaw[]; }): MergedServiceEntity[] { const mergedEntities = entities.reduce((map, current) => { - const key = current.service.name; + const key = current['service.name']; if (map.has(key)) { const existingEntity = map.get(key); map.set(key, mergeFunc(current, existingEntity)); @@ -33,28 +33,37 @@ export function mergeEntities({ return map; }, new Map()); - return [...mergedEntities.values()]; + return [...new Set(mergedEntities.values())]; } function mergeFunc(entity: EntityLatestServiceRaw, existingEntity?: MergedServiceEntity) { const commonEntityFields = { - serviceName: entity.service.name, - agentName: entity.agent.name[0], - lastSeenTimestamp: entity.entity.last_seen_timestamp, + serviceName: entity['service.name'], + agentName: + Array.isArray(entity['agent.name']) && entity['agent.name'].length > 0 + ? entity['agent.name'][0] + : entity['agent.name'], + lastSeenTimestamp: entity['entity.last_seen_timestamp'], }; if (!existingEntity) { return { ...commonEntityFields, - dataStreamTypes: entity.source_data_stream.type, - environments: compact([entity?.service.environment]), + dataStreamTypes: uniq(entity['data_stream.type']), + environments: uniq( + compact( + Array.isArray(entity['service.environment']) + ? entity['service.environment'] + : [entity['service.environment']] + ) + ), }; } return { ...commonEntityFields, dataStreamTypes: uniq( - compact([...(existingEntity?.dataStreamTypes ?? []), ...entity.source_data_stream.type]) + compact([...(existingEntity?.dataStreamTypes ?? []), ...entity['data_stream.type']]) ), - environments: uniq(compact([...existingEntity?.environments, entity?.service.environment])), + environments: uniq(compact([...existingEntity?.environments, entity['service.environment']])), }; } diff --git a/x-pack/plugins/observability_solution/apm/server/routes/services/route.ts b/x-pack/plugins/observability_solution/apm/server/routes/services/route.ts index d6c3b5b73e3d8..71d570d2708f7 100644 --- a/x-pack/plugins/observability_solution/apm/server/routes/services/route.ts +++ b/x-pack/plugins/observability_solution/apm/server/routes/services/route.ts @@ -80,7 +80,6 @@ import { import { getThroughput, ServiceThroughputResponse } from './get_throughput'; import { getServiceEntitySummary } from '../entities/services/get_service_entity_summary'; import { ENVIRONMENT_ALL } from '../../../common/environment_filter_values'; -import { createEntitiesESClient } from '../../lib/helpers/create_es_client/create_entities_es_client/create_entities_es_client'; const servicesRoute = createApmServerRoute({ endpoint: 'GET /internal/apm/services', @@ -297,16 +296,11 @@ const serviceAgentRoute = createApmServerRoute({ }), security: { authz: { requiredPrivileges: ['apm'] } }, handler: async (resources): Promise<ServiceAgentResponse> => { - const { context, request } = resources; - const coreContext = await context.core; + const { request, plugins } = resources; + const entityManagerStart = await plugins.entityManager.start(); - const [apmEventClient, entitiesESClient] = await Promise.all([ - getApmEventClient(resources), - createEntitiesESClient({ - request, - esClient: coreContext.elasticsearch.client.asCurrentUser, - }), - ]); + const apmEventClient = await getApmEventClient(resources); + const entityManagerClient = await entityManagerStart.getScopedClient({ request }); const { params } = resources; const { serviceName } = params.path; const { start, end } = params.query; @@ -320,7 +314,7 @@ const serviceAgentRoute = createApmServerRoute({ }), getServiceEntitySummary({ serviceName, - entitiesESClient, + entityManagerClient, environment: ENVIRONMENT_ALL.value, }), ]); diff --git a/x-pack/plugins/observability_solution/apm/server/types.ts b/x-pack/plugins/observability_solution/apm/server/types.ts index e99860b9d441f..ba1d17d6af6b9 100644 --- a/x-pack/plugins/observability_solution/apm/server/types.ts +++ b/x-pack/plugins/observability_solution/apm/server/types.ts @@ -5,52 +5,50 @@ * 2.0. */ -import { SharePluginSetup } from '@kbn/share-plugin/server'; -import { Observable } from 'rxjs'; -import { - RuleRegistryPluginSetupContract, - RuleRegistryPluginStartContract, -} from '@kbn/rule-registry-plugin/server'; -import { - PluginSetup as DataPluginSetup, - PluginStart as DataPluginStart, -} from '@kbn/data-plugin/server'; -import { +import type { ApmDataAccessPluginSetup, ApmDataAccessPluginStart, } from '@kbn/apm-data-access-plugin/server'; - -import { SpacesPluginSetup, SpacesPluginStart } from '@kbn/spaces-plugin/server'; +import type { + PluginSetup as DataPluginSetup, + PluginStart as DataPluginStart, +} from '@kbn/data-plugin/server'; +import type { + RuleRegistryPluginSetupContract, + RuleRegistryPluginStartContract, +} from '@kbn/rule-registry-plugin/server'; +import type { SharePluginSetup } from '@kbn/share-plugin/server'; +import type { Observable } from 'rxjs'; +import type { ActionsPlugin } from '@kbn/actions-plugin/server'; +import type { CloudSetup } from '@kbn/cloud-plugin/server'; +import type { DataViewsServerPluginStart } from '@kbn/data-views-plugin/server'; +import type { FeaturesPluginSetup, FeaturesPluginStart } from '@kbn/features-plugin/server'; import { HomeServerPluginSetup, HomeServerPluginStart } from '@kbn/home-plugin/server'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; -import { ActionsPlugin } from '@kbn/actions-plugin/server'; import type { AlertingServerSetup, AlertingServerStart } from '@kbn/alerting-plugin/server'; -import { CloudSetup } from '@kbn/cloud-plugin/server'; -import { FeaturesPluginSetup, FeaturesPluginStart } from '@kbn/features-plugin/server'; import { LicensingPluginSetup, LicensingPluginStart } from '@kbn/licensing-plugin/server'; import { MlPluginSetup, MlPluginStart } from '@kbn/ml-plugin/server'; import { ObservabilityPluginSetup } from '@kbn/observability-plugin/server'; import { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/server'; -import { - TaskManagerSetupContract, - TaskManagerStartContract, -} from '@kbn/task-manager-plugin/server'; import { FleetSetupContract as FleetPluginSetup, FleetStartContract as FleetPluginStart, } from '@kbn/fleet-plugin/server'; -import { MetricsDataPluginSetup } from '@kbn/metrics-data-access-plugin/server'; -import { DataViewsServerPluginStart } from '@kbn/data-views-plugin/server'; - -import { +import type { MetricsDataPluginSetup } from '@kbn/metrics-data-access-plugin/server'; +import type { SpacesPluginSetup, SpacesPluginStart } from '@kbn/spaces-plugin/server'; +import type { + TaskManagerSetupContract, + TaskManagerStartContract, +} from '@kbn/task-manager-plugin/server'; +import type { CustomIntegrationsPluginSetup, CustomIntegrationsPluginStart, } from '@kbn/custom-integrations-plugin/server'; -import { - ProfilingDataAccessPluginSetup, - ProfilingDataAccessPluginStart, -} from '@kbn/profiling-data-access-plugin/server'; -import { +import type { + EntityManagerServerPluginSetup, + EntityManagerServerPluginStart, +} from '@kbn/entityManager-plugin/server'; +import type { LogsDataAccessPluginSetup, LogsDataAccessPluginStart, } from '@kbn/logs-data-access-plugin/server'; @@ -58,6 +56,10 @@ import type { ObservabilityAIAssistantServerSetup, ObservabilityAIAssistantServerStart, } from '@kbn/observability-ai-assistant-plugin/server'; +import type { + ProfilingDataAccessPluginSetup, + ProfilingDataAccessPluginStart, +} from '@kbn/profiling-data-access-plugin/server'; import { APMConfig } from '.'; export interface APMPluginSetup { @@ -75,8 +77,10 @@ export interface APMPluginSetupDependencies { metricsDataAccess: MetricsDataPluginSetup; dataViews: {}; share: SharePluginSetup; - observabilityAIAssistant?: ObservabilityAIAssistantServerSetup; + logsDataAccess: LogsDataAccessPluginSetup; + entityManager: EntityManagerServerPluginSetup; // optional dependencies + observabilityAIAssistant?: ObservabilityAIAssistantServerSetup; actions?: ActionsPlugin['setup']; alerting?: AlertingServerSetup; cloud?: CloudSetup; @@ -89,7 +93,6 @@ export interface APMPluginSetupDependencies { usageCollection?: UsageCollectionSetup; customIntegrations?: CustomIntegrationsPluginSetup; profilingDataAccess?: ProfilingDataAccessPluginSetup; - logsDataAccess: LogsDataAccessPluginSetup; } export interface APMPluginStartDependencies { // required dependencies @@ -102,8 +105,10 @@ export interface APMPluginStartDependencies { metricsDataAccess: MetricsDataPluginSetup; dataViews: DataViewsServerPluginStart; share: undefined; - observabilityAIAssistant?: ObservabilityAIAssistantServerStart; + logsDataAccess: LogsDataAccessPluginStart; + entityManager: EntityManagerServerPluginStart; // optional dependencies + observabilityAIAssistant?: ObservabilityAIAssistantServerStart; actions?: ActionsPlugin['start']; alerting?: AlertingServerStart; cloud?: undefined; @@ -116,5 +121,4 @@ export interface APMPluginStartDependencies { usageCollection?: undefined; customIntegrations?: CustomIntegrationsPluginStart; profilingDataAccess?: ProfilingDataAccessPluginStart; - logsDataAccess: LogsDataAccessPluginStart; } diff --git a/x-pack/plugins/observability_solution/apm/tsconfig.json b/x-pack/plugins/observability_solution/apm/tsconfig.json index b2fda13c3f76f..82dd827086033 100644 --- a/x-pack/plugins/observability_solution/apm/tsconfig.json +++ b/x-pack/plugins/observability_solution/apm/tsconfig.json @@ -129,6 +129,7 @@ "@kbn/alerting-comparators", "@kbn/saved-search-component", "@kbn/saved-search-plugin", + "@kbn/entityManager-plugin", ], "exclude": ["target/**/*"] } diff --git a/x-pack/plugins/observability_solution/apm_data_access/server/lib/helpers/create_es_client/create_apm_event_client/index.test.ts b/x-pack/plugins/observability_solution/apm_data_access/server/lib/helpers/create_es_client/create_apm_event_client/index.test.ts index a349c7c48f687..79084daeb22e6 100644 --- a/x-pack/plugins/observability_solution/apm_data_access/server/lib/helpers/create_es_client/create_apm_event_client/index.test.ts +++ b/x-pack/plugins/observability_solution/apm_data_access/server/lib/helpers/create_es_client/create_apm_event_client/index.test.ts @@ -47,34 +47,46 @@ describe('APMEventClient', () => { const router = createRouter('/'); let abortSignal: AbortSignal | undefined; - router.get({ path: '/', validate: false }, async (context, request, res) => { - const eventClient = new APMEventClient({ - esClient: { - search: async (params: any, { signal }: { signal: AbortSignal }) => { - abortSignal = signal; - await setTimeoutPromise(3_000, undefined, { - signal: abortSignal, - }); - return {}; + router.get( + { + path: '/', + security: { + authz: { + enabled: false, + reason: 'This route is opted out from authorization', }, - } as any, - debug: false, - request, - indices: {} as APMIndices, - options: { - includeFrozen: false, }, - }); + validate: false, + }, + async (context, request, res) => { + const eventClient = new APMEventClient({ + esClient: { + search: async (params: any, { signal }: { signal: AbortSignal }) => { + abortSignal = signal; + await setTimeoutPromise(3_000, undefined, { + signal: abortSignal, + }); + return {}; + }, + } as any, + debug: false, + request, + indices: {} as APMIndices, + options: { + includeFrozen: false, + }, + }); - await eventClient.search('foo', { - apm: { - events: [], - }, - body: { size: 0, track_total_hits: false }, - }); + await eventClient.search('foo', { + apm: { + events: [], + }, + body: { size: 0, track_total_hits: false }, + }); - return res.ok({ body: 'ok' }); - }); + return res.ok({ body: 'ok' }); + } + ); await server.start(); diff --git a/x-pack/plugins/observability_solution/infra/public/alerting/log_threshold/components/alert_details_app_section/components/threhsold_chart/create_lens_definition.ts b/x-pack/plugins/observability_solution/infra/public/alerting/log_threshold/components/alert_details_app_section/components/threhsold_chart/create_lens_definition.ts index ab3bc5f72bbfa..a6feb02a2bc61 100644 --- a/x-pack/plugins/observability_solution/infra/public/alerting/log_threshold/components/alert_details_app_section/components/threhsold_chart/create_lens_definition.ts +++ b/x-pack/plugins/observability_solution/infra/public/alerting/log_threshold/components/alert_details_app_section/components/threhsold_chart/create_lens_definition.ts @@ -78,7 +78,7 @@ function createBaseLensDefinition<D extends {}>( yConfig: [ { forAccessor: '607b2253-ed20-4f0a-bf62-07a1f846cca4', - color: '#6092c0', + color: euiTheme.colors.vis.euiColorVis2, }, ], }, diff --git a/x-pack/plugins/observability_solution/infra/public/alerting/metric_threshold/components/__snapshots__/alert_details_app_section.test.tsx.snap b/x-pack/plugins/observability_solution/infra/public/alerting/metric_threshold/components/__snapshots__/alert_details_app_section.test.tsx.snap index af8a5b3d8e0a9..0df66d4c3dca3 100644 --- a/x-pack/plugins/observability_solution/infra/public/alerting/metric_threshold/components/__snapshots__/alert_details_app_section.test.tsx.snap +++ b/x-pack/plugins/observability_solution/infra/public/alerting/metric_threshold/components/__snapshots__/alert_details_app_section.test.tsx.snap @@ -17,7 +17,7 @@ Array [ "type": "manual", }, Object { - "color": "#F04E9833", + "color": "rgba(189,39,30,0.2)", "id": "metric_threshold_active_alert_range_annotation", "key": Object { "endTimestamp": "2024-06-13T07:00:33.381Z", diff --git a/x-pack/plugins/observability_solution/infra/public/alerting/metric_threshold/components/alert_details_app_section.tsx b/x-pack/plugins/observability_solution/infra/public/alerting/metric_threshold/components/alert_details_app_section.tsx index 8f3e22c5b8a84..b23bfe38d1d39 100644 --- a/x-pack/plugins/observability_solution/infra/public/alerting/metric_threshold/components/alert_details_app_section.tsx +++ b/x-pack/plugins/observability_solution/infra/public/alerting/metric_threshold/components/alert_details_app_section.tsx @@ -18,7 +18,6 @@ import { transparentize, useEuiTheme, } from '@elastic/eui'; -import chroma from 'chroma-js'; import { RuleConditionChart, TopAlert } from '@kbn/observability-plugin/public'; import { ALERT_END, ALERT_START, ALERT_EVALUATION_VALUES, ALERT_GROUP } from '@kbn/rule-data-utils'; @@ -90,7 +89,7 @@ export function AlertDetailsAppSection({ alert, rule }: AppSectionProps) { timestamp: alertStart!, endTimestamp: alertEnd ?? moment().toISOString(), }, - color: chroma(transparentize('#F04E981A', 0.2)).hex().toUpperCase(), + color: transparentize(euiTheme.colors.danger, 0.2), id: `metric_threshold_${alertEnd ? 'recovered' : 'active'}_alert_range_annotation`, }; diff --git a/x-pack/plugins/observability_solution/infra/public/components/log_stream/log_stream_react_embeddable.tsx b/x-pack/plugins/observability_solution/infra/public/components/log_stream/log_stream_react_embeddable.tsx index 43382cf37203b..f5fee9d94ea0e 100644 --- a/x-pack/plugins/observability_solution/infra/public/components/log_stream/log_stream_react_embeddable.tsx +++ b/x-pack/plugins/observability_solution/infra/public/components/log_stream/log_stream_react_embeddable.tsx @@ -142,8 +142,8 @@ const DeprecationCallout = () => { target="_blank" > {i18n.translate( - 'xpack.infra.logsStreamEmbeddable.deprecationWarningDescription.savedSearchesLinkLabel', - { defaultMessage: 'saved searches' } + 'xpack.infra.logsStreamEmbeddable.deprecationWarningDescription.discoverSessionsLinkLabel', + { defaultMessage: 'Discover sessions' } )} </EuiLink> ), diff --git a/x-pack/plugins/observability_solution/infra/public/components/logging/log_minimap/density_chart.tsx b/x-pack/plugins/observability_solution/infra/public/components/logging/log_minimap/density_chart.tsx index 5f42d19d035d5..d45fe0c3c42c3 100644 --- a/x-pack/plugins/observability_solution/infra/public/components/logging/log_minimap/density_chart.tsx +++ b/x-pack/plugins/observability_solution/infra/public/components/logging/log_minimap/density_chart.tsx @@ -11,6 +11,7 @@ import { max } from 'lodash'; import * as React from 'react'; import styled from '@emotion/styled'; import { LogEntriesSummaryBucket } from '@kbn/logs-shared-plugin/common'; +import { COLOR_MODES_STANDARD } from '@elastic/eui'; interface DensityChartProps { buckets: LogEntriesSummaryBucket[]; @@ -66,14 +67,14 @@ export const DensityChart: React.FC<DensityChartProps> = ({ const DensityChartPositiveBackground = styled.rect` fill: ${(props) => - props.theme.colorMode === 'DARK' + props.theme.colorMode === COLOR_MODES_STANDARD.dark ? props.theme.euiTheme.colors.lightShade : props.theme.euiTheme.colors.lightestShade}; `; const PositiveAreaPath = styled.path` fill: ${(props) => - props.theme.colorMode === 'DARK' + props.theme.colorMode === COLOR_MODES_STANDARD.dark ? props.theme.euiTheme.colors.mediumShade : props.theme.euiTheme.colors.lightShade}; `; diff --git a/x-pack/plugins/observability_solution/infra/public/components/logging/log_minimap/log_minimap.tsx b/x-pack/plugins/observability_solution/infra/public/components/logging/log_minimap/log_minimap.tsx index fcd57e98b07d4..a2c1121ff2ba0 100644 --- a/x-pack/plugins/observability_solution/infra/public/components/logging/log_minimap/log_minimap.tsx +++ b/x-pack/plugins/observability_solution/infra/public/components/logging/log_minimap/log_minimap.tsx @@ -14,6 +14,7 @@ import { import { scaleLinear } from 'd3-scale'; import moment from 'moment'; import * as React from 'react'; +import { COLOR_MODES_STANDARD } from '@elastic/eui'; import { DensityChart } from './density_chart'; import { HighlightedInterval } from './highlighted_interval'; import { SearchMarkers } from './search_markers'; @@ -166,7 +167,7 @@ const TimeCursor = styled.line` pointer-events: none; stroke-width: 1px; stroke: ${(props) => - props.theme.colorMode === 'DARK' + props.theme.colorMode === COLOR_MODES_STANDARD.dark ? props.theme.euiTheme.colors.darkestShade : props.theme.euiTheme.colors.darkShade}; `; diff --git a/x-pack/plugins/observability_solution/infra/public/components/logging/log_minimap/time_ruler.tsx b/x-pack/plugins/observability_solution/infra/public/components/logging/log_minimap/time_ruler.tsx index 1223e014fe9e6..59e94333e94ee 100644 --- a/x-pack/plugins/observability_solution/infra/public/components/logging/log_minimap/time_ruler.tsx +++ b/x-pack/plugins/observability_solution/infra/public/components/logging/log_minimap/time_ruler.tsx @@ -8,7 +8,7 @@ import { scaleTime } from 'd3-scale'; import * as React from 'react'; import styled from '@emotion/styled'; -import { useEuiFontSize } from '@elastic/eui'; +import { COLOR_MODES_STANDARD, useEuiFontSize } from '@elastic/eui'; import { useKibanaTimeZoneSetting } from '../../../hooks/use_kibana_time_zone_setting'; import { getTimeLabelFormat } from './time_label_formatter'; @@ -69,7 +69,7 @@ const TimeRulerTickLabel = styled.text` const TimeRulerGridLine = styled.line` stroke: ${(props) => - props.theme.colorMode === 'DARK' + props.theme.colorMode === COLOR_MODES_STANDARD.dark ? props.theme.euiTheme.colors.darkestShade : props.theme.euiTheme.colors.darkShade}; stroke-opacity: 0.5; diff --git a/x-pack/plugins/observability_solution/infra/public/hooks/use_entity_centric_experience_setting.tsx b/x-pack/plugins/observability_solution/infra/public/hooks/use_entity_centric_experience_setting.tsx index 1cbc4680405e4..1ac6eed88f2ad 100644 --- a/x-pack/plugins/observability_solution/infra/public/hooks/use_entity_centric_experience_setting.tsx +++ b/x-pack/plugins/observability_solution/infra/public/hooks/use_entity_centric_experience_setting.tsx @@ -11,7 +11,7 @@ import { useKibanaContextForPlugin } from './use_kibana'; export function useEntityCentricExperienceSetting() { const { uiSettings } = useKibanaContextForPlugin().services; - const isEntityCentricExperienceEnabled = uiSettings.get<boolean>(entityCentricExperience, true); + const isEntityCentricExperienceEnabled = uiSettings.get<boolean>(entityCentricExperience); return { isEntityCentricExperienceEnabled }; } diff --git a/x-pack/plugins/observability_solution/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx b/x-pack/plugins/observability_solution/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx index 0697b05205fea..a40bab58d70fa 100644 --- a/x-pack/plugins/observability_solution/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx +++ b/x-pack/plugins/observability_solution/infra/public/pages/metrics/inventory_view/components/timeline/timeline.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import moment from 'moment'; import { first, last } from 'lodash'; -import { EuiLoadingChart, EuiText, EuiEmptyPrompt, EuiButton } from '@elastic/eui'; +import { EuiLoadingChart, EuiText, EuiEmptyPrompt, EuiButton, useEuiTheme } from '@elastic/eui'; import { Axis, Chart, @@ -56,7 +56,7 @@ export const Timeline: React.FC<Props> = ({ interval, yAxisFormatter, isVisible const { metric, nodeType, accountId, region } = useWaffleOptionsContext(); const { currentTime, jumpToTime, stopAutoReload } = useWaffleTimeContext(); const { filterQueryAsJson } = useWaffleFiltersContext(); - + const { euiTheme } = useEuiTheme(); const chartTheme = useTimelineChartTheme(); const { loading, error, startTime, endTime, timeseries, reload } = useTimeline( @@ -238,7 +238,11 @@ export const Timeline: React.FC<Props> = ({ interval, yAxisFormatter, isVisible <EuiFlexGroup gutterSize={'s'} alignItems={'center'} responsive={false}> <EuiFlexItem grow={false} - style={{ backgroundColor: '#D36086', height: 5, width: 10 }} + style={{ + backgroundColor: euiTheme.colors.backgroundFilledAccent, + height: 5, + width: 10, + }} /> <EuiFlexItem> <EuiText size={'xs'}> @@ -261,7 +265,7 @@ export const Timeline: React.FC<Props> = ({ interval, yAxisFormatter, isVisible dataValues={generateAnnotationData( anomalies.map((a) => [a.startTime, a.influencers]) )} - style={{ fill: '#D36086' }} + style={{ fill: euiTheme.colors.backgroundFilledAccent }} /> )} <MetricExplorerSeriesChart diff --git a/x-pack/plugins/observability_solution/infra/public/plugin.ts b/x-pack/plugins/observability_solution/infra/public/plugin.ts index c8217794acf70..f9825915a6815 100644 --- a/x-pack/plugins/observability_solution/infra/public/plugin.ts +++ b/x-pack/plugins/observability_solution/infra/public/plugin.ts @@ -19,7 +19,6 @@ import { i18n } from '@kbn/i18n'; import { METRICS_EXPLORER_LOCATOR_ID, MetricsExplorerLocatorParams, - ObservabilityTriggerId, } from '@kbn/observability-shared-plugin/common'; import { BehaviorSubject, @@ -101,10 +100,6 @@ export class Plugin implements InfraClientPluginClass { registerFeatures(pluginsSetup.home); } - pluginsSetup.uiActions.registerTrigger({ - id: ObservabilityTriggerId.LogEntryContextMenu, - }); - const assetDetailsLocator = pluginsSetup.share.url.locators.get<AssetDetailsLocatorParams>(ASSET_DETAILS_LOCATOR_ID); const inventoryLocator = @@ -358,7 +353,7 @@ export class Plugin implements InfraClientPluginClass { getDisplayNameTooltip: () => i18n.translate('xpack.infra.logStreamEmbeddable.description', { defaultMessage: - 'Add a table of live streaming logs. For a more efficient experience, we recommend using the Discover Page to create a saved search instead of using Log stream.', + 'Add a table of live streaming logs. For a more efficient experience, we recommend using the Discover Page to create a saved Discover session instead of using Log stream.', }), getIconType: () => 'logsApp', isCompatible: async ({ embeddable }) => { diff --git a/x-pack/plugins/observability_solution/infra/server/routes/entities/get_data_stream_types.test.ts b/x-pack/plugins/observability_solution/infra/server/routes/entities/get_data_stream_types.test.ts index 75048ac22a6a8..4a1466b698c78 100644 --- a/x-pack/plugins/observability_solution/infra/server/routes/entities/get_data_stream_types.test.ts +++ b/x-pack/plugins/observability_solution/infra/server/routes/entities/get_data_stream_types.test.ts @@ -35,13 +35,13 @@ describe('getDataStreamTypes', () => { jest.clearAllMocks(); }); - it('should return only metrics when entityCentriExperienceEnabled is false and hasMetricsData is true', async () => { + it('should return only metrics when entityCentricExperienceEnabled is false and hasMetricsData is true', async () => { (getHasMetricsData as jest.Mock).mockResolvedValue(true); const params = { entityId: 'entity123', entityType: 'host' as EntityType, - entityCentriExperienceEnabled: false, + entityCentricExperienceEnabled: false, infraMetricsClient, obsEsClient, entityManagerClient, @@ -58,13 +58,13 @@ describe('getDataStreamTypes', () => { }); }); - it('should return an empty array when entityCentriExperienceEnabled is false and hasMetricsData is false', async () => { + it('should return an empty array when entityCentricExperienceEnabled is false and hasMetricsData is false', async () => { (getHasMetricsData as jest.Mock).mockResolvedValue(false); const params = { entityId: 'entity123', entityType: 'container' as EntityType, - entityCentriExperienceEnabled: false, + entityCentricExperienceEnabled: false, infraMetricsClient, obsEsClient, entityManagerClient, @@ -75,7 +75,7 @@ describe('getDataStreamTypes', () => { expect(result).toEqual([]); }); - it('should return metrics and entity source_data_stream types when entityCentriExperienceEnabled is true and has entity data', async () => { + it('should return metrics and entity source_data_stream types when entityCentricExperienceEnabled is true and has entity data', async () => { (getHasMetricsData as jest.Mock).mockResolvedValue(true); (getLatestEntity as jest.Mock).mockResolvedValue({ sourceDataStreamType: ['logs', 'metrics'], @@ -84,7 +84,7 @@ describe('getDataStreamTypes', () => { const params = { entityId: 'entity123', entityType: 'host' as EntityType, - entityCentriExperienceEnabled: true, + entityCentricExperienceEnabled: true, infraMetricsClient, obsEsClient, entityManagerClient, @@ -104,14 +104,14 @@ describe('getDataStreamTypes', () => { }); }); - it('should return only metrics when entityCentriExperienceEnabled is true but entity data is undefined', async () => { + it('should return only metrics when entityCentricExperienceEnabled is true but entity data is undefined', async () => { (getHasMetricsData as jest.Mock).mockResolvedValue(true); (getLatestEntity as jest.Mock).mockResolvedValue(undefined); const params = { entityId: 'entity123', entityType: 'host' as EntityType, - entityCentriExperienceEnabled: true, + entityCentricExperienceEnabled: true, infraMetricsClient, obsEsClient, entityManagerClient, @@ -131,7 +131,7 @@ describe('getDataStreamTypes', () => { const params = { entityId: 'entity123', entityType: 'host' as EntityType, - entityCentriExperienceEnabled: true, + entityCentricExperienceEnabled: true, infraMetricsClient, obsEsClient, entityManagerClient, diff --git a/x-pack/plugins/observability_solution/infra/server/routes/entities/get_data_stream_types.ts b/x-pack/plugins/observability_solution/infra/server/routes/entities/get_data_stream_types.ts index 4a949de4d0ed7..d1cd99be31f9f 100644 --- a/x-pack/plugins/observability_solution/infra/server/routes/entities/get_data_stream_types.ts +++ b/x-pack/plugins/observability_solution/infra/server/routes/entities/get_data_stream_types.ts @@ -18,7 +18,7 @@ import { getLatestEntity } from './get_latest_entity'; interface Params { entityId: string; entityType: 'host' | 'container'; - entityCentriExperienceEnabled: boolean; + entityCentricExperienceEnabled: boolean; infraMetricsClient: InfraMetricsClient; obsEsClient: ObservabilityElasticsearchClient; entityManagerClient: EntityClient; @@ -26,7 +26,7 @@ interface Params { } export async function getDataStreamTypes({ - entityCentriExperienceEnabled, + entityCentricExperienceEnabled, entityId, entityManagerClient, entityType, @@ -42,7 +42,7 @@ export async function getDataStreamTypes({ const sourceDataStreams = new Set(hasMetricsData ? [EntityDataStreamType.METRICS] : []); - if (!entityCentriExperienceEnabled) { + if (!entityCentricExperienceEnabled) { return Array.from(sourceDataStreams); } diff --git a/x-pack/plugins/observability_solution/infra/server/routes/entities/index.ts b/x-pack/plugins/observability_solution/infra/server/routes/entities/index.ts index 4056faba9427e..9c5c5c4527fee 100644 --- a/x-pack/plugins/observability_solution/infra/server/routes/entities/index.ts +++ b/x-pack/plugins/observability_solution/infra/server/routes/entities/index.ts @@ -54,13 +54,13 @@ export const initEntitiesConfigurationRoutes = (libs: InfraBackendLibs) => { plugin: `@kbn/${METRICS_APP_ID}-plugin`, }); - const entityCentriExperienceEnabled = await coreContext.uiSettings.client.get( + const entityCentricExperienceEnabled = await coreContext.uiSettings.client.get( entityCentricExperience ); try { const sourceDataStreamTypes = await getDataStreamTypes({ - entityCentriExperienceEnabled, + entityCentricExperienceEnabled, entityId, entityManagerClient, entityType, diff --git a/x-pack/plugins/observability_solution/infra/tsconfig.json b/x-pack/plugins/observability_solution/infra/tsconfig.json index dd3e56903ea5d..639780d61ae82 100644 --- a/x-pack/plugins/observability_solution/infra/tsconfig.json +++ b/x-pack/plugins/observability_solution/infra/tsconfig.json @@ -9,7 +9,6 @@ "public/**/*", "server/**/*", "types/**/*", - "./emotion.d.ts" ], "kbn_references": [ "@kbn/core", diff --git a/x-pack/plugins/observability_solution/inventory/e2e/cypress/e2e/alert_count/alert_count.cy.ts b/x-pack/plugins/observability_solution/inventory/e2e/cypress/e2e/alert_count/alert_count.cy.ts index ac5fa17ecb08a..525828de10b18 100644 --- a/x-pack/plugins/observability_solution/inventory/e2e/cypress/e2e/alert_count/alert_count.cy.ts +++ b/x-pack/plugins/observability_solution/inventory/e2e/cypress/e2e/alert_count/alert_count.cy.ts @@ -33,10 +33,15 @@ const verifyAlertsTableCount = (alertsCount: string) => { verifyNumber(cy.getByTestSubj('toolbar-alerts-count'), alertsCount); }; -describe('Alert count', () => { +// Temporary skipping those test, will be enabled in the future once we fix them https://github.com/elastic/kibana/issues/204558 +describe.skip('Alert count', () => { beforeEach(() => { cy.loginAsSuperUser(); + cy.updateAdvancedSettings({ + 'observability:entityCentricExperience': true, + }); + cy.intercept('GET', '/internal/entities/managed/enablement', { fixture: 'eem_enabled.json', }).as('getEEMStatus'); @@ -49,6 +54,9 @@ describe('Alert count', () => { }); afterEach(() => { + cy.updateAdvancedSettings({ + 'observability:entityCentricExperience': false, + }); entitiesSynthtrace.clean(); cleanEntityAlerts(); }); diff --git a/x-pack/plugins/observability_solution/inventory/e2e/cypress/e2e/home.cy.ts b/x-pack/plugins/observability_solution/inventory/e2e/cypress/e2e/home.cy.ts index c2e7f1232e6aa..e86c673c2a6b7 100644 --- a/x-pack/plugins/observability_solution/inventory/e2e/cypress/e2e/home.cy.ts +++ b/x-pack/plugins/observability_solution/inventory/e2e/cypress/e2e/home.cy.ts @@ -11,9 +11,29 @@ import { generateEntities, generateLogs, generateTraces } from './generate_data' const start = '2024-10-16T00:00:00.000Z'; const end = '2024-10-16T00:15:00.000Z'; -describe('Home page', () => { +// Temporary skipping those test, will be enabled in the future once we fix them https://github.com/elastic/kibana/issues/204558 +describe.skip('Home page', () => { beforeEach(() => { cy.loginAsSuperUser(); + cy.updateAdvancedSettings({ + 'observability:entityCentricExperience': true, + }); + }); + + afterEach(() => { + cy.updateAdvancedSettings({ + 'observability:entityCentricExperience': false, + }); + }); + + describe('When the entityCentricExperience FF is disabled', () => { + it('Shows 404', () => { + cy.updateAdvancedSettings({ + 'observability:entityCentricExperience': false, + }); + cy.visitKibana('/app/inventory'); + cy.contains('Application Not Found'); + }); }); describe('When EEM is disabled', () => { diff --git a/x-pack/plugins/observability_solution/inventory/e2e/cypress/support/commands.ts b/x-pack/plugins/observability_solution/inventory/e2e/cypress/support/commands.ts index c3462f8b6ff18..9a260519c7608 100644 --- a/x-pack/plugins/observability_solution/inventory/e2e/cypress/support/commands.ts +++ b/x-pack/plugins/observability_solution/inventory/e2e/cypress/support/commands.ts @@ -55,3 +55,17 @@ Cypress.Commands.add( ); } ); + +Cypress.Commands.add('updateAdvancedSettings', (settings: Record<string, unknown>) => { + const kibanaUrl = Cypress.env('KIBANA_URL'); + cy.request({ + log: false, + method: 'POST', + url: `${kibanaUrl}/internal/kibana/settings`, + body: { changes: settings }, + headers: { + 'kbn-xsrf': 'e2e_test', + }, + auth: { user: 'elastic', pass: 'changeme' }, + }); +}); diff --git a/x-pack/plugins/observability_solution/inventory/e2e/cypress/support/types.d.ts b/x-pack/plugins/observability_solution/inventory/e2e/cypress/support/types.d.ts index c51b20c3b9904..8e49da093612f 100644 --- a/x-pack/plugins/observability_solution/inventory/e2e/cypress/support/types.d.ts +++ b/x-pack/plugins/observability_solution/inventory/e2e/cypress/support/types.d.ts @@ -13,6 +13,7 @@ declare namespace Cypress { password: string; }): Cypress.Chainable<Cypress.Response<any>>; getByTestSubj(selector: string): Chainable<JQuery<Element>>; + updateAdvancedSettings(settings: Record<string, unknown>): void; visitKibana(url: string): void; } } diff --git a/x-pack/plugins/observability_solution/inventory/public/plugin.ts b/x-pack/plugins/observability_solution/inventory/public/plugin.ts index 109123859d4ca..0d9309d3694fb 100644 --- a/x-pack/plugins/observability_solution/inventory/public/plugin.ts +++ b/x-pack/plugins/observability_solution/inventory/public/plugin.ts @@ -57,7 +57,7 @@ export class InventoryPlugin const inventoryAPIClient = createCallInventoryAPI(coreSetup); const isEntityCentricExperienceSettingEnabled = coreSetup.uiSettings.get<boolean>( 'observability:entityCentricExperience', - true + false ); this.telemetry.setup({ diff --git a/x-pack/plugins/observability_solution/logs_data_access/kibana.jsonc b/x-pack/plugins/observability_solution/logs_data_access/kibana.jsonc index 02fcff85404a0..f3eccc1c0c154 100644 --- a/x-pack/plugins/observability_solution/logs_data_access/kibana.jsonc +++ b/x-pack/plugins/observability_solution/logs_data_access/kibana.jsonc @@ -1,13 +1,17 @@ { "type": "plugin", "id": "@kbn/logs-data-access-plugin", - "owner": ["@elastic/obs-ux-logs-team"], + "owner": [ + "@elastic/obs-ux-logs-team" + ], + "group": "platform", + "visibility": "shared", "plugin": { "id": "logsDataAccess", "server": true, "browser": true, "requiredPlugins": [ - "data", + "data", "dataViews" ], "optionalPlugins": [], diff --git a/x-pack/plugins/observability_solution/logs_shared/kibana.jsonc b/x-pack/plugins/observability_solution/logs_shared/kibana.jsonc index e6ee1a22edc05..46aa8f451260d 100644 --- a/x-pack/plugins/observability_solution/logs_shared/kibana.jsonc +++ b/x-pack/plugins/observability_solution/logs_shared/kibana.jsonc @@ -2,12 +2,17 @@ "type": "plugin", "id": "@kbn/logs-shared-plugin", "owner": "@elastic/obs-ux-logs-team", + "group": "platform", + "visibility": "shared", "description": "Exposes the shared components and APIs to access and visualize logs.", "plugin": { "id": "logsShared", "server": true, "browser": true, - "configPath": ["xpack", "logs_shared"], + "configPath": [ + "xpack", + "logs_shared" + ], "requiredPlugins": [ "charts", "data", @@ -15,16 +20,21 @@ "dataViews", "discoverShared", "logsDataAccess", - "observabilityShared", "share", "spaces", + "uiActions", "usageCollection", "embeddable", ], "optionalPlugins": [ "observabilityAIAssistant", ], - "requiredBundles": ["kibanaUtils", "kibanaReact"], - "extraPublicDirs": ["common"] + "requiredBundles": [ + "kibanaUtils", + "kibanaReact" + ], + "extraPublicDirs": [ + "common" + ] } } diff --git a/x-pack/plugins/observability_solution/logs_shared/public/components/log_stream/log_stream.tsx b/x-pack/plugins/observability_solution/logs_shared/public/components/log_stream/log_stream.tsx index f82e9436fe5cd..8d33fe4b5d343 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/components/log_stream/log_stream.tsx +++ b/x-pack/plugins/observability_solution/logs_shared/public/components/log_stream/log_stream.tsx @@ -10,19 +10,19 @@ import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; import { buildEsQuery, Filter, Query } from '@kbn/es-query'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { useKibana } from '@kbn/kibana-react-plugin/public'; +import type { LogsDataAccessPluginStart } from '@kbn/logs-data-access-plugin/public'; import type { SharePluginStart } from '@kbn/share-plugin/public'; import { JsonValue } from '@kbn/utility-types'; import { noop } from 'lodash'; import React, { useCallback, useEffect, useMemo } from 'react'; import usePrevious from 'react-use/lib/usePrevious'; -import type { LogsDataAccessPluginStart } from '@kbn/logs-data-access-plugin/public'; -import { useKibanaQuerySettings } from '@kbn/observability-shared-plugin/public'; import { LogEntryCursor } from '../../../common/log_entry'; import { defaultLogViewsStaticConfig, LogViewReference } from '../../../common/log_views'; import { BuiltEsQuery, useLogStream } from '../../containers/logs/log_stream'; import { useLogView } from '../../hooks/use_log_view'; import { LogViewsClient } from '../../services/log_views'; import { LogColumnRenderConfiguration } from '../../utils/log_column_render_configuration'; +import { useKibanaQuerySettings } from '../../utils/use_kibana_query_settings'; import { useLogEntryFlyout } from '../logging/log_entry_flyout'; import { ScrollableLogTextStreamView, VisibleInterval } from '../logging/log_text_stream'; import { LogStreamErrorBoundary } from './log_stream_error_boundary'; diff --git a/x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_entry_flyout/log_entry_actions_menu.test.tsx b/x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_entry_flyout/log_entry_actions_menu.test.tsx index ad989f8460016..05906b2794c9f 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_entry_flyout/log_entry_actions_menu.test.tsx +++ b/x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_entry_flyout/log_entry_actions_menu.test.tsx @@ -7,6 +7,8 @@ import { coreMock } from '@kbn/core/public/mocks'; import { + TRANSACTION_DETAILS_BY_TRACE_ID_LOCATOR, + TransactionDetailsByTraceIdLocatorParams, uptimeOverviewLocatorID, UptimeOverviewLocatorInfraParams, UptimeOverviewLocatorParams, @@ -26,10 +28,10 @@ coreStartMock.application.getUrlForApp.mockImplementation((app, options) => { }); const emptyUrlService = new MockUrlService(); -const urlServiceWithUptimeLocator = new MockUrlService(); +const urlServiceWithMockLocators = new MockUrlService(); // we can't use the actual locator here because its import would create a // forbidden ts project reference cycle -urlServiceWithUptimeLocator.locators.create< +urlServiceWithMockLocators.locators.create< UptimeOverviewLocatorInfraParams | UptimeOverviewLocatorParams >({ id: uptimeOverviewLocatorID, @@ -37,6 +39,12 @@ urlServiceWithUptimeLocator.locators.create< return { app: 'uptime', path: '/overview', state: {} }; }, }); +urlServiceWithMockLocators.locators.create<TransactionDetailsByTraceIdLocatorParams>({ + id: TRANSACTION_DETAILS_BY_TRACE_ID_LOCATOR, + getLocation: async (params) => { + return { app: 'apm', path: '/trace-id', state: {} }; + }, +}); const ProviderWrapper: FC<React.PropsWithChildren<{ urlService?: UrlService }>> = ({ children, @@ -90,7 +98,7 @@ describe('LogEntryActionsMenu component', () => { describe('uptime link with legacy uptime enabled', () => { it('renders as enabled when a host ip is present in the log entry', () => { const elementWrapper = mount( - <ProviderWrapper urlService={urlServiceWithUptimeLocator}> + <ProviderWrapper urlService={urlServiceWithMockLocators}> <LogEntryActionsMenu logEntry={{ fields: [{ field: 'host.ip', value: ['HOST_IP'] }], @@ -120,7 +128,7 @@ describe('LogEntryActionsMenu component', () => { it('renders as enabled when a container id is present in the log entry', () => { const elementWrapper = mount( - <ProviderWrapper urlService={urlServiceWithUptimeLocator}> + <ProviderWrapper urlService={urlServiceWithMockLocators}> <LogEntryActionsMenu logEntry={{ fields: [{ field: 'container.id', value: ['CONTAINER_ID'] }], @@ -150,7 +158,7 @@ describe('LogEntryActionsMenu component', () => { it('renders as enabled when a pod uid is present in the log entry', () => { const elementWrapper = mount( - <ProviderWrapper urlService={urlServiceWithUptimeLocator}> + <ProviderWrapper urlService={urlServiceWithMockLocators}> <LogEntryActionsMenu logEntry={{ fields: [{ field: 'kubernetes.pod.uid', value: ['POD_UID'] }], @@ -180,7 +188,7 @@ describe('LogEntryActionsMenu component', () => { it('renders as disabled when no supported field is present in the log entry', () => { const elementWrapper = mount( - <ProviderWrapper urlService={urlServiceWithUptimeLocator}> + <ProviderWrapper urlService={urlServiceWithMockLocators}> <LogEntryActionsMenu logEntry={{ fields: [], @@ -215,7 +223,7 @@ describe('LogEntryActionsMenu component', () => { describe('apm link', () => { it('renders with a trace id filter when present in log entry', () => { const elementWrapper = mount( - <ProviderWrapper> + <ProviderWrapper urlService={urlServiceWithMockLocators}> <LogEntryActionsMenu logEntry={{ fields: [{ field: 'trace.id', value: ['1234567'] }], @@ -246,7 +254,7 @@ describe('LogEntryActionsMenu component', () => { it('renders with a trace id filter and timestamp when present in log entry', () => { const timestamp = '2019-06-27T17:44:08.693Z'; const elementWrapper = mount( - <ProviderWrapper> + <ProviderWrapper urlService={urlServiceWithMockLocators}> <LogEntryActionsMenu logEntry={{ fields: [ @@ -279,7 +287,7 @@ describe('LogEntryActionsMenu component', () => { it('renders as disabled when no supported field is present in log entry', () => { const elementWrapper = mount( - <ProviderWrapper> + <ProviderWrapper urlService={urlServiceWithMockLocators}> <LogEntryActionsMenu logEntry={{ fields: [], @@ -303,7 +311,10 @@ describe('LogEntryActionsMenu component', () => { elementWrapper.update(); expect( - elementWrapper.find(`button${testSubject('~apmLogEntryActionsMenuItem')}`).prop('disabled') + elementWrapper + .find(`${testSubject('~apmLogEntryActionsMenuItem')}`) + .first() + .prop('disabled') ).toEqual(true); }); }); diff --git a/x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_entry_flyout/log_entry_actions_menu.tsx b/x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_entry_flyout/log_entry_actions_menu.tsx index 4f16d34a489ac..404f6c37bffaa 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_entry_flyout/log_entry_actions_menu.tsx +++ b/x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_entry_flyout/log_entry_actions_menu.tsx @@ -7,13 +7,14 @@ import { EuiButton, EuiContextMenuItem, EuiContextMenuPanel, EuiPopover } from '@elastic/eui'; import { + TRANSACTION_DETAILS_BY_TRACE_ID_LOCATOR, uptimeOverviewLocatorID, + type TransactionDetailsByTraceIdLocatorParams, type UptimeOverviewLocatorInfraParams, } from '@kbn/deeplinks-observability'; import { FormattedMessage } from '@kbn/i18n-react'; -import { LinkDescriptor, useLinkProps } from '@kbn/observability-shared-plugin/public'; import { getRouterLinkProps } from '@kbn/router-utils'; -import { ILocatorClient } from '@kbn/share-plugin/common/url_service'; +import { BrowserUrlService } from '@kbn/share-plugin/public'; import React, { useMemo } from 'react'; import { LogEntry } from '../../../../common/search_strategies/log_entries/log_entry'; import { useKibanaContextForPlugin } from '../../../hooks/use_kibana'; @@ -33,14 +34,11 @@ export const LogEntryActionsMenu = ({ logEntry }: LogEntryActionsMenuProps) => { } = useKibanaContextForPlugin(); const { hide, isVisible, toggle } = useVisibilityState(false); - const apmLinkDescriptor = useMemo(() => getAPMLink(logEntry), [logEntry]); - - const uptimeLinkProps = getUptimeLink({ locators })(logEntry); - - const apmLinkProps = useLinkProps({ - app: 'apm', - ...(apmLinkDescriptor ? apmLinkDescriptor : {}), - }); + const apmLinkProps = useMemo(() => getAPMLink({ locators })(logEntry), [locators, logEntry]); + const uptimeLinkProps = useMemo( + () => getUptimeLink({ locators })(logEntry), + [locators, logEntry] + ); const menuItems = useMemo( () => [ @@ -58,7 +56,7 @@ export const LogEntryActionsMenu = ({ logEntry }: LogEntryActionsMenuProps) => { </EuiContextMenuItem>, <EuiContextMenuItem data-test-subj="logEntryActionsMenuItem apmLogEntryActionsMenuItem" - disabled={!apmLinkDescriptor} + disabled={!apmLinkProps} icon="apmApp" key="apmLink" {...apmLinkProps} @@ -69,7 +67,7 @@ export const LogEntryActionsMenu = ({ logEntry }: LogEntryActionsMenuProps) => { /> </EuiContextMenuItem>, ], - [apmLinkDescriptor, apmLinkProps, uptimeLinkProps] + [apmLinkProps, uptimeLinkProps] ); const hasMenuItems = useMemo(() => menuItems.length > 0, [menuItems]); @@ -101,8 +99,8 @@ export const LogEntryActionsMenu = ({ logEntry }: LogEntryActionsMenuProps) => { }; const getUptimeLink = - ({ locators }: { locators: ILocatorClient }) => - (logEntry: LogEntry): ContextRouterLinkProps | undefined => { + ({ locators }: { locators: BrowserUrlService['locators'] }) => + (logEntry: LogEntry) => { const uptimeLocator = locators.get<UptimeOverviewLocatorInfraParams>(uptimeOverviewLocatorID); if (!uptimeLocator) { @@ -135,47 +133,49 @@ const getUptimeLink = }) as ContextRouterLinkProps; }; -const getAPMLink = (logEntry: LogEntry): LinkDescriptor | undefined => { - const traceId = logEntry.fields.find( - ({ field, value }) => typeof value[0] === 'string' && field === 'trace.id' - )?.value?.[0]; - - if (typeof traceId !== 'string') { - return undefined; - } - - const timestampField = logEntry.fields.find(({ field }) => field === '@timestamp'); - const timestamp = timestampField ? timestampField.value[0] : null; - const { rangeFrom, rangeTo } = - typeof timestamp === 'number' - ? (() => { - const from = new Date(timestamp); - const to = new Date(timestamp); - - from.setMinutes(from.getMinutes() - 10); - to.setMinutes(to.getMinutes() + 10); - - return { rangeFrom: from.toISOString(), rangeTo: to.toISOString() }; - })() - : { rangeFrom: 'now-1y', rangeTo: 'now' }; - - return { - app: 'apm', - pathname: getApmTraceUrl({ traceId, rangeFrom, rangeTo }), - }; -}; +const getAPMLink = + ({ locators }: { locators: BrowserUrlService['locators'] }) => + (logEntry: LogEntry) => { + const traceId = logEntry.fields.find( + ({ field, value }) => typeof value[0] === 'string' && field === 'trace.id' + )?.value?.[0]; -function getApmTraceUrl({ - traceId, - rangeFrom, - rangeTo, -}: { - traceId: string; - rangeFrom: string; - rangeTo: string; -}) { - return `/link-to/trace/${traceId}?` + new URLSearchParams({ rangeFrom, rangeTo }).toString(); -} + if (typeof traceId !== 'string') { + return undefined; + } + + const apmLocator = locators.get<TransactionDetailsByTraceIdLocatorParams>( + TRANSACTION_DETAILS_BY_TRACE_ID_LOCATOR + ); + + if (!apmLocator) { + return undefined; + } + + const timestampField = logEntry.fields.find(({ field }) => field === '@timestamp'); + const timestamp = timestampField ? timestampField.value[0] : null; + const { rangeFrom, rangeTo } = + typeof timestamp === 'number' || typeof timestamp === 'string' + ? (() => { + const from = new Date(timestamp); + const to = new Date(timestamp); + + from.setMinutes(from.getMinutes() - 10); + to.setMinutes(to.getMinutes() + 10); + + return { rangeFrom: from.toISOString(), rangeTo: to.toISOString() }; + })() + : { rangeFrom: 'now-1y', rangeTo: 'now' }; + + const apmLocatorParams = { traceId, rangeFrom, rangeTo }; + + // Coercing the return value to ContextRouterLinkProps because + // EuiContextMenuItem defines a too broad type for onClick + return getRouterLinkProps({ + href: apmLocator.getRedirectUrl(apmLocatorParams), + onClick: () => apmLocator.navigate(apmLocatorParams), + }) as ContextRouterLinkProps; + }; export interface ContextRouterLinkProps { href: string | undefined; diff --git a/x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_entry_flyout/log_entry_flyout.tsx b/x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_entry_flyout/log_entry_flyout.tsx index 952ee959e4a72..a66cb1790525a 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_entry_flyout/log_entry_flyout.tsx +++ b/x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_entry_flyout/log_entry_flyout.tsx @@ -28,7 +28,6 @@ import { useLogEntry } from '../../../containers/logs/log_entry'; import { CenteredEuiFlyoutBody } from '../../centered_flyout_body'; import { DataSearchErrorCallout } from '../../data_search_error_callout'; import { DataSearchProgress } from '../../data_search_progress'; -import LogAIAssistant from '../../log_ai_assistant/log_ai_assistant'; import { LogEntryActionsMenu } from './log_entry_actions_menu'; import { LogEntryFieldsTable } from './log_entry_fields_table'; @@ -42,7 +41,7 @@ export interface LogEntryFlyoutProps { export const useLogEntryFlyout = (logViewReference: LogViewReference) => { const flyoutRef = useRef<OverlayRef>(); const { - services: { http, data, share, uiSettings, application, observabilityAIAssistant }, + services: { http, data, share, uiSettings, application, logsShared }, overlays: { openFlyout }, } = useKibanaContextForPlugin(); @@ -58,7 +57,7 @@ export const useLogEntryFlyout = (logViewReference: LogViewReference) => { share, uiSettings, application, - observabilityAIAssistant, + logsShared, }); flyoutRef.current = openFlyout( @@ -72,12 +71,12 @@ export const useLogEntryFlyout = (logViewReference: LogViewReference) => { ); }, [ + logsShared, application, closeLogEntryFlyout, data, http, logViewReference, - observabilityAIAssistant, openFlyout, share, uiSettings, @@ -115,7 +114,11 @@ export const LogEntryFlyout = ({ logEntryId, }); - const { observabilityAIAssistant } = useKibanaContextForPlugin().services; + const { + services: { + logsShared: { LogAIAssistant }, + }, + } = useKibanaContextForPlugin(); useEffect(() => { if (logViewReference && logEntryId) { @@ -183,12 +186,9 @@ export const LogEntryFlyout = ({ } > <EuiFlexGroup direction="column" gutterSize="m"> - {observabilityAIAssistant && ( + {LogAIAssistant && ( <EuiFlexItem grow={false}> - <LogAIAssistant - observabilityAIAssistant={observabilityAIAssistant} - doc={logEntry} - /> + <LogAIAssistant doc={logEntry} /> </EuiFlexItem> )} <EuiFlexItem grow={false}> diff --git a/x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/index.ts b/x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/index.ts index 6468ea3d94d22..be32a2be6dc58 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/index.ts +++ b/x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/index.ts @@ -5,12 +5,11 @@ * 2.0. */ -export type { LogEntryStreamItem } from './item'; -export type { LogEntryColumnWidths } from './log_entry_column'; - export { LogColumnHeader } from './column_headers'; export { LogColumnHeadersWrapper } from './column_headers_wrapper'; -export { iconColumnId, LogEntryColumn, useColumnWidths } from './log_entry_column'; +export type { LogEntryStreamItem } from './item'; +export { LogEntryColumn, iconColumnId, useColumnWidths } from './log_entry_column'; +export type { LogEntryColumnWidths } from './log_entry_column'; export { LogEntryContextMenu } from './log_entry_context_menu'; export { LogEntryFieldColumn } from './log_entry_field_column'; export { LogEntryMessageColumn } from './log_entry_message_column'; diff --git a/x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/log_entry_row.tsx b/x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/log_entry_row.tsx index b73da833032f4..411b5d0731380 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/log_entry_row.tsx +++ b/x-pack/plugins/observability_solution/logs_shared/public/components/logging/log_text_stream/log_entry_row.tsx @@ -6,25 +6,19 @@ */ import { i18n } from '@kbn/i18n'; -import { ObservabilityTriggerId } from '@kbn/observability-shared-plugin/common'; -import { - useUiTracker, - getContextMenuItemsFromActions, -} from '@kbn/observability-shared-plugin/public'; import { isEmpty } from 'lodash'; import React, { memo, useCallback, useMemo, useState } from 'react'; -import useAsync from 'react-use/lib/useAsync'; import { LogColumn, LogEntry } from '../../../../common/log_entry'; import { TextScale } from '../../../../common/log_text_scale'; -import { useKibanaContextForPlugin } from '../../../hooks/use_kibana'; import { + LogColumnRenderConfiguration, isFieldColumnRenderConfiguration, isMessageColumnRenderConfiguration, isTimestampColumnRenderConfiguration, - LogColumnRenderConfiguration, } from '../../../utils/log_column_render_configuration'; import { isTimestampColumn } from '../../../utils/log_entry'; -import { iconColumnId, LogEntryColumn, LogEntryColumnWidths } from './log_entry_column'; +import { useUiTracker } from '../../../utils/use_ui_tracker'; +import { LogEntryColumn, LogEntryColumnWidths, iconColumnId } from './log_entry_column'; import { LogEntryContextMenu } from './log_entry_context_menu'; import { LogEntryFieldColumn } from './log_entry_field_column'; import { LogEntryMessageColumn } from './log_entry_message_column'; @@ -74,7 +68,7 @@ export const LogEntryRow = memo( scale, wrap, }: LogEntryRowProps) => { - const trackMetric = useUiTracker({ app: 'infra_logs' }); + const trackMetric = useUiTracker(); const [isHovered, setIsHovered] = useState(false); const [isMenuOpen, setIsMenuOpen] = useState(false); @@ -99,16 +93,6 @@ export const LogEntryRow = memo( const hasActionViewLogInContext = hasContext && openViewLogInContext !== undefined; const hasActionsMenu = hasActionFlyoutWithItem || hasActionViewLogInContext; - const uiActions = useKibanaContextForPlugin().services.uiActions; - - const externalContextMenuItems = useAsync(() => { - return getContextMenuItemsFromActions({ - uiActions, - triggerId: ObservabilityTriggerId.LogEntryContextMenu, - context: logEntry, - }); - }, [uiActions, logEntry]); - const menuItems = useMemo(() => { const items = []; if (hasActionFlyoutWithItem) { @@ -251,7 +235,6 @@ export const LogEntryRow = memo( onOpen={openMenu} onClose={closeMenu} items={menuItems} - externalItems={externalContextMenuItems.value} /> ) : null} </LogEntryColumn> diff --git a/x-pack/plugins/observability_solution/logs_shared/public/hooks/use_kibana.tsx b/x-pack/plugins/observability_solution/logs_shared/public/hooks/use_kibana.tsx index 09032b4b644a2..af55accdd66b5 100644 --- a/x-pack/plugins/observability_solution/logs_shared/public/hooks/use_kibana.tsx +++ b/x-pack/plugins/observability_solution/logs_shared/public/hooks/use_kibana.tsx @@ -20,8 +20,7 @@ import { } from '../types'; export type PluginKibanaContextValue = CoreStart & - LogsSharedClientStartDeps & - LogsSharedClientStartExports; + LogsSharedClientStartDeps & { logsShared: LogsSharedClientStartExports }; export const createKibanaContextForPlugin = ( core: CoreStart, @@ -31,7 +30,7 @@ export const createKibanaContextForPlugin = ( createKibanaReactContext<PluginKibanaContextValue>({ ...core, ...plugins, - ...pluginStart, + logsShared: pluginStart, }); export const useKibanaContextForPlugin = diff --git a/x-pack/plugins/observability_solution/logs_shared/public/utils/use_kibana_query_settings.ts b/x-pack/plugins/observability_solution/logs_shared/public/utils/use_kibana_query_settings.ts new file mode 100644 index 0000000000000..521cd0142303b --- /dev/null +++ b/x-pack/plugins/observability_solution/logs_shared/public/utils/use_kibana_query_settings.ts @@ -0,0 +1,31 @@ +/* + * 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 { EsQueryConfig } from '@kbn/es-query'; +import { SerializableRecord } from '@kbn/utility-types'; +import { useMemo } from 'react'; +import { UI_SETTINGS } from '@kbn/data-plugin/public'; +import { useUiSetting$ } from '@kbn/kibana-react-plugin/public'; + +export const useKibanaQuerySettings = (): EsQueryConfig => { + const [allowLeadingWildcards] = useUiSetting$<boolean>(UI_SETTINGS.QUERY_ALLOW_LEADING_WILDCARDS); + const [queryStringOptions] = useUiSetting$<SerializableRecord>(UI_SETTINGS.QUERY_STRING_OPTIONS); + const [dateFormatTZ] = useUiSetting$<string>(UI_SETTINGS.DATEFORMAT_TZ); + const [ignoreFilterIfFieldNotInIndex] = useUiSetting$<boolean>( + UI_SETTINGS.COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX + ); + + return useMemo( + () => ({ + allowLeadingWildcards, + queryStringOptions, + dateFormatTZ, + ignoreFilterIfFieldNotInIndex, + }), + [allowLeadingWildcards, dateFormatTZ, ignoreFilterIfFieldNotInIndex, queryStringOptions] + ); +}; diff --git a/x-pack/plugins/observability_solution/logs_shared/public/utils/use_ui_tracker.ts b/x-pack/plugins/observability_solution/logs_shared/public/utils/use_ui_tracker.ts new file mode 100644 index 0000000000000..bc7e3696b993e --- /dev/null +++ b/x-pack/plugins/observability_solution/logs_shared/public/utils/use_ui_tracker.ts @@ -0,0 +1,44 @@ +/* + * 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 { useMemo } from 'react'; +import { METRIC_TYPE, UiCounterMetricType } from '@kbn/analytics'; +import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; + +/** + * Note: The usage_collection plugin will take care of sending this data to the telemetry server. + * You can find the metrics that are collected by these hooks in Stack Telemetry. + * Search the index `kibana-ui-counter`. You can filter for `eventName` and/or `appName`. + */ + +interface TrackOptions { + metricType?: UiCounterMetricType; + delay?: number; // in ms +} + +interface ServiceDeps { + usageCollection: UsageCollectionSetup; // TODO: This should really be start. Looking into it. +} + +export type TrackMetricOptions = TrackOptions & { metric: string }; +export type UiTracker = ReturnType<typeof useUiTracker>; +export type TrackEvent = (options: TrackMetricOptions) => void; + +export { METRIC_TYPE }; + +export function useUiTracker<Services extends ServiceDeps>(): TrackEvent { + const reportUiCounter = useKibana<Services>().services?.usageCollection?.reportUiCounter; + const trackEvent = useMemo(() => { + return ({ metric, metricType = METRIC_TYPE.COUNT }: TrackMetricOptions) => { + if (reportUiCounter) { + reportUiCounter('infra_logs', metricType, metric); + } + }; + }, [reportUiCounter]); + return trackEvent; +} diff --git a/x-pack/plugins/observability_solution/logs_shared/tsconfig.json b/x-pack/plugins/observability_solution/logs_shared/tsconfig.json index cf1bb42b058be..1892e6b4e2dca 100644 --- a/x-pack/plugins/observability_solution/logs_shared/tsconfig.json +++ b/x-pack/plugins/observability_solution/logs_shared/tsconfig.json @@ -11,7 +11,9 @@ "types/**/*", "emotion.d.ts" ], - "exclude": ["target/**/*"], + "exclude": [ + "target/**/*" + ], "kbn_references": [ "@kbn/core", "@kbn/i18n", @@ -29,7 +31,6 @@ "@kbn/logging-mocks", "@kbn/kibana-react-plugin", "@kbn/test-subj-selector", - "@kbn/observability-shared-plugin", "@kbn/datemath", "@kbn/core-http-browser", "@kbn/ui-actions-plugin", @@ -53,5 +54,7 @@ "@kbn/embeddable-plugin", "@kbn/saved-search-plugin", "@kbn/spaces-plugin", + "@kbn/analytics", + "@kbn/usage-collection-plugin", ] } diff --git a/x-pack/plugins/observability_solution/metrics_data_access/server/routes/metric_indices/index.ts b/x-pack/plugins/observability_solution/metrics_data_access/server/routes/metric_indices/index.ts index ebd4ed1943f20..465a7fdf69f22 100644 --- a/x-pack/plugins/observability_solution/metrics_data_access/server/routes/metric_indices/index.ts +++ b/x-pack/plugins/observability_solution/metrics_data_access/server/routes/metric_indices/index.ts @@ -50,6 +50,12 @@ export function initMetricIndicesRoute<T extends RequestHandlerContext>({ router.get<unknown, unknown, MetricIndicesAPIResponse>( { path: `/api/metrics/indices`, + security: { + authz: { + enabled: false, + reason: 'This route is opted out from authorization', + }, + }, validate: false, }, async (context, _req, res) => { diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/.gitignore b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/.gitignore new file mode 100644 index 0000000000000..b88cb2a2003ab --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/.gitignore @@ -0,0 +1,2 @@ +.playwright +.env* diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/README.md b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/README.md new file mode 100644 index 0000000000000..f2952214127f4 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/README.md @@ -0,0 +1,25 @@ +# Observability Onboarding Playwright Tests + +These tests are part of the [Nightly CI workflow](https://github.com/elastic/ensemble/actions/workflows/nightly.yml) and do not run on PRs. + +Playwright tests are only responsible for UI checks and do not automate onboarding flows fully. On the CI, the missing parts (like executing code snippets on the host) are automated by Ensemble stories, but when running locally you need to do those steps manually. + +## Running The Tests Locally + +1. Run ES and Kibana +2. Create a `.env` file in the `./x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/` directory with the following content (adjust the values like Kibana URL according yo your local setup): +```bash +KIBANA_BASE_URL = "http://localhost:5601/ftw" +ELASTICSEARCH_HOST = "http://localhost:9200" +KIBANA_USERNAME = "elastic" +KIBANA_PASSWORD = "changeme" +CLUSTER_ENVIRONMENT = local +ARTIFACTS_FOLDER = ./.playwright +``` +3. Run the `playwright test` +```bash +# Assuming the working directory is the root of the Kibana repo +npx playwright test -c ./x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/playwright.config.ts --project stateful --reporter list --headed +``` +4. Once the test reaches one of the required manual steps, like executing auto-detect command snippet, do the step manually. +5. The test will proceed once the manual step is done. diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/assert_env.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/assert_env.ts new file mode 100644 index 0000000000000..6c54cabdc1601 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/assert_env.ts @@ -0,0 +1,12 @@ +/* + * 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. + */ + +export function assertEnv(variable: unknown, message: string): asserts variable is string { + if (typeof variable !== 'string') { + throw new Error(message); + } +} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/helpers.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/helpers.ts new file mode 100644 index 0000000000000..e7c6afaefbd23 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/helpers.ts @@ -0,0 +1,35 @@ +/* + * 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 { Locator } from '@playwright/test'; +import { HeaderBar } from '../stateful/pom/components/header_bar.component'; +import { SpaceSelector } from '../stateful/pom/components/space_selector.component'; + +type WaitForRes = [locatorIndex: number, locator: Locator]; + +export async function waitForOneOf(locators: Locator[]): Promise<WaitForRes> { + const res = await Promise.race([ + ...locators.map(async (locator, index): Promise<WaitForRes> => { + let timedOut = false; + await locator.waitFor({ state: 'visible' }).catch(() => (timedOut = true)); + return [timedOut ? -1 : index, locator]; + }), + ]); + if (res[0] === -1) { + throw new Error('No locator is visible before timeout.'); + } + return res; +} + +export async function spaceSelectorStateful(headerBar: HeaderBar, spaceSelector: SpaceSelector) { + const [index] = await waitForOneOf([headerBar.helpMenuButton(), spaceSelector.spaceSelector()]); + const selector = index === 1; + if (selector) { + await spaceSelector.selectDefault(); + await headerBar.assertHelpMenuButton(); + } +} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/logger.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/logger.ts new file mode 100644 index 0000000000000..92ec2ba6918f0 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/lib/logger.ts @@ -0,0 +1,13 @@ +/* + * 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 { ToolingLog } from '@kbn/tooling-log'; + +export const log: ToolingLog = new ToolingLog({ + level: 'info', + writeTo: process.stdout, +}); diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/playwright.config.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/playwright.config.ts new file mode 100644 index 0000000000000..39217999f5a2e --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/playwright.config.ts @@ -0,0 +1,102 @@ +/* + * 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 dotenv from 'dotenv'; +import { defineConfig, devices } from '@playwright/test'; +import path from 'path'; +import { log } from './lib/logger'; +import { assertEnv } from './lib/assert_env'; + +const dotEnvPath = process.env.DOTENV_PATH ?? path.join(__dirname, '.env'); + +dotenv.config({ path: dotEnvPath }); + +assertEnv(process.env.ARTIFACTS_FOLDER, 'ARTIFACTS_FOLDER is not defined.'); + +export const STORAGE_STATE = path.join(__dirname, process.env.ARTIFACTS_FOLDER, '.auth/user.json'); + +// eslint-disable-next-line import/no-default-export +export default defineConfig({ + testDir: './', + outputDir: './.playwright', + /* Run tests in files in parallel */ + fullyParallel: true, + /* Fail the build on CI if you accidentally left test.only in the source code. */ + forbidOnly: !!process.env.CI, + /* Retry on CI only */ + retries: process.env.CI ? 2 : 0, + /* Opt out of parallel tests on CI. */ + workers: process.env.CI ? 1 : undefined, + // workers: 4, + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + reporter: [ + ['json'], + ['json', { outputFile: path.join(process.env.ARTIFACTS_FOLDER, 'results.json') }], + ], + /* Timeouts */ + timeout: 400000, + expect: { timeout: 400000 }, + + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + use: { + /* Base URL to use in actions like `await page.goto('/')`. */ + baseURL: process.env.KIBANA_BASE_URL, + + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ + trace: 'on-first-retry', + testIdAttribute: 'data-test-subj', + permissions: ['clipboard-read'], + screenshot: 'only-on-failure', + }, + + projects: [ + { + name: 'auth', + testMatch: '*stateful/auth.ts', + use: { + viewport: { width: 1920, height: 1080 }, + launchOptions: { + logger: { + isEnabled: () => true, + log: (name, severity, message) => log.info(`[${severity}] ${name} ${message}`), + }, + }, + }, + }, + { + name: 'stateful', + testMatch: '*stateful/*.spec.ts', + use: { + ...devices['Desktop Chrome'], + viewport: { width: 1920, height: 1200 }, + storageState: STORAGE_STATE, + launchOptions: { + logger: { + isEnabled: () => true, + log: (name, severity, message) => log.info(`[${severity}] ${name} ${message}`), + }, + }, + }, + dependencies: ['auth'], + }, + { + name: 'teardown', + testMatch: 'teardown.setup.ts', + use: { + viewport: { width: 1920, height: 1080 }, + storageState: STORAGE_STATE, + testIdAttribute: 'data-test-subj', + launchOptions: { + logger: { + isEnabled: () => true, + log: (name, severity, message) => log.info(`[${severity}] ${name} ${message}`), + }, + }, + }, + }, + ], +}); diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/auth.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/auth.ts new file mode 100644 index 0000000000000..726085fbabc33 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/auth.ts @@ -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 { test as ess_auth, expect } from '@playwright/test'; +import { STORAGE_STATE } from '../playwright.config'; +import { waitForOneOf } from '../lib/helpers'; +import { log } from '../lib/logger'; +import { assertEnv } from '../lib/assert_env'; + +const isLocalCluster = process.env.CLUSTER_ENVIRONMENT === 'local'; + +ess_auth('Authentication', async ({ page }) => { + assertEnv(process.env.KIBANA_BASE_URL, 'KIBANA_BASE_URL is not defined.'); + assertEnv(process.env.KIBANA_USERNAME, 'KIBANA_USERNAME is not defined.'); + assertEnv(process.env.KIBANA_PASSWORD, 'KIBANA_PASSWORD is not defined.'); + + await page.goto(process.env.KIBANA_BASE_URL); + log.info(`...waiting for login page elements to appear.`); + if (!isLocalCluster) { + await page.getByRole('button', { name: 'Log in with Elasticsearch' }).click(); + } + await page.getByLabel('Username').fill(process.env.KIBANA_USERNAME); + await page.getByLabel('Password', { exact: true }).click(); + await page.getByLabel('Password', { exact: true }).fill(process.env.KIBANA_PASSWORD); + await page.getByRole('button', { name: 'Log in' }).click(); + + const [index] = await waitForOneOf([ + page.getByTestId('helpMenuButton'), + page.getByText('Select your space'), + page.getByTestId('loginErrorMessage'), + ]); + + const spaceSelector = index === 1; + const isAuthenticated = index === 0; + + if (isAuthenticated) { + await page.context().storageState({ path: STORAGE_STATE }); + } else if (spaceSelector) { + await page.getByRole('link', { name: 'Default' }).click(); + await expect(page.getByTestId('helpMenuButton')).toBeVisible(); + await page.context().storageState({ path: STORAGE_STATE }); + } else { + log.error('Username or password is incorrect.'); + throw new Error('Authentication is failed.'); + } +}); diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/auto_detect.spec.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/auto_detect.spec.ts new file mode 100644 index 0000000000000..cff927a2061c1 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/auto_detect.spec.ts @@ -0,0 +1,65 @@ +/* + * 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 fs from 'node:fs'; +import path from 'node:path'; +import { test } from './fixtures/base_page'; +import { HostDetailsPage } from './pom/pages/host_details.page'; +import { assertEnv } from '../lib/assert_env'; + +test.beforeEach(async ({ page }) => { + await page.goto(`${process.env.KIBANA_BASE_URL}/app/observabilityOnboarding`); +}); + +test('Auto-detect logs and metrics', async ({ page, onboardingHomePage, autoDetectFlowPage }) => { + assertEnv(process.env.ARTIFACTS_FOLDER, 'ARTIFACTS_FOLDER is not defined.'); + + const fileName = 'code_snippet_logs_auto_detect.sh'; + const outputPath = path.join(__dirname, '..', process.env.ARTIFACTS_FOLDER, fileName); + + await onboardingHomePage.selectHostUseCase(); + await onboardingHomePage.selectAutoDetectWithElasticAgent(); + + await autoDetectFlowPage.assertVisibilityCodeBlock(); + await autoDetectFlowPage.copyToClipboard(); + + const clipboardData = (await page.evaluate('navigator.clipboard.readText()')) as string; + + /** + * Ensemble story watches for the code snippet file + * to be created and then executes it + */ + fs.writeFileSync(outputPath, clipboardData); + + await autoDetectFlowPage.assertReceivedDataIndicator(); + await autoDetectFlowPage.clickAutoDetectSystemIntegrationCTA(); + + /** + * Host Details pages open in a new tab, so it + * needs to be captured using the `popup` event. + */ + const hostDetailsPage = new HostDetailsPage(await page.waitForEvent('popup')); + + /** + * There is a glitch on the Hosts page where it can show "No data" + * screen even though data is available and it can show it with a delay + * after the Hosts page layout was loaded. This workaround waits for + * the No Data screen to be visible, and if so - reloads the page. + * If the No Data screen does not appear, the test can proceed normally. + * Seems like some caching issue with the Hosts page. + */ + try { + await hostDetailsPage.noData().waitFor({ state: 'visible', timeout: 10000 }); + await hostDetailsPage.page.waitForTimeout(2000); + await hostDetailsPage.page.reload(); + } catch { + /* Ignore if "No Data" screen never showed up */ + } + + await hostDetailsPage.clickHostDetailsLogsTab(); + await hostDetailsPage.assertHostDetailsLogsStream(); +}); diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/fixtures/base_page.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/fixtures/base_page.ts new file mode 100644 index 0000000000000..e10be1d60cc1c --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/fixtures/base_page.ts @@ -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 { test as base } from '@playwright/test'; +import { HeaderBar } from '../pom/components/header_bar.component'; +import { OnboardingHomePage } from '../pom/pages/onboarding_home.page'; +import { SpaceSelector } from '../pom/components/space_selector.component'; +import { KubernetesOverviewDashboardPage } from '../pom/pages/kubernetes_overview_dashboard.page'; +import { AutoDetectFlowPage } from '../pom/pages/auto_detect_flow.page'; +import { KubernetesEAFlowPage } from '../pom/pages/kubernetes_ea_flow.page'; + +export const test = base.extend<{ + headerBar: HeaderBar; + spaceSelector: SpaceSelector; + onboardingHomePage: OnboardingHomePage; + autoDetectFlowPage: AutoDetectFlowPage; + kubernetesEAFlowPage: KubernetesEAFlowPage; + kubernetesOverviewDashboardPage: KubernetesOverviewDashboardPage; +}>({ + headerBar: async ({ page }, use) => { + await use(new HeaderBar(page)); + }, + + spaceSelector: async ({ page }, use) => { + await use(new SpaceSelector(page)); + }, + + onboardingHomePage: async ({ page }, use) => { + await use(new OnboardingHomePage(page)); + }, + + autoDetectFlowPage: async ({ page }, use) => { + await use(new AutoDetectFlowPage(page)); + }, + + kubernetesEAFlowPage: async ({ page }, use) => { + await use(new KubernetesEAFlowPage(page)); + }, + + kubernetesOverviewDashboardPage: async ({ page }, use) => { + await use(new KubernetesOverviewDashboardPage(page)); + }, +}); diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/kubernetes_ea.spec.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/kubernetes_ea.spec.ts new file mode 100644 index 0000000000000..8478630b232f0 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/kubernetes_ea.spec.ts @@ -0,0 +1,66 @@ +/* + * 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 fs from 'node:fs'; +import path from 'node:path'; +import { test } from './fixtures/base_page'; +import { assertEnv } from '../lib/assert_env'; + +test.beforeEach(async ({ page }) => { + await page.goto(`${process.env.KIBANA_BASE_URL}/app/observabilityOnboarding`); +}); + +test('Kubernetes EA', async ({ + page, + onboardingHomePage, + kubernetesEAFlowPage, + kubernetesOverviewDashboardPage, +}) => { + assertEnv(process.env.ARTIFACTS_FOLDER, 'ARTIFACTS_FOLDER is not defined.'); + + const fileName = 'code_snippet_kubernetes.sh'; + const outputPath = path.join(__dirname, '..', process.env.ARTIFACTS_FOLDER, fileName); + + await onboardingHomePage.selectKubernetesUseCase(); + await onboardingHomePage.selectKubernetesQuickstart(); + + await kubernetesEAFlowPage.assertVisibilityCodeBlock(); + await kubernetesEAFlowPage.copyToClipboard(); + + const clipboardData = (await page.evaluate('navigator.clipboard.readText()')) as string; + /** + * The page waits for the browser window to loose + * focus as a signal to start checking for incoming data + */ + await page.evaluate('window.dispatchEvent(new Event("blur"))'); + + /** + * Ensemble story watches for the code snippet file + * to be created and then executes it + */ + fs.writeFileSync(outputPath, clipboardData); + + await kubernetesEAFlowPage.assertReceivedDataIndicatorKubernetes(); + await kubernetesEAFlowPage.clickKubernetesAgentCTA(); + + await kubernetesOverviewDashboardPage.openNodesInspector(); + /** + * There might be a case that dashboard still does not show + * the data even though it was ingested already. This usually + * happens during in the test when navigation from the onboarding + * flow to the dashboard happens almost immediately. + * Waiting for a few seconds and reloading the page handles + * this case and makes the test a bit more robust. + */ + try { + await kubernetesOverviewDashboardPage.assertNodesNoResultsNotVisible(); + } catch { + await kubernetesOverviewDashboardPage.page.waitForTimeout(2000); + await kubernetesOverviewDashboardPage.page.reload(); + } + await kubernetesOverviewDashboardPage.assetNodesInspectorStatusTableCells(); +}); diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/components/header_bar.component.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/components/header_bar.component.ts new file mode 100644 index 0000000000000..9165622bf6ce0 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/components/header_bar.component.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 { expect, Page } from '@playwright/test'; + +export class HeaderBar { + page: Page; + + constructor(page: Page) { + this.page = page; + } + + public readonly helpMenuButton = () => this.page.getByTestId('helpMenuButton'); + + public async assertHelpMenuButton() { + await expect(this.helpMenuButton(), 'Help menu button').toBeVisible(); + } +} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/components/space_selector.component.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/components/space_selector.component.ts new file mode 100644 index 0000000000000..8527141d455af --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/components/space_selector.component.ts @@ -0,0 +1,23 @@ +/* + * 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 { Page } from '@playwright/test'; + +export class SpaceSelector { + page: Page; + + constructor(page: Page) { + this.page = page; + } + + public readonly spaceSelector = () => this.page.getByText('Select your space'); + private readonly spaceSelectorDefault = () => this.page.getByRole('link', { name: 'Default' }); + + public async selectDefault() { + await this.spaceSelectorDefault().click(); + } +} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/auto_detect_flow.page.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/auto_detect_flow.page.ts new file mode 100644 index 0000000000000..b1090b3cf091d --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/auto_detect_flow.page.ts @@ -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 { expect, Page } from '@playwright/test'; + +export class AutoDetectFlowPage { + page: Page; + + constructor(page: Page) { + this.page = page; + } + + private readonly copyToClipboardButton = () => + this.page.getByTestId('observabilityOnboardingCopyToClipboardButton'); + + private readonly receivedDataIndicator = () => + this.page + .getByTestId('observabilityOnboardingAutoDetectPanelDataReceivedProgressIndicator') + .getByText('Your data is ready to explore!'); + + private readonly autoDetectSystemIntegrationActionLink = () => + this.page.getByTestId( + 'observabilityOnboardingDataIngestStatusActionLink-inventory-host-details' + ); + + private readonly codeBlock = () => + this.page.getByTestId('observabilityOnboardingAutoDetectPanelCodeSnippet'); + + public async copyToClipboard() { + await this.copyToClipboardButton().click(); + } + + public async assertVisibilityCodeBlock() { + await expect(this.codeBlock(), 'Code block should be visible').toBeVisible(); + } + + public async assertReceivedDataIndicator() { + await expect( + this.receivedDataIndicator(), + 'Received data indicator should be visible' + ).toBeVisible(); + } + + public async clickAutoDetectSystemIntegrationCTA() { + await this.autoDetectSystemIntegrationActionLink().click(); + } +} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/host_details.page.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/host_details.page.ts new file mode 100644 index 0000000000000..d22b33d851639 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/host_details.page.ts @@ -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 { expect, Page } from '@playwright/test'; + +export class HostDetailsPage { + page: Page; + + public readonly hostDetailsLogsTab = () => this.page.getByTestId('infraAssetDetailsLogsTab'); + + private readonly hostDetailsLogsStream = () => this.page.getByTestId('logStream'); + + public readonly noData = () => this.page.getByTestId('kbnNoDataPage'); + + constructor(page: Page) { + this.page = page; + } + + public async clickHostDetailsLogsTab() { + await this.hostDetailsLogsTab().click(); + } + + public async assertHostDetailsLogsStream() { + await expect( + this.hostDetailsLogsStream(), + 'Host details log stream should be visible' + /** + * Using toBeAttached() instead of toBeVisible() because the element + * we're selecting here has a bit weird layout with 0 height and + * overflowing child elements. 0 height makes toBeVisible() fail. + */ + ).toBeAttached(); + } +} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/kubernetes_ea_flow.page.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/kubernetes_ea_flow.page.ts new file mode 100644 index 0000000000000..e956de4855579 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/kubernetes_ea_flow.page.ts @@ -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 { expect, Page } from '@playwright/test'; + +export class KubernetesEAFlowPage { + page: Page; + + constructor(page: Page) { + this.page = page; + } + + private readonly receivedDataIndicatorKubernetes = () => + this.page + .getByTestId('observabilityOnboardingKubernetesPanelDataProgressIndicator') + .getByText('We are monitoring your cluster'); + + private readonly kubernetesAgentExploreDataActionLink = () => + this.page.getByTestId( + 'observabilityOnboardingDataIngestStatusActionLink-kubernetes-f4dc26db-1b53-4ea2-a78b-1bfab8ea267c' + ); + + private readonly codeBlock = () => + this.page.getByTestId('observabilityOnboardingKubernetesPanelCodeSnippet'); + + private readonly copyToClipboardButton = () => + this.page.getByTestId('observabilityOnboardingCopyToClipboardButton'); + + public async assertVisibilityCodeBlock() { + await expect(this.codeBlock(), 'Code block should be visible').toBeVisible(); + } + + public async copyToClipboard() { + await this.copyToClipboardButton().click(); + } + + public async assertReceivedDataIndicatorKubernetes() { + await expect( + this.receivedDataIndicatorKubernetes(), + 'Received data indicator should be visible' + ).toBeVisible(); + } + + public async clickKubernetesAgentCTA() { + await this.kubernetesAgentExploreDataActionLink().click(); + } +} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/kubernetes_overview_dashboard.page.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/kubernetes_overview_dashboard.page.ts new file mode 100644 index 0000000000000..9562f0262994f --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/kubernetes_overview_dashboard.page.ts @@ -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 { expect, Page } from '@playwright/test'; + +export class KubernetesOverviewDashboardPage { + page: Page; + + constructor(page: Page) { + this.page = page; + } + + private readonly nodesPanelHeader = () => this.page.getByTestId('embeddablePanelHeading-Nodes'); + + private readonly nodesInspectorButton = () => + this.page + .getByTestId('embeddablePanelHoverActions-Nodes') + .getByTestId('embeddablePanelAction-openInspector'); + + private readonly nodesInspectorTableNoResults = () => + this.page.getByTestId('inspectorTable').getByText('No items found'); + + private readonly nodesInspectorTableStatusTableCells = () => + this.page.getByTestId('inspectorTable').getByText('Status'); + + public async assertNodesNoResultsNotVisible() { + await expect( + this.nodesInspectorTableNoResults(), + 'Nodes "No results" message should not be visible' + ).toBeHidden(); + } + + public async openNodesInspector() { + await this.nodesPanelHeader().hover(); + await this.nodesInspectorButton().click(); + } + + public async assetNodesInspectorStatusTableCells() { + await expect( + this.nodesInspectorTableStatusTableCells(), + 'Status table cell should exist' + ).toBeVisible(); + } +} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/onboarding_home.page.ts b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/onboarding_home.page.ts new file mode 100644 index 0000000000000..6997001496521 --- /dev/null +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/playwright/stateful/pom/pages/onboarding_home.page.ts @@ -0,0 +1,44 @@ +/* + * 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 { Page } from '@playwright/test'; + +export class OnboardingHomePage { + page: Page; + + constructor(page: Page) { + this.page = page; + } + + private readonly useCaseKubernetes = () => + this.page.getByTestId('observabilityOnboardingUseCaseCard-kubernetes').getByRole('radio'); + + private readonly kubernetesQuickStartCard = () => + this.page.getByTestId('integration-card:kubernetes-quick-start'); + + private readonly useCaseHost = () => + this.page.getByTestId('observabilityOnboardingUseCaseCard-host').getByRole('radio'); + + private readonly autoDetectElasticAgent = () => + this.page.getByTestId('integration-card:auto-detect-logs'); + + public async selectHostUseCase() { + await this.useCaseHost().click(); + } + + public async selectKubernetesUseCase() { + await this.useCaseKubernetes().click(); + } + + public async selectAutoDetectWithElasticAgent() { + await this.autoDetectElasticAgent().click(); + } + + public async selectKubernetesQuickstart() { + await this.kubernetesQuickStartCard().click(); + } +} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/tsconfig.json b/x-pack/plugins/observability_solution/observability_onboarding/e2e/tsconfig.json index 94d4f2278cb63..a18951aeb8cf7 100644 --- a/x-pack/plugins/observability_solution/observability_onboarding/e2e/tsconfig.json +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/tsconfig.json @@ -14,6 +14,7 @@ "@kbn/cypress-config", "@kbn/observability-onboarding-plugin", "@kbn/ftr-common-functional-services", - "@kbn/ftr-common-functional-ui-services" + "@kbn/ftr-common-functional-ui-services", + "@kbn/tooling-log" ] } diff --git a/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/auto_detect/auto_detect_panel.tsx b/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/auto_detect/auto_detect_panel.tsx index d12f0cae583f4..2891d4c47834d 100644 --- a/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/auto_detect/auto_detect_panel.tsx +++ b/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/auto_detect/auto_detect_panel.tsx @@ -95,7 +95,11 @@ export const AutoDetectPanel: FunctionComponent = () => { <SupportedIntegrationsList /> <EuiSpacer /> {/* Bash syntax highlighting only highlights a few random numbers (badly) so it looks less messy to go with plain text */} - <EuiCodeBlock paddingSize="m" language="text"> + <EuiCodeBlock + paddingSize="m" + language="text" + data-test-subj="observabilityOnboardingAutoDetectPanelCodeSnippet" + > {command} </EuiCodeBlock> <EuiSpacer /> diff --git a/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/kubernetes/command_snippet.tsx b/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/kubernetes/command_snippet.tsx index ac00190fb268d..ce22e31829730 100644 --- a/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/kubernetes/command_snippet.tsx +++ b/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/kubernetes/command_snippet.tsx @@ -63,7 +63,12 @@ export function CommandSnippet({ <EuiSpacer /> - <EuiCodeBlock language="text" paddingSize="m" fontSize="m"> + <EuiCodeBlock + language="text" + paddingSize="m" + fontSize="m" + data-test-subj="observabilityOnboardingKubernetesPanelCodeSnippet" + > {command} </EuiCodeBlock> diff --git a/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/kubernetes/data_ingest_status.tsx b/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/kubernetes/data_ingest_status.tsx index 659c1e5bd7b50..50725e262eb5a 100644 --- a/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/kubernetes/data_ingest_status.tsx +++ b/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/kubernetes/data_ingest_status.tsx @@ -80,6 +80,7 @@ export function DataIngestStatus({ onboardingId }: Props) { css={css` max-width: 40%; `} + data-test-subj="observabilityOnboardingKubernetesPanelDataProgressIndicator" /> {isTroubleshootingVisible && ( diff --git a/x-pack/plugins/observability_solution/observability_shared/common/entity/entity_types.ts b/x-pack/plugins/observability_solution/observability_shared/common/entity/entity_types.ts index db3e91fbf493a..222780a1fc31a 100644 --- a/x-pack/plugins/observability_solution/observability_shared/common/entity/entity_types.ts +++ b/x-pack/plugins/observability_solution/observability_shared/common/entity/entity_types.ts @@ -14,6 +14,7 @@ export const BUILT_IN_ENTITY_TYPES = { HOST: 'host', CONTAINER: 'container', SERVICE: 'service', + SERVICE_V2: 'built_in_services_from_ecs_data', KUBERNETES: { CLUSTER: createKubernetesEntity('cluster'), CONTAINER: createKubernetesEntity('container'), diff --git a/x-pack/plugins/observability_solution/observability_shared/common/field_names/elasticsearch.ts b/x-pack/plugins/observability_solution/observability_shared/common/field_names/elasticsearch.ts index e703cd487259c..5569dac69b8be 100644 --- a/x-pack/plugins/observability_solution/observability_shared/common/field_names/elasticsearch.ts +++ b/x-pack/plugins/observability_solution/observability_shared/common/field_names/elasticsearch.ts @@ -146,6 +146,8 @@ export const PROFILE_ALLOC_SPACE = 'profile.alloc_space.bytes'; export const PROFILE_INUSE_OBJECTS = 'profile.inuse_objects.count'; export const PROFILE_INUSE_SPACE = 'profile.inuse_space.bytes'; +export const DATA_STREAM_TYPE = 'data_stream.type'; + export const ENTITY = 'entity'; export const ENTITY_ID = 'entity.id'; export const ENTITY_TYPE = 'entity.type'; diff --git a/x-pack/plugins/observability_solution/observability_shared/common/index.ts b/x-pack/plugins/observability_solution/observability_shared/common/index.ts index a8e26366ab4b3..24d12362d7cfa 100644 --- a/x-pack/plugins/observability_solution/observability_shared/common/index.ts +++ b/x-pack/plugins/observability_solution/observability_shared/common/index.ts @@ -128,15 +128,16 @@ export { PROFILE_ALLOC_SPACE, PROFILE_INUSE_OBJECTS, PROFILE_INUSE_SPACE, + DATA_STREAM_TYPE, ENTITY, - ENTITY_DEFINITION_ID, - ENTITY_DISPLAY_NAME, - ENTITY_FIRST_SEEN, ENTITY_ID, - ENTITY_LAST_SEEN, ENTITY_TYPE, - SOURCE_DATA_STREAM_TYPE, + ENTITY_LAST_SEEN, + ENTITY_FIRST_SEEN, + ENTITY_DISPLAY_NAME, + ENTITY_DEFINITION_ID, ENTITY_IDENTITY_FIELDS, + SOURCE_DATA_STREAM_TYPE, } from './field_names/elasticsearch'; export { diff --git a/x-pack/plugins/observability_solution/observability_shared/common/locators/apm/transaction_details_by_trace_id_locator.ts b/x-pack/plugins/observability_solution/observability_shared/common/locators/apm/transaction_details_by_trace_id_locator.ts index 2e461bc4f9d55..94fa1176c3ee0 100644 --- a/x-pack/plugins/observability_solution/observability_shared/common/locators/apm/transaction_details_by_trace_id_locator.ts +++ b/x-pack/plugins/observability_solution/observability_shared/common/locators/apm/transaction_details_by_trace_id_locator.ts @@ -4,14 +4,14 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import qs from 'query-string'; import type { LocatorDefinition, LocatorPublic } from '@kbn/share-plugin/public'; -import type { SerializableRecord } from '@kbn/utility-types'; +import { + TRANSACTION_DETAILS_BY_TRACE_ID_LOCATOR, + type TransactionDetailsByTraceIdLocatorParams, +} from '@kbn/deeplinks-observability'; -export const TRANSACTION_DETAILS_BY_TRACE_ID_LOCATOR = 'TRANSACTION_DETAILS_BY_TRACE_ID_LOCATOR'; - -export interface TransactionDetailsByTraceIdLocatorParams extends SerializableRecord { - traceId: string; -} +export { TRANSACTION_DETAILS_BY_TRACE_ID_LOCATOR, type TransactionDetailsByTraceIdLocatorParams }; export type TransactionDetailsByTraceIdLocator = LocatorPublic<TransactionDetailsByTraceIdLocatorParams>; @@ -21,10 +21,15 @@ export class TransactionDetailsByTraceIdLocatorDefinition { public readonly id = TRANSACTION_DETAILS_BY_TRACE_ID_LOCATOR; - public readonly getLocation = async ({ traceId }: TransactionDetailsByTraceIdLocatorParams) => { + public readonly getLocation = async ({ + rangeFrom, + rangeTo, + traceId, + }: TransactionDetailsByTraceIdLocatorParams) => { + const params = { rangeFrom, rangeTo }; return { app: 'apm', - path: `/link-to/trace/${encodeURIComponent(traceId)}`, + path: `/link-to/trace/${encodeURIComponent(traceId)}?${qs.stringify(params)}`, state: {}, }; }; diff --git a/x-pack/plugins/observability_solution/observability_shared/common/trigger_ids.ts b/x-pack/plugins/observability_solution/observability_shared/common/trigger_ids.ts index 404aaab8781b1..8a75472e0546b 100644 --- a/x-pack/plugins/observability_solution/observability_shared/common/trigger_ids.ts +++ b/x-pack/plugins/observability_solution/observability_shared/common/trigger_ids.ts @@ -6,7 +6,6 @@ */ export enum ObservabilityTriggerId { - LogEntryContextMenu = 'logEntryContextMenu', ApmTransactionContextMenu = 'apmTransactionContextMenu', ApmErrorContextMenu = 'apmErrorContextMenu', } diff --git a/x-pack/plugins/observability_solution/observability_shared/public/hooks/use_chart_theme.tsx b/x-pack/plugins/observability_solution/observability_shared/public/hooks/use_chart_theme.tsx index 1a914e4abcd7e..3c06cfa9c7128 100644 --- a/x-pack/plugins/observability_solution/observability_shared/public/hooks/use_chart_theme.tsx +++ b/x-pack/plugins/observability_solution/observability_shared/public/hooks/use_chart_theme.tsx @@ -5,13 +5,13 @@ * 2.0. */ -import { LIGHT_THEME, DARK_THEME, PartialTheme, Theme } from '@elastic/charts'; +import { LIGHT_THEME, DARK_THEME, PartialTheme } from '@elastic/charts'; +import { useEuiTheme, COLOR_MODES_STANDARD } from '@elastic/eui'; import { useMemo } from 'react'; -import { useTheme } from './use_theme'; -export function useChartThemes(): { baseTheme: Theme; theme: PartialTheme[] } { - const theme = useTheme(); - const baseTheme = theme.darkMode ? DARK_THEME : LIGHT_THEME; +export function useChartThemes() { + const theme = useEuiTheme(); + const baseTheme = theme.colorMode === COLOR_MODES_STANDARD.dark ? DARK_THEME : LIGHT_THEME; return useMemo(() => { const themeOverrides: PartialTheme = { diff --git a/x-pack/plugins/observability_solution/observability_shared/tsconfig.json b/x-pack/plugins/observability_solution/observability_shared/tsconfig.json index f7b8a7ff6c573..15ae8d34c7f55 100644 --- a/x-pack/plugins/observability_solution/observability_shared/tsconfig.json +++ b/x-pack/plugins/observability_solution/observability_shared/tsconfig.json @@ -46,6 +46,7 @@ "@kbn/es-query", "@kbn/serverless", "@kbn/data-views-plugin", + "@kbn/deeplinks-observability", ], "exclude": ["target/**/*", ".storybook/**/*.js"] } diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/README.md b/x-pack/plugins/observability_solution/slo/docs/openapi/slo/README.md deleted file mode 100644 index f6a80b82c9754..0000000000000 --- a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# OpenAPI (Experimental) - -The current self-contained spec file is [as YAML](https://raw.githubusercontent.com/elastic/kibana/master/x-pack/plugins/observability/docs/openapi/slo/bundled.yaml) and can be used for online tools like those found at <https://openapi.tools/>. -This spec is experimental and may be incomplete or change later. - -A guide about the OpenApi specification can be found at [https://swagger.io/docs/specification/about/](https://swagger.io/docs/specification/about/). - -## The `openapi/slo` folder - -- `entrypoint.yaml` is the overview file which pulls together all the paths and components. -- [Paths](paths/README.md): this defines each endpoint. A path can have one operation per http method. -- [Components](components/README.md): Reusable components - -## Tools - -It is possible to manually validate the docs before bundling them with the following -command in the `x-pack/plugins/observability_solution/slo/docs/openapi/slo` folder: - -```bash -make validate -``` - -Then you can generate the `bundled` files by running the following command- this target will automatically validate inputs and lint the result: - -```bash -make bundle -``` - -To lint the generated bundle manually, run: - -```bash -make lint -``` - -To join these files with the rest of the Kibana APIs, refer to `oas_docs/README.md` diff --git a/x-pack/plugins/observability_solution/slo/e2e/tsconfig.json b/x-pack/plugins/observability_solution/slo/e2e/tsconfig.json deleted file mode 100644 index 68203a4db6013..0000000000000 --- a/x-pack/plugins/observability_solution/slo/e2e/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "../../../../../tsconfig.base.json", - "exclude": ["tmp", "target/**/*"], - "include": ["**/*"], - "compilerOptions": { - "outDir": "target/types", - "types": [ "node"], - "isolatedModules": false, - }, - "kbn_references": [ - "@kbn/test", - "@kbn/ftr-common-functional-services", - "@kbn/data-forge", - "@kbn/synthetics-e2e", - "@kbn/observability-synthetics-test-data", - ] -} diff --git a/x-pack/plugins/observability_solution/slo/emotion.d.ts b/x-pack/plugins/observability_solution/slo/emotion.d.ts deleted file mode 100644 index 213178080e536..0000000000000 --- a/x-pack/plugins/observability_solution/slo/emotion.d.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 '@emotion/react'; -import type { UseEuiTheme } from '@elastic/eui'; - -declare module '@emotion/react' { - // eslint-disable-next-line @typescript-eslint/no-empty-interface - export interface Theme extends UseEuiTheme {} -} diff --git a/x-pack/plugins/observability_solution/slo/jest.config.js b/x-pack/plugins/observability_solution/slo/jest.config.js deleted file mode 100644 index fa7ff9c84deca..0000000000000 --- a/x-pack/plugins/observability_solution/slo/jest.config.js +++ /dev/null @@ -1,19 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/plugins/observability_solution/slo'], - setupFiles: ['<rootDir>/x-pack/plugins/observability_solution/slo/.storybook/jest_setup.js'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/observability_solution/slo', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/observability_solution/slo/{common,public,server}/**/*.{js,ts,tsx}', - ], -}; diff --git a/x-pack/plugins/observability_solution/slo/tsconfig.json b/x-pack/plugins/observability_solution/slo/tsconfig.json deleted file mode 100644 index 125a8463be595..0000000000000 --- a/x-pack/plugins/observability_solution/slo/tsconfig.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - "../../../typings/**/*", - // Emotion theme typing - "./emotion.d.ts" - ], - "exclude": [ - "target/**/*" - ], - "kbn_references": [ - "@kbn/i18n", - "@kbn/i18n-react", - "@kbn/shared-ux-router", - "@kbn/core", - "@kbn/rule-data-utils", - "@kbn/triggers-actions-ui-plugin", - "@kbn/observability-plugin", - "@kbn/observability-shared-plugin", - "@kbn/kibana-react-plugin", - "@kbn/shared-ux-link-redirect-app", - "@kbn/kibana-utils-plugin", - "@kbn/slo-schema", - "@kbn/alerting-plugin", - "@kbn/rison", - "@kbn/embeddable-plugin", - "@kbn/embeddable-enhanced-plugin", - "@kbn/lens-plugin", - "@kbn/ui-theme", - "@kbn/es-query", - "@kbn/react-kibana-mount", - "@kbn/cases-plugin", - "@kbn/data-plugin", - "@kbn/core-ui-settings-browser", - "@kbn/charts-plugin", - "@kbn/ui-actions-plugin", - "@kbn/serverless", - "@kbn/data-views-plugin", - "@kbn/rule-registry-plugin", - "@kbn/licensing-plugin", - "@kbn/utility-types", - "@kbn/share-plugin", - "@kbn/presentation-util-plugin", - "@kbn/observability-ai-assistant-plugin", - "@kbn/core-http-browser", - "@kbn/core-chrome-browser", - "@kbn/ingest-pipelines-plugin", - "@kbn/unified-search-plugin", - "@kbn/std", - "@kbn/core-lifecycle-browser", - "@kbn/controls-plugin", - "@kbn/cloud-plugin", - "@kbn/spaces-plugin", - "@kbn/data-view-editor-plugin", - "@kbn/shared-ux-page-kibana-template", - "@kbn/config-schema", - "@kbn/usage-collection-plugin", - "@kbn/alerts-as-data-utils", - "@kbn/logging-mocks", - "@kbn/server-route-repository", - "@kbn/features-plugin", - "@kbn/task-manager-plugin", - "@kbn/core-saved-objects-server", - "@kbn/core-elasticsearch-server", - "@kbn/core-saved-objects-api-server", - "@kbn/calculate-auto", - "@kbn/core-elasticsearch-client-server-mocks", - "@kbn/core-saved-objects-api-server-mocks", - "@kbn/es-types", - "@kbn/logging", - "@kbn/unified-data-table", - "@kbn/cell-actions", - "@kbn/discover-utils", - "@kbn/unified-field-list", - "@kbn/data-view-field-editor-plugin", - "@kbn/discover-plugin", - "@kbn/field-formats-plugin", - "@kbn/core-http-server", - "@kbn/aiops-plugin", - "@kbn/presentation-publishing", - "@kbn/aiops-log-rate-analysis", - "@kbn/data-view-field-editor-plugin", - "@kbn/securitysolution-io-ts-utils", - "@kbn/core-elasticsearch-server-mocks", - "@kbn/datemath", - "@kbn/presentation-containers", - "@kbn/dashboard-plugin", - "@kbn/monaco", - "@kbn/code-editor", - "@kbn/react-kibana-context-render", - "@kbn/core-application-browser", - "@kbn/core-theme-browser", - "@kbn/ebt-tools", - "@kbn/observability-alerting-rule-utils", - "@kbn/discover-shared-plugin", - "@kbn/server-route-repository-client", - "@kbn/security-plugin-types-public", - ] -} diff --git a/x-pack/plugins/rule_registry/common/schemas/README.md b/x-pack/plugins/rule_registry/common/schemas/README.md index 7995cd8aab0e7..488b3dc20de4b 100644 --- a/x-pack/plugins/rule_registry/common/schemas/README.md +++ b/x-pack/plugins/rule_registry/common/schemas/README.md @@ -1 +1 @@ -See x-pack/plugins/security_solution/common/detection_engine/schemas/alerts/README.md for full description of versioned alert schema strategy and how it's used in the Security Solution's Detection Engine. +See x-pack/solutions/security/plugins/security_solution/common/detection_engine/schemas/alerts/README.md for full description of versioned alert schema strategy and how it's used in the Security Solution's Detection Engine. diff --git a/x-pack/plugins/rule_registry/server/routes/utils/route_validation.ts b/x-pack/plugins/rule_registry/server/routes/utils/route_validation.ts index 910d712a75d75..37c6ae217cb30 100644 --- a/x-pack/plugins/rule_registry/server/routes/utils/route_validation.ts +++ b/x-pack/plugins/rule_registry/server/routes/utils/route_validation.ts @@ -33,7 +33,7 @@ type RequestValidationResult<T> = }; /** - * Copied from x-pack/plugins/security_solution/server/utils/build_validation/route_validation.ts + * Copied from x-pack/solutions/security/plugins/security_solution/server/utils/build_validation/route_validation.ts * This really should be in @kbn/securitysolution-io-ts-utils rather than copied yet again, however, this has types * from a lot of places such as RouteValidationResultFactory from core/server which in turn can pull in @kbn/schema * which cannot work on the front end and @kbn/securitysolution-io-ts-utils works on both front and backend. diff --git a/x-pack/plugins/screenshotting/README.md b/x-pack/plugins/screenshotting/README.md deleted file mode 100644 index 8138be53dc8f4..0000000000000 --- a/x-pack/plugins/screenshotting/README.md +++ /dev/null @@ -1,156 +0,0 @@ -# Kibana Screenshotting - -This plugin provides functionality to take screenshots of the Kibana pages. -It uses Chromium and Puppeteer underneath to run the browser in headless mode. - -## Capabilities -- Canvas workpads screenshots. -- Dashboards screenshots. -- Expressions screenshots. -- PDF generation. -- Batch screenshotting. - -## Usage - -### Getting started -After listing the `screenshotting` plugin in your dependencies, the plugin will be intitalized on the setup stage. -The intitalization process downloads (if it is not already present) and verifies the Chromium build. - -The start contract exposes a public API to interact with the plugin. -Apart from the actual screenshotting functionality, it also provides a way for self-diagnostics. - -Here is an example of how you can take a screenshot of a Kibana URL. - -```typescript -import { lastValueFrom } from 'rxjs'; -import type { CoreSetup, Plugin } from 'src/core/server'; -import type { ScreenshottingStart } from 'x-pack/plugins/screenshotting/server'; - - -interface StartDeps { - screenshotting: ScreenshottingStart; -} - -class ExamplePlugin implements Plugin<void, void, void, StartDeps> { - setup({ http, getStartServices }: CoreSetup<StartDeps>) { - const router = http.createRouter(); - - router.get( - { - path: '/api/capture', - validate: { - query: schema.object({ - id: schema.string(), - }), - }, - }, - async (context, request, response) => { - const [, { screenshotting }] = await getStartServices(); - const { metrics, results } = await lastValueFrom( - screenshotting.getScreenshots({ - request, - urls: [`http://localhost/app/canvas#/workpad/workpad-${request.query.id}`], - }) - ); - - return response.ok({ - body: JSON.stringify({ - metrics, - image: results[0]?.screenshots[0]?.data.toString('base64'), - errors: results[0]?.renderErrors, - } as ScreenshottingExpressionResponse), - }); - } - ); - } - - start() {} -} - -export function plugin() { - return new ExamplePlugin(); -} -``` - -### API -Please use automatically generated API reference or generated TypeDoc comments to find the complete documentation. - -#### `getScreenshots(options): Observable` -Takes screenshots of multiple pages or an expression and returns an observable with the screenshotting results. - -The `options` parameter is an object with parameters of the screenshotting session. -Option | Required | Default | Description ---- | :---: | --- | --- -`browserTimezone` | no | _none_ | The browser timezone that will be emulated in the browser instance. This option should be used to keep timezone on server and client in sync. -`expression` | no | _none_ | An expression to capture screenshot of. Mutually exclusive with the `urls` parameter. -`format` | no | `'png'` | An output format. It can either be PDF or PNG. In case of capturing multiple URLs, all the screenshots will be combined into one document for PDF format. For PNG format, an array of screenshots will be returned. -`headers` | no | _none_ | Custom headers to be sent with each request. The headers will be used for authorization. -`input` | no | `undefined` | The expression input. -`layout` | no | `{}` | Page layout parameters describing characteristics of the capturing screenshot (e.g., dimensions, zoom, etc.). -`request` | no | _none_ | Kibana Request reference to extract headers from. -`timeouts` | no | _none_ | Timeouts for each phase of the screenshot. -`timeouts.openUrl` | no | (kibana.yml setting) | The timeout in milliseconds to allow the Chromium browser to wait for the "Loading…" screen to dismiss and find the initial data for the page. If the time is exceeded, a screenshot is captured showing the current page, and the result structure contains an error message. -`timeouts.renderComplete` | no | (kibana.yml setting) | The timeout in milliseconds to allow the Chromium browser to wait for all visualizations to fetch and render the data. If the time is exceeded, a screenshot is captured showing the current page, and the result structure contains an error message. -`timeouts.waitForElements` | no | (kibana.yml setting) | The timeout in milliseconds to allow the Chromium browser to wait for all visualization panels to load on the page. If the time is exceeded, a screenshot is captured showing the current page, and the result structure contains an error message. -`urls` | no | `[]` | The list or URL to take screenshots of. Every item can either be a string or a tuple containing a URL and a context. The contextual data can be gathered using the screenshot mode plugin. Mutually exclusive with the `expression` parameter. - -#### `diagnose(flags?: string[]): Observable` -Runs browser diagnostics. -The diagnostic implementation launches Chromium and emits the output in the resulting observable. - -There is a way to override some Chromium command line arguments using the `flags` parameter. - -### Configuration -Option | Default | Description ---- | --- | --- -`xpack.screenshotting.networkPolicy.enabled` | `true` | Capturing a screenshot from a Kibana page involves sending out requests for all the linked web assets. For example, a Markdown visualization can show an image from a remote server. -`xpack.screenshotting.networkPolicy.rules` | Allow http, https, ws, wss, and data. | A policy is specified as an array of objects that describe what to allow or deny based on a host or protocol. If a host or protocol is not specified, the rule matches any host or protocol. -`xpack.screenshotting.browser.autoDownload` | Depends on the `dist` parameter. | Flag to automatically download chromium distribution. -`xpack.screenshotting.browser.chromium.disableSandbox` | Defaults to `false` for all operating systems except Debian and Red Hat Linux, which use `true`. | It is recommended that you research the feasibility of enabling unprivileged user namespaces. An exception is if you are running Kibana in Docker because the container runs in a user namespace with the built-in seccomp/bpf filters. For more information, refer to [Chromium sandbox](https://chromium.googlesource.com/chromium/src/+/HEAD/docs/linux/sandboxing.md). -`xpack.screenshotting.browser.chromium.proxy.enabled` | `false` | Enables the proxy for Chromium to use. -`xpack.screenshotting.browser.chromium.proxy.server` | _none_ | The uri for the proxy server. Providing the username and password for the proxy server via the uri is not supported. -`xpack.screenshotting.browser.chromium.proxy.bypass` | `[]` | An array of hosts that should not go through the proxy server and should use a direct connection instead. Examples of valid entries are "elastic.co", "*.elastic.co", ".elastic.co", ".elastic.co:5601". - -## How It Works -```mermaid -sequenceDiagram - participant User - participant Screenshotting - participant Browser - - User ->> Screenshotting: API call - Screenshotting ->> Browser: Launch browser - activate Browser - Screenshotting ->> Browser: Create page - Screenshotting ->> Browser: Set parameters - Note over Screenshotting,Browser: timezone - - Screenshotting ->> Browser: Open URL - Screenshotting ->> Browser: Set contextual data - Note over Screenshotting,Browser: custom context, screenshot mode flag - Browser ->> Screenshotting: Rendering - - Screenshotting ->> Browser: Wait for visualizations - Note over Screenshotting,Browser: poll for a number of DOM nodes to match <br> the number of dashboard elements - Screenshotting ->> Browser: Wait for render completion - Note over Screenshotting,Browser: poll for selectors indicating rendering completion - Browser ->> Screenshotting: Page is ready - - Screenshotting ->> Browser: Take screenshot - Browser ->> Screenshotting: Return PNG buffer - Screenshotting ->> User: Return screenshot -``` - -## Testing -### Integration -There is an example plugin that demonstrates integration with the screenshotting plugin. That plugin utilizes expression capturing. - -### Chromium Downloads -To download all Chromium browsers for all platforms and architectures: - -```bash -cd x-pack -npx gulp downloadChromium -``` - -This command is used to provision CI workspaces so that Chromium does not need to be downloaded for every CI run. diff --git a/x-pack/plugins/screenshotting/jest.config.js b/x-pack/plugins/screenshotting/jest.config.js deleted file mode 100644 index a02d667f86a19..0000000000000 --- a/x-pack/plugins/screenshotting/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../..', - roots: ['<rootDir>/x-pack/plugins/screenshotting'], - coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/screenshotting', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['<rootDir>/x-pack/plugins/screenshotting/server/**/*.{ts}'], -}; diff --git a/x-pack/plugins/screenshotting/jest.integration.config.js b/x-pack/plugins/screenshotting/jest.integration.config.js deleted file mode 100644 index 45a65c93c6af3..0000000000000 --- a/x-pack/plugins/screenshotting/jest.integration.config.js +++ /dev/null @@ -1,12 +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. - */ - -module.exports = { - preset: '@kbn/test/jest_integration', - rootDir: '../../..', - roots: ['<rootDir>/x-pack/plugins/screenshotting'], -}; diff --git a/x-pack/plugins/screenshotting/tsconfig.json b/x-pack/plugins/screenshotting/tsconfig.json deleted file mode 100644 index 5e37b84bbf2e9..0000000000000 --- a/x-pack/plugins/screenshotting/tsconfig.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - "../../../typings/**/*" - ], - "kbn_references": [ - "@kbn/core", - { "path": "../../../src/setup_node_env/tsconfig.json" }, - "@kbn/expressions-plugin", - "@kbn/screenshot-mode-plugin", - "@kbn/cloud-plugin", - "@kbn/utility-types", - "@kbn/logging", - "@kbn/std", - "@kbn/i18n", - "@kbn/utils", - "@kbn/core-logging-server-mocks", - "@kbn/logging-mocks", - "@kbn/core-http-server", - "@kbn/core-plugins-server", - "@kbn/task-manager-plugin", - "@kbn/screenshotting-server", - ], - "exclude": [ - "target/**/*", - ] -} diff --git a/x-pack/plugins/search_assistant/public/components/nav_control/index.tsx b/x-pack/plugins/search_assistant/public/components/nav_control/index.tsx index a341fdbe81412..f75eff1042eb6 100644 --- a/x-pack/plugins/search_assistant/public/components/nav_control/index.tsx +++ b/x-pack/plugins/search_assistant/public/components/nav_control/index.tsx @@ -5,7 +5,7 @@ * 2.0. */ import React, { useEffect, useRef, useState } from 'react'; -import { AssistantAvatar, useAbortableAsync } from '@kbn/observability-ai-assistant-plugin/public'; +import { useAbortableAsync } from '@kbn/observability-ai-assistant-plugin/public'; import { EuiButton, EuiLoadingSpinner, EuiToolTip, useEuiTheme } from '@elastic/eui'; import { css } from '@emotion/react'; import { v4 } from 'uuid'; @@ -19,6 +19,7 @@ import type { CoreStart } from '@kbn/core/public'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { KibanaThemeProvider } from '@kbn/react-kibana-context-theme'; import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app'; +import { AssistantIcon } from '@kbn/ai-assistant-icon'; interface NavControlWithProviderDeps { coreStart: CoreStart; @@ -123,7 +124,7 @@ export function NavControl() { fullWidth={false} minWidth={0} > - {chatService.loading ? <EuiLoadingSpinner size="s" /> : <AssistantAvatar size="xs" />} + {chatService.loading ? <EuiLoadingSpinner size="s" /> : <AssistantIcon size="m" />} </EuiButton> </EuiToolTip> {chatService.value && diff --git a/x-pack/plugins/search_assistant/tsconfig.json b/x-pack/plugins/search_assistant/tsconfig.json index 30002038bbc2d..f29f624ab46ea 100644 --- a/x-pack/plugins/search_assistant/tsconfig.json +++ b/x-pack/plugins/search_assistant/tsconfig.json @@ -28,7 +28,8 @@ "@kbn/licensing-plugin", "@kbn/ml-plugin", "@kbn/share-plugin", - "@kbn/triggers-actions-ui-plugin" + "@kbn/triggers-actions-ui-plugin", + "@kbn/ai-assistant-icon" ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/search_notebooks/public/components/notebooks_button.tsx b/x-pack/plugins/search_notebooks/public/components/notebooks_button.tsx index 66fc50a03ddd7..d71cade82aae7 100644 --- a/x-pack/plugins/search_notebooks/public/components/notebooks_button.tsx +++ b/x-pack/plugins/search_notebooks/public/components/notebooks_button.tsx @@ -30,7 +30,7 @@ export const SearchNotebooksButton = ({ if (activeView) { return ( <EuiButton - color="success" + color="primary" fill onClick={onClick} size="s" @@ -47,7 +47,7 @@ export const SearchNotebooksButton = ({ } return ( <EuiButtonEmpty - color="success" + color="primary" onClick={onClick} size="s" iconType="documentation" diff --git a/x-pack/plugins/security_solution/README.md b/x-pack/plugins/security_solution/README.md deleted file mode 100644 index 1bca44e88e721..0000000000000 --- a/x-pack/plugins/security_solution/README.md +++ /dev/null @@ -1,144 +0,0 @@ -# Security Solution - -Welcome to the Kibana Security Solution plugin! This README will go over getting started with development and testing. - -## Development - -## Tests - -The endpoint specific tests leverage the ingest manager to install the endpoint package. Before the api integration -and functional tests are run the ingest manager is initialized. This initialization process includes reaching out to -a package registry service to install the endpoint package. The endpoint tests support three different ways to run -the tests given the constraint on an available package registry. - -1. Using Docker -2. Running your own local package registry -3. Using the default external package registry - -These scenarios will be outlined the sections below. - -### Endpoint API Integration Tests Location - -The endpoint api integration tests are located [here](../../test/security_solution_endpoint_api_int) - -### Endpoint Functional Tests Location - -The endpoint functional tests are located [here](../../test/security_solution_endpoint) - -### Using Docker - -To run the tests using the recommended docker image version you must have `docker` installed. The testing infrastructure -will stand up a docker container using the image defined [here](../../test/fleet_api_integration/config.ts#L15) - -Make sure you're in the Kibana root directory. - -#### Endpoint API Integration Tests - -In one terminal, run: - -```bash -FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:server --config x-pack/test/security_solution_endpoint_api_int/config.ts -``` - -In another terminal, run: - -```bash -FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/security_solution_endpoint_api_int/config.ts -``` - -#### Endpoint Functional Tests - -In one terminal, run: - -```bash -FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:server --config x-pack/test/security_solution_endpoint/config.ts -``` - -In another terminal, run: - -```bash -FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/security_solution_endpoint/config.ts -``` - -### Running your own package registry - -If you are doing endpoint package development it will be useful to run your own package registry to serve the latest package you're building. -To do this use the following commands: - -Make sure you're in the Kibana root directory. - -#### Endpoint API Integration Tests - -In one terminal, run: - -```bash -PACKAGE_REGISTRY_URL_OVERRIDE=<url to your package registry like http://localhost:8080> yarn test:ftr:server --config x-pack/test/security_solution_endpoint_api_int/config.ts -``` - -In another terminal, run: - -```bash -PACKAGE_REGISTRY_URL_OVERRIDE=<url to your package registry like http://localhost:8080> yarn test:ftr:runner --config x-pack/test/security_solution_endpoint_api_int/config.ts -``` - -#### Endpoint Functional Tests - -In one terminal, run: - -```bash -PACKAGE_REGISTRY_URL_OVERRIDE=<url to your package registry like http://localhost:8080> yarn test:ftr:server --config x-pack/test/security_solution_endpoint/config.ts -``` - -In another terminal, run: - -```bash -PACKAGE_REGISTRY_URL_OVERRIDE=<url to your package registry like http://localhost:8080> yarn test:ftr:runner --config x-pack/test/security_solution_endpoint/config.ts -``` - -### Using the default public registry - -If you don't have docker installed and don't want to run your own registry, you can run the tests using the ingest manager's default public package registry. The actual package registry used is [here](../../plugins/fleet/common/constants/epm.ts#L9) - -Make sure you're in the Kibana root directory. - -#### Endpoint API Integration Tests - -In one terminal, run: - -```bash -yarn test:ftr:server --config x-pack/test/security_solution_endpoint_api_int/config.ts -``` - -In another terminal, run: - -```bash -yarn test:ftr:runner --config x-pack/test/security_solution_endpoint_api_int/config.ts -``` - -#### Endpoint Functional Tests - -In one terminal, run: - -```bash -yarn test:ftr:server --config x-pack/test/security_solution_endpoint/config.ts -``` - -In another terminal, run: - -```bash -yarn test:ftr:runner --config x-pack/test/security_solution_endpoint/config.ts -``` - -#### Generate huge amount of indices with huge amount of fields - -The result of this operation will be 10 separate bucket folders within `mappings_folder`. Each bucket folder will contain a `mappings.json` file describing 50 indices. - -```bash -yarn mappings:generate --fieldsCount=10000 --indexCount=500 --indexPrefix='.ds-huge' --unmappedRate=.2 --buckets=10 --outputDirectory='mappings_folder' -``` - -#### Load generated mappings - -```bash -yarn mappings:load --mappings-dir='mappings_folder' --es-url=http://username:password@localhost:9200 --kibana-url=http://username:password@localhost:5601/app -``` diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/README.md b/x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/README.md deleted file mode 100644 index 481fb04e5d3f7..0000000000000 --- a/x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# Summary - -Original PR: https://github.com/elastic/kibana/pull/127218 -The goal here is to create a system of schemas that are: - -- Easy to read -- Usable historical records of alert schemas from previous Kibana versions -- Accurate for every field -- Usable on both server and client side - -# Motivation - Development speed and quality - -We have already run into one bug (https://github.com/elastic/kibana/issues/125885) where a required field was not populated in some alert documents. Once a bug ships that creates documents incorrectly, any fix requires user action to initiate a re-index of the alerts in addition to the developer time to create and validate the fix. The changes proposed here would catch this bug at compile time. These sorts of bugs become harder to catch as the schema evolves over time and fields get added, removed, and changed. Keeping the schemas separated by version will help reduce the risk of repeated schema changes over time causing fields to be incorrectly included in or omitted from alert documents. - -We are also spending more time than necessary communicating details of the alerts schema over Slack and Zoom. It will be far more efficient for the code to clearly communicate more details about the alert schema. With a more comprehensive static schema, the knowledge will transfer to new developers more efficiently. - -Static types are a powerful tool for ensuring code correctness. However, each deviation of the static type from the actual runtime structure adds places where developers may need to cast, assert, or use conditional logic to satisfy the compiler. The current static types require frequent workarounds when the static types don't match what developers know or believe is true about the runtime type of the alert documents. These runtime workarounds establish patterns that evade the type system - costing developer time to create and maintain in addition to increasing the risk of bugs due to the additional complexity. Accurate static types are excellent documentation of the data structures we use but it's crucial that the static types are comprehensive to minimize cases where runtime checks are needed. - -# Structure - Common Alert Schema Directory - -The schemas in this directory have 2 primary purposes: (1) separate the alert document schemas from the FieldMaps, and (2) set up a code structure that enables easy versioning of alert schemas. During the Detection Engine migration to the rule registry we used the FieldMaps to define the alert schema, but ended up with numerous type casts and some bugs in the process. This common directory stores the various alert schemas by Kibana version. - -x-pack/plugins/security_solution/common/api/detection_engine/model/alerts initially contains index.ts and one folder, 8.0.0. index.ts imports the schemas from 8.0.0 and re-exports them as ...Latest, denoting that those are the "write" schemas. The reason for this is that as we add new schemas, there are many places server side where we want to ensure that we're writing the latest alert schema. By having index.ts re-export 8.0.0 schemas, when we add make a new alert schema in the future (e.g. adding an additional field in 8.x) we can simply update index.ts to re-export the new schema instead of the previous schema. index.ts also exports a DetectionAlert which is the "read" schema - this type will be maintained as a union of all versioned alert schemas, which is needed to accurately type alerts that are read from the alerts index. - -## Reading vs writing alerts - -When writing code that deals with creating a new alert document, always use the schema from alerts/index.ts, not from a specific version folder. This way when the schema is updated in the future, your code will automatically use the latest alert schema and the static type system will tell us if code is writing alerts that don't conform to the new schema. - -When writing code that deals with reading alerts, it must be able to handle alerts from any schema version. The "read schema" in index.ts DetectionAlert is a union of all of the versioned alert schemas since a valid alert from the .alerts index could be from any version. Initially there is only one versioned schema, so DetectionAlert is identical to DetectionAlert800. - -Generally, Solution code should not be directly importing alert schemas from a specific version. Alert writing code should use the latest schema, and alert reading code should use the union of all schemas. - -## Adding new schemas - -In the future, when we want to add new fields, we should create a new folder named with the version the field is being added in, create the updated schema in the new folder, and update index.ts to re-export the schemas for the new version instead of the previous version. Also, update the "read schema" DetectionAlert type in index.ts to include the new schema in addition to the previous schemas. The schema in the new version folder can either build on the previous version, e.g. 8.4.0 could import the schema from 8.0.0 and simply add a few new fields, or for larger changes the new version could build the schema from scratch. Old schemas should not change when new fields are added! - -## Changing existing schemas - -The schema in the 8.0.0 folder, and any future versioned folders after the version is released, should not be updated with new fields. Old schemas should only be updated if a bug is discovered and it is determined that the schema does not accurately represent the alert documents that were actually written by that version, e.g. if a field is typed as string in the schema but was actually written as string[]. The goal of these schemas is to represent documents accurately as they were written and since we aren't changing the documents that already exist, the schema should generally not change. - -## No changes - -If a version of Kibana makes no changes to the schema, a new folder for that version is not needed. - -# Design decisions - -- Why not combine the FieldMaps and alert schema, creating a single structure that can define both? - FieldMaps are integrated tightly with Elasticsearch mappings already, with minimal support for accurate TypeScript types of the fields. We want to avoid adding tons of extra information in to the FieldMaps that would not be used for the Elasticsearch mappings. Instead later we can write a bit of code to ensure that the alert schemas are compatible with the FieldMap schemas, essentially ensuring that the alert schemas extend the FieldMap schemas. - -- Why is | undefined used in field definitions instead of making fields optional? - Making all fields required, but some | undefined in the type, helps ensure that we don't forget to copy over fields that may be undefined. If the field is optional, e.g. [ALERT_RULE_NOTE]?: string, then the compiler won't complain if the field is completely left out when we build the alert document. However, when it's defined as [ALERT_RULE_NOTE]: string | undefined instead, the field must be explicitly provided when creating an object literal of the alert type - even if the value is undefined. This makes it harder to forget to populate all of the fields. This can be seen in build_alert.ts where removing one of the optional fields from the return value results in a compiler error. - -- Why do we need to version the schemas instead of adding all new fields as | undefined? - Adding new fields as | undefined when they're actually required reduces the accuracy of the schema, which makes it less useful and harder to work with. If we decide to add a new field and always populate it going forward then accurately representing that in the static type makes it easier to work with alerts during the alert creation process. When a field is typed as | undefined but a developer knows that it should always exist, it encourages patterns that fight the type system through type-casting, assertions, using ?? <some default value>, etc. This makes the code harder to read, harder to reason about, and thus harder to maintain because the knowledge of "this field is typed as | undefined but actually always exists here" is not represented in the code and only lives in developers minds. Versioned alert schemas aim to turn the static types into an asset that precisely documents what the alert document structure is. diff --git a/x-pack/plugins/security_solution/common/api/endpoint/README.md b/x-pack/plugins/security_solution/common/api/endpoint/README.md deleted file mode 100644 index d03b376b4d6bc..0000000000000 --- a/x-pack/plugins/security_solution/common/api/endpoint/README.md +++ /dev/null @@ -1,63 +0,0 @@ -## Elastic Defend related APIs developer reference - - -### Directory structure and files - -- All the OpenAPI schemas are located under this directory and organized by sub-directories that reflect the API domain. -- Note that the sub-directory names for individual APIs are defined using snake_case to match the associated API path. -- The `model/` directory stores common schemas for re-use across multiple APIs. - -- Each API has at least the following set of files: - -``` -index.ts -<api_route_name>.ts -<api_route_name>.gen.ts -<api_route_name>.schema.yaml -``` - -#### `index.ts` file - -The `index.ts` file found under each API directory exports both the generated and the kibana config schemas. - - -#### `<api_route_name>.ts` file - -This file contains the Kibana `schema` definition that is used on the server side when the route is registered. This file is manually updated whenever needed. - - -#### `<api_route_name>.schema.yaml` file - -This file defines and describes the API using the OpenAPI standard. - - -#### `<api_route_name>.gen.ts` file - -This is a generated file and should not be updated manually. It contains schema validation code generated using the [Zod library](https://github.com/colinhacks/zod). - - - - - -### Making changes - -1. Update the OpenAPI schema YML file and/or the Kibana schema file (see References below for help with OpenAPI YAML format) -2. Generate/re-generate the Zod schema validation modules: -```shell -yarn --cwd x-pack/plugins/security_solution openapi:generate -``` -3. Create a new bundle with the updated APIs: -```shell -yarn --cwd x-pack/plugins/security_solution openapi:bundle:endpoint-management -``` -4. Ensure that the newly generated files are commited to source - - - -### References - -- [Kibana OpenAPI generator Usage Guide](https://github.com/elastic/kibana/blob/main/packages/kbn-openapi-generator/docs/USAGE_GUIDE.md) -- [Open API documentation](https://spec.openapis.org/oas/v3.0.3#document-structure) -- [Swagger documentation](https://swagger.io/docs/specification/basic-structure/) - - diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/common/response_actions.ts b/x-pack/plugins/security_solution/common/api/endpoint/actions/common/response_actions.ts deleted file mode 100644 index 56b1fafdb5a71..0000000000000 --- a/x-pack/plugins/security_solution/common/api/endpoint/actions/common/response_actions.ts +++ /dev/null @@ -1,33 +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 type { TypeOf } from '@kbn/config-schema'; -import { schema } from '@kbn/config-schema'; - -import { ExecuteActionRequestSchema } from '../response_actions/execute'; -import { EndpointActionGetFileSchema } from '../response_actions/get_file'; -import { ScanActionRequestSchema } from '../response_actions/scan'; -import { IsolateRouteRequestSchema } from '../response_actions/isolate'; -import { UnisolateRouteRequestSchema } from '../response_actions/unisolate'; -import { GetProcessesRouteRequestSchema } from '../response_actions/running_procs'; -import { KillProcessRouteRequestSchema } from '../response_actions/kill_process'; -import { SuspendProcessRouteRequestSchema } from '../response_actions/suspend_process'; -import { UploadActionRequestSchema } from '../response_actions/upload'; - -export const ResponseActionBodySchema = schema.oneOf([ - IsolateRouteRequestSchema.body, - UnisolateRouteRequestSchema.body, - GetProcessesRouteRequestSchema.body, - KillProcessRouteRequestSchema.body, - SuspendProcessRouteRequestSchema.body, - EndpointActionGetFileSchema.body, - ExecuteActionRequestSchema.body, - UploadActionRequestSchema.body, - ScanActionRequestSchema.body, -]); - -export type ResponseActionsRequestBody = TypeOf<typeof ResponseActionBodySchema>; 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 deleted file mode 100644 index d60002d5a060c..0000000000000 --- a/x-pack/plugins/security_solution/common/endpoint/service/response_actions/constants.ts +++ /dev/null @@ -1,213 +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 type { EndpointAuthzKeyList } from '../../types/authz'; - -export const RESPONSE_ACTION_STATUS = ['failed', 'pending', 'successful'] as const; -export type ResponseActionStatus = (typeof RESPONSE_ACTION_STATUS)[number]; - -export const RESPONSE_ACTION_TYPE = ['automated', 'manual'] as const; -export type ResponseActionType = (typeof RESPONSE_ACTION_TYPE)[number]; - -export const RESPONSE_ACTION_AGENT_TYPE = ['endpoint', 'sentinel_one', 'crowdstrike'] as const; -export type ResponseActionAgentType = (typeof RESPONSE_ACTION_AGENT_TYPE)[number]; - -/** - * The Command names that are used in the API payload for the `{ command: '' }` attribute - */ -export const RESPONSE_ACTION_API_COMMANDS_NAMES = [ - 'isolate', - 'unisolate', - 'kill-process', - 'suspend-process', - 'running-processes', - 'get-file', - 'execute', - 'upload', - 'scan', - 'runscript', -] as const; - -export type ResponseActionsApiCommandNames = (typeof RESPONSE_ACTION_API_COMMANDS_NAMES)[number]; - -export const ENABLED_AUTOMATED_RESPONSE_ACTION_COMMANDS: ResponseActionsApiCommandNames[] = [ - 'isolate', - // TODO: TC- Uncomment these when we go GA with automated process actions - // 'kill-process', - // 'suspend-process' -]; - -export type EnabledAutomatedResponseActionsCommands = - (typeof ENABLED_AUTOMATED_RESPONSE_ACTION_COMMANDS)[number]; - -/** - * The list of possible capabilities, reported by the endpoint in the metadata document - */ -export const ENDPOINT_CAPABILITIES = [ - 'isolation', - 'kill_process', - 'suspend_process', - 'running_processes', - 'get_file', - 'execute', - 'upload_file', - 'scan', - 'runscript', -] as const; - -export type EndpointCapabilities = (typeof ENDPOINT_CAPABILITIES)[number]; - -/** - * The list of possible console command names that generate a Response Action to be dispatched - * to the Endpoint. (FYI: not all console commands are response actions) - */ -export const CONSOLE_RESPONSE_ACTION_COMMANDS = [ - 'isolate', - 'release', - 'processes', - 'kill-process', - 'suspend-process', - 'get-file', - 'execute', - 'upload', - 'scan', - 'runscript', -] as const; - -export type ConsoleResponseActionCommands = (typeof CONSOLE_RESPONSE_ACTION_COMMANDS)[number]; - -export type ResponseConsoleRbacControls = - | 'writeHostIsolation' - | 'writeHostIsolationRelease' - | 'writeProcessOperations' - | 'writeFileOperations' - | 'writeExecuteOperations' - | 'writeScanOperations'; - -/** - * maps the console command to the RBAC control (kibana feature control) that is required to access it via console - */ -export const RESPONSE_CONSOLE_ACTION_COMMANDS_TO_RBAC_FEATURE_CONTROL: Record< - ConsoleResponseActionCommands, - ResponseConsoleRbacControls -> = Object.freeze({ - isolate: 'writeHostIsolation', - release: 'writeHostIsolationRelease', - 'kill-process': 'writeProcessOperations', - 'suspend-process': 'writeProcessOperations', - processes: 'writeProcessOperations', - 'get-file': 'writeFileOperations', - execute: 'writeExecuteOperations', - upload: 'writeFileOperations', - scan: 'writeScanOperations', - runscript: 'writeExecuteOperations', -}); - -export const RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP = Object.freeze< - Record<ResponseActionsApiCommandNames, ConsoleResponseActionCommands> ->({ - isolate: 'isolate', - unisolate: 'release', - execute: 'execute', - 'get-file': 'get-file', - 'running-processes': 'processes', - 'kill-process': 'kill-process', - 'suspend-process': 'suspend-process', - upload: 'upload', - scan: 'scan', - runscript: 'runscript', -}); - -export const RESPONSE_CONSOLE_COMMAND_TO_API_COMMAND_MAP = Object.freeze< - Record<ConsoleResponseActionCommands, ResponseActionsApiCommandNames> ->({ - isolate: 'isolate', - release: 'unisolate', - execute: 'execute', - 'get-file': 'get-file', - processes: 'running-processes', - 'kill-process': 'kill-process', - 'suspend-process': 'suspend-process', - upload: 'upload', - scan: 'scan', - runscript: 'runscript', -}); - -export const RESPONSE_CONSOLE_ACTION_COMMANDS_TO_ENDPOINT_CAPABILITY = Object.freeze< - Record<ConsoleResponseActionCommands, EndpointCapabilities> ->({ - isolate: 'isolation', - release: 'isolation', - execute: 'execute', - 'get-file': 'get_file', - processes: 'running_processes', - 'kill-process': 'kill_process', - 'suspend-process': 'suspend_process', - upload: 'upload_file', - scan: 'scan', - runscript: 'runscript', -}); - -/** - * The list of console commands mapped to the required EndpointAuthz to access that command - */ -export const RESPONSE_CONSOLE_ACTION_COMMANDS_TO_REQUIRED_AUTHZ = Object.freeze< - Record<ConsoleResponseActionCommands, EndpointAuthzKeyList[number]> ->({ - isolate: 'canIsolateHost', - release: 'canUnIsolateHost', - execute: 'canWriteExecuteOperations', - 'get-file': 'canWriteFileOperations', - upload: 'canWriteFileOperations', - processes: 'canGetRunningProcesses', - 'kill-process': 'canKillProcess', - 'suspend-process': 'canSuspendProcess', - scan: 'canWriteScanOperations', - runscript: 'canWriteExecuteOperations', -}); - -// 4 hrs in seconds -// 4 * 60 * 60 -export const DEFAULT_EXECUTE_ACTION_TIMEOUT = 14400; - -/** - * The passcodes used for accessing the content of a zip file (ex. from a `get-file` response action) - */ -export const RESPONSE_ACTIONS_ZIP_PASSCODE: Readonly<Record<ResponseActionAgentType, string>> = - Object.freeze({ - endpoint: 'elastic', - sentinel_one: 'Elastic@123', - crowdstrike: 'tbd..', - }); - -/** - * Map of Agent Type to alert fields that holds the Agent ID for that agent type. - * Multiple alert fields are supported since different data sources define the agent - * id in different paths. - * - * NOTE: there are utilities in `x-pack/plugins/security_solution/public/common/lib/endpoint/utils` - * that facilitate working with alert (ECS) fields to determine if the give event/alert supports - * response actions, including: - * - `getAgentTypeForAgentIdField()` - * - `getEventDetailsAgentIdField()` - * - `isResponseActionsAlertAgentIdField()` - */ -export const RESPONSE_ACTIONS_ALERT_AGENT_ID_FIELDS: Readonly< - Record<ResponseActionAgentType, string[]> -> = Object.freeze({ - endpoint: ['agent.id'], - sentinel_one: [ - 'sentinel_one.alert.agent.id', - 'sentinel_one.threat.agent.id', - 'sentinel_one.activity.agent.id', - 'sentinel_one.agent.agent.id', - ], - crowdstrike: ['device.id'], -}); - -export const SUPPORTED_AGENT_ID_ALERT_FIELDS: Readonly<string[]> = Object.values( - RESPONSE_ACTIONS_ALERT_AGENT_ID_FIELDS -).flat(); diff --git a/x-pack/plugins/security_solution/common/jest.config.js b/x-pack/plugins/security_solution/common/jest.config.js deleted file mode 100644 index ee73875c3d5e9..0000000000000 --- a/x-pack/plugins/security_solution/common/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/common'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/common', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/common/**/*.{ts,tsx}'], - moduleNameMapper: require('../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/common/siem_migrations/constants.ts b/x-pack/plugins/security_solution/common/siem_migrations/constants.ts deleted file mode 100644 index 531669608ed8b..0000000000000 --- a/x-pack/plugins/security_solution/common/siem_migrations/constants.ts +++ /dev/null @@ -1,62 +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 type { Severity } from '@kbn/securitysolution-io-ts-alerting-types'; - -export const SIEM_MIGRATIONS_PATH = '/internal/siem_migrations' as const; -export const SIEM_RULE_MIGRATIONS_PATH = `${SIEM_MIGRATIONS_PATH}/rules` as const; - -export const SIEM_RULE_MIGRATIONS_ALL_STATS_PATH = `${SIEM_RULE_MIGRATIONS_PATH}/stats` as const; -export const SIEM_RULE_MIGRATION_CREATE_PATH = - `${SIEM_RULE_MIGRATIONS_PATH}/{migration_id?}` as const; -export const SIEM_RULE_MIGRATION_PATH = `${SIEM_RULE_MIGRATIONS_PATH}/{migration_id}` as const; -export const SIEM_RULE_MIGRATION_START_PATH = `${SIEM_RULE_MIGRATION_PATH}/start` as const; -export const SIEM_RULE_MIGRATION_RETRY_PATH = `${SIEM_RULE_MIGRATION_PATH}/retry` as const; -export const SIEM_RULE_MIGRATION_STATS_PATH = `${SIEM_RULE_MIGRATION_PATH}/stats` as const; -export const SIEM_RULE_MIGRATION_TRANSLATION_STATS_PATH = - `${SIEM_RULE_MIGRATION_PATH}/translation_stats` as const; -export const SIEM_RULE_MIGRATION_STOP_PATH = `${SIEM_RULE_MIGRATION_PATH}/stop` as const; -export const SIEM_RULE_MIGRATION_INSTALL_PATH = `${SIEM_RULE_MIGRATION_PATH}/install` as const; -export const SIEM_RULE_MIGRATION_INSTALL_TRANSLATED_PATH = - `${SIEM_RULE_MIGRATION_PATH}/install_translated` as const; -export const SIEM_RULE_MIGRATIONS_PREBUILT_RULES_PATH = - `${SIEM_RULE_MIGRATION_PATH}/prebuilt_rules` as const; - -export const SIEM_RULE_MIGRATION_RESOURCES_PATH = `${SIEM_RULE_MIGRATION_PATH}/resources` as const; -export const SIEM_RULE_MIGRATION_RESOURCES_MISSING_PATH = - `${SIEM_RULE_MIGRATION_RESOURCES_PATH}/missing` as const; - -export enum SiemMigrationTaskStatus { - READY = 'ready', - RUNNING = 'running', - STOPPED = 'stopped', - FINISHED = 'finished', -} - -export enum SiemMigrationStatus { - PENDING = 'pending', - PROCESSING = 'processing', - COMPLETED = 'completed', - FAILED = 'failed', -} - -export enum SiemMigrationRuleTranslationResult { - FULL = 'full', - PARTIAL = 'partial', - UNTRANSLATABLE = 'untranslatable', -} - -export const DEFAULT_TRANSLATION_RISK_SCORE = 21; -export const DEFAULT_TRANSLATION_SEVERITY: Severity = 'low'; - -export const DEFAULT_TRANSLATION_FIELDS = { - risk_score: DEFAULT_TRANSLATION_RISK_SCORE, - severity: DEFAULT_TRANSLATION_SEVERITY, - from: 'now-360s', - to: 'now', - interval: '5m', -} as const; diff --git a/x-pack/plugins/security_solution/docs/openapi/README.md b/x-pack/plugins/security_solution/docs/openapi/README.md deleted file mode 100644 index 4031201348bfa..0000000000000 --- a/x-pack/plugins/security_solution/docs/openapi/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# Security Solution API reference documentation - -Documentation about Security Solution OpenAPI bundling workflow and configuration. See [Kibana wide docs](../../../../../oas_docs/README.md) for general information. - -## Workflow - -Security Solution uses **specification first approach**. It means we define OpenAPI spec files describing individual API endpoints (also known as source OpenAPI specs) at first. After that we use tooling in particular [`kbn-openapi-bundler`](../../../../../packages/kbn-openapi-bundler/README.md) to process source OpenAPI specs to produce domain OpenAPI bundles. - -The workflow consists of multiple steps and visualized below - -![workflow diagram](workflow.png) - -This document describes **step 0** implemented on Security Solution's side. - -#### Bundling automation (CI integration) - -Bundling Security Solution domain OpenAPI bundles is **Step 0** of the workflow. To keep the domain OpenAPI bundles always up-to-date and in sync with the source OpenAPI specs, the bundling runs as part of the `Checks` step in CI on every PR build and on merge builds. If there are any changes to the source OpenAPI files, these changes get propagated to the domain OpenAPI bundles and CI commits the changes. In that case the build is marked as failed and needs to be restarted. - -### API Domains - -Security Solution has multiple API domains scattered across Kibana. Currently the following API domains are handled in the workflow: - -- Security AI Assistant - - - Bundling script: `x-pack/platform/packages/shared/kbn-elastic-assistant-common/scripts/openapi/bundle.js` - - Bundles location: `x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/{ess|serverless}` - -- Security Detections - - - Bundling script: `x-pack/plugins/security_solution/scripts/openapi/bundle_detections.js` - - Bundles location: `x-pack/plugins/security_solution/docs/openapi/{ess|serverless}` - -- Security Endpoint Exceptions - - - Bundling script: `packages/kbn-securitysolution-endpoint-exceptions-common/scripts/openapi_bundle.js` - - Bundles location: `packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/{ess|serverless}` - -- Security Endpoint Management - - - Bundling script: `x-pack/plugins/security_solution/scripts/openapi/bundle_endpoint_management.js` - - Bundles location: `x-pack/plugins/security_solution/docs/openapi/{ess|serverless}` - -- Security Endpoint Management - - - Bundling script: `x-pack/plugins/security_solution/scripts/openapi/bundle_entity_analytics.js` - - Bundles location: `x-pack/plugins/security_solution/docs/openapi/{ess|serverless}` - -- Security Security Exceptions - - - Bundling script: `packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle.js` - - Bundles location: `packages/kbn-securitysolution-exceptions-common/docs/openapi/{ess|serverless}` - -- Security Lists - - - Bundling script: `packages/kbn-securitysolution-lists-common/scripts/openapi_bundle.js` - - Bundles location: `packages/kbn-securitysolution-lists-common/docs/openapi/{ess|serverless}` - -- Security Osquery - - - Bundling script: `x-pack/platform/plugins/shared/osquery/scripts/openapi/bundle.js` - - Bundles location: `x-pack/platform/plugins/shared/osquery/docs/openapi/{ess|serverless}` - -- Security Timeline - - - Bundling script: `x-pack/plugins/security_solution/scripts/openapi/bundle_timeline.js` - - Bundles location: `x-pack/plugins/security_solution/docs/openapi/{ess|serverless}` diff --git a/x-pack/plugins/security_solution/jest.config.dev.js b/x-pack/plugins/security_solution/jest.config.dev.js deleted file mode 100644 index 1aaace56c5f88..0000000000000 --- a/x-pack/plugins/security_solution/jest.config.dev.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../', - projects: [ - '<rootDir>/x-pack/plugins/security_solution/common/*/jest.config.js', - '<rootDir>/x-pack/plugins/security_solution/server/*/jest.config.js', - '<rootDir>/x-pack/plugins/security_solution/public/*/jest.config.js', - '<rootDir>/x-pack/plugins/security_solution/scripts/junit_transformer/*/jest.config.js', - ], -}; diff --git a/x-pack/plugins/security_solution/jest.integration.config.js b/x-pack/plugins/security_solution/jest.integration.config.js deleted file mode 100644 index 046faf5e6198c..0000000000000 --- a/x-pack/plugins/security_solution/jest.integration.config.js +++ /dev/null @@ -1,12 +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. - */ - -module.exports = { - preset: '@kbn/test/jest_integration', - rootDir: '../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution'], -}; diff --git a/x-pack/plugins/security_solution/package.json b/x-pack/plugins/security_solution/package.json deleted file mode 100644 index fd1be833c5d6b..0000000000000 --- a/x-pack/plugins/security_solution/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "author": "Elastic", - "name": "@kbn/security-solution-plugin", - "version": "1.0.0", - "private": true, - "license": "Elastic License 2.0", - "scripts": { - "extract-mitre-attacks": "node scripts/extract_tactics_techniques_mitre.js && node ../../../scripts/eslint ./public/detections/mitre/mitre_tactics_techniques.ts --fix", - "build-beat-doc": "node scripts/beat_docs/build.js && node ../../../scripts/eslint ../timelines/server/utils/beat_schema/fields.ts --fix", - "cypress": "NODE_OPTIONS=--openssl-legacy-provider ../../../node_modules/.bin/cypress", - "cypress:burn": "yarn cypress:dw run --env burn=2 --headed", - "cypress:changed-specs-only": "yarn cypress:dw run --changed-specs-only --env burn=2", - "cypress:dw": "NODE_OPTIONS=--openssl-legacy-provider node ./scripts/start_cypress_parallel --config-file ./public/management/cypress/cypress.config.ts --ftr-config-file ../../test/defend_workflows_cypress/cli_config", - "cypress:dw:open": "yarn cypress:dw open", - "cypress:dw:run": "yarn cypress:dw run", - "cypress:dw:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ./scripts/start_cypress_parallel --config-file ./public/management/cypress/cypress_serverless.config.ts --ftr-config-file ../../test/defend_workflows_cypress/serverless_config", - "cypress:dw:serverless:open": "yarn cypress:dw:serverless open", - "cypress:dw:serverless:run": "yarn cypress:dw:serverless run", - "cypress:dw:qa:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ./scripts/start_cypress_parallel_serverless --config-file ./public/management/cypress/cypress_serverless_qa.config.ts", - "cypress:dw:qa:serverless:run": "yarn cypress:dw:qa:serverless run", - "cypress:dw:serverless:changed-specs-only": "yarn cypress:dw:serverless run --changed-specs-only --env burn=2", - "cypress:dw:endpoint": "echo '\n** WARNING **: Run script `cypress:dw:endpoint` no longer valid! Use `cypress:dw` instead\n'", - "cypress:dw:endpoint:run": "echo '\n** WARNING **: Run script `cypress:dw:endpoint:run` no longer valid! Use `cypress:dw:run` instead\n'", - "cypress:dw:endpoint:open": "echo '\n** WARNING **: Run script `cypress:dw:endpoint:open` no longer valid! Use `cypress:dw:open` instead\n'", - "junit:merge": "../../../node_modules/.bin/mochawesome-merge ../../../target/kibana-security-solution/cypress/results/mochawesome*.json > ../../../target/kibana-security-solution/cypress/results/output.json && ../../../node_modules/.bin/marge ../../../target/kibana-security-solution/cypress/results/output.json --reportDir ../../../target/kibana-security-solution/cypress/results && yarn junit:transform && mkdir -p ../../../target/junit && cp ../../../target/kibana-security-solution/cypress/results/*.xml ../../../target/junit/", - "test:generate": "node scripts/endpoint/resolver_generator", - "test:generate:serverless-dev": "NODE_TLS_REJECT_UNAUTHORIZED=0 node --no-warnings scripts/endpoint/resolver_generator --node https://elastic_serverless:changeme@127.0.0.1:9200 --kibana http://elastic_serverless:changeme@127.0.0.1:5601", - "mappings:generate": "node scripts/mappings/mappings_generator", - "mappings:load": "node scripts/mappings/mappings_loader", - "siem-migrations:graph:draw": "node scripts/siem_migration/draw_graphs", - "junit:transform": "node scripts/junit_transformer --pathPattern '../../../target/kibana-security-solution/cypress/results/*.xml' --rootDirectory ../../../ --reportName 'Security Solution Cypress' --writeInPlace", - "openapi:generate": "node scripts/openapi/generate", - "openapi:generate:debug": "node --inspect-brk scripts/openapi/generate", - "openapi:bundle:detections": "node scripts/openapi/bundle_detections", - "openapi:bundle:timeline": "node scripts/openapi/bundle_timeline", - "openapi:bundle:entity-analytics": "node scripts/openapi/bundle_entity_analytics", - "openapi:bundle:endpoint-management": "node scripts/openapi/bundle_endpoint_management" - } -} \ No newline at end of file diff --git a/x-pack/plugins/security_solution/public/app/actions/utils.ts b/x-pack/plugins/security_solution/public/app/actions/utils.ts deleted file mode 100644 index 3da597db60c0e..0000000000000 --- a/x-pack/plugins/security_solution/public/app/actions/utils.ts +++ /dev/null @@ -1,34 +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 type { IEmbeddable } from '@kbn/embeddable-plugin/public'; -import { isLensApi } from '@kbn/lens-plugin/public'; -import type { Serializable } from '@kbn/utility-types'; - -// All cell actions are disabled for these fields in Security -const FIELDS_WITHOUT_CELL_ACTIONS = [ - 'signal.rule.risk_score', - 'kibana.alert.risk_score', - 'signal.reason', - 'kibana.alert.reason', -]; - -// @TODO: this is a temporary fix. It needs a better refactor on the consumer side here to -// adapt to the new Embeddable architecture -export const isLensEmbeddable = (embeddable: IEmbeddable): embeddable is IEmbeddable => { - return isLensApi(embeddable); -}; - -export const fieldHasCellActions = (field?: string): boolean => { - return !!field && !FIELDS_WITHOUT_CELL_ACTIONS.includes(field); -}; - -export const isCountField = ( - fieldType: string | undefined, - sourceParamType: Serializable | undefined -) => { - return fieldType === 'number' && sourceParamType === 'value_count'; -}; diff --git a/x-pack/plugins/security_solution/public/app/jest.config.js b/x-pack/plugins/security_solution/public/app/jest.config.js deleted file mode 100644 index 089b6e238c09b..0000000000000 --- a/x-pack/plugins/security_solution/public/app/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/app'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/app', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/app/**/*.{ts,tsx}'], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/assistant/jest.config.js b/x-pack/plugins/security_solution/public/assistant/jest.config.js deleted file mode 100644 index 184141b299f4a..0000000000000 --- a/x-pack/plugins/security_solution/public/assistant/jest.config.js +++ /dev/null @@ -1,19 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/assistant'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/assistant', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution/public/assistant/**/*.{ts,tsx}', - ], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/attack_discovery/jest.config.js b/x-pack/plugins/security_solution/public/attack_discovery/jest.config.js deleted file mode 100644 index bfec7737e4211..0000000000000 --- a/x-pack/plugins/security_solution/public/attack_discovery/jest.config.js +++ /dev/null @@ -1,19 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/attack_discovery'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/attack_discovery', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution/public/attack_discovery/**/*.{ts,tsx}', - ], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/cases/jest.config.js b/x-pack/plugins/security_solution/public/cases/jest.config.js deleted file mode 100644 index e5268f5112f50..0000000000000 --- a/x-pack/plugins/security_solution/public/cases/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/cases'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/cases', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/cases/**/*.{ts,tsx}'], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/jest.config.js b/x-pack/plugins/security_solution/public/cloud_security_posture/jest.config.js deleted file mode 100644 index 6ef34a542da9f..0000000000000 --- a/x-pack/plugins/security_solution/public/cloud_security_posture/jest.config.js +++ /dev/null @@ -1,19 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/cloud_security_posture'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/cloud_security_posture', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution/public/cloud_security_posture/**/*.{ts,tsx}', - ], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/common/components/toasters/index.tsx b/x-pack/plugins/security_solution/public/common/components/toasters/index.tsx deleted file mode 100644 index cc02c6a5eb745..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/toasters/index.tsx +++ /dev/null @@ -1,181 +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 type { EuiGlobalToastListToast as Toast } from '@elastic/eui'; -import { EuiButton, EuiGlobalToastList } from '@elastic/eui'; -import { noop } from 'lodash/fp'; -import type { Dispatch } from 'react'; -import React, { createContext, useContext, useReducer, useState } from 'react'; -import styled from 'styled-components'; - -import { ModalAllErrors } from './modal_all_errors'; -import * as i18n from './translations'; - -export * from './utils'; -export * from './errors'; - -/** - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead - */ -export interface AppToast extends Toast { - // FunFact: In a very rare case of errors this can be something other than array. We have a unit test case for it and am leaving it like this type for now. - errors?: string[]; -} - -/** - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead - */ -interface ToastState { - toasts: AppToast[]; -} - -/** - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead - */ -const initialToasterState: ToastState = { - toasts: [], -}; - -/** - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead - */ -export type ActionToaster = - | { type: 'addToaster'; toast: AppToast } - | { type: 'deleteToaster'; id: string } - | { type: 'toggleWaitToShowNextToast' }; - -/** - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead - */ -export const StateToasterContext = createContext<[ToastState, Dispatch<ActionToaster>]>([ - initialToasterState, - () => noop, -]); - -/** - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead - */ -export const useStateToaster = () => useContext(StateToasterContext); - -/** - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead - */ -interface ManageGlobalToasterProps { - children: React.ReactNode; -} - -/** - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead - */ -export const ManageGlobalToaster = ({ children }: ManageGlobalToasterProps) => { - const reducerToaster = (state: ToastState, action: ActionToaster) => { - switch (action.type) { - case 'addToaster': - return { ...state, toasts: [...state.toasts, action.toast] }; - case 'deleteToaster': - return { ...state, toasts: state.toasts.filter((msg) => msg.id !== action.id) }; - default: - return state; - } - }; - - return ( - <StateToasterContext.Provider value={useReducer(reducerToaster, initialToasterState)}> - {children} - </StateToasterContext.Provider> - ); -}; - -/** - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead - */ -const GlobalToasterListContainer = styled.div` - position: absolute; - right: 0; - bottom: 0; -`; - -/** - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead - */ -interface GlobalToasterProps { - toastLifeTimeMs?: number; -} - -/** - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead - */ -export const GlobalToaster = ({ toastLifeTimeMs = 5000 }: GlobalToasterProps) => { - const [{ toasts }, dispatch] = useStateToaster(); - const [isShowing, setIsShowing] = useState(false); - const [toastInModal, setToastInModal] = useState<AppToast | null>(null); - - const toggle = (toast: AppToast) => { - if (isShowing) { - dispatch({ type: 'deleteToaster', id: toast.id }); - setToastInModal(null); - } else { - setToastInModal(toast); - } - setIsShowing(!isShowing); - }; - - return ( - <> - {toasts.length > 0 && !isShowing && ( - <GlobalToasterListContainer> - <EuiGlobalToastList - toasts={[formatToErrorToastIfNeeded(toasts[0], toggle)]} - dismissToast={({ id }) => { - dispatch({ type: 'deleteToaster', id }); - }} - toastLifeTimeMs={toastLifeTimeMs} - /> - </GlobalToasterListContainer> - )} - {toastInModal != null && ( - <ModalAllErrors isShowing={isShowing} toast={toastInModal} toggle={toggle} /> - )} - </> - ); -}; - -/** - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead - */ -const formatToErrorToastIfNeeded = ( - toast: AppToast, - toggle: (toast: AppToast) => void -): AppToast => { - if (toast != null && toast.errors != null && toast.errors.length > 0) { - toast.text = ( - <ErrorToastContainer> - <EuiButton - data-test-subj="toaster-show-all-error-modal" - size="s" - color="danger" - onClick={() => toast != null && toggle(toast)} - > - {i18n.SEE_ALL_ERRORS} - </EuiButton> - </ErrorToastContainer> - ); - } - return toast; -}; - -/** - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead - */ -const ErrorToastContainer = styled.div` - text-align: right; -`; - -/** - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead - */ -ErrorToastContainer.displayName = 'ErrorToastContainer'; diff --git a/x-pack/plugins/security_solution/public/common/components/toasters/utils.ts b/x-pack/plugins/security_solution/public/common/components/toasters/utils.ts deleted file mode 100644 index 0114cb2cf4a45..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/toasters/utils.ts +++ /dev/null @@ -1,133 +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 type React from 'react'; -import { v4 as uuidv4 } from 'uuid'; -import { isError } from 'lodash/fp'; -import { isAppError } from '@kbn/securitysolution-t-grid'; - -import type { AppToast, ActionToaster } from '.'; -import { isToasterError } from './errors'; - -/** - * Displays an error toast for the provided title and message - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead - * @param errorTitle Title of error to display in toaster and modal - * @param errorMessages Message to display in error modal when clicked - * @param dispatchToaster provided by useStateToaster() - */ -export const displayErrorToast = ( - errorTitle: string, - errorMessages: string[], - dispatchToaster: React.Dispatch<ActionToaster>, - id: string = uuidv4() -): void => { - const toast: AppToast = { - id, - title: errorTitle, - color: 'danger', - iconType: 'error', - errors: errorMessages, - }; - dispatchToaster({ - type: 'addToaster', - toast, - }); -}; - -/** - * Displays a success toast for the provided title and message - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead - * @param title success message to display in toaster and modal - * @param dispatchToaster provided by useStateToaster() - */ -export const displaySuccessToast = ( - title: string, - dispatchToaster: React.Dispatch<ActionToaster>, - id: string = uuidv4() -): void => { - const toast: AppToast = { - id, - title, - color: 'success', - iconType: 'check', - }; - dispatchToaster({ - type: 'addToaster', - toast, - }); -}; - -export type ErrorToToasterArgs = Partial<AppToast> & { - error: unknown; - dispatchToaster: React.Dispatch<ActionToaster>; -}; - -/** - * Displays an error toast with messages parsed from the error. - * - * This has shortcomings and bugs compared to using the use_app_toasts because it takes naive guesses at the - * underlying data structure and does not display much about the error. This is not compatible with bsearch (async search) - * and sometimes can display to the user blank messages. - * - * The use_app_toasts has more feature rich logic and uses the Kibana toaster system to figure out which type of - * error you have in a more robust way then this function does and supersedes this function. - * - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead - * @param title error message to display in toaster and modal - * @param error the error from which messages will be parsed - * @param dispatchToaster provided by useStateToaster() - */ -export const errorToToaster = ({ - id = uuidv4(), - title, - error, - color = 'danger', - iconType = 'error', - dispatchToaster, -}: ErrorToToasterArgs) => { - let toast: AppToast; - - if (isToasterError(error)) { - toast = { - id, - title, - color, - iconType, - errors: error.messages, - }; - } else if (isAppError(error)) { - toast = { - id, - title, - color, - iconType, - errors: [error.body.message], - }; - } else if (isError(error)) { - toast = { - id, - title, - color, - iconType, - errors: [error.message], - }; - } else { - toast = { - id, - title, - color, - iconType, - errors: ['Network Error'], - }; - } - - dispatchToaster({ - type: 'addToaster', - toast, - }); -}; diff --git a/x-pack/plugins/security_solution/public/common/constants.ts b/x-pack/plugins/security_solution/public/common/constants.ts deleted file mode 100644 index c114f70915a75..0000000000000 --- a/x-pack/plugins/security_solution/public/common/constants.ts +++ /dev/null @@ -1,20 +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 { euiLightVars } from '@kbn/ui-theme'; - -export const RISK_COLOR_LOW = euiLightVars.euiColorVis0; -export const RISK_COLOR_MEDIUM = euiLightVars.euiColorVis5; -export const RISK_COLOR_HIGH = euiLightVars.euiColorVis7; -export const RISK_COLOR_CRITICAL = euiLightVars.euiColorVis9; - -export const RISK_SCORE_LOW = 21; -export const RISK_SCORE_MEDIUM = 47; -export const RISK_SCORE_HIGH = 73; -export const RISK_SCORE_CRITICAL = 99; - -export const ONBOARDING_VIDEO_SOURCE = '//play.vidyard.com/K6kKDBbP9SpXife9s2tHNP.html?'; diff --git a/x-pack/plugins/security_solution/public/common/jest.config.js b/x-pack/plugins/security_solution/public/common/jest.config.js deleted file mode 100644 index 1326b2602bf19..0000000000000 --- a/x-pack/plugins/security_solution/public/common/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/common'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/common', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/common/**/*.{ts,tsx}'], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/dashboards/jest.config.js b/x-pack/plugins/security_solution/public/dashboards/jest.config.js deleted file mode 100644 index a2ff7b5c4a1af..0000000000000 --- a/x-pack/plugins/security_solution/public/dashboards/jest.config.js +++ /dev/null @@ -1,19 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/dashboards'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/dashboards', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution/public/dashboards/**/*.{ts,tsx}', - ], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/jest.config.js b/x-pack/plugins/security_solution/public/detection_engine/jest.config.js deleted file mode 100644 index e6bfcc76205f9..0000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/jest.config.js +++ /dev/null @@ -1,19 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/detection_engine'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/detection_engine', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution/public/detection_engine/**/*.{ts,tsx}', - ], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/index.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/index.tsx deleted file mode 100644 index 26c81f325ea18..0000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/index.tsx +++ /dev/null @@ -1,372 +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 { EuiDescriptionList, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { isEmpty, chunk, get, pick, isNumber } from 'lodash/fp'; -import React, { memo, useState } from 'react'; -import styled from 'styled-components'; -import type { ThreatMapping, Threats, Type } from '@kbn/securitysolution-io-ts-alerting-types'; -import type { DataViewBase, Filter } from '@kbn/es-query'; -import { FilterStateStore } from '@kbn/es-query'; -import { FilterManager } from '@kbn/data-plugin/public'; -import type { - RelatedIntegrationArray, - RequiredFieldArray, -} from '../../../../../common/api/detection_engine/model/rule_schema'; -import { buildRelatedIntegrationsDescription } from '../../../../detections/components/rules/related_integrations/integrations_description'; -import { DEFAULT_TIMELINE_TITLE } from '../../../../timelines/components/timeline/translations'; -import type { EqlOptions } from '../../../../../common/search_strategy'; -import { useKibana } from '../../../../common/lib/kibana'; -import type { - AboutStepRiskScore, - AboutStepSeverity, - Duration, -} from '../../../../detections/pages/detection_engine/rules/types'; -import type { FieldValueTimeline } from '../../../rule_creation/components/pick_timeline'; -import type { FormSchema } from '../../../../shared_imports'; -import type { ListItems } from './types'; -import { - buildQueryBarDescription, - buildSeverityDescription, - buildStringArrayDescription, - buildThreatDescription, - buildUnorderedListArrayDescription, - buildUrlsDescription, - buildNoteDescription, - buildRiskScoreDescription, - buildRuleTypeDescription, - buildThresholdDescription, - buildThreatMappingDescription, - buildEqlOptionsDescription, - buildRequiredFieldsDescription, - buildAlertSuppressionDescription, - buildAlertSuppressionWindowDescription, - buildAlertSuppressionMissingFieldsDescription, - buildHighlightedFieldsOverrideDescription, - buildSetupDescription, - getQueryLabel, - buildIntervalDescription, -} from './helpers'; -import * as i18n from './translations'; -import { buildMlJobsDescription } from './build_ml_jobs_description'; -import { buildActionsDescription } from './actions_description'; -import { buildThrottleDescription } from './throttle_description'; -import { THREAT_QUERY_LABEL } from './translations'; -import { filterEmptyThreats } from '../../pages/rule_creation/helpers'; -import { useLicense } from '../../../../common/hooks/use_license'; -import type { LicenseService } from '../../../../../common/license'; -import { - isThresholdRule, - isSuppressionRuleConfiguredWithMissingFields, - isSuppressionRuleConfiguredWithGroupBy, - isSuppressionRuleConfiguredWithDuration, -} from '../../../../../common/detection_engine/utils'; -import { - ALERT_SUPPRESSION_DURATION_FIELD_NAME, - ALERT_SUPPRESSION_DURATION_TYPE_FIELD_NAME, - ALERT_SUPPRESSION_FIELDS_FIELD_NAME, - ALERT_SUPPRESSION_MISSING_FIELDS_FIELD_NAME, -} from '../../../rule_creation/components/alert_suppression_edit'; -import { THRESHOLD_ALERT_SUPPRESSION_ENABLED } from '../../../rule_creation/components/threshold_alert_suppression_edit'; -import type { FieldValueQueryBar } from '../query_bar_field'; - -const DescriptionListContainer = styled(EuiDescriptionList)` - max-width: 600px; - .euiDescriptionList__description { - overflow-wrap: anywhere; - } -`; - -const DESCRIPTION_LIST_COLUMN_WIDTHS: [string, string] = ['50%', '50%']; - -interface StepRuleDescriptionProps<T> { - columns?: 'multi' | 'single' | 'singleSplit'; - data: unknown; - indexPatterns?: DataViewBase; - // @ts-expect-error upgrade typescript v4.9.5 - schema: FormSchema<T>; -} - -export const StepRuleDescriptionComponent = <T,>({ - data, - columns = 'multi', - indexPatterns, - schema, -}: StepRuleDescriptionProps<T>) => { - const kibana = useKibana(); - const license = useLicense(); - const [filterManager] = useState<FilterManager>(new FilterManager(kibana.services.uiSettings)); - - const keys = Object.keys(schema); - const listItems = keys.reduce((acc: ListItems[], key: string) => { - if (key === 'machineLearningJobId') { - return [ - ...acc, - buildMlJobsDescription( - get(key, data) as string[], - (get(key, schema) as { label: string }).label - ), - ]; - } - - if (key === 'throttle') { - return [...acc, buildThrottleDescription(get(key, data), get([key, 'label'], schema))]; - } - - if (key === 'actions') { - return [...acc, buildActionsDescription(get(key, data), get([key, 'label'], schema))]; - } - - return [ - ...acc, - ...buildListItems(data, pick(key, schema), filterManager, license, indexPatterns), - ]; - }, []); - - if (columns === 'multi') { - return ( - <EuiFlexGroup> - {chunk(Math.ceil(listItems.length / 2), listItems).map((chunkListItems, index) => ( - <EuiFlexItem - data-test-subj="listItemColumnStepRuleDescription" - key={`description-step-rule-${index}`} - > - <EuiDescriptionList listItems={chunkListItems} /> - </EuiFlexItem> - ))} - </EuiFlexGroup> - ); - } - - return ( - <EuiFlexGroup> - <EuiFlexItem data-test-subj="listItemColumnStepRuleDescription"> - {columns === 'single' ? ( - <EuiDescriptionList listItems={listItems} /> - ) : ( - <DescriptionListContainer - data-test-subj="singleSplitStepRuleDescriptionList" - type="column" - columnWidths={DESCRIPTION_LIST_COLUMN_WIDTHS} - rowGutterSize="m" - listItems={listItems} - /> - )} - </EuiFlexItem> - </EuiFlexGroup> - ); -}; - -export const StepRuleDescription = memo(StepRuleDescriptionComponent); - -export const buildListItems = <T,>( - data: unknown, - // @ts-expect-error upgrade typescript v4.9.5 - schema: FormSchema<T>, - filterManager: FilterManager, - license: LicenseService, - indexPatterns?: DataViewBase -): ListItems[] => - Object.keys(schema).reduce<ListItems[]>( - (acc, field) => [ - ...acc, - ...getDescriptionItem( - field, - get([field, 'label'], schema), - data, - filterManager, - license, - indexPatterns - ), - ], - [] - ); - -export const addFilterStateIfNotThere = (filters: Filter[]): Filter[] => { - return filters.map((filter) => { - if (filter.$state == null) { - return { $state: { store: FilterStateStore.APP_STATE }, ...filter }; - } else { - return filter; - } - }); -}; - -/* eslint complexity: ["error", 25]*/ -// eslint-disable-next-line complexity -export const getDescriptionItem = ( - field: string, - label: string, - data: unknown, - filterManager: FilterManager, - license: LicenseService, - indexPatterns?: DataViewBase -): ListItems[] => { - if (field === 'queryBar') { - const queryBar = get('queryBar', data) as FieldValueQueryBar; - const filters = addFilterStateIfNotThere(queryBar.filters ?? []); - const query = queryBar.query.query as string; - const savedId = queryBar.saved_id ?? ''; - const savedQueryName = queryBar.title; - const ruleType: Type = get('ruleType', data) as Type; - const queryLabel = getQueryLabel(ruleType); - return buildQueryBarDescription({ - field, - filters, - filterManager, - query, - queryLabel, - savedId, - savedQueryName, - indexPatterns, - }); - } else if (field === 'responseActions') { - return []; - } else if (field === ALERT_SUPPRESSION_FIELDS_FIELD_NAME) { - const ruleType: Type = get('ruleType', data); - - const ruleCanHaveGroupByFields = isSuppressionRuleConfiguredWithGroupBy(ruleType); - if (!ruleCanHaveGroupByFields) { - return []; - } - const values: string[] = get(field, data); - return buildAlertSuppressionDescription(label, values, ruleType); - } else if (field === ALERT_SUPPRESSION_DURATION_TYPE_FIELD_NAME) { - return []; - } else if (field === ALERT_SUPPRESSION_DURATION_FIELD_NAME) { - const ruleType: Type = get('ruleType', data); - - const ruleCanHaveDuration = isSuppressionRuleConfiguredWithDuration(ruleType); - if (!ruleCanHaveDuration) { - return []; - } - - // threshold rule has suppression duration without grouping fields, but suppression should be explicitly enabled by user - // query rule have suppression duration only if group by fields selected - const showDuration = isThresholdRule(ruleType) - ? get(THRESHOLD_ALERT_SUPPRESSION_ENABLED, data) === true - : get(ALERT_SUPPRESSION_FIELDS_FIELD_NAME, data).length > 0; - - if (showDuration) { - const value: Duration = get(field, data); - return buildAlertSuppressionWindowDescription( - label, - value, - get(ALERT_SUPPRESSION_DURATION_TYPE_FIELD_NAME, data), - ruleType - ); - } else { - return []; - } - } else if (field === ALERT_SUPPRESSION_MISSING_FIELDS_FIELD_NAME) { - const ruleType: Type = get('ruleType', data); - const ruleCanHaveSuppressionMissingFields = - isSuppressionRuleConfiguredWithMissingFields(ruleType); - - if (!ruleCanHaveSuppressionMissingFields) { - return []; - } - if (get(ALERT_SUPPRESSION_FIELDS_FIELD_NAME, data).length > 0) { - const value = get(field, data); - return buildAlertSuppressionMissingFieldsDescription(label, value, ruleType); - } else { - return []; - } - } else if (field === 'eqlOptions') { - const eqlOptions: EqlOptions = get(field, data); - return buildEqlOptionsDescription(eqlOptions); - } else if (field === 'threat') { - const threats: Threats = get(field, data); - return buildThreatDescription({ label, threat: filterEmptyThreats(threats) }); - } else if (field === 'threshold') { - const threshold = get(field, data); - return buildThresholdDescription(label, threshold); - } else if (field === 'references') { - const urls: string[] = get(field, data); - return buildUrlsDescription(label, urls); - } else if (field === 'falsePositives') { - const values: string[] = get(field, data); - return buildUnorderedListArrayDescription(label, field, values); - } else if (field === 'investigationFields') { - const values: string[] = get(field, data); - return buildHighlightedFieldsOverrideDescription(label, values); - } else if (field === 'riskScore') { - const values: AboutStepRiskScore = get(field, data); - return buildRiskScoreDescription(values); - } else if (field === 'severity') { - const values: AboutStepSeverity = get(field, data); - return buildSeverityDescription(values); - } else if (field === 'requiredFields') { - const requiredFields: RequiredFieldArray = get(field, data); - return buildRequiredFieldsDescription(label, requiredFields); - } else if (field === 'relatedIntegrations') { - const relatedIntegrations: RelatedIntegrationArray = get(field, data); - return buildRelatedIntegrationsDescription(label, relatedIntegrations); - } else if (field === 'timeline') { - const timeline = get(field, data) as FieldValueTimeline; - return [ - { - title: label, - description: timeline.title ?? DEFAULT_TIMELINE_TITLE, - }, - ]; - } else if (field === 'note') { - const val: string = get(field, data); - return buildNoteDescription(label, val); - } else if (field === 'setup') { - const val: string = get(field, data); - return buildSetupDescription(label, val); - } else if (field === 'ruleType') { - const ruleType: Type = get(field, data); - return buildRuleTypeDescription(label, ruleType); - } else if (field === 'kibanaSiemAppUrl') { - return []; - } else if (field === 'threatQueryBar') { - const filters = addFilterStateIfNotThere(get('threatQueryBar.filters', data) ?? []); - const query = get('threatQueryBar.query.query', data); - const savedId = get('threatQueryBar.saved_id', data); - return buildQueryBarDescription({ - field, - filters, - filterManager, - query, - savedId, - indexPatterns, - queryLabel: THREAT_QUERY_LABEL, - }); - } else if (field === 'threatMapping') { - const threatMap: ThreatMapping = get(field, data); - return buildThreatMappingDescription(label, threatMap); - } else if (Array.isArray(get(field, data)) && field !== 'threatMapping') { - const values: string[] = get(field, data); - return buildStringArrayDescription(label, field, values); - } else if (field === 'index') { - if (get('dataViewId', data)) { - return []; - } - } else if (field === 'isBuildingBlock') { - return get('isBuildingBlock', data) - ? [{ title: i18n.BUILDING_BLOCK_LABEL, description: i18n.BUILDING_BLOCK_DESCRIPTION }] - : []; - } else if (['interval', 'from'].includes(field)) { - return buildIntervalDescription(label, get(field, data)); - } else if (field === 'maxSignals') { - const value: number | undefined = get(field, data); - return value ? [{ title: label, description: value }] : []; - } - - const description: string = get(field, data); - if (isNumber(description) || !isEmpty(description)) { - return [ - { - title: label, - description, - }, - ]; - } - return []; -}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/new_terms_fields/index.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/new_terms_fields/index.tsx deleted file mode 100644 index 7dfb24200e645..0000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/new_terms_fields/index.tsx +++ /dev/null @@ -1,42 +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, { useMemo } from 'react'; - -import type { DataViewFieldBase } from '@kbn/es-query'; -import type { FieldHook } from '../../../../shared_imports'; -import { Field } from '../../../../shared_imports'; -import { NEW_TERMS_FIELD_PLACEHOLDER } from './translations'; - -interface NewTermsFieldsProps { - browserFields: DataViewFieldBase[]; - field: FieldHook; -} - -const FIELD_COMBO_BOX_WIDTH = 410; - -const fieldDescribedByIds = 'detectionEngineStepDefineRuleNewTermsField'; - -export const NewTermsFieldsComponent: React.FC<NewTermsFieldsProps> = ({ - browserFields, - field, -}: NewTermsFieldsProps) => { - const fieldEuiFieldProps = useMemo( - () => ({ - fullWidth: true, - noSuggestions: false, - options: browserFields.map((browserField) => ({ label: browserField.name })), - placeholder: NEW_TERMS_FIELD_PLACEHOLDER, - onCreateOption: undefined, - style: { width: `${FIELD_COMBO_BOX_WIDTH}px` }, - }), - [browserFields] - ); - return <Field field={field} idAria={fieldDescribedByIds} euiFieldProps={fieldEuiFieldProps} />; -}; - -export const NewTermsFields = React.memo(NewTermsFieldsComponent); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/new_terms_fields/translations.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/new_terms_fields/translations.ts deleted file mode 100644 index 1bf73b4a46b48..0000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/new_terms_fields/translations.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 { i18n } from '@kbn/i18n'; - -export const NEW_TERMS_FIELD_PLACEHOLDER = i18n.translate( - 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.newTermsField.placeholderText', - { - defaultMessage: 'Select a field', - } -); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/helpers.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/helpers.ts deleted file mode 100644 index 045e957c4e129..0000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/helpers.ts +++ /dev/null @@ -1,151 +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 { isEmpty } from 'lodash'; -import type { EuiSelectOption } from '@elastic/eui'; -import type { Type, ThreatMapping } from '@kbn/securitysolution-io-ts-alerting-types'; -import * as i18n from './translations'; - -import type { FieldValueQueryBar } from '../query_bar_field'; -import type { TimeframePreviewOptions } from '../../../../detections/pages/detection_engine/rules/types'; -import { DataSourceType } from '../../../../detections/pages/detection_engine/rules/types'; -import { MAX_NUMBER_OF_NEW_TERMS_FIELDS } from '../../../../../common/constants'; - -/** - * Determines whether or not to display noise warning. - * Is considered noisy if alerts/hour rate > 1 - * @param hits Total query search hits - * @param timeframe Range selected by user (last hour, day...) - */ -export const isNoisy = (hits: number, timeframe: TimeframePreviewOptions): boolean => { - const oneHour = 1000 * 60 * 60; - const durationInHours = Math.max( - (timeframe.timeframeEnd.valueOf() - timeframe.timeframeStart.valueOf()) / oneHour, - 1.0 - ); - return hits / durationInHours > 1; -}; - -/** - * Determines what timerange options to show. - * Eql sequence queries tend to be slower, so decided - * not to include the last month option. - * @param ruleType - */ -export const getTimeframeOptions = (ruleType: Type): EuiSelectOption[] => { - if (ruleType === 'eql') { - return [ - { value: 'h', text: i18n.LAST_HOUR }, - { value: 'd', text: i18n.LAST_DAY }, - ]; - } else if (ruleType === 'threat_match') { - return [ - { value: 'h', text: i18n.LAST_HOUR }, - { value: 'd', text: i18n.LAST_DAY }, - { value: 'w', text: i18n.LAST_WEEK }, - ]; - } else if (ruleType === 'threshold') { - return [{ value: 'h', text: i18n.LAST_HOUR }]; - } else { - return [ - { value: 'h', text: i18n.LAST_HOUR }, - { value: 'd', text: i18n.LAST_DAY }, - { value: 'M', text: i18n.LAST_MONTH }, - ]; - } -}; - -const isNewTermsPreviewDisabled = (newTermsFields: string[]): boolean => { - return newTermsFields.length === 0 || newTermsFields.length > MAX_NUMBER_OF_NEW_TERMS_FIELDS; -}; - -const isEsqlPreviewDisabled = ({ - isQueryBarValid, - queryBar, -}: { - queryBar: FieldValueQueryBar; - isQueryBarValid: boolean; -}): boolean => { - return !isQueryBarValid || isEmpty(queryBar.query.query); -}; - -const isThreatMatchPreviewDisabled = ({ - isThreatQueryBarValid, - threatIndex, - threatMapping, -}: { - threatIndex: string[]; - threatMapping: ThreatMapping; - isThreatQueryBarValid: boolean; -}): boolean => { - if (!isThreatQueryBarValid || !threatIndex.length || !threatMapping) { - return true; - } else if ( - !threatMapping.length || - !threatMapping[0].entries?.length || - !threatMapping[0].entries[0].field || - !threatMapping[0].entries[0].value - ) { - return true; - } - - return false; -}; - -export const getIsRulePreviewDisabled = ({ - ruleType, - isQueryBarValid, - isThreatQueryBarValid, - index, - dataViewId, - dataSourceType, - threatIndex, - threatMapping, - machineLearningJobId, - queryBar, - newTermsFields, -}: { - ruleType: Type; - isQueryBarValid: boolean; - isThreatQueryBarValid: boolean; - index: string[]; - dataViewId: string | undefined; - dataSourceType: DataSourceType; - threatIndex: string[]; - threatMapping: ThreatMapping; - machineLearningJobId: string[]; - queryBar: FieldValueQueryBar; - newTermsFields: string[]; -}) => { - if (ruleType === 'esql') { - return isEsqlPreviewDisabled({ isQueryBarValid, queryBar }); - } - if (ruleType === 'machine_learning') { - return machineLearningJobId.length === 0; - } - if ( - !isQueryBarValid || - (dataSourceType === DataSourceType.DataView && !dataViewId) || - (dataSourceType === DataSourceType.IndexPatterns && index.length === 0) - ) { - return true; - } - if (ruleType === 'threat_match') { - return isThreatMatchPreviewDisabled({ - threatIndex, - threatMapping, - isThreatQueryBarValid, - }); - } - if (ruleType === 'eql' || ruleType === 'query' || ruleType === 'threshold') { - return isEmpty(queryBar.query.query) && isEmpty(queryBar.filters); - } - if (ruleType === 'new_terms') { - return isNewTermsPreviewDisabled(newTermsFields); - } - return false; -}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx deleted file mode 100644 index 7b056b5969799..0000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx +++ /dev/null @@ -1,828 +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 type { EuiButtonGroupOptionProps } from '@elastic/eui'; -import { - EuiButtonEmpty, - EuiFlexGroup, - EuiFlexItem, - EuiFormRow, - EuiSpacer, - EuiButtonGroup, - EuiText, -} from '@elastic/eui'; -import type { FC } from 'react'; -import React, { memo, useCallback, useState, useEffect, useMemo } from 'react'; - -import styled from 'styled-components'; -import { i18n as i18nCore } from '@kbn/i18n'; -import { isEqual } from 'lodash'; -import type { FieldSpec } from '@kbn/data-plugin/common'; - -import type { SavedQuery } from '@kbn/data-plugin/public'; -import type { DataViewBase } from '@kbn/es-query'; -import { FormattedMessage } from '@kbn/i18n-react'; -import type { SetRuleQuery } from '../../../../detections/containers/detection_engine/rules/use_rule_from_timeline'; -import { useRuleFromTimeline } from '../../../../detections/containers/detection_engine/rules/use_rule_from_timeline'; -import { isMlRule } from '../../../../../common/machine_learning/helpers'; -import { filterRuleFieldsForType, getStepDataDataSource } from '../../pages/rule_creation/helpers'; -import type { - DefineStepRule, - RuleStepProps, -} from '../../../../detections/pages/detection_engine/rules/types'; -import { DataSourceType } from '../../../../detections/pages/detection_engine/rules/types'; -import { StepRuleDescription } from '../description_step'; -import type { QueryBarFieldProps } from '../query_bar_field'; -import { QueryBarField } from '../query_bar_field'; -import { SelectRuleType } from '../select_rule_type'; -import { AnomalyThresholdSlider } from '../anomaly_threshold_slider'; -import { MlJobSelect } from '../../../rule_creation/components/ml_job_select'; -import { PickTimeline } from '../../../rule_creation/components/pick_timeline'; -import { StepContentWrapper } from '../../../rule_creation/components/step_content_wrapper'; -import { ThresholdInput } from '../threshold_input'; -import { - Field, - Form, - getUseField, - HiddenField, - UseField, - useFormData, - UseMultiFields, -} from '../../../../shared_imports'; -import type { FormHook, FieldHook } from '../../../../shared_imports'; -import { schema } from './schema'; -import { getTermsAggregationFields } from './utils'; -import { useExperimentalFeatureFieldsTransform } from './use_experimental_feature_fields_transform'; -import * as i18n from './translations'; -import { - isEqlRule, - isNewTermsRule, - isThreatMatchRule, - isThresholdRule as getIsThresholdRule, - isQueryRule, - isEsqlRule, - isEqlSequenceQuery, - isSuppressionRuleInGA, -} from '../../../../../common/detection_engine/utils'; -import { EqlQueryEdit } from '../../../rule_creation/components/eql_query_edit'; -import { DataViewSelectorField } from '../data_view_selector_field'; -import { ThreatMatchInput } from '../threatmatch_input'; -import { useFetchIndex } from '../../../../common/containers/source'; -import { NewTermsFields } from '../new_terms_fields'; -import { ScheduleItem } from '../../../rule_creation/components/schedule_item_form'; -import { RequiredFields } from '../../../rule_creation/components/required_fields'; -import { DocLink } from '../../../../common/components/links_to_docs/doc_link'; -import { useLicense } from '../../../../common/hooks/use_license'; -import { MINIMUM_LICENSE_FOR_SUPPRESSION } from '../../../../../common/detection_engine/constants'; -import { useUpsellingMessage } from '../../../../common/hooks/use_upselling'; -import { useAllEsqlRuleFields } from '../../hooks'; -import { useAlertSuppression } from '../../../rule_management/logic/use_alert_suppression'; -import { AiAssistant } from '../ai_assistant'; -import { RelatedIntegrations } from '../../../rule_creation/components/related_integrations'; -import { useMLRuleConfig } from '../../../../common/components/ml/hooks/use_ml_rule_config'; -import { - ALERT_SUPPRESSION_FIELDS_FIELD_NAME, - AlertSuppressionEdit, -} from '../../../rule_creation/components/alert_suppression_edit'; -import { ThresholdAlertSuppressionEdit } from '../../../rule_creation/components/threshold_alert_suppression_edit'; -import { usePersistentAlertSuppressionState } from './use_persistent_alert_suppression_state'; -import { EsqlQueryEdit } from '../../../rule_creation/components/esql_query_edit'; -import { usePersistentQuery } from './use_persistent_query'; - -const CommonUseField = getUseField({ component: Field }); - -const StyledVisibleContainer = styled.div<{ isVisible: boolean }>` - display: ${(props) => (props.isVisible ? 'block' : 'none')}; -`; -export interface StepDefineRuleProps extends RuleStepProps { - indicesConfig: string[]; - threatIndicesConfig: string[]; - defaultSavedQuery?: SavedQuery; - form: FormHook<DefineStepRule>; - indexPattern: DataViewBase; - isIndexPatternLoading: boolean; - isQueryBarValid: boolean; - setIsQueryBarValid: (valid: boolean) => void; - setIsThreatQueryBarValid: (valid: boolean) => void; - index: string[]; - threatIndex: string[]; - alertSuppressionFields?: string[]; - dataSourceType: DataSourceType; - shouldLoadQueryDynamically: boolean; - queryBarTitle: string | undefined; - queryBarSavedId: string | null | undefined; - thresholdFields: string[] | undefined; -} - -interface StepDefineRuleReadOnlyProps { - addPadding: boolean; - descriptionColumns: 'multi' | 'single' | 'singleSplit'; - defaultValues: DefineStepRule; - indexPattern: DataViewBase; -} - -export const MyLabelButton = styled(EuiButtonEmpty)` - height: 18px; - font-size: 12px; - - .euiIcon { - width: 14px; - height: 14px; - } -`; - -MyLabelButton.defaultProps = { - flush: 'right', -}; - -const RuleTypeEuiFormRow = styled(EuiFormRow).attrs<{ $isVisible: boolean }>(({ $isVisible }) => ({ - style: { - display: $isVisible ? 'flex' : 'none', - }, -}))<{ $isVisible: boolean }>``; - -const StepDefineRuleComponent: FC<StepDefineRuleProps> = ({ - dataSourceType, - defaultSavedQuery, - form, - alertSuppressionFields, - index, - indexPattern, - indicesConfig, - isIndexPatternLoading, - isLoading, - isQueryBarValid, - isUpdateView = false, - queryBarSavedId, - queryBarTitle, - setIsQueryBarValid, - setIsThreatQueryBarValid, - shouldLoadQueryDynamically, - threatIndex, - threatIndicesConfig, - thresholdFields, -}) => { - const [{ ruleType, queryBar, machineLearningJobId }] = useFormData<DefineStepRule>({ - form, - watch: ['ruleType', 'queryBar', 'machineLearningJobId'], - }); - - const [openTimelineSearch, setOpenTimelineSearch] = useState(false); - const [indexModified, setIndexModified] = useState(false); - const [threatIndexModified, setThreatIndexModified] = useState(false); - const license = useLicense(); - - const { - allJobsStarted, - hasMlAdminPermissions, - hasMlLicense, - loading: mlRuleConfigLoading, - mlSuppressionFields, - } = useMLRuleConfig({ machineLearningJobId }); - - const isMlSuppressionIncomplete = - isMlRule(ruleType) && machineLearningJobId?.length > 0 && !allJobsStarted; - - const isAlertSuppressionLicenseValid = license.isAtLeast(MINIMUM_LICENSE_FOR_SUPPRESSION); - - const isThresholdRule = getIsThresholdRule(ruleType); - const alertSuppressionUpsellingMessage = useUpsellingMessage('alert_suppression_rule_form'); - const { getFields, reset, setFieldValue } = form; - - // Callback for when user toggles between Data Views and Index Patterns - const onChangeDataSource = useCallback( - (optionId: string) => { - form.setFieldValue('dataSourceType', optionId); - form.getFields().index.reset({ - resetValue: false, - }); - form.getFields().dataViewId.reset({ - resetValue: false, - }); - }, - [form] - ); - - const aggFields = useMemo( - () => (indexPattern.fields as FieldSpec[]).filter((field) => field.aggregatable === true), - [indexPattern.fields] - ); - const termsAggregationFields = useMemo( - /** - * Typecasting to FieldSpec because fields is - * typed as DataViewFieldBase[] which does not have - * the 'aggregatable' property, however the type is incorrect - * - * fields does contain elements with the aggregatable property. - * We will need to determine where these types are defined and - * figure out where the discrepency is. - */ - () => getTermsAggregationFields(indexPattern.fields as FieldSpec[]), - [indexPattern.fields] - ); - - const [threatIndexPatternsLoading, { indexPatterns: threatIndexPatterns }] = - useFetchIndex(threatIndex); - - // reset form when rule type changes - useEffect(() => { - reset({ resetValues: false }); - }, [reset, ruleType]); - - useEffect(() => { - setIndexModified(!isEqual(index, indicesConfig)); - }, [index, indicesConfig]); - - useEffect(() => { - setThreatIndexModified(!isEqual(threatIndex, threatIndicesConfig)); - }, [threatIndex, threatIndicesConfig]); - - const { setPersistentEqlQuery, setPersistentEqlOptions } = usePersistentQuery({ - form, - }); - usePersistentAlertSuppressionState({ form }); - - const handleSetRuleFromTimeline = useCallback<SetRuleQuery>( - ({ index: timelineIndex, queryBar: timelineQueryBar, eqlOptions }) => { - const setQuery = () => { - setFieldValue('index', timelineIndex); - setFieldValue('queryBar', timelineQueryBar); - }; - if (timelineQueryBar.query.language === 'eql') { - setFieldValue('ruleType', 'eql'); - - // Rule type change takes as minimum two re-renders. Since we render a specific - // query editor component depending on rule type we need to first render - // the rule type specific query editor component (using UseField under the hood) to - // be able to set query's field value. - // - // setTimeout provides a simple solution to wait until the rule type specific query - // editor component is rendered. - setTimeout(() => { - setPersistentEqlQuery(timelineQueryBar); - setPersistentEqlOptions(eqlOptions ?? {}); - setQuery(); - setFieldValue('eqlOptions', eqlOptions ?? {}); - }); - } else { - setQuery(); - } - }, - [setFieldValue, setPersistentEqlQuery, setPersistentEqlOptions] - ); - - const { onOpenTimeline, loading: timelineQueryLoading } = - useRuleFromTimeline(handleSetRuleFromTimeline); - - // if saved query failed to load: - // - reset shouldLoadFormDynamically to false, as non existent query cannot be used for loading and execution - const handleSavedQueryError = useCallback(() => { - if (!isQueryBarValid) { - form.setFieldValue('shouldLoadQueryDynamically', false); - } - }, [isQueryBarValid, form]); - - const handleResetIndices = useCallback(() => { - const indexField = getFields().index; - indexField.setValue(indicesConfig); - }, [getFields, indicesConfig]); - - const handleResetThreatIndices = useCallback(() => { - const threatIndexField = getFields().threatIndex; - threatIndexField.setValue(threatIndicesConfig); - }, [getFields, threatIndicesConfig]); - - const handleOpenTimelineSearch = useCallback(() => { - setOpenTimelineSearch(true); - }, []); - - const handleCloseTimelineSearch = useCallback(() => { - setOpenTimelineSearch(false); - }, []); - - const ThresholdInputChildren = useCallback( - ({ - thresholdField, - thresholdValue, - thresholdCardinalityField, - thresholdCardinalityValue, - }: Record<string, FieldHook>) => ( - <ThresholdInput - browserFields={aggFields} - thresholdField={thresholdField} - thresholdValue={thresholdValue} - thresholdCardinalityField={thresholdCardinalityField} - thresholdCardinalityValue={thresholdCardinalityValue} - /> - ), - [aggFields] - ); - - const ThreatMatchInputChildren = useCallback( - ({ threatMapping }: Record<string, FieldHook>) => ( - <ThreatMatchInput - handleResetThreatIndices={handleResetThreatIndices} - indexPatterns={indexPattern} - threatIndexModified={threatIndexModified} - threatIndexPatterns={threatIndexPatterns} - threatIndexPatternsLoading={threatIndexPatternsLoading} - threatMapping={threatMapping} - onValidityChange={setIsThreatQueryBarValid} - /> - ), - [ - handleResetThreatIndices, - indexPattern, - setIsThreatQueryBarValid, - threatIndexModified, - threatIndexPatterns, - threatIndexPatternsLoading, - ] - ); - - const { fields: esqlSuppressionFields, isLoading: isEsqlSuppressionLoading } = - useAllEsqlRuleFields({ - esqlQuery: isEsqlRule(ruleType) ? (queryBar?.query?.query as string) : undefined, - indexPatternsFields: indexPattern.fields, - }); - - /** Suppression fields being selected is a special case for our form logic, as we can't - * disable these fields and leave users in a bad state that they cannot change. - * The exception is threshold rules, which use an existing threshold field for the same - * purpose and so are treated as if the field is always selected. */ - const areSuppressionFieldsSelected = isThresholdRule || Boolean(alertSuppressionFields?.length); - - const { isSuppressionEnabled: isAlertSuppressionEnabled } = useAlertSuppression( - isEqlSequenceQuery(queryBar?.query?.query as string) - ); - - /** If we don't have ML field information, users can't meaningfully interact with suppression fields */ - const areSuppressionFieldsDisabledByMlFields = - isMlRule(ruleType) && (mlRuleConfigLoading || !mlSuppressionFields.length); - - /** Suppression fields are generally disabled if either: - * - License is insufficient (i.e. less than platinum) - * - ML Field information is not available - */ - const areSuppressionFieldsDisabled = - !isAlertSuppressionLicenseValid || areSuppressionFieldsDisabledByMlFields; - - const isSuppressionGroupByDisabled = - (areSuppressionFieldsDisabled || isEsqlSuppressionLoading) && !areSuppressionFieldsSelected; - - const suppressionGroupByDisabledText = useMemo(() => { - if (areSuppressionFieldsDisabledByMlFields) { - return i18n.MACHINE_LEARNING_SUPPRESSION_DISABLED_LABEL; - } else { - return alertSuppressionUpsellingMessage; - } - }, [alertSuppressionUpsellingMessage, areSuppressionFieldsDisabledByMlFields]); - - const suppressionGroupByFields = useMemo(() => { - if (isEsqlRule(ruleType)) { - return esqlSuppressionFields; - } else if (isMlRule(ruleType)) { - return mlSuppressionFields; - } else { - return termsAggregationFields; - } - }, [esqlSuppressionFields, mlSuppressionFields, ruleType, termsAggregationFields]); - - const alertSuppressionFieldsAppendText = useMemo( - () => ( - <EuiText color="subdued" size="xs"> - {isSuppressionRuleInGA(ruleType) - ? i18n.ALERT_SUPPRESSION_FIELDS_GA_LABEL_APPEND - : i18n.ALERT_SUPPRESSION_FIELDS_TECH_PREVIEW_LABEL_APPEND} - </EuiText> - ), - [ruleType] - ); - - const dataViewIndexPatternToggleButtonOptions: EuiButtonGroupOptionProps[] = useMemo( - () => [ - { - id: DataSourceType.IndexPatterns, - label: i18nCore.translate( - 'xpack.securitySolution.ruleDefine.indexTypeSelect.indexPattern', - { - defaultMessage: 'Index Patterns', - } - ), - iconType: dataSourceType === DataSourceType.IndexPatterns ? 'checkInCircleFilled' : 'empty', - 'data-test-subj': `rule-index-toggle-${DataSourceType.IndexPatterns}`, - }, - { - id: DataSourceType.DataView, - label: i18nCore.translate('xpack.securitySolution.ruleDefine.indexTypeSelect.dataView', { - defaultMessage: 'Data View', - }), - iconType: dataSourceType === DataSourceType.DataView ? 'checkInCircleFilled' : 'empty', - 'data-test-subj': `rule-index-toggle-${DataSourceType.DataView}`, - }, - ], - [dataSourceType] - ); - - const DataSource = useMemo(() => { - return ( - <RuleTypeEuiFormRow label={i18n.SOURCE} $isVisible={true} fullWidth> - <EuiFlexGroup - direction="column" - gutterSize="s" - data-test-subj="dataViewIndexPatternButtonGroupFlexGroup" - > - <EuiFlexItem> - <EuiText size="xs"> - <FormattedMessage - id="xpack.securitySolution.dataViewSelectorText1" - defaultMessage="Use Kibana " - /> - <DocLink guidePath="kibana" docPath="data-views.html" linkText="Data Views" /> - <FormattedMessage - id="xpack.securitySolution.dataViewSelectorText2" - defaultMessage=" or specify individual " - /> - <DocLink - guidePath="kibana" - docPath="index-patterns-api-create.html" - linkText="index patterns" - /> - <FormattedMessage - id="xpack.securitySolution.dataViewSelectorText3" - defaultMessage=" as your rule's data source to be searched." - /> - </EuiText> - </EuiFlexItem> - <EuiFlexItem> - <RuleTypeEuiFormRow $isVisible={true}> - <EuiButtonGroup - isFullWidth={true} - legend="Rule index pattern or data view selector" - data-test-subj="dataViewIndexPatternButtonGroup" - idSelected={dataSourceType} - onChange={onChangeDataSource} - options={dataViewIndexPatternToggleButtonOptions} - color="primary" - /> - </RuleTypeEuiFormRow> - </EuiFlexItem> - - <EuiFlexItem> - <StyledVisibleContainer isVisible={dataSourceType === DataSourceType.DataView}> - <UseField - key="DataViewSelector" - path="dataViewId" - component={DataViewSelectorField} - /> - </StyledVisibleContainer> - <StyledVisibleContainer isVisible={dataSourceType === DataSourceType.IndexPatterns}> - <CommonUseField - path="index" - config={{ - ...schema.index, - labelAppend: indexModified ? ( - <MyLabelButton onClick={handleResetIndices} iconType="refresh"> - {i18n.RESET_DEFAULT_INDEX} - </MyLabelButton> - ) : null, - }} - componentProps={{ - idAria: 'detectionEngineStepDefineRuleIndices', - 'data-test-subj': 'detectionEngineStepDefineRuleIndices', - euiFieldProps: { - fullWidth: true, - placeholder: '', - isDisabled: timelineQueryLoading, - isLoading: timelineQueryLoading, - }, - }} - /> - </StyledVisibleContainer> - </EuiFlexItem> - </EuiFlexGroup> - </RuleTypeEuiFormRow> - ); - }, [ - timelineQueryLoading, - dataSourceType, - onChangeDataSource, - dataViewIndexPatternToggleButtonOptions, - indexModified, - handleResetIndices, - ]); - - const QueryBarMemo = useMemo( - () => ( - <UseField - key="QueryBarDefineRule" - path="queryBar" - config={{ - ...schema.queryBar, - label: i18n.QUERY_BAR_LABEL, - labelAppend: ( - <MyLabelButton - data-test-subj="importQueryFromSavedTimeline" - onClick={handleOpenTimelineSearch} - disabled={shouldLoadQueryDynamically} - > - {i18n.IMPORT_TIMELINE_QUERY} - </MyLabelButton> - ), - }} - component={QueryBarField} - componentProps={ - { - idAria: 'detectionEngineStepDefineRuleQueryBar', - indexPattern, - isDisabled: isLoading || shouldLoadQueryDynamically || timelineQueryLoading, - resetToSavedQuery: shouldLoadQueryDynamically, - isLoading: isIndexPatternLoading || timelineQueryLoading, - dataTestSubj: 'detectionEngineStepDefineRuleQueryBar', - openTimelineSearch, - onValidityChange: setIsQueryBarValid, - onCloseTimelineSearch: handleCloseTimelineSearch, - onSavedQueryError: handleSavedQueryError, - defaultSavedQuery, - onOpenTimeline, - } as QueryBarFieldProps - } - /> - ), - [ - handleOpenTimelineSearch, - shouldLoadQueryDynamically, - indexPattern, - isLoading, - timelineQueryLoading, - isIndexPatternLoading, - openTimelineSearch, - setIsQueryBarValid, - handleCloseTimelineSearch, - handleSavedQueryError, - defaultSavedQuery, - onOpenTimeline, - ] - ); - - const selectRuleTypeProps = useMemo( - () => ({ - describedByIds: ['detectionEngineStepDefineRuleType'], - isUpdateView, - hasValidLicense: hasMlLicense, - isMlAdmin: hasMlAdminPermissions, - }), - [hasMlAdminPermissions, hasMlLicense, isUpdateView] - ); - - return ( - <> - <StepContentWrapper addPadding={!isUpdateView}> - <Form form={form} data-test-subj="stepDefineRule"> - <UseField - path="dataSourceType" - component={HiddenField} - componentProps={{ - euiFieldProps: { - fullWidth: true, - placeholder: '', - }, - }} - /> - <UseField - path="ruleType" - component={SelectRuleType} - componentProps={selectRuleTypeProps} - /> - <RuleTypeEuiFormRow $isVisible={!isMlRule(ruleType) && !isEsqlRule(ruleType)} fullWidth> - <> - <EuiSpacer size="s" /> - {DataSource} - </> - </RuleTypeEuiFormRow> - <RuleTypeEuiFormRow - $isVisible={!isMlRule(ruleType)} - fullWidth - data-test-subj="defineRuleFormStepQueryEditor" - > - <> - <EuiSpacer size="s" /> - {isEqlRule(ruleType) ? ( - <EqlQueryEdit - path="queryBar" - eqlOptionsPath="eqlOptions" - fieldsToValidateOnChange={ALERT_SUPPRESSION_FIELDS_FIELD_NAME} - required - showFilterBar - dataView={indexPattern} - loading={isIndexPatternLoading} - disabled={isLoading} - onValidityChange={setIsQueryBarValid} - /> - ) : isEsqlRule(ruleType) ? ( - <EsqlQueryEdit - path="queryBar" - fieldsToValidateOnChange={ALERT_SUPPRESSION_FIELDS_FIELD_NAME} - required - dataView={indexPattern} - disabled={isLoading} - loading={isLoading} - onValidityChange={setIsQueryBarValid} - /> - ) : ( - QueryBarMemo - )} - </> - </RuleTypeEuiFormRow> - {!isMlRule(ruleType) && !isQueryBarValid && queryBar?.query?.query && ( - <AiAssistant - getFields={form.getFields} - setFieldValue={form.setFieldValue} - language={queryBar?.query?.language} - /> - )} - {isQueryRule(ruleType) && ( - <> - <EuiSpacer size="s" /> - <RuleTypeEuiFormRow - label={i18n.SAVED_QUERY_FORM_ROW_LABEL} - $isVisible={Boolean(queryBarSavedId)} - fullWidth - > - <CommonUseField - path="shouldLoadQueryDynamically" - componentProps={{ - idAria: 'detectionEngineStepDefineRuleShouldLoadQueryDynamically', - 'data-test-subj': 'detectionEngineStepDefineRuleShouldLoadQueryDynamically', - euiFieldProps: { - disabled: isLoading, - label: queryBarTitle - ? i18n.getSavedQueryCheckboxLabel(queryBarTitle) - : i18n.getSavedQueryCheckboxLabelWithoutName(), - }, - }} - /> - </RuleTypeEuiFormRow> - </> - )} - <RuleTypeEuiFormRow $isVisible={isMlRule(ruleType)} fullWidth> - <> - <UseField - path="machineLearningJobId" - component={MlJobSelect} - componentProps={{ - describedByIds: ['detectionEngineStepDefineRulemachineLearningJobId'], - }} - /> - <UseField - path="anomalyThreshold" - component={AnomalyThresholdSlider} - componentProps={{ - describedByIds: ['detectionEngineStepDefineRuleAnomalyThreshold'], - }} - /> - </> - </RuleTypeEuiFormRow> - <RuleTypeEuiFormRow - $isVisible={isThresholdRule} - data-test-subj="thresholdInput" - fullWidth - > - <> - <UseMultiFields - fields={{ - thresholdField: { - path: 'threshold.field', - }, - thresholdValue: { - path: 'threshold.value', - }, - thresholdCardinalityField: { - path: 'threshold.cardinality.field', - }, - thresholdCardinalityValue: { - path: 'threshold.cardinality.value', - }, - }} - > - {ThresholdInputChildren} - </UseMultiFields> - </> - </RuleTypeEuiFormRow> - <RuleTypeEuiFormRow - $isVisible={isThreatMatchRule(ruleType)} - data-test-subj="threatMatchInput" - fullWidth - > - <> - <UseMultiFields - fields={{ - threatMapping: { - path: 'threatMapping', - }, - }} - > - {ThreatMatchInputChildren} - </UseMultiFields> - </> - </RuleTypeEuiFormRow> - <RuleTypeEuiFormRow - $isVisible={isNewTermsRule(ruleType)} - data-test-subj="newTermsInput" - fullWidth - > - <> - <UseField - path="newTermsFields" - component={NewTermsFields} - componentProps={{ - browserFields: termsAggregationFields, - }} - /> - <UseField - path="historyWindowSize" - component={ScheduleItem} - componentProps={{ - idAria: 'detectionEngineStepDefineRuleHistoryWindowSize', - dataTestSubj: 'detectionEngineStepDefineRuleHistoryWindowSize', - timeTypes: ['m', 'h', 'd'], - }} - /> - </> - </RuleTypeEuiFormRow> - <EuiSpacer size="m" /> - - <RuleTypeEuiFormRow $isVisible={isAlertSuppressionEnabled} fullWidth> - {isThresholdRule ? ( - <ThresholdAlertSuppressionEdit - suppressionFieldNames={thresholdFields} - disabled={!isAlertSuppressionLicenseValid} - disabledText={alertSuppressionUpsellingMessage} - /> - ) : ( - <AlertSuppressionEdit - suppressibleFields={suppressionGroupByFields} - labelAppend={alertSuppressionFieldsAppendText} - warningText={ - isMlSuppressionIncomplete - ? i18n.MACHINE_LEARNING_SUPPRESSION_INCOMPLETE_LABEL - : undefined - } - disabled={isSuppressionGroupByDisabled} - disabledText={suppressionGroupByDisabledText} - /> - )} - </RuleTypeEuiFormRow> - {!isMlRule(ruleType) && ( - <> - <RequiredFields - path="requiredFields" - indexPatternFields={indexPattern.fields} - isIndexPatternLoading={isIndexPatternLoading} - /> - <EuiSpacer size="l" /> - </> - )} - <RelatedIntegrations path="relatedIntegrations" dataTestSubj="relatedIntegrations" /> - <UseField - path="timeline" - component={PickTimeline} - componentProps={{ - idAria: 'detectionEngineStepDefineRuleTimeline', - isDisabled: isLoading, - dataTestSubj: 'detectionEngineStepDefineRuleTimeline', - }} - /> - </Form> - </StepContentWrapper> - </> - ); -}; -export const StepDefineRule = memo(StepDefineRuleComponent); - -const StepDefineRuleReadOnlyComponent: FC<StepDefineRuleReadOnlyProps> = ({ - addPadding, - defaultValues: data, - descriptionColumns, - indexPattern, -}) => { - const dataForDescription: Partial<DefineStepRule> = getStepDataDataSource(data); - const transformFields = useExperimentalFeatureFieldsTransform(); - const fieldsToDisplay = transformFields(dataForDescription); - - return ( - <StepContentWrapper data-test-subj="definitionRule" addPadding={addPadding}> - <StepRuleDescription - columns={descriptionColumns} - schema={filterRuleFieldsForType(schema, data.ruleType)} - data={filterRuleFieldsForType(fieldsToDisplay, data.ruleType)} - indexPatterns={indexPattern} - /> - </StepContentWrapper> - ); -}; -export const StepDefineRuleReadOnly = memo(StepDefineRuleReadOnlyComponent); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_schedule_rule/index.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_schedule_rule/index.tsx deleted file mode 100644 index 2197b069de404..0000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_schedule_rule/index.tsx +++ /dev/null @@ -1,82 +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 type { FC } from 'react'; -import styled from 'styled-components'; -import React, { memo } from 'react'; -import type { - RuleStepProps, - ScheduleStepRule, -} from '../../../../detections/pages/detection_engine/rules/types'; -import { StepRuleDescription } from '../description_step'; -import { ScheduleItem } from '../../../rule_creation/components/schedule_item_form'; -import { Form, UseField } from '../../../../shared_imports'; -import type { FormHook } from '../../../../shared_imports'; -import { StepContentWrapper } from '../../../rule_creation/components/step_content_wrapper'; -import { schema } from './schema'; - -const StyledForm = styled(Form)` - max-width: 235px !important; -`; -interface StepScheduleRuleProps extends RuleStepProps { - form: FormHook<ScheduleStepRule>; -} - -interface StepScheduleRuleReadOnlyProps { - addPadding: boolean; - descriptionColumns: 'multi' | 'single' | 'singleSplit'; - defaultValues: ScheduleStepRule; -} - -const StepScheduleRuleComponent: FC<StepScheduleRuleProps> = ({ - isLoading, - isUpdateView = false, - form, -}) => { - return ( - <> - <StepContentWrapper addPadding={!isUpdateView}> - <StyledForm form={form} data-test-subj="stepScheduleRule"> - <UseField - path="interval" - component={ScheduleItem} - componentProps={{ - idAria: 'detectionEngineStepScheduleRuleInterval', - isDisabled: isLoading, - dataTestSubj: 'detectionEngineStepScheduleRuleInterval', - minimumValue: 1, - }} - /> - <UseField - path="from" - component={ScheduleItem} - componentProps={{ - idAria: 'detectionEngineStepScheduleRuleFrom', - isDisabled: isLoading, - dataTestSubj: 'detectionEngineStepScheduleRuleFrom', - minimumValue: 1, - }} - /> - </StyledForm> - </StepContentWrapper> - </> - ); -}; -export const StepScheduleRule = memo(StepScheduleRuleComponent); - -const StepScheduleRuleReadOnlyComponent: FC<StepScheduleRuleReadOnlyProps> = ({ - addPadding, - defaultValues: data, - descriptionColumns, -}) => { - return ( - <StepContentWrapper addPadding={addPadding}> - <StepRuleDescription columns={descriptionColumns} schema={schema} data={data} /> - </StepContentWrapper> - ); -}; -export const StepScheduleRuleReadOnly = memo(StepScheduleRuleReadOnlyComponent); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/helpers.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/helpers.ts deleted file mode 100644 index 9aeea303c6c32..0000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/helpers.ts +++ /dev/null @@ -1,745 +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. - */ - -/* eslint-disable complexity */ - -import { has, isEmpty, get } from 'lodash/fp'; -import type { Unit } from '@kbn/datemath'; -import moment from 'moment'; -import deepmerge from 'deepmerge'; -import omit from 'lodash/omit'; - -import type { - ExceptionListType, - NamespaceType, - List, -} from '@kbn/securitysolution-io-ts-list-types'; -import type { - RiskScoreMappingItem, - Threats, - ThreatSubtechnique, - ThreatTechnique, - Type, -} from '@kbn/securitysolution-io-ts-alerting-types'; -import { ENDPOINT_LIST_ID } from '@kbn/securitysolution-list-constants'; -import type { - RuleAction as AlertingRuleAction, - RuleSystemAction as AlertingRuleSystemAction, -} from '@kbn/alerting-plugin/common'; - -import type { ActionTypeRegistryContract } from '@kbn/triggers-actions-ui-plugin/public'; - -import { assertUnreachable } from '../../../../../common/utility_types'; -import { - transformAlertToRuleAction, - transformAlertToRuleResponseAction, - transformAlertToRuleSystemAction, -} from '../../../../../common/detection_engine/transform_actions'; - -import type { - AboutStepRule, - DefineStepRule, - ScheduleStepRule, - ActionsStepRule, - DefineStepRuleJson, - ScheduleStepRuleJson, - AboutStepRuleJson, - ActionsStepRuleJson, -} from '../../../../detections/pages/detection_engine/rules/types'; -import { - DataSourceType, - AlertSuppressionDurationType, -} from '../../../../detections/pages/detection_engine/rules/types'; -import type { - RuleCreateProps, - AlertSuppression, - RequiredFieldInput, - SeverityMapping, - RelatedIntegrationArray, -} from '../../../../../common/api/detection_engine/model/rule_schema'; -import { stepActionsDefaultValue } from '../../../rule_creation/components/step_rule_actions'; -import { DEFAULT_SUPPRESSION_MISSING_FIELDS_STRATEGY } from '../../../../../common/detection_engine/constants'; -import { - ALERT_SUPPRESSION_DURATION_FIELD_NAME, - ALERT_SUPPRESSION_DURATION_TYPE_FIELD_NAME, - ALERT_SUPPRESSION_FIELDS_FIELD_NAME, - ALERT_SUPPRESSION_MISSING_FIELDS_FIELD_NAME, -} from '../../../rule_creation/components/alert_suppression_edit'; -import { THRESHOLD_ALERT_SUPPRESSION_ENABLED } from '../../../rule_creation/components/threshold_alert_suppression_edit'; - -export const getTimeTypeValue = (time: string): { unit: Unit; value: number } => { - const timeObj: { unit: Unit; value: number } = { - unit: 'ms', - value: 0, - }; - const filterTimeVal = time.match(/\d+/g); - const filterTimeType = time.match(/[a-zA-Z]+/g); - if (!isEmpty(filterTimeVal) && filterTimeVal != null && !isNaN(Number(filterTimeVal[0]))) { - timeObj.value = Number(filterTimeVal[0]); - } - if ( - !isEmpty(filterTimeType) && - filterTimeType != null && - ['s', 'm', 'h', 'd'].includes(filterTimeType[0]) - ) { - timeObj.unit = filterTimeType[0] as Unit; - } - return timeObj; -}; - -export interface RuleFields { - anomalyThreshold: unknown; - machineLearningJobId: unknown; - queryBar: unknown; - index: unknown; - dataViewId?: unknown; - ruleType: unknown; - threshold?: unknown; - threatIndex?: unknown; - threatQueryBar?: unknown; - threatMapping?: unknown; - threatLanguage?: unknown; - eqlOptions: unknown; - newTermsFields?: unknown; - historyWindowSize?: unknown; -} - -type QueryRuleFields<T> = Omit< - T, - | 'anomalyThreshold' - | 'machineLearningJobId' - | 'threshold' - | 'threatIndex' - | 'threatQueryBar' - | 'threatMapping' - | 'eqlOptions' - | 'newTermsFields' - | 'historyWindowSize' ->; -type EqlQueryRuleFields<T> = Omit< - T, - | 'anomalyThreshold' - | 'machineLearningJobId' - | 'threshold' - | 'threatIndex' - | 'threatQueryBar' - | 'threatMapping' - | 'newTermsFields' - | 'historyWindowSize' ->; -type ThresholdRuleFields<T> = Omit< - T, - | 'anomalyThreshold' - | 'machineLearningJobId' - | 'threatIndex' - | 'threatQueryBar' - | 'threatMapping' - | 'eqlOptions' - | 'newTermsFields' - | 'historyWindowSize' ->; -type MlRuleFields<T> = Omit< - T, - | 'queryBar' - | 'index' - | 'threshold' - | 'threatIndex' - | 'threatQueryBar' - | 'threatMapping' - | 'eqlOptions' - | 'newTermsFields' - | 'historyWindowSize' ->; -type ThreatMatchRuleFields<T> = Omit< - T, - | 'anomalyThreshold' - | 'machineLearningJobId' - | 'threshold' - | 'eqlOptions' - | 'newTermsFields' - | 'historyWindowSize' ->; -type NewTermsRuleFields<T> = Omit< - T, - | 'anomalyThreshold' - | 'machineLearningJobId' - | 'threshold' - | 'threatIndex' - | 'threatQueryBar' - | 'threatMapping' - | 'eqlOptions' ->; -type EsqlRuleFields<T> = Omit< - T, - | 'anomalyThreshold' - | 'machineLearningJobId' - | 'threshold' - | 'threatIndex' - | 'threatQueryBar' - | 'threatMapping' - | 'eqlOptions' - | 'index' - | 'newTermsFields' - | 'historyWindowSize' - | 'dataViewId' ->; - -const isMlFields = <T>( - fields: - | QueryRuleFields<T> - | EqlQueryRuleFields<T> - | MlRuleFields<T> - | ThresholdRuleFields<T> - | ThreatMatchRuleFields<T> - | NewTermsRuleFields<T> - | EsqlRuleFields<T> -): fields is MlRuleFields<T> => has('anomalyThreshold', fields); - -const isThresholdFields = <T>( - fields: - | QueryRuleFields<T> - | EqlQueryRuleFields<T> - | MlRuleFields<T> - | ThresholdRuleFields<T> - | ThreatMatchRuleFields<T> - | NewTermsRuleFields<T> - | EsqlRuleFields<T> -): fields is ThresholdRuleFields<T> => has('threshold', fields); - -const isThreatMatchFields = <T>( - fields: - | QueryRuleFields<T> - | EqlQueryRuleFields<T> - | MlRuleFields<T> - | ThresholdRuleFields<T> - | ThreatMatchRuleFields<T> - | NewTermsRuleFields<T> - | EsqlRuleFields<T> -): fields is ThreatMatchRuleFields<T> => has('threatIndex', fields); - -const isNewTermsFields = <T>( - fields: - | QueryRuleFields<T> - | EqlQueryRuleFields<T> - | MlRuleFields<T> - | ThresholdRuleFields<T> - | ThreatMatchRuleFields<T> - | NewTermsRuleFields<T> - | EsqlRuleFields<T> -): fields is NewTermsRuleFields<T> => has('newTermsFields', fields); - -const isEqlFields = <T>( - fields: - | QueryRuleFields<T> - | EqlQueryRuleFields<T> - | MlRuleFields<T> - | ThresholdRuleFields<T> - | ThreatMatchRuleFields<T> - | NewTermsRuleFields<T> - | EsqlRuleFields<T> -): fields is EqlQueryRuleFields<T> => has('eqlOptions', fields); - -const isEsqlFields = <T>( - fields: - | QueryRuleFields<T> - | EqlQueryRuleFields<T> - | MlRuleFields<T> - | ThresholdRuleFields<T> - | ThreatMatchRuleFields<T> - | NewTermsRuleFields<T> - | EsqlRuleFields<T> -): fields is EsqlRuleFields<T> => get('queryBar.query.language', fields) === 'esql'; - -export const filterRuleFieldsForType = <T extends Partial<RuleFields>>( - fields: T, - type: Type -): - | QueryRuleFields<T> - | EqlQueryRuleFields<T> - | MlRuleFields<T> - | ThresholdRuleFields<T> - | ThreatMatchRuleFields<T> - | EsqlRuleFields<T> - | NewTermsRuleFields<T> => { - switch (type) { - case 'machine_learning': - const { - index, - queryBar, - threshold, - threatIndex, - threatQueryBar, - threatMapping, - eqlOptions, - newTermsFields, - historyWindowSize, - ...mlRuleFields - } = fields; - return mlRuleFields; - case 'threshold': - const { - anomalyThreshold, - machineLearningJobId, - threatIndex: _removedThreatIndex, - threatQueryBar: _removedThreatQueryBar, - threatMapping: _removedThreatMapping, - eqlOptions: _eqlOptions, - newTermsFields: removedNewTermsFields, - historyWindowSize: removedHistoryWindowSize, - ...thresholdRuleFields - } = fields; - return thresholdRuleFields; - case 'threat_match': - const { - anomalyThreshold: _removedAnomalyThreshold, - machineLearningJobId: _removedMachineLearningJobId, - threshold: _removedThreshold, - eqlOptions: __eqlOptions, - newTermsFields: _removedNewTermsFields, - historyWindowSize: _removedHistoryWindowSize, - ...threatMatchRuleFields - } = fields; - return threatMatchRuleFields; - case 'query': - case 'saved_query': - const { - anomalyThreshold: _a, - machineLearningJobId: _m, - threshold: _t, - threatIndex: __removedThreatIndex, - threatQueryBar: __removedThreatQueryBar, - threatMapping: __removedThreatMapping, - eqlOptions: ___eqlOptions, - newTermsFields: __removedNewTermsFields, - historyWindowSize: __removedHistoryWindowSize, - ...queryRuleFields - } = fields; - return queryRuleFields; - case 'eql': - const { - anomalyThreshold: __a, - machineLearningJobId: __m, - threshold: __t, - threatIndex: ___removedThreatIndex, - threatQueryBar: ___removedThreatQueryBar, - threatMapping: ___removedThreatMapping, - newTermsFields: ___removedNewTermsFields, - historyWindowSize: ___removedHistoryWindowSize, - ...eqlRuleFields - } = fields; - return eqlRuleFields; - - case 'new_terms': - const { - anomalyThreshold: ___a, - machineLearningJobId: ___m, - threshold: ___t, - threatIndex: ____removedThreatIndex, - threatQueryBar: ____removedThreatQueryBar, - threatMapping: ____removedThreatMapping, - eqlOptions: ____eqlOptions, - ...newTermsRuleFields - } = fields; - return newTermsRuleFields; - - case 'esql': - const { - anomalyThreshold: _esql_a, - machineLearningJobId: _esql_m, - threshold: _esql_t, - threatIndex: _esql_removedThreatIndex, - threatQueryBar: _esql_removedThreatQueryBar, - threatMapping: _esql_removedThreatMapping, - newTermsFields: _esql_removedNewTermsFields, - historyWindowSize: _esql_removedHistoryWindowSize, - eqlOptions: _esql__eqlOptions, - index: _esql_index, - dataViewId: _esql_dataViewId, - ...esqlRuleFields - } = fields; - return esqlRuleFields; - } - assertUnreachable(type); -}; - -function trimThreatsWithNoName<T extends ThreatSubtechnique | ThreatTechnique>( - filterable: T[] -): T[] { - return filterable.filter((item) => item.name !== 'none'); -} - -/** - * Filter out unfilled/empty threat, technique, and subtechnique fields based on if their name is `none` - */ -export const filterEmptyThreats = (threats: Threats): Threats => { - return threats - .filter((singleThreat) => singleThreat.tactic.name !== 'none') - .map((threat) => { - return { - ...threat, - technique: trimThreatsWithNoName(threat.technique ?? []).map((technique) => { - return { - ...technique, - subtechnique: - technique.subtechnique != null - ? trimThreatsWithNoName(technique.subtechnique) - : undefined, - }; - }), - }; - }); -}; - -/** - * remove unused data source. - * Ex: rule is using a data view so we should not - * write an index property on the rule form. - * @param defineStepData - * @returns DefineStepRule - */ -export const getStepDataDataSource = ( - defineStepData: DefineStepRule -): Omit<DefineStepRule, 'dataViewId' | 'index' | 'dataSourceType'> & { - index?: string[]; - dataViewId?: string; -} => { - const copiedStepData = { ...defineStepData }; - if (defineStepData.dataSourceType === DataSourceType.DataView) { - return omit(copiedStepData, ['index', 'dataSourceType']); - } else if (defineStepData.dataSourceType === DataSourceType.IndexPatterns) { - return omit(copiedStepData, ['dataViewId', 'dataSourceType']); - } - return copiedStepData; -}; - -/** - * Strips away form rows that were not filled out by the user - */ -export const removeEmptyRequiredFields = ( - requiredFields: RequiredFieldInput[] -): RequiredFieldInput[] => requiredFields.filter((field) => field.name !== '' && field.type !== ''); - -export const formatDefineStepData = (defineStepData: DefineStepRule): DefineStepRuleJson => { - const stepData = getStepDataDataSource(defineStepData); - - const ruleFields = filterRuleFieldsForType(stepData, stepData.ruleType); - const { ruleType, timeline } = ruleFields; - - const baseFields = { - type: ruleType, - related_integrations: defineStepData.relatedIntegrations - ? filterOutEmptyRelatedIntegrations(defineStepData.relatedIntegrations) - : undefined, - ...(timeline.id != null && - timeline.title != null && { - timeline_id: timeline.id, - timeline_title: timeline.title, - }), - }; - - // Threshold rule won't contain alert suppression fields - const alertSuppressionFields = - ruleFields[ALERT_SUPPRESSION_FIELDS_FIELD_NAME]?.length > 0 - ? { - alert_suppression: { - group_by: ruleFields[ALERT_SUPPRESSION_FIELDS_FIELD_NAME], - duration: - ruleFields[ALERT_SUPPRESSION_DURATION_TYPE_FIELD_NAME] === - AlertSuppressionDurationType.PerTimePeriod - ? ruleFields[ALERT_SUPPRESSION_DURATION_FIELD_NAME] - : undefined, - missing_fields_strategy: (ruleFields[ALERT_SUPPRESSION_MISSING_FIELDS_FIELD_NAME] || - DEFAULT_SUPPRESSION_MISSING_FIELDS_STRATEGY) as AlertSuppression['missing_fields_strategy'], - }, - } - : {}; - - const requiredFields = removeEmptyRequiredFields(defineStepData.requiredFields ?? []); - - const typeFields = isMlFields(ruleFields) - ? { - anomaly_threshold: ruleFields.anomalyThreshold, - machine_learning_job_id: ruleFields.machineLearningJobId, - ...alertSuppressionFields, - } - : isThresholdFields(ruleFields) - ? { - index: ruleFields.index, - filters: ruleFields.queryBar?.filters, - language: ruleFields.queryBar?.query?.language, - query: ruleFields.queryBar?.query?.query as string, - saved_id: ruleFields.queryBar?.saved_id ?? undefined, - required_fields: requiredFields, - ...(ruleType === 'threshold' && { - threshold: { - field: ruleFields.threshold?.field ?? [], - value: parseInt(ruleFields.threshold?.value, 10) ?? 0, - cardinality: - !isEmpty(ruleFields.threshold.cardinality?.field) && - ruleFields.threshold.cardinality?.value != null - ? [ - { - field: ruleFields.threshold.cardinality.field[0], - value: parseInt(ruleFields.threshold.cardinality.value, 10), - }, - ] - : [], - }, - ...(ruleFields[THRESHOLD_ALERT_SUPPRESSION_ENABLED] && { - alert_suppression: { duration: ruleFields[ALERT_SUPPRESSION_DURATION_FIELD_NAME] }, - }), - }), - } - : isThreatMatchFields(ruleFields) - ? { - index: ruleFields.index, - filters: ruleFields.queryBar?.filters, - language: ruleFields.queryBar?.query?.language, - query: ruleFields.queryBar?.query?.query as string, - saved_id: ruleFields.queryBar?.saved_id ?? undefined, - required_fields: requiredFields, - threat_index: ruleFields.threatIndex, - threat_query: ruleFields.threatQueryBar?.query?.query as string, - threat_filters: ruleFields.threatQueryBar?.filters, - threat_mapping: ruleFields.threatMapping, - threat_language: ruleFields.threatQueryBar?.query?.language, - ...alertSuppressionFields, - } - : isEqlFields(ruleFields) - ? { - index: ruleFields.index, - filters: ruleFields.queryBar?.filters, - language: ruleFields.queryBar?.query?.language, - query: ruleFields.queryBar?.query?.query as string, - saved_id: ruleFields.queryBar?.saved_id ?? undefined, - required_fields: requiredFields, - timestamp_field: ruleFields.eqlOptions?.timestampField, - event_category_override: ruleFields.eqlOptions?.eventCategoryField, - tiebreaker_field: ruleFields.eqlOptions?.tiebreakerField, - ...alertSuppressionFields, - } - : isNewTermsFields(ruleFields) - ? { - index: ruleFields.index, - filters: ruleFields.queryBar?.filters, - language: ruleFields.queryBar?.query?.language, - query: ruleFields.queryBar?.query?.query as string, - required_fields: requiredFields, - new_terms_fields: ruleFields.newTermsFields, - history_window_start: `now-${ruleFields.historyWindowSize}`, - ...alertSuppressionFields, - } - : isEsqlFields(ruleFields) && !('index' in ruleFields) - ? { - language: ruleFields.queryBar?.query?.language, - query: ruleFields.queryBar?.query?.query as string, - required_fields: requiredFields, - ...alertSuppressionFields, - } - : { - ...alertSuppressionFields, - index: ruleFields.index, - filters: ruleFields.queryBar?.filters, - language: ruleFields.queryBar?.query?.language, - query: ruleFields.queryBar?.query?.query as string, - saved_id: undefined, - required_fields: requiredFields, - type: 'query' as const, - // rule only be updated as saved_query type if it has saved_id and shouldLoadQueryDynamically checkbox checked - ...(['query', 'saved_query'].includes(ruleType) && - ruleFields.queryBar?.saved_id && - ruleFields.shouldLoadQueryDynamically && { - type: 'saved_query' as const, - query: undefined, - filters: undefined, - saved_id: ruleFields.queryBar.saved_id, - }), - }; - - return { - ...baseFields, - ...typeFields, - ...('dataViewId' in ruleFields ? { data_view_id: ruleFields.dataViewId } : {}), - }; -}; - -export const formatScheduleStepData = (scheduleData: ScheduleStepRule): ScheduleStepRuleJson => { - const { ...formatScheduleData } = scheduleData; - if (!isEmpty(formatScheduleData.interval) && !isEmpty(formatScheduleData.from)) { - const { unit: intervalUnit, value: intervalValue } = getTimeTypeValue( - formatScheduleData.interval - ); - const { unit: fromUnit, value: fromValue } = getTimeTypeValue(formatScheduleData.from); - const duration = moment.duration(intervalValue, intervalUnit); - duration.add(fromValue, fromUnit); - formatScheduleData.from = `now-${duration.asSeconds()}s`; - formatScheduleData.to = 'now'; - } - return { - ...formatScheduleData, - meta: { - from: scheduleData.from, - }, - }; -}; - -export const formatAboutStepData = ( - aboutStepData: AboutStepRule, - exceptionsList?: List[] -): AboutStepRuleJson => { - const { - author, - falsePositives, - investigationFields, - references, - riskScore, - severity, - threat, - isAssociatedToEndpointList, - isBuildingBlock, - maxSignals, - note, - ruleNameOverride, - threatIndicatorPath, - timestampOverride, - timestampOverrideFallbackDisabled, - ...rest - } = aboutStepData; - - const detectionExceptionLists = - exceptionsList != null ? exceptionsList.filter((list) => list.type !== 'endpoint') : []; - const isinvestigationFieldsEmpty = investigationFields.every((item) => isEmpty(item.trim())); - - const resp = { - author: author.filter((item) => !isEmpty(item)), - ...(isBuildingBlock ? { building_block_type: 'default' } : {}), - ...(isAssociatedToEndpointList - ? { - exceptions_list: [ - { - id: ENDPOINT_LIST_ID, - list_id: ENDPOINT_LIST_ID, - namespace_type: 'agnostic' as NamespaceType, - type: 'endpoint' as ExceptionListType, - }, - ...detectionExceptionLists, - ], - } - : exceptionsList != null - ? { - exceptions_list: [...detectionExceptionLists], - } - : {}), - false_positives: falsePositives.filter((item) => !isEmpty(item)), - references: references.filter((item) => !isEmpty(item)), - investigation_fields: isinvestigationFieldsEmpty - ? undefined - : { field_names: investigationFields }, - risk_score: riskScore.value, - risk_score_mapping: riskScore.isMappingChecked - ? filterOutEmptyRiskScoreMappingItems(riskScore.mapping) - : [], - rule_name_override: ruleNameOverride !== '' ? ruleNameOverride : undefined, - severity: severity.value, - severity_mapping: severity.isMappingChecked - ? filterOutEmptySeverityMappingItems(severity.mapping) - : [], - threat: filterEmptyThreats(threat).map((singleThreat) => ({ - ...singleThreat, - framework: 'MITRE ATT&CK', - })), - threat_indicator_path: threatIndicatorPath, - timestamp_override: timestampOverride !== '' ? timestampOverride : undefined, - timestamp_override_fallback_disabled: timestampOverrideFallbackDisabled, - ...(!isEmpty(note) ? { note } : {}), - max_signals: Number.isSafeInteger(maxSignals) ? maxSignals : undefined, - ...rest, - }; - return resp; -}; - -export const filterOutEmptyRiskScoreMappingItems = (riskScoreMapping: RiskScoreMappingItem[]) => - riskScoreMapping.filter((m) => m.field != null && m.field !== ''); - -export const filterOutEmptySeverityMappingItems = (severityMapping: SeverityMapping) => - severityMapping.filter((m) => m.field != null && m.field !== '' && m.value != null); - -export const filterOutEmptyRelatedIntegrations = (relatedIntegrations: RelatedIntegrationArray) => - relatedIntegrations.filter((ri) => !isEmpty(ri.package)); - -export const isRuleAction = ( - action: AlertingRuleAction | AlertingRuleSystemAction, - actionTypeRegistry: ActionTypeRegistryContract -): action is AlertingRuleAction => !actionTypeRegistry.get(action.actionTypeId).isSystemActionType; - -export const formatActionsStepData = ( - actionsStepData: ActionsStepRule, - actionTypeRegistry: ActionTypeRegistryContract -): ActionsStepRuleJson => { - const { actions = [], responseActions, enabled, kibanaSiemAppUrl } = actionsStepData; - - return { - actions: actions.map((action) => - isRuleAction(action, actionTypeRegistry) - ? transformAlertToRuleAction(action) - : transformAlertToRuleSystemAction(action) - ), - response_actions: responseActions?.map(transformAlertToRuleResponseAction), - enabled, - meta: { - kibana_siem_app_url: kibanaSiemAppUrl, - }, - }; -}; - -// Used to format form data in rule edit and -// create flows so "T" here would likely -// either be RuleCreateProps or Rule -export const formatRule = <T>( - defineStepData: DefineStepRule, - aboutStepData: AboutStepRule, - scheduleData: ScheduleStepRule, - actionsData: ActionsStepRule, - actionTypeRegistry: ActionTypeRegistryContract, - exceptionsList?: List[] -): T => - deepmerge.all([ - formatDefineStepData(defineStepData), - formatAboutStepData(aboutStepData, exceptionsList), - formatScheduleStepData(scheduleData), - formatActionsStepData(actionsData, actionTypeRegistry), - ]) as unknown as T; - -export const formatPreviewRule = ({ - defineRuleData, - aboutRuleData, - scheduleRuleData, - exceptionsList, - actionTypeRegistry, -}: { - defineRuleData: DefineStepRule; - aboutRuleData: AboutStepRule; - scheduleRuleData: ScheduleStepRule; - actionTypeRegistry: ActionTypeRegistryContract; - exceptionsList?: List[]; -}): RuleCreateProps => { - const aboutStepData = { - ...aboutRuleData, - name: 'Preview Rule', - description: 'Preview Rule', - }; - return { - ...formatRule<RuleCreateProps>( - defineRuleData, - aboutStepData, - scheduleRuleData, - stepActionsDefaultValue, - actionTypeRegistry, - exceptionsList - ), - }; -}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/new_terms_rule_field_edit.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/new_terms_rule_field_edit.tsx deleted file mode 100644 index e2860d431affa..0000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/new_terms_rule_field_edit.tsx +++ /dev/null @@ -1,29 +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 from 'react'; -import type { UpgradeableNewTermsFields } from '../../../../model/prebuilt_rule_upgrade/fields'; -import { KqlQueryEditForm } from './fields/kql_query'; -import { DataSourceEditForm } from './fields/data_source'; -import { AlertSuppressionEditForm } from './fields/alert_suppression'; - -interface NewTermsRuleFieldEditProps { - fieldName: UpgradeableNewTermsFields; -} - -export function NewTermsRuleFieldEdit({ fieldName }: NewTermsRuleFieldEditProps) { - switch (fieldName) { - case 'kql_query': - return <KqlQueryEditForm />; - case 'data_source': - return <DataSourceEditForm />; - case 'alert_suppression': - return <AlertSuppressionEditForm />; - default: - return null; // Will be replaced with `assertUnreachable(fieldName)` once all fields are implemented - } -} diff --git a/x-pack/plugins/security_solution/public/detections/jest.config.js b/x-pack/plugins/security_solution/public/detections/jest.config.js deleted file mode 100644 index c3da13db2d8e5..0000000000000 --- a/x-pack/plugins/security_solution/public/detections/jest.config.js +++ /dev/null @@ -1,19 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/detections'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/detections', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution/public/detections/**/*.{ts,tsx}', - ], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx deleted file mode 100644 index 2b187928a17f5..0000000000000 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx +++ /dev/null @@ -1,498 +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 dateMath from '@kbn/datemath'; -import moment from 'moment'; -import memoizeOne from 'memoize-one'; -import { useLocation } from 'react-router-dom'; - -import styled from 'styled-components'; -import { EuiFlexItem } from '@elastic/eui'; -import type { - Severity, - SeverityMapping, - Threats, - Type, -} from '@kbn/securitysolution-io-ts-alerting-types'; -import { ENDPOINT_LIST_ID } from '@kbn/securitysolution-list-constants'; -import type { Filter } from '@kbn/es-query'; -import type { ActionVariables } from '@kbn/triggers-actions-ui-plugin/public'; -import { requiredOptional } from '@kbn/zod-helpers'; -import { - ALERT_SUPPRESSION_FIELDS_FIELD_NAME, - ALERT_SUPPRESSION_DURATION_TYPE_FIELD_NAME, - ALERT_SUPPRESSION_DURATION_FIELD_NAME, - ALERT_SUPPRESSION_MISSING_FIELDS_FIELD_NAME, -} from '../../../../detection_engine/rule_creation/components/alert_suppression_edit'; -import { THRESHOLD_ALERT_SUPPRESSION_ENABLED } from '../../../../detection_engine/rule_creation/components/threshold_alert_suppression_edit'; -import type { ResponseAction } from '../../../../../common/api/detection_engine/model/rule_response_actions'; -import { normalizeThresholdField } from '../../../../../common/detection_engine/utils'; -import { assertUnreachable } from '../../../../../common/utility_types'; -import { - transformRuleToAlertAction, - transformRuleToAlertResponseAction, -} from '../../../../../common/detection_engine/transform_actions'; -import type { - AboutStepRule, - AboutStepRuleDetails, - DefineStepRule, - ScheduleStepRule, - ActionsStepRule, -} from './types'; -import { DataSourceType, AlertSuppressionDurationType } from './types'; -import { severityOptions } from '../../../../detection_engine/rule_creation_ui/components/step_about_rule/data'; -import { DEFAULT_SUPPRESSION_MISSING_FIELDS_STRATEGY } from '../../../../../common/detection_engine/constants'; -import type { RuleAction, RuleResponse } from '../../../../../common/api/detection_engine'; - -export interface GetStepsData { - aboutRuleData: AboutStepRule; - modifiedAboutRuleDetailsData: AboutStepRuleDetails; - defineRuleData: DefineStepRule; - scheduleRuleData: ScheduleStepRule; - ruleActionsData: ActionsStepRule; -} - -export const getStepsData = ({ - rule, - detailsView = false, -}: { - rule: RuleResponse; - detailsView?: boolean; -}): GetStepsData => { - const defineRuleData: DefineStepRule = getDefineStepsData(rule); - const aboutRuleData: AboutStepRule = getAboutStepsData(rule, detailsView); - const modifiedAboutRuleDetailsData: AboutStepRuleDetails = getModifiedAboutDetailsData(rule); - const scheduleRuleData: ScheduleStepRule = getScheduleStepsData(rule); - const ruleActionsData: ActionsStepRule = getActionsStepsData(rule); - - return { - aboutRuleData, - modifiedAboutRuleDetailsData, - defineRuleData, - scheduleRuleData, - ruleActionsData, - }; -}; - -export const getActionsStepsData = ( - rule: Omit<RuleResponse, 'actions'> & { - actions: RuleAction[]; - response_actions?: ResponseAction[]; - } -): ActionsStepRule => { - const { enabled, meta, actions = [], response_actions: responseActions } = rule; - - return { - actions: actions?.map((action) => transformRuleToAlertAction(action)), - responseActions: responseActions?.map(transformRuleToAlertResponseAction), - kibanaSiemAppUrl: - typeof meta?.kibana_siem_app_url === 'string' ? meta.kibana_siem_app_url : undefined, - enabled, - }; -}; - -export const getMachineLearningJobId = (rule: RuleResponse): string[] | undefined => { - if (rule.type === 'machine_learning') { - return typeof rule.machine_learning_job_id === 'string' - ? [rule.machine_learning_job_id] - : rule.machine_learning_job_id; - } - return undefined; -}; - -/* eslint-disable complexity */ -export const getDefineStepsData = (rule: RuleResponse): DefineStepRule => ({ - ruleType: rule.type, - anomalyThreshold: 'anomaly_threshold' in rule ? rule.anomaly_threshold : 50, - machineLearningJobId: getMachineLearningJobId(rule) || [], - index: ('index' in rule && rule.index) || [], - dataViewId: 'data_view_id' in rule ? rule.data_view_id : undefined, - threatIndex: ('threat_index' in rule && rule.threat_index) || [], - threatQueryBar: { - query: { - query: ('threat_query' in rule && rule.threat_query) || '', - language: ('threat_language' in rule && rule.threat_language) || '', - }, - filters: (('threat_filters' in rule && rule.threat_filters) || []) as Filter[], - saved_id: null, - }, - threatMapping: ('threat_mapping' in rule && rule.threat_mapping) || [], - queryBar: { - query: { - query: ('query' in rule && rule.query) || '', - language: ('language' in rule && rule.language) || '', - }, - filters: (('filters' in rule && rule.filters) || []) as Filter[], - saved_id: ('saved_id' in rule && rule.saved_id) || null, - }, - relatedIntegrations: rule.related_integrations ?? [], - requiredFields: rule.required_fields ?? [], - timeline: { - id: rule.timeline_id ?? null, - title: rule.timeline_title ?? null, - }, - threshold: { - field: normalizeThresholdField('threshold' in rule ? rule.threshold?.field : undefined), - value: `${('threshold' in rule && rule.threshold?.value) || 100}`, - ...('threshold' in rule && rule.threshold?.cardinality?.length - ? { - cardinality: { - field: [`${rule.threshold.cardinality[0].field}`], - value: `${rule.threshold.cardinality[0].value}`, - }, - } - : {}), - }, - eqlOptions: { - timestampField: 'timestamp_field' in rule ? rule.timestamp_field : undefined, - eventCategoryField: - 'event_category_override' in rule ? rule.event_category_override : undefined, - tiebreakerField: 'tiebreaker_field' in rule ? rule.tiebreaker_field : undefined, - }, - dataSourceType: - 'data_view_id' in rule && rule.data_view_id - ? DataSourceType.DataView - : DataSourceType.IndexPatterns, - newTermsFields: ('new_terms_fields' in rule && rule.new_terms_fields) || [], - historyWindowSize: - 'history_window_start' in rule && rule.history_window_start - ? convertHistoryStartToSize(rule.history_window_start) - : '7d', - shouldLoadQueryDynamically: Boolean(rule.type === 'saved_query' && rule.saved_id), - [ALERT_SUPPRESSION_FIELDS_FIELD_NAME]: - ('alert_suppression' in rule && - rule.alert_suppression && - 'group_by' in rule.alert_suppression && - rule.alert_suppression.group_by) || - [], - [ALERT_SUPPRESSION_DURATION_TYPE_FIELD_NAME]: - 'alert_suppression' in rule && rule.alert_suppression?.duration - ? AlertSuppressionDurationType.PerTimePeriod - : AlertSuppressionDurationType.PerRuleExecution, - [ALERT_SUPPRESSION_DURATION_FIELD_NAME]: ('alert_suppression' in rule && - rule.alert_suppression?.duration) || { - value: 5, - unit: 'm', - }, - [ALERT_SUPPRESSION_MISSING_FIELDS_FIELD_NAME]: - ('alert_suppression' in rule && - rule.alert_suppression && - 'missing_fields_strategy' in rule.alert_suppression && - rule.alert_suppression.missing_fields_strategy) || - DEFAULT_SUPPRESSION_MISSING_FIELDS_STRATEGY, - [THRESHOLD_ALERT_SUPPRESSION_ENABLED]: Boolean( - 'alert_suppression' in rule && rule.alert_suppression?.duration - ), -}); - -export const convertHistoryStartToSize = (relativeTime: string) => { - if (relativeTime.startsWith('now-')) { - return relativeTime.substring(4); - } else { - return relativeTime; - } -}; - -export const getScheduleStepsData = (rule: RuleResponse): ScheduleStepRule => { - const { interval, from } = rule; - const fromHumanizedValue = getHumanizedDuration(from, interval); - - return { - interval, - from: fromHumanizedValue, - }; -}; - -/** - * Converts seconds to duration string, like "1h", "30m" or "15s" - */ -export const secondsToDurationString = (seconds: number): string => { - if (seconds === 0) { - return `0s`; - } - - if (seconds % 3600 === 0) { - return `${seconds / 3600}h`; - } else if (seconds % 60 === 0) { - return `${seconds / 60}m`; - } else { - return `${seconds}s`; - } -}; - -export const getHumanizedDuration = (from: string, interval: string): string => { - const fromValue = dateMath.parse(from) ?? moment(); - const intervalValue = dateMath.parse(`now-${interval}`) ?? moment(); - - const fromDuration = moment.duration(intervalValue.diff(fromValue)); - - // Basing calculations off floored seconds count as moment durations weren't precise - const intervalDuration = Math.floor(fromDuration.asSeconds()); - // For consistency of display value - - return secondsToDurationString(intervalDuration); -}; - -export const getAboutStepsData = (rule: RuleResponse, detailsView: boolean): AboutStepRule => { - const { name, description, note, setup } = determineDetailsValue(rule, detailsView); - const { - author, - building_block_type: buildingBlockType, - exceptions_list: exceptionsList, - license, - risk_score_mapping: riskScoreMapping, - rule_name_override: ruleNameOverride, - severity_mapping: severityMapping, - timestamp_override: timestampOverride, - timestamp_override_fallback_disabled: timestampOverrideFallbackDisabled, - references, - severity, - false_positives: falsePositives, - risk_score: riskScore, - investigation_fields: investigationFields, - tags, - threat, - max_signals: maxSignals, - } = rule; - const threatIndicatorPath = - 'threat_indicator_path' in rule ? rule.threat_indicator_path : undefined; - - return { - author, - isAssociatedToEndpointList: exceptionsList?.some(({ id }) => id === ENDPOINT_LIST_ID) ?? false, - isBuildingBlock: buildingBlockType !== undefined, - license: license ?? '', - ruleNameOverride: ruleNameOverride ?? '', - timestampOverride: timestampOverride ?? '', - timestampOverrideFallbackDisabled, - name, - description, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - note: note!, - references, - severity: { - value: severity as Severity, - mapping: fillEmptySeverityMappings(severityMapping), - isMappingChecked: severityMapping.length > 0, - }, - tags, - riskScore: { - value: riskScore, - mapping: requiredOptional(riskScoreMapping), - isMappingChecked: riskScoreMapping.length > 0, - }, - falsePositives, - investigationFields: investigationFields?.field_names ?? [], - threat: threat as Threats, - threatIndicatorPath, - maxSignals, - setup, - }; -}; - -const severitySortMapping = { - low: 0, - medium: 1, - high: 2, - critical: 3, -}; - -export const fillEmptySeverityMappings = (mappings: SeverityMapping): SeverityMapping => { - const missingMappings: SeverityMapping = severityOptions.flatMap((so) => - mappings.find((mapping) => mapping.severity === so.value) == null - ? [{ field: '', value: '', operator: 'equals', severity: so.value }] - : [] - ); - return [...mappings, ...missingMappings].sort( - (a, b) => severitySortMapping[a.severity] - severitySortMapping[b.severity] - ); -}; - -export const determineDetailsValue = ( - rule: RuleResponse, - detailsView: boolean -): Pick<RuleResponse, 'name' | 'description' | 'note' | 'setup'> => { - const { name, description, note, setup } = rule; - if (detailsView) { - return { name: '', description: '', note: '', setup: '' }; - } - - return { name, description, setup, note: note ?? '' }; -}; - -export const getModifiedAboutDetailsData = (rule: RuleResponse): AboutStepRuleDetails => ({ - note: rule.note ?? '', - description: rule.description, - setup: rule.setup ?? '', -}); - -export const useQuery = () => new URLSearchParams(useLocation().search); - -export type PrePackagedRuleInstallationStatus = - | 'ruleInstalled' - | 'ruleNotInstalled' - | 'ruleNeedUpdate' - | 'someRuleUninstall' - | 'unknown'; - -export type PrePackagedTimelineInstallationStatus = - | 'timelinesNotInstalled' - | 'timelinesInstalled' - | 'someTimelineUninstall' - | 'timelineNeedUpdate' - | 'unknown'; - -export const getPrePackagedTimelineInstallationStatus = ( - timelinesInstalled?: number, - timelinesNotInstalled?: number, - timelinesNotUpdated?: number -): PrePackagedTimelineInstallationStatus => { - if ( - timelinesNotInstalled != null && - timelinesInstalled === 0 && - timelinesNotInstalled > 0 && - timelinesNotUpdated === 0 - ) { - return 'timelinesNotInstalled'; - } else if ( - timelinesInstalled != null && - timelinesInstalled > 0 && - timelinesNotInstalled === 0 && - timelinesNotUpdated === 0 - ) { - return 'timelinesInstalled'; - } else if ( - timelinesInstalled != null && - timelinesNotInstalled != null && - timelinesInstalled > 0 && - timelinesNotInstalled > 0 && - timelinesNotUpdated === 0 - ) { - return 'someTimelineUninstall'; - } else if ( - timelinesInstalled != null && - timelinesNotInstalled != null && - timelinesNotUpdated != null && - timelinesInstalled > 0 && - timelinesNotInstalled >= 0 && - timelinesNotUpdated > 0 - ) { - return 'timelineNeedUpdate'; - } - return 'unknown'; -}; - -export const redirectToDetections = ( - isSignalIndexExists: boolean | null, - isAuthenticated: boolean | null, - hasEncryptionKey: boolean | null, - needsListsConfiguration: boolean -) => - isSignalIndexExists === false || - isAuthenticated === false || - hasEncryptionKey === false || - needsListsConfiguration; - -const commonRuleParamsKeys = [ - 'id', - 'name', - 'description', - 'false_positives', - 'investigation_fields', - 'rule_id', - 'max_signals', - 'risk_score', - 'output_index', - 'references', - 'severity', - 'timeline_id', - 'timeline_title', - 'threat', - 'type', - 'version', -]; -const queryRuleParams = ['index', 'filters', 'language', 'query', 'saved_id', 'response_actions']; -const esqlRuleParams = ['filters', 'language', 'query', 'response_actions']; -const machineLearningRuleParams = ['anomaly_threshold', 'machine_learning_job_id']; -const thresholdRuleParams = ['threshold', ...queryRuleParams]; - -const getAllRuleParamsKeys = (): string[] => { - const allRuleParamsKeys = [ - ...commonRuleParamsKeys, - ...queryRuleParams, - ...machineLearningRuleParams, - ...thresholdRuleParams, - ].sort(); - - return Array.from(new Set<string>(allRuleParamsKeys)); -}; - -const getRuleSpecificRuleParamKeys = (ruleType: Type) => { - switch (ruleType) { - case 'machine_learning': - return machineLearningRuleParams; - case 'threshold': - return thresholdRuleParams; - case 'esql': - return esqlRuleParams; - case 'new_terms': - case 'threat_match': - case 'query': - case 'saved_query': - case 'eql': - return queryRuleParams; - } - assertUnreachable(ruleType); -}; - -export const getActionMessageRuleParams = (ruleType: Type): string[] => { - const ruleParamsKeys = [ - ...commonRuleParamsKeys, - ...getRuleSpecificRuleParamKeys(ruleType), - ].sort(); - - return ruleParamsKeys; -}; - -const transformRuleKeysToActionVariables = (actionMessageRuleParams: string[]): ActionVariables => { - return { - state: [{ name: 'signals_count', description: 'state.signals_count' }], - params: [], - context: [ - { - name: 'results_link', - description: 'context.results_link', - useWithTripleBracesInTemplates: true, - }, - { name: 'alerts', description: 'context.alerts' }, - ...actionMessageRuleParams.map((param) => { - const extendedParam = `rule.${param}`; - return { name: extendedParam, description: `context.${extendedParam}` }; - }), - ], - }; -}; - -export const getActionMessageParams = memoizeOne((ruleType: Type | undefined): ActionVariables => { - if (!ruleType) { - return { state: [], params: [] }; - } - const actionMessageRuleParams = getActionMessageRuleParams(ruleType); - - return transformRuleKeysToActionVariables(actionMessageRuleParams); -}); - -/** - * returns action variables available for all rule types - */ -export const getAllActionMessageParams = () => - transformRuleKeysToActionVariables(getAllRuleParamsKeys()); - -export const MaxWidthEuiFlexItem = styled(EuiFlexItem)` - max-width: 1000px; - overflow: hidden; -`; diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/translations.ts b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/translations.ts deleted file mode 100644 index cb0570855dabe..0000000000000 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/translations.ts +++ /dev/null @@ -1,1457 +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'; - -export const POPOVER_TOOLTIP_ARIA_LABEL = (columnName: string) => - i18n.translate('xpack.securitySolution.detectionEngine.rules.popoverTooltip.ariaLabel', { - defaultMessage: 'Tooltip for column: {columnName}', - values: { columnName }, - }); - -export const IMPORT_RULE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.importRuleTitle', - { - defaultMessage: 'Import rules', - } -); - -export const IMPORT_VALUE_LISTS = i18n.translate( - 'xpack.securitySolution.lists.detectionEngine.rules.importValueListsButton', - { - defaultMessage: 'Manage value lists', - } -); - -export const UPLOAD_VALUE_LISTS_TOOLTIP = i18n.translate( - 'xpack.securitySolution.lists.detectionEngine.rules.uploadValueListsButtonTooltip', - { - defaultMessage: - 'Use value lists to create an exception when a field value matches a value found in a list', - } -); - -export const UPLOAD_VALUE_LISTS_PRIVILEGES_TOOLTIP = i18n.translate( - 'xpack.securitySolution.lists.detectionEngine.rules.uploadValueListsButtonPrivilegesTooltip', - { - defaultMessage: - 'A user with manage cluster privileges must visit the Rules page before you can import value lists.', - } -); - -export const ADD_NEW_RULE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.addNewRuleTitle', - { - defaultMessage: 'Create new rule', - } -); - -export const PAGE_TITLE = i18n.translate('xpack.securitySolution.detectionEngine.rules.pageTitle', { - defaultMessage: 'Rules', -}); - -export const ADD_PAGE_TITLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.addPageTitle', - { - defaultMessage: 'Create', - } -); - -export const EDIT_PAGE_TITLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.editPageTitle', - { - defaultMessage: 'Edit', - } -); - -export const REFRESH = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.refreshTitle', - { - defaultMessage: 'Refresh', - } -); - -export const BATCH_ACTIONS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.batchActionsTitle', - { - defaultMessage: 'Bulk actions', - } -); - -export const BULK_ACTION_ENABLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.enableTitle', - { - defaultMessage: 'Enable', - } -); - -export const BULK_ACTION_DISABLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.disableTitle', - { - defaultMessage: 'Disable', - } -); - -export const BULK_ACTION_EXPORT = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.exportTitle', - { - defaultMessage: 'Export', - } -); - -export const BULK_ACTION_MANUAL_RULE_RUN = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.manualRuleRunTitle', - { - defaultMessage: 'Manual run', - } -); - -export const BULK_ACTION_DUPLICATE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.duplicateTitle', - { - defaultMessage: 'Duplicate', - } -); - -export const BULK_ACTION_DELETE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.deleteTitle', - { - defaultMessage: 'Delete', - } -); - -export const BULK_ACTION_INDEX_PATTERNS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.indexPatternsTitle', - { - defaultMessage: 'Index patterns', - } -); - -export const BULK_ACTION_TAGS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.tagsTitle', - { - defaultMessage: 'Tags', - } -); - -export const BULK_ACTION_ADD_INDEX_PATTERNS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.addIndexPatternsTitle', - { - defaultMessage: 'Add index patterns', - } -); - -export const BULK_ACTION_DELETE_INDEX_PATTERNS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.deleteIndexPatternsTitle', - { - defaultMessage: 'Delete index patterns', - } -); - -export const BULK_ACTION_ADD_TAGS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.addTagsTitle', - { - defaultMessage: 'Add tags', - } -); - -export const BULK_ACTION_DELETE_TAGS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.deleteTagsTitle', - { - defaultMessage: 'Delete tags', - } -); - -export const BULK_ACTION_INVESTIGATION_FIELDS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.investigationFieldsTitle', - { - defaultMessage: 'Custom highlighted fields', - } -); - -export const BULK_ACTION_ADD_INVESTIGATION_FIELDS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.addInvestigationFieldsTitle', - { - defaultMessage: 'Add custom highlighted fields', - } -); - -export const BULK_ACTION_DELETE_INVESTIGATION_FIELDS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.deleteInvestigationFieldsTitle', - { - defaultMessage: 'Delete custom highlighted fields', - } -); - -export const BULK_ACTION_APPLY_TIMELINE_TEMPLATE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.applyTimelineTemplateTitle', - { - defaultMessage: 'Apply Timeline template', - } -); - -export const BULK_ACTION_ADD_RULE_ACTIONS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.addRuleActionsTitle', - { - defaultMessage: 'Add rule actions', - } -); - -export const BULK_ACTION_SET_SCHEDULE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.setScheduleTitle', - { - defaultMessage: 'Update rule schedules', - } -); - -export const BULK_ACTION_MENU_TITLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.contextMenuTitle', - { - defaultMessage: 'Options', - } -); - -export const BULK_EDIT_WARNING_TOAST_TITLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkEditWarningToastTitle', - { - defaultMessage: 'Rules updates are in progress', - } -); - -export const BULK_EDIT_WARNING_TOAST_DESCRIPTION = (rulesCount: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkEditWarningToastDescription', - { - values: { rulesCount }, - defaultMessage: '{rulesCount, plural, =1 {# rule is} other {# rules are}} updating.', - } - ); - -export const BULK_EDIT_WARNING_TOAST_NOTIFY = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkEditWarningToastNotifyButtonLabel', - { - defaultMessage: `Notify me when done`, - } -); - -export const BULK_EXPORT_CONFIRMATION_REJECTED_TITLE = (rulesCount: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkExportConfirmationDeniedTitle', - { - values: { rulesCount }, - defaultMessage: '{rulesCount, plural, =1 {# rule} other {# rules}} cannot be exported', - } - ); - -export const BULK_MANUAL_RULE_RUN_CONFIRMATION_REJECTED_TITLE = (rulesCount: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkManualRuleRunConfirmationDeniedTitle', - { - values: { rulesCount }, - defaultMessage: '{rulesCount, plural, =1 {# rule} other {# rules}} cannot be scheduled', - } - ); - -export const BULK_EDIT_CONFIRMATION_REJECTED_TITLE = (rulesCount: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkEditConfirmationDeniedTitle', - { - values: { rulesCount }, - defaultMessage: '{rulesCount, plural, =1 {# rule} other {# rules}} cannot be edited', - } - ); - -export const BULK_ACTION_CONFIRMATION_PARTLY_TITLE = (customRulesCount: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkActionConfirmationPartlyTitle', - { - values: { customRulesCount }, - defaultMessage: - 'This action can only be applied to {customRulesCount, plural, =1 {# custom rule} other {# custom rules}}', - } - ); - -export const BULK_EDIT_CONFIRMATION_CANCEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditConfirmationCancelButtonLabel', - { - defaultMessage: 'Cancel', - } -); - -export const BULK_ACTION_CONFIRMATION_CLOSE = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkActionConfirmationCloseButtonLabel', - { - defaultMessage: 'Close', - } -); - -export const BULK_EDIT_CONFIRMATION_CONFIRM = (customRulesCount: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditConfirmation.confirmButtonLabel', - { - values: { customRulesCount }, - defaultMessage: 'Edit {customRulesCount, plural, =1 {# custom rule} other {# custom rules}}', - } - ); - -export const BULK_EXPORT_CONFIRMATION_CONFIRM = (customRulesCount: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkExportConfirmation.confirmButtonLabel', - { - values: { customRulesCount }, - defaultMessage: - 'Export {customRulesCount, plural, =1 {# custom rule} other {# custom rules}}', - } - ); - -export const BULK_MANUAL_RULE_RUN_CONFIRMATION_CONFIRM = (customRulesCount: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkManualRuleRunConfirmation.confirmButtonLabel', - { - values: { customRulesCount }, - defaultMessage: - 'Schedule {customRulesCount, plural, =1 {# custom rule} other {# custom rules}}', - } - ); - -export const BULK_MANUAL_RULE_RUN_LIMIT_ERROR_TITLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkManualRuleRunLimitErrorMessage', - { - defaultMessage: 'This action can only be applied', - } -); - -export const BULK_MANUAL_RULE_RUN_LIMIT_ERROR_MESSAGE = (rulesCount: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkManualRuleRunLimitErrorTitle', - { - values: { rulesCount }, - defaultMessage: - 'Manual rule run cannot be scheduled for more than {rulesCount, plural, =1 {# rule} other {# rules}}', - } - ); - -export const BULK_MANUAL_RULE_RUN_LIMIT_ERROR_CLOSE_BUTTON = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkManualRuleRunLimitErrorCloseButton', - { - defaultMessage: 'Close', - } -); - -export const BULK_EDIT_FLYOUT_FORM_SAVE = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.saveButtonLabel', - { - defaultMessage: 'Save', - } -); - -export const BULK_EDIT_FLYOUT_FORM_CANCEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.cancelButtonLabel', - { - defaultMessage: 'Cancel', - } -); - -export const BULK_EDIT_FLYOUT_FORM_ADD_INDEX_PATTERNS_HELP_TEXT = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addIndexPatternsComboboxHelpText', - { - defaultMessage: - 'Enter the pattern of Elasticsearch indices that you would like to add. By default, the dropdown includes index patterns defined in Security Solution advanced settings.', - } -); - -export const BULK_EDIT_FLYOUT_FORM_DELETE_INDEX_PATTERNS_HELP_TEXT = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.deleteIndexPatternsComboboxHelpText', - { - defaultMessage: - 'Enter the pattern of Elasticsearch indices that you would like to delete. By default, the dropdown includes index patterns defined in Security Solution advanced settings.', - } -); - -export const BULK_EDIT_FLYOUT_FORM_ADD_INDEX_PATTERNS_LABEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addIndexPatternsComboboxLabel', - { - defaultMessage: 'Add index patterns for selected rules', - } -); - -export const BULK_EDIT_FLYOUT_FORM_ADD_INDEX_PATTERNS_REQUIRED_ERROR = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.indexPatternsRequiredErrorMessage', - { - defaultMessage: 'A minimum of one index pattern is required.', - } -); - -export const BULK_EDIT_FLYOUT_FORM_ADD_INDEX_PATTERNS_TITLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addIndexPatternsTitle', - { - defaultMessage: 'Add index patterns', - } -); - -export const BULK_EDIT_FLYOUT_FORM_ADD_INDEX_PATTERNS_OVERWRITE_LABEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addIndexPatternsOverwriteCheckboxLabel', - { - defaultMessage: "Overwrite all selected rules' index patterns", - } -); - -export const BULK_EDIT_FLYOUT_FORM_DATA_VIEWS_OVERWRITE_LABEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.dataViewsOverwriteCheckboxLabel', - { - defaultMessage: 'Apply changes to rules configured with data views', - } -); - -export const BULK_EDIT_FLYOUT_FORM_DELETE_INDEX_PATTERNS_LABEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.deleteIndexPatternsComboboxLabel', - { - defaultMessage: 'Delete index patterns for selected rules', - } -); - -export const BULK_EDIT_FLYOUT_FORM_DELETE_INDEX_PATTERNS_TITLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.deleteIndexPatternsTitle', - { - defaultMessage: 'Delete index patterns', - } -); - -export const BULK_EDIT_FLYOUT_FORM_ADD_TAGS_HELP_TEXT = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addTagsComboboxHelpText', - { - defaultMessage: - 'Add one or more tags for selected rules from the dropdown. You can also enter custom identifying tags and press Enter to begin a new one.', - } -); - -export const BULK_EDIT_FLYOUT_FORM_DELETE_TAGS_HELP_TEXT = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.deleteTagsComboboxHelpText', - { - defaultMessage: - 'Delete one or more tags for selected rules from the dropdown. You can also enter custom identifying tags and press Enter to begin a new one.', - } -); - -export const BULK_EDIT_FLYOUT_FORM_ADD_TAGS_LABEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addTagsComboboxLabel', - { - defaultMessage: 'Add tags for selected rules', - } -); - -export const BULK_EDIT_FLYOUT_FORM_TAGS_REQUIRED_ERROR = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.tagsComoboxRequiredErrorMessage', - { - defaultMessage: 'A minimum of one tag is required.', - } -); - -export const BULK_EDIT_FLYOUT_FORM_ADD_TAGS_TITLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addTagsTitle', - { - defaultMessage: 'Add tags', - } -); - -export const BULK_EDIT_FLYOUT_FORM_ADD_TAGS_OVERWRITE_LABEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addTagsOverwriteCheckboxLabel', - { - defaultMessage: "Overwrite all selected rules' tags", - } -); - -export const BULK_EDIT_FLYOUT_FORM_DELETE_TAGS_LABEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.deleteTagsComboboxLabel', - { - defaultMessage: 'Delete tags for selected rules', - } -); - -export const BULK_EDIT_FLYOUT_FORM_DELETE_TAGS_TITLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.deleteTagsTitle', - { - defaultMessage: 'Delete tags', - } -); - -export const BULK_EDIT_FLYOUT_FORM_ADD_INVESTIGATION_FIELDS_REQUIRED_ERROR = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.investigationFieldsRequiredErrorMessage', - { - defaultMessage: 'A minimum of one custom highlighted field is required.', - } -); - -export const BULK_EDIT_FLYOUT_FORM_ADD_INVESTIGATION_FIELDS_OVERWRITE_LABEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addInvestigationFieldsOverwriteCheckboxLabel', - { - defaultMessage: 'Overwrite the custom highlighted fields for the selected rules', - } -); - -export const BULK_EDIT_FLYOUT_FORM_ADD_INVESTIGATION_FIELDS_LABEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addInvestigationFieldsComboboxLabel', - { - defaultMessage: 'Add custom highlighted fields for selected rules', - } -); - -export const BULK_EDIT_FLYOUT_FORM_ADD_INVESTIGATION_FIELDS_HELP_TEXT = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addInvestigationFieldsComboboxHelpText', - { - defaultMessage: - 'Enter fields that you want to add. You can choose from any of the fields included in the default Elastic Security indices.', - } -); - -export const BULK_EDIT_FLYOUT_FORM_ADD_INVESTIGATION_FIELDS_TITLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addInvestigationFieldsTitle', - { - defaultMessage: 'Add custom highlighted fields', - } -); - -export const BULK_EDIT_FLYOUT_FORM_DELETE_INVESTIGATION_FIELDS_LABEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.deleteInvestigationFieldsComboboxLabel', - { - defaultMessage: 'Delete custom highlighted fields for selected rules', - } -); - -export const BULK_EDIT_FLYOUT_FORM_DELETE_INVESTIGATION_FIELDS_HELP_TEXT = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.deleteInvestigationFieldsComboboxHelpText', - { - defaultMessage: - 'Enter the fields that you want to remove from the selected rules. After you remove these fields, they will no longer appear in the Highlighted fields section of the alerts generated by selected rules.', - } -); - -export const BULK_EDIT_FLYOUT_FORM_DELETE_INVESTIGATION_FIELDS_TITLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.deleteInvestigationFieldsTitle', - { - defaultMessage: 'Delete custom highlighted fields', - } -); - -export const EXPORT_FILENAME = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.exportFilenameTitle', - { - defaultMessage: 'rules_export', - } -); - -export const SEARCH_RULES = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.searchAriaLabel', - { - defaultMessage: 'Search rules', - } -); - -export const SEARCH_PLACEHOLDER = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.searchPlaceholder', - { - defaultMessage: - 'Rule name, index pattern (e.g., "filebeat-*"), or MITRE ATT&CK™ tactic or technique (e.g., "Defense Evasion" or "TA0005")', - } -); - -export const SHOWING_RULES = (firstInPage: number, lastOfPage: number, totalRules: number) => - i18n.translate('xpack.securitySolution.detectionEngine.rules.allRules.showingRulesTitle', { - values: { firstInPage, lastOfPage, totalRules }, - defaultMessage: - 'Showing {firstInPage}-{lastOfPage} of {totalRules} {totalRules, plural, =1 {rule} other {rules}}', - }); - -export const SELECT_ALL_RULES = (totalRules: number) => - i18n.translate('xpack.securitySolution.detectionEngine.rules.allRules.selectAllRulesTitle', { - values: { totalRules }, - defaultMessage: 'Select all {totalRules} {totalRules, plural, =1 {rule} other {rules}}', - }); - -export const CLEAR_SELECTION = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.clearSelectionTitle', - { - defaultMessage: 'Clear selection', - } -); - -export const SELECTED_RULES = (selectedRules: number) => - i18n.translate('xpack.securitySolution.detectionEngine.rules.allRules.selectedRulesTitle', { - values: { selectedRules }, - defaultMessage: 'Selected {selectedRules} {selectedRules, plural, =1 {rule} other {rules}}', - }); - -export const EDIT_RULE_SETTINGS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.actions.editRuleSettingsDescription', - { - defaultMessage: 'Edit rule settings', - } -); - -export const LACK_OF_KIBANA_ACTIONS_FEATURE_PRIVILEGES = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.actions.lackOfKibanaActionsFeaturePrivileges', - { - defaultMessage: 'You do not have Kibana Actions privileges', - } -); - -export const LACK_OF_KIBANA_SECURITY_PRIVILEGES = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.actions.lackOfKibanaSecurityPrivileges', - { - defaultMessage: 'You do not have Kibana Security privileges', - } -); - -export const DUPLICATE_RULE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.actions.duplicateRuleDescription', - { - defaultMessage: 'Duplicate rule', - } -); - -export const EXPORT_RULE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.actions.exportRuleDescription', - { - defaultMessage: 'Export rule', - } -); - -export const DELETE_RULE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.actions.deleteRuleDescription', - { - defaultMessage: 'Delete rule', - } -); - -export const MANUAL_RULE_RUN = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.actions.manualRuleRunDescription', - { - defaultMessage: 'Manual run', - } -); - -export const MANUAL_RULE_RUN_TOOLTIP = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.actions.manualRuleRunTooltip', - { - defaultMessage: 'Manual run available only for enabled rules', - } -); - -export const COLUMN_RULE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.columns.ruleTitle', - { - defaultMessage: 'Rule', - } -); - -export const COLUMN_RISK_SCORE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.columns.riskScoreTitle', - { - defaultMessage: 'Risk score', - } -); - -export const COLUMN_SEVERITY = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.columns.severityTitle', - { - defaultMessage: 'Severity', - } -); - -export const COLUMN_LAST_COMPLETE_RUN = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.columns.lastRunTitle', - { - defaultMessage: 'Last run', - } -); - -export const COLUMN_LAST_UPDATE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.columns.lastUpdateTitle', - { - defaultMessage: 'Last updated', - } -); - -export const COLUMN_LAST_RESPONSE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.columns.lastResponseTitle', - { - defaultMessage: 'Last response', - } -); - -export const COLUMN_TAGS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.columns.tagsTitle', - { - defaultMessage: 'Tags', - } -); - -export const COLUMN_INTEGRATIONS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.columns.integrationsTitle', - { - defaultMessage: 'Integrations', - } -); - -export const COLUMN_MODIFIED = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.columns.modifiedTitle', - { - defaultMessage: 'MODIFIED', - } -); - -export const COLUMN_ENABLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.columns.enabledTitle', - { - defaultMessage: 'Enabled', - } -); - -export const COLUMN_SNOOZE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.columns.snoozeTitle', - { - defaultMessage: 'Notify', - } -); - -export const COLUMN_INDEXING_TIMES = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.columns.indexingTimes', - { - defaultMessage: 'Indexing Time (ms)', - } -); - -export const COLUMN_INDEXING_TIMES_TOOLTIP = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.columns.indexingTimesTooltip', - { - defaultMessage: 'Total time spent indexing alerts during last Rule execution', - } -); - -export const COLUMN_QUERY_TIMES = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.columns.queryTimes', - { - defaultMessage: 'Query Time (ms)', - } -); - -export const COLUMN_QUERY_TIMES_TOOLTIP = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.columns.queryTimesTooltip', - { - defaultMessage: 'Total time spent querying source indices during last Rule execution', - } -); - -export const COLUMN_GAP = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.columns.gap', - { - defaultMessage: 'Last Gap (if any)', - } -); - -export const COLUMN_GAP_TOOLTIP_SEE_DOCUMENTATION = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.columns.gapTooltipSeeDocsDescription', - { - defaultMessage: 'see documentation', - } -); - -export const RULES_TAB = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.tabs.rules', - { - defaultMessage: 'Rules', - } -); - -export const MONITORING_TAB = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.tabs.monitoring', - { - defaultMessage: 'Rule Monitoring', - } -); - -export const ENABLED_RULES = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.filters.enabledRulesTitle', - { - defaultMessage: 'Enabled rules', - } -); - -export const DISABLED_RULES = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.filters.disabledRulesTitle', - { - defaultMessage: 'Disabled rules', - } -); - -export const CUSTOM_RULES = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.filters.customRulesTitle', - { - defaultMessage: 'Custom rules', - } -); - -export const ELASTIC_RULES = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.filters.elasticRulesTitle', - { - defaultMessage: 'Elastic rules', - } -); - -export const TAGS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.filters.tagsLabel', - { - defaultMessage: 'Tags', - } -); - -export const SEARCH_TAGS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.filters.searchTagsPlaceholder', - { - defaultMessage: 'Search tags', - } -); - -export const RULES_TAG_SEARCH = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.filters.rulesTagSearchText', - { - defaultMessage: 'Rules tag search', - } -); - -export const NO_TAGS_AVAILABLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.filters.noTagsAvailableDescription', - { - defaultMessage: 'No tags available', - } -); - -export const RULE_SOURCE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.filters.ruleSourceLabel', - { - defaultMessage: 'Modifications', - } -); - -export const MODIFIED_LABEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.upgradeRules.modifiedLabel', - { - defaultMessage: 'Modified', - } -); - -export const UNMODIFIED_LABEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.upgradeRules.unmodifiedLabel', - { - defaultMessage: 'Unmodified', - } -); - -export const MODIFIED_TOOLTIP = i18n.translate( - 'xpack.securitySolution.detectionEngine.upgradeRules.modifiedTooltipDescription', - { - defaultMessage: 'This Elastic rule has been modified.', - } -); - -export const RULE_EXECTION_STATUS_FILTER = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.filters.ruleExecutionStatusFilter', - { - defaultMessage: 'Select rule execution status to filter by', - } -); - -export const NO_RULES = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.filters.noRulesTitle', - { - defaultMessage: 'No rules found', - } -); - -export const NO_RULES_BODY = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.filters.noRulesBodyTitle', - { - defaultMessage: "We weren't able to find any rules with the above filters.", - } -); - -export const NO_RULES_AVAILABLE_FOR_INSTALL = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.addRules.noRulesTitle', - { - defaultMessage: 'All Elastic rules have been installed', - } -); - -export const NO_RULES_AVAILABLE_FOR_INSTALL_BODY = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.addRules.noRulesBodyTitle', - { - defaultMessage: 'There are no prebuilt detection rules available for installation', - } -); -export const NO_RULES_AVAILABLE_FOR_UPGRADE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.noRulesTitle', - { - defaultMessage: 'All Elastic rules are up to date', - } -); - -export const NO_RULES_AVAILABLE_FOR_UPGRADE_BODY = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.noRulesBodyTitle', - { - defaultMessage: 'There are currently no available updates to your installed Elastic rules.', - } -); - -export const DEFINE_RULE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.defineRuleTitle', - { - defaultMessage: 'Define rule', - } -); - -export const ABOUT_RULE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.aboutRuleTitle', - { - defaultMessage: 'About rule', - } -); - -export const SCHEDULE_RULE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.scheduleRuleTitle', - { - defaultMessage: 'Schedule rule', - } -); - -export const RULE_ACTIONS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.ruleActionsTitle', - { - defaultMessage: 'Rule actions', - } -); - -export const DEFINITION = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.stepDefinitionTitle', - { - defaultMessage: 'Definition', - } -); - -export const ABOUT = i18n.translate('xpack.securitySolution.detectionEngine.rules.stepAboutTitle', { - defaultMessage: 'About', -}); - -export const SCHEDULE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.stepScheduleTitle', - { - defaultMessage: 'Schedule', - } -); - -export const ACTIONS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.stepActionsTitle', - { - defaultMessage: 'Actions', - } -); - -export const OPTIONAL_FIELD = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.optionalFieldDescription', - { - defaultMessage: 'Optional', - } -); - -export const CONTINUE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.continueButtonTitle', - { - defaultMessage: 'Continue', - } -); - -export const UPDATE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.updateButtonTitle', - { - defaultMessage: 'Update', - } -); - -export const DELETE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.deleteDescription', - { - defaultMessage: 'Delete', - } -); - -export const IMPORT_RULE_BTN_TITLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.importRuleModal.importRuleTitle', - { - defaultMessage: 'Import', - } -); - -export const SELECT_RULE = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.importRuleModal.selectRuleDescription', - { - defaultMessage: - 'Select rules to import. Associated rule actions and exceptions can be included.', - } -); - -export const INITIAL_PROMPT_TEXT = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.importRuleModal.initialPromptTextDescription', - { - defaultMessage: 'Select or drag and drop a valid rules_export.ndjson file', - } -); - -export const OVERWRITE_WITH_SAME_NAME = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.importRuleModal.overwriteDescription', - { - defaultMessage: 'Overwrite existing detection rules with conflicting "rule_id"', - } -); - -export const SUCCESSFULLY_IMPORTED_RULES = (totalRules: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.components.importRuleModal.successfullyImportedRulesTitle', - { - values: { totalRules }, - defaultMessage: - 'Successfully imported {totalRules} {totalRules, plural, =1 {rule} other {rules}}', - } - ); - -export const IMPORT_FAILED = (totalRules: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.components.importRuleModal.importFailedTitle', - { - values: { totalRules }, - defaultMessage: 'Failed to import {totalRules} {totalRules, plural, =1 {rule} other {rules}}', - } - ); - -export const IMPORT_FAILED_DETAILED = (message: string) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.components.importRuleModal.importFailedDetailedTitle', - { - values: { message }, - defaultMessage: '{message}', - } - ); - -export const BULK_DELETE_CONFIRMATION_TITLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.bulkDeleteConfirmationTitle', - { - defaultMessage: 'Confirm bulk deletion', - } -); - -export const SINGLE_DELETE_CONFIRMATION_TITLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.singleDeleteConfirmationTitle', - { - defaultMessage: 'Confirm deletion', - } -); - -export const DELETE_CONFIRMATION_CONFIRM = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.deleteConfirmationConfirm', - { - defaultMessage: 'Delete', - } -); - -export const DELETE_CONFIRMATION_CANCEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.components.allRules.deleteConfirmationCancel', - { - defaultMessage: 'Cancel', - } -); - -export const REFRESH_RULE_POPOVER_DESCRIPTION = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.refreshRulePopoverDescription', - { - defaultMessage: 'Automatically refresh table', - } -); - -export const REFRESH_RULE_POPOVER_LABEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.refreshRulePopoverLabel', - { - defaultMessage: 'Refresh settings', - } -); - -export const CLEAR_RULES_TABLE_FILTERS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.clearRulesTableFilters', - { - defaultMessage: 'Clear filters', - } -); - -/** - * Bulk Export - */ - -export const RULES_BULK_EXPORT_SUCCESS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.export.successToastTitle', - { - defaultMessage: 'Rules exported', - } -); - -export const RULES_BULK_EXPORT_SUCCESS_DESCRIPTION = (exportedRules: number, totalRules: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.export.successToastDescription', - { - values: { totalRules, exportedRules }, - defaultMessage: - 'Successfully exported {exportedRules} of {totalRules} {totalRules, plural, =1 {rule} other {rules}}.', - } - ); - -export const RULES_BULK_EXPORT_PREBUILT_RULES_EXCLUDED_DESCRIPTION = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.export.prebuiltRulesExcludedToastDescription', - { - defaultMessage: 'Prebuilt rules were excluded from the resulting file.', - } -); - -export const RULES_BULK_EXPORT_FAILURE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.export.errorToastTitle', - { - defaultMessage: 'Error exporting rules', - } -); - -export const RULES_BULK_EXPORT_FAILURE_DESCRIPTION = (rulesCount: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.export.errorToastDescription', - { - values: { rulesCount }, - defaultMessage: '{rulesCount, plural, =1 {# rule is} other {# rules are}} failed to export.', - } - ); - -/** - * Bulk Duplicate - */ - -export const RULES_BULK_DUPLICATE_SUCCESS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.duplicate.successToastTitle', - { - defaultMessage: 'Rules duplicated', - } -); - -export const RULES_BULK_DUPLICATE_SUCCESS_DESCRIPTION = (totalRules: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.duplicate.successToastDescription', - { - values: { totalRules }, - defaultMessage: - 'Successfully duplicated {totalRules, plural, =1 {{totalRules} rule} other {{totalRules} rules}}', - } - ); - -export const RULES_BULK_DUPLICATE_FAILURE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.duplicate.errorToastTitle', - { - defaultMessage: 'Error duplicating rule', - } -); - -export const RULES_BULK_DUPLICATE_FAILURE_DESCRIPTION = (rulesCount: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.duplicate.errorToastDescription', - { - values: { rulesCount }, - defaultMessage: - '{rulesCount, plural, =1 {# rule is} other {# rules are}} failed to duplicate.', - } - ); - -/** - * Bulk Delete - */ - -export const RULES_BULK_DELETE_SUCCESS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.delete.successToastTitle', - { - defaultMessage: 'Rules deleted', - } -); - -export const RULES_BULK_DELETE_SUCCESS_DESCRIPTION = (totalRules: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.delete.successToastDescription', - { - values: { totalRules }, - defaultMessage: - 'Successfully deleted {totalRules, plural, =1 {{totalRules} rule} other {{totalRules} rules}}', - } - ); - -export const RULES_BULK_DELETE_FAILURE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.delete.errorToastTitle', - { - defaultMessage: 'Error deleting rules', - } -); - -export const RULES_BULK_DELETE_FAILURE_DESCRIPTION = (rulesCount: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.delete.errorToastDescription', - { - values: { rulesCount }, - defaultMessage: '{rulesCount, plural, =1 {# rule is} other {# rules are}} failed to delete.', - } - ); - -/** - * Bulk Enable - */ - -export const RULES_BULK_ENABLE_SUCCESS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.enable.successToastTitle', - { - defaultMessage: 'Rules enabled', - } -); - -export const RULES_BULK_ENABLE_SUCCESS_DESCRIPTION = (totalRules: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkAction.enable.successToastDescription', - { - values: { totalRules }, - defaultMessage: - 'Successfully enabled {totalRules, plural, =1 {{totalRules} rule} other {{totalRules} rules}}', - } - ); - -export const RULES_BULK_ENABLE_FAILURE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.enable.errorToastTitle', - { - defaultMessage: 'Error enabling rules', - } -); - -export const RULES_BULK_ENABLE_FAILURE_DESCRIPTION = (rulesCount: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.enable.errorToastDescription', - { - values: { rulesCount }, - defaultMessage: '{rulesCount, plural, =1 {# rule is} other {# rules are}} failed to enable.', - } - ); - -/** - * Bulk Disable - */ - -export const RULES_BULK_DISABLE_SUCCESS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.disable.successToastTitle', - { - defaultMessage: 'Rules disabled', - } -); - -export const RULES_BULK_DISABLE_SUCCESS_DESCRIPTION = (totalRules: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.disable.successToastDescription', - { - values: { totalRules }, - defaultMessage: - 'Successfully disabled {totalRules, plural, =1 {{totalRules} rule} other {{totalRules} rules}}', - } - ); - -export const RULES_BULK_DISABLE_FAILURE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.disable.errorToastTitle', - { - defaultMessage: 'Error disabling rules', - } -); - -export const RULES_BULK_DISABLE_FAILURE_DESCRIPTION = (rulesCount: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.disable.errorToastDescription', - { - values: { rulesCount }, - defaultMessage: '{rulesCount, plural, =1 {# rule is} other {# rules are}} failed to disable.', - } - ); - -/** - * Bulk Manual Rule Run - */ - -export const RULES_BULK_MANUAL_RULE_RUN_SUCCESS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.manualRuleRun.successToastTitle', - { - defaultMessage: 'Rules scheduled', - } -); - -export const RULES_BULK_MANUAL_RULE_RUN_FAILURE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.manualRuleRun.errorToastTitle', - { - defaultMessage: 'Error scheduling manual rule run', - } -); - -export const RULES_BULK_MANUAL_RULE_RUN_SUCCESS_DESCRIPTION = (totalRules: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.manualRuleRun.successToastDescription', - { - values: { totalRules }, - defaultMessage: - 'Successfully scheduled manual rule run for {totalRules, plural, =1 {{totalRules} rule} other {{totalRules} rules}}', - } - ); - -export const RULES_BULK_MANUAL_RULE_RUN_FAILURE_DESCRIPTION = (failedRulesCount: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.manualRuleRun.errorToastDescription', - { - values: { failedRulesCount }, - defaultMessage: - '{failedRulesCount, plural, =0 {} =1 {# rule} other {# rules}} failed to schedule manual rule run.', - } - ); - -/** - * Bulk Edit - */ - -export const RULES_BULK_EDIT_SUCCESS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.edit.successToastTitle', - { - defaultMessage: 'Rules updated', - } -); - -export const RULES_BULK_EDIT_SUCCESS_DESCRIPTION = ( - succeededRulesCount: number, - skippedRulesCount: number -) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.edit.successToastDescription', - { - values: { succeededRulesCount, skippedRulesCount }, - defaultMessage: `{succeededRulesCount, plural, =0 {} =1 {You've successfully updated # rule. } other {You've successfully updated # rules. }} - {skippedRulesCount, plural, =0 {} =1 { # rule was skipped.} other { # rules were skipped.}} - `, - } - ); - -export const RULES_BULK_EDIT_SUCCESS_DATA_VIEW_RULES_SKIPPED_DETAIL = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.edit.successIndexEditToastDescription', - { - defaultMessage: - 'If you did not select to apply changes to rules using Kibana data views, those rules were not updated and will continue using data views.', - } -); - -export const RULES_BULK_EDIT_FAILURE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.edit.errorToastTitle', - { - defaultMessage: 'Error updating rules', - } -); - -export const RULES_BULK_EDIT_FAILURE_DESCRIPTION = ( - failedRulesCount: number, - skippedRulesCount: number -) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.edit.errorToastDescription', - { - values: { failedRulesCount, skippedRulesCount }, - defaultMessage: - '{failedRulesCount, plural, =0 {} =1 {# rule} other {# rules}} failed to update. {skippedRulesCount, plural, =0 {} =1 { # rule was skipped.} other { # rules were skipped.}}', - } - ); - -export const CANCEL_BUTTON_LABEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.createRule.cancelButtonLabel', - { - defaultMessage: 'Cancel', - } -); - -export const SAVED_QUERY_LOAD_ERROR_TOAST = i18n.translate( - 'xpack.securitySolution.hooks.useGetSavedQuery.errorToastMessage', - { - defaultMessage: 'Failed to load the saved query', - } -); - -// Prompt Context i18n -export const RULE_MANAGEMENT_CONTEXT_DESCRIPTION = i18n.translate( - 'xpack.securitySolution.detectionEngine.ruleManagement.ruleManagementContextDescription', - { - defaultMessage: 'Selected Detection Rules', - } -); - -export const EXPLAIN_THEN_SUMMARIZE_RULE_DETAILS = i18n.translate( - 'xpack.securitySolution.detectionEngine.ruleManagement.explainThenSummarizeRuleDetails', - { - defaultMessage: - "Please explain the selected rules above. For each rule, highlight why they are relevant, the query as published on Elastic's detection rules repository and an in-depth explanation of it, and what they typically mean for an organization if detected.", - } -); - -export const DETECTION_RULES_CONVERSATION_ID = i18n.translate( - 'xpack.securitySolution.detectionEngine.ruleManagement.detectionRulesConversationId', - { - defaultMessage: 'Detection Rules', - } -); - -export const RULE_MANAGEMENT_CONTEXT_TOOLTIP = i18n.translate( - 'xpack.securitySolution.detectionEngine.ruleManagement.ruleManagementContextTooltip', - { - defaultMessage: 'Add this alert as context', - } -); - -export const INSTALL_RULE_BUTTON = i18n.translate( - 'xpack.securitySolution.addRules.installRuleButton', - { - defaultMessage: 'Install rule', - } -); - -export const UPDATE_RULE_BUTTON = i18n.translate( - 'xpack.securitySolution.addRules.upgradeRuleButton', - { - defaultMessage: 'Update rule', - } -); - -export const UPDATE_RULE_BUTTON_TOOLTIP_CONFLICTS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.button.conflicts', - { - defaultMessage: 'Rule has conflicts. Resolve them manually.', - } -); - -export const GO_BACK_TO_RULES_TABLE_BUTTON = i18n.translate( - 'xpack.securitySolution.addRules.goBackToRulesTableButton', - { - defaultMessage: 'Go back to installed Elastic rules', - } -); - -export const RULE_UPDATES_DOCUMENTATION_LINK = i18n.translate( - 'xpack.securitySolution.ruleUpdates.documentationLink', - { - defaultMessage: "See what's new in Prebuilt Security Detection Rules", - } -); diff --git a/x-pack/plugins/security_solution/public/entity_analytics/jest.config.js b/x-pack/plugins/security_solution/public/entity_analytics/jest.config.js deleted file mode 100644 index ab3868717aa54..0000000000000 --- a/x-pack/plugins/security_solution/public/entity_analytics/jest.config.js +++ /dev/null @@ -1,19 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/entity_analytics'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/entity_analytics', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution/public/entity_analytics/**/*.{ts,tsx}', - ], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/exceptions/hooks/use_exceptions_list.card/index.tsx b/x-pack/plugins/security_solution/public/exceptions/hooks/use_exceptions_list.card/index.tsx deleted file mode 100644 index 82440e478edcd..0000000000000 --- a/x-pack/plugins/security_solution/public/exceptions/hooks/use_exceptions_list.card/index.tsx +++ /dev/null @@ -1,305 +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 { useCallback, useEffect, useMemo, useState } from 'react'; -import type { - ExceptionListItemSchema, - NamespaceType, -} from '@kbn/securitysolution-io-ts-list-types'; -import { ExceptionListTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; - -import { ViewerStatus } from '@kbn/securitysolution-exception-list-components'; -import { useGeneratedHtmlId } from '@elastic/eui'; -import { useGetSecuritySolutionLinkProps } from '../../../common/components/links'; -import { SecurityPageName } from '../../../../common/constants'; -import type { ExceptionListInfo } from '../use_all_exception_lists'; -import { useListExceptionItems } from '../use_list_exception_items'; -import * as i18n from '../../translations'; -import { checkIfListCannotBeEdited } from '../../utils/list.utils'; -import type { CheckExceptionTtlActionTypes } from '../../components/expired_exceptions_list_items_modal'; -import { CHECK_EXCEPTION_TTL_ACTION_TYPES } from '../../components/expired_exceptions_list_items_modal'; - -interface DuplicateListAction { - listId: string; - name: string; - namespaceType: NamespaceType; - includeExpiredExceptions: boolean; -} -interface ExportListAction { - id: string; - listId: string; - name: string; - namespaceType: NamespaceType; - includeExpiredExceptions: boolean; -} -interface ListAction { - id: string; - listId: string; - namespaceType: NamespaceType; -} -export const useExceptionsListCard = ({ - exceptionsList, - handleExport, - handleDelete, - handleDuplicate, - handleManageRules, -}: { - exceptionsList: ExceptionListInfo; - handleExport: ({ - id, - listId, - name, - namespaceType, - includeExpiredExceptions, - }: ExportListAction) => () => Promise<void>; - handleDelete: ({ id, listId, namespaceType }: ListAction) => () => Promise<void>; - handleDuplicate: ({ - listId, - name, - namespaceType, - includeExpiredExceptions, - }: DuplicateListAction) => () => Promise<void>; - handleManageRules: () => void; -}) => { - const [viewerStatus, setViewerStatus] = useState<ViewerStatus | string>(ViewerStatus.LOADING); - const [exceptionToEdit, setExceptionToEdit] = useState<ExceptionListItemSchema>(); - const [showAddExceptionFlyout, setShowAddExceptionFlyout] = useState(false); - const [showEditExceptionFlyout, setShowEditExceptionFlyout] = useState(false); - const [showIncludeExpiredExceptionsModal, setShowIncludeExpiredExceptionsModal] = - useState<CheckExceptionTtlActionTypes | null>(null); - - const { - name: listName, - list_id: listId, - rules: listRules, - type: listType, - created_by: createdBy, - created_at: createdAt, - description: listDescription, - } = exceptionsList; - - const onFinishFetchingExceptions = useCallback(() => { - setViewerStatus(''); - }, [setViewerStatus]); - - const onEditExceptionItem = (exception: ExceptionListItemSchema) => { - setExceptionToEdit(exception); - setShowEditExceptionFlyout(true); - }; - - const { - lastUpdated, - exceptionViewerStatus, - exceptions, - pagination, - ruleReferences, - fetchItems, - onDeleteException, - onPaginationChange, - } = useListExceptionItems({ - list: exceptionsList, - deleteToastTitle: i18n.EXCEPTION_ITEM_DELETE_TITLE, - deleteToastBody: (name) => i18n.EXCEPTION_ITEM_DELETE_TEXT(name), - errorToastBody: i18n.EXCEPTION_ERROR_DESCRIPTION, - errorToastTitle: i18n.EXCEPTION_ERROR_TITLE, - onEditListExceptionItem: onEditExceptionItem, - onFinishFetchingExceptions, - }); - - useEffect(() => { - fetchItems(null, ViewerStatus.LOADING); - }, [fetchItems]); - - const [toggleAccordion, setToggleAccordion] = useState(false); - const openAccordionId = useGeneratedHtmlId({ prefix: 'openAccordion' }); - - const listCannotBeEdited = checkIfListCannotBeEdited(exceptionsList); - - const emptyViewerTitle = useMemo(() => { - return viewerStatus === ViewerStatus.EMPTY ? i18n.EXCEPTION_LIST_EMPTY_VIEWER_TITLE : ''; - }, [viewerStatus]); - - const emptyViewerBody = useMemo(() => { - return viewerStatus === ViewerStatus.EMPTY - ? i18n.EXCEPTION_LIST_EMPTY_VIEWER_BODY(exceptionsList.name) - : ''; - }, [exceptionsList.name, viewerStatus]); - - const emptyViewerButtonText = useMemo(() => { - return exceptionsList.type === ExceptionListTypeEnum.ENDPOINT - ? i18n.EXCEPTION_LIST_EMPTY_VIEWER_BUTTON_ENDPOINT - : i18n.EXCEPTION_LIST_EMPTY_VIEWER_BUTTON; - }, [exceptionsList.type]); - - const menuActionItems = useMemo( - () => [ - { - key: 'Export', - icon: 'exportAction', - label: i18n.EXPORT_EXCEPTION_LIST, - onClick: (e: React.MouseEvent<Element, MouseEvent>) => { - if (listType === ExceptionListTypeEnum.ENDPOINT) { - handleExport({ - id: exceptionsList.id, - listId: exceptionsList.list_id, - name: exceptionsList.name, - namespaceType: exceptionsList.namespace_type, - includeExpiredExceptions: true, - })(); - } else { - setShowIncludeExpiredExceptionsModal(CHECK_EXCEPTION_TTL_ACTION_TYPES.EXPORT); - } - }, - }, - { - key: 'Duplicate', - icon: 'copy', - label: i18n.DUPLICATE_EXCEPTION_LIST, - disabled: listCannotBeEdited, - onClick: (_: React.MouseEvent<Element, MouseEvent>) => { - setShowIncludeExpiredExceptionsModal(CHECK_EXCEPTION_TTL_ACTION_TYPES.DUPLICATE); - }, - }, - { - key: 'Delete', - icon: 'trash', - disabled: listCannotBeEdited, - label: i18n.DELETE_EXCEPTION_LIST, - onClick: (e: React.MouseEvent<Element, MouseEvent>) => { - handleDelete({ - id: exceptionsList.id, - listId: exceptionsList.list_id, - namespaceType: exceptionsList.namespace_type, - })(); - }, - }, - { - key: 'LinkRules', - icon: 'gear', - disabled: listCannotBeEdited, - label: i18n.LINK_RULES_OVERFLOW_BUTTON_TITLE, - onClick: (e: React.MouseEvent<Element, MouseEvent>) => { - handleManageRules(); - }, - }, - ], - [ - listCannotBeEdited, - listType, - handleExport, - exceptionsList.id, - exceptionsList.list_id, - exceptionsList.name, - exceptionsList.namespace_type, - handleDelete, - handleManageRules, - ] - ); - - // Once details Page is added all of these methods will be used from it as well - // as their own states - const onAddExceptionClick = useCallback(() => { - setShowAddExceptionFlyout(true); - }, [setShowAddExceptionFlyout]); - - const handleCancelExceptionItemFlyout = () => { - setShowAddExceptionFlyout(false); - setShowEditExceptionFlyout(false); - }; - const handleConfirmExceptionFlyout = useCallback( - (didExceptionChange: boolean): void => { - setShowAddExceptionFlyout(false); - setShowEditExceptionFlyout(false); - if (!didExceptionChange) return; - fetchItems(); - }, - [fetchItems, setShowAddExceptionFlyout, setShowEditExceptionFlyout] - ); - - const onExportListClick = useCallback(() => { - setShowIncludeExpiredExceptionsModal(CHECK_EXCEPTION_TTL_ACTION_TYPES.EXPORT); - }, [setShowIncludeExpiredExceptionsModal]); - - const handleCancelExpiredExceptionsModal = () => { - setShowIncludeExpiredExceptionsModal(null); - }; - - const handleConfirmExpiredExceptionsModal = useCallback( - (includeExpiredExceptions: boolean): void => { - if (showIncludeExpiredExceptionsModal === CHECK_EXCEPTION_TTL_ACTION_TYPES.EXPORT) { - handleExport({ - id: exceptionsList.id, - listId: exceptionsList.list_id, - name: exceptionsList.name, - namespaceType: exceptionsList.namespace_type, - includeExpiredExceptions, - })(); - } - if (showIncludeExpiredExceptionsModal === CHECK_EXCEPTION_TTL_ACTION_TYPES.DUPLICATE) { - handleDuplicate({ - listId: exceptionsList.list_id, - name: exceptionsList.name, - namespaceType: exceptionsList.namespace_type, - includeExpiredExceptions, - })(); - } - }, - [ - showIncludeExpiredExceptionsModal, - handleExport, - exceptionsList.id, - exceptionsList.list_id, - exceptionsList.name, - exceptionsList.namespace_type, - handleDuplicate, - ] - ); - - // routes to x-pack/plugins/security_solution/public/exceptions/routes.tsx - // details component is here: x-pack/plugins/security_solution/public/exceptions/pages/list_detail_view/index.tsx - const { onClick: goToExceptionDetail } = useGetSecuritySolutionLinkProps()({ - deepLinkId: SecurityPageName.exceptions, - path: `/details/${exceptionsList.list_id}`, - }); - return { - listId, - listName, - listDescription, - createdAt: new Date(createdAt).toDateString(), - createdBy, - listRulesCount: listRules.length.toString(), - exceptionItemsCount: pagination.totalItemCount.toString(), - listType, - menuActionItems, - showAddExceptionFlyout, - toggleAccordion, - openAccordionId, - viewerStatus, - exceptionToEdit, - showEditExceptionFlyout, - lastUpdated, - exceptions, - ruleReferences, - pagination, - exceptionViewerStatus, - onEditExceptionItem, - onDeleteException, - onPaginationChange, - setToggleAccordion, - onAddExceptionClick, - handleConfirmExceptionFlyout, - handleCancelExceptionItemFlyout, - goToExceptionDetail, - emptyViewerTitle, - emptyViewerBody, - emptyViewerButtonText, - showIncludeExpiredExceptionsModal, - onExportListClick, - handleCancelExpiredExceptionsModal, - handleConfirmExpiredExceptionsModal, - }; -}; diff --git a/x-pack/plugins/security_solution/public/exceptions/hooks/use_import_exception_list/index.tsx b/x-pack/plugins/security_solution/public/exceptions/hooks/use_import_exception_list/index.tsx deleted file mode 100644 index 536d558b371a2..0000000000000 --- a/x-pack/plugins/security_solution/public/exceptions/hooks/use_import_exception_list/index.tsx +++ /dev/null @@ -1,49 +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 { EXCEPTION_LIST_URL } from '@kbn/securitysolution-list-constants'; - -import type { ImportExceptionsResponseSchema } from '@kbn/securitysolution-io-ts-list-types'; - -import type { HttpStart } from '@kbn/core/public'; -import { useAsync, withOptionalSignal } from '@kbn/securitysolution-hook-utils'; - -export const importExceptionList = async ({ - file, - http, - signal, - overwrite, - overwriteExceptions, - asNewList, -}: { - // TODO: Replace these with kbn packaged versions once we have those available to us - // These originally came from this location below before moving them to this hacked "any" types: - // import { HttpStart, NotificationsStart } from '../../../../../src/core/public'; - http: HttpStart; - signal: AbortSignal; - file: File; - overwrite: boolean; - overwriteExceptions: boolean; - asNewList: boolean; -}): Promise<ImportExceptionsResponseSchema> => { - const formData = new FormData(); - formData.append('file', file as Blob); - - const res = await http.post<ImportExceptionsResponseSchema>(`${EXCEPTION_LIST_URL}/_import`, { - version: '2023-10-31', - body: formData, - query: { overwrite, overwrite_exceptions: overwriteExceptions, as_new_list: asNewList }, - headers: { 'Content-Type': undefined }, - method: 'POST', - signal, - }); - return res; -}; - -const importListWithOptionalSignal = withOptionalSignal(importExceptionList); - -export const useImportExceptionList = () => useAsync(importListWithOptionalSignal); diff --git a/x-pack/plugins/security_solution/public/exceptions/jest.config.js b/x-pack/plugins/security_solution/public/exceptions/jest.config.js deleted file mode 100644 index 6c6bdbe0da125..0000000000000 --- a/x-pack/plugins/security_solution/public/exceptions/jest.config.js +++ /dev/null @@ -1,29 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/exceptions'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/exceptions', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution/public/exceptions/**/*.{ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution/public/exceptions/*.test.{ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution/public/exceptions/*.constants.{ts}', - '!<rootDir>/x-pack/plugins/security_solution/public/exceptions/{__test__,__snapshots__,__examples__,*mock*,tests,test_helpers,integration_tests,types}/**/*', - '!<rootDir>/x-pack/plugins/security_solution/public/exceptions/*mock*.{ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution/public/exceptions/*.test.{ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution/public/exceptions/*.d.ts', - '!<rootDir>/x-pack/plugins/security_solution/public/exceptions/*.config.ts', - '!<rootDir>/x-pack/plugins/security_solution/public/exceptions/index.{js,ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution/public/exceptions/translations/*', - '!<rootDir>/x-pack/plugins/security_solution/public/exceptions/*.translations', - ], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/explore/jest.config.js b/x-pack/plugins/security_solution/public/explore/jest.config.js deleted file mode 100644 index cf380849ea68c..0000000000000 --- a/x-pack/plugins/security_solution/public/explore/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/explore'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/explore', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/explore/**/*.{ts,tsx}'], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/flyout/README.md b/x-pack/plugins/security_solution/public/flyout/README.md deleted file mode 100644 index be70c3ca0ebec..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# Security Solution expandable flyouts - -For more info on the expandable flyout, see the `@kbn/expandable-flyout` package. - -## Description - -The Security Solution plugin aims at having a single instance of the expandable flyout. That instance can display as many panels as we need. This folder hosts all the panels that are can be displayed in the Security Solution flyout. Panels can be differentiated as to be displayed in different sections of the expandable flyout (right, left or preview), but ultimately, nothing prevents us from displaying a panel in any section we want. - -> Remember to add any new panels to the `index.tsx` at the root of the [flyout folder](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/flyout). These are passed to the `@kbn/expandable-flyout` package as `registeredPanels`. Failing to do so will result in the panel not being rendered. - -## Folder Structure - -The structure of the `flyout` folder is intended to work as follows: -- multiple top level folders referring to the _type_ of flyout (for example document details, user, host, rule, cases...) and would contain all the panels for that flyout _type_. Each of these top level folders can be organized the way you want, but we recommend following a similar structure to the one we have for the `document_details` flyout type, where the `right`, `left` and `preview` folders correspond to the panels displayed in the right, left and preview flyout sections respectively. The `shared` folder contains any shared components/hooks/services/helpers that are used within the other folders. -``` -document_details -└─── right -└─── left -└─── preview -└─── shared -``` -- one top level `shared` folder containing all the components/hooks/services/helpers that are used across multiple flyout types. Putting code in this folder should be very deliberate, and should follow some guidelines: - - code built in isolation (meaning that it should not be built with a specific flyout type or usage in mind) - - extensively tested - - components should have storybook stories - -The `flyout` folder structure should therefore look like this: -``` -flyout -│ index.tsx -│ jest.config.js -│ README.md -│ -└─── document_details -│ └─── right -│ └─── left -│ └─── preview -│ -└─── new_type -│ └─── right -│ └─── preview -│ -└─── other_new_type -│ └─── right -│ └─── left -│ -└─── ... -│ -└─── shared - └─── components -``` - -## Shared flyout components - -Here's a non-exhaustive list of the reusable component in the top-level `shared` folder. We recommend using these components to create a unified flyout experience. - - - [FlyoutNavigation](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.tsx): navigation menu on the **right panel** only, with expand/collapse button and option to pass in a list of actions to be displayed on top. Works best when used in combination with the header component below. - - [FlyoutHeader](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_header.tsx): wrapper of `EuiFlyoutHeader`, setting the recommended `16px` padding using a EuiPanel. - - [FlyoutTitle](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_title.tsx): title component with optional icon to indicate the type of document, works when the title is link or pure text - - [FlyoutHeaderTabs](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_header_tabs.tsx): Wrapper of `EuiTabs`, setting bottom margin to align with the flyout header divider - - [FlyoutBody](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_body.tsx): wrapper of `EuiFlyoutHeader`, setting the recommended `16px` padding using a EuiPanel. - - [FlyoutFooter](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_footer.tsx): wrapper of `EuiFlyoutFooter`, setting the recommended `16px` padding using a EuiPanel. - - [FlyoutError](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_error.tsx): displays a `EuiEmptyPrompt` for error messages, correctly positioned and sized when used in at the panel level (not for individual components) - - [FlyoutLoading](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_loading.tsx): displays an `EuiLoadingSpinner` component correctly positioned and sized when used in at the panel level (not for individual components) diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/graph_visualization.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/graph_visualization.tsx deleted file mode 100644 index 96374b81e18d5..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/graph_visualization.tsx +++ /dev/null @@ -1,56 +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 { css } from '@emotion/css'; -import { EuiLoadingSpinner } from '@elastic/eui'; -import { useGetScopedSourcererDataView } from '../../../../sourcerer/components/use_get_sourcerer_data_view'; -import { SourcererScopeName } from '../../../../sourcerer/store/model'; -import { useDocumentDetailsContext } from '../../shared/context'; -import { GRAPH_VISUALIZATION_TEST_ID } from './test_ids'; -import { useGraphPreview } from '../../shared/hooks/use_graph_preview'; - -const GraphInvestigationLazy = React.lazy(() => - import('@kbn/cloud-security-posture-graph').then((module) => ({ - default: module.GraphInvestigation, - })) -); - -export const GRAPH_ID = 'graph-visualization' as const; - -/** - * Graph visualization view displayed in the document details expandable flyout left section under the Visualize tab - */ -export const GraphVisualization: React.FC = memo(() => { - const dataView = useGetScopedSourcererDataView({ - sourcererScope: SourcererScopeName.default, - }); - const { getFieldsData, dataAsNestedObject } = useDocumentDetailsContext(); - const { eventIds, timestamp } = useGraphPreview({ - getFieldsData, - ecsData: dataAsNestedObject, - }); - - return ( - <div - data-test-subj={GRAPH_VISUALIZATION_TEST_ID} - css={css` - height: calc(100vh - 250px); - min-height: 400px; - width: 100%; - `} - > - {dataView && ( - <React.Suspense fallback={<EuiLoadingSpinner />}> - <GraphInvestigationLazy dataView={dataView} eventIds={eventIds} timestamp={timestamp} /> - </React.Suspense> - )} - </div> - ); -}); - -GraphVisualization.displayName = 'GraphVisualization'; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/preview/footer.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/preview/footer.test.tsx deleted file mode 100644 index 2eee16007f91c..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/preview/footer.test.tsx +++ /dev/null @@ -1,83 +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 from 'react'; -import { render } from '@testing-library/react'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { TestProviders } from '../../../common/mock'; -import { DocumentDetailsRightPanelKey } from '../shared/constants/panel_keys'; -import { mockFlyoutApi } from '../shared/mocks/mock_flyout_context'; -import { mockContextValue } from '../shared/mocks/mock_context'; -import { DocumentDetailsContext } from '../shared/context'; -import { PreviewPanelFooter } from './footer'; -import { PREVIEW_FOOTER_TEST_ID, PREVIEW_FOOTER_LINK_TEST_ID } from './test_ids'; -import { createTelemetryServiceMock } from '../../../common/lib/telemetry/telemetry_service.mock'; - -jest.mock('@kbn/expandable-flyout'); - -const mockedTelemetry = createTelemetryServiceMock(); -jest.mock('../../../common/lib/kibana', () => { - return { - useKibana: () => ({ - services: { - telemetry: mockedTelemetry, - }, - }), - }; -}); - -describe('<PreviewPanelFooter />', () => { - beforeAll(() => { - jest.mocked(useExpandableFlyoutApi).mockReturnValue(mockFlyoutApi); - }); - - it('should render footer for alert', () => { - const { getByTestId } = render( - <TestProviders> - <DocumentDetailsContext.Provider value={mockContextValue}> - <PreviewPanelFooter /> - </DocumentDetailsContext.Provider> - </TestProviders> - ); - expect(getByTestId(PREVIEW_FOOTER_TEST_ID)).toBeInTheDocument(); - expect(getByTestId(PREVIEW_FOOTER_TEST_ID)).toHaveTextContent('Show full alert details'); - }); - - it('should render footer for event', () => { - const { getByTestId } = render( - <TestProviders> - <DocumentDetailsContext.Provider - value={{ ...mockContextValue, getFieldsData: () => 'event' }} - > - <PreviewPanelFooter /> - </DocumentDetailsContext.Provider> - </TestProviders> - ); - expect(getByTestId(PREVIEW_FOOTER_TEST_ID)).toHaveTextContent('Show full event details'); - }); - - it('should open document details flyout when clicked', () => { - const { getByTestId } = render( - <TestProviders> - <DocumentDetailsContext.Provider value={mockContextValue}> - <PreviewPanelFooter /> - </DocumentDetailsContext.Provider> - </TestProviders> - ); - - getByTestId(PREVIEW_FOOTER_LINK_TEST_ID).click(); - expect(mockFlyoutApi.openFlyout).toHaveBeenCalledWith({ - right: { - id: DocumentDetailsRightPanelKey, - params: { - id: mockContextValue.eventId, - indexName: mockContextValue.indexName, - scopeId: mockContextValue.scopeId, - }, - }, - }); - }); -}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/preview/footer.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/preview/footer.tsx deleted file mode 100644 index b2df6c096e279..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/preview/footer.tsx +++ /dev/null @@ -1,71 +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, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import React, { useCallback, useMemo } from 'react'; -import { i18n } from '@kbn/i18n'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { getField } from '../shared/utils'; -import { EventKind } from '../shared/constants/event_kinds'; -import { FlyoutFooter } from '../../shared/components/flyout_footer'; -import { DocumentDetailsRightPanelKey } from '../shared/constants/panel_keys'; -import { useDocumentDetailsContext } from '../shared/context'; -import { PREVIEW_FOOTER_TEST_ID, PREVIEW_FOOTER_LINK_TEST_ID } from './test_ids'; -import { useKibana } from '../../../common/lib/kibana'; -import { DocumentEventTypes } from '../../../common/lib/telemetry'; - -/** - * Footer at the bottom of preview panel with a link to open document details flyout - */ -export const PreviewPanelFooter = () => { - const { eventId, indexName, scopeId, getFieldsData } = useDocumentDetailsContext(); - const { openFlyout } = useExpandableFlyoutApi(); - const { telemetry } = useKibana().services; - - const isAlert = useMemo( - () => getField(getFieldsData('event.kind')) === EventKind.signal, - [getFieldsData] - ); - - const openDocumentFlyout = useCallback(() => { - openFlyout({ - right: { - id: DocumentDetailsRightPanelKey, - params: { - id: eventId, - indexName, - scopeId, - }, - }, - }); - telemetry.reportEvent(DocumentEventTypes.DetailsFlyoutOpened, { - location: scopeId, - panel: 'right', - }); - }, [openFlyout, eventId, indexName, scopeId, telemetry]); - - return ( - <FlyoutFooter data-test-subj={PREVIEW_FOOTER_TEST_ID}> - <EuiFlexGroup justifyContent="center"> - <EuiFlexItem grow={false}> - <EuiLink - onClick={openDocumentFlyout} - target="_blank" - data-test-subj={PREVIEW_FOOTER_LINK_TEST_ID} - > - <> - {i18n.translate('xpack.securitySolution.flyout.preview.openFlyoutLabel', { - values: { isAlert }, - defaultMessage: 'Show full {isAlert, select, true{alert} other{event}} details', - })} - </> - </EuiLink> - </EuiFlexItem> - </EuiFlexGroup> - </FlyoutFooter> - ); -}; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/analyzer_preview_container.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/analyzer_preview_container.test.tsx deleted file mode 100644 index 3e841da34a4fa..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/analyzer_preview_container.test.tsx +++ /dev/null @@ -1,259 +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 { render, screen } from '@testing-library/react'; -import { TestProviders } from '../../../../common/mock'; -import React from 'react'; -import { DocumentDetailsContext } from '../../shared/context'; -import { mockContextValue } from '../../shared/mocks/mock_context'; -import { AnalyzerPreviewContainer } from './analyzer_preview_container'; -import { useIsInvestigateInResolverActionEnabled } from '../../../../detections/components/alerts_table/timeline_actions/investigate_in_resolver'; -import { ANALYZER_PREVIEW_TEST_ID } from './test_ids'; -import { useAlertPrevalenceFromProcessTree } from '../../shared/hooks/use_alert_prevalence_from_process_tree'; -import * as mock from '../mocks/mock_analyzer_data'; -import { - EXPANDABLE_PANEL_CONTENT_TEST_ID, - EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID, - EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID, - EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID, - EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID, -} from '../../../shared/components/test_ids'; - -import { useInvestigateInTimeline } from '../../../../detections/components/alerts_table/timeline_actions/use_investigate_in_timeline'; - -jest.mock( - '../../../../detections/components/alerts_table/timeline_actions/investigate_in_resolver' -); -jest.mock('../../shared/hooks/use_alert_prevalence_from_process_tree'); -jest.mock( - '../../../../detections/components/alerts_table/timeline_actions/use_investigate_in_timeline' -); - -const mockNavigateToAnalyzer = jest.fn(); -jest.mock('../../shared/hooks/use_navigate_to_analyzer', () => { - return { useNavigateToAnalyzer: () => ({ navigateToAnalyzer: mockNavigateToAnalyzer }) }; -}); - -jest.mock('@kbn/kibana-react-plugin/public', () => { - const original = jest.requireActual('@kbn/kibana-react-plugin/public'); - return { - ...original, - useUiSetting$: () => mockUseUiSetting(), - }; -}); - -jest.mock('react-router-dom', () => { - const actual = jest.requireActual('react-router-dom'); - return { ...actual, useLocation: jest.fn().mockReturnValue({ pathname: '' }) }; -}); -jest.mock('react-redux', () => { - const original = jest.requireActual('react-redux'); - - return { - ...original, - useDispatch: () => jest.fn(), - }; -}); - -const mockUseUiSetting = jest.fn().mockReturnValue([false]); -jest.mock('@kbn/kibana-react-plugin/public', () => { - const original = jest.requireActual('@kbn/kibana-react-plugin/public'); - return { - ...original, - useUiSetting$: () => mockUseUiSetting(), - }; -}); - -const NO_ANALYZER_MESSAGE = - 'You can only visualize events triggered by hosts configured with the Elastic Defend integration or any sysmon data from winlogbeat. Refer to Visual event analyzer(external, opens in a new tab or window) for more information.'; - -const renderAnalyzerPreview = (context = mockContextValue) => - render( - <TestProviders> - <DocumentDetailsContext.Provider value={context}> - <AnalyzerPreviewContainer /> - </DocumentDetailsContext.Provider> - </TestProviders> - ); - -describe('AnalyzerPreviewContainer', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - it('should render component and link in header', () => { - (useIsInvestigateInResolverActionEnabled as jest.Mock).mockReturnValue(true); - (useAlertPrevalenceFromProcessTree as jest.Mock).mockReturnValue({ - loading: false, - error: false, - alertIds: ['alertid'], - statsNodes: mock.mockStatsNodes, - }); - (useInvestigateInTimeline as jest.Mock).mockReturnValue({ - investigateInTimelineAlertClick: jest.fn(), - }); - - const { getByTestId } = renderAnalyzerPreview(); - - expect(getByTestId(ANALYZER_PREVIEW_TEST_ID)).toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - screen.queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - expect( - screen.getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - screen.getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - screen.queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - expect( - screen.getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) - ).not.toHaveTextContent(NO_ANALYZER_MESSAGE); - }); - - it('should render error message and text in header', () => { - (useIsInvestigateInResolverActionEnabled as jest.Mock).mockReturnValue(false); - (useInvestigateInTimeline as jest.Mock).mockReturnValue({ - investigateInTimelineAlertClick: jest.fn(), - }); - - const { getByTestId } = renderAnalyzerPreview(); - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) - ).toHaveTextContent(NO_ANALYZER_MESSAGE); - }); - - describe('when visualizationInFlyoutEnabled is disabled', () => { - it('should navigate to analyzer in timeline when clicking on title', () => { - (useIsInvestigateInResolverActionEnabled as jest.Mock).mockReturnValue(true); - (useAlertPrevalenceFromProcessTree as jest.Mock).mockReturnValue({ - loading: false, - error: false, - alertIds: ['alertid'], - statsNodes: mock.mockStatsNodes, - }); - (useInvestigateInTimeline as jest.Mock).mockReturnValue({ - investigateInTimelineAlertClick: jest.fn(), - }); - - const { getByTestId } = renderAnalyzerPreview(); - - const { investigateInTimelineAlertClick } = useInvestigateInTimeline({}); - - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(ANALYZER_PREVIEW_TEST_ID)).click(); - expect(investigateInTimelineAlertClick).toHaveBeenCalled(); - }); - - it('should not navigate to analyzer when in preview and clicking on title', () => { - (useIsInvestigateInResolverActionEnabled as jest.Mock).mockReturnValue(true); - (useAlertPrevalenceFromProcessTree as jest.Mock).mockReturnValue({ - loading: false, - error: false, - alertIds: ['alertid'], - statsNodes: mock.mockStatsNodes, - }); - (useInvestigateInTimeline as jest.Mock).mockReturnValue({ - investigateInTimelineAlertClick: jest.fn(), - }); - - const { queryByTestId } = renderAnalyzerPreview({ ...mockContextValue, isPreview: true }); - expect( - queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - const { investigateInTimelineAlertClick } = useInvestigateInTimeline({}); - expect(investigateInTimelineAlertClick).not.toHaveBeenCalled(); - }); - - it('should not navigate to analyzer when in preview mode', () => { - (useIsInvestigateInResolverActionEnabled as jest.Mock).mockReturnValue(true); - (useAlertPrevalenceFromProcessTree as jest.Mock).mockReturnValue({ - loading: false, - error: false, - alertIds: ['alertid'], - statsNodes: mock.mockStatsNodes, - }); - (useInvestigateInTimeline as jest.Mock).mockReturnValue({ - investigateInTimelineAlertClick: jest.fn(), - }); - - const { queryByTestId } = renderAnalyzerPreview({ ...mockContextValue, isPreviewMode: true }); - expect( - queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - const { investigateInTimelineAlertClick } = useInvestigateInTimeline({}); - expect(investigateInTimelineAlertClick).not.toHaveBeenCalled(); - }); - }); - - describe('when visualizationInFlyoutEnabled is enabled', () => { - it('should open left flyout visualization tab when clicking on title', () => { - mockUseUiSetting.mockReturnValue([true]); - - (useIsInvestigateInResolverActionEnabled as jest.Mock).mockReturnValue(true); - (useAlertPrevalenceFromProcessTree as jest.Mock).mockReturnValue({ - loading: false, - error: false, - alertIds: ['alertid'], - statsNodes: mock.mockStatsNodes, - }); - (useInvestigateInTimeline as jest.Mock).mockReturnValue({ - investigateInTimelineAlertClick: jest.fn(), - }); - - const { getByTestId } = renderAnalyzerPreview(); - - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(ANALYZER_PREVIEW_TEST_ID)).click(); - expect(mockNavigateToAnalyzer).toHaveBeenCalled(); - }); - - it('should disable link when in rule preview', () => { - mockUseUiSetting.mockReturnValue([true]); - (useIsInvestigateInResolverActionEnabled as jest.Mock).mockReturnValue(true); - (useAlertPrevalenceFromProcessTree as jest.Mock).mockReturnValue({ - loading: false, - error: false, - alertIds: ['alertid'], - statsNodes: mock.mockStatsNodes, - }); - (useInvestigateInTimeline as jest.Mock).mockReturnValue({ - investigateInTimelineAlertClick: jest.fn(), - }); - - const { queryByTestId } = renderAnalyzerPreview({ ...mockContextValue, isPreview: true }); - expect( - queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - }); - - it('should disable link when in preview mode', () => { - mockUseUiSetting.mockReturnValue([true]); - (useIsInvestigateInResolverActionEnabled as jest.Mock).mockReturnValue(true); - (useAlertPrevalenceFromProcessTree as jest.Mock).mockReturnValue({ - loading: false, - error: false, - alertIds: ['alertid'], - statsNodes: mock.mockStatsNodes, - }); - (useInvestigateInTimeline as jest.Mock).mockReturnValue({ - investigateInTimelineAlertClick: jest.fn(), - }); - - const { queryByTestId } = renderAnalyzerPreview({ ...mockContextValue, isPreviewMode: true }); - expect( - queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - }); - }); -}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/analyzer_preview_container.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/analyzer_preview_container.tsx deleted file mode 100644 index 286394d16aadc..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/analyzer_preview_container.tsx +++ /dev/null @@ -1,129 +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 { useDispatch } from 'react-redux'; -import { TimelineTabs } from '@kbn/securitysolution-data-table'; -import { EuiLink, EuiMark } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { useUiSetting$ } from '@kbn/kibana-react-plugin/public'; -import { ENABLE_VISUALIZATIONS_IN_FLYOUT_SETTING } from '../../../../../common/constants'; -import { useStartTransaction } from '../../../../common/lib/apm/use_start_transaction'; -import { useInvestigateInTimeline } from '../../../../detections/components/alerts_table/timeline_actions/use_investigate_in_timeline'; -import { ALERTS_ACTIONS } from '../../../../common/lib/apm/user_actions'; -import { getScopedActions } from '../../../../helpers'; -import { setActiveTabTimeline } from '../../../../timelines/store/actions'; -import { useDocumentDetailsContext } from '../../shared/context'; -import { useIsInvestigateInResolverActionEnabled } from '../../../../detections/components/alerts_table/timeline_actions/investigate_in_resolver'; -import { AnalyzerPreview } from './analyzer_preview'; -import { ANALYZER_PREVIEW_TEST_ID } from './test_ids'; -import { useNavigateToAnalyzer } from '../../shared/hooks/use_navigate_to_analyzer'; -import { ExpandablePanel } from '../../../shared/components/expandable_panel'; - -const timelineId = 'timeline-1'; - -/** - * Analyzer preview under Overview, Visualizations. It shows a tree representation of analyzer. - */ -export const AnalyzerPreviewContainer: React.FC = () => { - const { dataAsNestedObject, isPreview, eventId, indexName, scopeId, isPreviewMode } = - useDocumentDetailsContext(); - - const [visualizationInFlyoutEnabled] = useUiSetting$<boolean>( - ENABLE_VISUALIZATIONS_IN_FLYOUT_SETTING - ); - // decide whether to show the analyzer preview or not - const isEnabled = useIsInvestigateInResolverActionEnabled(dataAsNestedObject); - - const dispatch = useDispatch(); - const { startTransaction } = useStartTransaction(); - const { investigateInTimelineAlertClick } = useInvestigateInTimeline({ - ecsRowData: dataAsNestedObject, - }); - - // open timeline to the analyzer tab because the expandable flyout left panel Visualize => Analyzer tab is not ready - const goToAnalyzerTab = useCallback(async () => { - // open timeline - await investigateInTimelineAlertClick(); - - // open analyzer tab - startTransaction({ name: ALERTS_ACTIONS.OPEN_ANALYZER }); - const scopedActions = getScopedActions(timelineId); - if (scopedActions && dataAsNestedObject) { - dispatch( - scopedActions.updateGraphEventId({ id: timelineId, graphEventId: dataAsNestedObject._id }) - ); - } - dispatch(setActiveTabTimeline({ id: timelineId, activeTab: TimelineTabs.graph })); - }, [dataAsNestedObject, dispatch, investigateInTimelineAlertClick, startTransaction]); - - const { navigateToAnalyzer } = useNavigateToAnalyzer({ - eventId, - indexName, - isFlyoutOpen: true, - scopeId, - }); - - return ( - <ExpandablePanel - header={{ - title: ( - <FormattedMessage - id="xpack.securitySolution.flyout.right.visualizations.analyzerPreview.analyzerPreviewTitle" - defaultMessage="Analyzer preview" - /> - ), - iconType: visualizationInFlyoutEnabled ? 'arrowStart' : 'timeline', - ...(isEnabled && - !isPreview && - !isPreviewMode && { - link: { - callback: visualizationInFlyoutEnabled ? navigateToAnalyzer : goToAnalyzerTab, - tooltip: visualizationInFlyoutEnabled ? ( - <FormattedMessage - id="xpack.securitySolution.flyout.right.visualizations.analyzerPreview.analyzerPreviewOpenAnalyzerTooltip" - defaultMessage="Open analyzer graph" - /> - ) : ( - <FormattedMessage - id="xpack.securitySolution.flyout.right.visualizations.analyzerPreview.analyzerPreviewInvestigateTooltip" - defaultMessage="Investigate in timeline" - /> - ), - }, - }), - }} - data-test-subj={ANALYZER_PREVIEW_TEST_ID} - > - {isEnabled ? ( - <AnalyzerPreview /> - ) : ( - <FormattedMessage - id="xpack.securitySolution.flyout.right.visualizations.analyzerPreview.noDataDescription" - defaultMessage="You can only visualize events triggered by hosts configured with the Elastic Defend integration or any {sysmon} data from {winlogbeat}. Refer to {link} for more information." - values={{ - sysmon: <EuiMark>{'sysmon'}</EuiMark>, - winlogbeat: <EuiMark>{'winlogbeat'}</EuiMark>, - link: ( - <EuiLink - href="https://www.elastic.co/guide/en/security/current/visual-event-analyzer.html" - target="_blank" - > - <FormattedMessage - id="xpack.securitySolution.flyout.right.visualizations.analyzerPreview.noDataLinkText" - defaultMessage="Visual event analyzer" - /> - </EuiLink> - ), - }} - /> - )} - </ExpandablePanel> - ); -}; - -AnalyzerPreviewContainer.displayName = 'AnalyzerPreviewContainer'; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview_container.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview_container.test.tsx deleted file mode 100644 index c805f2a3c67a7..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview_container.test.tsx +++ /dev/null @@ -1,334 +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 { render } from '@testing-library/react'; -import { useFetchGraphData } from '@kbn/cloud-security-posture-graph/src/hooks'; -import { TestProviders } from '../../../../common/mock'; -import React from 'react'; -import { DocumentDetailsContext } from '../../shared/context'; -import { mockContextValue } from '../../shared/mocks/mock_context'; -import { GraphPreviewContainer } from './graph_preview_container'; -import { GRAPH_PREVIEW_TEST_ID } from './test_ids'; -import { useGraphPreview } from '../../shared/hooks/use_graph_preview'; -import { - EXPANDABLE_PANEL_CONTENT_TEST_ID, - EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID, - EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID, - EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID, - EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID, -} from '../../../shared/components/test_ids'; -import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; - -const mockUseUiSetting = jest.fn().mockReturnValue([true]); -jest.mock('@kbn/kibana-react-plugin/public', () => { - const original = jest.requireActual('@kbn/kibana-react-plugin/public'); - return { - ...original, - useUiSetting$: () => mockUseUiSetting(), - }; -}); - -jest.mock('../../../../common/hooks/use_experimental_features', () => ({ - useIsExperimentalFeatureEnabled: jest.fn(), -})); - -const useIsExperimentalFeatureEnabledMock = useIsExperimentalFeatureEnabled as jest.Mock; - -jest.mock('../../shared/hooks/use_graph_preview'); -jest.mock('@kbn/cloud-security-posture-graph/src/hooks', () => ({ - useFetchGraphData: jest.fn(), -})); -const mockUseFetchGraphData = useFetchGraphData as jest.Mock; - -const mockGraph = () => <div data-test-subj={GRAPH_PREVIEW_TEST_ID} />; - -jest.mock('@kbn/cloud-security-posture-graph', () => { - return { Graph: mockGraph }; -}); - -const renderGraphPreview = (context = mockContextValue) => - render( - <TestProviders> - <DocumentDetailsContext.Provider value={context}> - <GraphPreviewContainer /> - </DocumentDetailsContext.Provider> - </TestProviders> - ); - -const DEFAULT_NODES = [ - { - id: '1', - color: 'primary', - shape: 'ellipse', - }, -]; - -describe('<GraphPreviewContainer />', () => { - beforeEach(() => { - jest.clearAllMocks(); - useIsExperimentalFeatureEnabledMock.mockReturnValue(true); - }); - - it('should render component and link in header', async () => { - mockUseFetchGraphData.mockReturnValue({ - isLoading: false, - isError: false, - data: { nodes: DEFAULT_NODES, edges: [] }, - }); - - const timestamp = new Date().toISOString(); - - (useGraphPreview as jest.Mock).mockReturnValue({ - timestamp, - eventIds: [], - hasGraphRepresentation: true, - }); - - const { getByTestId, queryByTestId, findByTestId } = renderGraphPreview(); - - // Using findByTestId to wait for the component to be rendered because it is a lazy loaded component - expect(await findByTestId(GRAPH_PREVIEW_TEST_ID)).toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - expect(mockUseFetchGraphData).toHaveBeenCalled(); - expect(mockUseFetchGraphData.mock.calls[0][0]).toEqual({ - req: { - query: { - eventIds: [], - start: `${timestamp}||-30m`, - end: `${timestamp}||+30m`, - }, - }, - options: { - enabled: true, - refetchOnWindowFocus: false, - }, - }); - }); - - it('should render component and without link in header in preview panel', async () => { - mockUseFetchGraphData.mockReturnValue({ - isLoading: false, - isError: false, - data: { nodes: DEFAULT_NODES, edges: [] }, - }); - - const timestamp = new Date().toISOString(); - - (useGraphPreview as jest.Mock).mockReturnValue({ - timestamp, - eventIds: [], - hasGraphRepresentation: true, - }); - - const { getByTestId, queryByTestId, findByTestId } = renderGraphPreview({ - ...mockContextValue, - isPreviewMode: true, - }); - - // Using findByTestId to wait for the component to be rendered because it is a lazy loaded component - expect(await findByTestId(GRAPH_PREVIEW_TEST_ID)).toBeInTheDocument(); - expect( - queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - expect( - queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect(mockUseFetchGraphData).toHaveBeenCalled(); - expect(mockUseFetchGraphData.mock.calls[0][0]).toEqual({ - req: { - query: { - eventIds: [], - start: `${timestamp}||-30m`, - end: `${timestamp}||+30m`, - }, - }, - options: { - enabled: true, - refetchOnWindowFocus: false, - }, - }); - }); - - it('should render component and without link in header in rule preview', async () => { - mockUseFetchGraphData.mockReturnValue({ - isLoading: false, - isError: false, - data: { nodes: DEFAULT_NODES, edges: [] }, - }); - - const timestamp = new Date().toISOString(); - - (useGraphPreview as jest.Mock).mockReturnValue({ - timestamp, - eventIds: [], - hasGraphRepresentation: true, - }); - - const { getByTestId, queryByTestId, findByTestId } = renderGraphPreview({ - ...mockContextValue, - isPreview: true, - }); - - // Using findByTestId to wait for the component to be rendered because it is a lazy loaded component - expect(await findByTestId(GRAPH_PREVIEW_TEST_ID)).toBeInTheDocument(); - expect( - queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - expect( - queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect(mockUseFetchGraphData).toHaveBeenCalled(); - expect(mockUseFetchGraphData.mock.calls[0][0]).toEqual({ - req: { - query: { - eventIds: [], - start: `${timestamp}||-30m`, - end: `${timestamp}||+30m`, - }, - }, - options: { - enabled: true, - refetchOnWindowFocus: false, - }, - }); - }); - - it('should render component and without link in header when expanding flyout feature is disabled', async () => { - mockUseUiSetting.mockReturnValue([false]); - mockUseFetchGraphData.mockReturnValue({ - isLoading: false, - isError: false, - data: { nodes: DEFAULT_NODES, edges: [] }, - }); - - const timestamp = new Date().toISOString(); - - (useGraphPreview as jest.Mock).mockReturnValue({ - timestamp, - eventIds: [], - hasGraphRepresentation: true, - }); - - const { getByTestId, queryByTestId, findByTestId } = renderGraphPreview(); - - // Using findByTestId to wait for the component to be rendered because it is a lazy loaded component - expect(await findByTestId(GRAPH_PREVIEW_TEST_ID)).toBeInTheDocument(); - expect( - queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - expect( - queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect(mockUseFetchGraphData).toHaveBeenCalled(); - expect(mockUseFetchGraphData.mock.calls[0][0]).toEqual({ - req: { - query: { - eventIds: [], - start: `${timestamp}||-30m`, - end: `${timestamp}||+30m`, - }, - }, - options: { - enabled: true, - refetchOnWindowFocus: false, - }, - }); - }); - - it('should not render when graph data is not available', async () => { - mockUseFetchGraphData.mockReturnValue({ - isLoading: false, - isError: false, - data: undefined, - }); - - const timestamp = new Date().toISOString(); - - (useGraphPreview as jest.Mock).mockReturnValue({ - timestamp, - eventIds: [], - hasGraphRepresentation: false, - }); - - const { getByTestId, queryByTestId, findByTestId } = renderGraphPreview(); - - // Using findByTestId to wait for the component to be rendered because it is a lazy loaded component - expect( - await findByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - expect( - queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect(mockUseFetchGraphData).toHaveBeenCalled(); - expect(mockUseFetchGraphData.mock.calls[0][0]).toEqual({ - req: { - query: { - eventIds: [], - start: `${timestamp}||-30m`, - end: `${timestamp}||+30m`, - }, - }, - options: { - enabled: false, - refetchOnWindowFocus: false, - }, - }); - }); -}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields_cell.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields_cell.tsx deleted file mode 100644 index e11dee4a74adf..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields_cell.tsx +++ /dev/null @@ -1,110 +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 type { VFC } from 'react'; -import React, { useCallback, useMemo } from 'react'; -import { EuiFlexItem, EuiLink } from '@elastic/eui'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { getAgentTypeForAgentIdField } from '../../../../common/lib/endpoint/utils/get_agent_type_for_agent_id_field'; -import type { ResponseActionAgentType } from '../../../../../common/endpoint/service/response_actions/constants'; -import { AgentStatus } from '../../../../common/components/endpoint/agents/agent_status'; -import { useDocumentDetailsContext } from '../../shared/context'; -import { AGENT_STATUS_FIELD_NAME } from '../../../../timelines/components/timeline/body/renderers/constants'; -import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; -import { LeftPanelInsightsTab } from '../../left'; -import { ENTITIES_TAB_ID } from '../../left/components/entities_details'; -import { - HIGHLIGHTED_FIELDS_AGENT_STATUS_CELL_TEST_ID, - HIGHLIGHTED_FIELDS_BASIC_CELL_TEST_ID, - HIGHLIGHTED_FIELDS_CELL_TEST_ID, - HIGHLIGHTED_FIELDS_LINKED_CELL_TEST_ID, -} from './test_ids'; -import { hasPreview, PreviewLink } from '../../../shared/components/preview_link'; - -export interface HighlightedFieldsCellProps { - /** - * Highlighted field's name used to know what component to display - */ - field: string; - /** - * Highlighted field's original name, when the field is overridden - */ - originalField?: string; - /** - * Highlighted field's value to display - */ - values: string[] | null | undefined; -} - -/** - * Renders a component in the highlighted fields table cell based on the field name - */ -export const HighlightedFieldsCell: VFC<HighlightedFieldsCellProps> = ({ - values, - field, - originalField = '', -}) => { - const { scopeId, eventId, indexName } = useDocumentDetailsContext(); - const { openLeftPanel } = useExpandableFlyoutApi(); - const isPreviewEnabled = !useIsExperimentalFeatureEnabled('entityAlertPreviewDisabled'); - - const goToInsightsEntities = useCallback(() => { - openLeftPanel({ - id: DocumentDetailsLeftPanelKey, - path: { tab: LeftPanelInsightsTab, subTab: ENTITIES_TAB_ID }, - params: { - id: eventId, - indexName, - scopeId, - }, - }); - }, [eventId, indexName, openLeftPanel, scopeId]); - - const agentType: ResponseActionAgentType = useMemo(() => { - return getAgentTypeForAgentIdField(originalField); - }, [originalField]); - - return ( - <> - {values != null && - values.map((value, i) => { - return ( - <EuiFlexItem - grow={false} - key={`${i}-${value}`} - data-test-subj={`${value}-${HIGHLIGHTED_FIELDS_CELL_TEST_ID}`} - > - {isPreviewEnabled && hasPreview(field) ? ( - <PreviewLink - field={field} - value={value} - scopeId={scopeId} - data-test-subj={HIGHLIGHTED_FIELDS_LINKED_CELL_TEST_ID} - /> - ) : hasPreview(field) ? ( - <EuiLink - onClick={goToInsightsEntities} - data-test-subj={HIGHLIGHTED_FIELDS_LINKED_CELL_TEST_ID} - > - {value} - </EuiLink> - ) : field === AGENT_STATUS_FIELD_NAME ? ( - <AgentStatus - agentId={String(value ?? '')} - agentType={agentType} - data-test-subj={HIGHLIGHTED_FIELDS_AGENT_STATUS_CELL_TEST_ID} - /> - ) : ( - <span data-test-subj={HIGHLIGHTED_FIELDS_BASIC_CELL_TEST_ID}>{value}</span> - )} - </EuiFlexItem> - ); - })} - </> - ); -}; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/insights_summary_row.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/insights_summary_row.test.tsx deleted file mode 100644 index 2a721e317781e..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/insights_summary_row.test.tsx +++ /dev/null @@ -1,155 +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 from 'react'; -import { render } from '@testing-library/react'; -import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; -import { InsightsSummaryRow } from './insights_summary_row'; -import { useDocumentDetailsContext } from '../../shared/context'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; -import { LeftPanelInsightsTab } from '../../left'; - -jest.mock('@kbn/expandable-flyout'); -jest.mock('../../shared/context'); - -const mockOpenLeftPanel = jest.fn(); -const scopeId = 'scopeId'; -const eventId = 'eventId'; -const indexName = 'indexName'; - -const testId = 'test'; -const textTestId = `${testId}Text`; -const buttonTestId = `${testId}Button`; -const valueTestId = `${testId}Value`; -const loadingTestId = `${testId}Loading`; - -describe('<InsightsSummaryRow />', () => { - beforeEach(() => { - jest.clearAllMocks(); - - (useDocumentDetailsContext as jest.Mock).mockReturnValue({ - eventId, - indexName, - scopeId, - isPreviewMode: false, - }); - (useExpandableFlyoutApi as jest.Mock).mockReturnValue({ openLeftPanel: mockOpenLeftPanel }); - }); - - it('should render loading skeleton if loading is true', () => { - const { getByTestId } = render( - <InsightsSummaryRow - loading={true} - text={'text'} - value={<div>{'value for this'}</div>} - data-test-subj={testId} - /> - ); - - expect(getByTestId(loadingTestId)).toBeInTheDocument(); - }); - - it('should only render null when error is true', () => { - const { container } = render( - <InsightsSummaryRow error={true} text={'text'} value={<div>{'value for this'}</div>} /> - ); - - expect(container).toBeEmptyDOMElement(); - }); - - it('should render the value component', () => { - const { getByTestId, queryByTestId } = render( - <IntlProvider locale="en"> - <InsightsSummaryRow - text={'this is a test for red'} - value={<div>{'value for this'}</div>} - data-test-subj={testId} - /> - </IntlProvider> - ); - - expect(getByTestId(textTestId)).toHaveTextContent('this is a test for red'); - expect(getByTestId(valueTestId)).toHaveTextContent('value for this'); - expect(queryByTestId(buttonTestId)).not.toBeInTheDocument(); - }); - - it('should render the value as EuiBadge and EuiButtonEmpty', () => { - const { getByTestId, queryByTestId } = render( - <IntlProvider locale="en"> - <InsightsSummaryRow text={'this is a test for red'} value={2} data-test-subj={testId} /> - </IntlProvider> - ); - - expect(getByTestId(textTestId)).toHaveTextContent('this is a test for red'); - expect(getByTestId(buttonTestId)).toHaveTextContent('2'); - expect(queryByTestId(valueTestId)).not.toBeInTheDocument(); - }); - - it('should render big numbers formatted correctly', () => { - const { getByTestId } = render( - <IntlProvider locale="en"> - <InsightsSummaryRow text={'this is a test for red'} value={2000} data-test-subj={testId} /> - </IntlProvider> - ); - - expect(getByTestId(buttonTestId)).toHaveTextContent('2k'); - }); - - it('should open the expanded section to the correct tab when the number is clicked', () => { - const { getByTestId } = render( - <IntlProvider locale="en"> - <InsightsSummaryRow - text={'this is a test for red'} - value={2} - expandedSubTab={'subTab'} - data-test-subj={testId} - /> - </IntlProvider> - ); - getByTestId(buttonTestId).click(); - - expect(mockOpenLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { - tab: LeftPanelInsightsTab, - subTab: 'subTab', - }, - params: { - id: eventId, - indexName, - scopeId, - }, - }); - }); - - it('should disabled the click when in preview mode', () => { - (useDocumentDetailsContext as jest.Mock).mockReturnValue({ - eventId, - indexName, - scopeId, - isPreviewMode: true, - }); - - const { getByTestId } = render( - <IntlProvider locale="en"> - <InsightsSummaryRow - text={'this is a test for red'} - value={2} - expandedSubTab={'subTab'} - data-test-subj={testId} - /> - </IntlProvider> - ); - const button = getByTestId(buttonTestId); - - expect(button).toHaveAttribute('disabled'); - - button.click(); - expect(mockOpenLeftPanel).not.toHaveBeenCalled(); - }); -}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_cases.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_cases.test.tsx deleted file mode 100644 index e55d0e109d1d7..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_cases.test.tsx +++ /dev/null @@ -1,124 +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 from 'react'; -import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; -import { render } from '@testing-library/react'; -import { - CORRELATIONS_RELATED_CASES_TEST_ID, - SUMMARY_ROW_TEXT_TEST_ID, - SUMMARY_ROW_LOADING_TEST_ID, - SUMMARY_ROW_BUTTON_TEST_ID, -} from './test_ids'; -import { RelatedCases } from './related_cases'; -import { useFetchRelatedCases } from '../../shared/hooks/use_fetch_related_cases'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; -import { LeftPanelInsightsTab } from '../../left'; -import { CORRELATIONS_TAB_ID } from '../../left/components/correlations_details'; -import { useDocumentDetailsContext } from '../../shared/context'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; - -jest.mock('@kbn/expandable-flyout'); -jest.mock('../../shared/context'); -jest.mock('../../shared/hooks/use_fetch_related_cases'); - -const mockOpenLeftPanel = jest.fn(); -const eventId = 'eventId'; -const indexName = 'indexName'; -const scopeId = 'scopeId'; - -const TEXT_TEST_ID = SUMMARY_ROW_TEXT_TEST_ID(CORRELATIONS_RELATED_CASES_TEST_ID); -const BUTTON_TEST_ID = SUMMARY_ROW_BUTTON_TEST_ID(CORRELATIONS_RELATED_CASES_TEST_ID); -const LOADING_TEST_ID = SUMMARY_ROW_LOADING_TEST_ID(CORRELATIONS_RELATED_CASES_TEST_ID); - -const renderRelatedCases = () => - render( - <IntlProvider locale="en"> - <RelatedCases eventId={eventId} /> - </IntlProvider> - ); - -describe('<RelatedCases />', () => { - beforeEach(() => { - jest.clearAllMocks(); - - (useDocumentDetailsContext as jest.Mock).mockReturnValue({ - eventId, - indexName, - scopeId, - isPreviewMode: false, - }); - (useExpandableFlyoutApi as jest.Mock).mockReturnValue({ openLeftPanel: mockOpenLeftPanel }); - }); - - it('should render single related case correctly', () => { - (useFetchRelatedCases as jest.Mock).mockReturnValue({ - loading: false, - error: false, - dataCount: 1, - }); - - const { getByTestId } = renderRelatedCases(); - expect(getByTestId(TEXT_TEST_ID)).toHaveTextContent('Related case'); - expect(getByTestId(BUTTON_TEST_ID)).toHaveTextContent('1'); - }); - - it('should render multiple related cases correctly', () => { - (useFetchRelatedCases as jest.Mock).mockReturnValue({ - loading: false, - error: false, - dataCount: 2, - }); - - const { getByTestId } = renderRelatedCases(); - expect(getByTestId(TEXT_TEST_ID)).toHaveTextContent('Related cases'); - expect(getByTestId(BUTTON_TEST_ID)).toHaveTextContent('2'); - }); - - it('should render loading skeleton', () => { - (useFetchRelatedCases as jest.Mock).mockReturnValue({ - loading: true, - }); - - const { getByTestId } = renderRelatedCases(); - expect(getByTestId(LOADING_TEST_ID)).toBeInTheDocument(); - }); - - it('should render null if error', () => { - (useFetchRelatedCases as jest.Mock).mockReturnValue({ - loading: false, - error: true, - }); - - const { container } = renderRelatedCases(); - expect(container).toBeEmptyDOMElement(); - }); - - it('should open the expanded section to the correct tab when the number is clicked', () => { - (useFetchRelatedCases as jest.Mock).mockReturnValue({ - loading: false, - error: false, - dataCount: 1, - }); - - const { getByTestId } = renderRelatedCases(); - getByTestId(BUTTON_TEST_ID).click(); - - expect(mockOpenLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { - tab: LeftPanelInsightsTab, - subTab: CORRELATIONS_TAB_ID, - }, - params: { - id: eventId, - indexName, - scopeId, - }, - }); - }); -}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/response_button.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/response_button.tsx deleted file mode 100644 index 291ce9687ae27..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/response_button.tsx +++ /dev/null @@ -1,52 +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 { EuiButton } from '@elastic/eui'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { useDocumentDetailsContext } from '../../shared/context'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; -import { LeftPanelResponseTab } from '../../left'; -import { RESPONSE_BUTTON_TEST_ID } from './test_ids'; - -/** - * Response button that opens Response section in the left panel - */ -export const ResponseButton: React.FC = () => { - const { openLeftPanel } = useExpandableFlyoutApi(); - const { eventId, indexName, scopeId } = useDocumentDetailsContext(); - - const goToResponseTab = useCallback(() => { - openLeftPanel({ - id: DocumentDetailsLeftPanelKey, - path: { tab: LeftPanelResponseTab }, - params: { - id: eventId, - indexName, - scopeId, - }, - }); - }, [eventId, indexName, openLeftPanel, scopeId]); - - return ( - <> - <EuiButton - onClick={goToResponseTab} - iconType="documentation" - data-test-subj={RESPONSE_BUTTON_TEST_ID} - size="s" - > - <FormattedMessage - id="xpack.securitySolution.flyout.right.response.responseButtonLabel" - defaultMessage="Response" - /> - </EuiButton> - </> - ); -}; - -ResponseButton.displayName = 'ResponseButton'; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/session_preview_container.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/session_preview_container.test.tsx deleted file mode 100644 index 9ccb512030b43..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/session_preview_container.test.tsx +++ /dev/null @@ -1,231 +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 { render, screen } from '@testing-library/react'; -import { TestProviders } from '../../../../common/mock'; -import React from 'react'; -import { DocumentDetailsContext } from '../../shared/context'; -import { SessionPreviewContainer } from './session_preview_container'; -import { useSessionPreview } from '../hooks/use_session_preview'; -import { useLicense } from '../../../../common/hooks/use_license'; -import { SESSION_PREVIEW_TEST_ID } from './test_ids'; -import { - EXPANDABLE_PANEL_CONTENT_TEST_ID, - EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID, - EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID, - EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID, - EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID, -} from '../../../shared/components/test_ids'; -import { mockContextValue } from '../../shared/mocks/mock_context'; - -jest.mock('../hooks/use_session_preview'); -jest.mock('../../../../common/hooks/use_license'); - -const mockNavigateToSessionView = jest.fn(); -jest.mock('../../shared/hooks/use_navigate_to_session_view', () => { - return { useNavigateToSessionView: () => ({ navigateToSessionView: mockNavigateToSessionView }) }; -}); - -const mockUseUiSetting = jest.fn().mockReturnValue([false]); -jest.mock('@kbn/kibana-react-plugin/public', () => { - const original = jest.requireActual('@kbn/kibana-react-plugin/public'); - return { - ...original, - useUiSetting$: () => mockUseUiSetting(), - }; -}); - -const NO_DATA_MESSAGE = - 'You can only view Linux session details if you’ve enabled the Include session data setting in your Elastic Defend integration policy. Refer to Enable Session View data(external, opens in a new tab or window) for more information.'; - -const UPSELL_TEXT = 'This feature requires an Enterprise subscription'; - -const sessionViewConfig = { - index: {}, - sessionEntityId: 'sessionEntityId', - sessionStartTime: 'sessionStartTime', -}; - -const renderSessionPreview = (context = mockContextValue) => - render( - <TestProviders> - <DocumentDetailsContext.Provider value={context}> - <SessionPreviewContainer /> - </DocumentDetailsContext.Provider> - </TestProviders> - ); - -describe('SessionPreviewContainer', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - it('should render component and link in header', () => { - (useSessionPreview as jest.Mock).mockReturnValue(sessionViewConfig); - (useLicense as jest.Mock).mockReturnValue({ isEnterprise: () => true }); - - const { getByTestId } = renderSessionPreview(); - - expect(getByTestId(SESSION_PREVIEW_TEST_ID)).toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - - expect( - screen.queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - expect( - screen.getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - screen.getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - screen.queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - expect( - screen.queryByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).not.toHaveTextContent(NO_DATA_MESSAGE); - expect( - screen.queryByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).not.toHaveTextContent(UPSELL_TEXT); - }); - - it('should render error message and text in header if no sessionConfig', () => { - (useSessionPreview as jest.Mock).mockReturnValue(null); - (useLicense as jest.Mock).mockReturnValue({ isEnterprise: () => true }); - - const { getByTestId, queryByTestId } = renderSessionPreview(); - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - screen.getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).toHaveTextContent(NO_DATA_MESSAGE); - - expect( - screen.queryByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).not.toHaveTextContent(UPSELL_TEXT); - expect(queryByTestId(SESSION_PREVIEW_TEST_ID)).not.toBeInTheDocument(); - }); - - it('should render upsell message in header if no correct license', () => { - (useSessionPreview as jest.Mock).mockReturnValue(sessionViewConfig); - (useLicense as jest.Mock).mockReturnValue({ isEnterprise: () => false }); - - const { getByTestId, queryByTestId } = renderSessionPreview(); - - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - screen.getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).toHaveTextContent(UPSELL_TEXT); - - expect( - screen.queryByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).not.toHaveTextContent(NO_DATA_MESSAGE); - expect(queryByTestId(SESSION_PREVIEW_TEST_ID)).not.toBeInTheDocument(); - }); - - it('should not render link to session viewer if flyout is open in preview', () => { - (useSessionPreview as jest.Mock).mockReturnValue(sessionViewConfig); - (useLicense as jest.Mock).mockReturnValue({ isEnterprise: () => true }); - - const { getByTestId, queryByTestId } = renderSessionPreview({ - ...mockContextValue, - isPreview: true, - }); - - expect(getByTestId(SESSION_PREVIEW_TEST_ID)).toBeInTheDocument(); - expect( - queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - }); - - it('should not render link to session viewer if flyout is open in preview mode', () => { - (useSessionPreview as jest.Mock).mockReturnValue(sessionViewConfig); - (useLicense as jest.Mock).mockReturnValue({ isEnterprise: () => true }); - - const { getByTestId, queryByTestId } = renderSessionPreview({ - ...mockContextValue, - isPreviewMode: true, - }); - - expect(getByTestId(SESSION_PREVIEW_TEST_ID)).toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - }); - - describe('when visualization in flyout flag is enabled', () => { - it('should open left panel vizualization tab when visualization in flyout flag is on', () => { - mockUseUiSetting.mockReturnValue([true]); - (useSessionPreview as jest.Mock).mockReturnValue(sessionViewConfig); - (useLicense as jest.Mock).mockReturnValue({ isEnterprise: () => true }); - - const { getByTestId } = renderSessionPreview(); - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)).click(); - - expect(mockNavigateToSessionView).toHaveBeenCalled(); - }); - - it('should not render link to session viewer if flyout is open in rule preview', () => { - (useSessionPreview as jest.Mock).mockReturnValue(sessionViewConfig); - (useLicense as jest.Mock).mockReturnValue({ isEnterprise: () => true }); - - const { getByTestId, queryByTestId } = renderSessionPreview({ - ...mockContextValue, - isPreview: true, - }); - - expect(getByTestId(SESSION_PREVIEW_TEST_ID)).toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - }); - - it('should not render link to session viewer if flyout is open in preview mode', () => { - (useSessionPreview as jest.Mock).mockReturnValue(sessionViewConfig); - (useLicense as jest.Mock).mockReturnValue({ isEnterprise: () => true }); - - const { getByTestId, queryByTestId } = renderSessionPreview({ - ...mockContextValue, - isPreview: true, - }); - - expect(getByTestId(SESSION_PREVIEW_TEST_ID)).toBeInTheDocument(); - expect( - getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).toBeInTheDocument(); - expect( - queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)) - ).not.toBeInTheDocument(); - }); - }); -}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/session_preview_container.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/session_preview_container.tsx deleted file mode 100644 index 4098b35a0abfc..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/session_preview_container.tsx +++ /dev/null @@ -1,124 +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, { type FC, useCallback } from 'react'; -import { TimelineTabs } from '@kbn/securitysolution-data-table'; -import { useDispatch } from 'react-redux'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { useUiSetting$ } from '@kbn/kibana-react-plugin/public'; -import { ENABLE_VISUALIZATIONS_IN_FLYOUT_SETTING } from '../../../../../common/constants'; -import { useLicense } from '../../../../common/hooks/use_license'; -import { SessionPreview } from './session_preview'; -import { useSessionPreview } from '../hooks/use_session_preview'; -import { useInvestigateInTimeline } from '../../../../detections/components/alerts_table/timeline_actions/use_investigate_in_timeline'; -import { useDocumentDetailsContext } from '../../shared/context'; -import { ALERTS_ACTIONS } from '../../../../common/lib/apm/user_actions'; -import { ExpandablePanel } from '../../../shared/components/expandable_panel'; -import { SESSION_PREVIEW_TEST_ID } from './test_ids'; -import { useStartTransaction } from '../../../../common/lib/apm/use_start_transaction'; -import { setActiveTabTimeline } from '../../../../timelines/store/actions'; -import { getScopedActions } from '../../../../helpers'; -import { useNavigateToSessionView } from '../../shared/hooks/use_navigate_to_session_view'; -import { SessionViewNoDataMessage } from '../../shared/components/session_view_no_data_message'; - -const timelineId = 'timeline-1'; - -/** - * Checks if the SessionView component is available, if so render it or else render an error message - */ -export const SessionPreviewContainer: FC = () => { - const { - eventId, - indexName, - scopeId, - dataAsNestedObject, - getFieldsData, - isPreview, - isPreviewMode, - dataFormattedForFieldBrowser, - } = useDocumentDetailsContext(); - - const [visualizationInFlyoutEnabled] = useUiSetting$<boolean>( - ENABLE_VISUALIZATIONS_IN_FLYOUT_SETTING - ); - - // decide whether to show the session view or not - const sessionViewConfig = useSessionPreview({ getFieldsData, dataFormattedForFieldBrowser }); - const isEnterprisePlus = useLicense().isEnterprise(); - const isEnabled = sessionViewConfig && isEnterprisePlus; - - const dispatch = useDispatch(); - const { startTransaction } = useStartTransaction(); - const scopedActions = getScopedActions(timelineId); - const { investigateInTimelineAlertClick } = useInvestigateInTimeline({ - ecsRowData: dataAsNestedObject, - }); - - const goToSessionViewTab = useCallback(async () => { - // open timeline - await investigateInTimelineAlertClick(); - - // open session view tab - startTransaction({ name: ALERTS_ACTIONS.OPEN_SESSION_VIEW }); - if (sessionViewConfig !== null) { - dispatch(setActiveTabTimeline({ id: timelineId, activeTab: TimelineTabs.session })); - if (scopedActions) { - dispatch(scopedActions.updateSessionViewConfig({ id: timelineId, sessionViewConfig })); - } - } - }, [ - dispatch, - investigateInTimelineAlertClick, - scopedActions, - sessionViewConfig, - startTransaction, - ]); - - const { navigateToSessionView } = useNavigateToSessionView({ - eventId, - indexName, - isFlyoutOpen: true, - scopeId, - }); - - return ( - <ExpandablePanel - header={{ - title: ( - <FormattedMessage - id="xpack.securitySolution.flyout.right.visualizations.sessionPreview.sessionPreviewTitle" - defaultMessage="Session viewer preview" - /> - ), - iconType: visualizationInFlyoutEnabled ? 'arrowStart' : 'timeline', - ...(isEnabled && - !isPreview && - !isPreviewMode && { - link: { - callback: visualizationInFlyoutEnabled ? navigateToSessionView : goToSessionViewTab, - tooltip: ( - <FormattedMessage - id="xpack.securitySolution.flyout.right.visualizations.sessionPreview.sessionPreviewTooltip" - defaultMessage="Investigate in timeline" - /> - ), - }, - }), - }} - data-test-subj={SESSION_PREVIEW_TEST_ID} - > - {isEnabled ? ( - <SessionPreview /> - ) : ( - <SessionViewNoDataMessage - isEnterprisePlus={isEnterprisePlus} - hasSessionViewConfig={sessionViewConfig !== null} - /> - )} - </ExpandablePanel> - ); -}; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/suppressed_alerts.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/suppressed_alerts.test.tsx deleted file mode 100644 index 331283e194ed0..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/suppressed_alerts.test.tsx +++ /dev/null @@ -1,103 +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 from 'react'; -import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; -import { render } from '@testing-library/react'; -import { - SUMMARY_ROW_TEXT_TEST_ID, - CORRELATIONS_SUPPRESSED_ALERTS_TEST_ID, - CORRELATIONS_SUPPRESSED_ALERTS_TECHNICAL_PREVIEW_TEST_ID, - SUMMARY_ROW_BUTTON_TEST_ID, -} from './test_ids'; -import { SuppressedAlerts } from './suppressed_alerts'; -import { isSuppressionRuleInGA } from '../../../../../common/detection_engine/utils'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; -import { LeftPanelInsightsTab } from '../../left'; -import { CORRELATIONS_TAB_ID } from '../../left/components/correlations_details'; -import { useDocumentDetailsContext } from '../../shared/context'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; - -jest.mock('@kbn/expandable-flyout'); -jest.mock('../../shared/context'); -jest.mock('../../../../../common/detection_engine/utils', () => ({ - isSuppressionRuleInGA: jest.fn().mockReturnValue(false), -})); - -const TEXT_TEST_ID = SUMMARY_ROW_TEXT_TEST_ID(CORRELATIONS_SUPPRESSED_ALERTS_TEST_ID); -const BUTTON_TEST_ID = SUMMARY_ROW_BUTTON_TEST_ID(CORRELATIONS_SUPPRESSED_ALERTS_TEST_ID); - -const renderSuppressedAlerts = (alertSuppressionCount: number) => - render( - <IntlProvider locale="en"> - <SuppressedAlerts alertSuppressionCount={alertSuppressionCount} ruleType="query" /> - </IntlProvider> - ); - -const mockOpenLeftPanel = jest.fn(); -const scopeId = 'scopeId'; -const eventId = 'eventId'; -const indexName = 'indexName'; -const isSuppressionRuleInGAMock = isSuppressionRuleInGA as jest.Mock; - -describe('<SuppressedAlerts />', () => { - beforeEach(() => { - jest.clearAllMocks(); - - (useDocumentDetailsContext as jest.Mock).mockReturnValue({ - eventId, - indexName, - scopeId, - isPreviewMode: false, - }); - (useExpandableFlyoutApi as jest.Mock).mockReturnValue({ openLeftPanel: mockOpenLeftPanel }); - }); - - it('should render single suppressed alert correctly', () => { - const { getByTestId } = renderSuppressedAlerts(1); - - expect(getByTestId(TEXT_TEST_ID)).toHaveTextContent('Suppressed alert'); - expect(getByTestId(BUTTON_TEST_ID)).toHaveTextContent('1'); - expect( - getByTestId(CORRELATIONS_SUPPRESSED_ALERTS_TECHNICAL_PREVIEW_TEST_ID) - ).toBeInTheDocument(); - }); - - it('should render multiple suppressed alerts row correctly', () => { - const { getByTestId } = renderSuppressedAlerts(2); - - expect(getByTestId(TEXT_TEST_ID)).toHaveTextContent('Suppressed alerts'); - expect(getByTestId(BUTTON_TEST_ID)).toHaveTextContent('2'); - }); - - it('should not render Technical Preview badge if rule type is in GA', () => { - isSuppressionRuleInGAMock.mockReturnValueOnce(true); - const { queryByTestId } = renderSuppressedAlerts(2); - - expect( - queryByTestId(CORRELATIONS_SUPPRESSED_ALERTS_TECHNICAL_PREVIEW_TEST_ID) - ).not.toBeInTheDocument(); - }); - - it('should open the expanded section to the correct tab when the number is clicked', () => { - const { getByTestId } = renderSuppressedAlerts(1); - getByTestId(BUTTON_TEST_ID).click(); - - expect(mockOpenLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { - tab: LeftPanelInsightsTab, - subTab: CORRELATIONS_TAB_ID, - }, - params: { - id: eventId, - indexName, - scopeId, - }, - }); - }); -}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/footer.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/footer.test.tsx deleted file mode 100644 index 9ece9b0e52495..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/footer.test.tsx +++ /dev/null @@ -1,62 +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 from 'react'; -import { render } from '@testing-library/react'; -import { PanelFooter } from './footer'; -import { TestProviders } from '../../../common/mock'; -import { mockContextValue } from '../shared/mocks/mock_context'; -import { DocumentDetailsContext } from '../shared/context'; -import { FLYOUT_FOOTER_TEST_ID } from './test_ids'; -import { useKibana } from '../../../common/lib/kibana'; -import { useAlertExceptionActions } from '../../../detections/components/alerts_table/timeline_actions/use_add_exception_actions'; -import { useInvestigateInTimeline } from '../../../detections/components/alerts_table/timeline_actions/use_investigate_in_timeline'; -import { useAddToCaseActions } from '../../../detections/components/alerts_table/timeline_actions/use_add_to_case_actions'; - -jest.mock('../../../common/lib/kibana'); -jest.mock('../../../detections/components/alerts_table/timeline_actions/use_add_exception_actions'); -jest.mock( - '../../../detections/components/alerts_table/timeline_actions/use_investigate_in_timeline' -); -jest.mock('../../../detections/components/alerts_table/timeline_actions/use_add_to_case_actions'); - -describe('PanelFooter', () => { - it('should not render the take action dropdown if preview mode', () => { - const { queryByTestId } = render( - <TestProviders> - <DocumentDetailsContext.Provider value={mockContextValue}> - <PanelFooter isPreview={true} /> - </DocumentDetailsContext.Provider> - </TestProviders> - ); - - expect(queryByTestId(FLYOUT_FOOTER_TEST_ID)).not.toBeInTheDocument(); - }); - - it('should render the take action dropdown', () => { - (useKibana as jest.Mock).mockReturnValue({ - services: { - osquery: { - isOsqueryAvailable: jest.fn(), - }, - }, - }); - (useAlertExceptionActions as jest.Mock).mockReturnValue({ exceptionActionItems: [] }); - (useInvestigateInTimeline as jest.Mock).mockReturnValue({ - investigateInTimelineActionItems: [], - }); - (useAddToCaseActions as jest.Mock).mockReturnValue({ addToCaseActionItems: [] }); - - const wrapper = render( - <TestProviders> - <DocumentDetailsContext.Provider value={mockContextValue}> - <PanelFooter isPreview={false} /> - </DocumentDetailsContext.Provider> - </TestProviders> - ); - expect(wrapper.getByTestId(FLYOUT_FOOTER_TEST_ID)).toBeInTheDocument(); - }); -}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/footer.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/footer.tsx deleted file mode 100644 index e5a5fb12915a6..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/footer.tsx +++ /dev/null @@ -1,238 +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 type { FC } from 'react'; -import React, { useCallback, useMemo, useState } from 'react'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { EuiFlexGroup, EuiFlexItem, useEuiTheme, EuiFlyoutFooter, EuiPanel } from '@elastic/eui'; -import { find } from 'lodash/fp'; -import { FLYOUT_FOOTER_TEST_ID } from './test_ids'; -import type { Status } from '../../../../common/api/detection_engine'; -import { getAlertDetailsFieldValue } from '../../../common/lib/endpoint/utils/get_event_details_field_values'; -import { TakeActionDropdown } from './components/take_action_dropdown'; -import { AddExceptionFlyoutWrapper } from '../../../detections/components/alerts_table/timeline_actions/alert_context_menu'; -import { EventFiltersFlyout } from '../../../management/pages/event_filters/view/components/event_filters_flyout'; -import { OsqueryFlyout } from '../../../detections/components/osquery/osquery_flyout'; -import { useDocumentDetailsContext } from '../shared/context'; -import { useHostIsolation } from '../shared/hooks/use_host_isolation'; -import { DocumentDetailsIsolateHostPanelKey } from '../shared/constants/panel_keys'; -import { useRefetchByScope } from './hooks/use_refetch_by_scope'; -import { useExceptionFlyout } from '../../../detections/components/alerts_table/timeline_actions/use_add_exception_flyout'; -import { isActiveTimeline } from '../../../helpers'; -import { useEventFilterModal } from '../../../detections/components/alerts_table/timeline_actions/use_event_filter_modal'; - -interface AlertSummaryData { - /** - * Status of the alert (open, closed...) - */ - alertStatus: Status; - /** - * Id of the document - */ - eventId: string; - /** - * Id of the rule - */ - ruleId: string; - /** - * Property ruleId on the rule - */ - ruleRuleId: string; - /** - * Name of the rule - */ - ruleName: string; -} - -interface PanelFooterProps { - /** - * Boolean that indicates whether flyout is in preview and action should be hidden - */ - isPreview: boolean; -} - -/** - * Bottom section of the flyout that contains the take action button - */ -export const PanelFooter: FC<PanelFooterProps> = ({ isPreview }) => { - const { euiTheme } = useEuiTheme(); - // we need this flyout to be above the timeline flyout (which has a z-index of 1002) - const flyoutZIndex = useMemo( - () => ({ style: `z-index: ${(euiTheme.levels.flyout as number) + 3}` }), - [euiTheme] - ); - - const { closeFlyout, openRightPanel } = useExpandableFlyoutApi(); - const { - eventId, - indexName, - dataFormattedForFieldBrowser, - dataAsNestedObject, - refetchFlyoutData, - scopeId, - } = useDocumentDetailsContext(); - - // host isolation interaction - const { isHostIsolationPanelOpen, showHostIsolationPanel } = useHostIsolation(); - const showHostIsolationPanelCallback = useCallback( - (action: 'isolateHost' | 'unisolateHost' | undefined) => { - showHostIsolationPanel(action); - openRightPanel({ - id: DocumentDetailsIsolateHostPanelKey, - params: { - id: eventId, - indexName, - scopeId, - isolateAction: action, - }, - }); - }, - [eventId, indexName, openRightPanel, scopeId, showHostIsolationPanel] - ); - - const { refetch: refetchAll } = useRefetchByScope({ scopeId }); - - // exception interaction - const ruleIndexRaw = useMemo( - () => - find({ category: 'signal', field: 'signal.rule.index' }, dataFormattedForFieldBrowser) - ?.values ?? - find( - { category: 'kibana', field: 'kibana.alert.rule.parameters.index' }, - dataFormattedForFieldBrowser - )?.values, - [dataFormattedForFieldBrowser] - ); - const ruleIndex = useMemo( - (): string[] | undefined => (Array.isArray(ruleIndexRaw) ? ruleIndexRaw : undefined), - [ruleIndexRaw] - ); - const ruleDataViewIdRaw = useMemo( - () => - find({ category: 'signal', field: 'signal.rule.data_view_id' }, dataFormattedForFieldBrowser) - ?.values ?? - find( - { category: 'kibana', field: 'kibana.alert.rule.parameters.data_view_id' }, - dataFormattedForFieldBrowser - )?.values, - [dataFormattedForFieldBrowser] - ); - const ruleDataViewId = useMemo( - (): string | undefined => (Array.isArray(ruleDataViewIdRaw) ? ruleDataViewIdRaw[0] : undefined), - [ruleDataViewIdRaw] - ); - const alertSummaryData = useMemo( - () => - [ - { category: 'signal', field: 'signal.rule.id', name: 'ruleId' }, - { category: 'signal', field: 'signal.rule.rule_id', name: 'ruleRuleId' }, - { category: 'signal', field: 'signal.rule.name', name: 'ruleName' }, - { category: 'signal', field: 'kibana.alert.workflow_status', name: 'alertStatus' }, - { category: '_id', field: '_id', name: 'eventId' }, - ].reduce<AlertSummaryData>( - (acc, curr) => ({ - ...acc, - [curr.name]: getAlertDetailsFieldValue( - { category: curr.category, field: curr.field }, - dataFormattedForFieldBrowser - ), - }), - {} as AlertSummaryData - ), - [dataFormattedForFieldBrowser] - ); - const { - exceptionFlyoutType, - openAddExceptionFlyout, - onAddExceptionTypeClick, - onAddExceptionCancel, - onAddExceptionConfirm, - } = useExceptionFlyout({ - refetch: refetchAll, - isActiveTimelines: isActiveTimeline(scopeId), - }); - - // event filter interaction - const { closeAddEventFilterModal, isAddEventFilterModalOpen, onAddEventFilterClick } = - useEventFilterModal(); - - // osquery interaction - const [isOsqueryFlyoutOpenWithAgentId, setOsqueryFlyoutOpenWithAgentId] = useState<null | string>( - null - ); - const closeOsqueryFlyout = useCallback(() => { - setOsqueryFlyoutOpenWithAgentId(null); - }, [setOsqueryFlyoutOpenWithAgentId]); - const alertId = useMemo( - () => (dataAsNestedObject?.kibana?.alert ? dataAsNestedObject?._id : null), - [dataAsNestedObject?._id, dataAsNestedObject?.kibana?.alert] - ); - - if (isPreview) return null; - - return ( - <> - <EuiFlyoutFooter data-test-subj={FLYOUT_FOOTER_TEST_ID}> - <EuiPanel color="transparent"> - <EuiFlexGroup justifyContent="flexEnd"> - <EuiFlexItem grow={false}> - {dataAsNestedObject && ( - <TakeActionDropdown - dataFormattedForFieldBrowser={dataFormattedForFieldBrowser} - dataAsNestedObject={dataAsNestedObject} - handleOnEventClosed={closeFlyout} - isHostIsolationPanelOpen={isHostIsolationPanelOpen} - onAddEventFilterClick={onAddEventFilterClick} - onAddExceptionTypeClick={onAddExceptionTypeClick} - onAddIsolationStatusClick={showHostIsolationPanelCallback} - refetchFlyoutData={refetchFlyoutData} - refetch={refetchAll} - scopeId={scopeId} - onOsqueryClick={setOsqueryFlyoutOpenWithAgentId} - /> - )} - </EuiFlexItem> - </EuiFlexGroup> - </EuiPanel> - </EuiFlyoutFooter> - - {openAddExceptionFlyout && - alertSummaryData.ruleId != null && - alertSummaryData.ruleRuleId != null && - alertSummaryData.eventId != null && ( - <AddExceptionFlyoutWrapper - {...alertSummaryData} - ruleIndices={ruleIndex} - ruleDataViewId={ruleDataViewId} - exceptionListType={exceptionFlyoutType} - onCancel={onAddExceptionCancel} - onConfirm={onAddExceptionConfirm} - /> - )} - - {isAddEventFilterModalOpen && dataAsNestedObject != null && ( - <EventFiltersFlyout - data={dataAsNestedObject} - onCancel={closeAddEventFilterModal} - // EUI TODO: This z-index override of EuiOverlayMask is a workaround, and ideally should be resolved with a cleaner UI/UX flow long-term - maskProps={flyoutZIndex} // we need this flyout to be above the timeline flyout (which has a z-index of 1002) - /> - )} - - {isOsqueryFlyoutOpenWithAgentId && dataAsNestedObject != null && ( - <OsqueryFlyout - agentId={isOsqueryFlyoutOpenWithAgentId} - defaultValues={alertId ? { alertIds: [alertId] } : undefined} - onClose={closeOsqueryFlyout} - ecsData={dataAsNestedObject} - /> - )} - </> - ); -}; - -PanelFooter.displayName = 'PanelFooter'; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/test_ids.ts b/x-pack/plugins/security_solution/public/flyout/document_details/right/test_ids.ts deleted file mode 100644 index 89a71e5fd17ba..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/test_ids.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 { PREFIX } from '../../shared/test_ids'; - -export const FLYOUT_BODY_TEST_ID = `${PREFIX}Body` as const; -export const FLYOUT_FOOTER_TEST_ID = `${PREFIX}Footer` as const; -export const FLYOUT_FOOTER_DEOPDOEN_BUTTON_TEST_ID = - `${FLYOUT_FOOTER_TEST_ID}DropdownButton` as const; -export const OVERVIEW_TAB_TEST_ID = `${PREFIX}OverviewTab` as const; -export const TABLE_TAB_TEST_ID = `${PREFIX}TableTab` as const; -export const JSON_TAB_TEST_ID = `${PREFIX}JsonTab` as const; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/components/test_ids.ts b/x-pack/plugins/security_solution/public/flyout/document_details/shared/components/test_ids.ts deleted file mode 100644 index b250e9a688380..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/shared/components/test_ids.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 { PREFIX } from '../../../shared/test_ids'; - -export const FLYOUT_PREVIEW_LINK_TEST_ID = `${PREFIX}PreviewLink` as const; - -export const SESSION_VIEW_UPSELL_TEST_ID = `${PREFIX}SessionViewUpsell` as const; -export const SESSION_VIEW_NO_DATA_TEST_ID = `${PREFIX}SessionViewNoData` as const; - -export const MISCONFIGURATIONS_TEST_ID = `${PREFIX}Misconfigurations` as const; -export const VULNERABILITIES_TEST_ID = `${PREFIX}Vulnerabilities` as const; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_graph_preview.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_graph_preview.test.tsx deleted file mode 100644 index 453f897d4e188..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_graph_preview.test.tsx +++ /dev/null @@ -1,226 +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 type { RenderHookResult } from '@testing-library/react'; -import { renderHook } from '@testing-library/react'; -import type { UseGraphPreviewParams, UseGraphPreviewResult } from './use_graph_preview'; -import { useGraphPreview } from './use_graph_preview'; -import type { GetFieldsData } from './use_get_fields_data'; -import { mockFieldData } from '../mocks/mock_get_fields_data'; - -const mockGetFieldsData: GetFieldsData = (field: string) => { - if (field === 'kibana.alert.original_event.id') { - return 'eventId'; - } else if (field === 'actor.entity.id') { - return 'actorId'; - } else if (field === 'target.entity.id') { - return 'targetId'; - } - - return mockFieldData[field]; -}; - -describe('useGraphPreview', () => { - let hookResult: RenderHookResult<UseGraphPreviewResult, UseGraphPreviewParams>; - - it(`should return false when missing actor`, () => { - const getFieldsData: GetFieldsData = (field: string) => { - if (field === 'actor.entity.id') { - return; - } - return mockGetFieldsData(field); - }; - - hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { - initialProps: { - getFieldsData, - ecsData: { - _id: 'id', - event: { - action: ['action'], - }, - }, - }, - }); - - const { hasGraphRepresentation, timestamp, eventIds, actorIds, action, targetIds } = - hookResult.result.current; - expect(hasGraphRepresentation).toEqual(false); - expect(timestamp).toEqual(mockFieldData['@timestamp'][0]); - expect(eventIds).toEqual(['eventId']); - expect(actorIds).toEqual([]); - expect(targetIds).toEqual(['targetId']); - expect(action).toEqual(['action']); - }); - - it(`should return false when missing event.action`, () => { - hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { - initialProps: { - getFieldsData: mockGetFieldsData, - ecsData: { - _id: 'id', - }, - }, - }); - - const { hasGraphRepresentation, timestamp, eventIds, actorIds, action, targetIds } = - hookResult.result.current; - expect(hasGraphRepresentation).toEqual(false); - expect(timestamp).toEqual(mockFieldData['@timestamp'][0]); - expect(eventIds).toEqual(['eventId']); - expect(actorIds).toEqual(['actorId']); - expect(targetIds).toEqual(['targetId']); - expect(action).toEqual(undefined); - }); - - it(`should return false when missing target`, () => { - const getFieldsData: GetFieldsData = (field: string) => { - if (field === 'target.entity.id') { - return; - } - return mockGetFieldsData(field); - }; - - hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { - initialProps: { - getFieldsData, - ecsData: { - _id: 'id', - }, - }, - }); - - const { hasGraphRepresentation, timestamp, eventIds, actorIds, action, targetIds } = - hookResult.result.current; - expect(hasGraphRepresentation).toEqual(false); - expect(timestamp).toEqual(mockFieldData['@timestamp'][0]); - expect(eventIds).toEqual(['eventId']); - expect(actorIds).toEqual(['actorId']); - expect(targetIds).toEqual([]); - expect(action).toEqual(undefined); - }); - - it(`should return false when missing original_event.id`, () => { - const getFieldsData: GetFieldsData = (field: string) => { - if (field === 'kibana.alert.original_event.id') { - return; - } - - return mockGetFieldsData(field); - }; - - hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { - initialProps: { - getFieldsData, - ecsData: { - _id: 'id', - event: { - action: ['action'], - }, - }, - }, - }); - - const { hasGraphRepresentation, timestamp, eventIds, actorIds, action, targetIds } = - hookResult.result.current; - expect(hasGraphRepresentation).toEqual(false); - expect(timestamp).toEqual(mockFieldData['@timestamp'][0]); - expect(eventIds).toEqual([]); - expect(actorIds).toEqual(['actorId']); - expect(targetIds).toEqual(['targetId']); - expect(action).toEqual(['action']); - }); - - it(`should return false when timestamp is missing`, () => { - const getFieldsData: GetFieldsData = (field: string) => { - if (field === '@timestamp') { - return; - } - - return mockGetFieldsData(field); - }; - - hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { - initialProps: { - getFieldsData, - ecsData: { - _id: 'id', - event: { - action: ['action'], - }, - }, - }, - }); - - const { hasGraphRepresentation, timestamp, eventIds, actorIds, action, targetIds } = - hookResult.result.current; - expect(hasGraphRepresentation).toEqual(false); - expect(timestamp).toEqual(null); - expect(eventIds).toEqual(['eventId']); - expect(actorIds).toEqual(['actorId']); - expect(targetIds).toEqual(['targetId']); - expect(action).toEqual(['action']); - }); - - it(`should return true when alert is has graph preview`, () => { - hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { - initialProps: { - getFieldsData: mockGetFieldsData, - ecsData: { - _id: 'id', - event: { - action: ['action'], - }, - }, - }, - }); - - const { hasGraphRepresentation, timestamp, eventIds, actorIds, action, targetIds } = - hookResult.result.current; - expect(hasGraphRepresentation).toEqual(true); - expect(timestamp).toEqual(mockFieldData['@timestamp'][0]); - expect(eventIds).toEqual(['eventId']); - expect(actorIds).toEqual(['actorId']); - expect(targetIds).toEqual(['targetId']); - expect(action).toEqual(['action']); - }); - - it(`should return true when alert is has graph preview with multiple values`, () => { - const getFieldsData: GetFieldsData = (field: string) => { - if (field === 'kibana.alert.original_event.id') { - return ['id1', 'id2']; - } else if (field === 'actor.entity.id') { - return ['actorId1', 'actorId2']; - } else if (field === 'target.entity.id') { - return ['targetId1', 'targetId2']; - } - - return mockFieldData[field]; - }; - - hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { - initialProps: { - getFieldsData, - ecsData: { - _id: 'id', - event: { - action: ['action1', 'action2'], - }, - }, - }, - }); - - const { hasGraphRepresentation, timestamp, eventIds, actorIds, action, targetIds } = - hookResult.result.current; - expect(hasGraphRepresentation).toEqual(true); - expect(timestamp).toEqual(mockFieldData['@timestamp'][0]); - expect(eventIds).toEqual(['id1', 'id2']); - expect(actorIds).toEqual(['actorId1', 'actorId2']); - expect(action).toEqual(['action1', 'action2']); - expect(targetIds).toEqual(['targetId1', 'targetId2']); - }); -}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_analyzer.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_analyzer.test.tsx deleted file mode 100644 index 334bf5f08721e..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_analyzer.test.tsx +++ /dev/null @@ -1,147 +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 { renderHook } from '@testing-library/react'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { useNavigateToAnalyzer } from './use_navigate_to_analyzer'; -import { mockFlyoutApi } from '../mocks/mock_flyout_context'; -import { useWhichFlyout } from './use_which_flyout'; -import { useKibana as mockUseKibana } from '../../../../common/lib/kibana/__mocks__'; -import { useKibana } from '../../../../common/lib/kibana'; -import { - DocumentDetailsRightPanelKey, - DocumentDetailsLeftPanelKey, - DocumentDetailsAnalyzerPanelKey, -} from '../constants/panel_keys'; -import { ANALYZE_GRAPH_ID, ANALYZER_PREVIEW_BANNER } from '../../left/components/analyze_graph'; - -jest.mock('@kbn/expandable-flyout'); -jest.mock('../../../../common/lib/kibana'); -jest.mock('./use_which_flyout'); - -const mockedUseKibana = mockUseKibana(); -(useKibana as jest.Mock).mockReturnValue(mockedUseKibana); - -const mockUseWhichFlyout = useWhichFlyout as jest.Mock; -const FLYOUT_KEY = 'SecuritySolution'; -const TIMELINE_FLYOUT_KEY = 'Timeline'; - -const eventId = 'eventId1'; -const indexName = 'index1'; -const scopeId = 'scopeId1'; - -describe('useNavigateToAnalyzer', () => { - beforeEach(() => { - jest.clearAllMocks(); - jest.mocked(useExpandableFlyoutApi).mockReturnValue(mockFlyoutApi); - }); - - it('when isFlyoutOpen is true, should return callback that opens left and preview panels', () => { - mockUseWhichFlyout.mockReturnValue(FLYOUT_KEY); - const hookResult = renderHook(() => - useNavigateToAnalyzer({ isFlyoutOpen: true, eventId, indexName, scopeId }) - ); - hookResult.result.current.navigateToAnalyzer(); - - expect(mockFlyoutApi.openLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { - tab: 'visualize', - subTab: ANALYZE_GRAPH_ID, - }, - params: { - id: eventId, - indexName, - scopeId, - }, - }); - - expect(mockFlyoutApi.openPreviewPanel).toHaveBeenCalledWith({ - id: DocumentDetailsAnalyzerPanelKey, - params: { - resolverComponentInstanceID: `${FLYOUT_KEY}-${scopeId}`, - banner: ANALYZER_PREVIEW_BANNER, - }, - }); - }); - - it('when isFlyoutOpen is false and scopeId is not timeline, should return callback that opens a new flyout', () => { - mockUseWhichFlyout.mockReturnValue(null); - - const hookResult = renderHook(() => - useNavigateToAnalyzer({ isFlyoutOpen: false, eventId, indexName, scopeId }) - ); - hookResult.result.current.navigateToAnalyzer(); - expect(mockFlyoutApi.openFlyout).toHaveBeenCalledWith({ - right: { - id: DocumentDetailsRightPanelKey, - params: { - id: eventId, - indexName, - scopeId, - }, - }, - left: { - id: DocumentDetailsLeftPanelKey, - path: { - tab: 'visualize', - subTab: ANALYZE_GRAPH_ID, - }, - params: { - id: eventId, - indexName, - scopeId, - }, - }, - preview: { - id: DocumentDetailsAnalyzerPanelKey, - params: { - resolverComponentInstanceID: `${FLYOUT_KEY}-${scopeId}`, - banner: ANALYZER_PREVIEW_BANNER, - }, - }, - }); - }); - - it('when isFlyoutOpen is false and scopeId is current timeline, should return callback that opens a new flyout in timeline', () => { - mockUseWhichFlyout.mockReturnValue(null); - const timelineId = 'timeline-1'; - const hookResult = renderHook(() => - useNavigateToAnalyzer({ isFlyoutOpen: false, eventId, indexName, scopeId: timelineId }) - ); - hookResult.result.current.navigateToAnalyzer(); - expect(mockFlyoutApi.openFlyout).toHaveBeenCalledWith({ - right: { - id: DocumentDetailsRightPanelKey, - params: { - id: eventId, - indexName, - scopeId: timelineId, - }, - }, - left: { - id: DocumentDetailsLeftPanelKey, - path: { - tab: 'visualize', - subTab: ANALYZE_GRAPH_ID, - }, - params: { - id: eventId, - indexName, - scopeId: timelineId, - }, - }, - preview: { - id: DocumentDetailsAnalyzerPanelKey, - params: { - resolverComponentInstanceID: `${TIMELINE_FLYOUT_KEY}-${timelineId}`, - banner: ANALYZER_PREVIEW_BANNER, - }, - }, - }); - }); -}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_session_view.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_session_view.test.tsx deleted file mode 100644 index ac624ce11ce56..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_session_view.test.tsx +++ /dev/null @@ -1,81 +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 { renderHook } from '@testing-library/react'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { useNavigateToSessionView } from './use_navigate_to_session_view'; -import { mockFlyoutApi } from '../mocks/mock_flyout_context'; -import { useKibana as mockUseKibana } from '../../../../common/lib/kibana/__mocks__'; -import { useKibana } from '../../../../common/lib/kibana'; -import { DocumentDetailsRightPanelKey, DocumentDetailsLeftPanelKey } from '../constants/panel_keys'; -import { SESSION_VIEW_ID } from '../../left/components/session_view'; - -jest.mock('@kbn/expandable-flyout'); -jest.mock('../../../../common/lib/kibana'); - -const mockedUseKibana = mockUseKibana(); -(useKibana as jest.Mock).mockReturnValue(mockedUseKibana); - -const eventId = 'eventId1'; -const indexName = 'index1'; -const scopeId = 'scopeId1'; - -describe('useNavigateToSessionView', () => { - beforeEach(() => { - jest.clearAllMocks(); - jest.mocked(useExpandableFlyoutApi).mockReturnValue(mockFlyoutApi); - }); - - it('when isFlyoutOpen is true, should return callback that opens left panel', () => { - const hookResult = renderHook(() => - useNavigateToSessionView({ isFlyoutOpen: true, eventId, indexName, scopeId }) - ); - hookResult.result.current.navigateToSessionView(); - - expect(mockFlyoutApi.openLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { - tab: 'visualize', - subTab: SESSION_VIEW_ID, - }, - params: { - id: eventId, - indexName, - scopeId, - }, - }); - }); - - it('when isFlyoutOpen is false, should return callback that opens a new flyout', () => { - const hookResult = renderHook(() => - useNavigateToSessionView({ isFlyoutOpen: false, eventId, indexName, scopeId }) - ); - hookResult.result.current.navigateToSessionView(); - expect(mockFlyoutApi.openFlyout).toHaveBeenCalledWith({ - right: { - id: DocumentDetailsRightPanelKey, - params: { - id: eventId, - indexName, - scopeId, - }, - }, - left: { - id: DocumentDetailsLeftPanelKey, - path: { - tab: 'visualize', - subTab: SESSION_VIEW_ID, - }, - params: { - id: eventId, - indexName, - scopeId, - }, - }, - }); - }); -}); diff --git a/x-pack/plugins/security_solution/public/flyout/jest.config.js b/x-pack/plugins/security_solution/public/flyout/jest.config.js deleted file mode 100644 index 57101f9368e5f..0000000000000 --- a/x-pack/plugins/security_solution/public/flyout/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/flyout'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/flyout', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/flyout/**/*.{ts,tsx}'], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/jest.config.js b/x-pack/plugins/security_solution/public/jest.config.js deleted file mode 100644 index 745b307ee4d41..0000000000000 --- a/x-pack/plugins/security_solution/public/jest.config.js +++ /dev/null @@ -1,29 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - /** all nested directories have their own Jest config file */ - testMatch: ['<rootDir>/x-pack/plugins/security_solution/public/*.test.{js,mjs,ts,tsx}'], - roots: ['<rootDir>/x-pack/plugins/security_solution/public'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution/public/**/*.{ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution/public/*.test.{ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution/public/{__test__,__snapshots__,__examples__,*mock*,tests,test_helpers,integration_tests,types}/**/*', - '!<rootDir>/x-pack/plugins/security_solution/public/*mock*.{ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution/public/*.test.{ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution/public/*.d.ts', - '!<rootDir>/x-pack/plugins/security_solution/public/*.config.ts', - '!<rootDir>/x-pack/plugins/security_solution/public/index.{js,ts,tsx}', - ], - - moduleNameMapper: require('../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/management/common/translations.ts b/x-pack/plugins/security_solution/public/management/common/translations.ts deleted file mode 100644 index 6929452e5d9e9..0000000000000 --- a/x-pack/plugins/security_solution/public/management/common/translations.ts +++ /dev/null @@ -1,323 +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 { OperatingSystem } from '@kbn/securitysolution-utils'; -import type { ServerApiError } from '../../common/types'; - -export const ENDPOINTS_TAB = i18n.translate('xpack.securitySolution.endpointsTab', { - defaultMessage: 'Endpoints', -}); - -export const POLICIES_TAB = i18n.translate('xpack.securitySolution.policiesTab', { - defaultMessage: 'Policies', -}); - -export const TRUSTED_APPS_TAB = i18n.translate('xpack.securitySolution.trustedAppsTab', { - defaultMessage: 'Trusted applications', -}); - -export const EVENT_FILTERS_TAB = i18n.translate('xpack.securitySolution.eventFiltersTab', { - defaultMessage: 'Event filters', -}); - -export const OS_TITLES: Readonly<{ [K in OperatingSystem]: string }> = { - [OperatingSystem.WINDOWS]: i18n.translate('xpack.securitySolution.administration.os.windows', { - defaultMessage: 'Windows', - }), - [OperatingSystem.MAC]: i18n.translate('xpack.securitySolution.administration.os.macos', { - defaultMessage: 'Mac', - }), - [OperatingSystem.LINUX]: i18n.translate('xpack.securitySolution.administration.os.linux', { - defaultMessage: 'Linux', - }), -}; - -export const getLoadPoliciesError = (error: ServerApiError) => { - return i18n.translate('xpack.securitySolution.exceptions.failedLoadPolicies', { - defaultMessage: 'There was an error loading policies: "{error}"', - values: { error: error.message }, - }); -}; - -export const CONSOLE_COMMANDS = { - isolate: { - title: i18n.translate('xpack.securitySolution.endpointConsoleCommands.isolate.title', { - defaultMessage: 'Isolate', - }), - about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.isolate.about', { - defaultMessage: 'Isolate the host', - }), - privileges: i18n.translate( - 'xpack.securitySolution.endpointConsoleCommands.isolate.privileges', - { - defaultMessage: - 'Insufficient privileges to isolate hosts. Contact your Kibana administrator if you think you should have this permission.', - } - ), - }, - release: { - about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.release.about', { - defaultMessage: 'Release the host', - }), - }, - killProcess: { - title: i18n.translate('xpack.securitySolution.endpointConsoleCommands.killProcess.title', { - defaultMessage: 'Kill process', - }), - about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.killProcess.about', { - defaultMessage: 'Kill/terminate a process', - }), - privileges: i18n.translate( - 'xpack.securitySolution.endpointConsoleCommands.killProcess.privileges', - { - defaultMessage: - 'Insufficient privileges to kill process. Contact your Kibana administrator if you think you should have this permission.', - } - ), - args: { - pid: { - about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.pid.arg.comment', { - defaultMessage: 'A PID representing the process to kill', - }), - }, - entityId: { - about: i18n.translate( - 'xpack.securitySolution.endpointConsoleCommands.entityId.arg.comment', - { - defaultMessage: 'An entity id representing the process to kill', - } - ), - }, - processName: { - about: i18n.translate( - 'xpack.securitySolution.endpointConsoleCommands.processName.arg.comment', - { defaultMessage: 'The process name to kill' } - ), - }, - }, - }, - suspendProcess: { - title: i18n.translate('xpack.securitySolution.endpointConsoleCommands.suspendProcess.title', { - defaultMessage: 'Suspend process', - }), - about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.suspendProcess.about', { - defaultMessage: 'Temporarily suspend a process', - }), - privileges: i18n.translate( - 'xpack.securitySolution.endpointConsoleCommands.suspendProcess.privileges', - { - defaultMessage: - 'Insufficient privileges to supend process. Contact your Kibana administrator if you think you should have this permission.', - } - ), - args: { - pid: { - about: i18n.translate( - 'xpack.securitySolution.endpointConsoleCommands.suspendProcess.pid.arg.comment', - { - defaultMessage: 'A PID representing the process to suspend', - } - ), - }, - entityId: { - about: i18n.translate( - 'xpack.securitySolution.endpointConsoleCommands.suspendProcess.entityId.arg.comment', - { - defaultMessage: 'An entity id representing the process to suspend', - } - ), - }, - }, - }, - status: { - about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.status.about', { - defaultMessage: 'Show host status information', - }), - }, - processes: { - about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.processes.about', { - defaultMessage: 'Show all running processes', - }), - }, - getFile: { - about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.getFile.about', { - defaultMessage: 'Retrieve a file from the host', - }), - args: { - path: { - about: i18n.translate( - 'xpack.securitySolution.endpointConsoleCommands.getFile.pathArgAbout', - { - defaultMessage: 'The full file path to be retrieved', - } - ), - }, - }, - }, - execute: { - about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.execute.about', { - defaultMessage: 'Execute a command on the host', - }), - args: { - timeout: { - about: i18n.translate( - 'xpack.securitySolution.endpointConsoleCommands.execute.args.timeout.about', - { - defaultMessage: - 'The timeout in units of time (h for hours, m for minutes, s for seconds) for the endpoint to wait for the script to complete. Example: 37m. If not given, it defaults to 4 hours.', - } - ), - }, - }, - }, - upload: { - about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.upload.about', { - defaultMessage: 'Upload a file to the host', - }), - args: { - file: { - about: i18n.translate( - 'xpack.securitySolution.endpointConsoleCommands.upload.args.file.about', - { - defaultMessage: 'The file that will be sent to the host', - } - ), - }, - overwrite: { - about: i18n.translate( - 'xpack.securitySolution.endpointConsoleCommands.upload.args.overwrite.about', - { - defaultMessage: 'Overwrite the file on the host if it already exists', - } - ), - }, - }, - }, - scan: { - about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.scan.about', { - defaultMessage: 'Scan the host for malware', - }), - args: { - path: { - about: i18n.translate( - 'xpack.securitySolution.endpointConsoleCommands.scan.args.path.about', - { - defaultMessage: 'The absolute path to a file or directory to be scanned', - } - ), - }, - }, - }, -}; - -export const CROWDSTRIKE_CONSOLE_COMMANDS = { - runscript: { - args: { - raw: { - about: i18n.translate( - 'xpack.securitySolution.crowdStrikeConsoleCommands.runscript.args.raw.about', - { - defaultMessage: 'Raw script content', - } - ), - }, - cloudFile: { - about: i18n.translate( - 'xpack.securitySolution.crowdStrikeConsoleCommands.runscript.args.cloudFile.about', - { - defaultMessage: 'Script name in cloud storage', - } - ), - }, - commandLine: { - about: i18n.translate( - 'xpack.securitySolution.crowdStrikeConsoleCommands.runscript.args.commandLine.about', - { - defaultMessage: 'Command line arguments', - } - ), - }, - hostPath: { - about: i18n.translate( - 'xpack.securitySolution.crowdStrikeConsoleCommands.runscript.args.hostPath.about', - { - defaultMessage: 'Absolute or relative path of script on host machine', - } - ), - }, - timeout: { - about: i18n.translate( - 'xpack.securitySolution.crowdStrikeConsoleCommands.runscript.args.timeout.about', - { - defaultMessage: 'Timeout in seconds', - } - ), - }, - }, - title: i18n.translate('xpack.securitySolution.crowdStrikeConsoleCommands.runscript.title', { - defaultMessage: 'Isolate', - }), - about: i18n.translate('xpack.securitySolution.crowdStrikeConsoleCommands.runscript.about', { - defaultMessage: 'Run a script on the host', - }), - helpUsage: i18n.translate('xpack.securitySolution.crowdStrikeConsoleCommands.runscript.about', { - defaultMessage: ` -Command Examples for Running Scripts: - -1. Executes a script saved in the CrowdStrike cloud with the specified command-line arguments. - - runscript --CloudFile="CloudScript1.ps1" --CommandLine="-Verbose true" - -2. Executes a script saved in the CrowdStrike cloud with the specified command-line arguments and a 180-second timeout. - - runscript --CloudFile="CloudScript1.ps1" --CommandLine="-Verbose true" -Timeout=180 - -3. Executes a raw script provided entirely within the "--Raw" flag. - - runscript --Raw="Get-ChildItem." - -4. Executes a script located on the remote host at the specified path with the provided command-line arguments. - - runscript --HostPath="C:\\temp\\LocalScript.ps1" --CommandLine="-Verbose true" - -`, - }), - privileges: i18n.translate( - 'xpack.securitySolution.crowdStrikeConsoleCommands.runscript.privileges', - { - defaultMessage: - 'Insufficient privileges to run script. Contact your Kibana administrator if you think you should have this permission.', - } - ), - }, -}; - -export const CONFIRM_WARNING_MODAL_LABELS = (entryType: string) => { - return { - title: i18n.translate('xpack.securitySolution.artifacts.confirmWarningModal.title', { - defaultMessage: `Confirm {type}`, - values: { type: entryType }, - }), - body: i18n.translate('xpack.securitySolution.artifacts.confirmWarningModal.body', { - defaultMessage: - 'Using a "*" or a "?" in the value with the "is" operator can make the entry ineffective. Change the operator to "matches" to ensure wildcards run properly. Select “Cancel” to revise your entry, or "Add" to continue with the entry in its current state.', - }), - confirmButton: i18n.translate( - 'xpack.securitySolution.artifacts.confirmWarningModal.confirmButtonText', - { - defaultMessage: 'Add', - } - ), - cancelButton: i18n.translate( - 'xpack.securitySolution.trustedapps.confirmWarningModal.cancelButtonText', - { - defaultMessage: 'Cancel', - } - ), - }; -}; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_execute_action/execute_action_host_response.tsx b/x-pack/plugins/security_solution/public/management/components/endpoint_execute_action/execute_action_host_response.tsx deleted file mode 100644 index 43ff3ffca5a62..0000000000000 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_execute_action/execute_action_host_response.tsx +++ /dev/null @@ -1,69 +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 { EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import React, { memo, useMemo } from 'react'; -import type { - ActionDetails, - MaybeImmutable, - ResponseActionExecuteOutputContent, - ResponseActionsExecuteParameters, -} from '../../../../common/endpoint/types'; -import { EXECUTE_FILE_LINK_TITLE } from '../endpoint_response_actions_list/translations'; -import { ResponseActionFileDownloadLink } from '../response_action_file_download_link'; -import { ExecuteActionHostResponseOutput } from './execute_action_host_response_output'; - -export interface ExecuteActionHostResponseProps { - action: MaybeImmutable< - ActionDetails<ResponseActionExecuteOutputContent, ResponseActionsExecuteParameters> - >; - agentId?: string; - canAccessFileDownloadLink: boolean; - 'data-test-subj'?: string; - textSize?: 'xs' | 's'; -} - -export const ExecuteActionHostResponse = memo<ExecuteActionHostResponseProps>( - ({ - action, - agentId = action.agents[0], - canAccessFileDownloadLink, - textSize = 's', - 'data-test-subj': dataTestSubj, - }) => { - const outputContent = useMemo( - () => - action.outputs && - action.outputs[agentId] && - (action.outputs[agentId].content as ResponseActionExecuteOutputContent), - [action.outputs, agentId] - ); - - return ( - <> - <EuiFlexItem> - <ResponseActionFileDownloadLink - action={action} - buttonTitle={EXECUTE_FILE_LINK_TITLE} - canAccessFileDownloadLink={canAccessFileDownloadLink} - data-test-subj={`${dataTestSubj}-getExecuteLink`} - textSize={textSize} - /> - <EuiSpacer size="xxl" /> - </EuiFlexItem> - {outputContent && ( - <ExecuteActionHostResponseOutput - outputContent={outputContent} - data-test-subj={`${dataTestSubj}-executeResponseOutput`} - textSize={textSize} - /> - )} - </> - ); - } -); - -ExecuteActionHostResponse.displayName = 'ExecuteActionHostResponse'; diff --git a/x-pack/plugins/security_solution/public/management/cypress/README.md b/x-pack/plugins/security_solution/public/management/cypress/README.md deleted file mode 100644 index 482a2bac99595..0000000000000 --- a/x-pack/plugins/security_solution/public/management/cypress/README.md +++ /dev/null @@ -1,202 +0,0 @@ -# Cypress Tests - -The `plugins/security_solution/public/management/cypress` directory contains functional UI tests that execute -using [Cypress](https://www.cypress.io/). - -## Pre-requisites - -Good to have before you run the tests: - -- Docker CLI, as Docker desktop doesn't install it by default. Install using `brew`: - -```shell -brew install docker -``` - -- [Multipass](https://multipass.run/) for running the tests against real endpoint. Install using `brew`: - -```shell -brew install multipass -``` - -If you also want to run the tests against real endpoints as on the CI pipeline, then you need to have the following: - -- [Vagrant](https://developer.hashicorp.com/vagrant/docs/installation) -- [Vagrant provider for VMware](https://developer.hashicorp.com/vagrant/docs/providers/vmware/installation) -- [Vagrant VMware Utility](https://developer.hashicorp.com/vagrant/docs/providers/vmware/vagrant-vmware-utility) -- [VMware Fusion](https://www.vmware.com/products/fusion/fusion-evaluation.html) - -See [running interactive tests on real endpoint with vagrant](#cypress-interactive-with-real-endpoints-using-vagrant) -for more information. - -## Adding new tests - tagging for ESS vs Serverless - -Similarly to Security Solution cypress tests, we use tags in order to select which tests we want to execute on which environment: - -- `@serverless` includes a test in the Serverless test suite. You need to explicitly add this tag to any test you want to run against a Serverless environment. -- `@serverlessQA` includes a test in the Serverless test suite for the Kibana release process of serverless. You need to explicitly add this tag to any test you want you run in CI for the Kibana QA quality gate. These tests should be stable, otherwise they will be blocking the release pipeline. They should be also critical enough, so that when they fail, there's a high chance of an SDH or blocker issue to be reported. -- `@ess` includes a test in the normal, non-Serverless test suite. You need to explicitly add this tag to any test you want to run against a non-Serverless environment. -- `@brokenInServerless` excludes a test from the Serverless test suite (even if it's tagged as `@serverless`). Indicates that a test should run in Serverless, but currently is broken. -- `@skipInServerless` excludes a test from the Serverless test suite (even if it's tagged as `@serverless`). Indicates that we don't want to run the given test in Serverless. -- `@skipInServerlessMKI` excludes a test from any MKI environment, but it will continue being executed as part of the PR process if the `@serverless` tag is present. - -Important: if you don't provide any tag, your test won't be executed. - -## Running the tests - -There are currently three ways to run the tests, comprised of two execution modes and two target environments, which -will be detailed below. - -### Environment Variables - -The test suites are set up with defaults for Kibana and Elasticsearch. The following environment variables can be set to -changes those defaults and target a run against different instances of the stack: - -``` -CYPRESS_KIBANA_URL -CYPRESS_KIBANA_USERNAME -CYPRESS_KIBANA_PASSWORD -CYPRESS_ELASTICSEARCH_URL -CYPRESS_ELASTICSEARCH_USERNAME -CYPRESS_ELASTICSEARCH_PASSWORD -CYPRESS_BASE_URL -``` - -Some notes: - -- The `ELASTICSEARCH_USERNAME` and `ELASTICSEARCH_PASSWORD` should have sufficient privileges to CRUD on restricted indices. -- Both URL variables should **NOT** include credentials in the url -- `KIBANA_URL` and `BASE_URL` will almost always be the same - -Example: - -```shell -yarn --cwd x-pack/plugins/security_solution -CYPRESS_BASE_URL=http://localhost:5601 \ -CYPRESS_KIBANA_URL=http://localhost:5601 \ -CYPRESS_KIBANA_USERNAME=elastic \ -CYPRESS_KIBANA_PASSWORD=changeme \ -CYPRESS_ELASTICSEARCH_USERNAME=system_indices_superuser \ -CYPRESS_ELASTICSEARCH_PASSWORD=changeme \ -CYPRESS_ELASTICSEARCH_URL=http://localhost:9200 cypress:dw:open -``` - -### Execution modes - -#### Interactive mode - -When you run Cypress in interactive mode, an interactive runner is displayed that allows you to see commands as they -execute while also viewing the application under test. For more information, please -see [cypress documentation](https://docs.cypress.io/guides/core-concepts/test-runner.html#Overview). - -#### Headless mode - -A headless browser is a browser simulation program that does not have a user interface. These programs operate like any -other browser but do not display any UI. So when you are executing the tests on this mode you are not -going to see the application under test. Just the output of the test is displayed on the terminal once the execution is -finished. - -### Target environments - -#### FTR (CI) - -This is the configuration used by CI. It uses the FTR to spawn both a Kibana instance (http://localhost:5620) and an -Elasticsearch instance (http://localhost:9220) with a preloaded minimum set of data (see preceding "Test data" section), -and then executes cypress against this stack. You can find this configuration in `x-pack/test/defend_workflows_cypress` - -### Test Execution: Examples - -#### Cypress + Headless (Chrome) - -Since this is how tests are run on CI, this will likely be the configuration you want to use in order to reproduce -failures locally, etc. - -```shell -# bootstrap kibana from the project root and build the plugins/assets that cypress will execute against -yarn kbn bootstrap && node scripts/build_kibana_platform_plugins - -# launch the cypress test runner against ESS -yarn --cwd x-pack/plugins/security_solution cypress:dw:run - -# or against Serverless -yarn --cwd x-pack/plugins/security_solution cypress:dw:serverless:run -``` - -#### Cypress - -This is the preferred mode for developing new tests against mocked data - -```shell -# bootstrap kibana from the project root and build the plugins/assets that cypress will execute against -yarn kbn bootstrap && node scripts/build_kibana_platform_plugins - -# launch the cypress test runner against ESS -yarn --cwd x-pack/plugins/security_solution cypress:dw:open - -# or against Serverless -yarn --cwd x-pack/plugins/security_solution cypress:dw:serverless:open -``` - -## Folder Structure - -### e2e/ - -Contains all the tests. Within it are two sub-folders: - -### integration/ - -Cypress convention. Contains the specs that are going to be executed. - -### fixtures/ - -Cypress convention. Fixtures are used as external pieces of static data when we stub responses. - -### support/ - -Cypress convention. As a convenience, by default Cypress will automatically include the plugins file -cypress/plugins/index.js before every single spec file it runs. -Directory also holds Cypress Plugins that are then initialized via `setupNodeEvents()` in the Cypress configuration. - -### screens/ - -Contains the elements we want to interact with within our tests. -Each file inside the screens folder represents a screen in our application. - -### tasks/ - -_Tasks_ are functions that may be reused across tests. - -Each file inside the tasks folder represents a screen of our application. - -## Test data - -The data the tests need: - -- Is generated on the fly using our application APIs (preferred way) - -## Development Best Practices - -### Clean up the state - -Remember to clean up the state of the test after its execution. Be mindful of failure scenarios, as well: if your test -fails, will it leave the environment in a recoverable state? - -### Minimize the use of es_archive - -When possible, create all the data that you need for executing the tests using the application APIS or the UI. - -### Speed up test execution time - -Loading the web page takes a big amount of time, in order to minimize that impact, the following points should be -taken into consideration until another solution is implemented: - -- Group the tests that are similar in different contexts. -- For every context login only once, and clean the state between tests if needed without reloading the page. -- All tests in a spec file must be order-independent. - -Remember that by minimizing the number of times the web page is loaded, we minimize the execution time as well. - -## Linting - -Optional linting rules for Cypress and linting setup can be -found [here](https://github.com/cypress-io/eslint-plugin-cypress#usage) diff --git a/x-pack/plugins/security_solution/public/management/cypress/tsconfig.json b/x-pack/plugins/security_solution/public/management/cypress/tsconfig.json deleted file mode 100644 index c983368164906..0000000000000 --- a/x-pack/plugins/security_solution/public/management/cypress/tsconfig.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "extends": "../../../../../../tsconfig.base.json", - "include": [ - "**/*", - ], - "exclude": [ - "target/**/*" - ], - "compilerOptions": { - "outDir": "target/types", - "types": [ - "cypress", - "node", - ], - }, - "kbn_references": [ - // this cypress project uses code from the parent ts project - // in a way that can't be auto-matically deteceted at this time - // so we have to force the inclusion of this reference - { - "path": "../../../tsconfig.json", - "force": true - }, - "@kbn/security-plugin", - "@kbn/securitysolution-list-constants", - "@kbn/fleet-plugin", - "@kbn/securitysolution-io-ts-list-types", - "@kbn/cypress-config", - "@kbn/test-subj-selector", - "@kbn/cases-plugin", - "@kbn/test", - "@kbn/repo-info", - "@kbn/tooling-log", - "@kbn/security-solution-serverless", - "@kbn/dev-utils", - "@kbn/spaces-plugin", - "@kbn/test-suites-xpack/security_solution_cypress/cypress", - ] -} diff --git a/x-pack/plugins/security_solution/public/management/jest.config.js b/x-pack/plugins/security_solution/public/management/jest.config.js deleted file mode 100644 index e33e13fb4ce1a..0000000000000 --- a/x-pack/plugins/security_solution/public/management/jest.config.js +++ /dev/null @@ -1,19 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/management'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/management', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution/public/management/**/*.{ts,tsx}', - ], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/management/reporter_config.json b/x-pack/plugins/security_solution/public/management/reporter_config.json deleted file mode 100644 index f697013786e26..0000000000000 --- a/x-pack/plugins/security_solution/public/management/reporter_config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "reporterEnabled": "mochawesome, mocha-junit-reporter, buildkite-test-collector/mocha/reporter", - "buildkiteTestCollectorMochaReporterReporterOptions": { - "token_name": "BK_ANALYTICS_API_KEY", - "follow-symlinks": true, - "timeout": 120, - "upload-concurrency": 50 - }, - "reporterOptions": { - "html": false, - "json": true, - "mochaFile": "../../../target/kibana-security-solution/cypress/results/TEST-security-solution-cypress-[hash].xml", - "overwrite": false, - "reportDir": "../../../target/kibana-security-solution/cypress/results" - } -} diff --git a/x-pack/plugins/security_solution/public/notes/jest.config.js b/x-pack/plugins/security_solution/public/notes/jest.config.js deleted file mode 100644 index 7a19d2648f6be..0000000000000 --- a/x-pack/plugins/security_solution/public/notes/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/notes'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/notes', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/notes/**/*.{ts,tsx}'], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/context.tsx b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/context.tsx deleted file mode 100644 index 49baaba65caca..0000000000000 --- a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/context.tsx +++ /dev/null @@ -1,35 +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, { createContext, useContext, useMemo, type PropsWithChildren } from 'react'; -import type { RuleMigrationTaskStats } from '../../../../../../../common/siem_migrations/model/rule_migration.gen'; - -interface StartMigrationContextValue { - openFlyout: (migrationStats?: RuleMigrationTaskStats) => void; - closeFlyout: () => void; -} - -const StartMigrationContext = createContext<StartMigrationContextValue | null>(null); - -export const StartMigrationContextProvider: React.FC< - PropsWithChildren<StartMigrationContextValue> -> = React.memo(({ children, openFlyout, closeFlyout }) => { - const value = useMemo<StartMigrationContextValue>( - () => ({ openFlyout, closeFlyout }), - [openFlyout, closeFlyout] - ); - return <StartMigrationContext.Provider value={value}>{children}</StartMigrationContext.Provider>; -}); -StartMigrationContextProvider.displayName = 'StartMigrationContextProvider'; - -export const useStartMigrationContext = (): StartMigrationContextValue => { - const context = useContext(StartMigrationContext); - if (context == null) { - throw new Error('useStartMigrationContext must be used within a StartMigrationContextProvider'); - } - return context; -}; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_progress_panel.tsx b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_progress_panel.tsx deleted file mode 100644 index 0527e1cfbdf17..0000000000000 --- a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_progress_panel.tsx +++ /dev/null @@ -1,45 +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, { useMemo } from 'react'; -import { EuiFlexGroup, EuiFlexItem, EuiText, EuiPanel, EuiProgress } from '@elastic/eui'; -import type { RuleMigrationStats } from '../../../../../../../siem_migrations/rules/types'; -import * as i18n from '../translations'; -import { TITLE_CLASS_NAME } from '../start_migration_card.styles'; - -export interface MigrationProgressPanelProps { - migrationStats: RuleMigrationStats; -} -export const MigrationProgressPanel = React.memo<MigrationProgressPanelProps>( - ({ migrationStats }) => { - const progressValue = useMemo(() => { - const finished = migrationStats.rules.completed + migrationStats.rules.failed; - return (finished / migrationStats.rules.total) * 100; - }, [migrationStats.rules]); - - return ( - <EuiPanel hasShadow={false} hasBorder paddingSize="m"> - <EuiFlexGroup direction="column"> - <EuiFlexItem grow={false}> - <EuiText size="s" className={TITLE_CLASS_NAME}> - <p>{i18n.START_MIGRATION_CARD_MIGRATION_TITLE(migrationStats.number)}</p> - </EuiText> - </EuiFlexItem> - <EuiFlexItem grow={false}> - <EuiText size="s"> - <p>{i18n.START_MIGRATION_CARD_PROGRESS_DESCRIPTION}</p> - </EuiText> - </EuiFlexItem> - <EuiFlexItem grow={false}> - <EuiProgress value={progressValue} max={100} color="success" /> - </EuiFlexItem> - </EuiFlexGroup> - </EuiPanel> - ); - } -); -MigrationProgressPanel.displayName = 'MigrationProgressPanel'; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_ready_panel.tsx b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_ready_panel.tsx deleted file mode 100644 index 8603511fa2d6f..0000000000000 --- a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_ready_panel.tsx +++ /dev/null @@ -1,68 +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 { - EuiFlexGroup, - EuiFlexItem, - EuiText, - EuiButton, - EuiButtonEmpty, - EuiPanel, -} from '@elastic/eui'; -import { useStartMigration } from '../../../../../../../siem_migrations/rules/service/hooks/use_start_migration'; -import type { RuleMigrationStats } from '../../../../../../../siem_migrations/rules/types'; -import * as i18n from '../translations'; -import { useStartMigrationContext } from '../context'; -import { TITLE_CLASS_NAME } from '../start_migration_card.styles'; - -export interface MigrationReadyPanelProps { - migrationStats: RuleMigrationStats; -} -export const MigrationReadyPanel = React.memo<MigrationReadyPanelProps>(({ migrationStats }) => { - const { openFlyout } = useStartMigrationContext(); - const onOpenFlyout = useCallback<React.MouseEventHandler>(() => { - openFlyout(migrationStats); - }, [openFlyout, migrationStats]); - - const { startMigration, isLoading } = useStartMigration(); - const onStartMigration = useCallback(() => { - startMigration(migrationStats.id); - }, [migrationStats.id, startMigration]); - - return ( - <EuiPanel hasShadow={false} hasBorder paddingSize="m"> - <EuiFlexGroup direction="row" alignItems="center" gutterSize="m"> - <EuiFlexItem> - <EuiFlexGroup direction="column" alignItems="flexStart" gutterSize="s"> - <EuiFlexItem grow={false}> - <EuiText size="s" className={TITLE_CLASS_NAME}> - <p>{i18n.START_MIGRATION_CARD_MIGRATION_TITLE(migrationStats.number)}</p> - </EuiText> - </EuiFlexItem> - <EuiFlexItem grow={false}> - <EuiText size="s" color="subdued"> - <p>{i18n.START_MIGRATION_CARD_MIGRATION_READY_DESCRIPTION}</p> - </EuiText> - </EuiFlexItem> - </EuiFlexGroup> - </EuiFlexItem> - <EuiFlexItem grow={false}> - <EuiButtonEmpty onClick={onStartMigration} isLoading={isLoading}> - {i18n.START_MIGRATION_CARD_TRANSLATE_BUTTON} - </EuiButtonEmpty> - </EuiFlexItem> - <EuiFlexItem grow={false}> - <EuiButton iconType="download" iconSide="right" onClick={onOpenFlyout}> - {i18n.START_MIGRATION_CARD_UPLOAD_MACROS_BUTTON} - </EuiButton> - </EuiFlexItem> - </EuiFlexGroup> - </EuiPanel> - ); -}); -MigrationReadyPanel.displayName = 'MigrationReadyPanel'; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_result_panel.tsx b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_result_panel.tsx deleted file mode 100644 index b73b3cc8b4921..0000000000000 --- a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/migration_result_panel.tsx +++ /dev/null @@ -1,87 +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 from 'react'; -import moment from 'moment'; -import { - EuiFlexGroup, - EuiFlexItem, - EuiText, - EuiPanel, - EuiHorizontalRule, - EuiIcon, -} from '@elastic/eui'; -import { SecurityPageName } from '@kbn/security-solution-navigation'; -import { AssistantAvatar } from '@kbn/elastic-assistant/impl/assistant/assistant_avatar/assistant_avatar'; -import { SecuritySolutionLinkButton } from '../../../../../../../common/components/links'; -import type { RuleMigrationStats } from '../../../../../../../siem_migrations/rules/types'; -import * as i18n from '../translations'; -import { TITLE_CLASS_NAME } from '../start_migration_card.styles'; - -export interface MigrationResultPanelProps { - migrationStats: RuleMigrationStats; -} -export const MigrationResultPanel = React.memo<MigrationResultPanelProps>(({ migrationStats }) => { - return ( - <EuiPanel hasShadow={false} hasBorder paddingSize="none"> - <EuiPanel hasShadow={false} hasBorder={false} paddingSize="m"> - <EuiFlexGroup direction="column" alignItems="flexStart" gutterSize="xs"> - <EuiFlexItem grow={false}> - <EuiText size="s" className={TITLE_CLASS_NAME}> - <p>{i18n.START_MIGRATION_CARD_RESULT_TITLE(migrationStats.number)}</p> - </EuiText> - </EuiFlexItem> - <EuiFlexItem grow={false}> - <EuiText size="s" color="subdued"> - <p> - {i18n.START_MIGRATION_CARD_RESULT_DESCRIPTION( - moment(migrationStats.created_at).format('MMMM Do YYYY, h:mm:ss a'), - moment(migrationStats.last_updated_at).fromNow() - )} - </p> - </EuiText> - </EuiFlexItem> - </EuiFlexGroup> - </EuiPanel> - <EuiHorizontalRule margin="none" /> - <EuiPanel hasShadow={false} hasBorder={false} paddingSize="m"> - <EuiFlexGroup direction="column" alignItems="stretch" gutterSize="m"> - <EuiFlexItem grow={false}> - <EuiFlexGroup direction="row" alignItems="center" gutterSize="s"> - <EuiFlexItem grow={false}> - <EuiIcon type={AssistantAvatar} size="m" /> - </EuiFlexItem> - <EuiFlexItem> - <EuiText size="s" className={TITLE_CLASS_NAME}> - <p>{i18n.VIEW_TRANSLATED_RULES_TITLE}</p> - </EuiText> - </EuiFlexItem> - </EuiFlexGroup> - </EuiFlexItem> - <EuiFlexItem> - <EuiPanel hasShadow={false} hasBorder paddingSize="m"> - <EuiFlexGroup direction="column" alignItems="center"> - <EuiFlexItem grow={false}> - <p>{'TODO: chart'}</p> - </EuiFlexItem> - <EuiFlexItem grow={false}> - <SecuritySolutionLinkButton - deepLinkId={SecurityPageName.siemMigrationsRules} - path={migrationStats.id} - > - {i18n.VIEW_TRANSLATED_RULES_BUTTON} - </SecuritySolutionLinkButton> - </EuiFlexItem> - </EuiFlexGroup> - </EuiPanel> - </EuiFlexItem> - </EuiFlexGroup> - </EuiPanel> - </EuiPanel> - ); -}); -MigrationResultPanel.displayName = 'MigrationResultPanel'; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.tsx b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.tsx deleted file mode 100644 index a8d7aa78d0c93..0000000000000 --- a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.tsx +++ /dev/null @@ -1,87 +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, useEffect, useState } from 'react'; -import { EuiSpacer, EuiText } from '@elastic/eui'; -import { SiemMigrationTaskStatus } from '../../../../../../../common/siem_migrations/constants'; -import { OnboardingCardId } from '../../../../../constants'; -import type { RuleMigrationTaskStats } from '../../../../../../../common/siem_migrations/model/rule_migration.gen'; -import { useLatestStats } from '../../../../../../siem_migrations/rules/service/hooks/use_latest_stats'; -import { MigrationDataInputFlyout } from '../../../../../../siem_migrations/rules/components/data_input_flyout'; -import { CenteredLoadingSpinner } from '../../../../../../common/components/centered_loading_spinner'; -import type { OnboardingCardComponent } from '../../../../../types'; -import { OnboardingCardContentPanel } from '../../common/card_content_panel'; -import { UploadRulesPanels } from './upload_rules_panels'; -import { StartMigrationContextProvider } from './context'; -import { useStyles } from './start_migration_card.styles'; -import * as i18n from './translations'; -import { MissingAIConnectorCallout } from './missing_ai_connector_callout'; - -export const StartMigrationCard: OnboardingCardComponent = React.memo( - ({ setComplete, isCardComplete, setExpandedCardId }) => { - const styles = useStyles(); - const { data: migrationsStats, isLoading, refreshStats } = useLatestStats(); - - const [isFlyoutOpen, setIsFlyoutOpen] = useState<boolean>(); - const [flyoutMigrationStats, setFlyoutMigrationStats] = useState< - RuleMigrationTaskStats | undefined - >(); - - useEffect(() => { - // Set card complete if any migration is finished - if (!isCardComplete(OnboardingCardId.siemMigrationsStart) && migrationsStats) { - if (migrationsStats.some(({ status }) => status === SiemMigrationTaskStatus.FINISHED)) { - setComplete(true); - } - } - }, [isCardComplete, migrationsStats, setComplete]); - - const closeFlyout = useCallback(() => { - setIsFlyoutOpen(false); - setFlyoutMigrationStats(undefined); - refreshStats(); - }, [refreshStats]); - - const openFlyout = useCallback((migrationStats?: RuleMigrationTaskStats) => { - setFlyoutMigrationStats(migrationStats); - setIsFlyoutOpen(true); - }, []); - - if (!isCardComplete(OnboardingCardId.siemMigrationsAiConnectors)) { - return ( - <MissingAIConnectorCallout - onExpandAiConnectorsCard={() => - setExpandedCardId(OnboardingCardId.siemMigrationsAiConnectors) - } - /> - ); - } - - return ( - <StartMigrationContextProvider openFlyout={openFlyout} closeFlyout={closeFlyout}> - <OnboardingCardContentPanel paddingSize="none" className={styles}> - {isLoading ? ( - <CenteredLoadingSpinner /> - ) : ( - <UploadRulesPanels migrationsStats={migrationsStats} /> - )} - <EuiSpacer size="m" /> - <EuiText size="xs" color="subdued"> - <p>{i18n.START_MIGRATION_CARD_FOOTER_NOTE}</p> - </EuiText> - </OnboardingCardContentPanel> - {isFlyoutOpen && ( - <MigrationDataInputFlyout onClose={closeFlyout} migrationStats={flyoutMigrationStats} /> - )} - </StartMigrationContextProvider> - ); - } -); -StartMigrationCard.displayName = 'StartMigrationCard'; - -// eslint-disable-next-line import/no-default-export -export default StartMigrationCard; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/translations.ts b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/translations.ts deleted file mode 100644 index bdb3f31842549..0000000000000 --- a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/translations.ts +++ /dev/null @@ -1,118 +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'; - -export const START_MIGRATION_CARD_TITLE = i18n.translate( - 'xpack.securitySolution.onboarding.startMigration.title', - { defaultMessage: 'Translate your existing SIEM Rules to Elastic' } -); -export const START_MIGRATION_CARD_FOOTER_NOTE = i18n.translate( - 'xpack.securitySolution.onboarding.startMigration.footerNote', - { - defaultMessage: - 'Splunk and related marks are trademarks or registered trademarks of Splunk LLC in the United States and other countries.', - } -); -export const START_MIGRATION_CARD_CONNECTOR_MISSING_TEXT = i18n.translate( - 'xpack.securitySolution.onboarding.startMigration.connectorMissingText', - { - defaultMessage: 'Rule migrations require an AI connector to be configured.', - } -); -export const START_MIGRATION_CARD_CONNECTOR_MISSING_BUTTON = i18n.translate( - 'xpack.securitySolution.onboarding.startMigration.connectorMissingText', - { defaultMessage: 'AI provider step' } -); - -export const START_MIGRATION_CARD_UPLOAD_TITLE = i18n.translate( - 'xpack.securitySolution.onboarding.startMigration.upload.title', - { defaultMessage: 'Export your Splunk® SIEM rules to start translation.' } -); - -export const START_MIGRATION_CARD_UPLOAD_DESCRIPTION = i18n.translate( - 'xpack.securitySolution.onboarding.startMigration.upload.description', - { - defaultMessage: - 'Upload your rules before importing data to identify the integrations, data streams, and available details of your SIEM rules. Click “Upload Rules” to view step-by-step instructions to export and uploading the rules.', - } -); - -export const START_MIGRATION_CARD_UPLOAD_BUTTON = i18n.translate( - 'xpack.securitySolution.onboarding.startMigration.upload.button', - { defaultMessage: 'Upload rules' } -); - -export const START_MIGRATION_CARD_UPLOAD_MORE_TITLE = i18n.translate( - 'xpack.securitySolution.onboarding.startMigration.uploadMore.title', - { defaultMessage: 'Need to migrate more rules?' } -); -export const START_MIGRATION_CARD_UPLOAD_MORE_BUTTON = i18n.translate( - 'xpack.securitySolution.onboarding.startMigration.uploadMore.button', - { defaultMessage: 'Upload more rules' } -); - -export const START_MIGRATION_CARD_UPLOAD_READ_MORE = i18n.translate( - 'xpack.securitySolution.onboarding.startMigration.upload.readMore', - { defaultMessage: 'Read more about our AI powered translations and other features.' } -); - -export const START_MIGRATION_CARD_UPLOAD_READ_DOCS = i18n.translate( - 'xpack.securitySolution.onboarding.startMigration.upload.readAiDocsLink', - { defaultMessage: 'Read AI docs' } -); - -export const START_MIGRATION_CARD_MIGRATION_READY_DESCRIPTION = i18n.translate( - 'xpack.securitySolution.onboarding.startMigration.ready.description', - { - defaultMessage: - 'Migration is created and ready but the translation has not started yet. You can either upload macros & lookups or start the translation process', - } -); -export const START_MIGRATION_CARD_TRANSLATE_BUTTON = i18n.translate( - 'xpack.securitySolution.onboarding.startMigration.translate.button', - { defaultMessage: 'Start translation' } -); -export const START_MIGRATION_CARD_UPLOAD_MACROS_BUTTON = i18n.translate( - 'xpack.securitySolution.onboarding.startMigration.uploadMacros.button', - { defaultMessage: 'Upload macros' } -); - -export const START_MIGRATION_CARD_MIGRATION_TITLE = (number: number) => - i18n.translate('xpack.securitySolution.onboarding.startMigration.migrationTitle', { - defaultMessage: 'SIEM rules migration #{number}', - values: { number }, - }); - -export const START_MIGRATION_CARD_PROGRESS_DESCRIPTION = i18n.translate( - 'xpack.securitySolution.onboarding.startMigration.progress.description', - { - defaultMessage: `This may take a few minutes & the task will work in the background. Just stay logged in and we'll notify you when done.`, - } -); - -export const START_MIGRATION_CARD_RESULT_TITLE = (number: number) => - i18n.translate('xpack.securitySolution.onboarding.startMigration.result.title', { - defaultMessage: 'SIEM rules migration #{number} complete', - values: { number }, - }); - -export const START_MIGRATION_CARD_RESULT_DESCRIPTION = (createdAt: string, finishedAt: string) => - i18n.translate('xpack.securitySolution.onboarding.startMigration.result.description', { - defaultMessage: 'Export uploaded on {createdAt} and translation finished {finishedAt}.', - values: { createdAt, finishedAt }, - }); - -export const VIEW_TRANSLATED_RULES_TITLE = i18n.translate( - 'xpack.securitySolution.onboarding.startMigration.result.translatedRules.title', - { defaultMessage: 'Translation Summary' } -); - -export const VIEW_TRANSLATED_RULES_BUTTON = i18n.translate( - 'xpack.securitySolution.onboarding.startMigration.result.translatedRules.button', - { defaultMessage: 'View translated rules' } -); diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/upload_rules_panels.tsx b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/upload_rules_panels.tsx deleted file mode 100644 index 6d011fc5fbb5b..0000000000000 --- a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/upload_rules_panels.tsx +++ /dev/null @@ -1,46 +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 from 'react'; -import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { SiemMigrationTaskStatus } from '../../../../../../../common/siem_migrations/constants'; -import type { RuleMigrationStats } from '../../../../../../siem_migrations/rules/types'; -import { UploadRulesPanel } from './panels/upload_rules_panel'; -import { MigrationProgressPanel } from './panels/migration_progress_panel'; -import { MigrationResultPanel } from './panels/migration_result_panel'; -import { MigrationReadyPanel } from './panels/migration_ready_panel'; - -export interface UploadRulesPanelsProps { - migrationsStats: RuleMigrationStats[]; -} -export const UploadRulesPanels = React.memo<UploadRulesPanelsProps>(({ migrationsStats }) => { - if (migrationsStats.length === 0) { - return <UploadRulesPanel />; - } - - return ( - <EuiFlexGroup direction="column" gutterSize="m"> - <EuiFlexItem grow={false}> - <UploadRulesPanel isUploadMore /> - </EuiFlexItem> - {migrationsStats.map((migrationStats) => ( - <EuiFlexItem grow={false} key={migrationStats.id}> - {migrationStats.status === SiemMigrationTaskStatus.READY && ( - <MigrationReadyPanel migrationStats={migrationStats} /> - )} - {migrationStats.status === SiemMigrationTaskStatus.RUNNING && ( - <MigrationProgressPanel migrationStats={migrationStats} /> - )} - {migrationStats.status === SiemMigrationTaskStatus.FINISHED && ( - <MigrationResultPanel migrationStats={migrationStats} /> - )} - </EuiFlexItem> - ))} - </EuiFlexGroup> - ); -}); -UploadRulesPanels.displayName = 'UploadRulesPanels'; diff --git a/x-pack/plugins/security_solution/public/onboarding/jest.config.js b/x-pack/plugins/security_solution/public/onboarding/jest.config.js deleted file mode 100644 index f5c05b19b495b..0000000000000 --- a/x-pack/plugins/security_solution/public/onboarding/jest.config.js +++ /dev/null @@ -1,19 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/onboarding'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/onboarding', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution/public/onboarding/**/*.{ts,tsx}', - ], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/one_discover/jest.config.js b/x-pack/plugins/security_solution/public/one_discover/jest.config.js deleted file mode 100644 index 7e4552f72e98f..0000000000000 --- a/x-pack/plugins/security_solution/public/one_discover/jest.config.js +++ /dev/null @@ -1,19 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/one_discover'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/one_discover', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution/public/one_discover/**/*.{ts,tsx}', - ], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/overview/jest.config.js b/x-pack/plugins/security_solution/public/overview/jest.config.js deleted file mode 100644 index 94874720385c3..0000000000000 --- a/x-pack/plugins/security_solution/public/overview/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/overview'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/overview', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/overview/**/*.{ts,tsx}'], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/resolver/jest.config.js b/x-pack/plugins/security_solution/public/resolver/jest.config.js deleted file mode 100644 index 641311b3c8cf2..0000000000000 --- a/x-pack/plugins/security_solution/public/resolver/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/resolver'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/resolver', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/resolver/**/*.{ts,tsx}'], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/security_integrations/jest.config.js b/x-pack/plugins/security_solution/public/security_integrations/jest.config.js deleted file mode 100644 index 030ad86fc80f1..0000000000000 --- a/x-pack/plugins/security_solution/public/security_integrations/jest.config.js +++ /dev/null @@ -1,19 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/security_integrations'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/security_integrations', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution/public/security_integrations/**/*.{ts,tsx}', - ], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/jest.config.js b/x-pack/plugins/security_solution/public/siem_migrations/jest.config.js deleted file mode 100644 index fd313059456a1..0000000000000 --- a/x-pack/plugins/security_solution/public/siem_migrations/jest.config.js +++ /dev/null @@ -1,19 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/siem_migrations'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/siem_migrations', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution/public/siem_migrations/**/*.{ts,tsx}', - ], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/sub_step_wrapper.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/sub_step_wrapper.tsx deleted file mode 100644 index fc0bd0e8c3b44..0000000000000 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/sub_step_wrapper.tsx +++ /dev/null @@ -1,26 +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 { EuiPanel } from '@elastic/eui'; -import { css } from '@emotion/css'; -import type { PropsWithChildren } from 'react'; -import React from 'react'; - -const style = css` - .euiStep__title { - font-size: 14px; - } -`; - -export const SubStepsWrapper = React.memo<PropsWithChildren<{}>>(({ children }) => { - return ( - <EuiPanel hasShadow={false} paddingSize="xs" className={style}> - {children} - </EuiPanel> - ); -}); -SubStepsWrapper.displayName = 'SubStepsWrapper'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/translations.ts deleted file mode 100644 index 71466a54dd138..0000000000000 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/translations.ts +++ /dev/null @@ -1,18 +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'; - -export const RULES_DATA_INPUT_COPY_TITLE = i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.macros.copyExportQuery.title', - { defaultMessage: 'Copy macros query' } -); - -export const RULES_DATA_INPUT_COPY_DESCRIPTION_SECTION = i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.macros.copyExportQuery.description.section', - { defaultMessage: 'Search and Reporting' } -); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/index.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/index.tsx deleted file mode 100644 index f2353e3f0276a..0000000000000 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/index.tsx +++ /dev/null @@ -1,94 +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, useMemo } from 'react'; -import type { EuiStepProps, EuiStepStatus } from '@elastic/eui'; -import { ResourceIdentifier } from '../../../../../../../../../common/siem_migrations/rules/resources'; -import { useUpsertResources } from '../../../../../../service/hooks/use_upsert_resources'; -import type { - RuleMigrationResourceData, - RuleMigrationTaskStats, -} from '../../../../../../../../../common/siem_migrations/model/rule_migration.gen'; -import type { OnResourcesCreated } from '../../../../types'; -import { MacrosFileUpload } from './macros_file_upload'; -import * as i18n from './translations'; - -export interface RulesFileUploadStepProps { - status: EuiStepStatus; - migrationStats: RuleMigrationTaskStats; - missingMacros: string[]; - onMacrosCreated: OnResourcesCreated; -} -export const useMacrosFileUploadStep = ({ - status, - migrationStats, - missingMacros, - onMacrosCreated, -}: RulesFileUploadStepProps): EuiStepProps => { - const { upsertResources, isLoading, error } = useUpsertResources(onMacrosCreated); - - const upsertMigrationResources = useCallback( - (macrosFromFile: RuleMigrationResourceData[]) => { - const macrosIndexed: Record<string, RuleMigrationResourceData> = Object.fromEntries( - macrosFromFile.map((macro) => [macro.name, macro]) - ); - const resourceIdentifier = new ResourceIdentifier('splunk'); - const macrosToUpsert: RuleMigrationResourceData[] = []; - let missingMacrosIt: string[] = missingMacros; - - while (missingMacrosIt.length > 0) { - const macros: RuleMigrationResourceData[] = []; - missingMacrosIt.forEach((macroName) => { - const macro = macrosIndexed[macroName]; - if (macro) { - macros.push(macro); - } else { - // Macro missing from file - } - }); - macrosToUpsert.push(...macros); - - missingMacrosIt = resourceIdentifier - .fromResources(macros) - .reduce<string[]>((acc, resource) => { - if (resource.type === 'macro') { - acc.push(resource.name); - } - return acc; - }, []); - } - - if (macrosToUpsert.length === 0) { - return; // No missing macros provided - } - upsertResources(migrationStats.id, macrosToUpsert); - }, - [upsertResources, migrationStats, missingMacros] - ); - - const uploadStepStatus = useMemo(() => { - if (isLoading) { - return 'loading'; - } - if (error) { - return 'danger'; - } - return status; - }, [isLoading, error, status]); - - return { - title: i18n.RULES_DATA_INPUT_FILE_UPLOAD_TITLE, - status: uploadStepStatus, - children: ( - <MacrosFileUpload - createResources={upsertMigrationResources} - isLoading={isLoading} - apiError={error?.message} - /> - ), - }; -}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/translations.ts deleted file mode 100644 index 25b64787d6dcd..0000000000000 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/translations.ts +++ /dev/null @@ -1,26 +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'; - -export const RULES_DATA_INPUT_FILE_UPLOAD_TITLE = i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.macros.macrosFileUpload.title', - { defaultMessage: 'Update your macros export' } -); -export const RULES_DATA_INPUT_FILE_UPLOAD_PROMPT = i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.macros.macrosFileUpload.prompt', - { defaultMessage: 'Select or drag and drop the exported JSON file' } -); - -export const RULES_DATA_INPUT_CREATE_MIGRATION_SUCCESS = i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.macros.macrosFileUpload.createSuccess', - { defaultMessage: 'Macros uploaded successfully' } -); -export const RULES_DATA_INPUT_CREATE_MIGRATION_ERROR = i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.macros.macrosFileUpload.createError', - { defaultMessage: 'Failed to upload macros file' } -); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/index.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/index.tsx deleted file mode 100644 index 3d2adcc78857b..0000000000000 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/index.tsx +++ /dev/null @@ -1,26 +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 from 'react'; -import type { EuiStepProps, EuiStepStatus } from '@elastic/eui'; -import { CopyExportQuery } from './copy_export_query'; -import * as i18n from './translations'; - -export interface CopyExportQueryStepProps { - status: EuiStepStatus; - onCopied: () => void; -} -export const useCopyExportQueryStep = ({ - status, - onCopied, -}: CopyExportQueryStepProps): EuiStepProps => { - return { - title: i18n.RULES_DATA_INPUT_COPY_TITLE, - status, - children: <CopyExportQuery onCopied={onCopied} />, - }; -}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/types.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/types.ts deleted file mode 100644 index b293a9394ba54..0000000000000 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/types.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 type { - RuleMigrationResourceData, - RuleMigrationTaskStats, -} from '../../../../../common/siem_migrations/model/rule_migration.gen'; - -export type OnMigrationCreated = (migrationStats: RuleMigrationTaskStats) => void; -export type OnResourcesCreated = () => void; -export type OnMissingResourcesFetched = (missingResources: RuleMigrationResourceData[]) => void; - -export enum DataInputStep { - Rules = 1, - Macros = 2, - Lookups = 3, - End = 10, -} diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/index.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/index.tsx deleted file mode 100644 index 4328e1b888dfd..0000000000000 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/index.tsx +++ /dev/null @@ -1,132 +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, { useMemo } from 'react'; -import { - EuiAccordion, - EuiBadge, - EuiFlexGroup, - EuiFlexItem, - EuiSpacer, - EuiSplitPanel, - EuiTitle, - useEuiTheme, -} from '@elastic/eui'; -import { css } from '@emotion/css'; -import { FormattedMessage } from '@kbn/i18n-react'; -import type { RuleResponse } from '../../../../../../../common/api/detection_engine'; -import type { RuleMigration } from '../../../../../../../common/siem_migrations/model/rule_migration.gen'; -import { TranslationTabHeader } from './header'; -import { MigrationRuleQuery } from './migration_rule_query'; -import * as i18n from './translations'; -import { - convertTranslationResultIntoColor, - convertTranslationResultIntoText, -} from '../../../../utils/helpers'; -import { TranslationCallOut } from './callout'; - -interface TranslationTabProps { - ruleMigration: RuleMigration; - matchedPrebuiltRule?: RuleResponse; - onTranslationUpdate?: (ruleName: string, ruleQuery: string) => Promise<void>; -} - -export const TranslationTab: React.FC<TranslationTabProps> = React.memo( - ({ ruleMigration, matchedPrebuiltRule, onTranslationUpdate }) => { - const { euiTheme } = useEuiTheme(); - - const isInstalled = !!ruleMigration.elastic_rule?.id; - const canEdit = !matchedPrebuiltRule && !isInstalled; - - const ruleName = matchedPrebuiltRule?.name ?? ruleMigration.elastic_rule?.title; - const originalQuery = ruleMigration.original_rule.query; - const elasticQuery = useMemo(() => { - let query = ruleMigration.elastic_rule?.query; - if (matchedPrebuiltRule && matchedPrebuiltRule.type !== 'machine_learning') { - query = matchedPrebuiltRule.query; - } - return query ?? ''; - }, [matchedPrebuiltRule, ruleMigration.elastic_rule?.query]); - - return ( - <> - <EuiSpacer size="m" /> - {ruleMigration.translation_result && !isInstalled && ( - <> - <TranslationCallOut translationResult={ruleMigration.translation_result} /> - <EuiSpacer size="m" /> - </> - )} - <EuiAccordion - id="translationQueryItem" - buttonContent={<TranslationTabHeader />} - initialIsOpen={true} - > - <EuiFlexItem> - <EuiSpacer size="s" /> - <EuiSplitPanel.Outer grow hasShadow={false} hasBorder={true}> - <EuiSplitPanel.Inner grow={false} color="subdued" paddingSize="s"> - <EuiFlexGroup justifyContent="flexEnd"> - <EuiFlexItem grow={false}> - <EuiTitle size="xxs"> - <h2> - <FormattedMessage - id="xpack.securitySolution.detectionEngine.translationDetails.translationTab.statusTitle" - defaultMessage="Translation status" - /> - </h2> - </EuiTitle> - </EuiFlexItem> - <EuiFlexItem grow={false}> - <EuiBadge - color={convertTranslationResultIntoColor(ruleMigration.translation_result)} - onClick={() => {}} - onClickAriaLabel={'Click to update translation status'} - > - {isInstalled - ? i18n.INSTALLED_LABEL - : convertTranslationResultIntoText(ruleMigration.translation_result)} - </EuiBadge> - </EuiFlexItem> - </EuiFlexGroup> - </EuiSplitPanel.Inner> - <EuiSplitPanel.Inner grow> - <EuiFlexGroup gutterSize="s" alignItems="flexStart"> - <EuiFlexItem grow={1}> - <MigrationRuleQuery - title={i18n.SPLUNK_QUERY_TITLE} - ruleName={ruleMigration.original_rule.title} - query={originalQuery} - canEdit={false} - /> - </EuiFlexItem> - <EuiFlexItem - grow={0} - css={css` - align-self: stretch; - border-right: ${euiTheme.border.thin}; - `} - /> - <EuiFlexItem grow={1}> - <MigrationRuleQuery - title={i18n.ESQL_TRANSLATION_TITLE} - ruleName={ruleName} - query={elasticQuery} - canEdit={canEdit} - onTranslationUpdate={onTranslationUpdate} - /> - </EuiFlexItem> - </EuiFlexGroup> - </EuiSplitPanel.Inner> - </EuiSplitPanel.Outer> - </EuiFlexItem> - </EuiAccordion> - </> - ); - } -); -TranslationTab.displayName = 'TranslationTab'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table/index.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table/index.tsx deleted file mode 100644 index 07ba44d4d167e..0000000000000 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table/index.tsx +++ /dev/null @@ -1,302 +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 type { CriteriaWithPagination, EuiTableSelectionType } from '@elastic/eui'; -import { - EuiSkeletonLoading, - EuiSkeletonTitle, - EuiSkeletonText, - EuiFlexGroup, - EuiFlexItem, - EuiSpacer, - EuiBasicTable, - EuiButton, -} from '@elastic/eui'; -import React, { useCallback, useMemo, useState } from 'react'; - -import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; -import type { RuleMigration } from '../../../../../common/siem_migrations/model/rule_migration.gen'; -import { EmptyMigration } from './empty_migration'; -import { useMigrationRulesTableColumns } from '../../hooks/use_migration_rules_table_columns'; -import { useMigrationRuleDetailsFlyout } from '../../hooks/use_migration_rule_preview_flyout'; -import { useInstallMigrationRules } from '../../logic/use_install_migration_rules'; -import { useGetMigrationRules } from '../../logic/use_get_migration_rules'; -import { useInstallTranslatedMigrationRules } from '../../logic/use_install_translated_migration_rules'; -import { useGetMigrationTranslationStats } from '../../logic/use_get_migration_translation_stats'; -import { useGetMigrationPrebuiltRules } from '../../logic/use_get_migration_prebuilt_rules'; -import * as logicI18n from '../../logic/translations'; -import { BulkActions } from './bulk_actions'; -import { SearchField } from './search_field'; -import { SiemMigrationRuleTranslationResult } from '../../../../../common/siem_migrations/constants'; -import * as i18n from './translations'; - -const DEFAULT_PAGE_SIZE = 10; -const DEFAULT_SORT_FIELD = 'translation_result'; -const DEFAULT_SORT_DIRECTION = 'desc'; - -export interface MigrationRulesTableProps { - /** - * Selected rule migration id - */ - migrationId: string; -} - -/** - * Table Component for displaying SIEM rules migrations - */ -export const MigrationRulesTable: React.FC<MigrationRulesTableProps> = React.memo( - ({ migrationId }) => { - const { addError } = useAppToasts(); - - const [pageIndex, setPageIndex] = useState(0); - const [pageSize, setPageSize] = useState(DEFAULT_PAGE_SIZE); - const [sortField, setSortField] = useState<keyof RuleMigration>(DEFAULT_SORT_FIELD); - const [sortDirection, setSortDirection] = useState<'asc' | 'desc'>(DEFAULT_SORT_DIRECTION); - const [searchTerm, setSearchTerm] = useState<string | undefined>(); - - const { data: translationStats, isLoading: isStatsLoading } = - useGetMigrationTranslationStats(migrationId); - - const { data: prebuiltRules = {}, isLoading: isPrebuiltRulesLoading } = - useGetMigrationPrebuiltRules(migrationId); - - const { - data: { ruleMigrations, total } = { ruleMigrations: [], total: 0 }, - isLoading: isDataLoading, - } = useGetMigrationRules({ - migrationId, - page: pageIndex, - perPage: pageSize, - sortField, - sortDirection, - searchTerm, - }); - - const [selectedRuleMigrations, setSelectedRuleMigrations] = useState<RuleMigration[]>([]); - const tableSelection: EuiTableSelectionType<RuleMigration> = useMemo( - () => ({ - selectable: (item: RuleMigration) => { - return ( - !item.elastic_rule?.id && - item.translation_result === SiemMigrationRuleTranslationResult.FULL - ); - }, - selectableMessage: (selectable: boolean, item: RuleMigration) => { - if (selectable) { - return ''; - } - return item.elastic_rule?.id - ? i18n.ALREADY_TRANSLATED_RULE_TOOLTIP - : i18n.NOT_FULLY_TRANSLATED_RULE_TOOLTIP; - }, - onSelectionChange: setSelectedRuleMigrations, - selected: selectedRuleMigrations, - }), - [selectedRuleMigrations] - ); - - const pagination = useMemo(() => { - return { - pageIndex, - pageSize, - totalItemCount: total, - }; - }, [pageIndex, pageSize, total]); - - const sorting = useMemo(() => { - return { - sort: { - field: sortField, - direction: sortDirection, - }, - }; - }, [sortDirection, sortField]); - - const onTableChange = useCallback(({ page, sort }: CriteriaWithPagination<RuleMigration>) => { - if (page) { - setPageIndex(page.index); - setPageSize(page.size); - } - if (sort) { - const { field, direction } = sort; - setSortField(field); - setSortDirection(direction); - } - }, []); - - const handleOnSearch = useCallback((value: string) => { - setSearchTerm(value.trim()); - }, []); - - const { mutateAsync: installMigrationRules } = useInstallMigrationRules(migrationId); - const { mutateAsync: installTranslatedMigrationRules } = - useInstallTranslatedMigrationRules(migrationId); - - const [isTableLoading, setTableLoading] = useState(false); - const installSingleRule = useCallback( - async (migrationRule: RuleMigration, enabled = false) => { - setTableLoading(true); - try { - await installMigrationRules({ ids: [migrationRule.id], enabled }); - } catch (error) { - addError(error, { title: logicI18n.INSTALL_MIGRATION_RULES_FAILURE }); - } finally { - setTableLoading(false); - } - }, - [addError, installMigrationRules] - ); - - const installSelectedRule = useCallback( - async (enabled = false) => { - setTableLoading(true); - try { - await installMigrationRules({ - ids: selectedRuleMigrations.map((rule) => rule.id), - enabled, - }); - } catch (error) { - addError(error, { title: logicI18n.INSTALL_MIGRATION_RULES_FAILURE }); - } finally { - setTableLoading(false); - setSelectedRuleMigrations([]); - } - }, - [addError, installMigrationRules, selectedRuleMigrations] - ); - - const installTranslatedRules = useCallback( - async (enable?: boolean) => { - setTableLoading(true); - try { - await installTranslatedMigrationRules(); - } catch (error) { - addError(error, { title: logicI18n.INSTALL_MIGRATION_RULES_FAILURE }); - } finally { - setTableLoading(false); - } - }, - [addError, installTranslatedMigrationRules] - ); - - const isLoading = isStatsLoading || isPrebuiltRulesLoading || isDataLoading || isTableLoading; - - const ruleActionsFactory = useCallback( - (ruleMigration: RuleMigration, closeRulePreview: () => void) => { - const canMigrationRuleBeInstalled = - !isLoading && - !ruleMigration.elastic_rule?.id && - ruleMigration.translation_result === SiemMigrationRuleTranslationResult.FULL; - return ( - <EuiFlexGroup> - <EuiFlexItem> - <EuiButton - disabled={!canMigrationRuleBeInstalled} - onClick={() => { - installSingleRule(ruleMigration); - closeRulePreview(); - }} - data-test-subj="installMigrationRuleFromFlyoutButton" - > - {i18n.INSTALL_WITHOUT_ENABLING_BUTTON_LABEL} - </EuiButton> - </EuiFlexItem> - <EuiFlexItem> - <EuiButton - disabled={!canMigrationRuleBeInstalled} - onClick={() => { - installSingleRule(ruleMigration, true); - closeRulePreview(); - }} - fill - data-test-subj="installAndEnableMigrationRuleFromFlyoutButton" - > - {i18n.INSTALL_AND_ENABLE_BUTTON_LABEL} - </EuiButton> - </EuiFlexItem> - </EuiFlexGroup> - ); - }, - [installSingleRule, isLoading] - ); - - const getMigrationRule = useCallback( - (ruleId: string) => { - if (!isLoading && ruleMigrations.length) { - return ruleMigrations.find((item) => item.id === ruleId); - } - }, - [isLoading, ruleMigrations] - ); - - const { - migrationRuleDetailsFlyout: rulePreviewFlyout, - openMigrationRuleDetails: openRulePreview, - } = useMigrationRuleDetailsFlyout({ - isLoading, - prebuiltRules, - getMigrationRule, - ruleActionsFactory, - }); - - const rulesColumns = useMigrationRulesTableColumns({ - disableActions: isTableLoading, - openMigrationRuleDetails: openRulePreview, - installMigrationRule: installSingleRule, - }); - - return ( - <> - <EuiSkeletonLoading - isLoading={isDataLoading} - loadingContent={ - <> - <EuiSkeletonTitle /> - <EuiSkeletonText /> - </> - } - loadedContent={ - !translationStats?.rules.total ? ( - <EmptyMigration /> - ) : ( - <> - <EuiFlexGroup gutterSize="m" justifyContent="flexEnd" wrap> - <EuiFlexItem> - <SearchField initialValue={searchTerm} onSearch={handleOnSearch} /> - </EuiFlexItem> - <EuiFlexItem grow={false}> - <BulkActions - isTableLoading={isLoading} - numberOfTranslatedRules={translationStats?.rules.installable ?? 0} - numberOfSelectedRules={selectedRuleMigrations.length} - installTranslatedRule={installTranslatedRules} - installSelectedRule={installSelectedRule} - /> - </EuiFlexItem> - </EuiFlexGroup> - <EuiSpacer size="m" /> - <EuiBasicTable<RuleMigration> - loading={isTableLoading} - items={ruleMigrations} - pagination={pagination} - sorting={sorting} - onChange={onTableChange} - selection={tableSelection} - itemId={'id'} - data-test-subj={'rules-translation-table'} - columns={rulesColumns} - /> - </> - ) - } - /> - {rulePreviewFlyout} - </> - ); - } -); -MigrationRulesTable.displayName = 'MigrationRulesTable'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/status_badge/index.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/status_badge/index.tsx deleted file mode 100644 index f1f435c7e14ad..0000000000000 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/status_badge/index.tsx +++ /dev/null @@ -1,83 +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 from 'react'; -import { euiLightVars } from '@kbn/ui-theme'; - -import { EuiFlexGroup, EuiFlexItem, EuiHealth, EuiIcon, EuiToolTip } from '@elastic/eui'; -import { css } from '@emotion/css'; -import { - RuleMigrationStatusEnum, - type RuleMigration, - type RuleMigrationTranslationResult, -} from '../../../../../common/siem_migrations/model/rule_migration.gen'; -import { convertTranslationResultIntoText } from '../../utils/helpers'; -import * as i18n from './translations'; - -const statusTextWrapperClassName = css` - width: 100%; - display: inline-grid; -`; - -const { euiColorVis0, euiColorVis7, euiColorVis9 } = euiLightVars; -const statusToColorMap: Record<RuleMigrationTranslationResult, string> = { - full: euiColorVis0, - partial: euiColorVis7, - untranslatable: euiColorVis9, -}; - -interface StatusBadgeProps { - migrationRule: RuleMigration; - 'data-test-subj'?: string; -} - -export const StatusBadge: React.FC<StatusBadgeProps> = React.memo( - ({ migrationRule, 'data-test-subj': dataTestSubj = 'translation-result' }) => { - // Installed - if (migrationRule.elastic_rule?.id) { - return ( - <EuiToolTip content={i18n.RULE_STATUS_INSTALLED}> - <EuiFlexGroup gutterSize="xs" alignItems="center"> - <EuiFlexItem grow={false}> - <EuiIcon type="check" color={statusToColorMap.full} /> - </EuiFlexItem> - <EuiFlexItem grow={false}>{i18n.RULE_STATUS_INSTALLED}</EuiFlexItem> - </EuiFlexGroup> - </EuiToolTip> - ); - } - - // Failed - if (migrationRule.status === RuleMigrationStatusEnum.failed) { - return ( - <EuiToolTip content={i18n.RULE_STATUS_FAILED}> - <EuiFlexGroup gutterSize="xs" alignItems="center"> - <EuiFlexItem grow={false}> - <EuiIcon type="warningFilled" color="danger" /> - </EuiFlexItem> - <EuiFlexItem grow={false}>{i18n.RULE_STATUS_FAILED}</EuiFlexItem> - </EuiFlexGroup> - </EuiToolTip> - ); - } - - const translationResult = migrationRule.translation_result ?? 'untranslatable'; - const displayValue = convertTranslationResultIntoText(translationResult); - const color = statusToColorMap[translationResult]; - - return ( - <EuiToolTip content={displayValue}> - <EuiHealth color={color} data-test-subj={dataTestSubj}> - <div className={statusTextWrapperClassName}> - <span className="eui-textTruncate">{displayValue}</span> - </div> - </EuiHealth> - </EuiToolTip> - ); - } -); -StatusBadge.displayName = 'StatusBadge'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/utils/helpers.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/utils/helpers.tsx deleted file mode 100644 index fe3fbf9945077..0000000000000 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/utils/helpers.tsx +++ /dev/null @@ -1,44 +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 { - RuleMigrationTranslationResultEnum, - type RuleMigrationTranslationResult, -} from '../../../../common/siem_migrations/model/rule_migration.gen'; -import * as i18n from './translations'; - -export const convertTranslationResultIntoColor = (status?: RuleMigrationTranslationResult) => { - switch (status) { - case RuleMigrationTranslationResultEnum.full: - return 'primary'; - - case RuleMigrationTranslationResultEnum.partial: - return 'warning'; - - case RuleMigrationTranslationResultEnum.untranslatable: - return 'danger'; - - default: - throw new Error(i18n.SIEM_TRANSLATION_RESULT_UNKNOWN_ERROR(status)); - } -}; - -export const convertTranslationResultIntoText = (status?: RuleMigrationTranslationResult) => { - switch (status) { - case RuleMigrationTranslationResultEnum.full: - return i18n.SIEM_TRANSLATION_RESULT_FULL_LABEL; - - case RuleMigrationTranslationResultEnum.partial: - return i18n.SIEM_TRANSLATION_RESULT_PARTIAL_LABEL; - - case RuleMigrationTranslationResultEnum.untranslatable: - return i18n.SIEM_TRANSLATION_RESULT_UNTRANSLATABLE_LABEL; - - default: - throw new Error(i18n.SIEM_TRANSLATION_RESULT_UNKNOWN_ERROR(status)); - } -}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/utils/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/utils/translations.ts deleted file mode 100644 index 03f76cb833818..0000000000000 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/utils/translations.ts +++ /dev/null @@ -1,46 +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'; - -export const SIEM_TRANSLATION_RESULT_FULL_LABEL = i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.translationResult.full', - { - defaultMessage: 'Translated', - } -); - -export const SIEM_TRANSLATION_RESULT_PARTIAL_LABEL = i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.translationResult.partially', - { - defaultMessage: 'Partially translated', - } -); - -export const SIEM_TRANSLATION_RESULT_UNTRANSLATABLE_LABEL = i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.translationResult.untranslatable', - { - defaultMessage: 'Not translated', - } -); - -export const SIEM_TRANSLATION_RESULT_UNKNOWN_LABEL = i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.translationResult.unknown', - { - defaultMessage: 'Unknown', - } -); - -export const SIEM_TRANSLATION_RESULT_UNKNOWN_ERROR = (status?: string) => { - return i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.translationResult.unknownError', - { - defaultMessage: 'Unknown translation result status: ({status})', - values: { status }, - } - ); -}; diff --git a/x-pack/plugins/security_solution/public/sourcerer/jest.config.js b/x-pack/plugins/security_solution/public/sourcerer/jest.config.js deleted file mode 100644 index 2967d36235b29..0000000000000 --- a/x-pack/plugins/security_solution/public/sourcerer/jest.config.js +++ /dev/null @@ -1,19 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/sourcerer'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/sourcerer', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution/public/sourcerer/**/*.{ts,tsx}', - ], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/translations.ts b/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/translations.ts deleted file mode 100644 index e97da8b29c65e..0000000000000 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/translations.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 { i18n } from '@kbn/i18n'; - -export const GET_TIMELINE_DISCOVER_SAVED_SEARCH_TITLE = (title: string) => - i18n.translate('xpack.securitySolution.timelines.discoverInTimeline.savedSearchTitle', { - defaultMessage: 'Saved search for timeline - {title}', - values: { title }, - }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/query/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/query/index.test.tsx deleted file mode 100644 index cfd8f86af9dac..0000000000000 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/query/index.test.tsx +++ /dev/null @@ -1,1327 +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 type { ComponentProps, FunctionComponent } from 'react'; -import React, { useEffect } from 'react'; -import QueryTabContent from '.'; -import { defaultRowRenderers } from '../../body/renderers'; -import { TimelineId } from '../../../../../../common/types/timeline'; -import { useTimelineEvents } from '../../../../containers'; -import { useTimelineEventsDetails } from '../../../../containers/details'; -import { useSourcererDataView } from '../../../../../sourcerer/containers'; -import { mockSourcererScope } from '../../../../../sourcerer/containers/mocks'; -import { - createMockStore, - createSecuritySolutionStorageMock, - mockGlobalState, - mockTimelineData, - TestProviders, -} from '../../../../../common/mock'; -import { DefaultCellRenderer } from '../../cell_rendering/default_cell_renderer'; -import { render, screen, waitFor, fireEvent, within, cleanup } from '@testing-library/react'; -import { createStartServicesMock } from '../../../../../common/lib/kibana/kibana_react.mock'; -import type { StartServices } from '../../../../../types'; -import { useKibana } from '../../../../../common/lib/kibana'; -import { useDispatch } from 'react-redux'; -import type { ExperimentalFeatures } from '../../../../../../common'; -import { allowedExperimentalValues } from '../../../../../../common'; -import { useIsExperimentalFeatureEnabled } from '../../../../../common/hooks/use_experimental_features'; -import { - defaultUdtHeaders, - defaultColumnHeaderType, -} from '../../body/column_headers/default_headers'; -import { useUserPrivileges } from '../../../../../common/components/user_privileges'; -import { getEndpointPrivilegesInitialStateMock } from '../../../../../common/components/user_privileges/endpoint/mocks'; -import * as timelineActions from '../../../../store/actions'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { createExpandableFlyoutApiMock } from '../../../../../common/mock/expandable_flyout'; -import { OPEN_FLYOUT_BUTTON_TEST_ID } from '../../../../../notes/components/test_ids'; -import { userEvent } from '@testing-library/user-event'; -import * as notesApi from '../../../../../notes/api/api'; - -jest.mock('../../../../../common/components/user_privileges'); - -jest.mock('../../../../containers', () => ({ - useTimelineEvents: jest.fn(), -})); - -jest.mock('../../../../containers/details'); - -jest.mock('../../../fields_browser', () => ({ - useFieldBrowserOptions: jest.fn(), -})); - -jest.mock('../../../../../sourcerer/containers'); -jest.mock('../../../../../sourcerer/containers/use_signal_helpers', () => ({ - useSignalHelpers: () => ({ signalIndexNeedsInit: false }), -})); - -jest.mock('../../../../../common/lib/kuery'); - -jest.mock('../../../../../common/hooks/use_experimental_features'); - -jest.mock('react-router-dom', () => ({ - ...jest.requireActual('react-router-dom'), - useLocation: jest.fn(() => ({ - pathname: '', - search: '', - })), -})); - -// These tests can take more than standard timeout of 5s -// that is why we are increasing it. -const SPECIAL_TEST_TIMEOUT = 50000; - -const useIsExperimentalFeatureEnabledMock = jest.fn((feature: keyof ExperimentalFeatures) => { - return allowedExperimentalValues[feature]; -}); - -jest.mock('../../../../../common/lib/kibana'); - -// unified-field-list is reporting multiple analytics events -jest.mock(`@elastic/ebt/client`); - -const mockOpenFlyout = jest.fn(); -const mockCloseFlyout = jest.fn(); -jest.mock('@kbn/expandable-flyout'); - -const TestComponent = (props: Partial<ComponentProps<typeof QueryTabContent>>) => { - const testComponentDefaultProps: ComponentProps<typeof QueryTabContent> = { - timelineId: TimelineId.test, - renderCellValue: DefaultCellRenderer, - rowRenderers: defaultRowRenderers, - }; - - const dispatch = useDispatch(); - - useEffect(() => { - // Unified field list can be a culprit for long load times, so we wait for the timeline to be interacted with to load - dispatch(timelineActions.showTimeline({ id: TimelineId.test, show: true })); - - // populating timeline so that it is not blank - dispatch( - timelineActions.applyKqlFilterQuery({ - id: TimelineId.test, - filterQuery: { - kuery: { - kind: 'kuery', - expression: '*', - }, - serializedQuery: '*', - }, - }) - ); - }, [dispatch]); - - return <QueryTabContent {...testComponentDefaultProps} {...props} />; -}; - -const customColumnOrder = [ - ...defaultUdtHeaders, - { - columnHeaderType: defaultColumnHeaderType, - id: 'event.severity', - }, -]; - -const mockState = { - ...structuredClone(mockGlobalState), -}; - -mockState.timeline.timelineById[TimelineId.test].columns = customColumnOrder; - -const TestWrapper: FunctionComponent<React.PropsWithChildren<{}>> = ({ children }) => { - return <TestProviders store={createMockStore(mockState)}>{children}</TestProviders>; -}; - -const renderTestComponents = (props?: Partial<ComponentProps<typeof TestComponent>>) => { - return render(<TestComponent {...props} />, { - wrapper: TestWrapper, - }); -}; - -const loadPageMock = jest.fn(); - -const useSourcererDataViewMocked = jest.fn().mockReturnValue({ - ...mockSourcererScope, -}); - -const { storage: storageMock } = createSecuritySolutionStorageMock(); - -let useTimelineEventsMock = jest.fn(); - -describe('query tab with unified timeline', () => { - const fetchNotesMock = jest.spyOn(notesApi, 'fetchNotesByDocumentIds'); - beforeAll(() => { - fetchNotesMock.mockImplementation(jest.fn()); - jest.mocked(useExpandableFlyoutApi).mockImplementation(() => ({ - ...createExpandableFlyoutApiMock(), - openFlyout: mockOpenFlyout, - closeFlyout: mockCloseFlyout, - })); - - // https://github.com/atlassian/react-beautiful-dnd/blob/4721a518356f72f1dac45b5fd4ee9d466aa2996b/docs/guides/setup-problem-detection-and-error-recovery.md#disable-logging - Object.defineProperty(window, '__@hello-pangea/dnd-disable-dev-warnings', { - get() { - return true; - }, - }); - }); - const kibanaServiceMock: StartServices = { - ...createStartServicesMock(), - storage: storageMock, - }; - - afterEach(() => { - jest.clearAllMocks(); - storageMock.clear(); - fetchNotesMock.mockClear(); - cleanup(); - localStorage.clear(); - }); - - beforeEach(() => { - useTimelineEventsMock = jest.fn(() => [ - false, - { - events: structuredClone(mockTimelineData.slice(0, 1)), - pageInfo: { - activePage: 0, - totalPages: 3, - }, - refreshedAt: Date.now(), - totalCount: 3, - loadPage: loadPageMock, - }, - ]); - - HTMLElement.prototype.getBoundingClientRect = jest.fn(() => { - return { - width: 1000, - height: 1000, - x: 0, - y: 0, - } as DOMRect; - }); - - (useKibana as jest.Mock).mockImplementation(() => { - return { - services: kibanaServiceMock, - }; - }); - - (useTimelineEvents as jest.Mock).mockImplementation(useTimelineEventsMock); - - (useTimelineEventsDetails as jest.Mock).mockImplementation(() => [false, {}]); - - (useSourcererDataView as jest.Mock).mockImplementation(useSourcererDataViewMocked); - - (useIsExperimentalFeatureEnabled as jest.Mock).mockImplementation( - useIsExperimentalFeatureEnabledMock - ); - - (useUserPrivileges as jest.Mock).mockReturnValue({ - kibanaSecuritySolutionsPrivileges: { crud: true, read: true }, - endpointPrivileges: getEndpointPrivilegesInitialStateMock(), - detectionEnginePrivileges: { loading: false, error: undefined, result: undefined }, - }); - }); - - describe('render', () => { - it( - 'should render unifiedDataTable in timeline', - async () => { - renderTestComponents(); - await waitFor(() => { - expect(screen.getByTestId('discoverDocTable')).toBeVisible(); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - - it( - 'should render unified-field-list in timeline', - async () => { - renderTestComponents(); - await waitFor(() => { - expect(screen.getByTestId('timeline-sidebar')).toBeVisible(); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - it( - 'should show row-renderers correctly by default', - async () => { - renderTestComponents(); - await waitFor(() => { - expect(screen.getByTestId('discoverDocTable')).toBeVisible(); - }); - - expect(screen.getByTestId('timeline-row-renderer-0')).toBeVisible(); - }, - - SPECIAL_TEST_TIMEOUT - ); - - it( - 'should hide row-renderers when disabled', - async () => { - renderTestComponents(); - await waitFor(() => { - expect(screen.getByTestId('discoverDocTable')).toBeVisible(); - }); - - expect(screen.getByTestId('timeline-row-renderer-0')).toBeVisible(); - - fireEvent.click(screen.getByTestId('show-row-renderers-gear')); - expect(screen.getByTestId('row-renderers-modal')).toBeVisible(); - - fireEvent.click(screen.getByTestId('disable-all')); - - expect( - within(screen.getAllByTestId('renderer-checkbox')[0]).getByRole('checkbox') - ).not.toBeChecked(); - - fireEvent.click(screen.getByLabelText('Closes this modal window')); - - expect(screen.queryByTestId('row-renderers-modal')).not.toBeInTheDocument(); - - expect(screen.queryByTestId('timeline-row-renderer-0')).not.toBeInTheDocument(); - }, - SPECIAL_TEST_TIMEOUT - ); - }); - - describe('pagination', () => { - beforeEach(() => { - // pagination tests need more than 1 record so here - // we return 5 records instead of just 1. - useTimelineEventsMock = jest.fn(() => [ - false, - { - events: structuredClone(mockTimelineData.slice(0, 5)), - pageInfo: { - activePage: 0, - totalPages: 5, - }, - refreshedAt: Date.now(), - /* - * `totalCount` could be any number w.r.t this test - * and actually means total hits on elastic search - * and not the fecthed number of records. - * - * This helps in testing `sampleSize` and `loadMore` - */ - totalCount: 50, - loadPage: loadPageMock, - }, - ]); - - (useTimelineEvents as jest.Mock).mockImplementation(useTimelineEventsMock); - }); - - afterEach(() => { - jest.clearAllMocks(); - }); - - it( - 'should paginate correctly', - async () => { - const mockStateWithNoteInTimeline = { - ...mockGlobalState, - timeline: { - ...mockGlobalState.timeline, - timelineById: { - [TimelineId.test]: { - ...mockGlobalState.timeline.timelineById[TimelineId.test], - /* 1 record for each page */ - itemsPerPage: 1, - itemsPerPageOptions: [1, 2, 3, 4, 5], - savedObjectId: 'timeline-1', // match timelineId in mocked notes data - pinnedEventIds: { '1': true }, - }, - }, - }, - }; - - render( - <TestProviders - store={createMockStore({ - ...structuredClone(mockStateWithNoteInTimeline), - })} - > - <TestComponent /> - </TestProviders> - ); - - expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); - expect(screen.getByTestId('pagination-button-previous')).toBeVisible(); - - expect(screen.getByTestId('tablePaginationPopoverButton')).toHaveTextContent( - 'Rows per page: 1' - ); - - expect(screen.getByTestId('pagination-button-0')).toHaveAttribute('aria-current', 'true'); - expect(screen.getByTestId('pagination-button-4')).toBeVisible(); - expect(screen.queryByTestId('pagination-button-5')).toBeNull(); - - fireEvent.click(screen.getByTestId('pagination-button-4')); - - await waitFor(() => { - expect(screen.getByTestId('pagination-button-4')).toHaveAttribute('aria-current', 'true'); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - - it( - 'should load more records according to sample size correctly', - async () => { - const mockStateWithNoteInTimeline = { - ...mockGlobalState, - timeline: { - ...mockGlobalState.timeline, - timelineById: { - [TimelineId.test]: { - ...mockGlobalState.timeline.timelineById[TimelineId.test], - itemsPerPage: 1, - /* - * `sampleSize` is the max number of records that are fetched from elasticsearch - * in one request. If hits > sampleSize, you can fetch more records ( <= sampleSize) - */ - sampleSize: 5, - itemsPerPageOptions: [1, 2, 3, 4, 5], - savedObjectId: 'timeline-1', // match timelineId in mocked notes data - pinnedEventIds: { '1': true }, - }, - }, - }, - }; - - render( - <TestProviders - store={createMockStore({ - ...structuredClone(mockStateWithNoteInTimeline), - })} - > - <TestComponent /> - </TestProviders> - ); - - expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); - - await waitFor(() => { - expect(screen.getByTestId('pagination-button-0')).toHaveAttribute('aria-current', 'true'); - expect(screen.getByTestId('pagination-button-4')).toBeVisible(); - }); - // Go to last page - fireEvent.click(screen.getByTestId('pagination-button-4')); - await waitFor(() => { - expect(screen.getByTestId('dscGridSampleSizeFetchMoreLink')).toBeVisible(); - }); - fireEvent.click(screen.getByTestId('dscGridSampleSizeFetchMoreLink')); - expect(loadPageMock).toHaveBeenNthCalledWith(1, 1); - }, - SPECIAL_TEST_TIMEOUT - ); - - it( - 'should load notes for current page only', - async () => { - const mockStateWithNoteInTimeline = { - ...mockGlobalState, - timeline: { - ...mockGlobalState.timeline, - timelineById: { - [TimelineId.test]: { - ...mockGlobalState.timeline.timelineById[TimelineId.test], - /* 1 record for each page */ - itemsPerPage: 1, - pageIndex: 0, - itemsPerPageOptions: [1, 2, 3, 4, 5], - savedObjectId: 'timeline-1', // match timelineId in mocked notes data - pinnedEventIds: { '1': true }, - }, - }, - }, - }; - - render( - <TestProviders - store={createMockStore({ - ...structuredClone(mockStateWithNoteInTimeline), - })} - > - <TestComponent /> - </TestProviders> - ); - - expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); - - expect(screen.getByTestId('pagination-button-previous')).toBeVisible(); - - expect(screen.getByTestId('pagination-button-0')).toHaveAttribute('aria-current', 'true'); - expect(fetchNotesMock).toHaveBeenCalledWith(['1']); - - // Page : 2 - - fetchNotesMock.mockClear(); - expect(screen.getByTestId('pagination-button-1')).toBeVisible(); - - fireEvent.click(screen.getByTestId('pagination-button-1')); - - await waitFor(() => { - expect(screen.getByTestId('pagination-button-1')).toHaveAttribute('aria-current', 'true'); - - expect(fetchNotesMock).toHaveBeenNthCalledWith(1, [mockTimelineData[1]._id]); - }); - - // Page : 3 - - fetchNotesMock.mockClear(); - expect(screen.getByTestId('pagination-button-2')).toBeVisible(); - fireEvent.click(screen.getByTestId('pagination-button-2')); - - await waitFor(() => { - expect(screen.getByTestId('pagination-button-2')).toHaveAttribute('aria-current', 'true'); - - expect(fetchNotesMock).toHaveBeenNthCalledWith(1, [mockTimelineData[2]._id]); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - - it( - 'should load notes for correct page size', - async () => { - const mockStateWithNoteInTimeline = { - ...mockGlobalState, - timeline: { - ...mockGlobalState.timeline, - timelineById: { - [TimelineId.test]: { - ...mockGlobalState.timeline.timelineById[TimelineId.test], - /* 1 record for each page */ - itemsPerPage: 1, - pageIndex: 0, - itemsPerPageOptions: [1, 2, 3, 4, 5], - savedObjectId: 'timeline-1', // match timelineId in mocked notes data - pinnedEventIds: { '1': true }, - }, - }, - }, - }; - - render( - <TestProviders - store={createMockStore({ - ...structuredClone(mockStateWithNoteInTimeline), - })} - > - <TestComponent /> - </TestProviders> - ); - - expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); - - expect(screen.getByTestId('pagination-button-previous')).toBeVisible(); - - expect(screen.getByTestId('pagination-button-0')).toHaveAttribute('aria-current', 'true'); - expect(screen.getByTestId('tablePaginationPopoverButton')).toHaveTextContent( - 'Rows per page: 1' - ); - fireEvent.click(screen.getByTestId('tablePaginationPopoverButton')); - - await waitFor(() => { - expect(screen.getByTestId('tablePagination-2-rows')).toBeVisible(); - }); - - fetchNotesMock.mockClear(); - fireEvent.click(screen.getByTestId('tablePagination-2-rows')); - - await waitFor(() => { - expect(fetchNotesMock).toHaveBeenNthCalledWith(1, [ - mockTimelineData[0]._id, - mockTimelineData[1]._id, - ]); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - }); - - describe('columns', () => { - it( - 'should move column left/right correctly ', - async () => { - const { container } = renderTestComponents(); - - await waitFor(() => { - expect(screen.getByTestId('discoverDocTable')).toBeVisible(); - }); - - const messageColumnIndex = - customColumnOrder.findIndex((header) => header.id === 'message') + 3; - // 3 is the offset for additional leading columns on left - - expect(container.querySelector('[data-gridcell-column-id="message"]')).toHaveAttribute( - 'data-gridcell-column-index', - String(messageColumnIndex) - ); - - expect(container.querySelector('[data-gridcell-column-id="message"]')).toBeInTheDocument(); - - fireEvent.click(screen.getByTestId('dataGridHeaderCellActionButton-message')); - - await waitFor(() => { - expect(screen.getByTitle('Move left')).toBeEnabled(); - }); - - fireEvent.click(screen.getByTitle('Move left')); - - await waitFor(() => { - expect(container.querySelector('[data-gridcell-column-id="message"]')).toHaveAttribute( - 'data-gridcell-column-index', - String(messageColumnIndex - 1) - ); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - - it( - 'should remove column', - async () => { - const { container } = renderTestComponents(); - - await waitFor(() => { - expect(screen.getByTestId('discoverDocTable')).toBeVisible(); - }); - - expect(container.querySelector('[data-gridcell-column-id="message"]')).toBeInTheDocument(); - - fireEvent.click(screen.getByTestId('dataGridHeaderCellActionButton-message')); - - await waitFor(() => { - expect(screen.getByTitle('Remove column')).toBeVisible(); - }); - - fireEvent.click(screen.getByTitle('Remove column')); - - await waitFor(() => { - expect( - container.querySelector('[data-gridcell-column-id="message"]') - ).not.toBeInTheDocument(); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - - it( - 'should sort date column', - async () => { - const { container } = renderTestComponents(); - await waitFor(() => { - expect(screen.getByTestId('discoverDocTable')).toBeVisible(); - }); - - expect( - container.querySelector('[data-gridcell-column-id="@timestamp"]') - ).toBeInTheDocument(); - - fireEvent.click(screen.getByTestId('dataGridHeaderCellActionButton-@timestamp')); - - await waitFor(() => { - expect(screen.getByTitle('Sort Old-New')).toBeVisible(); - }); - expect(screen.getByTitle('Unsort New-Old')).toBeVisible(); - - useTimelineEventsMock.mockClear(); - - fireEvent.click(screen.getByTitle('Sort Old-New')); - - await waitFor(() => { - expect(useTimelineEventsMock).toHaveBeenNthCalledWith( - 1, - expect.objectContaining({ - sort: [ - { - direction: 'asc', - esTypes: ['date'], - field: '@timestamp', - type: 'date', - }, - ], - }) - ); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - - it( - 'should sort string column correctly', - async () => { - const { container } = renderTestComponents(); - await waitFor(() => { - expect(screen.getByTestId('discoverDocTable')).toBeVisible(); - }); - - expect( - container.querySelector('[data-gridcell-column-id="host.name"]') - ).toBeInTheDocument(); - - fireEvent.click(screen.getByTestId('dataGridHeaderCellActionButton-host.name')); - - await waitFor(() => { - expect(screen.getByTestId('dataGridHeaderCellActionGroup-host.name')).toBeVisible(); - }); - - expect(screen.getByTitle('Sort A-Z')).toBeVisible(); - expect(screen.getByTitle('Sort Z-A')).toBeVisible(); - - useTimelineEventsMock.mockClear(); - - fireEvent.click(screen.getByTitle('Sort A-Z')); - - await waitFor(() => { - expect(useTimelineEventsMock).toHaveBeenNthCalledWith( - 1, - expect.objectContaining({ - sort: [ - { - direction: 'desc', - esTypes: ['date'], - field: '@timestamp', - type: 'date', - }, - { - direction: 'asc', - esTypes: [], - field: 'host.name', - type: 'string', - }, - ], - }) - ); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - - it( - 'should sort number column', - async () => { - const field = { - name: 'event.severity', - type: 'number', - }; - - const { container } = renderTestComponents(); - await waitFor(() => { - expect(screen.getByTestId('discoverDocTable')).toBeVisible(); - }); - - expect( - container.querySelector(`[data-gridcell-column-id="${field.name}"]`) - ).toBeInTheDocument(); - - fireEvent.click(screen.getByTestId(`dataGridHeaderCellActionButton-${field.name}`)); - - await waitFor(() => { - expect(screen.getByTestId(`dataGridHeaderCellActionGroup-${field.name}`)).toBeVisible(); - }); - - expect(screen.getByTitle('Sort Low-High')).toBeVisible(); - expect(screen.getByTitle('Sort High-Low')).toBeVisible(); - - useTimelineEventsMock.mockClear(); - - fireEvent.click(screen.getByTitle('Sort Low-High')); - - await waitFor(() => { - expect(useTimelineEventsMock).toHaveBeenNthCalledWith( - 1, - expect.objectContaining({ - sort: [ - { - direction: 'desc', - esTypes: ['date'], - field: '@timestamp', - type: 'date', - }, - { - direction: 'asc', - esTypes: [], - field: field.name, - type: field.type, - }, - ], - }) - ); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - }); - - describe('left controls', () => { - it( - 'should clear all sorting', - async () => { - renderTestComponents(); - expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); - - expect(screen.getByTestId('dataGridColumnSortingButton')).toBeVisible(); - expect( - within(screen.getByTestId('dataGridColumnSortingButton')).getByRole('marquee') - ).toHaveTextContent('1'); - - fireEvent.click(screen.getByTestId('dataGridColumnSortingButton')); - - // // timestamp sorting indicators - expect( - await screen.findByTestId('euiDataGridColumnSorting-sortColumn-@timestamp') - ).toBeInTheDocument(); - - expect(screen.getByTestId('dataGridHeaderCellSortingIcon-@timestamp')).toBeInTheDocument(); - - fireEvent.click(screen.getByTestId('dataGridColumnSortingClearButton')); - - await waitFor(() => { - expect(screen.queryByTestId('dataGridHeaderCellSortingIcon-@timestamp')).toBeNull(); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - - it( - 'should be able to sort by multiple columns', - async () => { - renderTestComponents(); - expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); - - expect(screen.getByTestId('dataGridColumnSortingButton')).toBeVisible(); - expect( - within(screen.getByTestId('dataGridColumnSortingButton')).getByRole('marquee') - ).toHaveTextContent('1'); - - fireEvent.click(screen.getByTestId('dataGridColumnSortingButton')); - - // // timestamp sorting indicators - expect( - await screen.findByTestId('euiDataGridColumnSorting-sortColumn-@timestamp') - ).toBeInTheDocument(); - - expect(screen.getByTestId('dataGridHeaderCellSortingIcon-@timestamp')).toBeInTheDocument(); - - // add more columns to sorting - fireEvent.click(screen.getByText(/Pick fields to sort by/)); - - await waitFor(() => { - expect( - screen.getByTestId('dataGridColumnSortingPopoverColumnSelection-event.severity') - ).toBeInTheDocument(); - }); - - fireEvent.click( - screen.getByTestId('dataGridColumnSortingPopoverColumnSelection-event.severity') - ); - - // check new columns for sorting validity - await waitFor(() => { - expect( - screen.getByTestId('dataGridHeaderCellSortingIcon-event.severity') - ).toBeInTheDocument(); - }); - expect( - screen.getByTestId('euiDataGridColumnSorting-sortColumn-event.severity') - ).toBeInTheDocument(); - - expect(screen.getByTestId('dataGridHeaderCellSortingIcon-@timestamp')).toBeInTheDocument(); - }, - SPECIAL_TEST_TIMEOUT - ); - }); - - describe('unified fields list', () => { - it( - 'should remove the column when clicked on X sign', - async () => { - const field = { - name: 'event.severity', - }; - - renderTestComponents(); - expect(await screen.findByTestId('timeline-sidebar')).toBeVisible(); - - await waitFor(() => { - expect(screen.getByTestId('fieldListGroupedSelectedFields-count')).toHaveTextContent( - String(customColumnOrder.length) - ); - }); - - // column exists in the table - expect(screen.getByTestId(`dataGridHeaderCell-${field.name}`)).toBeVisible(); - - fireEvent.click(screen.getAllByTestId(`fieldToggle-${field.name}`)[0]); - - // column not longer exists in the table - await waitFor(() => { - expect(screen.getByTestId('fieldListGroupedSelectedFields-count')).toHaveTextContent( - String(customColumnOrder.length - 1) - ); - }); - expect(screen.queryAllByTestId(`dataGridHeaderCell-${field.name}`)).toHaveLength(0); - }, - SPECIAL_TEST_TIMEOUT - ); - - it( - 'should add the column when clicked on ⊕ sign', - async () => { - const field = { - name: 'agent.id', - }; - - renderTestComponents(); - expect(await screen.findByTestId('timeline-sidebar')).toBeVisible(); - - await waitFor(() => { - expect(screen.getByTestId('fieldListGroupedSelectedFields-count')).toHaveTextContent( - String(customColumnOrder.length) - ); - }); - - expect(screen.queryAllByTestId(`dataGridHeaderCell-${field.name}`)).toHaveLength(0); - - // column exists in the table - const availableFields = screen.getByTestId('fieldListGroupedAvailableFields'); - - fireEvent.click(within(availableFields).getByTestId(`fieldToggle-${field.name}`)); - - await waitFor(() => { - expect(screen.getByTestId('fieldListGroupedSelectedFields-count')).toHaveTextContent( - String(customColumnOrder.length + 1) - ); - }); - expect(screen.queryAllByTestId(`dataGridHeaderCell-${field.name}`)).toHaveLength(1); - }, - SPECIAL_TEST_TIMEOUT - ); - - it( - 'should should show callout when field search does not matches any field', - async () => { - renderTestComponents(); - expect(await screen.findByTestId('timeline-sidebar')).toBeVisible(); - - await waitFor(() => { - expect(screen.getByTestId('fieldListGroupedAvailableFields-count')).toHaveTextContent( - '37' - ); - }); - - fireEvent.change(screen.getByTestId('fieldListFiltersFieldSearch'), { - target: { value: 'fake_field' }, - }); - - await waitFor(() => { - expect( - screen.getByTestId('fieldListGroupedAvailableFieldsNoFieldsCallout-noFieldsMatch') - ).toBeVisible(); - }); - - expect(screen.getByTestId('fieldListGroupedAvailableFields-count')).toHaveTextContent('0'); - }, - SPECIAL_TEST_TIMEOUT - ); - - it( - 'should toggle side bar correctly', - async () => { - renderTestComponents(); - expect(await screen.findByTestId('timeline-sidebar')).toBeVisible(); - - expect(screen.getByTestId('fieldListGroupedFieldGroups')).toBeVisible(); - - fireEvent.click(screen.getByTitle('Hide sidebar')); - - await waitFor(() => { - expect(screen.queryByTestId('fieldListGroupedFieldGroups')).not.toBeInTheDocument(); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - }); - - describe('Leading actions - expand event', () => { - it( - 'should expand and collapse event correctly', - async () => { - renderTestComponents(); - expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); - - expect(screen.getByTestId('docTableExpandToggleColumn').firstChild).toHaveAttribute( - 'data-euiicon-type', - 'expand' - ); - - // Open Flyout - fireEvent.click(screen.getByTestId('docTableExpandToggleColumn')); - - await waitFor(() => { - expect(mockOpenFlyout).toHaveBeenNthCalledWith(1, { - right: { - id: 'document-details-right', - params: { - id: '1', - indexName: '', - scopeId: TimelineId.test, - }, - }, - }); - }); - - expect(screen.getByTestId('docTableExpandToggleColumn').firstChild).toHaveAttribute( - 'data-euiicon-type', - 'minimize' - ); - - // Close Flyout - fireEvent.click(screen.getByTestId('docTableExpandToggleColumn')); - - await waitFor(() => { - expect(mockCloseFlyout).toHaveBeenNthCalledWith(1); - expect(screen.getByTestId('docTableExpandToggleColumn').firstChild).toHaveAttribute( - 'data-euiicon-type', - 'expand' - ); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - }); - - describe('Leading actions - notes', () => { - describe('securitySolutionNotesDisabled = false', () => { - beforeEach(() => { - (useIsExperimentalFeatureEnabled as jest.Mock).mockImplementation( - jest.fn((feature: keyof ExperimentalFeatures) => { - if (feature === 'securitySolutionNotesDisabled') { - return false; - } - return allowedExperimentalValues[feature]; - }) - ); - }); - - // Flaky: https://github.com/elastic/kibana/issues/189794 - it.skip( - 'should have the notification dot & correct tooltip', - async () => { - renderTestComponents(); - expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); - - expect(screen.getAllByTestId('timeline-notes-button-small')).toHaveLength(1); - expect(screen.getByTestId('timeline-notes-button-small')).not.toBeDisabled(); - - expect(screen.getByTestId('timeline-notes-notification-dot')).toBeVisible(); - - userEvent.hover(screen.getByTestId('timeline-notes-button-small')); - - await waitFor(() => { - expect(screen.getByTestId('timeline-notes-tool-tip')).toBeInTheDocument(); - expect(screen.getByTestId('timeline-notes-tool-tip')).toHaveTextContent( - '1 Note available. Click to view it & add more.' - ); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - it( - 'should be able to add notes through expandable flyout', - async () => { - renderTestComponents(); - expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); - - await waitFor(() => { - expect(screen.getByTestId('timeline-notes-button-small')).not.toBeDisabled(); - }); - - fireEvent.click(screen.getByTestId('timeline-notes-button-small')); - - await waitFor(() => { - expect(mockOpenFlyout).toHaveBeenCalled(); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - }); - - describe('securitySolutionNotesDisabled = true', () => { - beforeEach(() => { - (useIsExperimentalFeatureEnabled as jest.Mock).mockImplementation( - jest.fn((feature: keyof ExperimentalFeatures) => { - if (feature === 'securitySolutionNotesDisabled') { - return true; - } - return allowedExperimentalValues[feature]; - }) - ); - }); - - // Flaky: https://github.com/elastic/kibana/issues/189794 - it.skip( - 'should have the notification dot & correct tooltip', - async () => { - renderTestComponents(); - expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); - - expect(screen.getAllByTestId('timeline-notes-button-small')).toHaveLength(1); - expect(screen.getByTestId('timeline-notes-button-small')).not.toBeDisabled(); - - expect(screen.getByTestId('timeline-notes-notification-dot')).toBeVisible(); - - fireEvent.mouseOver(screen.getByTestId('timeline-notes-button-small')); - - await waitFor(() => { - expect(screen.getByTestId('timeline-notes-tool-tip')).toBeVisible(); - expect(screen.getByTestId('timeline-notes-tool-tip')).toHaveTextContent( - '1 Note available. Click to view it & add more.' - ); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - it( - 'should be able to add notes using EuiFlyout', - async () => { - renderTestComponents(); - expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); - - await waitFor(() => { - expect(screen.getByTestId('timeline-notes-button-small')).not.toBeDisabled(); - }); - - fireEvent.click(screen.getByTestId('timeline-notes-button-small')); - - await waitFor(() => { - expect(screen.getByTestId('add-note-container')).toBeVisible(); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - - it( - 'should cancel adding notes', - async () => { - renderTestComponents(); - expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); - - await waitFor(() => { - expect(screen.getByTestId('timeline-notes-button-small')).not.toBeDisabled(); - }); - - fireEvent.click(screen.getByTestId('timeline-notes-button-small')); - - await waitFor(() => { - expect(screen.getByTestId('add-note-container')).toBeVisible(); - }); - - expect(screen.getByTestId('cancel')).not.toBeDisabled(); - - fireEvent.click(screen.getByTestId('cancel')); - - await waitFor(() => { - expect(screen.queryByTestId('add-note-container')).not.toBeInTheDocument(); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - - it( - 'should be able to delete notes', - async () => { - renderTestComponents(); - expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); - - await waitFor(() => { - expect(screen.getByTestId('timeline-notes-button-small')).not.toBeDisabled(); - }); - - fireEvent.click(screen.getByTestId('timeline-notes-button-small')); - - await waitFor(() => { - expect(screen.getByTestId('delete-note')).toBeVisible(); - }); - - const noteDeleteSpy = jest.spyOn(timelineActions, 'setConfirmingNoteId'); - - fireEvent.click(screen.getByTestId('delete-note')); - - await waitFor(() => { - expect(noteDeleteSpy).toHaveBeenCalled(); - expect(noteDeleteSpy).toHaveBeenCalledWith({ - confirmingNoteId: '1', - id: TimelineId.test, - }); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - - it( - 'should not show toggle event details action', - async () => { - renderTestComponents(); - expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); - - await waitFor(() => { - expect(screen.getByTestId('timeline-notes-button-small')).not.toBeDisabled(); - }); - - fireEvent.click(screen.getByTestId('timeline-notes-button-small')); - - await waitFor(() => { - expect(screen.queryByTestId(OPEN_FLYOUT_BUTTON_TEST_ID)).not.toBeInTheDocument(); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - }); - }); - - describe('Leading actions - pin', () => { - describe('securitySolutionNotesDisabled = false', () => { - beforeEach(() => { - (useIsExperimentalFeatureEnabled as jest.Mock).mockImplementation( - jest.fn((feature: keyof ExperimentalFeatures) => { - if (feature === 'securitySolutionNotesDisabled') { - return false; - } - return allowedExperimentalValues[feature]; - }) - ); - }); - it( - 'should disable pinning when event has notes attached in timeline', - async () => { - const mockStateWithNoteInTimeline = { - ...mockGlobalState, - timeline: { - ...mockGlobalState.timeline, - timelineById: { - [TimelineId.test]: { - ...mockGlobalState.timeline.timelineById[TimelineId.test], - savedObjectId: 'timeline-1', // match timelineId in mocked notes data - pinnedEventIds: { '1': true }, - }, - }, - }, - }; - - render( - <TestProviders - store={createMockStore({ - ...structuredClone(mockStateWithNoteInTimeline), - })} - > - <TestComponent /> - </TestProviders> - ); - - expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); - - expect(screen.getAllByTestId('pin')).toHaveLength(1); - // disabled because it is already pinned - expect(screen.getByTestId('pin')).toBeDisabled(); - - fireEvent.mouseOver(screen.getByTestId('pin')); - - await waitFor(() => { - expect(screen.getByTestId('timeline-action-pin-tool-tip')).toBeVisible(); - expect(screen.getByTestId('timeline-action-pin-tool-tip')).toHaveTextContent( - 'This event cannot be unpinned because it has notes in Timeline' - ); - /* - * Above event is alert and not an event but `getEventType` in - *x-pack/plugins/security_solution/public/timelines/components/timeline/body/helpers.tsx - * returns it has event and not an alert even though, it has event.kind as signal. - * Need to see if it is okay - * - * */ - }); - }, - SPECIAL_TEST_TIMEOUT - ); - - it( - 'should allow pinning when event has notes but notes are not attached in current timeline', - async () => { - renderTestComponents(); - expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); - - expect(screen.getAllByTestId('pin')).toHaveLength(1); - expect(screen.getByTestId('pin')).not.toBeDisabled(); - - fireEvent.mouseOver(screen.getByTestId('pin')); - await waitFor(() => { - expect(screen.getByTestId('timeline-action-pin-tool-tip')).toBeVisible(); - expect(screen.getByTestId('timeline-action-pin-tool-tip')).toHaveTextContent( - 'Pin event' - ); - }); - }, - SPECIAL_TEST_TIMEOUT - ); - }); - - describe('securitySolutionNotesDisabled = true', () => { - beforeEach(() => { - (useIsExperimentalFeatureEnabled as jest.Mock).mockImplementation( - jest.fn((feature: keyof ExperimentalFeatures) => { - if (feature === 'securitySolutionNotesDisabled') { - return true; - } - return allowedExperimentalValues[feature]; - }) - ); - }); - - it( - 'should have the pin button with correct tooltip', - async () => { - renderTestComponents(); - - expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); - - expect(screen.getAllByTestId('pin')).toHaveLength(1); - // disabled because it is already pinned - expect(screen.getByTestId('pin')).toBeDisabled(); - - fireEvent.mouseOver(screen.getByTestId('pin')); - - await waitFor(() => { - expect(screen.getByTestId('timeline-action-pin-tool-tip')).toBeVisible(); - expect(screen.getByTestId('timeline-action-pin-tool-tip')).toHaveTextContent( - 'This event cannot be unpinned because it has notes' - ); - /* - * Above event is alert and not an event but `getEventType` in - * x-pack/plugins/security_solution/public/timelines/components/timeline/body/helpers.tsx - * returns it has event and not an alert even though, it has event.kind as signal. - * Need to see if it is okay - * - * */ - }); - }, - SPECIAL_TEST_TIMEOUT - ); - }); - }); -}); diff --git a/x-pack/plugins/security_solution/public/timelines/jest.config.js b/x-pack/plugins/security_solution/public/timelines/jest.config.js deleted file mode 100644 index e2d6858969393..0000000000000 --- a/x-pack/plugins/security_solution/public/timelines/jest.config.js +++ /dev/null @@ -1,19 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/public/timelines'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/timelines', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution/public/timelines/**/*.{ts,tsx}', - ], - moduleNameMapper: require('../../server/__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/scripts/endpoint/README.md b/x-pack/plugins/security_solution/scripts/endpoint/README.md deleted file mode 100644 index 2827ab065504b..0000000000000 --- a/x-pack/plugins/security_solution/scripts/endpoint/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# Resolver Generator Script - -This script makes it easy to create the endpoint metadata, alert, and event documents needed to test Resolver in Kibana. -The default behavior is to create 1 endpoint with 1 alert and a moderate number of events (random, typically on the order of 20). -A seed value can be provided as a string for the random number generator for repeatable behavior, useful for demos etc. -Use the `-d` option if you want to delete and remake the indices, otherwise it will add documents to existing indices. - -Example command sequence to get ES and kibana running with sample data after installing ts-node: - -`yarn es snapshot` -> starts ES - -`npx yarn start --no-base-path` -> starts kibana. Note: you may need other configurations steps to start the security solution with endpoint support. - -`cd x-pack/plugins/security_solution/scripts/endpoint` - -`yarn test:generate` -> run the resolver_generator.ts script - -To see Resolver generator CLI options, run `yarn test:generate --help`. diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/README.md b/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/README.md deleted file mode 100644 index 48e1da2ef442f..0000000000000 --- a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# API Emulator - -API Emulator is a framework wrapped around [Hapi](https://hapi.dev/) that enables developer to quickly create API interfaces for development and testing purposes. Emulator plugins (a wrapper around [Hapi plugins](https://hapi.dev/api/?v=21.3.3#plugins)) is the mechanism used to create an given set of APIs for emulation, and these are then added to the server framework which makes them available via the server's routes. - -The following script can be used to start the External EDR Server Emulator from the command line: - -```shell -node x-pack/plugins/security_solution/scripts/endpoint/start_external_edr_server_emulator.js -``` - -Use the `--help` option to view what arguments can be used - -For usages other than the command line, see the Development section below. - - - -## Development - -### Adding an new Plugin - -Plugins are the mechanism for adding API emulators into this framework. Each plugin is defined via an object that includes at a minimum the `name` and a `register()` callback. This callback for registering the plugin will be provided with an interface that allows the plugin to interact with the HTTP server and provide access to "core" services available at the server level for use by all plugins. - -Example: A method that returns the definition for a plugin - -```typescript - -export const getFooPluginRegistration = () => { - return { - name: 'foo', // [1] - register(server) { - // register routes - server.router.route({ - path: '/api/get', // [2] - method: 'GET', - handler: async (req, h) => { - return 'alive!'; - } - }) - } - } -} -``` - -In the above example: - -1. a plugin with the name `foo` [1] will be registered. The name of the plugin will also be the default `prefix` to all API routes (an optional attributed named `prefix` is also available if wanting to use a different value for the namespacing the routes). -2. the `register()` callback will be given a `server` argument that provides access to server level services like the HTTP `router` -3. a new route is registered [2], which will be mounted at `/foo/api/get` - note the use of the plugin name as the route prefix - - -#### Plugin HTTP routes - -HTTP route handlers work very similar to the route handlers in Kibana today. You are given a `Request` and a Response Factory by the Hapi framework - see the [HAPI docs on Lifecycle Methods](https://hapi.dev/api/?v=21.3.3#lifecycle-methods) for more details. - -This emulator framework will expose the core services (ex. for the EDR server emulator, this would include Kibana and Elasticsearch clients) to each route under `request.pre` (pre-handler methods). - -Example: a route handler under the EDR server emulator that returns the version of kibana - -```typescript - -const handler = async (req, h) => { - const kbnStatus = await req.pre.services.kbnClient.status.get(); - - return kbnStatus.version.number; -} - -``` diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/response_actions.ts b/x-pack/plugins/security_solution/scripts/endpoint/common/response_actions.ts deleted file mode 100644 index 1987a019f8887..0000000000000 --- a/x-pack/plugins/security_solution/scripts/endpoint/common/response_actions.ts +++ /dev/null @@ -1,385 +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. - */ - -/* eslint-disable complexity */ - -import type { Client } from '@elastic/elasticsearch'; -import type { SearchHit } from '@elastic/elasticsearch/lib/api/types'; -import { basename } from 'path'; -import { encode } from '@kbn/cbor'; -import { AGENT_ACTIONS_INDEX, AGENT_ACTIONS_RESULTS_INDEX } from '@kbn/fleet-plugin/common'; -import { FleetActionGenerator } from '../../../common/endpoint/data_generators/fleet_action_generator'; -import { EndpointActionGenerator } from '../../../common/endpoint/data_generators/endpoint_action_generator'; -import type { - ActionDetails, - EndpointAction, - EndpointActionData, - EndpointActionResponse, - FileUploadMetadata, - GetProcessesActionOutputContent, - LogsEndpointActionResponse, - ResponseActionExecuteOutputContent, - ResponseActionGetFileOutputContent, - ResponseActionGetFileParameters, - EndpointActionResponseDataOutput, - ResponseActionScanOutputContent, -} from '../../../common/endpoint/types'; -import { getFileDownloadId } from '../../../common/endpoint/service/response_actions/get_file_download_id'; -import { - ENDPOINT_ACTION_RESPONSES_INDEX, - FILE_STORAGE_DATA_INDEX, - FILE_STORAGE_METADATA_INDEX, -} from '../../../common/endpoint/constants'; -import { sendEndpointMetadataUpdate } from './endpoint_metadata_services'; -import { checkInFleetAgent } from './fleet_services'; -import { generateFileMetadataDocumentMock } from '../../../server/endpoint/services/actions/mocks'; - -const ES_INDEX_OPTIONS = { headers: { 'X-elastic-product-origin': 'fleet' } }; -export const fleetActionGenerator = new FleetActionGenerator(); -export const endpointActionGenerator = new EndpointActionGenerator(); -export const sleep = (ms: number = 1000) => new Promise((r) => setTimeout(r, ms)); - -export const sendFleetActionResponse = async ( - esClient: Client, - action: ActionDetails, - { state }: { state?: 'success' | 'failure' } = {} -): Promise<EndpointActionResponse> => { - let fleetResponse: EndpointActionResponse; - - for (const agentId of action.agents) { - fleetResponse = fleetActionGenerator.generateResponse({ - action_id: action.id, - agent_id: agentId, - action_response: { endpoint: { ack: true } }, - }); - - // 20% of the time we generate an error - if (state === 'failure' || (!state && fleetActionGenerator.randomFloat() < 0.2)) { - fleetResponse.action_response = {}; - fleetResponse.error = 'Agent failed to deliver message to endpoint due to unknown error'; - } else { - // show it as success (generator currently always generates a `error`, so delete it) - delete fleetResponse.error; - } - - await esClient.index( - { - index: AGENT_ACTIONS_RESULTS_INDEX, - body: fleetResponse, - refresh: 'wait_for', - }, - ES_INDEX_OPTIONS - ); - } - - // @ts-expect-error - return fleetResponse; -}; -export const sendEndpointActionResponse = async ( - esClient: Client, - action: ActionDetails, - { state }: { state?: 'success' | 'failure' } = {} -): Promise<LogsEndpointActionResponse> => { - let endpointResponse: LogsEndpointActionResponse; - - for (const actionAgentId of action.agents) { - endpointResponse = endpointActionGenerator.generateResponse<EndpointActionResponseDataOutput>({ - agent: { id: actionAgentId }, - EndpointActions: { - action_id: action.id, - data: { - command: action.command as EndpointActionData['command'], - comment: '', - ...getOutputDataIfNeeded(action), - }, - started_at: action.startedAt, - }, - }); - - // 20% of the time we generate an error - if ( - state === 'failure' || - (state !== 'success' && endpointActionGenerator.randomFloat() < 0.2) - ) { - endpointResponse.error = { - message: 'Endpoint encountered an error and was unable to apply action to host', - }; - - if ( - endpointResponse.EndpointActions.data.command === 'get-file' && - endpointResponse.EndpointActions.data.output - ) { - ( - endpointResponse.EndpointActions.data.output - .content as unknown as ResponseActionGetFileOutputContent - ).code = endpointActionGenerator.randomGetFileFailureCode(); - } - - if ( - endpointResponse.EndpointActions.data.command === 'scan' && - endpointResponse.EndpointActions.data.output - ) { - ( - endpointResponse.EndpointActions.data.output - .content as unknown as ResponseActionScanOutputContent - ).code = endpointActionGenerator.randomScanFailureCode(); - } - - if ( - endpointResponse.EndpointActions.data.command === 'execute' && - endpointResponse.EndpointActions.data.output - ) { - ( - endpointResponse.EndpointActions.data.output - .content as unknown as ResponseActionExecuteOutputContent - ).stderr = 'execute command timed out'; - } - } - - await esClient.index({ - index: ENDPOINT_ACTION_RESPONSES_INDEX, - body: endpointResponse, - refresh: 'wait_for', - }); - - // ------------------------------------------ - // Post Action Response tasks - // ------------------------------------------ - - // For isolate, If the response is not an error, then also send a metadata update - if (action.command === 'isolate' && !endpointResponse.error) { - await Promise.all([ - sendEndpointMetadataUpdate(esClient, actionAgentId, { - Endpoint: { state: { isolation: true } }, - }), - - checkInFleetAgent(esClient, actionAgentId), - ]); - } - - // For UnIsolate, if response is not an Error, then also send metadata update - if (action.command === 'unisolate' && !endpointResponse.error) { - await Promise.all([ - sendEndpointMetadataUpdate(esClient, actionAgentId, { - Endpoint: { state: { isolation: false } }, - }), - - checkInFleetAgent(esClient, actionAgentId), - ]); - } - - // For `get-file`, upload a file to ES - if ( - (action.command === 'execute' || action.command === 'get-file') && - !endpointResponse.error - ) { - const filePath = - action.command === 'execute' - ? '/execute/file/path' - : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - ( - action as unknown as ActionDetails< - ResponseActionGetFileOutputContent, - ResponseActionGetFileParameters - > - )?.parameters?.path!; - - const fileName = basename(filePath.replace(/\\/g, '/')); - const fileMetaDoc: FileUploadMetadata = generateFileMetadataDocumentMock({ - action_id: action.id, - agent_id: actionAgentId, - upload_start: Date.now(), - contents: [ - { - sha256: '8d61673c9d782297b3c774ded4e3d88f31a8869a8f25cf5cdd402ba6822d1d28', - file_name: fileName ?? 'bad_file.txt', - path: filePath, - size: 4, - type: 'file', - }, - ], - file: { - attributes: ['archive', 'compressed'], - ChunkSize: 4194304, - compression: 'deflate', - hash: { - sha256: '8d61673c9d782297b3c774ded4e3d88f31a8869a8f25cf5cdd402ba6822d1d28', - }, - mime_type: 'application/zip', - name: action.command === 'execute' ? 'full-output.zip' : 'upload.zip', - extension: 'zip', - size: 125, - Status: 'READY', - type: 'file', - }, - src: 'endpoint', - }); - - // Index the file's metadata - const fileMeta = await esClient.index({ - index: FILE_STORAGE_METADATA_INDEX, - id: getFileDownloadId(action, actionAgentId), - op_type: 'create', - refresh: 'wait_for', - body: fileMetaDoc, - }); - - // Index the file content (just one chunk) - // call to `.index()` copied from File plugin here: - // https://github.com/elastic/kibana/blob/main/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts#L195 - await esClient - .index( - { - index: FILE_STORAGE_DATA_INDEX, - id: `${fileMeta._id}.0`, - document: encode({ - bid: fileMeta._id, - last: true, - '@timestamp': new Date().toISOString(), - data: Buffer.from( - 'UEsDBAoACQAAAFZeRFWpAsDLHwAAABMAAAAMABwAYmFkX2ZpbGUudHh0VVQJAANTVjxjU1Y8Y3V4CwABBPUBAAAEFAAAAMOcoyEq/Q4VyG02U9O0LRbGlwP/y5SOCfRKqLz1rsBQSwcIqQLAyx8AAAATAAAAUEsBAh4DCgAJAAAAVl5EVakCwMsfAAAAEwAAAAwAGAAAAAAAAQAAAKSBAAAAAGJhZF9maWxlLnR4dFVUBQADU1Y8Y3V4CwABBPUBAAAEFAAAAFBLBQYAAAAAAQABAFIAAAB1AAAAAAA=', - 'base64' - ), - }), - refresh: 'wait_for', - op_type: 'create', - }, - { - headers: { - 'content-type': 'application/cbor', - accept: 'application/json', - }, - } - ) - .then(() => sleep(2000)); - } - } - - // @ts-expect-error - return endpointResponse as unknown as LogsEndpointActionResponse; -}; - -type ResponseOutput< - TOutputContent extends EndpointActionResponseDataOutput = EndpointActionResponseDataOutput -> = Pick<LogsEndpointActionResponse<TOutputContent>['EndpointActions']['data'], 'output'>; - -const getOutputDataIfNeeded = (action: ActionDetails): ResponseOutput => { - const commentUppercase = (action?.comment ?? '').toUpperCase(); - - switch (action.command) { - case 'running-processes': - return { - output: { - type: 'json', - content: { - entries: endpointActionGenerator.randomResponseActionProcesses(100), - }, - }, - } as unknown as ResponseOutput<GetProcessesActionOutputContent>; - - case 'get-file': - return { - output: { - type: 'json', - content: { - code: 'ra_get-file_success_done', - zip_size: 123, - contents: [ - { - type: 'file', - path: ( - action as unknown as ActionDetails< - ResponseActionGetFileOutputContent, - ResponseActionGetFileParameters - > - ).parameters?.path, - size: 1234, - file_name: 'bad_file.txt', - sha256: '9558c5cb39622e9b3653203e772b129d6c634e7dbd7af1b244352fc1d704601f', - }, - ], - }, - }, - } as unknown as ResponseOutput<ResponseActionGetFileOutputContent>; - - case 'execute': - const executeOutput: Partial<ResponseActionExecuteOutputContent> = { - output_file_id: getFileDownloadId(action, action.agents[0]), - }; - - // Error? - if (commentUppercase.indexOf('EXECUTE:FAILURE') > -1) { - executeOutput.stdout = ''; - executeOutput.stdout_truncated = false; - executeOutput.output_file_stdout_truncated = false; - } else { - executeOutput.stderr = ''; - executeOutput.stderr_truncated = false; - executeOutput.output_file_stderr_truncated = false; - } - - return { - output: endpointActionGenerator.generateExecuteActionResponseOutput({ - content: executeOutput, - }), - } as unknown as ResponseOutput<ResponseActionExecuteOutputContent>; - - default: - return { output: undefined }; - } -}; - -export async function getLatestActionDoc( - esClient: Client -): Promise<SearchHit<EndpointAction> | undefined> { - return ( - await esClient.search<EndpointAction>({ - index: AGENT_ACTIONS_INDEX, - ignore_unavailable: true, - query: { - match: { - type: 'INPUT_ACTION', - }, - }, - sort: { - '@timestamp': { - order: 'desc', - }, - }, - size: 1, - }) - ).hits.hits.at(0); -} - -export async function waitForNewActionDoc( - esClient: Client, - previousActionDoc?: SearchHit<EndpointAction>, - options: { - maxAttempts: number; - interval: number; - } = { maxAttempts: 3, interval: 10000 } -): Promise<SearchHit<EndpointAction> | undefined> { - const { maxAttempts, interval } = options; - let attempts = 1; - let latestDoc = await getLatestActionDoc(esClient); - while ((!latestDoc || latestDoc._id === previousActionDoc?._id) && attempts <= maxAttempts) { - await new Promise((res) => setTimeout(res, interval)); - latestDoc = await getLatestActionDoc(esClient); - attempts++; - } - - return latestDoc; -} - -export function updateActionDoc<T = unknown>(esClient: Client, id: string, doc: T) { - return esClient.update({ - index: AGENT_ACTIONS_INDEX, - id, - doc, - refresh: 'wait_for', - }); -} diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/README.md b/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/README.md deleted file mode 100644 index d2e519a0aab68..0000000000000 --- a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# Security Solution Serverless Resources - -Directory contains ES serverless resources that can be used to override the defaults that are loaded when ES is started in serverless mode. For more information on how these are used [packages/kbn-es/src/serverless_resources/README.md](https://github.com/elastic/kibana/blob/main/packages/kbn-es/src/serverless_resources/README.md) - -> **ℹ️ NOTE** -> -> The files referenced via `--resources` argument will be bound and mounted to the ES docker containers that are running ES. This means that any changes to the files done on the host machine will be automatically (after a delay - 5s by default) picked up by Elasticsearch and applied to the ES docker nodes. - -## Usage - -Example executed from the root directory of Kibana: - -```shell -yarn es serverless \ ---clean \ ---kill \ --E xpack.security.authc.api_key.enabled=true \ --E http.host=0.0.0.0 \ ---resources=./x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/roles.yml \ ---resources=./x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/users \ ---resources=./x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/users_roles -``` - -> **💡️TIP** -> -> If needing to make custom changes to any of the ES resources for personal dev. purposes, copy the files located in this folder to your own local directly, make changes there and then use those file paths when starting ES - - - -## Files - -### `roles.yml` - -The list of Roles that are loaded into security serverless projects. The values in this file should match those in the [project controller](https://github.com/elastic/project-controller/blob/main/internal/project/security/config/roles.yml) and should remain in sync. - -### `users` - -List of users that are loaded into ES for serverless. This file currently includes a user for each of the Security Project roles (same name as the role). All users in this file have their password set to `changeme` - -Format: `user:encrypted_password` - -### `users_roles` - -A map of role names (should match those define in the `roles.yml`) to list of users (values found in the `users` file). All Security serverless roles are listed in this file along with one user by the same name. - -Format: `role_name:username,username,username` - diff --git a/x-pack/plugins/security_solution/scripts/jest.config.js b/x-pack/plugins/security_solution/scripts/jest.config.js deleted file mode 100644 index dba0d6bc5bade..0000000000000 --- a/x-pack/plugins/security_solution/scripts/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/scripts'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/scripts', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/scripts/**/*.{ts,tsx}'], -}; diff --git a/x-pack/plugins/security_solution/scripts/mappings/README.md b/x-pack/plugins/security_solution/scripts/mappings/README.md deleted file mode 100644 index 4c612c5efb13f..0000000000000 --- a/x-pack/plugins/security_solution/scripts/mappings/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# Huge Indices with Unmapped Fields Generator/Loader Scripts - -This script makes it easy to generate and load big amount of indices with huge amount of fields. -It is also easy to specify what portion of those fields should be unmapped across various indices. -The purpose of this scripts is to be able to test `_field_caps` APIs which we use to fetch fields, -especially with `include_unmapped` options set. - -There are two different scripts: -1. `mappings_generator.js` which generates indices -2. `mappings_loader.js` which loads all generated indices to ES - -## Examples. - -### Generate 1k indices (split into 10 buckets with 100 indices each) with 10k fields (with 20% randomly unmapped fields within each index) - -> `node mappings_generator.js --fieldsCount=10000 --indexCount=1000 --indexPrefix='.ds-huge' --unmappedRate=.2 --buckets=10 --outputDirectory='test_unmapped'` - -The result of this operation will be 10 separate bucket folders within `test_unmapped`. Each bucket folder will contain a `mappings.json` file describing 100 indices. - -Available attributes: -* `--fieldsCount` (*required*): the number of fields in generated index -* `--indexCount` (*required*): the number of indices to be generated -* `--indexPrefix` (*required*): the prefix for the generated indices -* `--unmappedRate` (*required*): the percentage of unmapped fields in each index (value ranges from 0.0 to 1.0) -* `--buckets` (*optional, default value is 1*): it is possible to split the generated indices mappings into the smaller chunks -* `--outputDirectory` (*required*): the output folder -* `--purgeOutputDirectory` (*optional, default value is false*): the flag indicating whether we should purge output folder before generating new mappings - -### Load all generated buckets generated via previous command - -> `node mappings_loader.js --mappings-dir='test_unmapped' --es-url=http://elastic:changeme@localhost:9200 --kibana-url=http://elastic:changeme@localhost:5601/kbn/app` - - -This script will go through each folder in the provided root folder (via `--mappings-dir`) and load each folder with mappings inside using `es_archiver` tool. - - -**NOTE:** The path to `es_archiver` is adjusted for the call of this script using `x-pack/plugins/security_solution/package.json`. If you call this script directly, you will need to adjust it accordingly. diff --git a/x-pack/plugins/security_solution/scripts/quickstart/README.md b/x-pack/plugins/security_solution/scripts/quickstart/README.md deleted file mode 100644 index 997762a82a27d..0000000000000 --- a/x-pack/plugins/security_solution/scripts/quickstart/README.md +++ /dev/null @@ -1,136 +0,0 @@ -# Quickstart for Developers - -These tools make it fast and easy to create detection rules, exceptions, value lists, and source data for testing. - -## Usage - -`node x-pack/plugins/security_solution/scripts/quickstart/run.js`: Runs the script defined in `scratchpad.ts` -Options: ---username: User name to be used for auth against elasticsearch and kibana (Default: elastic). ---password: User name Password (Default: changeme) ---kibana: The url to Kibana (Default: http://127.0.0.1:5601). In most cases you'll want to set this URL to include the basepath as well. ---apikey: The API key for authentication, overrides username/password - use for serverless projects - -`scratchpad.ts` already contains code to set up clients for Elasticsearch and Kibana. In addition it provides clients for Security Solution, Lists, and Exceptions APIs, built on top of the Kibana client. However, it does not create any rules/exceptions/lists/data - it's a blank slate for you to immediately begin creating the resources you want for testing. Please don't commit data-generating code to `scratchpad.ts`! Instead, when you have built a data-generating script that might be useful to others, please extract the useful components to the `quickstart/modules` folder and leave `scratchpad.ts` empty for the next developer. - -### Environments - -The API clients are designed to work with any delivery method - local, cloud, or serverless deployments. For deployments that do not allow username/password auth, use an API key. - -## Modules - -Extracting data-generating logic into reusable modules that other people will actually use is the hardest part of sharing these scripts. To that end, it's crucial that the modules are organized as neatly as possible and extremely clear about what they do. If the modules are even slightly confusing, it will be faster for people to rebuild the same logic than to figure out how the existing scripts work. - -### Data - -Functions to create documents with various properties. This initial implementation has a function to create a document with an arbitrary number of fields and arbitrary amount of data in each field, but should be extended with more functions to create sets of documents with specific relationships such as X total documents with Y number of unique hosts etc. - -### Entity Analytics - -Functions to help install fake entity analytics data. Useful for testing alert enrichment based on entity analytics. - -### Exceptions - -Functions to help create exceptions with various properties. For example, one helper takes an array of values and automatically creates a value list exception item from that array - internally, it creates the value list and an exception item that references the list. - -### Frozen (TODO) - -Functions to help create frozen tier data quickly. These functions (once implemented) will take existing data and immediately move it to frozen for test purposes. - -### Lists - -Functions to help interact with the Lists APIs. The initial helper function makes it easy to import a value list from an array, since the process of attaching a file to a request (as the API expects) is not that intuitive. - -### Mappings - -Functions to help setup mappings. Provides the ECS mapping as well as helpers to generate mappings with tons of fields. - -### Rules - -Functions to help create rules along with data specific to each rule (WIP). Each sample rule defined in this folder should have an associated function to generate data that triggers alerts for the rule. - -## Speed - -To run a number of API requests in parallel, use `concurrentlyExec` from @kbn/securitysolution-utils. - -## Examples - -### Create a Rule - -``` -// Extra imports -import { concurrentlyExec } from '@kbn/securitysolution-utils/src/client_concurrency'; -import { basicRule } from './modules/rules/new_terms/basic_rule'; -import { duplicateRuleParams } from './modules/rules'; - -// ... omitted client setup stuff - -// Core logic -const ruleCopies = duplicateRuleParams(basicRule, 200); -const functions = ruleCopies.map((rule) => () => detectionsClient.createRule({ body: rule })); -const responses = await concurrentlyExec(functions); -``` - -### Create 200 Rules and an Exception for each one - -``` -// Extra imports -import { concurrentlyExec } from '@kbn/securitysolution-utils/src/client_concurrency'; -import { basicRule } from './modules/rules/new_terms/basic_rule'; -import { duplicateRuleParams } from './modules/rules'; -import { buildCreateRuleExceptionListItemsProps } from './modules/exceptions'; - -// ... omitted client setup stuff - -// Core logic -const ruleCopies = duplicateRuleParams(basicRule, 200); -const response = await detectionsClient.bulkCreateRules({ body: ruleCopies }); -const createdRules: RuleResponse[] = response.data.filter( -(r) => r.id != null -) as RuleResponse[]; - -// This map looks a bit confusing, but the concept is simple: take the rules we just created and -// create a *function* per rule to create an exception for that rule. We want a function to call later instead of just -// calling the API immediately to limit the number of requests in flight (with `concurrentlyExec`) -const exceptionsFunctions = createdRules.map( -(r) => () => - exceptionsClient.createRuleExceptionListItems( - buildCreateRuleExceptionListItemsProps({ id: r.id }) - ) -); -const exceptionsResponses = await concurrentlyExec(exceptionsFunctions); -``` - -### Run 10 Rule Preview Requests Simultaneously - -``` -const previewPromises = range(50).map( - (idx) => () => - detectionsClient.rulePreview({ - body: { - ...getBasicRuleMetadata(), - type: 'query', - timeframeEnd: '2024-08-21T20:37:37.114Z', - invocationCount: 1, - from: 'now-6m', - interval: '5m', - index: [index], - query: '*', - }, - }) -); - -const results = (await concurrentlyExec(previewPromises, 50)).map( - (result) => result.data.logs -); -``` - -## Future Work - -### Interactive Mode - -It may be useful to have a mode where the CLI waits for input from the user and creates resources selected from a predefined list. - -### Resource Tracking/Cleanup - -It may also be useful to have the tooling automatically keep track of the created resources so they can be deleted automatically when finished. diff --git a/x-pack/plugins/security_solution/scripts/run_cypress/utils.ts b/x-pack/plugins/security_solution/scripts/run_cypress/utils.ts deleted file mode 100644 index 6e292eff9a384..0000000000000 --- a/x-pack/plugins/security_solution/scripts/run_cypress/utils.ts +++ /dev/null @@ -1,179 +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 _ from 'lodash'; -import * as fs from 'fs'; -import * as parser from '@babel/parser'; -import generate from '@babel/generator'; -import type { ExpressionStatement, ObjectExpression, ObjectProperty } from '@babel/types'; -import { schema, type TypeOf } from '@kbn/config-schema'; -import chalk from 'chalk'; -import type { ToolingLogTextWriterConfig } from '@kbn/tooling-log'; -import { createToolingLogger } from '../../common/endpoint/data_loaders/utils'; - -/** - * Retrieve test files using a glob pattern. - * If process.env.RUN_ALL_TESTS is true, returns all matching files, otherwise, return files that should be run by this job based on process.env.BUILDKITE_PARALLEL_JOB_COUNT and process.env.BUILDKITE_PARALLEL_JOB - */ -export const retrieveIntegrations = (integrationsPaths: string[]) => { - const nonSkippedSpecs = integrationsPaths.filter((filePath) => !isSkipped(filePath)); - - if (process.env.RUN_ALL_TESTS === 'true') { - return nonSkippedSpecs; - } else { - // The number of instances of this job were created - const chunksTotal: number = process.env.BUILDKITE_PARALLEL_JOB_COUNT - ? parseInt(process.env.BUILDKITE_PARALLEL_JOB_COUNT, 10) - : 1; - // An index which uniquely identifies this instance of the job - const chunkIndex: number = process.env.BUILDKITE_PARALLEL_JOB - ? parseInt(process.env.BUILDKITE_PARALLEL_JOB, 10) - : 0; - - const nonSkippedSpecsForChunk: string[] = []; - - for (let i = chunkIndex; i < nonSkippedSpecs.length; i += chunksTotal) { - nonSkippedSpecsForChunk.push(nonSkippedSpecs[i]); - } - - return nonSkippedSpecsForChunk; - } -}; - -export const isSkipped = (filePath: string): boolean => { - const testFile = fs.readFileSync(filePath, { encoding: 'utf8' }); - - const ast = parser.parse(testFile, { - sourceType: 'module', - plugins: ['typescript'], - }); - - const expressionStatement = _.find(ast.program.body, ['type', 'ExpressionStatement']) as - | ExpressionStatement - | undefined; - - const callExpression = expressionStatement?.expression; - - // @ts-expect-error - return callExpression?.callee?.property?.name === 'skip'; -}; - -export const parseTestFileConfig = (filePath: string): SecuritySolutionDescribeBlockFtrConfig => { - const testFile = fs.readFileSync(filePath, { encoding: 'utf8' }); - - const ast = parser.parse(testFile, { - sourceType: 'module', - plugins: ['typescript'], - }); - - const expressionStatement = _.find(ast.program.body, { - type: 'ExpressionStatement', - expression: { callee: { name: 'describe' } }, - }) as ExpressionStatement | undefined; - - const callExpression = expressionStatement?.expression; - // @ts-expect-error - if (expressionStatement?.expression?.arguments?.length === 3) { - // @ts-expect-error - const callExpressionArguments = _.find(callExpression?.arguments, [ - 'type', - 'ObjectExpression', - ]) as ObjectExpression | undefined; - - const callExpressionProperties = _.find(callExpressionArguments?.properties, [ - 'key.name', - 'env', - ]) as ObjectProperty[] | undefined; - // @ts-expect-error - const ftrConfig = _.find(callExpressionProperties?.value?.properties, [ - 'key.name', - 'ftrConfig', - ]); - - if (!ftrConfig) { - return {}; - } - - const ftrConfigCode = generate(ftrConfig.value, { jsonCompatibleStrings: true }).code; - - try { - // TODO:PT need to assess implication of using this approach to get the JSON back out - // eslint-disable-next-line no-new-func - const ftrConfigJson = new Function(`return ${ftrConfigCode}`)(); - return TestFileFtrConfigSchema.validate(ftrConfigJson); - } catch (err) { - throw new Error( - `Failed to parse 'ftrConfig' value defined in 'describe()' at ${filePath}. ${err.message}\nCode: ${ftrConfigCode}` - ); - } - } - - return {}; -}; - -const TestFileFtrConfigSchema = schema.object( - { - license: schema.maybe(schema.string()), - kbnServerArgs: schema.maybe(schema.arrayOf(schema.string())), - productTypes: schema.maybe( - // TODO:PT write validate function to ensure that only the correct combinations are used - schema.arrayOf( - schema.object({ - product_line: schema.oneOf([ - schema.literal('security'), - schema.literal('endpoint'), - schema.literal('cloud'), - ]), - - product_tier: schema.oneOf([schema.literal('essentials'), schema.literal('complete')]), - }) - ) - ), - }, - { defaultValue: {}, unknowns: 'forbid' } -); - -export type SecuritySolutionDescribeBlockFtrConfig = TypeOf<typeof TestFileFtrConfigSchema>; - -export const getOnBeforeHook = (module: unknown, beforeSpecFilePath: string): Function => { - if (typeof module !== 'object' || module === null) { - throw new Error( - `${chalk.bold( - beforeSpecFilePath - )} expected to explicitly export function member named "onBeforeHook"` - ); - } - - if (!('onBeforeHook' in module) || typeof module.onBeforeHook !== 'function') { - throw new Error( - `${chalk.bold('onBeforeHook')} exported from ${chalk.bold( - beforeSpecFilePath - )} is not a function` - ); - } - - return module.onBeforeHook; -}; - -/** - * Sets the default log level for `ToolingLog` instances created by `createToolingLogger()`: - * `x-pack/plugins/security_solution/common/endpoint/data_loaders/utils.ts:148`. - * It will first check the NodeJs `process.env` to see if an Environment Variable was set - * and then, if provided, it will use the value defined in the Cypress Config. file. - */ -export const setDefaultToolingLoggingLevel = (defaultFallbackLoggingLevel?: string) => { - const logLevel = - process.env.TOOLING_LOG_LEVEL || - process.env.CYPRESS_TOOLING_LOG_LEVEL || - defaultFallbackLoggingLevel || - ''; - - if (logLevel) { - createToolingLogger('info').info(`Setting tooling log level to [${logLevel}]`); - createToolingLogger.defaultLogLevel = logLevel as ToolingLogTextWriterConfig['level']; - } -}; diff --git a/x-pack/plugins/security_solution/scripts/telemetry/README.md b/x-pack/plugins/security_solution/scripts/telemetry/README.md deleted file mode 100644 index f1cfa92dd731c..0000000000000 --- a/x-pack/plugins/security_solution/scripts/telemetry/README.md +++ /dev/null @@ -1,38 +0,0 @@ -## Telemetry data view generation script - -The purpose of the script is to map telemetry fields to runtime fields on the appropriate security solution ebt data views on the staging cluster. This can be used to automate the addition of new fields to the data views. - -### Events -- The browser ebt events come from `telemetryEvents` imported from `x-pack/plugins/security_solution/public/common/lib/telemetry/events/telemetry_events` -- The server ebt events come from: - - `events` imported from `x-pack/plugins/elastic-assistant/server/lib/telemetry/event_based_telemetry` - - `telemetryEvents` imported from `x-pack/plugins/security_solution_serverless/server/telemetry/event_based_telemetry` - - `events` imported from `x-pack/plugins/security_solution/server/lib/telemetry/event_based/events` - -If you have further events to be included in the data views, please update the script to include the event schema. - -### Usage - -1. Login with Vault (`vault login -method oidc`), ensure you have siem-team access. If you have never accessed Vault before, follow [these instructions](https://github.com/elastic/infra/blob/master/docs/vault/README.md) -2. cd into this directory -3. Run the script with the appropriate arguments. By default, the script will run for the `security-solution-ebt-kibana-browser` data view in the `securitysolution` space. If you want to run the script for the server data view, pass the `--telemetry_type` argument with the value `server`. - -```bash -# Run the script for the security-solution-ebt-kibana-browser data view -./build_ebt_data_view.sh - -# Run the script for the security-solution-ebt-server data view -./build_ebt_data_view.sh --telemetry_type=server -``` - -### Data view recovery - -If a security solution ebt data view is for some reason deleted, upload the saved object that is committed in this directory to the staging cluster. This will recreate the data view with the correct mappings. Then you can run this script to ensure any new fields get added. - -#### Why upload the saved object? Why not just run this script? - -There are some fields not covered by this script, at least for the security-solution-ebt-kibana-browser data view (ex: `day_of_week`). I'm not sure where they came from. In order to be on the safe side, the data view saved objects will be updated per minor release to ensure that all fields are covered. - -### Production data views - -This script manages the staging data views. To make updates to the production data views, export the saved objects from staging and upload them to production. diff --git a/x-pack/plugins/security_solution/server/__mocks__/module_name_map.js b/x-pack/plugins/security_solution/server/__mocks__/module_name_map.js deleted file mode 100644 index 61d6b09ba550b..0000000000000 --- a/x-pack/plugins/security_solution/server/__mocks__/module_name_map.js +++ /dev/null @@ -1,18 +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. - */ - -// See: https://github.com/elastic/kibana/issues/117255, this moduleNameMapper creates -// mocks to avoid memory leaks from kibana core. -module.exports = { - '^@kbn/core/server$': '<rootDir>/x-pack/plugins/security_solution/server/__mocks__/core.mock.ts', - '^@kbn/task-manager-plugin/server$': - '<rootDir>/x-pack/plugins/security_solution/server/__mocks__/task_manager.mock.ts', - '^@kbn/alerting-plugin/server$': - '<rootDir>/x-pack/plugins/security_solution/server/__mocks__/alert.mock.ts', - '^@kbn/actions-plugin/server$': - '<rootDir>/x-pack/plugins/security_solution/server/__mocks__/action.mock.ts', -}; diff --git a/x-pack/plugins/security_solution/server/assistant/jest.config.js b/x-pack/plugins/security_solution/server/assistant/jest.config.js deleted file mode 100644 index 787dae7ce8d68..0000000000000 --- a/x-pack/plugins/security_solution/server/assistant/jest.config.js +++ /dev/null @@ -1,19 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/server/assistant'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/server/assistant', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution/server/assistant/**/*.{ts,tsx}', - ], - moduleNameMapper: require('../__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/server/assistant/tools/index.ts b/x-pack/plugins/security_solution/server/assistant/tools/index.ts deleted file mode 100644 index dc32e01335b30..0000000000000 --- a/x-pack/plugins/security_solution/server/assistant/tools/index.ts +++ /dev/null @@ -1,26 +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 { PRODUCT_DOCUMENTATION_TOOL } from './product_docs/product_documentation_tool'; -import { NL_TO_ESQL_TOOL } from './esql/nl_to_esql_tool'; -import { ALERT_COUNTS_TOOL } from './alert_counts/alert_counts_tool'; -import { OPEN_AND_ACKNOWLEDGED_ALERTS_TOOL } from './open_and_acknowledged_alerts/open_and_acknowledged_alerts_tool'; -import { DEFEND_INSIGHTS_TOOL } from './defend_insights'; -import { KNOWLEDGE_BASE_RETRIEVAL_TOOL } from './knowledge_base/knowledge_base_retrieval_tool'; -import { KNOWLEDGE_BASE_WRITE_TOOL } from './knowledge_base/knowledge_base_write_tool'; -import { SECURITY_LABS_KNOWLEDGE_BASE_TOOL } from './security_labs/security_labs_tool'; - -export const assistantTools = [ - ALERT_COUNTS_TOOL, - DEFEND_INSIGHTS_TOOL, - KNOWLEDGE_BASE_RETRIEVAL_TOOL, - KNOWLEDGE_BASE_WRITE_TOOL, - NL_TO_ESQL_TOOL, - OPEN_AND_ACKNOWLEDGED_ALERTS_TOOL, - PRODUCT_DOCUMENTATION_TOOL, - SECURITY_LABS_KNOWLEDGE_BASE_TOOL, -]; diff --git a/x-pack/plugins/security_solution/server/client/jest.config.js b/x-pack/plugins/security_solution/server/client/jest.config.js deleted file mode 100644 index bdf35ce91c864..0000000000000 --- a/x-pack/plugins/security_solution/server/client/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/server/client'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/server/client', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/server/client/**/*.{ts,tsx}'], - moduleNameMapper: require('../__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/server/config.ts b/x-pack/plugins/security_solution/server/config.ts deleted file mode 100644 index 240e452cd44bc..0000000000000 --- a/x-pack/plugins/security_solution/server/config.ts +++ /dev/null @@ -1,229 +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 type { TypeOf } from '@kbn/config-schema'; -import { schema } from '@kbn/config-schema'; -import type { PluginInitializerContext } from '@kbn/core/server'; -import { SIGNALS_INDEX_KEY, DEFAULT_SIGNALS_INDEX } from '../common/constants'; -import type { ExperimentalFeatures } from '../common/experimental_features'; -import { parseExperimentalConfigValue } from '../common/experimental_features'; -import { parseConfigSettings, type ConfigSettings } from '../common/config_settings'; - -/** - * Validates if the value provided is a valid duration for use with Task Manager (ex. 5m, 4s) - */ -const isValidTaskManagerDuration = (value: string): string | undefined => { - if (/^\d+[s,m]{1}$/.test(value)) { - return `Invalid duration [${value}]. Value must be a number followed by either 's' for seconds or 'm' for minutes `; - } -}; - -export const configSchema = schema.object({ - maxRuleImportExportSize: schema.number({ defaultValue: 10000 }), - maxRuleImportPayloadBytes: schema.number({ defaultValue: 10485760 }), - maxTimelineImportExportSize: schema.number({ defaultValue: 10000 }), - maxTimelineImportPayloadBytes: schema.number({ defaultValue: 10485760 }), - - /** - * This is used within the merge strategies: - * server/lib/detection_engine/rule_types/utils/source_fields_merging - * - * For determining which strategy for merging "fields" and "_source" together to get - * runtime fields, constant keywords, etc... - * - * "missingFields" (default) This will only merge fields that are missing from the _source and exist in the fields. - * "noFields" This will turn off all merging of runtime fields, constant keywords from fields. - * "allFields" This will merge and overwrite anything found within "fields" into "_source" before indexing the data. - */ - alertMergeStrategy: schema.oneOf( - [schema.literal('allFields'), schema.literal('missingFields'), schema.literal('noFields')], - { - defaultValue: 'missingFields', - } - ), - - /** - * This is used within the merge strategies: - * server/lib/detection_engine/rule_types/utils/source_fields_merging - * - * For determining if we need to ignore particular "fields" and not merge them with "_source" such as - * runtime fields, constant keywords, etc... - * - * This feature and functionality is mostly as "safety feature" meaning that we have had bugs in the past - * where something down the stack unexpectedly ends up in the fields API which causes documents to not - * be indexable. Rather than changing alertMergeStrategy to be "noFields", you can use this array to add - * any problematic values. - * - * You can use plain dotted notation strings such as "host.name" or a regular expression such as "/host\..+/" - */ - alertIgnoreFields: schema.arrayOf(schema.string(), { - defaultValue: [], - validate(ignoreFields) { - const errors = ignoreFields.flatMap((ignoreField, index) => { - if (ignoreField.startsWith('/') && ignoreField.endsWith('/')) { - try { - new RegExp(ignoreField.slice(1, -1)); - return []; - } catch (error) { - return [`"${error.message}" at array position ${index}`]; - } - } else { - return []; - } - }); - if (errors.length !== 0) { - return errors.join('. '); - } else { - return undefined; - } - }, - }), - [SIGNALS_INDEX_KEY]: schema.string({ defaultValue: DEFAULT_SIGNALS_INDEX }), - - /** - * For internal use. A list of string values (comma delimited) that will enable experimental - * type of functionality that is not yet released. Valid values for this settings need to - * be defined in: - * `x-pack/plugins/security_solution/common/experimental_features.ts` - * under the `allowedExperimentalValues` object - * - * @example - * xpack.securitySolution.enableExperimental: - * - someCrazyFeature - * - someEvenCrazierFeature - */ - enableExperimental: schema.arrayOf(schema.string(), { - defaultValue: () => [], - }), - - /** - * Endpoint Artifacts Configuration: the interval between runs of the task that builds the - * artifacts and associated manifest. - */ - packagerTaskInterval: schema.string({ defaultValue: '60s' }), - - /** - * Endpoint Artifacts Configuration: timeout value for how long the task should run. - */ - packagerTaskTimeout: schema.string({ defaultValue: '20m' }), - - /** - * Artifacts Configuration for package policy update concurrency - */ - packagerTaskPackagePolicyUpdateBatchSize: schema.number({ defaultValue: 25, max: 50, min: 1 }), - - /** - * Complete External Response Actions task: interval duration - */ - completeExternalResponseActionsTaskInterval: schema.string({ - defaultValue: '60s', - validate: isValidTaskManagerDuration, - }), - - /** - * Complete External Response Actions task: Timeout value for how long the task should run - */ - completeExternalResponseActionsTaskTimeout: schema.string({ - defaultValue: '5m', - validate: isValidTaskManagerDuration, - }), - - /** - * For internal use. Specify which version of the Detection Rules fleet package to install - * when upgrading rules. If not provided, the latest compatible package will be installed, - * or if running from a dev environment or -SNAPSHOT build, the latest pre-release package - * will be used (if fleet is available or not within an airgapped environment). - * - * Note: This is for `upgrade only`, which occurs by means of the `useUpgradeSecurityPackages` - * hook when navigating to a Security Solution page. The package version specified in - * `fleet_packages.json` in project root will always be installed first on Kibana start if - * the package is not already installed. - */ - prebuiltRulesPackageVersion: schema.maybe(schema.string()), - enabled: schema.boolean({ defaultValue: true }), - enableUiSettingsValidations: schema.boolean({ defaultValue: false }), - - /** - * The Max number of Bytes allowed for the `upload` endpoint response action - */ - maxUploadResponseActionFileBytes: schema.number({ - defaultValue: 26214400, // 25MB, - max: 104857600, // 100MB, - }), - /** - * Defines the settings for a specific offering of the Security Solution app. - * They override the default values. - * @example - * xpack.securitySolution.offeringSettings: { - * "ILMEnabled": false, - * } - */ - offeringSettings: schema.recordOf(schema.string(), schema.boolean(), { - defaultValue: {}, - }), - entityAnalytics: schema.object({ - riskEngine: schema.object({ - alertSampleSizePerShard: schema.number({ defaultValue: 10_000 }), - }), - assetCriticality: schema.object({ - csvUpload: schema.object({ - errorRetries: schema.number({ defaultValue: 1 }), - maxBulkRequestBodySizeBytes: schema.number({ defaultValue: 100_000 }), // 100KB - }), - }), - entityStore: schema.object({ - syncDelay: schema.duration({ defaultValue: '60s' }), - frequency: schema.duration({ defaultValue: '60s' }), - developer: schema.object({ - pipelineDebugMode: schema.boolean({ defaultValue: false }), - }), - }), - }), -}); - -export type ConfigSchema = TypeOf<typeof configSchema>; - -export type ConfigType = Omit<ConfigSchema, 'offeringSettings'> & { - experimentalFeatures: ExperimentalFeatures; - settings: ConfigSettings; - enableUiSettingsValidations: boolean; -}; - -export const createConfig = (context: PluginInitializerContext): ConfigType => { - const pluginConfig = context.config.get<TypeOf<typeof configSchema>>(); - const logger = context.logger.get('config'); - - const { invalid, features: experimentalFeatures } = parseExperimentalConfigValue( - pluginConfig.enableExperimental - ); - - if (invalid.length) { - logger.warn(`Unsupported "xpack.securitySolution.enableExperimental" values detected. -The following configuration values are no longer supported and should be removed from the kibana configuration file: - - xpack.securitySolution.enableExperimental: -${invalid.map((key) => ` - ${key}`).join('\n')} -`); - } - - const { invalid: invalidConfigSettings, settings } = parseConfigSettings( - pluginConfig.offeringSettings - ); - - if (invalidConfigSettings.length) { - logger.warn(`Unsupported "xpack.securitySolution.offeringSettings" values detected. -The following configuration values are no longer supported and should be removed from the kibana configuration file: -${invalidConfigSettings.map((key) => ` - ${key}`).join('\n')} -`); - } - - return { - ...pluginConfig, - experimentalFeatures, - settings, - }; -}; diff --git a/x-pack/plugins/security_solution/server/endpoint/jest.config.js b/x-pack/plugins/security_solution/server/endpoint/jest.config.js deleted file mode 100644 index 54b164d779377..0000000000000 --- a/x-pack/plugins/security_solution/server/endpoint/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/server/endpoint'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/server/endpoint', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/server/endpoint/**/*.{ts,tsx}'], - moduleNameMapper: require('../__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/mocks.ts b/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/mocks.ts deleted file mode 100644 index 6360ceba71cef..0000000000000 --- a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/mocks.ts +++ /dev/null @@ -1,344 +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 type { ActionsClientMock } from '@kbn/actions-plugin/server/actions_client/actions_client.mock'; -import { actionsClientMock } from '@kbn/actions-plugin/server/actions_client/actions_client.mock'; -import type { ConnectorWithExtraFindData } from '@kbn/actions-plugin/server/application/connector/types'; -import type { DeepPartial } from 'utility-types'; -import type { ActionTypeExecutorResult } from '@kbn/actions-plugin/common'; -import type { ElasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; -import type { CasesClientMock } from '@kbn/cases-plugin/server/client/mocks'; -import { createCasesClientMock } from '@kbn/cases-plugin/server/client/mocks'; -import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; -import { merge } from 'lodash'; -import type * as esTypes from '@elastic/elasticsearch/lib/api/types'; -import type { TransportResult } from '@elastic/elasticsearch'; -import type { AttachmentsSubClient } from '@kbn/cases-plugin/server/client/attachments/client'; -import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; -import type { DeeplyMockedKeys } from '@kbn/utility-types-jest'; - -import type { ResponseActionsClient } from '../..'; -import { NormalizedExternalConnectorClient } from '../..'; -import type { KillOrSuspendProcessRequestBody } from '../../../../../common/endpoint/types'; -import { BaseDataGenerator } from '../../../../../common/endpoint/data_generators/base_data_generator'; -import { - createActionRequestsEsSearchResultsMock, - createActionResponsesEsSearchResultsMock, - createHapiReadableStreamMock, -} from '../mocks'; -import { - ENDPOINT_ACTION_RESPONSES_INDEX, - ENDPOINT_ACTIONS_INDEX, -} from '../../../../../common/endpoint/constants'; -import type { DeepMutable } from '../../../../../common/endpoint/types/utility_types'; -import { EndpointAppContextService } from '../../../endpoint_app_context_services'; -import { - createMockEndpointAppContextServiceSetupContract, - createMockEndpointAppContextServiceStartContract, -} from '../../../mocks'; -import type { ResponseActionsClientOptions } from './lib/base_response_actions_client'; -import { ACTION_RESPONSE_INDICES } from '../constants'; -import type { - ExecuteActionRequestBody, - GetProcessesRequestBody, - IsolationRouteRequestBody, - ResponseActionGetFileRequestBody, - UploadActionApiRequestBody, - ScanActionRequestBody, - RunScriptActionRequestBody, -} from '../../../../../common/api/endpoint'; - -export interface ResponseActionsClientOptionsMock extends ResponseActionsClientOptions { - esClient: ElasticsearchClientMock; - casesClient?: CasesClientMock; -} - -const createResponseActionClientMock = (): jest.Mocked<ResponseActionsClient> => { - return { - suspendProcess: jest.fn().mockReturnValue(Promise.resolve()), - upload: jest.fn().mockReturnValue(Promise.resolve()), - getFile: jest.fn().mockReturnValue(Promise.resolve()), - execute: jest.fn().mockReturnValue(Promise.resolve()), - killProcess: jest.fn().mockReturnValue(Promise.resolve()), - isolate: jest.fn().mockReturnValue(Promise.resolve()), - release: jest.fn().mockReturnValue(Promise.resolve()), - runningProcesses: jest.fn().mockReturnValue(Promise.resolve()), - processPendingActions: jest.fn().mockReturnValue(Promise.resolve()), - getFileInfo: jest.fn().mockReturnValue(Promise.resolve()), - getFileDownload: jest.fn().mockReturnValue(Promise.resolve()), - scan: jest.fn().mockReturnValue(Promise.resolve()), - runscript: jest.fn().mockReturnValue(Promise.resolve()), - }; -}; - -const createConstructorOptionsMock = (): Required<ResponseActionsClientOptionsMock> => { - const esClient = elasticsearchServiceMock.createScopedClusterClient().asInternalUser; - const casesClient = createCasesClientMock(); - const endpointService = new EndpointAppContextService(); - - esClient.index.mockImplementation((async (payload) => { - switch (payload.index) { - case ENDPOINT_ACTIONS_INDEX: - case ENDPOINT_ACTION_RESPONSES_INDEX: - return createEsIndexTransportResponseMock({ body: { _index: payload.index } }); - default: - throw new Error(`no esClient.index() mock defined for index ${payload.index}`); - } - }) as typeof esClient.index); - - esClient.search.mockImplementation(async (payload) => { - if (payload) { - switch (payload.index) { - case ENDPOINT_ACTIONS_INDEX: - return createActionRequestsEsSearchResultsMock(); - case ACTION_RESPONSE_INDICES: - return createActionResponsesEsSearchResultsMock(); - } - } - - return BaseDataGenerator.toEsSearchResponse([]); - }); - - (casesClient.attachments.bulkCreate as jest.Mock).mockImplementation( - (async () => {}) as unknown as jest.Mocked<AttachmentsSubClient>['bulkCreate'] - ); - - endpointService.setup(createMockEndpointAppContextServiceSetupContract()); - endpointService.start({ - ...createMockEndpointAppContextServiceStartContract(), - esClient, - }); - - return { - esClient, - casesClient, - endpointService, - username: 'foo', - isAutomated: false, - }; -}; - -const createEsIndexTransportResponseMock = ( - overrides: DeepPartial<TransportResult<esTypes.IndexResponse, unknown>> = {} -): TransportResult<esTypes.IndexResponse, unknown> => { - const responseDoc: TransportResult<esTypes.IndexResponse, unknown> = { - body: { - _id: 'indexed-1-2-3', - _index: 'some-index', - _primary_term: 1, - result: 'created', - _seq_no: 1, - _shards: { - failed: 0, - successful: 1, - total: 1, - }, - _version: 1, - }, - statusCode: 201, - headers: {}, - warnings: null, - meta: { - context: {}, - name: 'foo', - request: { - params: { - method: 'GET', - path: 'some/path', - }, - options: {}, - id: 'some-id', - }, - connection: null, - attempts: 1, - aborted: false, - }, - }; - - return merge(responseDoc, overrides); -}; - -const createNoParamsResponseActionOptionsMock = ( - overrides: Partial<IsolationRouteRequestBody> = {} -): DeepMutable<IsolationRouteRequestBody> => { - const isolateOptions: IsolationRouteRequestBody = { - agent_type: 'endpoint', - endpoint_ids: ['1-2-3'], - comment: 'test comment', - }; - - return merge(isolateOptions, overrides); -}; - -const createKillOrSuspendProcessOptionsMock = ( - overrides: Partial<KillOrSuspendProcessRequestBody> = {} -): KillOrSuspendProcessRequestBody => { - const parameters = overrides.parameters ?? { pid: 999 }; - const options: KillOrSuspendProcessRequestBody = { - ...createNoParamsResponseActionOptionsMock(), - parameters, - }; - return merge(options, overrides); -}; - -const createRunningProcessesOptionsMock = ( - overrides: Partial<GetProcessesRequestBody> = {} -): GetProcessesRequestBody => { - return createNoParamsResponseActionOptionsMock(overrides); -}; - -const createGetFileOptionsMock = ( - overrides: Partial<ResponseActionGetFileRequestBody> = {} -): ResponseActionGetFileRequestBody => { - const options: ResponseActionGetFileRequestBody = { - ...createNoParamsResponseActionOptionsMock(), - parameters: { - path: '/some/file', - }, - }; - return merge(options, overrides); -}; - -const createExecuteOptionsMock = ( - overrides: Partial<ExecuteActionRequestBody> = {} -): ExecuteActionRequestBody => { - const options: ExecuteActionRequestBody = { - ...createNoParamsResponseActionOptionsMock(), - parameters: { - command: 'ls -ltr', - }, - }; - - return merge(options, overrides); -}; - -const createUploadOptionsMock = ( - overrides: Partial<UploadActionApiRequestBody> = {} -): UploadActionApiRequestBody => { - const options: UploadActionApiRequestBody = { - ...createNoParamsResponseActionOptionsMock(), - parameters: { - overwrite: true, - }, - file: createHapiReadableStreamMock(), - }; - - return merge(options, overrides); -}; - -const createScanOptionsMock = ( - overrides: Partial<ScanActionRequestBody> = {} -): ScanActionRequestBody => { - const options: ScanActionRequestBody = { - ...createNoParamsResponseActionOptionsMock(), - parameters: { - path: '/scan/folder', - }, - }; - return merge(options, overrides); -}; - -const createRunScriptOptionsMock = ( - overrides: Partial<RunScriptActionRequestBody> = {} -): RunScriptActionRequestBody => { - const options: RunScriptActionRequestBody = { - ...createNoParamsResponseActionOptionsMock(), - parameters: { - Raw: 'ls', - }, - }; - return merge(options, overrides); -}; - -const createConnectorMock = ( - overrides: DeepPartial<ConnectorWithExtraFindData> = {} -): ConnectorWithExtraFindData => { - return merge( - { - id: 'connector-mock-id-1', - actionTypeId: '.some-type', - name: 'some mock name', - isMissingSecrets: false, - config: {}, - isPreconfigured: false, - isDeprecated: false, - isSystemAction: false, - referencedByCount: 0, - }, - overrides - ); -}; - -const createConnectorActionExecuteResponseMock = <TData>( - overrides: DeepPartial<ActionTypeExecutorResult<TData>> = {} -): ActionTypeExecutorResult<{}> => { - const result: ActionTypeExecutorResult<TData> = { - actionId: 'execute-response-mock-1', - data: undefined, - message: 'some mock message', - serviceMessage: 'some mock service message', - retry: true, - status: 'ok', - }; - - // @ts-expect-error upgrade typescript v4.9.5 - return merge(result, overrides); -}; - -const createConnectorActionsClientMock = ({ - getAllResponse, -}: { - getAllResponse?: ConnectorWithExtraFindData[]; -} = {}): ActionsClientMock => { - const client = actionsClientMock.create(); - - (client.getAll as jest.Mock).mockImplementation(async () => { - return getAllResponse ?? []; - }); - - return client; -}; - -const createNormalizedExternalConnectorClientMock = ( - connectorActionsClientMock: ActionsClientMock = createConnectorActionsClientMock() -): DeeplyMockedKeys<NormalizedExternalConnectorClient> => { - const normalizedClient = new NormalizedExternalConnectorClient( - connectorActionsClientMock, - loggingSystemMock.createLogger() - ); - - jest.spyOn(normalizedClient, 'execute'); - jest.spyOn(normalizedClient, 'setup'); - - return normalizedClient as DeeplyMockedKeys<NormalizedExternalConnectorClient>; -}; - -export const responseActionsClientMock = Object.freeze({ - create: createResponseActionClientMock, - createConstructorOptions: createConstructorOptionsMock, - - createIsolateOptions: createNoParamsResponseActionOptionsMock, - createReleaseOptions: createNoParamsResponseActionOptionsMock, - createKillProcessOptions: createKillOrSuspendProcessOptionsMock, - createSuspendProcessOptions: createKillOrSuspendProcessOptionsMock, - createRunningProcessesOptions: createRunningProcessesOptionsMock, - createGetFileOptions: createGetFileOptionsMock, - createExecuteOptions: createExecuteOptionsMock, - createUploadOptions: createUploadOptionsMock, - createScanOptions: createScanOptionsMock, - createRunScriptOptions: createRunScriptOptionsMock, - - createIndexedResponse: createEsIndexTransportResponseMock, - - createNormalizedExternalConnectorClient: createNormalizedExternalConnectorClientMock, - - // Some common mocks when working with connector actions client (actions plugin) - createConnectorActionsClient: createConnectorActionsClientMock, - /** Create a mock connector instance */ - createConnector: createConnectorMock, - createConnectorActionExecuteResponse: createConnectorActionExecuteResponseMock, -}); diff --git a/x-pack/plugins/security_solution/server/endpoint/services/metadata/mocks.ts b/x-pack/plugins/security_solution/server/endpoint/services/metadata/mocks.ts deleted file mode 100644 index 51c70a461ee14..0000000000000 --- a/x-pack/plugins/security_solution/server/endpoint/services/metadata/mocks.ts +++ /dev/null @@ -1,189 +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 type { SavedObjectsServiceStart } from '@kbn/core/server'; -import { coreMock, type ElasticsearchClientMock, loggingSystemMock } from '@kbn/core/server/mocks'; -import type { createPackagePolicyServiceMock } from '@kbn/fleet-plugin/server/mocks'; -import type { AgentPolicyServiceInterface, AgentService } from '@kbn/fleet-plugin/server'; -import type { Agent, GetAgentPoliciesResponseItem } from '@kbn/fleet-plugin/common'; -import type { - PolicyData, - UnitedAgentMetadataPersistedData, -} from '../../../../common/endpoint/types'; -import { FleetAgentPolicyGenerator } from '../../../../common/endpoint/data_generators/fleet_agent_policy_generator'; -import { FleetAgentGenerator } from '../../../../common/endpoint/data_generators/fleet_agent_generator'; -import { FleetPackagePolicyGenerator } from '../../../../common/endpoint/data_generators/fleet_package_policy_generator'; -import { applyEsClientSearchMock } from '../../mocks/utils.mock'; -import type { EndpointInternalFleetServicesInterfaceMocked } from '../fleet/endpoint_fleet_services_factory.mocks'; -import { createEndpointFleetServicesFactoryMock } from '../fleet/endpoint_fleet_services_factory.mocks'; -import { createMockEndpointAppContextServiceStartContract } from '../../mocks'; -import { EndpointMetadataService } from './endpoint_metadata_service'; -import { SavedObjectsClientFactory } from '../saved_objects'; -import { - METADATA_UNITED_INDEX, - metadataCurrentIndexPattern, -} from '../../../../common/endpoint/constants'; -import { EndpointMetadataGenerator } from '../../../../common/endpoint/data_generators/endpoint_metadata_generator'; - -/** - * Endpoint Metadata Service test context. Includes an instance of `EndpointMetadataService` along with the - * dependencies that were used to initialize that instance. - */ -export interface EndpointMetadataServiceTestContextMock { - savedObjectsStart: jest.Mocked<SavedObjectsServiceStart>; - agentService: jest.Mocked<AgentService>; - agentPolicyService: jest.Mocked<AgentPolicyServiceInterface>; - packagePolicyService: ReturnType<typeof createPackagePolicyServiceMock>; - endpointMetadataService: EndpointMetadataService; - fleetServices: EndpointInternalFleetServicesInterfaceMocked; - logger: ReturnType<ReturnType<typeof loggingSystemMock.create>['get']>; - esClient: ElasticsearchClientMock; - applyMetadataMocks: typeof applyMetadataMocks; -} - -export const createEndpointMetadataServiceTestContextMock = - (): EndpointMetadataServiceTestContextMock => { - const logger = loggingSystemMock.create().get(); - const { esClient, fleetStartServices, savedObjectsServiceStart } = - createMockEndpointAppContextServiceStartContract(); - const savedObjectsServiceFactory = new SavedObjectsClientFactory( - savedObjectsServiceStart, - coreMock.createSetup().http - ); - const fleetServices = createEndpointFleetServicesFactoryMock({ - fleetDependencies: fleetStartServices, - savedObjects: savedObjectsServiceFactory, - }).service.asInternalUser(); - const endpointMetadataService = new EndpointMetadataService( - esClient, - savedObjectsServiceFactory.createInternalScopedSoClient({ readonly: false }), - fleetServices, - logger - ); - - fleetServices.packagePolicy.list.mockImplementation(async (_, options) => { - return { - items: [], - total: 0, - page: options.page ?? 1, - perPage: options.perPage ?? 10, - }; - }); - - return { - savedObjectsStart: savedObjectsServiceStart, - agentService: { - asInternalUser: fleetServices.agent, - asScoped: jest.fn().mockReturnValue(fleetServices.agent), - asInternalScopedUser: jest.fn().mockReturnValue(fleetServices.agent), - }, - agentPolicyService: fleetServices.agentPolicy, - packagePolicyService: fleetServices.packagePolicy, - logger, - endpointMetadataService, - fleetServices, - applyMetadataMocks, - esClient: esClient as ElasticsearchClientMock, - }; - }; - -export interface ApplyMetadataMocksResponse { - unitedMetadata: UnitedAgentMetadataPersistedData; - integrationPolicies: PolicyData[]; - agentPolicies: GetAgentPoliciesResponseItem[]; - agents: Agent[]; -} - -/** - * Apply mocks to the various services used to retrieve metadata via the EndpointMetadataService. - * Returns the data that is used in the mocks, thus allowing manipulation of it before running the - * test. - * @param esClientMock - * @param fleetServices - */ -export const applyMetadataMocks = ( - esClientMock: ElasticsearchClientMock, - fleetServices: EndpointInternalFleetServicesInterfaceMocked -): ApplyMetadataMocksResponse => { - const metadataGenerator = new EndpointMetadataGenerator('seed'); - const fleetIntegrationPolicyGenerator = new FleetPackagePolicyGenerator('seed'); - const fleetAgentGenerator = new FleetAgentGenerator('seed'); - const fleetAgentPolicyGenerator = new FleetAgentPolicyGenerator('seed'); - - const unitedMetadata = metadataGenerator.generateUnitedAgentMetadata(); - const integrationPolicies = [ - fleetIntegrationPolicyGenerator.generateEndpointPackagePolicy({ - id: unitedMetadata.united.endpoint.Endpoint.policy.applied.id, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - policy_ids: [unitedMetadata.united.agent.policy_id!], - }), - ]; - const agentPolicies = [ - fleetAgentPolicyGenerator.generate({ id: unitedMetadata.united.agent.policy_id }), - ]; - const agents = [ - fleetAgentGenerator.generate({ - id: unitedMetadata.agent.id, - policy_id: agentPolicies[0].id, - }), - ]; - - applyEsClientSearchMock({ - esClientMock, - index: METADATA_UNITED_INDEX, - response: metadataGenerator.toEsSearchResponse([ - metadataGenerator.toEsSearchHit(unitedMetadata, METADATA_UNITED_INDEX), - ]), - }); - - applyEsClientSearchMock({ - esClientMock, - index: metadataCurrentIndexPattern, - response: metadataGenerator.toEsSearchResponse([ - metadataGenerator.toEsSearchHit(unitedMetadata.united.endpoint, metadataCurrentIndexPattern), - ]), - }); - - fleetServices.packagePolicy.list.mockImplementation(async (_, { page = 1 }) => { - // FYI: need to implement returning an empty list of items after page 1 due to how - // `getAllEndpointPackagePolicies()` is currently looping through all policies - // See `x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.ts` - return { - items: page === 1 ? integrationPolicies : [], - page: 1, - total: 1, - perPage: 20, - }; - }); - - fleetServices.packagePolicy.get.mockImplementation(async () => { - return integrationPolicies[0]; - }); - - fleetServices.agentPolicy.getByIds.mockImplementation(async () => { - return agentPolicies; - }); - - fleetServices.agentPolicy.get.mockImplementation(async () => { - return agentPolicies[0]; - }); - - fleetServices.agent.getByIds.mockImplementation(async () => { - return agents; - }); - - fleetServices.agent.getAgent.mockImplementation(async () => { - return agents[0]; - }); - - return { - unitedMetadata, - integrationPolicies, - agentPolicies, - agents, - }; -}; diff --git a/x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/helpers.test.ts b/x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/helpers.test.ts deleted file mode 100644 index c3fd5b36ee1e2..0000000000000 --- a/x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/helpers.test.ts +++ /dev/null @@ -1,196 +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 type { ElasticsearchClient } from '@kbn/core/server'; - -import { DataStreamSpacesAdapter } from '@kbn/data-stream-adapter'; -import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; -import { kibanaPackageJson } from '@kbn/repo-info'; - -import type { HostMetadata } from '../../../../common/endpoint/types'; -import type { SearchParams } from '../../../../common/endpoint/types/workflow_insights'; - -import { - ActionType, - Category, - SourceType, -} from '../../../../common/endpoint/types/workflow_insights'; -import type { EndpointMetadataService } from '../metadata'; -import { - buildEsQueryParams, - createDatastream, - createPipeline, - groupEndpointIdsByOS, -} from './helpers'; -import { - COMPONENT_TEMPLATE_NAME, - DATA_STREAM_PREFIX, - INDEX_TEMPLATE_NAME, - INGEST_PIPELINE_NAME, - TOTAL_FIELDS_LIMIT, -} from './constants'; -import { securityWorkflowInsightsFieldMap } from './field_map_configurations'; -import { createMockEndpointAppContext } from '../../mocks'; - -jest.mock('@kbn/data-stream-adapter', () => ({ - DataStreamSpacesAdapter: jest.fn().mockImplementation(() => ({ - setComponentTemplate: jest.fn(), - setIndexTemplate: jest.fn(), - })), -})); - -describe('helpers', () => { - describe('createDatastream', () => { - it('should create a DataStreamSpacesAdapter with the correct configuration', () => { - const kibanaVersion = kibanaPackageJson.version; - const ds = createDatastream(kibanaVersion); - - expect(DataStreamSpacesAdapter).toHaveBeenCalledTimes(1); - expect(DataStreamSpacesAdapter).toHaveBeenCalledWith(DATA_STREAM_PREFIX, { - kibanaVersion, - totalFieldsLimit: TOTAL_FIELDS_LIMIT, - }); - expect(ds.setComponentTemplate).toHaveBeenCalledTimes(1); - expect(ds.setComponentTemplate).toHaveBeenCalledWith({ - name: COMPONENT_TEMPLATE_NAME, - fieldMap: securityWorkflowInsightsFieldMap, - }); - expect(ds.setIndexTemplate).toHaveBeenCalledTimes(1); - expect(ds.setIndexTemplate).toHaveBeenCalledWith({ - name: INDEX_TEMPLATE_NAME, - componentTemplateRefs: [COMPONENT_TEMPLATE_NAME], - template: { - settings: { - default_pipeline: INGEST_PIPELINE_NAME, - }, - }, - hidden: true, - }); - }); - }); - - describe('createPipeline', () => { - let esClient: ElasticsearchClient; - - beforeEach(() => { - esClient = elasticsearchServiceMock.createElasticsearchClient(); - }); - - it('should create an ingest pipeline with the correct configuration', async () => { - await createPipeline(esClient); - - expect(esClient.ingest.putPipeline).toHaveBeenCalledTimes(1); - expect(esClient.ingest.putPipeline).toHaveBeenCalledWith({ - id: INGEST_PIPELINE_NAME, - processors: [], - _meta: { - managed: true, - }, - }); - }); - }); - - describe('buildEsQueryParams', () => { - it('should build query with valid keys', () => { - const searchParams: SearchParams = { - ids: ['id1', 'id2'], - categories: [Category.Endpoint], - types: ['incompatible_antivirus'], - sourceTypes: [SourceType.LlmConnector], - sourceIds: ['source1'], - targetIds: ['target1'], - actionTypes: [ActionType.Refreshed], - }; - const result = buildEsQueryParams(searchParams); - expect(result).toEqual([ - { terms: { _id: ['id1', 'id2'] } }, - { terms: { categories: ['endpoint'] } }, - { terms: { types: ['incompatible_antivirus'] } }, - { nested: { path: 'source', query: { terms: { 'source.type': ['llm-connector'] } } } }, - { nested: { path: 'source', query: { terms: { 'source.id': ['source1'] } } } }, - { nested: { path: 'target', query: { terms: { 'target.ids': ['target1'] } } } }, - { nested: { path: 'action', query: { terms: { 'action.type': ['refreshed'] } } } }, - ]); - }); - - it('should ignore invalid keys', () => { - const searchParams = { - invalidKey: 'invalidValue', - ids: ['id1'], - } as unknown as SearchParams; - const result = buildEsQueryParams(searchParams); - expect(result).toEqual([{ terms: { _id: ['id1'] } }]); - }); - - it('should handle empty searchParams', () => { - const searchParams: SearchParams = {}; - const result = buildEsQueryParams(searchParams); - expect(result).toEqual([]); - }); - - it('should handle nested query for actionTypes', () => { - const searchParams: SearchParams = { - actionTypes: [ActionType.Refreshed], - }; - const result = buildEsQueryParams(searchParams); - expect(result).toEqual([ - { nested: { path: 'action', query: { terms: { 'action.type': ['refreshed'] } } } }, - ]); - }); - - it('should handle nested query for targetIds', () => { - const searchParams: SearchParams = { - targetIds: ['target1'], - }; - const result = buildEsQueryParams(searchParams); - expect(result).toEqual([ - { nested: { path: 'target', query: { terms: { 'target.ids': ['target1'] } } } }, - ]); - }); - }); - - describe('groupEndpointIdsByOS', () => { - let endpointMetadataService: jest.Mocked<EndpointMetadataService>; - - beforeEach(() => { - const mockEndpointAppContextService = createMockEndpointAppContext().service; - mockEndpointAppContextService.getEndpointMetadataService = jest.fn().mockReturnValue({ - getMetadataForEndpoints: jest.fn(), - }); - endpointMetadataService = - mockEndpointAppContextService.getEndpointMetadataService() as jest.Mocked<EndpointMetadataService>; - }); - - it('should correctly group endpoint IDs by OS type', async () => { - const endpointIds = ['endpoint1', 'endpoint2', 'endpoint3']; - const metadata = [ - { - host: { os: { name: 'Windows' } }, - agent: { id: 'agent1' }, - }, - { - host: { os: { name: 'Linux' } }, - agent: { id: 'agent2' }, - }, - { - host: { os: { name: 'MacOS' } }, - agent: { id: 'agent3' }, - }, - ] as HostMetadata[]; - - endpointMetadataService.getMetadataForEndpoints.mockResolvedValue(metadata); - - const result = await groupEndpointIdsByOS(endpointIds, endpointMetadataService); - - expect(result).toEqual({ - windows: ['agent1'], - linux: ['agent2'], - macos: ['agent3'], - }); - }); - }); -}); diff --git a/x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/helpers.ts b/x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/helpers.ts deleted file mode 100644 index 67c852cc2720b..0000000000000 --- a/x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/helpers.ts +++ /dev/null @@ -1,132 +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 { get as _get } from 'lodash'; - -import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; -import type { ElasticsearchClient } from '@kbn/core/server'; - -import { DataStreamSpacesAdapter } from '@kbn/data-stream-adapter'; - -import type { SearchParams } from '../../../../common/endpoint/types/workflow_insights'; -import type { SupportedHostOsType } from '../../../../common/endpoint/constants'; - -import type { EndpointMetadataService } from '../metadata'; -import { - COMPONENT_TEMPLATE_NAME, - DATA_STREAM_PREFIX, - INDEX_TEMPLATE_NAME, - INGEST_PIPELINE_NAME, - TOTAL_FIELDS_LIMIT, -} from './constants'; -import { securityWorkflowInsightsFieldMap } from './field_map_configurations'; - -export function createDatastream(kibanaVersion: string): DataStreamSpacesAdapter { - const ds = new DataStreamSpacesAdapter(DATA_STREAM_PREFIX, { - kibanaVersion, - totalFieldsLimit: TOTAL_FIELDS_LIMIT, - }); - ds.setComponentTemplate({ - name: COMPONENT_TEMPLATE_NAME, - fieldMap: securityWorkflowInsightsFieldMap, - }); - ds.setIndexTemplate({ - name: INDEX_TEMPLATE_NAME, - componentTemplateRefs: [COMPONENT_TEMPLATE_NAME], - template: { - settings: { - default_pipeline: INGEST_PIPELINE_NAME, - }, - }, - hidden: true, - }); - return ds; -} - -export async function createPipeline(esClient: ElasticsearchClient): Promise<boolean> { - const response = await esClient.ingest.putPipeline({ - id: INGEST_PIPELINE_NAME, - processors: [ - // requires @elastic/elasticsearch 8.16.0 - // { - // fingerprint: { - // fields: ['type', 'category', 'value', 'target.type', 'target.id'], - // target_field: '_id', - // method: 'SHA-256', - // if: 'ctx._id == null', - // }, - // }, - ], - _meta: { - managed: true, - }, - }); - return response.acknowledged; -} - -const validKeys = new Set([ - 'ids', - 'categories', - 'types', - 'sourceTypes', - 'sourceIds', - 'targetTypes', - 'targetIds', - 'actionTypes', -]); - -const paramFieldMap = { - ids: '_id', - sourceTypes: 'source.type', - sourceIds: 'source.id', - targetTypes: 'target.type', - targetIds: 'target.ids', - actionTypes: 'action.type', -}; -const nestedKeys = new Set(['source', 'target', 'action']); -export function buildEsQueryParams(searchParams: SearchParams): QueryDslQueryContainer[] { - return Object.entries(searchParams).reduce((acc: object[], [k, v]) => { - if (!validKeys.has(k)) { - return acc; - } - - const paramKey = _get(paramFieldMap, k, k); - - const topKey = paramKey.split('.')[0]; - if (nestedKeys.has(topKey)) { - const nestedQuery = { - nested: { - path: topKey, - query: { - terms: { [paramKey]: v }, - }, - }, - }; - return [...acc, nestedQuery]; - } - - const next = { terms: { [paramKey]: v } }; - return [...acc, next]; - }, []); -} - -export async function groupEndpointIdsByOS( - endpointIds: string[], - endpointMetadataService: EndpointMetadataService -): Promise<Record<SupportedHostOsType, string[]>> { - const metadata = await endpointMetadataService.getMetadataForEndpoints(endpointIds); - return metadata.reduce<Record<string, string[]>>((acc, m) => { - const os = m.host.os.name.toLowerCase() as SupportedHostOsType; - if (!acc[os]) { - acc[os] = []; - } - - acc[os].push(m.agent.id); - - return acc; - }, {}); -} diff --git a/x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/index.test.ts b/x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/index.test.ts deleted file mode 100644 index c742daa90d258..0000000000000 --- a/x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/index.test.ts +++ /dev/null @@ -1,424 +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 { merge } from 'lodash'; -import moment from 'moment'; -import { ReplaySubject } from 'rxjs'; - -import type { ElasticsearchClient, KibanaRequest, Logger } from '@kbn/core/server'; -import type { DefendInsight, DefendInsightsPostRequestBody } from '@kbn/elastic-assistant-common'; - -import { DataStreamSpacesAdapter } from '@kbn/data-stream-adapter'; -import { DefendInsightType } from '@kbn/elastic-assistant-common'; -import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; -import { kibanaPackageJson } from '@kbn/repo-info'; -import { loggerMock } from '@kbn/logging-mocks'; - -import type { - SearchParams, - SecurityWorkflowInsight, -} from '../../../../common/endpoint/types/workflow_insights'; -import type { EndpointAppContextService } from '../../endpoint_app_context_services'; - -import { - Category, - SourceType, - TargetType, - ActionType, -} from '../../../../common/endpoint/types/workflow_insights'; -import { createMockEndpointAppContext } from '../../mocks'; -import { createDatastream, createPipeline } from './helpers'; -import { securityWorkflowInsightsService } from '.'; -import { DATA_STREAM_NAME } from './constants'; -import { buildWorkflowInsights } from './builders'; - -jest.mock('./helpers', () => { - const original = jest.requireActual('./helpers'); - return { - ...original, - createDatastream: jest.fn(), - createPipeline: jest.fn(), - }; -}); - -jest.mock('./builders', () => { - const original = jest.requireActual('./builders'); - return { - ...original, - buildWorkflowInsights: jest.fn(), - }; -}); - -function getDefaultInsight(overrides?: Partial<SecurityWorkflowInsight>): SecurityWorkflowInsight { - const defaultInsight = { - '@timestamp': moment(), - message: 'This is a test message', - category: Category.Endpoint, - type: DefendInsightType.Enum.incompatible_antivirus, - source: { - type: SourceType.LlmConnector, - id: 'openai-connector-id', - data_range_start: moment(), - data_range_end: moment(), - }, - target: { - type: TargetType.Endpoint, - ids: ['endpoint-1', 'endpoint-2'], - }, - action: { - type: ActionType.Refreshed, - timestamp: moment(), - }, - value: 'unique-key', - remediation: { - exception_list_items: [ - { - list_id: 'example-list-id', - name: 'Example List Name', - description: 'Example description', - entries: [ - { - field: 'example-field', - operator: 'included', - type: 'match', - value: 'example-value', - }, - ], - tags: ['example-tag'], - os_types: ['windows', 'linux'], - }, - ], - }, - metadata: { - notes: { - key1: 'value1', - key2: 'value2', - }, - message_variables: ['variable1', 'variable2'], - }, - }; - return merge(defaultInsight, overrides); -} - -describe('SecurityWorkflowInsightsService', () => { - let logger: Logger; - let esClient: ElasticsearchClient; - let mockEndpointAppContextService: jest.Mocked<EndpointAppContextService>; - - beforeEach(() => { - logger = loggerMock.create(); - esClient = elasticsearchServiceMock.createElasticsearchClient(); - - mockEndpointAppContextService = createMockEndpointAppContext() - .service as jest.Mocked<EndpointAppContextService>; - }); - - afterEach(() => { - jest.clearAllMocks(); - }); - - describe('setup', () => { - it('should set up the data stream', () => { - const createDatastreamMock = createDatastream as jest.Mock; - createDatastreamMock.mockReturnValueOnce( - new DataStreamSpacesAdapter(DATA_STREAM_NAME, { - kibanaVersion: kibanaPackageJson.version, - }) - ); - - securityWorkflowInsightsService.setup({ - kibanaVersion: kibanaPackageJson.version, - logger, - isFeatureEnabled: true, - endpointContext: mockEndpointAppContextService, - }); - - expect(createDatastreamMock).toHaveBeenCalledTimes(1); - expect(createDatastreamMock).toHaveBeenCalledWith(kibanaPackageJson.version); - }); - - it('should log a warning if createDatastream throws an error', () => { - const createDatastreamMock = createDatastream as jest.Mock; - createDatastreamMock.mockImplementation(() => { - throw new Error('test error'); - }); - - securityWorkflowInsightsService.setup({ - kibanaVersion: kibanaPackageJson.version, - logger, - isFeatureEnabled: true, - endpointContext: mockEndpointAppContextService, - }); - - expect(logger.warn).toHaveBeenCalledTimes(1); - expect(logger.warn).toHaveBeenCalledWith(expect.stringContaining('test error')); - }); - }); - - describe('start', () => { - it('should start the service', async () => { - const createDatastreamMock = createDatastream as jest.Mock; - const ds = new DataStreamSpacesAdapter(DATA_STREAM_NAME, { - kibanaVersion: kibanaPackageJson.version, - }); - const dsInstallSpy = jest.spyOn(ds, 'install'); - dsInstallSpy.mockResolvedValueOnce(); - createDatastreamMock.mockReturnValueOnce(ds); - const createPipelineMock = createPipeline as jest.Mock; - createPipelineMock.mockResolvedValueOnce(true); - const createDataStreamMock = esClient.indices.createDataStream as jest.Mock; - - securityWorkflowInsightsService.setup({ - kibanaVersion: kibanaPackageJson.version, - logger, - isFeatureEnabled: true, - endpointContext: mockEndpointAppContextService, - }); - expect(createDatastreamMock).toHaveBeenCalledTimes(1); - expect(createDatastreamMock).toHaveBeenCalledWith(kibanaPackageJson.version); - - await securityWorkflowInsightsService.start({ esClient }); - - expect(createPipelineMock).toHaveBeenCalledTimes(1); - expect(createPipelineMock).toHaveBeenCalledWith(esClient); - expect(dsInstallSpy).toHaveBeenCalledTimes(1); - expect(dsInstallSpy).toHaveBeenCalledWith({ - logger, - esClient, - pluginStop$: expect.any(ReplaySubject), - }); - expect(createDataStreamMock).toHaveBeenCalledTimes(1); - expect(createDataStreamMock).toHaveBeenCalledWith({ name: DATA_STREAM_NAME }); - }); - - it('should log a warning if createPipeline or ds.install throws an error', async () => { - securityWorkflowInsightsService.setup({ - kibanaVersion: kibanaPackageJson.version, - logger, - isFeatureEnabled: true, - endpointContext: mockEndpointAppContextService, - }); - - const createPipelineMock = createPipeline as jest.Mock; - createPipelineMock.mockImplementationOnce(() => { - throw new Error('test error'); - }); - - await securityWorkflowInsightsService.start({ esClient }); - - expect(logger.warn).toHaveBeenCalledTimes(2); - expect(logger.warn).toHaveBeenNthCalledWith(1, expect.stringContaining('test error')); - }); - }); - - describe('createFromDefendInsights', () => { - it('should create workflow insights from defend insights', async () => { - const isInitializedSpy = jest - .spyOn(securityWorkflowInsightsService, 'isInitialized', 'get') - .mockResolvedValueOnce([undefined, undefined]); - - const defendInsights: DefendInsight[] = [ - { - group: 'AVGAntivirus', - events: [ - { - id: 'lqw5opMB9Ke6SNgnxRSZ', - endpointId: 'f6e2f338-6fb7-4c85-9c23-d20e9f96a051', - value: '/Applications/AVGAntivirus.app/Contents/Backend/services/com.avg.activity', - }, - ], - }, - ]; - - const request = {} as KibanaRequest<unknown, unknown, DefendInsightsPostRequestBody>; - const workflowInsights: SecurityWorkflowInsight[] = [getDefaultInsight()]; - - const buildWorkflowInsightsMock = buildWorkflowInsights as jest.Mock; - buildWorkflowInsightsMock.mockResolvedValueOnce(workflowInsights); - - const esClientIndexResp = { - _index: DATA_STREAM_NAME, - _id: '1', - result: 'created' as const, - _shards: { - total: 1, - successful: 1, - failed: 0, - }, - _version: 1, - }; - jest.spyOn(esClient, 'index').mockResolvedValue(esClientIndexResp); - await securityWorkflowInsightsService.start({ esClient }); - const result = await securityWorkflowInsightsService.createFromDefendInsights( - defendInsights, - request - ); - - // twice since it calls securityWorkflowInsightsService.create internally - expect(isInitializedSpy).toHaveBeenCalledTimes(2); - expect(buildWorkflowInsightsMock).toHaveBeenCalledWith({ - defendInsights, - request, - endpointMetadataService: expect.any(Object), - }); - expect(result).toEqual(workflowInsights.map(() => esClientIndexResp)); - }); - }); - - describe('create', () => { - it('should index the doc correctly', async () => { - const isInitializedSpy = jest - .spyOn(securityWorkflowInsightsService, 'isInitialized', 'get') - .mockResolvedValueOnce([undefined, undefined]); - - await securityWorkflowInsightsService.start({ esClient }); - const insight = getDefaultInsight(); - await securityWorkflowInsightsService.create(insight); - - // ensure it waits for initialization first - expect(isInitializedSpy).toHaveBeenCalledTimes(1); - // indexes the doc - expect(esClient.index).toHaveBeenCalledTimes(1); - expect(esClient.index).toHaveBeenCalledWith({ - index: DATA_STREAM_NAME, - body: insight, - refresh: 'wait_for', - }); - }); - }); - - describe('update', () => { - it('should update the doc correctly', async () => { - const isInitializedSpy = jest - .spyOn(securityWorkflowInsightsService, 'isInitialized', 'get') - .mockResolvedValueOnce([undefined, undefined]); - - await securityWorkflowInsightsService.start({ esClient }); - const insightId = 'some-insight-id'; - const insight = getDefaultInsight(); - const indexName = 'backing-index-name'; - await securityWorkflowInsightsService.update(insightId, insight, indexName); - - // ensure it waits for initialization first - expect(isInitializedSpy).toHaveBeenCalledTimes(1); - // updates the doc - expect(esClient.update).toHaveBeenCalledTimes(1); - expect(esClient.update).toHaveBeenCalledWith({ - index: indexName, - id: insightId, - body: { doc: insight }, - refresh: 'wait_for', - }); - }); - }); - - describe('fetch', () => { - it('should fetch the docs with the correct params', async () => { - const isInitializedSpy = jest - .spyOn(securityWorkflowInsightsService, 'isInitialized', 'get') - .mockResolvedValueOnce([undefined, undefined]); - - await securityWorkflowInsightsService.start({ esClient }); - const searchParams: SearchParams = { - size: 50, - from: 50, - ids: ['id1', 'id2'], - categories: [Category.Endpoint], - types: [DefendInsightType.Enum.incompatible_antivirus], - sourceTypes: [SourceType.LlmConnector], - sourceIds: ['source-id1', 'source-id2'], - targetTypes: [TargetType.Endpoint], - targetIds: ['target-id1', 'target-id2'], - actionTypes: [ActionType.Refreshed, ActionType.Remediated], - }; - await securityWorkflowInsightsService.fetch(searchParams); - - // ensure it waits for initialization first - expect(isInitializedSpy).toHaveBeenCalledTimes(1); - // fetches the doc - expect(esClient.search).toHaveBeenCalledTimes(1); - expect(esClient.search).toHaveBeenCalledWith({ - index: DATA_STREAM_NAME, - body: { - query: { - bool: { - must: [ - { - terms: { - _id: ['id1', 'id2'], - }, - }, - { - terms: { - categories: ['endpoint'], - }, - }, - { - terms: { - types: ['incompatible_antivirus'], - }, - }, - { - nested: { - path: 'source', - query: { - terms: { - 'source.type': ['llm-connector'], - }, - }, - }, - }, - { - nested: { - path: 'source', - query: { - terms: { - 'source.id': ['source-id1', 'source-id2'], - }, - }, - }, - }, - { - nested: { - path: 'target', - query: { - terms: { - 'target.type': ['endpoint'], - }, - }, - }, - }, - { - nested: { - path: 'target', - query: { - terms: { - 'target.ids': ['target-id1', 'target-id2'], - }, - }, - }, - }, - { - nested: { - path: 'action', - query: { - terms: { - 'action.type': ['refreshed', 'remediated'], - }, - }, - }, - }, - ], - }, - }, - size: searchParams.size, - from: searchParams.from, - }, - }); - }); - }); -}); diff --git a/x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/index.ts b/x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/index.ts deleted file mode 100644 index d1c765196db29..0000000000000 --- a/x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/index.ts +++ /dev/null @@ -1,222 +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 { ReplaySubject, firstValueFrom, combineLatest } from 'rxjs'; - -import type { - SearchHit, - UpdateResponse, - WriteResponseBase, -} from '@elastic/elasticsearch/lib/api/types'; -import type { ElasticsearchClient, KibanaRequest, Logger } from '@kbn/core/server'; -import type { DataStreamSpacesAdapter } from '@kbn/data-stream-adapter'; -import type { DefendInsight, DefendInsightsPostRequestBody } from '@kbn/elastic-assistant-common'; - -import type { - SearchParams, - SecurityWorkflowInsight, -} from '../../../../common/endpoint/types/workflow_insights'; -import type { EndpointAppContextService } from '../../endpoint_app_context_services'; - -import { SecurityWorkflowInsightsFailedInitialized } from './errors'; -import { buildEsQueryParams, createDatastream, createPipeline } from './helpers'; -import { DATA_STREAM_NAME } from './constants'; -import { buildWorkflowInsights } from './builders'; - -const DEFAULT_PAGE_SIZE = 10; - -interface SetupInterface { - kibanaVersion: string; - logger: Logger; - isFeatureEnabled: boolean; - endpointContext: EndpointAppContextService; -} - -interface StartInterface { - esClient: ElasticsearchClient; -} - -class SecurityWorkflowInsightsService { - private setup$ = new ReplaySubject<void>(1); - private start$ = new ReplaySubject<void>(1); - private stop$ = new ReplaySubject<void>(1); - private ds: DataStreamSpacesAdapter | undefined; - private _esClient: ElasticsearchClient | undefined; - private _endpointContext: EndpointAppContextService | undefined; - private _logger: Logger | undefined; - private _isInitialized: Promise<[void, void]> = firstValueFrom( - combineLatest<[void, void]>([this.setup$, this.start$]) - ); - private isFeatureEnabled = false; - - public get isInitialized() { - return this._isInitialized; - } - - public setup({ kibanaVersion, logger, isFeatureEnabled, endpointContext }: SetupInterface) { - this.isFeatureEnabled = isFeatureEnabled; - if (!isFeatureEnabled) { - return; - } - - this._logger = logger; - this._endpointContext = endpointContext; - - try { - this.ds = createDatastream(kibanaVersion); - } catch (err) { - this.logger.warn(new SecurityWorkflowInsightsFailedInitialized(err.message).message); - return; - } - - this.setup$.next(); - } - - public async start({ esClient }: StartInterface) { - if (!this.isFeatureEnabled) { - return; - } - - this._esClient = esClient; - await firstValueFrom(this.setup$); - - try { - await createPipeline(esClient); - await this.ds?.install({ - logger: this.logger, - esClient, - pluginStop$: this.stop$, - }); - - try { - await esClient.indices.createDataStream({ name: DATA_STREAM_NAME }); - } catch (err) { - if (err?.body?.error?.type === 'resource_already_exists_exception') { - this.logger.debug(`Datastream ${DATA_STREAM_NAME} already exists`); - } else { - throw new SecurityWorkflowInsightsFailedInitialized(err.message); - } - } - } catch (err) { - this.logger.warn(err.message); - return; - } - - this.start$.next(); - } - - public stop() { - this.setup$.next(); - this.setup$.complete(); - this.start$.next(); - this.start$.complete(); - this.stop$.next(); - this.stop$.complete(); - } - - public async createFromDefendInsights( - defendInsights: DefendInsight[], - request: KibanaRequest<unknown, unknown, DefendInsightsPostRequestBody> - ): Promise<WriteResponseBase[]> { - await this.isInitialized; - - const workflowInsights = await buildWorkflowInsights({ - defendInsights, - request, - endpointMetadataService: this.endpointContext.getEndpointMetadataService(), - }); - return Promise.all(workflowInsights.map((insight) => this.create(insight))); - } - - public async create(insight: SecurityWorkflowInsight): Promise<WriteResponseBase> { - await this.isInitialized; - - const response = await this.esClient.index<SecurityWorkflowInsight>({ - index: DATA_STREAM_NAME, - body: insight, - refresh: 'wait_for', - }); - - return response; - } - - public async update( - id: string, - insight: Partial<SecurityWorkflowInsight>, - backingIndex?: string - ): Promise<UpdateResponse> { - await this.isInitialized; - - let index = backingIndex; - if (!index) { - const retrievedInsight = (await this.fetch({ ids: [id] }))[0]; - index = retrievedInsight?._index; - } - - if (!index) { - throw new Error('invalid backing index for updating workflow insight'); - } - - const response = await this.esClient.update<SecurityWorkflowInsight>({ - index, - id, - body: { doc: insight }, - refresh: 'wait_for', - }); - - return response; - } - - public async fetch(params?: SearchParams): Promise<Array<SearchHit<SecurityWorkflowInsight>>> { - await this.isInitialized; - - const size = params?.size ?? DEFAULT_PAGE_SIZE; - const from = params?.from ?? 0; - - const termFilters = params ? buildEsQueryParams(params) : []; - const response = await this.esClient.search<SecurityWorkflowInsight>({ - index: DATA_STREAM_NAME, - body: { - query: { - bool: { - must: termFilters, - }, - }, - size, - from, - }, - }); - - return response?.hits?.hits ?? []; - } - - private get esClient(): ElasticsearchClient { - if (!this._esClient) { - throw new SecurityWorkflowInsightsFailedInitialized('no elasticsearch client found'); - } - - return this._esClient; - } - - private get logger(): Logger { - if (!this._logger) { - throw new SecurityWorkflowInsightsFailedInitialized('no logger found'); - } - - return this._logger; - } - - private get endpointContext(): EndpointAppContextService { - if (!this._endpointContext) { - throw new SecurityWorkflowInsightsFailedInitialized('no endpoint context found'); - } - - return this._endpointContext; - } -} - -export const securityWorkflowInsightsService = new SecurityWorkflowInsightsService(); diff --git a/x-pack/plugins/security_solution/server/fleet_integration/jest.config.js b/x-pack/plugins/security_solution/server/fleet_integration/jest.config.js deleted file mode 100644 index 726842812a45a..0000000000000 --- a/x-pack/plugins/security_solution/server/fleet_integration/jest.config.js +++ /dev/null @@ -1,19 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/server/fleet_integration'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/server/fleet_integration', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution/server/fleet_integration/**/*.{ts,tsx}', - ], - moduleNameMapper: require('../__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/server/integration_tests/lib/helpers.ts b/x-pack/plugins/security_solution/server/integration_tests/lib/helpers.ts deleted file mode 100644 index d6eb3b6d8ca71..0000000000000 --- a/x-pack/plugins/security_solution/server/integration_tests/lib/helpers.ts +++ /dev/null @@ -1,175 +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 { v4 as uuidGen } from 'uuid'; -import Fs from 'fs'; -import Util from 'util'; -import type { ElasticsearchClient } from '@kbn/core/server'; -import deepmerge from 'deepmerge'; -import { createTestServers, createRootWithCorePlugins } from '@kbn/core-test-helpers-kbn-server'; - -export const DEFAULT_GET_ROUTES: Array<[RegExp, unknown]> = [ - [new RegExp('.*/ping$'), { status: 200 }], - [ - /.*kibana\/manifest\/artifacts.*/, - { - status: 200, - data: 'x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip', - }, - ], -]; - -export const DEFAULT_POST_ROUTES: Array<[RegExp, unknown]> = [[/.*/, { status: 200 }]]; - -const asyncUnlink = Util.promisify(Fs.unlink); - -/** - * Eventually runs a callback until it succeeds or times out. - * Inspired in https://kotest.io/docs/assertions/eventually.html - * - * @param cb The callback to run/retry - * @param duration The maximum duration to run the callback, default 10000 millisecs - * @param interval The interval between each run, default 100 millisecs - */ -export async function eventually<T>( - cb: () => Promise<T>, - duration: number = 120000, - interval: number = 3000 -) { - let elapsed = 0; - - while (true) { - const startedAt: number = performance.now(); - try { - return await cb(); - } catch (e) { - if (elapsed >= duration) { - throw e; - } - } - await new Promise((resolve) => setTimeout(resolve, interval)); - elapsed += performance.now() - startedAt; - } -} - -export async function setupTestServers(logFilePath: string, settings = {}) { - const { startES } = createTestServers({ - adjustTimeout: (t) => jest.setTimeout(t), - settings: { - es: { - license: 'trial', - }, - }, - }); - - const esServer = await startES(); - - const root = createRootWithCorePlugins( - deepmerge( - { - logging: { - appenders: { - file: { - type: 'file', - fileName: logFilePath, - layout: { - type: 'json', - }, - }, - }, - root: { - level: 'warn', - }, - loggers: [ - { - name: 'plugins.taskManager', - level: 'warn', - appenders: ['file'], - }, - { - name: 'plugins.securitySolution.telemetry_events', - level: 'all', - appenders: ['file'], - }, - ], - }, - }, - settings - ), - { oss: false } - ); - - await root.preboot(); - const coreSetup = await root.setup(); - const coreStart = await root.start(); - - return { - esServer, - kibanaServer: { - root, - coreSetup, - coreStart, - stop: async () => root.shutdown(), - }, - }; -} - -export async function removeFile(path: string) { - await asyncUnlink(path).catch(() => void 0); -} - -export async function bulkInsert( - esClient: ElasticsearchClient, - index: string, - data: unknown[], - ids: string[] = [] -): Promise<void> { - const bulk = data.flatMap((d, i) => { - const _id = ids[i] ?? uuidGen(); - return [{ create: { _index: index, _id } }, d]; - }); - await esClient.bulk({ body: bulk, refresh: 'wait_for' }).catch(() => {}); -} - -export function updateTimestamps(data: object[]): object[] { - const currentTimeMillis = new Date().getTime(); - return data.map((d, i) => { - // wait a couple of millisecs to not make timestamps overlap - return { ...d, '@timestamp': new Date(currentTimeMillis + (i + 1) * 100) }; - }); -} - -export function mockAxiosPost( - postSpy: jest.SpyInstance, - routes: Array<[RegExp, unknown]> = DEFAULT_POST_ROUTES -) { - postSpy.mockImplementation(async (url: string) => { - for (const [route, returnValue] of routes) { - if (route.test(url)) { - return returnValue; - } - } - return { status: 404 }; - }); -} - -export function mockAxiosGet( - getSpy: jest.SpyInstance, - routes: Array<[RegExp, unknown]> = DEFAULT_GET_ROUTES -) { - getSpy.mockImplementation(async (url: string) => { - for (const [route, returnValue] of routes) { - if (route.test(url)) { - return returnValue; - } - } - return { status: 404 }; - }); -} - -export function getRandomInt(min: number, max: number): number { - return Math.floor(Math.random() * (max - min + 1)) + min; -} diff --git a/x-pack/plugins/security_solution/server/jest.config.js b/x-pack/plugins/security_solution/server/jest.config.js deleted file mode 100644 index feb812760d98a..0000000000000 --- a/x-pack/plugins/security_solution/server/jest.config.js +++ /dev/null @@ -1,19 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - /** all nested directories have their own Jest config file */ - testMatch: ['<rootDir>/x-pack/plugins/security_solution/server/*.test.{js,mjs,ts,tsx}'], - roots: ['<rootDir>/x-pack/plugins/security_solution/server'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/server', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/server/**/*.{ts,tsx}'], - moduleNameMapper: require('./__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/README.md b/x-pack/plugins/security_solution/server/lib/detection_engine/README.md deleted file mode 100644 index a2385e15a1bf2..0000000000000 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/README.md +++ /dev/null @@ -1,176 +0,0 @@ -README.md for developers working on the backend detection engine on how to get started -using the CURL scripts in the scripts folder. - -The scripts rely on CURL and jq: - -- [CURL](https://curl.haxx.se) -- [jq](https://stedolan.github.io/jq/) - -Install curl and jq - -```sh -brew update -brew install curl -brew install jq -``` - -Open `$HOME/.zshrc` or `${HOME}.bashrc` depending on your SHELL output from `echo $SHELL` -and add these environment variables: - -```sh -export ELASTICSEARCH_USERNAME=${user} -export ELASTICSEARCH_PASSWORD=${password} -export ELASTICSEARCH_URL=https://${ip}:9200 -export KIBANA_URL=http://localhost:5601 -export TASK_MANAGER_INDEX=.kibana-task-manager-${your user id} -export KIBANA_INDEX=.kibana-${your user id} -``` - -source `$HOME/.zshrc` or `${HOME}.bashrc` to ensure variables are set: - -```sh -source ~/.zshrc -``` - -Open your `kibana.dev.yml` file and add these lines: - -```sh -xpack.securitySolution.signalsIndex: .siem-signals-${your user id} -``` - -Restart Kibana and ensure that you are using `--no-base-path` as changing the base path is a feature but will -get in the way of the CURL scripts written as is. You should see alerting and actions starting up like so afterwards - -```sh -server log [22:05:22.277] [info][status][plugin:alerting@8.0.0] Status changed from uninitialized to green - Ready -server log [22:05:22.270] [info][status][plugin:actions@8.0.0] Status changed from uninitialized to green - Ready -``` - -Go to the scripts folder `cd kibana/x-pack/plugins/security_solution/server/lib/detection_engine/scripts` and run: - -```sh -./hard_reset.sh -./post_rule.sh -``` - -which will: - -- Delete any existing actions you have -- Delete any existing alerts you have -- Delete any existing alert tasks you have -- Delete any existing signal mapping, policies, and template, you might have previously had. -- Add the latest signal index and its mappings using your settings from `kibana.dev.yml` environment variable of `xpack.securitySolution.signalsIndex`. -- Posts the sample rule from `./rules/queries/query_with_rule_id.json` -- The sample rule checks for root or admin every 5 minutes and reports that as a signal if it is a positive hit - -Now you can run - -```sh -./find_rules.sh -``` - -You should see the new rules created like so: - -```sh -{ - "page": 1, - "perPage": 20, - "total": 1, - "data": [ - { - "created_by": "elastic", - "description": "Detecting root and admin users", - "enabled": true, - "false_positives": [], - "from": "now-6m", - "id": "a556065c-0656-4ba1-ad64-a77ca9d2013b", - "immutable": false, - "index": [ - "auditbeat-*", - "filebeat-*", - "packetbeat-*", - "winlogbeat-*" - ], - "interval": "5m", - "rule_id": "rule-1", - "language": "kuery", - "output_index": ".siem-signals-some-name", - "max_signals": 100, - "risk_score": 1, - "name": "Detect Root/Admin Users", - "query": "user.name: root or user.name: admin", - "references": [ - "http://www.example.com", - "https://ww.example.com" - ], - "severity": "high", - "updated_by": "elastic", - "tags": [], - "to": "now", - "type": "query" - } - ] -} -``` - -Every 5 minutes if you get positive hits you will see messages on info like so: - -```sh -server log [09:54:59.013] [info][plugins][siem] Total signals found from signal rule "id: a556065c-0656-4ba1-ad64-a77ca9d2013b", "ruleId: rule-1": 10000 -``` - -Rules are [space aware](https://www.elastic.co/guide/en/kibana/master/xpack-spaces.html) and default -to the "default" (empty) URL space if you do not export the variable of `SPACE_URL`. Example, if you want to -post rules to `test-space` you set `SPACE_URL` to be: - -```sh -export SPACE_URL=/s/test-space -``` - -The `${SPACE_URL}` is in front of all the APIs to correctly create, modify, delete, and update -them from within the defined space. If this variable is not defined the default which is the url of an -empty string will be used. - -Add the `.siem-signals-${your user id}` to your advanced SIEM settings to see any signals -created which should update once every 5 minutes at this point. - -Also add the `.siem-signals-${your user id}` as a kibana index for Maps to be able to see the -signals - -Optionally you can add these debug statements to your `kibana.dev.yml` to see more information when running the detection -engine - -```sh -logging.verbose: true -logging.events: - { - log: ['security_solution', 'info', 'warning', 'error', 'fatal'], - request: ['info', 'warning', 'error', 'fatal'], - error: '*', - ops: __no-ops__, - } -``` - -See these two README.md's pages for more references on the alerting and actions API: -https://github.com/elastic/kibana/blob/main/x-pack/plugins/alerting/README.md -https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions - -### Signals API - -To update the status of a signal or group of signals, the following scripts provide an example of how to -go about doing so. -`cd x-pack/plugins/security_solution/server/lib/detection_engine/scripts` -`./signals/put_signal_doc.sh` will post a sample signal doc into the signals index to play with -`./signals/set_status_with_id.sh closed` will update the status of the sample signal to closed -`./signals/set_status_with_id.sh open` will update the status of the sample signal to open -`./signals/set_status_with_query.sh closed` will update the status of the signals in the result of the query to closed. -`./signals/set_status_with_query.sh open` will update the status of the signals in the result of the query to open. - -### Large List Exceptions - -To test out the functionality of large lists with rules, the user will need to import a list and post a rule with a reference to that exception list. The following outlines an example using the sample json rule provided in the repo. - -* First, set the appropriate env var in order to enable exceptions features`export ELASTIC_XPACK_SECURITY_SOLUTION_LISTS_FEATURE=true` and `export ELASTIC_XPACK_SECURITY_SOLUTION_EXCEPTIONS_LISTS=true` and start kibana -* Second, import a list of ips from a file called `ci-badguys.txt`. The command should look like this: -`cd $HOME/kibana/x-pack/plugins/lists/server/scripts && ./import_list_items_by_filename.sh ip ~/ci-badguys.txt` -* Then, from the detection engine scripts folder (`cd kibana/x-pack/plugins/security_solution/server/lib/detection_engine/scripts`) run `./post_rule.sh rules/queries/lists/query_with_list_plugin.json` diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/README.md b/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/README.md deleted file mode 100644 index 6b9638389e120..0000000000000 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/README.md +++ /dev/null @@ -1,184 +0,0 @@ - - -### How to on board a new prepackage timelines: - - - -1. [Have the env params set up](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/README.md) - -2. Create a new timelines template into `x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines` - - ##### 2.a : Create a new template from UI and export it. - - 1. Go to Security Solution app in Kibana - 2. Go to timelines > templates > custom templates (a filter on the right) - 3. Click `Create new timeline template` - 4. Edit your template - 5. Export only **one** timeline template each time and put that in `x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines`. (For potential update requirement in the future, we put one timeline in each file to keep nice and clear) - 6. Rename the file extension to `.json` - 7. Check the chapter of `Fields to hightlight for on boarding a new prepackaged timeline` in this readme and update your template - - - - - ##### 2.b : Create a new template from scratch - Please note that below template is just an example, please replace all your fields with whatever makes sense. Do check `Fields to hightlight for on boarding a new prepackaged timeline` to make sure the template can be created as expected. - - - cd x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines - - - - echo '{"savedObjectId":null,"version":null,"columns":[{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"@timestamp","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"kibana.alert.rule.description","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"event.action","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.name","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"The working directory of the process.","columnHeaderType":"not-filtered","id":"process.working_directory","category":"process","type":"string","searchable":null,"example":"/home/alice"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments, starting with the absolute path to\nthe executable.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.args","category":"process","type":"string","searchable":null,"example":"[\"/usr/bin/ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.pid","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"Absolute path to the process executable.","columnHeaderType":"not-filtered","id":"process.parent.executable","category":"process","type":"string","searchable":null,"example":"/usr/bin/ssh"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.parent.args","category":"process","type":"string","searchable":null,"example":"[\"ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"aggregatable":true,"name":null,"description":"Process id.","columnHeaderType":"not-filtered","id":"process.parent.pid","category":"process","type":"number","searchable":null,"example":"4242"},{"indexes":null,"aggregatable":true,"name":null,"description":"Short name or login of the user.","columnHeaderType":"not-filtered","id":"user.name","category":"user","type":"string","searchable":null,"example":"albert"},{"indexes":null,"aggregatable":true,"name":null,"description":"Name of the host.\n\nIt can contain what `hostname` returns on Unix systems, the fully qualified\ndomain name, or a name specified by the user. The sender decides which value\nto use.","columnHeaderType":"not-filtered","id":"host.name","category":"host","type":"string","searchable":null}],"dataProviders":[{"excluded":false,"and":[],"kqlQuery":"","name":"590eb946a7fdbacaa587ed0f6b1a16f5ad3d659ec47ef35ad0826c47af133bde","queryMatch":{"displayValue":null,"field":"_id","displayField":null,"value":"590eb946a7fdbacaa587ed0f6b1a16f5ad3d659ec47ef35ad0826c47af133bde","operator":":"},"id":"send-signal-to-timeline-action-default-draggable-event-details-value-formatted-field-value-timeline-1-signal-id-590eb946a7fdbacaa587ed0f6b1a16f5ad3d659ec47ef35ad0826c47af133bde","enabled":true}],"description":"","eventType":"all","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"title":"Generic Process Timeline","dateRange":{"start":1588161020848,"end":1588162280848},"savedQueryId":null,"sort":{"columnId":"@timestamp","sortDirection":"desc"},"created":1588162404153,"createdBy":"Elastic","updated":1588604767818,"updatedBy":"Elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"timelineType":"template","status":"immutable","templateTimelineId":"2c7e0663-5a91-0004-aa15-26bf756d2c40","templateTimelineVersion":1}' > my_new_template.json``` - - #### Note that the json has to be minified. - #### Fields to hightlight for on boarding a new prepackaged timeline: - - - savedObjectId: null - - - version: null - - - templateTimelineId: Specify an unique uuid e.g.: `2c7e0663-5a91-0004-aa15-26bf756d2c40` - - - templateTimelineVersion: start from `1`, bump it on update - - - timelineType: `template` - - - status: `immutable` - - - indexNames: [] - - - -3. ```cd x-pack/plugins/security_solution/server/lib/detection_engine/scripts``` - -4. ```sh ./timelines/regen_prepackage_timelines_index.sh``` - -(this will update `x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/index.ndjson`) - - - -5. Go to `http://localhost:5601/app/security#/detections/rules` and click on `Install Elastic prebuild rules` - -or run - -``` -cd x-pack/plugins/security_solution/server/lib/detection_engine/scripts - -sh ./timelines/add_prepackaged_timelines.sh - -``` - - - -6. Check in UI or run the script below to see if prepackaged timelines on-boarded correctly. - -``` - -sh ./timelines/find_timeline_by_filter.sh immutable template elastic - -``` - - - -### How to update an existing prepackage timeline: - -1. ```cd x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines``` - -2. Open the json file you wish to update, and remember to bump the `templateTimelineVersion` - -3. Go to ```cd x-pack/plugins/security_solution/server/lib/detection_engine/scripts```, run ```sh ./timelines/regen_prepackage_timelines_index.sh``` - -4. Go to `http://localhost:5601/app/security#/detections/rules` and click on `Install Elastic prebuild rules` - -or run - -``` - -sh ./timelines/add_prepackaged_timelines.sh - -``` - - - -5. Check in UI or run the script below to see if the prepackaged timeline updated correctly. - -``` - -sh ./timelines/find_timeline_by_filter.sh immutable template elastic - -``` - - - - -### How to install prepackaged timelines: - -1. ```cd x-pack/plugins/siem/server/lib/detection_engine/scripts``` - -2. ```sh ./timelines/add_prepackaged_timelines.sh``` - -3. ```sh ./timelines/find_timeline_by_filter.sh immutable template elastic``` - - - -### Get timeline by id: - -``` - -cd x-pack/plugins/security_solution/server/lib/detection_engine/scripts - -sh ./timelines/get_timeline_by_id.sh {id} - -``` - - - - -### Get timeline by templateTimelineId: - -``` - -cd x-pack/plugins/security_solution/server/lib/detection_engine/scripts - -sh ./timelines/get_timeline_by_template_timeline_id.sh {template_timeline_id} - -``` - - - - -### Get all custom timelines: - -``` - -cd x-pack/plugins/security_solution/server/lib/detection_engine/scripts - -sh ./timelines/get_all_timelines.sh - -``` - - - - -### Delete all timelines: - -``` - -cd x-pack/plugins/security_solution/server/lib/detection_engine/scripts - -sh ./timelines/delete_all_timelines.sh - -``` - - - -### Delete timeline by timeline id: - -``` - -cd x-pack/plugins/security_solution/server/lib/detection_engine/scripts - -./timelines/delete_all_alerts.sh {timeline_id} - -``` diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/README.md b/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/README.md deleted file mode 100644 index c7e9c7ba9d687..0000000000000 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# Detection Engine health logic - -See [README](../../../../../../common/api/detection_engine/rule_monitoring/detection_engine_health/README.md) in the common folder for info about the Detection Engine health API. - -This logic provides the following functionality via the `IDetectionEngineHealthClient` interface: - -- Calculating health snapshots for different "slices" of rules in the cluster: - - the whole cluster: all detection rules in all Kibana spaces - - a given space: all rules in the current Kibana space - - a given rule: an individual rule specified by id -- Installing assets for monitoring health, such as Kibana dashboards, etc. - -## Assets for monitoring health - -The assets' sources are located in the repo under `x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets`. - -### Assets are installed on behalf of the internal user - -The important aspect to know about is that we install these assets via the saved objects `import()` method, and do it on behalf of the internal Kibana user (which is `kibana_system` by default). This user has privileges for writing saved objects out of the box, which allows our users to be able to install the assets without configuring any additional RBAC. - -See `createDetectionEngineHealthClient` and `installAssetsForMonitoringHealth` for the implementation details. - -### Assets' source files are JSON - -Another thing to consider is that the assets are stored as `.json` files in the repo. This has pros and cons, but the important benefit here is that it allows you to make changes in the assets faster. Especially it applies to Kibana dashboards, which are large objects, and it's hard to construct a dashboard manually in the code. - -### Updating the rule monitoring dashboard - -For example, let's talk about updating the `dashboard_rule_monitoring.json`. It is very convenient to be able to install this dashboard via calling the `_setup` endpoint, and then go edit it in Kibana, save it, export it, and update the source file based on the exported `.ndjson` file. - -Only a few adjustments would need to be done after that manually in the source file: - -- obviously, formatting to JSON -- the dashboard's id has to be updated to `security-detection-rule-monitoring-<spaceId>` -- you have to make sure the references to tags are specified correctly: - - ```json - { - "id": "fleet-managed-<spaceId>", - "name": "tag-ref-fleet-managed", - "type": "tag" - }, - { - "id": "security-solution-<spaceId>", - "name": "tag-ref-security-solution", - "type": "tag" - } - ``` diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.test.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.test.ts deleted file mode 100644 index 86ac7d136d221..0000000000000 --- a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.test.ts +++ /dev/null @@ -1,185 +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 { - loggingSystemMock, - elasticsearchServiceMock, - savedObjectsClientMock, -} from '@kbn/core/server/mocks'; -import { EntityStoreDataClient } from './entity_store_data_client'; -import type { SortOrder } from '@elastic/elasticsearch/lib/api/types'; -import type { EntityType } from '../../../../common/api/entity_analytics/entity_store/common.gen'; -import type { DataViewsService } from '@kbn/data-views-plugin/common'; -import type { AppClient } from '../../..'; -import type { EntityStoreConfig } from './types'; -import { mockGlobalState } from '../../../../public/common/mock'; - -describe('EntityStoreDataClient', () => { - const mockSavedObjectClient = savedObjectsClientMock.create(); - const clusterClientMock = elasticsearchServiceMock.createScopedClusterClient(); - const esClientMock = clusterClientMock.asCurrentUser; - const loggerMock = loggingSystemMock.createLogger(); - const dataClient = new EntityStoreDataClient({ - clusterClient: clusterClientMock, - logger: loggerMock, - namespace: 'default', - soClient: mockSavedObjectClient, - kibanaVersion: '9.0.0', - dataViewsService: {} as DataViewsService, - appClient: {} as AppClient, - config: {} as EntityStoreConfig, - experimentalFeatures: mockGlobalState.app.enableExperimental, - }); - - const defaultSearchParams = { - entityTypes: ['host'] as EntityType[], - page: 1, - perPage: 10, - sortField: 'hostName', - sortOrder: 'asc' as SortOrder, - }; - - const emptySearchResponse = { - took: 0, - timed_out: false, - _shards: { - total: 0, - successful: 0, - skipped: 0, - failed: 0, - }, - hits: { - total: 0, - hits: [], - }, - }; - - describe('search entities', () => { - beforeEach(() => { - jest.resetAllMocks(); - esClientMock.search.mockResolvedValue(emptySearchResponse); - }); - - it('searches in the entities store indices', async () => { - await dataClient.searchEntities({ - ...defaultSearchParams, - entityTypes: ['host', 'user'], - }); - - expect(esClientMock.search).toHaveBeenCalledWith( - expect.objectContaining({ - index: [ - '.entities.v1.latest.security_host_default', - '.entities.v1.latest.security_user_default', - ], - }) - ); - }); - - it('should filter by filterQuery param', async () => { - await dataClient.searchEntities({ - ...defaultSearchParams, - filterQuery: '{"match_all":{}}', - }); - - expect(esClientMock.search).toHaveBeenCalledWith( - expect.objectContaining({ query: { match_all: {} } }) - ); - }); - - it('should paginate', async () => { - await dataClient.searchEntities({ - ...defaultSearchParams, - page: 3, - perPage: 7, - }); - - expect(esClientMock.search).toHaveBeenCalledWith( - expect.objectContaining({ from: 14, size: 7 }) - ); - }); - - it('should sort', async () => { - await dataClient.searchEntities({ - ...defaultSearchParams, - sortField: '@timestamp', - sortOrder: 'asc', - }); - - expect(esClientMock.search).toHaveBeenCalledWith( - expect.objectContaining({ sort: [{ '@timestamp': 'asc' }] }) - ); - }); - - it('caps the size to the maximum query size', async () => { - await dataClient.searchEntities({ - ...defaultSearchParams, - perPage: 999_999, - }); - - const maxSize = 10_000; - - expect(esClientMock.search).toHaveBeenCalledWith(expect.objectContaining({ size: maxSize })); - }); - - it('ignores an index_not_found_exception if the entity index does not exist', async () => { - await dataClient.searchEntities(defaultSearchParams); - - expect(esClientMock.search).toHaveBeenCalledWith( - expect.objectContaining({ ignore_unavailable: true }) - ); - }); - - it('returns inspect query params', async () => { - const response = await dataClient.searchEntities(defaultSearchParams); - - expect(response.inspect).toMatchSnapshot(); - }); - - it('returns searched entity record', async () => { - const fakeEntityRecord = { entity_record: true, asset: { criticality: 'low' } }; - - esClientMock.search.mockResolvedValue({ - ...emptySearchResponse, - hits: { - total: 1, - hits: [ - { - _index: '.entities.v1.latest.security_host_default', - _source: fakeEntityRecord, - }, - ], - }, - }); - - const response = await dataClient.searchEntities(defaultSearchParams); - - expect(response.records[0]).toEqual(fakeEntityRecord); - }); - - it("returns empty asset criticality when criticality value is 'deleted'", async () => { - const fakeEntityRecord = { entity_record: true }; - - esClientMock.search.mockResolvedValue({ - ...emptySearchResponse, - hits: { - total: 1, - hits: [ - { - _index: '.entities.v1.latest.security_host_default', - _source: { asset: { criticality: 'deleted' }, ...fakeEntityRecord }, - }, - ], - }, - }); - - const response = await dataClient.searchEntities(defaultSearchParams); - - expect(response.records[0]).toEqual(fakeEntityRecord); - }); - }); -}); diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/index.test.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/index.test.ts deleted file mode 100644 index 5d25cf38761fe..0000000000000 --- a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/index.test.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 { getPainlessScripts } from '.'; - -describe('getPainlessScripts', () => { - // to update snapshot run `yarn test:jest x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/index.test.ts -u` - test('Scripts should not have changed. If this change is intentional, ensure that Serverless scripted metric allowlists are updated', async () => { - const scripts = await getPainlessScripts(); - - expect(scripts).toMatchInlineSnapshot(` - Object { - "combine": "return state;", - "init": "state.inputs = []", - "map": "Map fields = new HashMap();fields.put('id', doc['kibana.alert.uuid'].value);fields.put('index', doc['_index'].value);fields.put('time', doc['@timestamp'].value);fields.put('rule_name', doc['kibana.alert.rule.name'].value);fields.put('category', doc['event.kind'].value);fields.put('score', doc['kibana.alert.risk_score'].value);state.inputs.add(fields); ", - "reduce": "Map results = new HashMap();results['notes'] = [];results['category_1_score'] = 0.0;results['category_1_count'] = 0;results['risk_inputs'] = [];results['score'] = 0.0;def inputs = states[0].inputs;Collections.sort(inputs, (a, b) -> b.get('score').compareTo(a.get('score')));for (int i = 0; i < inputs.length; i++) { double current_score = inputs[i].score / Math.pow(i + 1, params.p); if (i < 10) { inputs[i]['contribution'] = current_score / params.risk_cap; results['risk_inputs'].add(inputs[i]); } results['category_1_score'] += current_score; results['category_1_count'] += 1; results['score'] += current_score;}results['score'] *= params.global_identifier_type_weight;results['normalized_score'] = results['score'] / params.risk_cap;return results;", - } - `); - }); -}); diff --git a/x-pack/plugins/security_solution/server/lib/jest.config.js b/x-pack/plugins/security_solution/server/lib/jest.config.js deleted file mode 100644 index dd07f905422b3..0000000000000 --- a/x-pack/plugins/security_solution/server/lib/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/server/lib'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/server/lib', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/server/lib/**/*.{ts,tsx}'], - moduleNameMapper: require('../__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/graph.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/graph.ts deleted file mode 100644 index 942adcfcc89ec..0000000000000 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/graph.ts +++ /dev/null @@ -1,69 +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 { END, START, StateGraph } from '@langchain/langgraph'; -import { SiemMigrationRuleTranslationResult } from '../../../../../../common/siem_migrations/constants'; -import { getCreateSemanticQueryNode } from './nodes/create_semantic_query'; -import { getMatchPrebuiltRuleNode } from './nodes/match_prebuilt_rule'; -import { getProcessQueryNode } from './nodes/process_query'; - -import { migrateRuleState } from './state'; -import { getTranslateRuleGraph } from './sub_graphs/translate_rule'; -import type { MigrateRuleGraphParams, MigrateRuleState } from './types'; - -export function getRuleMigrationAgent({ - model, - inferenceClient, - ruleMigrationsRetriever, - connectorId, - logger, -}: MigrateRuleGraphParams) { - const matchPrebuiltRuleNode = getMatchPrebuiltRuleNode({ - model, - logger, - ruleMigrationsRetriever, - }); - const translationSubGraph = getTranslateRuleGraph({ - model, - inferenceClient, - ruleMigrationsRetriever, - connectorId, - logger, - }); - const createSemanticQueryNode = getCreateSemanticQueryNode({ model }); - const processQueryNode = getProcessQueryNode({ model, ruleMigrationsRetriever }); - - const siemMigrationAgentGraph = new StateGraph(migrateRuleState) - // Nodes - .addNode('processQuery', processQueryNode) - .addNode('createSemanticQuery', createSemanticQueryNode) - .addNode('matchPrebuiltRule', matchPrebuiltRuleNode) - .addNode('translationSubGraph', translationSubGraph) - // Edges - .addEdge(START, 'createSemanticQuery') - .addEdge('createSemanticQuery', 'matchPrebuiltRule') - .addConditionalEdges('matchPrebuiltRule', matchedPrebuiltRuleConditional, ['processQuery', END]) - .addEdge('processQuery', 'translationSubGraph') - .addEdge('translationSubGraph', END); - - const graph = siemMigrationAgentGraph.compile(); - graph.name = 'Rule Migration Graph'; // Customizes the name displayed in LangSmith - return graph; -} - -/* - * If the original splunk rule has no prebuilt rule match, we will start processing the query, unless it is related to input/outputlookups. - */ -const matchedPrebuiltRuleConditional = (state: MigrateRuleState) => { - if (state.elastic_rule?.prebuilt_rule_id) { - return END; - } - if (state.translation_result === SiemMigrationRuleTranslationResult.UNTRANSLATABLE) { - return END; - } - return 'processQuery'; -}; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/state.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/state.ts deleted file mode 100644 index a9047c9dc5439..0000000000000 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/state.ts +++ /dev/null @@ -1,40 +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 type { BaseMessage } from '@langchain/core/messages'; -import { Annotation, messagesStateReducer } from '@langchain/langgraph'; -import type { SiemMigrationRuleTranslationResult } from '../../../../../../common/siem_migrations/constants'; -import type { - ElasticRule, - OriginalRule, - RuleMigration, -} from '../../../../../../common/siem_migrations/model/rule_migration.gen'; - -export const migrateRuleState = Annotation.Root({ - messages: Annotation<BaseMessage[]>({ - reducer: messagesStateReducer, - default: () => [], - }), - original_rule: Annotation<OriginalRule>(), - elastic_rule: Annotation<ElasticRule>({ - reducer: (state, action) => ({ ...state, ...action }), - }), - semantic_query: Annotation<string>({ - reducer: (current, value) => value ?? current, - default: () => '', - }), - inline_query: Annotation<string>({ - reducer: (current, value) => value ?? current, - default: () => '', - }), - translation_result: Annotation<SiemMigrationRuleTranslationResult>(), - comments: Annotation<RuleMigration['comments']>({ - reducer: (current, value) => (value ? (current ?? []).concat(value) : current), - default: () => [], - }), - response: Annotation<string>(), -}); diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/graph.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/graph.ts deleted file mode 100644 index 463de671552c1..0000000000000 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/graph.ts +++ /dev/null @@ -1,80 +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 { END, START, StateGraph } from '@langchain/langgraph'; -import { isEmpty } from 'lodash/fp'; -import { SiemMigrationRuleTranslationResult } from '../../../../../../../../common/siem_migrations/constants'; -import { getEcsMappingNode } from './nodes/ecs_mapping'; -import { getFilterIndexPatternsNode } from './nodes/filter_index_patterns'; -import { getFixQueryErrorsNode } from './nodes/fix_query_errors'; -import { getRetrieveIntegrationsNode } from './nodes/retrieve_integrations'; -import { getTranslateRuleNode } from './nodes/translate_rule'; -import { getValidationNode } from './nodes/validation'; -import { translateRuleState } from './state'; -import type { TranslateRuleGraphParams, TranslateRuleState } from './types'; - -// How many times we will try to self-heal when validation fails, to prevent infinite graph recursions -const MAX_VALIDATION_ITERATIONS = 3; - -export function getTranslateRuleGraph({ - model, - inferenceClient, - connectorId, - ruleMigrationsRetriever, - logger, -}: TranslateRuleGraphParams) { - const translateRuleNode = getTranslateRuleNode({ - inferenceClient, - connectorId, - logger, - }); - const validationNode = getValidationNode({ logger }); - const fixQueryErrorsNode = getFixQueryErrorsNode({ inferenceClient, connectorId, logger }); - const retrieveIntegrationsNode = getRetrieveIntegrationsNode({ model, ruleMigrationsRetriever }); - const ecsMappingNode = getEcsMappingNode({ inferenceClient, connectorId, logger }); - const filterIndexPatternsNode = getFilterIndexPatternsNode({ logger }); - - const translateRuleGraph = new StateGraph(translateRuleState) - // Nodes - .addNode('translateRule', translateRuleNode) - .addNode('validation', validationNode) - .addNode('fixQueryErrors', fixQueryErrorsNode) - .addNode('retrieveIntegrations', retrieveIntegrationsNode) - .addNode('ecsMapping', ecsMappingNode) - .addNode('filterIndexPatterns', filterIndexPatternsNode) - // Edges - .addEdge(START, 'retrieveIntegrations') - .addEdge('retrieveIntegrations', 'translateRule') - .addEdge('translateRule', 'validation') - .addEdge('fixQueryErrors', 'validation') - .addEdge('ecsMapping', 'validation') - .addConditionalEdges('validation', validationRouter, [ - 'fixQueryErrors', - 'ecsMapping', - 'filterIndexPatterns', - ]) - .addEdge('filterIndexPatterns', END); - - const graph = translateRuleGraph.compile(); - graph.name = 'Translate Rule Graph'; - return graph; -} - -const validationRouter = (state: TranslateRuleState) => { - if ( - state.validation_errors.iterations <= MAX_VALIDATION_ITERATIONS && - state.translation_result === SiemMigrationRuleTranslationResult.FULL - ) { - if (!isEmpty(state.validation_errors?.esql_errors)) { - return 'fixQueryErrors'; - } - if (!state.translation_finalized) { - return 'ecsMapping'; - } - } - return 'filterIndexPatterns'; -}; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/state.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/state.ts deleted file mode 100644 index ea46238002178..0000000000000 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/state.ts +++ /dev/null @@ -1,61 +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 type { BaseMessage } from '@langchain/core/messages'; -import { Annotation, messagesStateReducer } from '@langchain/langgraph'; -import { SiemMigrationRuleTranslationResult } from '../../../../../../../../common/siem_migrations/constants'; -import type { - ElasticRule, - OriginalRule, - RuleMigration, -} from '../../../../../../../../common/siem_migrations/model/rule_migration.gen'; -import type { Integration } from '../../../../types'; -import type { TranslateRuleValidationErrors } from './types'; - -export const translateRuleState = Annotation.Root({ - messages: Annotation<BaseMessage[]>({ - reducer: messagesStateReducer, - default: () => [], - }), - original_rule: Annotation<OriginalRule>(), - integration: Annotation<Integration>({ - reducer: (current, value) => value ?? current, - default: () => ({} as Integration), - }), - translation_finalized: Annotation<boolean>({ - reducer: (current, value) => value ?? current, - default: () => false, - }), - inline_query: Annotation<string>({ - reducer: (current, value) => value ?? current, - default: () => '', - }), - semantic_query: Annotation<string>({ - reducer: (current, value) => value ?? current, - default: () => '', - }), - elastic_rule: Annotation<ElasticRule>({ - reducer: (state, action) => ({ ...state, ...action }), - default: () => ({} as ElasticRule), - }), - validation_errors: Annotation<TranslateRuleValidationErrors>({ - reducer: (current, value) => value ?? current, - default: () => ({ iterations: 0 } as TranslateRuleValidationErrors), - }), - translation_result: Annotation<SiemMigrationRuleTranslationResult>({ - reducer: (current, value) => value ?? current, - default: () => SiemMigrationRuleTranslationResult.UNTRANSLATABLE, - }), - comments: Annotation<RuleMigration['comments']>({ - reducer: (current, value) => (value ? (current ?? []).concat(value) : current), - default: () => [], - }), - response: Annotation<string>({ - reducer: (current, value) => value ?? current, - default: () => '', - }), -}); diff --git a/x-pack/plugins/security_solution/server/lists_integration/jest.config.js b/x-pack/plugins/security_solution/server/lists_integration/jest.config.js deleted file mode 100644 index f2b4a98984bbd..0000000000000 --- a/x-pack/plugins/security_solution/server/lists_integration/jest.config.js +++ /dev/null @@ -1,19 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/server/lists_integration'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/server/lists_integration', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution/server/lists_integration/**/*.{ts,tsx}', - ], - moduleNameMapper: require('../__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/server/search_strategy/jest.config.js b/x-pack/plugins/security_solution/server/search_strategy/jest.config.js deleted file mode 100644 index 9e17c9c3ae186..0000000000000 --- a/x-pack/plugins/security_solution/server/search_strategy/jest.config.js +++ /dev/null @@ -1,19 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/server/search_strategy'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/server/search_strategy', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution/server/search_strategy/**/*.{ts,tsx}', - ], - moduleNameMapper: require('../__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/server/usage/jest.config.js b/x-pack/plugins/security_solution/server/usage/jest.config.js deleted file mode 100644 index 4041e8f66d7c8..0000000000000 --- a/x-pack/plugins/security_solution/server/usage/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/server/usage'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/server/usage', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/server/usage/**/*.{ts,tsx}'], - moduleNameMapper: require('../__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/server/utils/jest.config.js b/x-pack/plugins/security_solution/server/utils/jest.config.js deleted file mode 100644 index 2e1817b0b4071..0000000000000 --- a/x-pack/plugins/security_solution/server/utils/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution/server/utils'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/server/utils', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/server/utils/**/*.{ts,tsx}'], - moduleNameMapper: require('../__mocks__/module_name_map'), -}; diff --git a/x-pack/plugins/security_solution/tsconfig.json b/x-pack/plugins/security_solution/tsconfig.json deleted file mode 100644 index 7767fffe69824..0000000000000 --- a/x-pack/plugins/security_solution/tsconfig.json +++ /dev/null @@ -1,239 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - "scripts/**/*", - // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 - "common/**/*.json", - "server/**/*.json", - "scripts/**/*.json", - "public/**/*.json", - "../../../typings/**/*" - ], - "exclude": [ - "target/**/*", - "**/cypress/**", - "public/management/cypress.config.ts" - ], - "kbn_references": [ - "@kbn/core", - { - "path": "../../../src/setup_node_env/tsconfig.json" - }, - "@kbn/data-plugin", - "@kbn/embeddable-plugin", - "@kbn/files-plugin", - "@kbn/home-plugin", - "@kbn/inspector-plugin", - "@kbn/ui-actions-plugin", - "@kbn/newsfeed-plugin", - "@kbn/usage-collection-plugin", - "@kbn/telemetry-plugin", - "@kbn/data-view-field-editor-plugin", - "@kbn/unified-search-plugin", - "@kbn/actions-plugin", - "@kbn/alerting-plugin", - "@kbn/cases-plugin", - "@kbn/cloud-security-posture-plugin", - "@kbn/encrypted-saved-objects-plugin", - "@kbn/features-plugin", - "@kbn/fleet-plugin", - "@kbn/kubernetes-security-plugin", - "@kbn/licensing-plugin", - "@kbn/lists-plugin", - "@kbn/maps-plugin", - "@kbn/ml-plugin", - "@kbn/osquery-plugin", - "@kbn/session-view-plugin", - "@kbn/security-plugin", - "@kbn/spaces-plugin", - "@kbn/threat-intelligence-plugin", - "@kbn/timelines-plugin", - "@kbn/es-query", - "@kbn/utility-types", - "@kbn/securitysolution-list-utils", - "@kbn/securitysolution-io-ts-list-types", - "@kbn/securitysolution-io-ts-alerting-types", - "@kbn/test", - "@kbn/std", - "@kbn/rule-data-utils", - "@kbn/securitysolution-t-grid", - "@kbn/rule-registry-plugin", - "@kbn/securitysolution-utils", - "@kbn/securitysolution-list-constants", - "@kbn/config-schema", - "@kbn/triggers-actions-ui-plugin", - "@kbn/securitysolution-io-ts-types", - "@kbn/securitysolution-io-ts-utils", - "@kbn/osquery-io-ts-types", - "@kbn/core-capabilities-common", - "@kbn/es-ui-shared-plugin", - "@kbn/i18n", - "@kbn/kibana-utils-plugin", - "@kbn/lens-plugin", - "@kbn/dashboard-plugin", - "@kbn/saved-objects-tagging-oss-plugin", - "@kbn/guided-onboarding-plugin", - "@kbn/i18n-react", - "@kbn/kibana-react-plugin", - "@kbn/ecs-data-quality-dashboard", - "@kbn/elastic-assistant", - "@kbn/elastic-assistant-plugin", - "@kbn/data-views-plugin", - "@kbn/datemath", - "@kbn/ui-theme", - "@kbn/securitysolution-list-api", - "@kbn/core-http-browser", - "@kbn/core-http-browser-mocks", - "@kbn/securitysolution-list-hooks", - "@kbn/securitysolution-exception-list-components", - "@kbn/securitysolution-exceptions-common", - "@kbn/rison", - "@kbn/shared-ux-page-kibana-template", - "@kbn/securitysolution-hook-utils", - "@kbn/test-jest-helpers", - "@kbn/safer-lodash-set", - "@kbn/securitysolution-autocomplete", - "@kbn/core-application-browser", - "@kbn/expect", - "@kbn/share-plugin", - "@kbn/analytics", - "@kbn/core-notifications-browser", - "@kbn/doc-links", - "@kbn/react-field", - "@kbn/field-types", - "@kbn/securitysolution-rules", - "@kbn/cases-components", - "@kbn/event-log-plugin", - "@kbn/task-manager-plugin", - "@kbn/cloud-plugin", - "@kbn/core-saved-objects-utils-server", - "@kbn/core-http-router-server-mocks", - "@kbn/core-elasticsearch-client-server-mocks", - "@kbn/apm-utils", - "@kbn/core-saved-objects-server", - "@kbn/es-types", - "@kbn/utils", - "@kbn/logging-mocks", - "@kbn/securitysolution-es-utils", - "@kbn/logging", - "@kbn/utility-types-jest", - "@kbn/core-elasticsearch-server", - "@kbn/core-saved-objects-api-server", - "@kbn/core-http-server", - "@kbn/dev-cli-runner", - "@kbn/dev-cli-errors", - "@kbn/dev-utils", - "@kbn/tooling-log", - "@kbn/core-status-common", - "@kbn/repo-info", - "@kbn/storybook", - "@kbn/controls-plugin", - "@kbn/core-saved-objects-common", - "@kbn/core-saved-objects-import-export-server-mocks", - "@kbn/user-profile-components", - "@kbn/guided-onboarding", - "@kbn/securitysolution-ecs", - "@kbn/cell-actions", - "@kbn/shared-ux-router", - "@kbn/charts-plugin", - "@kbn/alerts-as-data-utils", - "@kbn/cloud-defend-plugin", - "@kbn/expandable-flyout", - "@kbn/grouping", - "@kbn/securitysolution-data-table", - "@kbn/core-analytics-server", - "@kbn/security-solution-side-nav", - "@kbn/ml-anomaly-utils", - "@kbn/discover-plugin", - "@kbn/field-formats-plugin", - "@kbn/expressions-plugin", - "@kbn/dev-proc-runner", - "@kbn/alerts-ui-shared", - "@kbn/security-solution-navigation", - "@kbn/security-solution-upselling", - "@kbn/discover-plugin", - "@kbn/data-view-editor-plugin", - "@kbn/alerts-ui-shared", - "@kbn/saved-search-plugin", - "@kbn/unified-histogram-plugin", - "@kbn/navigation-plugin", - "@kbn/core-logging-server-mocks", - "@kbn/core-lifecycle-browser", - "@kbn/security-solution-features", - "@kbn/content-management-plugin", - "@kbn/discover-utils", - "@kbn/core-application-common", - "@kbn/openapi-generator", - "@kbn/openapi-bundler", - "@kbn/es", - "@kbn/react-kibana-mount", - "@kbn/react-kibana-context-styled", - "@kbn/unified-doc-viewer-plugin", - "@kbn/openapi-generator", - "@kbn/unified-data-table", - "@kbn/unified-doc-viewer", - "@kbn/dom-drag-drop", - "@kbn/unified-field-list", - "@kbn/resizable-layout", - "@kbn/zod-helpers", - "@kbn/core-http-common", - "@kbn/search-errors", - "@kbn/stack-connectors-plugin", - "@kbn/elastic-assistant-common", - "@kbn/core-elasticsearch-server-mocks", - "@kbn/lens-embeddable-utils", - "@kbn/esql-utils", - "@kbn/core-test-helpers-kbn-server", - "@kbn/core-ui-settings-server", - "@kbn/core-http-request-handler-context-server", - "@kbn/core-http-server-mocks", - "@kbn/data-service", - "@kbn/core-chrome-browser", - "@kbn/shared-ux-chrome-navigation", - "@kbn/core-ui-settings-browser-mocks", - "@kbn/management-plugin", - "@kbn/security-plugin-types-server", - "@kbn/deeplinks-security", - "@kbn/react-kibana-context-render", - "@kbn/search-types", - "@kbn/field-utils", - "@kbn/core-saved-objects-api-server-mocks", - "@kbn/core-analytics-browser", - "@kbn/core-i18n-browser", - "@kbn/core-theme-browser", - "@kbn/integration-assistant-plugin", - "@kbn/avc-banner", - "@kbn/config", - "@kbn/openapi-common", - "@kbn/securitysolution-lists-common", - "@kbn/cbor", - "@kbn/zod", - "@kbn/cloud-security-posture", - "@kbn/security-solution-distribution-bar", - "@kbn/cloud-security-posture-common", - "@kbn/cloud-security-posture-graph", - "@kbn/presentation-publishing", - "@kbn/entityManager-plugin", - "@kbn/entities-schema", - "@kbn/inference-plugin", - "@kbn/core-saved-objects-server-mocks", - "@kbn/core-security-server-mocks", - "@kbn/serverless", - "@kbn/core-user-profile-browser", - "@kbn/data-stream-adapter", - "@kbn/core-lifecycle-server", - "@kbn/core-user-profile-common", - "@kbn/langchain", - "@kbn/discover-shared-plugin", - "@kbn/react-hooks", - "@kbn/index-adapter", - "@kbn/core-http-server-utils", - "@kbn/llm-tasks-plugin" - ] -} diff --git a/x-pack/plugins/security_solution_ess/README.md b/x-pack/plugins/security_solution_ess/README.md deleted file mode 100755 index ee0dbe2250b9a..0000000000000 --- a/x-pack/plugins/security_solution_ess/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# **Security Solution ESS Plugin** - -## **Table of Contents** -- [Introduction](#introduction) -- [Purpose](#purpose) -- [Architecture](#architecture) -- [Contributing](#contributing) -- [License](#license) - -## **Introduction** -The `security_solution_ess` plugin is an internal plugin for Kibana's Security Solution, designed to encapsulate ESS-specific logic. -This plugin is only enabled when the application is built for stateful deployments (ESS or on-prem), keeping the main `security_solution` plugin clean and agnostic of the offering model. - -> The term ESS used by this plugin is not strictly referring to Cloud deployments, it's used to refer to all stateful deployments (non-serverless), including on-prem instances. - -## **Purpose** -The primary goal of the `security_solution_ess` plugin is to: -- Isolate ess-specific code and configuration from the main `security_solution` plugin. -- Enable seamless integration with the non-serverless environment without affecting the serverless build of the Security Solution. -- Provide a modular approach by encapsulating ess-related functionality, thereby maintaining the codebase's cleanliness and modularity. - -## **Architecture** -The `security_solution_ess` plugin depends on the main `security_solution` plugin, it can import code from it though the use of agnostic packages is preferred, and they interact through the plugin lifecycle contract. -This architecture allows the `security_solution_ess` plugin to: -- Modify the behavior of the main plugin by providing ess-specific content. -- Ensure that the `security_solution` plugin remains offering-agnostic by using APIs for ess-specific behavior only when necessary. - -### **Plugin Interaction** -- **Generic Plugin (`security_solution`)**: Exposes an API in its plugin lifecycle contract for components and configurations that depend on the offering. -- **ESS Plugin (`security_solution_ess`)**: Utilizes the exposed API to inject or modify the application according to ess-specific content and logic. -- **Other Plugins**: Other plugins may also expose contract APIs to configure ess-specific content for Security. - -#### **Example** - -The following example demonstrates how the `security_solution_ess` plugin interacts with the main `security_solution` plugin via a contract API. - -It exposes a setter to the contract API for `usersUrl`, which is an offering-specific value. The `security_solution_ess` plugin uses these APIs to inject the ess-specific URL into the main plugin. - -The `PluginContract` class in the main Security Solution plugin simplifies the usage of contract APIs, storing the values and providing a getter to the application using the Kibana services context. - -___security_solution/public/plugin_contract.ts___ -```typescript -export class PluginContract { - usersUrl: string; - - public getStartContract() { - return { - setUsersUrl: (url: string) => { - this.usersUrl = url; - } - }; - } - - public getStartServices() { - return { - getUsersUrl: () => this.usersUrl; // available via useKibana().services.getUsersUrl() - }; - } -} -``` - -___security_solution_ess/public/plugin.ts___ -```typescript -export class Plugin { - - public start(core: CoreStart, deps: SecuritySolutionEssStartDeps) { - deps.securitySolution.setUsersUrl(deps.application.getUrlForApp('management', { path: 'security/users' })); - } -} -``` - -## **Contributing** -If you're looking to contribute to this plugin, please follow the standard contribution guidelines of the Security Solution plugin. Ensure that all changes are tested in a ESS environment. - -## **License** -This plugin is licensed under the Elastic License. See the [LICENSE](../../../LICENSE.txt) file for more details. diff --git a/x-pack/plugins/security_solution_ess/jest.config.dev.js b/x-pack/plugins/security_solution_ess/jest.config.dev.js deleted file mode 100644 index 6ac2f96f95f04..0000000000000 --- a/x-pack/plugins/security_solution_ess/jest.config.dev.js +++ /dev/null @@ -1,12 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../', - projects: ['<rootDir>/x-pack/plugins/security_solution_ess/public/jest.config.js'], -}; diff --git a/x-pack/plugins/security_solution_ess/package.json b/x-pack/plugins/security_solution_ess/package.json deleted file mode 100644 index e7ab99edd6a2a..0000000000000 --- a/x-pack/plugins/security_solution_ess/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "@kbn/security-solution-ess", - "version": "1.0.0", - "license": "Elastic License 2.0", - "private": true, - "scripts": { - "build": "yarn plugin-helpers build", - "plugin-helpers": "node ../../../scripts/plugin_helpers", - "kbn": "node ../../../scripts/kbn" - } -} diff --git a/x-pack/plugins/security_solution_ess/public/jest.config.js b/x-pack/plugins/security_solution_ess/public/jest.config.js deleted file mode 100644 index fac3d4ceba420..0000000000000 --- a/x-pack/plugins/security_solution_ess/public/jest.config.js +++ /dev/null @@ -1,26 +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. - */ -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - /** all nested directories have their own Jest config file */ - testMatch: ['<rootDir>/x-pack/plugins/security_solution_ess/public/**/*.test.{js,mjs,ts,tsx}'], - roots: ['<rootDir>/x-pack/plugins/security_solution_ess/public'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution_ess/public', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution_ess/public/**/*.{ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution_ess/public/*.test.{ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution_ess/public/{__test__,__snapshots__,__examples__,*mock*,tests,test_helpers,integration_tests,types}/**/*', - '!<rootDir>/x-pack/plugins/security_solution_ess/public/*mock*.{ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution_ess/public/*.test.{ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution_ess/public/*.d.ts', - '!<rootDir>/x-pack/plugins/security_solution_ess/public/*.config.ts', - '!<rootDir>/x-pack/plugins/security_solution_ess/public/index.{js,ts,tsx}', - ], -}; diff --git a/x-pack/plugins/security_solution_ess/tsconfig.json b/x-pack/plugins/security_solution_ess/tsconfig.json deleted file mode 100644 index 6409a15bd7d27..0000000000000 --- a/x-pack/plugins/security_solution_ess/tsconfig.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "index.ts", - "common/**/*.ts", - "public/**/*.ts", - "public/**/*.tsx", - "server/**/*.ts", - "../../../typings/**/*" - ], - "exclude": ["target/**/*"], - "kbn_references": [ - "@kbn/core", - "@kbn/config-schema", - "@kbn/security-solution-plugin", - "@kbn/kibana-react-plugin", - "@kbn/security-solution-features", - "@kbn/cases-plugin", - "@kbn/security-solution-navigation", - "@kbn/licensing-plugin", - "@kbn/security-solution-upselling", - "@kbn/i18n", - "@kbn/navigation-plugin", - "@kbn/management-plugin", - "@kbn/core-chrome-browser", - ] -} diff --git a/x-pack/plugins/security_solution_serverless/README.md b/x-pack/plugins/security_solution_serverless/README.md deleted file mode 100755 index 27d541dd659da..0000000000000 --- a/x-pack/plugins/security_solution_serverless/README.md +++ /dev/null @@ -1,78 +0,0 @@ -# **Security Solution Serverless Plugin** - -## **Table of Contents** -- [Introduction](#introduction) -- [Purpose](#purpose) -- [Architecture](#architecture) -- [Contributing](#contributing) -- [License](#license) - -## **Introduction** -The `security_solution_serverless` plugin is an internal plugin for Kibana's Security Solution, designed to encapsulate serverless-specific logic. -This plugin is only enabled when the application is built for serverless project, keeping the main `security_solution` plugin clean and agnostic of the offering model. - -This plugin contains configuration and code used to create a Serverless Security project. -It leverages universal configuration and other APIs in the [`serverless`](../serverless/README.mdx) plugin to configure Kibana. - -## **Purpose** -The primary goal of the `security_solution_serverless` plugin is to: -- Isolate serverless-specific code and configuration from the main `security_solution` plugin. -- Enable seamless integration with the serverless environment without affecting the non-serverless build of the Security Solution. -- Provide a modular approach by encapsulating serverless-related functionality, thereby maintaining the codebase's cleanliness and modularity. - -## **Architecture** -The `security_solution_serverless` plugin depends on the main `security_solution` plugin, it can import code from it thought the use of agnostic packages is preferred, -and they interact through the plugin lifecycle contract. -This architecture allows the `security_solution_serverless` plugin to: -- Modify the behavior of the main plugin by providing serverless-specific content. -- Ensure that the `security_solution` plugin remains offering-agnostic by using APIs for serverless-specific behavior only when necessary. - -### **Plugin Interaction** -- **Generic Plugin (`security_solution`)**: Exposes an API in its plugin lifecycle contract for components and configurations that depend on the offering. -- **Serverless Plugin (`security_solution_serverless`)**: Utilizes the exposed API to inject or modify the application according to serverless-specific content and logic. -- **Other Plugins**: Other plugins may also expose contract APIs to configure serverless-specific content for Security. - -#### **Example** - -The following example demonstrates how the `security_solution_serverless` plugin interacts with the main `security_solution` plugin via a contract API. - -It exposes a setter to the contract API for `usersUrl`, which is an offering-specific value. The `security_solution_serverless` plugin uses these APIs to inject the serverless-specific URL into the main plugin. - -The `PluginContract` class in the main Security Solution plugin simplifies the usage of contract APIs, storing the values and providing a getter to the application using the Kibana services context. - -___security_solution/public/plugin_contract.ts___ -```typescript -export class PluginContract { - usersUrl: string; - - public getStartContract() { - return { - setUsersUrl: (url: string) => { - this.usersUrl = url; - } - }; - } - - public getStartServices() { - return { - getUsersUrl: () => this.usersUrl; // available via useKibana().services.getUsersUrl() - }; - } -} -``` - -___security_solution_serverless/public/plugin.ts___ -```typescript -export class Plugin { - - public start(core: CoreStart, deps: SecuritySolutionServerlessStartDeps) { - deps.securitySolution.setUsersUrl(deps.cloud.usersAndRolesUrl); - } -} -``` - -## **Contributing** -If you're looking to contribute to this plugin, please follow the standard contribution guidelines of the Security Solution plugin. Ensure that all changes are tested in a serverless environment. - -## **License** -This plugin is licensed under the Elastic License. See the [LICENSE](../../../LICENSE.txt) file for more details. diff --git a/x-pack/plugins/security_solution_serverless/common/config.ts b/x-pack/plugins/security_solution_serverless/common/config.ts deleted file mode 100644 index f4e9151988a60..0000000000000 --- a/x-pack/plugins/security_solution_serverless/common/config.ts +++ /dev/null @@ -1,56 +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 { schema, type TypeOf } from '@kbn/config-schema'; -import { ProductLine, ProductTier } from './product'; - -export const productLine = schema.oneOf([ - schema.literal(ProductLine.security), - schema.literal(ProductLine.endpoint), - schema.literal(ProductLine.cloud), -]); - -export type SecurityProductLine = TypeOf<typeof productLine>; - -export const productTier = schema.oneOf([ - schema.literal(ProductTier.essentials), - schema.literal(ProductTier.complete), -]); -export type SecurityProductTier = TypeOf<typeof productTier>; - -export const productType = schema.object({ - product_line: productLine, - product_tier: productTier, -}); -export type SecurityProductType = TypeOf<typeof productType>; - -export const productTypes = schema.arrayOf<SecurityProductType>(productType, { - defaultValue: [], -}); -export type SecurityProductTypes = TypeOf<typeof productTypes>; - -export const configSchema = schema.object({ - enabled: schema.boolean({ defaultValue: false }), - productTypes, - /** - * For internal use. A list of string values (comma delimited) that will enable experimental - * type of functionality that is not yet released. Valid values for this settings need to - * be defined in: - * `x-pack/plugins/security_solution_serverless/common/experimental_features.ts` - * under the `allowedExperimentalValues` object - * - * @example - * xpack.securitySolutionServerless.enableExperimental: - * - someCrazyFeature - * - someEvenCrazierFeature - */ - enableExperimental: schema.arrayOf(schema.string(), { - defaultValue: () => [], - }), -}); - -export type ServerlessSecurityConfigSchema = TypeOf<typeof configSchema>; diff --git a/x-pack/plugins/security_solution_serverless/common/jest.config.js b/x-pack/plugins/security_solution_serverless/common/jest.config.js deleted file mode 100644 index 01ea1139d6e44..0000000000000 --- a/x-pack/plugins/security_solution_serverless/common/jest.config.js +++ /dev/null @@ -1,28 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution_serverless/common'], - testMatch: [ - '<rootDir>/x-pack/plugins/security_solution_serverless/common/**/*.test.{js,mjs,ts,tsx}', - ], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution_serverless/common', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution_serverless/common/**/*.{ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution_serverless/common/*.test.{ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution_serverless/common/{__test__,__snapshots__,__examples__,*mock*,tests,test_helpers,integration_tests,types}/**/*', - '!<rootDir>/x-pack/plugins/security_solution_serverless/common/*mock*.{ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution_serverless/common/*.test.{ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution_serverless/common/*.d.ts', - '!<rootDir>/x-pack/plugins/security_solution_serverless/common/*.config.ts', - '!<rootDir>/x-pack/plugins/security_solution_serverless/common/index.{js,ts,tsx}', - ], -}; diff --git a/x-pack/plugins/security_solution_serverless/jest.config.dev.js b/x-pack/plugins/security_solution_serverless/jest.config.dev.js deleted file mode 100644 index 2591fcc775ab0..0000000000000 --- a/x-pack/plugins/security_solution_serverless/jest.config.dev.js +++ /dev/null @@ -1,12 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../', - projects: ['<rootDir>/x-pack/plugins/security_solution_serverless/public/jest.config.js'], -}; diff --git a/x-pack/plugins/security_solution_serverless/package.json b/x-pack/plugins/security_solution_serverless/package.json deleted file mode 100644 index 745afbe7d97c6..0000000000000 --- a/x-pack/plugins/security_solution_serverless/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "@kbn/security-solution-serverless", - "version": "1.0.0", - "license": "Elastic License 2.0", - "private": true, - "scripts": { - "build": "yarn plugin-helpers build", - "plugin-helpers": "node ../../../scripts/plugin_helpers", - "kbn": "node ../../../scripts/kbn" - } -} \ No newline at end of file diff --git a/x-pack/plugins/security_solution_serverless/public/jest.config.js b/x-pack/plugins/security_solution_serverless/public/jest.config.js deleted file mode 100644 index cf3ad9340c14d..0000000000000 --- a/x-pack/plugins/security_solution_serverless/public/jest.config.js +++ /dev/null @@ -1,29 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - /** all nested directories have their own Jest config file */ - testMatch: [ - '<rootDir>/x-pack/plugins/security_solution_serverless/public/**/*.test.{js,mjs,ts,tsx}', - ], - roots: ['<rootDir>/x-pack/plugins/security_solution_serverless/public'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution_serverless/public', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/security_solution_serverless/public/**/*.{ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution_serverless/public/*.test.{ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution_serverless/public/{__test__,__snapshots__,__examples__,*mock*,tests,test_helpers,integration_tests,types}/**/*', - '!<rootDir>/x-pack/plugins/security_solution_serverless/public/*mock*.{ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution_serverless/public/*.test.{ts,tsx}', - '!<rootDir>/x-pack/plugins/security_solution_serverless/public/*.d.ts', - '!<rootDir>/x-pack/plugins/security_solution_serverless/public/*.config.ts', - '!<rootDir>/x-pack/plugins/security_solution_serverless/public/index.{js,ts,tsx}', - ], -}; diff --git a/x-pack/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering_task.test.ts b/x-pack/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering_task.test.ts deleted file mode 100644 index 6d55e52469283..0000000000000 --- a/x-pack/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering_task.test.ts +++ /dev/null @@ -1,508 +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 Chance from 'chance'; -import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; - -import { getCloudProductTier } from './cloud_security_metering'; -import { - getCloudSecurityUsageRecord, - getSearchQueryByCloudSecuritySolution, -} from './cloud_security_metering_task'; - -import type { ServerlessSecurityConfig } from '../config'; - -import type { ProductTier } from '../../common/product'; -import { - CLOUD_SECURITY_TASK_TYPE, - CSPM, - KSPM, - CNVM, - CLOUD_DEFEND, - BILLABLE_ASSETS_CONFIG, -} from './constants'; -import { getCloudDefendUsageRecords } from './defend_for_containers_metering'; - -const mockEsClient = elasticsearchServiceMock.createStart().client.asInternalUser; -const logger: ReturnType<typeof loggingSystemMock.createLogger> = loggingSystemMock.createLogger(); -const chance = new Chance(); - -const cloudSecuritySolutions: Array<typeof CSPM | typeof KSPM> = [CSPM, KSPM]; - -describe('getCloudSecurityUsageRecord', () => { - beforeEach(() => { - jest.resetAllMocks(); - }); - - it('should return undefined if cloudSecuritySolution is missing', async () => { - // Mock Elasticsearch search to throw an error - mockEsClient.search.mockRejectedValue({}); - - const projectId = chance.guid(); - const taskId = chance.guid(); - const cloudSecuritySolution = CSPM; - - const tier = 'essentials' as ProductTier; - - const result = await getCloudSecurityUsageRecord({ - esClient: mockEsClient, - projectId, - logger, - taskId, - lastSuccessfulReport: new Date(), - cloudSecuritySolution, - tier, - }); - - expect(result).toBeUndefined(); - }); - - test.each(cloudSecuritySolutions)( - 'should return usageRecords with correct values for cspm and kspm when Elasticsearch response has aggregations', - async (cloudSecuritySolution) => { - // @ts-ignore - mockEsClient.search.mockResolvedValueOnce({ - hits: { hits: [{ _id: 'someRecord', _index: 'mockIndex' }] }, // mocking for indexHasDataInDateRange - }); - const randomIndex = Math.floor( - Math.random() * BILLABLE_ASSETS_CONFIG[cloudSecuritySolution].values.length - ); - const randomBillableAsset = BILLABLE_ASSETS_CONFIG[cloudSecuritySolution].values[randomIndex]; - - // @ts-ignore - mockEsClient.search.mockResolvedValueOnce({ - aggregations: { - resource_sub_type: { - buckets: [ - { - key: randomBillableAsset, - doc_count: 100, - unique_assets: { value: 10 }, - }, - { - key: 'not_billable_asset', - doc_count: 50, - unique_assets: { value: 11 }, - }, - ], - }, - min_timestamp: { - value_as_string: '2023-07-30T15:11:41.738Z', - }, - }, - }); - - const projectId = chance.guid(); - const taskId = chance.guid(); - - const tier = 'essentials' as ProductTier; - - const result = await getCloudSecurityUsageRecord({ - esClient: mockEsClient, - projectId, - logger, - taskId, - lastSuccessfulReport: new Date(), - cloudSecuritySolution, - tier, - }); - - expect(result).toEqual([ - { - id: expect.stringContaining( - `${CLOUD_SECURITY_TASK_TYPE}_${cloudSecuritySolution}_${projectId}` - ), - usage_timestamp: '2023-07-30T15:11:41.738Z', - creation_timestamp: expect.any(String), // Expect a valid ISO string - usage: { - type: CLOUD_SECURITY_TASK_TYPE, - sub_type: cloudSecuritySolution, - quantity: 10, - period_seconds: expect.any(Number), - metadata: { - [randomBillableAsset]: '10', - not_billable_asset: '11', - }, - }, - source: { - id: taskId, - instance_group_id: projectId, - metadata: { - tier: 'essentials', - }, - }, - }, - ]); - } - ); - - it('should return usageRecords with correct values for cnvm when Elasticsearch response has aggregations', async () => { - const cloudSecuritySolution = CNVM; - - // @ts-ignore - mockEsClient.search.mockResolvedValueOnce({ - hits: { hits: [{ _id: 'someRecord', _index: 'mockIndex' }] }, // mocking for indexHasDataInDateRange - }); - - // @ts-ignore - mockEsClient.search.mockResolvedValueOnce({ - aggregations: { - unique_assets: { - value: 10, - }, - min_timestamp: { - value_as_string: '2023-07-30T15:11:41.738Z', - }, - }, - }); - - const projectId = chance.guid(); - const taskId = chance.guid(); - - const tier = 'essentials' as ProductTier; - const result = await getCloudSecurityUsageRecord({ - esClient: mockEsClient, - projectId, - logger, - taskId, - lastSuccessfulReport: new Date(), - cloudSecuritySolution, - tier, - }); - - expect(result).toEqual([ - { - id: expect.stringContaining(`${CLOUD_SECURITY_TASK_TYPE}_cnvm_${projectId}`), - usage_timestamp: '2023-07-30T15:11:41.738Z', - creation_timestamp: expect.any(String), // Expect a valid ISO string - usage: { - type: CLOUD_SECURITY_TASK_TYPE, - sub_type: CNVM, - quantity: 10, - period_seconds: expect.any(Number), - }, - source: { - id: taskId, - instance_group_id: projectId, - metadata: { - tier: 'essentials', - }, - }, - }, - ]); - }); - - it('should return undefined when Elasticsearch response does not have aggregations', async () => { - // @ts-ignore - mockEsClient.search.mockResolvedValue({}); - - const projectId = chance.guid(); - const taskId = chance.guid(); - const cloudSecuritySolution = CSPM; - - const tier = 'essentials' as ProductTier; - - const result = await getCloudSecurityUsageRecord({ - esClient: mockEsClient, - projectId, - logger, - taskId, - lastSuccessfulReport: new Date(), - cloudSecuritySolution, - tier, - }); - - expect(result).toBeUndefined(); - }); - - it('should return undefined if an error occurs during Elasticsearch search', async () => { - // Mock Elasticsearch search to throw an error - mockEsClient.search.mockRejectedValue(new Error('Elasticsearch search error')); - - const projectId = chance.guid(); - const taskId = chance.guid(); - const cloudSecuritySolution = CSPM; - - const tier = 'essentials' as ProductTier; - - const result = await getCloudSecurityUsageRecord({ - esClient: mockEsClient, - projectId, - logger, - taskId, - lastSuccessfulReport: new Date(), - cloudSecuritySolution, - tier, - }); - - expect(result).toBeUndefined(); - }); -}); - -describe('getSearchQueryByCloudSecuritySolution', () => { - it('should return the correct search query for CSPM', () => { - const result = getSearchQueryByCloudSecuritySolution('cspm'); - - expect(result).toEqual({ - bool: { - must: [ - { - range: { - '@timestamp': { - gte: 'now-24h', - }, - }, - }, - { - term: { - 'rule.benchmark.posture_type': 'cspm', - }, - }, - ], - }, - }); - }); - - it('should return the correct search query for KSPM', () => { - const result = getSearchQueryByCloudSecuritySolution('kspm'); - - expect(result).toEqual({ - bool: { - must: [ - { - range: { - '@timestamp': { - gte: 'now-24h', - }, - }, - }, - { - term: { - 'rule.benchmark.posture_type': 'kspm', - }, - }, - ], - }, - }); - }); - - it('should return the correct search query for CNVM', () => { - const result = getSearchQueryByCloudSecuritySolution(CNVM); - - expect(result).toEqual({ - bool: { - must: [ - { - range: { - '@timestamp': { - gte: 'now-24h', - }, - }, - }, - ], - }, - }); - }); -}); - -describe('should return the relevant product tier', () => { - it('should return the relevant product tier for cloud product line', async () => { - const serverlessSecurityConfig = { - enabled: true, - developer: {}, - productTypes: [ - { product_line: 'endpoint', product_tier: 'essentials' }, - { product_line: 'cloud', product_tier: 'complete' }, - ], - } as unknown as ServerlessSecurityConfig; - - const tier = getCloudProductTier(serverlessSecurityConfig, logger); - - expect(tier).toBe('complete'); - }); - - it('should return none tier in case cloud product line is missing ', async () => { - const serverlessSecurityConfig = { - enabled: true, - developer: {}, - productTypes: [{ product_line: 'endpoint', product_tier: 'complete' }], - } as unknown as ServerlessSecurityConfig; - - const tier = getCloudProductTier(serverlessSecurityConfig, logger); - - expect(tier).toBe('none'); - }); -}); - -describe('cloud defend metering', () => { - it('should return usageRecords with correct values', async () => { - const cloudSecuritySolution = 'cloud_defend'; - const agentId1 = chance.guid(); - const eventIngestedStr = '2024-05-28T12:10:51Z'; - const eventIngestedTimestamp = new Date(eventIngestedStr); - - // @ts-ignore - mockEsClient.search.mockResolvedValueOnce({ - hits: { - hits: [ - { - _id: 'someRecord', - _index: 'mockIndex', - _source: { - 'cloud_defend.block_action_enabled': true, - 'agent.id': agentId1, - event: { - ingested: eventIngestedStr, - }, - }, - }, - ], - }, - }); - - const projectId = chance.guid(); - const taskId = chance.guid(); - - const tier = 'essentials' as ProductTier; - - const result = await getCloudDefendUsageRecords({ - esClient: mockEsClient, - projectId, - taskId, - lastSuccessfulReport: new Date(), - cloudSecuritySolution, - logger, - tier, - }); - - const roundedIngestedTimestamp = eventIngestedTimestamp; - roundedIngestedTimestamp.setMinutes(0); - roundedIngestedTimestamp.setSeconds(0); - roundedIngestedTimestamp.setMilliseconds(0); - - expect(result).toEqual([ - { - id: expect.stringContaining( - `${projectId}_${agentId1}_${roundedIngestedTimestamp.toISOString()}` - ), - usage_timestamp: eventIngestedStr, - creation_timestamp: expect.any(String), - usage: { - type: CLOUD_SECURITY_TASK_TYPE, - sub_type: CLOUD_DEFEND, - quantity: 1, - period_seconds: 3600, - }, - source: { - id: taskId, - instance_group_id: projectId, - metadata: { - tier: 'essentials', - }, - }, - }, - ]); - }); - - it('should return an empty array when Elasticsearch returns an empty response', async () => { - // @ts-ignore - mockEsClient.search.mockResolvedValueOnce({ - hits: { - hits: [], - }, - }); - const tier = 'essentials' as ProductTier; - // Call the function with mock parameters - const result = await getCloudDefendUsageRecords({ - esClient: mockEsClient, - projectId: chance.guid(), - taskId: chance.guid(), - lastSuccessfulReport: new Date(), - cloudSecuritySolution: 'cloud_defend', - logger, - tier, - }); - - // Assert that the result is an empty array - expect(result).toEqual([]); - }); - - it('should handle errors from Elasticsearch', async () => { - // Mock Elasticsearch client's search method to throw an error - mockEsClient.search.mockRejectedValueOnce(new Error('Elasticsearch query failed')); - - const tier = 'essentials' as ProductTier; - - // Call the function with mock parameters - await getCloudDefendUsageRecords({ - esClient: mockEsClient, - projectId: chance.guid(), - taskId: chance.guid(), - lastSuccessfulReport: new Date(), - cloudSecuritySolution: 'cloud_defend', - logger, - tier, - }); - - // Assert that the logger's error method was called with the correct error message - expect(logger.error).toHaveBeenCalledWith( - 'Failed to fetch cloud_defend metering data Error: Elasticsearch query failed' - ); - }); - - it('should return usageRecords when Elasticsearch returns multiple records', async () => { - // Mock Elasticsearch response with multiple records - const agentId1 = chance.guid(); - const agentId2 = chance.guid(); - const eventIngestedStr1 = '2024-05-28T12:10:51Z'; - const eventIngestedStr2 = '2024-05-28T13:10:51Z'; - - // @ts-ignore - mockEsClient.search.mockResolvedValueOnce({ - hits: { - hits: [ - { - _id: 'record1', - _index: 'mockIndex', - _source: { - 'cloud_defend.block_action_enabled': true, - 'agent.id': agentId1, - event: { - ingested: eventIngestedStr1, - }, - }, - }, - { - _id: 'record2', - _index: 'mockIndex', - _source: { - 'cloud_defend.block_action_enabled': true, - 'agent.id': agentId2, - event: { - ingested: eventIngestedStr2, - }, - }, - }, - ], - }, - }); - const tier = 'essentials' as ProductTier; - - // Call the function with mock parameters - const result = await getCloudDefendUsageRecords({ - esClient: mockEsClient, - projectId: chance.guid(), - taskId: chance.guid(), - lastSuccessfulReport: new Date(), - cloudSecuritySolution: 'cloud_defend', - logger, - tier, - }); - - // Assert that the result contains usage records for both records - expect(result).toHaveLength(2); - }); -}); diff --git a/x-pack/plugins/security_solution_serverless/server/cloud_security/constants.ts b/x-pack/plugins/security_solution_serverless/server/cloud_security/constants.ts deleted file mode 100644 index fa98707e5ebeb..0000000000000 --- a/x-pack/plugins/security_solution_serverless/server/cloud_security/constants.ts +++ /dev/null @@ -1,76 +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 { - CSPM_POLICY_TEMPLATE, - KSPM_POLICY_TEMPLATE, - CDR_LATEST_NATIVE_MISCONFIGURATIONS_INDEX_PATTERN, - CDR_LATEST_NATIVE_VULNERABILITIES_INDEX_PATTERN, -} from '@kbn/cloud-security-posture-common'; -import { CNVM_POLICY_TEMPLATE } from '@kbn/cloud-security-posture-plugin/common/constants'; -import { INTEGRATION_PACKAGE_NAME } from '@kbn/cloud-defend-plugin/common/constants'; - -export const CLOUD_DEFEND_HEARTBEAT_INDEX = 'metrics-cloud_defend.heartbeat-*'; -export const CLOUD_SECURITY_TASK_TYPE = 'cloud_security'; -export const AGGREGATION_PRECISION_THRESHOLD = 40000; -export const ASSETS_SAMPLE_GRANULARITY = '24h'; -export const THRESHOLD_MINUTES = 30; - -export const CSPM = CSPM_POLICY_TEMPLATE; -export const KSPM = KSPM_POLICY_TEMPLATE; -export const CNVM = CNVM_POLICY_TEMPLATE; -export const CLOUD_DEFEND = INTEGRATION_PACKAGE_NAME; - -export const METERING_CONFIGS = { - [CSPM]: { - index: CDR_LATEST_NATIVE_MISCONFIGURATIONS_INDEX_PATTERN, - assets_identifier: 'resource.id', - }, - [KSPM]: { - index: CDR_LATEST_NATIVE_MISCONFIGURATIONS_INDEX_PATTERN, - assets_identifier: 'agent.id', - }, - [CNVM]: { - index: CDR_LATEST_NATIVE_VULNERABILITIES_INDEX_PATTERN, - assets_identifier: 'cloud.instance.id', - }, - [CLOUD_DEFEND]: { - index: CLOUD_DEFEND_HEARTBEAT_INDEX, - assets_identifier: 'agent.id', - }, -}; - -// see https://github.com/elastic/security-team/issues/8970 for billable asset definition -export const BILLABLE_ASSETS_CONFIG = { - [CSPM]: { - filter_attribute: 'resource.sub_type', - values: [ - // 'aws-ebs', we can't include EBS volumes until https://github.com/elastic/security-team/issues/9283 is resolved - // 'aws-ec2', we can't include EC2 instances until https://github.com/elastic/security-team/issues/9254 is resolved - 'aws-s3', - 'aws-rds', - 'azure-disk', - 'azure-document-db-database-account', - 'azure-flexible-mysql-server-db', - 'azure-flexible-postgresql-server-db', - 'azure-mysql-server-db', - 'azure-postgresql-server-db', - 'azure-sql-server', - 'azure-storage-account', - 'azure-vm', - 'gcp-bigquery-dataset', - 'gcp-compute-disk', - 'gcp-compute-instance', - 'gcp-sqladmin-instance', - 'gcp-storage-bucket', - ], - }, - [KSPM]: { - filter_attribute: 'resource.sub_type', - values: ['Node', 'node'], - }, -}; diff --git a/x-pack/plugins/security_solution_serverless/server/cloud_security/defend_for_containers_metering.ts b/x-pack/plugins/security_solution_serverless/server/cloud_security/defend_for_containers_metering.ts deleted file mode 100644 index 61240df94f9b2..0000000000000 --- a/x-pack/plugins/security_solution_serverless/server/cloud_security/defend_for_containers_metering.ts +++ /dev/null @@ -1,148 +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 type { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; -import type { - AggregationsAggregate, - SearchResponse, - SortResults, -} from '@elastic/elasticsearch/lib/api/types'; -import type { Tier, UsageRecord } from '../types'; -import type { CloudSecurityMeteringCallbackInput } from './types'; -import { CLOUD_DEFEND, CLOUD_SECURITY_TASK_TYPE, CLOUD_DEFEND_HEARTBEAT_INDEX } from './constants'; - -const BATCH_SIZE = 1000; -const SAMPLE_WEIGHT_SECONDS = 3600; // 1 Hour - -export interface CloudDefendHeartbeat { - '@timestamp': string; - 'agent.id': string; - event: { - ingested: string; - }; -} - -const buildMeteringRecord = ( - agentId: string, - timestampStr: string, - taskId: string, - tier: Tier, - projectId: string -): UsageRecord => { - const timestamp = new Date(timestampStr); - timestamp.setMinutes(0); - timestamp.setSeconds(0); - timestamp.setMilliseconds(0); - const creationTimestamp = new Date(); - const usageRecord = { - id: `${projectId}_${agentId}_${timestamp.toISOString()}`, - usage_timestamp: timestampStr, - creation_timestamp: creationTimestamp.toISOString(), - usage: { - type: CLOUD_SECURITY_TASK_TYPE, - sub_type: CLOUD_DEFEND, - period_seconds: SAMPLE_WEIGHT_SECONDS, - quantity: 1, - }, - source: { - id: taskId, - instance_group_id: projectId, - metadata: { - tier, - }, - }, - }; - - return usageRecord; -}; -export const getUsageRecords = async ( - esClient: ElasticsearchClient, - searchFrom: Date, - searchAfter?: SortResults -): Promise<SearchResponse<CloudDefendHeartbeat, Record<string, AggregationsAggregate>>> => { - return esClient.search<CloudDefendHeartbeat>( - { - index: CLOUD_DEFEND_HEARTBEAT_INDEX, - size: BATCH_SIZE, - sort: [{ 'event.ingested': 'asc' }, { 'agent.id': 'asc' }], - search_after: searchAfter, - query: { - bool: { - must: [ - { - range: { - 'event.ingested': { - // gt: searchFrom.toISOString(), Tech debt: https://github.com/elastic/security-team/issues/9895 - gte: `now-30m`, - }, - }, - }, - { - term: { - 'cloud_defend.block_action_enabled': true, - }, - }, - ], - }, - }, - }, - { ignore: [404] } - ); -}; - -export const getCloudDefendUsageRecords = async ({ - esClient, - projectId, - taskId, - lastSuccessfulReport, - cloudSecuritySolution, - tier, - logger, -}: CloudSecurityMeteringCallbackInput): Promise<UsageRecord[] | undefined> => { - try { - let allRecords: UsageRecord[] = []; - let searchAfter: SortResults | undefined; - let fetchMore = true; - - while (fetchMore) { - const usageRecords = await getUsageRecords(esClient, lastSuccessfulReport, searchAfter); - - if (!usageRecords?.hits?.hits?.length) { - break; - } - - const records = usageRecords.hits.hits.reduce((acc, { _source }) => { - if (!_source) { - return acc; - } - - const { event } = _source; - const record = buildMeteringRecord( - _source['agent.id'], - event.ingested, - taskId, - tier, - projectId - ); - - return [...acc, record]; - }, [] as UsageRecord[]); - - allRecords = [...allRecords, ...records]; - - if (usageRecords.hits.hits.length < BATCH_SIZE) { - fetchMore = false; - } else { - searchAfter = usageRecords.hits.hits[usageRecords.hits.hits.length - 1].sort; - } - } - - return allRecords; - } catch (err) { - logger.error(`Failed to fetch ${cloudSecuritySolution} metering data ${err}`); - } -}; diff --git a/x-pack/plugins/security_solution_serverless/server/cloud_security/types.ts b/x-pack/plugins/security_solution_serverless/server/cloud_security/types.ts deleted file mode 100644 index 0ca9a7b5b943a..0000000000000 --- a/x-pack/plugins/security_solution_serverless/server/cloud_security/types.ts +++ /dev/null @@ -1,49 +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 type { CSPM, KSPM, CNVM, CLOUD_DEFEND } from './constants'; -import type { MeteringCallbackInput, Tier } from '../types'; - -export interface CloudDefendAssetCountAggregation { - asset_count_groups: AssetCountAggregationBucket; -} -export interface AssetCountAggregationBucket { - buckets: AssetCountAggregation[]; -} - -export interface ResourceSubtypeAggregationBucket { - key: string; - doc_count: number; - unique_assets: { - value: number; - }; -} - -export interface AssetCountAggregation { - key_as_string: string; - min_timestamp: MinTimestamp; - unique_assets: { - value: number; - }; - resource_sub_type: { - buckets: ResourceSubtypeAggregationBucket[]; - }; -} - -export interface MinTimestamp { - value: number; - value_as_string: string; -} - -export type CloudSecuritySolutions = typeof CSPM | typeof KSPM | typeof CNVM | typeof CLOUD_DEFEND; - -export interface CloudSecurityMeteringCallbackInput - extends Omit<MeteringCallbackInput, 'cloudSetup' | 'abortController' | 'config'> { - projectId: string; - cloudSecuritySolution: CloudSecuritySolutions; - tier: Tier; -} diff --git a/x-pack/plugins/security_solution_serverless/server/config.ts b/x-pack/plugins/security_solution_serverless/server/config.ts deleted file mode 100644 index d4bafd9b9ddb9..0000000000000 --- a/x-pack/plugins/security_solution_serverless/server/config.ts +++ /dev/null @@ -1,127 +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 type { TypeOf } from '@kbn/config-schema'; -import type { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; -import type { SecuritySolutionPluginSetup } from '@kbn/security-solution-plugin/server/plugin_contract'; - -import { schema } from '@kbn/config-schema'; - -import type { ExperimentalFeatures } from '../common/experimental_features'; - -import { productTypes } from '../common/config'; -import { parseExperimentalConfigValue } from '../common/experimental_features'; - -const tlsConfig = schema.object({ - certificate: schema.string(), - key: schema.string(), - ca: schema.string(), -}); -export type TlsConfigSchema = TypeOf<typeof tlsConfig>; - -const usageApiConfig = schema.object({ - enabled: schema.boolean({ defaultValue: false }), - url: schema.maybe(schema.string()), - tls: schema.maybe(tlsConfig), -}); -export type UsageApiConfigSchema = TypeOf<typeof usageApiConfig>; - -export const configSchema = schema.object({ - enabled: schema.boolean({ defaultValue: false }), - productTypes, - /** - * Usage Reporting: the interval between runs of the endpoint task - */ - - usageReportingTaskInterval: schema.string({ defaultValue: '5m' }), - - /** - * Usage Reporting: the interval between runs of the cloud security task - */ - - cloudSecurityUsageReportingTaskInterval: schema.string({ defaultValue: '30m' }), - - /** - * Usage Reporting: timeout value for how long the task should run. - */ - usageReportingTaskTimeout: schema.string({ defaultValue: '1m' }), - - /** - * For internal use. A list of string values (comma delimited) that will enable experimental - * type of functionality that is not yet released. Valid values for this settings need to - * be defined in: - * `x-pack/plugins/security_solution_serverless/common/experimental_features.ts` - * under the `allowedExperimentalValues` object - * - * @example - * xpack.securitySolutionServerless.enableExperimental: - * - someCrazyServerlessFeature - * - someEvenCrazierServerlessFeature - */ - enableExperimental: schema.arrayOf(schema.string(), { - defaultValue: () => [], - }), - - usageApi: usageApiConfig, -}); -export type ServerlessSecuritySchema = TypeOf<typeof configSchema>; - -export const config: PluginConfigDescriptor<ServerlessSecuritySchema> = { - exposeToBrowser: { - enableExperimental: true, - productTypes: true, - }, - schema: configSchema, - deprecations: ({ renameFromRoot }) => [ - renameFromRoot( - 'xpack.serverless.security.productTypes', - 'xpack.securitySolutionServerless.productTypes', - { silent: true, level: 'warning' } - ), - ], -}; - -export type ServerlessSecurityConfig = Omit<ServerlessSecuritySchema, 'enableExperimental'> & { - experimentalFeatures: ExperimentalFeatures; -}; - -export const createConfig = ( - context: PluginInitializerContext, - securitySolution: SecuritySolutionPluginSetup -): ServerlessSecurityConfig => { - const { enableExperimental, ...pluginConfig } = context.config.get<ServerlessSecuritySchema>(); - const logger = context.logger.get('config'); - - const { - invalid, - duplicated, - features: experimentalFeatures, - } = parseExperimentalConfigValue(enableExperimental, securitySolution.experimentalFeatures); - - if (invalid.length) { - logger.warn(`Unsupported "xpack.securitySolutionServerless.enableExperimental" values detected. -The following configuration values are not supported and should be removed from the configuration: - - xpack.securitySolutionServerless.enableExperimental: -${invalid.map((key) => ` - ${key}`).join('\n')} -`); - } - - if (duplicated.length) { - logger.warn(`Duplicated "xpack.securitySolutionServerless.enableExperimental" values detected. -The following configuration values are should only be defined using the generic "xpack.securitySolution.enableExperimental": - - xpack.securitySolutionServerless.enableExperimental: -${duplicated.map((key) => ` - ${key}`).join('\n')} -`); - } - - return { - ...pluginConfig, - experimentalFeatures, - }; -}; diff --git a/x-pack/plugins/security_solution_serverless/server/jest.config.js b/x-pack/plugins/security_solution_serverless/server/jest.config.js deleted file mode 100644 index ba44c864b686c..0000000000000 --- a/x-pack/plugins/security_solution_serverless/server/jest.config.js +++ /dev/null @@ -1,13 +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. - */ - -/** @type {import('@jest/types').Config.InitialOptions} */ -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/plugins/security_solution_serverless/server/'], -}; diff --git a/x-pack/plugins/security_solution_serverless/tsconfig.json b/x-pack/plugins/security_solution_serverless/tsconfig.json deleted file mode 100644 index cb0518fc4dcd5..0000000000000 --- a/x-pack/plugins/security_solution_serverless/tsconfig.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "index.ts", - "common/**/*.ts", - "public/**/*.ts", - "public/**/*.tsx", - "server/**/*.ts", - "../../../typings/**/*" - ], - "exclude": ["target/**/*"], - "kbn_references": [ - "@kbn/core", - "@kbn/config-schema", - "@kbn/management-plugin", - "@kbn/security-plugin", - "@kbn/security-solution-ess", - "@kbn/security-solution-plugin", - "@kbn/server-http-tools", - "@kbn/serverless", - "@kbn/security-solution-navigation", - "@kbn/security-solution-upselling", - "@kbn/kibana-react-plugin", - "@kbn/core-chrome-browser", - "@kbn/i18n-react", - "@kbn/i18n", - "@kbn/shared-ux-page-kibana-template", - "@kbn/features-plugin", - "@kbn/kibana-utils-plugin", - "@kbn/task-manager-plugin", - "@kbn/cloud-plugin", - "@kbn/cloud-security-posture-plugin", - "@kbn/security-solution-features", - "@kbn/cases-plugin", - "@kbn/fleet-plugin", - "@kbn/serverless-security-settings", - "@kbn/core-elasticsearch-server", - "@kbn/cloud-defend-plugin", - "@kbn/core-logging-server-mocks", - "@kbn/stack-connectors-plugin", - "@kbn/actions-plugin", - "@kbn/management-cards-navigation", - "@kbn/discover-plugin", - "@kbn/logging", - "@kbn/integration-assistant-plugin", - "@kbn/cloud-security-posture-common", - "@kbn/dev-utils" - ] -} diff --git a/x-pack/plugins/serverless_search/public/application/components/languages/python.ts b/x-pack/plugins/serverless_search/public/application/components/languages/python.ts index 266a28b12c181..963d4c40ce5b6 100644 --- a/x-pack/plugins/serverless_search/public/application/components/languages/python.ts +++ b/x-pack/plugins/serverless_search/public/application/components/languages/python.ts @@ -14,7 +14,7 @@ export const pythonDefinition: LanguageDefinition = { apiReference: docLinks.pythonApiReference, basicConfig: docLinks.pythonBasicConfig, buildSearchQuery: `client.search(index="books", q="snow")`, - configureClient: ({ url, apiKey }) => `from elasticsearch_serverless import Elasticsearch + configureClient: ({ url, apiKey }) => `from elasticsearch import Elasticsearch client = Elasticsearch( "${url}", @@ -22,9 +22,9 @@ client = Elasticsearch( )`, docLink: docLinks.pythonClient, github: { - link: 'https://github.com/elastic/elasticsearch-serverless-python', + link: 'https://github.com/elastic/elasticsearch-py', label: i18n.translate('xpack.serverlessSearch.languages.python.githubLabel', { - defaultMessage: 'elasticsearch-serverless-python', + defaultMessage: 'elasticsearch-py', }), }, iconType: 'python.svg', @@ -50,7 +50,7 @@ client.bulk(operations=documents${ingestPipeline ? `, pipeline="${ingestPipeline url, indexName, ingestPipeline, - }) => `from elasticsearch_serverless import Elasticsearch + }) => `from elasticsearch import Elasticsearch client = Elasticsearch( "${url}", @@ -64,10 +64,10 @@ documents = [ client.bulk(operations=documents${ingestPipeline ? `, pipeline="${ingestPipeline}"` : ''}) `, - installClient: `python -m pip install elasticsearch-serverless + installClient: `python -m pip install elasticsearch # If your application uses async/await in Python you can install with the async extra -# python -m pip install elasticsearch_serverless[async] +# python -m pip install elasticsearch[async] `, name: i18n.translate('xpack.serverlessSearch.languages.python', { defaultMessage: 'Python', diff --git a/x-pack/plugins/serverless_search/public/application/components/overview.scss b/x-pack/plugins/serverless_search/public/application/components/overview.scss index fe5e83e5ccf41..195fbd2fdf018 100644 --- a/x-pack/plugins/serverless_search/public/application/components/overview.scss +++ b/x-pack/plugins/serverless_search/public/application/components/overview.scss @@ -1,7 +1,3 @@ -.serverlessSearchHeaderSection { - background-color: $euiColorPrimary; -} - .serverlessSearchHeaderSection > div { padding-bottom: 0; padding-top: 0; @@ -13,4 +9,4 @@ .serverlessSearchCloudDetailsCopyPanel { word-break: break-all; -} \ No newline at end of file +} diff --git a/x-pack/plugins/serverless_search/public/application/components/overview.tsx b/x-pack/plugins/serverless_search/public/application/components/overview.tsx index 678eadb6b5cb6..d20706a6aa804 100644 --- a/x-pack/plugins/serverless_search/public/application/components/overview.tsx +++ b/x-pack/plugins/serverless_search/public/application/components/overview.tsx @@ -14,7 +14,6 @@ import { EuiIcon, EuiPageTemplate, EuiPanel, - EuiText, EuiBadge, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -96,9 +95,7 @@ export const ElasticsearchOverview = () => { return ( <EuiPageTemplate offset={0} grow restrictWidth data-test-subj="svlSearchOverviewPage"> <EuiPageTemplate.Section alignment="top" className="serverlessSearchHeaderSection"> - <EuiText color="ghost"> - <WelcomeBanner user={user} assetBasePath={assetBasePath} /> - </EuiText> + <WelcomeBanner user={user} assetBasePath={assetBasePath} /> </EuiPageTemplate.Section> <EuiPageTemplate.Section color="subdued" diff --git a/x-pack/plugins/session_view/README.md b/x-pack/plugins/session_view/README.md deleted file mode 100644 index 384be8bcc292b..0000000000000 --- a/x-pack/plugins/session_view/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Session View - -Session View is meant to provide a visualization into what is going on in a particular Linux environment where the agent is running. It looks likes a terminal emulator; however, it is a tool for introspecting process activity and understanding user and service behaviour in your Linux servers and infrastructure. It is a time-ordered series of process executions displayed in a tree over time. - -It provides an audit trail of: - -- Interactive processes being entered by a user into the terminal - User Input -- Processes and services which do not have a controlling tty (ie are not interactive) -- Output which is generated as a result of process activity - Output -- Nested sessions inside the entry session - Nested session (Note: For now nested sessions will display as they did at Cmd with no special handling for TMUX) -- Full telemetry about the process initiated event. This will include the information specified in the Linux logical event model -- Who executed the session or process, even if the user changes. - -## Development - -## Tests - -### Unit tests - -From kibana path in your terminal go to this plugin root: - -```bash -cd x-pack/plugins/session_view -``` - -Then run jest with: - -```bash -yarn test:jest -``` - -Or if running from kibana root, you can specify the `-i` to specify the path: - -```bash -yarn test:jest -i x-pack/plugins/session_view/ -``` diff --git a/x-pack/plugins/session_view/jest.config.js b/x-pack/plugins/session_view/jest.config.js deleted file mode 100644 index d35db0d369468..0000000000000 --- a/x-pack/plugins/session_view/jest.config.js +++ /dev/null @@ -1,18 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../..', - roots: ['<rootDir>/x-pack/plugins/session_view'], - coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/session_view', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/session_view/{common,public,server}/**/*.{ts,tsx}', - ], - setupFiles: ['jest-canvas-mock'], -}; diff --git a/x-pack/plugins/session_view/package.json b/x-pack/plugins/session_view/package.json deleted file mode 100644 index 256080545ba17..0000000000000 --- a/x-pack/plugins/session_view/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "author": "Elastic", - "name": "@kbn/session-view-plugin", - "version": "1.0.0", - "private": true, - "license": "Elastic License 2.0", - "scripts": { - "test:jest": "node ../../scripts/jest", - "test:coverage": "node ../../scripts/jest --coverage" - } -} diff --git a/x-pack/plugins/session_view/tsconfig.json b/x-pack/plugins/session_view/tsconfig.json deleted file mode 100644 index 412de8355943c..0000000000000 --- a/x-pack/plugins/session_view/tsconfig.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - }, - "include": [ - // add all the folders containg files to be compiled - "common/**/*", - "public/**/*", - "server/**/*", - "server/**/*.json", - "scripts/**/*", - "package.json", - "storybook/**/*", - "../../../typings/**/*" - ], - "kbn_references": [ - "@kbn/core", - // add references to other TypeScript projects the plugin depends on - - // requiredPlugins from ./kibana.json - - // optionalPlugins from ./kibana.json - "@kbn/security-plugin", - - // requiredBundles from ./kibana.json - "@kbn/kibana-react-plugin", - "@kbn/es-ui-shared-plugin", - "@kbn/rule-registry-plugin", - "@kbn/i18n", - "@kbn/std", - "@kbn/ui-theme", - "@kbn/i18n-react", - "@kbn/config-schema", - "@kbn/alerting-plugin", - "@kbn/rule-data-utils", - "@kbn/securitysolution-es-utils", - "@kbn/shared-ux-router", - "@kbn/usage-collection-plugin", - "@kbn/analytics", - "@kbn/securitysolution-rules", - ], - "exclude": [ - "target/**/*", - ] -} diff --git a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_mode_control.tsx b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_mode_control.tsx index 223a21f248f7d..fb8fde6b1e226 100644 --- a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_mode_control.tsx +++ b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_mode_control.tsx @@ -80,7 +80,7 @@ const includeRelated = { 'xpack.spaces.management.copyToSpace.copyModeControl.includeRelated.text', { defaultMessage: - 'Copy this object and its related objects. For dashboards, related visualizations, index patterns, and saved searches are also copied.', + 'Copy this object and its related objects. For dashboards, related visualizations, data views, and saved Discover sessions are also copied.', } ), }; diff --git a/x-pack/plugins/spaces/server/config.test.ts b/x-pack/plugins/spaces/server/config.test.ts index cc210e7e4e5a4..19d4a7cbe7f90 100644 --- a/x-pack/plugins/spaces/server/config.test.ts +++ b/x-pack/plugins/spaces/server/config.test.ts @@ -23,9 +23,6 @@ describe('config schema', () => { "allowFeatureVisibility": true, "allowSolutionVisibility": true, "enabled": true, - "experimental": Object { - "forceSolutionVisibility": false, - }, "maxSpaces": 1000, } `); @@ -35,9 +32,6 @@ describe('config schema', () => { "allowFeatureVisibility": true, "allowSolutionVisibility": true, "enabled": true, - "experimental": Object { - "forceSolutionVisibility": false, - }, "maxSpaces": 1000, } `); @@ -47,9 +41,6 @@ describe('config schema', () => { "allowFeatureVisibility": true, "allowSolutionVisibility": true, "enabled": true, - "experimental": Object { - "forceSolutionVisibility": false, - }, "maxSpaces": 1000, } `); diff --git a/x-pack/plugins/spaces/server/config.ts b/x-pack/plugins/spaces/server/config.ts index ef6b300d43965..a7c9606e74543 100644 --- a/x-pack/plugins/spaces/server/config.ts +++ b/x-pack/plugins/spaces/server/config.ts @@ -54,13 +54,6 @@ export const ConfigSchema = schema.object({ defaultValue: true, }), }), - experimental: schema.maybe( - offeringBasedSchema({ - traditional: schema.object({ - forceSolutionVisibility: schema.boolean({ defaultValue: false }), - }), - }) - ), }); export function createConfig$(context: PluginInitializerContext) { diff --git a/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts b/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts index 509de14e2928b..fcbc84b0655cf 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/copy_to_space.ts @@ -47,7 +47,7 @@ export function initCopyToSpacesApi(deps: ExternalRouteDeps) { tags: ['oas-tag:spaces'], summary: `Copy saved objects between spaces`, description: - 'It also allows you to automatically copy related objects, so when you copy a dashboard, this can automatically copy over the associated visualizations, data views, and saved searches, as required. You can request to overwrite any objects that already exist in the target space if they share an identifier or you can use the resolve copy saved objects conflicts API to do this on a per-object basis.', + 'It also allows you to automatically copy related objects, so when you copy a dashboard, this can automatically copy over the associated visualizations, data views, and saved Discover sessions, as required. You can request to overwrite any objects that already exist in the target space if they share an identifier or you can use the resolve copy saved objects conflicts API to do this on a per-object basis.', }, validate: { body: schema.object( diff --git a/x-pack/plugins/stack_connectors/common/crowdstrike/schema.ts b/x-pack/plugins/stack_connectors/common/crowdstrike/schema.ts index d5d4154f985e9..40e58613c69e0 100644 --- a/x-pack/plugins/stack_connectors/common/crowdstrike/schema.ts +++ b/x-pack/plugins/stack_connectors/common/crowdstrike/schema.ts @@ -318,16 +318,16 @@ export const CrowdstrikeExecuteRTRResponseSchema = schema.object( schema.string(), schema.object( { - session_id: schema.maybe(schema.string()), - task_id: schema.maybe(schema.string()), - complete: schema.maybe(schema.boolean()), - stdout: schema.maybe(schema.string()), - stderr: schema.maybe(schema.string()), - base_command: schema.maybe(schema.string()), - aid: schema.maybe(schema.string()), - errors: schema.maybe(schema.arrayOf(schema.any())), - query_time: schema.maybe(schema.number()), - offline_queued: schema.maybe(schema.boolean()), + session_id: schema.string(), + task_id: schema.string(), + complete: schema.boolean(), + stdout: schema.string(), + stderr: schema.string(), + base_command: schema.string(), + aid: schema.string(), + errors: schema.arrayOf(schema.any()), + query_time: schema.number(), + offline_queued: schema.boolean(), }, { unknowns: 'allow' } ) @@ -337,9 +337,9 @@ export const CrowdstrikeExecuteRTRResponseSchema = schema.object( ), meta: schema.object( { - query_time: schema.maybe(schema.number()), - powered_by: schema.maybe(schema.string()), - trace_id: schema.maybe(schema.string()), + query_time: schema.number(), + powered_by: schema.string(), + trace_id: schema.string(), }, { unknowns: 'allow' } ), @@ -348,7 +348,5 @@ export const CrowdstrikeExecuteRTRResponseSchema = schema.object( { unknowns: 'allow' } ); -export type CrowdStrikeExecuteRTRResponse = typeof CrowdstrikeExecuteRTRResponseSchema; - // TODO: will be part of a next PR export const CrowdstrikeGetScriptsParamsSchema = schema.any({}); diff --git a/x-pack/plugins/stack_connectors/common/crowdstrike/types.ts b/x-pack/plugins/stack_connectors/common/crowdstrike/types.ts index 3c9cc15ea167e..68f8275d71434 100644 --- a/x-pack/plugins/stack_connectors/common/crowdstrike/types.ts +++ b/x-pack/plugins/stack_connectors/common/crowdstrike/types.ts @@ -17,8 +17,8 @@ import { CrowdstrikeGetTokenResponseSchema, CrowdstrikeGetAgentsResponseSchema, RelaxedCrowdstrikeBaseApiResponseSchema, - CrowdstrikeInitRTRResponseSchema, CrowdstrikeInitRTRParamsSchema, + CrowdstrikeExecuteRTRResponseSchema, } from './schema'; export type CrowdstrikeConfig = TypeOf<typeof CrowdstrikeConfigSchema>; @@ -35,9 +35,10 @@ export type CrowdstrikeGetAgentOnlineStatusResponse = TypeOf< typeof CrowdstrikeGetAgentOnlineStatusResponseSchema >; export type CrowdstrikeGetTokenResponse = TypeOf<typeof CrowdstrikeGetTokenResponseSchema>; -export type CrowdstrikeInitRTRResponse = TypeOf<typeof CrowdstrikeInitRTRResponseSchema>; export type CrowdstrikeHostActionsParams = TypeOf<typeof CrowdstrikeHostActionsParamsSchema>; export type CrowdstrikeActionParams = TypeOf<typeof CrowdstrikeActionParamsSchema>; export type CrowdstrikeInitRTRParams = TypeOf<typeof CrowdstrikeInitRTRParamsSchema>; + +export type CrowdStrikeExecuteRTRResponse = TypeOf<typeof CrowdstrikeExecuteRTRResponseSchema>; diff --git a/x-pack/plugins/stack_connectors/common/inference/constants.ts b/x-pack/plugins/stack_connectors/common/inference/constants.ts index b795e54f5d32a..c2f2e6713270b 100644 --- a/x-pack/plugins/stack_connectors/common/inference/constants.ts +++ b/x-pack/plugins/stack_connectors/common/inference/constants.ts @@ -32,6 +32,9 @@ export enum ServiceProviderKeys { export const INFERENCE_CONNECTOR_ID = '.inference'; export enum SUB_ACTION { + UNIFIED_COMPLETION_ASYNC_ITERATOR = 'unified_completion_async_iterator', + UNIFIED_COMPLETION_STREAM = 'unified_completion_stream', + UNIFIED_COMPLETION = 'unified_completion', COMPLETION = 'completion', RERANK = 'rerank', TEXT_EMBEDDING = 'text_embedding', diff --git a/x-pack/plugins/stack_connectors/common/inference/schema.ts b/x-pack/plugins/stack_connectors/common/inference/schema.ts index 07b51cf9a5aa3..c62e9782bb517 100644 --- a/x-pack/plugins/stack_connectors/common/inference/schema.ts +++ b/x-pack/plugins/stack_connectors/common/inference/schema.ts @@ -23,6 +23,176 @@ export const ChatCompleteParamsSchema = schema.object({ input: schema.string(), }); +// subset of OpenAI.ChatCompletionMessageParam https://github.com/openai/openai-node/blob/master/src/resources/chat/completions.ts +const AIMessage = schema.object({ + role: schema.string(), + content: schema.maybe(schema.string()), + name: schema.maybe(schema.string()), + tool_calls: schema.maybe( + schema.arrayOf( + schema.object({ + id: schema.string(), + function: schema.object({ + arguments: schema.maybe(schema.string()), + name: schema.maybe(schema.string()), + }), + type: schema.string(), + }) + ) + ), + tool_call_id: schema.maybe(schema.string()), +}); + +const AITool = schema.object({ + type: schema.string(), + function: schema.object({ + name: schema.string(), + description: schema.maybe(schema.string()), + parameters: schema.maybe(schema.recordOf(schema.string(), schema.any())), + }), +}); + +// subset of OpenAI.ChatCompletionCreateParamsBase https://github.com/openai/openai-node/blob/master/src/resources/chat/completions.ts +export const UnifiedChatCompleteParamsSchema = schema.object({ + body: schema.object({ + messages: schema.arrayOf(AIMessage, { defaultValue: [] }), + model: schema.maybe(schema.string()), + /** + * The maximum number of [tokens](/tokenizer) that can be generated in the chat + * completion. This value can be used to control + * [costs](https://openai.com/api/pricing/) for text generated via API. + * + * This value is now deprecated in favor of `max_completion_tokens`, and is not + * compatible with + * [o1 series models](https://platform.openai.com/docs/guides/reasoning). + */ + max_tokens: schema.maybe(schema.number()), + /** + * Developer-defined tags and values used for filtering completions in the + * [dashboard](https://platform.openai.com/chat-completions). + */ + metadata: schema.maybe(schema.recordOf(schema.string(), schema.string())), + /** + * How many chat completion choices to generate for each input message. Note that + * you will be charged based on the number of generated tokens across all of the + * choices. Keep `n` as `1` to minimize costs. + */ + n: schema.maybe(schema.number()), + /** + * Up to 4 sequences where the API will stop generating further tokens. + */ + stop: schema.maybe( + schema.nullable(schema.oneOf([schema.string(), schema.arrayOf(schema.string())])) + ), + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + * make the output more random, while lower values like 0.2 will make it more + * focused and deterministic. + * + * We generally recommend altering this or `top_p` but not both. + */ + temperature: schema.maybe(schema.number()), + /** + * Controls which (if any) tool is called by the model. `none` means the model will + * not call any tool and instead generates a message. `auto` means the model can + * pick between generating a message or calling one or more tools. `required` means + * the model must call one or more tools. Specifying a particular tool via + * `{"type": "function", "function": {"name": "my_function"}}` forces the model to + * call that tool. + * + * `none` is the default when no tools are present. `auto` is the default if tools + * are present. + */ + tool_choice: schema.maybe( + schema.oneOf([ + schema.string(), + schema.object({ + type: schema.string(), + function: schema.object({ + name: schema.string(), + }), + }), + ]) + ), + /** + * A list of tools the model may call. Currently, only functions are supported as a + * tool. Use this to provide a list of functions the model may generate JSON inputs + * for. A max of 128 functions are supported. + */ + tools: schema.maybe(schema.arrayOf(AITool)), + /** + * An alternative to sampling with temperature, called nucleus sampling, where the + * model considers the results of the tokens with top_p probability mass. So 0.1 + * means only the tokens comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or `temperature` but not both. + */ + top_p: schema.maybe(schema.number()), + /** + * A unique identifier representing your end-user, which can help OpenAI to monitor + * and detect abuse. + * [Learn more](https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids). + */ + user: schema.maybe(schema.string()), + }), + // abort signal from client + signal: schema.maybe(schema.any()), +}); + +export const UnifiedChatCompleteResponseSchema = schema.object({ + id: schema.string(), + choices: schema.arrayOf( + schema.object({ + finish_reason: schema.maybe( + schema.nullable( + schema.oneOf([ + schema.literal('stop'), + schema.literal('length'), + schema.literal('tool_calls'), + schema.literal('content_filter'), + schema.literal('function_call'), + ]) + ) + ), + index: schema.maybe(schema.number()), + message: schema.object({ + content: schema.maybe(schema.nullable(schema.string())), + refusal: schema.maybe(schema.nullable(schema.string())), + role: schema.maybe(schema.string()), + tool_calls: schema.maybe( + schema.arrayOf( + schema.object({ + id: schema.maybe(schema.string()), + index: schema.maybe(schema.number()), + function: schema.maybe( + schema.object({ + arguments: schema.maybe(schema.string()), + name: schema.maybe(schema.string()), + }) + ), + type: schema.maybe(schema.string()), + }), + { defaultValue: [] } + ) + ), + }), + }), + { defaultValue: [] } + ), + created: schema.maybe(schema.number()), + model: schema.maybe(schema.string()), + object: schema.maybe(schema.string()), + usage: schema.maybe( + schema.nullable( + schema.object({ + completion_tokens: schema.maybe(schema.number()), + prompt_tokens: schema.maybe(schema.number()), + total_tokens: schema.maybe(schema.number()), + }) + ) + ), +}); + export const ChatCompleteResponseSchema = schema.arrayOf( schema.object({ result: schema.string(), @@ -66,3 +236,12 @@ export const TextEmbeddingResponseSchema = schema.arrayOf( ); export const StreamingResponseSchema = schema.stream(); + +// Run action schema +export const DashboardActionParamsSchema = schema.object({ + dashboardId: schema.string(), +}); + +export const DashboardActionResponseSchema = schema.object({ + available: schema.boolean(), +}); diff --git a/x-pack/plugins/stack_connectors/common/inference/types.ts b/x-pack/plugins/stack_connectors/common/inference/types.ts index d8b846ce19422..1593429792e07 100644 --- a/x-pack/plugins/stack_connectors/common/inference/types.ts +++ b/x-pack/plugins/stack_connectors/common/inference/types.ts @@ -18,12 +18,19 @@ import { SparseEmbeddingResponseSchema, TextEmbeddingParamsSchema, TextEmbeddingResponseSchema, + UnifiedChatCompleteParamsSchema, + UnifiedChatCompleteResponseSchema, + DashboardActionParamsSchema, + DashboardActionResponseSchema, } from './schema'; import { ConfigProperties } from '../dynamic_config/types'; export type Config = TypeOf<typeof ConfigSchema>; export type Secrets = TypeOf<typeof SecretsSchema>; +export type UnifiedChatCompleteParams = TypeOf<typeof UnifiedChatCompleteParamsSchema>; +export type UnifiedChatCompleteResponse = TypeOf<typeof UnifiedChatCompleteResponseSchema>; + export type ChatCompleteParams = TypeOf<typeof ChatCompleteParamsSchema>; export type ChatCompleteResponse = TypeOf<typeof ChatCompleteResponseSchema>; @@ -38,6 +45,9 @@ export type TextEmbeddingResponse = TypeOf<typeof TextEmbeddingResponseSchema>; export type StreamingResponse = TypeOf<typeof StreamingResponseSchema>; +export type DashboardActionParams = TypeOf<typeof DashboardActionParamsSchema>; +export type DashboardActionResponse = TypeOf<typeof DashboardActionResponseSchema>; + export type FieldsConfiguration = Record<string, ConfigProperties>; export interface InferenceProvider { diff --git a/x-pack/plugins/stack_connectors/public/connector_types/inference/constants.tsx b/x-pack/plugins/stack_connectors/public/connector_types/inference/constants.tsx index 8427caaf49ffc..1b635ca8fe887 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/inference/constants.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/inference/constants.tsx @@ -25,13 +25,27 @@ export const DEFAULT_TEXT_EMBEDDING_BODY = { inputType: 'ingest', }; +export const DEFAULT_UNIFIED_CHAT_COMPLETE_BODY = { + body: { + messages: [ + { + role: 'user', + content: 'Hello world', + }, + ], + }, +}; + export const DEFAULTS_BY_TASK_TYPE: Record<string, unknown> = { [SUB_ACTION.COMPLETION]: DEFAULT_CHAT_COMPLETE_BODY, + [SUB_ACTION.UNIFIED_COMPLETION]: DEFAULT_UNIFIED_CHAT_COMPLETE_BODY, + [SUB_ACTION.UNIFIED_COMPLETION_STREAM]: DEFAULT_UNIFIED_CHAT_COMPLETE_BODY, + [SUB_ACTION.UNIFIED_COMPLETION_ASYNC_ITERATOR]: DEFAULT_UNIFIED_CHAT_COMPLETE_BODY, [SUB_ACTION.RERANK]: DEFAULT_RERANK_BODY, [SUB_ACTION.SPARSE_EMBEDDING]: DEFAULT_SPARSE_EMBEDDING_BODY, [SUB_ACTION.TEXT_EMBEDDING]: DEFAULT_TEXT_EMBEDDING_BODY, }; -export const DEFAULT_TASK_TYPE = 'completion'; +export const DEFAULT_TASK_TYPE = 'unified_completion'; export const DEFAULT_PROVIDER = 'elasticsearch'; diff --git a/x-pack/plugins/stack_connectors/public/connector_types/inference/inference.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/inference/inference.test.tsx index 76dc50a316e65..b67264674aebe 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/inference/inference.test.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/inference/inference.test.tsx @@ -44,8 +44,16 @@ describe('OpenAI action params validation', () => { subActionParams: { input: ['message test'], query: 'foobar' }, }, { - subAction: SUB_ACTION.COMPLETION, - subActionParams: { input: 'message test' }, + subAction: SUB_ACTION.UNIFIED_COMPLETION, + subActionParams: { body: { messages: [{ role: 'user', content: 'What is Elastic?' }] } }, + }, + { + subAction: SUB_ACTION.UNIFIED_COMPLETION_STREAM, + subActionParams: { body: { messages: [{ role: 'user', content: 'What is Elastic?' }] } }, + }, + { + subAction: SUB_ACTION.UNIFIED_COMPLETION_ASYNC_ITERATOR, + subActionParams: { body: { messages: [{ role: 'user', content: 'What is Elastic?' }] } }, }, { subAction: SUB_ACTION.TEXT_EMBEDDING, @@ -55,6 +63,10 @@ describe('OpenAI action params validation', () => { subAction: SUB_ACTION.SPARSE_EMBEDDING, subActionParams: { input: 'message test' }, }, + { + subAction: SUB_ACTION.COMPLETION, + subActionParams: { input: 'message test' }, + }, ])( 'validation succeeds when params are valid for subAction $subAction', async ({ subAction, subActionParams }) => { @@ -63,19 +75,25 @@ describe('OpenAI action params validation', () => { subActionParams, }; expect(await actionTypeModel.validateParams(actionParams)).toEqual({ - errors: { input: [], subAction: [], inputType: [], query: [] }, + errors: { body: [], input: [], subAction: [], inputType: [], query: [] }, }); } ); test('params validation fails when params is a wrong object', async () => { const actionParams = { - subAction: SUB_ACTION.COMPLETION, + subAction: SUB_ACTION.UNIFIED_COMPLETION, subActionParams: { body: 'message {test}' }, }; expect(await actionTypeModel.validateParams(actionParams)).toEqual({ - errors: { input: ['Input is required.'], inputType: [], query: [], subAction: [] }, + errors: { + body: ['Messages is required.'], + inputType: [], + query: [], + subAction: [], + input: [], + }, }); }); @@ -86,6 +104,7 @@ describe('OpenAI action params validation', () => { expect(await actionTypeModel.validateParams(actionParams)).toEqual({ errors: { + body: [], input: [], inputType: [], query: [], @@ -102,6 +121,7 @@ describe('OpenAI action params validation', () => { expect(await actionTypeModel.validateParams(actionParams)).toEqual({ errors: { + body: [], input: [], inputType: [], query: [], @@ -118,6 +138,7 @@ describe('OpenAI action params validation', () => { expect(await actionTypeModel.validateParams(actionParams)).toEqual({ errors: { + body: [], input: ['Input is required.', 'Input does not have a valid Array format.'], inputType: [], query: ['Query is required.'], @@ -134,6 +155,7 @@ describe('OpenAI action params validation', () => { expect(await actionTypeModel.validateParams(actionParams)).toEqual({ errors: { + body: [], input: [], inputType: ['Input type is required.'], query: [], diff --git a/x-pack/plugins/stack_connectors/public/connector_types/inference/inference.tsx b/x-pack/plugins/stack_connectors/public/connector_types/inference/inference.tsx index e16d03306c166..388da0556801c 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/inference/inference.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/inference/inference.tsx @@ -19,6 +19,7 @@ import { InferenceActionParams, InferenceConnector } from './types'; interface ValidationErrors { subAction: string[]; input: string[]; + body: string[]; // rerank only query: string[]; // text_embedding only @@ -40,14 +41,28 @@ export function getConnectorType(): InferenceConnector { const translations = await import('./translations'); const errors: ValidationErrors = { input: [], + body: [], subAction: [], inputType: [], query: [], }; if ( - subAction === SUB_ACTION.RERANK || + subAction === SUB_ACTION.UNIFIED_COMPLETION || + subAction === SUB_ACTION.UNIFIED_COMPLETION_STREAM || + subAction === SUB_ACTION.UNIFIED_COMPLETION_ASYNC_ITERATOR + ) { + if ( + !Array.isArray(subActionParams.body.messages) || + !subActionParams.body.messages.length + ) { + errors.body.push(translations.getRequiredMessage('Messages')); + } + } + + if ( subAction === SUB_ACTION.COMPLETION || + subAction === SUB_ACTION.RERANK || subAction === SUB_ACTION.TEXT_EMBEDDING || subAction === SUB_ACTION.SPARSE_EMBEDDING ) { @@ -76,10 +91,13 @@ export function getConnectorType(): InferenceConnector { errors.subAction.push(translations.getRequiredMessage('Action')); } else if ( ![ - SUB_ACTION.COMPLETION, + SUB_ACTION.UNIFIED_COMPLETION, + SUB_ACTION.UNIFIED_COMPLETION_STREAM, + SUB_ACTION.UNIFIED_COMPLETION_ASYNC_ITERATOR, SUB_ACTION.SPARSE_EMBEDDING, SUB_ACTION.RERANK, SUB_ACTION.TEXT_EMBEDDING, + SUB_ACTION.COMPLETION, ].includes(subAction) ) { errors.subAction.push(translations.INVALID_ACTION); diff --git a/x-pack/plugins/stack_connectors/public/connector_types/inference/params.test.tsx b/x-pack/plugins/stack_connectors/public/connector_types/inference/params.test.tsx index 49773edc2246a..ba094ec64f6bd 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/inference/params.test.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/inference/params.test.tsx @@ -15,8 +15,8 @@ describe('Inference Params Fields renders', () => { const { getByTestId } = render( <ParamsFields actionParams={{ - subAction: SUB_ACTION.COMPLETION, - subActionParams: { input: 'What is Elastic?' }, + subAction: SUB_ACTION.UNIFIED_COMPLETION, + subActionParams: { body: { messages: [{ role: 'user', content: 'What is Elastic?' }] } }, }} actionConnector={{ actionTypeId: '.inference', @@ -35,8 +35,11 @@ describe('Inference Params Fields renders', () => { index={0} /> ); - expect(getByTestId('inferenceInput')).toBeInTheDocument(); - expect(getByTestId('inferenceInput')).toHaveProperty('value', 'What is Elastic?'); + expect(getByTestId('inference-bodyJsonEditor')).toBeInTheDocument(); + expect(getByTestId('bodyJsonEditor')).toHaveProperty( + 'value', + `{\"messages\":[{\"role\":\"user\",\"content\":\"What is Elastic?\"}]}` + ); }); test.each(['openai', 'googleaistudio'])( @@ -76,15 +79,25 @@ describe('Inference Params Fields renders', () => { /> ); expect(editAction).toHaveBeenCalledTimes(2); - expect(editAction).toHaveBeenCalledWith('subAction', SUB_ACTION.COMPLETION, 0); if (provider === 'openai') { + expect(editAction).toHaveBeenCalledWith('subAction', SUB_ACTION.UNIFIED_COMPLETION, 0); expect(editAction).toHaveBeenCalledWith( 'subActionParams', - { input: 'What is Elastic?' }, + { + body: { + messages: [ + { + content: 'Hello world', + role: 'user', + }, + ], + }, + }, 0 ); } if (provider === 'googleaistudio') { + expect(editAction).toHaveBeenCalledWith('subAction', SUB_ACTION.COMPLETION, 0); expect(editAction).toHaveBeenCalledWith( 'subActionParams', { input: 'What is Elastic?' }, diff --git a/x-pack/plugins/stack_connectors/public/connector_types/inference/params.tsx b/x-pack/plugins/stack_connectors/public/connector_types/inference/params.tsx index c24fff24c33f6..be162e70493bc 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/inference/params.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/inference/params.tsx @@ -12,11 +12,13 @@ import { } from '@kbn/triggers-actions-ui-plugin/public'; import { EuiTextArea, EuiFormRow, EuiSpacer, EuiSelect } from '@elastic/eui'; import type { RuleFormParamsErrors } from '@kbn/response-ops-rule-form'; +import { ActionVariable } from '@kbn/alerting-types'; import { ChatCompleteParams, RerankParams, SparseEmbeddingParams, TextEmbeddingParams, + UnifiedChatCompleteParams, } from '../../../common/inference/types'; import { DEFAULTS_BY_TASK_TYPE } from './constants'; import * as i18n from './translations'; @@ -25,28 +27,38 @@ import { InferenceActionConnector, InferenceActionParams } from './types'; const InferenceServiceParamsFields: React.FunctionComponent< ActionParamsProps<InferenceActionParams> -> = ({ actionParams, editAction, index, errors, actionConnector }) => { +> = ({ actionParams, editAction, index, errors, actionConnector, messageVariables }) => { const { subAction, subActionParams } = actionParams; - const { taskType } = (actionConnector as unknown as InferenceActionConnector).config; + const { taskType, provider } = (actionConnector as unknown as InferenceActionConnector).config; useEffect(() => { if (!subAction) { - editAction('subAction', taskType, index); + editAction( + 'subAction', + provider === 'openai' && taskType === 'completion' + ? SUB_ACTION.UNIFIED_COMPLETION + : taskType, + index + ); } - }, [editAction, index, subAction, taskType]); + }, [editAction, index, provider, subAction, taskType]); useEffect(() => { if (!subActionParams) { editAction( 'subActionParams', { - ...(DEFAULTS_BY_TASK_TYPE[taskType] ?? {}), + ...(DEFAULTS_BY_TASK_TYPE[ + provider === 'openai' && taskType === 'completion' + ? SUB_ACTION.UNIFIED_COMPLETION + : taskType + ] ?? {}), }, index ); } - }, [editAction, index, subActionParams, taskType]); + }, [editAction, index, provider, subActionParams, taskType]); const editSubActionParams = useCallback( (params: Partial<InferenceActionParams['subActionParams']>) => { @@ -55,6 +67,28 @@ const InferenceServiceParamsFields: React.FunctionComponent< [editAction, index, subActionParams] ); + if (subAction === SUB_ACTION.UNIFIED_COMPLETION) { + return ( + <UnifiedCompletionParamsFields + errors={errors} + messageVariables={messageVariables} + editSubActionParams={editSubActionParams} + subActionParams={subActionParams as UnifiedChatCompleteParams} + /> + ); + } + + if (subAction === SUB_ACTION.UNIFIED_COMPLETION_ASYNC_ITERATOR) { + return ( + <UnifiedCompletionParamsFields + errors={errors} + messageVariables={messageVariables} + editSubActionParams={editSubActionParams} + subActionParams={subActionParams as UnifiedChatCompleteParams} + /> + ); + } + if (subAction === SUB_ACTION.COMPLETION) { return ( <CompletionParamsFields @@ -119,6 +153,36 @@ const InferenceInput: React.FunctionComponent<{ ); }; +const UnifiedCompletionParamsFields: React.FunctionComponent<{ + subActionParams: UnifiedChatCompleteParams; + errors: RuleFormParamsErrors; + editSubActionParams: (params: Partial<InferenceActionParams['subActionParams']>) => void; + messageVariables: ActionVariable[] | undefined; +}> = ({ subActionParams, editSubActionParams, errors, messageVariables }) => { + const { body } = subActionParams ?? {}; + + return ( + <> + <JsonEditorWithMessageVariables + messageVariables={messageVariables} + paramsProperty={'body'} + inputTargetValue={JSON.stringify(body)} + label={i18n.BODY} + errors={errors.body as string[]} + onDocumentsChange={(json: string) => { + editSubActionParams({ body: JSON.parse(json) }); + }} + onBlur={() => { + if (!subActionParams.body) { + editSubActionParams({ body: { messages: [] } }); + } + }} + dataTestSubj="inference-bodyJsonEditor" + /> + </> + ); +}; + const CompletionParamsFields: React.FunctionComponent<{ subActionParams: ChatCompleteParams; errors: RuleFormParamsErrors; diff --git a/x-pack/plugins/stack_connectors/public/connector_types/inference/types.ts b/x-pack/plugins/stack_connectors/public/connector_types/inference/types.ts index 1bd55793bc463..1756e213a1a7a 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/inference/types.ts +++ b/x-pack/plugins/stack_connectors/public/connector_types/inference/types.ts @@ -13,9 +13,16 @@ import { RerankParams, SparseEmbeddingParams, TextEmbeddingParams, + UnifiedChatCompleteParams, } from '../../../common/inference/types'; export type InferenceActionParams = + | { subAction: SUB_ACTION.UNIFIED_COMPLETION_STREAM; subActionParams: UnifiedChatCompleteParams } + | { subAction: SUB_ACTION.UNIFIED_COMPLETION; subActionParams: UnifiedChatCompleteParams } + | { + subAction: SUB_ACTION.UNIFIED_COMPLETION_ASYNC_ITERATOR; + subActionParams: UnifiedChatCompleteParams; + } | { subAction: SUB_ACTION.COMPLETION; subActionParams: ChatCompleteParams } | { subAction: SUB_ACTION.RERANK; subActionParams: RerankParams } | { subAction: SUB_ACTION.SPARSE_EMBEDDING; subActionParams: SparseEmbeddingParams } diff --git a/x-pack/plugins/stack_connectors/server/connector_types/crowdstrike/crowdstrike.ts b/x-pack/plugins/stack_connectors/server/connector_types/crowdstrike/crowdstrike.ts index 14b38b414eb3b..9bc53c58aa198 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/crowdstrike/crowdstrike.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/crowdstrike/crowdstrike.ts @@ -22,6 +22,7 @@ import type { CrowdstrikeGetTokenResponse, CrowdstrikeGetAgentOnlineStatusResponse, RelaxedCrowdstrikeBaseApiResponse, + CrowdStrikeExecuteRTRResponse, } from '../../../common/crowdstrike/types'; import { CrowdstrikeHostActionsParamsSchema, @@ -31,7 +32,6 @@ import { CrowdstrikeRTRCommandParamsSchema, CrowdstrikeExecuteRTRResponseSchema, CrowdstrikeGetScriptsParamsSchema, - CrowdStrikeExecuteRTRResponse, CrowdstrikeApiDoNotValidateResponsesSchema, CrowdstrikeGetTokenResponseSchema, } from '../../../common/crowdstrike/schema'; @@ -292,15 +292,9 @@ export class CrowdstrikeConnector extends SubActionConnector< payload: { command: string; endpoint_ids: string[]; - overwriteUrl?: 'batchExecuteRTR' | 'batchActiveResponderExecuteRTR' | 'batchAdminExecuteRTR'; }, connectorUsageCollector: ConnectorUsageCollector ): Promise<CrowdStrikeExecuteRTRResponse> => { - // Some commands are only available in specific API endpoints, however there's an additional requirement check for the command's argument - // Eg. runscript command is available with the batchExecuteRTR endpoint, but if it goes with --Raw parameter, it should go to batchAdminExecuteRTR endpoint - // This overwrite value will be coming from kibana response actions api - const csUrl = payload.overwriteUrl ? this.urls[payload.overwriteUrl] : url; - const batchId = await this.crowdStrikeSessionManager.initializeSession( { endpoint_ids: payload.endpoint_ids }, connectorUsageCollector @@ -313,7 +307,7 @@ export class CrowdstrikeConnector extends SubActionConnector< } return await this.crowdstrikeApiRequest<CrowdStrikeExecuteRTRResponse>( { - url: csUrl, + url, method: 'post', data: { base_command: baseCommand, @@ -335,7 +329,6 @@ export class CrowdstrikeConnector extends SubActionConnector< payload: { command: string; endpoint_ids: string[]; - overwriteUrl?: 'batchActiveResponderExecuteRTR' | 'batchAdminExecuteRTR'; }, connectorUsageCollector: ConnectorUsageCollector ): Promise<CrowdStrikeExecuteRTRResponse> { @@ -351,7 +344,6 @@ export class CrowdstrikeConnector extends SubActionConnector< payload: { command: string; endpoint_ids: string[]; - overwriteUrl?: 'batchAdminExecuteRTR'; }, connectorUsageCollector: ConnectorUsageCollector ): Promise<CrowdStrikeExecuteRTRResponse> { diff --git a/x-pack/plugins/stack_connectors/server/connector_types/inference/helpers.ts b/x-pack/plugins/stack_connectors/server/connector_types/inference/helpers.ts new file mode 100644 index 0000000000000..7c6bfab9c6396 --- /dev/null +++ b/x-pack/plugins/stack_connectors/server/connector_types/inference/helpers.ts @@ -0,0 +1,111 @@ +/* + * 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 { last, lastValueFrom, map, merge, Observable, scan, share } from 'rxjs'; +import type { Readable } from 'node:stream'; +import { createParser } from 'eventsource-parser'; +import { UnifiedChatCompleteResponse } from '../../../common/inference/types'; + +// TODO: Extract to the common package with appex-ai +export function eventSourceStreamIntoObservable(readable: Readable) { + return new Observable<string>((subscriber) => { + const parser = createParser({ + onEvent: (event) => { + subscriber.next(event.data); + }, + }); + + async function processStream() { + for await (const chunk of readable) { + parser.feed(chunk.toString()); + } + } + + processStream().then( + () => { + subscriber.complete(); + }, + (error) => { + subscriber.error(error); + } + ); + }); +} + +export function chunksIntoMessage(obs$: Observable<UnifiedChatCompleteResponse>) { + const shared$ = obs$.pipe(share()); + + return lastValueFrom( + merge( + shared$, + shared$.pipe( + scan( + (prev, chunk) => { + if (chunk.choices.length > 0 && !chunk.usage) { + prev.choices[0].message.content += chunk.choices[0].message.content ?? ''; + + chunk.choices[0].message.tool_calls?.forEach((toolCall) => { + if (toolCall.index !== undefined) { + const prevToolCallLength = prev.choices[0].message.tool_calls?.length ?? 0; + if (prevToolCallLength - 1 !== toolCall.index) { + if (!prev.choices[0].message.tool_calls) { + prev.choices[0].message.tool_calls = []; + } + prev.choices[0].message.tool_calls.push({ + function: { + name: '', + arguments: '', + }, + id: '', + }); + } + const prevToolCall = prev.choices[0].message.tool_calls[toolCall.index]; + + if (toolCall.function?.name) { + prevToolCall.function.name += toolCall.function?.name; + } + if (toolCall.function?.arguments) { + prevToolCall.function.arguments += toolCall.function?.arguments; + } + if (toolCall.id) { + prevToolCall.id += toolCall.id; + } + if (toolCall.type) { + prevToolCall.type = toolCall.type; + } + } + }); + } else if (chunk.usage) { + prev.usage = chunk.usage; + } + return { ...prev, id: chunk.id, model: chunk.model }; + }, + { + choices: [ + { + message: { + content: '', + role: 'assistant', + }, + }, + ], + object: 'chat.completion', + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } as any + ), + last(), + map((concatenatedChunk): UnifiedChatCompleteResponse => { + // TODO: const validatedToolCalls = validateToolCalls(concatenatedChunk.choices[0].message.tool_calls); + if (concatenatedChunk.choices[0].message.content === '') { + concatenatedChunk.choices[0].message.content = null; + } + return concatenatedChunk; + }) + ) + ) + ); +} diff --git a/x-pack/plugins/stack_connectors/server/connector_types/inference/index.ts b/x-pack/plugins/stack_connectors/server/connector_types/inference/index.ts index 18af48bc18a51..5af6773d15fe9 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/inference/index.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/inference/index.ts @@ -161,7 +161,10 @@ export const configValidator = (configObject: Config, validatorServices: Validat ); } - if (!Object.keys(SUB_ACTION).includes(taskType.toUpperCase())) { + if ( + !taskType.includes('completion') && + !Object.keys(SUB_ACTION).includes(taskType.toUpperCase()) + ) { throw new Error( `Task type is not supported${ taskType && taskType.length ? `: ${taskType}` : `` diff --git a/x-pack/plugins/stack_connectors/server/connector_types/inference/inference.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/inference/inference.test.ts index a79bd0360598b..4aa28d2952dba 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/inference/inference.test.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/inference/inference.test.ts @@ -9,7 +9,7 @@ import { InferenceConnector } from './inference'; import { actionsConfigMock } from '@kbn/actions-plugin/server/actions_config.mock'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { actionsMock } from '@kbn/actions-plugin/server/mocks'; -import { PassThrough, Transform } from 'stream'; +import { Readable, Transform } from 'stream'; import {} from '@kbn/actions-plugin/server/types'; import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { InferenceInferenceResponse } from '@elastic/elasticsearch/lib/api/types'; @@ -29,7 +29,7 @@ describe('InferenceConnector', () => { ], }; - describe('performApiCompletion', () => { + describe('performApiUnifiedCompletion', () => { const mockEsClient = elasticsearchClientMock.createClusterClient().asScoped().asInternalUser; beforeEach(() => { @@ -60,28 +60,44 @@ describe('InferenceConnector', () => { }); it('uses the completion task_type is supplied', async () => { - const response = await connector.performApiCompletion({ - input: 'What is Elastic?', + const stream = Readable.from([ + `data: {"id":"chatcmpl-AbLKRuRMZCAcMMQdl96KMTUgAfZNg","choices":[{"delta":{"content":" you"},"index":0}],"model":"gpt-4o-2024-08-06","object":"chat.completion.chunk"}\n\n`, + `data: [DONE]\n\n`, + ]); + mockEsClient.transport.request.mockResolvedValue(stream); + + const response = await connector.performApiUnifiedCompletion({ + body: { messages: [{ content: 'What is Elastic?', role: 'user' }] }, }); - expect(mockEsClient.inference.inference).toBeCalledTimes(1); - expect(mockEsClient.inference.inference).toHaveBeenCalledWith( + expect(mockEsClient.transport.request).toBeCalledTimes(1); + expect(mockEsClient.transport.request).toHaveBeenCalledWith( { - inference_id: 'test', - input: 'What is Elastic?', - task_type: 'completion', + body: { + messages: [ + { + content: 'What is Elastic?', + role: 'user', + }, + ], + n: undefined, + }, + method: 'POST', + path: '_inference/completion/test/_unified', }, - { asStream: false } + { asStream: true } ); - expect(response).toEqual(mockResponse.completion); + expect(response.choices[0].message.content).toEqual(' you'); }); it('errors during API calls are properly handled', async () => { // @ts-ignore - mockEsClient.inference.inference = mockError; + mockEsClient.transport.request = mockError; - await expect(connector.performApiCompletion({ input: 'What is Elastic?' })).rejects.toThrow( - 'API Error' - ); + await expect( + connector.performApiUnifiedCompletion({ + body: { messages: [{ content: 'What is Elastic?', role: 'user' }] }, + }) + ).rejects.toThrow('API Error'); }); }); @@ -223,6 +239,7 @@ describe('InferenceConnector', () => { }; beforeEach(() => { + jest.clearAllMocks(); // @ts-ignore mockStream(); }); @@ -238,7 +255,7 @@ describe('InferenceConnector', () => { }, provider: 'elasticsearch', taskType: 'completion', - inferenceId: '', + inferenceId: 'test', taskTypeConfig: {}, }, secrets: { providerSecrets: {} }, @@ -247,13 +264,23 @@ describe('InferenceConnector', () => { }); it('the API call is successful with correct request parameters', async () => { - await connector.performApiCompletionStream({ input: 'Hello world' }); - expect(mockEsClient.inference.inference).toBeCalledTimes(1); - expect(mockEsClient.inference.inference).toHaveBeenCalledWith( + await connector.performApiUnifiedCompletionStream({ + body: { messages: [{ content: 'Hello world', role: 'user' }] }, + }); + expect(mockEsClient.transport.request).toBeCalledTimes(1); + expect(mockEsClient.transport.request).toHaveBeenCalledWith( { - inference_id: '', - input: 'Hello world', - task_type: 'completion', + body: { + messages: [ + { + content: 'Hello world', + role: 'user', + }, + ], + n: undefined, + }, + method: 'POST', + path: '_inference/completion/test/_unified', }, { asStream: true } ); @@ -261,32 +288,42 @@ describe('InferenceConnector', () => { it('signal is properly passed to streamApi', async () => { const signal = jest.fn() as unknown as AbortSignal; - await connector.performApiCompletionStream({ input: 'Hello world', signal }); + await connector.performApiUnifiedCompletionStream({ + body: { messages: [{ content: 'Hello world', role: 'user' }] }, + signal, + }); - expect(mockEsClient.inference.inference).toHaveBeenCalledWith( + expect(mockEsClient.transport.request).toHaveBeenCalledWith( { - inference_id: '', - input: 'Hello world', - task_type: 'completion', + body: { messages: [{ content: 'Hello world', role: 'user' }], n: undefined }, + method: 'POST', + path: '_inference/completion/test/_unified', }, - { asStream: true, signal } + { asStream: true } ); }); it('errors during API calls are properly handled', async () => { // @ts-ignore - mockEsClient.inference.inference = mockError; + mockEsClient.transport.request = mockError; await expect( - connector.performApiCompletionStream({ input: 'What is Elastic?' }) + connector.performApiUnifiedCompletionStream({ + body: { messages: [{ content: 'What is Elastic?', role: 'user' }] }, + }) ).rejects.toThrow('API Error'); }); it('responds with a readable stream', async () => { - const response = await connector.performApiCompletionStream({ - input: 'What is Elastic?', + const stream = Readable.from([ + `data: {"id":"chatcmpl-AbLKRuRMZCAcMMQdl96KMTUgAfZNg","choices":[{"delta":{"content":" you"},"index":0}],"model":"gpt-4o-2024-08-06","object":"chat.completion.chunk"}\n\n`, + `data: [DONE]\n\n`, + ]); + mockEsClient.transport.request.mockResolvedValue(stream); + const response = await connector.performApiUnifiedCompletionStream({ + body: { messages: [{ content: 'What is Elastic?', role: 'user' }] }, }); - expect(response instanceof PassThrough).toEqual(true); + expect(response instanceof Readable).toEqual(true); }); }); }); diff --git a/x-pack/plugins/stack_connectors/server/connector_types/inference/inference.ts b/x-pack/plugins/stack_connectors/server/connector_types/inference/inference.ts index d9aa4bf044e1d..d6c9af0e1365e 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/inference/inference.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/inference/inference.ts @@ -6,36 +6,44 @@ */ import { ServiceParams, SubActionConnector } from '@kbn/actions-plugin/server'; - -import { PassThrough, Stream } from 'stream'; -import { IncomingMessage } from 'http'; +import { Stream } from 'openai/streaming'; +import { Readable } from 'stream'; import { AxiosError } from 'axios'; import { InferenceInferenceRequest, InferenceInferenceResponse, - InferenceTaskType, } from '@elastic/elasticsearch/lib/api/types'; +import { ConnectorUsageCollector } from '@kbn/actions-plugin/server/usage'; +import { filter, from, identity, map, mergeMap, Observable, tap } from 'rxjs'; +import OpenAI from 'openai'; +import { ChatCompletionChunk } from 'openai/resources'; import { ChatCompleteParamsSchema, RerankParamsSchema, SparseEmbeddingParamsSchema, TextEmbeddingParamsSchema, + UnifiedChatCompleteParamsSchema, } from '../../../common/inference/schema'; import { Config, Secrets, - ChatCompleteParams, - ChatCompleteResponse, - StreamingResponse, RerankParams, RerankResponse, SparseEmbeddingParams, SparseEmbeddingResponse, TextEmbeddingParams, TextEmbeddingResponse, + UnifiedChatCompleteParams, + UnifiedChatCompleteResponse, + DashboardActionParams, + DashboardActionResponse, + ChatCompleteParams, + ChatCompleteResponse, } from '../../../common/inference/types'; import { SUB_ACTION } from '../../../common/inference/constants'; +import { initDashboard } from '../lib/gen_ai/create_gen_ai_dashboard'; +import { chunksIntoMessage, eventSourceStreamIntoObservable } from './helpers'; export class InferenceConnector extends SubActionConnector<Config, Secrets> { // Not using Axios @@ -60,10 +68,25 @@ export class InferenceConnector extends SubActionConnector<Config, Secrets> { } private registerSubActions() { + // non-streaming unified completion task this.registerSubAction({ - name: SUB_ACTION.COMPLETION, - method: 'performApiCompletion', - schema: ChatCompleteParamsSchema, + name: SUB_ACTION.UNIFIED_COMPLETION, + method: 'performApiUnifiedCompletion', + schema: UnifiedChatCompleteParamsSchema, + }); + + // streaming unified completion task + this.registerSubAction({ + name: SUB_ACTION.UNIFIED_COMPLETION_STREAM, + method: 'performApiUnifiedCompletionStream', + schema: UnifiedChatCompleteParamsSchema, + }); + + // streaming unified completion task for langchain + this.registerSubAction({ + name: SUB_ACTION.UNIFIED_COMPLETION_ASYNC_ITERATOR, + method: 'performApiUnifiedCompletionAsyncIterator', + schema: UnifiedChatCompleteParamsSchema, }); this.registerSubAction({ @@ -85,8 +108,8 @@ export class InferenceConnector extends SubActionConnector<Config, Secrets> { }); this.registerSubAction({ - name: SUB_ACTION.COMPLETION_STREAM, - method: 'performApiCompletionStream', + name: SUB_ACTION.COMPLETION, + method: 'performApiCompletion', schema: ChatCompleteParamsSchema, }); } @@ -96,16 +119,112 @@ export class InferenceConnector extends SubActionConnector<Config, Secrets> { * @param input the text on which you want to perform the inference task. * @signal abort signal */ - public async performApiCompletion({ - input, - signal, - }: ChatCompleteParams & { signal?: AbortSignal }): Promise<ChatCompleteResponse> { - const response = await this.performInferenceApi( - { inference_id: this.inferenceId, input, task_type: 'completion' }, - false, - signal + public async performApiUnifiedCompletion( + params: UnifiedChatCompleteParams + ): Promise<UnifiedChatCompleteResponse> { + const res = await this.performApiUnifiedCompletionStream(params); + + const obs$ = from(eventSourceStreamIntoObservable(res as unknown as Readable)).pipe( + filter((line) => !!line && line !== '[DONE]'), + map((line) => { + return JSON.parse(line) as OpenAI.ChatCompletionChunk | { error: { message: string } }; + }), + tap((line) => { + if ('error' in line) { + throw new Error(line.error.message); + } + if ( + 'choices' in line && + line.choices.length && + line.choices[0].finish_reason === 'length' + ) { + throw new Error('createTokenLimitReachedError()'); + } + }), + filter((line): line is OpenAI.ChatCompletionChunk => { + return 'object' in line && line.object === 'chat.completion.chunk'; + }), + mergeMap((chunk): Observable<UnifiedChatCompleteResponse> => { + const events: UnifiedChatCompleteResponse[] = []; + events.push({ + choices: chunk.choices.map((c) => ({ + message: { + tool_calls: c.delta.tool_calls?.map((t) => ({ + index: t.index, + id: t.id, + function: t.function, + type: t.type, + })), + content: c.delta.content, + refusal: c.delta.refusal, + role: c.delta.role, + }, + finish_reason: c.finish_reason, + index: c.index, + })), + id: chunk.id, + model: chunk.model, + object: chunk.object, + usage: chunk.usage, + }); + return from(events); + }), + identity + ); + + return chunksIntoMessage(obs$); + } + + /** + * responsible for making a esClient inference method to perform chat completetion task endpoint and returning the service response data + * @param input the text on which you want to perform the inference task. + * @signal abort signal + */ + public async performApiUnifiedCompletionStream(params: UnifiedChatCompleteParams) { + return await this.esClient.transport.request<UnifiedChatCompleteResponse>( + { + method: 'POST', + path: `_inference/completion/${this.inferenceId}/_unified`, + body: { ...params.body, n: undefined }, // exclude n param for now, constant is used on the inference API side + }, + { + asStream: true, + } ); - return response.completion!; + } + + /** + * Streamed requests (langchain) + * @param params - the request body + * @returns { + * consumerStream: Stream<UnifiedChatCompleteResponse>; the result to be read/transformed on the server and sent to the client via Server Sent Events + * tokenCountStream: Stream<UnifiedChatCompleteResponse>; the result for token counting stream + * } + */ + public async performApiUnifiedCompletionAsyncIterator( + params: UnifiedChatCompleteParams & { signal?: AbortSignal }, + connectorUsageCollector: ConnectorUsageCollector + ): Promise<{ + consumerStream: Stream<ChatCompletionChunk>; + tokenCountStream: Stream<ChatCompletionChunk>; + }> { + try { + connectorUsageCollector.addRequestBodyBytes(undefined, params.body); + const res = await this.performApiUnifiedCompletionStream(params); + const controller = new AbortController(); + // splits the stream in two, one is used for the UI and other for token tracking + + const stream = Stream.fromSSEResponse<ChatCompletionChunk>( + { body: res } as unknown as Response, + controller + ); + const teed = stream.tee(); + return { consumerStream: teed[0], tokenCountStream: teed[1] }; + // since we do not use the sub action connector request method, we need to do our own error handling + } catch (e) { + const errorMessage = this.getResponseErrorMessage(e); + throw new Error(errorMessage); + } } /** @@ -198,35 +317,56 @@ export class InferenceConnector extends SubActionConnector<Config, Secrets> { } } - private async streamAPI({ + /** + * responsible for making a esClient inference method to perform chat completetion task endpoint and returning the service response data + * @param input the text on which you want to perform the inference task. + * @signal abort signal + */ + public async performApiCompletion({ input, signal, - }: ChatCompleteParams & { signal?: AbortSignal }): Promise<StreamingResponse> { + }: ChatCompleteParams & { signal?: AbortSignal }): Promise<ChatCompleteResponse> { const response = await this.performInferenceApi( - { inference_id: this.inferenceId, input, task_type: this.taskType as InferenceTaskType }, - true, + { inference_id: this.inferenceId, input, task_type: 'completion' }, + false, signal ); - - return (response as unknown as Stream).pipe(new PassThrough()); + return response.completion!; } /** - * takes input. It calls the streamApi method to make a - * request to the Inference API with the message. It then returns a Transform stream - * that pipes the response from the API through the transformToString function, - * which parses the proprietary response into a string of the response text alone - * @param input A message to be sent to the API - * @signal abort signal + * retrieves a dashboard from the Kibana server and checks if the + * user has the necessary privileges to access it. + * @param dashboardId The ID of the dashboard to retrieve. */ - public async performApiCompletionStream({ - input, - signal, - }: ChatCompleteParams & { signal?: AbortSignal }): Promise<IncomingMessage> { - const res = (await this.streamAPI({ - input, - signal, - })) as unknown as IncomingMessage; - return res; + public async getDashboard({ + dashboardId, + }: DashboardActionParams): Promise<DashboardActionResponse> { + const privilege = (await this.esClient.transport.request({ + path: '/_security/user/_has_privileges', + method: 'POST', + body: { + index: [ + { + names: ['.kibana-event-log-*'], + allow_restricted_indices: true, + privileges: ['read'], + }, + ], + }, + })) as { has_all_requested: boolean }; + + if (!privilege?.has_all_requested) { + return { available: false }; + } + + const response = await initDashboard({ + logger: this.logger, + savedObjectsClient: this.savedObjectsClient, + dashboardId, + genAIProvider: 'Inference', + }); + + return { available: response.success }; } } diff --git a/x-pack/plugins/task_manager/server/saved_objects/model_versions/task_model_versions.ts b/x-pack/plugins/task_manager/server/saved_objects/model_versions/task_model_versions.ts index 775b3ea2f8cad..a86aed7e358fe 100644 --- a/x-pack/plugins/task_manager/server/saved_objects/model_versions/task_model_versions.ts +++ b/x-pack/plugins/task_manager/server/saved_objects/model_versions/task_model_versions.ts @@ -8,6 +8,10 @@ import { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server'; import { taskSchemaV1, taskSchemaV2 } from '../schemas/task'; +// IMPORTANT!!! +// When adding new model versions, make sure to manually test +// downgrading to the previous version. This is a gap in our +// automated test coverage so manual testing is needed. export const taskModelVersions: SavedObjectsModelVersionMap = { '1': { changes: [ diff --git a/x-pack/plugins/task_manager/server/saved_objects/schemas/task.test.ts b/x-pack/plugins/task_manager/server/saved_objects/schemas/task.test.ts new file mode 100644 index 0000000000000..709e50bc54bf9 --- /dev/null +++ b/x-pack/plugins/task_manager/server/saved_objects/schemas/task.test.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 { validateDuration } from './task'; + +test('allows valid duration', () => { + expect(validateDuration('1s')).toBeUndefined(); + expect(validateDuration('45346s')).toBeUndefined(); + expect(validateDuration('10m')).toBeUndefined(); + expect(validateDuration('30000000h')).toBeUndefined(); + expect(validateDuration('3245d')).toBeUndefined(); +}); + +test('returns error message for invalid duration', () => { + expect(validateDuration('10x')).toBe('string is not a valid duration: 10x'); + expect(validateDuration('PT1M')).toBe('string is not a valid duration: PT1M'); + expect(validateDuration('foo')).toBe('string is not a valid duration: foo'); + expect(validateDuration('1 minute')).toBe('string is not a valid duration: 1 minute'); + expect(validateDuration('1hr')).toBe('string is not a valid duration: 1hr'); +}); diff --git a/x-pack/plugins/task_manager/server/saved_objects/schemas/task.ts b/x-pack/plugins/task_manager/server/saved_objects/schemas/task.ts index 2a6ee5c92198c..25b6a1cb079d0 100644 --- a/x-pack/plugins/task_manager/server/saved_objects/schemas/task.ts +++ b/x-pack/plugins/task_manager/server/saved_objects/schemas/task.ts @@ -6,6 +6,13 @@ */ import { schema } from '@kbn/config-schema'; +import { isInterval } from '../../lib/intervals'; + +export function validateDuration(duration: string) { + if (!isInterval(duration)) { + return 'string is not a valid duration: ' + duration; + } +} export const taskSchemaV1 = schema.object({ taskType: schema.string(), @@ -15,7 +22,7 @@ export const taskSchemaV1 = schema.object({ runAt: schema.string(), schedule: schema.maybe( schema.object({ - interval: schema.duration(), + interval: schema.string({ validate: validateDuration }), }) ), params: schema.string(), diff --git a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_observability.json b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_observability.json index 22b1e3c3071ec..4b60ca1da8d6b 100644 --- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_observability.json +++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_observability.json @@ -131,6 +131,82 @@ } } } + }, + "slo": { + "properties": { + "slo": { + "properties": { + "total": { + "type": "long", + "_meta": { + "description": "The total number of slos in the cluster" + } + }, + "by_status": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "The number of enabled slos in the cluster" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "The number of disabled slos in the cluster" + } + } + } + }, + "by_sli_type": { + "properties": { + "DYNAMIC_KEY": { + "type": "long", + "_meta": { + "description": "The number of slos by sli type in the cluster" + } + } + } + }, + "by_rolling_duration": { + "properties": { + "DYNAMIC_KEY": { + "type": "long", + "_meta": { + "description": "The number of slos by rolling duration in the cluster" + } + } + } + }, + "by_calendar_aligned_duration": { + "properties": { + "DYNAMIC_KEY": { + "type": "long", + "_meta": { + "description": "The number of slos by calendar aligned duration in the cluster" + } + } + } + }, + "by_budgeting_method": { + "properties": { + "occurrences": { + "type": "long", + "_meta": { + "description": "The number of slos by timeslices budgeting method in the cluster" + } + }, + "timeslices": { + "type": "long", + "_meta": { + "description": "The number of slos by occurrences budgeting method in the cluster" + } + } + } + } + } + } + } } } } 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 ccdfb2a3bf647..b2870f3ef4809 100644 --- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json +++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @@ -10955,909 +10955,197 @@ } } }, - "cloud_defend": { + "connectors": { "properties": { - "indices": { - "properties": { - "alerts": { - "properties": { - "doc_count": { - "type": "long" - }, - "deleted": { - "type": "long" - }, - "size_in_bytes": { - "type": "long" - }, - "last_doc_timestamp": { - "type": "date" - } - } - }, - "file": { - "properties": { - "doc_count": { - "type": "long" - }, - "deleted": { - "type": "long" - }, - "size_in_bytes": { - "type": "long" - }, - "last_doc_timestamp": { - "type": "date" - } - } - }, - "process": { - "properties": { - "doc_count": { - "type": "long" - }, - "deleted": { - "type": "long" - }, - "size_in_bytes": { - "type": "long" - }, - "last_doc_timestamp": { - "type": "date" - } - } - }, - "latestPackageVersion": { - "type": "keyword" - }, - "packageStatus": { - "properties": { - "status": { - "type": "keyword" - }, - "installedPackagePolicies": { - "type": "long" - }, - "healthyAgents": { - "type": "long" - } - } - } - } - }, - "pods_stats": { + "connectors": { "type": "array", "items": { "properties": { - "account_id": { - "type": "keyword" - }, - "container_image_name": { - "type": "keyword" - }, - "container_image_tag": { + "id": { "type": "keyword" }, - "pod_name": { + "serviceType": { "type": "keyword" }, - "total_doc_count": { - "type": "long" - }, - "process_doc_count": { - "type": "long" - }, - "file_doc_count": { - "type": "long" - }, - "alert_doc_count": { - "type": "long" - } - } - } - }, - "accounts_stats": { - "type": "array", - "items": { - "properties": { - "account_id": { - "type": "keyword" + "isNative": { + "type": "boolean" }, - "cloud_provider": { - "type": "keyword" + "isDeleted": { + "type": "boolean" }, - "kubernetes_version": { + "status": { "type": "keyword" }, - "total_doc_count": { - "type": "long" - }, - "file_doc_count": { - "type": "long" - }, - "process_doc_count": { - "type": "long" - }, - "alert_doc_count": { - "type": "long" - }, - "agents_count": { - "type": "short" - }, - "nodes_count": { - "type": "short" - }, - "pods_count": { - "type": "short" - } - } - } - }, - "installation_stats": { - "type": "array", - "items": { - "properties": { - "package_policy_id": { + "indexName": { "type": "keyword" }, - "package_version": { - "type": "keyword" + "dlsEnabled": { + "type": "boolean" }, - "agent_policy_id": { - "type": "keyword" + "sslEnabled": { + "type": "boolean" }, - "created_at": { - "type": "date" + "fetchSelectively": { + "type": "boolean" }, - "agent_count": { - "type": "long" + "textExtractionServiceEnabled": { + "type": "boolean" }, - "policy_yaml": { - "type": "keyword" + "documents": { + "properties": { + "total": { + "type": "long" + }, + "volume": { + "type": "long" + }, + "inLastSync": { + "type": "long" + } + } }, - "selectors": { - "type": "array", - "items": { - "properties": { - "type": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "operation": { - "type": "array", - "items": { - "type": "keyword" - } - }, - "containerImageFullName": { - "type": "array", - "items": { - "type": "keyword" - } - }, - "containerImageName": { - "type": "array", - "items": { + "dataSourceSpecific": { + "properties": { + "confluence": { + "properties": { + "dataSourceType": { "type": "keyword" } - }, - "containerImageTag": { - "type": "array", - "items": { - "type": "keyword" + } + }, + "github": { + "properties": { + "isCloud": { + "type": "boolean" } - }, - "kubernetesClusterId": { - "type": "array", - "items": { + } + }, + "jira": { + "properties": { + "dataSourceType": { "type": "keyword" } - }, - "kubernetesClusterName": { - "type": "array", - "items": { - "type": "keyword" + } + }, + "mongodb": { + "properties": { + "directConnect": { + "type": "boolean" } - }, - "kubernetesNamespace": { - "type": "array", - "items": { - "type": "keyword" + } + }, + "mssql": { + "properties": { + "validateHost": { + "type": "boolean" + }, + "tables": { + "type": "long" } - }, - "kubernetesPodLabel": { - "type": "array", - "items": { - "type": "keyword" + } + }, + "mysql": { + "properties": { + "tables": { + "type": "long" } - }, - "kubernetesPodName": { - "type": "array", - "items": { - "type": "keyword" + } + }, + "oracle": { + "properties": { + "tables": { + "type": "long" } - }, - "targetFilePath": { - "type": "array", - "items": { - "type": "keyword" + } + }, + "postgresql": { + "properties": { + "tables": { + "type": "long" } - }, - "ignoreVolumeFiles": { - "type": "boolean" - }, - "ignoreVolumeMounts": { - "type": "boolean" - }, - "processExecutable": { - "type": "array", - "items": { - "type": "keyword" + } + }, + "slack": { + "properties": { + "autoJoinChannelsEnabled": { + "type": "boolean" + }, + "syncUsersEnabled": { + "type": "boolean" + }, + "fetchLastNDays": { + "type": "long" } - }, - "processName": { - "type": "array", - "items": { - "type": "keyword" + } + }, + "zoom": { + "properties": { + "recordingAge": { + "type": "long" } - }, - "sessionLeaderInteractive": { - "type": "boolean" } } } }, - "responses": { - "type": "array", - "items": { - "properties": { - "type": { - "type": "keyword" - }, - "match": { - "type": "array", - "items": { - "type": "keyword" - } - }, - "exclude": { - "type": "array", - "items": { - "type": "keyword" + "scheduling": { + "properties": { + "accessControl": { + "properties": { + "enabled": { + "type": "boolean" + }, + "interval": { + "type": "text" } - }, - "actions": { - "type": "array", - "items": { - "type": "keyword" + } + }, + "full": { + "properties": { + "enabled": { + "type": "boolean" + }, + "interval": { + "type": "text" + } + } + }, + "incremental": { + "properties": { + "enabled": { + "type": "boolean" + }, + "interval": { + "type": "text" } } } } - } - } - } - } - } - }, - "cloud_security_posture": { - "properties": { - "indices": { - "properties": { - "findings": { - "properties": { - "doc_count": { - "type": "long" - }, - "deleted": { - "type": "long" - }, - "size_in_bytes": { - "type": "long" - }, - "last_doc_timestamp": { - "type": "date" - } - } - }, - "latest_findings": { - "properties": { - "doc_count": { - "type": "long" - }, - "deleted": { - "type": "long" - }, - "size_in_bytes": { - "type": "long" - }, - "last_doc_timestamp": { - "type": "date" - } - } - }, - "vulnerabilities": { - "properties": { - "doc_count": { - "type": "long" - }, - "deleted": { - "type": "long" - }, - "size_in_bytes": { - "type": "long" - }, - "last_doc_timestamp": { - "type": "date" - } - } - }, - "latest_vulnerabilities": { - "properties": { - "doc_count": { - "type": "long" - }, - "deleted": { - "type": "long" - }, - "size_in_bytes": { - "type": "long" - }, - "last_doc_timestamp": { - "type": "date" - } - } - }, - "score": { - "properties": { - "doc_count": { - "type": "long" - }, - "deleted": { - "type": "long" - }, - "size_in_bytes": { - "type": "long" - }, - "last_doc_timestamp": { - "type": "date" - } - } - }, - "latestPackageVersion": { - "type": "keyword" - }, - "cspm": { - "properties": { - "status": { - "type": "keyword" - }, - "installedPackagePolicies": { - "type": "long" - }, - "healthyAgents": { - "type": "long" - } - } - }, - "kspm": { - "properties": { - "status": { - "type": "keyword" - }, - "installedPackagePolicies": { - "type": "long" - }, - "healthyAgents": { - "type": "long" - } - } - }, - "vuln_mgmt": { - "properties": { - "status": { - "type": "keyword" - }, - "installedPackagePolicies": { - "type": "long" - }, - "healthyAgents": { - "type": "long" - } - } - } - } - }, - "resources_stats": { - "type": "array", - "items": { - "properties": { - "account_id": { - "type": "keyword" - }, - "resource_type": { - "type": "keyword" - }, - "resource_type_doc_count": { - "type": "long" - }, - "resource_sub_type": { - "type": "keyword" - }, - "resource_sub_type_doc_count": { - "type": "long" - }, - "passed_findings_count": { - "type": "long" - }, - "failed_findings_count": { - "type": "long" - } - } - } - }, - "accounts_stats": { - "type": "array", - "items": { - "properties": { - "account_id": { - "type": "keyword" - }, - "posture_score": { - "type": "long" - }, - "latest_findings_doc_count": { - "type": "long" - }, - "benchmark_id": { - "type": "keyword" - }, - "benchmark_name": { - "type": "keyword" - }, - "benchmark_version": { - "type": "keyword" - }, - "kubernetes_version": { - "type": "keyword" - }, - "passed_findings_count": { - "type": "long" - }, - "failed_findings_count": { - "type": "long" - }, - "agents_count": { - "type": "short" - }, - "nodes_count": { - "type": "short" - }, - "pods_count": { - "type": "short" - } - } - } - }, - "rules_stats": { - "type": "array", - "items": { - "properties": { - "account_id": { - "type": "keyword" - }, - "rule_id": { - "type": "keyword" - }, - "rule_name": { - "type": "keyword" - }, - "rule_section": { - "type": "keyword" - }, - "rule_version": { - "type": "keyword" - }, - "rule_number": { - "type": "keyword" - }, - "posture_type": { - "type": "keyword" - }, - "benchmark_id": { - "type": "keyword" - }, - "benchmark_name": { - "type": "keyword" - }, - "benchmark_version": { - "type": "keyword" - }, - "passed_findings_count": { - "type": "long" - }, - "failed_findings_count": { - "type": "long" - } - } - } - }, - "installation_stats": { - "type": "array", - "items": { - "properties": { - "package_policy_id": { - "type": "keyword" - }, - "feature": { - "type": "keyword" - }, - "package_version": { - "type": "keyword" - }, - "agent_policy_id": { - "type": "keyword" - }, - "deployment_mode": { - "type": "keyword" - }, - "created_at": { - "type": "date" - }, - "agent_count": { - "type": "long" - }, - "is_agentless": { - "type": "boolean" - }, - "account_type": { - "type": "keyword" - }, - "is_setup_automatic": { - "type": "boolean" - }, - "setup_access_option": { - "type": "keyword" - } - } - } - }, - "alerts_stats": { - "type": "array", - "items": { - "properties": { - "posture_type": { - "type": "keyword" - }, - "rules_count": { - "type": "long" - }, - "alerts_count": { - "type": "long" - }, - "alerts_open_count": { - "type": "long" - }, - "alerts_closed_count": { - "type": "long" - }, - "alerts_acknowledged_count": { - "type": "long" - } - } - } - }, - "cloud_account_stats": { - "type": "array", - "items": { - "properties": { - "account_id": { - "type": "keyword" - }, - "cloud_provider": { - "type": "keyword" - }, - "product": { - "type": "keyword" }, - "package_policy_id": { - "type": "keyword" - }, - "latest_doc_count": { - "type": "long" - }, - "latest_doc_updated_timestamp": { - "type": "date" - }, - "posture_management_stats": { + "syncRules": { "properties": { - "posture_score": { - "type": "long" - }, - "benchmark_name": { - "type": "keyword" - }, - "benchmark_version": { - "type": "keyword" - }, - "passed_findings_count": { - "type": "long" + "active": { + "properties": { + "withBasicRules": { + "type": "boolean" + }, + "withAdvancedRules": { + "type": "boolean" + } + } }, - "failed_findings_count": { - "type": "long" + "draft": { + "properties": { + "withBasicRules": { + "type": "boolean" + }, + "withAdvancedRules": { + "type": "boolean" + } + } } } }, - "posture_management_stats_enabled_rules": { - "properties": { - "posture_score": { - "type": "long" - }, - "benchmark_name": { - "type": "keyword" - }, - "benchmark_version": { - "type": "keyword" - }, - "passed_findings_count": { - "type": "long" - }, - "failed_findings_count": { - "type": "long" - } - } - }, - "kspm_stats": { - "properties": { - "kubernetes_version": { - "type": "keyword" - }, - "agents_count": { - "type": "short" - }, - "nodes_count": { - "type": "short" - }, - "pods_count": { - "type": "short" - } - } - }, - "has_muted_rules": { - "type": "boolean" - } - } - } - }, - "muted_rules_stats": { - "type": "array", - "items": { - "properties": { - "id": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "section": { - "type": "keyword" - }, - "benchmark_id": { - "type": "keyword" - }, - "benchmark_name": { - "type": "keyword" - }, - "benchmark_version": { - "type": "keyword" - }, - "rule_number": { - "type": "keyword" - }, - "posture_type": { - "type": "keyword" - }, - "version": { - "type": "keyword" - } - } - } - } - } - }, - "connectors": { - "properties": { - "connectors": { - "type": "array", - "items": { - "properties": { - "id": { - "type": "keyword" - }, - "serviceType": { - "type": "keyword" - }, - "isNative": { - "type": "boolean" - }, - "isDeleted": { - "type": "boolean" - }, - "status": { - "type": "keyword" - }, - "indexName": { - "type": "keyword" - }, - "dlsEnabled": { - "type": "boolean" - }, - "sslEnabled": { - "type": "boolean" - }, - "fetchSelectively": { - "type": "boolean" - }, - "textExtractionServiceEnabled": { - "type": "boolean" - }, - "documents": { - "properties": { - "total": { - "type": "long" - }, - "volume": { - "type": "long" - }, - "inLastSync": { - "type": "long" - } - } - }, - "dataSourceSpecific": { - "properties": { - "confluence": { - "properties": { - "dataSourceType": { - "type": "keyword" - } - } - }, - "github": { - "properties": { - "isCloud": { - "type": "boolean" - } - } - }, - "jira": { - "properties": { - "dataSourceType": { - "type": "keyword" - } - } - }, - "mongodb": { - "properties": { - "directConnect": { - "type": "boolean" - } - } - }, - "mssql": { - "properties": { - "validateHost": { - "type": "boolean" - }, - "tables": { - "type": "long" - } - } - }, - "mysql": { - "properties": { - "tables": { - "type": "long" - } - } - }, - "oracle": { - "properties": { - "tables": { - "type": "long" - } - } - }, - "postgresql": { - "properties": { - "tables": { - "type": "long" - } - } - }, - "slack": { - "properties": { - "autoJoinChannelsEnabled": { - "type": "boolean" - }, - "syncUsersEnabled": { - "type": "boolean" - }, - "fetchLastNDays": { - "type": "long" - } - } - }, - "zoom": { - "properties": { - "recordingAge": { - "type": "long" - } - } - } - } - }, - "scheduling": { - "properties": { - "accessControl": { - "properties": { - "enabled": { - "type": "boolean" - }, - "interval": { - "type": "text" - } - } - }, - "full": { - "properties": { - "enabled": { - "type": "boolean" - }, - "interval": { - "type": "text" - } - } - }, - "incremental": { - "properties": { - "enabled": { - "type": "boolean" - }, - "interval": { - "type": "text" - } - } - } - } - }, - "syncRules": { - "properties": { - "active": { - "properties": { - "withBasicRules": { - "type": "boolean" - }, - "withAdvancedRules": { - "type": "boolean" - } - } - }, - "draft": { - "properties": { - "withBasicRules": { - "type": "boolean" - }, - "withAdvancedRules": { - "type": "boolean" - } - } - } - } - }, - "ingestPipeline": { + "ingestPipeline": { "properties": { "name": { "type": "keyword" @@ -14534,4969 +13822,400 @@ }, "avg": { "type": "float", - "_meta": { - "description": "avg number of layers with term joins per map" - } - }, - "total": { - "type": "long", - "_meta": { - "description": "total number of layers with term joins in cluster" - } - } - } - } - } - }, - "basemaps": { - "properties": { - "auto": { - "properties": { - "min": { - "type": "long", - "_meta": { - "description": "min number of ems basemap layers with auto-style per map" - } - }, - "max": { - "type": "long", - "_meta": { - "description": "max number of ems basemap layers with auto-style per map" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "avg number of ems basemap layers with auto-style per map" - } - }, - "total": { - "type": "long", - "_meta": { - "description": "total number of ems basemap layers with auto-style in cluster" - } - } - } - }, - "dark": { - "properties": { - "min": { - "type": "long", - "_meta": { - "description": "min number of ems basemap layers with dark-style per map" - } - }, - "max": { - "type": "long", - "_meta": { - "description": "max number of ems basemap layers with dark-style per map" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "avg number of ems basemap layers with dark-style per map" - } - }, - "total": { - "type": "long", - "_meta": { - "description": "total number of ems basemap layers with dark-style in cluster" - } - } - } - }, - "roadmap": { - "properties": { - "min": { - "type": "long", - "_meta": { - "description": "min number of ems basemap layers with roadmap-style per map" - } - }, - "max": { - "type": "long", - "_meta": { - "description": "max number of ems basemap layers with roadmap-style per map" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "avg number of ems basemap layers with roadmap-style per map" - } - }, - "total": { - "type": "long", - "_meta": { - "description": "total number of ems basemap layers with roadmap-style in cluster" - } - } - } - }, - "roadmap_desaturated": { - "properties": { - "min": { - "type": "long", - "_meta": { - "description": "min number of ems basemap layers with desaturated-style per map" - } - }, - "max": { - "type": "long", - "_meta": { - "description": "max number of ems basemap layers with desaturated-style per map" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "avg number of ems basemap layers with desaturated-style per map" - } - }, - "total": { - "type": "long", - "_meta": { - "description": "total number of ems basemap layers with desaturated-style in cluster" - } - } - } - } - } - }, - "attributesPerMap": { - "properties": { - "dataSourcesCount": { - "properties": { - "min": { - "type": "long" - }, - "max": { - "type": "long" - }, - "avg": { - "type": "float" - } - } - }, - "layersCount": { - "properties": { - "min": { - "type": "long" - }, - "max": { - "type": "long" - }, - "avg": { - "type": "float" - } - } - }, - "layerTypesCount": { - "properties": { - "DYNAMIC_KEY": { - "properties": { - "min": { - "type": "long" - }, - "max": { - "type": "long" - }, - "avg": { - "type": "float" - } - } - } - } - }, - "emsVectorLayersCount": { - "properties": { - "DYNAMIC_KEY": { - "properties": { - "min": { - "type": "long" - }, - "max": { - "type": "long" - }, - "avg": { - "type": "float" - } - } - } - } - }, - "customIconsCount": { - "properties": { - "min": { - "type": "long" - }, - "max": { - "type": "long" - }, - "avg": { - "type": "float" - } - } - } - } - } - } - }, - "monitoring": { - "properties": { - "hasMonitoringData": { - "type": "boolean" - }, - "clusters": { - "type": "array", - "items": { - "properties": { - "license": { - "type": "keyword" - }, - "clusterUuid": { - "type": "keyword" - }, - "metricbeatUsed": { - "type": "boolean" - }, - "elasticsearch": { - "properties": { - "enabled": { - "type": "boolean" - }, - "count": { - "type": "long" - }, - "metricbeatUsed": { - "type": "boolean" - } - } - }, - "kibana": { - "properties": { - "enabled": { - "type": "boolean" - }, - "count": { - "type": "long" - }, - "metricbeatUsed": { - "type": "boolean" - } - } - }, - "logstash": { - "properties": { - "enabled": { - "type": "boolean" - }, - "count": { - "type": "long" - }, - "metricbeatUsed": { - "type": "boolean" - } - } - }, - "beats": { - "properties": { - "enabled": { - "type": "boolean" - }, - "count": { - "type": "long" - }, - "metricbeatUsed": { - "type": "boolean" - } - } - }, - "apm": { - "properties": { - "enabled": { - "type": "boolean" - }, - "count": { - "type": "long" - }, - "metricbeatUsed": { - "type": "boolean" - } - } - } - } - } - } - } - }, - "reporting": { - "properties": { - "available": { - "type": "boolean" - }, - "enabled": { - "type": "boolean" - } - } - }, - "saved_objects_tagging": { - "properties": { - "usedTags": { - "type": "integer" - }, - "taggedObjects": { - "type": "integer" - }, - "types": { - "properties": { - "dashboard": { - "properties": { - "usedTags": { - "type": "integer" - }, - "taggedObjects": { - "type": "integer" - } - } - }, - "lens": { - "properties": { - "usedTags": { - "type": "integer" - }, - "taggedObjects": { - "type": "integer" - } - } - }, - "visualization": { - "properties": { - "usedTags": { - "type": "integer" - }, - "taggedObjects": { - "type": "integer" - } - } - }, - "map": { - "properties": { - "usedTags": { - "type": "integer" - }, - "taggedObjects": { - "type": "integer" - } - } - }, - "search": { - "properties": { - "usedTags": { - "type": "integer" - }, - "taggedObjects": { - "type": "integer" - } - } - }, - "osquery-pack": { - "properties": { - "usedTags": { - "type": "integer" - }, - "taggedObjects": { - "type": "integer" - } - } - }, - "osquery-pack-asset": { - "properties": { - "usedTags": { - "type": "integer" - }, - "taggedObjects": { - "type": "integer" - } - } - }, - "osquery-saved-query": { - "properties": { - "usedTags": { - "type": "integer" - }, - "taggedObjects": { - "type": "integer" - } - } - } - } - } - } - }, - "security": { - "properties": { - "auditLoggingEnabled": { - "type": "boolean", - "_meta": { - "description": "Indicates if audit logging is both enabled and supported by the current license." - } - }, - "loginSelectorEnabled": { - "type": "boolean", - "_meta": { - "description": "Indicates if the login selector UI is enabled." - } - }, - "accessAgreementEnabled": { - "type": "boolean", - "_meta": { - "description": "Indicates if the access agreement UI is both enabled and supported by the current license." - } - }, - "authProviderCount": { - "type": "long", - "_meta": { - "description": "The number of configured auth providers (including disabled auth providers)." - } - }, - "enabledAuthProviders": { - "type": "array", - "items": { - "type": "keyword", - "_meta": { - "description": "The types of enabled auth providers (such as `saml`, `basic`, `pki`, etc)." - } - } - }, - "fipsModeEnabled": { - "type": "boolean", - "_meta": { - "description": "Indicates if Kibana is being run in FIPS mode." - } - }, - "httpAuthSchemes": { - "type": "array", - "items": { - "type": "keyword", - "_meta": { - "description": "The set of enabled http auth schemes. Used for api-based usage, and when credentials are provided via reverse-proxy." - } - } - }, - "sessionIdleTimeoutInMinutes": { - "type": "long", - "_meta": { - "description": "The global session idle timeout expiration that is configured, in minutes (0 if disabled)." - } - }, - "sessionLifespanInMinutes": { - "type": "long", - "_meta": { - "description": "The global session lifespan expiration that is configured, in minutes (0 if disabled)." - } - }, - "sessionCleanupInMinutes": { - "type": "long", - "_meta": { - "description": "The session cleanup interval that is configured, in minutes (0 if disabled)." - } - }, - "sessionConcurrentSessionsMaxSessions": { - "type": "long", - "_meta": { - "description": "The maximum number of the concurrent user sessions (0 if not configured)." - } - }, - "anonymousCredentialType": { - "type": "keyword", - "_meta": { - "description": "The credential type that is configured for the anonymous authentication provider." - } - } - } - }, - "security_solution": { - "properties": { - "detectionMetrics": { - "properties": { - "detection_rules": { - "properties": { - "detection_rule_usage": { - "properties": { - "query": { - "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "Number of query rules enabled" - } - }, - "disabled": { - "type": "long", - "_meta": { - "description": "Number of query rules disabled" - } - }, - "alerts": { - "type": "long", - "_meta": { - "description": "Number of alerts generated by query rules" - } - }, - "cases": { - "type": "long", - "_meta": { - "description": "Number of cases attached to query detection rule alerts" - } - }, - "legacy_notifications_enabled": { - "type": "long", - "_meta": { - "description": "Number of legacy notifications enabled" - } - }, - "legacy_notifications_disabled": { - "type": "long", - "_meta": { - "description": "Number of legacy notifications disabled" - } - }, - "notifications_enabled": { - "type": "long", - "_meta": { - "description": "Number of notifications enabled" - } - }, - "notifications_disabled": { - "type": "long", - "_meta": { - "description": "Number of notifications enabled" - } - }, - "legacy_investigation_fields": { - "type": "long", - "_meta": { - "description": "Number of rules using the legacy investigation fields type introduced only in 8.10 ESS" - } - }, - "alert_suppression": { - "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "Number of enabled query rules configured with suppression" - } - }, - "disabled": { - "type": "long", - "_meta": { - "description": "Number of disabled query rules configured with suppression" - } - }, - "suppressed_fields_count": { - "properties": { - "one": { - "type": "long", - "_meta": { - "description": "Number of query rules configured with one suppression field" - } - }, - "two": { - "type": "long", - "_meta": { - "description": "Number of query rules configured with two suppression field" - } - }, - "three": { - "type": "long", - "_meta": { - "description": "Number of query rules configured with three suppression field" - } - } - } - }, - "suppressed_per_time_period": { - "type": "long", - "_meta": { - "description": "Number of query rules configured with suppression per time period" - } - }, - "suppressed_per_rule_execution": { - "type": "long", - "_meta": { - "description": "Number of query rules configured with suppression per rule execution" - } - }, - "suppresses_missing_fields": { - "type": "long", - "_meta": { - "description": "Number of query rules configured to suppress alerts with missing fields" - } - }, - "does_not_suppress_missing_fields": { - "type": "long", - "_meta": { - "description": "Number of query rules configured do not suppress alerts with missing fields" - } - } - } - } - } - }, - "threshold": { - "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "Number of threshold rules enabled" - } - }, - "disabled": { - "type": "long", - "_meta": { - "description": "Number of threshold rules disabled" - } - }, - "alerts": { - "type": "long", - "_meta": { - "description": "Number of alerts generated by threshold rules" - } - }, - "cases": { - "type": "long", - "_meta": { - "description": "Number of cases attached to threshold detection rule alerts" - } - }, - "legacy_notifications_enabled": { - "type": "long", - "_meta": { - "description": "Number of legacy notifications enabled" - } - }, - "legacy_notifications_disabled": { - "type": "long", - "_meta": { - "description": "Number of legacy notifications disabled" - } - }, - "notifications_enabled": { - "type": "long", - "_meta": { - "description": "Number of notifications enabled" - } - }, - "notifications_disabled": { - "type": "long", - "_meta": { - "description": "Number of notifications enabled" - } - }, - "legacy_investigation_fields": { - "type": "long", - "_meta": { - "description": "Number of rules using the legacy investigation fields type introduced only in 8.10 ESS" - } - }, - "alert_suppression": { - "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "Number of enabled threshold rules configured with suppression" - } - }, - "disabled": { - "type": "long", - "_meta": { - "description": "Number of disabled threshold rules configured with suppression" - } - }, - "suppressed_fields_count": { - "properties": { - "one": { - "type": "long", - "_meta": { - "description": "Number of threshold rules configured with one suppression field" - } - }, - "two": { - "type": "long", - "_meta": { - "description": "Number of threshold rules configured with two suppression field" - } - }, - "three": { - "type": "long", - "_meta": { - "description": "Number of threshold rules configured with three suppression field" - } - } - } - }, - "suppressed_per_time_period": { - "type": "long", - "_meta": { - "description": "Number of threshold rules configured with suppression per time period" - } - }, - "suppressed_per_rule_execution": { - "type": "long", - "_meta": { - "description": "Number of threshold rules configured with suppression per rule execution" - } - }, - "suppresses_missing_fields": { - "type": "long", - "_meta": { - "description": "Number of threshold rules configured to suppress alerts with missing fields" - } - }, - "does_not_suppress_missing_fields": { - "type": "long", - "_meta": { - "description": "Number of threshold rules configured do not suppress alerts with missing fields" - } - } - } - } - } - }, - "eql": { - "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "Number of eql rules enabled" - } - }, - "disabled": { - "type": "long", - "_meta": { - "description": "Number of eql rules disabled" - } - }, - "alerts": { - "type": "long", - "_meta": { - "description": "Number of alerts generated by eql rules" - } - }, - "cases": { - "type": "long", - "_meta": { - "description": "Number of cases attached to eql detection rule alerts" - } - }, - "legacy_notifications_enabled": { - "type": "long", - "_meta": { - "description": "Number of legacy notifications enabled" - } - }, - "legacy_notifications_disabled": { - "type": "long", - "_meta": { - "description": "Number of legacy notifications disabled" - } - }, - "notifications_enabled": { - "type": "long", - "_meta": { - "description": "Number of notifications enabled" - } - }, - "notifications_disabled": { - "type": "long", - "_meta": { - "description": "Number of notifications enabled" - } - }, - "legacy_investigation_fields": { - "type": "long", - "_meta": { - "description": "Number of rules using the legacy investigation fields type introduced only in 8.10 ESS" - } - }, - "alert_suppression": { - "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "Number of enabled eql rules configured with suppression" - } - }, - "disabled": { - "type": "long", - "_meta": { - "description": "Number of disabled eql rules configured with suppression" - } - }, - "suppressed_fields_count": { - "properties": { - "one": { - "type": "long", - "_meta": { - "description": "Number of eql rules configured with one suppression field" - } - }, - "two": { - "type": "long", - "_meta": { - "description": "Number of eql rules configured with two suppression field" - } - }, - "three": { - "type": "long", - "_meta": { - "description": "Number of eql rules configured with three suppression field" - } - } - } - }, - "suppressed_per_time_period": { - "type": "long", - "_meta": { - "description": "Number of eql rules configured with suppression per time period" - } - }, - "suppressed_per_rule_execution": { - "type": "long", - "_meta": { - "description": "Number of eql rules configured with suppression per rule execution" - } - }, - "suppresses_missing_fields": { - "type": "long", - "_meta": { - "description": "Number of eql rules configured to suppress alerts with missing fields" - } - }, - "does_not_suppress_missing_fields": { - "type": "long", - "_meta": { - "description": "Number of eql rules configured do not suppress alerts with missing fields" - } - } - } - } - } - }, - "machine_learning": { - "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "Number of machine_learning rules enabled" - } - }, - "disabled": { - "type": "long", - "_meta": { - "description": "Number of machine_learning rules disabled" - } - }, - "alerts": { - "type": "long", - "_meta": { - "description": "Number of alerts generated by machine_learning rules" - } - }, - "cases": { - "type": "long", - "_meta": { - "description": "Number of cases attached to machine_learning detection rule alerts" - } - }, - "legacy_notifications_enabled": { - "type": "long", - "_meta": { - "description": "Number of legacy notifications enabled" - } - }, - "legacy_notifications_disabled": { - "type": "long", - "_meta": { - "description": "Number of legacy notifications disabled" - } - }, - "notifications_enabled": { - "type": "long", - "_meta": { - "description": "Number of notifications enabled" - } - }, - "notifications_disabled": { - "type": "long", - "_meta": { - "description": "Number of notifications enabled" - } - }, - "legacy_investigation_fields": { - "type": "long", - "_meta": { - "description": "Number of rules using the legacy investigation fields type introduced only in 8.10 ESS" - } - }, - "alert_suppression": { - "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "Number of enabled machine_learning rules configured with suppression" - } - }, - "disabled": { - "type": "long", - "_meta": { - "description": "Number of disabled machine_learning rules configured with suppression" - } - }, - "suppressed_fields_count": { - "properties": { - "one": { - "type": "long", - "_meta": { - "description": "Number of machine_learning rules configured with one suppression field" - } - }, - "two": { - "type": "long", - "_meta": { - "description": "Number of machine_learning rules configured with two suppression field" - } - }, - "three": { - "type": "long", - "_meta": { - "description": "Number of machine_learning rules configured with three suppression field" - } - } - } - }, - "suppressed_per_time_period": { - "type": "long", - "_meta": { - "description": "Number of machine_learning rules configured with suppression per time period" - } - }, - "suppressed_per_rule_execution": { - "type": "long", - "_meta": { - "description": "Number of machine_learning rules configured with suppression per rule execution" - } - }, - "suppresses_missing_fields": { - "type": "long", - "_meta": { - "description": "Number of machine_learning rules configured to suppress alerts with missing fields" - } - }, - "does_not_suppress_missing_fields": { - "type": "long", - "_meta": { - "description": "Number of machine_learning rules configured do not suppress alerts with missing fields" - } - } - } - } - } - }, - "threat_match": { - "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "Number of threat_match rules enabled" - } - }, - "disabled": { - "type": "long", - "_meta": { - "description": "Number of threat_match rules disabled" - } - }, - "alerts": { - "type": "long", - "_meta": { - "description": "Number of alerts generated by threat_match rules" - } - }, - "cases": { - "type": "long", - "_meta": { - "description": "Number of cases attached to threat_match detection rule alerts" - } - }, - "legacy_notifications_enabled": { - "type": "long", - "_meta": { - "description": "Number of legacy notifications enabled" - } - }, - "legacy_notifications_disabled": { - "type": "long", - "_meta": { - "description": "Number of legacy notifications disabled" - } - }, - "notifications_enabled": { - "type": "long", - "_meta": { - "description": "Number of notifications enabled" - } - }, - "notifications_disabled": { - "type": "long", - "_meta": { - "description": "Number of notifications enabled" - } - }, - "legacy_investigation_fields": { - "type": "long", - "_meta": { - "description": "Number of rules using the legacy investigation fields type introduced only in 8.10 ESS" - } - }, - "alert_suppression": { - "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "Number of enabled threat_match rules configured with suppression" - } - }, - "disabled": { - "type": "long", - "_meta": { - "description": "Number of disabled threat_match rules configured with suppression" - } - }, - "suppressed_fields_count": { - "properties": { - "one": { - "type": "long", - "_meta": { - "description": "Number of threat_match rules configured with one suppression field" - } - }, - "two": { - "type": "long", - "_meta": { - "description": "Number of threat_match rules configured with two suppression field" - } - }, - "three": { - "type": "long", - "_meta": { - "description": "Number of threat_match rules configured with three suppression field" - } - } - } - }, - "suppressed_per_time_period": { - "type": "long", - "_meta": { - "description": "Number of threat_match rules configured with suppression per time period" - } - }, - "suppressed_per_rule_execution": { - "type": "long", - "_meta": { - "description": "Number of threat_match rules configured with suppression per rule execution" - } - }, - "suppresses_missing_fields": { - "type": "long", - "_meta": { - "description": "Number of threat_match rules configured to suppress alerts with missing fields" - } - }, - "does_not_suppress_missing_fields": { - "type": "long", - "_meta": { - "description": "Number of threat_match rules configured do not suppress alerts with missing fields" - } - } - } - } - } - }, - "new_terms": { - "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "Number of new_terms rules enabled" - } - }, - "disabled": { - "type": "long", - "_meta": { - "description": "Number of new_terms rules disabled" - } - }, - "alerts": { - "type": "long", - "_meta": { - "description": "Number of alerts generated by new_terms rules" - } - }, - "cases": { - "type": "long", - "_meta": { - "description": "Number of cases attached to new_terms detection rule alerts" - } - }, - "legacy_notifications_enabled": { - "type": "long", - "_meta": { - "description": "Number of legacy notifications enabled" - } - }, - "legacy_notifications_disabled": { - "type": "long", - "_meta": { - "description": "Number of legacy notifications disabled" - } - }, - "notifications_enabled": { - "type": "long", - "_meta": { - "description": "Number of notifications enabled" - } - }, - "notifications_disabled": { - "type": "long", - "_meta": { - "description": "Number of notifications enabled" - } - }, - "legacy_investigation_fields": { - "type": "long", - "_meta": { - "description": "Number of rules using the legacy investigation fields type introduced only in 8.10 ESS" - } - }, - "alert_suppression": { - "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "Number of enabled new_terms rules configured with suppression" - } - }, - "disabled": { - "type": "long", - "_meta": { - "description": "Number of disabled new_terms rules configured with suppression" - } - }, - "suppressed_fields_count": { - "properties": { - "one": { - "type": "long", - "_meta": { - "description": "Number of new_terms rules configured with one suppression field" - } - }, - "two": { - "type": "long", - "_meta": { - "description": "Number of new_terms rules configured with two suppression field" - } - }, - "three": { - "type": "long", - "_meta": { - "description": "Number of new_terms rules configured with three suppression field" - } - } - } - }, - "suppressed_per_time_period": { - "type": "long", - "_meta": { - "description": "Number of new_terms rules configured with suppression per time period" - } - }, - "suppressed_per_rule_execution": { - "type": "long", - "_meta": { - "description": "Number of new_terms rules configured with suppression per rule execution" - } - }, - "suppresses_missing_fields": { - "type": "long", - "_meta": { - "description": "Number of new_terms rules configured to suppress alerts with missing fields" - } - }, - "does_not_suppress_missing_fields": { - "type": "long", - "_meta": { - "description": "Number of new_terms rules configured do not suppress alerts with missing fields" - } - } - } - } - } - }, - "esql": { - "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "Number of esql rules enabled" - } - }, - "disabled": { - "type": "long", - "_meta": { - "description": "Number of esql rules disabled" - } - }, - "alerts": { - "type": "long", - "_meta": { - "description": "Number of alerts generated by esql rules" - } - }, - "cases": { - "type": "long", - "_meta": { - "description": "Number of cases attached to esql detection rule alerts" - } - }, - "legacy_notifications_enabled": { - "type": "long", - "_meta": { - "description": "Number of legacy notifications enabled" - } - }, - "legacy_notifications_disabled": { - "type": "long", - "_meta": { - "description": "Number of legacy notifications disabled" - } - }, - "notifications_enabled": { - "type": "long", - "_meta": { - "description": "Number of notifications enabled" - } - }, - "notifications_disabled": { - "type": "long", - "_meta": { - "description": "Number of notifications enabled" - } - }, - "legacy_investigation_fields": { - "type": "long", - "_meta": { - "description": "Number of rules using the legacy investigation fields type introduced only in 8.10 ESS" - } - }, - "alert_suppression": { - "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "Number of enabled esql rules configured with suppression" - } - }, - "disabled": { - "type": "long", - "_meta": { - "description": "Number of disabled esql rules configured with suppression" - } - }, - "suppressed_fields_count": { - "properties": { - "one": { - "type": "long", - "_meta": { - "description": "Number of esql rules configured with one suppression field" - } - }, - "two": { - "type": "long", - "_meta": { - "description": "Number of esql rules configured with two suppression field" - } - }, - "three": { - "type": "long", - "_meta": { - "description": "Number of esql rules configured with three suppression field" - } - } - } - }, - "suppressed_per_time_period": { - "type": "long", - "_meta": { - "description": "Number of esql rules configured with suppression per time period" - } - }, - "suppressed_per_rule_execution": { - "type": "long", - "_meta": { - "description": "Number of esql rules configured with suppression per rule execution" - } - }, - "suppresses_missing_fields": { - "type": "long", - "_meta": { - "description": "Number of esql rules configured to suppress alerts with missing fields" - } - }, - "does_not_suppress_missing_fields": { - "type": "long", - "_meta": { - "description": "Number of esql rules configured do not suppress alerts with missing fields" - } - } - } - } - } - }, - "elastic_total": { - "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "Number of elastic rules enabled" - } - }, - "disabled": { - "type": "long", - "_meta": { - "description": "Number of elastic rules disabled" - } - }, - "alerts": { - "type": "long", - "_meta": { - "description": "Number of alerts generated by elastic rules" - } - }, - "cases": { - "type": "long", - "_meta": { - "description": "Number of cases attached to elastic detection rule alerts" - } - }, - "legacy_notifications_enabled": { - "type": "long", - "_meta": { - "description": "Number of legacy notifications enabled" - } - }, - "legacy_notifications_disabled": { - "type": "long", - "_meta": { - "description": "Number of legacy notifications disabled" - } - }, - "notifications_enabled": { - "type": "long", - "_meta": { - "description": "Number of notifications enabled" - } - }, - "notifications_disabled": { - "type": "long", - "_meta": { - "description": "Number of notifications enabled" - } - }, - "legacy_investigation_fields": { - "type": "long", - "_meta": { - "description": "Number of rules using the legacy investigation fields type introduced only in 8.10 ESS" - } - }, - "alert_suppression": { - "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "Number of enabled elastic rules configured with suppression" - } - }, - "disabled": { - "type": "long", - "_meta": { - "description": "Number of disabled elastic rules configured with suppression" - } - }, - "suppressed_fields_count": { - "properties": { - "one": { - "type": "long", - "_meta": { - "description": "Number of elastic rules configured with one suppression field" - } - }, - "two": { - "type": "long", - "_meta": { - "description": "Number of elastic rules configured with two suppression field" - } - }, - "three": { - "type": "long", - "_meta": { - "description": "Number of elastic rules configured with three suppression field" - } - } - } - }, - "suppressed_per_time_period": { - "type": "long", - "_meta": { - "description": "Number of elastic rules configured with suppression per time period" - } - }, - "suppressed_per_rule_execution": { - "type": "long", - "_meta": { - "description": "Number of elastic rules configured with suppression per rule execution" - } - }, - "suppresses_missing_fields": { - "type": "long", - "_meta": { - "description": "Number of elastic rules configured to suppress alerts with missing fields" - } - }, - "does_not_suppress_missing_fields": { - "type": "long", - "_meta": { - "description": "Number of elastic rules configured do not suppress alerts with missing fields" - } - } - } - } - } - }, - "custom_total": { - "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "Number of custom rules enabled" - } - }, - "disabled": { - "type": "long", - "_meta": { - "description": "Number of custom rules disabled" - } - }, - "alerts": { - "type": "long", - "_meta": { - "description": "Number of alerts generated by custom rules" - } - }, - "cases": { - "type": "long", - "_meta": { - "description": "Number of cases attached to custom detection rule alerts" - } - }, - "legacy_notifications_enabled": { - "type": "long", - "_meta": { - "description": "Number of legacy notifications enabled" - } - }, - "legacy_notifications_disabled": { - "type": "long", - "_meta": { - "description": "Number of legacy notifications disabled" - } - }, - "notifications_enabled": { - "type": "long", - "_meta": { - "description": "Number of notifications enabled" - } - }, - "notifications_disabled": { - "type": "long", - "_meta": { - "description": "Number of notifications enabled" - } - }, - "legacy_investigation_fields": { - "type": "long", - "_meta": { - "description": "Number of rules using the legacy investigation fields type introduced only in 8.10 ESS" - } - }, - "alert_suppression": { - "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "Number of enabled custom rules configured with suppression" - } - }, - "disabled": { - "type": "long", - "_meta": { - "description": "Number of disabled custom rules configured with suppression" - } - }, - "suppressed_fields_count": { - "properties": { - "one": { - "type": "long", - "_meta": { - "description": "Number of custom rules configured with one suppression field" - } - }, - "two": { - "type": "long", - "_meta": { - "description": "Number of custom rules configured with two suppression field" - } - }, - "three": { - "type": "long", - "_meta": { - "description": "Number of custom rules configured with three suppression field" - } - } - } - }, - "suppressed_per_time_period": { - "type": "long", - "_meta": { - "description": "Number of custom rules configured with suppression per time period" - } - }, - "suppressed_per_rule_execution": { - "type": "long", - "_meta": { - "description": "Number of custom rules configured with suppression per rule execution" - } - }, - "suppresses_missing_fields": { - "type": "long", - "_meta": { - "description": "Number of custom rules configured to suppress alerts with missing fields" - } - }, - "does_not_suppress_missing_fields": { - "type": "long", - "_meta": { - "description": "Number of custom rules configured do not suppress alerts with missing fields" - } - } - } - } - } - } - } - }, - "detection_rule_detail": { - "type": "array", - "items": { - "properties": { - "rule_name": { - "type": "keyword", - "_meta": { - "description": "The name of the detection rule" - } - }, - "rule_id": { - "type": "keyword", - "_meta": { - "description": "The UUID id of the detection rule" - } - }, - "rule_type": { - "type": "keyword", - "_meta": { - "description": "The type of detection rule. ie eql, query..." - } - }, - "rule_version": { - "type": "long", - "_meta": { - "description": "The version of the rule" - } - }, - "enabled": { - "type": "boolean", - "_meta": { - "description": "If the detection rule has been enabled by the user" - } - }, - "elastic_rule": { - "type": "boolean", - "_meta": { - "description": "If the detection rule has been authored by Elastic" - } - }, - "created_on": { - "type": "keyword", - "_meta": { - "description": "When the detection rule was created on the cluster" - } - }, - "updated_on": { - "type": "keyword", - "_meta": { - "description": "When the detection rule was updated on the cluster" - } - }, - "alert_count_daily": { - "type": "long", - "_meta": { - "description": "The number of daily alerts generated by a rule" - } - }, - "cases_count_total": { - "type": "long", - "_meta": { - "description": "The number of total cases generated by a rule" - } - }, - "has_legacy_notification": { - "type": "boolean", - "_meta": { - "description": "True if this rule has a legacy notification" - } - }, - "has_notification": { - "type": "boolean", - "_meta": { - "description": "True if this rule has a notification" - } - } - } - } - }, - "detection_rule_status": { - "properties": { - "all_rules": { - "properties": { - "eql": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "top_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "top_partial_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of successful rules" - } - }, - "index_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "search_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "enrichment_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_count": { - "type": "long", - "_meta": { - "description": "The count of gaps" - } - } - } - }, - "threat_match": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "top_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "top_partial_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of successful rules" - } - }, - "index_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "search_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "enrichment_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_count": { - "type": "long", - "_meta": { - "description": "The count of gaps" - } - } - } - }, - "machine_learning": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "top_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "top_partial_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of successful rules" - } - }, - "index_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "search_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "enrichment_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_count": { - "type": "long", - "_meta": { - "description": "The count of gaps" - } - } - } - }, - "query": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "top_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "top_partial_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of successful rules" - } - }, - "index_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "search_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "enrichment_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_count": { - "type": "long", - "_meta": { - "description": "The count of gaps" - } - } - } - }, - "saved_query": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "top_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "top_partial_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of successful rules" - } - }, - "index_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "search_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "enrichment_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_count": { - "type": "long", - "_meta": { - "description": "The count of gaps" - } - } - } - }, - "threshold": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "top_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "top_partial_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of successful rules" - } - }, - "index_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "search_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "enrichment_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_count": { - "type": "long", - "_meta": { - "description": "The count of gaps" - } - } - } - }, - "total": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of succeeded rules" - } - } - } - } - } - }, - "elastic_rules": { - "properties": { - "eql": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "top_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "top_partial_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of successful rules" - } - }, - "index_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "search_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "enrichment_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_count": { - "type": "long", - "_meta": { - "description": "The count of gaps" - } - } - } - }, - "threat_match": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "top_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "top_partial_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of successful rules" - } - }, - "index_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "search_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "enrichment_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_count": { - "type": "long", - "_meta": { - "description": "The count of gaps" - } - } - } - }, - "machine_learning": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "top_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "top_partial_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of successful rules" - } - }, - "index_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "search_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "enrichment_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_count": { - "type": "long", - "_meta": { - "description": "The count of gaps" - } - } - } - }, - "query": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "top_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "top_partial_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of successful rules" - } - }, - "index_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "search_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "enrichment_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_count": { - "type": "long", - "_meta": { - "description": "The count of gaps" - } - } - } - }, - "saved_query": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "top_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "top_partial_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of successful rules" - } - }, - "index_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "search_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "enrichment_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_count": { - "type": "long", - "_meta": { - "description": "The count of gaps" - } - } - } - }, - "threshold": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "top_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "top_partial_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of successful rules" - } - }, - "index_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "search_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "enrichment_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_count": { - "type": "long", - "_meta": { - "description": "The count of gaps" - } - } - } - }, - "total": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of succeeded rules" - } - } - } - } - } - }, - "custom_rules": { - "properties": { - "eql": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "top_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "top_partial_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of successful rules" - } - }, - "index_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "search_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "enrichment_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_count": { - "type": "long", - "_meta": { - "description": "The count of gaps" - } - } - } - }, - "threat_match": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "top_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "top_partial_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of successful rules" - } - }, - "index_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "search_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "enrichment_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_count": { - "type": "long", - "_meta": { - "description": "The count of gaps" - } - } - } - }, - "machine_learning": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "top_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "top_partial_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of successful rules" - } - }, - "index_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "search_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "enrichment_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_count": { - "type": "long", - "_meta": { - "description": "The count of gaps" - } - } - } - }, - "query": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "top_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "top_partial_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of successful rules" - } - }, - "index_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "search_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "enrichment_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_count": { - "type": "long", - "_meta": { - "description": "The count of gaps" - } - } - } - }, - "saved_query": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "top_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "top_partial_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of successful rules" - } - }, - "index_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "search_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "enrichment_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_count": { - "type": "long", - "_meta": { - "description": "The count of gaps" - } - } - } - }, - "threshold": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "top_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "top_partial_failures": { - "type": "array", - "items": { - "properties": { - "message": { - "type": "keyword", - "_meta": { - "description": "Failed rule message" - } - }, - "count": { - "type": "long", - "_meta": { - "description": "Number of times the message occurred" - } - } - } - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of successful rules" - } - }, - "index_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "search_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "enrichment_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_duration": { - "properties": { - "max": { - "type": "float", - "_meta": { - "description": "The max duration" - } - }, - "avg": { - "type": "float", - "_meta": { - "description": "The avg duration" - } - }, - "min": { - "type": "float", - "_meta": { - "description": "The min duration" - } - } - } - }, - "gap_count": { - "type": "long", - "_meta": { - "description": "The count of gaps" - } - } - } - }, - "total": { - "properties": { - "failures": { - "type": "long", - "_meta": { - "description": "The number of failed rules" - } - }, - "partial_failures": { - "type": "long", - "_meta": { - "description": "The number of partial failure rules" - } - }, - "succeeded": { - "type": "long", - "_meta": { - "description": "The number of succeeded rules" - } - } - } - } - } - } - } - } - } - }, - "ml_jobs": { - "properties": { - "ml_job_usage": { - "properties": { - "custom": { - "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "The number of custom ML jobs rules enabled" - } - }, - "disabled": { - "type": "long", - "_meta": { - "description": "The number of custom ML jobs rules disabled" - } - } - } - }, - "elastic": { - "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "The number of elastic provided ML jobs rules enabled" - } - }, - "disabled": { - "type": "long", - "_meta": { - "description": "The number of elastic provided ML jobs rules disabled" - } - } - } - } - } - }, - "ml_job_metrics": { - "type": "array", - "items": { - "properties": { - "job_id": { - "type": "keyword", - "_meta": { - "description": "Identifier for the anomaly detection job" - } - }, - "open_time": { - "type": "keyword", - "_meta": { - "description": "For open jobs only, the elapsed time for which the job has been open" - } - }, - "create_time": { - "type": "keyword", - "_meta": { - "description": "The time the job was created" - } - }, - "finished_time": { - "type": "keyword", - "_meta": { - "description": "If the job closed or failed, this is the time the job finished" - } - }, - "state": { - "type": "keyword", - "_meta": { - "description": "The status of the anomaly detection job" - } - }, - "data_counts": { - "properties": { - "bucket_count": { - "type": "long", - "_meta": { - "description": "The number of buckets processed" - } - }, - "empty_bucket_count": { - "type": "long", - "_meta": { - "description": "The number of buckets which did not contain any data" - } - }, - "input_bytes": { - "type": "long", - "_meta": { - "description": "The number of bytes of input data posted to the anomaly detection job" - } - }, - "input_record_count": { - "type": "long", - "_meta": { - "description": "The number of input documents posted to the anomaly detection job" - } - }, - "last_data_time": { - "type": "long", - "_meta": { - "description": "The timestamp at which data was last analyzed, according to server time" - } - }, - "processed_record_count": { - "type": "long", - "_meta": { - "description": "The number of input documents that have been processed by the anomaly detection job" - } - } - } - }, - "model_size_stats": { - "properties": { - "bucket_allocation_failures_count": { - "type": "long", - "_meta": { - "description": "The number of buckets for which new entities in incoming data were not processed due to insufficient model memory" - } - }, - "model_bytes": { - "type": "long", - "_meta": { - "description": "The number of bytes of memory used by the models" - } - }, - "model_bytes_exceeded": { - "type": "long", - "_meta": { - "description": "The number of bytes over the high limit for memory usage at the last allocation failure" - } - }, - "model_bytes_memory_limit": { - "type": "long", - "_meta": { - "description": "The upper limit for model memory usage, checked on increasing values" - } - }, - "peak_model_bytes": { - "type": "long", - "_meta": { - "description": "The peak number of bytes of memory ever used by the models" - } - } - } - }, - "timing_stats": { - "properties": { - "bucket_count": { - "type": "long", - "_meta": { - "description": "The number of buckets processed" - } - }, - "exponential_average_bucket_processing_time_ms": { - "type": "long", - "_meta": { - "description": "Exponential moving average of all bucket processing times, in milliseconds" - } - }, - "exponential_average_bucket_processing_time_per_hour_ms": { - "type": "long", - "_meta": { - "description": "Exponentially-weighted moving average of bucket processing times calculated in a 1 hour time window, in milliseconds" - } - }, - "maximum_bucket_processing_time_ms": { - "type": "long", - "_meta": { - "description": "Maximum among all bucket processing times, in milliseconds" - } - }, - "minimum_bucket_processing_time_ms": { - "type": "long", - "_meta": { - "description": "Minimum among all bucket processing times, in milliseconds" - } - }, - "total_bucket_processing_time_ms": { - "type": "long", - "_meta": { - "description": "Sum of all bucket processing times, in milliseconds" - } - } - } - }, - "datafeed": { - "properties": { - "datafeed_id": { - "type": "keyword", - "_meta": { - "description": "A numerical character string that uniquely identifies the datafeed" - } - }, - "state": { - "type": "keyword", - "_meta": { - "description": "The status of the datafeed" - } - }, - "timing_stats": { - "properties": { - "average_search_time_per_bucket_ms": { - "type": "long", - "_meta": { - "description": "The average search time per bucket, in milliseconds" - } - }, - "bucket_count": { - "type": "long", - "_meta": { - "description": "The number of buckets processed" - } - }, - "exponential_average_search_time_per_hour_ms": { - "type": "long", - "_meta": { - "description": "The exponential average search time per hour, in milliseconds" - } - }, - "search_count": { - "type": "long", - "_meta": { - "description": "The number of searches run by the datafeed" - } - }, - "total_search_time_ms": { - "type": "long", - "_meta": { - "description": "The total time the datafeed spent searching, in milliseconds" - } - } - } - } - } - } - } + "_meta": { + "description": "avg number of layers with term joins per map" + } + }, + "total": { + "type": "long", + "_meta": { + "description": "total number of layers with term joins in cluster" + } + } + } + } + } + }, + "basemaps": { + "properties": { + "auto": { + "properties": { + "min": { + "type": "long", + "_meta": { + "description": "min number of ems basemap layers with auto-style per map" + } + }, + "max": { + "type": "long", + "_meta": { + "description": "max number of ems basemap layers with auto-style per map" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "avg number of ems basemap layers with auto-style per map" + } + }, + "total": { + "type": "long", + "_meta": { + "description": "total number of ems basemap layers with auto-style in cluster" + } + } + } + }, + "dark": { + "properties": { + "min": { + "type": "long", + "_meta": { + "description": "min number of ems basemap layers with dark-style per map" + } + }, + "max": { + "type": "long", + "_meta": { + "description": "max number of ems basemap layers with dark-style per map" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "avg number of ems basemap layers with dark-style per map" + } + }, + "total": { + "type": "long", + "_meta": { + "description": "total number of ems basemap layers with dark-style in cluster" + } + } + } + }, + "roadmap": { + "properties": { + "min": { + "type": "long", + "_meta": { + "description": "min number of ems basemap layers with roadmap-style per map" + } + }, + "max": { + "type": "long", + "_meta": { + "description": "max number of ems basemap layers with roadmap-style per map" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "avg number of ems basemap layers with roadmap-style per map" + } + }, + "total": { + "type": "long", + "_meta": { + "description": "total number of ems basemap layers with roadmap-style in cluster" } } } }, - "legacy_siem_signals": { + "roadmap_desaturated": { "properties": { - "non_migrated_indices_total": { + "min": { + "type": "long", + "_meta": { + "description": "min number of ems basemap layers with desaturated-style per map" + } + }, + "max": { "type": "long", "_meta": { - "description": "Total number of non migrated legacy siem signals indices" + "description": "max number of ems basemap layers with desaturated-style per map" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "avg number of ems basemap layers with desaturated-style per map" } }, - "spaces_total": { + "total": { "type": "long", "_meta": { - "description": "Total number of Kibana spaces that have non migrated legacy siem signals indices" + "description": "total number of ems basemap layers with desaturated-style in cluster" } } } } } }, - "endpointMetrics": { + "attributesPerMap": { "properties": { - "unique_endpoint_count": { - "type": "long", - "_meta": { - "description": "Number of active unique endpoints in last 24 hours" + "dataSourcesCount": { + "properties": { + "min": { + "type": "long" + }, + "max": { + "type": "long" + }, + "avg": { + "type": "float" + } + } + }, + "layersCount": { + "properties": { + "min": { + "type": "long" + }, + "max": { + "type": "long" + }, + "avg": { + "type": "float" + } + } + }, + "layerTypesCount": { + "properties": { + "DYNAMIC_KEY": { + "properties": { + "min": { + "type": "long" + }, + "max": { + "type": "long" + }, + "avg": { + "type": "float" + } + } + } + } + }, + "emsVectorLayersCount": { + "properties": { + "DYNAMIC_KEY": { + "properties": { + "min": { + "type": "long" + }, + "max": { + "type": "long" + }, + "avg": { + "type": "float" + } + } + } + } + }, + "customIconsCount": { + "properties": { + "min": { + "type": "long" + }, + "max": { + "type": "long" + }, + "avg": { + "type": "float" + } } } } + } + } + }, + "monitoring": { + "properties": { + "hasMonitoringData": { + "type": "boolean" }, - "dashboardMetrics": { - "properties": { - "dashboard_tag": { - "properties": { - "created_at": { - "type": "keyword", - "_meta": { - "description": "The time the tab was created" + "clusters": { + "type": "array", + "items": { + "properties": { + "license": { + "type": "keyword" + }, + "clusterUuid": { + "type": "keyword" + }, + "metricbeatUsed": { + "type": "boolean" + }, + "elasticsearch": { + "properties": { + "enabled": { + "type": "boolean" + }, + "count": { + "type": "long" + }, + "metricbeatUsed": { + "type": "boolean" } - }, - "linked_dashboards_count": { - "type": "long", - "_meta": { - "description": "Number of associated dashboards" + } + }, + "kibana": { + "properties": { + "enabled": { + "type": "boolean" + }, + "count": { + "type": "long" + }, + "metricbeatUsed": { + "type": "boolean" + } + } + }, + "logstash": { + "properties": { + "enabled": { + "type": "boolean" + }, + "count": { + "type": "long" + }, + "metricbeatUsed": { + "type": "boolean" + } + } + }, + "beats": { + "properties": { + "enabled": { + "type": "boolean" + }, + "count": { + "type": "long" + }, + "metricbeatUsed": { + "type": "boolean" } } - } - }, - "dashboards": { - "type": "array", - "items": { + }, + "apm": { "properties": { - "created_at": { - "type": "keyword", - "_meta": { - "description": "The time the dashboard was created" - } - }, - "dashboard_id": { - "type": "keyword", - "_meta": { - "description": "The dashboard saved object id" - } + "enabled": { + "type": "boolean" }, - "error_message": { - "type": "keyword", - "_meta": { - "description": "The relevant error message" - } + "count": { + "type": "long" }, - "error_status_code": { - "type": "long", - "_meta": { - "description": "The relevant error status code" - } + "metricbeatUsed": { + "type": "boolean" } } } } } + } + } + }, + "reporting": { + "properties": { + "available": { + "type": "boolean" }, - "riskEngineMetrics": { - "properties": { - "unique_user_risk_score_total": { - "type": "long", - "_meta": { - "description": "Total unique user risk scores" - } - }, - "unique_host_risk_score_total": { - "type": "long", - "_meta": { - "description": "Total unique host risk scores" - } - }, - "unique_user_risk_score_day": { - "type": "long", - "_meta": { - "description": "Unique user risk scores per day" - } - }, - "unique_host_risk_score_day": { - "type": "long", - "_meta": { - "description": "Unique host risk scores per day" - } - }, - "all_host_risk_scores_total": { - "type": "long", - "_meta": { - "description": "Total number of host risk score records" - } - }, - "all_user_risk_scores_total": { - "type": "long", - "_meta": { - "description": "Total number of user risk score records" - } - }, - "all_host_risk_scores_total_day": { - "type": "long", - "_meta": { - "description": "Number of host risk score records per day" - } - }, - "all_user_risk_scores_total_day": { - "type": "long", - "_meta": { - "description": "Number of user risk score records per day" - } - }, - "all_risk_scores_index_size": { - "type": "long", - "_meta": { - "description": "Total size of the all Risk Score indices (MB)" - } - }, - "unique_risk_scores_index_size": { - "type": "long", - "_meta": { - "description": "Total size of the unique Risk Score indices (MB)" - } - } - } + "enabled": { + "type": "boolean" } } }, - "slo": { + "saved_objects_tagging": { "properties": { - "slo": { + "usedTags": { + "type": "integer" + }, + "taggedObjects": { + "type": "integer" + }, + "types": { "properties": { - "total": { - "type": "long", - "_meta": { - "description": "The total number of slos in the cluster" + "dashboard": { + "properties": { + "usedTags": { + "type": "integer" + }, + "taggedObjects": { + "type": "integer" + } } }, - "by_status": { + "lens": { "properties": { - "enabled": { - "type": "long", - "_meta": { - "description": "The number of enabled slos in the cluster" - } + "usedTags": { + "type": "integer" }, - "disabled": { - "type": "long", - "_meta": { - "description": "The number of disabled slos in the cluster" - } + "taggedObjects": { + "type": "integer" } } }, - "by_sli_type": { + "visualization": { "properties": { - "DYNAMIC_KEY": { - "type": "long", - "_meta": { - "description": "The number of slos by sli type in the cluster" - } + "usedTags": { + "type": "integer" + }, + "taggedObjects": { + "type": "integer" } } }, - "by_rolling_duration": { + "map": { "properties": { - "DYNAMIC_KEY": { - "type": "long", - "_meta": { - "description": "The number of slos by rolling duration in the cluster" - } + "usedTags": { + "type": "integer" + }, + "taggedObjects": { + "type": "integer" } } }, - "by_calendar_aligned_duration": { + "search": { "properties": { - "DYNAMIC_KEY": { - "type": "long", - "_meta": { - "description": "The number of slos by calendar aligned duration in the cluster" - } + "usedTags": { + "type": "integer" + }, + "taggedObjects": { + "type": "integer" } } }, - "by_budgeting_method": { + "osquery-pack": { "properties": { - "occurrences": { - "type": "long", - "_meta": { - "description": "The number of slos by timeslices budgeting method in the cluster" - } + "usedTags": { + "type": "integer" }, - "timeslices": { - "type": "long", - "_meta": { - "description": "The number of slos by occurrences budgeting method in the cluster" - } + "taggedObjects": { + "type": "integer" + } + } + }, + "osquery-pack-asset": { + "properties": { + "usedTags": { + "type": "integer" + }, + "taggedObjects": { + "type": "integer" + } + } + }, + "osquery-saved-query": { + "properties": { + "usedTags": { + "type": "integer" + }, + "taggedObjects": { + "type": "integer" } } } @@ -19504,6 +14223,88 @@ } } }, + "security": { + "properties": { + "auditLoggingEnabled": { + "type": "boolean", + "_meta": { + "description": "Indicates if audit logging is both enabled and supported by the current license." + } + }, + "loginSelectorEnabled": { + "type": "boolean", + "_meta": { + "description": "Indicates if the login selector UI is enabled." + } + }, + "accessAgreementEnabled": { + "type": "boolean", + "_meta": { + "description": "Indicates if the access agreement UI is both enabled and supported by the current license." + } + }, + "authProviderCount": { + "type": "long", + "_meta": { + "description": "The number of configured auth providers (including disabled auth providers)." + } + }, + "enabledAuthProviders": { + "type": "array", + "items": { + "type": "keyword", + "_meta": { + "description": "The types of enabled auth providers (such as `saml`, `basic`, `pki`, etc)." + } + } + }, + "fipsModeEnabled": { + "type": "boolean", + "_meta": { + "description": "Indicates if Kibana is being run in FIPS mode." + } + }, + "httpAuthSchemes": { + "type": "array", + "items": { + "type": "keyword", + "_meta": { + "description": "The set of enabled http auth schemes. Used for api-based usage, and when credentials are provided via reverse-proxy." + } + } + }, + "sessionIdleTimeoutInMinutes": { + "type": "long", + "_meta": { + "description": "The global session idle timeout expiration that is configured, in minutes (0 if disabled)." + } + }, + "sessionLifespanInMinutes": { + "type": "long", + "_meta": { + "description": "The global session lifespan expiration that is configured, in minutes (0 if disabled)." + } + }, + "sessionCleanupInMinutes": { + "type": "long", + "_meta": { + "description": "The session cleanup interval that is configured, in minutes (0 if disabled)." + } + }, + "sessionConcurrentSessionsMaxSessions": { + "type": "long", + "_meta": { + "description": "The maximum number of the concurrent user sessions (0 if not configured)." + } + }, + "anonymousCredentialType": { + "type": "keyword", + "_meta": { + "description": "The credential type that is configured for the anonymous authentication provider." + } + } + } + }, "spaces": { "properties": { "usesFeatureControls": { diff --git a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_security.json b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_security.json index d5b0514b64918..1ab6ba490f0b5 100644 --- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_security.json +++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_security.json @@ -1,3 +1,5127 @@ { - "properties": {} + "properties": { + "cloud_defend": { + "properties": { + "indices": { + "properties": { + "alerts": { + "properties": { + "doc_count": { + "type": "long" + }, + "deleted": { + "type": "long" + }, + "size_in_bytes": { + "type": "long" + }, + "last_doc_timestamp": { + "type": "date" + } + } + }, + "file": { + "properties": { + "doc_count": { + "type": "long" + }, + "deleted": { + "type": "long" + }, + "size_in_bytes": { + "type": "long" + }, + "last_doc_timestamp": { + "type": "date" + } + } + }, + "process": { + "properties": { + "doc_count": { + "type": "long" + }, + "deleted": { + "type": "long" + }, + "size_in_bytes": { + "type": "long" + }, + "last_doc_timestamp": { + "type": "date" + } + } + }, + "latestPackageVersion": { + "type": "keyword" + }, + "packageStatus": { + "properties": { + "status": { + "type": "keyword" + }, + "installedPackagePolicies": { + "type": "long" + }, + "healthyAgents": { + "type": "long" + } + } + } + } + }, + "pods_stats": { + "type": "array", + "items": { + "properties": { + "account_id": { + "type": "keyword" + }, + "container_image_name": { + "type": "keyword" + }, + "container_image_tag": { + "type": "keyword" + }, + "pod_name": { + "type": "keyword" + }, + "total_doc_count": { + "type": "long" + }, + "process_doc_count": { + "type": "long" + }, + "file_doc_count": { + "type": "long" + }, + "alert_doc_count": { + "type": "long" + } + } + } + }, + "accounts_stats": { + "type": "array", + "items": { + "properties": { + "account_id": { + "type": "keyword" + }, + "cloud_provider": { + "type": "keyword" + }, + "kubernetes_version": { + "type": "keyword" + }, + "total_doc_count": { + "type": "long" + }, + "file_doc_count": { + "type": "long" + }, + "process_doc_count": { + "type": "long" + }, + "alert_doc_count": { + "type": "long" + }, + "agents_count": { + "type": "short" + }, + "nodes_count": { + "type": "short" + }, + "pods_count": { + "type": "short" + } + } + } + }, + "installation_stats": { + "type": "array", + "items": { + "properties": { + "package_policy_id": { + "type": "keyword" + }, + "package_version": { + "type": "keyword" + }, + "agent_policy_id": { + "type": "keyword" + }, + "created_at": { + "type": "date" + }, + "agent_count": { + "type": "long" + }, + "policy_yaml": { + "type": "keyword" + }, + "selectors": { + "type": "array", + "items": { + "properties": { + "type": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "operation": { + "type": "array", + "items": { + "type": "keyword" + } + }, + "containerImageFullName": { + "type": "array", + "items": { + "type": "keyword" + } + }, + "containerImageName": { + "type": "array", + "items": { + "type": "keyword" + } + }, + "containerImageTag": { + "type": "array", + "items": { + "type": "keyword" + } + }, + "kubernetesClusterId": { + "type": "array", + "items": { + "type": "keyword" + } + }, + "kubernetesClusterName": { + "type": "array", + "items": { + "type": "keyword" + } + }, + "kubernetesNamespace": { + "type": "array", + "items": { + "type": "keyword" + } + }, + "kubernetesPodLabel": { + "type": "array", + "items": { + "type": "keyword" + } + }, + "kubernetesPodName": { + "type": "array", + "items": { + "type": "keyword" + } + }, + "targetFilePath": { + "type": "array", + "items": { + "type": "keyword" + } + }, + "ignoreVolumeFiles": { + "type": "boolean" + }, + "ignoreVolumeMounts": { + "type": "boolean" + }, + "processExecutable": { + "type": "array", + "items": { + "type": "keyword" + } + }, + "processName": { + "type": "array", + "items": { + "type": "keyword" + } + }, + "sessionLeaderInteractive": { + "type": "boolean" + } + } + } + }, + "responses": { + "type": "array", + "items": { + "properties": { + "type": { + "type": "keyword" + }, + "match": { + "type": "array", + "items": { + "type": "keyword" + } + }, + "exclude": { + "type": "array", + "items": { + "type": "keyword" + } + }, + "actions": { + "type": "array", + "items": { + "type": "keyword" + } + } + } + } + } + } + } + } + } + }, + "cloud_security_posture": { + "properties": { + "indices": { + "properties": { + "findings": { + "properties": { + "doc_count": { + "type": "long" + }, + "deleted": { + "type": "long" + }, + "size_in_bytes": { + "type": "long" + }, + "last_doc_timestamp": { + "type": "date" + } + } + }, + "latest_findings": { + "properties": { + "doc_count": { + "type": "long" + }, + "deleted": { + "type": "long" + }, + "size_in_bytes": { + "type": "long" + }, + "last_doc_timestamp": { + "type": "date" + } + } + }, + "vulnerabilities": { + "properties": { + "doc_count": { + "type": "long" + }, + "deleted": { + "type": "long" + }, + "size_in_bytes": { + "type": "long" + }, + "last_doc_timestamp": { + "type": "date" + } + } + }, + "latest_vulnerabilities": { + "properties": { + "doc_count": { + "type": "long" + }, + "deleted": { + "type": "long" + }, + "size_in_bytes": { + "type": "long" + }, + "last_doc_timestamp": { + "type": "date" + } + } + }, + "score": { + "properties": { + "doc_count": { + "type": "long" + }, + "deleted": { + "type": "long" + }, + "size_in_bytes": { + "type": "long" + }, + "last_doc_timestamp": { + "type": "date" + } + } + }, + "latestPackageVersion": { + "type": "keyword" + }, + "cspm": { + "properties": { + "status": { + "type": "keyword" + }, + "installedPackagePolicies": { + "type": "long" + }, + "healthyAgents": { + "type": "long" + } + } + }, + "kspm": { + "properties": { + "status": { + "type": "keyword" + }, + "installedPackagePolicies": { + "type": "long" + }, + "healthyAgents": { + "type": "long" + } + } + }, + "vuln_mgmt": { + "properties": { + "status": { + "type": "keyword" + }, + "installedPackagePolicies": { + "type": "long" + }, + "healthyAgents": { + "type": "long" + } + } + } + } + }, + "resources_stats": { + "type": "array", + "items": { + "properties": { + "account_id": { + "type": "keyword" + }, + "resource_type": { + "type": "keyword" + }, + "resource_type_doc_count": { + "type": "long" + }, + "resource_sub_type": { + "type": "keyword" + }, + "resource_sub_type_doc_count": { + "type": "long" + }, + "passed_findings_count": { + "type": "long" + }, + "failed_findings_count": { + "type": "long" + } + } + } + }, + "accounts_stats": { + "type": "array", + "items": { + "properties": { + "account_id": { + "type": "keyword" + }, + "posture_score": { + "type": "long" + }, + "latest_findings_doc_count": { + "type": "long" + }, + "benchmark_id": { + "type": "keyword" + }, + "benchmark_name": { + "type": "keyword" + }, + "benchmark_version": { + "type": "keyword" + }, + "kubernetes_version": { + "type": "keyword" + }, + "passed_findings_count": { + "type": "long" + }, + "failed_findings_count": { + "type": "long" + }, + "agents_count": { + "type": "short" + }, + "nodes_count": { + "type": "short" + }, + "pods_count": { + "type": "short" + } + } + } + }, + "rules_stats": { + "type": "array", + "items": { + "properties": { + "account_id": { + "type": "keyword" + }, + "rule_id": { + "type": "keyword" + }, + "rule_name": { + "type": "keyword" + }, + "rule_section": { + "type": "keyword" + }, + "rule_version": { + "type": "keyword" + }, + "rule_number": { + "type": "keyword" + }, + "posture_type": { + "type": "keyword" + }, + "benchmark_id": { + "type": "keyword" + }, + "benchmark_name": { + "type": "keyword" + }, + "benchmark_version": { + "type": "keyword" + }, + "passed_findings_count": { + "type": "long" + }, + "failed_findings_count": { + "type": "long" + } + } + } + }, + "installation_stats": { + "type": "array", + "items": { + "properties": { + "package_policy_id": { + "type": "keyword" + }, + "feature": { + "type": "keyword" + }, + "package_version": { + "type": "keyword" + }, + "agent_policy_id": { + "type": "keyword" + }, + "deployment_mode": { + "type": "keyword" + }, + "created_at": { + "type": "date" + }, + "agent_count": { + "type": "long" + }, + "is_agentless": { + "type": "boolean" + }, + "account_type": { + "type": "keyword" + }, + "is_setup_automatic": { + "type": "boolean" + }, + "setup_access_option": { + "type": "keyword" + } + } + } + }, + "alerts_stats": { + "type": "array", + "items": { + "properties": { + "posture_type": { + "type": "keyword" + }, + "rules_count": { + "type": "long" + }, + "alerts_count": { + "type": "long" + }, + "alerts_open_count": { + "type": "long" + }, + "alerts_closed_count": { + "type": "long" + }, + "alerts_acknowledged_count": { + "type": "long" + } + } + } + }, + "cloud_account_stats": { + "type": "array", + "items": { + "properties": { + "account_id": { + "type": "keyword" + }, + "cloud_provider": { + "type": "keyword" + }, + "product": { + "type": "keyword" + }, + "package_policy_id": { + "type": "keyword" + }, + "latest_doc_count": { + "type": "long" + }, + "latest_doc_updated_timestamp": { + "type": "date" + }, + "posture_management_stats": { + "properties": { + "posture_score": { + "type": "long" + }, + "benchmark_name": { + "type": "keyword" + }, + "benchmark_version": { + "type": "keyword" + }, + "passed_findings_count": { + "type": "long" + }, + "failed_findings_count": { + "type": "long" + } + } + }, + "posture_management_stats_enabled_rules": { + "properties": { + "posture_score": { + "type": "long" + }, + "benchmark_name": { + "type": "keyword" + }, + "benchmark_version": { + "type": "keyword" + }, + "passed_findings_count": { + "type": "long" + }, + "failed_findings_count": { + "type": "long" + } + } + }, + "kspm_stats": { + "properties": { + "kubernetes_version": { + "type": "keyword" + }, + "agents_count": { + "type": "short" + }, + "nodes_count": { + "type": "short" + }, + "pods_count": { + "type": "short" + } + } + }, + "has_muted_rules": { + "type": "boolean" + } + } + } + }, + "muted_rules_stats": { + "type": "array", + "items": { + "properties": { + "id": { + "type": "keyword" + }, + "name": { + "type": "keyword" + }, + "section": { + "type": "keyword" + }, + "benchmark_id": { + "type": "keyword" + }, + "benchmark_name": { + "type": "keyword" + }, + "benchmark_version": { + "type": "keyword" + }, + "rule_number": { + "type": "keyword" + }, + "posture_type": { + "type": "keyword" + }, + "version": { + "type": "keyword" + } + } + } + } + } + }, + "security_solution": { + "properties": { + "detectionMetrics": { + "properties": { + "detection_rules": { + "properties": { + "detection_rule_usage": { + "properties": { + "query": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "Number of query rules enabled" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "Number of query rules disabled" + } + }, + "alerts": { + "type": "long", + "_meta": { + "description": "Number of alerts generated by query rules" + } + }, + "cases": { + "type": "long", + "_meta": { + "description": "Number of cases attached to query detection rule alerts" + } + }, + "legacy_notifications_enabled": { + "type": "long", + "_meta": { + "description": "Number of legacy notifications enabled" + } + }, + "legacy_notifications_disabled": { + "type": "long", + "_meta": { + "description": "Number of legacy notifications disabled" + } + }, + "notifications_enabled": { + "type": "long", + "_meta": { + "description": "Number of notifications enabled" + } + }, + "notifications_disabled": { + "type": "long", + "_meta": { + "description": "Number of notifications enabled" + } + }, + "legacy_investigation_fields": { + "type": "long", + "_meta": { + "description": "Number of rules using the legacy investigation fields type introduced only in 8.10 ESS" + } + }, + "alert_suppression": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "Number of enabled query rules configured with suppression" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "Number of disabled query rules configured with suppression" + } + }, + "suppressed_fields_count": { + "properties": { + "one": { + "type": "long", + "_meta": { + "description": "Number of query rules configured with one suppression field" + } + }, + "two": { + "type": "long", + "_meta": { + "description": "Number of query rules configured with two suppression field" + } + }, + "three": { + "type": "long", + "_meta": { + "description": "Number of query rules configured with three suppression field" + } + } + } + }, + "suppressed_per_time_period": { + "type": "long", + "_meta": { + "description": "Number of query rules configured with suppression per time period" + } + }, + "suppressed_per_rule_execution": { + "type": "long", + "_meta": { + "description": "Number of query rules configured with suppression per rule execution" + } + }, + "suppresses_missing_fields": { + "type": "long", + "_meta": { + "description": "Number of query rules configured to suppress alerts with missing fields" + } + }, + "does_not_suppress_missing_fields": { + "type": "long", + "_meta": { + "description": "Number of query rules configured do not suppress alerts with missing fields" + } + } + } + } + } + }, + "threshold": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "Number of threshold rules enabled" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "Number of threshold rules disabled" + } + }, + "alerts": { + "type": "long", + "_meta": { + "description": "Number of alerts generated by threshold rules" + } + }, + "cases": { + "type": "long", + "_meta": { + "description": "Number of cases attached to threshold detection rule alerts" + } + }, + "legacy_notifications_enabled": { + "type": "long", + "_meta": { + "description": "Number of legacy notifications enabled" + } + }, + "legacy_notifications_disabled": { + "type": "long", + "_meta": { + "description": "Number of legacy notifications disabled" + } + }, + "notifications_enabled": { + "type": "long", + "_meta": { + "description": "Number of notifications enabled" + } + }, + "notifications_disabled": { + "type": "long", + "_meta": { + "description": "Number of notifications enabled" + } + }, + "legacy_investigation_fields": { + "type": "long", + "_meta": { + "description": "Number of rules using the legacy investigation fields type introduced only in 8.10 ESS" + } + }, + "alert_suppression": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "Number of enabled threshold rules configured with suppression" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "Number of disabled threshold rules configured with suppression" + } + }, + "suppressed_fields_count": { + "properties": { + "one": { + "type": "long", + "_meta": { + "description": "Number of threshold rules configured with one suppression field" + } + }, + "two": { + "type": "long", + "_meta": { + "description": "Number of threshold rules configured with two suppression field" + } + }, + "three": { + "type": "long", + "_meta": { + "description": "Number of threshold rules configured with three suppression field" + } + } + } + }, + "suppressed_per_time_period": { + "type": "long", + "_meta": { + "description": "Number of threshold rules configured with suppression per time period" + } + }, + "suppressed_per_rule_execution": { + "type": "long", + "_meta": { + "description": "Number of threshold rules configured with suppression per rule execution" + } + }, + "suppresses_missing_fields": { + "type": "long", + "_meta": { + "description": "Number of threshold rules configured to suppress alerts with missing fields" + } + }, + "does_not_suppress_missing_fields": { + "type": "long", + "_meta": { + "description": "Number of threshold rules configured do not suppress alerts with missing fields" + } + } + } + } + } + }, + "eql": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "Number of eql rules enabled" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "Number of eql rules disabled" + } + }, + "alerts": { + "type": "long", + "_meta": { + "description": "Number of alerts generated by eql rules" + } + }, + "cases": { + "type": "long", + "_meta": { + "description": "Number of cases attached to eql detection rule alerts" + } + }, + "legacy_notifications_enabled": { + "type": "long", + "_meta": { + "description": "Number of legacy notifications enabled" + } + }, + "legacy_notifications_disabled": { + "type": "long", + "_meta": { + "description": "Number of legacy notifications disabled" + } + }, + "notifications_enabled": { + "type": "long", + "_meta": { + "description": "Number of notifications enabled" + } + }, + "notifications_disabled": { + "type": "long", + "_meta": { + "description": "Number of notifications enabled" + } + }, + "legacy_investigation_fields": { + "type": "long", + "_meta": { + "description": "Number of rules using the legacy investigation fields type introduced only in 8.10 ESS" + } + }, + "alert_suppression": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "Number of enabled eql rules configured with suppression" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "Number of disabled eql rules configured with suppression" + } + }, + "suppressed_fields_count": { + "properties": { + "one": { + "type": "long", + "_meta": { + "description": "Number of eql rules configured with one suppression field" + } + }, + "two": { + "type": "long", + "_meta": { + "description": "Number of eql rules configured with two suppression field" + } + }, + "three": { + "type": "long", + "_meta": { + "description": "Number of eql rules configured with three suppression field" + } + } + } + }, + "suppressed_per_time_period": { + "type": "long", + "_meta": { + "description": "Number of eql rules configured with suppression per time period" + } + }, + "suppressed_per_rule_execution": { + "type": "long", + "_meta": { + "description": "Number of eql rules configured with suppression per rule execution" + } + }, + "suppresses_missing_fields": { + "type": "long", + "_meta": { + "description": "Number of eql rules configured to suppress alerts with missing fields" + } + }, + "does_not_suppress_missing_fields": { + "type": "long", + "_meta": { + "description": "Number of eql rules configured do not suppress alerts with missing fields" + } + } + } + } + } + }, + "machine_learning": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "Number of machine_learning rules enabled" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "Number of machine_learning rules disabled" + } + }, + "alerts": { + "type": "long", + "_meta": { + "description": "Number of alerts generated by machine_learning rules" + } + }, + "cases": { + "type": "long", + "_meta": { + "description": "Number of cases attached to machine_learning detection rule alerts" + } + }, + "legacy_notifications_enabled": { + "type": "long", + "_meta": { + "description": "Number of legacy notifications enabled" + } + }, + "legacy_notifications_disabled": { + "type": "long", + "_meta": { + "description": "Number of legacy notifications disabled" + } + }, + "notifications_enabled": { + "type": "long", + "_meta": { + "description": "Number of notifications enabled" + } + }, + "notifications_disabled": { + "type": "long", + "_meta": { + "description": "Number of notifications enabled" + } + }, + "legacy_investigation_fields": { + "type": "long", + "_meta": { + "description": "Number of rules using the legacy investigation fields type introduced only in 8.10 ESS" + } + }, + "alert_suppression": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "Number of enabled machine_learning rules configured with suppression" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "Number of disabled machine_learning rules configured with suppression" + } + }, + "suppressed_fields_count": { + "properties": { + "one": { + "type": "long", + "_meta": { + "description": "Number of machine_learning rules configured with one suppression field" + } + }, + "two": { + "type": "long", + "_meta": { + "description": "Number of machine_learning rules configured with two suppression field" + } + }, + "three": { + "type": "long", + "_meta": { + "description": "Number of machine_learning rules configured with three suppression field" + } + } + } + }, + "suppressed_per_time_period": { + "type": "long", + "_meta": { + "description": "Number of machine_learning rules configured with suppression per time period" + } + }, + "suppressed_per_rule_execution": { + "type": "long", + "_meta": { + "description": "Number of machine_learning rules configured with suppression per rule execution" + } + }, + "suppresses_missing_fields": { + "type": "long", + "_meta": { + "description": "Number of machine_learning rules configured to suppress alerts with missing fields" + } + }, + "does_not_suppress_missing_fields": { + "type": "long", + "_meta": { + "description": "Number of machine_learning rules configured do not suppress alerts with missing fields" + } + } + } + } + } + }, + "threat_match": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "Number of threat_match rules enabled" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "Number of threat_match rules disabled" + } + }, + "alerts": { + "type": "long", + "_meta": { + "description": "Number of alerts generated by threat_match rules" + } + }, + "cases": { + "type": "long", + "_meta": { + "description": "Number of cases attached to threat_match detection rule alerts" + } + }, + "legacy_notifications_enabled": { + "type": "long", + "_meta": { + "description": "Number of legacy notifications enabled" + } + }, + "legacy_notifications_disabled": { + "type": "long", + "_meta": { + "description": "Number of legacy notifications disabled" + } + }, + "notifications_enabled": { + "type": "long", + "_meta": { + "description": "Number of notifications enabled" + } + }, + "notifications_disabled": { + "type": "long", + "_meta": { + "description": "Number of notifications enabled" + } + }, + "legacy_investigation_fields": { + "type": "long", + "_meta": { + "description": "Number of rules using the legacy investigation fields type introduced only in 8.10 ESS" + } + }, + "alert_suppression": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "Number of enabled threat_match rules configured with suppression" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "Number of disabled threat_match rules configured with suppression" + } + }, + "suppressed_fields_count": { + "properties": { + "one": { + "type": "long", + "_meta": { + "description": "Number of threat_match rules configured with one suppression field" + } + }, + "two": { + "type": "long", + "_meta": { + "description": "Number of threat_match rules configured with two suppression field" + } + }, + "three": { + "type": "long", + "_meta": { + "description": "Number of threat_match rules configured with three suppression field" + } + } + } + }, + "suppressed_per_time_period": { + "type": "long", + "_meta": { + "description": "Number of threat_match rules configured with suppression per time period" + } + }, + "suppressed_per_rule_execution": { + "type": "long", + "_meta": { + "description": "Number of threat_match rules configured with suppression per rule execution" + } + }, + "suppresses_missing_fields": { + "type": "long", + "_meta": { + "description": "Number of threat_match rules configured to suppress alerts with missing fields" + } + }, + "does_not_suppress_missing_fields": { + "type": "long", + "_meta": { + "description": "Number of threat_match rules configured do not suppress alerts with missing fields" + } + } + } + } + } + }, + "new_terms": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "Number of new_terms rules enabled" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "Number of new_terms rules disabled" + } + }, + "alerts": { + "type": "long", + "_meta": { + "description": "Number of alerts generated by new_terms rules" + } + }, + "cases": { + "type": "long", + "_meta": { + "description": "Number of cases attached to new_terms detection rule alerts" + } + }, + "legacy_notifications_enabled": { + "type": "long", + "_meta": { + "description": "Number of legacy notifications enabled" + } + }, + "legacy_notifications_disabled": { + "type": "long", + "_meta": { + "description": "Number of legacy notifications disabled" + } + }, + "notifications_enabled": { + "type": "long", + "_meta": { + "description": "Number of notifications enabled" + } + }, + "notifications_disabled": { + "type": "long", + "_meta": { + "description": "Number of notifications enabled" + } + }, + "legacy_investigation_fields": { + "type": "long", + "_meta": { + "description": "Number of rules using the legacy investigation fields type introduced only in 8.10 ESS" + } + }, + "alert_suppression": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "Number of enabled new_terms rules configured with suppression" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "Number of disabled new_terms rules configured with suppression" + } + }, + "suppressed_fields_count": { + "properties": { + "one": { + "type": "long", + "_meta": { + "description": "Number of new_terms rules configured with one suppression field" + } + }, + "two": { + "type": "long", + "_meta": { + "description": "Number of new_terms rules configured with two suppression field" + } + }, + "three": { + "type": "long", + "_meta": { + "description": "Number of new_terms rules configured with three suppression field" + } + } + } + }, + "suppressed_per_time_period": { + "type": "long", + "_meta": { + "description": "Number of new_terms rules configured with suppression per time period" + } + }, + "suppressed_per_rule_execution": { + "type": "long", + "_meta": { + "description": "Number of new_terms rules configured with suppression per rule execution" + } + }, + "suppresses_missing_fields": { + "type": "long", + "_meta": { + "description": "Number of new_terms rules configured to suppress alerts with missing fields" + } + }, + "does_not_suppress_missing_fields": { + "type": "long", + "_meta": { + "description": "Number of new_terms rules configured do not suppress alerts with missing fields" + } + } + } + } + } + }, + "esql": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "Number of esql rules enabled" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "Number of esql rules disabled" + } + }, + "alerts": { + "type": "long", + "_meta": { + "description": "Number of alerts generated by esql rules" + } + }, + "cases": { + "type": "long", + "_meta": { + "description": "Number of cases attached to esql detection rule alerts" + } + }, + "legacy_notifications_enabled": { + "type": "long", + "_meta": { + "description": "Number of legacy notifications enabled" + } + }, + "legacy_notifications_disabled": { + "type": "long", + "_meta": { + "description": "Number of legacy notifications disabled" + } + }, + "notifications_enabled": { + "type": "long", + "_meta": { + "description": "Number of notifications enabled" + } + }, + "notifications_disabled": { + "type": "long", + "_meta": { + "description": "Number of notifications enabled" + } + }, + "legacy_investigation_fields": { + "type": "long", + "_meta": { + "description": "Number of rules using the legacy investigation fields type introduced only in 8.10 ESS" + } + }, + "alert_suppression": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "Number of enabled esql rules configured with suppression" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "Number of disabled esql rules configured with suppression" + } + }, + "suppressed_fields_count": { + "properties": { + "one": { + "type": "long", + "_meta": { + "description": "Number of esql rules configured with one suppression field" + } + }, + "two": { + "type": "long", + "_meta": { + "description": "Number of esql rules configured with two suppression field" + } + }, + "three": { + "type": "long", + "_meta": { + "description": "Number of esql rules configured with three suppression field" + } + } + } + }, + "suppressed_per_time_period": { + "type": "long", + "_meta": { + "description": "Number of esql rules configured with suppression per time period" + } + }, + "suppressed_per_rule_execution": { + "type": "long", + "_meta": { + "description": "Number of esql rules configured with suppression per rule execution" + } + }, + "suppresses_missing_fields": { + "type": "long", + "_meta": { + "description": "Number of esql rules configured to suppress alerts with missing fields" + } + }, + "does_not_suppress_missing_fields": { + "type": "long", + "_meta": { + "description": "Number of esql rules configured do not suppress alerts with missing fields" + } + } + } + } + } + }, + "elastic_total": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "Number of elastic rules enabled" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "Number of elastic rules disabled" + } + }, + "alerts": { + "type": "long", + "_meta": { + "description": "Number of alerts generated by elastic rules" + } + }, + "cases": { + "type": "long", + "_meta": { + "description": "Number of cases attached to elastic detection rule alerts" + } + }, + "legacy_notifications_enabled": { + "type": "long", + "_meta": { + "description": "Number of legacy notifications enabled" + } + }, + "legacy_notifications_disabled": { + "type": "long", + "_meta": { + "description": "Number of legacy notifications disabled" + } + }, + "notifications_enabled": { + "type": "long", + "_meta": { + "description": "Number of notifications enabled" + } + }, + "notifications_disabled": { + "type": "long", + "_meta": { + "description": "Number of notifications enabled" + } + }, + "legacy_investigation_fields": { + "type": "long", + "_meta": { + "description": "Number of rules using the legacy investigation fields type introduced only in 8.10 ESS" + } + }, + "alert_suppression": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "Number of enabled elastic rules configured with suppression" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "Number of disabled elastic rules configured with suppression" + } + }, + "suppressed_fields_count": { + "properties": { + "one": { + "type": "long", + "_meta": { + "description": "Number of elastic rules configured with one suppression field" + } + }, + "two": { + "type": "long", + "_meta": { + "description": "Number of elastic rules configured with two suppression field" + } + }, + "three": { + "type": "long", + "_meta": { + "description": "Number of elastic rules configured with three suppression field" + } + } + } + }, + "suppressed_per_time_period": { + "type": "long", + "_meta": { + "description": "Number of elastic rules configured with suppression per time period" + } + }, + "suppressed_per_rule_execution": { + "type": "long", + "_meta": { + "description": "Number of elastic rules configured with suppression per rule execution" + } + }, + "suppresses_missing_fields": { + "type": "long", + "_meta": { + "description": "Number of elastic rules configured to suppress alerts with missing fields" + } + }, + "does_not_suppress_missing_fields": { + "type": "long", + "_meta": { + "description": "Number of elastic rules configured do not suppress alerts with missing fields" + } + } + } + } + } + }, + "custom_total": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "Number of custom rules enabled" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "Number of custom rules disabled" + } + }, + "alerts": { + "type": "long", + "_meta": { + "description": "Number of alerts generated by custom rules" + } + }, + "cases": { + "type": "long", + "_meta": { + "description": "Number of cases attached to custom detection rule alerts" + } + }, + "legacy_notifications_enabled": { + "type": "long", + "_meta": { + "description": "Number of legacy notifications enabled" + } + }, + "legacy_notifications_disabled": { + "type": "long", + "_meta": { + "description": "Number of legacy notifications disabled" + } + }, + "notifications_enabled": { + "type": "long", + "_meta": { + "description": "Number of notifications enabled" + } + }, + "notifications_disabled": { + "type": "long", + "_meta": { + "description": "Number of notifications enabled" + } + }, + "legacy_investigation_fields": { + "type": "long", + "_meta": { + "description": "Number of rules using the legacy investigation fields type introduced only in 8.10 ESS" + } + }, + "alert_suppression": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "Number of enabled custom rules configured with suppression" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "Number of disabled custom rules configured with suppression" + } + }, + "suppressed_fields_count": { + "properties": { + "one": { + "type": "long", + "_meta": { + "description": "Number of custom rules configured with one suppression field" + } + }, + "two": { + "type": "long", + "_meta": { + "description": "Number of custom rules configured with two suppression field" + } + }, + "three": { + "type": "long", + "_meta": { + "description": "Number of custom rules configured with three suppression field" + } + } + } + }, + "suppressed_per_time_period": { + "type": "long", + "_meta": { + "description": "Number of custom rules configured with suppression per time period" + } + }, + "suppressed_per_rule_execution": { + "type": "long", + "_meta": { + "description": "Number of custom rules configured with suppression per rule execution" + } + }, + "suppresses_missing_fields": { + "type": "long", + "_meta": { + "description": "Number of custom rules configured to suppress alerts with missing fields" + } + }, + "does_not_suppress_missing_fields": { + "type": "long", + "_meta": { + "description": "Number of custom rules configured do not suppress alerts with missing fields" + } + } + } + } + } + } + } + }, + "detection_rule_detail": { + "type": "array", + "items": { + "properties": { + "rule_name": { + "type": "keyword", + "_meta": { + "description": "The name of the detection rule" + } + }, + "rule_id": { + "type": "keyword", + "_meta": { + "description": "The UUID id of the detection rule" + } + }, + "rule_type": { + "type": "keyword", + "_meta": { + "description": "The type of detection rule. ie eql, query..." + } + }, + "rule_version": { + "type": "long", + "_meta": { + "description": "The version of the rule" + } + }, + "enabled": { + "type": "boolean", + "_meta": { + "description": "If the detection rule has been enabled by the user" + } + }, + "elastic_rule": { + "type": "boolean", + "_meta": { + "description": "If the detection rule has been authored by Elastic" + } + }, + "created_on": { + "type": "keyword", + "_meta": { + "description": "When the detection rule was created on the cluster" + } + }, + "updated_on": { + "type": "keyword", + "_meta": { + "description": "When the detection rule was updated on the cluster" + } + }, + "alert_count_daily": { + "type": "long", + "_meta": { + "description": "The number of daily alerts generated by a rule" + } + }, + "cases_count_total": { + "type": "long", + "_meta": { + "description": "The number of total cases generated by a rule" + } + }, + "has_legacy_notification": { + "type": "boolean", + "_meta": { + "description": "True if this rule has a legacy notification" + } + }, + "has_notification": { + "type": "boolean", + "_meta": { + "description": "True if this rule has a notification" + } + } + } + } + }, + "detection_rule_status": { + "properties": { + "all_rules": { + "properties": { + "eql": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "top_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "top_partial_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of successful rules" + } + }, + "index_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "search_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "enrichment_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_count": { + "type": "long", + "_meta": { + "description": "The count of gaps" + } + } + } + }, + "threat_match": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "top_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "top_partial_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of successful rules" + } + }, + "index_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "search_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "enrichment_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_count": { + "type": "long", + "_meta": { + "description": "The count of gaps" + } + } + } + }, + "machine_learning": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "top_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "top_partial_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of successful rules" + } + }, + "index_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "search_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "enrichment_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_count": { + "type": "long", + "_meta": { + "description": "The count of gaps" + } + } + } + }, + "query": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "top_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "top_partial_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of successful rules" + } + }, + "index_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "search_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "enrichment_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_count": { + "type": "long", + "_meta": { + "description": "The count of gaps" + } + } + } + }, + "saved_query": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "top_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "top_partial_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of successful rules" + } + }, + "index_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "search_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "enrichment_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_count": { + "type": "long", + "_meta": { + "description": "The count of gaps" + } + } + } + }, + "threshold": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "top_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "top_partial_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of successful rules" + } + }, + "index_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "search_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "enrichment_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_count": { + "type": "long", + "_meta": { + "description": "The count of gaps" + } + } + } + }, + "total": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of succeeded rules" + } + } + } + } + } + }, + "elastic_rules": { + "properties": { + "eql": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "top_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "top_partial_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of successful rules" + } + }, + "index_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "search_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "enrichment_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_count": { + "type": "long", + "_meta": { + "description": "The count of gaps" + } + } + } + }, + "threat_match": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "top_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "top_partial_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of successful rules" + } + }, + "index_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "search_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "enrichment_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_count": { + "type": "long", + "_meta": { + "description": "The count of gaps" + } + } + } + }, + "machine_learning": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "top_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "top_partial_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of successful rules" + } + }, + "index_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "search_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "enrichment_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_count": { + "type": "long", + "_meta": { + "description": "The count of gaps" + } + } + } + }, + "query": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "top_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "top_partial_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of successful rules" + } + }, + "index_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "search_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "enrichment_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_count": { + "type": "long", + "_meta": { + "description": "The count of gaps" + } + } + } + }, + "saved_query": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "top_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "top_partial_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of successful rules" + } + }, + "index_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "search_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "enrichment_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_count": { + "type": "long", + "_meta": { + "description": "The count of gaps" + } + } + } + }, + "threshold": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "top_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "top_partial_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of successful rules" + } + }, + "index_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "search_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "enrichment_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_count": { + "type": "long", + "_meta": { + "description": "The count of gaps" + } + } + } + }, + "total": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of succeeded rules" + } + } + } + } + } + }, + "custom_rules": { + "properties": { + "eql": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "top_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "top_partial_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of successful rules" + } + }, + "index_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "search_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "enrichment_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_count": { + "type": "long", + "_meta": { + "description": "The count of gaps" + } + } + } + }, + "threat_match": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "top_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "top_partial_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of successful rules" + } + }, + "index_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "search_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "enrichment_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_count": { + "type": "long", + "_meta": { + "description": "The count of gaps" + } + } + } + }, + "machine_learning": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "top_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "top_partial_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of successful rules" + } + }, + "index_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "search_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "enrichment_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_count": { + "type": "long", + "_meta": { + "description": "The count of gaps" + } + } + } + }, + "query": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "top_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "top_partial_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of successful rules" + } + }, + "index_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "search_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "enrichment_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_count": { + "type": "long", + "_meta": { + "description": "The count of gaps" + } + } + } + }, + "saved_query": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "top_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "top_partial_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of successful rules" + } + }, + "index_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "search_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "enrichment_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_count": { + "type": "long", + "_meta": { + "description": "The count of gaps" + } + } + } + }, + "threshold": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "top_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "top_partial_failures": { + "type": "array", + "items": { + "properties": { + "message": { + "type": "keyword", + "_meta": { + "description": "Failed rule message" + } + }, + "count": { + "type": "long", + "_meta": { + "description": "Number of times the message occurred" + } + } + } + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of successful rules" + } + }, + "index_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "search_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "enrichment_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_duration": { + "properties": { + "max": { + "type": "float", + "_meta": { + "description": "The max duration" + } + }, + "avg": { + "type": "float", + "_meta": { + "description": "The avg duration" + } + }, + "min": { + "type": "float", + "_meta": { + "description": "The min duration" + } + } + } + }, + "gap_count": { + "type": "long", + "_meta": { + "description": "The count of gaps" + } + } + } + }, + "total": { + "properties": { + "failures": { + "type": "long", + "_meta": { + "description": "The number of failed rules" + } + }, + "partial_failures": { + "type": "long", + "_meta": { + "description": "The number of partial failure rules" + } + }, + "succeeded": { + "type": "long", + "_meta": { + "description": "The number of succeeded rules" + } + } + } + } + } + } + } + } + } + }, + "ml_jobs": { + "properties": { + "ml_job_usage": { + "properties": { + "custom": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "The number of custom ML jobs rules enabled" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "The number of custom ML jobs rules disabled" + } + } + } + }, + "elastic": { + "properties": { + "enabled": { + "type": "long", + "_meta": { + "description": "The number of elastic provided ML jobs rules enabled" + } + }, + "disabled": { + "type": "long", + "_meta": { + "description": "The number of elastic provided ML jobs rules disabled" + } + } + } + } + } + }, + "ml_job_metrics": { + "type": "array", + "items": { + "properties": { + "job_id": { + "type": "keyword", + "_meta": { + "description": "Identifier for the anomaly detection job" + } + }, + "open_time": { + "type": "keyword", + "_meta": { + "description": "For open jobs only, the elapsed time for which the job has been open" + } + }, + "create_time": { + "type": "keyword", + "_meta": { + "description": "The time the job was created" + } + }, + "finished_time": { + "type": "keyword", + "_meta": { + "description": "If the job closed or failed, this is the time the job finished" + } + }, + "state": { + "type": "keyword", + "_meta": { + "description": "The status of the anomaly detection job" + } + }, + "data_counts": { + "properties": { + "bucket_count": { + "type": "long", + "_meta": { + "description": "The number of buckets processed" + } + }, + "empty_bucket_count": { + "type": "long", + "_meta": { + "description": "The number of buckets which did not contain any data" + } + }, + "input_bytes": { + "type": "long", + "_meta": { + "description": "The number of bytes of input data posted to the anomaly detection job" + } + }, + "input_record_count": { + "type": "long", + "_meta": { + "description": "The number of input documents posted to the anomaly detection job" + } + }, + "last_data_time": { + "type": "long", + "_meta": { + "description": "The timestamp at which data was last analyzed, according to server time" + } + }, + "processed_record_count": { + "type": "long", + "_meta": { + "description": "The number of input documents that have been processed by the anomaly detection job" + } + } + } + }, + "model_size_stats": { + "properties": { + "bucket_allocation_failures_count": { + "type": "long", + "_meta": { + "description": "The number of buckets for which new entities in incoming data were not processed due to insufficient model memory" + } + }, + "model_bytes": { + "type": "long", + "_meta": { + "description": "The number of bytes of memory used by the models" + } + }, + "model_bytes_exceeded": { + "type": "long", + "_meta": { + "description": "The number of bytes over the high limit for memory usage at the last allocation failure" + } + }, + "model_bytes_memory_limit": { + "type": "long", + "_meta": { + "description": "The upper limit for model memory usage, checked on increasing values" + } + }, + "peak_model_bytes": { + "type": "long", + "_meta": { + "description": "The peak number of bytes of memory ever used by the models" + } + } + } + }, + "timing_stats": { + "properties": { + "bucket_count": { + "type": "long", + "_meta": { + "description": "The number of buckets processed" + } + }, + "exponential_average_bucket_processing_time_ms": { + "type": "long", + "_meta": { + "description": "Exponential moving average of all bucket processing times, in milliseconds" + } + }, + "exponential_average_bucket_processing_time_per_hour_ms": { + "type": "long", + "_meta": { + "description": "Exponentially-weighted moving average of bucket processing times calculated in a 1 hour time window, in milliseconds" + } + }, + "maximum_bucket_processing_time_ms": { + "type": "long", + "_meta": { + "description": "Maximum among all bucket processing times, in milliseconds" + } + }, + "minimum_bucket_processing_time_ms": { + "type": "long", + "_meta": { + "description": "Minimum among all bucket processing times, in milliseconds" + } + }, + "total_bucket_processing_time_ms": { + "type": "long", + "_meta": { + "description": "Sum of all bucket processing times, in milliseconds" + } + } + } + }, + "datafeed": { + "properties": { + "datafeed_id": { + "type": "keyword", + "_meta": { + "description": "A numerical character string that uniquely identifies the datafeed" + } + }, + "state": { + "type": "keyword", + "_meta": { + "description": "The status of the datafeed" + } + }, + "timing_stats": { + "properties": { + "average_search_time_per_bucket_ms": { + "type": "long", + "_meta": { + "description": "The average search time per bucket, in milliseconds" + } + }, + "bucket_count": { + "type": "long", + "_meta": { + "description": "The number of buckets processed" + } + }, + "exponential_average_search_time_per_hour_ms": { + "type": "long", + "_meta": { + "description": "The exponential average search time per hour, in milliseconds" + } + }, + "search_count": { + "type": "long", + "_meta": { + "description": "The number of searches run by the datafeed" + } + }, + "total_search_time_ms": { + "type": "long", + "_meta": { + "description": "The total time the datafeed spent searching, in milliseconds" + } + } + } + } + } + } + } + } + } + } + }, + "legacy_siem_signals": { + "properties": { + "non_migrated_indices_total": { + "type": "long", + "_meta": { + "description": "Total number of non migrated legacy siem signals indices" + } + }, + "spaces_total": { + "type": "long", + "_meta": { + "description": "Total number of Kibana spaces that have non migrated legacy siem signals indices" + } + } + } + } + } + }, + "endpointMetrics": { + "properties": { + "unique_endpoint_count": { + "type": "long", + "_meta": { + "description": "Number of active unique endpoints in last 24 hours" + } + } + } + }, + "dashboardMetrics": { + "properties": { + "dashboard_tag": { + "properties": { + "created_at": { + "type": "keyword", + "_meta": { + "description": "The time the tab was created" + } + }, + "linked_dashboards_count": { + "type": "long", + "_meta": { + "description": "Number of associated dashboards" + } + } + } + }, + "dashboards": { + "type": "array", + "items": { + "properties": { + "created_at": { + "type": "keyword", + "_meta": { + "description": "The time the dashboard was created" + } + }, + "dashboard_id": { + "type": "keyword", + "_meta": { + "description": "The dashboard saved object id" + } + }, + "error_message": { + "type": "keyword", + "_meta": { + "description": "The relevant error message" + } + }, + "error_status_code": { + "type": "long", + "_meta": { + "description": "The relevant error status code" + } + } + } + } + } + } + }, + "riskEngineMetrics": { + "properties": { + "unique_user_risk_score_total": { + "type": "long", + "_meta": { + "description": "Total unique user risk scores" + } + }, + "unique_host_risk_score_total": { + "type": "long", + "_meta": { + "description": "Total unique host risk scores" + } + }, + "unique_user_risk_score_day": { + "type": "long", + "_meta": { + "description": "Unique user risk scores per day" + } + }, + "unique_host_risk_score_day": { + "type": "long", + "_meta": { + "description": "Unique host risk scores per day" + } + }, + "all_host_risk_scores_total": { + "type": "long", + "_meta": { + "description": "Total number of host risk score records" + } + }, + "all_user_risk_scores_total": { + "type": "long", + "_meta": { + "description": "Total number of user risk score records" + } + }, + "all_host_risk_scores_total_day": { + "type": "long", + "_meta": { + "description": "Number of host risk score records per day" + } + }, + "all_user_risk_scores_total_day": { + "type": "long", + "_meta": { + "description": "Number of user risk score records per day" + } + }, + "all_risk_scores_index_size": { + "type": "long", + "_meta": { + "description": "Total size of the all Risk Score indices (MB)" + } + }, + "unique_risk_scores_index_size": { + "type": "long", + "_meta": { + "description": "Total size of the unique Risk Score indices (MB)" + } + } + } + } + } + } + } } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/apis/get_rules_muted_alerts.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/apis/get_rules_muted_alerts.test.ts index d0f1a39f7cede..f6b3d23c2e289 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/apis/get_rules_muted_alerts.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/apis/get_rules_muted_alerts.test.ts @@ -37,7 +37,28 @@ describe('getMutedAlerts', () => { Array [ "/internal/alerting/rules/_find", Object { - "body": "{\\"rule_type_ids\\":[\\"foo\\"],\\"fields\\":[\\"id\\",\\"mutedInstanceIds\\"],\\"page\\":1,\\"per_page\\":1}", + "body": "{\\"filter\\":\\"{\\\\\\"type\\\\\\":\\\\\\"function\\\\\\",\\\\\\"function\\\\\\":\\\\\\"is\\\\\\",\\\\\\"arguments\\\\\\":[{\\\\\\"type\\\\\\":\\\\\\"literal\\\\\\",\\\\\\"value\\\\\\":\\\\\\"alert.id\\\\\\",\\\\\\"isQuoted\\\\\\":false},{\\\\\\"type\\\\\\":\\\\\\"literal\\\\\\",\\\\\\"value\\\\\\":\\\\\\"alert:foo\\\\\\",\\\\\\"isQuoted\\\\\\":false}]}\\",\\"fields\\":[\\"id\\",\\"mutedInstanceIds\\"],\\"page\\":1,\\"per_page\\":1}", + "signal": undefined, + }, + ] + `); + }); + + test('should call find API with multiple ruleIds', async () => { + const result = await getMutedAlerts(http, { ruleIds: ['foo', 'bar'] }); + + expect(result).toEqual({ + page: 1, + per_page: 10, + total: 0, + data: [], + }); + + expect(http.post.mock.calls[0]).toMatchInlineSnapshot(` + Array [ + "/internal/alerting/rules/_find", + Object { + "body": "{\\"filter\\":\\"{\\\\\\"type\\\\\\":\\\\\\"function\\\\\\",\\\\\\"function\\\\\\":\\\\\\"or\\\\\\",\\\\\\"arguments\\\\\\":[{\\\\\\"type\\\\\\":\\\\\\"function\\\\\\",\\\\\\"function\\\\\\":\\\\\\"is\\\\\\",\\\\\\"arguments\\\\\\":[{\\\\\\"type\\\\\\":\\\\\\"literal\\\\\\",\\\\\\"value\\\\\\":\\\\\\"alert.id\\\\\\",\\\\\\"isQuoted\\\\\\":false},{\\\\\\"type\\\\\\":\\\\\\"literal\\\\\\",\\\\\\"value\\\\\\":\\\\\\"alert:foo\\\\\\",\\\\\\"isQuoted\\\\\\":false}]},{\\\\\\"type\\\\\\":\\\\\\"function\\\\\\",\\\\\\"function\\\\\\":\\\\\\"is\\\\\\",\\\\\\"arguments\\\\\\":[{\\\\\\"type\\\\\\":\\\\\\"literal\\\\\\",\\\\\\"value\\\\\\":\\\\\\"alert.id\\\\\\",\\\\\\"isQuoted\\\\\\":false},{\\\\\\"type\\\\\\":\\\\\\"literal\\\\\\",\\\\\\"value\\\\\\":\\\\\\"alert:bar\\\\\\",\\\\\\"isQuoted\\\\\\":false}]}]}\\",\\"fields\\":[\\"id\\",\\"mutedInstanceIds\\"],\\"page\\":1,\\"per_page\\":2}", "signal": undefined, }, ] diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/apis/get_rules_muted_alerts.ts b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/apis/get_rules_muted_alerts.ts index d9baef548dafc..4c13c0c7b5ef6 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/apis/get_rules_muted_alerts.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/hooks/apis/get_rules_muted_alerts.ts @@ -6,6 +6,7 @@ */ import { HttpStart } from '@kbn/core-http-browser'; +import { nodeBuilder } from '@kbn/es-query'; const INTERNAL_FIND_RULES_URL = '/internal/alerting/rules/_find'; @@ -23,9 +24,12 @@ export const getMutedAlerts = async ( params: { ruleIds: string[] }, signal?: AbortSignal ) => { + const filterNode = nodeBuilder.or( + params.ruleIds.map((id) => nodeBuilder.is('alert.id', `alert:${id}`)) + ); return http.post<FindRulesResponse>(INTERNAL_FIND_RULES_URL, { body: JSON.stringify({ - rule_type_ids: params.ruleIds, + filter: JSON.stringify(filterNode), fields: ['id', 'mutedInstanceIds'], page: 1, per_page: params.ruleIds.length, diff --git a/x-pack/plugins/upgrade_assistant/kibana.jsonc b/x-pack/plugins/upgrade_assistant/kibana.jsonc index 55a08297937bb..24b328c1294bc 100644 --- a/x-pack/plugins/upgrade_assistant/kibana.jsonc +++ b/x-pack/plugins/upgrade_assistant/kibana.jsonc @@ -1,7 +1,9 @@ { "type": "plugin", "id": "@kbn/upgrade-assistant-plugin", - "owner": "@elastic/kibana-management", + "owner": [ + "@elastic/kibana-core" + ], "group": "platform", "visibility": "private", "plugin": { diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/overview/backup_step/cloud_backup.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/overview/backup_step/cloud_backup.tsx index 0d06c72e5f1b5..dabdd76bb1373 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/overview/backup_step/cloud_backup.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/overview/backup_step/cloud_backup.tsx @@ -145,8 +145,16 @@ export const CloudBackup: React.FunctionComponent<Props> = ({ return ( <> + <EuiText> + <p> + {i18n.translate('xpack.upgradeAssistant.overview.cloudBackup.description', { + defaultMessage: 'Back up your data using snapshots before proceeding.', + })} + </p> + </EuiText> + <EuiSpacer size="m" /> {statusMessage} - <EuiSpacer size="s" /> + <EuiSpacer size="m" /> {/* eslint-disable-next-line @elastic/eui/href-or-on-click */} <EuiButton href={cloudSnapshotsUrl} diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/overview/backup_step/on_prem_backup.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/overview/backup_step/on_prem_backup.tsx index 1bccb4eb3f8dc..c356f3403586a 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/overview/backup_step/on_prem_backup.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/overview/backup_step/on_prem_backup.tsx @@ -27,6 +27,7 @@ const SnapshotRestoreAppLink: React.FunctionComponent = () => { // eslint-disable-next-line @elastic/eui/href-or-on-click <EuiButton href={snapshotRestoreUrl} + target="_blank" onClick={() => { uiMetricService.trackUiMetric(METRIC_TYPE.CLICK, UIM_BACKUP_DATA_ON_PREM_CLICK); }} @@ -46,12 +47,12 @@ export const OnPremBackup: React.FunctionComponent = () => { <EuiText> <p> {i18n.translate('xpack.upgradeAssistant.overview.backupStepDescription', { - defaultMessage: 'Make sure you have a current snapshot before making any changes.', + defaultMessage: 'Make sure you have a current snapshot before proceeding.', })} </p> </EuiText> - <EuiSpacer size="s" /> + <EuiSpacer size="m" /> <SnapshotRestoreAppLink /> </> diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts index e160ac37a9e34..44aed05b2c82a 100644 --- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts +++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.test.ts @@ -26,7 +26,6 @@ import { esIndicesStateCheck } from '../es_indices_state_check'; import { versionService } from '../version'; import { ReindexService, reindexServiceFactory } from './reindex_service'; -import { error } from './error'; const asApiResponse = <T>(body: T): TransportResult<T> => ({ @@ -638,12 +637,7 @@ describe('reindexService', () => { index: '.tasks', id: 'xyz', }); - expect(log.warn).toHaveBeenCalledTimes(1); - expect(log.warn).toHaveBeenCalledWith( - error.reindexTaskCannotBeDeleted( - `Could not delete reindexing task xyz, got response "!?"` - ) - ); + expect(log.warn).toHaveBeenCalledTimes(0); // Do not log anything in this case }); it('does not throw if task doc deletion throws', async () => { @@ -672,6 +666,32 @@ describe('reindexService', () => { expect(log.warn).toHaveBeenCalledTimes(1); expect(log.warn).toHaveBeenCalledWith(new Error('FAILED!')); }); + + it.each([401, 403])( + 'does not throw if task doc deletion throws AND does not log due to missing access permission: %d', + async (statusCode) => { + clusterClient.asCurrentUser.tasks.get.mockResponseOnce({ + completed: true, + // @ts-expect-error not full interface + task: { status: { created: 100, total: 100 } }, + }); + + clusterClient.asCurrentUser.count.mockResponseOnce( + // @ts-expect-error not full interface + { + count: 100, + } + ); + const e = new Error(); + Object.defineProperty(e, 'statusCode', { value: statusCode }); + clusterClient.asCurrentUser.delete.mockRejectedValue(e); + + const updatedOp = await service.processNextStep(reindexOp); + expect(updatedOp.attributes.lastCompletedStep).toEqual(ReindexStep.reindexCompleted); + expect(updatedOp.attributes.reindexTaskPercComplete).toEqual(1); + expect(log.warn).toHaveBeenCalledTimes(0); + } + ); }); describe('reindex task is cancelled', () => { diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts index ce1f19f6babb5..e55b4fce2e4d7 100644 --- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts +++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_service.ts @@ -309,20 +309,17 @@ export const reindexServiceFactory = ( } try { - // Delete the task from ES .tasks index - const deleteTaskResp = await esClient.delete({ + // Best effort, delete the task from ES .tasks index... + await esClient.delete({ index: '.tasks', id: taskId, }); - if (deleteTaskResp.result !== 'deleted') { - log.warn( - error.reindexTaskCannotBeDeleted( - `Could not delete reindexing task ${taskId}, got response "${deleteTaskResp.result}"` - ) - ); - } } catch (e) { - log.warn(e); + // We explicitly ignore authz related error codes bc we expect this to be + // very common when deleting from .tasks + if (e?.statusCode !== 401 && e?.statusCode !== 403) { + log.warn(e); + } } return reindexOp; diff --git a/x-pack/solutions/observability/plugins/observability/public/application/index.tsx b/x-pack/solutions/observability/plugins/observability/public/application/index.tsx index 3ae624d2f8ea1..54b8b4044e64e 100644 --- a/x-pack/solutions/observability/plugins/observability/public/application/index.tsx +++ b/x-pack/solutions/observability/plugins/observability/public/application/index.tsx @@ -28,7 +28,7 @@ import { HideableReactQueryDevTools } from './hideable_react_query_dev_tools'; function App() { return ( <> - <Routes> + <Routes enableExecutionContextTracking={true}> {Object.keys(routes).map((key) => { const path = key as keyof typeof routes; const { handler, exact } = routes[path]; diff --git a/x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/helpers.ts b/x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/helpers.ts index 30663d02cda72..775da2fc1c805 100644 --- a/x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/helpers.ts +++ b/x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/helpers.ts @@ -18,7 +18,7 @@ export const getLensOperationFromRuleMetric = (metric: GenericMetric): LensOpera const { aggType, field, filter = '' } = metric; let operation: string = aggType; const operationArgs: string[] = []; - const escapedFilter = filter.replace(/'/g, "\\'"); + const escapedFilter = filter.replace(/\\/g, '\\\\').replace(/'/g, "\\'"); if (aggType === Aggregators.RATE) { return { diff --git a/x-pack/solutions/observability/plugins/observability/server/routes/rules/route.ts b/x-pack/solutions/observability/plugins/observability/server/routes/rules/route.ts index 909b11cb713a9..a7d03e11b9890 100644 --- a/x-pack/solutions/observability/plugins/observability/server/routes/rules/route.ts +++ b/x-pack/solutions/observability/plugins/observability/server/routes/rules/route.ts @@ -11,10 +11,14 @@ import { createObservabilityServerRoute } from '../create_observability_server_r const alertsDynamicIndexPatternRoute = createObservabilityServerRoute({ endpoint: 'GET /api/observability/rules/alerts/dynamic_index_pattern 2023-10-31', - options: { - tags: [], - access: 'public', + security: { + authz: { + enabled: false, + reason: + 'This endpoint returns alert index names for a set of registration contexts and has traditionally required no specific authorization', + }, }, + options: { access: 'public' }, params: t.type({ query: t.type({ registrationContexts: t.array(t.string), @@ -24,6 +28,7 @@ const alertsDynamicIndexPatternRoute = createObservabilityServerRoute({ handler: async ({ dependencies, params }) => { const { namespace, registrationContexts } = params.query; const { ruleDataService } = dependencies; + const indexNames = registrationContexts.flatMap((registrationContext) => { const indexName = ruleDataService .findIndexByName(registrationContext, Dataset.alerts) diff --git a/x-pack/solutions/observability/plugins/observability/server/ui_settings.ts b/x-pack/solutions/observability/plugins/observability/server/ui_settings.ts index e5695a3c9034d..a68ae28b267fc 100644 --- a/x-pack/solutions/observability/plugins/observability/server/ui_settings.ts +++ b/x-pack/solutions/observability/plugins/observability/server/ui_settings.ts @@ -325,7 +325,7 @@ export const uiSettings: Record<string, UiSettings> = { }, }), schema: schema.boolean(), - value: true, + value: false, requiresPageReload: true, type: 'boolean', }, diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/nav_control/index.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/nav_control/index.tsx index fd198c42fda08..e43a9ea5f4527 100644 --- a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/nav_control/index.tsx +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/nav_control/index.tsx @@ -5,7 +5,7 @@ * 2.0. */ import React, { useEffect, useRef, useState } from 'react'; -import { AssistantAvatar, useAbortableAsync } from '@kbn/observability-ai-assistant-plugin/public'; +import { useAbortableAsync } from '@kbn/observability-ai-assistant-plugin/public'; import { EuiButton, EuiButtonEmpty, EuiLoadingSpinner, EuiToolTip } from '@elastic/eui'; import { css } from '@emotion/react'; import { v4 } from 'uuid'; @@ -13,6 +13,7 @@ import useObservable from 'react-use/lib/useObservable'; import { i18n } from '@kbn/i18n'; import { CoreStart } from '@kbn/core-lifecycle-browser'; import { AIAssistantAppService, useAIAssistantAppService, ChatFlyout } from '@kbn/ai-assistant'; +import { AssistantIcon } from '@kbn/ai-assistant-icon'; import { useKibana } from '../../hooks/use_kibana'; import { useTheme } from '../../hooks/use_theme'; import { useNavControlScreenContext } from '../../hooks/use_nav_control_screen_context'; @@ -157,7 +158,7 @@ export function NavControl({ isServerless }: { isServerless?: boolean }) { color="primary" size="s" > - {chatService.loading ? <EuiLoadingSpinner size="s" /> : <AssistantAvatar size="xs" />} + {chatService.loading ? <EuiLoadingSpinner size="s" /> : <AssistantIcon size="m" />} </EuiButtonEmpty> ) : ( <EuiButton @@ -174,7 +175,7 @@ export function NavControl({ isServerless }: { isServerless?: boolean }) { fullWidth={false} minWidth={0} > - {chatService.loading ? <EuiLoadingSpinner size="s" /> : <AssistantAvatar size="xs" />} + {chatService.loading ? <EuiLoadingSpinner size="s" /> : <AssistantIcon size="m" />} </EuiButton> )} </EuiToolTip> diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/rule_connector/ai_assistant.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/rule_connector/ai_assistant.tsx index bd024e9231ac0..79d9678733941 100644 --- a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/rule_connector/ai_assistant.tsx +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/rule_connector/ai_assistant.tsx @@ -10,10 +10,8 @@ import type { ActionTypeModel as ConnectorTypeModel, GenericValidationResult, } from '@kbn/triggers-actions-ui-plugin/public/types'; -import { - AssistantAvatar, - ObservabilityAIAssistantService, -} from '@kbn/observability-ai-assistant-plugin/public'; +import { ObservabilityAIAssistantService } from '@kbn/observability-ai-assistant-plugin/public'; +import { AssistantIcon } from '@kbn/ai-assistant-icon'; import { OBSERVABILITY_AI_ASSISTANT_CONNECTOR_ID } from '../../common/rule_connector'; import { ObsAIAssistantActionParams } from './types'; import { @@ -29,7 +27,7 @@ export function getConnectorType( return { id: OBSERVABILITY_AI_ASSISTANT_CONNECTOR_ID, modalWidth: 675, - iconClass: () => <AssistantAvatar />, + iconClass: () => <AssistantIcon />, isSystemActionType: true, isExperimental: true, selectMessage: CONNECTOR_DESC, diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/tsconfig.json b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/tsconfig.json index 7e3de7940f22b..af075027d9cd4 100644 --- a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/tsconfig.json +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/tsconfig.json @@ -80,6 +80,7 @@ "@kbn/observability-ai-common", "@kbn/llm-tasks-plugin", "@kbn/product-doc-common", + "@kbn/ai-assistant-icon", ], "exclude": [ "target/**/*" diff --git a/x-pack/plugins/observability_solution/slo/.storybook/jest_setup.js b/x-pack/solutions/observability/plugins/slo/.storybook/jest_setup.js similarity index 100% rename from x-pack/plugins/observability_solution/slo/.storybook/jest_setup.js rename to x-pack/solutions/observability/plugins/slo/.storybook/jest_setup.js diff --git a/x-pack/plugins/lists/.storybook/main.js b/x-pack/solutions/observability/plugins/slo/.storybook/main.js similarity index 100% rename from x-pack/plugins/lists/.storybook/main.js rename to x-pack/solutions/observability/plugins/slo/.storybook/main.js diff --git a/x-pack/plugins/observability_solution/slo/.storybook/preview.js b/x-pack/solutions/observability/plugins/slo/.storybook/preview.js similarity index 100% rename from x-pack/plugins/observability_solution/slo/.storybook/preview.js rename to x-pack/solutions/observability/plugins/slo/.storybook/preview.js diff --git a/x-pack/plugins/observability_solution/slo/README.md b/x-pack/solutions/observability/plugins/slo/README.md similarity index 100% rename from x-pack/plugins/observability_solution/slo/README.md rename to x-pack/solutions/observability/plugins/slo/README.md diff --git a/x-pack/plugins/observability_solution/slo/common/config.ts b/x-pack/solutions/observability/plugins/slo/common/config.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/common/config.ts rename to x-pack/solutions/observability/plugins/slo/common/config.ts diff --git a/x-pack/plugins/observability_solution/slo/common/constants.ts b/x-pack/solutions/observability/plugins/slo/common/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/common/constants.ts rename to x-pack/solutions/observability/plugins/slo/common/constants.ts diff --git a/x-pack/plugins/observability_solution/slo/common/field_names/slo.ts b/x-pack/solutions/observability/plugins/slo/common/field_names/slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/common/field_names/slo.ts rename to x-pack/solutions/observability/plugins/slo/common/field_names/slo.ts diff --git a/x-pack/plugins/observability_solution/slo/common/i18n.ts b/x-pack/solutions/observability/plugins/slo/common/i18n.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/common/i18n.ts rename to x-pack/solutions/observability/plugins/slo/common/i18n.ts diff --git a/x-pack/plugins/observability_solution/slo/common/index.ts b/x-pack/solutions/observability/plugins/slo/common/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/common/index.ts rename to x-pack/solutions/observability/plugins/slo/common/index.ts diff --git a/x-pack/plugins/observability_solution/slo/common/locators/paths.ts b/x-pack/solutions/observability/plugins/slo/common/locators/paths.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/common/locators/paths.ts rename to x-pack/solutions/observability/plugins/slo/common/locators/paths.ts diff --git a/x-pack/plugins/observability_solution/slo/common/parse_kuery.ts b/x-pack/solutions/observability/plugins/slo/common/parse_kuery.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/common/parse_kuery.ts rename to x-pack/solutions/observability/plugins/slo/common/parse_kuery.ts diff --git a/x-pack/plugins/observability_solution/slo/common/summary_indices.test.ts b/x-pack/solutions/observability/plugins/slo/common/summary_indices.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/common/summary_indices.test.ts rename to x-pack/solutions/observability/plugins/slo/common/summary_indices.test.ts diff --git a/x-pack/plugins/observability_solution/slo/common/summary_indices.ts b/x-pack/solutions/observability/plugins/slo/common/summary_indices.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/common/summary_indices.ts rename to x-pack/solutions/observability/plugins/slo/common/summary_indices.ts diff --git a/x-pack/plugins/observability_solution/slo/common/types.ts b/x-pack/solutions/observability/plugins/slo/common/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/common/types.ts rename to x-pack/solutions/observability/plugins/slo/common/types.ts diff --git a/x-pack/plugins/observability_solution/slo/dev_docs/slo.md b/x-pack/solutions/observability/plugins/slo/dev_docs/slo.md similarity index 98% rename from x-pack/plugins/observability_solution/slo/dev_docs/slo.md rename to x-pack/solutions/observability/plugins/slo/dev_docs/slo.md index 6286c47f2447d..3eb4c6f898352 100644 --- a/x-pack/plugins/observability_solution/slo/dev_docs/slo.md +++ b/x-pack/solutions/observability/plugins/slo/dev_docs/slo.md @@ -8,7 +8,7 @@ Starting in 8.8, SLO is enabled by default. SLO is GA since 8.12 1. Data generation > [!TIP] -> The following commands uses [kbn-data-forge](../../../../platform/packages/shared/kbn-data-forge/README.md) to generate some data for developping or testing SLOs +> The following commands uses [kbn-data-forge](../../../../../platform/packages/shared/kbn-data-forge/README.md) to generate some data for developping or testing SLOs Basic command to generate 7 days of data with a couple of services: ```sh diff --git a/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/README.md b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/README.md new file mode 100644 index 0000000000000..198dc9a405685 --- /dev/null +++ b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/README.md @@ -0,0 +1,35 @@ +# OpenAPI (Experimental) + +The current self-contained spec file is [as YAML](https://raw.githubusercontent.com/elastic/kibana/master/x-pack/plugins/observability/docs/openapi/slo/bundled.yaml) and can be used for online tools like those found at <https://openapi.tools/>. +This spec is experimental and may be incomplete or change later. + +A guide about the OpenApi specification can be found at [https://swagger.io/docs/specification/about/](https://swagger.io/docs/specification/about/). + +## The `openapi/slo` folder + +- `entrypoint.yaml` is the overview file which pulls together all the paths and components. +- [Paths](paths/README.md): this defines each endpoint. A path can have one operation per http method. +- [Components](components/README.md): Reusable components + +## Tools + +It is possible to manually validate the docs before bundling them with the following +command in the `x-pack/solutions/observability/plugins/slo/docs/openapi/slo` folder: + +```bash +make validate +``` + +Then you can generate the `bundled` files by running the following command- this target will automatically validate inputs and lint the result: + +```bash +make bundle +``` + +To lint the generated bundle manually, run: + +```bash +make lint +``` + +To join these files with the rest of the Kibana APIs, refer to `oas_docs/README.md` diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.json b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/bundled.json similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.json rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/bundled.json diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/bundled.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/bundled.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/README.md b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/README.md similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/README.md rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/README.md diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/headers/kbn_xsrf.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/headers/kbn_xsrf.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/headers/kbn_xsrf.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/headers/kbn_xsrf.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/parameters/slo_id.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/parameters/slo_id.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/parameters/slo_id.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/parameters/slo_id.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/parameters/space_id.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/parameters/space_id.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/parameters/space_id.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/parameters/space_id.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/400_response.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/400_response.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/400_response.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/400_response.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/401_response.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/401_response.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/401_response.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/401_response.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/403_response.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/403_response.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/403_response.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/403_response.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/404_response.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/404_response.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/404_response.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/404_response.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/409_response.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/409_response.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/409_response.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/409_response.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/budgeting_method.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/budgeting_method.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/budgeting_method.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/budgeting_method.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/create_slo_request.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/create_slo_request.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/create_slo_request.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/create_slo_request.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/create_slo_response.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/create_slo_response.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/create_slo_response.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/create_slo_response.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/delete_slo_instances_request.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/delete_slo_instances_request.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/delete_slo_instances_request.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/delete_slo_instances_request.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/error_budget.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/error_budget.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/error_budget.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/error_budget.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/filter.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/filter.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/filter.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/filter.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/filter_meta.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/filter_meta.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/filter_meta.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/filter_meta.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/find_slo_definitions_response.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/find_slo_definitions_response.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/find_slo_definitions_response.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/find_slo_definitions_response.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/find_slo_response.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/find_slo_response.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/find_slo_response.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/find_slo_response.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/group_by.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/group_by.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/group_by.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/group_by.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/historical_summary_request.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/historical_summary_request.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/historical_summary_request.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/historical_summary_request.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/historical_summary_response.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/historical_summary_response.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/historical_summary_response.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/historical_summary_response.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/indicator_properties_apm_availability.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/indicator_properties_apm_availability.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/indicator_properties_apm_availability.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/indicator_properties_apm_availability.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/indicator_properties_apm_latency.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/indicator_properties_apm_latency.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/indicator_properties_apm_latency.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/indicator_properties_apm_latency.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/indicator_properties_custom_kql.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/indicator_properties_custom_kql.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/indicator_properties_custom_kql.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/indicator_properties_custom_kql.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/indicator_properties_custom_metric.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/indicator_properties_custom_metric.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/indicator_properties_custom_metric.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/indicator_properties_custom_metric.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/indicator_properties_histogram.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/indicator_properties_histogram.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/indicator_properties_histogram.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/indicator_properties_histogram.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/indicator_properties_timeslice_metric.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/indicator_properties_timeslice_metric.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/indicator_properties_timeslice_metric.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/indicator_properties_timeslice_metric.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/kql_with_filters.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/kql_with_filters.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/kql_with_filters.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/kql_with_filters.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/kql_with_filters_good.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/kql_with_filters_good.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/kql_with_filters_good.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/kql_with_filters_good.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/kql_with_filters_total.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/kql_with_filters_total.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/kql_with_filters_total.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/kql_with_filters_total.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/objective.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/objective.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/objective.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/objective.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/settings.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/settings.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/settings.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/settings.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/slo_definition_response.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/slo_definition_response.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/slo_definition_response.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/slo_definition_response.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/slo_with_summary_response.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/slo_with_summary_response.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/slo_with_summary_response.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/slo_with_summary_response.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/summary.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/summary.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/summary.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/summary.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/summary_status.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/summary_status.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/summary_status.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/summary_status.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/time_window.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/time_window.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/time_window.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/time_window.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/timeslice_metric_basic_metric_with_field.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/timeslice_metric_basic_metric_with_field.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/timeslice_metric_basic_metric_with_field.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/timeslice_metric_basic_metric_with_field.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/timeslice_metric_doc_count_metric.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/timeslice_metric_doc_count_metric.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/timeslice_metric_doc_count_metric.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/timeslice_metric_doc_count_metric.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/timeslice_metric_percentile_metric.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/timeslice_metric_percentile_metric.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/timeslice_metric_percentile_metric.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/timeslice_metric_percentile_metric.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/update_slo_request.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/update_slo_request.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/components/schemas/update_slo_request.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/components/schemas/update_slo_request.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/entrypoint.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/entrypoint.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/entrypoint.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/entrypoint.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/makefile b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/makefile similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/makefile rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/makefile diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/README.md b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/paths/README.md similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/README.md rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/paths/README.md diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@_definitions.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@_definitions.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@_definitions.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@_definitions.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@_delete_instances.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@_delete_instances.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@_delete_instances.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@_delete_instances.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@_historical_summary.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@_historical_summary.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@_historical_summary.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@_historical_summary.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@{sloid}.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@{sloid}.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@{sloid}.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@{sloid}.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@{sloid}@_reset.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@{sloid}@_reset.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@{sloid}@_reset.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@{sloid}@_reset.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@{sloid}@disable.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@{sloid}@disable.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@{sloid}@disable.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@{sloid}@disable.yaml diff --git a/x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@{sloid}@enable.yaml b/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@{sloid}@enable.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@{sloid}@enable.yaml rename to x-pack/solutions/observability/plugins/slo/docs/openapi/slo/paths/s@{spaceid}@api@slos@{sloid}@enable.yaml diff --git a/x-pack/plugins/observability_solution/slo/e2e/journeys/annotation_list.journey.ts b/x-pack/solutions/observability/plugins/slo/e2e/journeys/annotation_list.journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/e2e/journeys/annotation_list.journey.ts rename to x-pack/solutions/observability/plugins/slo/e2e/journeys/annotation_list.journey.ts diff --git a/x-pack/plugins/observability_solution/slo/e2e/journeys/index.ts b/x-pack/solutions/observability/plugins/slo/e2e/journeys/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/e2e/journeys/index.ts rename to x-pack/solutions/observability/plugins/slo/e2e/journeys/index.ts diff --git a/x-pack/plugins/observability_solution/slo/e2e/journeys/slos_overview.journey.ts b/x-pack/solutions/observability/plugins/slo/e2e/journeys/slos_overview.journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/e2e/journeys/slos_overview.journey.ts rename to x-pack/solutions/observability/plugins/slo/e2e/journeys/slos_overview.journey.ts diff --git a/x-pack/plugins/observability_solution/slo/e2e/page_objects/slo_app.tsx b/x-pack/solutions/observability/plugins/slo/e2e/page_objects/slo_app.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/e2e/page_objects/slo_app.tsx rename to x-pack/solutions/observability/plugins/slo/e2e/page_objects/slo_app.tsx diff --git a/x-pack/plugins/observability_solution/slo/e2e/services/annotation_data_service.ts b/x-pack/solutions/observability/plugins/slo/e2e/services/annotation_data_service.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/e2e/services/annotation_data_service.ts rename to x-pack/solutions/observability/plugins/slo/e2e/services/annotation_data_service.ts diff --git a/x-pack/plugins/observability_solution/slo/e2e/services/slo_data_service.ts b/x-pack/solutions/observability/plugins/slo/e2e/services/slo_data_service.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/e2e/services/slo_data_service.ts rename to x-pack/solutions/observability/plugins/slo/e2e/services/slo_data_service.ts diff --git a/x-pack/plugins/observability_solution/slo/e2e/synthetics_run.ts b/x-pack/solutions/observability/plugins/slo/e2e/synthetics_run.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/e2e/synthetics_run.ts rename to x-pack/solutions/observability/plugins/slo/e2e/synthetics_run.ts diff --git a/x-pack/solutions/observability/plugins/slo/e2e/tsconfig.json b/x-pack/solutions/observability/plugins/slo/e2e/tsconfig.json new file mode 100644 index 0000000000000..420d48f662617 --- /dev/null +++ b/x-pack/solutions/observability/plugins/slo/e2e/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../../../../../tsconfig.base.json", + "exclude": ["tmp", "target/**/*"], + "include": ["**/*"], + "compilerOptions": { + "outDir": "target/types", + "types": [ "node"], + "isolatedModules": false, + }, + "kbn_references": [ + "@kbn/test", + "@kbn/ftr-common-functional-services", + "@kbn/data-forge", + "@kbn/synthetics-e2e", + "@kbn/observability-synthetics-test-data", + ] +} diff --git a/x-pack/plugins/observability_solution/infra/emotion.d.ts b/x-pack/solutions/observability/plugins/slo/emotion.d.ts similarity index 100% rename from x-pack/plugins/observability_solution/infra/emotion.d.ts rename to x-pack/solutions/observability/plugins/slo/emotion.d.ts diff --git a/x-pack/solutions/observability/plugins/slo/jest.config.js b/x-pack/solutions/observability/plugins/slo/jest.config.js new file mode 100644 index 0000000000000..5de5881b39250 --- /dev/null +++ b/x-pack/solutions/observability/plugins/slo/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/solutions/observability/plugins/slo'], + setupFiles: ['<rootDir>/x-pack/solutions/observability/plugins/slo/.storybook/jest_setup.js'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/observability/plugins/slo', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/observability/plugins/slo/{common,public,server}/**/*.{js,ts,tsx}', + ], +}; diff --git a/x-pack/plugins/observability_solution/slo/kibana.jsonc b/x-pack/solutions/observability/plugins/slo/kibana.jsonc similarity index 100% rename from x-pack/plugins/observability_solution/slo/kibana.jsonc rename to x-pack/solutions/observability/plugins/slo/kibana.jsonc diff --git a/x-pack/plugins/observability_solution/slo/public/application.tsx b/x-pack/solutions/observability/plugins/slo/public/application.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/application.tsx rename to x-pack/solutions/observability/plugins/slo/public/application.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/alert_details/alert_details_app_section.tsx b/x-pack/solutions/observability/plugins/slo/public/components/alert_details/alert_details_app_section.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/alert_details/alert_details_app_section.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/alert_details/alert_details_app_section.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/alert_details/components/custom_panels/apm/apm_alert_details.tsx b/x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/apm/apm_alert_details.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/alert_details/components/custom_panels/apm/apm_alert_details.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/apm/apm_alert_details.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/alert_details/components/custom_panels/apm/embeddable_root.tsx b/x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/apm/embeddable_root.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/alert_details/components/custom_panels/apm/embeddable_root.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/apm/embeddable_root.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/alert_details/components/custom_panels/custom_kql/custom_kql_panels.tsx b/x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/custom_kql/custom_kql_panels.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/alert_details/components/custom_panels/custom_kql/custom_kql_panels.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/custom_kql/custom_kql_panels.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/alert_details/components/custom_panels/custom_kql/helpers/__snapshots__/log_rate_analysis_query.test.ts.snap b/x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/custom_kql/helpers/__snapshots__/log_rate_analysis_query.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/alert_details/components/custom_panels/custom_kql/helpers/__snapshots__/log_rate_analysis_query.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/custom_kql/helpers/__snapshots__/log_rate_analysis_query.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/public/components/alert_details/components/custom_panels/custom_kql/helpers/log_rate_analysis_query.test.ts b/x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/custom_kql/helpers/log_rate_analysis_query.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/alert_details/components/custom_panels/custom_kql/helpers/log_rate_analysis_query.test.ts rename to x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/custom_kql/helpers/log_rate_analysis_query.test.ts diff --git a/x-pack/plugins/observability_solution/slo/public/components/alert_details/components/custom_panels/custom_kql/helpers/log_rate_analysis_query.ts b/x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/custom_kql/helpers/log_rate_analysis_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/alert_details/components/custom_panels/custom_kql/helpers/log_rate_analysis_query.ts rename to x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/custom_kql/helpers/log_rate_analysis_query.ts diff --git a/x-pack/plugins/observability_solution/slo/public/components/alert_details/components/custom_panels/custom_kql/log_rate_analysis_panel.tsx b/x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/custom_kql/log_rate_analysis_panel.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/alert_details/components/custom_panels/custom_kql/log_rate_analysis_panel.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/custom_kql/log_rate_analysis_panel.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/alert_details/components/custom_panels/custom_panels.tsx b/x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/custom_panels.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/alert_details/components/custom_panels/custom_panels.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/custom_panels/custom_panels.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/alert_details/components/error_rate/error_rate_panel.tsx b/x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/error_rate/error_rate_panel.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/alert_details/components/error_rate/error_rate_panel.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/alert_details/components/error_rate/error_rate_panel.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/alert_details/types.ts b/x-pack/solutions/observability/plugins/slo/public/components/alert_details/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/alert_details/types.ts rename to x-pack/solutions/observability/plugins/slo/public/components/alert_details/types.ts diff --git a/x-pack/plugins/observability_solution/slo/public/components/alert_details/utils/alert.ts b/x-pack/solutions/observability/plugins/slo/public/components/alert_details/utils/alert.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/alert_details/utils/alert.ts rename to x-pack/solutions/observability/plugins/slo/public/components/alert_details/utils/alert.ts diff --git a/x-pack/plugins/observability_solution/slo/public/components/alert_details/utils/last_duration_i18n.ts b/x-pack/solutions/observability/plugins/slo/public/components/alert_details/utils/last_duration_i18n.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/alert_details/utils/last_duration_i18n.ts rename to x-pack/solutions/observability/plugins/slo/public/components/alert_details/utils/last_duration_i18n.ts diff --git a/x-pack/plugins/observability_solution/slo/public/components/alert_details/utils/time_range.ts b/x-pack/solutions/observability/plugins/slo/public/components/alert_details/utils/time_range.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/alert_details/utils/time_range.ts rename to x-pack/solutions/observability/plugins/slo/public/components/alert_details/utils/time_range.ts diff --git a/x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/alert_time_table.tsx b/x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/alert_time_table.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/alert_time_table.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/alert_time_table.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/budget_consumed.tsx b/x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/budget_consumed.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/budget_consumed.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/budget_consumed.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/burn_rate.tsx b/x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/burn_rate.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/burn_rate.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/burn_rate.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/burn_rate_rule_editor.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/burn_rate_rule_editor.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/burn_rate_rule_editor.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/burn_rate_rule_editor.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/burn_rate_rule_editor.tsx b/x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/burn_rate_rule_editor.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/burn_rate_rule_editor.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/burn_rate_rule_editor.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/constants.ts b/x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/constants.ts rename to x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/constants.ts diff --git a/x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/dependencies.tsx b/x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/dependencies.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/dependencies.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/dependencies.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/dependency_editor.tsx b/x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/dependency_editor.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/dependency_editor.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/dependency_editor.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/index.tsx b/x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/index.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/index.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/long_window_duration.tsx b/x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/long_window_duration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/long_window_duration.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/long_window_duration.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/short_window_duration.tsx b/x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/short_window_duration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/short_window_duration.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/short_window_duration.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/slo_selector.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/slo_selector.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/slo_selector.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/slo_selector.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/slo_selector.test.tsx b/x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/slo_selector.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/slo_selector.test.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/slo_selector.test.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/slo_selector.tsx b/x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/slo_selector.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/slo_selector.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/slo_selector.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/validation.test.ts b/x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/validation.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/validation.test.ts rename to x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/validation.test.ts diff --git a/x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/validation.ts b/x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/validation.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/validation.ts rename to x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/validation.ts diff --git a/x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/windows.tsx b/x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/windows.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/burn_rate_rule_editor/windows.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/burn_rate_rule_editor/windows.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/good_bad_events_chart/good_bad_events_chart.tsx b/x-pack/solutions/observability/plugins/slo/public/components/good_bad_events_chart/good_bad_events_chart.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/good_bad_events_chart/good_bad_events_chart.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/good_bad_events_chart/good_bad_events_chart.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/header_menu/header_menu.tsx b/x-pack/solutions/observability/plugins/slo/public/components/header_menu/header_menu.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/header_menu/header_menu.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/header_menu/header_menu.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/loading_state.tsx b/x-pack/solutions/observability/plugins/slo/public/components/loading_state.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/loading_state.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/loading_state.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/auto_refresh_button/auto_refresh_button.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/components/slo/auto_refresh_button/auto_refresh_button.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/slo/auto_refresh_button/auto_refresh_button.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/slo/auto_refresh_button/auto_refresh_button.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/auto_refresh_button/auto_refresh_button.tsx b/x-pack/solutions/observability/plugins/slo/public/components/slo/auto_refresh_button/auto_refresh_button.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/slo/auto_refresh_button/auto_refresh_button.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/slo/auto_refresh_button/auto_refresh_button.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/auto_refresh_button/hooks/use_auto_refresh_storage.tsx b/x-pack/solutions/observability/plugins/slo/public/components/slo/auto_refresh_button/hooks/use_auto_refresh_storage.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/slo/auto_refresh_button/hooks/use_auto_refresh_storage.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/slo/auto_refresh_button/hooks/use_auto_refresh_storage.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/auto_refresh_button/index.tsx b/x-pack/solutions/observability/plugins/slo/public/components/slo/auto_refresh_button/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/slo/auto_refresh_button/index.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/slo/auto_refresh_button/index.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/delete_confirmation_modal/slo_delete_confirmation_modal.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/components/slo/delete_confirmation_modal/slo_delete_confirmation_modal.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/slo/delete_confirmation_modal/slo_delete_confirmation_modal.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/slo/delete_confirmation_modal/slo_delete_confirmation_modal.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/delete_confirmation_modal/slo_delete_confirmation_modal.tsx b/x-pack/solutions/observability/plugins/slo/public/components/slo/delete_confirmation_modal/slo_delete_confirmation_modal.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/slo/delete_confirmation_modal/slo_delete_confirmation_modal.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/slo/delete_confirmation_modal/slo_delete_confirmation_modal.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/error_rate_chart/error_rate_chart.tsx b/x-pack/solutions/observability/plugins/slo/public/components/slo/error_rate_chart/error_rate_chart.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/slo/error_rate_chart/error_rate_chart.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/slo/error_rate_chart/error_rate_chart.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/error_rate_chart/index.ts b/x-pack/solutions/observability/plugins/slo/public/components/slo/error_rate_chart/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/slo/error_rate_chart/index.ts rename to x-pack/solutions/observability/plugins/slo/public/components/slo/error_rate_chart/index.ts diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/error_rate_chart/use_lens_definition.ts b/x-pack/solutions/observability/plugins/slo/public/components/slo/error_rate_chart/use_lens_definition.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/slo/error_rate_chart/use_lens_definition.ts rename to x-pack/solutions/observability/plugins/slo/public/components/slo/error_rate_chart/use_lens_definition.ts diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/error_rate_chart/utils.test.ts b/x-pack/solutions/observability/plugins/slo/public/components/slo/error_rate_chart/utils.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/slo/error_rate_chart/utils.test.ts rename to x-pack/solutions/observability/plugins/slo/public/components/slo/error_rate_chart/utils.test.ts diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/error_rate_chart/utils.ts b/x-pack/solutions/observability/plugins/slo/public/components/slo/error_rate_chart/utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/slo/error_rate_chart/utils.ts rename to x-pack/solutions/observability/plugins/slo/public/components/slo/error_rate_chart/utils.ts diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/reset_confirmation_modal/slo_reset_confirmation_modal.tsx b/x-pack/solutions/observability/plugins/slo/public/components/slo/reset_confirmation_modal/slo_reset_confirmation_modal.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/slo/reset_confirmation_modal/slo_reset_confirmation_modal.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/slo/reset_confirmation_modal/slo_reset_confirmation_modal.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/simple_burn_rate/burn_rate.tsx b/x-pack/solutions/observability/plugins/slo/public/components/slo/simple_burn_rate/burn_rate.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/slo/simple_burn_rate/burn_rate.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/slo/simple_burn_rate/burn_rate.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/slo_outdated_callout/index.tsx b/x-pack/solutions/observability/plugins/slo/public/components/slo/slo_outdated_callout/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/slo/slo_outdated_callout/index.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/slo/slo_outdated_callout/index.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/slo_permissions_callout/index.tsx b/x-pack/solutions/observability/plugins/slo/public/components/slo/slo_permissions_callout/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/slo/slo_permissions_callout/index.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/slo/slo_permissions_callout/index.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/slo_status_badge/index.tsx b/x-pack/solutions/observability/plugins/slo/public/components/slo/slo_status_badge/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/slo/slo_status_badge/index.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/slo/slo_status_badge/index.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/slo_status_badge/slo_active_alerts_badge.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/components/slo/slo_status_badge/slo_active_alerts_badge.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/slo/slo_status_badge/slo_active_alerts_badge.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/slo/slo_status_badge/slo_active_alerts_badge.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/slo_status_badge/slo_active_alerts_badge.tsx b/x-pack/solutions/observability/plugins/slo/public/components/slo/slo_status_badge/slo_active_alerts_badge.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/slo/slo_status_badge/slo_active_alerts_badge.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/slo/slo_status_badge/slo_active_alerts_badge.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/slo_status_badge/slo_status_badge.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/components/slo/slo_status_badge/slo_status_badge.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/slo/slo_status_badge/slo_status_badge.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/slo/slo_status_badge/slo_status_badge.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/slo/slo_status_badge/slo_status_badge.tsx b/x-pack/solutions/observability/plugins/slo/public/components/slo/slo_status_badge/slo_status_badge.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/slo/slo_status_badge/slo_status_badge.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/slo/slo_status_badge/slo_status_badge.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/components/technical_preview_badge.tsx b/x-pack/solutions/observability/plugins/slo/public/components/technical_preview_badge.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/components/technical_preview_badge.tsx rename to x-pack/solutions/observability/plugins/slo/public/components/technical_preview_badge.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/constants.ts b/x-pack/solutions/observability/plugins/slo/public/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/constants.ts rename to x-pack/solutions/observability/plugins/slo/public/constants.ts diff --git a/x-pack/plugins/observability_solution/slo/public/context/plugin_context.tsx b/x-pack/solutions/observability/plugins/slo/public/context/plugin_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/context/plugin_context.tsx rename to x-pack/solutions/observability/plugins/slo/public/context/plugin_context.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/data/slo/common.ts b/x-pack/solutions/observability/plugins/slo/public/data/slo/common.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/data/slo/common.ts rename to x-pack/solutions/observability/plugins/slo/public/data/slo/common.ts diff --git a/x-pack/plugins/observability_solution/slo/public/data/slo/historical_summary_data.ts b/x-pack/solutions/observability/plugins/slo/public/data/slo/historical_summary_data.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/data/slo/historical_summary_data.ts rename to x-pack/solutions/observability/plugins/slo/public/data/slo/historical_summary_data.ts diff --git a/x-pack/plugins/observability_solution/slo/public/data/slo/indicator.ts b/x-pack/solutions/observability/plugins/slo/public/data/slo/indicator.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/data/slo/indicator.ts rename to x-pack/solutions/observability/plugins/slo/public/data/slo/indicator.ts diff --git a/x-pack/plugins/observability_solution/slo/public/data/slo/slo.ts b/x-pack/solutions/observability/plugins/slo/public/data/slo/slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/data/slo/slo.ts rename to x-pack/solutions/observability/plugins/slo/public/data/slo/slo.ts diff --git a/x-pack/plugins/observability_solution/slo/public/data/slo/time_window.ts b/x-pack/solutions/observability/plugins/slo/public/data/slo/time_window.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/data/slo/time_window.ts rename to x-pack/solutions/observability/plugins/slo/public/data/slo/time_window.ts diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/alerts/components/slo_alerts_summary.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/alerts/components/slo_alerts_summary.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/alerts/components/slo_alerts_summary.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/alerts/components/slo_alerts_summary.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/alerts/components/slo_alerts_table.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/alerts/components/slo_alerts_table.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/alerts/components/slo_alerts_table.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/alerts/components/slo_alerts_table.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/alerts/components/slo_included_count.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/alerts/components/slo_included_count.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/alerts/components/slo_included_count.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/alerts/components/slo_included_count.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/alerts/constants.ts b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/alerts/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/alerts/constants.ts rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/alerts/constants.ts diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/alerts/slo_alerts_embeddable_factory.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/alerts/slo_alerts_embeddable_factory.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/alerts/slo_alerts_embeddable_factory.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/alerts/slo_alerts_embeddable_factory.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/alerts/slo_alerts_open_configuration.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/alerts/slo_alerts_open_configuration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/alerts/slo_alerts_open_configuration.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/alerts/slo_alerts_open_configuration.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/alerts/slo_alerts_wrapper.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/alerts/slo_alerts_wrapper.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/alerts/slo_alerts_wrapper.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/alerts/slo_alerts_wrapper.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/alerts/slo_configuration.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/alerts/slo_configuration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/alerts/slo_configuration.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/alerts/slo_configuration.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/alerts/slo_selector.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/alerts/slo_selector.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/alerts/slo_selector.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/alerts/slo_selector.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/alerts/types.ts b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/alerts/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/alerts/types.ts rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/alerts/types.ts diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/burn_rate/burn_rate.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/burn_rate/burn_rate.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/burn_rate/burn_rate.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/burn_rate/burn_rate.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/burn_rate/burn_rate_react_embeddable_factory.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/burn_rate/burn_rate_react_embeddable_factory.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/burn_rate/burn_rate_react_embeddable_factory.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/burn_rate/burn_rate_react_embeddable_factory.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/burn_rate/configuration.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/burn_rate/configuration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/burn_rate/configuration.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/burn_rate/configuration.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/burn_rate/constants.ts b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/burn_rate/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/burn_rate/constants.ts rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/burn_rate/constants.ts diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/burn_rate/open_configuration.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/burn_rate/open_configuration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/burn_rate/open_configuration.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/burn_rate/open_configuration.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/burn_rate/types.ts b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/burn_rate/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/burn_rate/types.ts rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/burn_rate/types.ts diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/common/slo_overview_details.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/common/slo_overview_details.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/common/slo_overview_details.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/common/slo_overview_details.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/constants.ts b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/constants.ts rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/constants.ts diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/error_budget/constants.ts b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/error_budget/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/error_budget/constants.ts rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/error_budget/constants.ts diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/error_budget/error_budget_burn_down.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/error_budget/error_budget_burn_down.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/error_budget/error_budget_burn_down.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/error_budget/error_budget_burn_down.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/error_budget/error_budget_open_configuration.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/error_budget/error_budget_open_configuration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/error_budget/error_budget_open_configuration.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/error_budget/error_budget_open_configuration.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/error_budget/error_budget_react_embeddable_factory.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/error_budget/error_budget_react_embeddable_factory.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/error_budget/error_budget_react_embeddable_factory.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/error_budget/error_budget_react_embeddable_factory.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/error_budget/slo_configuration.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/error_budget/slo_configuration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/error_budget/slo_configuration.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/error_budget/slo_configuration.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/error_budget/types.ts b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/error_budget/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/error_budget/types.ts rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/error_budget/types.ts diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/constants.ts b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/constants.ts rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/constants.ts diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/group_view/group_view.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/group_view/group_view.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/group_view/group_view.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/group_view/group_view.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/group_view/helpers/__snapshots__/build_kql_query.test.ts.snap b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/group_view/helpers/__snapshots__/build_kql_query.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/group_view/helpers/__snapshots__/build_kql_query.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/group_view/helpers/__snapshots__/build_kql_query.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/group_view/helpers/build_kql_query.test.ts b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/group_view/helpers/build_kql_query.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/group_view/helpers/build_kql_query.test.ts rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/group_view/helpers/build_kql_query.test.ts diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/group_view/helpers/build_kql_query.ts b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/group_view/helpers/build_kql_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/group_view/helpers/build_kql_query.ts rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/group_view/helpers/build_kql_query.ts diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/group_view/slo_group_filters.scss b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/group_view/slo_group_filters.scss similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/group_view/slo_group_filters.scss rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/group_view/slo_group_filters.scss diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/group_view/slo_group_filters.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/group_view/slo_group_filters.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/group_view/slo_group_filters.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/group_view/slo_group_filters.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/overview_mode_selector.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/overview_mode_selector.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/overview_mode_selector.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/overview_mode_selector.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/slo_configuration.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/slo_configuration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/slo_configuration.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/slo_configuration.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/slo_embeddable_factory.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/slo_embeddable_factory.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/slo_embeddable_factory.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/slo_embeddable_factory.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/slo_overview.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/slo_overview.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/slo_overview.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/slo_overview.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/slo_overview_grid.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/slo_overview_grid.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/slo_overview_grid.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/slo_overview_grid.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/slo_overview_open_configuration.tsx b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/slo_overview_open_configuration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/slo_overview_open_configuration.tsx rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/slo_overview_open_configuration.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/types.ts b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/overview/types.ts rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/overview/types.ts diff --git a/x-pack/plugins/observability_solution/slo/public/embeddable/slo/types.ts b/x-pack/solutions/observability/plugins/slo/public/embeddable/slo/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/embeddable/slo/types.ts rename to x-pack/solutions/observability/plugins/slo/public/embeddable/slo/types.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/__storybook_mocks__/use_capabilities.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/__storybook_mocks__/use_capabilities.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/__storybook_mocks__/use_capabilities.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/__storybook_mocks__/use_capabilities.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/__storybook_mocks__/use_fetch_active_alerts.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/__storybook_mocks__/use_fetch_active_alerts.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/__storybook_mocks__/use_fetch_active_alerts.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/__storybook_mocks__/use_fetch_active_alerts.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/__storybook_mocks__/use_fetch_apm_suggestions.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/__storybook_mocks__/use_fetch_apm_suggestions.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/__storybook_mocks__/use_fetch_apm_suggestions.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/__storybook_mocks__/use_fetch_apm_suggestions.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/__storybook_mocks__/use_fetch_historical_summary.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/__storybook_mocks__/use_fetch_historical_summary.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/__storybook_mocks__/use_fetch_historical_summary.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/__storybook_mocks__/use_fetch_historical_summary.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/__storybook_mocks__/use_fetch_slo_list.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/__storybook_mocks__/use_fetch_slo_list.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/__storybook_mocks__/use_fetch_slo_list.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/__storybook_mocks__/use_fetch_slo_list.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/active_alerts.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/active_alerts.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/active_alerts.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/active_alerts.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/helpers/convert_error_for_use_in_toast.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/helpers/convert_error_for_use_in_toast.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/helpers/convert_error_for_use_in_toast.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/helpers/convert_error_for_use_in_toast.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/query_key_factory.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/query_key_factory.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/query_key_factory.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/query_key_factory.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_alerts_url.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_alerts_url.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_alerts_url.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_alerts_url.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_capabilities.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_capabilities.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_capabilities.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_capabilities.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_clone_slo.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_clone_slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_clone_slo.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_clone_slo.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_create_burn_rate_rule.tsx b/x-pack/solutions/observability/plugins/slo/public/hooks/use_create_burn_rate_rule.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_create_burn_rate_rule.tsx rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_create_burn_rate_rule.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_create_data_view.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_create_data_view.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_create_data_view.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_create_data_view.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_create_slo.tsx b/x-pack/solutions/observability/plugins/slo/public/hooks/use_create_slo.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_create_slo.tsx rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_create_slo.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_delete_slo.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_delete_slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_delete_slo.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_delete_slo.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_delete_slo_instance.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_delete_slo_instance.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_delete_slo_instance.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_delete_slo_instance.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_active_alerts.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_active_alerts.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_active_alerts.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_active_alerts.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_apm_indices.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_apm_indices.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_apm_indices.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_apm_indices.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_apm_suggestions.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_apm_suggestions.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_apm_suggestions.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_apm_suggestions.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_global_diagnosis.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_global_diagnosis.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_global_diagnosis.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_global_diagnosis.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_group_by_cardinality.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_group_by_cardinality.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_group_by_cardinality.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_group_by_cardinality.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_historical_summary.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_historical_summary.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_historical_summary.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_historical_summary.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_indices.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_indices.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_indices.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_indices.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_rules_for_slo.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_rules_for_slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_rules_for_slo.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_rules_for_slo.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_slo_burn_rates.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_slo_burn_rates.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_slo_burn_rates.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_slo_burn_rates.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_slo_definitions.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_slo_definitions.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_slo_definitions.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_slo_definitions.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_slo_details.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_slo_details.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_slo_details.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_slo_details.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_slo_groups.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_slo_groups.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_slo_groups.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_slo_groups.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_slo_health.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_slo_health.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_slo_health.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_slo_health.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_slo_inspect.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_slo_inspect.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_slo_inspect.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_slo_inspect.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_slo_list.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_slo_list.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_slo_list.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_slo_list.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_slos_with_burn_rate_rules.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_slos_with_burn_rate_rules.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_slos_with_burn_rate_rules.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_slos_with_burn_rate_rules.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_synthetics_suggestions.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_synthetics_suggestions.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_fetch_synthetics_suggestions.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_fetch_synthetics_suggestions.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_get_filtered_rule_types.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_get_filtered_rule_types.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_get_filtered_rule_types.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_get_filtered_rule_types.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_get_preview_data.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_get_preview_data.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_get_preview_data.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_get_preview_data.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_kibana.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_kibana.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_kibana.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_kibana.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_license.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_license.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_license.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_license.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_permissions.test.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_permissions.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_permissions.test.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_permissions.test.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_permissions.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_permissions.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_permissions.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_permissions.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_plugin_context.tsx b/x-pack/solutions/observability/plugins/slo/public/hooks/use_plugin_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_plugin_context.tsx rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_plugin_context.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_reset_slo.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_reset_slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_reset_slo.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_reset_slo.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_space.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_space.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_space.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_space.ts diff --git a/x-pack/plugins/observability_solution/slo/public/hooks/use_update_slo.ts b/x-pack/solutions/observability/plugins/slo/public/hooks/use_update_slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/hooks/use_update_slo.ts rename to x-pack/solutions/observability/plugins/slo/public/hooks/use_update_slo.ts diff --git a/x-pack/plugins/observability_solution/slo/public/index.ts b/x-pack/solutions/observability/plugins/slo/public/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/index.ts rename to x-pack/solutions/observability/plugins/slo/public/index.ts diff --git a/x-pack/plugins/observability_solution/slo/public/locators/slo_details.test.ts b/x-pack/solutions/observability/plugins/slo/public/locators/slo_details.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/locators/slo_details.test.ts rename to x-pack/solutions/observability/plugins/slo/public/locators/slo_details.test.ts diff --git a/x-pack/plugins/observability_solution/slo/public/locators/slo_details.ts b/x-pack/solutions/observability/plugins/slo/public/locators/slo_details.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/locators/slo_details.ts rename to x-pack/solutions/observability/plugins/slo/public/locators/slo_details.ts diff --git a/x-pack/plugins/observability_solution/slo/public/locators/slo_edit.test.ts b/x-pack/solutions/observability/plugins/slo/public/locators/slo_edit.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/locators/slo_edit.test.ts rename to x-pack/solutions/observability/plugins/slo/public/locators/slo_edit.test.ts diff --git a/x-pack/plugins/observability_solution/slo/public/locators/slo_edit.ts b/x-pack/solutions/observability/plugins/slo/public/locators/slo_edit.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/locators/slo_edit.ts rename to x-pack/solutions/observability/plugins/slo/public/locators/slo_edit.ts diff --git a/x-pack/plugins/observability_solution/slo/public/locators/slo_list.test.ts b/x-pack/solutions/observability/plugins/slo/public/locators/slo_list.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/locators/slo_list.test.ts rename to x-pack/solutions/observability/plugins/slo/public/locators/slo_list.test.ts diff --git a/x-pack/plugins/observability_solution/slo/public/locators/slo_list.ts b/x-pack/solutions/observability/plugins/slo/public/locators/slo_list.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/locators/slo_list.ts rename to x-pack/solutions/observability/plugins/slo/public/locators/slo_list.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/404.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/404.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/404.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/404.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/burn_rate_panel/burn_rate_panel.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/burn_rate_panel/burn_rate_panel.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/burn_rate_panel/burn_rate_panel.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/burn_rate_panel/burn_rate_panel.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/burn_rate_panel/burn_rate_status.test.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/burn_rate_panel/burn_rate_status.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/burn_rate_panel/burn_rate_status.test.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/burn_rate_panel/burn_rate_status.test.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/burn_rate_panel/burn_rate_status.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/burn_rate_panel/burn_rate_status.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/burn_rate_panel/burn_rate_status.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/burn_rate_panel/burn_rate_status.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/burn_rate_panel/utils.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/burn_rate_panel/utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/burn_rate_panel/utils.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/burn_rate_panel/utils.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/error_budget_actions.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/error_budget_actions.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/error_budget_actions.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/error_budget_actions.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/error_budget_chart.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/error_budget_chart.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/error_budget_chart.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/error_budget_chart.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/error_budget_chart_panel.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/error_budget_chart_panel.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/error_budget_chart_panel.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/error_budget_chart_panel.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/error_budget_header.test.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/error_budget_header.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/error_budget_header.test.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/error_budget_header.test.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/error_budget_header.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/error_budget_header.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/error_budget_header.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/error_budget_header.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/events_area_chart.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/events_area_chart.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/events_area_chart.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/events_area_chart.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/events_chart_panel.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/events_chart_panel.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/events_chart_panel.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/events_chart_panel.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/groupings/slo_grouping_value_selector.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/groupings/slo_grouping_value_selector.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/groupings/slo_grouping_value_selector.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/groupings/slo_grouping_value_selector.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/groupings/slo_groupings.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/groupings/slo_groupings.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/groupings/slo_groupings.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/groupings/slo_groupings.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/header_control.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/header_control.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/header_control.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/header_control.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/header_control.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/header_control.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/header_control.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/header_control.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/header_title.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/header_title.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/header_title.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/header_title.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/header_title.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/header_title.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/header_title.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/header_title.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/historical_data_charts.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/historical_data_charts.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/historical_data_charts.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/historical_data_charts.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/history/slo_details_history.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/history/slo_details_history.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/history/slo_details_history.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/history/slo_details_history.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/overview/apm_indicator_overview.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/overview/apm_indicator_overview.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/overview/apm_indicator_overview.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/overview/apm_indicator_overview.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/overview/display_query.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/overview/display_query.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/overview/display_query.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/overview/display_query.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/overview/overview.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/overview/overview.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/overview/overview.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/overview/overview.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/overview/overview.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/overview/overview.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/overview/overview.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/overview/overview.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/overview/overview_item.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/overview/overview_item.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/overview/overview_item.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/overview/overview_item.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/overview/synthetics_indicator_overview.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/overview/synthetics_indicator_overview.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/overview/synthetics_indicator_overview.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/overview/synthetics_indicator_overview.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/sli_chart_panel.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/sli_chart_panel.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/sli_chart_panel.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/sli_chart_panel.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/slo_detail_alerts.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/slo_detail_alerts.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/slo_detail_alerts.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/slo_detail_alerts.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/slo_details.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/slo_details.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/slo_details.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/slo_details.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/slo_details.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/slo_details.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/slo_details.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/slo_details.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/slo_health_callout.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/slo_health_callout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/slo_health_callout.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/slo_health_callout.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/slo_remote_callout.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/slo_remote_callout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/slo_remote_callout.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/slo_remote_callout.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/timeslice_annotation.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/timeslice_annotation.tsx similarity index 93% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/timeslice_annotation.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/timeslice_annotation.tsx index c1fd80bc53bc0..03fca2e3ff433 100644 --- a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/timeslice_annotation.tsx +++ b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/timeslice_annotation.tsx @@ -35,7 +35,7 @@ export function TimesliceAnnotation({ slo, maxValue, minValue }: Props) { style={{ line: { strokeWidth: 2, - stroke: euiTheme.colors.warning || '#000', + stroke: euiTheme.colors.warning, opacity: 1, }, }} @@ -55,7 +55,7 @@ export function TimesliceAnnotation({ slo, maxValue, minValue }: Props) { }, ]} id="thresholdShade" - style={{ fill: euiTheme.colors.warning || '#000', opacity: 0.1 }} + style={{ fill: euiTheme.colors.warning, opacity: 0.1 }} /> </> ) : null; diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/wide_chart.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/wide_chart.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/components/wide_chart.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/components/wide_chart.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/hooks/use_fetch_burn_rate_windows.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/hooks/use_fetch_burn_rate_windows.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/hooks/use_fetch_burn_rate_windows.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/hooks/use_fetch_burn_rate_windows.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/hooks/use_fetch_slo_instances.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/hooks/use_fetch_slo_instances.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/hooks/use_fetch_slo_instances.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/hooks/use_fetch_slo_instances.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/hooks/use_get_query_params.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/hooks/use_get_query_params.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/hooks/use_get_query_params.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/hooks/use_get_query_params.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/hooks/use_selected_tab.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/hooks/use_selected_tab.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/hooks/use_selected_tab.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/hooks/use_selected_tab.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/hooks/use_slo_actions.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/hooks/use_slo_actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/hooks/use_slo_actions.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/hooks/use_slo_actions.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/hooks/use_slo_details_tabs.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/hooks/use_slo_details_tabs.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/hooks/use_slo_details_tabs.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/hooks/use_slo_details_tabs.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/slo_details.test.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/slo_details.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/slo_details.test.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/slo_details.test.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/slo_details.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/slo_details.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/slo_details.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/slo_details.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_details/types.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_details/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_details/types.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_details/types.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/data_preview_chart.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/data_preview_chart.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/data_preview_chart.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/data_preview_chart.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/documents_table.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/documents_table.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/documents_table.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/documents_table.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/equivalent_api_request.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/equivalent_api_request.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/equivalent_api_request.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/equivalent_api_request.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/group_by_cardinality.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/group_by_cardinality.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/group_by_cardinality.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/group_by_cardinality.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/group_by_field.test.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/group_by_field.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/group_by_field.test.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/group_by_field.test.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/group_by_field.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/group_by_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/group_by_field.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/group_by_field.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/group_by_field_selector.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/group_by_field_selector.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/group_by_field_selector.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/group_by_field_selector.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/optional_text.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/optional_text.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/optional_text.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/optional_text.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/query_builder.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/query_builder.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/query_builder.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/query_builder.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/query_builder.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/query_builder.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/query_builder.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/query_builder.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/query_documents_flyout.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/query_documents_flyout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/query_documents_flyout.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/query_documents_flyout.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/query_search_bar.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/query_search_bar.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/query_search_bar.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/query_search_bar.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/runtime_field_used.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/runtime_field_used.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/runtime_field_used.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/runtime_field_used.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/slo_inspect/code_block_accordion.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/slo_inspect/code_block_accordion.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/slo_inspect/code_block_accordion.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/slo_inspect/code_block_accordion.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/slo_inspect/loading_state.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/slo_inspect/loading_state.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/slo_inspect/loading_state.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/slo_inspect/loading_state.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/slo_inspect/req_code_viewer.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/slo_inspect/req_code_viewer.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/slo_inspect/req_code_viewer.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/slo_inspect/req_code_viewer.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/slo_inspect/slo_inspect.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/slo_inspect/slo_inspect.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/slo_inspect/slo_inspect.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/slo_inspect/slo_inspect.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/timestamp_field_selector.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/timestamp_field_selector.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/timestamp_field_selector.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/timestamp_field_selector.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/use_field_sidebar.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/use_field_sidebar.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/use_field_sidebar.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/use_field_sidebar.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/use_table_docs.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/use_table_docs.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/common/use_table_docs.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/common/use_table_docs.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/advanced_settings/advanced_settings.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/advanced_settings/advanced_settings.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/advanced_settings/advanced_settings.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/advanced_settings/advanced_settings.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/advanced_settings/sync_field_selector.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/advanced_settings/sync_field_selector.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/advanced_settings/sync_field_selector.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/advanced_settings/sync_field_selector.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/apm_availability/apm_availability_indicator_type_form.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/apm_availability/apm_availability_indicator_type_form.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/apm_availability/apm_availability_indicator_type_form.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/apm_availability/apm_availability_indicator_type_form.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/apm_availability/apm_availability_indicator_type_form.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/apm_availability/apm_availability_indicator_type_form.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/apm_availability/apm_availability_indicator_type_form.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/apm_availability/apm_availability_indicator_type_form.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/apm_common/field_selector.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/apm_common/field_selector.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/apm_common/field_selector.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/apm_common/field_selector.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/apm_common/field_selector.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/apm_common/field_selector.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/apm_common/field_selector.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/apm_common/field_selector.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/apm_common/get_group_by_cardinality_filters.test.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/apm_common/get_group_by_cardinality_filters.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/apm_common/get_group_by_cardinality_filters.test.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/apm_common/get_group_by_cardinality_filters.test.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/apm_common/get_group_by_cardinality_filters.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/apm_common/get_group_by_cardinality_filters.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/apm_common/get_group_by_cardinality_filters.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/apm_common/get_group_by_cardinality_filters.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/apm_common/use_apm_default_values.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/apm_common/use_apm_default_values.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/apm_common/use_apm_default_values.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/apm_common/use_apm_default_values.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/apm_latency/apm_latency_indicator_type_form.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/apm_latency/apm_latency_indicator_type_form.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/apm_latency/apm_latency_indicator_type_form.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/apm_latency/apm_latency_indicator_type_form.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/apm_latency/apm_latency_indicator_type_form.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/apm_latency/apm_latency_indicator_type_form.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/apm_latency/apm_latency_indicator_type_form.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/apm_latency/apm_latency_indicator_type_form.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/custom_common/index_and_timestamp_field.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/custom_common/index_and_timestamp_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/custom_common/index_and_timestamp_field.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/custom_common/index_and_timestamp_field.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/custom_common/index_selection.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/custom_common/index_selection.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/custom_common/index_selection.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/custom_common/index_selection.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/custom_common/index_selection.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/custom_common/index_selection.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/custom_common/index_selection.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/custom_common/index_selection.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/custom_common/use_adhoc_data_views.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/custom_common/use_adhoc_data_views.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/custom_common/use_adhoc_data_views.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/custom_common/use_adhoc_data_views.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/custom_kql/custom_kql_indicator_type_form.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/custom_kql/custom_kql_indicator_type_form.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/custom_kql/custom_kql_indicator_type_form.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/custom_kql/custom_kql_indicator_type_form.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/custom_kql/custom_kql_indicator_type_form.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/custom_kql/custom_kql_indicator_type_form.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/custom_kql/custom_kql_indicator_type_form.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/custom_kql/custom_kql_indicator_type_form.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/custom_metric/custom_metric_type_form.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/custom_metric/custom_metric_type_form.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/custom_metric/custom_metric_type_form.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/custom_metric/custom_metric_type_form.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/custom_metric/custom_metric_type_form.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/custom_metric/custom_metric_type_form.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/custom_metric/custom_metric_type_form.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/custom_metric/custom_metric_type_form.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/custom_metric/metric_indicator.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/custom_metric/metric_indicator.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/custom_metric/metric_indicator.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/custom_metric/metric_indicator.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/histogram/histogram_indicator.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/histogram/histogram_indicator.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/histogram/histogram_indicator.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/histogram/histogram_indicator.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/histogram/histogram_indicator_type_form.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/histogram/histogram_indicator_type_form.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/histogram/histogram_indicator_type_form.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/histogram/histogram_indicator_type_form.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/synthetics_availability/synthetics_availability_indicator_type_form.test.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/synthetics_availability/synthetics_availability_indicator_type_form.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/synthetics_availability/synthetics_availability_indicator_type_form.test.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/synthetics_availability/synthetics_availability_indicator_type_form.test.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/synthetics_availability/synthetics_availability_indicator_type_form.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/synthetics_availability/synthetics_availability_indicator_type_form.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/synthetics_availability/synthetics_availability_indicator_type_form.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/synthetics_availability/synthetics_availability_indicator_type_form.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/synthetics_common/field_selector.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/synthetics_common/field_selector.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/synthetics_common/field_selector.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/synthetics_common/field_selector.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/timeslice_metric/metric_indicator.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/timeslice_metric/metric_indicator.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/timeslice_metric/metric_indicator.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/timeslice_metric/metric_indicator.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/timeslice_metric/metric_input.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/timeslice_metric/metric_input.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/timeslice_metric/metric_input.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/timeslice_metric/metric_input.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/timeslice_metric/timeslice_metric_indicator.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/timeslice_metric/timeslice_metric_indicator.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/indicator_section/timeslice_metric/timeslice_metric_indicator.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/indicator_section/timeslice_metric/timeslice_metric_indicator.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/slo_edit_form.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/slo_edit_form.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/slo_edit_form.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/slo_edit_form.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/slo_edit_form_description_section.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form_description_section.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/slo_edit_form_description_section.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form_description_section.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/slo_edit_form_description_section.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form_description_section.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/slo_edit_form_description_section.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form_description_section.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/slo_edit_form_footer.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form_footer.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/slo_edit_form_footer.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form_footer.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/slo_edit_form_indicator_section.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form_indicator_section.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/slo_edit_form_indicator_section.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form_indicator_section.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/slo_edit_form_objective_section.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form_objective_section.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/slo_edit_form_objective_section.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form_objective_section.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/slo_edit_form_objective_section.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form_objective_section.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/slo_edit_form_objective_section.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form_objective_section.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/slo_edit_form_objective_section_timeslices.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form_objective_section_timeslices.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/slo_edit_form_objective_section_timeslices.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form_objective_section_timeslices.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/slo_edit_form_objective_section_timeslices.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form_objective_section_timeslices.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/components/slo_edit_form_objective_section_timeslices.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/components/slo_edit_form_objective_section_timeslices.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/constants.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/constants.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/constants.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/helpers/__snapshots__/process_slo_form_values.test.ts.snap b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/helpers/__snapshots__/process_slo_form_values.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/helpers/__snapshots__/process_slo_form_values.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/helpers/__snapshots__/process_slo_form_values.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/helpers/aggregation_options.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/helpers/aggregation_options.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/helpers/aggregation_options.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/helpers/aggregation_options.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/helpers/create_burn_rate_rule_request_body.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/helpers/create_burn_rate_rule_request_body.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/helpers/create_burn_rate_rule_request_body.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/helpers/create_burn_rate_rule_request_body.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/helpers/create_options.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/helpers/create_options.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/helpers/create_options.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/helpers/create_options.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/helpers/format_filters.test.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/helpers/format_filters.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/helpers/format_filters.test.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/helpers/format_filters.test.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/helpers/format_filters.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/helpers/format_filters.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/helpers/format_filters.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/helpers/format_filters.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/helpers/process_slo_form_values.test.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/helpers/process_slo_form_values.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/helpers/process_slo_form_values.test.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/helpers/process_slo_form_values.test.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/helpers/process_slo_form_values.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/helpers/process_slo_form_values.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/helpers/process_slo_form_values.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/helpers/process_slo_form_values.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/hooks/use_add_rule_flyout_state.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/hooks/use_add_rule_flyout_state.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/hooks/use_add_rule_flyout_state.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/hooks/use_add_rule_flyout_state.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/hooks/use_fetch_suggestions.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/hooks/use_fetch_suggestions.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/hooks/use_fetch_suggestions.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/hooks/use_fetch_suggestions.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/hooks/use_find_runtime_usage.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/hooks/use_find_runtime_usage.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/hooks/use_find_runtime_usage.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/hooks/use_find_runtime_usage.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/hooks/use_parse_url_state.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/hooks/use_parse_url_state.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/hooks/use_parse_url_state.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/hooks/use_parse_url_state.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/hooks/use_preview.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/hooks/use_preview.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/hooks/use_preview.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/hooks/use_preview.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/hooks/use_section_form_validation.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/hooks/use_section_form_validation.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/hooks/use_section_form_validation.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/hooks/use_section_form_validation.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/hooks/use_show_sections.test.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/hooks/use_show_sections.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/hooks/use_show_sections.test.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/hooks/use_show_sections.test.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/hooks/use_show_sections.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/hooks/use_show_sections.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/hooks/use_show_sections.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/hooks/use_show_sections.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/hooks/use_unregister_fields.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/hooks/use_unregister_fields.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/hooks/use_unregister_fields.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/hooks/use_unregister_fields.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/shared_flyout/slo_add_form_flyout.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/shared_flyout/slo_add_form_flyout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/shared_flyout/slo_add_form_flyout.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/shared_flyout/slo_add_form_flyout.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/slo_edit.test.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/slo_edit.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/slo_edit.test.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/slo_edit.test.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/slo_edit.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/slo_edit.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/slo_edit.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/slo_edit.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_edit/types.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_edit/types.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_edit/types.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_outdated_definitions/index.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_outdated_definitions/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_outdated_definitions/index.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_outdated_definitions/index.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_outdated_definitions/outdated_slo.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_outdated_definitions/outdated_slo.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_outdated_definitions/outdated_slo.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_outdated_definitions/outdated_slo.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_outdated_definitions/outdated_slo_search_bar.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_outdated_definitions/outdated_slo_search_bar.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_outdated_definitions/outdated_slo_search_bar.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_outdated_definitions/outdated_slo_search_bar.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_settings/hooks/use_get_settings.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slo_settings/hooks/use_get_settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_settings/hooks/use_get_settings.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_settings/hooks/use_get_settings.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_settings/hooks/use_put_slo_settings.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_settings/hooks/use_put_slo_settings.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_settings/hooks/use_put_slo_settings.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_settings/hooks/use_put_slo_settings.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_settings/settings_form.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_settings/settings_form.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_settings/settings_form.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_settings/settings_form.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slo_settings/slo_settings.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slo_settings/slo_settings.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slo_settings/slo_settings.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slo_settings/slo_settings.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/badges/slo_badges.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/badges/slo_badges.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/badges/slo_badges.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/badges/slo_badges.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/badges/slo_badges.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/badges/slo_badges.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/badges/slo_badges.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/badges/slo_badges.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/badges/slo_indicator_type_badge.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/badges/slo_indicator_type_badge.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/badges/slo_indicator_type_badge.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/badges/slo_indicator_type_badge.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/badges/slo_indicator_type_badge.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/badges/slo_indicator_type_badge.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/badges/slo_indicator_type_badge.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/badges/slo_indicator_type_badge.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/badges/slo_remote_badge.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/badges/slo_remote_badge.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/badges/slo_remote_badge.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/badges/slo_remote_badge.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/badges/slo_rules_badge.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/badges/slo_rules_badge.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/badges/slo_rules_badge.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/badges/slo_rules_badge.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/badges/slo_rules_badge.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/badges/slo_rules_badge.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/badges/slo_rules_badge.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/badges/slo_rules_badge.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/badges/slo_time_window_badge.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/badges/slo_time_window_badge.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/badges/slo_time_window_badge.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/badges/slo_time_window_badge.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/badges/slo_time_window_badge.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/badges/slo_time_window_badge.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/badges/slo_time_window_badge.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/badges/slo_time_window_badge.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/card_view/slo_card_item.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/card_view/slo_card_item.tsx similarity index 96% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/card_view/slo_card_item.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/card_view/slo_card_item.tsx index 7800337be79ae..7d36a615638f8 100644 --- a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/card_view/slo_card_item.tsx +++ b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/card_view/slo_card_item.tsx @@ -6,7 +6,7 @@ */ import { Chart, isMetricElementEvent, Metric, MetricTrendShape, Settings } from '@elastic/charts'; -import { EuiIcon, EuiPanel, useEuiBackgroundColor } from '@elastic/eui'; +import { EuiIcon, EuiPanel, useEuiTheme } from '@elastic/eui'; import { css } from '@emotion/react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -20,9 +20,9 @@ import moment from 'moment'; import React, { useState } from 'react'; import { SloDeleteModal } from '../../../../components/slo/delete_confirmation_modal/slo_delete_confirmation_modal'; import { SloResetConfirmationModal } from '../../../../components/slo/reset_confirmation_modal/slo_reset_confirmation_modal'; +import { useKibana } from '../../../../hooks/use_kibana'; import { useResetSlo } from '../../../../hooks/use_reset_slo'; import { BurnRateRuleParams } from '../../../../typings'; -import { useKibana } from '../../../../hooks/use_kibana'; import { formatHistoricalData } from '../../../../utils/slo/chart_data_formatter'; import { useSloListActions } from '../../hooks/use_slo_list_actions'; import { useSloFormattedSummary } from '../../hooks/use_slo_summary'; @@ -44,11 +44,12 @@ export interface Props { } export const useSloCardColor = (status?: SLOWithSummaryResponse['summary']['status']) => { + const { euiTheme } = useEuiTheme(); const colors = { - DEGRADING: useEuiBackgroundColor('warning'), - VIOLATED: useEuiBackgroundColor('danger'), - HEALTHY: useEuiBackgroundColor('success'), - NO_DATA: useEuiBackgroundColor('subdued'), + DEGRADING: euiTheme.colors.backgroundBaseWarning, + VIOLATED: euiTheme.colors.backgroundBaseDanger, + HEALTHY: euiTheme.colors.backgroundBaseSuccess, + NO_DATA: euiTheme.colors.backgroundBaseSubdued, }; return { cardColor: colors[status ?? 'NO_DATA'], colors }; diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/card_view/slo_card_item_actions.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/card_view/slo_card_item_actions.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/card_view/slo_card_item_actions.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/card_view/slo_card_item_actions.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/card_view/slo_card_item_badges.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/card_view/slo_card_item_badges.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/card_view/slo_card_item_badges.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/card_view/slo_card_item_badges.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/card_view/slo_card_item_instance_badge.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/card_view/slo_card_item_instance_badge.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/card_view/slo_card_item_instance_badge.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/card_view/slo_card_item_instance_badge.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/card_view/slos_card_view.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/card_view/slos_card_view.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/card_view/slos_card_view.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/card_view/slos_card_view.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/burn_rate_rule_flyout.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/common/burn_rate_rule_flyout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/burn_rate_rule_flyout.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/common/burn_rate_rule_flyout.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/create_slo_btn.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/common/create_slo_btn.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/create_slo_btn.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/common/create_slo_btn.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/edit_burn_rate_rule_flyout.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/common/edit_burn_rate_rule_flyout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/edit_burn_rate_rule_flyout.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/common/edit_burn_rate_rule_flyout.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/feedback_button.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/common/feedback_button.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/feedback_button.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/common/feedback_button.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/quick_filters.test.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/common/quick_filters.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/quick_filters.test.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/common/quick_filters.test.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/quick_filters.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/common/quick_filters.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/quick_filters.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/common/quick_filters.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/slo_groupings.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/common/slo_groupings.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/slo_groupings.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/common/slo_groupings.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/slo_tags_list.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/common/slo_tags_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/slo_tags_list.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/common/slo_tags_list.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/sort_by_select.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/common/sort_by_select.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/common/sort_by_select.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/common/sort_by_select.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/compact_view/slo_list_compact_view.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/compact_view/slo_list_compact_view.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/compact_view/slo_list_compact_view.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/compact_view/slo_list_compact_view.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/grouped_slos/group_list_empty.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/grouped_slos/group_list_empty.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/grouped_slos/group_list_empty.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/grouped_slos/group_list_empty.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/grouped_slos/group_list_error.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/grouped_slos/group_list_error.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/grouped_slos/group_list_error.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/grouped_slos/group_list_error.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/grouped_slos/group_list_view.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/grouped_slos/group_list_view.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/grouped_slos/group_list_view.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/grouped_slos/group_list_view.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/grouped_slos/group_view.test.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/grouped_slos/group_view.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/grouped_slos/group_view.test.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/grouped_slos/group_view.test.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/grouped_slos/group_view.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/grouped_slos/group_view.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/grouped_slos/group_view.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/grouped_slos/group_view.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/grouped_slos/hooks/use_group_name.test.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/grouped_slos/hooks/use_group_name.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/grouped_slos/hooks/use_group_name.test.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/grouped_slos/hooks/use_group_name.test.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/grouped_slos/hooks/use_group_name.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/grouped_slos/hooks/use_group_name.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/grouped_slos/hooks/use_group_name.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/grouped_slos/hooks/use_group_name.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/header_title.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/header_title.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/header_title.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/header_title.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/header_title.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/header_title.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/header_title.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/header_title.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/health_callout/health_callout.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/health_callout/health_callout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/health_callout/health_callout.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/health_callout/health_callout.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_context_menu.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_context_menu.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_context_menu.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_context_menu.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_item_actions.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_item_actions.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_item_actions.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_item_actions.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list_empty.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list_empty.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list_empty.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list_empty.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list_empty.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list_empty.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list_empty.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list_empty.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list_error.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list_error.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list_error.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list_error.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list_error.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list_error.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list_error.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list_error.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list_group_by.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list_group_by.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list_group_by.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list_group_by.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list_search_bar.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list_search_bar.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list_search_bar.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list_search_bar.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list_search_bar.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list_search_bar.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list_search_bar.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list_search_bar.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list_view/slo_list_item.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list_view/slo_list_item.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list_view/slo_list_item.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list_view/slo_list_item.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list_view/slo_list_item.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list_view/slo_list_item.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list_view/slo_list_item.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list_view/slo_list_item.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list_view/slo_list_view.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list_view/slo_list_view.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_list_view/slo_list_view.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_list_view/slo_list_view.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_sparkline.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_sparkline.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_sparkline.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_sparkline.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_sparkline.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_sparkline.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_sparkline.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_sparkline.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_summary.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_summary.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_summary.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_summary.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_summary.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_summary.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slo_summary.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slo_summary.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slos_overview/overview_item.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slos_overview/overview_item.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slos_overview/overview_item.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slos_overview/overview_item.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slos_overview/slo_overview_alerts.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slos_overview/slo_overview_alerts.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slos_overview/slo_overview_alerts.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slos_overview/slo_overview_alerts.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slos_overview/slos_overview.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slos_overview/slos_overview.tsx similarity index 98% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slos_overview/slos_overview.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slos_overview/slos_overview.tsx index 49e9e6e34e0df..3d342090c63fc 100644 --- a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slos_overview/slos_overview.tsx +++ b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slos_overview/slos_overview.tsx @@ -96,7 +96,7 @@ export function SLOsOverview() { tooltip={i18n.translate('xpack.slo.sLOsOverview.euiStat.degradingLabel.tooltip', { defaultMessage: 'Click to filter SLOs by Degrading status.', })} - titleColor={theme.colors.warningText} + titleColor={theme.colors.textWarning} /> <OverviewItem title={data?.stale} diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/slos_view.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slos_view.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/slos_view.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/slos_view.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/toggle_slo_view.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/toggle_slo_view.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/toggle_slo_view.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/toggle_slo_view.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/components/ungrouped_slos/ungrouped_view.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/components/ungrouped_slos/ungrouped_view.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/components/ungrouped_slos/ungrouped_view.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/components/ungrouped_slos/ungrouped_view.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/hooks/use_crud_loading.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slos/hooks/use_crud_loading.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/hooks/use_crud_loading.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/hooks/use_crud_loading.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/hooks/use_fetch_slos_overview.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slos/hooks/use_fetch_slos_overview.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/hooks/use_fetch_slos_overview.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/hooks/use_fetch_slos_overview.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/hooks/use_slo_list_actions.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slos/hooks/use_slo_list_actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/hooks/use_slo_list_actions.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/hooks/use_slo_list_actions.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/hooks/use_slo_summary.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slos/hooks/use_slo_summary.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/hooks/use_slo_summary.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/hooks/use_slo_summary.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/hooks/use_summary_dataview.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slos/hooks/use_summary_dataview.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/hooks/use_summary_dataview.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/hooks/use_summary_dataview.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/hooks/use_url_search_state.ts b/x-pack/solutions/observability/plugins/slo/public/pages/slos/hooks/use_url_search_state.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/hooks/use_url_search_state.ts rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/hooks/use_url_search_state.ts diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/slos.test.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/slos.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/slos.test.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/slos.test.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos/slos.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos/slos.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos/slos.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos/slos.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos_welcome/assets/illustration.svg b/x-pack/solutions/observability/plugins/slo/public/pages/slos_welcome/assets/illustration.svg similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos_welcome/assets/illustration.svg rename to x-pack/solutions/observability/plugins/slo/public/pages/slos_welcome/assets/illustration.svg diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos_welcome/slos_welcome.stories.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos_welcome/slos_welcome.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos_welcome/slos_welcome.stories.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos_welcome/slos_welcome.stories.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos_welcome/slos_welcome.test.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos_welcome/slos_welcome.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos_welcome/slos_welcome.test.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos_welcome/slos_welcome.test.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/pages/slos_welcome/slos_welcome.tsx b/x-pack/solutions/observability/plugins/slo/public/pages/slos_welcome/slos_welcome.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/pages/slos_welcome/slos_welcome.tsx rename to x-pack/solutions/observability/plugins/slo/public/pages/slos_welcome/slos_welcome.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/plugin.mock.tsx b/x-pack/solutions/observability/plugins/slo/public/plugin.mock.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/plugin.mock.tsx rename to x-pack/solutions/observability/plugins/slo/public/plugin.mock.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/plugin.ts b/x-pack/solutions/observability/plugins/slo/public/plugin.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/plugin.ts rename to x-pack/solutions/observability/plugins/slo/public/plugin.ts diff --git a/x-pack/plugins/observability_solution/slo/public/routes/routes.tsx b/x-pack/solutions/observability/plugins/slo/public/routes/routes.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/routes/routes.tsx rename to x-pack/solutions/observability/plugins/slo/public/routes/routes.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/rules/observability_rule_type_registry_mock.ts b/x-pack/solutions/observability/plugins/slo/public/rules/observability_rule_type_registry_mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/rules/observability_rule_type_registry_mock.ts rename to x-pack/solutions/observability/plugins/slo/public/rules/observability_rule_type_registry_mock.ts diff --git a/x-pack/plugins/observability_solution/slo/public/rules/register_burn_rate_rule_type.ts b/x-pack/solutions/observability/plugins/slo/public/rules/register_burn_rate_rule_type.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/rules/register_burn_rate_rule_type.ts rename to x-pack/solutions/observability/plugins/slo/public/rules/register_burn_rate_rule_type.ts diff --git a/x-pack/plugins/observability_solution/slo/public/types.ts b/x-pack/solutions/observability/plugins/slo/public/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/types.ts rename to x-pack/solutions/observability/plugins/slo/public/types.ts diff --git a/x-pack/plugins/observability_solution/slo/public/typings/index.ts b/x-pack/solutions/observability/plugins/slo/public/typings/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/typings/index.ts rename to x-pack/solutions/observability/plugins/slo/public/typings/index.ts diff --git a/x-pack/plugins/observability_solution/slo/public/typings/slo/index.ts b/x-pack/solutions/observability/plugins/slo/public/typings/slo/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/typings/slo/index.ts rename to x-pack/solutions/observability/plugins/slo/public/typings/slo/index.ts diff --git a/x-pack/plugins/observability_solution/slo/public/ui_actions/create_alerts_panel_action.tsx b/x-pack/solutions/observability/plugins/slo/public/ui_actions/create_alerts_panel_action.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/ui_actions/create_alerts_panel_action.tsx rename to x-pack/solutions/observability/plugins/slo/public/ui_actions/create_alerts_panel_action.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/ui_actions/create_burn_rate_panel_action.tsx b/x-pack/solutions/observability/plugins/slo/public/ui_actions/create_burn_rate_panel_action.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/ui_actions/create_burn_rate_panel_action.tsx rename to x-pack/solutions/observability/plugins/slo/public/ui_actions/create_burn_rate_panel_action.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/ui_actions/create_error_budget_action.tsx b/x-pack/solutions/observability/plugins/slo/public/ui_actions/create_error_budget_action.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/ui_actions/create_error_budget_action.tsx rename to x-pack/solutions/observability/plugins/slo/public/ui_actions/create_error_budget_action.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/ui_actions/create_overview_panel_action.tsx b/x-pack/solutions/observability/plugins/slo/public/ui_actions/create_overview_panel_action.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/ui_actions/create_overview_panel_action.tsx rename to x-pack/solutions/observability/plugins/slo/public/ui_actions/create_overview_panel_action.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/ui_actions/index.ts b/x-pack/solutions/observability/plugins/slo/public/ui_actions/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/ui_actions/index.ts rename to x-pack/solutions/observability/plugins/slo/public/ui_actions/index.ts diff --git a/x-pack/plugins/observability_solution/slo/public/utils/get_lazy_with_context_providers.tsx b/x-pack/solutions/observability/plugins/slo/public/utils/get_lazy_with_context_providers.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/utils/get_lazy_with_context_providers.tsx rename to x-pack/solutions/observability/plugins/slo/public/utils/get_lazy_with_context_providers.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/utils/kibana_react.mock.ts b/x-pack/solutions/observability/plugins/slo/public/utils/kibana_react.mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/utils/kibana_react.mock.ts rename to x-pack/solutions/observability/plugins/slo/public/utils/kibana_react.mock.ts diff --git a/x-pack/plugins/observability_solution/slo/public/utils/kibana_react.storybook_decorator.tsx b/x-pack/solutions/observability/plugins/slo/public/utils/kibana_react.storybook_decorator.tsx similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/utils/kibana_react.storybook_decorator.tsx rename to x-pack/solutions/observability/plugins/slo/public/utils/kibana_react.storybook_decorator.tsx diff --git a/x-pack/plugins/observability_solution/slo/public/utils/slo/chart_data_formatter.ts b/x-pack/solutions/observability/plugins/slo/public/utils/slo/chart_data_formatter.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/utils/slo/chart_data_formatter.ts rename to x-pack/solutions/observability/plugins/slo/public/utils/slo/chart_data_formatter.ts diff --git a/x-pack/plugins/observability_solution/slo/public/utils/slo/convert_sli_apm_params_to_apm_app_deeplink_url.test.ts b/x-pack/solutions/observability/plugins/slo/public/utils/slo/convert_sli_apm_params_to_apm_app_deeplink_url.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/utils/slo/convert_sli_apm_params_to_apm_app_deeplink_url.test.ts rename to x-pack/solutions/observability/plugins/slo/public/utils/slo/convert_sli_apm_params_to_apm_app_deeplink_url.test.ts diff --git a/x-pack/plugins/observability_solution/slo/public/utils/slo/convert_sli_apm_params_to_apm_app_deeplink_url.ts b/x-pack/solutions/observability/plugins/slo/public/utils/slo/convert_sli_apm_params_to_apm_app_deeplink_url.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/utils/slo/convert_sli_apm_params_to_apm_app_deeplink_url.ts rename to x-pack/solutions/observability/plugins/slo/public/utils/slo/convert_sli_apm_params_to_apm_app_deeplink_url.ts diff --git a/x-pack/plugins/observability_solution/slo/public/utils/slo/duration.ts b/x-pack/solutions/observability/plugins/slo/public/utils/slo/duration.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/utils/slo/duration.ts rename to x-pack/solutions/observability/plugins/slo/public/utils/slo/duration.ts diff --git a/x-pack/plugins/observability_solution/slo/public/utils/slo/get_delay_in_seconds_from_slo.ts b/x-pack/solutions/observability/plugins/slo/public/utils/slo/get_delay_in_seconds_from_slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/utils/slo/get_delay_in_seconds_from_slo.ts rename to x-pack/solutions/observability/plugins/slo/public/utils/slo/get_delay_in_seconds_from_slo.ts diff --git a/x-pack/plugins/observability_solution/slo/public/utils/slo/get_discover_link.ts b/x-pack/solutions/observability/plugins/slo/public/utils/slo/get_discover_link.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/utils/slo/get_discover_link.ts rename to x-pack/solutions/observability/plugins/slo/public/utils/slo/get_discover_link.ts diff --git a/x-pack/plugins/observability_solution/slo/public/utils/slo/groupings.ts b/x-pack/solutions/observability/plugins/slo/public/utils/slo/groupings.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/utils/slo/groupings.ts rename to x-pack/solutions/observability/plugins/slo/public/utils/slo/groupings.ts diff --git a/x-pack/plugins/observability_solution/slo/public/utils/slo/indicator.ts b/x-pack/solutions/observability/plugins/slo/public/utils/slo/indicator.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/utils/slo/indicator.ts rename to x-pack/solutions/observability/plugins/slo/public/utils/slo/indicator.ts diff --git a/x-pack/plugins/observability_solution/slo/public/utils/slo/labels.ts b/x-pack/solutions/observability/plugins/slo/public/utils/slo/labels.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/utils/slo/labels.ts rename to x-pack/solutions/observability/plugins/slo/public/utils/slo/labels.ts diff --git a/x-pack/plugins/observability_solution/slo/public/utils/slo/remote_slo_urls.test.ts b/x-pack/solutions/observability/plugins/slo/public/utils/slo/remote_slo_urls.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/utils/slo/remote_slo_urls.test.ts rename to x-pack/solutions/observability/plugins/slo/public/utils/slo/remote_slo_urls.test.ts diff --git a/x-pack/plugins/observability_solution/slo/public/utils/slo/remote_slo_urls.ts b/x-pack/solutions/observability/plugins/slo/public/utils/slo/remote_slo_urls.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/public/utils/slo/remote_slo_urls.ts rename to x-pack/solutions/observability/plugins/slo/public/utils/slo/remote_slo_urls.ts diff --git a/x-pack/plugins/observability_solution/slo/public/utils/test_helper.tsx b/x-pack/solutions/observability/plugins/slo/public/utils/test_helper.tsx similarity index 96% rename from x-pack/plugins/observability_solution/slo/public/utils/test_helper.tsx rename to x-pack/solutions/observability/plugins/slo/public/utils/test_helper.tsx index 44cd0abceded4..723d2fc68bee1 100644 --- a/x-pack/plugins/observability_solution/slo/public/utils/test_helper.tsx +++ b/x-pack/solutions/observability/plugins/slo/public/utils/test_helper.tsx @@ -53,7 +53,7 @@ export const render = (component: React.ReactNode) => { exploratoryView: { createExploratoryViewUrl: jest.fn(), getAppDataView: jest.fn(), - // eslint-disable-next-line @kbn/i18n/strings_should_be_translated_with_i18n + ExploratoryViewEmbeddable: () => <div>Embeddable exploratory view</div>, }, }} diff --git a/x-pack/plugins/observability_solution/slo/scripts/e2e.js b/x-pack/solutions/observability/plugins/slo/scripts/e2e.js similarity index 100% rename from x-pack/plugins/observability_solution/slo/scripts/e2e.js rename to x-pack/solutions/observability/plugins/slo/scripts/e2e.js diff --git a/x-pack/plugins/observability_solution/slo/scripts/storybook.js b/x-pack/solutions/observability/plugins/slo/scripts/storybook.js similarity index 100% rename from x-pack/plugins/observability_solution/slo/scripts/storybook.js rename to x-pack/solutions/observability/plugins/slo/scripts/storybook.js diff --git a/x-pack/plugins/observability_solution/slo/server/assets/component_templates/slo_mappings_template.ts b/x-pack/solutions/observability/plugins/slo/server/assets/component_templates/slo_mappings_template.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/assets/component_templates/slo_mappings_template.ts rename to x-pack/solutions/observability/plugins/slo/server/assets/component_templates/slo_mappings_template.ts diff --git a/x-pack/plugins/observability_solution/slo/server/assets/component_templates/slo_settings_template.ts b/x-pack/solutions/observability/plugins/slo/server/assets/component_templates/slo_settings_template.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/assets/component_templates/slo_settings_template.ts rename to x-pack/solutions/observability/plugins/slo/server/assets/component_templates/slo_settings_template.ts diff --git a/x-pack/plugins/observability_solution/slo/server/assets/component_templates/slo_summary_mappings_template.ts b/x-pack/solutions/observability/plugins/slo/server/assets/component_templates/slo_summary_mappings_template.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/assets/component_templates/slo_summary_mappings_template.ts rename to x-pack/solutions/observability/plugins/slo/server/assets/component_templates/slo_summary_mappings_template.ts diff --git a/x-pack/plugins/observability_solution/slo/server/assets/component_templates/slo_summary_settings_template.ts b/x-pack/solutions/observability/plugins/slo/server/assets/component_templates/slo_summary_settings_template.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/assets/component_templates/slo_summary_settings_template.ts rename to x-pack/solutions/observability/plugins/slo/server/assets/component_templates/slo_summary_settings_template.ts diff --git a/x-pack/plugins/observability_solution/slo/server/assets/index_templates/slo_index_templates.ts b/x-pack/solutions/observability/plugins/slo/server/assets/index_templates/slo_index_templates.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/assets/index_templates/slo_index_templates.ts rename to x-pack/solutions/observability/plugins/slo/server/assets/index_templates/slo_index_templates.ts diff --git a/x-pack/plugins/observability_solution/slo/server/assets/index_templates/slo_summary_index_templates.ts b/x-pack/solutions/observability/plugins/slo/server/assets/index_templates/slo_summary_index_templates.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/assets/index_templates/slo_summary_index_templates.ts rename to x-pack/solutions/observability/plugins/slo/server/assets/index_templates/slo_summary_index_templates.ts diff --git a/x-pack/plugins/observability_solution/slo/server/assets/ingest_templates/slo_pipeline_template.ts b/x-pack/solutions/observability/plugins/slo/server/assets/ingest_templates/slo_pipeline_template.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/assets/ingest_templates/slo_pipeline_template.ts rename to x-pack/solutions/observability/plugins/slo/server/assets/ingest_templates/slo_pipeline_template.ts diff --git a/x-pack/plugins/observability_solution/slo/server/assets/ingest_templates/slo_summary_pipeline_template.ts b/x-pack/solutions/observability/plugins/slo/server/assets/ingest_templates/slo_summary_pipeline_template.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/assets/ingest_templates/slo_summary_pipeline_template.ts rename to x-pack/solutions/observability/plugins/slo/server/assets/ingest_templates/slo_summary_pipeline_template.ts diff --git a/x-pack/plugins/observability_solution/slo/server/assets/transform_templates/slo_transform_template.test.ts b/x-pack/solutions/observability/plugins/slo/server/assets/transform_templates/slo_transform_template.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/assets/transform_templates/slo_transform_template.test.ts rename to x-pack/solutions/observability/plugins/slo/server/assets/transform_templates/slo_transform_template.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/assets/transform_templates/slo_transform_template.ts b/x-pack/solutions/observability/plugins/slo/server/assets/transform_templates/slo_transform_template.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/assets/transform_templates/slo_transform_template.ts rename to x-pack/solutions/observability/plugins/slo/server/assets/transform_templates/slo_transform_template.ts diff --git a/x-pack/plugins/observability_solution/slo/server/client/index.ts b/x-pack/solutions/observability/plugins/slo/server/client/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/client/index.ts rename to x-pack/solutions/observability/plugins/slo/server/client/index.ts diff --git a/x-pack/plugins/observability_solution/slo/server/common/constants.ts b/x-pack/solutions/observability/plugins/slo/server/common/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/common/constants.ts rename to x-pack/solutions/observability/plugins/slo/server/common/constants.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/models/common.ts b/x-pack/solutions/observability/plugins/slo/server/domain/models/common.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/models/common.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/models/common.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/models/error_budget.ts b/x-pack/solutions/observability/plugins/slo/server/domain/models/error_budget.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/models/error_budget.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/models/error_budget.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/models/health.ts b/x-pack/solutions/observability/plugins/slo/server/domain/models/health.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/models/health.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/models/health.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/models/index.ts b/x-pack/solutions/observability/plugins/slo/server/domain/models/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/models/index.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/models/index.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/models/indicators.ts b/x-pack/solutions/observability/plugins/slo/server/domain/models/indicators.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/models/indicators.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/models/indicators.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/models/slo.ts b/x-pack/solutions/observability/plugins/slo/server/domain/models/slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/models/slo.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/models/slo.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/models/time_window.ts b/x-pack/solutions/observability/plugins/slo/server/domain/models/time_window.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/models/time_window.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/models/time_window.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/services/compute_burn_rate.test.ts b/x-pack/solutions/observability/plugins/slo/server/domain/services/compute_burn_rate.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/services/compute_burn_rate.test.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/services/compute_burn_rate.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/services/compute_burn_rate.ts b/x-pack/solutions/observability/plugins/slo/server/domain/services/compute_burn_rate.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/services/compute_burn_rate.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/services/compute_burn_rate.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/services/compute_sli.test.ts b/x-pack/solutions/observability/plugins/slo/server/domain/services/compute_sli.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/services/compute_sli.test.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/services/compute_sli.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/services/compute_sli.ts b/x-pack/solutions/observability/plugins/slo/server/domain/services/compute_sli.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/services/compute_sli.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/services/compute_sli.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/services/compute_summary_status.test.ts b/x-pack/solutions/observability/plugins/slo/server/domain/services/compute_summary_status.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/services/compute_summary_status.test.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/services/compute_summary_status.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/services/compute_summary_status.ts b/x-pack/solutions/observability/plugins/slo/server/domain/services/compute_summary_status.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/services/compute_summary_status.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/services/compute_summary_status.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/services/date_range.test.ts b/x-pack/solutions/observability/plugins/slo/server/domain/services/date_range.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/services/date_range.test.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/services/date_range.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/services/date_range.ts b/x-pack/solutions/observability/plugins/slo/server/domain/services/date_range.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/services/date_range.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/services/date_range.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/services/error_budget.ts b/x-pack/solutions/observability/plugins/slo/server/domain/services/error_budget.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/services/error_budget.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/services/error_budget.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/services/get_delay_in_seconds_from_slo.ts b/x-pack/solutions/observability/plugins/slo/server/domain/services/get_delay_in_seconds_from_slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/services/get_delay_in_seconds_from_slo.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/services/get_delay_in_seconds_from_slo.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/services/get_lookback_date_range.ts b/x-pack/solutions/observability/plugins/slo/server/domain/services/get_lookback_date_range.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/services/get_lookback_date_range.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/services/get_lookback_date_range.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/services/index.ts b/x-pack/solutions/observability/plugins/slo/server/domain/services/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/services/index.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/services/index.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/services/validate_slo.test.ts b/x-pack/solutions/observability/plugins/slo/server/domain/services/validate_slo.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/services/validate_slo.test.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/services/validate_slo.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/domain/services/validate_slo.ts b/x-pack/solutions/observability/plugins/slo/server/domain/services/validate_slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/domain/services/validate_slo.ts rename to x-pack/solutions/observability/plugins/slo/server/domain/services/validate_slo.ts diff --git a/x-pack/plugins/observability_solution/slo/server/errors/errors.ts b/x-pack/solutions/observability/plugins/slo/server/errors/errors.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/errors/errors.ts rename to x-pack/solutions/observability/plugins/slo/server/errors/errors.ts diff --git a/x-pack/plugins/observability_solution/slo/server/errors/handler.ts b/x-pack/solutions/observability/plugins/slo/server/errors/handler.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/errors/handler.ts rename to x-pack/solutions/observability/plugins/slo/server/errors/handler.ts diff --git a/x-pack/plugins/observability_solution/slo/server/errors/index.ts b/x-pack/solutions/observability/plugins/slo/server/errors/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/errors/index.ts rename to x-pack/solutions/observability/plugins/slo/server/errors/index.ts diff --git a/x-pack/plugins/observability_solution/slo/server/index.ts b/x-pack/solutions/observability/plugins/slo/server/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/index.ts rename to x-pack/solutions/observability/plugins/slo/server/index.ts diff --git a/x-pack/plugins/observability_solution/slo/server/lib/collectors/fetcher.test.ts b/x-pack/solutions/observability/plugins/slo/server/lib/collectors/fetcher.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/collectors/fetcher.test.ts rename to x-pack/solutions/observability/plugins/slo/server/lib/collectors/fetcher.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/lib/collectors/fetcher.ts b/x-pack/solutions/observability/plugins/slo/server/lib/collectors/fetcher.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/collectors/fetcher.ts rename to x-pack/solutions/observability/plugins/slo/server/lib/collectors/fetcher.ts diff --git a/x-pack/plugins/observability_solution/slo/server/lib/collectors/register.ts b/x-pack/solutions/observability/plugins/slo/server/lib/collectors/register.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/collectors/register.ts rename to x-pack/solutions/observability/plugins/slo/server/lib/collectors/register.ts diff --git a/x-pack/plugins/observability_solution/slo/server/lib/collectors/type.ts b/x-pack/solutions/observability/plugins/slo/server/lib/collectors/type.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/collectors/type.ts rename to x-pack/solutions/observability/plugins/slo/server/lib/collectors/type.ts diff --git a/x-pack/plugins/observability_solution/slo/server/lib/rules/register_burn_rate_rule.ts b/x-pack/solutions/observability/plugins/slo/server/lib/rules/register_burn_rate_rule.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/rules/register_burn_rate_rule.ts rename to x-pack/solutions/observability/plugins/slo/server/lib/rules/register_burn_rate_rule.ts diff --git a/x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/docs/params_property_slo_burn_rate.yaml b/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/docs/params_property_slo_burn_rate.yaml similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/docs/params_property_slo_burn_rate.yaml rename to x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/docs/params_property_slo_burn_rate.yaml diff --git a/x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/executor.test.ts b/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/executor.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/executor.test.ts rename to x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/executor.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/executor.ts b/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/executor.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/executor.ts rename to x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/executor.ts diff --git a/x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/field_map.ts b/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/field_map.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/field_map.ts rename to x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/field_map.ts diff --git a/x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/fixtures/rule.ts b/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/fixtures/rule.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/fixtures/rule.ts rename to x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/fixtures/rule.ts diff --git a/x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/index.ts b/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/index.ts rename to x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/index.ts diff --git a/x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/lib/__snapshots__/build_query.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/lib/__snapshots__/build_query.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/lib/__snapshots__/build_query.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/lib/__snapshots__/build_query.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/lib/build_query.test.ts b/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/lib/build_query.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/lib/build_query.test.ts rename to x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/lib/build_query.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/lib/build_query.ts b/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/lib/build_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/lib/build_query.ts rename to x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/lib/build_query.ts diff --git a/x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/lib/evaluate.ts b/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/lib/evaluate.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/lib/evaluate.ts rename to x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/lib/evaluate.ts diff --git a/x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/lib/evaluate_dependencies.ts b/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/lib/evaluate_dependencies.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/lib/evaluate_dependencies.ts rename to x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/lib/evaluate_dependencies.ts diff --git a/x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/lib/should_suppress_instance_id.test.ts b/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/lib/should_suppress_instance_id.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/lib/should_suppress_instance_id.test.ts rename to x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/lib/should_suppress_instance_id.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/lib/should_suppress_instance_id.ts b/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/lib/should_suppress_instance_id.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/lib/should_suppress_instance_id.ts rename to x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/lib/should_suppress_instance_id.ts diff --git a/x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/lib/summary_repository.ts b/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/lib/summary_repository.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/lib/summary_repository.ts rename to x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/lib/summary_repository.ts diff --git a/x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/register.ts b/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/register.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/register.ts rename to x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/register.ts diff --git a/x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/types.ts b/x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/lib/rules/slo_burn_rate/types.ts rename to x-pack/solutions/observability/plugins/slo/server/lib/rules/slo_burn_rate/types.ts diff --git a/x-pack/plugins/observability_solution/slo/server/plugin.ts b/x-pack/solutions/observability/plugins/slo/server/plugin.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/plugin.ts rename to x-pack/solutions/observability/plugins/slo/server/plugin.ts diff --git a/x-pack/plugins/observability_solution/slo/server/routes/create_slo_server_route.ts b/x-pack/solutions/observability/plugins/slo/server/routes/create_slo_server_route.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/routes/create_slo_server_route.ts rename to x-pack/solutions/observability/plugins/slo/server/routes/create_slo_server_route.ts diff --git a/x-pack/plugins/observability_solution/slo/server/routes/get_slo_server_route_repository.ts b/x-pack/solutions/observability/plugins/slo/server/routes/get_slo_server_route_repository.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/routes/get_slo_server_route_repository.ts rename to x-pack/solutions/observability/plugins/slo/server/routes/get_slo_server_route_repository.ts diff --git a/x-pack/plugins/observability_solution/slo/server/routes/register_routes.ts b/x-pack/solutions/observability/plugins/slo/server/routes/register_routes.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/routes/register_routes.ts rename to x-pack/solutions/observability/plugins/slo/server/routes/register_routes.ts diff --git a/x-pack/plugins/observability_solution/slo/server/routes/slo/route.ts b/x-pack/solutions/observability/plugins/slo/server/routes/slo/route.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/routes/slo/route.ts rename to x-pack/solutions/observability/plugins/slo/server/routes/slo/route.ts diff --git a/x-pack/plugins/observability_solution/slo/server/routes/types.ts b/x-pack/solutions/observability/plugins/slo/server/routes/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/routes/types.ts rename to x-pack/solutions/observability/plugins/slo/server/routes/types.ts diff --git a/x-pack/plugins/observability_solution/slo/server/saved_objects/index.ts b/x-pack/solutions/observability/plugins/slo/server/saved_objects/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/saved_objects/index.ts rename to x-pack/solutions/observability/plugins/slo/server/saved_objects/index.ts diff --git a/x-pack/plugins/observability_solution/slo/server/saved_objects/slo.ts b/x-pack/solutions/observability/plugins/slo/server/saved_objects/slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/saved_objects/slo.ts rename to x-pack/solutions/observability/plugins/slo/server/saved_objects/slo.ts diff --git a/x-pack/plugins/observability_solution/slo/server/saved_objects/slo_settings.ts b/x-pack/solutions/observability/plugins/slo/server/saved_objects/slo_settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/saved_objects/slo_settings.ts rename to x-pack/solutions/observability/plugins/slo/server/saved_objects/slo_settings.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/__snapshots__/create_slo.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/__snapshots__/create_slo.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/__snapshots__/create_slo.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/__snapshots__/create_slo.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/__snapshots__/delete_slo.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/__snapshots__/delete_slo.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/__snapshots__/delete_slo.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/__snapshots__/delete_slo.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/__snapshots__/historical_summary_client.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/__snapshots__/historical_summary_client.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/__snapshots__/historical_summary_client.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/__snapshots__/historical_summary_client.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/__snapshots__/manage_slo.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/__snapshots__/manage_slo.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/__snapshots__/manage_slo.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/__snapshots__/manage_slo.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/__snapshots__/reset_slo.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/__snapshots__/reset_slo.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/__snapshots__/reset_slo.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/__snapshots__/reset_slo.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/__snapshots__/slo_definition_client.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/__snapshots__/slo_definition_client.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/__snapshots__/slo_definition_client.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/__snapshots__/slo_definition_client.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/__snapshots__/summary_client.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/__snapshots__/summary_client.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/__snapshots__/summary_client.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/__snapshots__/summary_client.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/__snapshots__/summary_search_client.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/__snapshots__/summary_search_client.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/__snapshots__/summary_search_client.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/__snapshots__/summary_search_client.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/aggregations/__snapshots__/get_custom_metric_indicator_aggregation.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/aggregations/__snapshots__/get_custom_metric_indicator_aggregation.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/aggregations/__snapshots__/get_custom_metric_indicator_aggregation.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/aggregations/__snapshots__/get_custom_metric_indicator_aggregation.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/aggregations/__snapshots__/get_histogram_indicator_aggregation.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/aggregations/__snapshots__/get_histogram_indicator_aggregation.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/aggregations/__snapshots__/get_histogram_indicator_aggregation.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/aggregations/__snapshots__/get_histogram_indicator_aggregation.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/aggregations/__snapshots__/get_timeslice_metric_indicator_aggregation.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/aggregations/__snapshots__/get_timeslice_metric_indicator_aggregation.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/aggregations/__snapshots__/get_timeslice_metric_indicator_aggregation.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/aggregations/__snapshots__/get_timeslice_metric_indicator_aggregation.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/aggregations/get_custom_metric_indicator_aggregation.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/aggregations/get_custom_metric_indicator_aggregation.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/aggregations/get_custom_metric_indicator_aggregation.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/aggregations/get_custom_metric_indicator_aggregation.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/aggregations/get_custom_metric_indicator_aggregation.ts b/x-pack/solutions/observability/plugins/slo/server/services/aggregations/get_custom_metric_indicator_aggregation.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/aggregations/get_custom_metric_indicator_aggregation.ts rename to x-pack/solutions/observability/plugins/slo/server/services/aggregations/get_custom_metric_indicator_aggregation.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/aggregations/get_histogram_indicator_aggregation.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/aggregations/get_histogram_indicator_aggregation.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/aggregations/get_histogram_indicator_aggregation.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/aggregations/get_histogram_indicator_aggregation.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/aggregations/get_histogram_indicator_aggregation.ts b/x-pack/solutions/observability/plugins/slo/server/services/aggregations/get_histogram_indicator_aggregation.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/aggregations/get_histogram_indicator_aggregation.ts rename to x-pack/solutions/observability/plugins/slo/server/services/aggregations/get_histogram_indicator_aggregation.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/aggregations/get_timeslice_metric_indicator_aggregation.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/aggregations/get_timeslice_metric_indicator_aggregation.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/aggregations/get_timeslice_metric_indicator_aggregation.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/aggregations/get_timeslice_metric_indicator_aggregation.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/aggregations/get_timeslice_metric_indicator_aggregation.ts b/x-pack/solutions/observability/plugins/slo/server/services/aggregations/get_timeslice_metric_indicator_aggregation.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/aggregations/get_timeslice_metric_indicator_aggregation.ts rename to x-pack/solutions/observability/plugins/slo/server/services/aggregations/get_timeslice_metric_indicator_aggregation.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/aggregations/index.ts b/x-pack/solutions/observability/plugins/slo/server/services/aggregations/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/aggregations/index.ts rename to x-pack/solutions/observability/plugins/slo/server/services/aggregations/index.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/burn_rates_client.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/burn_rates_client.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/burn_rates_client.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/burn_rates_client.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/burn_rates_client.ts b/x-pack/solutions/observability/plugins/slo/server/services/burn_rates_client.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/burn_rates_client.ts rename to x-pack/solutions/observability/plugins/slo/server/services/burn_rates_client.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/create_slo.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/create_slo.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/create_slo.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/create_slo.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/create_slo.ts b/x-pack/solutions/observability/plugins/slo/server/services/create_slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/create_slo.ts rename to x-pack/solutions/observability/plugins/slo/server/services/create_slo.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/delete_slo.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/delete_slo.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/delete_slo.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/delete_slo.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/delete_slo.ts b/x-pack/solutions/observability/plugins/slo/server/services/delete_slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/delete_slo.ts rename to x-pack/solutions/observability/plugins/slo/server/services/delete_slo.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/delete_slo_instances.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/delete_slo_instances.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/delete_slo_instances.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/delete_slo_instances.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/delete_slo_instances.ts b/x-pack/solutions/observability/plugins/slo/server/services/delete_slo_instances.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/delete_slo_instances.ts rename to x-pack/solutions/observability/plugins/slo/server/services/delete_slo_instances.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/find_slo.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/find_slo.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/find_slo.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/find_slo.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/find_slo.ts b/x-pack/solutions/observability/plugins/slo/server/services/find_slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/find_slo.ts rename to x-pack/solutions/observability/plugins/slo/server/services/find_slo.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/find_slo_definitions.ts b/x-pack/solutions/observability/plugins/slo/server/services/find_slo_definitions.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/find_slo_definitions.ts rename to x-pack/solutions/observability/plugins/slo/server/services/find_slo_definitions.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/find_slo_groups.ts b/x-pack/solutions/observability/plugins/slo/server/services/find_slo_groups.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/find_slo_groups.ts rename to x-pack/solutions/observability/plugins/slo/server/services/find_slo_groups.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/fixtures/date.ts b/x-pack/solutions/observability/plugins/slo/server/services/fixtures/date.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/fixtures/date.ts rename to x-pack/solutions/observability/plugins/slo/server/services/fixtures/date.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/fixtures/duration.ts b/x-pack/solutions/observability/plugins/slo/server/services/fixtures/duration.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/fixtures/duration.ts rename to x-pack/solutions/observability/plugins/slo/server/services/fixtures/duration.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/fixtures/error_budget.ts b/x-pack/solutions/observability/plugins/slo/server/services/fixtures/error_budget.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/fixtures/error_budget.ts rename to x-pack/solutions/observability/plugins/slo/server/services/fixtures/error_budget.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/fixtures/slo.ts b/x-pack/solutions/observability/plugins/slo/server/services/fixtures/slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/fixtures/slo.ts rename to x-pack/solutions/observability/plugins/slo/server/services/fixtures/slo.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/fixtures/summary_search_document.ts b/x-pack/solutions/observability/plugins/slo/server/services/fixtures/summary_search_document.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/fixtures/summary_search_document.ts rename to x-pack/solutions/observability/plugins/slo/server/services/fixtures/summary_search_document.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/fixtures/time_window.ts b/x-pack/solutions/observability/plugins/slo/server/services/fixtures/time_window.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/fixtures/time_window.ts rename to x-pack/solutions/observability/plugins/slo/server/services/fixtures/time_window.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/get_burn_rates.ts b/x-pack/solutions/observability/plugins/slo/server/services/get_burn_rates.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/get_burn_rates.ts rename to x-pack/solutions/observability/plugins/slo/server/services/get_burn_rates.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/get_diagnosis.ts b/x-pack/solutions/observability/plugins/slo/server/services/get_diagnosis.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/get_diagnosis.ts rename to x-pack/solutions/observability/plugins/slo/server/services/get_diagnosis.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/get_preview_data.ts b/x-pack/solutions/observability/plugins/slo/server/services/get_preview_data.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/get_preview_data.ts rename to x-pack/solutions/observability/plugins/slo/server/services/get_preview_data.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/get_slo.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/get_slo.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/get_slo.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/get_slo.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/get_slo.ts b/x-pack/solutions/observability/plugins/slo/server/services/get_slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/get_slo.ts rename to x-pack/solutions/observability/plugins/slo/server/services/get_slo.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/get_slo_groupings.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/get_slo_groupings.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/get_slo_groupings.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/get_slo_groupings.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/get_slo_groupings.ts b/x-pack/solutions/observability/plugins/slo/server/services/get_slo_groupings.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/get_slo_groupings.ts rename to x-pack/solutions/observability/plugins/slo/server/services/get_slo_groupings.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/get_slo_health.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/get_slo_health.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/get_slo_health.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/get_slo_health.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/get_slo_health.ts b/x-pack/solutions/observability/plugins/slo/server/services/get_slo_health.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/get_slo_health.ts rename to x-pack/solutions/observability/plugins/slo/server/services/get_slo_health.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/get_slo_suggestions.ts b/x-pack/solutions/observability/plugins/slo/server/services/get_slo_suggestions.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/get_slo_suggestions.ts rename to x-pack/solutions/observability/plugins/slo/server/services/get_slo_suggestions.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/get_slos_overview.ts b/x-pack/solutions/observability/plugins/slo/server/services/get_slos_overview.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/get_slos_overview.ts rename to x-pack/solutions/observability/plugins/slo/server/services/get_slos_overview.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/historical_summary_client.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/historical_summary_client.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/historical_summary_client.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/historical_summary_client.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/historical_summary_client.ts b/x-pack/solutions/observability/plugins/slo/server/services/historical_summary_client.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/historical_summary_client.ts rename to x-pack/solutions/observability/plugins/slo/server/services/historical_summary_client.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/index.ts b/x-pack/solutions/observability/plugins/slo/server/services/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/index.ts rename to x-pack/solutions/observability/plugins/slo/server/services/index.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/manage_slo.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/manage_slo.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/manage_slo.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/manage_slo.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/manage_slo.ts b/x-pack/solutions/observability/plugins/slo/server/services/manage_slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/manage_slo.ts rename to x-pack/solutions/observability/plugins/slo/server/services/manage_slo.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/mocks/index.ts b/x-pack/solutions/observability/plugins/slo/server/services/mocks/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/mocks/index.ts rename to x-pack/solutions/observability/plugins/slo/server/services/mocks/index.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/reset_slo.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/reset_slo.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/reset_slo.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/reset_slo.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/reset_slo.ts b/x-pack/solutions/observability/plugins/slo/server/services/reset_slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/reset_slo.ts rename to x-pack/solutions/observability/plugins/slo/server/services/reset_slo.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/resource_installer.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/resource_installer.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/resource_installer.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/resource_installer.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/resource_installer.ts b/x-pack/solutions/observability/plugins/slo/server/services/resource_installer.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/resource_installer.ts rename to x-pack/solutions/observability/plugins/slo/server/services/resource_installer.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/slo_definition_client.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/slo_definition_client.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/slo_definition_client.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/slo_definition_client.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/slo_definition_client.ts b/x-pack/solutions/observability/plugins/slo/server/services/slo_definition_client.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/slo_definition_client.ts rename to x-pack/solutions/observability/plugins/slo/server/services/slo_definition_client.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/slo_installer.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/slo_installer.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/slo_installer.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/slo_installer.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/slo_installer.ts b/x-pack/solutions/observability/plugins/slo/server/services/slo_installer.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/slo_installer.ts rename to x-pack/solutions/observability/plugins/slo/server/services/slo_installer.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/slo_repository.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/slo_repository.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/slo_repository.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/slo_repository.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/slo_repository.ts b/x-pack/solutions/observability/plugins/slo/server/services/slo_repository.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/slo_repository.ts rename to x-pack/solutions/observability/plugins/slo/server/services/slo_repository.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/slo_settings.ts b/x-pack/solutions/observability/plugins/slo/server/services/slo_settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/slo_settings.ts rename to x-pack/solutions/observability/plugins/slo/server/services/slo_settings.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/summary_client.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/summary_client.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/summary_client.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/summary_client.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/summary_client.ts b/x-pack/solutions/observability/plugins/slo/server/services/summary_client.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/summary_client.ts rename to x-pack/solutions/observability/plugins/slo/server/services/summary_client.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/summary_search_client.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/summary_search_client.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/summary_search_client.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/summary_search_client.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/summary_search_client.ts b/x-pack/solutions/observability/plugins/slo/server/services/summary_search_client.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/summary_search_client.ts rename to x-pack/solutions/observability/plugins/slo/server/services/summary_search_client.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/__snapshots__/occurrences.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/__snapshots__/occurrences.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/__snapshots__/occurrences.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/__snapshots__/occurrences.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/__snapshots__/timeslices_calendar_aligned.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/__snapshots__/timeslices_calendar_aligned.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/__snapshots__/timeslices_calendar_aligned.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/__snapshots__/timeslices_calendar_aligned.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/__snapshots__/timeslices_rolling.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/__snapshots__/timeslices_rolling.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/__snapshots__/timeslices_rolling.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/__snapshots__/timeslices_rolling.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/common.ts b/x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/common.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/common.ts rename to x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/common.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/occurrences.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/occurrences.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/occurrences.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/occurrences.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/occurrences.ts b/x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/occurrences.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/occurrences.ts rename to x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/occurrences.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/timeslices_calendar_aligned.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/timeslices_calendar_aligned.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/timeslices_calendar_aligned.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/timeslices_calendar_aligned.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/timeslices_calendar_aligned.ts b/x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/timeslices_calendar_aligned.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/timeslices_calendar_aligned.ts rename to x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/timeslices_calendar_aligned.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/timeslices_rolling.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/timeslices_rolling.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/timeslices_rolling.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/timeslices_rolling.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/timeslices_rolling.ts b/x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/timeslices_rolling.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/timeslices_rolling.ts rename to x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/timeslices_rolling.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/utils.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/utils.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/utils.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/utils.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/utils.ts b/x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/generators/utils.ts rename to x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/generators/utils.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/helpers/create_temp_summary.ts b/x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/helpers/create_temp_summary.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/helpers/create_temp_summary.ts rename to x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/helpers/create_temp_summary.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/summary_transform_generator.ts b/x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/summary_transform_generator.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/summary_transform_generator/summary_transform_generator.ts rename to x-pack/solutions/observability/plugins/slo/server/services/summary_transform_generator/summary_transform_generator.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/summay_transform_manager.ts b/x-pack/solutions/observability/plugins/slo/server/services/summay_transform_manager.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/summay_transform_manager.ts rename to x-pack/solutions/observability/plugins/slo/server/services/summay_transform_manager.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/tasks/orphan_summary_cleanup_task.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/tasks/orphan_summary_cleanup_task.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/tasks/orphan_summary_cleanup_task.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/tasks/orphan_summary_cleanup_task.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/tasks/orphan_summary_cleanup_task.ts b/x-pack/solutions/observability/plugins/slo/server/services/tasks/orphan_summary_cleanup_task.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/tasks/orphan_summary_cleanup_task.ts rename to x-pack/solutions/observability/plugins/slo/server/services/tasks/orphan_summary_cleanup_task.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/__snapshots__/apm_transaction_duration.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/__snapshots__/apm_transaction_duration.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/__snapshots__/apm_transaction_duration.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/__snapshots__/apm_transaction_duration.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/__snapshots__/apm_transaction_error_rate.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/__snapshots__/apm_transaction_error_rate.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/__snapshots__/apm_transaction_error_rate.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/__snapshots__/apm_transaction_error_rate.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/__snapshots__/histogram.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/__snapshots__/histogram.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/__snapshots__/histogram.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/__snapshots__/histogram.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/__snapshots__/kql_custom.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/__snapshots__/kql_custom.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/__snapshots__/kql_custom.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/__snapshots__/kql_custom.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/__snapshots__/metric_custom.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/__snapshots__/metric_custom.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/__snapshots__/metric_custom.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/__snapshots__/metric_custom.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/__snapshots__/synthetics_availability.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/__snapshots__/synthetics_availability.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/__snapshots__/synthetics_availability.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/__snapshots__/synthetics_availability.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/__snapshots__/timeslice_metric.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/__snapshots__/timeslice_metric.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/__snapshots__/timeslice_metric.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/__snapshots__/timeslice_metric.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/__snapshots__/transform_generator.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/__snapshots__/transform_generator.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/__snapshots__/transform_generator.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/__snapshots__/transform_generator.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/apm_transaction_duration.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/apm_transaction_duration.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/apm_transaction_duration.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/apm_transaction_duration.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/apm_transaction_duration.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/apm_transaction_duration.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/apm_transaction_duration.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/apm_transaction_duration.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/apm_transaction_error_rate.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/apm_transaction_error_rate.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/apm_transaction_error_rate.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/apm_transaction_error_rate.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/apm_transaction_error_rate.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/apm_transaction_error_rate.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/apm_transaction_error_rate.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/apm_transaction_error_rate.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/common.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/common.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/common.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/common.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/common.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/common.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/common.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/common.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/histogram.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/histogram.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/histogram.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/histogram.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/histogram.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/histogram.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/histogram.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/histogram.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/index.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/index.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/index.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/kql_custom.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/kql_custom.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/kql_custom.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/kql_custom.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/kql_custom.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/kql_custom.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/kql_custom.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/kql_custom.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/metric_custom.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/metric_custom.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/metric_custom.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/metric_custom.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/metric_custom.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/metric_custom.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/metric_custom.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/metric_custom.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/synthetics_availability.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/synthetics_availability.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/synthetics_availability.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/synthetics_availability.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/synthetics_availability.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/synthetics_availability.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/synthetics_availability.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/synthetics_availability.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/timeslice_metric.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/timeslice_metric.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/timeslice_metric.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/timeslice_metric.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/timeslice_metric.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/timeslice_metric.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/timeslice_metric.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/timeslice_metric.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/transform_generator.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/transform_generator.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/transform_generator.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/transform_generator.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/transform_generator.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/transform_generator.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/transform_generator.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/transform_generator.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/transform_generators_factory.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/transform_generators_factory.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/transform_generators_factory.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/transform_generators_factory.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_generators/types.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_generators/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_generators/types.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_generators/types.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_manager.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_manager.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_manager.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_manager.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/transform_manager.ts b/x-pack/solutions/observability/plugins/slo/server/services/transform_manager.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/transform_manager.ts rename to x-pack/solutions/observability/plugins/slo/server/services/transform_manager.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/unsafe_federated/__snapshots__/remote_summary_doc_to_slo.test.ts.snap b/x-pack/solutions/observability/plugins/slo/server/services/unsafe_federated/__snapshots__/remote_summary_doc_to_slo.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/unsafe_federated/__snapshots__/remote_summary_doc_to_slo.test.ts.snap rename to x-pack/solutions/observability/plugins/slo/server/services/unsafe_federated/__snapshots__/remote_summary_doc_to_slo.test.ts.snap diff --git a/x-pack/plugins/observability_solution/slo/server/services/unsafe_federated/remote_summary_doc_to_slo.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/unsafe_federated/remote_summary_doc_to_slo.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/unsafe_federated/remote_summary_doc_to_slo.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/unsafe_federated/remote_summary_doc_to_slo.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/unsafe_federated/remote_summary_doc_to_slo.ts b/x-pack/solutions/observability/plugins/slo/server/services/unsafe_federated/remote_summary_doc_to_slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/unsafe_federated/remote_summary_doc_to_slo.ts rename to x-pack/solutions/observability/plugins/slo/server/services/unsafe_federated/remote_summary_doc_to_slo.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/update_slo.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/update_slo.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/update_slo.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/update_slo.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/update_slo.ts b/x-pack/solutions/observability/plugins/slo/server/services/update_slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/update_slo.ts rename to x-pack/solutions/observability/plugins/slo/server/services/update_slo.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/utils/assert_expected_indicator_source_index_privileges.ts b/x-pack/solutions/observability/plugins/slo/server/services/utils/assert_expected_indicator_source_index_privileges.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/utils/assert_expected_indicator_source_index_privileges.ts rename to x-pack/solutions/observability/plugins/slo/server/services/utils/assert_expected_indicator_source_index_privileges.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/utils/compute_total_slices_from_date_range.ts b/x-pack/solutions/observability/plugins/slo/server/services/utils/compute_total_slices_from_date_range.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/utils/compute_total_slices_from_date_range.ts rename to x-pack/solutions/observability/plugins/slo/server/services/utils/compute_total_slices_from_date_range.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/utils/get_transform_compite_query.ts b/x-pack/solutions/observability/plugins/slo/server/services/utils/get_transform_compite_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/utils/get_transform_compite_query.ts rename to x-pack/solutions/observability/plugins/slo/server/services/utils/get_transform_compite_query.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/utils/index.test.ts b/x-pack/solutions/observability/plugins/slo/server/services/utils/index.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/utils/index.test.ts rename to x-pack/solutions/observability/plugins/slo/server/services/utils/index.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/services/utils/index.ts b/x-pack/solutions/observability/plugins/slo/server/services/utils/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/services/utils/index.ts rename to x-pack/solutions/observability/plugins/slo/server/services/utils/index.ts diff --git a/x-pack/plugins/observability_solution/slo/server/types.ts b/x-pack/solutions/observability/plugins/slo/server/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/types.ts rename to x-pack/solutions/observability/plugins/slo/server/types.ts diff --git a/x-pack/plugins/observability_solution/slo/server/utils/number.ts b/x-pack/solutions/observability/plugins/slo/server/utils/number.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/utils/number.ts rename to x-pack/solutions/observability/plugins/slo/server/utils/number.ts diff --git a/x-pack/plugins/observability_solution/slo/server/utils/queries.test.ts b/x-pack/solutions/observability/plugins/slo/server/utils/queries.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/utils/queries.test.ts rename to x-pack/solutions/observability/plugins/slo/server/utils/queries.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/utils/queries.ts b/x-pack/solutions/observability/plugins/slo/server/utils/queries.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/utils/queries.ts rename to x-pack/solutions/observability/plugins/slo/server/utils/queries.ts diff --git a/x-pack/plugins/observability_solution/slo/server/utils/retry.test.ts b/x-pack/solutions/observability/plugins/slo/server/utils/retry.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/utils/retry.test.ts rename to x-pack/solutions/observability/plugins/slo/server/utils/retry.test.ts diff --git a/x-pack/plugins/observability_solution/slo/server/utils/retry.ts b/x-pack/solutions/observability/plugins/slo/server/utils/retry.ts similarity index 100% rename from x-pack/plugins/observability_solution/slo/server/utils/retry.ts rename to x-pack/solutions/observability/plugins/slo/server/utils/retry.ts diff --git a/x-pack/solutions/observability/plugins/slo/tsconfig.json b/x-pack/solutions/observability/plugins/slo/tsconfig.json new file mode 100644 index 0000000000000..e6cd1c2d890fc --- /dev/null +++ b/x-pack/solutions/observability/plugins/slo/tsconfig.json @@ -0,0 +1,105 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*", + "../../../../typings/**/*", + // Emotion theme typing + "./emotion.d.ts" + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/shared-ux-router", + "@kbn/core", + "@kbn/rule-data-utils", + "@kbn/triggers-actions-ui-plugin", + "@kbn/observability-plugin", + "@kbn/observability-shared-plugin", + "@kbn/kibana-react-plugin", + "@kbn/shared-ux-link-redirect-app", + "@kbn/kibana-utils-plugin", + "@kbn/slo-schema", + "@kbn/alerting-plugin", + "@kbn/rison", + "@kbn/embeddable-plugin", + "@kbn/embeddable-enhanced-plugin", + "@kbn/lens-plugin", + "@kbn/ui-theme", + "@kbn/es-query", + "@kbn/react-kibana-mount", + "@kbn/cases-plugin", + "@kbn/data-plugin", + "@kbn/core-ui-settings-browser", + "@kbn/charts-plugin", + "@kbn/ui-actions-plugin", + "@kbn/serverless", + "@kbn/data-views-plugin", + "@kbn/rule-registry-plugin", + "@kbn/licensing-plugin", + "@kbn/utility-types", + "@kbn/share-plugin", + "@kbn/presentation-util-plugin", + "@kbn/observability-ai-assistant-plugin", + "@kbn/core-http-browser", + "@kbn/core-chrome-browser", + "@kbn/ingest-pipelines-plugin", + "@kbn/unified-search-plugin", + "@kbn/std", + "@kbn/core-lifecycle-browser", + "@kbn/controls-plugin", + "@kbn/cloud-plugin", + "@kbn/spaces-plugin", + "@kbn/data-view-editor-plugin", + "@kbn/shared-ux-page-kibana-template", + "@kbn/config-schema", + "@kbn/usage-collection-plugin", + "@kbn/alerts-as-data-utils", + "@kbn/logging-mocks", + "@kbn/server-route-repository", + "@kbn/features-plugin", + "@kbn/task-manager-plugin", + "@kbn/core-saved-objects-server", + "@kbn/core-elasticsearch-server", + "@kbn/core-saved-objects-api-server", + "@kbn/calculate-auto", + "@kbn/core-elasticsearch-client-server-mocks", + "@kbn/core-saved-objects-api-server-mocks", + "@kbn/es-types", + "@kbn/logging", + "@kbn/unified-data-table", + "@kbn/cell-actions", + "@kbn/discover-utils", + "@kbn/unified-field-list", + "@kbn/data-view-field-editor-plugin", + "@kbn/discover-plugin", + "@kbn/field-formats-plugin", + "@kbn/core-http-server", + "@kbn/aiops-plugin", + "@kbn/presentation-publishing", + "@kbn/aiops-log-rate-analysis", + "@kbn/data-view-field-editor-plugin", + "@kbn/securitysolution-io-ts-utils", + "@kbn/core-elasticsearch-server-mocks", + "@kbn/datemath", + "@kbn/presentation-containers", + "@kbn/dashboard-plugin", + "@kbn/monaco", + "@kbn/code-editor", + "@kbn/react-kibana-context-render", + "@kbn/core-application-browser", + "@kbn/core-theme-browser", + "@kbn/ebt-tools", + "@kbn/observability-alerting-rule-utils", + "@kbn/discover-shared-plugin", + "@kbn/server-route-repository-client", + "@kbn/security-plugin-types-public", + ] +} diff --git a/x-pack/solutions/observability/plugins/synthetics/server/telemetry/sender.ts b/x-pack/solutions/observability/plugins/synthetics/server/telemetry/sender.ts index be60d3ca2a127..60b2fe84a7586 100644 --- a/x-pack/solutions/observability/plugins/synthetics/server/telemetry/sender.ts +++ b/x-pack/solutions/observability/plugins/synthetics/server/telemetry/sender.ts @@ -20,7 +20,7 @@ import { TelemetryQueue } from './queue'; import type { MonitorUpdateTelemetryChannel, MonitorUpdateTelemetryChannelEvents } from './types'; /** - * Simplified version of https://github.com/elastic/kibana/blob/master/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts + * Simplified version of https://github.com/elastic/kibana/blob/master/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/sender.ts * Sends batched events to telemetry v3 api */ export class TelemetryEventsSender { diff --git a/x-pack/solutions/observability/plugins/uptime/kibana.jsonc b/x-pack/solutions/observability/plugins/uptime/kibana.jsonc index c4c8b8b9d76de..25fd311a81f81 100644 --- a/x-pack/solutions/observability/plugins/uptime/kibana.jsonc +++ b/x-pack/solutions/observability/plugins/uptime/kibana.jsonc @@ -38,7 +38,8 @@ "triggersActionsUi", "usageCollection", "unifiedSearch", - "bfetch" + "bfetch", + "charts" ], "optionalPlugins": [ "cloud", @@ -57,4 +58,4 @@ "observability" ] } -} \ No newline at end of file +} diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/app/uptime_app.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/app/uptime_app.tsx index 3ce07ac9803f7..dc775e2295b9a 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/app/uptime_app.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/app/uptime_app.tsx @@ -22,7 +22,6 @@ import { UMUpdateBadge } from '../lib/lib'; import { UptimeRefreshContextProvider, UptimeSettingsContextProvider, - UptimeThemeContextProvider, UptimeStartupPluginsContextProvider, } from '../contexts'; import { CommonlyUsedRange } from '../components/common/uptime_date_picker'; @@ -34,17 +33,6 @@ import { kibanaService } from '../state/kibana_service'; import { ActionMenu } from '../components/common/header/action_menu'; import { UptimeDataViewContextProvider } from '../contexts/uptime_data_view_context'; -export interface UptimeAppColors { - danger: string; - dangerBehindText: string; - success: string; - gray: string; - range: string; - mean: string; - warning: string; - lightestShade: string; -} - export interface UptimeAppProps { basePath: string; canSave: boolean; @@ -131,27 +119,25 @@ const Application = (props: UptimeAppProps) => { <EuiThemeProvider darkMode={darkMode}> <UptimeRefreshContextProvider> <UptimeSettingsContextProvider {...props}> - <UptimeThemeContextProvider darkMode={darkMode}> - <UptimeStartupPluginsContextProvider {...startPlugins}> - <UptimeDataViewContextProvider dataViews={startPlugins.dataViews}> - <PerformanceContextProvider> - <div className={APP_WRAPPER_CLASS} data-test-subj="uptimeApp"> - <RedirectAppLinks - coreStart={{ - application: core.application, - }} - > - <InspectorContextProvider> - <UptimeAlertsFlyoutWrapper /> - <PageRouter /> - <ActionMenu appMountParameters={appMountParameters} /> - </InspectorContextProvider> - </RedirectAppLinks> - </div> - </PerformanceContextProvider> - </UptimeDataViewContextProvider> - </UptimeStartupPluginsContextProvider> - </UptimeThemeContextProvider> + <UptimeStartupPluginsContextProvider {...startPlugins}> + <UptimeDataViewContextProvider dataViews={startPlugins.dataViews}> + <PerformanceContextProvider> + <div className={APP_WRAPPER_CLASS} data-test-subj="uptimeApp"> + <RedirectAppLinks + coreStart={{ + application: core.application, + }} + > + <InspectorContextProvider> + <UptimeAlertsFlyoutWrapper /> + <PageRouter /> + <ActionMenu appMountParameters={appMountParameters} /> + </InspectorContextProvider> + </RedirectAppLinks> + </div> + </PerformanceContextProvider> + </UptimeDataViewContextProvider> + </UptimeStartupPluginsContextProvider> </UptimeSettingsContextProvider> </UptimeRefreshContextProvider> </EuiThemeProvider> diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_monitors.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_monitors.test.tsx.snap index 57a90f0081b56..3a7233b307176 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_monitors.test.tsx.snap +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_monitors.test.tsx.snap @@ -50,39 +50,28 @@ exports[`CertMonitors renders expected elements for valid props 1`] = ` `; exports[`CertMonitors shallow renders expected elements for valid props 1`] = ` -<ContextProvider - value={ +<Router + history={ Object { - "history": Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { + "action": "POP", + "block": [Function], + "canGo": [Function], + "createHref": [Function], + "entries": Array [ + Object { "hash": "", "key": "TestKeyForTesting", "pathname": "/", "search": "", "state": undefined, }, - "push": [Function], - "replace": [Function], - }, + ], + "go": [Function], + "goBack": [Function], + "goForward": [Function], + "index": 0, + "length": 1, + "listen": [Function], "location": Object { "hash": "", "key": "TestKeyForTesting", @@ -90,73 +79,31 @@ exports[`CertMonitors shallow renders expected elements for valid props 1`] = ` "search": "", "state": undefined, }, - "match": Object { - "isExact": true, - "params": Object {}, - "path": "/", - "url": "/", - }, - "staticContext": undefined, + "push": [Function], + "replace": [Function], } } > - <ContextProvider - value={ - Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, + <CertMonitors + monitors={ + Array [ + Object { + "id": "bad-ssl-dashboard", + "name": "", + "url": "https://badssl.com/dashboard/", + }, + Object { + "id": "elastic-co", + "name": "elastic", + "url": "https://www.elastic.co/", + }, + Object { + "id": "extended-validation", + "name": "", + "url": "https://extended-validation.badssl.com/", }, - "push": [Function], - "replace": [Function], - } + ] } - > - <CompatRouter> - <CertMonitors - monitors={ - Array [ - Object { - "id": "bad-ssl-dashboard", - "name": "", - "url": "https://badssl.com/dashboard/", - }, - Object { - "id": "elastic-co", - "name": "elastic", - "url": "https://www.elastic.co/", - }, - Object { - "id": "extended-validation", - "name": "", - "url": "https://extended-validation.badssl.com/", - }, - ] - } - /> - </CompatRouter> - </ContextProvider> -</ContextProvider> + /> +</Router> `; diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_search.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_search.test.tsx.snap index 663ef61fc87db..a08dc4b2286dc 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_search.test.tsx.snap +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_search.test.tsx.snap @@ -41,39 +41,28 @@ exports[`CertificatesSearch renders expected elements for valid props 1`] = ` `; exports[`CertificatesSearch shallow renders expected elements for valid props 1`] = ` -<ContextProvider - value={ +<Router + history={ Object { - "history": Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { + "action": "POP", + "block": [Function], + "canGo": [Function], + "createHref": [Function], + "entries": Array [ + Object { "hash": "", "key": "TestKeyForTesting", "pathname": "/", "search": "", "state": undefined, }, - "push": [Function], - "replace": [Function], - }, + ], + "go": [Function], + "goBack": [Function], + "goForward": [Function], + "index": 0, + "length": 1, + "listen": [Function], "location": Object { "hash": "", "key": "TestKeyForTesting", @@ -81,55 +70,13 @@ exports[`CertificatesSearch shallow renders expected elements for valid props 1` "search": "", "state": undefined, }, - "match": Object { - "isExact": true, - "params": Object {}, - "path": "/", - "url": "/", - }, - "staticContext": undefined, + "push": [Function], + "replace": [Function], } } > - <ContextProvider - value={ - Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - "push": [Function], - "replace": [Function], - } - } - > - <CompatRouter> - <CertificateSearch - setSearch={[MockFunction]} - /> - </CompatRouter> - </ContextProvider> -</ContextProvider> + <CertificateSearch + setSearch={[MockFunction]} + /> +</Router> `; diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_status.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_status.test.tsx.snap index 6849d2066b11d..0a870ef6ea321 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_status.test.tsx.snap +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_status.test.tsx.snap @@ -37,39 +37,28 @@ exports[`CertStatus renders expected elements for valid props 1`] = ` `; exports[`CertStatus shallow renders expected elements for valid props 1`] = ` -<ContextProvider - value={ +<Router + history={ Object { - "history": Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { + "action": "POP", + "block": [Function], + "canGo": [Function], + "createHref": [Function], + "entries": Array [ + Object { "hash": "", "key": "TestKeyForTesting", "pathname": "/", "search": "", "state": undefined, }, - "push": [Function], - "replace": [Function], - }, + ], + "go": [Function], + "goBack": [Function], + "goForward": [Function], + "index": 0, + "length": 1, + "listen": [Function], "location": Object { "hash": "", "key": "TestKeyForTesting", @@ -77,71 +66,29 @@ exports[`CertStatus shallow renders expected elements for valid props 1`] = ` "search": "", "state": undefined, }, - "match": Object { - "isExact": true, - "params": Object {}, - "path": "/", - "url": "/", - }, - "staticContext": undefined, + "push": [Function], + "replace": [Function], } } > - <ContextProvider - value={ + <CertStatus + cert={ Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ + "common_name": "github.com", + "issuer": "DigiCert SHA2 Extended Validation Server CA", + "monitors": Array [ Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, + "id": "github", + "name": "", + "url": "https://github.com/", }, ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - "push": [Function], - "replace": [Function], + "not_after": "2020-05-08T00:00:00.000Z", + "not_before": "2018-05-08T00:00:00.000Z", + "sha1": "ca06f56b258b7a0d4f2b05470939478651151984", + "sha256": "3111500c4a66012cdae333ec3fca1c9dde45c954440e7ee413716bff3663c074", } } - > - <CompatRouter> - <CertStatus - cert={ - Object { - "common_name": "github.com", - "issuer": "DigiCert SHA2 Extended Validation Server CA", - "monitors": Array [ - Object { - "id": "github", - "name": "", - "url": "https://github.com/", - }, - ], - "not_after": "2020-05-08T00:00:00.000Z", - "not_before": "2018-05-08T00:00:00.000Z", - "sha1": "ca06f56b258b7a0d4f2b05470939478651151984", - "sha256": "3111500c4a66012cdae333ec3fca1c9dde45c954440e7ee413716bff3663c074", - } - } - /> - </CompatRouter> - </ContextProvider> -</ContextProvider> + /> +</Router> `; diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/__snapshots__/monitor_tags.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/__snapshots__/monitor_tags.test.tsx.snap index 196f90fb8ecae..0ec6421383602 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/__snapshots__/monitor_tags.test.tsx.snap +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/__snapshots__/monitor_tags.test.tsx.snap @@ -102,39 +102,28 @@ exports[`MonitorTags component it shows expand tag on too many tags 1`] = ` `; exports[`MonitorTags component render against summary 1`] = ` -<ContextProvider - value={ +<Router + history={ Object { - "history": Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { + "action": "POP", + "block": [Function], + "canGo": [Function], + "createHref": [Function], + "entries": Array [ + Object { "hash": "", "key": "TestKeyForTesting", "pathname": "/", "search": "", "state": undefined, }, - "push": [Function], - "replace": [Function], - }, + ], + "go": [Function], + "goBack": [Function], + "goForward": [Function], + "index": 0, + "length": 1, + "listen": [Function], "location": Object { "hash": "", "key": "TestKeyForTesting", @@ -142,205 +131,143 @@ exports[`MonitorTags component render against summary 1`] = ` "search": "", "state": undefined, }, - "match": Object { - "isExact": true, - "params": Object {}, - "path": "/", - "url": "/", - }, - "staticContext": undefined, + "push": [Function], + "replace": [Function], } } > - <ContextProvider - value={ + <MonitorTags + summary={ Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, + "minInterval": 75000, + "monitor_id": "android-homepage", + "state": Object { + "monitor": Object { + "name": "Android Homepage", + "type": "http", }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - "push": [Function], - "replace": [Function], - } - } - > - <CompatRouter> - <MonitorTags - summary={ - Object { - "minInterval": 75000, - "monitor_id": "android-homepage", - "state": Object { + "observer": Object { + "geo": Object { + "name": Array [ + "Europe", + ], + }, + }, + "summary": Object { + "down": 0, + "status": "up", + "up": 1, + }, + "summaryPings": Array [ + Object { + "@timestamp": "2020-12-09T17:08:22.200Z", + "agent": Object { + "ephemeral_id": "a4d0d3eb-d162-4cc7-b14d-eaaad8b3d224", + "id": "1f122196-6a5e-4bd4-8288-ef084e2ec982", + "name": "Elastic-Mac", + "type": "heartbeat", + "version": "8.0.0", + }, + "docId": "jBR5SHYBjTkd_7K7sM41", + "ecs": Object { + "version": "1.6.0", + }, + "event": Object { + "dataset": "uptime", + }, + "http": Object { + "response": Object { + "body": Object { + "bytes": 176335, + "hash": "8367430abf690d75f3c0277b31a16cfcc622e2b315e338f803ae850127d37f48", + }, + "headers": Object { + "Accept-Ranges": "bytes", + "Alt-Svc": "h3-29=\\":443\\"; ma=2592000,h3-T051=\\":443\\"; ma=2592000,h3-Q050=\\":443\\"; ma=2592000,h3-Q046=\\":443\\"; ma=2592000,h3-Q043=\\":443\\"; ma=2592000,quic=\\":443\\"; ma=2592000; v=\\"46,43\\"", + "Cache-Control": "private, max-age=0", + "Content-Length": "176335", + "Content-Type": "text/html", + "Cross-Origin-Resource-Policy": "cross-origin", + "Date": "Wed, 09 Dec 2020 17:08:22 GMT", + "Expires": "Wed, 09 Dec 2020 17:08:22 GMT", + "Last-Modified": "Thu, 03 Dec 2020 21:45:00 GMT", + "Server": "sffe", + "Vary": "Accept-Encoding", + "X-Content-Type-Options": "nosniff", + "X-Xss-Protection": "0", + }, + "status_code": 200, + }, + }, "monitor": Object { + "check_group": "12a21140-3a41-11eb-ae8d-a683e72ee74d", + "duration": Object { + "us": 247752, + }, + "id": "android-homepage", + "ip": "172.217.16.206", "name": "Android Homepage", + "status": "up", + "timespan": Object { + "gte": "2020-12-09T17:08:22.200Z", + "lt": "2020-12-09T17:08:52.200Z", + }, "type": "http", }, "observer": Object { "geo": Object { - "name": Array [ - "Europe", - ], + "location": "51.5074, -0.1278", + "name": "Europe", + }, + }, + "resolve": Object { + "ip": "172.217.16.206", + "rtt": Object { + "us": 7025, }, }, "summary": Object { "down": 0, - "status": "up", "up": 1, }, - "summaryPings": Array [ - Object { - "@timestamp": "2020-12-09T17:08:22.200Z", - "agent": Object { - "ephemeral_id": "a4d0d3eb-d162-4cc7-b14d-eaaad8b3d224", - "id": "1f122196-6a5e-4bd4-8288-ef084e2ec982", - "name": "Elastic-Mac", - "type": "heartbeat", - "version": "8.0.0", - }, - "docId": "jBR5SHYBjTkd_7K7sM41", - "ecs": Object { - "version": "1.6.0", - }, - "event": Object { - "dataset": "uptime", - }, - "http": Object { - "response": Object { - "body": Object { - "bytes": 176335, - "hash": "8367430abf690d75f3c0277b31a16cfcc622e2b315e338f803ae850127d37f48", - }, - "headers": Object { - "Accept-Ranges": "bytes", - "Alt-Svc": "h3-29=\\":443\\"; ma=2592000,h3-T051=\\":443\\"; ma=2592000,h3-Q050=\\":443\\"; ma=2592000,h3-Q046=\\":443\\"; ma=2592000,h3-Q043=\\":443\\"; ma=2592000,quic=\\":443\\"; ma=2592000; v=\\"46,43\\"", - "Cache-Control": "private, max-age=0", - "Content-Length": "176335", - "Content-Type": "text/html", - "Cross-Origin-Resource-Policy": "cross-origin", - "Date": "Wed, 09 Dec 2020 17:08:22 GMT", - "Expires": "Wed, 09 Dec 2020 17:08:22 GMT", - "Last-Modified": "Thu, 03 Dec 2020 21:45:00 GMT", - "Server": "sffe", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "X-Xss-Protection": "0", - }, - "status_code": 200, - }, - }, - "monitor": Object { - "check_group": "12a21140-3a41-11eb-ae8d-a683e72ee74d", - "duration": Object { - "us": 247752, - }, - "id": "android-homepage", - "ip": "172.217.16.206", - "name": "Android Homepage", - "status": "up", - "timespan": Object { - "gte": "2020-12-09T17:08:22.200Z", - "lt": "2020-12-09T17:08:52.200Z", - }, - "type": "http", - }, - "observer": Object { - "geo": Object { - "location": "51.5074, -0.1278", - "name": "Europe", - }, - }, - "resolve": Object { - "ip": "172.217.16.206", - "rtt": Object { - "us": 7025, - }, - }, - "summary": Object { - "down": 0, - "up": 1, - }, - "tags": Array [ - "org:google", - ], - "tcp": Object { - "rtt": Object { - "connect": Object { - "us": 30719, - }, - }, - }, - "timestamp": "2020-12-09T17:08:22.200Z", - "tls": Object { - "certificate_not_valid_after": "2021-01-26T07:38:14.000Z", - "certificate_not_valid_before": "2020-11-03T07:38:14.000Z", - "cipher": "TLS-AES-128-GCM-SHA256", - "established": true, - "server": Object { - "hash": Object { - "sha1": "be647fa3de52eba57c89ac297c05604c4af69372", - "sha256": "19321783f8f923a0220cee1599a58203faf4c401ab5728c730ab05a44d9e7a9c", - }, - "x509": Object { - "issuer": Object { - "common_name": "GTS CA 1O1", - "distinguished_name": "CN=GTS CA 1O1,O=Google Trust Services,C=US", - }, - "not_after": "2021-01-26T07:38:14.000Z", - "not_before": "2020-11-03T07:38:14.000Z", - "public_key_algorithm": "ECDSA", - "public_key_curve": "P-256", - "serial_number": "264575002113234958015854475703440562297", - "signature_algorithm": "SHA256-RSA", - "subject": Object { - "common_name": "www.android.com", - "distinguished_name": "CN=www.android.com,O=Google LLC,L=Mountain View,ST=California,C=US", - }, - }, - }, - }, - "url": Object { - "domain": "www.android.com", - "full": "https://www.android.com", - "port": 443, - "scheme": "https", + "tags": Array [ + "org:google", + ], + "tcp": Object { + "rtt": Object { + "connect": Object { + "us": 30719, }, }, - ], + }, "timestamp": "2020-12-09T17:08:22.200Z", "tls": Object { "certificate_not_valid_after": "2021-01-26T07:38:14.000Z", "certificate_not_valid_before": "2020-11-03T07:38:14.000Z", "cipher": "TLS-AES-128-GCM-SHA256", "established": true, - "rtt": Object { - "handshake": Object { - "us": 39344, + "server": Object { + "hash": Object { + "sha1": "be647fa3de52eba57c89ac297c05604c4af69372", + "sha256": "19321783f8f923a0220cee1599a58203faf4c401ab5728c730ab05a44d9e7a9c", + }, + "x509": Object { + "issuer": Object { + "common_name": "GTS CA 1O1", + "distinguished_name": "CN=GTS CA 1O1,O=Google Trust Services,C=US", + }, + "not_after": "2021-01-26T07:38:14.000Z", + "not_before": "2020-11-03T07:38:14.000Z", + "public_key_algorithm": "ECDSA", + "public_key_curve": "P-256", + "serial_number": "264575002113234958015854475703440562297", + "signature_algorithm": "SHA256-RSA", + "subject": Object { + "common_name": "www.android.com", + "distinguished_name": "CN=www.android.com,O=Google LLC,L=Mountain View,ST=California,C=US", + }, }, }, - "version": "1.3", - "version_protocol": "tls", }, "url": Object { "domain": "www.android.com", @@ -349,48 +276,57 @@ exports[`MonitorTags component render against summary 1`] = ` "scheme": "https", }, }, - } - } - /> - </CompatRouter> - </ContextProvider> -</ContextProvider> + ], + "timestamp": "2020-12-09T17:08:22.200Z", + "tls": Object { + "certificate_not_valid_after": "2021-01-26T07:38:14.000Z", + "certificate_not_valid_before": "2020-11-03T07:38:14.000Z", + "cipher": "TLS-AES-128-GCM-SHA256", + "established": true, + "rtt": Object { + "handshake": Object { + "us": 39344, + }, + }, + "version": "1.3", + "version_protocol": "tls", + }, + "url": Object { + "domain": "www.android.com", + "full": "https://www.android.com", + "port": 443, + "scheme": "https", + }, + }, + } + } + /> +</Router> `; exports[`MonitorTags component renders against ping 1`] = ` -<ContextProvider - value={ +<Router + history={ Object { - "history": Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { + "action": "POP", + "block": [Function], + "canGo": [Function], + "createHref": [Function], + "entries": Array [ + Object { "hash": "", "key": "TestKeyForTesting", "pathname": "/", "search": "", "state": undefined, }, - "push": [Function], - "replace": [Function], - }, + ], + "go": [Function], + "goBack": [Function], + "goForward": [Function], + "index": 0, + "length": 1, + "listen": [Function], "location": Object { "hash": "", "key": "TestKeyForTesting", @@ -398,173 +334,131 @@ exports[`MonitorTags component renders against ping 1`] = ` "search": "", "state": undefined, }, - "match": Object { - "isExact": true, - "params": Object {}, - "path": "/", - "url": "/", - }, - "staticContext": undefined, + "push": [Function], + "replace": [Function], } } > - <ContextProvider - value={ + <MonitorTags + ping={ Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, + "@timestamp": "2020-12-09T17:08:22.200Z", + "agent": Object { + "ephemeral_id": "a4d0d3eb-d162-4cc7-b14d-eaaad8b3d224", + "id": "1f122196-6a5e-4bd4-8288-ef084e2ec982", + "name": "Elastic-Mac", + "type": "heartbeat", + "version": "8.0.0", }, - "push": [Function], - "replace": [Function], - } - } - > - <CompatRouter> - <MonitorTags - ping={ - Object { - "@timestamp": "2020-12-09T17:08:22.200Z", - "agent": Object { - "ephemeral_id": "a4d0d3eb-d162-4cc7-b14d-eaaad8b3d224", - "id": "1f122196-6a5e-4bd4-8288-ef084e2ec982", - "name": "Elastic-Mac", - "type": "heartbeat", - "version": "8.0.0", - }, - "docId": "jBR5SHYBjTkd_7K7sM41", - "ecs": Object { - "version": "1.6.0", - }, - "event": Object { - "dataset": "uptime", - }, - "http": Object { - "response": Object { - "body": Object { - "bytes": 176335, - "hash": "8367430abf690d75f3c0277b31a16cfcc622e2b315e338f803ae850127d37f48", - }, - "headers": Object { - "Accept-Ranges": "bytes", - "Alt-Svc": "h3-29=\\":443\\"; ma=2592000,h3-T051=\\":443\\"; ma=2592000,h3-Q050=\\":443\\"; ma=2592000,h3-Q046=\\":443\\"; ma=2592000,h3-Q043=\\":443\\"; ma=2592000,quic=\\":443\\"; ma=2592000; v=\\"46,43\\"", - "Cache-Control": "private, max-age=0", - "Content-Length": "176335", - "Content-Type": "text/html", - "Cross-Origin-Resource-Policy": "cross-origin", - "Date": "Wed, 09 Dec 2020 17:08:22 GMT", - "Expires": "Wed, 09 Dec 2020 17:08:22 GMT", - "Last-Modified": "Thu, 03 Dec 2020 21:45:00 GMT", - "Server": "sffe", - "Vary": "Accept-Encoding", - "X-Content-Type-Options": "nosniff", - "X-Xss-Protection": "0", - }, - "status_code": 200, - }, - }, - "monitor": Object { - "check_group": "12a21140-3a41-11eb-ae8d-a683e72ee74d", - "duration": Object { - "us": 247752, - }, - "id": "android-homepage", - "ip": "172.217.16.206", - "name": "Android Homepage", - "status": "up", - "timespan": Object { - "gte": "2020-12-09T17:08:22.200Z", - "lt": "2020-12-09T17:08:52.200Z", - }, - "type": "http", + "docId": "jBR5SHYBjTkd_7K7sM41", + "ecs": Object { + "version": "1.6.0", + }, + "event": Object { + "dataset": "uptime", + }, + "http": Object { + "response": Object { + "body": Object { + "bytes": 176335, + "hash": "8367430abf690d75f3c0277b31a16cfcc622e2b315e338f803ae850127d37f48", }, - "observer": Object { - "geo": Object { - "location": "51.5074, -0.1278", - "name": "Europe", - }, + "headers": Object { + "Accept-Ranges": "bytes", + "Alt-Svc": "h3-29=\\":443\\"; ma=2592000,h3-T051=\\":443\\"; ma=2592000,h3-Q050=\\":443\\"; ma=2592000,h3-Q046=\\":443\\"; ma=2592000,h3-Q043=\\":443\\"; ma=2592000,quic=\\":443\\"; ma=2592000; v=\\"46,43\\"", + "Cache-Control": "private, max-age=0", + "Content-Length": "176335", + "Content-Type": "text/html", + "Cross-Origin-Resource-Policy": "cross-origin", + "Date": "Wed, 09 Dec 2020 17:08:22 GMT", + "Expires": "Wed, 09 Dec 2020 17:08:22 GMT", + "Last-Modified": "Thu, 03 Dec 2020 21:45:00 GMT", + "Server": "sffe", + "Vary": "Accept-Encoding", + "X-Content-Type-Options": "nosniff", + "X-Xss-Protection": "0", }, - "resolve": Object { - "ip": "172.217.16.206", - "rtt": Object { - "us": 7025, - }, + "status_code": 200, + }, + }, + "monitor": Object { + "check_group": "12a21140-3a41-11eb-ae8d-a683e72ee74d", + "duration": Object { + "us": 247752, + }, + "id": "android-homepage", + "ip": "172.217.16.206", + "name": "Android Homepage", + "status": "up", + "timespan": Object { + "gte": "2020-12-09T17:08:22.200Z", + "lt": "2020-12-09T17:08:52.200Z", + }, + "type": "http", + }, + "observer": Object { + "geo": Object { + "location": "51.5074, -0.1278", + "name": "Europe", + }, + }, + "resolve": Object { + "ip": "172.217.16.206", + "rtt": Object { + "us": 7025, + }, + }, + "summary": Object { + "down": 0, + "up": 1, + }, + "tags": Array [ + "org:google", + ], + "tcp": Object { + "rtt": Object { + "connect": Object { + "us": 30719, }, - "summary": Object { - "down": 0, - "up": 1, + }, + }, + "timestamp": "2020-12-09T17:08:22.200Z", + "tls": Object { + "certificate_not_valid_after": "2021-01-26T07:38:14.000Z", + "certificate_not_valid_before": "2020-11-03T07:38:14.000Z", + "cipher": "TLS-AES-128-GCM-SHA256", + "established": true, + "server": Object { + "hash": Object { + "sha1": "be647fa3de52eba57c89ac297c05604c4af69372", + "sha256": "19321783f8f923a0220cee1599a58203faf4c401ab5728c730ab05a44d9e7a9c", }, - "tags": Array [ - "org:google", - ], - "tcp": Object { - "rtt": Object { - "connect": Object { - "us": 30719, - }, + "x509": Object { + "issuer": Object { + "common_name": "GTS CA 1O1", + "distinguished_name": "CN=GTS CA 1O1,O=Google Trust Services,C=US", }, - }, - "timestamp": "2020-12-09T17:08:22.200Z", - "tls": Object { - "certificate_not_valid_after": "2021-01-26T07:38:14.000Z", - "certificate_not_valid_before": "2020-11-03T07:38:14.000Z", - "cipher": "TLS-AES-128-GCM-SHA256", - "established": true, - "server": Object { - "hash": Object { - "sha1": "be647fa3de52eba57c89ac297c05604c4af69372", - "sha256": "19321783f8f923a0220cee1599a58203faf4c401ab5728c730ab05a44d9e7a9c", - }, - "x509": Object { - "issuer": Object { - "common_name": "GTS CA 1O1", - "distinguished_name": "CN=GTS CA 1O1,O=Google Trust Services,C=US", - }, - "not_after": "2021-01-26T07:38:14.000Z", - "not_before": "2020-11-03T07:38:14.000Z", - "public_key_algorithm": "ECDSA", - "public_key_curve": "P-256", - "serial_number": "264575002113234958015854475703440562297", - "signature_algorithm": "SHA256-RSA", - "subject": Object { - "common_name": "www.android.com", - "distinguished_name": "CN=www.android.com,O=Google LLC,L=Mountain View,ST=California,C=US", - }, - }, + "not_after": "2021-01-26T07:38:14.000Z", + "not_before": "2020-11-03T07:38:14.000Z", + "public_key_algorithm": "ECDSA", + "public_key_curve": "P-256", + "serial_number": "264575002113234958015854475703440562297", + "signature_algorithm": "SHA256-RSA", + "subject": Object { + "common_name": "www.android.com", + "distinguished_name": "CN=www.android.com,O=Google LLC,L=Mountain View,ST=California,C=US", }, }, - "url": Object { - "domain": "www.android.com", - "full": "https://www.android.com", - "port": 443, - "scheme": "https", - }, - } - } - /> - </CompatRouter> - </ContextProvider> -</ContextProvider> + }, + }, + "url": Object { + "domain": "www.android.com", + "full": "https://www.android.com", + "port": 443, + "scheme": "https", + }, + } + } + /> +</Router> `; diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/donut_chart.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/donut_chart.test.tsx.snap index 15f8ad666dced..a21a15116ccf7 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/donut_chart.test.tsx.snap +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/donut_chart.test.tsx.snap @@ -578,7 +578,6 @@ exports[`DonutChart component passes correct props without errors for valid prop "outerSizeRatio": 0.9, }, }, - Object {}, ] } /> @@ -697,7 +696,7 @@ exports[`DonutChart component renders a donut chart 1`] = ` class="euiFlexItem emotion-euiFlexItem-growZero" > <span - color="#bd271e" + color="#BD271E" data-euiicon-type="dot" /> </div> @@ -739,7 +738,7 @@ exports[`DonutChart component renders a donut chart 1`] = ` class="euiFlexItem emotion-euiFlexItem-growZero" > <span - color="#d3dae6" + color="#D3DAE6" data-euiicon-type="dot" /> </div> @@ -856,7 +855,7 @@ exports[`DonutChart component renders a green check when all monitors are up 1`] class="euiFlexItem emotion-euiFlexItem-growZero" > <span - color="#bd271e" + color="#BD271E" data-euiicon-type="dot" /> </div> @@ -898,7 +897,7 @@ exports[`DonutChart component renders a green check when all monitors are up 1`] class="euiFlexItem emotion-euiFlexItem-growZero" > <span - color="#d3dae6" + color="#D3DAE6" data-euiicon-type="dot" /> </div> diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/monitor_bar_series.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/monitor_bar_series.test.tsx.snap index 7b5da3fc31599..230fe13e10720 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/monitor_bar_series.test.tsx.snap +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/monitor_bar_series.test.tsx.snap @@ -32,39 +32,28 @@ exports[`MonitorBarSeries component renders if the data series is present 1`] = `; exports[`MonitorBarSeries component shallow renders a series when there are down items 1`] = ` -<ContextProvider - value={ +<Router + history={ Object { - "history": Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { + "action": "POP", + "block": [Function], + "canGo": [Function], + "createHref": [Function], + "entries": Array [ + Object { "hash": "", "key": "TestKeyForTesting", "pathname": "/", "search": "", "state": undefined, }, - "push": [Function], - "replace": [Function], - }, + ], + "go": [Function], + "goBack": [Function], + "goForward": [Function], + "index": 0, + "length": 1, + "listen": [Function], "location": Object { "hash": "", "key": "TestKeyForTesting", @@ -72,74 +61,32 @@ exports[`MonitorBarSeries component shallow renders a series when there are down "search": "", "state": undefined, }, - "match": Object { - "isExact": true, - "params": Object {}, - "path": "/", - "url": "/", - }, - "staticContext": undefined, + "push": [Function], + "replace": [Function], } } > - <ContextProvider - value={ - Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, + <MonitorBarSeries + histogramSeries={ + Array [ + Object { + "down": 1, + "timestamp": 124, + "up": 0, + }, + Object { + "down": 1, + "timestamp": 125, + "up": 0, + }, + Object { + "down": 1, + "timestamp": 126, + "up": 0, }, - "push": [Function], - "replace": [Function], - } + ] } - > - <CompatRouter> - <MonitorBarSeries - histogramSeries={ - Array [ - Object { - "down": 1, - "timestamp": 124, - "up": 0, - }, - Object { - "down": 1, - "timestamp": 125, - "up": 0, - }, - Object { - "down": 1, - "timestamp": 126, - "up": 0, - }, - ] - } - minInterval={10} - /> - </CompatRouter> - </ContextProvider> -</ContextProvider> + minInterval={10} + /> +</Router> `; diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/chart_wrapper.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/chart_wrapper.test.tsx index 1a1a74ab753b1..adeb1d00facc4 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/chart_wrapper.test.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/chart_wrapper.test.tsx @@ -13,7 +13,15 @@ import { shallowWithIntl } from '@kbn/test-jest-helpers'; import { ChartWrapper } from './chart_wrapper'; import { SnapshotHeading } from '../../overview/snapshot/snapshot_heading'; import { DonutChart } from './donut_chart'; +import { mockCore } from '../../../lib/helper/rtl_helpers'; const SNAPSHOT_CHART_HEIGHT = 144; + +jest.mock('@kbn/kibana-react-plugin/public', () => ({ + useKibana: jest.fn().mockImplementation(() => ({ + services: mockCore(), + })), +})); + describe('ChartWrapper component', () => { it('renders the component with loading false', () => { const component = shallowWithIntl( diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart.test.tsx index ff83c51900cdf..d74a7ba7e4372 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart.test.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart.test.tsx @@ -8,6 +8,13 @@ import { DonutChart } from './donut_chart'; import { renderWithIntl, shallowWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; +import { mockCore } from '../../../lib/helper/rtl_helpers'; + +jest.mock('@kbn/kibana-react-plugin/public', () => ({ + useKibana: jest.fn().mockImplementation(() => ({ + services: mockCore(), + })), +})); describe('DonutChart component', () => { it('passes correct props without errors for valid props', () => { diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart.tsx index e5fc97a52600a..1a5ff52eb10e6 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart.tsx @@ -5,13 +5,14 @@ * 2.0. */ -import { EuiFlexGroup, EuiFlexItem, EuiIcon } from '@elastic/eui'; -import React, { useContext } from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiIcon, useEuiTheme } from '@elastic/eui'; +import React from 'react'; import { i18n } from '@kbn/i18n'; import styled from 'styled-components'; import { Chart, Datum, Partition, Settings, PartitionLayout, PartialTheme } from '@elastic/charts'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { ClientPluginsStart } from '../../../../plugin'; import { DonutChartLegend } from './donut_chart_legend'; -import { UptimeThemeContext } from '../../../contexts'; interface DonutChartProps { down: number; @@ -42,11 +43,14 @@ const themeOverrides: PartialTheme = { }; export const DonutChart = ({ height, down, up }: DonutChartProps) => { - const { - colors: { danger, gray }, - chartTheme, - } = useContext(UptimeThemeContext); + const theme = useEuiTheme(); + const danger = theme.euiTheme.colors.danger; + const gray = theme.euiTheme.colors.lightShade; + const { + services: { charts }, + } = useKibana<ClientPluginsStart>(); + const baseTheme = charts.theme.useChartsBaseTheme(); return ( <EuiFlexGroup alignItems="center" responsive={false}> <EuiFlexItem grow={false} style={{ position: 'relative' }}> @@ -58,11 +62,7 @@ export const DonutChart = ({ height, down, up }: DonutChartProps) => { values: { down, total: up + down }, })} > - <Settings - theme={[themeOverrides, chartTheme.theme ?? {}]} - baseTheme={chartTheme.baseTheme} - locale={i18n.getLocale()} - /> + <Settings theme={[themeOverrides]} baseTheme={baseTheme} locale={i18n.getLocale()} /> <Partition id="spec_1" data={[ diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart_legend.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart_legend.tsx index 5b9ad91024547..777c43300f910 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart_legend.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart_legend.tsx @@ -5,11 +5,10 @@ * 2.0. */ -import { EuiSpacer } from '@elastic/eui'; -import React, { useContext } from 'react'; +import { EuiSpacer, useEuiTheme } from '@elastic/eui'; +import React from 'react'; import styled from 'styled-components'; import { DonutChartLegendRow } from './donut_chart_legend_row'; -import { UptimeThemeContext } from '../../../contexts'; import { STATUS_DOWN_LABEL, STATUS_UP_LABEL, @@ -30,9 +29,10 @@ interface Props { } export const DonutChartLegend = ({ down, up }: Props) => { - const { - colors: { gray, danger }, - } = useContext(UptimeThemeContext); + const theme = useEuiTheme(); + const danger = theme.euiTheme.colors.danger; + const gray = theme.euiTheme.colors.lightShade; + return ( <LegendContainer> <DonutChartLegendRow diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/duration_chart.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/duration_chart.tsx index 7acaa9ac2f935..d6d96518e10d6 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/duration_chart.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/duration_chart.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { useContext, useState } from 'react'; +import React, { useState } from 'react'; import { i18n } from '@kbn/i18n'; import moment from 'moment'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -19,6 +19,7 @@ import { LegendItemListener, } from '@elastic/charts'; import { useSelector } from 'react-redux'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; import { getChartDateLabel } from '../../../lib/helper'; import { LocationDurationLine } from '../../../../../common/types'; import { DurationLineSeriesList } from './duration_line_series_list'; @@ -28,11 +29,11 @@ import { getTickFormat } from './get_tick_format'; import { ChartEmptyState } from './chart_empty_state'; import { DurationAnomaliesBar } from './duration_line_bar_list'; import { AnomalyRecords } from '../../../state/actions'; -import { UptimeThemeContext } from '../../../contexts'; import { MONITOR_CHART_HEIGHT } from '../../monitor'; import { monitorStatusSelector } from '../../../state/selectors'; import { microToMilli, microToSec } from '../../../lib/formatting'; import { MS_LABEL, SECONDS_LABEL } from '../../../../../common/translations/translations'; +import { ClientPluginsStart } from '../../../../plugin'; interface DurationChartProps { /** @@ -66,7 +67,10 @@ export const DurationChartComponent = ({ const [hiddenLegends, setHiddenLegends] = useState<string[]>([]); - const { chartTheme } = useContext(UptimeThemeContext); + const { + services: { charts }, + } = useKibana<ClientPluginsStart>(); + const baseTheme = charts.theme.useChartsBaseTheme(); const onBrushEnd: BrushEndListener = ({ x }) => { if (!x) { @@ -110,8 +114,7 @@ export const DurationChartComponent = ({ onBrushEnd={onBrushEnd} onLegendItemClick={legendToggleVisibility} locale={i18n.getLocale()} - // TODO connect to charts.theme service see src/plugins/charts/public/services/theme/README.md - {...chartTheme} + baseTheme={baseTheme} /> <Axis id="bottom" diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/monitor_bar_series.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/monitor_bar_series.tsx index 25579d56fb13b..6012a08b28911 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/monitor_bar_series.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/monitor_bar_series.tsx @@ -18,15 +18,16 @@ import { ElementClickListener, } from '@elastic/charts'; import { i18n } from '@kbn/i18n'; -import React, { useContext } from 'react'; +import React from 'react'; import moment from 'moment'; import { FormattedMessage } from '@kbn/i18n-react'; -import { EuiText, EuiToolTip } from '@elastic/eui'; +import { EuiText, EuiToolTip, useEuiTheme } from '@elastic/eui'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; import { HistogramPoint } from '../../../../../common/runtime_types'; import { getChartDateLabel, seriesHasDownValues } from '../../../lib/helper'; import { useUrlParams } from '../../../hooks'; -import { UptimeThemeContext } from '../../../contexts'; import { getDateRangeFromChartElement } from './utils'; +import { ClientPluginsStart } from '../../../../plugin'; export interface MonitorBarSeriesProps { /** @@ -44,9 +45,13 @@ export interface MonitorBarSeriesProps { */ export const MonitorBarSeries = ({ histogramSeries, minInterval }: MonitorBarSeriesProps) => { const { - colors: { danger }, - chartTheme, - } = useContext(UptimeThemeContext); + services: { charts }, + } = useKibana<ClientPluginsStart>(); + const baseTheme = charts.theme.useChartsBaseTheme(); + + const theme = useEuiTheme(); + const danger = theme.euiTheme.colors.danger; + const [getUrlParams, updateUrlParams] = useUrlParams(); const { absoluteDateRangeStart, absoluteDateRangeEnd } = getUrlParams(); @@ -79,8 +84,7 @@ export const MonitorBarSeries = ({ histogramSeries, minInterval }: MonitorBarSer onBrushEnd={onBrushEnd} onElementClick={onBarClicked} locale={i18n.getLocale()} - // TODO connect to charts.theme service see src/plugins/charts/public/services/theme/README.md - {...chartTheme} + baseTheme={baseTheme} /> <Axis hide @@ -112,11 +116,21 @@ export const MonitorBarSeries = ({ histogramSeries, minInterval }: MonitorBarSer <FormattedMessage id="xpack.uptime.monitorList.noDownHistory" defaultMessage="This monitor has never been {emphasizedText} during the selected time range." - values={{ emphasizedText: <strong>down</strong> }} + values={{ + emphasizedText: ( + <strong> + {i18n.translate('xpack.uptime.monitorBarSeries.strong.downLabel', { + defaultMessage: 'down', + })} + </strong> + ), + }} /> } > - <EuiText color="success">--</EuiText> + <EuiText color="success"> + {i18n.translate('xpack.uptime.monitorBarSeries.TextLabel', { defaultMessage: '--' })} + </EuiText> </EuiToolTip> ); }; diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/ping_histogram.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/ping_histogram.tsx index a1471dfe1715d..1bad832a87d07 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/ping_histogram.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/ping_histogram.tsx @@ -17,15 +17,15 @@ import { ElementClickListener, ScaleType, } from '@elastic/charts'; -import { EuiTitle, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { EuiTitle, EuiFlexGroup, EuiFlexItem, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import React, { useContext } from 'react'; +import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import numeral from '@elastic/numeral'; import moment from 'moment'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; import { getChartDateLabel } from '../../../lib/helper'; import { ChartWrapper } from './chart_wrapper'; -import { UptimeThemeContext } from '../../../contexts'; import { HistogramResult } from '../../../../../common/runtime_types'; import { useUrlParams } from '../../../hooks'; import { ChartEmptyState } from './chart_empty_state'; @@ -34,6 +34,7 @@ import { STATUS_DOWN_LABEL, STATUS_UP_LABEL, } from '../../../../../common/translations/translations'; +import { ClientPluginsStart } from '../../../../plugin'; export interface PingHistogramComponentProps { /** @@ -72,9 +73,13 @@ export const PingHistogramComponent: React.FC<PingHistogramComponentProps> = ({ timeZone, }) => { const { - colors: { danger, gray }, - chartTheme, - } = useContext(UptimeThemeContext); + services: { charts }, + } = useKibana<ClientPluginsStart>(); + const baseTheme = charts.theme.useChartsBaseTheme(); + + const theme = useEuiTheme(); + const danger = theme.euiTheme.colors.danger; + const gray = theme.euiTheme.colors.lightShade; const [_getUrlParams, updateUrlParams] = useUrlParams(); @@ -143,8 +148,7 @@ export const PingHistogramComponent: React.FC<PingHistogramComponentProps> = ({ onBrushEnd={onBrushEnd} onElementClick={onBarClicked} locale={i18n.getLocale()} - // TODO connect to charts.theme service see src/plugins/charts/public/services/theme/README.md - {...chartTheme} + baseTheme={baseTheme} /> <Axis id={i18n.translate('xpack.uptime.snapshotHistogram.xAxisId', { diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/__snapshots__/monitor_charts.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/__snapshots__/monitor_charts.test.tsx.snap index 4fb746efe2818..554d34c88acf3 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/__snapshots__/monitor_charts.test.tsx.snap +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/__snapshots__/monitor_charts.test.tsx.snap @@ -1,39 +1,28 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`MonitorCharts component renders the component without errors 1`] = ` -<ContextProvider - value={ +<Router + history={ Object { - "history": Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { + "action": "POP", + "block": [Function], + "canGo": [Function], + "createHref": [Function], + "entries": Array [ + Object { "hash": "", "key": "TestKeyForTesting", "pathname": "/", "search": "", "state": undefined, }, - "push": [Function], - "replace": [Function], - }, + ], + "go": [Function], + "goBack": [Function], + "goForward": [Function], + "index": 0, + "length": 1, + "listen": [Function], "location": Object { "hash": "", "key": "TestKeyForTesting", @@ -41,55 +30,13 @@ exports[`MonitorCharts component renders the component without errors 1`] = ` "search": "", "state": undefined, }, - "match": Object { - "isExact": true, - "params": Object {}, - "path": "/", - "url": "/", - }, - "staticContext": undefined, + "push": [Function], + "replace": [Function], } } > - <ContextProvider - value={ - Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - "push": [Function], - "replace": [Function], - } - } - > - <CompatRouter> - <MonitorCharts - monitorId="something" - /> - </CompatRouter> - </ContextProvider> -</ContextProvider> + <MonitorCharts + monitorId="something" + /> +</Router> `; diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap index 5b8d20ae63ba0..1edd320bcc715 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap @@ -29,39 +29,28 @@ exports[`ML Integrations renders without errors 1`] = ` `; exports[`ML Integrations shallow renders without errors 1`] = ` -<ContextProvider - value={ +<Router + history={ Object { - "history": Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { + "action": "POP", + "block": [Function], + "canGo": [Function], + "createHref": [Function], + "entries": Array [ + Object { "hash": "", "key": "TestKeyForTesting", "pathname": "/", "search": "", "state": undefined, }, - "push": [Function], - "replace": [Function], - }, + ], + "go": [Function], + "goBack": [Function], + "goForward": [Function], + "index": 0, + "length": 1, + "listen": [Function], "location": Object { "hash": "", "key": "TestKeyForTesting", @@ -69,53 +58,11 @@ exports[`ML Integrations shallow renders without errors 1`] = ` "search": "", "state": undefined, }, - "match": Object { - "isExact": true, - "params": Object {}, - "path": "/", - "url": "/", - }, - "staticContext": undefined, + "push": [Function], + "replace": [Function], } } > - <ContextProvider - value={ - Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - "push": [Function], - "replace": [Function], - } - } - > - <CompatRouter> - <MLIntegrationComponent /> - </CompatRouter> - </ContextProvider> -</ContextProvider> + <MLIntegrationComponent /> +</Router> `; diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_status.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_status.tsx index e63bc4f08e6a5..9e5fef631507c 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_status.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_status.tsx @@ -5,13 +5,12 @@ * 2.0. */ -import React, { useContext } from 'react'; +import React from 'react'; import { i18n } from '@kbn/i18n'; import moment from 'moment'; -import { EuiBadge, EuiSpacer, EuiText } from '@elastic/eui'; +import { EuiBadge, EuiSpacer, EuiText, useEuiTheme } from '@elastic/eui'; import { Ping } from '../../../../../../common/runtime_types/ping'; import { MONITOR_TYPES, STATUS } from '../../../../../../common/constants'; -import { UptimeThemeContext } from '../../../../contexts'; import { STATUS_COMPLETE_LABEL, STATUS_DOWN_LABEL, @@ -32,9 +31,8 @@ const getPingStatusLabel = (status: string, ping: Ping) => { }; export const PingStatusColumn = ({ pingStatus, item }: Props) => { - const { - colors: { dangerBehindText }, - } = useContext(UptimeThemeContext); + const theme = useEuiTheme(); + const dangerBehindText = theme.euiTheme.colors.textDanger; const timeStamp = moment(item.timestamp); diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap index d8acb8a3cd715..84360ef93c8fc 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap @@ -59,7 +59,7 @@ Array [ <a class="euiLink emotion-euiLink-primary" data-test-subj="syntheticsMonitorTagsSetTagsLink" - href="undefined/monitor-options.html#monitor-tags" + href="https://www.elastic.co/guide/en/beats/heartbeat/mocked-test-branch/monitor-options.html#monitor-tags" rel="noopener noreferrer" target="_blank" > diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/ssl_certificate.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/ssl_certificate.test.tsx.snap index 1e50379a09553..4729f1942f4c3 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/ssl_certificate.test.tsx.snap +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/ssl_certificate.test.tsx.snap @@ -65,39 +65,28 @@ Array [ `; exports[`SSL Certificate component shallow renders 1`] = ` -<ContextProvider - value={ +<Router + history={ Object { - "history": Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { + "action": "POP", + "block": [Function], + "canGo": [Function], + "createHref": [Function], + "entries": Array [ + Object { "hash": "", "key": "TestKeyForTesting", "pathname": "/", "search": "", "state": undefined, }, - "push": [Function], - "replace": [Function], - }, + ], + "go": [Function], + "goBack": [Function], + "goForward": [Function], + "index": 0, + "length": 1, + "listen": [Function], "location": Object { "hash": "", "key": "TestKeyForTesting", @@ -105,60 +94,18 @@ exports[`SSL Certificate component shallow renders 1`] = ` "search": "", "state": undefined, }, - "match": Object { - "isExact": true, - "params": Object {}, - "path": "/", - "url": "/", - }, - "staticContext": undefined, + "push": [Function], + "replace": [Function], } } > - <ContextProvider - value={ + <MonitorSSLCertificate + tls={ Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - "push": [Function], - "replace": [Function], + "certificate_not_valid_after": "2020-04-24T11:41:38.200Z", + "certificate_not_valid_before": "2019-04-24T11:41:38.200Z", } } - > - <CompatRouter> - <MonitorSSLCertificate - tls={ - Object { - "certificate_not_valid_after": "2020-04-24T11:41:38.200Z", - "certificate_not_valid_before": "2019-04-24T11:41:38.200Z", - } - } - /> - </CompatRouter> - </ContextProvider> -</ContextProvider> + /> +</Router> `; diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/location_status_tags.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/location_status_tags.tsx index b50b84235dad7..f53636d5a753c 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/location_status_tags.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/location_status_tags.tsx @@ -5,10 +5,10 @@ * 2.0. */ -import React, { useContext } from 'react'; +import React from 'react'; import moment from 'moment'; import styled from 'styled-components'; -import { UptimeThemeContext } from '../../../../contexts'; +import { useEuiTheme } from '@elastic/eui'; import { MonitorLocation } from '../../../../../../common/runtime_types'; import { SHORT_TIMESPAN_LOCALE, SHORT_TS_LOCALE } from '../../../../../../common/constants'; import { AvailabilityReporting } from '..'; @@ -33,9 +33,9 @@ export interface StatusTag { } export const LocationStatusTags = ({ locations }: Props) => { - const { - colors: { gray, danger }, - } = useContext(UptimeThemeContext); + const theme = useEuiTheme(); + const danger = theme.euiTheme.colors.danger; + const gray = theme.euiTheme.colors.lightShade; const allLocations: StatusTag[] = []; const prevLocal: string = moment.locale() ?? 'en'; diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/__snapshots__/filter_status_button.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/__snapshots__/filter_status_button.test.tsx.snap index 8a2095bfdfdf8..dd4e3c9ff1e7c 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/__snapshots__/filter_status_button.test.tsx.snap +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/__snapshots__/filter_status_button.test.tsx.snap @@ -21,39 +21,28 @@ exports[`FilterStatusButton renders without errors for valid props 1`] = ` `; exports[`FilterStatusButton shallow renders without errors for valid props 1`] = ` -<ContextProvider - value={ +<Router + history={ Object { - "history": Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { + "action": "POP", + "block": [Function], + "canGo": [Function], + "createHref": [Function], + "entries": Array [ + Object { "hash": "", "key": "TestKeyForTesting", "pathname": "/", "search": "", "state": undefined, }, - "push": [Function], - "replace": [Function], - }, + ], + "go": [Function], + "goBack": [Function], + "goForward": [Function], + "index": 0, + "length": 1, + "listen": [Function], "location": Object { "hash": "", "key": "TestKeyForTesting", @@ -61,59 +50,17 @@ exports[`FilterStatusButton shallow renders without errors for valid props 1`] = "search": "", "state": undefined, }, - "match": Object { - "isExact": true, - "params": Object {}, - "path": "/", - "url": "/", - }, - "staticContext": undefined, + "push": [Function], + "replace": [Function], } } > - <ContextProvider - value={ - Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - "push": [Function], - "replace": [Function], - } - } - > - <CompatRouter> - <FilterStatusButton - content="Up" - dataTestSubj="foo" - isActive={true} - value="up" - withNext={true} - /> - </CompatRouter> - </ContextProvider> -</ContextProvider> + <FilterStatusButton + content="Up" + dataTestSubj="foo" + isActive={true} + value="up" + withNext={true} + /> +</Router> `; diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/__snapshots__/status_filter.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/__snapshots__/status_filter.test.tsx.snap index d25aecb486f62..a9d2b7baf2cc9 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/__snapshots__/status_filter.test.tsx.snap +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/__snapshots__/status_filter.test.tsx.snap @@ -59,39 +59,28 @@ exports[`StatusFilterComponent renders without errors for valid props 1`] = ` `; exports[`StatusFilterComponent shallow renders without errors for valid props 1`] = ` -<ContextProvider - value={ +<Router + history={ Object { - "history": Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { + "action": "POP", + "block": [Function], + "canGo": [Function], + "createHref": [Function], + "entries": Array [ + Object { "hash": "", "key": "TestKeyForTesting", "pathname": "/", "search": "", "state": undefined, }, - "push": [Function], - "replace": [Function], - }, + ], + "go": [Function], + "goBack": [Function], + "goForward": [Function], + "index": 0, + "length": 1, + "listen": [Function], "location": Object { "hash": "", "key": "TestKeyForTesting", @@ -99,53 +88,11 @@ exports[`StatusFilterComponent shallow renders without errors for valid props 1` "search": "", "state": undefined, }, - "match": Object { - "isExact": true, - "params": Object {}, - "path": "/", - "url": "/", - }, - "staticContext": undefined, + "push": [Function], + "replace": [Function], } } > - <ContextProvider - value={ - Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - "push": [Function], - "replace": [Function], - } - } - > - <CompatRouter> - <StatusFilter /> - </CompatRouter> - </ContextProvider> -</ContextProvider> + <StatusFilter /> +</Router> `; diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/status_badge.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/status_badge.tsx index 04311ff66aa8f..5abf56c0189e5 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/status_badge.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/status_badge.tsx @@ -5,11 +5,10 @@ * 2.0. */ -import { EuiBadge, EuiToolTip } from '@elastic/eui'; -import React, { useContext } from 'react'; +import { EuiBadge, EuiToolTip, useEuiTheme } from '@elastic/eui'; +import React from 'react'; import { STATUS } from '../../../../../../common/constants'; import { getHealthMessage } from './monitor_status_column'; -import { UptimeThemeContext } from '../../../../contexts'; import { PingError } from '../../../../../../common/runtime_types'; export const StatusBadge = ({ @@ -19,9 +18,8 @@ export const StatusBadge = ({ status: string; summaryError?: PingError; }) => { - const { - colors: { dangerBehindText }, - } = useContext(UptimeThemeContext); + const theme = useEuiTheme(); + const dangerBehindText = theme.euiTheme.colors.textDanger; if (status === STATUS.UP) { return ( diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap index c596dbb57eaa7..ac50a33f03afe 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap @@ -1,39 +1,28 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`MonitorListDrawer component renders a MonitorListDrawer when there are many checks 1`] = ` -<ContextProvider - value={ +<Router + history={ Object { - "history": Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { + "action": "POP", + "block": [Function], + "canGo": [Function], + "createHref": [Function], + "entries": Array [ + Object { "hash": "", "key": "TestKeyForTesting", "pathname": "/", "search": "", "state": undefined, }, - "push": [Function], - "replace": [Function], - }, + ], + "go": [Function], + "goBack": [Function], + "goForward": [Function], + "index": 0, + "length": 1, + "listen": [Function], "location": Object { "hash": "", "key": "TestKeyForTesting", @@ -41,183 +30,130 @@ exports[`MonitorListDrawer component renders a MonitorListDrawer when there are "search": "", "state": undefined, }, - "match": Object { - "isExact": true, - "params": Object {}, - "path": "/", - "url": "/", - }, - "staticContext": undefined, + "push": [Function], + "replace": [Function], } } > - <ContextProvider - value={ + <MonitorListDrawerComponent + loading={false} + monitorDetails={ Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, + "error": Object { + "message": "Get https://expired.badssl.com: x509: certificate has expired or is not yet valid", + "type": "io", }, - "push": [Function], - "replace": [Function], + "monitorId": "bad-ssl", } } - > - <CompatRouter> - <MonitorListDrawerComponent - loading={false} - monitorDetails={ - Object { - "error": Object { - "message": "Get https://expired.badssl.com: x509: certificate has expired or is not yet valid", - "type": "io", - }, - "monitorId": "bad-ssl", - } - } - summary={ - Object { - "monitor_id": "foo", - "state": Object { + summary={ + Object { + "monitor_id": "foo", + "state": Object { + "monitor": Object { + "type": "http", + }, + "summary": Object { + "down": 0, + "up": 1, + }, + "summaryPings": Array [ + Object { + "docId": "foo", "monitor": Object { - "type": "http", - }, - "summary": Object { - "down": 0, - "up": 1, - }, - "summaryPings": Array [ - Object { - "docId": "foo", - "monitor": Object { - "check_group": "myCheckGroup", - "duration": Object { - "us": 121, - }, - "id": "foo", - "ip": "127.0.0.1", - "name": undefined, - "status": "up", - "type": "icmp", - }, - "timestamp": "121", + "check_group": "myCheckGroup", + "duration": Object { + "us": 121, }, - Object { - "docId": "foo-0", - "monitor": Object { - "check_group": "myCheckGroup", - "duration": Object { - "us": 100000, - }, - "id": "foo", - "ip": "127.0.0.1", - "name": undefined, - "status": "down", - "type": "icmp", - }, - "timestamp": "0", + "id": "foo", + "ip": "127.0.0.1", + "name": undefined, + "status": "up", + "type": "icmp", + }, + "timestamp": "121", + }, + Object { + "docId": "foo-0", + "monitor": Object { + "check_group": "myCheckGroup", + "duration": Object { + "us": 100000, }, - Object { - "docId": "foo-1", - "monitor": Object { - "check_group": "myCheckGroup", - "duration": Object { - "us": 1, - }, - "id": "foo", - "ip": "127.0.0.2", - "name": undefined, - "status": "up", - "type": "icmp", - }, - "timestamp": "1", + "id": "foo", + "ip": "127.0.0.1", + "name": undefined, + "status": "down", + "type": "icmp", + }, + "timestamp": "0", + }, + Object { + "docId": "foo-1", + "monitor": Object { + "check_group": "myCheckGroup", + "duration": Object { + "us": 1, }, - Object { - "docId": "foo-2", - "monitor": Object { - "check_group": "myCheckGroup", - "duration": Object { - "us": 2, - }, - "id": "foo", - "ip": "127.0.0.3", - "name": undefined, - "status": "down", - "type": "icmp", - }, - "timestamp": "2", + "id": "foo", + "ip": "127.0.0.2", + "name": undefined, + "status": "up", + "type": "icmp", + }, + "timestamp": "1", + }, + Object { + "docId": "foo-2", + "monitor": Object { + "check_group": "myCheckGroup", + "duration": Object { + "us": 2, }, - ], - "timestamp": "123", - "url": Object { - "domain": "expired.badssl.com", - "full": "https://expired.badssl.com", + "id": "foo", + "ip": "127.0.0.3", + "name": undefined, + "status": "down", + "type": "icmp", }, + "timestamp": "2", }, - } - } - /> - </CompatRouter> - </ContextProvider> -</ContextProvider> + ], + "timestamp": "123", + "url": Object { + "domain": "expired.badssl.com", + "full": "https://expired.badssl.com", + }, + }, + } + } + /> +</Router> `; exports[`MonitorListDrawer component renders a MonitorListDrawer when there is only one check 1`] = ` -<ContextProvider - value={ +<Router + history={ Object { - "history": Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { + "action": "POP", + "block": [Function], + "canGo": [Function], + "createHref": [Function], + "entries": Array [ + Object { "hash": "", "key": "TestKeyForTesting", "pathname": "/", "search": "", "state": undefined, }, - "push": [Function], - "replace": [Function], - }, + ], + "go": [Function], + "goBack": [Function], + "goForward": [Function], + "index": 0, + "length": 1, + "listen": [Function], "location": Object { "hash": "", "key": "TestKeyForTesting", @@ -225,100 +161,58 @@ exports[`MonitorListDrawer component renders a MonitorListDrawer when there is o "search": "", "state": undefined, }, - "match": Object { - "isExact": true, - "params": Object {}, - "path": "/", - "url": "/", - }, - "staticContext": undefined, + "push": [Function], + "replace": [Function], } } > - <ContextProvider - value={ + <MonitorListDrawerComponent + loading={false} + monitorDetails={ Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, + "error": Object { + "message": "Get https://expired.badssl.com: x509: certificate has expired or is not yet valid", + "type": "io", }, - "push": [Function], - "replace": [Function], + "monitorId": "bad-ssl", } } - > - <CompatRouter> - <MonitorListDrawerComponent - loading={false} - monitorDetails={ - Object { - "error": Object { - "message": "Get https://expired.badssl.com: x509: certificate has expired or is not yet valid", - "type": "io", - }, - "monitorId": "bad-ssl", - } - } - summary={ - Object { - "monitor_id": "foo", - "state": Object { + summary={ + Object { + "monitor_id": "foo", + "state": Object { + "monitor": Object { + "type": "http", + }, + "summary": Object { + "down": 0, + "up": 1, + }, + "summaryPings": Array [ + Object { + "docId": "foo", "monitor": Object { - "type": "http", - }, - "summary": Object { - "down": 0, - "up": 1, - }, - "summaryPings": Array [ - Object { - "docId": "foo", - "monitor": Object { - "check_group": "myCheckGroup", - "duration": Object { - "us": 121, - }, - "id": "foo", - "ip": "127.0.0.1", - "name": undefined, - "status": "up", - "type": "icmp", - }, - "timestamp": "121", + "check_group": "myCheckGroup", + "duration": Object { + "us": 121, }, - ], - "timestamp": "123", - "url": Object { - "domain": "expired.badssl.com", - "full": "https://expired.badssl.com", + "id": "foo", + "ip": "127.0.0.1", + "name": undefined, + "status": "up", + "type": "icmp", }, + "timestamp": "121", }, - } - } - /> - </CompatRouter> - </ContextProvider> -</ContextProvider> + ], + "timestamp": "123", + "url": Object { + "domain": "expired.badssl.com", + "full": "https://expired.badssl.com", + }, + }, + } + } + /> +</Router> `; diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/__snapshots__/certificate_form.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/__snapshots__/certificate_form.test.tsx.snap index aa44f05e3763e..c5ba5f3d0bcf6 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/__snapshots__/certificate_form.test.tsx.snap +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/__snapshots__/certificate_form.test.tsx.snap @@ -1,39 +1,28 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`CertificateForm shallow renders expected elements for valid props 1`] = ` -<ContextProvider - value={ +<Router + history={ Object { - "history": Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { + "action": "POP", + "block": [Function], + "canGo": [Function], + "createHref": [Function], + "entries": Array [ + Object { "hash": "", "key": "TestKeyForTesting", "pathname": "/", "search": "", "state": undefined, }, - "push": [Function], - "replace": [Function], - }, + ], + "go": [Function], + "goBack": [Function], + "goForward": [Function], + "index": 0, + "length": 1, + "listen": [Function], "location": Object { "hash": "", "key": "TestKeyForTesting", @@ -41,66 +30,24 @@ exports[`CertificateForm shallow renders expected elements for valid props 1`] = "search": "", "state": undefined, }, - "match": Object { - "isExact": true, - "params": Object {}, - "path": "/", - "url": "/", - }, - "staticContext": undefined, + "push": [Function], + "replace": [Function], } } > - <ContextProvider - value={ + <CertificateExpirationForm + fieldErrors={null} + formFields={ Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - "push": [Function], - "replace": [Function], + "certAgeThreshold": 36, + "certExpirationThreshold": 7, + "defaultConnectors": Array [], + "heartbeatIndices": "heartbeat-8*", } } - > - <CompatRouter> - <CertificateExpirationForm - fieldErrors={null} - formFields={ - Object { - "certAgeThreshold": 36, - "certExpirationThreshold": 7, - "defaultConnectors": Array [], - "heartbeatIndices": "heartbeat-8*", - } - } - isDisabled={false} - loading={false} - onChange={[MockFunction]} - /> - </CompatRouter> - </ContextProvider> -</ContextProvider> + isDisabled={false} + loading={false} + onChange={[MockFunction]} + /> +</Router> `; diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/__snapshots__/indices_form.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/__snapshots__/indices_form.test.tsx.snap index e12ec38a52d86..4b7dc3cc1dec4 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/__snapshots__/indices_form.test.tsx.snap +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/__snapshots__/indices_form.test.tsx.snap @@ -1,39 +1,28 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`CertificateForm shallow renders expected elements for valid props 1`] = ` -<ContextProvider - value={ +<Router + history={ Object { - "history": Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { + "action": "POP", + "block": [Function], + "canGo": [Function], + "createHref": [Function], + "entries": Array [ + Object { "hash": "", "key": "TestKeyForTesting", "pathname": "/", "search": "", "state": undefined, }, - "push": [Function], - "replace": [Function], - }, + ], + "go": [Function], + "goBack": [Function], + "goForward": [Function], + "index": 0, + "length": 1, + "listen": [Function], "location": Object { "hash": "", "key": "TestKeyForTesting", @@ -41,66 +30,24 @@ exports[`CertificateForm shallow renders expected elements for valid props 1`] = "search": "", "state": undefined, }, - "match": Object { - "isExact": true, - "params": Object {}, - "path": "/", - "url": "/", - }, - "staticContext": undefined, + "push": [Function], + "replace": [Function], } } > - <ContextProvider - value={ + <IndicesForm + fieldErrors={null} + formFields={ Object { - "action": "POP", - "block": [Function], - "canGo": [Function], - "createHref": [Function], - "entries": Array [ - Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - ], - "go": [Function], - "goBack": [Function], - "goForward": [Function], - "index": 0, - "length": 1, - "listen": [Function], - "location": Object { - "hash": "", - "key": "TestKeyForTesting", - "pathname": "/", - "search": "", - "state": undefined, - }, - "push": [Function], - "replace": [Function], + "certAgeThreshold": 36, + "certExpirationThreshold": 7, + "defaultConnectors": Array [], + "heartbeatIndices": "heartbeat-8*", } } - > - <CompatRouter> - <IndicesForm - fieldErrors={null} - formFields={ - Object { - "certAgeThreshold": 36, - "certExpirationThreshold": 7, - "defaultConnectors": Array [], - "heartbeatIndices": "heartbeat-8*", - } - } - isDisabled={false} - loading={false} - onChange={[MockFunction]} - /> - </CompatRouter> - </ContextProvider> -</ContextProvider> + isDisabled={false} + loading={false} + onChange={[MockFunction]} + /> +</Router> `; diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/console_event.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/console_event.test.tsx index 6a3c6d02151ed..2db3b2ec004fc 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/console_event.test.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/console_event.test.tsx @@ -46,7 +46,7 @@ describe('ConsoleEvent component', () => { grow={false} style={ Object { - "color": "#bd271e", + "color": "#BD271E", } } > diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/console_event.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/console_event.tsx index aeceef2477e28..fb37ff6804225 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/console_event.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/console_event.tsx @@ -5,9 +5,8 @@ * 2.0. */ -import { EuiFlexItem, EuiFlexGroup } from '@elastic/eui'; -import React, { useContext, FC } from 'react'; -import { UptimeThemeContext } from '../../contexts'; +import { EuiFlexItem, EuiFlexGroup, useEuiTheme } from '@elastic/eui'; +import React, { FC } from 'react'; import { JourneyStep } from '../../../../common/runtime_types/ping'; interface Props { @@ -15,9 +14,8 @@ interface Props { } export const ConsoleEvent: FC<Props> = ({ event }) => { - const { - colors: { danger }, - } = useContext(UptimeThemeContext); + const theme = useEuiTheme(); + const danger = theme.euiTheme.colors.danger; let typeColor: string | undefined; if (event.synthetics?.type === 'stderr') { diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/status_badge.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/status_badge.tsx index a499f2f65885a..49c466e8daf51 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/status_badge.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/status_badge.tsx @@ -5,11 +5,9 @@ * 2.0. */ -import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; +import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiText, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import React, { useContext, FC } from 'react'; -import { UptimeAppColors } from '../../app/uptime_app'; -import { UptimeThemeContext } from '../../contexts'; +import React, { FC } from 'react'; interface StatusBadgeProps { isMobile?: boolean; @@ -17,12 +15,18 @@ interface StatusBadgeProps { stepNo: number; } -export function colorFromStatus(color: UptimeAppColors, status?: string) { +export function colorFromStatus( + color: { + success: string; + danger: string; + }, + status?: string +) { switch (status) { case 'succeeded': return color.success; case 'failed': - return color.dangerBehindText; + return color.danger; default: return 'default'; } @@ -48,7 +52,8 @@ export function textFromStatus(status?: string) { } export const StatusBadge: FC<StatusBadgeProps> = ({ status, stepNo, isMobile }) => { - const theme = useContext(UptimeThemeContext); + const theme = useEuiTheme(); + return ( <EuiFlexGroup alignItems="center" gutterSize="s"> {!isMobile && ( @@ -59,7 +64,17 @@ export const StatusBadge: FC<StatusBadgeProps> = ({ status, stepNo, isMobile }) </EuiFlexItem> )} <EuiFlexItem grow={false}> - <EuiBadge color={colorFromStatus(theme.colors, status)}>{textFromStatus(status)}</EuiBadge> + <EuiBadge + color={colorFromStatus( + { + danger: theme.euiTheme.colors.danger, + success: theme.euiTheme.colors.success, + }, + status + )} + > + {textFromStatus(status)} + </EuiBadge> </EuiFlexItem> </EuiFlexGroup> ); diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/step_screenshot_display.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/step_screenshot_display.tsx index 2e5b8aac0d720..8c158c86fd05b 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/step_screenshot_display.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/step_screenshot_display.tsx @@ -12,6 +12,7 @@ import { EuiImage, EuiLoadingSpinner, EuiText, + useEuiTheme, } from '@elastic/eui'; import styled from 'styled-components'; import { i18n } from '@kbn/i18n'; @@ -23,7 +24,7 @@ import { isScreenshotRef as isAScreenshotRef, ScreenshotRefImageData, } from '../../../../common/runtime_types'; -import { UptimeRefreshContext, UptimeSettingsContext, UptimeThemeContext } from '../../contexts'; +import { UptimeRefreshContext, UptimeSettingsContext } from '../../contexts'; import { getJourneyScreenshot } from '../../state/api/journey'; import { useCompositeImage } from '../../hooks'; @@ -103,9 +104,9 @@ export const StepScreenshotDisplay: FC<StepScreenshotDisplayProps> = ({ lazyLoad = true, }) => { const containerRef = useRef(null); - const { - colors: { lightestShade: pageBackground }, - } = useContext(UptimeThemeContext); + + const theme = useEuiTheme(); + const pageBackground = theme.euiTheme.colors.lightestShade; const { basePath } = useContext(UptimeSettingsContext); diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/contexts/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/contexts/index.ts index 8467691064bff..cd4f2b841e8ff 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/contexts/index.ts +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/contexts/index.ts @@ -8,7 +8,6 @@ export { UptimeRefreshContext, UptimeRefreshContextProvider } from './uptime_refresh_context'; export type { UptimeSettingsContextValues } from './uptime_settings_context'; export { UptimeSettingsContext, UptimeSettingsContextProvider } from './uptime_settings_context'; -export { UptimeThemeContextProvider, UptimeThemeContext } from './uptime_theme_context'; export { UptimeStartupPluginsContext, UptimeStartupPluginsContextProvider, diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/contexts/uptime_theme_context.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/contexts/uptime_theme_context.tsx deleted file mode 100644 index 97787ba9db4e9..0000000000000 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/contexts/uptime_theme_context.tsx +++ /dev/null @@ -1,85 +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 { euiLightVars, euiDarkVars } from '@kbn/ui-theme'; -import React, { createContext, useMemo, FC, PropsWithChildren } from 'react'; -import { DARK_THEME, LIGHT_THEME, PartialTheme, Theme } from '@elastic/charts'; -import { UptimeAppColors } from '../app/uptime_app'; - -export interface UptimeThemeContextValues { - colors: UptimeAppColors; - chartTheme: { - baseTheme?: Theme; - theme?: PartialTheme; - }; -} - -/** - * These are default values for the context. These defaults are typically - * overwritten by the Uptime App upon its invocation. - */ -const defaultContext: UptimeThemeContextValues = { - colors: { - danger: euiLightVars.euiColorDanger, - dangerBehindText: euiDarkVars.euiColorVis9_behindText, - mean: euiLightVars.euiColorPrimary, - range: euiLightVars.euiFocusBackgroundColor, - success: euiLightVars.euiColorSuccess, - warning: euiLightVars.euiColorWarning, - gray: euiLightVars.euiColorLightShade, - lightestShade: euiLightVars.euiColorLightestShade, - }, - chartTheme: { - baseTheme: LIGHT_THEME, - }, -}; - -export const UptimeThemeContext = createContext(defaultContext); - -interface ThemeContextProps { - darkMode: boolean; -} - -export const UptimeThemeContextProvider: FC<PropsWithChildren<ThemeContextProps>> = ({ - darkMode, - children, -}) => { - let colors: UptimeAppColors; - if (darkMode) { - colors = { - danger: euiDarkVars.euiColorVis9, - dangerBehindText: euiDarkVars.euiColorVis9_behindText, - mean: euiDarkVars.euiColorPrimary, - gray: euiDarkVars.euiColorLightShade, - range: euiDarkVars.euiFocusBackgroundColor, - success: euiDarkVars.euiColorSuccess, - warning: euiDarkVars.euiColorWarning, - lightestShade: euiDarkVars.euiColorLightestShade, - }; - } else { - colors = { - danger: euiLightVars.euiColorVis9, - dangerBehindText: euiLightVars.euiColorVis9_behindText, - mean: euiLightVars.euiColorPrimary, - gray: euiLightVars.euiColorLightShade, - range: euiLightVars.euiFocusBackgroundColor, - success: euiLightVars.euiColorSuccess, - warning: euiLightVars.euiColorWarning, - lightestShade: euiLightVars.euiColorLightestShade, - }; - } - const value = useMemo(() => { - return { - colors, - chartTheme: { - baseTheme: darkMode ? DARK_THEME : LIGHT_THEME, - }, - }; - }, [colors, darkMode]); - - return <UptimeThemeContext.Provider value={value} children={children} />; -}; diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/enzyme_helpers.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/enzyme_helpers.tsx index 984344de2e5e2..540e0fdac2c6c 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/enzyme_helpers.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/enzyme_helpers.tsx @@ -10,10 +10,11 @@ import { Router } from '@kbn/shared-ux-router'; import { MemoryHistory } from 'history/createMemoryHistory'; import { createMemoryHistory, History } from 'history'; import { mountWithIntl, renderWithI18nProvider, shallowWithIntl } from '@kbn/test-jest-helpers'; +import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { MountWithReduxProvider } from './helper_with_redux'; import { AppState } from '../../state'; import { mockState } from '../__mocks__/uptime_store.mock'; -import { KibanaProviderOptions, MockRouter } from './rtl_helpers'; +import { KibanaProviderOptions, mockCore, MockRouter } from './rtl_helpers'; interface RenderRouterOptions<ExtraCore> extends KibanaProviderOptions<ExtraCore> { history?: History; @@ -31,7 +32,11 @@ const helperWithRouter: <R>( history.location.key = 'TestKeyForTesting'; - const routerWrapper = <Router history={history}>{component}</Router>; + const routerWrapper = ( + <KibanaContextProvider services={{ ...mockCore() }}> + <Router history={history}>{component}</Router> + </KibanaContextProvider> + ); if (wrapReduxStore) { return helper( diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/rtl_helpers.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/rtl_helpers.tsx index 8f9264f4671b6..395c9d8bfb23a 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/rtl_helpers.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/rtl_helpers.tsx @@ -6,6 +6,7 @@ */ import React, { ReactElement, ReactNode } from 'react'; +import { i18n } from '@kbn/i18n'; import { of } from 'rxjs'; // eslint-disable-next-line import/no-extraneous-dependencies import { @@ -22,14 +23,16 @@ import { createMemoryHistory, History } from 'history'; import { CoreStart } from '@kbn/core/public'; import { I18nProvider } from '@kbn/i18n-react'; import { coreMock } from '@kbn/core/public/mocks'; -import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public'; import { KibanaContextProvider, KibanaServices } from '@kbn/kibana-react-plugin/public'; + import { triggersActionsUiMock } from '@kbn/triggers-actions-ui-plugin/public/mocks'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; import { unifiedSearchPluginMock } from '@kbn/unified-search-plugin/public/mocks'; import { Store } from 'redux'; import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; +import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; +import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; import { stringifyUrlParams } from './url_params/stringify_url_params'; import { mockState } from '../__mocks__/uptime_store.mock'; import { MountWithReduxProvider } from './helper_with_redux'; @@ -158,9 +161,16 @@ export const mockCore: () => Partial<CoreStart> = () => { exploratoryView: { createExploratoryViewUrl: jest.fn(), getAppDataView: jest.fn(), - ExploratoryViewEmbeddable: () => <div>Embeddable exploratory view</div>, + ExploratoryViewEmbeddable: () => ( + <div> + {i18n.translate('xpack.uptime.core.div.embeddableExploratoryViewLabel', { + defaultMessage: 'Embeddable exploratory view', + })} + </div> + ), }, unifiedSearch: unifiedSearchPluginMock.createStartContract(), + charts: chartPluginMock.createStartContract(), }; return core; diff --git a/x-pack/solutions/observability/plugins/uptime/public/plugin.ts b/x-pack/solutions/observability/plugins/uptime/public/plugin.ts index b2558fe83e33b..dca8c8baa19e3 100644 --- a/x-pack/solutions/observability/plugins/uptime/public/plugin.ts +++ b/x-pack/solutions/observability/plugins/uptime/public/plugin.ts @@ -55,6 +55,7 @@ import { ObservabilityAIAssistantPublicStart, ObservabilityAIAssistantPublicSetup, } from '@kbn/observability-ai-assistant-plugin/public'; +import type { ChartsPluginStart } from '@kbn/charts-plugin/public'; import { PLUGIN } from '../common/constants/plugin'; import { UptimeConfig } from '../common/config'; import { @@ -105,6 +106,7 @@ export interface ClientPluginsStart { docLinks: DocLinksStart; uiSettings: CoreStart['uiSettings']; usageCollection: UsageCollectionStart; + charts: ChartsPluginStart; } export interface UptimePluginServices extends Partial<CoreStart> { diff --git a/x-pack/solutions/observability/plugins/uptime/tsconfig.json b/x-pack/solutions/observability/plugins/uptime/tsconfig.json index 5de407dc03b8c..6761601deb208 100644 --- a/x-pack/solutions/observability/plugins/uptime/tsconfig.json +++ b/x-pack/solutions/observability/plugins/uptime/tsconfig.json @@ -36,7 +36,6 @@ "@kbn/core-http-browser", "@kbn/es-query", "@kbn/data-views-plugin", - "@kbn/ui-theme", "@kbn/rule-data-utils", "@kbn/kibana-utils-plugin", "@kbn/data-plugin", @@ -79,6 +78,7 @@ "@kbn/deeplinks-observability", "@kbn/ebt-tools", "@kbn/core-rendering-browser", + "@kbn/charts-plugin", ], "exclude": ["target/**/*"] } diff --git a/x-pack/solutions/security/packages/data_table/README.md b/x-pack/solutions/security/packages/data_table/README.md index 1cea501e31e30..9c86c3ea6e643 100644 --- a/x-pack/solutions/security/packages/data_table/README.md +++ b/x-pack/solutions/security/packages/data_table/README.md @@ -11,10 +11,10 @@ Standalone examples will follow. In the meantime: Consult the following file to get the idea of what is necessary to reuse the component -`x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx` +`x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/index.tsx` The following file: -`kibana/x-pack/plugins/security_solution/public/common/store/reducer.ts` +`kibana/x-pack/solutions/security/plugins/security_solution/public/common/store/reducer.ts` showcases the redux store setup for the package. diff --git a/x-pack/solutions/security/packages/expandable-flyout/README.md b/x-pack/solutions/security/packages/expandable-flyout/README.md index 003df10e222e5..de1e9435acad6 100644 --- a/x-pack/solutions/security/packages/expandable-flyout/README.md +++ b/x-pack/solutions/security/packages/expandable-flyout/README.md @@ -19,7 +19,7 @@ The expandable-flyout is making some strict UI design decisions: - if the window is smaller than 1600px, the flyout takes the entire browser window (minus 48px of padding on the left) - for windows bigger than 1600px, the flyout's width is 80% of the entire browser window (with a max width of 1500px for the left section, and 750px for the right section) -> While the expandable-flyout will work on very small screens, having both the right and left sections visible at the same time will not be a good experience to the user. We recommend only showing the right panel, and therefore handling this situation when you build your panels by considering hiding the actions that could open the left panel (like the expand details button in the [FlyoutNavigation](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.tsx)). +> While the expandable-flyout will work on very small screens, having both the right and left sections visible at the same time will not be a good experience to the user. We recommend only showing the right panel, and therefore handling this situation when you build your panels by considering hiding the actions that could open the left panel (like the expand details button in the [FlyoutNavigation](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_navigation.tsx)). ## State persistence @@ -35,7 +35,7 @@ The second way (done by setting the `urlKey` prop to a string value) saves the s **_Note: the word `memory` cannot be used as an `urlKey` as it is reserved for the memory storage behavior. You can use any other string value, try to use something that should be unique._** -> We highly recommend NOT nesting flyouts in your code, as it would cause conflicts for the url keys. We recommend instead to build multiple panels, with each their own context to manage their data (for example, take a look at the Security Solution [setup](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/flyout)). +> We highly recommend NOT nesting flyouts in your code, as it would cause conflicts for the url keys. We recommend instead to build multiple panels, with each their own context to manage their data (for example, take a look at the Security Solution [setup](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/flyout)). > > A good solution is for example to have one instance of a flyout at a page level, and then have multiple panels that can be opened in that flyout. diff --git a/x-pack/solutions/security/packages/features/src/security/types.ts b/x-pack/solutions/security/packages/features/src/security/types.ts index d069657070fc6..dda61b6e86b9a 100644 --- a/x-pack/solutions/security/packages/features/src/security/types.ts +++ b/x-pack/solutions/security/packages/features/src/security/types.ts @@ -14,7 +14,7 @@ export interface SecurityFeatureParams { * Unfortunately these can't be properly Typed due to it requiring an * import directly from the Security Solution plugin. The list of `keys` in this * object are defined here: - * @see https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/common/experimental_features.ts#L14 + * @see https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/common/experimental_features.ts#L14 */ experimentalFeatures: Record<string, boolean>; savedObjects: string[]; diff --git a/x-pack/packages/kbn-cloud-security-posture/storybook/config/README.mdx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/README.mdx similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/storybook/config/README.mdx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/README.mdx diff --git a/x-pack/packages/kbn-cloud-security-posture/storybook/config/babel_with_emotion.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/babel_with_emotion.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/storybook/config/babel_with_emotion.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/babel_with_emotion.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/storybook/config/constants.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/constants.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/storybook/config/constants.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/constants.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/storybook/config/index.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/index.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/storybook/config/index.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/index.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/storybook/config/main.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/main.ts similarity index 89% rename from x-pack/packages/kbn-cloud-security-posture/storybook/config/main.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/main.ts index 4e7fca030c2f6..2d455283571a3 100644 --- a/x-pack/packages/kbn-cloud-security-posture/storybook/config/main.ts +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/main.ts @@ -9,7 +9,7 @@ import { defaultConfig } from '@kbn/storybook'; module.exports = { ...defaultConfig, - stories: ['../../**/*.stories.+(tsx|mdx)'], + stories: ['../**/*.stories.+(tsx|mdx)'], reactOptions: { strictMode: true, }, diff --git a/x-pack/packages/kbn-cloud-security-posture/storybook/config/manager.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/manager.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/storybook/config/manager.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/manager.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/storybook/config/package.json b/x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/package.json similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/storybook/config/package.json rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/package.json diff --git a/x-pack/packages/kbn-cloud-security-posture/storybook/config/preview.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/preview.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/storybook/config/preview.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/preview.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/storybook/config/styles.css b/x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/styles.css similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/storybook/config/styles.css rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/styles.css diff --git a/x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/tsconfig.json b/x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/tsconfig.json new file mode 100644 index 0000000000000..6126ec1825c9e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": ["jest", "node", "@kbn/ambient-storybook-types"] + }, + "include": ["**/*.ts"], + "kbn_references": ["@kbn/storybook"], + "exclude": ["target/**/*"] +} diff --git a/x-pack/packages/kbn-cloud-security-posture/README.md b/x-pack/solutions/security/packages/kbn-cloud-security-posture/README.md similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/README.md rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/README.md diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/README.md b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/README.md similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/README.md rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/README.md diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/index.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/index.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/index.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/index.ts diff --git a/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/jest.config.js b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/jest.config.js new file mode 100644 index 0000000000000..3933698808c14 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/jest.config.js @@ -0,0 +1,20 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + roots: ['<rootDir>/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph'], + rootDir: '../../../../../..', + transform: { + '^.+\\.(js|tsx?)$': + '<rootDir>/x-pack/solutions/security/packages/kbn-cloud-security-posture/.storybook/babel_with_emotion.ts', + }, + setupFiles: ['jest-canvas-mock'], + setupFilesAfterEnv: [ + '<rootDir>/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/setup_tests.ts', + ], +}; diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/kibana.jsonc b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/kibana.jsonc similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/kibana.jsonc rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/kibana.jsonc diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/package.json b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/package.json similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/package.json rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/package.json diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/setup_tests.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/setup_tests.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/setup_tests.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/setup_tests.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/assets/icons/aws.svg b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/assets/icons/aws.svg similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/assets/icons/aws.svg rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/assets/icons/aws.svg diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/assets/icons/aws_ec2.svg b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/assets/icons/aws_ec2.svg similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/assets/icons/aws_ec2.svg rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/assets/icons/aws_ec2.svg diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/assets/icons/aws_s3.svg b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/assets/icons/aws_s3.svg similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/assets/icons/aws_s3.svg rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/assets/icons/aws_s3.svg diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/assets/icons/okta.svg b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/assets/icons/okta.svg similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/assets/icons/okta.svg rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/assets/icons/okta.svg diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/common/constants.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/common/constants.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/common/constants.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/common/constants.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/edge/deafult_edge.stories.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/edge/deafult_edge.stories.tsx similarity index 96% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/edge/deafult_edge.stories.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/edge/deafult_edge.stories.tsx index 4d6c689dd643b..dd1c956a55e55 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/edge/deafult_edge.stories.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/edge/deafult_edge.stories.tsx @@ -88,11 +88,11 @@ const Template: Story<NodeViewModel> = (args: NodeViewModel) => { const initialEdges = [ { - id: 'source-' + args.id, + id: `source-${args.id}`, source: 'source', target: args.id, data: { - id: 'source-' + args.id, + id: `source-${args.id}`, source: 'source', sourceShape: 'rectangle', target: args.id, @@ -103,11 +103,11 @@ const Template: Story<NodeViewModel> = (args: NodeViewModel) => { type: 'default', }, { - id: args.id + '-target', + id: `${args.id}-target`, source: args.id, target: 'target', data: { - id: args.id + '-target', + id: `${args.id}-target`, source: args.id, sourceShape: 'label', target: 'target', diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/edge/default_edge.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/edge/default_edge.tsx similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/edge/default_edge.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/edge/default_edge.tsx diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/edge/index.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/edge/index.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/edge/index.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/edge/index.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/edge/styles.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/edge/styles.tsx similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/edge/styles.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/edge/styles.tsx diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/edge/utils.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/edge/utils.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/edge/utils.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/edge/utils.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.test.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.test.tsx similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.test.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.test.tsx diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph_popover.stories.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/graph_popover.stories.tsx similarity index 93% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph_popover.stories.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/graph_popover.stories.tsx index 6d5b3c1b372fc..a4561f404829a 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph_popover.stories.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/graph_popover.stories.tsx @@ -6,9 +6,8 @@ */ import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import { ThemeProvider } from '@emotion/react'; +import { ThemeProvider, css } from '@emotion/react'; import { Story } from '@storybook/react'; -import { css } from '@emotion/react'; import { EuiListGroup, EuiHorizontalRule } from '@elastic/eui'; import type { EntityNodeViewModel, NodeProps } from '..'; import { Graph } from '..'; @@ -77,6 +76,7 @@ const useExpandButtonPopover = () => { closePopover(); }, [closePopover]); + // eslint-disable-next-line react/display-name const PopoverComponent = memo(() => ( <GraphPopover panelPaddingSize="s" @@ -130,6 +130,7 @@ const useExpandButtonPopover = () => { const useNodePopover = () => { const { id, state, actions } = useGraphPopover('node-popover'); + // eslint-disable-next-line react/display-name const PopoverComponent = memo(() => ( <GraphPopover panelPaddingSize="s" @@ -137,6 +138,7 @@ const useNodePopover = () => { isOpen={state.isOpen} anchorElement={state.anchorElement} closePopover={actions.closePopover} + // eslint-disable-next-line react/jsx-no-literals > TODO </GraphPopover> @@ -160,17 +162,21 @@ const Template: Story = () => { const popovers = [expandNodePopover, nodePopover]; const isPopoverOpen = popovers.some((popover) => popover.state.isOpen); + // eslint-disable-next-line @typescript-eslint/no-explicit-any const popoverOpenWrapper = (cb: Function, ...args: any[]) => { [expandNodePopover.actions.closePopover, nodePopover.actions.closePopover].forEach( (closePopover) => { closePopover(); } ); + // eslint-disable-next-line prefer-spread cb.apply(null, args); }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any const expandButtonClickHandler = (...args: any[]) => popoverOpenWrapper(expandNodePopover.onNodeExpandButtonClick, ...args); + // eslint-disable-next-line @typescript-eslint/no-explicit-any const nodeClickHandler = (...args: any[]) => popoverOpenWrapper(nodePopover.onNodeClick, ...args); const nodes: EntityNodeViewModel[] = useMemo( diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph_popover.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/graph_popover.tsx similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph_popover.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/graph_popover.tsx diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/layout_graph.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/layout_graph.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/layout_graph.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/layout_graph.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/use_graph_popover.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/use_graph_popover.tsx similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/use_graph_popover.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/use_graph_popover.tsx diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/utils.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/utils.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/utils.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph/utils.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_investigation.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_investigation.tsx similarity index 89% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_investigation.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_investigation.tsx index 081b4ec28c6a5..bd57082ba4cb9 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_investigation.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_investigation.tsx @@ -126,21 +126,46 @@ const useGraphPopovers = ( }; interface GraphInvestigationProps { - dataView: DataView; - eventIds: string[]; - timestamp: string | null; + /** + * The initial state to use for the graph investigation view. + */ + initialState: { + /** + * The data view to use for the graph investigation view. + */ + dataView: DataView; + + /** + * The origin events for the graph investigation view. + */ + originEventIds: Array<{ + /** + * The ID of the origin event. + */ + id: string; + + /** + * A flag indicating whether the origin event is an alert or not. + */ + isAlert: boolean; + }>; + + /** + * The initial timerange for the graph investigation view. + */ + timeRange: TimeRange; + }; } /** * Graph investigation view allows the user to expand nodes and view related entities. */ export const GraphInvestigation: React.FC<GraphInvestigationProps> = memo( - ({ dataView, eventIds, timestamp = new Date().toISOString() }: GraphInvestigationProps) => { + ({ + initialState: { dataView, originEventIds, timeRange: initialTimeRange }, + }: GraphInvestigationProps) => { const [searchFilters, setSearchFilters] = useState<Filter[]>(() => []); - const [timeRange, setTimeRange] = useState<TimeRange>({ - from: `${timestamp}||-30m`, - to: `${timestamp}||+30m`, - }); + const [timeRange, setTimeRange] = useState<TimeRange>(initialTimeRange); const { services: { uiSettings }, @@ -153,7 +178,7 @@ export const GraphInvestigation: React.FC<GraphInvestigationProps> = memo( [...searchFilters], getEsQueryConfig(uiSettings as Parameters<typeof getEsQueryConfig>[0]) ), - [searchFilters, dataView, uiSettings] + [dataView, searchFilters, uiSettings] ); const { nodeExpandPopover, openPopoverCallback } = useGraphPopovers( @@ -166,7 +191,7 @@ export const GraphInvestigation: React.FC<GraphInvestigationProps> = memo( const { data, refresh, isFetching } = useFetchGraphData({ req: { query: { - eventIds, + originEventIds, esQuery: query, start: timeRange.from, end: timeRange.to, diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_node_expand_popover.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_node_expand_popover.tsx similarity index 75% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_node_expand_popover.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_node_expand_popover.tsx index c22f8dbe51ace..2fd10aa5c8c29 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_node_expand_popover.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_node_expand_popover.tsx @@ -47,25 +47,34 @@ export const GraphNodeExpandPopover: React.FC<GraphNodeExpandPopoverProps> = mem <EuiListGroup gutterSize="none" bordered={false} flush={true}> <ExpandPopoverListItem iconType="users" - label={i18n.translate('xpack.csp.graph.graphNodeExpandPopover.showActionsByEntity', { - defaultMessage: 'Show actions by this entity', - })} + label={i18n.translate( + 'securitySolutionPackages.csp.graph.graphNodeExpandPopover.showActionsByEntity', + { + defaultMessage: 'Show actions by this entity', + } + )} onClick={onShowActionsByEntityClick} data-test-subj={GRAPH_NODE_POPOVER_SHOW_ACTIONS_BY_ITEM_ID} /> <ExpandPopoverListItem iconType="storage" - label={i18n.translate('xpack.csp.graph.graphNodeExpandPopover.showActionsOnEntity', { - defaultMessage: 'Show actions on this entity', - })} + label={i18n.translate( + 'securitySolutionPackages.csp.graph.graphNodeExpandPopover.showActionsOnEntity', + { + defaultMessage: 'Show actions on this entity', + } + )} onClick={onShowActionsOnEntityClick} data-test-subj={GRAPH_NODE_POPOVER_SHOW_ACTIONS_ON_ITEM_ID} /> <ExpandPopoverListItem iconType="visTagCloud" - label={i18n.translate('xpack.csp.graph.graphNodeExpandPopover.showRelatedEvents', { - defaultMessage: 'Show related events', - })} + label={i18n.translate( + 'securitySolutionPackages.csp.graph.graphNodeExpandPopover.showRelatedEvents', + { + defaultMessage: 'Show related events', + } + )} onClick={onShowRelatedEntitiesClick} data-test-subj={GRAPH_NODE_POPOVER_SHOW_RELATED_ITEM_ID} /> diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/use_graph_node_expand_popover.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/use_graph_node_expand_popover.tsx similarity index 98% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/use_graph_node_expand_popover.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/use_graph_node_expand_popover.tsx index 90e8f66510cc0..520df39c8b47a 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/use_graph_node_expand_popover.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/use_graph_node_expand_popover.tsx @@ -60,6 +60,8 @@ export const useGraphNodeExpandPopover = ({ // PopoverComponent is a memoized component that renders the GraphNodeExpandPopover // It handles the display of the popover and the actions that can be performed on the node + + // eslint-disable-next-line react/display-name const PopoverComponent = memo(() => ( <GraphNodeExpandPopover isOpen={state.isOpen} diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_layout.stories.test.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph_layout.stories.test.tsx similarity index 98% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_layout.stories.test.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph_layout.stories.test.tsx index 77da232f27bd3..6cf859bca9397 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_layout.stories.test.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph_layout.stories.test.tsx @@ -73,6 +73,7 @@ describe('GraphLargeStackedEdgeCases story', () => { // Same label can appear more than once in the graph, so we skip them if already scanned if (labelElements.has(id!)) { + // eslint-disable-next-line no-continue continue; } labelElements.add(id!); diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_layout.stories.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph_layout.stories.tsx similarity index 98% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_layout.stories.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph_layout.stories.tsx index e576a5abf030e..21a75d2500fec 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_layout.stories.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/graph_layout.stories.tsx @@ -6,10 +6,9 @@ */ import React from 'react'; -import { ThemeProvider } from '@emotion/react'; +import { ThemeProvider, css } from '@emotion/react'; import { Story } from '@storybook/react'; import { Writable } from '@kbn/utility-types'; -import { css } from '@emotion/react'; import type { EdgeViewModel, LabelNodeViewModel, @@ -515,7 +514,7 @@ GraphLargeStackedEdgeCases.args = { id: 'a(oktauser)-b(hackeruser)', source: 'oktauser', target: 'hackeruser', - label: 'CreateUser' + idx, + label: `CreateUser${idx}`, color: 'primary', shape: 'label', })), @@ -525,7 +524,7 @@ GraphLargeStackedEdgeCases.args = { id: 'a(siem-windows)-b(user)', source: 'siem-windows', target: 'user', - label: 'User login to OKTA' + idx, + label: `User login to OKTA${idx}`, color: 'danger', shape: 'label', })), diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/index.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/index.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/index.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/index.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/mock/react_flow.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/mock/react_flow.ts similarity index 96% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/mock/react_flow.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/mock/react_flow.ts index 35282dedcc6de..d28a50ba20c33 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/mock/react_flow.ts +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/mock/react_flow.ts @@ -60,6 +60,7 @@ export const mockReactFlow = () => { }, }); + // eslint-disable-next-line @typescript-eslint/no-explicit-any (global.SVGElement as any).prototype.getBBox = () => ({ x: 0, y: 0, diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/mock/test_providers.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/mock/test_providers.tsx similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/mock/test_providers.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/mock/test_providers.tsx diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/button.stories.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/button.stories.tsx similarity index 95% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/button.stories.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/button.stories.tsx index 4a034c05ee166..7dc46ac6eb82c 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/button.stories.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/button.stories.tsx @@ -5,6 +5,8 @@ * 2.0. */ +/* eslint-disable react/jsx-no-literals */ + import React from 'react'; import { ThemeProvider } from '@emotion/react'; import { Story } from '@storybook/react'; diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/diamond_node.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/diamond_node.tsx similarity index 96% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/diamond_node.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/diamond_node.tsx index 75ad989b625e8..c974c0c9a60e6 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/diamond_node.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/diamond_node.tsx @@ -24,6 +24,7 @@ import { NodeExpandButton } from './node_expand_button'; const NODE_WIDTH = 99; const NODE_HEIGHT = 98; +// eslint-disable-next-line react/display-name export const DiamondNode: React.FC<NodeProps> = memo((props: NodeProps) => { const { id, color, icon, label, interactive, expandButtonClick, nodeClick } = props.data as EntityNodeViewModel; @@ -80,7 +81,7 @@ export const DiamondNode: React.FC<NodeProps> = memo((props: NodeProps) => { style={HandleStyleOverride} /> </NodeShapeContainer> - <NodeLabel>{Boolean(label) ? label : id}</NodeLabel> + <NodeLabel>{label ? label : id}</NodeLabel> </> ); }); diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/edge_group_node.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/edge_group_node.tsx similarity index 96% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/edge_group_node.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/edge_group_node.tsx index a3dd064d16ab7..05a61977cdcb1 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/edge_group_node.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/edge_group_node.tsx @@ -10,6 +10,7 @@ import { Handle, NodeResizeControl, Position } from '@xyflow/react'; import { HandleStyleOverride } from './styles'; import type { NodeProps } from '../types'; +// eslint-disable-next-line react/display-name export const EdgeGroupNode: React.FC<NodeProps> = memo((props: NodeProps) => { // Handles order horizontally is: in > inside > out > outside return ( diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/ellipse_node.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/ellipse_node.tsx similarity index 96% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/ellipse_node.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/ellipse_node.tsx index c9bd363130dca..7fccea3b6bcf6 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/ellipse_node.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/ellipse_node.tsx @@ -24,6 +24,7 @@ import { NodeExpandButton } from './node_expand_button'; const NODE_WIDTH = 90; const NODE_HEIGHT = 90; +// eslint-disable-next-line react/display-name export const EllipseNode: React.FC<NodeProps> = memo((props: NodeProps) => { const { id, color, icon, label, interactive, expandButtonClick, nodeClick } = props.data as EntityNodeViewModel; @@ -80,7 +81,7 @@ export const EllipseNode: React.FC<NodeProps> = memo((props: NodeProps) => { style={HandleStyleOverride} /> </NodeShapeContainer> - <NodeLabel>{Boolean(label) ? label : id}</NodeLabel> + <NodeLabel>{label ? label : id}</NodeLabel> </> ); }); diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/get_span_icon.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/get_span_icon.ts similarity index 91% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/get_span_icon.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/get_span_icon.ts index 9aa77f03c3eb6..b5d092ddf25ef 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/get_span_icon.ts +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/get_span_icon.ts @@ -10,6 +10,7 @@ import awsEc2Icon from '../../assets/icons/aws_ec2.svg'; import awsS3Icon from '../../assets/icons/aws_s3.svg'; import oktaIcon from '../../assets/icons/okta.svg'; +// eslint-disable-next-line @typescript-eslint/no-explicit-any const icons: Record<string, any> = { aws: awsIcon, aws_ec2: awsEc2Icon, diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/hexagon_node.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/hexagon_node.tsx similarity index 96% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/hexagon_node.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/hexagon_node.tsx index 9d155999e76ca..ca90094344072 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/hexagon_node.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/hexagon_node.tsx @@ -24,6 +24,7 @@ import { NodeExpandButton } from './node_expand_button'; const NODE_WIDTH = 87; const NODE_HEIGHT = 96; +// eslint-disable-next-line react/display-name export const HexagonNode: React.FC<NodeProps> = memo((props: NodeProps) => { const { id, color, icon, label, interactive, expandButtonClick, nodeClick } = props.data as EntityNodeViewModel; @@ -80,7 +81,7 @@ export const HexagonNode: React.FC<NodeProps> = memo((props: NodeProps) => { style={HandleStyleOverride} /> </NodeShapeContainer> - <NodeLabel>{Boolean(label) ? label : id}</NodeLabel> + <NodeLabel>{label ? label : id}</NodeLabel> </> ); }); diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/index.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/index.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/index.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/index.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/label_node.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/label_node.tsx similarity index 93% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/label_node.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/label_node.tsx index 2f23e5ab07513..62ee671659662 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/label_node.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/label_node.tsx @@ -10,6 +10,7 @@ import { Handle, Position } from '@xyflow/react'; import { LabelNodeContainer, LabelShape, HandleStyleOverride, LabelShapeOnHover } from './styles'; import type { LabelNodeViewModel, NodeProps } from '../types'; +// eslint-disable-next-line react/display-name export const LabelNode: React.FC<NodeProps> = memo((props: NodeProps) => { const { id, color, label, interactive } = props.data as LabelNodeViewModel; @@ -17,7 +18,7 @@ export const LabelNode: React.FC<NodeProps> = memo((props: NodeProps) => { <LabelNodeContainer> {interactive && <LabelShapeOnHover color={color} />} <LabelShape color={color} textAlign="center"> - {Boolean(label) ? label : id} + {label ? label : id} </LabelShape> <Handle type="target" diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/node.stories.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/node.stories.tsx similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/node.stories.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/node.stories.tsx diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/node_expand_button.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/node_expand_button.tsx similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/node_expand_button.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/node_expand_button.tsx diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/pentagon_node.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/pentagon_node.tsx similarity index 96% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/pentagon_node.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/pentagon_node.tsx index f2745cef7ec80..159f78a83b279 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/pentagon_node.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/pentagon_node.tsx @@ -29,6 +29,7 @@ const PentagonShapeOnHover = styled(NodeShapeOnHoverSvg)` const NODE_WIDTH = 91; const NODE_HEIGHT = 88; +// eslint-disable-next-line react/display-name export const PentagonNode: React.FC<NodeProps> = memo((props: NodeProps) => { const { id, color, icon, label, interactive, expandButtonClick, nodeClick } = props.data as EntityNodeViewModel; @@ -85,7 +86,7 @@ export const PentagonNode: React.FC<NodeProps> = memo((props: NodeProps) => { style={HandleStyleOverride} /> </NodeShapeContainer> - <NodeLabel>{Boolean(label) ? label : id}</NodeLabel> + <NodeLabel>{label ? label : id}</NodeLabel> </> ); }); diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/rectangle_node.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/rectangle_node.tsx similarity index 96% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/rectangle_node.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/rectangle_node.tsx index f85b102c7e445..6884974982838 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/rectangle_node.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/rectangle_node.tsx @@ -24,6 +24,7 @@ import { NodeExpandButton } from './node_expand_button'; const NODE_WIDTH = 81; const NODE_HEIGHT = 80; +// eslint-disable-next-line react/display-name export const RectangleNode: React.FC<NodeProps> = memo((props: NodeProps) => { const { id, color, icon, label, interactive, expandButtonClick, nodeClick } = props.data as EntityNodeViewModel; @@ -80,7 +81,7 @@ export const RectangleNode: React.FC<NodeProps> = memo((props: NodeProps) => { style={HandleStyleOverride} /> </NodeShapeContainer> - <NodeLabel>{Boolean(label) ? label : id}</NodeLabel> + <NodeLabel>{label ? label : id}</NodeLabel> </> ); }); diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/diamond_shape.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/diamond_shape.tsx similarity index 98% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/diamond_shape.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/diamond_shape.tsx index 126a5702cf5d0..0f0cce4e744c7 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/diamond_shape.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/diamond_shape.tsx @@ -8,6 +8,7 @@ import React, { memo } from 'react'; import type { HoverShapeProps, ShapeProps } from './types'; +// eslint-disable-next-line react/display-name export const DiamondHoverShape: React.FC<HoverShapeProps> = memo(({ stroke }) => ( <path opacity="0.5" @@ -17,6 +18,7 @@ export const DiamondHoverShape: React.FC<HoverShapeProps> = memo(({ stroke }) => /> )); +// eslint-disable-next-line react/display-name export const DiamondShape: React.FC<ShapeProps> = memo(({ stroke, fill }) => ( <path d="M34.1967 3.01041C37.1256 0.0814755 41.8744 0.0814755 44.8033 3.01041L75.4896 33.6967C78.4185 36.6256 78.4185 41.3744 75.4896 44.3033L44.8033 74.9896C41.8744 77.9185 37.1256 77.9185 34.1967 74.9896L3.51041 44.3033C0.581475 41.3744 0.581475 36.6256 3.51041 33.6967L34.1967 3.01041Z" diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/ellipse_shape.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/ellipse_shape.tsx similarity index 87% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/ellipse_shape.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/ellipse_shape.tsx index 18fe56440c5f5..ef2f8452cf206 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/ellipse_shape.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/ellipse_shape.tsx @@ -8,10 +8,12 @@ import React, { memo } from 'react'; import type { HoverShapeProps, ShapeProps } from './types'; +// eslint-disable-next-line react/display-name export const EllipseHoverShape: React.FC<HoverShapeProps> = memo(({ stroke }) => ( <circle opacity="0.5" cx="45" cy="45" r="44.5" stroke={stroke} strokeDasharray="2 2" /> )); +// eslint-disable-next-line react/display-name export const EllipseShape: React.FC<ShapeProps> = memo(({ stroke, fill }) => ( <circle cx="36" cy="36" r="35.5" fill={fill} stroke={stroke} /> )); diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/hexagon_shape.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/hexagon_shape.tsx similarity index 98% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/hexagon_shape.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/hexagon_shape.tsx index 12aeebec88605..133c6e4a035c7 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/hexagon_shape.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/hexagon_shape.tsx @@ -8,6 +8,7 @@ import React, { memo } from 'react'; import type { HoverShapeProps, ShapeProps } from './types'; +// eslint-disable-next-line react/display-name export const HexagonHoverShape: React.FC<HoverShapeProps> = memo(({ stroke }) => ( <path opacity="0.5" @@ -17,6 +18,7 @@ export const HexagonHoverShape: React.FC<HoverShapeProps> = memo(({ stroke }) => /> )); +// eslint-disable-next-line react/display-name export const HexagonShape: React.FC<ShapeProps> = memo(({ stroke, fill }) => ( <path d="M31.75 1.74241C34.0705 0.402668 36.9295 0.402668 39.25 1.74241L65.891 17.1236C68.2115 18.4634 69.641 20.9393 69.641 23.6188V54.3812C69.641 57.0607 68.2115 59.5366 65.891 60.8764L39.25 76.2576C36.9295 77.5973 34.0705 77.5973 31.75 76.2576L5.10898 60.8764C2.78847 59.5366 1.35898 57.0607 1.35898 54.3812V23.6188C1.35898 20.9393 2.78847 18.4634 5.10898 17.1236L31.75 1.74241Z" diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/pentagon_shape.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/pentagon_shape.tsx similarity index 98% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/pentagon_shape.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/pentagon_shape.tsx index f4d07fc69db79..ea43efed36a48 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/pentagon_shape.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/pentagon_shape.tsx @@ -8,6 +8,7 @@ import React, { memo } from 'react'; import type { HoverShapeProps, ShapeProps } from './types'; +// eslint-disable-next-line react/display-name export const PentagonHoverShape: React.FC<HoverShapeProps> = memo(({ stroke }) => ( <path opacity="0.5" @@ -17,6 +18,7 @@ export const PentagonHoverShape: React.FC<HoverShapeProps> = memo(({ stroke }) = /> )); +// eslint-disable-next-line react/display-name export const PentagonShape: React.FC<ShapeProps> = memo(({ stroke, fill }) => ( <path d="M33.0916 2.82091C35.7203 0.911085 39.2797 0.911086 41.9084 2.82092L70.5461 23.6274C73.1747 25.5373 74.2747 28.9225 73.2706 32.0127L62.332 65.6783C61.3279 68.7685 58.4483 70.8607 55.1991 70.8607H19.8009C16.5517 70.8607 13.6721 68.7685 12.668 65.6783L1.72938 32.0127C0.725323 28.9225 1.82526 25.5373 4.45392 23.6274L33.0916 2.82091Z" diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/rectangle_shape.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/rectangle_shape.tsx similarity index 88% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/rectangle_shape.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/rectangle_shape.tsx index 7d019ce331baf..28e55c8ea117c 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/rectangle_shape.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/rectangle_shape.tsx @@ -8,6 +8,7 @@ import React, { memo } from 'react'; import type { HoverShapeProps, ShapeProps } from './types'; +// eslint-disable-next-line react/display-name export const RectangleHoverShape: React.FC<HoverShapeProps> = memo(({ stroke }) => ( <rect opacity="0.5" @@ -21,6 +22,7 @@ export const RectangleHoverShape: React.FC<HoverShapeProps> = memo(({ stroke }) /> )); +// eslint-disable-next-line react/display-name export const RectangleShape: React.FC<ShapeProps> = memo(({ stroke, fill }) => ( <rect x="1" y="0.5" width="63" height="63" rx="7.5" fill={fill} stroke={stroke} /> )); diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/types.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/types.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/types.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/shapes/types.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/styles.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/styles.tsx similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/styles.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/node/styles.tsx diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/styles.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/styles.tsx similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/styles.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/styles.tsx diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/test_ids.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/test_ids.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/components/test_ids.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/test_ids.ts diff --git a/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/types.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/types.ts new file mode 100644 index 0000000000000..b09f6a29f6c62 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/components/types.ts @@ -0,0 +1,68 @@ +/* + * 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 { + EntityNodeDataModel, + GroupNodeDataModel, + LabelNodeDataModel, + EdgeDataModel, + NodeShape, +} from '@kbn/cloud-security-posture-common/types/graph/latest'; +import type { Node, NodeProps as xyNodeProps, Edge, EdgeProps as xyEdgeProps } from '@xyflow/react'; + +export interface Size { + width: number; + height: number; +} + +interface BaseNodeDataViewModel { + interactive?: boolean; +} + +export type NodeClickCallback = (e: React.MouseEvent<HTMLElement>, node: NodeProps) => void; + +export type ExpandButtonClickCallback = ( + e: React.MouseEvent<HTMLElement>, + node: NodeProps, + unToggleCallback: () => void +) => void; + +export interface EntityNodeViewModel + extends Record<string, unknown>, + EntityNodeDataModel, + BaseNodeDataViewModel { + expandButtonClick?: ExpandButtonClickCallback; + nodeClick?: NodeClickCallback; +} + +export interface GroupNodeViewModel + extends Record<string, unknown>, + GroupNodeDataModel, + BaseNodeDataViewModel {} + +export interface LabelNodeViewModel + extends Record<string, unknown>, + LabelNodeDataModel, + BaseNodeDataViewModel { + expandButtonClick?: ExpandButtonClickCallback; +} + +export type NodeViewModel = EntityNodeViewModel | GroupNodeViewModel | LabelNodeViewModel; + +export type NodeProps = xyNodeProps<Node<NodeViewModel>>; + +export interface EdgeViewModel extends Record<string, unknown>, EdgeDataModel {} + +export type EdgeProps = xyEdgeProps< + Edge< + EdgeViewModel & { + sourceShape: NodeShape; + targetShape: NodeShape; + } + > +>; diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/index.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/hooks/index.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/index.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/hooks/index.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.test.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.test.tsx similarity index 95% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.test.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.test.tsx index e494ff0957ecb..da5eaee9bfbf9 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.test.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.test.tsx @@ -33,7 +33,7 @@ describe('useFetchGraphData', () => { return useFetchGraphData({ req: { query: { - eventIds: [], + originEventIds: [], start: '2021-09-01T00:00:00.000Z', end: '2021-09-01T23:59:59.999Z', }, @@ -52,7 +52,7 @@ describe('useFetchGraphData', () => { return useFetchGraphData({ req: { query: { - eventIds: [], + originEventIds: [], start: '2021-09-01T00:00:00.000Z', end: '2021-09-01T23:59:59.999Z', }, @@ -75,7 +75,7 @@ describe('useFetchGraphData', () => { return useFetchGraphData({ req: { query: { - eventIds: [], + originEventIds: [], start: '2021-09-01T00:00:00.000Z', end: '2021-09-01T23:59:59.999Z', }, @@ -98,7 +98,7 @@ describe('useFetchGraphData', () => { return useFetchGraphData({ req: { query: { - eventIds: [], + originEventIds: [], start: '2021-09-01T00:00:00.000Z', end: '2021-09-01T23:59:59.999Z', }, diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.ts similarity index 94% rename from x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.ts index 74cca4693e801..477492a3bbb7b 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.ts +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.ts @@ -81,13 +81,13 @@ export const useFetchGraphData = ({ options, }: UseFetchGraphDataParams): UseFetchGraphDataResult => { const queryClient = useQueryClient(); - const { esQuery, eventIds, start, end } = req.query; + const { esQuery, originEventIds, start, end } = req.query; const { services: { http }, } = useKibana(); const QUERY_KEY = useMemo( - () => ['useFetchGraphData', eventIds, start, end, esQuery], - [end, esQuery, eventIds, start] + () => ['useFetchGraphData', originEventIds, start, end, esQuery], + [end, esQuery, originEventIds, start] ); const { isLoading, isError, data, isFetching } = useQuery<GraphResponse>( diff --git a/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/tsconfig.json b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/tsconfig.json new file mode 100644 index 0000000000000..711f3cb002692 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/graph/tsconfig.json @@ -0,0 +1,24 @@ +{ + "extends": "../../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "**/*.ts", + "**/*.tsx" + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/cloud-security-posture-common", + "@kbn/data-views-plugin", + "@kbn/kibana-react-plugin", + "@kbn/ui-theme", + "@kbn/utility-types", + "@kbn/unified-search-plugin", + "@kbn/es-query", + "@kbn/data-service", + "@kbn/i18n", + ] +} diff --git a/x-pack/packages/kbn-cloud-security-posture/public/index.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/index.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/index.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/index.ts diff --git a/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/jest.config.js b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/jest.config.js new file mode 100644 index 0000000000000..c5a8f9ba2694d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/jest.config.js @@ -0,0 +1,12 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/packages/kbn-cloud-security-posture/public'], +}; diff --git a/x-pack/packages/kbn-cloud-security-posture/public/kibana.jsonc b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/kibana.jsonc similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/kibana.jsonc rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/kibana.jsonc diff --git a/x-pack/packages/kbn-cloud-security-posture/public/package.json b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/package.json similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/package.json rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/package.json diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/components/csp_evaluation_badge.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/components/csp_evaluation_badge.tsx similarity index 75% rename from x-pack/packages/kbn-cloud-security-posture/public/src/components/csp_evaluation_badge.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/components/csp_evaluation_badge.tsx index f84ac26d68767..28a5b7655723a 100644 --- a/x-pack/packages/kbn-cloud-security-posture/public/src/components/csp_evaluation_badge.tsx +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/components/csp_evaluation_badge.tsx @@ -36,11 +36,20 @@ export const CspEvaluationBadge = ({ type }: Props) => ( data-test-subj={`${type}_finding`} > {type === 'failed' ? ( - <FormattedMessage id="xpack.csp.cspEvaluationBadge.failLabel" defaultMessage="Fail" /> + <FormattedMessage + id="securitySolutionPackages.csp.cspEvaluationBadge.failLabel" + defaultMessage="Fail" + /> ) : type === 'passed' ? ( - <FormattedMessage id="xpack.csp.cspEvaluationBadge.passLabel" defaultMessage="Pass" /> + <FormattedMessage + id="securitySolutionPackages.csp.cspEvaluationBadge.passLabel" + defaultMessage="Pass" + /> ) : ( - <FormattedMessage id="xpack.csp.cspEvaluationBadge.naLabel" defaultMessage="N/A" /> + <FormattedMessage + id="securitySolutionPackages.csp.cspEvaluationBadge.naLabel" + defaultMessage="N/A" + /> )} </EuiBadge> ); diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/components/vulnerability_badges.tsx b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/components/vulnerability_badges.tsx similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/src/components/vulnerability_badges.tsx rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/components/vulnerability_badges.tsx diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts similarity index 81% rename from x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts index 90c9633433cec..7175de9934a45 100644 --- a/x-pack/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/constants/navigation.ts @@ -9,20 +9,20 @@ import { CLOUD_SECURITY_POSTURE_BASE_PATH } from '@kbn/cloud-security-posture-co import { i18n } from '@kbn/i18n'; export const NAV_ITEMS_NAMES = { - DASHBOARD: i18n.translate('xpack.csp.navigation.dashboardNavItemLabel', { + DASHBOARD: i18n.translate('securitySolutionPackages.csp.navigation.dashboardNavItemLabel', { defaultMessage: 'Cloud Security Posture', }), VULNERABILITY_DASHBOARD: i18n.translate( - 'xpack.csp.navigation.vulnerabilityDashboardNavItemLabel', + 'securitySolutionPackages.csp.navigation.vulnerabilityDashboardNavItemLabel', { defaultMessage: 'Cloud Native Vulnerability Management' } ), - FINDINGS: i18n.translate('xpack.csp.navigation.findingsNavItemLabel', { + FINDINGS: i18n.translate('securitySolutionPackages.csp.navigation.findingsNavItemLabel', { defaultMessage: 'Findings', }), - BENCHMARKS: i18n.translate('xpack.csp.navigation.myBenchmarksNavItemLabel', { + BENCHMARKS: i18n.translate('securitySolutionPackages.csp.navigation.findingsNavItemLabel', { defaultMessage: 'Benchmarks', }), - RULES: i18n.translate('xpack.csp.navigation.rulesNavItemLabel', { + RULES: i18n.translate('securitySolutionPackages.csp.navigation.rulesNavItemLabel', { defaultMessage: 'Rules', }), }; diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_csp_setup_status_api.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_csp_setup_status_api.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_csp_setup_status_api.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_csp_setup_status_api.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_data_view.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_data_view.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_data_view.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_data_view.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_get_benchmark_rules_state_api.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_get_benchmark_rules_state_api.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_get_benchmark_rules_state_api.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_get_benchmark_rules_state_api.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_get_navigation_url_params.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_get_navigation_url_params.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_get_navigation_url_params.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_get_navigation_url_params.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_has_misconfigurations.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_has_misconfigurations.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_has_misconfigurations.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_has_misconfigurations.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_has_vulnerabilities.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_has_vulnerabilities.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_has_vulnerabilities.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_has_vulnerabilities.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_misconfiguration_findings.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_misconfiguration_findings.ts similarity index 96% rename from x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_misconfiguration_findings.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_misconfiguration_findings.ts index 9bbaedf587dde..fa060738651a1 100644 --- a/x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_misconfiguration_findings.ts +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_misconfiguration_findings.ts @@ -37,6 +37,7 @@ export const useMisconfigurationFindings = (options: UseCspOptions) => { rawResponse: { hits, aggregations }, } = await lastValueFrom( data.search.search<LatestFindingsRequest, LatestFindingsResponse>({ + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion params: buildMisconfigurationsFindingsQuery(options, rulesStates!), }) ); diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_misconfiguration_preview.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_misconfiguration_preview.ts similarity index 95% rename from x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_misconfiguration_preview.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_misconfiguration_preview.ts index 067cd22a9e1a9..d2f4d4f522111 100644 --- a/x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_misconfiguration_preview.ts +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_misconfiguration_preview.ts @@ -35,6 +35,7 @@ export const useMisconfigurationPreview = (options: UseCspOptions) => { rawResponse: { aggregations }, } = await lastValueFrom( data.search.search<LatestFindingsRequest, LatestFindingsResponse>({ + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion params: buildMisconfigurationsFindingsQuery(options, rulesStates!), }) ); diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_navigate_findings.test.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_navigate_findings.test.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_navigate_findings.test.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_navigate_findings.test.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_navigate_findings.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_navigate_findings.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_navigate_findings.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_navigate_findings.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_vulnerabilities_findings.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_vulnerabilities_findings.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_vulnerabilities_findings.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_vulnerabilities_findings.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_vulnerabilities_preview.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_vulnerabilities_preview.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/src/hooks/use_vulnerabilities_preview.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/hooks/use_vulnerabilities_preview.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/types.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/src/types.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/types.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerabilitiy_colors.test.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerabilitiy_colors.test.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerabilitiy_colors.test.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerabilitiy_colors.test.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_colors.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_colors.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_colors.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_colors.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_text.test.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_text.test.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_text.test.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_text.test.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_text.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_text.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_text.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/get_vulnerability_text.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/utils/hooks_utils.test.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/hooks_utils.test.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/src/utils/hooks_utils.test.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/hooks_utils.test.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/utils/hooks_utils.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/hooks_utils.ts similarity index 98% rename from x-pack/packages/kbn-cloud-security-posture/public/src/utils/hooks_utils.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/hooks_utils.ts index a621e1d01add8..e52b66a0db685 100644 --- a/x-pack/packages/kbn-cloud-security-posture/public/src/utils/hooks_utils.ts +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/hooks_utils.ts @@ -7,12 +7,12 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { + buildMutedRulesFilter, CDR_MISCONFIGURATIONS_INDEX_PATTERN, CDR_VULNERABILITIES_INDEX_PATTERN, CDR_3RD_PARTY_RETENTION_POLICY, } from '@kbn/cloud-security-posture-common'; import type { CspBenchmarkRulesStates } from '@kbn/cloud-security-posture-common/schema/rules/latest'; -import { buildMutedRulesFilter } from '@kbn/cloud-security-posture-common'; import type { UseCspOptions } from '../types'; const MISCONFIGURATIONS_SOURCE_FIELDS = ['result.*', 'rule.*', 'resource.*']; diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/utils/query_utils.test.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/query_utils.test.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/src/utils/query_utils.test.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/query_utils.test.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/utils/query_utils.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/query_utils.ts similarity index 93% rename from x-pack/packages/kbn-cloud-security-posture/public/src/utils/query_utils.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/query_utils.ts index 6cb5c1384e732..72307e4f47b28 100644 --- a/x-pack/packages/kbn-cloud-security-posture/public/src/utils/query_utils.ts +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/query_utils.ts @@ -20,6 +20,7 @@ type FilterValue = string | number | NegatedValue; export type NavFilter = Record<string, FilterValue>; +// eslint-disable-next-line @typescript-eslint/no-explicit-any const encodeRison = (v: any): string | undefined => { try { return encode(v); @@ -40,6 +41,7 @@ const decodeRison = <T extends unknown>(query: string): T | undefined => { const QUERY_PARAM_KEY = 'cspq'; +// eslint-disable-next-line @typescript-eslint/no-explicit-any export const encodeQuery = (query: any): LocationDescriptorObject['search'] => { const risonQuery = encodeRison(query); if (!risonQuery) return; @@ -56,6 +58,7 @@ export const encodeQueryUrl = ( servicesStart: DataPublicPluginStart, filters: Filter[], groupBy?: string[] + // eslint-disable-next-line @typescript-eslint/no-explicit-any ): any => { return encodeQuery({ query: servicesStart.query.queryString.getDefaultQuery(), diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/utils/show_error_toast.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/show_error_toast.ts similarity index 90% rename from x-pack/packages/kbn-cloud-security-posture/public/src/utils/show_error_toast.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/show_error_toast.ts index 060ae8c3b69ee..d8ddbcce9c985 100644 --- a/x-pack/packages/kbn-cloud-security-posture/public/src/utils/show_error_toast.ts +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/show_error_toast.ts @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { extractErrorMessage } from '@kbn/cloud-security-posture-common'; const SEARCH_FAILED_TEXT = i18n.translate( - 'xpack.csp.findings.findingsErrorToast.searchFailedTitle', + 'securitySolutionPackages.csp.findings.findingsErrorToast.searchFailedTitle', { defaultMessage: 'Search failed' } ); diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.test.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.test.ts similarity index 100% rename from x-pack/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.test.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.test.ts diff --git a/x-pack/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.ts b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.ts similarity index 98% rename from x-pack/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.ts rename to x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.ts index e1bec795ad444..321a135557e59 100644 --- a/x-pack/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.ts +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/src/utils/vulnerability_helpers.ts @@ -16,6 +16,7 @@ interface VulnerabilitiesDistributionBarProps { color: string; isCurrentFilter?: boolean; filter?: () => void; + // eslint-disable-next-line @typescript-eslint/no-explicit-any reset?: (event: any) => void; } diff --git a/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/tsconfig.json b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/tsconfig.json new file mode 100644 index 0000000000000..80f3333bd276a --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-cloud-security-posture/public/tsconfig.json @@ -0,0 +1,40 @@ +{ + "extends": "../../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/core", + "@kbn/licensing-plugin", + "@kbn/data-views-plugin", + "@kbn/unified-search-plugin", + "@kbn/ui-actions-plugin", + "@kbn/field-formats-plugin", + "@kbn/data-view-field-editor-plugin", + "@kbn/data-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/charts-plugin", + "@kbn/discover-plugin", + "@kbn/fleet-plugin", + "@kbn/usage-collection-plugin", + "@kbn/share-plugin", + "@kbn/es-query", + "@kbn/cloud-plugin", + "@kbn/spaces-plugin", + "@kbn/kibana-react-plugin", + "@kbn/cloud-security-posture-common", + "@kbn/i18n", + "@kbn/search-types", + "@kbn/ui-theme", + "@kbn/i18n-react", + "@kbn/rison", + "@kbn/core-lifecycle-browser", + ] +} diff --git a/packages/kbn-securitysolution-autocomplete/README.md b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/README.md similarity index 100% rename from packages/kbn-securitysolution-autocomplete/README.md rename to x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/README.md diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/index.ts new file mode 100644 index 0000000000000..f3768e8cd37f7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/index.ts @@ -0,0 +1,23 @@ +/* + * 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. + */ + +export * from './src/check_empty_value'; +export * from './src/es_field_selector'; +export * from './src/field_value_exists'; +export * from './src/field_value_lists'; +export * from './src/field_value_match'; +export * from './src/field_value_match_any'; +export * from './src/field_value_wildcard'; +export * from './src/filter_field_to_list'; +export * from './src/get_generic_combo_box_props'; +export * from './src/get_operators'; +export * from './src/hooks'; +export * from './src/operator'; +export * from './src/param_is_valid'; +export * from './src/param_contains_space'; + +export { default as autoCompletei18n } from './src/translations'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/jest.config.js b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/jest.config.js new file mode 100644 index 0000000000000..7384086c58710 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/jest.config.js @@ -0,0 +1,12 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete'], +}; diff --git a/packages/kbn-securitysolution-autocomplete/kibana.jsonc b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/kibana.jsonc similarity index 100% rename from packages/kbn-securitysolution-autocomplete/kibana.jsonc rename to x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/kibana.jsonc diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/package.json b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/package.json new file mode 100644 index 0000000000000..fcce028035c42 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/package.json @@ -0,0 +1,8 @@ +{ + "name": "@kbn/securitysolution-autocomplete", + "version": "1.0.0", + "description": "Security Solution auto complete", + "license": "Elastic License 2.0", + "private": true, + "sideEffects": false +} \ No newline at end of file diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/autocomplete/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/autocomplete/index.mock.ts new file mode 100644 index 0000000000000..2372ad727e9f1 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/autocomplete/index.mock.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. + */ + +// Copied from "src/plugins/data/public/mocks.ts" but without any type information +// TODO: Remove this in favor of the data/public/mocks if/when they become available, https://github.com/elastic/kibana/issues/100715 +export const autocompleteStartMock = { + getQuerySuggestions: jest.fn(), + getValueSuggestions: jest.fn(), + hasQuerySuggestions: jest.fn(), +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/check_empty_value/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/check_empty_value/index.test.ts new file mode 100644 index 0000000000000..4f99799bb468e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/check_empty_value/index.test.ts @@ -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 { checkEmptyValue } from '.'; +import { getField } from '../fields/index.mock'; +import * as i18n from '../translations'; + +describe('check_empty_value', () => { + test('returns no errors if no field has been selected', () => { + const isValid = checkEmptyValue('', undefined, true, false); + + expect(isValid).toBeUndefined(); + }); + + test('returns error string if user has touched a required input and left empty', () => { + const isValid = checkEmptyValue(undefined, getField('@timestamp'), true, true); + + expect(isValid).toEqual(i18n.FIELD_REQUIRED_ERR); + }); + + test('returns no errors if required input is empty but user has not yet touched it', () => { + const isValid = checkEmptyValue(undefined, getField('@timestamp'), true, false); + + expect(isValid).toBeUndefined(); + }); + + test('returns no errors if user has touched an input that is not required and left empty', () => { + const isValid = checkEmptyValue(undefined, getField('@timestamp'), false, true); + + expect(isValid).toBeUndefined(); + }); + + test('returns no errors if user has touched an input that is not required and left empty string', () => { + const isValid = checkEmptyValue('', getField('@timestamp'), false, true); + + expect(isValid).toBeUndefined(); + }); + + test('returns null if input value is not empty string or undefined', () => { + const isValid = checkEmptyValue('hellooo', getField('@timestamp'), false, true); + + expect(isValid).toBeNull(); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/check_empty_value/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/check_empty_value/index.ts new file mode 100644 index 0000000000000..285c91842f2fe --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/check_empty_value/index.ts @@ -0,0 +1,33 @@ +/* + * 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 { DataViewFieldBase } from '@kbn/es-query'; +import * as i18n from '../translations'; + +/** + * Determines if empty value is ok + */ +export const checkEmptyValue = ( + param: string | undefined, + field: DataViewFieldBase | undefined, + isRequired: boolean, + touched: boolean +): string | undefined | null => { + if (isRequired && touched && (param == null || param.trim() === '')) { + return i18n.FIELD_REQUIRED_ERR; + } + + if ( + field == null || + (isRequired && !touched) || + (!isRequired && (param == null || param === '')) + ) { + return undefined; + } + + return null; +}; diff --git a/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/__snapshots__/index.test.tsx.snap similarity index 100% rename from packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/__snapshots__/index.test.tsx.snap diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/disabled_types_with_tooltip_text.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/disabled_types_with_tooltip_text.test.ts new file mode 100644 index 0000000000000..743ba33fbbe53 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/disabled_types_with_tooltip_text.test.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 { disabledTypesWithTooltipText } from '../disabled_types_with_tooltip_text'; + +jest.mock('../../translations', () => ({ + BINARY_TYPE_NOT_SUPPORTED: 'Binary fields are currently unsupported', +})); +describe('disabledTypesWithTooltipText', () => { + it('should return Binary fields are currently unsupported for binary type', () => { + const type = 'binary'; + expect(disabledTypesWithTooltipText[type]).toEqual('Binary fields are currently unsupported'); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/index.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/index.test.tsx new file mode 100644 index 0000000000000..10db3fcce5f52 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/index.test.tsx @@ -0,0 +1,142 @@ +/* + * 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, waitFor, within } from '@testing-library/react'; +import '@testing-library/jest-dom'; + +import { EsFieldSelector } from '..'; +import { fields, getField } from '../../fields/index.mock'; + +describe('FieldComponent', () => { + it('should render the component enabled and displays the selected field correctly', () => { + const wrapper = render( + <EsFieldSelector + isClearable={false} + isDisabled={false} + isLoading={false} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + onChange={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('machine.os.raw')} + /> + ); + expect(wrapper.container).toMatchSnapshot(); + const comboBox = wrapper.getByTestId('fieldAutocompleteComboBox'); + const input = within(comboBox).getByRole('combobox'); + expect(input).toHaveAttribute('value', 'machine.os.raw'); + }); + it('should render the component disabled if isDisabled is true', () => { + const wrapper = render( + <EsFieldSelector + isClearable={false} + isDisabled={true} + isLoading={false} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + onChange={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('machine.os.raw')} + /> + ); + expect(wrapper.container).toMatchSnapshot(); + expect(wrapper.getByTestId('fieldAutocompleteComboBox').querySelector('input')).toBeDisabled(); + }); + it('should render the loading spinner if isLoading is true when clicked', () => { + const wrapper = render( + <EsFieldSelector + isClearable={false} + isDisabled={true} + isLoading={true} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + onChange={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('machine.os.raw')} + /> + ); + const fieldAutocompleteComboBox = wrapper.getByTestId('fieldAutocompleteComboBox'); + expect(wrapper.container).toMatchSnapshot(); + fireEvent.click(fieldAutocompleteComboBox); + expect(wrapper.getByRole('progressbar')).toBeInTheDocument(); + }); + it('should allow user to clear values if isClearable is true', () => { + const wrapper = render( + <EsFieldSelector + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={true} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('machine.os.raw')} + /> + ); + expect(wrapper.container).toMatchSnapshot(); + expect(wrapper.getByTestId('comboBoxClearButton')).toBeInTheDocument(); + }); + it('should change the selected value', async () => { + const wrapper = render( + <EsFieldSelector + isClearable={false} + isDisabled={true} + isLoading={false} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + onChange={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('machine.os.raw')} + /> + ); + const fieldAutocompleteComboBox = wrapper.getByTestId('comboBoxSearchInput'); + fireEvent.change(fieldAutocompleteComboBox, { target: { value: '_source' } }); + expect(fieldAutocompleteComboBox).toHaveValue('_source'); + }); + + it('it allows custom user input if "acceptsCustomOptions" is "true"', async () => { + const mockOnChange = jest.fn(); + const wrapper = render( + <EsFieldSelector + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={mockOnChange} + placeholder="Placeholder text" + selectedField={undefined} + acceptsCustomOptions + /> + ); + + const fieldAutocompleteComboBox = wrapper.getByTestId('comboBoxSearchInput'); + fireEvent.change(fieldAutocompleteComboBox, { target: { value: 'custom' } }); + await waitFor(() => + expect(wrapper.getByTestId('fieldAutocompleteComboBox')).toHaveTextContent('custom') + ); + }); +}); diff --git a/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/use_es_field.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/use_es_field.test.ts similarity index 97% rename from packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/use_es_field.test.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/use_es_field.test.ts index 942ccbc29c38e..1fb07e21fc915 100644 --- a/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/use_es_field.test.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/use_es_field.test.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { DataViewFieldBase } from '@kbn/es-query'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/disabled_types_with_tooltip_text.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/disabled_types_with_tooltip_text.ts new file mode 100644 index 0000000000000..5b24ecb736054 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/disabled_types_with_tooltip_text.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. + */ + +interface DisabledTypesTextType { + [typeName: string]: string; +} +import * as i18n from '../translations'; + +export const disabledTypesWithTooltipText: DisabledTypesTextType = { + binary: i18n.BINARY_TYPE_NOT_SUPPORTED, +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/index.tsx new file mode 100644 index 0000000000000..8ce7e7ed5507d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/index.tsx @@ -0,0 +1,107 @@ +/* + * 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 { EuiComboBox } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; + +import { FieldBaseProps } from './types'; +import { useEsField } from './use_es_field'; + +const AS_PLAIN_TEXT = { asPlainText: true }; + +interface EsFieldSelectorProps extends FieldBaseProps { + isClearable?: boolean; + isDisabled?: boolean; + isLoading?: boolean; + placeholder: string; + acceptsCustomOptions?: boolean; + showMappingConflicts?: boolean; + 'aria-label'?: string; +} + +export function EsFieldSelector({ + fieldInputWidth, + fieldTypeFilter = [], + indexPattern, + isClearable = false, + isDisabled = false, + isLoading = false, + isRequired = false, + onChange, + placeholder, + selectedField, + acceptsCustomOptions = false, + showMappingConflicts = false, + 'aria-label': ariaLabel, +}: EsFieldSelectorProps): JSX.Element { + const { + isInvalid, + comboOptions, + selectedComboOptions, + fieldWidth, + renderFields, + handleTouch, + handleValuesChange, + handleCreateCustomOption, + } = useEsField({ + indexPattern, + fieldTypeFilter, + isRequired, + selectedField, + fieldInputWidth, + showMappingConflicts, + onChange, + }); + + if (acceptsCustomOptions) { + return ( + <EuiComboBox + placeholder={placeholder} + options={comboOptions} + selectedOptions={selectedComboOptions} + onChange={handleValuesChange} + isLoading={isLoading} + isDisabled={isDisabled} + isClearable={isClearable} + isInvalid={isInvalid} + onFocus={handleTouch} + singleSelection={AS_PLAIN_TEXT} + data-test-subj="fieldAutocompleteComboBox" + style={fieldWidth} + onCreateOption={handleCreateCustomOption} + customOptionText={i18n.translate('autocomplete.customOptionText', { + defaultMessage: 'Add {searchValuePlaceholder} as a custom field', + values: { searchValuePlaceholder: '{searchValue}' }, + })} + fullWidth + renderOption={renderFields} + aria-label={ariaLabel} + /> + ); + } + + return ( + <EuiComboBox + placeholder={placeholder} + options={comboOptions} + selectedOptions={selectedComboOptions} + onChange={handleValuesChange} + isLoading={isLoading} + isDisabled={isDisabled} + isClearable={isClearable} + isInvalid={isInvalid} + onFocus={handleTouch} + singleSelection={AS_PLAIN_TEXT} + data-test-subj="fieldAutocompleteComboBox" + style={fieldWidth} + fullWidth + renderOption={renderFields} + aria-label={ariaLabel} + /> + ); +} diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/types.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/types.ts new file mode 100644 index 0000000000000..e300df89e1c3c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/types.ts @@ -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 { DataViewBase, DataViewFieldBase } from '@kbn/es-query'; +import { FieldConflictsInfo } from '@kbn/securitysolution-list-utils'; +import { GetGenericComboBoxPropsReturn } from '../get_generic_combo_box_props'; + +export interface FieldBaseProps { + indexPattern: DataViewBase | undefined; + fieldTypeFilter?: string[]; + isRequired?: boolean; + selectedField?: DataViewFieldBase | undefined; + fieldInputWidth?: number; + showMappingConflicts?: boolean; + onChange: (a: DataViewFieldBase[]) => void; +} + +export interface ComboBoxFields { + availableFields: DataViewField[]; + selectedFields: DataViewField[]; +} + +export interface GetFieldComboBoxPropsReturn extends GetGenericComboBoxPropsReturn { + disabledLabelTooltipTexts: { [label: string]: string }; + mappingConflictsTooltipInfo: { [label: string]: FieldConflictsInfo[] }; +} + +export interface DataViewField extends DataViewFieldBase { + esTypes?: string[]; +} diff --git a/packages/kbn-securitysolution-autocomplete/src/es_field_selector/use_es_field.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/use_es_field.tsx similarity index 94% rename from packages/kbn-securitysolution-autocomplete/src/es_field_selector/use_es_field.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/use_es_field.tsx index 615571d989607..1d6b84618af3e 100644 --- a/packages/kbn-securitysolution-autocomplete/src/es_field_selector/use_es_field.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/es_field_selector/use_es_field.tsx @@ -1,14 +1,11 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { useCallback, useMemo, useState } from 'react'; +import React, { useCallback, useMemo, useState } from 'react'; import { EuiComboBoxOptionOption, EuiIcon, diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_exists/index.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_exists/index.test.tsx new file mode 100644 index 0000000000000..9fc10f6ba3bc1 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_exists/index.test.tsx @@ -0,0 +1,23 @@ +/* + * 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 { mount } from 'enzyme'; + +import { AutocompleteFieldExistsComponent } from '.'; + +describe('AutocompleteFieldExistsComponent', () => { + test('it renders field disabled', () => { + const wrapper = mount(<AutocompleteFieldExistsComponent placeholder="Placeholder text" />); + + expect( + wrapper + .find(`[data-test-subj="valuesAutocompleteComboBox existsComboxBox"] input`) + .prop('disabled') + ).toBeTruthy(); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_exists/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_exists/index.tsx new file mode 100644 index 0000000000000..ccd27f559e124 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_exists/index.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 from 'react'; +import { EuiComboBox, EuiComboBoxOptionOption, EuiFormRow } from '@elastic/eui'; + +const NO_OPTIONS_FOR_EXIST: EuiComboBoxOptionOption[] = []; + +interface AutocompleteFieldExistsProps { + placeholder: string; + rowLabel?: string; + 'aria-label'?: string; +} + +export const AutocompleteFieldExistsComponent: React.FC<AutocompleteFieldExistsProps> = ({ + placeholder, + rowLabel, + 'aria-label': ariaLabel, +}): JSX.Element => ( + <EuiFormRow label={rowLabel} fullWidth> + <EuiComboBox + placeholder={placeholder} + options={NO_OPTIONS_FOR_EXIST} + selectedOptions={NO_OPTIONS_FOR_EXIST} + onChange={undefined} + isDisabled + data-test-subj="valuesAutocompleteComboBox existsComboxBox" + aria-label={ariaLabel} + fullWidth + /> + </EuiFormRow> +); + +AutocompleteFieldExistsComponent.displayName = 'AutocompleteFieldExists'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.test.tsx new file mode 100644 index 0000000000000..30323eba26855 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.test.tsx @@ -0,0 +1,268 @@ +/* + * 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 { mount } from 'enzyme'; +import { EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui'; +import { waitFor } from '@testing-library/react'; +import type { ListSchema } from '@kbn/securitysolution-io-ts-list-types'; + +import { getField } from '../fields/index.mock'; +import { AutocompleteFieldListsComponent } from '.'; +import { + getListResponseMock, + getFoundListsBySizeSchemaMock, + DATE_NOW, + IMMUTABLE, + VERSION, +} from '../list_schema/index.mock'; + +// TODO: Once these mocks are available, use them instead of hand mocking, https://github.com/elastic/kibana/issues/100715 +// const mockKibanaHttpService = coreMock.createStart().http; +// import { coreMock } from '../../../../../../../../../../src/core/public/mocks'; +const mockKibanaHttpService = jest.fn(); +const mockShowValueListModal = jest.fn(); +const MockedShowValueListModal = (props: unknown) => { + mockShowValueListModal(props); + return <></>; +}; +const mockStart = jest.fn(); +const mockKeywordList: ListSchema = { + ...getListResponseMock(), + id: 'keyword_list', + name: 'keyword list', + type: 'keyword', +}; +const mockResult = { ...getFoundListsBySizeSchemaMock() }; +mockResult.smallLists = [...mockResult.smallLists, mockKeywordList]; +mockResult.largeLists = []; +jest.mock('@kbn/securitysolution-list-hooks', () => { + const originalModule = jest.requireActual('@kbn/securitysolution-list-hooks'); + + return { + ...originalModule, + useFindListsBySize: () => ({ + error: undefined, + loading: false, + result: mockResult, + start: mockStart.mockReturnValue(mockResult), + }), + }; +}); + +describe('AutocompleteFieldListsComponent', () => { + test('it renders disabled if "isDisabled" is true', async () => { + const wrapper = mount( + <AutocompleteFieldListsComponent + httpService={mockKibanaHttpService} + isClearable={true} + isDisabled + isLoading={false} + onChange={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('ip')} + selectedValue="some-list-id" + showValueListModal={MockedShowValueListModal} + /> + ); + + expect( + wrapper + .find(`[data-test-subj="valuesAutocompleteComboBox listsComboxBox"] input`) + .prop('disabled') + ).toBeTruthy(); + }); + + test('it renders loading if "isLoading" is true', async () => { + const wrapper = mount( + <AutocompleteFieldListsComponent + httpService={mockKibanaHttpService} + isClearable={false} + isDisabled={false} + isLoading + onChange={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('@tags')} + selectedValue="" + showValueListModal={MockedShowValueListModal} + /> + ); + + wrapper + .find(`[data-test-subj="valuesAutocompleteComboBox listsComboxBox"] button`) + .at(0) + .simulate('click'); + expect( + wrapper + .find( + `EuiComboBoxOptionsList[data-test-subj="valuesAutocompleteComboBox listsComboxBox-optionsList"]` + ) + .prop('isLoading') + ).toBeTruthy(); + }); + + test('it allows user to clear values if "isClearable" is true', async () => { + const wrapper = mount( + <AutocompleteFieldListsComponent + httpService={mockKibanaHttpService} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('ip')} + selectedValue="" + showValueListModal={MockedShowValueListModal} + /> + ); + expect( + wrapper + .find('EuiComboBox[data-test-subj="valuesAutocompleteComboBox listsComboxBox"]') + .prop('options') + ).toEqual([{ label: 'some name', disabled: false }]); + }); + + test('it correctly displays lists that match the selected "keyword" field esType', () => { + const wrapper = mount( + <AutocompleteFieldListsComponent + httpService={mockKibanaHttpService} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('@tags')} + selectedValue="" + showValueListModal={MockedShowValueListModal} + /> + ); + + wrapper.find('[data-test-subj="comboBoxToggleListButton"] button').simulate('click'); + + expect( + wrapper + .find('EuiComboBox[data-test-subj="valuesAutocompleteComboBox listsComboxBox"]') + .prop('options') + ).toEqual([{ label: 'keyword list', disabled: false }]); + }); + + test('it correctly displays lists that match the selected "ip" field esType', () => { + const wrapper = mount( + <AutocompleteFieldListsComponent + httpService={mockKibanaHttpService} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('ip')} + selectedValue="" + showValueListModal={MockedShowValueListModal} + /> + ); + + wrapper.find('[data-test-subj="comboBoxToggleListButton"] button').simulate('click'); + + expect( + wrapper + .find('EuiComboBox[data-test-subj="valuesAutocompleteComboBox listsComboxBox"]') + .prop('options') + ).toEqual([{ label: 'some name', disabled: false }]); + }); + + test('it correctly displays selected list', async () => { + const wrapper = mount( + <AutocompleteFieldListsComponent + httpService={mockKibanaHttpService} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('ip')} + selectedValue="some-list-id" + showValueListModal={MockedShowValueListModal} + /> + ); + + expect( + wrapper + .find(`[data-test-subj="valuesAutocompleteComboBox listsComboxBox"] input`) + .at(0) + .props().value + ).toEqual('some name'); + }); + + test('it invokes "onChange" when option selected', async () => { + const mockOnChange = jest.fn(); + const wrapper = mount( + <AutocompleteFieldListsComponent + httpService={mockKibanaHttpService} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={mockOnChange} + placeholder="Placeholder text" + selectedField={getField('ip')} + selectedValue="" + showValueListModal={MockedShowValueListModal} + /> + ); + + ( + wrapper.find(EuiComboBox).props() as unknown as { + onChange: (a: EuiComboBoxOptionOption[]) => void; + } + ).onChange([{ label: 'some name', disabled: false }]); + + await waitFor(() => { + expect(mockOnChange).toHaveBeenCalledWith({ + '@timestamp': DATE_NOW, + _version: undefined, + created_at: DATE_NOW, + created_by: 'some user', + description: 'some description', + deserializer: undefined, + id: 'some-list-id', + immutable: IMMUTABLE, + meta: {}, + name: 'some name', + serializer: undefined, + tie_breaker_id: '6a76b69d-80df-4ab2-8c3e-85f466b06a0e', + type: 'ip', + updated_at: DATE_NOW, + updated_by: 'some user', + version: VERSION, + }); + }); + }); + + test('it render the value list modal', async () => { + mockShowValueListModal.mockReset(); + mount( + <AutocompleteFieldListsComponent + httpService={mockKibanaHttpService} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('ip')} + selectedValue="some-list-id" + showValueListModal={MockedShowValueListModal} + /> + ); + + expect(mockShowValueListModal).toHaveBeenCalledWith( + expect.objectContaining({ + children: 'Show value list', + listId: 'some-list-id', + shouldShowContentIfModalNotAvailable: false, + }) + ); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.tsx new file mode 100644 index 0000000000000..480791b001c5f --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.tsx @@ -0,0 +1,182 @@ +/* + * 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, { ElementType, useCallback, useEffect, useMemo, useState } from 'react'; +import { EuiComboBox, EuiComboBoxOptionOption, EuiFormRow, EuiLink, EuiText } from '@elastic/eui'; +import type { ListSchema } from '@kbn/securitysolution-io-ts-list-types'; +import { useFindListsBySize } from '@kbn/securitysolution-list-hooks'; +import { DataViewFieldBase } from '@kbn/es-query'; +import { getDocLinks } from '@kbn/doc-links'; + +import { filterFieldToList } from '../filter_field_to_list'; +import { getGenericComboBoxProps } from '../get_generic_combo_box_props'; + +// TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715 +// import { HttpStart } from '@kbn/core/public'; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +type HttpStart = any; + +import * as i18n from '../translations'; + +const SINGLE_SELECTION = { asPlainText: true }; + +interface AutocompleteFieldListsProps { + httpService: HttpStart; + isClearable: boolean; + isDisabled: boolean; + isLoading: boolean; + onChange: (arg: ListSchema) => void; + placeholder: string; + rowLabel?: string; + selectedField: DataViewFieldBase | undefined; + selectedValue: string | undefined; + allowLargeValueLists?: boolean; + 'aria-label'?: string; + showValueListModal: ElementType; +} + +export interface AutocompleteListsData { + smallLists: ListSchema[]; + largeLists: ListSchema[]; +} + +export const AutocompleteFieldListsComponent: React.FC<AutocompleteFieldListsProps> = ({ + httpService, + isClearable = false, + isDisabled = false, + isLoading = false, + onChange, + placeholder, + rowLabel, + selectedField, + selectedValue, + allowLargeValueLists = false, + 'aria-label': ariaLabel, + showValueListModal, +}): JSX.Element => { + const [error, setError] = useState<string | undefined>(undefined); + const [listData, setListData] = useState<AutocompleteListsData>({ + smallLists: [], + largeLists: [], + }); + const { loading, result, start } = useFindListsBySize(); + const getLabel = useCallback(({ name }: ListSchema) => name, []); + + const optionsMemo = useMemo( + () => filterFieldToList(listData, selectedField), + [listData, selectedField] + ); + const selectedOptionsMemo = useMemo(() => { + if (selectedValue != null) { + const combinedLists = [...listData.smallLists, ...listData.largeLists]; + const list = combinedLists.filter(({ id }) => id === selectedValue); + return list ?? []; + } else { + return []; + } + }, [selectedValue, listData]); + const { comboOptions, labels, selectedComboOptions } = useMemo( + () => + getGenericComboBoxProps<ListSchema>({ + getLabel, + options: [...optionsMemo.smallLists, ...optionsMemo.largeLists], + selectedOptions: selectedOptionsMemo, + disabledOptions: allowLargeValueLists ? undefined : optionsMemo.largeLists, // Disable large lists if the rule type doesn't allow it + }), + [optionsMemo, selectedOptionsMemo, getLabel, allowLargeValueLists] + ); + + const handleValuesChange = useCallback( + (newOptions: EuiComboBoxOptionOption[]) => { + const combinedLists = [...optionsMemo.smallLists, ...optionsMemo.largeLists]; + const [newValue] = newOptions.map(({ label }) => combinedLists[labels.indexOf(label)]); + onChange(newValue ?? ''); + }, + [labels, optionsMemo, onChange] + ); + + const setIsTouchedValue = useCallback((): void => { + setError(selectedValue == null ? i18n.FIELD_REQUIRED_ERR : undefined); + }, [selectedValue]); + + useEffect(() => { + if (result != null) { + setListData(result); + } + }, [result]); + + useEffect(() => { + if (selectedField != null && httpService != null) { + start({ + http: httpService, + pageIndex: 1, + pageSize: 500, + }); + } + }, [selectedField, start, httpService]); + + const isLoadingState = useMemo((): boolean => isLoading || loading, [isLoading, loading]); + const ShowValueListModal = showValueListModal; + + const helpText = useMemo(() => { + return ( + <> + {selectedValue && ( + <ShowValueListModal shouldShowContentIfModalNotAvailable={false} listId={selectedValue}> + {i18n.SHOW_VALUE_LIST_MODAL} + </ShowValueListModal> + )} + {!allowLargeValueLists && ( + <EuiText size="xs"> + {i18n.LISTS_TOOLTIP_INFO}{' '} + <EuiLink + external + target="_blank" + href={ + getDocLinks({ + kibanaBranch: 'main', + buildFlavor: 'traditional', + }).securitySolution.exceptions.value_lists + } + > + {i18n.SEE_DOCUMENTATION} + </EuiLink> + </EuiText> + )} + </> + ); + }, [allowLargeValueLists, selectedValue, ShowValueListModal]); + return ( + <EuiFormRow + label={rowLabel} + error={error} + isInvalid={error != null} + helpText={helpText} + fullWidth + > + <EuiComboBox + async + data-test-subj="valuesAutocompleteComboBox listsComboxBox" + fullWidth + isClearable={isClearable} + isDisabled={isDisabled} + isInvalid={error != null} + isLoading={isLoadingState} + onBlur={setIsTouchedValue} + onChange={handleValuesChange} + options={comboOptions} + placeholder={placeholder} + selectedOptions={selectedComboOptions} + singleSelection={SINGLE_SELECTION} + sortMatchesBy="startsWith" + aria-label={ariaLabel} + /> + </EuiFormRow> + ); +}; + +AutocompleteFieldListsComponent.displayName = 'AutocompleteFieldList'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.test.tsx new file mode 100644 index 0000000000000..8ca17a78764cc --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.test.tsx @@ -0,0 +1,629 @@ +/* + * 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 { ReactWrapper, mount } from 'enzyme'; +import { + EuiComboBox, + EuiComboBoxOptionOption, + EuiFormHelpText, + EuiSuperSelect, +} from '@elastic/eui'; +import { act, waitFor } from '@testing-library/react'; +import { AutocompleteFieldMatchComponent } from '.'; +import { useFieldValueAutocomplete } from '../hooks/use_field_value_autocomplete'; +import { fields, getField } from '../fields/index.mock'; +import { autocompleteStartMock } from '../autocomplete/index.mock'; + +jest.mock('../hooks/use_field_value_autocomplete'); +jest.mock('../translations', () => ({ + FIELD_SPACE_WARNING: 'Warning: there is a space', +})); +describe('AutocompleteFieldMatchComponent', () => { + let wrapper: ReactWrapper; + + const getValueSuggestionsMock = jest + .fn() + .mockResolvedValue([false, true, ['value 3', 'value 4'], jest.fn()]); + + const findEuiComboBox = () => + wrapper.find(EuiComboBox).props() as unknown as { + onChange: (a: EuiComboBoxOptionOption[]) => void; + onSearchChange: (a: string) => void; + onCreateOption: (a: string) => void; + }; + + beforeEach(() => { + (useFieldValueAutocomplete as jest.Mock).mockReturnValue([ + false, + true, + ['value 1', 'value 2'], + getValueSuggestionsMock, + ]); + }); + + afterEach(() => { + jest.clearAllMocks(); + wrapper.unmount(); + }); + + test('it renders row label if one passed in', () => { + wrapper = mount( + <AutocompleteFieldMatchComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled + isLoading={false} + onChange={jest.fn()} + placeholder="Placeholder text" + rowLabel={'Row Label'} + selectedField={getField('ip')} + selectedValue="127.0.0.1" + /> + ); + + expect( + wrapper.find('[data-test-subj="valuesAutocompleteMatchLabel"] label').at(0).text() + ).toEqual('Row Label'); + }); + + test('it renders disabled if "isDisabled" is true', () => { + wrapper = mount( + <AutocompleteFieldMatchComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('ip')} + selectedValue="127.0.0.1" + /> + ); + + expect( + wrapper.find('[data-test-subj="valuesAutocompleteMatch"] input').prop('disabled') + ).toBeTruthy(); + }); + + test('it renders loading if "isLoading" is true', () => { + wrapper = mount( + <AutocompleteFieldMatchComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading + onChange={jest.fn()} + onError={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('ip')} + selectedValue="127.0.0.1" + /> + ); + wrapper.find('[data-test-subj="valuesAutocompleteMatch"] button').at(0).simulate('click'); + expect( + wrapper + .find('EuiComboBoxOptionsList[data-test-subj="valuesAutocompleteMatch-optionsList"]') + .prop('isLoading') + ).toBeTruthy(); + }); + + test('it allows user to clear values if "isClearable" is true', () => { + wrapper = mount( + <AutocompleteFieldMatchComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={true} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('ip')} + selectedValue="127.0.0.1" + /> + ); + + expect(wrapper.find(`[data-test-subj="comboBoxClearButton"]`)).toBeTruthy(); + }); + + test('it correctly displays selected value', () => { + wrapper = mount( + <AutocompleteFieldMatchComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('ip')} + selectedValue="127.0.0.1" + /> + ); + + expect( + wrapper.find('[data-test-subj="valuesAutocompleteMatch"] input').at(0).props().value + ).toEqual('127.0.0.1'); + }); + + test('it invokes "onChange" when new value created', () => { + const mockOnChange = jest.fn(); + wrapper = mount( + <AutocompleteFieldMatchComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={mockOnChange} + onError={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('ip')} + selectedValue="" + /> + ); + + findEuiComboBox().onCreateOption('127.0.0.1'); + + expect(mockOnChange).toHaveBeenCalledWith('127.0.0.1'); + }); + + test('it invokes "onChange" when new value selected', () => { + const mockOnChange = jest.fn(); + wrapper = mount( + <AutocompleteFieldMatchComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={mockOnChange} + onError={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('machine.os.raw')} + selectedValue="" + /> + ); + + findEuiComboBox().onChange([{ label: 'value 1' }]); + + expect(mockOnChange).toHaveBeenCalledWith('value 1'); + }); + + test('it invokes "onChange" with empty value (i.e. clears selection) when new value searched', () => { + const mockOnChange = jest.fn(); + wrapper = mount( + <AutocompleteFieldMatchComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={mockOnChange} + onError={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('machine.os.raw')} + selectedValue="value 1" + /> + ); + + act(() => { + findEuiComboBox().onSearchChange('value 12'); + }); + + expect(mockOnChange).toHaveBeenCalledWith(''); + }); + + test('should show the warning helper text if the new value contains spaces when change', async () => { + (useFieldValueAutocomplete as jest.Mock).mockReturnValue([ + false, + true, + [' value 1 ', 'value 2'], + getValueSuggestionsMock, + ]); + const mockOnChange = jest.fn(); + wrapper = mount( + <AutocompleteFieldMatchComponent + autocompleteService={autocompleteStartMock} + rowLabel="Test" + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={mockOnChange} + onError={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('machine.os.raw')} + selectedValue="" + /> + ); + + await waitFor(() => findEuiComboBox().onChange([{ label: ' value 1 ' }])); + wrapper.update(); + expect(mockOnChange).toHaveBeenCalledWith(' value 1 '); + + const euiFormHelptext = wrapper.find(EuiFormHelpText); + expect(euiFormHelptext.length).toBeTruthy(); + }); + + test('it refreshes autocomplete with search query when new value searched', () => { + wrapper = mount( + <AutocompleteFieldMatchComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('machine.os.raw')} + selectedValue="" + /> + ); + act(() => { + findEuiComboBox().onSearchChange('value 1'); + }); + + expect(useFieldValueAutocomplete).toHaveBeenCalledWith({ + autocompleteService: autocompleteStartMock, + fieldValue: '', + indexPattern: { + fields, + id: '1234', + title: 'logstash-*', + }, + operatorType: 'match', + query: 'value 1', + selectedField: getField('machine.os.raw'), + }); + }); + + test('it refreshes autocomplete with search query when input field is cleared', () => { + wrapper = mount( + <AutocompleteFieldMatchComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('machine.os.raw')} + selectedValue="windows" + /> + ); + + act(() => { + findEuiComboBox().onSearchChange('value 1'); + }); + act(() => { + findEuiComboBox().onSearchChange(''); + }); + + // 1st call is initial render, 2nd call sets the search query: + expect(useFieldValueAutocomplete).toHaveBeenNthCalledWith(2, { + autocompleteService: autocompleteStartMock, + fieldValue: 'windows', + indexPattern: { fields, id: '1234', title: 'logstash-*' }, + operatorType: 'match', + query: 'value 1', + selectedField: getField('machine.os.raw'), + }); + // last call is the refresh when input field is cleared + expect(useFieldValueAutocomplete).toHaveBeenLastCalledWith({ + autocompleteService: autocompleteStartMock, + fieldValue: 'windows', + indexPattern: { fields, id: '1234', title: 'logstash-*' }, + operatorType: 'match', + query: '', + selectedField: getField('machine.os.raw'), + }); + }); + + test('should show the warning helper text if the new value contains spaces when searching a new query', () => { + wrapper = mount( + <AutocompleteFieldMatchComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('machine.os.raw')} + selectedValue="" + /> + ); + act(() => { + findEuiComboBox().onSearchChange(' value 1'); + }); + + wrapper.update(); + const euiFormHelptext = wrapper.find(EuiFormHelpText); + expect(euiFormHelptext.length).toBeTruthy(); + expect(euiFormHelptext.text()).toEqual('Warning: there is a space'); + }); + + test('should show the warning helper text if selectedValue contains spaces when editing', () => { + wrapper = mount( + <AutocompleteFieldMatchComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('machine.os.raw')} + selectedValue=" leading and trailing space " + /> + ); + const euiFormHelptext = wrapper.find(EuiFormHelpText); + expect(euiFormHelptext.length).toBeTruthy(); + expect(euiFormHelptext.text()).toEqual('Warning: there is a space'); + }); + + test('should not show the warning helper text if selectedValue is falsy', () => { + wrapper = mount( + <AutocompleteFieldMatchComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('machine.os.raw')} + selectedValue="" + /> + ); + const euiFormHelptext = wrapper.find(EuiFormHelpText); + expect(euiFormHelptext.length).toBeFalsy(); + }); + + describe('boolean type', () => { + const valueSuggestionsMock = jest.fn().mockResolvedValue([false, false, [], jest.fn()]); + + beforeEach(() => { + (useFieldValueAutocomplete as jest.Mock).mockReturnValue([ + false, + false, + [], + valueSuggestionsMock, + ]); + }); + + test('it displays only two options - "true" or "false"', () => { + wrapper = mount( + <AutocompleteFieldMatchComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('ssl')} + selectedValue="" + /> + ); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteMatchBoolean"]').exists() + ).toBeTruthy(); + expect( + wrapper.find('[data-test-subj="valuesAutocompleteMatchBoolean"]').at(0).prop('options') + ).toEqual([ + { + inputDisplay: 'true', + value: 'true', + }, + { + inputDisplay: 'false', + value: 'false', + }, + ]); + }); + + test('it invokes "onChange" with "true" when selected', () => { + const mockOnChange = jest.fn(); + wrapper = mount( + <AutocompleteFieldMatchComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={mockOnChange} + onError={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('ssl')} + selectedValue="" + /> + ); + + ( + wrapper.find(EuiSuperSelect).props() as unknown as { + onChange: (a: string) => void; + } + ).onChange('true'); + + expect(mockOnChange).toHaveBeenCalledWith('true'); + }); + + test('it invokes "onChange" with "false" when selected', () => { + const mockOnChange = jest.fn(); + wrapper = mount( + <AutocompleteFieldMatchComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={mockOnChange} + onError={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('ssl')} + selectedValue="" + /> + ); + + ( + wrapper.find(EuiSuperSelect).props() as unknown as { + onChange: (a: string) => void; + } + ).onChange('false'); + + expect(mockOnChange).toHaveBeenCalledWith('false'); + }); + }); + + describe('number type', () => { + const valueSuggestionsMock = jest.fn().mockResolvedValue([false, false, [], jest.fn()]); + + beforeEach(() => { + (useFieldValueAutocomplete as jest.Mock).mockReturnValue([ + false, + false, + [], + valueSuggestionsMock, + ]); + }); + + test('it number input when field type is number', () => { + wrapper = mount( + <AutocompleteFieldMatchComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('bytes')} + selectedValue="" + /> + ); + + expect( + wrapper.find('[data-test-subj="valueAutocompleteFieldMatchNumber"]').exists() + ).toBeTruthy(); + }); + + test('it invokes "onChange" with numeric value when inputted', () => { + const mockOnChange = jest.fn(); + wrapper = mount( + <AutocompleteFieldMatchComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={mockOnChange} + onError={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('bytes')} + selectedValue="" + /> + ); + wrapper + .find('[data-test-subj="valueAutocompleteFieldMatchNumber"] input') + .at(0) + .simulate('change', { target: { value: '8' } }); + + expect(mockOnChange).toHaveBeenCalledWith('8'); + }); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.tsx new file mode 100644 index 0000000000000..a938ad2f7a991 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_match/index.tsx @@ -0,0 +1,376 @@ +/* + * 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, useMemo, useState, useEffect } from 'react'; +import { + EuiSuperSelect, + EuiFormRow, + EuiFieldNumber, + EuiComboBoxOptionOption, + EuiComboBox, +} from '@elastic/eui'; +import { DataViewBase, DataViewFieldBase } from '@kbn/es-query'; + +import { uniq } from 'lodash'; + +import { ListOperatorTypeEnum as OperatorTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; + +// TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715 +// import { AutocompleteStart } from '../../../../../../../../../../src/plugins/unified_search/public'; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +type AutocompleteStart = any; + +import * as i18n from '../translations'; +import { useFieldValueAutocomplete } from '../hooks/use_field_value_autocomplete'; +import { + getGenericComboBoxProps, + GetGenericComboBoxPropsReturn, +} from '../get_generic_combo_box_props'; +import { paramIsValid } from '../param_is_valid'; +import { paramContainsSpace } from '../param_contains_space'; + +const BOOLEAN_OPTIONS = [ + { inputDisplay: 'true', value: 'true' }, + { inputDisplay: 'false', value: 'false' }, +]; + +const SINGLE_SELECTION = { asPlainText: true }; + +type Warning = string | React.ReactNode; + +interface AutocompleteFieldMatchProps { + placeholder: string; + selectedField: DataViewFieldBase | undefined; + selectedValue: string | undefined; + indexPattern: DataViewBase | undefined; + isLoading?: boolean; + isDisabled?: boolean; + isClearable?: boolean; + isRequired?: boolean; + fieldInputWidth?: number; + rowLabel?: string; + autocompleteService: AutocompleteStart; + onChange: (arg: string) => void; + onError?: (arg: boolean) => void; + onWarning?: (arg: boolean) => void; + warning?: Warning; + 'aria-label'?: string; +} + +export const AutocompleteFieldMatchComponent: React.FC<AutocompleteFieldMatchProps> = ({ + placeholder, + rowLabel, + selectedField, + selectedValue, + indexPattern, + isLoading = false, + isDisabled = false, + isClearable = false, + isRequired = false, + fieldInputWidth, + autocompleteService, + onChange, + onError, + onWarning, + warning, + 'aria-label': ariaLabel, +}): JSX.Element => { + const [searchQuery, setSearchQuery] = useState(''); + const [touched, setIsTouched] = useState(false); + const [error, setError] = useState<string | undefined>(undefined); + const [showSpacesWarning, setShowSpacesWarning] = useState<boolean>(false); + const [isLoadingSuggestions, isSuggestingValues, suggestions] = useFieldValueAutocomplete({ + autocompleteService, + fieldValue: selectedValue, + indexPattern, + operatorType: OperatorTypeEnum.MATCH, + query: searchQuery, + selectedField, + }); + const getLabel = useCallback((option: string): string => option, []); + + const optionsMemo = useMemo((): string[] => { + const valueAsStr = String(selectedValue); + return selectedValue != null && selectedValue.trim() !== '' + ? uniq([valueAsStr, ...suggestions]) + : suggestions; + }, [suggestions, selectedValue]); + + const selectedOptionsMemo = useMemo((): string[] => { + const valueAsStr = String(selectedValue); + return selectedValue ? [valueAsStr] : []; + }, [selectedValue]); + + const handleSpacesWarning = useCallback( + (param: string | undefined) => { + if (!param) return setShowSpacesWarning(false); + setShowSpacesWarning(!!paramContainsSpace(param)); + }, + [setShowSpacesWarning] + ); + + const handleError = useCallback( + (err: string | undefined): void => { + setError((existingErr): string | undefined => { + const oldErr = existingErr != null; + const newErr = err != null; + if (oldErr !== newErr && onError != null) { + onError(newErr); + } + + return err; + }); + }, + [setError, onError] + ); + + const handleWarning = useCallback( + (warn: Warning | undefined): void => { + if (onWarning) { + onWarning(warn !== undefined); + } + }, + [onWarning] + ); + + const { comboOptions, labels, selectedComboOptions } = useMemo( + (): GetGenericComboBoxPropsReturn => + getGenericComboBoxProps<string>({ + getLabel, + options: optionsMemo, + selectedOptions: selectedOptionsMemo, + }), + [optionsMemo, selectedOptionsMemo, getLabel] + ); + + const handleValuesChange = useCallback( + (newOptions: EuiComboBoxOptionOption[]): void => { + const [newValue] = newOptions.map(({ label }) => optionsMemo[labels.indexOf(label)]); + + handleSpacesWarning(newValue); + handleError(undefined); + handleWarning(undefined); + onChange(newValue ?? ''); + }, + [handleError, handleWarning, handleSpacesWarning, labels, onChange, optionsMemo] + ); + + const handleSearchChange = useCallback( + (searchVal: string): void => { + if (searchVal !== '' && selectedField != null) { + const err = paramIsValid(searchVal, selectedField, isRequired, touched); + handleError(err); + handleWarning(warning); + + if (!err) handleSpacesWarning(searchVal); + } + + if (searchVal) { + // Clear selected option when user types to allow user to modify value without {backspace} + onChange(''); + } + + // Update search query unconditionally to show correct suggestions even when input is cleared + setSearchQuery(searchVal); + }, + [ + selectedField, + onChange, + isRequired, + touched, + handleError, + handleWarning, + warning, + handleSpacesWarning, + ] + ); + + const handleCreateOption = useCallback( + (option: string): boolean | undefined => { + const err = paramIsValid(option, selectedField, isRequired, touched); + handleError(err); + handleWarning(warning); + + if (err != null) { + // Explicitly reject the user's input + setShowSpacesWarning(false); + return false; + } + + handleSpacesWarning(option); + onChange(option); + return undefined; + }, + [ + isRequired, + onChange, + selectedField, + touched, + handleError, + handleSpacesWarning, + handleWarning, + warning, + ] + ); + + const handleNonComboBoxInputChange = useCallback( + (event: React.ChangeEvent<HTMLInputElement>): void => { + const newValue = event.target.value; + onChange(newValue); + }, + [onChange] + ); + + const handleBooleanInputChange = useCallback( + (newOption: string): void => { + onChange(newOption); + }, + [onChange] + ); + + const setIsTouchedValue = useCallback((): void => { + setIsTouched(true); + + const err = paramIsValid(selectedValue, selectedField, isRequired, true); + handleError(err); + handleWarning(warning); + }, [setIsTouched, handleError, selectedValue, selectedField, isRequired, warning, handleWarning]); + + const inputPlaceholder = useMemo((): string => { + if (isLoading || isLoadingSuggestions) { + return i18n.LOADING; + } else if (selectedField == null) { + return i18n.SELECT_FIELD_FIRST; + } else { + return placeholder; + } + }, [isLoading, selectedField, isLoadingSuggestions, placeholder]); + + const isLoadingState = useMemo( + (): boolean => isLoading || isLoadingSuggestions, + [isLoading, isLoadingSuggestions] + ); + + useEffect((): void => { + setError(undefined); + if (onError != null) onError(false); + + handleSpacesWarning(selectedValue); + // Looks like selectedField return new object every time when we for example add "and" entry + // that's why we need to check for name and type here + // Probably we should use some kind of memoization on parent components for entries + }, [selectedField?.name, selectedField?.type, selectedValue, handleSpacesWarning, onError]); + + const defaultInput = useMemo((): JSX.Element => { + return ( + <EuiFormRow + label={rowLabel} + error={error} + isInvalid={selectedField != null && error != null} + data-test-subj="valuesAutocompleteMatchLabel" + fullWidth + helpText={warning || (showSpacesWarning && i18n.FIELD_SPACE_WARNING)} + > + <EuiComboBox + placeholder={inputPlaceholder} + isDisabled={isDisabled || !selectedField} + isLoading={isLoadingState} + isClearable={isClearable} + options={comboOptions} + selectedOptions={selectedComboOptions} + onChange={handleValuesChange} + singleSelection={SINGLE_SELECTION} + onSearchChange={handleSearchChange} + onCreateOption={handleCreateOption} + isInvalid={selectedField != null && error != null} + onBlur={setIsTouchedValue} + sortMatchesBy="startsWith" + data-test-subj="valuesAutocompleteMatch" + style={fieldInputWidth ? { width: `${fieldInputWidth}px` } : {}} + aria-label={ariaLabel} + fullWidth + async + /> + </EuiFormRow> + ); + }, [ + rowLabel, + error, + selectedField, + showSpacesWarning, + inputPlaceholder, + isDisabled, + isLoadingState, + isClearable, + comboOptions, + selectedComboOptions, + handleValuesChange, + handleSearchChange, + handleCreateOption, + setIsTouchedValue, + warning, + fieldInputWidth, + ariaLabel, + ]); + + if (!isSuggestingValues && selectedField != null) { + switch (selectedField.type) { + case 'number': + return ( + <EuiFormRow + label={rowLabel} + error={error} + isInvalid={selectedField != null && error != null} + data-test-subj="valuesAutocompleteMatchLabel" + fullWidth + > + <EuiFieldNumber + placeholder={inputPlaceholder} + onBlur={setIsTouchedValue} + value={ + typeof selectedValue === 'string' && selectedValue.trim().length > 0 + ? parseFloat(selectedValue) + : selectedValue ?? '' + } + onChange={handleNonComboBoxInputChange} + data-test-subj="valueAutocompleteFieldMatchNumber" + style={fieldInputWidth ? { width: `${fieldInputWidth}px` } : {}} + aria-label={ariaLabel} + fullWidth + /> + </EuiFormRow> + ); + case 'boolean': + return ( + <EuiFormRow + label={rowLabel} + error={error} + isInvalid={selectedField != null && error != null} + data-test-subj="valuesAutocompleteMatchLabel" + fullWidth + > + <EuiSuperSelect + isLoading={isLoadingState} + options={BOOLEAN_OPTIONS} + valueOfSelected={selectedValue ?? 'true'} + onChange={handleBooleanInputChange} + data-test-subj="valuesAutocompleteMatchBoolean" + style={fieldInputWidth ? { width: `${fieldInputWidth}px` } : {}} + aria-label={ariaLabel} + fullWidth + /> + </EuiFormRow> + ); + default: + return defaultInput; + } + } else { + return defaultInput; + } +}; + +AutocompleteFieldMatchComponent.displayName = 'AutocompleteFieldMatch'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_match_any/index.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_match_any/index.test.tsx new file mode 100644 index 0000000000000..33355e2cb382b --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_match_any/index.test.tsx @@ -0,0 +1,398 @@ +/* + * 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 { ReactWrapper, mount } from 'enzyme'; +import { EuiComboBox, EuiComboBoxOptionOption, EuiFormHelpText } from '@elastic/eui'; +import { act, waitFor } from '@testing-library/react'; + +import { AutocompleteFieldMatchAnyComponent } from '.'; +import { getField, fields } from '../fields/index.mock'; +import { useFieldValueAutocomplete } from '../hooks/use_field_value_autocomplete'; +import { autocompleteStartMock } from '../autocomplete/index.mock'; + +jest.mock('../hooks/use_field_value_autocomplete', () => { + const actual = jest.requireActual('../hooks/use_field_value_autocomplete'); + return { + ...actual, + useFieldValueAutocomplete: jest.fn(), + }; +}); +jest.mock('../translations', () => ({ + FIELD_SPACE_WARNING: 'Warning: there is a space', +})); + +describe('AutocompleteFieldMatchAnyComponent', () => { + let wrapper: ReactWrapper; + const getValueSuggestionsMock = jest + .fn() + .mockResolvedValue([false, true, ['value 3', 'value 4'], jest.fn()]); + + beforeEach(() => { + (useFieldValueAutocomplete as jest.Mock).mockReturnValue([ + false, + true, + ['value 1', 'value 2'], + getValueSuggestionsMock, + ]); + }); + + afterEach(() => { + jest.clearAllMocks(); + wrapper.unmount(); + }); + + test('it renders disabled if "isDisabled" is true', () => { + wrapper = mount( + <AutocompleteFieldMatchAnyComponent + autocompleteService={{ + ...autocompleteStartMock, + getValueSuggestions: getValueSuggestionsMock, + }} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={true} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + placeholder="Placeholder text" + rowLabel={'Row Label'} + selectedField={getField('ip')} + selectedValue={['127.0.0.1']} + /> + ); + + expect( + wrapper.find(`[data-test-subj="valuesAutocompleteMatchAny"] input`).prop('disabled') + ).toBeTruthy(); + }); + + test('it renders loading if "isLoading" is true', () => { + wrapper = mount( + <AutocompleteFieldMatchAnyComponent + autocompleteService={{ + ...autocompleteStartMock, + getValueSuggestions: getValueSuggestionsMock, + }} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={true} + onChange={jest.fn()} + onError={jest.fn()} + placeholder="Placeholder text" + rowLabel={'Row Label'} + selectedField={getField('ip')} + selectedValue={[]} + /> + ); + wrapper.find(`[data-test-subj="valuesAutocompleteMatchAny"] button`).at(0).simulate('click'); + expect( + wrapper + .find(`EuiComboBoxOptionsList[data-test-subj="valuesAutocompleteMatchAny-optionsList"]`) + .prop('isLoading') + ).toBeTruthy(); + }); + + test('it allows user to clear values if "isClearable" is true', () => { + wrapper = mount( + <AutocompleteFieldMatchAnyComponent + autocompleteService={{ + ...autocompleteStartMock, + getValueSuggestions: getValueSuggestionsMock, + }} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={true} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + placeholder="Placeholder text" + rowLabel={'Row Label'} + selectedField={getField('ip')} + selectedValue={['127.0.0.1']} + /> + ); + + expect(wrapper.find(`[data-test-subj="comboBoxClearButton"]`)).toBeTruthy(); + }); + + test('it correctly displays selected value', () => { + wrapper = mount( + <AutocompleteFieldMatchAnyComponent + autocompleteService={{ + ...autocompleteStartMock, + getValueSuggestions: getValueSuggestionsMock, + }} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + placeholder="Placeholder text" + rowLabel={'Row Label'} + selectedField={getField('ip')} + selectedValue={['127.0.0.1']} + /> + ); + + expect( + wrapper.find(`[data-test-subj="valuesAutocompleteMatchAny"] EuiComboBoxPill`).at(0).text() + ).toEqual('127.0.0.1'); + }); + + test('it invokes "onChange" when new value created', async () => { + const mockOnChange = jest.fn(); + wrapper = mount( + <AutocompleteFieldMatchAnyComponent + autocompleteService={{ + ...autocompleteStartMock, + getValueSuggestions: getValueSuggestionsMock, + }} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={mockOnChange} + onError={jest.fn()} + placeholder="Placeholder text" + rowLabel={'Row Label'} + selectedField={getField('ip')} + selectedValue={[]} + /> + ); + + ( + wrapper.find(EuiComboBox).props() as unknown as { + onCreateOption: (a: string) => void; + } + ).onCreateOption('127.0.0.1'); + + expect(mockOnChange).toHaveBeenCalledWith(['127.0.0.1']); + }); + + test('it invokes "onChange" when new value selected', async () => { + const mockOnChange = jest.fn(); + wrapper = mount( + <AutocompleteFieldMatchAnyComponent + autocompleteService={{ + ...autocompleteStartMock, + getValueSuggestions: getValueSuggestionsMock, + }} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isLoading={false} + isClearable={false} + isDisabled={false} + onChange={mockOnChange} + onError={jest.fn()} + placeholder="Placeholder text" + rowLabel={'Row Label'} + selectedField={getField('machine.os.raw')} + selectedValue={[]} + /> + ); + + ( + wrapper.find(EuiComboBox).props() as unknown as { + onChange: (a: EuiComboBoxOptionOption[]) => void; + } + ).onChange([{ label: 'value 1' }]); + + expect(mockOnChange).toHaveBeenCalledWith(['value 1']); + }); + + test('it refreshes autocomplete with search query when new value searched', () => { + wrapper = mount( + <AutocompleteFieldMatchAnyComponent + autocompleteService={{ + ...autocompleteStartMock, + }} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + placeholder="Placeholder text" + rowLabel={'Row Label'} + selectedField={getField('machine.os.raw')} + selectedValue={[]} + /> + ); + act(() => { + ( + wrapper.find(EuiComboBox).props() as unknown as { + onSearchChange: (a: string) => void; + } + ).onSearchChange('value 1'); + }); + expect(useFieldValueAutocomplete).toHaveBeenCalledWith({ + autocompleteService: autocompleteStartMock, + fieldValue: [], + indexPattern: { + fields, + id: '1234', + title: 'logstash-*', + }, + operatorType: 'match_any', + query: 'value 1', + selectedField: getField('machine.os.raw'), + }); + }); + test('should show the warning helper text if the new value contains spaces when change', async () => { + (useFieldValueAutocomplete as jest.Mock).mockReturnValue([ + false, + true, + [' value 1 ', 'value 2'], + getValueSuggestionsMock, + ]); + const mockOnChange = jest.fn(); + wrapper = mount( + <AutocompleteFieldMatchAnyComponent + autocompleteService={{ + ...autocompleteStartMock, + }} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={mockOnChange} + placeholder="Placeholder text" + rowLabel={'Row Label'} + selectedField={getField('machine.os.raw')} + selectedValue={[]} + /> + ); + + await waitFor(() => + ( + wrapper.find(EuiComboBox).props() as unknown as { + onChange: (a: EuiComboBoxOptionOption[]) => void; + } + ).onChange([{ label: ' value 1 ' }]) + ); + wrapper.update(); + expect(mockOnChange).toHaveBeenCalledWith([' value 1 ']); + const euiFormHelptext = wrapper.find(EuiFormHelpText); + expect(euiFormHelptext.length).toBeTruthy(); + }); + test('should show the warning helper text if the new value contains spaces when searching a new query', () => { + wrapper = mount( + <AutocompleteFieldMatchAnyComponent + autocompleteService={{ + ...autocompleteStartMock, + }} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + placeholder="Placeholder text" + rowLabel={'Row Label'} + selectedField={getField('machine.os.raw')} + selectedValue={[]} + /> + ); + act(() => { + ( + wrapper.find(EuiComboBox).props() as unknown as { + onSearchChange: (a: string) => void; + } + ).onSearchChange(' value 1'); + }); + + wrapper.update(); + const euiFormHelptext = wrapper.find(EuiFormHelpText); + expect(euiFormHelptext.length).toBeTruthy(); + expect(euiFormHelptext.text()).toEqual('Warning: there is a space'); + }); + test('should show the warning helper text if selectedValue contains spaces when editing', () => { + wrapper = mount( + <AutocompleteFieldMatchAnyComponent + autocompleteService={{ + ...autocompleteStartMock, + }} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + placeholder="Placeholder text" + rowLabel={'Row Label'} + selectedField={getField('machine.os.raw')} + selectedValue={['value with trailing space ', 'value 1']} + /> + ); + const euiFormHelptext = wrapper.find(EuiFormHelpText); + expect(euiFormHelptext.length).toBeTruthy(); + expect(euiFormHelptext.text()).toEqual('Warning: there is a space'); + }); + test('should not show the warning helper text if selectedValue is falsy', () => { + wrapper = mount( + <AutocompleteFieldMatchAnyComponent + autocompleteService={{ + ...autocompleteStartMock, + }} + indexPattern={{ + fields, + id: '1234', + title: 'logstash-*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + placeholder="Placeholder text" + rowLabel={'Row Label'} + selectedField={getField('machine.os.raw')} + selectedValue={[]} + /> + ); + const euiFormHelptext = wrapper.find(EuiFormHelpText); + expect(euiFormHelptext.length).toBeFalsy(); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_match_any/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_match_any/index.tsx new file mode 100644 index 0000000000000..be7fac088ec1a --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_match_any/index.tsx @@ -0,0 +1,252 @@ +/* + * 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, useEffect, useMemo, useState } from 'react'; +import { EuiComboBox, EuiComboBoxOptionOption, EuiFormRow } from '@elastic/eui'; +import { uniq } from 'lodash'; +import { ListOperatorTypeEnum as OperatorTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; +import { DataViewBase, DataViewFieldBase } from '@kbn/es-query'; + +// TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715 +// import { AutocompleteStart } from '../../../../../../../../../../src/plugins/unified_search/public'; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +type AutocompleteStart = any; + +import * as i18n from '../translations'; +import { + getGenericComboBoxProps, + GetGenericComboBoxPropsReturn, +} from '../get_generic_combo_box_props'; +import { useFieldValueAutocomplete } from '../hooks/use_field_value_autocomplete'; +import { paramIsValid } from '../param_is_valid'; +import { paramContainsSpace } from '../param_contains_space'; + +interface AutocompleteFieldMatchAnyProps { + placeholder: string; + selectedField: DataViewFieldBase | undefined; + selectedValue: string[]; + indexPattern: DataViewBase | undefined; + isLoading: boolean; + isDisabled: boolean; + isClearable: boolean; + isRequired?: boolean; + rowLabel?: string; + autocompleteService: AutocompleteStart; + onChange: (arg: string[]) => void; + onError?: (arg: boolean) => void; + 'aria-label'?: string; +} + +export const AutocompleteFieldMatchAnyComponent: React.FC<AutocompleteFieldMatchAnyProps> = ({ + placeholder, + rowLabel, + selectedField, + selectedValue, + indexPattern, + isLoading, + isDisabled = false, + isClearable = false, + isRequired = false, + onChange, + onError, + autocompleteService, + 'aria-label': ariaLabel, +}): JSX.Element => { + const [searchQuery, setSearchQuery] = useState(''); + const [touched, setIsTouched] = useState(false); + const [error, setError] = useState<string | undefined>(undefined); + const [showSpacesWarning, setShowSpacesWarning] = useState<boolean>(false); + const [isLoadingSuggestions, isSuggestingValues, suggestions] = useFieldValueAutocomplete({ + autocompleteService, + fieldValue: selectedValue, + indexPattern, + operatorType: OperatorTypeEnum.MATCH_ANY, + query: searchQuery, + selectedField, + }); + const getLabel = useCallback((option: string): string => option, []); + const optionsMemo = useMemo( + (): string[] => (selectedValue ? uniq([...selectedValue, ...suggestions]) : suggestions), + [suggestions, selectedValue] + ); + const { comboOptions, labels, selectedComboOptions } = useMemo( + (): GetGenericComboBoxPropsReturn => + getGenericComboBoxProps<string>({ + getLabel, + options: optionsMemo, + selectedOptions: selectedValue, + }), + [optionsMemo, selectedValue, getLabel] + ); + const handleSpacesWarning = useCallback( + (params: string[]) => + setShowSpacesWarning(!!params.find((param: string) => paramContainsSpace(param))), + [setShowSpacesWarning] + ); + const handleError = useCallback( + (err: string | undefined): void => { + setError((existingErr): string | undefined => { + const oldErr = existingErr != null; + const newErr = err != null; + if (oldErr !== newErr && onError != null) { + onError(newErr); + } + + return err; + }); + }, + [setError, onError] + ); + + const handleValuesChange = useCallback( + (newOptions: EuiComboBoxOptionOption[]): void => { + const newValues: string[] = newOptions.map(({ label }) => optionsMemo[labels.indexOf(label)]); + handleError(undefined); + handleSpacesWarning(newValues); + onChange(newValues); + }, + [handleError, handleSpacesWarning, labels, onChange, optionsMemo] + ); + + const handleSearchChange = useCallback( + (searchVal: string) => { + if (searchVal === '') { + handleError(undefined); + } + + if (searchVal !== '' && selectedField != null) { + const err = paramIsValid(searchVal, selectedField, isRequired, touched); + handleError(err); + + if (!err) handleSpacesWarning([searchVal]); + + setSearchQuery(searchVal); + } + }, + [handleError, handleSpacesWarning, isRequired, selectedField, touched] + ); + + const handleCreateOption = useCallback( + (option: string): boolean => { + const err = paramIsValid(option, selectedField, isRequired, touched); + handleError(err); + + if (err != null) { + // Explicitly reject the user's input + setShowSpacesWarning(false); + return false; + } + + onChange([...(selectedValue || []), option]); + handleSpacesWarning([option]); + return true; + }, + [handleError, handleSpacesWarning, isRequired, onChange, selectedField, selectedValue, touched] + ); + + const setIsTouchedValue = useCallback((): void => { + handleError(selectedComboOptions.length === 0 ? i18n.FIELD_REQUIRED_ERR : undefined); + setIsTouched(true); + }, [setIsTouched, handleError, selectedComboOptions]); + + const inputPlaceholder = useMemo( + (): string => (isLoading || isLoadingSuggestions ? i18n.LOADING : placeholder), + [isLoading, isLoadingSuggestions, placeholder] + ); + + const isLoadingState = useMemo( + (): boolean => isLoading || isLoadingSuggestions, + [isLoading, isLoadingSuggestions] + ); + useEffect((): void => { + handleSpacesWarning(selectedValue); + }, [selectedField, selectedValue, handleSpacesWarning]); + + const defaultInput = useMemo((): JSX.Element => { + return ( + <EuiFormRow + label={rowLabel} + error={error} + isInvalid={selectedField != null && error != null} + helpText={showSpacesWarning && i18n.FIELD_SPACE_WARNING} + fullWidth + > + <EuiComboBox + placeholder={inputPlaceholder} + isLoading={isLoadingState} + isClearable={isClearable} + isDisabled={isDisabled} + options={comboOptions} + selectedOptions={selectedComboOptions} + onChange={handleValuesChange} + onSearchChange={handleSearchChange} + onCreateOption={handleCreateOption} + isInvalid={selectedField != null && error != null} + isCaseSensitive + onBlur={setIsTouchedValue} + data-test-subj="valuesAutocompleteMatchAny" + aria-label={ariaLabel} + fullWidth + async + /> + </EuiFormRow> + ); + }, [ + rowLabel, + error, + selectedField, + showSpacesWarning, + inputPlaceholder, + isLoadingState, + isClearable, + isDisabled, + comboOptions, + selectedComboOptions, + handleValuesChange, + handleSearchChange, + handleCreateOption, + setIsTouchedValue, + ariaLabel, + ]); + + if (!isSuggestingValues && selectedField != null) { + switch (selectedField.type) { + case 'number': + return ( + <EuiFormRow + label={rowLabel} + error={error} + isInvalid={selectedField != null && error != null} + fullWidth + > + <EuiComboBox + noSuggestions + placeholder={inputPlaceholder} + isLoading={isLoadingState} + isClearable={isClearable} + isDisabled={isDisabled} + selectedOptions={selectedComboOptions} + onChange={handleValuesChange} + onSearchChange={handleSearchChange} + onCreateOption={handleCreateOption} + isInvalid={selectedField != null && error != null} + onFocus={setIsTouchedValue} + data-test-subj="valuesAutocompleteMatchAnyNumber" + aria-label={ariaLabel} + fullWidth + /> + </EuiFormRow> + ); + default: + return defaultInput; + } + } + + return defaultInput; +}; + +AutocompleteFieldMatchAnyComponent.displayName = 'AutocompleteFieldMatchAny'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.test.tsx new file mode 100644 index 0000000000000..2c2411f0a0c11 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.test.tsx @@ -0,0 +1,514 @@ +/* + * 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 { ReactWrapper, mount } from 'enzyme'; +import { EuiComboBox, EuiComboBoxOptionOption, EuiFormHelpText } from '@elastic/eui'; +import { act, waitFor } from '@testing-library/react'; +import { AutocompleteFieldWildcardComponent } from '.'; +import { useFieldValueAutocomplete } from '../hooks/use_field_value_autocomplete'; +import { fields, getField } from '../fields/index.mock'; +import { autocompleteStartMock } from '../autocomplete/index.mock'; +import { WILDCARD_WARNING, FILEPATH_WARNING } from '@kbn/securitysolution-utils'; + +jest.mock('../hooks/use_field_value_autocomplete'); +jest.mock('../translations', () => ({ + FIELD_SPACE_WARNING: 'Warning: there is a space', +})); +describe('AutocompleteFieldWildcardComponent', () => { + let wrapper: ReactWrapper; + + const getValueSuggestionsMock = jest + .fn() + .mockResolvedValue([false, true, ['value 3', 'value 4'], jest.fn()]); + + beforeEach(() => { + (useFieldValueAutocomplete as jest.Mock).mockReturnValue([ + false, + true, + ['value 1', 'value 2'], + getValueSuggestionsMock, + ]); + }); + + afterEach(() => { + jest.clearAllMocks(); + wrapper.unmount(); + }); + + test('it renders row label if one passed in', () => { + wrapper = mount( + <AutocompleteFieldWildcardComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logs-endpoint.events.*', + }} + isClearable={false} + isDisabled + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + onWarning={jest.fn()} + placeholder="Placeholder text" + rowLabel={'Row Label'} + selectedField={getField('file.path.text')} + selectedValue="/opt/bin/app.dmg" + /> + ); + + expect( + wrapper.find('[data-test-subj="valuesAutocompleteWildcardLabel"] label').at(0).text() + ).toEqual('Row Label'); + }); + + test('it renders disabled if "isDisabled" is true', () => { + wrapper = mount( + <AutocompleteFieldWildcardComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logs-endpoint.events.*', + }} + isClearable={false} + isDisabled + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + onWarning={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('file.path.text')} + selectedValue="/opt/*/app.dmg" + /> + ); + + expect( + wrapper.find('[data-test-subj="valuesAutocompleteWildcard"] input').prop('disabled') + ).toBeTruthy(); + }); + + test('it renders loading if "isLoading" is true', () => { + wrapper = mount( + <AutocompleteFieldWildcardComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logs-endpoint.events.*', + }} + isClearable={false} + isDisabled={false} + isLoading + onChange={jest.fn()} + onError={jest.fn()} + onWarning={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('file.path.text')} + selectedValue="/opt/*/app.dmg" + /> + ); + wrapper.find('[data-test-subj="valuesAutocompleteWildcard"] button').at(0).simulate('click'); + expect( + wrapper + .find('EuiComboBoxOptionsList[data-test-subj="valuesAutocompleteWildcard-optionsList"]') + .prop('isLoading') + ).toBeTruthy(); + }); + + test('it allows user to clear values if "isClearable" is true', () => { + wrapper = mount( + <AutocompleteFieldWildcardComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logs-endpoint.events.*', + }} + isClearable={true} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + onWarning={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('file.path.text')} + selectedValue="/opt/*/app.dmg" + /> + ); + + expect(wrapper.find(`[data-test-subj="comboBoxClearButton"]`)).toBeTruthy(); + }); + + test('it correctly displays selected value', () => { + wrapper = mount( + <AutocompleteFieldWildcardComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logs-endpoint.events.*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + onWarning={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('file.path.text')} + selectedValue="/opt/*/app.dmg" + /> + ); + + expect( + wrapper.find('[data-test-subj="valuesAutocompleteWildcard"] input').at(0).props().value + ).toEqual('/opt/*/app.dmg'); + }); + + test('it invokes "onChange" when new value created', async () => { + const mockOnChange = jest.fn(); + wrapper = mount( + <AutocompleteFieldWildcardComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logs-endpoint.events.*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={mockOnChange} + onError={jest.fn()} + onWarning={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('file.path.text')} + selectedValue="" + /> + ); + + ( + wrapper.find(EuiComboBox).props() as unknown as { + onCreateOption: (a: string) => void; + } + ).onCreateOption('/opt/*/app.dmg'); + + expect(mockOnChange).toHaveBeenCalledWith('/opt/*/app.dmg'); + }); + + test('it invokes "onChange" when new value selected', async () => { + const mockOnChange = jest.fn(); + wrapper = mount( + <AutocompleteFieldWildcardComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logs-endpoint.events.*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={mockOnChange} + onError={jest.fn()} + onWarning={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('file.path.text')} + selectedValue="" + /> + ); + + ( + wrapper.find(EuiComboBox).props() as unknown as { + onChange: (a: EuiComboBoxOptionOption[]) => void; + } + ).onChange([{ label: 'value 1' }]); + + expect(mockOnChange).toHaveBeenCalledWith('value 1'); + }); + + test('it refreshes autocomplete with search query when new value searched', () => { + wrapper = mount( + <AutocompleteFieldWildcardComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logs-endpoint.events.*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + onWarning={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('file.path.text')} + selectedValue="" + /> + ); + act(() => { + ( + wrapper.find(EuiComboBox).props() as unknown as { + onSearchChange: (a: string) => void; + } + ).onSearchChange('A:\\Some Folder\\inc*.exe'); + }); + + expect(useFieldValueAutocomplete).toHaveBeenCalledWith({ + autocompleteService: autocompleteStartMock, + fieldValue: '', + indexPattern: { + fields, + id: '1234', + title: 'logs-endpoint.events.*', + }, + operatorType: 'wildcard', + query: 'A:\\Some Folder\\inc*.exe', + selectedField: getField('file.path.text'), + }); + }); + + test('it does not invoke "onWarning" when no warning exists', () => { + const mockOnWarning = jest.fn(); + wrapper = mount( + <AutocompleteFieldWildcardComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logs-endpoint.events.*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + onWarning={mockOnWarning} + placeholder="Placeholder text" + selectedField={getField('file.path.text')} + selectedValue="invalid path" + /> + ); + + act(() => { + ( + wrapper.find(EuiComboBox).props() as unknown as { + onBlur: () => void; + } + ).onBlur(); + }); + + expect(mockOnWarning).not.toHaveBeenCalledWith(true); + }); + + test('it invokes "onWarning" when warning exists', () => { + const mockOnWarning = jest.fn(); + wrapper = mount( + <AutocompleteFieldWildcardComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logs-endpoint.events.*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + onWarning={mockOnWarning} + placeholder="Placeholder text" + selectedField={getField('file.path.text')} + selectedValue="invalid path" + warning={FILEPATH_WARNING} + /> + ); + + act(() => { + ( + wrapper.find(EuiComboBox).props() as unknown as { + onBlur: () => void; + } + ).onBlur(); + }); + + expect(mockOnWarning).toHaveBeenCalledWith(true); + expect( + wrapper + .find('[data-test-subj="valuesAutocompleteWildcardLabel"] div.euiFormHelpText') + .at(0) + .text() + ).toEqual(FILEPATH_WARNING); + }); + + test('it invokes "onWarning" when warning exists and is wildcard warning', () => { + const mockOnWarning = jest.fn(); + wrapper = mount( + <AutocompleteFieldWildcardComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logs-endpoint.events.*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + onWarning={mockOnWarning} + placeholder="Placeholder text" + selectedField={getField('file.path.text')} + selectedValue="invalid path" + warning={WILDCARD_WARNING} + /> + ); + + act(() => { + ( + wrapper.find(EuiComboBox).props() as unknown as { + onBlur: () => void; + } + ).onBlur(); + }); + + expect(mockOnWarning).toHaveBeenCalledWith(true); + const helpText = wrapper + .find('[data-test-subj="valuesAutocompleteWildcardLabel"] div.euiFormHelpText') + .at(0); + expect(helpText.text()).toEqual(WILDCARD_WARNING); + expect(helpText.find('.euiToolTipAnchor')).toBeTruthy(); + }); + test('should show the warning helper text if the new value contains spaces when change', async () => { + (useFieldValueAutocomplete as jest.Mock).mockReturnValue([ + false, + true, + [' value 1 ', 'value 2'], + getValueSuggestionsMock, + ]); + const mockOnChange = jest.fn(); + wrapper = mount( + <AutocompleteFieldWildcardComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logs-endpoint.events.*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={mockOnChange} + onError={jest.fn()} + onWarning={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('file.path.text')} + selectedValue="invalid path" + warning={WILDCARD_WARNING} + /> + ); + + await waitFor(() => + ( + wrapper.find(EuiComboBox).props() as unknown as { + onChange: (a: EuiComboBoxOptionOption[]) => void; + } + ).onChange([{ label: ' value 1 ' }]) + ); + wrapper.update(); + expect(mockOnChange).toHaveBeenCalledWith(' value 1 '); + + const euiFormHelptext = wrapper.find(EuiFormHelpText); + expect(euiFormHelptext.length).toBeTruthy(); + }); + test('should show the warning helper text if the new value contains spaces when searching a new query', () => { + wrapper = mount( + <AutocompleteFieldWildcardComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logs-endpoint.events.*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + onWarning={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('file.path.text')} + selectedValue="invalid path" + warning={''} + /> + ); + act(() => { + ( + wrapper.find(EuiComboBox).props() as unknown as { + onSearchChange: (a: string) => void; + } + ).onSearchChange(' value 1'); + }); + + wrapper.update(); + const euiFormHelptext = wrapper.find(EuiFormHelpText); + expect(euiFormHelptext.length).toBeTruthy(); + expect(euiFormHelptext.text()).toEqual('Warning: there is a space'); + }); + test('should show the warning helper text if selectedValue contains spaces when editing', () => { + wrapper = mount( + <AutocompleteFieldWildcardComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logs-endpoint.events.*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + onWarning={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('file.path.text')} + selectedValue=" leading space" + warning={''} + /> + ); + const euiFormHelptext = wrapper.find(EuiFormHelpText); + expect(euiFormHelptext.length).toBeTruthy(); + expect(euiFormHelptext.text()).toEqual('Warning: there is a space'); + }); + test('should not show the warning helper text if selectedValue is falsy', () => { + wrapper = mount( + <AutocompleteFieldWildcardComponent + autocompleteService={autocompleteStartMock} + indexPattern={{ + fields, + id: '1234', + title: 'logs-endpoint.events.*', + }} + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + onError={jest.fn()} + onWarning={jest.fn()} + placeholder="Placeholder text" + selectedField={getField('file.path.text')} + selectedValue="" + warning={''} + /> + ); + const euiFormHelptext = wrapper.find(EuiFormHelpText); + expect(euiFormHelptext.length).toBeFalsy(); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.tsx new file mode 100644 index 0000000000000..c095578bf0ff0 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_wildcard/index.tsx @@ -0,0 +1,285 @@ +/* + * 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, useMemo, useState, useEffect, memo } from 'react'; +import { EuiFormRow, EuiComboBoxOptionOption, EuiComboBox } from '@elastic/eui'; +import { DataViewBase, DataViewFieldBase } from '@kbn/es-query'; + +import { uniq } from 'lodash'; + +import { ListOperatorTypeEnum as OperatorTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; + +// TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715 +// import { AutocompleteStart } from '../../../../../../../../../../src/plugins/unified_search/public'; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +type AutocompleteStart = any; + +import * as i18n from '../translations'; +import { useFieldValueAutocomplete } from '../hooks/use_field_value_autocomplete'; +import { + getGenericComboBoxProps, + GetGenericComboBoxPropsReturn, +} from '../get_generic_combo_box_props'; +import { paramIsValid } from '../param_is_valid'; +import { paramContainsSpace } from '../param_contains_space'; + +const SINGLE_SELECTION = { asPlainText: true }; + +type Warning = string | React.ReactNode; +interface AutocompleteFieldWildcardProps { + placeholder: string; + selectedField: DataViewFieldBase | undefined; + selectedValue: string | undefined; + indexPattern: DataViewBase | undefined; + isLoading: boolean; + isDisabled?: boolean; + isClearable?: boolean; + isRequired?: boolean; + fieldInputWidth?: number; + rowLabel?: string; + autocompleteService: AutocompleteStart; + onChange: (arg: string) => void; + onError: (arg: boolean) => void; + onWarning: (arg: boolean) => void; + warning?: Warning; + 'aria-label'?: string; +} + +export const AutocompleteFieldWildcardComponent: React.FC<AutocompleteFieldWildcardProps> = memo( + ({ + autocompleteService, + placeholder, + rowLabel, + selectedField, + selectedValue, + indexPattern, + isLoading, + isDisabled = false, + isClearable = false, + isRequired = false, + fieldInputWidth, + onChange, + onError, + onWarning, + warning, + 'aria-label': ariaLabel, + }): JSX.Element => { + const [searchQuery, setSearchQuery] = useState(''); + const [touched, setIsTouched] = useState(false); + const [error, setError] = useState<string | undefined>(undefined); + const [showSpacesWarning, setShowSpacesWarning] = useState<boolean>(false); + const [isLoadingSuggestions, , suggestions] = useFieldValueAutocomplete({ + autocompleteService, + fieldValue: selectedValue, + indexPattern, + operatorType: OperatorTypeEnum.WILDCARD, + query: searchQuery, + selectedField, + }); + const getLabel = useCallback((option: string): string => option, []); + const optionsMemo = useMemo((): string[] => { + const valueAsStr = String(selectedValue); + return selectedValue != null && selectedValue.trim() !== '' + ? uniq([valueAsStr, ...suggestions]) + : suggestions; + }, [suggestions, selectedValue]); + const selectedOptionsMemo = useMemo((): string[] => { + const valueAsStr = String(selectedValue); + return selectedValue ? [valueAsStr] : []; + }, [selectedValue]); + + const handleSpacesWarning = useCallback( + (param: string | undefined) => { + if (!param) return setShowSpacesWarning(false); + setShowSpacesWarning(!!paramContainsSpace(param)); + }, + [setShowSpacesWarning] + ); + const handleError = useCallback( + (err: string | undefined): void => { + setError((existingErr): string | undefined => { + const oldErr = existingErr != null; + const newErr = err != null; + if (oldErr !== newErr && onError != null) { + onError(newErr); + } + + return err; + }); + }, + [setError, onError] + ); + + const handleWarning = useCallback( + (warn: Warning | undefined): void => { + onWarning(warn !== undefined); + }, + [onWarning] + ); + + const { comboOptions, labels, selectedComboOptions } = useMemo( + (): GetGenericComboBoxPropsReturn => + getGenericComboBoxProps<string>({ + getLabel, + options: optionsMemo, + selectedOptions: selectedOptionsMemo, + }), + [optionsMemo, selectedOptionsMemo, getLabel] + ); + + const handleValuesChange = useCallback( + (newOptions: EuiComboBoxOptionOption[]): void => { + const [newValue] = newOptions.map(({ label }) => optionsMemo[labels.indexOf(label)]); + handleError(undefined); + handleSpacesWarning(newValue); + setShowSpacesWarning(false); + + onChange(newValue ?? ''); + }, + [handleError, handleSpacesWarning, labels, onChange, optionsMemo] + ); + + const handleSearchChange = useCallback( + (searchVal: string): void => { + if (searchVal.trim() !== '' && selectedField != null) { + const err = paramIsValid(searchVal, selectedField, isRequired, touched); + handleError(err); + handleWarning(warning); + if (!err) handleSpacesWarning(searchVal); + + setSearchQuery(searchVal); + } + }, + [handleError, handleSpacesWarning, isRequired, selectedField, touched, warning, handleWarning] + ); + + const handleCreateOption = useCallback( + (option: string): boolean | undefined => { + const err = paramIsValid(option, selectedField, isRequired, touched); + handleError(err); + handleWarning(warning); + + if (err != null) { + // Explicitly reject the user's input + setShowSpacesWarning(false); + return false; + } + + handleSpacesWarning(option); + onChange(option); + return undefined; + }, + [ + isRequired, + handleSpacesWarning, + onChange, + selectedField, + touched, + handleError, + handleWarning, + warning, + ] + ); + + const setIsTouchedValue = useCallback((): void => { + setIsTouched(true); + + const err = paramIsValid(selectedValue, selectedField, isRequired, true); + handleError(err); + handleWarning(warning); + }, [ + setIsTouched, + handleError, + selectedValue, + selectedField, + isRequired, + handleWarning, + warning, + ]); + + const inputPlaceholder = useMemo((): string => { + if (isLoading || isLoadingSuggestions) { + return i18n.LOADING; + } else if (selectedField == null) { + return i18n.SELECT_FIELD_FIRST; + } else { + return placeholder; + } + }, [isLoading, selectedField, isLoadingSuggestions, placeholder]); + + const isLoadingState = useMemo( + (): boolean => isLoading || isLoadingSuggestions, + [isLoading, isLoadingSuggestions] + ); + + useEffect((): void => { + setError(undefined); + if (onError != null) { + onError(false); + } + handleSpacesWarning(selectedValue); + + onWarning(false); + }, [selectedField, selectedValue, onError, onWarning, handleSpacesWarning]); + + const defaultInput = useMemo((): JSX.Element => { + return ( + <EuiFormRow + label={rowLabel} + error={error} + helpText={warning || (showSpacesWarning && i18n.FIELD_SPACE_WARNING)} + isInvalid={selectedField != null && error != null} + data-test-subj="valuesAutocompleteWildcardLabel" + fullWidth + > + <EuiComboBox + placeholder={inputPlaceholder} + isDisabled={isDisabled || !selectedField} + isLoading={isLoadingState} + isClearable={isClearable} + options={comboOptions} + selectedOptions={selectedComboOptions} + onChange={handleValuesChange} + singleSelection={SINGLE_SELECTION} + onSearchChange={handleSearchChange} + onCreateOption={handleCreateOption} + isInvalid={selectedField != null && error != null} + onBlur={setIsTouchedValue} + sortMatchesBy="startsWith" + data-test-subj="valuesAutocompleteWildcard" + style={fieldInputWidth ? { width: `${fieldInputWidth}px` } : {}} + fullWidth + async + aria-label={ariaLabel} + /> + </EuiFormRow> + ); + }, [ + rowLabel, + error, + warning, + showSpacesWarning, + selectedField, + inputPlaceholder, + isDisabled, + isLoadingState, + isClearable, + comboOptions, + selectedComboOptions, + handleValuesChange, + handleSearchChange, + handleCreateOption, + setIsTouchedValue, + fieldInputWidth, + ariaLabel, + ]); + + return defaultInput; + } +); + +AutocompleteFieldWildcardComponent.displayName = 'AutocompleteFieldWildcard'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/fields/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/fields/index.mock.ts new file mode 100644 index 0000000000000..32e9d60197868 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/fields/index.mock.ts @@ -0,0 +1,321 @@ +/* + * 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 { DataViewFieldBase } from '@kbn/es-query'; + +// Copied from "src/plugins/data/common/index_patterns/fields/fields.mocks.ts" but with the types changed to "DataViewFieldBase" since that type is compatible. +// TODO: This should move out once those mocks are directly useable or in their own package, https://github.com/elastic/kibana/issues/100715 + +export const fields: DataViewFieldBase[] = [ + { + name: 'bytes', + type: 'number', + esTypes: ['long'], + count: 10, + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + name: 'ssl', + type: 'boolean', + esTypes: ['boolean'], + count: 20, + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + name: '@timestamp', + type: 'date', + esTypes: ['date'], + count: 30, + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + name: 'time', + type: 'date', + esTypes: ['date'], + count: 30, + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + name: '@tags', + type: 'string', + esTypes: ['keyword'], + count: 0, + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + name: 'utc_time', + type: 'date', + esTypes: ['date'], + count: 0, + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + name: 'phpmemory', + type: 'number', + esTypes: ['integer'], + count: 0, + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + name: 'ip', + type: 'ip', + esTypes: ['ip'], + count: 0, + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + name: 'request_body', + type: 'attachment', + esTypes: ['attachment'], + count: 0, + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + name: 'point', + type: 'geo_point', + esTypes: ['geo_point'], + count: 0, + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + name: 'area', + type: 'geo_shape', + esTypes: ['geo_shape'], + count: 0, + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + name: 'hashed', + type: 'murmur3', + esTypes: ['murmur3'], + count: 0, + scripted: false, + searchable: true, + aggregatable: false, + readFromDocValues: false, + }, + { + name: 'geo.coordinates', + type: 'geo_point', + esTypes: ['geo_point'], + count: 0, + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + name: 'extension', + type: 'string', + esTypes: ['keyword'], + count: 0, + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + name: 'machine.os', + type: 'string', + esTypes: ['text'], + count: 0, + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: false, + }, + { + name: 'machine.os.raw', + type: 'string', + esTypes: ['keyword'], + count: 0, + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + subType: { multi: { parent: 'machine.os' } }, + }, + { + name: 'geo.src', + type: 'string', + esTypes: ['keyword'], + count: 0, + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + name: '_id', + type: 'string', + esTypes: ['_id'], + count: 0, + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: false, + }, + { + name: '_type', + type: 'string', + esTypes: ['_type'], + count: 0, + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: false, + }, + { + name: '_source', + type: '_source', + esTypes: ['_source'], + count: 0, + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: false, + }, + { + name: 'non-filterable', + type: 'string', + esTypes: ['text'], + count: 0, + scripted: false, + searchable: false, + aggregatable: true, + readFromDocValues: false, + }, + { + name: 'non-sortable', + type: 'string', + esTypes: ['text'], + count: 0, + scripted: false, + searchable: false, + aggregatable: false, + readFromDocValues: false, + }, + { + name: 'custom_user_field', + type: 'conflict', + esTypes: ['long', 'text'], + count: 0, + scripted: false, + searchable: true, + aggregatable: true, + readFromDocValues: true, + }, + { + name: 'script string', + type: 'string', + count: 0, + scripted: true, + script: "'i am a string'", + lang: 'expression', + searchable: true, + aggregatable: true, + readFromDocValues: false, + }, + { + name: 'script number', + type: 'number', + count: 0, + scripted: true, + script: '1234', + lang: 'expression', + searchable: true, + aggregatable: true, + readFromDocValues: false, + }, + { + name: 'script date', + type: 'date', + count: 0, + scripted: true, + script: '1234', + lang: 'painless', + searchable: true, + aggregatable: true, + readFromDocValues: false, + }, + { + name: 'script murmur3', + type: 'murmur3', + count: 0, + scripted: true, + script: '1234', + lang: 'expression', + searchable: true, + aggregatable: true, + readFromDocValues: false, + }, + { + name: 'nestedField.child', + type: 'string', + esTypes: ['text'], + count: 0, + scripted: false, + searchable: true, + aggregatable: false, + readFromDocValues: false, + subType: { nested: { path: 'nestedField' } }, + }, + { + name: 'nestedField.nestedChild.doublyNestedChild', + type: 'string', + esTypes: ['text'], + count: 0, + scripted: false, + searchable: true, + aggregatable: false, + readFromDocValues: false, + subType: { nested: { path: 'nestedField.nestedChild' } }, + }, + { + name: 'file.path.text', + type: 'string', + esTypes: ['text'], + searchable: true, + aggregatable: false, + subType: { multi: { parent: 'file.path' } }, + }, +] as unknown as DataViewFieldBase[]; + +export const getField = (name: string) => fields.find((field) => field.name === name); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/filter_field_to_list/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/filter_field_to_list/index.test.ts new file mode 100644 index 0000000000000..3328af4e2fa2c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/filter_field_to_list/index.test.ts @@ -0,0 +1,123 @@ +/* + * 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 { filterFieldToList } from '.'; + +import { getListResponseMock } from '../list_schema/index.mock'; +import { DataViewFieldBase } from '@kbn/es-query'; +import { AutocompleteListsData } from '../field_value_lists'; + +const emptyListData: AutocompleteListsData = { smallLists: [], largeLists: [] }; + +describe('#filterFieldToList', () => { + test('it returns empty list data object if given a undefined for field', () => { + const filter = filterFieldToList(emptyListData, undefined); + expect(filter).toEqual(emptyListData); + }); + + test('it returns empty list data object if filed does not contain esTypes', () => { + const field: DataViewFieldBase = { + name: 'some-name', + type: 'some-type', + }; + const filter = filterFieldToList(emptyListData, field); + expect(filter).toEqual(emptyListData); + }); + + test('it returns filtered lists of ip_range -> ip', () => { + const field: DataViewFieldBase & { esTypes: string[] } = { + esTypes: ['ip'], + name: 'some-name', + type: 'ip', + }; + const listData: AutocompleteListsData = { + smallLists: [{ ...getListResponseMock(), type: 'ip_range' }], + largeLists: [], + }; + const filter = filterFieldToList(listData, field); + const expected = listData; + expect(filter).toEqual(expected); + }); + + test('it returns filtered lists of ip -> ip', () => { + const field: DataViewFieldBase & { esTypes: string[] } = { + esTypes: ['ip'], + name: 'some-name', + type: 'ip', + }; + const listData: AutocompleteListsData = { + smallLists: [{ ...getListResponseMock(), type: 'ip' }], + largeLists: [], + }; + const filter = filterFieldToList(listData, field); + const expected = listData; + expect(filter).toEqual(expected); + }); + + test('it returns filtered lists of keyword -> keyword', () => { + const field: DataViewFieldBase & { esTypes: string[] } = { + esTypes: ['keyword'], + name: 'some-name', + type: 'keyword', + }; + const listData: AutocompleteListsData = { + smallLists: [{ ...getListResponseMock(), type: 'keyword' }], + largeLists: [], + }; + const filter = filterFieldToList(listData, field); + const expected = listData; + expect(filter).toEqual(expected); + }); + + test('it returns filtered lists of text -> text', () => { + const field: DataViewFieldBase & { esTypes: string[] } = { + esTypes: ['text'], + name: 'some-name', + type: 'text', + }; + const listData: AutocompleteListsData = { + smallLists: [{ ...getListResponseMock(), type: 'text' }], + largeLists: [], + }; + const filter = filterFieldToList(listData, field); + const expected = listData; + expect(filter).toEqual(expected); + }); + + test('it returns small and large filtered lists of ip_range -> ip', () => { + const field: DataViewFieldBase & { esTypes: string[] } = { + esTypes: ['ip'], + name: 'some-name', + type: 'ip', + }; + const listData: AutocompleteListsData = { + smallLists: [{ ...getListResponseMock(), type: 'ip_range' }], + largeLists: [{ ...getListResponseMock(), type: 'ip_range' }], + }; + const filter = filterFieldToList(listData, field); + const expected = listData; + expect(filter).toEqual(expected); + }); + + test('it returns 1 filtered lists of ip_range -> ip if the 2nd is not compatible type', () => { + const field: DataViewFieldBase & { esTypes: string[] } = { + esTypes: ['ip'], + name: 'some-name', + type: 'ip', + }; + const listData: AutocompleteListsData = { + smallLists: [{ ...getListResponseMock(), type: 'ip_range' }], + largeLists: [{ ...getListResponseMock(), type: 'text' }], + }; + const filter = filterFieldToList(listData, field); + const expected: AutocompleteListsData = { + smallLists: [{ ...getListResponseMock(), type: 'ip_range' }], + largeLists: [], + }; + expect(filter).toEqual(expected); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/filter_field_to_list/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/filter_field_to_list/index.ts new file mode 100644 index 0000000000000..a4df119766a96 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/filter_field_to_list/index.ts @@ -0,0 +1,39 @@ +/* + * 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 { DataViewFieldBase } from '@kbn/es-query'; +import { typeMatch } from '../type_match'; +import { AutocompleteListsData } from '../field_value_lists'; + +/** + * Given an array of lists and optionally a field this will return all + * the lists that match against the field based on the types from the field + * + * NOTE: That we support one additional property from "FieldSpec" located here: + * src/plugins/data/common/index_patterns/fields/types.ts + * This type property is esTypes. If it exists and is on there we will read off the esTypes. + * @param lists The lists to match against the field + * @param field The field to check against the list to see if they are compatible + */ +export const filterFieldToList = ( + lists: AutocompleteListsData, + field?: DataViewFieldBase & { esTypes?: string[] } +): AutocompleteListsData => { + if (field != null) { + const { esTypes = [] } = field; + return { + smallLists: lists.smallLists.filter(({ type }) => + esTypes.some((esType: string) => typeMatch(type, esType)) + ), + largeLists: lists.largeLists.filter(({ type }) => + esTypes.some((esType: string) => typeMatch(type, esType)) + ), + }; + } else { + return { smallLists: [], largeLists: [] }; + } +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/get_generic_combo_box_props/index.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/get_generic_combo_box_props/index.test.tsx new file mode 100644 index 0000000000000..f333e7c6ebdd2 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/get_generic_combo_box_props/index.test.tsx @@ -0,0 +1,124 @@ +/* + * 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 { getGenericComboBoxProps } from '.'; + +describe('get_generic_combo_box_props', () => { + test('it returns empty arrays if "options" is empty array', () => { + const result = getGenericComboBoxProps<string>({ + options: [], + selectedOptions: ['option1'], + getLabel: (t: string) => t, + }); + + expect(result).toEqual({ comboOptions: [], labels: [], selectedComboOptions: [] }); + }); + + test('it returns formatted props if "options" array is not empty', () => { + const result = getGenericComboBoxProps<string>({ + options: ['option1', 'option2', 'option3'], + selectedOptions: [], + getLabel: (t: string) => t, + }); + + expect(result).toEqual({ + comboOptions: [ + { + label: 'option1', + }, + { + label: 'option2', + }, + { + label: 'option3', + }, + ], + labels: ['option1', 'option2', 'option3'], + selectedComboOptions: [], + }); + }); + + test('it does not return "selectedOptions" items that do not appear in "options"', () => { + const result = getGenericComboBoxProps<string>({ + options: ['option1', 'option2', 'option3'], + selectedOptions: ['option4'], + getLabel: (t: string) => t, + }); + + expect(result).toEqual({ + comboOptions: [ + { + label: 'option1', + }, + { + label: 'option2', + }, + { + label: 'option3', + }, + ], + labels: ['option1', 'option2', 'option3'], + selectedComboOptions: [], + }); + }); + + test('it returns "selectedOptions" items that do appear in "options"', () => { + const result = getGenericComboBoxProps<string>({ + options: ['option1', 'option2', 'option3'], + selectedOptions: ['option2'], + getLabel: (t: string) => t, + }); + + expect(result).toEqual({ + comboOptions: [ + { + label: 'option1', + }, + { + label: 'option2', + }, + { + label: 'option3', + }, + ], + labels: ['option1', 'option2', 'option3'], + selectedComboOptions: [ + { + label: 'option2', + }, + ], + }); + }); + + test('it returns "disabledOptions" items that do appear in "options" as disabled', () => { + const result = getGenericComboBoxProps<string>({ + options: ['option1', 'option2', 'option3'], + selectedOptions: [], + disabledOptions: ['option2'], + getLabel: (t: string) => t, + }); + + expect(result).toEqual({ + comboOptions: [ + { + label: 'option1', + disabled: false, + }, + { + label: 'option2', + disabled: true, + }, + { + label: 'option3', + disabled: false, + }, + ], + labels: ['option1', 'option2', 'option3'], + selectedComboOptions: [], + }); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/get_generic_combo_box_props/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/get_generic_combo_box_props/index.ts new file mode 100644 index 0000000000000..f043fc978836d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/get_generic_combo_box_props/index.ts @@ -0,0 +1,53 @@ +/* + * 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'; + +export interface GetGenericComboBoxPropsReturn { + comboOptions: EuiComboBoxOptionOption[]; + labels: string[]; + selectedComboOptions: EuiComboBoxOptionOption[]; +} + +/** + * Determines the options, selected values and option labels for EUI combo box + * @param options options user can select from + * @param selectedOptions user selection if any + * @param getLabel helper function to know which property to use for labels + */ +export const getGenericComboBoxProps = <T>({ + getLabel, + options, + selectedOptions, + disabledOptions, +}: { + getLabel: (value: T) => string; + options: T[]; + selectedOptions: T[]; + disabledOptions?: T[]; +}): GetGenericComboBoxPropsReturn => { + const newLabels = options.map(getLabel); + const disabledLabels = disabledOptions?.map(getLabel); + const newComboOptions: EuiComboBoxOptionOption[] = newLabels.map((label) => ({ + label, + disabled: disabledLabels && disabledLabels.length !== 0 && disabledLabels.includes(label), + })); + const newSelectedComboOptions = selectedOptions + .map(getLabel) + .filter((option) => { + return newLabels.indexOf(option) !== -1; + }) + .map((option) => { + return newComboOptions[newLabels.indexOf(option)]; + }); + + return { + comboOptions: newComboOptions, + labels: newLabels, + selectedComboOptions: newSelectedComboOptions, + }; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/get_operators/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/get_operators/index.test.ts new file mode 100644 index 0000000000000..db031a65e0bb7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/get_operators/index.test.ts @@ -0,0 +1,57 @@ +/* + * 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 { + doesNotExistOperator, + EVENT_FILTERS_OPERATORS, + ALL_OPERATORS, + existsOperator, + isNotOperator, + isOperator, +} from '@kbn/securitysolution-list-utils'; +import { getOperators } from '.'; +import { getField } from '../fields/index.mock'; + +describe('#getOperators', () => { + test('it returns "isOperator" if passed in field is "undefined"', () => { + const operator = getOperators(undefined); + + expect(operator).toEqual([isOperator]); + }); + + test('it returns expected operators when field type is "boolean"', () => { + const operator = getOperators(getField('ssl')); + + expect(operator).toEqual([isOperator, isNotOperator, existsOperator, doesNotExistOperator]); + }); + + test('it returns "isOperator" when field type is "nested"', () => { + const operator = getOperators({ + name: 'nestedField', + scripted: false, + subType: { nested: { path: 'nestedField' } }, + type: 'nested', + }); + + expect(operator).toEqual([isOperator]); + }); + + test('it includes a "matches" operator when field is "file.path.text"', () => { + const operator = getOperators({ + name: 'file.path.text', + type: 'simple', + }); + + expect(operator).toEqual(EVENT_FILTERS_OPERATORS); + }); + + test('it returns all operator types when field type is not null, boolean, or nested', () => { + const operator = getOperators(getField('machine.os.raw')); + + expect(operator).toEqual(ALL_OPERATORS); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/get_operators/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/get_operators/index.ts new file mode 100644 index 0000000000000..451d4f5c21a7c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/get_operators/index.ts @@ -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 { DataViewFieldBase } from '@kbn/es-query'; + +import { + ALL_OPERATORS, + EVENT_FILTERS_OPERATORS, + OperatorOption, + doesNotExistOperator, + existsOperator, + isNotOperator, + isOperator, +} from '@kbn/securitysolution-list-utils'; + +/** + * Returns the appropriate operators given a field type + * + * @param field DataViewFieldBase selected field + * + */ +export const getOperators = (field: DataViewFieldBase | undefined): OperatorOption[] => { + if (field == null) { + return [isOperator]; + } else if (field.type === 'boolean') { + return [isOperator, isNotOperator, existsOperator, doesNotExistOperator]; + } else if (field.type === 'nested') { + return [isOperator]; + } else if (field.name === 'file.path.text') { + return EVENT_FILTERS_OPERATORS; + } else { + return ALL_OPERATORS; + } +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/hooks/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/hooks/index.ts new file mode 100644 index 0000000000000..e9d4507b14005 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/hooks/index.ts @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export * from './use_field_value_autocomplete'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.test.ts new file mode 100644 index 0000000000000..7d776db124134 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.test.ts @@ -0,0 +1,298 @@ +/* + * 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 { waitFor, renderHook } from '@testing-library/react'; +import { ListOperatorTypeEnum as OperatorTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; + +import { UseFieldValueAutocompleteReturn, useFieldValueAutocomplete } from '.'; +import { getField } from '../../fields/index.mock'; +import { autocompleteStartMock } from '../../autocomplete/index.mock'; +import { DataViewFieldBase } from '@kbn/es-query'; + +// Copied from "src/plugins/data/common/index_patterns/index_pattern.stub.ts" +// TODO: Remove this in favor of the above if/when it is ported, https://github.com/elastic/kibana/issues/100715 +export const stubIndexPatternWithFields = { + id: '1234', + title: 'logstash-*', + fields: [ + { + name: 'response', + type: 'number', + esTypes: ['integer'], + aggregatable: true, + filterable: true, + searchable: true, + }, + ], +}; + +describe('use_field_value_autocomplete', () => { + const onErrorMock = jest.fn(); + const getValueSuggestionsMock = jest.fn().mockResolvedValue(['value 1', 'value 2']); + + afterEach(() => { + onErrorMock.mockClear(); + getValueSuggestionsMock.mockClear(); + }); + + test('initializes hook', async () => { + const { result } = renderHook(() => + useFieldValueAutocomplete({ + autocompleteService: { + ...autocompleteStartMock, + getValueSuggestions: getValueSuggestionsMock, + }, + fieldValue: '', + indexPattern: undefined, + operatorType: OperatorTypeEnum.MATCH, + query: '', + selectedField: undefined, + }) + ); + await waitFor(() => expect(result.current).toEqual([false, true, [], result.current[3]])); + }); + + test('does not call autocomplete service if "operatorType" is "exists"', async () => { + const { result } = renderHook(() => + useFieldValueAutocomplete({ + autocompleteService: { + ...autocompleteStartMock, + getValueSuggestions: getValueSuggestionsMock, + }, + fieldValue: '', + indexPattern: stubIndexPatternWithFields, + operatorType: OperatorTypeEnum.EXISTS, + query: '', + selectedField: getField('machine.os'), + }) + ); + + await waitFor(() => { + const expectedResult: UseFieldValueAutocompleteReturn = [false, true, [], result.current[3]]; + + expect(result.current).toEqual(expectedResult); + expect(getValueSuggestionsMock).not.toHaveBeenCalled(); + }); + }); + + test('does not call autocomplete service if "selectedField" is undefined', async () => { + const { result } = renderHook(() => + useFieldValueAutocomplete({ + autocompleteService: { + ...autocompleteStartMock, + getValueSuggestions: getValueSuggestionsMock, + }, + fieldValue: '', + indexPattern: stubIndexPatternWithFields, + operatorType: OperatorTypeEnum.EXISTS, + query: '', + selectedField: undefined, + }) + ); + + await waitFor(() => { + const expectedResult: UseFieldValueAutocompleteReturn = [false, true, [], result.current[3]]; + + expect(result.current).toEqual(expectedResult); + expect(getValueSuggestionsMock).not.toHaveBeenCalled(); + }); + }); + + test('does not call autocomplete service if "indexPattern" is undefined', async () => { + const { result } = renderHook(() => + useFieldValueAutocomplete({ + autocompleteService: { + ...autocompleteStartMock, + getValueSuggestions: getValueSuggestionsMock, + }, + fieldValue: '', + indexPattern: undefined, + operatorType: OperatorTypeEnum.EXISTS, + query: '', + selectedField: getField('machine.os'), + }) + ); + + await waitFor(() => { + const expectedResult: UseFieldValueAutocompleteReturn = [false, true, [], result.current[3]]; + + expect(result.current).toEqual(expectedResult); + expect(getValueSuggestionsMock).not.toHaveBeenCalled(); + }); + }); + + test('it uses full path name for nested fields to fetch suggestions', async () => { + const suggestionsMock = jest.fn().mockResolvedValue([]); + + const selectedField: DataViewFieldBase | undefined = getField('nestedField.child'); + if (selectedField == null) { + throw new TypeError('selectedField for this test should always be defined'); + } + + const { signal } = new AbortController(); + renderHook(() => + useFieldValueAutocomplete({ + autocompleteService: { + ...autocompleteStartMock, + getValueSuggestions: suggestionsMock, + }, + fieldValue: '', + indexPattern: stubIndexPatternWithFields, + operatorType: OperatorTypeEnum.MATCH, + query: '', + selectedField: { ...selectedField, name: 'child' }, + }) + ); + + await waitFor(() => + expect(suggestionsMock).toHaveBeenCalledWith({ + field: { ...getField('nestedField.child'), name: 'nestedField.child' }, + indexPattern: { + fields: [ + { + aggregatable: true, + esTypes: ['integer'], + filterable: true, + name: 'response', + searchable: true, + type: 'number', + }, + ], + id: '1234', + title: 'logstash-*', + }, + query: '', + signal, + useTimeRange: false, + }) + ); + }); + + test('returns "isSuggestingValues" of false if field type is boolean', async () => { + const { result } = renderHook(() => + useFieldValueAutocomplete({ + autocompleteService: { + ...autocompleteStartMock, + getValueSuggestions: getValueSuggestionsMock, + }, + fieldValue: '', + indexPattern: stubIndexPatternWithFields, + operatorType: OperatorTypeEnum.MATCH, + query: '', + selectedField: getField('ssl'), + }) + ); + + await waitFor(() => { + const expectedResult: UseFieldValueAutocompleteReturn = [false, false, [], result.current[3]]; + + expect(result.current).toEqual(expectedResult); + expect(getValueSuggestionsMock).not.toHaveBeenCalled(); + }); + }); + + test('returns "isSuggestingValues" of false to note that autocomplete service is not in use if no autocomplete suggestions available', async () => { + const suggestionsMock = jest.fn().mockResolvedValue([]); + + const { result } = renderHook(() => + useFieldValueAutocomplete({ + autocompleteService: { + ...autocompleteStartMock, + getValueSuggestions: suggestionsMock, + }, + fieldValue: '', + indexPattern: stubIndexPatternWithFields, + operatorType: OperatorTypeEnum.MATCH, + query: '', + selectedField: getField('bytes'), + }) + ); + + await waitFor(() => { + const expectedResult: UseFieldValueAutocompleteReturn = [false, false, [], result.current[3]]; + + expect(suggestionsMock).toHaveBeenCalled(); + expect(result.current).toEqual(expectedResult); + }); + }); + + test('returns suggestions', async () => { + const { signal } = new AbortController(); + const { result } = renderHook(() => + useFieldValueAutocomplete({ + autocompleteService: { + ...autocompleteStartMock, + getValueSuggestions: getValueSuggestionsMock, + }, + fieldValue: '', + indexPattern: stubIndexPatternWithFields, + operatorType: OperatorTypeEnum.MATCH, + query: '', + selectedField: getField('@tags'), + }) + ); + + await waitFor(() => { + const expectedResult: UseFieldValueAutocompleteReturn = [ + false, + true, + ['value 1', 'value 2'], + result.current[3], + ]; + + expect(getValueSuggestionsMock).toHaveBeenCalledWith({ + field: getField('@tags'), + indexPattern: stubIndexPatternWithFields, + query: '', + signal, + useTimeRange: false, + }); + expect(result.current).toEqual(expectedResult); + }); + }); + + test('returns new suggestions on subsequent calls', async () => { + const { result } = renderHook(() => + useFieldValueAutocomplete({ + autocompleteService: { + ...autocompleteStartMock, + getValueSuggestions: getValueSuggestionsMock, + }, + fieldValue: '', + indexPattern: stubIndexPatternWithFields, + operatorType: OperatorTypeEnum.MATCH, + query: '', + selectedField: getField('@tags'), + }) + ); + + await waitFor(() => expect(result.current[3]).not.toBeNull()); + + // Added check for typescripts sake, if null, + // would not reach below logic as test would stop above + if (result.current[3] != null) { + result.current[3]({ + fieldSelected: getField('@tags'), + patterns: stubIndexPatternWithFields, + searchQuery: '', + value: 'hello', + }); + } + + await waitFor(() => { + const expectedResult: UseFieldValueAutocompleteReturn = [ + false, + true, + ['value 1', 'value 2'], + result.current[3], + ]; + + expect(getValueSuggestionsMock).toHaveBeenCalledTimes(2); + expect(result.current).toEqual(expectedResult); + }); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.ts new file mode 100644 index 0000000000000..dbbe321014e2b --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.ts @@ -0,0 +1,122 @@ +/* + * 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 { useEffect, useRef, useState } from 'react'; +import { debounce } from 'lodash'; +import { ListOperatorTypeEnum as OperatorTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; +import { DataViewBase, DataViewFieldBase, getDataViewFieldSubtypeNested } from '@kbn/es-query'; + +// TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715 +// import { AutocompleteStart } from '../../../../../../../../../../../src/plugins/unified_search/public'; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +type AutocompleteStart = any; + +interface FuncArgs { + fieldSelected: DataViewFieldBase | undefined; + patterns: DataViewBase | undefined; + searchQuery: string; + value: string | string[] | undefined; +} + +type Func = (args: FuncArgs) => void; + +export type UseFieldValueAutocompleteReturn = [boolean, boolean, string[], Func | null]; + +export interface UseFieldValueAutocompleteProps { + autocompleteService: AutocompleteStart; + fieldValue: string | string[] | undefined; + indexPattern: DataViewBase | undefined; + operatorType: OperatorTypeEnum; + query: string; + selectedField: DataViewFieldBase | undefined; +} +/** + * Hook for using the field value autocomplete service + */ +export const useFieldValueAutocomplete = ({ + selectedField, + operatorType, + fieldValue, + query, + indexPattern, + autocompleteService, +}: UseFieldValueAutocompleteProps): UseFieldValueAutocompleteReturn => { + const [isLoading, setIsLoading] = useState(false); + const [isSuggestingValues, setIsSuggestingValues] = useState(true); + const [suggestions, setSuggestions] = useState<string[]>([]); + const updateSuggestions = useRef<Func | null>(null); + + useEffect(() => { + let isSubscribed = true; + const abortCtrl = new AbortController(); + + const fetchSuggestions = debounce( + async ({ fieldSelected, patterns, searchQuery }: FuncArgs) => { + try { + if (isSubscribed) { + if (fieldSelected == null || patterns == null) { + return; + } + + if (fieldSelected.type === 'boolean') { + setIsSuggestingValues(false); + return; + } + + setIsLoading(true); + const subTypeNested = getDataViewFieldSubtypeNested(fieldSelected); + const field = subTypeNested + ? { + ...fieldSelected, + name: `${subTypeNested.nested.path}.${fieldSelected.name}`, + } + : fieldSelected; + + const newSuggestions = await autocompleteService.getValueSuggestions({ + field, + indexPattern: patterns, + query: searchQuery, + signal: abortCtrl.signal, + useTimeRange: false, + }); + + if (newSuggestions.length === 0) { + setIsSuggestingValues(false); + } + + setIsLoading(false); + setSuggestions([...newSuggestions]); + } + } catch (error) { + if (isSubscribed) { + setSuggestions([]); + setIsLoading(false); + } + } + }, + 500 + ); + + if (operatorType !== OperatorTypeEnum.EXISTS) { + fetchSuggestions({ + fieldSelected: selectedField, + patterns: indexPattern, + searchQuery: query, + value: fieldValue, + }); + } + + updateSuggestions.current = fetchSuggestions; + + return (): void => { + isSubscribed = false; + abortCtrl.abort(); + }; + }, [selectedField, operatorType, fieldValue, indexPattern, query, autocompleteService]); + + return [isLoading, isSuggestingValues, suggestions, updateSuggestions.current]; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/list_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/list_schema/index.mock.ts new file mode 100644 index 0000000000000..aade602f1950c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/list_schema/index.mock.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 { + FoundListSchema, + ListSchema, + FoundListsBySizeSchema, +} from '@kbn/securitysolution-io-ts-list-types'; + +// TODO: Once this mock is available within packages, use it instead, https://github.com/elastic/kibana/issues/100715 +// import { getFoundListSchemaMock } from '../../../../../../../../lists/common/schemas/response/found_list_schema.mock'; +export const getFoundListSchemaMock = (): FoundListSchema => ({ + cursor: '123', + data: [getListResponseMock()], + page: 1, + per_page: 1, + total: 1, +}); + +export const getFoundListsBySizeSchemaMock = (): FoundListsBySizeSchema => ({ + smallLists: [getListResponseMock()], + largeLists: [getListResponseMock()], +}); + +// TODO: Once these mocks are available from packages use it instead, https://github.com/elastic/kibana/issues/100715 +export const DATE_NOW = '2020-04-20T15:25:31.830Z'; +export const USER = 'some user'; +export const IMMUTABLE = false; +export const VERSION = 1; +export const DESCRIPTION = 'some description'; +export const TIE_BREAKER = '6a76b69d-80df-4ab2-8c3e-85f466b06a0e'; +export const LIST_ID = 'some-list-id'; +export const META = {}; +export const TYPE = 'ip'; +export const NAME = 'some name'; + +// TODO: Once this mock is available within packages, use it instead, https://github.com/elastic/kibana/issues/100715 +// import { getListResponseMock } from '../../../../../../../../lists/common/schemas/response/list_schema.mock'; +export const getListResponseMock = (): ListSchema => ({ + '@timestamp': DATE_NOW, + _version: undefined, + created_at: DATE_NOW, + created_by: USER, + description: DESCRIPTION, + deserializer: undefined, + id: LIST_ID, + immutable: IMMUTABLE, + meta: META, + name: NAME, + serializer: undefined, + tie_breaker_id: TIE_BREAKER, + type: TYPE, + updated_at: DATE_NOW, + updated_by: USER, + version: VERSION, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/operator/index.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/operator/index.test.tsx new file mode 100644 index 0000000000000..eef8738b67c51 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/operator/index.test.tsx @@ -0,0 +1,253 @@ +/* + * 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 { mount } from 'enzyme'; +import { EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui'; +import { isNotOperator, isOperator } from '@kbn/securitysolution-list-utils'; + +import { OperatorComponent } from '.'; +import { getField } from '../fields/index.mock'; + +describe('operator', () => { + test('it renders disabled if "isDisabled" is true', () => { + const wrapper = mount( + <OperatorComponent + isClearable={false} + isDisabled={true} + isLoading={false} + onChange={jest.fn()} + operator={isOperator} + placeholder="Placeholder text" + selectedField={getField('machine.os.raw')} + /> + ); + + expect( + wrapper.find(`[data-test-subj="operatorAutocompleteComboBox"] input`).prop('disabled') + ).toBeTruthy(); + }); + + test('it renders loading if "isLoading" is true', () => { + const wrapper = mount( + <OperatorComponent + isClearable={false} + isDisabled={false} + isLoading={true} + onChange={jest.fn()} + operator={isOperator} + placeholder="Placeholder text" + selectedField={getField('machine.os.raw')} + /> + ); + wrapper.find(`[data-test-subj="operatorAutocompleteComboBox"] button`).at(0).simulate('click'); + expect( + wrapper + .find(`EuiComboBoxOptionsList[data-test-subj="operatorAutocompleteComboBox-optionsList"]`) + .prop('isLoading') + ).toBeTruthy(); + }); + + test('it allows user to clear values if "isClearable" is true', () => { + const wrapper = mount( + <OperatorComponent + isClearable={true} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + operator={isOperator} + placeholder="Placeholder text" + selectedField={getField('machine.os.raw')} + /> + ); + + expect(wrapper.find(`button[data-test-subj="comboBoxClearButton"]`).exists()).toBeTruthy(); + }); + + test('it displays "operatorOptions" if param is passed in with items', () => { + const wrapper = mount( + <OperatorComponent + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + operator={isOperator} + operatorOptions={[isNotOperator]} + placeholder="Placeholder text" + selectedField={getField('machine.os.raw')} + /> + ); + + expect( + wrapper.find(`[data-test-subj="operatorAutocompleteComboBox"]`).at(0).prop('options') + ).toEqual([{ label: 'is not' }]); + }); + + test('it does not display "operatorOptions" if param is passed in with no items', () => { + const wrapper = mount( + <OperatorComponent + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + operator={isOperator} + operatorOptions={[]} + placeholder="Placeholder text" + selectedField={getField('machine.os.raw')} + /> + ); + + expect( + wrapper.find(`[data-test-subj="operatorAutocompleteComboBox"]`).at(0).prop('options') + ).toEqual([ + { + label: 'is', + }, + { + label: 'is not', + }, + { + label: 'is one of', + }, + { + label: 'is not one of', + }, + { + label: 'exists', + }, + { + label: 'does not exist', + }, + { + label: 'is in list', + }, + { + label: 'is not in list', + }, + { + label: 'matches', + }, + { + label: 'does not match', + }, + ]); + }); + + test('it correctly displays selected operator', () => { + const wrapper = mount( + <OperatorComponent + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + operator={isOperator} + placeholder="Placeholder text" + selectedField={getField('machine.os.raw')} + /> + ); + + expect( + wrapper.find('[data-test-subj="operatorAutocompleteComboBox"] input').at(0).props().value + ).toEqual('is'); + }); + + test('it only displays subset of operators if field type is nested', () => { + const wrapper = mount( + <OperatorComponent + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + operator={isOperator} + placeholder="Placeholder text" + selectedField={{ + name: 'nestedField', + scripted: false, + subType: { nested: { path: 'nestedField' } }, + type: 'nested', + }} + /> + ); + + expect( + wrapper.find(`[data-test-subj="operatorAutocompleteComboBox"]`).at(0).prop('options') + ).toEqual([{ label: 'is' }]); + }); + + test('it only displays subset of operators if field type is boolean', () => { + const wrapper = mount( + <OperatorComponent + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + operator={isOperator} + placeholder="Placeholder text" + selectedField={getField('ssl')} + /> + ); + + expect( + wrapper.find(`[data-test-subj="operatorAutocompleteComboBox"]`).at(0).prop('options') + ).toEqual([ + { label: 'is' }, + { label: 'is not' }, + { label: 'exists' }, + { label: 'does not exist' }, + ]); + }); + + test('it only displays subset of operators if field name is "file.path.text"', () => { + const wrapper = mount( + <OperatorComponent + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={jest.fn()} + operator={isOperator} + placeholder="Placeholder text" + selectedField={getField('file.path.text')} + /> + ); + + expect( + wrapper.find(`[data-test-subj="operatorAutocompleteComboBox"]`).at(0).prop('options') + ).toEqual([ + { label: 'is' }, + { label: 'is not' }, + { label: 'is one of' }, + { label: 'is not one of' }, + { label: 'matches' }, + { label: 'does not match' }, + ]); + }); + + test('it invokes "onChange" when option selected', () => { + const mockOnChange = jest.fn(); + const wrapper = mount( + <OperatorComponent + isClearable={false} + isDisabled={false} + isLoading={false} + onChange={mockOnChange} + operator={isOperator} + placeholder="Placeholder text" + selectedField={getField('machine.os.raw')} + /> + ); + + ( + wrapper.find(EuiComboBox).props() as unknown as { + onChange: (a: EuiComboBoxOptionOption[]) => void; + } + ).onChange([{ label: 'is not' }]); + + expect(mockOnChange).toHaveBeenCalledWith([ + { message: 'is not', operator: 'excluded', type: 'match', value: 'is_not' }, + ]); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/operator/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/operator/index.tsx new file mode 100644 index 0000000000000..6c91f7e70b94b --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/operator/index.tsx @@ -0,0 +1,99 @@ +/* + * 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, useMemo } from 'react'; +import { EuiComboBox, EuiComboBoxOptionOption } from '@elastic/eui'; +import { OperatorOption } from '@kbn/securitysolution-list-utils'; +import { DataViewFieldBase } from '@kbn/es-query'; + +import { getOperators } from '../get_operators'; +import { + getGenericComboBoxProps, + GetGenericComboBoxPropsReturn, +} from '../get_generic_combo_box_props'; + +const AS_PLAIN_TEXT = { asPlainText: true }; + +interface OperatorState { + isClearable: boolean; + isDisabled: boolean; + isLoading: boolean; + onChange: (arg: OperatorOption[]) => void; + operator: OperatorOption; + operatorInputWidth?: number; + operatorOptions?: OperatorOption[]; + placeholder: string; + selectedField: DataViewFieldBase | undefined; + 'aria-label'?: string; +} + +export const OperatorComponent: React.FC<OperatorState> = ({ + isClearable = false, + isDisabled = false, + isLoading = false, + onChange, + operator, + operatorOptions, + operatorInputWidth = 150, + placeholder, + selectedField, + 'aria-label': ariaLabel, +}): JSX.Element => { + const getLabel = useCallback(({ message }: OperatorOption): string => message, []); + const optionsMemo = useMemo( + (): OperatorOption[] => + operatorOptions != null && operatorOptions.length > 0 + ? operatorOptions + : getOperators(selectedField), + [operatorOptions, selectedField] + ); + const selectedOptionsMemo = useMemo( + (): OperatorOption[] => (operator ? [operator] : []), + [operator] + ); + const { comboOptions, labels, selectedComboOptions } = useMemo( + (): GetGenericComboBoxPropsReturn => + getGenericComboBoxProps<OperatorOption>({ + getLabel, + options: optionsMemo, + selectedOptions: selectedOptionsMemo, + }), + [optionsMemo, selectedOptionsMemo, getLabel] + ); + + const handleValuesChange = useCallback( + (newOptions: EuiComboBoxOptionOption[]): void => { + const newValues: OperatorOption[] = newOptions.map( + ({ label }) => optionsMemo[labels.indexOf(label)] + ); + onChange(newValues); + }, + [labels, onChange, optionsMemo] + ); + + const inputWidth = useMemo(() => { + return { width: `${operatorInputWidth}px` }; + }, [operatorInputWidth]); + + return ( + <EuiComboBox + placeholder={placeholder} + options={comboOptions} + selectedOptions={selectedComboOptions} + onChange={handleValuesChange} + isLoading={isLoading} + isDisabled={isDisabled} + isClearable={isClearable} + singleSelection={AS_PLAIN_TEXT} + data-test-subj="operatorAutocompleteComboBox" + style={inputWidth} + aria-label={ariaLabel} + /> + ); +}; + +OperatorComponent.displayName = 'Operator'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/param_contains_space/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/param_contains_space/index.test.ts new file mode 100644 index 0000000000000..d0571d157ec2b --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/param_contains_space/index.test.ts @@ -0,0 +1,29 @@ +/* + * 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 { paramContainsSpace } from '.'; + +describe('param_contains_space', () => { + test('should return true if leading spaces were found', () => { + expect(paramContainsSpace(' test')).toBeTruthy(); + }); + test('should return true if trailing spaces were found', () => { + expect(paramContainsSpace('test ')).toBeTruthy(); + }); + test('should return true if both trailing and leading spaces were found', () => { + expect(paramContainsSpace(' test ')).toBeTruthy(); + }); + test('should return true if tabs was found', () => { + expect(paramContainsSpace('\ttest')).toBeTruthy(); + }); + test('should return false if no spaces were found', () => { + expect(paramContainsSpace('test test')).toBeFalsy(); + }); + test('should return false if param is falsy', () => { + expect(paramContainsSpace('')).toBeFalsy(); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/param_contains_space/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/param_contains_space/index.ts new file mode 100644 index 0000000000000..3d7bb99ae3d05 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/param_contains_space/index.ts @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export const paramContainsSpace = (param: string) => param && param.trim().length !== param.length; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/param_is_valid/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/param_is_valid/index.test.ts new file mode 100644 index 0000000000000..f93ad28eb4ad2 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/param_is_valid/index.test.ts @@ -0,0 +1,105 @@ +/* + * 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 { paramIsValid } from '.'; +import { getField } from '../fields/index.mock'; +import * as i18n from '../translations'; +import moment from 'moment'; + +describe('params_is_valid', () => { + beforeEach(() => { + // Disable momentJS deprecation warning and it looks like it is not typed either so + // we have to disable the type as well and cannot extend it easily. + ( + moment as unknown as { + suppressDeprecationWarnings: boolean; + } + ).suppressDeprecationWarnings = true; + }); + + afterEach(() => { + // Re-enable momentJS deprecation warning and it looks like it is not typed either so + // we have to disable the type as well and cannot extend it easily. + ( + moment as unknown as { + suppressDeprecationWarnings: boolean; + } + ).suppressDeprecationWarnings = false; + }); + + test('returns no errors if no field has been selected', () => { + const isValid = paramIsValid('', undefined, true, false); + + expect(isValid).toBeUndefined(); + }); + + test('returns error string if user has touched a required input and left empty', () => { + const isValid = paramIsValid(undefined, getField('@timestamp'), true, true); + + expect(isValid).toEqual(i18n.FIELD_REQUIRED_ERR); + }); + + test('returns no errors if required input is empty but user has not yet touched it', () => { + const isValid = paramIsValid(undefined, getField('@timestamp'), true, false); + + expect(isValid).toBeUndefined(); + }); + + test('returns no errors if user has touched an input that is not required and left empty', () => { + const isValid = paramIsValid(undefined, getField('@timestamp'), false, true); + + expect(isValid).toBeUndefined(); + }); + + test('returns no errors if user has touched an input that is not required and left empty string', () => { + const isValid = paramIsValid('', getField('@timestamp'), false, true); + + expect(isValid).toBeUndefined(); + }); + + test('returns no errors if field is of type date and value is valid', () => { + const isValid = paramIsValid('1994-11-05T08:15:30-05:00', getField('@timestamp'), false, true); + + expect(isValid).toBeUndefined(); + }); + + test('returns errors if filed is of type date and value is not valid', () => { + const isValid = paramIsValid('1593478826', getField('@timestamp'), false, true); + + expect(isValid).toEqual(i18n.DATE_ERR); + }); + + test('returns no errors if field is of type number and value is an integer', () => { + const isValid = paramIsValid('4', getField('bytes'), true, true); + + expect(isValid).toBeUndefined(); + }); + + test('returns no errors if field is of type number and value is a float', () => { + const isValid = paramIsValid('4.3', getField('bytes'), true, true); + + expect(isValid).toBeUndefined(); + }); + + test('returns no errors if field is of type number and value is a long', () => { + const isValid = paramIsValid('-9223372036854775808', getField('bytes'), true, true); + + expect(isValid).toBeUndefined(); + }); + + test('returns errors if field is of type number and value is "hello"', () => { + const isValid = paramIsValid('hello', getField('bytes'), true, true); + + expect(isValid).toEqual(i18n.NUMBER_ERR); + }); + + test('returns errors if field is of type number and value is "123abc"', () => { + const isValid = paramIsValid('123abc', getField('bytes'), true, true); + + expect(isValid).toEqual(i18n.NUMBER_ERR); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/param_is_valid/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/param_is_valid/index.ts new file mode 100644 index 0000000000000..3d091b7a9b21f --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/param_is_valid/index.ts @@ -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 dateMath from '@kbn/datemath'; +import { DataViewFieldBase } from '@kbn/es-query'; +import { checkEmptyValue } from '../check_empty_value'; + +import * as i18n from '../translations'; + +/** + * Very basic validation for values + * @param param the value being checked + * @param field the selected field + * @param isRequired whether or not an empty value is allowed + * @param touched has field been touched by user + * @returns undefined if valid, string with error message if invalid + */ +export const paramIsValid = ( + param: string | undefined, + field: DataViewFieldBase | undefined, + isRequired: boolean, + touched: boolean +): string | undefined => { + if (field == null) { + return undefined; + } + + const emptyValueError = checkEmptyValue(param, field, isRequired, touched); + if (emptyValueError !== null) { + return emptyValueError; + } + + switch (field.type) { + case 'date': + const moment = dateMath.parse(param ?? ''); + const isDate = Boolean(moment && moment.isValid()); + return isDate ? undefined : i18n.DATE_ERR; + case 'number': + const isNum = param != null && param.trim() !== '' && !isNaN(+param); + return isNum ? undefined : i18n.NUMBER_ERR; + default: + return undefined; + } +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/translations/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/translations/index.ts new file mode 100644 index 0000000000000..51790e96ba682 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/translations/index.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 { i18n } from '@kbn/i18n'; + +export const LOADING = i18n.translate('autocomplete.loadingDescription', { + defaultMessage: 'Loading...', +}); + +export const SELECT_FIELD_FIRST = i18n.translate('autocomplete.selectField', { + defaultMessage: 'Please select a field first...', +}); + +export const FIELD_REQUIRED_ERR = i18n.translate('autocomplete.fieldRequiredError', { + defaultMessage: 'Value cannot be empty', +}); + +export const NUMBER_ERR = i18n.translate('autocomplete.invalidNumberError', { + defaultMessage: 'Not a valid number', +}); + +export const DATE_ERR = i18n.translate('autocomplete.invalidDateError', { + defaultMessage: 'Not a valid date', +}); + +export const BINARY_TYPE_NOT_SUPPORTED = i18n.translate('autocomplete.invalidBinaryType', { + defaultMessage: 'Binary fields are currently unsupported', +}); +export const FIELD_SPACE_WARNING = i18n.translate('autocomplete.fieldSpaceWarning', { + defaultMessage: "Warning: Spaces at the start or end of this value aren't being displayed.", +}); + +export const LISTS_TOOLTIP_INFO = i18n.translate('autocomplete.listsTooltipWarning', { + defaultMessage: "Lists that aren't able to be processed by this rule type will be disabled.", +}); + +export const SEE_DOCUMENTATION = i18n.translate('autocomplete.seeDocumentation', { + defaultMessage: 'See Documentation', +}); + +export const FIELD_CONFLICT_INDICES_WARNING_TITLE = i18n.translate( + 'autocomplete.conflictIndicesWarning.title', + { + defaultMessage: 'Mapping Conflict', + } +); + +export const FIELD_CONFLICT_INDICES_WARNING_DESCRIPTION = i18n.translate( + 'autocomplete.conflictIndicesWarning.description', + { + defaultMessage: + 'This field is defined as different types across the following indices or is unmapped. This can cause unexpected query results.', + } +); + +export const CONFLICT_MULTIPLE_INDEX_DESCRIPTION = (name: string, count: number): string => + i18n.translate('autocomplete.conflictIndicesWarning.index.description', { + defaultMessage: '{name} ({count} indices)', + values: { count, name }, + }); + +export const SHOW_VALUE_LIST_MODAL = i18n.translate('autocomplete.showValueListModal', { + defaultMessage: 'Show value list', +}); + +// eslint-disable-next-line import/no-default-export +export default { + LOADING, + SELECT_FIELD_FIRST, + FIELD_REQUIRED_ERR, + NUMBER_ERR, + DATE_ERR, + FIELD_SPACE_WARNING, + BINARY_TYPE_NOT_SUPPORTED, +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/type_match/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/type_match/index.test.ts new file mode 100644 index 0000000000000..74c713f63d360 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/type_match/index.test.ts @@ -0,0 +1,58 @@ +/* + * 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 { typeMatch } from '.'; + +describe('type_match', () => { + test('ip -> ip is true', () => { + expect(typeMatch('ip', 'ip')).toEqual(true); + }); + + test('keyword -> keyword is true', () => { + expect(typeMatch('keyword', 'keyword')).toEqual(true); + }); + + test('text -> text is true', () => { + expect(typeMatch('text', 'text')).toEqual(true); + }); + + test('ip_range -> ip is true', () => { + expect(typeMatch('ip_range', 'ip')).toEqual(true); + }); + + test('date_range -> date is true', () => { + expect(typeMatch('date_range', 'date')).toEqual(true); + }); + + test('double_range -> double is true', () => { + expect(typeMatch('double_range', 'double')).toEqual(true); + }); + + test('float_range -> float is true', () => { + expect(typeMatch('float_range', 'float')).toEqual(true); + }); + + test('integer_range -> integer is true', () => { + expect(typeMatch('integer_range', 'integer')).toEqual(true); + }); + + test('long_range -> long is true', () => { + expect(typeMatch('long_range', 'long')).toEqual(true); + }); + + test('ip -> date is false', () => { + expect(typeMatch('ip', 'date')).toEqual(false); + }); + + test('long -> float is false', () => { + expect(typeMatch('long', 'float')).toEqual(false); + }); + + test('integer -> long is false', () => { + expect(typeMatch('integer', 'long')).toEqual(false); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/type_match/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/type_match/index.ts new file mode 100644 index 0000000000000..0e368127b596c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/type_match/index.ts @@ -0,0 +1,26 @@ +/* + * 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 { Type } from '@kbn/securitysolution-io-ts-list-types'; + +/** + * Given an input list type and a string based ES type this will match + * if they're exact or if they are compatible with a range + * @param type The type to match against the esType + * @param esType The ES type to match with + */ +export const typeMatch = (type: Type, esType: string): boolean => { + return ( + type === esType || + (type === 'ip_range' && esType === 'ip') || + (type === 'date_range' && esType === 'date') || + (type === 'double_range' && esType === 'double') || + (type === 'float_range' && esType === 'float') || + (type === 'integer_range' && esType === 'integer') || + (type === 'long_range' && esType === 'long') + ); +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/tsconfig.json b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/tsconfig.json new file mode 100644 index 0000000000000..e4f0b64736b07 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/tsconfig.json @@ -0,0 +1,24 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": ["jest", "node"] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "kbn_references": [ + "@kbn/datemath", + "@kbn/es-query", + "@kbn/i18n", + "@kbn/securitysolution-io-ts-list-types", + "@kbn/securitysolution-list-hooks", + "@kbn/securitysolution-list-utils", + "@kbn/doc-links", + "@kbn/securitysolution-utils", + ], + "exclude": [ + "target/**/*", + ], +} diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/README.md b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/README.md similarity index 100% rename from packages/kbn-securitysolution-endpoint-exceptions-common/README.md rename to x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/README.md diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.gen.ts new file mode 100644 index 0000000000000..c8e4f90c347a4 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.gen.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. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Create endpoint list API endpoint + * version: 2023-10-31 + */ + +import { z } from '@kbn/zod'; + +import { EndpointList } from '../model/endpoint_list_common.gen'; + +export type CreateEndpointListResponse = z.infer<typeof CreateEndpointListResponse>; +export const CreateEndpointListResponse = EndpointList; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.schema.yaml new file mode 100644 index 0000000000000..cdc9004ce7e60 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list/create_endpoint_list.schema.yaml @@ -0,0 +1,45 @@ +openapi: 3.0.0 +info: + title: Create endpoint list API endpoint + version: '2023-10-31' +paths: + /api/endpoint_list: + post: + x-labels: [serverless, ess] + x-codegen-enabled: true + operationId: CreateEndpointList + summary: Create an endpoint exception list + description: Create an endpoint exception list, which groups endpoint exception list items. If an endpoint exception list already exists, an empty response is returned. + responses: + 200: + description: Successful response + content: + application/json: + schema: + $ref: '../model/endpoint_list_common.schema.yaml#/components/schemas/EndpointList' + 400: + description: Invalid input data + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Insufficient privileges + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 500: + description: Internal server error + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.gen.ts similarity index 81% rename from packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.gen.ts index ed3a60dc08f30..c4ce0697b2372 100644 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.schema.yaml similarity index 77% rename from packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.schema.yaml index b90bee75fc073..6948df21afbbc 100644 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/create_endpoint_list_item/create_endpoint_list_item.schema.yaml @@ -57,29 +57,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Insufficient privileges content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 409: description: Endpoint list item already exists content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.gen.ts similarity index 75% rename from packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.gen.ts index 5cb5f518494ec..4f268641f93cd 100644 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.schema.yaml new file mode 100644 index 0000000000000..ae1010573e5ef --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/delete_endpoint_list_item/delete_endpoint_list_item.schema.yaml @@ -0,0 +1,64 @@ +openapi: 3.0.0 +info: + title: Delete endpoint list item API endpoint + version: '2023-10-31' +paths: + /api/endpoint_list/items: + delete: + x-labels: [serverless, ess] + x-codegen-enabled: true + operationId: DeleteEndpointListItem + summary: Delete an endpoint exception list item + description: Delete an endpoint exception list item using the `id` or `item_id` field. + parameters: + - name: id + in: query + required: false + description: Either `id` or `item_id` must be specified + schema: + $ref: '../../../kbn-securitysolution-exceptions-common/api/model/exception_list_common.schema.yaml#/components/schemas/ExceptionListItemId' + - name: item_id + in: query + required: false + description: Either `id` or `item_id` must be specified + schema: + $ref: '../../../kbn-securitysolution-exceptions-common/api/model/exception_list_common.schema.yaml#/components/schemas/ExceptionListItemHumanId' + responses: + 200: + description: Successful response + content: + application/json: + schema: + $ref: '../model/endpoint_list_common.schema.yaml#/components/schemas/EndpointListItem' + 400: + description: Invalid input data + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Insufficient privileges + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 404: + description: Endpoint list item not found + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.gen.ts similarity index 83% rename from packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.gen.ts index a830572c7b503..5b1e10d9bb04b 100644 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.schema.yaml new file mode 100644 index 0000000000000..400851ac52543 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/find_endpoint_list_item/find_endpoint_list_item.schema.yaml @@ -0,0 +1,113 @@ +openapi: 3.0.0 +info: + title: Find endpoint list items API endpoint + version: '2023-10-31' +paths: + /api/endpoint_list/items/_find: + get: + x-labels: [serverless, ess] + x-codegen-enabled: true + operationId: FindEndpointListItems + summary: Get endpoint exception list items + description: Get a list of all endpoint exception list items. + parameters: + - name: filter + in: query + required: false + description: | + Filters the returned results according to the value of the specified field, + using the `<field name>:<field value>` syntax. + schema: + $ref: '#/components/schemas/FindEndpointListItemsFilter' + - name: page + in: query + required: false + description: The page number to return + schema: + type: integer + minimum: 0 + - name: per_page + in: query + required: false + description: The number of exception list items to return per page + schema: + type: integer + minimum: 0 + - name: sort_field + in: query + required: false + description: Determines which field is used to sort the results + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + - name: sort_order + in: query + required: false + description: Determines the sort order, which can be `desc` or `asc` + schema: + type: string + enum: [desc, asc] + responses: + 200: + description: Successful response + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '../model/endpoint_list_common.schema.yaml#/components/schemas/EndpointListItem' + page: + type: integer + minimum: 0 + per_page: + type: integer + minimum: 0 + total: + type: integer + minimum: 0 + pit: + type: string + required: + - data + - page + - per_page + - total + 400: + description: Invalid input data + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Insufficient privileges + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 404: + description: Endpoint list not found + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + +components: + schemas: + FindEndpointListItemsFilter: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/index.ts new file mode 100644 index 0000000000000..912af19448e44 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/index.ts @@ -0,0 +1,13 @@ +/* + * 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. + */ + +export * from './create_endpoint_list/create_endpoint_list.gen'; +export * from './create_endpoint_list_item/create_endpoint_list_item.gen'; +export * from './read_endpoint_list_item/read_endpoint_list_item.gen'; +export * from './update_endpoint_list_item/update_endpoint_list_item.gen'; +export * from './delete_endpoint_list_item/delete_endpoint_list_item.gen'; +export * from './find_endpoint_list_item/find_endpoint_list_item.gen'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/model/endpoint_list_common.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/model/endpoint_list_common.gen.ts new file mode 100644 index 0000000000000..a68abd53c11c4 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/model/endpoint_list_common.gen.ts @@ -0,0 +1,28 @@ +/* + * 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. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Common Exception List Attributes + * version: not applicable + */ + +import { z } from '@kbn/zod'; + +import { + ExceptionList, + ExceptionListItem, +} from '@kbn/securitysolution-exceptions-common/api/model/exception_list_common.gen'; + +export type EndpointList = z.infer<typeof EndpointList>; +export const EndpointList = z.union([ExceptionList, z.object({}).strict()]); + +export type EndpointListItem = z.infer<typeof EndpointListItem>; +export const EndpointListItem = ExceptionListItem; diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/model/endpoint_list_common.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/model/endpoint_list_common.schema.yaml similarity index 100% rename from packages/kbn-securitysolution-endpoint-exceptions-common/api/model/endpoint_list_common.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/model/endpoint_list_common.schema.yaml diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.gen.ts similarity index 75% rename from packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.gen.ts index 4a9c335b395bc..e2dc38450bbbd 100644 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.schema.yaml new file mode 100644 index 0000000000000..0b64bac231df5 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/read_endpoint_list_item/read_endpoint_list_item.schema.yaml @@ -0,0 +1,66 @@ +openapi: 3.0.0 +info: + title: Read endpoint list item API endpoint + version: '2023-10-31' +paths: + /api/endpoint_list/items: + get: + x-labels: [serverless, ess] + x-codegen-enabled: true + operationId: ReadEndpointListItem + summary: Get an endpoint exception list item + description: Get the details of an endpoint exception list item using the `id` or `item_id` field. + parameters: + - name: id + in: query + required: false + description: Either `id` or `item_id` must be specified + schema: + $ref: '../../../kbn-securitysolution-exceptions-common/api/model/exception_list_common.schema.yaml#/components/schemas/ExceptionListItemId' + - name: item_id + in: query + required: false + description: Either `id` or `item_id` must be specified + schema: + $ref: '../../../kbn-securitysolution-exceptions-common/api/model/exception_list_common.schema.yaml#/components/schemas/ExceptionListItemHumanId' + responses: + 200: + description: Successful response + content: + application/json: + schema: + type: array + items: + $ref: '../model/endpoint_list_common.schema.yaml#/components/schemas/EndpointListItem' + 400: + description: Invalid input data + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Insufficient privileges + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 404: + description: Endpoint list item not found + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.gen.ts similarity index 83% rename from packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.gen.ts index 0a235ca2ff896..ec86992d58b7b 100644 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.schema.yaml similarity index 78% rename from packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.schema.yaml index 679000674c7b2..1fbe40d2b94ee 100644 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/api/update_endpoint_list_item/update_endpoint_list_item.schema.yaml @@ -62,29 +62,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Insufficient privileges content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: Endpoint list item not found content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/ess/security_solution_endpoint_exceptions_api_2023_10_31.bundled.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/ess/security_solution_endpoint_exceptions_api_2023_10_31.bundled.schema.yaml similarity index 100% rename from packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/ess/security_solution_endpoint_exceptions_api_2023_10_31.bundled.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/ess/security_solution_endpoint_exceptions_api_2023_10_31.bundled.schema.yaml diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/serverless/security_solution_endpoint_exceptions_api_2023_10_31.bundled.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/serverless/security_solution_endpoint_exceptions_api_2023_10_31.bundled.schema.yaml similarity index 100% rename from packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/serverless/security_solution_endpoint_exceptions_api_2023_10_31.bundled.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/serverless/security_solution_endpoint_exceptions_api_2023_10_31.bundled.schema.yaml diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/kibana.jsonc b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/kibana.jsonc similarity index 100% rename from packages/kbn-securitysolution-endpoint-exceptions-common/kibana.jsonc rename to x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/kibana.jsonc diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/package.json b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/package.json new file mode 100644 index 0000000000000..39e6232e4e0f5 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/package.json @@ -0,0 +1,11 @@ +{ + "description": "OpenAPI Endpoint Exceptions Common", + "license": "Elastic License 2.0", + "name": "@kbn/securitysolution-endpoint-exceptions-common", + "private": true, + "version": "1.0.0", + "scripts": { + "openapi:generate": "node scripts/openapi_generate", + "openapi:bundle": "node scripts/openapi_bundle" + } +} diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/scripts/openapi_bundle.js b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/scripts/openapi_bundle.js new file mode 100644 index 0000000000000..c54e162b6462e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/scripts/openapi_bundle.js @@ -0,0 +1,65 @@ +/* + * 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. + */ + +require('../../../../../../src/setup_node_env'); +// eslint-disable-next-line import/no-nodejs-modules +const { join, resolve } = require('path'); +const { bundle } = require('@kbn/openapi-bundler'); + +const ROOT = resolve(__dirname, '..'); + +(async () => { + await bundle({ + sourceGlob: join(ROOT, 'api/**/*.schema.yaml'), + outputFilePath: join( + ROOT, + 'docs/openapi/serverless/security_solution_endpoint_exceptions_api_{version}.bundled.schema.yaml' + ), + options: { + includeLabels: ['serverless'], + prototypeDocument: { + info: { + title: 'Security Endpoint Exceptions API (Elastic Cloud Serverless)', + description: 'Endpoint Exceptions API allow you to manage Endpoint lists.', + }, + tags: [ + { + name: 'Security Endpoint Exceptions API', + 'x-displayName': 'Security endpoint exceptions', + description: + "Endpoint Exceptions API allows you to manage detection rule endpoint exceptions to prevent a rule from generating an alert from incoming events even when the rule's other criteria are met.", + }, + ], + }, + }, + }); + + await bundle({ + sourceGlob: join(ROOT, 'api/**/*.schema.yaml'), + outputFilePath: join( + ROOT, + 'docs/openapi/ess/security_solution_endpoint_exceptions_api_{version}.bundled.schema.yaml' + ), + options: { + includeLabels: ['ess'], + prototypeDocument: { + info: { + title: 'Security Endpoint Exceptions API (Elastic Cloud and self-hosted)', + description: 'Endpoint Exceptions API allow you to manage Endpoint lists.', + }, + tags: [ + { + name: 'Security Endpoint Exceptions API', + 'x-displayName': 'Security endpoint exceptions', + description: + "Endpoint Exceptions API allows you to manage detection rule endpoint exceptions to prevent a rule from generating an alert from incoming events even when the rule's other criteria are met.", + }, + ], + }, + }, + }); +})(); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/scripts/openapi_generate.js b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/scripts/openapi_generate.js new file mode 100644 index 0000000000000..9a303c4f74bef --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/scripts/openapi_generate.js @@ -0,0 +1,37 @@ +/* + * 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. + */ + +require('../../../../../../src/setup_node_env'); +// eslint-disable-next-line import/no-nodejs-modules +const { join, resolve } = require('path'); +const { generate } = require('@kbn/openapi-generator'); +const { REPO_ROOT } = require('@kbn/repo-info'); + +const ROOT = resolve(__dirname, '..'); + +(async () => { + await generate({ + title: 'OpenAPI Endpoint Exceptions API Schemas', + rootDir: ROOT, + sourceGlob: './api/**/*.schema.yaml', + templateName: 'zod_operation_schema', + }); + + await generate({ + title: 'Endpoint Exceptions API client for tests', + rootDir: ROOT, + sourceGlob: './api/**/*.schema.yaml', + templateName: 'api_client_supertest', + skipLinting: true, + bundle: { + outFile: join( + REPO_ROOT, + 'x-pack/test/api_integration/services/security_solution_endpoint_exceptions_api.gen.ts' + ), + }, + }); +})(); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/tsconfig.json b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/tsconfig.json new file mode 100644 index 0000000000000..38f2843b03ad7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "outDir": "target/types", + "types": ["jest", "node"] + }, + "exclude": ["target/**/*"], + "extends": "../../../../../tsconfig.base.json", + "include": ["**/*.ts"], + "kbn_references": [ + "@kbn/securitysolution-exceptions-common", + "@kbn/openapi-common", + "@kbn/zod", + ] +} diff --git a/packages/kbn-securitysolution-exception-list-components/README.md b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/README.md similarity index 100% rename from packages/kbn-securitysolution-exception-list-components/README.md rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/README.md diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/index.ts new file mode 100644 index 0000000000000..40277892f1f79 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/index.ts @@ -0,0 +1,20 @@ +/* + * 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. + */ + +export * from './src/search_bar'; +export * from './src/empty_viewer_state'; +export * from './src/pagination/pagination'; +// export * from './src/exceptions_utility/exceptions_utility'; +export * from './src/exception_items'; +export * from './src/exception_item_card'; +export * from './src/value_with_space_warning'; +export * from './src/types'; +export * from './src/list_header'; +export * from './src/header_menu'; +export * from './src/generate_linked_rules_menu_item'; +export * from './src/wildcard_with_wrong_operator_callout'; +export * from './src/partial_code_signature_callout'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/jest.config.js b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/jest.config.js new file mode 100644 index 0000000000000..d9a562b21e875 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/jest.config.js @@ -0,0 +1,29 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: [ + '<rootDir>/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components', + ], + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/**/*.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/**/*.test', + '!<rootDir>/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/**/types/*', + '!<rootDir>/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/**/*.type', + '!<rootDir>/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/**/*.styles', + '!<rootDir>/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/**/mocks/*', + '!<rootDir>/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/**/*.config', + '!<rootDir>/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/**/translations', + '!<rootDir>/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/**/types/*', + ], + setupFilesAfterEnv: [ + '<rootDir>/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/setup_test.ts', + ], +}; diff --git a/packages/kbn-securitysolution-exception-list-components/kibana.jsonc b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/kibana.jsonc similarity index 100% rename from packages/kbn-securitysolution-exception-list-components/kibana.jsonc rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/kibana.jsonc diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/package.json b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/package.json new file mode 100644 index 0000000000000..f9246cb9353d0 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/securitysolution-exception-list-components", + "private": true, + "version": "1.0.0", + "license": "Elastic License 2.0", + "sideEffects": false +} \ No newline at end of file diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/setup_test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/setup_test.ts new file mode 100644 index 0000000000000..72e0edd0d07f7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/setup_test.ts @@ -0,0 +1,9 @@ +/* + * 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. + */ + +// eslint-disable-next-line import/no-extraneous-dependencies +import '@testing-library/jest-dom'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/assets/images/illustration_product_no_results_magnifying_glass.svg b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/assets/images/illustration_product_no_results_magnifying_glass.svg similarity index 100% rename from packages/kbn-securitysolution-exception-list-components/src/assets/images/illustration_product_no_results_magnifying_glass.svg rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/assets/images/illustration_product_no_results_magnifying_glass.svg diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/custom.d.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/custom.d.ts new file mode 100644 index 0000000000000..18dda6a910031 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/custom.d.ts @@ -0,0 +1,12 @@ +/* + * 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. + */ + +declare module '*.svg' { + const content: string; + // eslint-disable-next-line import/no-default-export + export default content; +} diff --git a/packages/kbn-securitysolution-exception-list-components/src/empty_viewer_state/empty_viewer_state.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/empty_viewer_state/empty_viewer_state.test.tsx similarity index 93% rename from packages/kbn-securitysolution-exception-list-components/src/empty_viewer_state/empty_viewer_state.test.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/empty_viewer_state/empty_viewer_state.test.tsx index 1b711185c526c..7df3f732711a0 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/empty_viewer_state/empty_viewer_state.test.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/empty_viewer_state/empty_viewer_state.test.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/empty_viewer_state/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/empty_viewer_state/index.tsx new file mode 100644 index 0000000000000..2e489cb5dca97 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/empty_viewer_state/index.tsx @@ -0,0 +1,133 @@ +/* + * 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, { useMemo } from 'react'; +import type { FC } from 'react'; +import { css } from '@emotion/react'; +import { + EuiSkeletonText, + EuiImage, + EuiEmptyPrompt, + EuiButton, + useEuiTheme, + EuiPanel, +} from '@elastic/eui'; +import type { ExpressionColor } from '@elastic/eui/src/components/expression/expression'; +import type { EuiFacetGroupLayout } from '@elastic/eui/src/components/facet/facet_group'; +import { euiThemeVars } from '@kbn/ui-theme'; +import { ListTypeText, ViewerStatus } from '../types'; +import * as i18n from '../translations'; +import illustration from '../assets/images/illustration_product_no_results_magnifying_glass.svg'; + +interface EmptyViewerStateProps { + title?: string; + body?: string; + buttonText?: string; + listType?: ListTypeText; + isReadOnly: boolean; + viewerStatus: ViewerStatus; + onEmptyButtonStateClick?: () => void | null; +} + +const panelCss = css` + margin: ${euiThemeVars.euiSizeL} 0; + padding: ${euiThemeVars.euiSizeL} 0; +`; +const EmptyViewerStateComponent: FC<EmptyViewerStateProps> = ({ + title, + body, + buttonText, + listType, + isReadOnly, + viewerStatus, + onEmptyButtonStateClick, +}) => { + const { euiTheme } = useEuiTheme(); + + const euiEmptyPromptProps = useMemo(() => { + switch (viewerStatus) { + case ViewerStatus.ERROR: { + return { + color: 'danger' as ExpressionColor, + iconType: 'error', + title: ( + <h2 data-test-subj="errorTitle">{title || i18n.EMPTY_VIEWER_STATE_ERROR_TITLE}</h2> + ), + body: <p data-test-subj="errorBody">{body || i18n.EMPTY_VIEWER_STATE_ERROR_BODY}</p>, + 'data-test-subj': 'errorViewerState', + }; + } + case ViewerStatus.EMPTY: + return { + color: 'subdued' as ExpressionColor, + iconType: 'plusInCircle', + iconColor: euiTheme.colors.darkestShade, + title: ( + <h2 data-test-subj="emptyTitle">{title || i18n.EMPTY_VIEWER_STATE_EMPTY_TITLE}</h2> + ), + body: <p data-test-subj="emptyBody">{body || i18n.EMPTY_VIEWER_STATE_EMPTY_BODY}</p>, + 'data-test-subj': 'emptyViewerState', + actions: [ + <EuiButton + data-test-subj="emptyStateButton" + onClick={onEmptyButtonStateClick} + iconType="plusInCircle" + color="primary" + isDisabled={isReadOnly} + fill + > + {buttonText || i18n.EMPTY_VIEWER_STATE_EMPTY_VIEWER_BUTTON(listType || 'rule')} + </EuiButton>, + ], + }; + case ViewerStatus.EMPTY_SEARCH: + return { + color: 'plain' as ExpressionColor, + layout: 'horizontal' as EuiFacetGroupLayout, + hasBorder: true, + hasShadow: false, + icon: <EuiImage size="fullWidth" alt="" src={illustration} />, + title: ( + <h3 data-test-subj="emptySearchTitle"> + {title || i18n.EMPTY_VIEWER_STATE_EMPTY_SEARCH_TITLE} + </h3> + ), + body: ( + <p data-test-subj="emptySearchBody"> + {body || i18n.EMPTY_VIEWER_STATE_EMPTY_SEARCH_BODY} + </p> + ), + 'data-test-subj': 'emptySearchViewerState', + }; + } + }, [ + viewerStatus, + euiTheme.colors.darkestShade, + title, + body, + onEmptyButtonStateClick, + isReadOnly, + buttonText, + listType, + ]); + + return ( + <EuiSkeletonText + lines={4} + data-test-subj="loadingViewerState" + isLoading={viewerStatus === ViewerStatus.LOADING || viewerStatus === ViewerStatus.SEARCHING} + > + <EuiPanel css={panelCss} color={viewerStatus === 'empty_search' ? 'subdued' : 'transparent'}> + <EuiEmptyPrompt {...euiEmptyPromptProps} /> + </EuiPanel> + </EuiSkeletonText> + ); +}; + +export const EmptyViewerState = React.memo(EmptyViewerStateComponent); + +EmptyViewerState.displayName = 'EmptyViewerState'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/__snapshots__/comments.test.tsx.snap b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/__snapshots__/comments.test.tsx.snap similarity index 100% rename from packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/__snapshots__/comments.test.tsx.snap rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/__snapshots__/comments.test.tsx.snap diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/comments.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/comments.test.tsx similarity index 83% rename from packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/comments.test.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/comments.test.tsx index c8c8e92cd6c70..caf989efcc9ec 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/comments.test.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/comments.test.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/index.tsx new file mode 100644 index 0000000000000..76ef48fba0a90 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/comments/index.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 React, { memo } from 'react'; +import type { EuiCommentProps } from '@elastic/eui'; +import { EuiAccordion, EuiCommentList, EuiFlexItem, EuiPanel, EuiText } from '@elastic/eui'; +import { css } from '@emotion/react'; +import { euiThemeVars } from '@kbn/ui-theme'; +import * as i18n from '../translations'; + +const accordionCss = css` + color: ${euiThemeVars.euiColorPrimary}; +`; + +export interface ExceptionItemCardCommentsProps { + comments: EuiCommentProps[]; + dataTestSubj?: string; +} + +export const ExceptionItemCardComments = memo<ExceptionItemCardCommentsProps>( + ({ comments, dataTestSubj }) => { + if (!comments.length) return null; + return ( + <EuiFlexItem data-test-subj={dataTestSubj}> + <EuiAccordion + id="exceptionItemCardComments" + buttonContent={ + <EuiText size="s" css={accordionCss} data-test-subj={`${dataTestSubj || ''}TextButton`}> + {i18n.exceptionItemCardCommentsAccordion(comments.length)} + </EuiText> + } + arrowDisplay="none" + data-test-subj="exceptionItemCardComments" + > + <EuiPanel data-test-subj="accordionContentPanel" hasBorder hasShadow paddingSize="m"> + <EuiCommentList data-test-subj="accordionCommentList" comments={comments} /> + </EuiPanel> + </EuiAccordion> + </EuiFlexItem> + ); + } +); + +ExceptionItemCardComments.displayName = 'ExceptionItemCardComments'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/conditions.config.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/conditions.config.ts similarity index 77% rename from packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/conditions.config.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/conditions.config.ts index fdb545dc2c031..0c826f40f0224 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/conditions.config.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/conditions.config.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { ListOperatorTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/conditions.styles.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/conditions.styles.tsx new file mode 100644 index 0000000000000..043e2e2e44850 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/conditions.styles.tsx @@ -0,0 +1,36 @@ +/* + * 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 { cx } from '@emotion/css'; +import { css } from '@emotion/react'; +import { euiThemeVars } from '@kbn/ui-theme'; + +// TODO check font Roboto Mono +export const nestedGroupSpaceCss = css` + margin-left: ${euiThemeVars.euiSizeXL}; + margin-bottom: ${euiThemeVars.euiSizeXS}; + padding-top: ${euiThemeVars.euiSizeXS}; +`; + +export const borderCss = cx( + 'eui-xScroll', + ` + border: 1px; + border-color: #d3dae6; + border-style: solid; +` +); + +export const valueContainerCss = css` + display: flex; + align-items: center; + margin-left: ${euiThemeVars.euiSizeS}; +`; +export const expressionContainerCss = css` + display: flex; + align-items: center; +`; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/conditions.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/conditions.test.tsx similarity index 96% rename from packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/conditions.test.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/conditions.test.tsx index e19327226de21..6cd3ee06d203a 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/conditions.test.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/conditions.test.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { render } from '@testing-library/react'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/__snapshots__/entry_content.test.tsx.snap b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/__snapshots__/entry_content.test.tsx.snap similarity index 100% rename from packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/__snapshots__/entry_content.test.tsx.snap rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/__snapshots__/entry_content.test.tsx.snap diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.helper.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.helper.test.tsx similarity index 93% rename from packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.helper.test.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.helper.test.tsx index e49d18ec78c49..07de278ace7b3 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.helper.test.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.helper.test.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { ListOperatorTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.helper.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.helper.tsx similarity index 85% rename from packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.helper.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.helper.tsx index 2fa113e5a612a..aeca92d4d0031 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.helper.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.helper.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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, { ElementType } from 'react'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.test.tsx similarity index 83% rename from packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.test.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.test.tsx index 7eb141493ef40..bed784f46b878 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.test.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/entry_content.test.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/index.tsx new file mode 100644 index 0000000000000..7f75694b16d34 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/entry_content/index.tsx @@ -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 React, { ElementType, FC, memo } from 'react'; +import { EuiExpression, EuiToken, EuiFlexGroup } from '@elastic/eui'; +import { ListOperatorTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; +import { + nestedGroupSpaceCss, + valueContainerCss, + expressionContainerCss, +} from '../conditions.styles'; +import type { Entry } from '../types'; +import * as i18n from '../../translations'; +import { getValue, getValueExpression } from './entry_content.helper'; + +interface EntryContentProps { + entry: Entry; + index: number; + isNestedEntry?: boolean; + dataTestSubj?: string; + showValueListModal: ElementType; +} + +export const EntryContent: FC<EntryContentProps> = memo( + ({ entry, index, isNestedEntry = false, dataTestSubj, showValueListModal }) => { + const { field, type } = entry; + const value = getValue(entry); + const operator = 'operator' in entry ? entry.operator : ''; + + const entryKey = `${field}${type}${value}${index}`; + return ( + <div data-test-subj={`${dataTestSubj || ''}${entryKey}EntryContent`} key={entryKey}> + <div css={expressionContainerCss}> + {isNestedEntry ? ( + <EuiFlexGroup + responsive + css={nestedGroupSpaceCss} + direction="row" + alignItems="center" + gutterSize="m" + data-test-subj={`${dataTestSubj || ''}NestedEntry`} + > + <EuiToken data-test-subj="nstedEntryIcon" iconType="tokenNested" size="s" /> + + <div css={valueContainerCss}> + <EuiExpression description="" value={field} color="subdued" /> + {getValueExpression( + type as ListOperatorTypeEnum, + operator, + value, + showValueListModal + )} + </div> + </EuiFlexGroup> + ) : ( + <> + <EuiExpression + description={index === 0 ? '' : i18n.CONDITION_AND} + value={field} + color={index === 0 ? 'primary' : 'subdued'} + data-test-subj={`${dataTestSubj || ''}SingleEntry`} + /> + + {getValueExpression( + type as ListOperatorTypeEnum, + operator, + value, + showValueListModal + )} + </> + )} + </div> + </div> + ); + } +); +EntryContent.displayName = 'EntryContent'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/index.tsx new file mode 100644 index 0000000000000..804af918e4f16 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/index.tsx @@ -0,0 +1,57 @@ +/* + * 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 { EuiPanel } from '@elastic/eui'; + +import { borderCss } from './conditions.styles'; +import { EntryContent } from './entry_content'; +import { OsCondition } from './os_conditions'; +import type { CriteriaConditionsProps, Entry } from './types'; + +export const ExceptionItemCardConditions = memo<CriteriaConditionsProps>( + ({ os, entries, dataTestSubj, showValueListModal }) => { + return ( + <EuiPanel + color="subdued" + hasBorder={true} + hasShadow={false} + data-test-subj={dataTestSubj} + className={borderCss} + > + {os?.length ? <OsCondition os={os} dataTestSubj={dataTestSubj} /> : null} + {entries.map((entry: Entry, index: number) => { + const nestedEntries = 'entries' in entry ? entry.entries : []; + return ( + <div key={`ExceptionItemCardConditionsContainer${index}`}> + <EntryContent + key={`entry${index}`} + entry={entry} + index={index} + dataTestSubj={dataTestSubj} + showValueListModal={showValueListModal} + /> + {nestedEntries?.length + ? nestedEntries.map((nestedEntry: Entry, nestedIndex: number) => ( + <EntryContent + key={`nestedEntry${index}${nestedIndex}`} + entry={nestedEntry} + index={nestedIndex} + isNestedEntry={true} + dataTestSubj={dataTestSubj} + showValueListModal={showValueListModal} + /> + )) + : null} + </div> + ); + })} + </EuiPanel> + ); + } +); +ExceptionItemCardConditions.displayName = 'ExceptionItemCardConditions'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/os_conditions/__snapshots__/os_conditions.test.tsx.snap b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/os_conditions/__snapshots__/os_conditions.test.tsx.snap similarity index 100% rename from packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/os_conditions/__snapshots__/os_conditions.test.tsx.snap rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/os_conditions/__snapshots__/os_conditions.test.tsx.snap diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/os_conditions/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/os_conditions/index.tsx new file mode 100644 index 0000000000000..3a2dded6ce2ba --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/os_conditions/index.tsx @@ -0,0 +1,37 @@ +/* + * 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, useMemo } from 'react'; +import { EuiExpression } from '@elastic/eui'; + +import { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; +import { OS_LABELS } from '../conditions.config'; +import * as i18n from '../../translations'; + +export interface OsConditionsProps { + dataTestSubj?: string; + os: ExceptionListItemSchema['os_types']; +} + +export const OsCondition = memo<OsConditionsProps>(({ os, dataTestSubj }) => { + const osLabel = useMemo(() => { + return os.map((osValue) => OS_LABELS[osValue] ?? osValue).join(', '); + }, [os]); + return osLabel ? ( + <div data-test-subj={`${dataTestSubj || ''}Os`}> + <strong> + <EuiExpression data-test-subj="osLabel" description="" value={i18n.CONDITION_OS} /> + <EuiExpression + data-test-subj="osValue" + description={i18n.CONDITION_OPERATOR_TYPE_MATCH} + value={osLabel} + /> + </strong> + </div> + ) : null; +}); +OsCondition.displayName = 'OsCondition'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/os_conditions/os_conditions.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/os_conditions/os_conditions.test.tsx similarity index 82% rename from packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/os_conditions/os_conditions.test.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/os_conditions/os_conditions.test.tsx index 3aea8d5ed0065..a3575c1845227 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/os_conditions/os_conditions.test.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/os_conditions/os_conditions.test.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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'; @@ -35,6 +33,7 @@ describe('OsCondition', () => { expect(wrapper.container).toMatchSnapshot(); }); it('should return any os sent', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any const wrapper = render(<OsCondition os={['MacPro' as any]} dataTestSubj="OsConditionMac" />); expect(wrapper.getByTestId('osLabel')).toHaveTextContent(i18n.CONDITION_OS); expect(wrapper.getByTestId('osValue')).toHaveTextContent( diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/types.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/types.ts new file mode 100644 index 0000000000000..a69a0f16c1d7b --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/conditions/types.ts @@ -0,0 +1,33 @@ +/* + * 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 { + EntryExists, + EntryList, + EntryMatch, + EntryMatchAny, + EntryMatchWildcard, + EntryNested, + ExceptionListItemSchema, +} from '@kbn/securitysolution-io-ts-list-types'; +import { ElementType } from 'react'; + +export type Entry = + | EntryExists + | EntryList + | EntryMatch + | EntryMatchAny + | EntryMatchWildcard + | EntryNested; + +export type Entries = ExceptionListItemSchema['entries']; +export interface CriteriaConditionsProps { + entries: Entries; + dataTestSubj: string; + os?: ExceptionListItemSchema['os_types']; + showValueListModal: ElementType; +} diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.test.tsx similarity index 94% rename from packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.test.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.test.tsx index aeaf5755ea1da..b3f06eddec715 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.test.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.test.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.tsx similarity index 91% rename from packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.tsx index 44456a130687d..52d2f730b33b9 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/exception_item_card.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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, { FC, ElementType } from 'react'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/header/header.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/header/header.test.tsx similarity index 81% rename from packages/kbn-securitysolution-exception-list-components/src/exception_item_card/header/header.test.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/header/header.test.tsx index 5de4f5d729f0c..9127589b5b560 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/header/header.test.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/header/header.test.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/header/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/header/index.tsx new file mode 100644 index 0000000000000..88eb6233a9350 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/header/index.tsx @@ -0,0 +1,44 @@ +/* + * 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, EuiTitle } from '@elastic/eui'; +import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; +import { HeaderMenu } from '../../header_menu'; + +export interface ExceptionItemCardHeaderProps { + item: ExceptionListItemSchema; + actions: Array<{ key: string; icon: string; label: string | boolean; onClick: () => void }>; + disableActions?: boolean; + dataTestSubj: string; +} + +export const ExceptionItemCardHeader = memo<ExceptionItemCardHeaderProps>( + ({ item, actions, disableActions = false, dataTestSubj }) => { + return ( + <EuiFlexGroup responsive data-test-subj={dataTestSubj} justifyContent="spaceBetween"> + <EuiFlexItem grow={9}> + <EuiTitle size="xs" textTransform="uppercase" data-test-subj={`${dataTestSubj}Title`}> + <h3>{item.name}</h3> + </EuiTitle> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <HeaderMenu + iconType="boxesHorizontal" + disableActions={disableActions} + actions={actions} + aria-label="Exception item actions menu" + dataTestSubj={dataTestSubj} + anchorPosition="downCenter" + /> + </EuiFlexItem> + </EuiFlexGroup> + ); + } +); + +ExceptionItemCardHeader.displayName = 'ExceptionItemCardHeader'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/index.ts new file mode 100644 index 0000000000000..2d2b38d288da9 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/index.ts @@ -0,0 +1,12 @@ +/* + * 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. + */ + +export * from './conditions'; +export * from './header'; +export * from './meta'; +export * from './comments'; +export * from './exception_item_card'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/details_info/__snapshots__/details_info.test.tsx.snap b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/details_info/__snapshots__/details_info.test.tsx.snap similarity index 100% rename from packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/details_info/__snapshots__/details_info.test.tsx.snap rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/details_info/__snapshots__/details_info.test.tsx.snap diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/details_info/details_info.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/details_info/details_info.test.tsx new file mode 100644 index 0000000000000..3950d674a1add --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/details_info/details_info.test.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 from 'react'; +import { render } from '@testing-library/react'; +import { MetaInfoDetails } from '.'; + +describe('MetaInfoDetails', () => { + it('should render lastUpdate as string', () => { + const wrapper = render( + <MetaInfoDetails + dataTestSubj="MetaInfoDetails" + label="created_by" + lastUpdate="last update" + lastUpdateValue="value" + /> + ); + expect(wrapper.container).toMatchSnapshot(); + expect(wrapper.getByTestId('MetaInfoDetailslastUpdate')).toHaveTextContent('last update'); + }); + it('should render lastUpdate as JSX Element', () => { + const wrapper = render( + <MetaInfoDetails + dataTestSubj="MetaInfoDetails" + label="created_by" + // eslint-disable-next-line react/jsx-no-literals + lastUpdate={<p>Last update value</p>} + lastUpdateValue="value" + /> + ); + expect(wrapper.container).toMatchSnapshot(); + expect(wrapper.getByTestId('MetaInfoDetailslastUpdate')).toHaveTextContent('Last update value'); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/details_info/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/details_info/index.tsx new file mode 100644 index 0000000000000..209ce3b59553c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/details_info/index.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, { memo } from 'react'; +import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; +import { css } from '@emotion/react'; +import { euiThemeVars } from '@kbn/ui-theme'; +import * as i18n from '../../translations'; + +interface MetaInfoDetailsProps { + label: string; + lastUpdate: JSX.Element | string; + lastUpdateValue?: string; + dataTestSubj?: string; +} + +const euiBadgeFontFamily = css` + font-family: ${euiThemeVars.euiFontFamily}; +`; +export const MetaInfoDetails = memo<MetaInfoDetailsProps>( + ({ label, lastUpdate, lastUpdateValue, dataTestSubj }) => { + return ( + <EuiFlexGroup + data-test-subj={`${dataTestSubj || ''}metaInfoDetails`} + alignItems="center" + gutterSize="s" + wrap + responsive + > + <EuiFlexItem grow={false}> + <EuiText size="xs" css={euiBadgeFontFamily}> + {label} + </EuiText> + </EuiFlexItem> + <EuiFlexItem grow={false} data-test-subj={`${dataTestSubj || ''}lastUpdate`}> + <EuiBadge color="default" css={euiBadgeFontFamily}> + {lastUpdate} + </EuiBadge> + </EuiFlexItem> + {lastUpdateValue != null && ( + <> + <EuiFlexItem grow={false}> + <EuiText size="xs" css={euiBadgeFontFamily}> + {i18n.EXCEPTION_ITEM_CARD_META_BY} + </EuiText> + </EuiFlexItem> + <EuiFlexItem grow={false} data-test-subj={`${dataTestSubj || ''}lastUpdateValue`}> + <EuiFlexGroup responsive gutterSize="xs" alignItems="center"> + <EuiFlexItem grow={false}> + <EuiBadge color="hollow" css={euiBadgeFontFamily}> + {lastUpdateValue} + </EuiBadge> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + </> + )} + </EuiFlexGroup> + ); + } +); + +MetaInfoDetails.displayName = 'MetaInfoDetails'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/index.tsx new file mode 100644 index 0000000000000..8c7734ab51c99 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/index.tsx @@ -0,0 +1,123 @@ +/* + * 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, useMemo } from 'react'; +import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; + +import { css } from '@emotion/react'; +import { euiThemeVars } from '@kbn/ui-theme'; +import * as i18n from '../translations'; +import type { Rule } from '../../types'; +import { MetaInfoDetails } from './details_info'; +import { HeaderMenu } from '../../header_menu'; +import { generateLinkedRulesMenuItems } from '../../generate_linked_rules_menu_item'; + +const itemCss = css` + border-right: 1px solid #d3dae6; + padding: ${euiThemeVars.euiSizeS} ${euiThemeVars.euiSizeM} ${euiThemeVars.euiSizeS} 0; +`; + +export interface ExceptionItemCardMetaInfoProps { + item: ExceptionListItemSchema; + rules: Rule[]; + dataTestSubj: string; + formattedDateComponent: React.ElementType; // This property needs to be removed to avoid the Prop Drilling, once we move all the common components from x-pack/security-solution/common + securityLinkAnchorComponent: React.ElementType; // This property needs to be removed to avoid the Prop Drilling, once we move all the common components from x-pack/security-solution/common +} + +export const ExceptionItemCardMetaInfo = memo<ExceptionItemCardMetaInfoProps>( + ({ item, rules, dataTestSubj, securityLinkAnchorComponent, formattedDateComponent }) => { + const FormattedDateComponent = formattedDateComponent; + + const referencedLinks = useMemo( + () => + generateLinkedRulesMenuItems({ + dataTestSubj, + linkedRules: rules, + securityLinkAnchorComponent, + }), + [dataTestSubj, rules, securityLinkAnchorComponent] + ); + + const isExpired = useMemo( + () => (item.expire_time ? new Date(item.expire_time) <= new Date() : false), + [item] + ); + + return ( + <EuiFlexGroup alignItems="center" responsive gutterSize="s" data-test-subj={dataTestSubj}> + {FormattedDateComponent !== null && ( + <> + <EuiFlexItem css={itemCss} grow={false}> + <MetaInfoDetails + label={i18n.EXCEPTION_ITEM_CARD_CREATED_LABEL} + lastUpdate={ + <FormattedDateComponent + data-test-subj={`{dataTestSubj||''}formattedDateComponentCreatedBy`} + fieldName="created_at" + value={item.created_at} + /> + } + lastUpdateValue={item.created_by} + dataTestSubj={`${dataTestSubj || ''}CreatedBy`} + /> + </EuiFlexItem> + + <EuiFlexItem css={itemCss} grow={false}> + <MetaInfoDetails + label={i18n.EXCEPTION_ITEM_CARD_UPDATED_LABEL} + lastUpdate={ + <FormattedDateComponent + data-test-subj={`{dataTestSubj||''}formattedDateComponentUpdatedBy`} + fieldName="updated_at" + value={item.updated_at} + /> + } + lastUpdateValue={item.updated_by} + dataTestSubj={`${dataTestSubj || ''}UpdatedBy`} + /> + </EuiFlexItem> + {item.expire_time != null && ( + <> + <EuiFlexItem css={itemCss} grow={false}> + <MetaInfoDetails + label={ + isExpired + ? i18n.EXCEPTION_ITEM_CARD_EXPIRED_LABEL + : i18n.EXCEPTION_ITEM_CARD_EXPIRES_LABEL + } + lastUpdate={ + <FormattedDateComponent + data-test-subj={`{dataTestSubj||''}formattedDateComponentExpireTime`} + fieldName="expire_time" + value={item.expire_time} + /> + } + dataTestSubj={`${dataTestSubj || ''}ExpireTime`} + /> + </EuiFlexItem> + </> + )} + </> + )} + <EuiFlexItem> + <HeaderMenu + emptyButton + useCustomActions + iconType="list" + actions={referencedLinks} + disableActions={false} + text={i18n.AFFECTED_RULES(rules.length)} + dataTestSubj={dataTestSubj} + /> + </EuiFlexItem> + </EuiFlexGroup> + ); + } +); +ExceptionItemCardMetaInfo.displayName = 'ExceptionItemCardMetaInfo'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/meta.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/meta.test.tsx similarity index 90% rename from packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/meta.test.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/meta.test.tsx index 10570b2637812..f7a94d9d76ff9 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/meta.test.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/meta/meta.test.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/translations.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/translations.ts new file mode 100644 index 0000000000000..9b1a64bd6cf40 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/translations.ts @@ -0,0 +1,179 @@ +/* + * 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'; + +export const exceptionItemCardEditButton = (listType: string) => + i18n.translate('exceptionList-components.exceptions.exceptionItem.card.editItemButton', { + values: { listType }, + defaultMessage: 'Edit {listType} exception', + }); + +export const exceptionItemCardDeleteButton = (listType: string) => + i18n.translate('exceptionList-components.exceptions.exceptionItem.card.deleteItemButton', { + values: { listType }, + defaultMessage: 'Delete {listType} exception', + }); + +export const EXCEPTION_ITEM_CARD_CREATED_LABEL = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.createdLabel', + { + defaultMessage: 'Created', + } +); + +export const EXCEPTION_ITEM_CARD_UPDATED_LABEL = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.updatedLabel', + { + defaultMessage: 'Updated', + } +); + +export const EXCEPTION_ITEM_CARD_EXPIRES_LABEL = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.expiresLabel', + { + defaultMessage: 'Expires at', + } +); + +export const EXCEPTION_ITEM_CARD_EXPIRED_LABEL = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.expiredLabel', + { + defaultMessage: 'Expired at', + } +); + +export const EXCEPTION_ITEM_CARD_META_BY = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.metaDetailsBy', + { + defaultMessage: 'by', + } +); + +export const exceptionItemCardCommentsAccordion = (comments: number) => + i18n.translate('exceptionList-components.exceptions.exceptionItem.card.showCommentsLabel', { + values: { comments }, + defaultMessage: 'Show {comments, plural, =1 {comment} other {comments}} ({comments})', + }); + +export const CONDITION_OPERATOR_TYPE_MATCH = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.conditions.matchOperator', + { + defaultMessage: 'IS', + } +); + +export const CONDITION_OPERATOR_TYPE_NOT_MATCH = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.conditions.matchOperator.not', + { + defaultMessage: 'IS NOT', + } +); + +export const CONDITION_OPERATOR_TYPE_WILDCARD_MATCHES = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.conditions.wildcardMatchesOperator', + { + defaultMessage: 'MATCHES', + } +); + +export const CONDITION_OPERATOR_TYPE_WILDCARD_DOES_NOT_MATCH = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.conditions.wildcardDoesNotMatchOperator', + { + defaultMessage: 'DOES NOT MATCH', + } +); + +export const CONDITION_OPERATOR_TYPE_NESTED = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.conditions.nestedOperator', + { + defaultMessage: 'has', + } +); + +export const CONDITION_OPERATOR_TYPE_MATCH_ANY = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.conditions.matchAnyOperator', + { + defaultMessage: 'is one of', + } +); + +export const CONDITION_OPERATOR_TYPE_NOT_MATCH_ANY = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.conditions.matchAnyOperator.not', + { + defaultMessage: 'is not one of', + } +); + +export const CONDITION_OPERATOR_TYPE_EXISTS = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.conditions.existsOperator', + { + defaultMessage: 'exists', + } +); + +export const CONDITION_OPERATOR_TYPE_DOES_NOT_EXIST = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.conditions.existsOperator.not', + { + defaultMessage: 'does not exist', + } +); + +export const CONDITION_OPERATOR_TYPE_LIST = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.conditions.listOperator', + { + defaultMessage: 'included in', + } +); + +export const CONDITION_OPERATOR_TYPE_NOT_IN_LIST = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.conditions.listOperator.not', + { + defaultMessage: 'is not included in', + } +); + +export const CONDITION_AND = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.conditions.and', + { + defaultMessage: 'AND', + } +); + +export const CONDITION_OS = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.conditions.os', + { + defaultMessage: 'OS', + } +); + +export const OS_WINDOWS = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.conditions.windows', + { + defaultMessage: 'Windows', + } +); + +export const OS_LINUX = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.conditions.linux', + { + defaultMessage: 'Linux', + } +); + +export const OS_MAC = i18n.translate( + 'exceptionList-components.exceptions.exceptionItem.card.conditions.macos', + { + defaultMessage: 'Mac', + } +); + +export const AFFECTED_RULES = (numRules: number) => + i18n.translate('exceptionList-components.exceptions.card.exceptionItem.affectedRules', { + values: { numRules }, + defaultMessage: 'Affects {numRules} {numRules, plural, =1 {rule} other {rules}}', + }); diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/use_exception_item_card.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/use_exception_item_card.test.ts similarity index 90% rename from packages/kbn-securitysolution-exception-list-components/src/exception_item_card/use_exception_item_card.test.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/use_exception_item_card.test.ts index 5c04c87727147..1a144182eeed8 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/use_exception_item_card.test.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/use_exception_item_card.test.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { ExceptionListTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/use_exception_item_card.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/use_exception_item_card.ts similarity index 86% rename from packages/kbn-securitysolution-exception-list-components/src/exception_item_card/use_exception_item_card.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/use_exception_item_card.ts index 2978dfb12c727..f3da4ec925955 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/use_exception_item_card.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/use_exception_item_card.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_items/exception_items.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_items/exception_items.test.tsx similarity index 96% rename from packages/kbn-securitysolution-exception-list-components/src/exception_items/exception_items.test.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_items/exception_items.test.tsx index e60cff40626ff..936a58b670f52 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_items/exception_items.test.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_items/exception_items.test.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_items/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_items/index.tsx new file mode 100644 index 0000000000000..6fde321cfcb93 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/exception_items/index.tsx @@ -0,0 +1,153 @@ +/* + * 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, { ElementType } from 'react'; +import { css } from '@emotion/react'; +import type { FC } from 'react'; +import { EuiCommentProps, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; + +import type { + CommentsArray, + ExceptionListItemSchema, + ExceptionListTypeEnum, +} from '@kbn/securitysolution-io-ts-list-types'; + +import { euiThemeVars } from '@kbn/ui-theme'; +import { EmptyViewerState, ExceptionItemCard, Pagination, PaginationProps } from '../..'; + +import type { + RuleReferences, + ExceptionListItemIdentifiers, + ViewerStatus, + GetExceptionItemProps, +} from '../types'; + +const exceptionItemCss = css` + margin: ${euiThemeVars.euiSize} 0; + &div:first-child { + margin: ${euiThemeVars.euiSizeXS} 0 ${euiThemeVars.euiSize}; + } +`; + +interface ExceptionItemsProps { + lastUpdated: string | number | null; + viewerStatus: ViewerStatus; + isReadOnly: boolean; + emptyViewerTitle?: string; + emptyViewerBody?: string; + emptyViewerButtonText?: string; + exceptions: ExceptionListItemSchema[]; + listType: ExceptionListTypeEnum; + ruleReferences: RuleReferences; + pagination: PaginationProps['pagination']; + editActionLabel?: string; + deleteActionLabel?: string; + dataTestSubj?: string; + securityLinkAnchorComponent: ElementType; // This property needs to be removed to avoid the Prop Drilling, once we move all the common components from x-pack/security-solution/common + formattedDateComponent: ElementType; // This property needs to be removed to avoid the Prop Drilling, once we move all the common components from x-pack/security-solution/common + exceptionsUtilityComponent: ElementType; // This property needs to be removed to avoid the Prop Drilling, once we move all the common components from x-pack/security-solution/common + getFormattedComments: (comments: CommentsArray) => EuiCommentProps[]; // This property needs to be removed to avoid the Prop Drilling, once we move all the common components from x-pack/security-solution/common + onCreateExceptionListItem?: () => void; + onDeleteException: (arg: ExceptionListItemIdentifiers) => void; + onEditExceptionItem: (item: ExceptionListItemSchema) => void; + onPaginationChange: (arg: GetExceptionItemProps) => void; + showValueListModal: ElementType; +} + +const ExceptionItemsComponent: FC<ExceptionItemsProps> = ({ + lastUpdated, + viewerStatus, + isReadOnly, + exceptions, + listType, + ruleReferences, + emptyViewerTitle, + emptyViewerBody, + emptyViewerButtonText, + pagination, + dataTestSubj, + editActionLabel, + deleteActionLabel, + securityLinkAnchorComponent, + exceptionsUtilityComponent, + formattedDateComponent, + getFormattedComments, + onPaginationChange, + onDeleteException, + onEditExceptionItem, + onCreateExceptionListItem, + showValueListModal, +}) => { + const ExceptionsUtility = exceptionsUtilityComponent; + if (!exceptions.length || viewerStatus) + return ( + <EmptyViewerState + isReadOnly={isReadOnly} + title={emptyViewerTitle} + viewerStatus={viewerStatus} + buttonText={emptyViewerButtonText} + body={emptyViewerBody} + onEmptyButtonStateClick={onCreateExceptionListItem} + /> + ); + const ShowValueListModal = showValueListModal; + return ( + <> + <ExceptionsUtility pagination={pagination} lastUpdated={lastUpdated} /> + <EuiFlexGroup direction="column" gutterSize="none" className="eui-yScrollWithShadows"> + <EuiFlexItem grow={false}> + <EuiFlexGroup + css={exceptionItemCss} + data-test-subj={`${dataTestSubj || ''}exceptionsContainer`} + direction="column" + gutterSize="s" + > + {exceptions.map((exception) => ( + <EuiFlexItem + data-test-subj={`${dataTestSubj || ''}exceptionItemContainer`} + grow={false} + key={exception.id} + > + <ExceptionItemCard + key={`${exception.id}exceptionItemCardKey`} + dataTestSubj={`${dataTestSubj || ''}exceptionItemCard`} + disableActions={isReadOnly} + exceptionItem={exception} + listType={listType} + ruleReferences={ + Object.keys(ruleReferences).length && ruleReferences[exception.list_id] + ? ruleReferences[exception.list_id].referenced_rules + : [] + } + editActionLabel={editActionLabel} + deleteActionLabel={deleteActionLabel} + onDeleteException={onDeleteException} + onEditException={onEditExceptionItem} + securityLinkAnchorComponent={securityLinkAnchorComponent} + formattedDateComponent={formattedDateComponent} + getFormattedComments={getFormattedComments} + showValueListModal={ShowValueListModal} + /> + </EuiFlexItem> + ))} + </EuiFlexGroup> + </EuiFlexItem> + </EuiFlexGroup> + <Pagination + dataTestSubj={`${dataTestSubj || ''}pagination`} + pagination={pagination} + onPaginationChange={onPaginationChange} + /> + </> + ); +}; + +ExceptionItemsComponent.displayName = 'ExceptionItemsComponent'; + +export const ExceptionItems = React.memo(ExceptionItemsComponent); + +ExceptionItems.displayName = 'ExceptionsItems'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/__snapshots__/generate_linked_rules_menu_item.test.tsx.snap b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/__snapshots__/generate_linked_rules_menu_item.test.tsx.snap similarity index 100% rename from packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/__snapshots__/generate_linked_rules_menu_item.test.tsx.snap rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/__snapshots__/generate_linked_rules_menu_item.test.tsx.snap diff --git a/packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/generate_linked_rules_menu_item.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/generate_linked_rules_menu_item.test.tsx similarity index 80% rename from packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/generate_linked_rules_menu_item.test.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/generate_linked_rules_menu_item.test.tsx index 01f708a0f6bdc..2bf26f551fb06 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/generate_linked_rules_menu_item.test.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/generate_linked_rules_menu_item.test.tsx @@ -1,15 +1,12 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { render } from '@testing-library/react'; -import { ReactElement } from 'react'; -import { ElementType } from 'react'; +import { ReactElement, ElementType } from 'react'; import { generateLinkedRulesMenuItems } from '.'; import { rules } from '../mocks/rule_references.mock'; import { @@ -45,7 +42,7 @@ describe('generateLinedRulesMenuItems', () => { leftIcon: 'check', }) as ReactElement[]; - result.map((link) => { + result.forEach((link) => { const wrapper = render(link); expect(wrapper.container).toMatchSnapshot(); expect(wrapper.getByTestId('generateLinedRulesMenuItemsTestActionItem1a2b3c')); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/index.tsx new file mode 100644 index 0000000000000..9187d0975e92a --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/index.tsx @@ -0,0 +1,49 @@ +/* + * 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, { ElementType, ReactElement } from 'react'; +import { EuiContextMenuItem, EuiFlexGroup, EuiFlexItem, EuiIcon, IconType } from '@elastic/eui'; +import { Rule } from '../types'; +import { itemContentCss, containerCss } from './menu_link.styles'; + +interface MenuItemLinkedRulesProps { + leftIcon?: IconType; + dataTestSubj?: string; + linkedRules: Rule[]; + securityLinkAnchorComponent: ElementType; // This property needs to be removed to avoid the Prop Drilling, once we move all the common components from x-pack/security-solution/common +} + +export const generateLinkedRulesMenuItems = ({ + dataTestSubj, + linkedRules, + securityLinkAnchorComponent, + leftIcon = '', +}: MenuItemLinkedRulesProps): ReactElement[] | null => { + if (!linkedRules.length || securityLinkAnchorComponent === null) return null; + + const SecurityLinkAnchor = securityLinkAnchorComponent; + return linkedRules.map((rule) => { + return ( + <EuiContextMenuItem + css={linkedRules.length > 1 ? containerCss : ''} + data-test-subj={`${dataTestSubj || ''}ActionItem${rule.id}`} + key={rule.id} + > + <EuiFlexGroup gutterSize="s" css={itemContentCss}> + {leftIcon ? ( + <EuiFlexItem data-test-subj={`${dataTestSubj || ''}LeftIcon`} grow={false}> + <EuiIcon type={leftIcon} /> + </EuiFlexItem> + ) : null} + <EuiFlexItem css={itemContentCss}> + <SecurityLinkAnchor external referenceName={rule.name} referenceId={rule.id} /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiContextMenuItem> + ); + }); +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/menu_link.styles.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/menu_link.styles.ts new file mode 100644 index 0000000000000..886369b22e23b --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/generate_linked_rules_menu_item/menu_link.styles.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 { css } from '@emotion/react'; +import { euiThemeVars } from '@kbn/ui-theme'; + +export const containerCss = css` + border-bottom: 1px solid ${euiThemeVars.euiColorLightShade}; +`; + +export const itemContentCss = css` + color: ${euiThemeVars.euiColorPrimary}; + flex-basis: content; +`; diff --git a/packages/kbn-securitysolution-exception-list-components/src/header_menu/__snapshots__/header_menu.test.tsx.snap b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/header_menu/__snapshots__/header_menu.test.tsx.snap similarity index 100% rename from packages/kbn-securitysolution-exception-list-components/src/header_menu/__snapshots__/header_menu.test.tsx.snap rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/header_menu/__snapshots__/header_menu.test.tsx.snap diff --git a/packages/kbn-securitysolution-exception-list-components/src/header_menu/header_menu.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/header_menu/header_menu.test.tsx similarity index 93% rename from packages/kbn-securitysolution-exception-list-components/src/header_menu/header_menu.test.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/header_menu/header_menu.test.tsx index 7e14b503721b5..2869b16e3aaa2 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/header_menu/header_menu.test.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/header_menu/header_menu.test.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { createEvent, fireEvent, render } from '@testing-library/react'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/header_menu/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/header_menu/index.tsx new file mode 100644 index 0000000000000..bd634b5f6c361 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/header_menu/index.tsx @@ -0,0 +1,137 @@ +/* + * 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, { FC, ReactElement, useMemo, useState } from 'react'; +import { + EuiButtonEmpty, + EuiButtonEmptyProps, + EuiButtonIcon, + EuiContextMenuItem, + EuiContextMenuPanel, + EuiFlexGroup, + EuiPopover, + PanelPaddingSize, + PopoverAnchorPosition, +} from '@elastic/eui'; + +import { css } from '@emotion/react'; + +export interface Action { + key: string; + icon: string; + label: string | boolean; + disabled?: boolean; + onClick: (e: React.MouseEvent<Element, MouseEvent>) => void; +} + +interface HeaderMenuComponentProps { + disableActions: boolean; + actions: Action[] | ReactElement[] | null; + text?: string; + iconType?: EuiButtonEmptyProps['iconType']; + iconSide?: EuiButtonEmptyProps['iconSide']; + dataTestSubj?: string; + emptyButton?: boolean; + useCustomActions?: boolean; + anchorPosition?: PopoverAnchorPosition; + panelPaddingSize?: PanelPaddingSize; +} + +const popoverHeightStyle = css` + max-height: 300px; + height: 100%; + overflow-x: hidden; + overflow-y: auto; +`; +const HeaderMenuComponent: FC<HeaderMenuComponentProps> = ({ + text, + dataTestSubj, + actions, + disableActions, + emptyButton, + useCustomActions, + iconType, + iconSide = 'left', + anchorPosition = 'downCenter', + panelPaddingSize = 's', +}) => { + const [isPopoverOpen, setIsPopoverOpen] = useState(false); + + const onAffectedRulesClick = () => setIsPopoverOpen((isOpen) => !isOpen); + const onClosePopover = () => setIsPopoverOpen(false); + + const itemActions = useMemo(() => { + if (useCustomActions || actions === null) return actions; + return (actions as Action[]).map((action) => ( + <EuiContextMenuItem + data-test-subj={`${dataTestSubj || ''}ActionItem${action.key}`} + key={action.key} + icon={action.icon} + disabled={action.disabled} + layoutAlign="center" + onClick={(e) => { + onClosePopover(); + if (typeof action.onClick === 'function') action.onClick(e); + }} + > + {action.label} + </EuiContextMenuItem> + )); + }, [actions, dataTestSubj, useCustomActions]); + + return ( + <EuiFlexGroup responsive> + <EuiPopover + button={ + emptyButton ? ( + <EuiButtonEmpty + isDisabled={disableActions} + onClick={onAffectedRulesClick} + iconType={iconType ? iconType : undefined} + iconSide={iconSide} + data-test-subj={`${dataTestSubj || ''}EmptyButton`} + aria-label="Header menu Button Empty" + > + {text} + </EuiButtonEmpty> + ) : ( + <EuiButtonIcon + isDisabled={disableActions} + onClick={onAffectedRulesClick} + iconType={iconType ? iconType : 'boxesHorizontal'} + data-test-subj={`${dataTestSubj || ''}ButtonIcon`} + aria-label="Header menu Button Icon" + > + {text} + </EuiButtonIcon> + ) + } + onClick={(e) => e.stopPropagation()} + panelPaddingSize={panelPaddingSize} + isOpen={isPopoverOpen} + closePopover={onClosePopover} + anchorPosition={anchorPosition} + data-test-subj={`${dataTestSubj || ''}Items`} + > + {!itemActions ? null : ( + <EuiContextMenuPanel + css={popoverHeightStyle} + className="eui-scrollBar" + data-test-subj={`${dataTestSubj || ''}MenuPanel`} + size="s" + items={itemActions as ReactElement[]} + /> + )} + </EuiPopover> + </EuiFlexGroup> + ); +}; +HeaderMenuComponent.displayName = 'HeaderMenuComponent'; + +export const HeaderMenu = React.memo(HeaderMenuComponent); + +HeaderMenu.displayName = 'HeaderMenu'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/__snapshots__/list_header.test.tsx.snap b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/__snapshots__/list_header.test.tsx.snap similarity index 100% rename from packages/kbn-securitysolution-exception-list-components/src/list_header/__snapshots__/list_header.test.tsx.snap rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/__snapshots__/list_header.test.tsx.snap diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/__snapshots__/edit_modal.test.tsx.snap b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/__snapshots__/edit_modal.test.tsx.snap similarity index 100% rename from packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/__snapshots__/edit_modal.test.tsx.snap rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/__snapshots__/edit_modal.test.tsx.snap diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/edit_modal.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/edit_modal.test.tsx similarity index 93% rename from packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/edit_modal.test.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/edit_modal.test.tsx index 39692e35394ec..9b23afaf2089e 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/edit_modal.test.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/edit_modal.test.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/index.tsx new file mode 100644 index 0000000000000..fda87a768fd0d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/index.tsx @@ -0,0 +1,109 @@ +/* + * 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, { FC } from 'react'; +import { + EuiButton, + EuiButtonEmpty, + EuiFieldText, + EuiForm, + EuiFormRow, + EuiModal, + EuiModalBody, + EuiModalFooter, + EuiModalHeader, + EuiModalHeaderTitle, + EuiTextArea, + EuiProgress, +} from '@elastic/eui'; +import * as i18n from '../../translations'; +import { ListDetails } from '../../types'; +import { useEditModal } from './use_edit_modal'; + +interface EditModalProps { + listDetails: ListDetails; + onSave: (newListDetails: ListDetails) => void; + onCancel: () => void; +} + +const EditModalComponent: FC<EditModalProps> = ({ listDetails, onSave, onCancel }) => { + const { error, modalFormId, newListDetails, showProgress, onBlur, onSubmit, onChange } = + useEditModal({ + listDetails, + onSave, + }); + return ( + <EuiModal data-test-subj="EditModal" onClose={onCancel} initialFocus="[name=popswitch]"> + {showProgress && ( + <EuiProgress data-test-subj="editModalProgess" size="xs" position="absolute" /> + )} + <EuiModalHeader> + <EuiModalHeaderTitle data-test-subj="editModalTitle"> + {i18n.EXCEPTION_LIST_HEADER_EDIT_MODAL_TITLE(listDetails.name)} + </EuiModalHeaderTitle> + </EuiModalHeader> + + <EuiModalBody> + <EuiForm + id={modalFormId} + data-test-subj="editModalForm" + component="form" + onSubmit={onSubmit} + > + <EuiFormRow + error={error} + isInvalid={!!error} + fullWidth + label={i18n.EXCEPTION_LIST_HEADER_NAME_TEXTBOX} + > + <EuiFieldText + fullWidth + isInvalid={!!error} + onBlur={onBlur} + data-test-subj="editModalNameTextField" + name="name" + value={newListDetails.name} + onChange={onChange} + /> + </EuiFormRow> + + <EuiFormRow fullWidth label={i18n.EXCEPTION_LIST_HEADER_DESCRIPTION_TEXTBOX}> + <EuiTextArea + fullWidth + data-test-subj="editModalDescriptionTextField" + name="description" + value={newListDetails.description} + onChange={onChange} + onBlur={onBlur} + /> + </EuiFormRow> + </EuiForm> + </EuiModalBody> + + <EuiModalFooter> + <EuiButtonEmpty data-test-subj="editModalCancelBtn" onClick={onCancel}> + {i18n.EXCEPTION_LIST_HEADER_EDIT_MODAL_CANCEL_BUTTON} + </EuiButtonEmpty> + + <EuiButton + data-test-subj="editModalSaveBtn" + type="submit" + form={modalFormId} + onClick={onSubmit} + fill + > + {i18n.EXCEPTION_LIST_HEADER_EDIT_MODAL_SAVE_BUTTON} + </EuiButton> + </EuiModalFooter> + </EuiModal> + ); +}; +EditModalComponent.displayName = 'EditModalComponent'; + +export const EditModal = React.memo(EditModalComponent); + +EditModal.displayName = 'EditModal'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/use_edit_modal.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/use_edit_modal.test.ts similarity index 81% rename from packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/use_edit_modal.test.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/use_edit_modal.test.ts index 65b532a55c834..a540fdd7704db 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/use_edit_modal.test.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/use_edit_modal.test.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { ChangeEvent, SyntheticEvent } from 'react'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/use_edit_modal.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/use_edit_modal.ts similarity index 80% rename from packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/use_edit_modal.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/use_edit_modal.ts index 6977b8467b94a..38c60328ef3d2 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/use_edit_modal.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/use_edit_modal.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { useGeneratedHtmlId } from '@elastic/eui'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/index.tsx new file mode 100644 index 0000000000000..a6fce88699993 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/index.tsx @@ -0,0 +1,138 @@ +/* + * 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. + */ + +/* eslint-disable react/jsx-no-literals */ + +import React from 'react'; +import type { FC } from 'react'; +import { EuiIcon, EuiPageHeader, EuiText } from '@elastic/eui'; +import * as i18n from '../translations'; +import { textCss, descriptionContainerCss, backTextCss } from './list_header.styles'; +import { MenuItems } from './menu_items'; +import { TextWithEdit } from '../text_with_edit'; +import { EditModal } from './edit_modal'; +import { ListDetails, Rule } from '../types'; +import { useExceptionListHeader } from './use_list_header'; +import { textWithEditContainerCss } from '../text_with_edit/text_with_edit.styles'; + +interface ExceptionListHeaderComponentProps { + name: string; + description?: string; + listId: string; + isReadonly: boolean; + linkedRules: Rule[]; + dataTestSubj?: string; + backOptions: BackOptions; + canUserEditList?: boolean; + securityLinkAnchorComponent: React.ElementType; // This property needs to be removed to avoid the Prop Drilling, once we move all the common components from x-pack/security-solution/common + onEditListDetails: (listDetails: ListDetails) => void; + onDeleteList: () => void; + onManageRules: () => void; + onExportList: () => void; + onDuplicateList: () => void; +} + +export interface BackOptions { + pageId: string; + path: string; + dataTestSubj?: string; + onNavigate: (path: string) => void; +} +const ExceptionListHeaderComponent: FC<ExceptionListHeaderComponentProps> = ({ + name, + description, + listId, + linkedRules, + isReadonly, + dataTestSubj, + securityLinkAnchorComponent, + backOptions, + canUserEditList = true, + onEditListDetails, + onDeleteList, + onManageRules, + onExportList, + onDuplicateList, +}) => { + const { isModalVisible, listDetails, onEdit, onSave, onCancel } = useExceptionListHeader({ + name, + description, + onEditListDetails, + }); + return ( + <div> + <EuiPageHeader + bottomBorder + paddingSize="none" + pageTitle={ + <TextWithEdit + dataTestSubj={`${dataTestSubj || ''}Title`} + text={listDetails.name || i18n.EXCEPTION_LIST_HEADER_NAME} + isReadonly={isReadonly || !canUserEditList} + onEdit={onEdit} + /> + } + responsive + data-test-subj={`${dataTestSubj || ''}PageHeader`} + description={ + <div css={descriptionContainerCss}> + <TextWithEdit + dataTestSubj={`${dataTestSubj || ''}Description`} + textCss={textCss} + isReadonly={isReadonly || !canUserEditList} + text={listDetails.description || i18n.EXCEPTION_LIST_HEADER_DESCRIPTION} + onEdit={onEdit} + /> + <div css={textWithEditContainerCss} data-test-subj={`${dataTestSubj || ''}ListID`}> + <EuiText css={textCss}>{i18n.EXCEPTION_LIST_HEADER_LIST_ID}:</EuiText> + <EuiText css={textCss}>{listId}</EuiText> + </div> + </div> + } + rightSideItems={[ + <MenuItems + dataTestSubj={`${dataTestSubj || ''}RightSideMenuItems`} + linkedRules={linkedRules} + isReadonly={isReadonly} + canUserEditList={canUserEditList} + securityLinkAnchorComponent={securityLinkAnchorComponent} + onDeleteList={onDeleteList} + onManageRules={onManageRules} + onExportList={onExportList} + onDuplicateList={onDuplicateList} + />, + ]} + breadcrumbs={[ + { + text: ( + <div data-test-subj={`${dataTestSubj || ''}Breadcrumb`} css={backTextCss}> + <EuiIcon size="s" type="arrowLeft" /> + {i18n.EXCEPTION_LIST_HEADER_BREADCRUMB} + </div> + ), + color: 'primary', + 'aria-current': false, + href: backOptions.path, + onClick: (e) => { + e.preventDefault(); + backOptions.onNavigate(backOptions.path); + }, + }, + ]} + /> + {isModalVisible && ( + <EditModal listDetails={listDetails} onSave={onSave} onCancel={onCancel} /> + )} + </div> + ); +}; + +ExceptionListHeaderComponent.displayName = 'ExceptionListHeaderComponent'; + +export const ExceptionListHeader = React.memo(ExceptionListHeaderComponent); + +ExceptionListHeader.displayName = 'ExceptionListHeader'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/list_header.styles.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/list_header.styles.ts new file mode 100644 index 0000000000000..7a82cd9bc2893 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/list_header.styles.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 { css } from '@emotion/react'; +import { euiThemeVars } from '@kbn/ui-theme'; + +export const headerMenuCss = css` + border-right: 1px solid #d3dae6; + padding: ${euiThemeVars.euiSizeXS} ${euiThemeVars.euiSizeL} ${euiThemeVars.euiSizeXS} 0; +`; + +export const noLinkedRulesCss = css` + width: max-content; +`; + +export const textCss = css` + font-size: ${euiThemeVars.euiFontSize}; + color: ${euiThemeVars.euiTextSubduedColor}; + margin-left: ${euiThemeVars.euiSizeXS}; +`; +export const descriptionContainerCss = css` + margin-top: -${euiThemeVars.euiSizeL}; + margin-bottom: -${euiThemeVars.euiSizeL}; +`; + +export const backTextCss = css` + font-size: ${euiThemeVars.euiFontSizeXS}; +`; diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/list_header.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/list_header.test.tsx similarity index 94% rename from packages/kbn-securitysolution-exception-list-components/src/list_header/list_header.test.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/list_header.test.tsx index 9ceb648dfa7e1..246e880716087 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/list_header/list_header.test.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/list_header.test.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/__snapshots__/menu_items.test.tsx.snap b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/__snapshots__/menu_items.test.tsx.snap similarity index 100% rename from packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/__snapshots__/menu_items.test.tsx.snap rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/__snapshots__/menu_items.test.tsx.snap diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/index.tsx new file mode 100644 index 0000000000000..798f737be65db --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/index.tsx @@ -0,0 +1,134 @@ +/* + * 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 { EuiButton, EuiFlexGroup, EuiFlexItem, EuiTextColor } from '@elastic/eui'; +import React, { FC, useMemo } from 'react'; +import { HeaderMenu } from '../../header_menu'; +import { headerMenuCss, noLinkedRulesCss } from '../list_header.styles'; +import * as i18n from '../../translations'; +import { Rule } from '../../types'; +import { generateLinkedRulesMenuItems } from '../../generate_linked_rules_menu_item'; +interface MenuItemsProps { + isReadonly: boolean; + dataTestSubj?: string; + linkedRules: Rule[]; + canUserEditList?: boolean; + securityLinkAnchorComponent: React.ElementType; // This property needs to be removed to avoid the Prop Drilling, once we move all the common components from x-pack/security-solution/common + onDeleteList: () => void; + onManageRules: () => void; + onExportList: () => void; + onDuplicateList: () => void; +} + +const MenuItemsComponent: FC<MenuItemsProps> = ({ + dataTestSubj, + linkedRules, + securityLinkAnchorComponent, + isReadonly, + canUserEditList = true, + onDeleteList, + onManageRules, + onExportList, + onDuplicateList, +}) => { + const referencedLinks = useMemo( + () => + generateLinkedRulesMenuItems({ + leftIcon: 'check', + dataTestSubj, + linkedRules, + securityLinkAnchorComponent, + }), + [dataTestSubj, linkedRules, securityLinkAnchorComponent] + ); + return ( + <EuiFlexGroup + direction="row" + alignItems="baseline" + justifyContent="center" + responsive + data-test-subj={`${dataTestSubj || ''}Container`} + gutterSize="l" + > + <EuiFlexItem css={headerMenuCss}> + {linkedRules.length ? ( + <HeaderMenu + dataTestSubj={`${dataTestSubj || ''}LinkedRulesMenu`} + emptyButton + useCustomActions + text={i18n.EXCEPTION_LIST_HEADER_LINKED_RULES(linkedRules.length)} + actions={referencedLinks} + disableActions={false} + iconType="arrowDown" + iconSide="right" + panelPaddingSize="none" + /> + ) : ( + <EuiTextColor data-test-subj="noLinkedRules" css={noLinkedRulesCss} color="subdued"> + {i18n.EXCEPTION_LIST_HEADER_LINKED_RULES(linkedRules.length)} + </EuiTextColor> + )} + </EuiFlexItem> + + {canUserEditList && ( + <EuiFlexItem> + <EuiButton + data-test-subj={`${dataTestSubj || ''}LinkRulesButton`} + fill + onClick={() => { + if (typeof onManageRules === 'function') onManageRules(); + }} + > + {i18n.EXCEPTION_LIST_HEADER_LINK_RULES_BUTTON} + </EuiButton> + </EuiFlexItem> + )} + <EuiFlexItem> + <HeaderMenu + iconType="boxesHorizontal" + dataTestSubj={`${dataTestSubj || ''}MenuActions`} + actions={[ + { + key: '1', + icon: 'exportAction', + label: i18n.EXCEPTION_LIST_HEADER_EXPORT_ACTION, + onClick: () => { + if (typeof onExportList === 'function') onExportList(); + }, + }, + { + key: '2', + icon: 'copy', + label: i18n.EXCEPTION_LIST_HEADER_DUPLICATE_ACTION, + onClick: () => { + if (typeof onDuplicateList === 'function') onDuplicateList(); + }, + disabled: !canUserEditList, + }, + { + key: '3', + icon: 'trash', + label: i18n.EXCEPTION_LIST_HEADER_DELETE_ACTION, + onClick: () => { + if (typeof onDeleteList === 'function') onDeleteList(); + }, + disabled: !canUserEditList, + }, + ]} + disableActions={isReadonly} + anchorPosition="downCenter" + /> + </EuiFlexItem> + </EuiFlexGroup> + ); +}; + +MenuItemsComponent.displayName = 'MenuItemsComponent'; + +export const MenuItems = React.memo(MenuItemsComponent); + +MenuItems.displayName = 'MenuItems'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/menu_items.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/menu_items.test.tsx similarity index 94% rename from packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/menu_items.test.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/menu_items.test.tsx index 16072bab295ab..8fdf6519cf448 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/menu_items.test.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/menu_items/menu_items.test.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { fireEvent, render } from '@testing-library/react'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/use_list_header.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/use_list_header.test.ts similarity index 86% rename from packages/kbn-securitysolution-exception-list-components/src/list_header/use_list_header.test.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/use_list_header.test.ts index e16681d2b184b..a49ef8f6f560c 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/list_header/use_list_header.test.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/use_list_header.test.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { waitFor, renderHook, act } from '@testing-library/react'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/use_list_header.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/use_list_header.ts new file mode 100644 index 0000000000000..cda4bf346a203 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/list_header/use_list_header.ts @@ -0,0 +1,44 @@ +/* + * 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 { useState } from 'react'; +import { ListDetails } from '../types'; + +interface UseExceptionListHeaderProps { + name: string; + description?: string; + onEditListDetails: (listDetails: ListDetails) => void; +} +export const useExceptionListHeader = ({ + name, + description, + onEditListDetails, +}: UseExceptionListHeaderProps) => { + const [isModalVisible, setIsModalVisible] = useState(false); + const [listDetails, setListDetails] = useState<ListDetails>({ name, description }); + const onEdit = () => { + setIsModalVisible(true); + }; + const onSave = (newListDetails: ListDetails) => { + setListDetails(newListDetails); + if (typeof onEditListDetails === 'function') onEditListDetails(newListDetails); + setTimeout(() => { + setIsModalVisible(false); + }, 200); + }; + const onCancel = () => { + setIsModalVisible(false); + }; + + return { + isModalVisible, + listDetails, + onEdit, + onSave, + onCancel, + }; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/comments.mock.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/comments.mock.tsx new file mode 100644 index 0000000000000..02767cfb979de --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/comments.mock.tsx @@ -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 React from 'react'; +import type { Comment, CommentsArray } from '@kbn/securitysolution-io-ts-list-types'; + +export const getCommentsMock = (): Comment => ({ + comment: 'some old comment', + created_at: '2020-04-20T15:25:31.830Z', + created_by: 'some user', + id: 'uuid_here', +}); + +export const getCommentsArrayMock = (): CommentsArray => [getCommentsMock(), getCommentsMock()]; + +export const mockGetFormattedComments = () => + getCommentsArrayMock().map((comment) => ({ + username: comment.created_by, + children: <p>{comment.comment}</p>, + })); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/entry.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/entry.mock.ts new file mode 100644 index 0000000000000..34a4e98cf981a --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/entry.mock.ts @@ -0,0 +1,28 @@ +/* + * 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 { Entry } from '../exception_item_card/conditions/types'; + +export const includedListTypeEntry: Entry = { + field: '', + operator: 'included', + type: 'list', + list: { id: 'list_id', type: 'boolean' }, +}; + +export const includedMatchTypeEntry: Entry = { + field: '', + operator: 'included', + type: 'match', + value: 'matches value', +}; + +export const includedExistsTypeEntry: Entry = { + field: '', + operator: 'included', + type: 'exists', +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/exception_list_item_schema.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/exception_list_item_schema.mock.ts new file mode 100644 index 0000000000000..a34ddc4dd484f --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/exception_list_item_schema.mock.ts @@ -0,0 +1,42 @@ +/* + * 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 { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; + +export const getExceptionListItemSchemaMock = ( + overrides?: Partial<ExceptionListItemSchema> +): ExceptionListItemSchema => ({ + _version: undefined, + comments: [], + created_at: '2020-04-20T15:25:31.830Z', + created_by: 'some user', + description: 'some description', + entries: [ + { + entries: [ + { field: 'nested.field', operator: 'included', type: 'match', value: 'some value' }, + ], + field: 'some.parentField', + type: 'nested', + }, + { field: 'some.not.nested.field', operator: 'included', type: 'match', value: 'some value' }, + ], + expire_time: undefined, + id: '1', + item_id: 'endpoint_list_item', + list_id: 'endpoint_list_id', + meta: {}, + name: 'some name', + namespace_type: 'single', + os_types: [], + tags: ['user added string for a tag', 'malware'], + tie_breaker_id: '6a76b69d-80df-4ab2-8c3e-85f466b06a0e', + type: 'simple', + updated_at: '2020-04-20T15:25:31.830Z', + updated_by: 'some user', + ...(overrides || {}), +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/header.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/header.mock.ts new file mode 100644 index 0000000000000..5ee301495e6f5 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/header.mock.ts @@ -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. + */ + +export const handleEdit = jest.fn(); +export const handleDelete = jest.fn(); +export const actions = [ + { + key: 'edit', + icon: 'pencil', + label: 'Edit detection exception', + onClick: handleEdit, + }, + { + key: 'delete', + icon: 'trash', + label: 'Delete detection exception', + onClick: handleDelete, + }, +]; +export const actionsWithDisabledDelete = [ + { + key: 'edit', + icon: 'pencil', + label: 'Edit detection exception', + onClick: handleEdit, + }, + { + key: 'delete', + icon: 'trash', + disabled: true, + label: 'Delete detection exception', + onClick: handleDelete, + }, +]; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/rule_references.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/rule_references.mock.ts new file mode 100644 index 0000000000000..c4eaff274a741 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/rule_references.mock.ts @@ -0,0 +1,41 @@ +/* + * 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 { Rule, RuleReference } from '../types'; + +export const rules: Rule[] = [ + { + exceptions_list: [ + { + id: '123', + list_id: 'i_exist', + namespace_type: 'single', + type: 'detection', + }, + { + id: '456', + list_id: 'i_exist_2', + namespace_type: 'single', + type: 'detection', + }, + ], + id: '1a2b3c', + name: 'Simple Rule Query', + rule_id: 'rule-2', + }, +]; + +export const ruleReference: RuleReference = { + name: 'endpoint list', + id: 'endpoint_list', + referenced_rules: rules, + listId: 'endpoint_list_id', +}; + +export const ruleReferences = { + endpoint_list_id: ruleReference, +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/security_link_component.mock.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/security_link_component.mock.tsx new file mode 100644 index 0000000000000..03c44d7e91667 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/security_link_component.mock.tsx @@ -0,0 +1,36 @@ +/* + * 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, { ReactElement } from 'react'; +import { generateLinkedRulesMenuItems } from '../generate_linked_rules_menu_item'; +import { rules } from './rule_references.mock'; +export const securityLinkAnchorComponentMock = ({ + referenceName, + referenceId, +}: { + referenceName: string; + referenceId: string; +}) => ( + <div data-test-subj="securityLinkAnchorComponent"> + <a href={referenceId}>{referenceName}</a> + </div> +); + +export const getSecurityLinkAction = (dataTestSubj: string) => + generateLinkedRulesMenuItems({ + dataTestSubj, + linkedRules: [ + ...rules, + { + exceptions_list: [], + id: '2a2b3c', + name: 'Simple Rule Query 2', + rule_id: 'rule-2', + }, + ], + securityLinkAnchorComponent: securityLinkAnchorComponentMock, + }) as ReactElement[]; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/value_list_modal.mock.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/value_list_modal.mock.tsx new file mode 100644 index 0000000000000..e0f9f5d700bed --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/mocks/value_list_modal.mock.tsx @@ -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 React from 'react'; + +export const mockShowValueListModal = jest.fn(); +export const MockedShowValueListModal = (props: { children: React.ReactNode }) => { + mockShowValueListModal(props); + return <>{props.children}</>; +}; diff --git a/packages/kbn-securitysolution-exception-list-components/src/pagination/pagination.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/pagination/pagination.test.tsx similarity index 84% rename from packages/kbn-securitysolution-exception-list-components/src/pagination/pagination.test.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/pagination/pagination.test.tsx index 5eaab267abb52..1467653d432b2 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/pagination/pagination.test.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/pagination/pagination.test.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { fireEvent, render } from '@testing-library/react'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/pagination/pagination.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/pagination/pagination.tsx new file mode 100644 index 0000000000000..e7275c4be2c2e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/pagination/pagination.tsx @@ -0,0 +1,49 @@ +/* + * 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 { FC } from 'react'; +import { EuiTablePagination } from '@elastic/eui'; + +import type { PaginationProps } from '../types'; +import { usePagination } from './use_pagination'; + +const PaginationComponent: FC<PaginationProps> = ({ + dataTestSubj, + ariaLabel, + pagination, + onPaginationChange, +}) => { + const { + pageIndex, + pageCount, + pageSize, + pageSizeOptions, + + handleItemsPerPageChange, + handlePageIndexChange, + } = usePagination({ pagination, onPaginationChange }); + + return ( + <EuiTablePagination + data-test-subj={dataTestSubj} + aria-label={ariaLabel} + pageCount={pageCount} + activePage={pageIndex} + itemsPerPage={pageSize} + onChangePage={handlePageIndexChange} + onChangeItemsPerPage={handleItemsPerPageChange} + itemsPerPageOptions={pageSizeOptions} + /> + ); +}; + +PaginationComponent.displayName = 'PaginationComponent'; + +export const Pagination = React.memo(PaginationComponent); + +Pagination.displayName = 'Pagination'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/pagination/use_pagination.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/pagination/use_pagination.test.ts similarity index 87% rename from packages/kbn-securitysolution-exception-list-components/src/pagination/use_pagination.test.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/pagination/use_pagination.test.ts index e90408f1e161b..2126ace9191b5 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/pagination/use_pagination.test.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/pagination/use_pagination.test.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { renderHook, act } from '@testing-library/react'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/pagination/use_pagination.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/pagination/use_pagination.ts similarity index 76% rename from packages/kbn-securitysolution-exception-list-components/src/pagination/use_pagination.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/pagination/use_pagination.ts index da96624f8b43a..289d5ebcaa268 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/pagination/use_pagination.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/pagination/use_pagination.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/partial_code_signature_callout/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/partial_code_signature_callout/index.tsx new file mode 100644 index 0000000000000..4339d95b6c4cb --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/partial_code_signature_callout/index.tsx @@ -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 { FormattedMessage } from '@kbn/i18n-react'; +import { i18n } from '@kbn/i18n'; + +import { EuiCallOut } from '@elastic/eui'; + +export const PartialCodeSignatureCallout = () => { + return ( + <EuiCallOut + title={i18n.translate('exceptionList-components.partialCodeSignatureCallout.title', { + defaultMessage: 'Please review your entries', + })} + iconType="warning" + color="warning" + size="s" + data-test-subj="partialCodeSignatureCallout" + > + <FormattedMessage + id="exceptionList-components.partialCodeSignatureCallout.body" + defaultMessage='Please review field values, as your filter criteria may be incomplete. We recommend both the signer name and trust status be included (using the "AND" operator) to avoid potential security gaps.' + tagName="p" + /> + </EuiCallOut> + ); +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/search_bar/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/search_bar/index.tsx new file mode 100644 index 0000000000000..dd36c16b9bd8d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/search_bar/index.tsx @@ -0,0 +1,122 @@ +/* + * 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 type { FC } from 'react'; + +import type { EuiSearchBarProps, IconType, SearchFilterConfig } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiButton, EuiSearchBar } from '@elastic/eui'; +import type { ExceptionListTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; +import type { GetExceptionItemProps } from '../types'; + +const ITEMS_SCHEMA = { + strict: true, + fields: { + created_by: { + type: 'string', + }, + description: { + type: 'string', + }, + id: { + type: 'string', + }, + item_id: { + type: 'string', + }, + list_id: { + type: 'string', + }, + name: { + type: 'string', + }, + os_types: { + type: 'string', + }, + tags: { + type: 'string', + }, + }, +}; +interface SearchBarProps { + addExceptionButtonText?: string; + placeholdertext?: string; + canAddException?: boolean; // TODO what is the default value + + // TODO: REFACTOR: not to send the listType and handle it in the Parent + // Exception list type used to determine what type of item is + // being created when "onAddExceptionClick" is invoked + listType: ExceptionListTypeEnum; + isSearching?: boolean; + dataTestSubj?: string; + filters?: SearchFilterConfig[]; // TODO about filters + isButtonFilled?: boolean; + buttonIconType?: IconType; + onSearch: (arg: GetExceptionItemProps) => void; + onAddExceptionClick: (type: ExceptionListTypeEnum) => void; +} +const SearchBarComponent: FC<SearchBarProps> = ({ + addExceptionButtonText, + placeholdertext, + canAddException, + listType, + isSearching, + dataTestSubj, + filters = [], + isButtonFilled = true, + buttonIconType, + onSearch, + onAddExceptionClick, +}) => { + const handleOnSearch = useCallback<NonNullable<EuiSearchBarProps['onChange']>>( + ({ queryText }): void => { + onSearch({ search: queryText }); + }, + [onSearch] + ); + + const handleAddException = useCallback(() => { + // TODO: ASK YARA why we need to send the listType + onAddExceptionClick(listType); + }, [onAddExceptionClick, listType]); + + return ( + <EuiFlexGroup alignItems="center"> + <EuiFlexItem grow={true}> + <EuiSearchBar + box={{ + placeholder: placeholdertext, + incremental: false, + schema: ITEMS_SCHEMA, + 'data-test-subj': `${dataTestSubj || ''}searchBar`, + }} + filters={filters} + onChange={handleOnSearch} + /> + </EuiFlexItem> + {!canAddException && ( + <EuiFlexItem grow={false}> + <EuiButton + data-test-subj={`${dataTestSubj || ''}Button`} + onClick={handleAddException} + isDisabled={isSearching} + fill={isButtonFilled} + iconType={buttonIconType} + > + {addExceptionButtonText} + </EuiButton> + </EuiFlexItem> + )} + </EuiFlexGroup> + ); +}; + +SearchBarComponent.displayName = 'SearchBarComponent'; + +export const SearchBar = React.memo(SearchBarComponent); + +SearchBar.displayName = 'SearchBar'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/search_bar/search_bar.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/search_bar/search_bar.test.tsx similarity index 88% rename from packages/kbn-securitysolution-exception-list-components/src/search_bar/search_bar.test.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/search_bar/search_bar.test.tsx index b1eadded0e3f8..a7eaa7ba47ad0 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/search_bar/search_bar.test.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/search_bar/search_bar.test.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/__snapshots__/text_with_edit.test.tsx.snap b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/__snapshots__/text_with_edit.test.tsx.snap similarity index 100% rename from packages/kbn-securitysolution-exception-list-components/src/text_with_edit/__snapshots__/text_with_edit.test.tsx.snap rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/__snapshots__/text_with_edit.test.tsx.snap diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/index.tsx new file mode 100644 index 0000000000000..1428dcfa238ea --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/index.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 React, { FC } from 'react'; +import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { Interpolation, Theme } from '@emotion/react'; +import { textWithEditContainerCss, editIconCss } from './text_with_edit.styles'; +interface TextWithEditProps { + isReadonly: boolean; + dataTestSubj?: string; + text: string; + textCss?: Interpolation<Theme>; + onEdit?: () => void; +} + +const TextWithEditComponent: FC<TextWithEditProps> = ({ + isReadonly, + dataTestSubj, + text, + onEdit, + textCss, +}) => { + return ( + <EuiFlexGroup css={textWithEditContainerCss}> + <EuiFlexItem grow={10}> + <span css={textCss} data-test-subj={`${dataTestSubj || ''}Text`}> + {text} + </span> + </EuiFlexItem> + <EuiFlexItem grow={false} css={editIconCss}> + {isReadonly ? null : ( + <EuiButtonIcon + data-test-subj={`${dataTestSubj || ''}EditIcon`} + aria-label="Edit Text List Header" + iconType="pencil" + onClick={() => (typeof onEdit === 'function' ? onEdit() : null)} + /> + )} + </EuiFlexItem> + </EuiFlexGroup> + ); +}; +TextWithEditComponent.displayName = 'TextWithEditComponent'; + +export const TextWithEdit = React.memo(TextWithEditComponent); + +TextWithEdit.displayName = 'TextWithEdit'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/text_with_edit.styles.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/text_with_edit.styles.ts new file mode 100644 index 0000000000000..d61aaab0f9be6 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/text_with_edit.styles.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 { css } from '@emotion/react'; +import { euiThemeVars } from '@kbn/ui-theme'; + +export const textWithEditContainerCss = css` + display: flex; + width: fit-content; + align-items: baseline; + padding-bottom: ${euiThemeVars.euiSizeS}; + h1 { + margin-bottom: 0; + } +`; +export const editIconCss = css` + button { + margin-left: -${euiThemeVars.euiSizeM}; + } +`; diff --git a/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/text_with_edit.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/text_with_edit.test.tsx similarity index 84% rename from packages/kbn-securitysolution-exception-list-components/src/text_with_edit/text_with_edit.test.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/text_with_edit.test.tsx index eab0eb7817d8c..24b5eec6e3350 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/text_with_edit.test.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/text_with_edit/text_with_edit.test.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { fireEvent, render } from '@testing-library/react'; @@ -35,6 +33,7 @@ describe('TextWithEdit', () => { isReadonly={false} dataTestSubj="TextWithEditTest" text="Test" + // eslint-disable-next-line @typescript-eslint/no-explicit-any onEdit={onEdit as any} /> ); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/translations.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/translations.ts new file mode 100644 index 0000000000000..5660ac3564c7d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/translations.ts @@ -0,0 +1,154 @@ +/* + * 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'; + +export const EMPTY_VIEWER_STATE_EMPTY_TITLE = i18n.translate( + 'exceptionList-components.empty.viewer.state.empty.title', + { + defaultMessage: 'Add exceptions to this list', + } +); + +export const EMPTY_VIEWER_STATE_EMPTY_BODY = i18n.translate( + 'exceptionList-components.empty.viewer.state.empty.body', + { + defaultMessage: 'There is no exception in your list. Create your first exception.', + } +); +export const EMPTY_VIEWER_STATE_EMPTY_SEARCH_TITLE = i18n.translate( + 'exceptionList-components.empty.viewer.state.empty_search.search.title', + { + defaultMessage: 'No results match your search criteria', + } +); + +export const EMPTY_VIEWER_STATE_EMPTY_SEARCH_BODY = i18n.translate( + 'exceptionList-components.empty.viewer.state.empty_search.body', + { + defaultMessage: 'Try modifying your search', + } +); + +export const EMPTY_VIEWER_STATE_EMPTY_VIEWER_BUTTON = (exceptionType: string) => + i18n.translate('exceptionList-components.empty.viewer.state.empty.viewer_button', { + values: { exceptionType }, + defaultMessage: 'Create {exceptionType} exception', + }); + +export const EMPTY_VIEWER_STATE_ERROR_TITLE = i18n.translate( + 'exceptionList-components.empty.viewer.state.error_title', + { + defaultMessage: 'Unable to load exception items', + } +); + +export const EMPTY_VIEWER_STATE_ERROR_BODY = i18n.translate( + 'exceptionList-components.empty.viewer.state.error_body', + { + defaultMessage: + 'There was an error loading the exception items. Contact your administrator for help.', + } +); +export const EXCEPTION_LIST_HEADER_EXPORT_ACTION = i18n.translate( + 'exceptionList-components.exception_list_header_export_action', + { + defaultMessage: 'Export exception list', + } +); +export const EXCEPTION_LIST_HEADER_DELETE_ACTION = i18n.translate( + 'exceptionList-components.exception_list_header_delete_action', + { + defaultMessage: 'Delete exception list', + } +); +export const EXCEPTION_LIST_HEADER_DUPLICATE_ACTION = i18n.translate( + 'exceptionList-components.exception_list_header_duplicate_action', + { + defaultMessage: 'Duplicate exception list', + } +); +export const EXCEPTION_LIST_HEADER_LINK_RULES_BUTTON = i18n.translate( + 'exceptionList-components.exception_list_header_link_rules_button', + { + defaultMessage: 'Link rules', + } +); + +export const EXCEPTION_LIST_HEADER_LINKED_RULES = (noOfRules: number) => + i18n.translate('exceptionList-components.exception_list_header_linked_rules', { + values: { noOfRules }, + defaultMessage: 'Linked to {noOfRules} rules', + }); + +export const EXCEPTION_LIST_HEADER_BREADCRUMB = i18n.translate( + 'exceptionList-components.exception_list_header_breadcrumb', + { + defaultMessage: 'Shared Exception Lists', + } +); + +export const EXCEPTION_LIST_HEADER_LIST_ID = i18n.translate( + 'exceptionList-components.exception_list_header_list_id', + { + defaultMessage: 'List ID', + } +); + +export const EXCEPTION_LIST_HEADER_NAME = i18n.translate( + 'exceptionList-components.exception_list_header_name', + { + defaultMessage: 'Add a name', + } +); + +export const EXCEPTION_LIST_HEADER_DESCRIPTION = i18n.translate( + 'exceptionList-components.exception_list_header_description', + { + defaultMessage: 'Add a description', + } +); + +export const EXCEPTION_LIST_HEADER_EDIT_MODAL_TITLE = (listName: string) => + i18n.translate('exceptionList-components.exception_list_header_edit_modal_name', { + defaultMessage: 'Edit {listName}', + values: { listName }, + }); + +export const EXCEPTION_LIST_HEADER_EDIT_MODAL_SAVE_BUTTON = i18n.translate( + 'exceptionList-components.exception_list_header_edit_modal_save_button', + { + defaultMessage: 'Save', + } +); + +export const EXCEPTION_LIST_HEADER_EDIT_MODAL_CANCEL_BUTTON = i18n.translate( + 'exceptionList-components.exception_list_header_edit_modal_cancel_button', + { + defaultMessage: 'Cancel', + } +); +export const EXCEPTION_LIST_HEADER_NAME_TEXTBOX = i18n.translate( + 'exceptionList-components.exception_list_header_Name_textbox', + { + defaultMessage: 'Name', + } +); + +export const EXCEPTION_LIST_HEADER_DESCRIPTION_TEXTBOX = i18n.translate( + 'exceptionList-components.exception_list_header_description_textbox', + { + defaultMessage: 'Description (optional)', + } +); + +export const LIST_NAME_REQUIRED_ERROR = i18n.translate( + 'exceptionList-components.exception_list_header_description_textboxexceptionList-components.exception_list_header_name_required_eror', + { + defaultMessage: 'List name cannot be empty', + } +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/types/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/types/index.ts new file mode 100644 index 0000000000000..d628cd0137972 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/types/index.ts @@ -0,0 +1,75 @@ +/* + * 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 { ListArray } from '@kbn/securitysolution-io-ts-list-types'; + +import type { Pagination } from '@elastic/eui'; +import type { NamespaceType } from '@kbn/securitysolution-io-ts-list-types'; + +export interface GetExceptionItemProps { + pagination?: PaginationProps['pagination']; + search?: string; + filters?: string; +} + +export interface PaginationProps { + dataTestSubj?: string; + ariaLabel?: string; + pagination: Pagination & { pageSize: number }; + onPaginationChange: (arg: GetExceptionItemProps) => void; +} + +export enum ViewerStatus { + ERROR = 'error', + EMPTY = 'empty', + EMPTY_SEARCH = 'empty_search', + LOADING = 'loading', + SEARCHING = 'searching', + DELETING = 'deleting', +} + +export interface ExceptionListSummaryProps { + pagination: Pagination; + // Corresponds to last time exception items were fetched + lastUpdated: string | number | null; +} + +export type ViewerFlyoutName = 'addException' | 'editException' | null; + +export interface RuleReferences { + [key: string]: RuleReference; +} + +export interface ExceptionListItemIdentifiers { + id: string; + name: string; + namespaceType: NamespaceType; +} + +export enum ListTypeText { + ENDPOINT = 'endpoint', + DETECTION = 'empty', + RULE_DEFAULT = 'empty_search', +} +export interface Rule { + name: string; + id: string; + rule_id: string; + exceptions_list?: ListArray; +} + +export interface RuleReference { + name: string; + id: string; + referenced_rules: Rule[]; + listId?: string; +} + +export interface ListDetails { + name: string; + description?: string; +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/index.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/index.ts diff --git a/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/use_value_with_space_warning.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/use_value_with_space_warning.test.ts similarity index 84% rename from packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/use_value_with_space_warning.test.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/use_value_with_space_warning.test.ts index 51954c0140e61..570399a5ecb23 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/use_value_with_space_warning.test.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/use_value_with_space_warning.test.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { renderHook } from '@testing-library/react'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/use_value_with_space_warning.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/use_value_with_space_warning.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/use_value_with_space_warning.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/use_value_with_space_warning.ts diff --git a/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/value_with_space_warning.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/value_with_space_warning.test.tsx similarity index 81% rename from packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/value_with_space_warning.test.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/value_with_space_warning.test.tsx index 8f780181e0528..a500f13af6e16 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/value_with_space_warning.test.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/value_with_space_warning.test.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/value_with_space_warning.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/value_with_space_warning.tsx similarity index 75% rename from packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/value_with_space_warning.tsx rename to x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/value_with_space_warning.tsx index c736982142b1e..c73a39a516ed8 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/value_with_space_warning.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/value_with_space_warning.tsx @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/wildcard_with_wrong_operator_callout/index.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/wildcard_with_wrong_operator_callout/index.tsx new file mode 100644 index 0000000000000..b21259f4ed895 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/src/wildcard_with_wrong_operator_callout/index.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 React from 'react'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { i18n } from '@kbn/i18n'; + +import { EuiCallOut } from '@elastic/eui'; + +export const WildCardWithWrongOperatorCallout = () => { + return ( + <EuiCallOut + title={i18n.translate('exceptionList-components.wildcardWithWrongOperatorCallout.title', { + defaultMessage: 'Please review your entries', + })} + iconType="warning" + color="warning" + size="s" + data-test-subj="wildcardWithWrongOperatorCallout" + > + <p> + <FormattedMessage + id="exceptionList-components.wildcardWithWrongOperatorCallout.body" + defaultMessage='Using a "*" or a "?" in the value with the "is" operator can make the entry ineffective. {operator} to "{matches}" to ensure wildcards run properly.' + values={{ + operator: ( + <strong> + {i18n.translate( + 'exceptionList-components.wildcardWithWrongOperatorCallout.changeTheOperator', + { defaultMessage: 'Change the operator' } + )} + </strong> + ), + matches: ( + <strong> + {i18n.translate( + 'exceptionList-components.wildcardWithWrongOperatorCallout.matches', + { defaultMessage: 'matches' } + )} + </strong> + ), + }} + /> + </p> + </EuiCallOut> + ); +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/tsconfig.json b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/tsconfig.json new file mode 100644 index 0000000000000..5378a8fbdfe1a --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components/tsconfig.json @@ -0,0 +1,27 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react", + "@emotion/react/types/css-prop" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + "**/*.d.ts" + ], + "kbn_references": [ + "@kbn/securitysolution-io-ts-list-types", + "@kbn/securitysolution-autocomplete", + "@kbn/ui-theme", + "@kbn/i18n", + "@kbn/i18n-react", + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/packages/kbn-securitysolution-exceptions-common/README.md b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/README.md similarity index 100% rename from packages/kbn-securitysolution-exceptions-common/README.md rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/README.md diff --git a/packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.gen.ts similarity index 78% rename from packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.gen.ts index a9acaee37cefa..2c7dc29dd182a 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.schema.yaml similarity index 77% rename from packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.schema.yaml index 5925d0bd923c0..e4aa39a5db30f 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list/create_exception_list.schema.yaml @@ -59,29 +59,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 409: description: Exception list already exists response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.gen.ts similarity index 85% rename from packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.gen.ts index 9adf64b6b083f..dba75c11fde83 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.schema.yaml similarity index 76% rename from packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.schema.yaml index 47fa2895d27c6..a86c6a21e25ed 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_exception_list_item/create_exception_list_item.schema.yaml @@ -69,32 +69,32 @@ paths: application/json: schema: oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 409: description: Exception list item already exists response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' components: x-codegen-enabled: true @@ -103,7 +103,7 @@ components: type: object properties: comment: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' required: - comment diff --git a/packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.gen.ts similarity index 88% rename from packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.gen.ts index 77437ff51618c..e2fa379cdc528 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.schema.yaml similarity index 76% rename from packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.schema.yaml index 6162d00d78ae8..246c8de363a68 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_rule_exceptions/create_rule_exceptions.schema.yaml @@ -9,7 +9,7 @@ paths: operationId: CreateRuleExceptionListItems x-codegen-enabled: true summary: Create rule exception list items - description: Create exception items that apply to a single detection rule. + description: Create exception items that apply to a single detection rule. parameters: - name: id in: path @@ -45,37 +45,37 @@ paths: application/json: schema: oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' components: schemas: RuleId: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/UUID' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/UUID' CreateRuleExceptionListItemComment: type: object properties: comment: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' required: - comment diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.gen.ts new file mode 100644 index 0000000000000..07650ee2d0c01 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.gen.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Create shared exception list API endpoint + * version: 2023-10-31 + */ + +import { z } from '@kbn/zod'; + +import { + ExceptionListName, + ExceptionListDescription, + ExceptionList, +} from '../model/exception_list_common.gen'; + +export type CreateSharedExceptionListRequestBody = z.infer< + typeof CreateSharedExceptionListRequestBody +>; +export const CreateSharedExceptionListRequestBody = z.object({ + name: ExceptionListName, + description: ExceptionListDescription, +}); +export type CreateSharedExceptionListRequestBodyInput = z.input< + typeof CreateSharedExceptionListRequestBody +>; + +export type CreateSharedExceptionListResponse = z.infer<typeof CreateSharedExceptionListResponse>; +export const CreateSharedExceptionListResponse = ExceptionList; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.schema.yaml new file mode 100644 index 0000000000000..5ac7e8e78ccbb --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/create_shared_exceptions_list/create_shared_exceptions_list.schema.yaml @@ -0,0 +1,68 @@ +openapi: 3.0.0 +info: + title: Create shared exception list API endpoint + version: '2023-10-31' +paths: + /api/exceptions/shared: + post: + x-labels: [serverless, ess] + operationId: CreateSharedExceptionList + x-codegen-enabled: true + summary: Create a shared exception list + description: | + An exception list groups exception items and can be associated with detection rules. A shared exception list can apply to multiple detection rules. + > info + > All exception items added to the same list are evaluated using `OR` logic. That is, if any of the items in a list evaluate to `true`, the exception prevents the rule from generating an alert. Likewise, `OR` logic is used for evaluating exceptions when more than one exception list is assigned to a rule. To use the `AND` operator, you can define multiple clauses (`entries`) in a single exception item. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListName' + description: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListDescription' + required: + - name + - description + responses: + 200: + description: Successful response + content: + application/json: + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionList' + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 409: + description: Exception list already exists response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.gen.ts similarity index 75% rename from packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.gen.ts index a12512aab1374..0842dc7c74637 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.schema.yaml new file mode 100644 index 0000000000000..709afe0fdff6b --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list/delete_exception_list.schema.yaml @@ -0,0 +1,70 @@ +openapi: 3.0.0 +info: + title: Delete exception list API endpoint + version: '2023-10-31' +paths: + /api/exception_lists: + delete: + x-labels: [serverless, ess] + operationId: DeleteExceptionList + x-codegen-enabled: true + summary: Delete an exception list + description: Delete an exception list using the `id` or `list_id` field. + parameters: + - name: id + in: query + required: false + description: Either `id` or `list_id` must be specified + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListId' + - name: list_id + in: query + required: false + description: Either `id` or `list_id` must be specified + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListHumanId' + - name: namespace_type + in: query + required: false + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionNamespaceType' + default: single + responses: + 200: + description: Successful response + content: + application/json: + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionList' + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 404: + description: Exception list not found response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.gen.ts similarity index 76% rename from packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.gen.ts index a93af0cf3d4c2..429568c33f1c6 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.schema.yaml new file mode 100644 index 0000000000000..22344db77f619 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/delete_exception_list_item/delete_exception_list_item.schema.yaml @@ -0,0 +1,70 @@ +openapi: 3.0.0 +info: + title: Delete exception list item API endpoint + version: '2023-10-31' +paths: + /api/exception_lists/items: + delete: + x-labels: [serverless, ess] + operationId: DeleteExceptionListItem + x-codegen-enabled: true + summary: Delete an exception list item + description: Delete an exception list item using the `id` or `item_id` field. + parameters: + - name: id + in: query + required: false + description: Either `id` or `item_id` must be specified + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListItemId' + - name: item_id + in: query + required: false + description: Either `id` or `item_id` must be specified + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListItemHumanId' + - name: namespace_type + in: query + required: false + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionNamespaceType' + default: single + responses: + 200: + description: Successful response + content: + application/json: + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListItem' + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 404: + description: Exception list item not found response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.gen.ts similarity index 75% rename from packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.gen.ts index 61de17abe06f8..d259d37b23487 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.schema.yaml new file mode 100644 index 0000000000000..a758d2856123b --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/duplicate_exception_list/duplicate_exception_list.schema.yaml @@ -0,0 +1,71 @@ +openapi: 3.0.0 +info: + title: Duplicate exception list API endpoint + version: '2023-10-31' +paths: + /api/exception_lists/_duplicate: + post: + x-labels: [serverless, ess] + operationId: DuplicateExceptionList + x-codegen-enabled: true + summary: Duplicate an exception list + description: Duplicate an existing exception list. + parameters: + - name: list_id + in: query + required: true + description: Exception list's human identifier + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListHumanId' + - name: namespace_type + in: query + required: true + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionNamespaceType' + - name: include_expired_exceptions + in: query + required: true + description: Determines whether to include expired exceptions in the exported list + schema: + type: string + enum: ['true', 'false'] + default: 'true' + responses: + 200: + description: Successful response + content: + application/json: + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionList' + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 405: + description: Exception list to duplicate not found response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.gen.ts new file mode 100644 index 0000000000000..280884c7d749d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.gen.ts @@ -0,0 +1,41 @@ +/* + * 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. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Export exception list API endpoint + * version: 2023-10-31 + */ + +import { z } from '@kbn/zod'; + +import { + ExceptionListId, + ExceptionListHumanId, + ExceptionNamespaceType, +} from '../model/exception_list_common.gen'; + +export type ExportExceptionListRequestQuery = z.infer<typeof ExportExceptionListRequestQuery>; +export const ExportExceptionListRequestQuery = z.object({ + /** + * Exception list's identifier + */ + id: ExceptionListId, + /** + * Exception list's human identifier + */ + list_id: ExceptionListHumanId, + namespace_type: ExceptionNamespaceType, + /** + * Determines whether to include expired exceptions in the exported list + */ + include_expired_exceptions: z.enum(['true', 'false']).default('true'), +}); +export type ExportExceptionListRequestQueryInput = z.input<typeof ExportExceptionListRequestQuery>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.schema.yaml new file mode 100644 index 0000000000000..2d5242131adbe --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/export_exception_list/export_exception_list.schema.yaml @@ -0,0 +1,79 @@ +openapi: 3.0.0 +info: + title: Export exception list API endpoint + version: '2023-10-31' +paths: + /api/exception_lists/_export: + post: + x-labels: [serverless, ess] + operationId: ExportExceptionList + x-codegen-enabled: true + summary: Export an exception list + description: Export an exception list and its associated items to an NDJSON file. + parameters: + - name: id + in: query + required: true + description: Exception list's identifier + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListId' + - name: list_id + in: query + required: true + description: Exception list's human identifier + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListHumanId' + - name: namespace_type + in: query + required: true + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionNamespaceType' + - name: include_expired_exceptions + in: query + required: true + description: Determines whether to include expired exceptions in the exported list + schema: + type: string + enum: ['true', 'false'] + default: 'true' + responses: + 200: + description: Successful response + content: + application/ndjson: + schema: + type: string + format: binary + description: A `.ndjson` file containing specified exception list and its items + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 404: + description: Exception list not found response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.gen.ts similarity index 86% rename from packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.gen.ts index 99ed1b3a31ddc..d7606bbccff37 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.schema.yaml similarity index 75% rename from packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.schema.yaml index e40f780af03ef..fc76802492420 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_list_items/find_exception_list_items.schema.yaml @@ -65,7 +65,7 @@ paths: required: false description: Determines which field is used to sort the results schema: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - name: sort_order in: query required: false @@ -107,34 +107,34 @@ paths: application/json: schema: oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: Exception list not found response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' components: schemas: FindExceptionListItemsFilter: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' diff --git a/packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.gen.ts similarity index 85% rename from packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.gen.ts index 83a68b4232e8b..82f5de2f5a157 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.schema.yaml similarity index 80% rename from packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.schema.yaml index c46dacbab01d0..e5ef4f83a1343 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/find_exception_lists/find_exception_lists.schema.yaml @@ -93,26 +93,26 @@ paths: application/json: schema: oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' components: schemas: diff --git a/packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.gen.ts similarity index 86% rename from packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.gen.ts index ea24803e79456..738ce79dd97d0 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.schema.yaml similarity index 83% rename from packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.schema.yaml index 8ae3ac1aa2c0c..75778f07c0c8e 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/import_exceptions/import_exceptions.schema.yaml @@ -92,26 +92,26 @@ paths: application/json: schema: oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' components: schemas: diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/index.ts new file mode 100644 index 0000000000000..014fe58cfce09 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/index.ts @@ -0,0 +1,25 @@ +/* + * 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. + */ + +export * from './model/exception_list_common.gen'; +export * from './model/exception_list_item_entry.gen'; +export * from './create_exception_list_item/create_exception_list_item.gen'; +export * from './create_rule_exceptions/create_rule_exceptions.gen'; +export * from './create_shared_exceptions_list/create_shared_exceptions_list.gen'; +export * from './create_exception_list/create_exception_list.gen'; +export * from './delete_exception_list_item/delete_exception_list_item.gen'; +export * from './delete_exception_list/delete_exception_list.gen'; +export * from './duplicate_exception_list/duplicate_exception_list.gen'; +export * from './export_exception_list/export_exception_list.gen'; +export * from './find_exception_list_items/find_exception_list_items.gen'; +export * from './find_exception_lists/find_exception_lists.gen'; +export * from './import_exceptions/import_exceptions.gen'; +export * from './read_exception_list_item/read_exception_list_item.gen'; +export * from './read_exception_list/read_exception_list.gen'; +export * from './read_exception_list_summary/read_exception_list_summary.gen'; +export * from './update_exception_list_item/update_exception_list_item.gen'; +export * from './update_exception_list/update_exception_list.gen'; diff --git a/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.gen.ts similarity index 94% rename from packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.gen.ts index 1f2d9e7387da3..2ee44afa69b9f 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.schema.yaml similarity index 81% rename from packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.schema.yaml index ebcecc9c916f7..8d8cdf82b6d94 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_common.schema.yaml @@ -7,10 +7,10 @@ components: x-codegen-enabled: true schemas: ExceptionListId: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' ExceptionListHumanId: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' description: Human readable string identifier, e.g. `trusted-linux-processes` ExceptionListType: @@ -122,17 +122,17 @@ components: - updated_by ExceptionListItemId: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' ExceptionListItemHumanId: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' ExceptionListItemType: type: string enum: [simple] ExceptionListItemName: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' ExceptionListItemDescription: type: string @@ -144,7 +144,7 @@ components: ExceptionListItemTags: type: array items: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' ExceptionListItemOsType: type: string @@ -162,19 +162,19 @@ components: type: object properties: id: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' comment: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' created_at: type: string format: date-time created_by: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' updated_at: type: string format: date-time updated_by: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' required: - id - comment @@ -278,7 +278,7 @@ components: comments: $ref: '#/components/schemas/ExceptionListItemCommentArray' version: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' tie_breaker_id: type: string created_at: diff --git a/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.gen.ts similarity index 90% rename from packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.gen.ts index 0b7f0233ba429..272e5e7d6c356 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.schema.yaml new file mode 100644 index 0000000000000..73fe9ea229bc3 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/model/exception_list_item_entry.schema.yaml @@ -0,0 +1,147 @@ +openapi: 3.0.0 +info: + title: Common Exception List Item Entry Attributes + version: 'not applicable' +paths: {} +components: + x-codegen-enabled: true + schemas: + ExceptionListItemEntryOperator: + type: string + enum: [excluded, included] + + ExceptionListItemEntryMatch: + type: object + properties: + type: + type: string + enum: [match] + field: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + value: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + operator: + $ref: '#/components/schemas/ExceptionListItemEntryOperator' + required: + - type + - field + - value + - operator + + ExceptionListItemEntryMatchAny: + type: object + properties: + type: + type: string + enum: [match_any] + field: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + value: + type: array + items: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + minItems: 1 + operator: + $ref: '#/components/schemas/ExceptionListItemEntryOperator' + required: + - type + - field + - value + - operator + + ExceptionListItemEntryList: + type: object + properties: + type: + type: string + enum: [list] + field: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + list: + type: object + properties: + id: + $ref: '../../../kbn-securitysolution-lists-common/api/model/list_common.schema.yaml#/components/schemas/ListId' + type: + $ref: '../../../kbn-securitysolution-lists-common/api/model/list_common.schema.yaml#/components/schemas/ListType' + required: [id, type] + operator: + $ref: '#/components/schemas/ExceptionListItemEntryOperator' + required: + - type + - field + - list + - operator + + ExceptionListItemEntryExists: + type: object + properties: + type: + type: string + enum: [exists] + field: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + operator: + $ref: '#/components/schemas/ExceptionListItemEntryOperator' + required: + - type + - field + - operator + + ExceptionListItemEntryNestedEntryItem: + oneOf: + - $ref: '#/components/schemas/ExceptionListItemEntryMatch' + - $ref: '#/components/schemas/ExceptionListItemEntryMatchAny' + - $ref: '#/components/schemas/ExceptionListItemEntryExists' + + ExceptionListItemEntryNested: + type: object + properties: + type: + type: string + enum: [nested] + field: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + entries: + type: array + items: + $ref: '#/components/schemas/ExceptionListItemEntryNestedEntryItem' + minItems: 1 + required: + - type + - field + - entries + + ExceptionListItemEntryMatchWildcard: + type: object + properties: + type: + type: string + enum: [wildcard] + field: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + value: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + operator: + $ref: '#/components/schemas/ExceptionListItemEntryOperator' + required: + - type + - field + - value + - operator + + ExceptionListItemEntry: + discriminator: + propertyName: type + anyOf: + - $ref: '#/components/schemas/ExceptionListItemEntryMatch' + - $ref: '#/components/schemas/ExceptionListItemEntryMatchAny' + - $ref: '#/components/schemas/ExceptionListItemEntryList' + - $ref: '#/components/schemas/ExceptionListItemEntryExists' + - $ref: '#/components/schemas/ExceptionListItemEntryNested' + - $ref: '#/components/schemas/ExceptionListItemEntryMatchWildcard' + + ExceptionListItemEntryArray: + type: array + items: + $ref: '#/components/schemas/ExceptionListItemEntry' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/quickstart_client.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/quickstart_client.gen.ts new file mode 100644 index 0000000000000..bfa84f18fa7c2 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/quickstart_client.gen.ts @@ -0,0 +1,425 @@ +/* + * 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. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Exceptions API client for quickstart + * version: Bundle (no version) + */ + +import type { KbnClient } from '@kbn/test'; +import { ToolingLog } from '@kbn/tooling-log'; +import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; +import { replaceParams } from '@kbn/openapi-common/shared'; +import { catchAxiosErrorFormatAndThrow } from '@kbn/securitysolution-utils'; + +import type { + CreateExceptionListItemRequestBodyInput, + CreateExceptionListItemResponse, +} from './create_exception_list_item/create_exception_list_item.gen'; +import type { + CreateExceptionListRequestBodyInput, + CreateExceptionListResponse, +} from './create_exception_list/create_exception_list.gen'; +import type { + CreateRuleExceptionListItemsRequestParamsInput, + CreateRuleExceptionListItemsRequestBodyInput, + CreateRuleExceptionListItemsResponse, +} from './create_rule_exceptions/create_rule_exceptions.gen'; +import type { + CreateSharedExceptionListRequestBodyInput, + CreateSharedExceptionListResponse, +} from './create_shared_exceptions_list/create_shared_exceptions_list.gen'; +import type { + DeleteExceptionListItemRequestQueryInput, + DeleteExceptionListItemResponse, +} from './delete_exception_list_item/delete_exception_list_item.gen'; +import type { + DeleteExceptionListRequestQueryInput, + DeleteExceptionListResponse, +} from './delete_exception_list/delete_exception_list.gen'; +import type { + DuplicateExceptionListRequestQueryInput, + DuplicateExceptionListResponse, +} from './duplicate_exception_list/duplicate_exception_list.gen'; +import type { ExportExceptionListRequestQueryInput } from './export_exception_list/export_exception_list.gen'; +import type { + FindExceptionListItemsRequestQueryInput, + FindExceptionListItemsResponse, +} from './find_exception_list_items/find_exception_list_items.gen'; +import type { + FindExceptionListsRequestQueryInput, + FindExceptionListsResponse, +} from './find_exception_lists/find_exception_lists.gen'; +import type { + ImportExceptionListRequestQueryInput, + ImportExceptionListResponse, +} from './import_exceptions/import_exceptions.gen'; +import type { + ReadExceptionListItemRequestQueryInput, + ReadExceptionListItemResponse, +} from './read_exception_list_item/read_exception_list_item.gen'; +import type { + ReadExceptionListSummaryRequestQueryInput, + ReadExceptionListSummaryResponse, +} from './read_exception_list_summary/read_exception_list_summary.gen'; +import type { + ReadExceptionListRequestQueryInput, + ReadExceptionListResponse, +} from './read_exception_list/read_exception_list.gen'; +import type { + UpdateExceptionListItemRequestBodyInput, + UpdateExceptionListItemResponse, +} from './update_exception_list_item/update_exception_list_item.gen'; +import type { + UpdateExceptionListRequestBodyInput, + UpdateExceptionListResponse, +} from './update_exception_list/update_exception_list.gen'; + +export interface ClientOptions { + kbnClient: KbnClient; + log: ToolingLog; +} + +export class Client { + readonly kbnClient: KbnClient; + readonly log: ToolingLog; + + constructor(options: ClientOptions) { + this.kbnClient = options.kbnClient; + this.log = options.log; + } + /** + * An exception list groups exception items and can be associated with detection rules. You can assign detection rules with multiple exception lists. +> info +> All exception items added to the same list are evaluated using `OR` logic. That is, if any of the items in a list evaluate to `true`, the exception prevents the rule from generating an alert. Likewise, `OR` logic is used for evaluating exceptions when more than one exception list is assigned to a rule. To use the `AND` operator, you can define multiple clauses (`entries`) in a single exception item. + + */ + async createExceptionList(props: CreateExceptionListProps) { + this.log.info(`${new Date().toISOString()} Calling API CreateExceptionList`); + return this.kbnClient + .request<CreateExceptionListResponse>({ + path: '/api/exception_lists', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'POST', + body: props.body, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Create an exception item and associate it with the specified exception list. +> info +> Before creating exception items, you must create an exception list. + + */ + async createExceptionListItem(props: CreateExceptionListItemProps) { + this.log.info(`${new Date().toISOString()} Calling API CreateExceptionListItem`); + return this.kbnClient + .request<CreateExceptionListItemResponse>({ + path: '/api/exception_lists/items', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'POST', + body: props.body, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Create exception items that apply to a single detection rule. + */ + async createRuleExceptionListItems(props: CreateRuleExceptionListItemsProps) { + this.log.info(`${new Date().toISOString()} Calling API CreateRuleExceptionListItems`); + return this.kbnClient + .request<CreateRuleExceptionListItemsResponse>({ + path: replaceParams('/api/detection_engine/rules/{id}/exceptions', props.params), + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'POST', + body: props.body, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * An exception list groups exception items and can be associated with detection rules. A shared exception list can apply to multiple detection rules. +> info +> All exception items added to the same list are evaluated using `OR` logic. That is, if any of the items in a list evaluate to `true`, the exception prevents the rule from generating an alert. Likewise, `OR` logic is used for evaluating exceptions when more than one exception list is assigned to a rule. To use the `AND` operator, you can define multiple clauses (`entries`) in a single exception item. + + */ + async createSharedExceptionList(props: CreateSharedExceptionListProps) { + this.log.info(`${new Date().toISOString()} Calling API CreateSharedExceptionList`); + return this.kbnClient + .request<CreateSharedExceptionListResponse>({ + path: '/api/exceptions/shared', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'POST', + body: props.body, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Delete an exception list using the `id` or `list_id` field. + */ + async deleteExceptionList(props: DeleteExceptionListProps) { + this.log.info(`${new Date().toISOString()} Calling API DeleteExceptionList`); + return this.kbnClient + .request<DeleteExceptionListResponse>({ + path: '/api/exception_lists', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'DELETE', + + query: props.query, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Delete an exception list item using the `id` or `item_id` field. + */ + async deleteExceptionListItem(props: DeleteExceptionListItemProps) { + this.log.info(`${new Date().toISOString()} Calling API DeleteExceptionListItem`); + return this.kbnClient + .request<DeleteExceptionListItemResponse>({ + path: '/api/exception_lists/items', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'DELETE', + + query: props.query, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Duplicate an existing exception list. + */ + async duplicateExceptionList(props: DuplicateExceptionListProps) { + this.log.info(`${new Date().toISOString()} Calling API DuplicateExceptionList`); + return this.kbnClient + .request<DuplicateExceptionListResponse>({ + path: '/api/exception_lists/_duplicate', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'POST', + + query: props.query, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Export an exception list and its associated items to an NDJSON file. + */ + async exportExceptionList(props: ExportExceptionListProps) { + this.log.info(`${new Date().toISOString()} Calling API ExportExceptionList`); + return this.kbnClient + .request({ + path: '/api/exception_lists/_export', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'POST', + + query: props.query, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Get a list of all exception list items in the specified list. + */ + async findExceptionListItems(props: FindExceptionListItemsProps) { + this.log.info(`${new Date().toISOString()} Calling API FindExceptionListItems`); + return this.kbnClient + .request<FindExceptionListItemsResponse>({ + path: '/api/exception_lists/items/_find', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'GET', + + query: props.query, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Get a list of all exception lists. + */ + async findExceptionLists(props: FindExceptionListsProps) { + this.log.info(`${new Date().toISOString()} Calling API FindExceptionLists`); + return this.kbnClient + .request<FindExceptionListsResponse>({ + path: '/api/exception_lists/_find', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'GET', + + query: props.query, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Import an exception list and its associated items from an NDJSON file. + */ + async importExceptionList(props: ImportExceptionListProps) { + this.log.info(`${new Date().toISOString()} Calling API ImportExceptionList`); + return this.kbnClient + .request<ImportExceptionListResponse>({ + path: '/api/exception_lists/_import', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'POST', + body: props.attachment, + query: props.query, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Get the details of an exception list using the `id` or `list_id` field. + */ + async readExceptionList(props: ReadExceptionListProps) { + this.log.info(`${new Date().toISOString()} Calling API ReadExceptionList`); + return this.kbnClient + .request<ReadExceptionListResponse>({ + path: '/api/exception_lists', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'GET', + + query: props.query, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Get the details of an exception list item using the `id` or `item_id` field. + */ + async readExceptionListItem(props: ReadExceptionListItemProps) { + this.log.info(`${new Date().toISOString()} Calling API ReadExceptionListItem`); + return this.kbnClient + .request<ReadExceptionListItemResponse>({ + path: '/api/exception_lists/items', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'GET', + + query: props.query, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Get a summary of the specified exception list. + */ + async readExceptionListSummary(props: ReadExceptionListSummaryProps) { + this.log.info(`${new Date().toISOString()} Calling API ReadExceptionListSummary`); + return this.kbnClient + .request<ReadExceptionListSummaryResponse>({ + path: '/api/exception_lists/summary', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'GET', + + query: props.query, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Update an exception list using the `id` or `list_id` field. + */ + async updateExceptionList(props: UpdateExceptionListProps) { + this.log.info(`${new Date().toISOString()} Calling API UpdateExceptionList`); + return this.kbnClient + .request<UpdateExceptionListResponse>({ + path: '/api/exception_lists', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'PUT', + body: props.body, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Update an exception list item using the `id` or `item_id` field. + */ + async updateExceptionListItem(props: UpdateExceptionListItemProps) { + this.log.info(`${new Date().toISOString()} Calling API UpdateExceptionListItem`); + return this.kbnClient + .request<UpdateExceptionListItemResponse>({ + path: '/api/exception_lists/items', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'PUT', + body: props.body, + }) + .catch(catchAxiosErrorFormatAndThrow); + } +} + +export interface CreateExceptionListProps { + body: CreateExceptionListRequestBodyInput; +} +export interface CreateExceptionListItemProps { + body: CreateExceptionListItemRequestBodyInput; +} +export interface CreateRuleExceptionListItemsProps { + params: CreateRuleExceptionListItemsRequestParamsInput; + body: CreateRuleExceptionListItemsRequestBodyInput; +} +export interface CreateSharedExceptionListProps { + body: CreateSharedExceptionListRequestBodyInput; +} +export interface DeleteExceptionListProps { + query: DeleteExceptionListRequestQueryInput; +} +export interface DeleteExceptionListItemProps { + query: DeleteExceptionListItemRequestQueryInput; +} +export interface DuplicateExceptionListProps { + query: DuplicateExceptionListRequestQueryInput; +} +export interface ExportExceptionListProps { + query: ExportExceptionListRequestQueryInput; +} +export interface FindExceptionListItemsProps { + query: FindExceptionListItemsRequestQueryInput; +} +export interface FindExceptionListsProps { + query: FindExceptionListsRequestQueryInput; +} +export interface ImportExceptionListProps { + query: ImportExceptionListRequestQueryInput; + attachment: FormData; +} +export interface ReadExceptionListProps { + query: ReadExceptionListRequestQueryInput; +} +export interface ReadExceptionListItemProps { + query: ReadExceptionListItemRequestQueryInput; +} +export interface ReadExceptionListSummaryProps { + query: ReadExceptionListSummaryRequestQueryInput; +} +export interface UpdateExceptionListProps { + body: UpdateExceptionListRequestBodyInput; +} +export interface UpdateExceptionListItemProps { + body: UpdateExceptionListItemRequestBodyInput; +} diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.gen.ts new file mode 100644 index 0000000000000..87db0f9e75623 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.gen.ts @@ -0,0 +1,41 @@ +/* + * 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. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Read exception list API endpoint + * version: 2023-10-31 + */ + +import { z } from '@kbn/zod'; + +import { + ExceptionListId, + ExceptionListHumanId, + ExceptionNamespaceType, + ExceptionList, +} from '../model/exception_list_common.gen'; + +export type ReadExceptionListRequestQuery = z.infer<typeof ReadExceptionListRequestQuery>; +export const ReadExceptionListRequestQuery = z.object({ + /** + * Either `id` or `list_id` must be specified + */ + id: ExceptionListId.optional(), + /** + * Either `id` or `list_id` must be specified + */ + list_id: ExceptionListHumanId.optional(), + namespace_type: ExceptionNamespaceType.optional().default('single'), +}); +export type ReadExceptionListRequestQueryInput = z.input<typeof ReadExceptionListRequestQuery>; + +export type ReadExceptionListResponse = z.infer<typeof ReadExceptionListResponse>; +export const ReadExceptionListResponse = ExceptionList; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.schema.yaml new file mode 100644 index 0000000000000..001c56a3eafb4 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list/read_exception_list.schema.yaml @@ -0,0 +1,70 @@ +openapi: 3.0.0 +info: + title: Read exception list API endpoint + version: '2023-10-31' +paths: + /api/exception_lists: + get: + x-labels: [serverless, ess] + operationId: ReadExceptionList + x-codegen-enabled: true + summary: Get exception list details + description: Get the details of an exception list using the `id` or `list_id` field. + parameters: + - name: id + in: query + required: false + description: Either `id` or `list_id` must be specified + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListId' + - name: list_id + in: query + required: false + description: Either `id` or `list_id` must be specified + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListHumanId' + - name: namespace_type + in: query + required: false + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionNamespaceType' + default: single + responses: + 200: + description: Successful response + content: + application/json: + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionList' + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 404: + description: Exception list item not found response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.gen.ts similarity index 75% rename from packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.gen.ts index 4de512301cd83..02f6d10558389 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.schema.yaml new file mode 100644 index 0000000000000..82cac05e97813 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_item/read_exception_list_item.schema.yaml @@ -0,0 +1,70 @@ +openapi: 3.0.0 +info: + title: Read exception list item API endpoint + version: '2023-10-31' +paths: + /api/exception_lists/items: + get: + x-labels: [serverless, ess] + operationId: ReadExceptionListItem + x-codegen-enabled: true + summary: Get an exception list item + description: Get the details of an exception list item using the `id` or `item_id` field. + parameters: + - name: id + in: query + required: false + description: Either `id` or `item_id` must be specified + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListItemId' + - name: item_id + in: query + required: false + description: Either `id` or `item_id` must be specified + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListItemHumanId' + - name: namespace_type + in: query + required: false + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionNamespaceType' + default: single + responses: + 200: + description: Successful response + content: + application/json: + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListItem' + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 404: + description: Exception list item not found response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.gen.ts similarity index 79% rename from packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.gen.ts index 3e3230dddb0aa..8807f4b7e7812 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.schema.yaml new file mode 100644 index 0000000000000..fe6bb93b9cdb9 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/read_exception_list_summary/read_exception_list_summary.schema.yaml @@ -0,0 +1,89 @@ +openapi: 3.0.0 +info: + title: Read exception list summary API endpoint + version: '2023-10-31' +paths: + /api/exception_lists/summary: + get: + x-labels: [serverless, ess] + operationId: ReadExceptionListSummary + x-codegen-enabled: true + summary: Get an exception list summary + description: Get a summary of the specified exception list. + parameters: + - name: id + in: query + required: false + description: Exception list's identifier generated upon creation + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListId' + - name: list_id + in: query + required: false + description: Exception list's human readable identifier + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionListHumanId' + - name: namespace_type + in: query + required: false + schema: + $ref: '../model/exception_list_common.schema.yaml#/components/schemas/ExceptionNamespaceType' + default: single + - name: filter + in: query + required: false + description: Search filter clause + schema: + type: string + responses: + 200: + description: Successful response + content: + application/json: + schema: + type: object + properties: + windows: + type: integer + minimum: 0 + linux: + type: integer + minimum: 0 + macos: + type: integer + minimum: 0 + total: + type: integer + minimum: 0 + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 404: + description: Exception list not found response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.gen.ts similarity index 79% rename from packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.gen.ts index 2f38661cc9587..fb5fde05dcc85 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.schema.yaml similarity index 75% rename from packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.schema.yaml index 5e8f3dfd8b509..5a07623f4c937 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list/update_exception_list.schema.yaml @@ -59,29 +59,29 @@ paths: application/json: schema: oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: Exception list not found response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.gen.ts similarity index 86% rename from packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.gen.ts index 651c1dc1f2d49..791af5f65e35f 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.schema.yaml similarity index 75% rename from packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.schema.yaml index 2b8182aeb5c34..d6021768492c5 100644 --- a/packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/update_exception_list_item/update_exception_list_item.schema.yaml @@ -70,32 +70,32 @@ paths: application/json: schema: oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 404: description: Exception list item not found response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' components: x-codegen-enabled: true @@ -104,9 +104,9 @@ components: type: object properties: id: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' comment: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' required: - comment diff --git a/packages/kbn-securitysolution-exceptions-common/docs/openapi/ess/security_solution_exceptions_api_2023_10_31.bundled.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/docs/openapi/ess/security_solution_exceptions_api_2023_10_31.bundled.schema.yaml similarity index 100% rename from packages/kbn-securitysolution-exceptions-common/docs/openapi/ess/security_solution_exceptions_api_2023_10_31.bundled.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/docs/openapi/ess/security_solution_exceptions_api_2023_10_31.bundled.schema.yaml diff --git a/packages/kbn-securitysolution-exceptions-common/docs/openapi/serverless/security_solution_exceptions_api_2023_10_31.bundled.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/docs/openapi/serverless/security_solution_exceptions_api_2023_10_31.bundled.schema.yaml similarity index 100% rename from packages/kbn-securitysolution-exceptions-common/docs/openapi/serverless/security_solution_exceptions_api_2023_10_31.bundled.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/docs/openapi/serverless/security_solution_exceptions_api_2023_10_31.bundled.schema.yaml diff --git a/packages/kbn-securitysolution-exceptions-common/kibana.jsonc b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/kibana.jsonc similarity index 100% rename from packages/kbn-securitysolution-exceptions-common/kibana.jsonc rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/kibana.jsonc diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/package.json b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/package.json new file mode 100644 index 0000000000000..e68c27982b295 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/package.json @@ -0,0 +1,11 @@ +{ + "description": "Security Solution Exceptions common package", + "license": "Elastic License 2.0", + "name": "@kbn/securitysolution-exceptions-common", + "private": true, + "version": "1.0.0", + "scripts": { + "openapi:generate": "node scripts/openapi_generate", + "openapi:bundle": "node scripts/openapi_bundle" + } +} diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle.js b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle.js new file mode 100644 index 0000000000000..996c55ce307d9 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle.js @@ -0,0 +1,39 @@ +/* + * 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. + */ + +require('../../../../../../src/setup_node_env'); +// eslint-disable-next-line import/no-nodejs-modules +const { join, resolve } = require('path'); +const { bundle } = require('@kbn/openapi-bundler'); + +const ROOT = resolve(__dirname, '..'); + +(async () => { + await bundle({ + sourceGlob: join(ROOT, 'api/**/*.schema.yaml'), + outputFilePath: join( + ROOT, + 'docs/openapi/serverless/security_solution_exceptions_api_{version}.bundled.schema.yaml' + ), + options: { + includeLabels: ['serverless'], + prototypeDocument: join(ROOT, 'scripts/openapi_bundle_info/exceptions_serverless.info.yaml'), + }, + }); + + await bundle({ + sourceGlob: join(ROOT, 'api/**/*.schema.yaml'), + outputFilePath: join( + ROOT, + 'docs/openapi/ess/security_solution_exceptions_api_{version}.bundled.schema.yaml' + ), + options: { + includeLabels: ['ess'], + prototypeDocument: join(ROOT, 'scripts/openapi_bundle_info/exceptions_ess.info.yaml'), + }, + }); +})(); diff --git a/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle_info/exceptions_ess.info.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle_info/exceptions_ess.info.yaml similarity index 100% rename from packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle_info/exceptions_ess.info.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle_info/exceptions_ess.info.yaml diff --git a/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle_info/exceptions_serverless.info.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle_info/exceptions_serverless.info.yaml similarity index 100% rename from packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle_info/exceptions_serverless.info.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle_info/exceptions_serverless.info.yaml diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/scripts/openapi_generate.js b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/scripts/openapi_generate.js new file mode 100644 index 0000000000000..92488001b0b3a --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/scripts/openapi_generate.js @@ -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. + */ + +require('../../../../../../src/setup_node_env'); +// eslint-disable-next-line import/no-nodejs-modules +const { join, resolve } = require('path'); +const { generate } = require('@kbn/openapi-generator'); +const { REPO_ROOT } = require('@kbn/repo-info'); + +const ROOT = resolve(__dirname, '..'); + +(async () => { + await generate({ + title: 'OpenAPI Exceptions API Schemas', + rootDir: ROOT, + sourceGlob: './api/**/*.schema.yaml', + templateName: 'zod_operation_schema', + }); + + await generate({ + title: 'Exceptions API client for tests', + rootDir: ROOT, + sourceGlob: './api/**/*.schema.yaml', + templateName: 'api_client_supertest', + skipLinting: true, + bundle: { + outFile: join( + REPO_ROOT, + 'x-pack/test/api_integration/services/security_solution_exceptions_api.gen.ts' + ), + }, + }); + + await generate({ + title: 'Exceptions API client for quickstart', + rootDir: ROOT, + sourceGlob: './api/**/*.schema.yaml', + templateName: 'api_client_quickstart', + skipLinting: true, + bundle: { + outFile: join( + REPO_ROOT, + 'x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/api/quickstart_client.gen.ts' + ), + }, + }); +})(); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/tsconfig.json b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/tsconfig.json new file mode 100644 index 0000000000000..ba5a2c115a336 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "outDir": "target/types", + "types": ["jest", "node"] + }, + "exclude": ["target/**/*"], + "extends": "../../../../../tsconfig.base.json", + "include": ["**/*.ts"], + "kbn_references": [ + "@kbn/openapi-common", + "@kbn/zod-helpers", + "@kbn/securitysolution-lists-common", + "@kbn/test", + "@kbn/tooling-log", + "@kbn/core-http-common", + "@kbn/securitysolution-utils", + "@kbn/zod", + ] +} diff --git a/packages/kbn-securitysolution-hook-utils/README.md b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/README.md similarity index 100% rename from packages/kbn-securitysolution-hook-utils/README.md rename to x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/README.md diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/index.ts new file mode 100644 index 0000000000000..40ff03e880946 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/index.ts @@ -0,0 +1,12 @@ +/* + * 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. + */ + +export * from './src/types'; +export * from './src/use_async'; +export * from './src/use_is_mounted'; +export * from './src/use_observable'; +export * from './src/with_optional_signal'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/jest.config.js b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/jest.config.js new file mode 100644 index 0000000000000..8238f9f7e97d2 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/jest.config.js @@ -0,0 +1,12 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils'], +}; diff --git a/packages/kbn-securitysolution-hook-utils/kibana.jsonc b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/kibana.jsonc similarity index 100% rename from packages/kbn-securitysolution-hook-utils/kibana.jsonc rename to x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/kibana.jsonc diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/package.json b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/package.json new file mode 100644 index 0000000000000..efd415370f23d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/package.json @@ -0,0 +1,8 @@ +{ + "name": "@kbn/securitysolution-hook-utils", + "version": "1.0.0", + "description": "Security Solution utilities for React hooks", + "license": "Elastic License 2.0", + "private": true, + "sideEffects": false +} \ No newline at end of file diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/types.ts b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/types.ts new file mode 100644 index 0000000000000..1b31cae2a16d4 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/types.ts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +/** + * Represents the state of an asynchronous task, along with an initiator + * function to kick off the work. + */ +export interface Task<Args extends unknown[], Result> { + loading: boolean; + error: unknown | undefined; + result: Result | undefined; + start: (...args: Args) => void; +} diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/use_async/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/use_async/index.test.ts new file mode 100644 index 0000000000000..e5420124a0ebc --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/use_async/index.test.ts @@ -0,0 +1,164 @@ +/* + * 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 { waitFor, renderHook, act } from '@testing-library/react'; + +import { useAsync } from '.'; + +interface TestArgs { + n: number; + s: string; +} + +type TestReturn = Promise<unknown>; + +describe('useAsync', () => { + /** + * Timeout for both jest tests and for the waitFor. + * jest tests default to 5 seconds and waitFor defaults to 1 second. + * 20_0000 = 20,000 milliseconds = 20 seconds + */ + const timeout = 20_000; + + let fn: jest.Mock<TestReturn, TestArgs[]>; + let args: TestArgs; + + beforeEach(() => { + args = { n: 1, s: 's' }; + fn = jest.fn().mockResolvedValue(false); + }); + + it('does not invoke fn if start was not called', () => { + renderHook(() => useAsync(fn)); + expect(fn).not.toHaveBeenCalled(); + }); + + it( + 'invokes the function when start is called', + async () => { + const { result } = renderHook(() => useAsync(fn)); + + act(() => { + result.current.start(args); + }); + await waitFor(() => expect(fn).toHaveBeenCalled(), { timeout }); + }, + timeout + ); + + it('invokes the function with start args', async () => { + const { result } = renderHook(() => useAsync(fn)); + const expectedArgs = { ...args }; + + act(() => { + result.current.start(args); + }); + await waitFor(() => expect(fn).toHaveBeenCalledWith(expectedArgs), { timeout }); + }); + + it( + 'populates result with the resolved value of the fn', + async () => { + const { result } = renderHook(() => useAsync(fn)); + fn.mockResolvedValue({ resolved: 'value' }); + + act(() => { + result.current.start(args); + }); + await waitFor( + () => { + expect(result.current.result).toEqual({ resolved: 'value' }); + expect(result.current.error).toBeUndefined(); + }, + { timeout } + ); + }, + timeout + ); + + it( + 'populates error if function rejects', + async () => { + fn.mockRejectedValue(new Error('whoops')); + const { result } = renderHook(() => useAsync(fn)); + + act(() => { + result.current.start(args); + }); + + await waitFor( + () => { + expect(result.current.result).toBeUndefined(); + expect(result.current.error).toEqual(new Error('whoops')); + }, + { timeout } + ); + }, + timeout + ); + + it( + 'populates the loading state while the function is pending', + async () => { + let resolve: () => void; + fn.mockImplementation(() => new Promise<void>((_resolve) => (resolve = _resolve))); + + const { result } = renderHook(() => useAsync(fn)); + + act(() => { + result.current.start(args); + }); + + expect(result.current.loading).toBe(true); + + act(() => resolve()); + await waitFor(() => expect(result.current.loading).toBe(false), { timeout }); + }, + timeout + ); + + it( + 'multiple start calls reset state', + async () => { + let resolve: (result: string) => void; + fn.mockImplementation(() => new Promise((_resolve) => (resolve = _resolve))); + + const { result } = renderHook(() => useAsync(fn)); + + act(() => { + result.current.start(args); + }); + + expect(result.current.loading).toBe(true); + + act(() => resolve('result')); + await waitFor( + () => { + expect(result.current.loading).toBe(false); + expect(result.current.result).toBe('result'); + }, + { timeout } + ); + + act(() => { + result.current.start(args); + }); + + expect(result.current.loading).toBe(true); + expect(result.current.result).toBe(undefined); + act(() => resolve('result')); + await waitFor( + () => { + expect(result.current.loading).toBe(false); + expect(result.current.result).toBe('result'); + }, + { timeout } + ); + }, + timeout + ); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/use_async/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/use_async/index.ts new file mode 100644 index 0000000000000..027039ac7cca7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/use_async/index.ts @@ -0,0 +1,54 @@ +/* + * 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, useState } from 'react'; + +import { Task } from '../types'; +import { useIsMounted } from '../use_is_mounted'; + +/** + * + * This hook wraps a promise-returning thunk (task) in order to conditionally + * initiate the work, and automatically provide state corresponding to the + * task's status. + * + * In order to function properly and not rerender unnecessarily, ensure that + * your task is a stable function reference. + * + * @param fn a function returning a promise. + * + * @returns An {@link Task} containing the task's current state along with a + * start callback + */ +export const useAsync = <Args extends unknown[], Result>( + fn: (...args: Args) => Promise<Result> +): Task<Args, Result> => { + const isMounted = useIsMounted(); + const [loading, setLoading] = useState(false); + const [error, setError] = useState<unknown | undefined>(); + const [result, setResult] = useState<Result | undefined>(); + + const start = useCallback( + (...args: Args) => { + setLoading(true); + setResult(undefined); + setError(undefined); + fn(...args) + .then((r) => isMounted() && setResult(r)) + .catch((e) => isMounted() && setError(e)) + .finally(() => isMounted() && setLoading(false)); + }, + [fn, isMounted] + ); + + return { + error, + loading, + result, + start, + }; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/use_is_mounted/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/use_is_mounted/index.test.ts new file mode 100644 index 0000000000000..52f3a0739f4aa --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/use_is_mounted/index.test.ts @@ -0,0 +1,25 @@ +/* + * 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 { renderHook } from '@testing-library/react'; + +import { useIsMounted } from '.'; + +describe('useIsMounted', () => { + it('evaluates to true when mounted', () => { + const { result } = renderHook(() => useIsMounted()); + + expect(result.current()).toEqual(true); + }); + + it('evaluates to false when unmounted', () => { + const { result, unmount } = renderHook(() => useIsMounted()); + + unmount(); + expect(result.current()).toEqual(false); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/use_is_mounted/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/use_is_mounted/index.ts new file mode 100644 index 0000000000000..8d325aed1abd6 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/use_is_mounted/index.ts @@ -0,0 +1,29 @@ +/* + * 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, useEffect, useRef } from 'react'; + +type GetIsMounted = () => boolean; + +/** + * + * @returns A {@link GetIsMounted} getter function returning whether the component is currently mounted + */ +export const useIsMounted = (): GetIsMounted => { + const isMounted = useRef(false); + const getIsMounted: GetIsMounted = useCallback(() => isMounted.current, []); + const handleCleanup = useCallback(() => { + isMounted.current = false; + }, []); + + useEffect(() => { + isMounted.current = true; + return handleCleanup; + }, [handleCleanup]); + + return getIsMounted; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/use_observable/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/use_observable/index.test.ts new file mode 100644 index 0000000000000..3c6d96e3d3ac2 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/use_observable/index.test.ts @@ -0,0 +1,159 @@ +/* + * 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 { renderHook, act } from '@testing-library/react'; +import { Subject, throwError } from 'rxjs'; + +import { useObservable } from '.'; + +interface TestArgs { + n: number; + s: string; +} + +type TestReturn = Subject<unknown>; + +describe('useObservable', () => { + let fn: jest.Mock<TestReturn, TestArgs[]>; + let subject: TestReturn; + let args: TestArgs; + + beforeEach(() => { + args = { n: 1, s: 's' }; + subject = new Subject(); + fn = jest.fn().mockReturnValue(subject); + }); + + it('does not invoke fn if start was not called', () => { + renderHook(() => useObservable(fn)); + expect(fn).not.toHaveBeenCalled(); + }); + + it('invokes the function when start is called', () => { + const { result } = renderHook(() => useObservable(fn)); + + act(() => { + result.current.start(args); + }); + + expect(fn).toHaveBeenCalled(); + }); + + it('invokes the function with start args', () => { + const { result } = renderHook(() => useObservable(fn)); + const expectedArgs = { ...args }; + + act(() => { + result.current.start(args); + }); + + expect(fn).toHaveBeenCalledWith(expectedArgs); + }); + + it('populates result with the next value of the fn', () => { + const { result } = renderHook(() => useObservable(fn)); + + act(() => { + result.current.start(args); + }); + act(() => subject.next('value')); + + expect(result.current.result).toEqual('value'); + expect(result.current.error).toBeUndefined(); + }); + + it('populates error if observable throws an error', () => { + const error = new Error('whoops'); + const errorFn = () => throwError(error); + + const { result } = renderHook(() => useObservable(errorFn)); + + act(() => { + result.current.start(); + }); + + expect(result.current.result).toBeUndefined(); + expect(result.current.error).toEqual(error); + }); + + it('populates the loading state while no value has resolved', () => { + const { result } = renderHook(() => useObservable(fn)); + + act(() => { + result.current.start(args); + }); + + expect(result.current.loading).toBe(true); + + act(() => subject.next('a value')); + + expect(result.current.loading).toBe(false); + }); + + it('updates result with each resolved value', () => { + const { result } = renderHook(() => useObservable(fn)); + + act(() => { + result.current.start(args); + }); + + act(() => subject.next('a value')); + expect(result.current.result).toEqual('a value'); + + act(() => subject.next('a subsequent value')); + expect(result.current.result).toEqual('a subsequent value'); + }); + + it('does not update result with values if start has not been called', () => { + const { result } = renderHook(() => useObservable(fn)); + + act(() => subject.next('a value')); + expect(result.current.result).toBeUndefined(); + + act(() => subject.next('a subsequent value')); + expect(result.current.result).toBeUndefined(); + }); + + it('unsubscribes on unmount', () => { + const { result, unmount } = renderHook(() => useObservable(fn)); + + act(() => { + result.current.start(args); + }); + expect(subject.observers).toHaveLength(1); + + unmount(); + expect(subject.observers).toHaveLength(0); + }); + + it('multiple start calls reset state', () => { + const { result } = renderHook(() => useObservable(fn)); + + act(() => { + result.current.start(args); + }); + + expect(result.current.loading).toBe(true); + + act(() => subject.next('one value')); + + expect(result.current.loading).toBe(false); + expect(result.current.result).toBe('one value'); + + act(() => { + result.current.start(args); + }); + + expect(result.current.loading).toBe(true); + expect(result.current.result).toBe(undefined); + + act(() => subject.next('another value')); + + expect(result.current.loading).toBe(false); + expect(result.current.result).toBe('another value'); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/use_observable/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/use_observable/index.ts new file mode 100644 index 0000000000000..b7cd1e2623b78 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/use_observable/index.ts @@ -0,0 +1,91 @@ +/* + * 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, useEffect, useRef, useReducer, Reducer } from 'react'; +import { Observable, Subscription } from 'rxjs'; + +import { useIsMounted } from '../use_is_mounted'; +import { Task } from '../types'; + +interface State<T> { + loading: boolean; + error?: unknown; + result?: T; +} + +export type Action<T> = + | { type: 'setResult'; result: T } + | { type: 'setError'; error: unknown } + | { type: 'load' }; + +function reducer<T>(state: State<T>, action: Action<T>) { + switch (action.type) { + case 'setResult': + return { ...state, result: action.result, loading: false }; + case 'setError': + return { ...state, error: action.error, loading: false }; + case 'load': + return { loading: true, result: undefined, error: undefined }; + } +} + +/** + * + * @param fn function returning an observable + * + * @returns An {@link Async} containing the underlying task's state along with a start callback + */ +export const useObservable = <Args extends unknown[], Result>( + fn: (...args: Args) => Observable<Result> +): Task<Args, Result> => { + const isMounted = useIsMounted(); + const subRef = useRef<Subscription | undefined>(); + const [state, dispatch] = useReducer<Reducer<State<Result>, Action<Result>>>(reducer, { + loading: false, + error: undefined, + result: undefined, + }); + + const start = useCallback( + (...args: Args) => { + if (subRef.current) { + subRef.current.unsubscribe(); + } + dispatch({ type: 'load' }); + + subRef.current = fn(...args).subscribe( + (r) => { + if (isMounted()) { + dispatch({ type: 'setResult', result: r }); + } + }, + (e) => { + if (isMounted()) { + dispatch({ type: 'setError', error: e }); + } + } + ); + }, + [fn, isMounted] + ); + + useEffect( + () => () => { + if (subRef.current) { + subRef.current.unsubscribe(); + } + }, + [] + ); + + return { + result: state.result, + error: state.error, + loading: state.loading, + start, + }; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/with_optional_signal/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/with_optional_signal/index.test.ts new file mode 100644 index 0000000000000..05a1b2fa167a0 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/with_optional_signal/index.test.ts @@ -0,0 +1,30 @@ +/* + * 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 { withOptionalSignal } from '.'; + +type TestFn = ({ number, signal }: { number: number; signal: AbortSignal }) => boolean; + +describe('withOptionalSignal', () => { + it('does not require a signal on the returned function', () => { + const fn = jest.fn().mockReturnValue('hello') as TestFn; + + const wrappedFn = withOptionalSignal(fn); + + expect(wrappedFn({ number: 1 })).toEqual('hello'); + }); + + it('will pass a given signal to the wrapped function', () => { + const fn = jest.fn().mockReturnValue('hello') as TestFn; + const { signal } = new AbortController(); + + const wrappedFn = withOptionalSignal(fn); + + wrappedFn({ number: 1, signal }); + expect(fn).toHaveBeenCalledWith({ number: 1, signal }); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/with_optional_signal/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/with_optional_signal/index.ts new file mode 100644 index 0000000000000..eadad58804f83 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/src/with_optional_signal/index.ts @@ -0,0 +1,25 @@ +/* + * 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. + */ + +interface SignalArgs { + signal: AbortSignal; +} + +export type OptionalSignalArgs<Args> = Omit<Args, 'signal'> & Partial<SignalArgs>; + +/** + * + * @param fn an async function receiving an AbortSignal argument + * + * @returns An async function where the AbortSignal argument is optional + */ +export const withOptionalSignal = + <Args extends SignalArgs, Result>(fn: (args: Args) => Result) => + (args: OptionalSignalArgs<Args>): Result => { + const signal = args.signal != null ? args.signal : new AbortController().signal; + return fn({ ...args, signal } as Args); + }; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/tsconfig.json b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/tsconfig.json new file mode 100644 index 0000000000000..ccdf26c349f09 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-hook-utils/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": ["jest", "node"] + }, + "include": [ + "**/*.ts" + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/README.md b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/README.md similarity index 100% rename from packages/kbn-securitysolution-io-ts-alerting-types/README.md rename to x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/README.md diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/index.ts new file mode 100644 index 0000000000000..f5e8f8419b254 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/index.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. + */ + +export * from './src/actions'; +export * from './src/default_actions_array'; +export * from './src/default_export_file_name'; +export * from './src/default_from_string'; +export * from './src/default_interval_string'; +export * from './src/default_language_string'; +export * from './src/default_max_signals_number'; +export * from './src/default_page'; +export * from './src/default_per_page'; +export * from './src/default_risk_score_mapping_array'; +export * from './src/default_severity_mapping_array'; +export * from './src/default_threat_array'; +export * from './src/default_to_string'; +export * from './src/default_uuid'; +export * from './src/frequency'; +export * from './src/language'; +export * from './src/machine_learning_job_id'; +export * from './src/max_signals'; +export * from './src/normalized_ml_job_id'; +export * from './src/references_default_array'; +export * from './src/risk_score'; +export * from './src/risk_score_mapping'; +export * from './src/rule_schedule'; +export * from './src/saved_object_attributes'; +export * from './src/severity'; +export * from './src/severity_mapping'; +export * from './src/threat'; +export * from './src/threat_mapping'; +export * from './src/threat_subtechnique'; +export * from './src/threat_tactic'; +export * from './src/threat_technique'; +export * from './src/throttle'; +export * from './src/type'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/jest.config.js b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/jest.config.js new file mode 100644 index 0000000000000..16223422cbd8d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/jest.config.js @@ -0,0 +1,12 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types'], +}; diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/kibana.jsonc b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/kibana.jsonc similarity index 100% rename from packages/kbn-securitysolution-io-ts-alerting-types/kibana.jsonc rename to x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/kibana.jsonc diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/package.json b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/package.json new file mode 100644 index 0000000000000..bbe6c163fb5e8 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/package.json @@ -0,0 +1,8 @@ +{ + "name": "@kbn/securitysolution-io-ts-alerting-types", + "version": "1.0.0", + "description": "io ts utilities and types to be shared with plugins from the security solution project", + "license": "Elastic License 2.0", + "private": true, + "sideEffects": false +} \ No newline at end of file diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/actions/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/actions/index.ts new file mode 100644 index 0000000000000..64953a0dc0cdd --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/actions/index.ts @@ -0,0 +1,127 @@ +/* + * 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 { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; + +import * as t from 'io-ts'; +import { saved_object_attributes } from '../saved_object_attributes'; +import { RuleActionFrequency } from '../frequency'; + +export type RuleActionGroup = t.TypeOf<typeof RuleActionGroup>; +export const RuleActionGroup = t.string; + +export type RuleActionId = t.TypeOf<typeof RuleActionId>; +export const RuleActionId = t.string; + +export type RuleActionTypeId = t.TypeOf<typeof RuleActionTypeId>; +export const RuleActionTypeId = t.string; + +export type RuleActionUuid = t.TypeOf<typeof RuleActionUuid>; +export const RuleActionUuid = NonEmptyString; + +/** + * Params is an "object", since it is a type of RuleActionParams which is action templates. + * @see x-pack/plugins/alerting/common/rule.ts + */ +export type RuleActionParams = t.TypeOf<typeof RuleActionParams>; +export const RuleActionParams = saved_object_attributes; + +export const RuleActionAlertsFilter = t.partial({ + query: t.union([ + t.undefined, + t.intersection([ + t.strict({ + kql: t.string, + filters: t.array( + t.intersection([ + t.type({ + meta: t.partial({ + alias: t.union([t.string, t.null]), + disabled: t.boolean, + negate: t.boolean, + controlledBy: t.string, + group: t.string, + index: t.string, + isMultiIndex: t.boolean, + type: t.string, + key: t.string, + params: t.any, + value: t.string, + }), + }), + t.partial({ + $state: t.type({ store: t.any }), + query: t.record(t.string, t.any), + }), + ]) + ), + }), + t.partial({ dsl: t.string }), + ]), + ]), + timeframe: t.union([ + t.undefined, + t.strict({ + timezone: t.string, + days: t.array( + t.union([ + t.literal(1), + t.literal(2), + t.literal(3), + t.literal(4), + t.literal(5), + t.literal(6), + t.literal(7), + ]) + ), + hours: t.strict({ + start: t.string, + end: t.string, + }), + }), + ]), +}); + +export type RuleAction = t.TypeOf<typeof RuleAction>; +export const RuleAction = t.exact( + t.intersection([ + t.type({ + group: RuleActionGroup, + id: RuleActionId, + action_type_id: RuleActionTypeId, + params: RuleActionParams, + }), + t.partial({ + uuid: RuleActionUuid, + alerts_filter: RuleActionAlertsFilter, + frequency: RuleActionFrequency, + }), + ]) +); + +export type RuleActionArray = t.TypeOf<typeof RuleActionArray>; +export const RuleActionArray = t.array(RuleAction); + +export type RuleActionCamel = t.TypeOf<typeof RuleActionCamel>; +export const RuleActionCamel = t.exact( + t.intersection([ + t.type({ + group: RuleActionGroup, + id: RuleActionId, + actionTypeId: RuleActionTypeId, + params: RuleActionParams, + }), + t.partial({ + uuid: RuleActionUuid, + alertsFilter: RuleActionAlertsFilter, + frequency: RuleActionFrequency, + }), + ]) +); + +export type RuleActionArrayCamel = t.TypeOf<typeof RuleActionArrayCamel>; +export const RuleActionArrayCamel = t.array(RuleActionCamel); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/constants/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/constants/index.mock.ts new file mode 100644 index 0000000000000..2747846c74d80 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/constants/index.mock.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. + */ + +export const ENTRY_VALUE = 'some host name'; +export const FIELD = 'host.name'; +export const MATCH = 'match'; +export const MATCH_ANY = 'match_any'; +export const OPERATOR = 'included'; +export const NESTED = 'nested'; +export const NESTED_FIELD = 'parent.field'; +export const LIST_ID = 'some-list-id'; +export const LIST = 'list'; +export const TYPE = 'ip'; +export const EXISTS = 'exists'; +export const WILDCARD = 'wildcard'; +export const USER = 'some user'; +export const DATE_NOW = '2020-04-20T15:25:31.830Z'; + +// Exception List specific +export const ID = 'uuid_here'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/constants/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/constants/index.ts new file mode 100644 index 0000000000000..ad5a2ba262260 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/constants/index.ts @@ -0,0 +1,12 @@ +/* + * 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. + */ + +/** + * TODO: Create a kbn-alerting-constants and add this to it. + * @deprecated Use a DEFAULT_MAX_SIGNALS from a kbn-alerting-constants package. + */ +export const DEFAULT_MAX_SIGNALS = 100; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_actions_array/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_actions_array/index.ts new file mode 100644 index 0000000000000..28ff3053564c9 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_actions_array/index.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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { RuleActionArray } from '../actions'; + +export const DefaultActionsArray = new t.Type< + RuleActionArray, + RuleActionArray | undefined, + unknown +>( + 'DefaultActionsArray', + RuleActionArray.is, + (input, context): Either<t.Errors, RuleActionArray> => + input == null ? t.success([]) : RuleActionArray.validate(input, context), + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_export_file_name/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_export_file_name/index.test.ts new file mode 100644 index 0000000000000..009fdb23d3fb7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_export_file_name/index.test.ts @@ -0,0 +1,42 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { DefaultExportFileName } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('default_export_file_name', () => { + test('it should validate a regular string', () => { + const payload = 'some string'; + const decoded = DefaultExportFileName.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not validate a number', () => { + const payload = 5; + const decoded = DefaultExportFileName.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "5" supplied to "DefaultExportFileName"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should return a default of "export.ndjson"', () => { + const payload = null; + const decoded = DefaultExportFileName.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual('export.ndjson'); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_export_file_name/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_export_file_name/index.ts new file mode 100644 index 0000000000000..53f0972baca21 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_export_file_name/index.ts @@ -0,0 +1,21 @@ +/* + * 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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; + +/** + * Types the DefaultExportFileName as: + * - If null or undefined, then a default of "export.ndjson" will be used + */ +export const DefaultExportFileName = new t.Type<string, string | undefined, unknown>( + 'DefaultExportFileName', + t.string.is, + (input, context): Either<t.Errors, string> => + input == null ? t.success('export.ndjson') : t.string.validate(input, context), + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_from_string/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_from_string/index.test.ts new file mode 100644 index 0000000000000..f6c7f91e315ad --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_from_string/index.test.ts @@ -0,0 +1,42 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { DefaultFromString } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('default_from_string', () => { + test('it should validate a from string', () => { + const payload = 'now-20m'; + const decoded = DefaultFromString.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not validate a number', () => { + const payload = 5; + const decoded = DefaultFromString.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "5" supplied to "DefaultFromString"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should return a default of "now-6m"', () => { + const payload = null; + const decoded = DefaultFromString.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual('now-6m'); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_from_string/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_from_string/index.ts new file mode 100644 index 0000000000000..d23bca135d03e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_from_string/index.ts @@ -0,0 +1,26 @@ +/* + * 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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { From } from '../from'; + +/** + * Types the DefaultFromString as: + * - If null or undefined, then a default of the string "now-6m" will be used + */ +export const DefaultFromString = new t.Type<string, string | undefined, unknown>( + 'DefaultFromString', + t.string.is, + (input, context): Either<t.Errors, string> => { + if (input == null) { + return t.success('now-6m'); + } + return From.validate(input, context); + }, + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_interval_string/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_interval_string/index.test.ts new file mode 100644 index 0000000000000..602d6c9ff79e8 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_interval_string/index.test.ts @@ -0,0 +1,42 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { DefaultIntervalString } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('default_interval_string', () => { + test('it should validate a interval string', () => { + const payload = '20m'; + const decoded = DefaultIntervalString.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not validate a number', () => { + const payload = 5; + const decoded = DefaultIntervalString.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "5" supplied to "DefaultIntervalString"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should return a default of "5m"', () => { + const payload = null; + const decoded = DefaultIntervalString.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual('5m'); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_interval_string/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_interval_string/index.ts new file mode 100644 index 0000000000000..d743fa773f2ec --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_interval_string/index.ts @@ -0,0 +1,21 @@ +/* + * 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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; + +/** + * Types the DefaultIntervalString as: + * - If null or undefined, then a default of the string "5m" will be used + */ +export const DefaultIntervalString = new t.Type<string, string | undefined, unknown>( + 'DefaultIntervalString', + t.string.is, + (input, context): Either<t.Errors, string> => + input == null ? t.success('5m') : t.string.validate(input, context), + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_language_string/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_language_string/index.test.ts new file mode 100644 index 0000000000000..34e6e65518c71 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_language_string/index.test.ts @@ -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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { Language } from '../language'; +import { DefaultLanguageString } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('default_language_string', () => { + test('it should validate a string', () => { + const payload: Language = 'lucene'; + const decoded = DefaultLanguageString.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not validate a number', () => { + const payload = 5; + const decoded = DefaultLanguageString.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "5" supplied to "DefaultLanguageString"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should return a default of "kuery"', () => { + const payload = null; + const decoded = DefaultLanguageString.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual('kuery'); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_language_string/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_language_string/index.ts new file mode 100644 index 0000000000000..ca557dafecefd --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_language_string/index.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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { language } from '../language'; + +/** + * Types the DefaultLanguageString as: + * - If null or undefined, then a default of the string "kuery" will be used + */ +export const DefaultLanguageString = new t.Type<string, string | undefined, unknown>( + 'DefaultLanguageString', + t.string.is, + (input, context): Either<t.Errors, string> => + input == null ? t.success('kuery') : language.validate(input, context), + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_max_signals_number/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_max_signals_number/index.test.ts new file mode 100644 index 0000000000000..cd4b0aa42953b --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_max_signals_number/index.test.ts @@ -0,0 +1,65 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { DefaultMaxSignalsNumber } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { DEFAULT_MAX_SIGNALS } from '../constants'; + +describe('default_from_string', () => { + test('it should validate a max signal number', () => { + const payload = 5; + const decoded = DefaultMaxSignalsNumber.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not validate a string', () => { + const payload = '5'; + const decoded = DefaultMaxSignalsNumber.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "5" supplied to "DefaultMaxSignals"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not validate a zero', () => { + const payload = 0; + const decoded = DefaultMaxSignalsNumber.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "0" supplied to "DefaultMaxSignals"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not validate a negative number', () => { + const payload = -1; + const decoded = DefaultMaxSignalsNumber.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "-1" supplied to "DefaultMaxSignals"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should return a default of DEFAULT_MAX_SIGNALS', () => { + const payload = null; + const decoded = DefaultMaxSignalsNumber.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(DEFAULT_MAX_SIGNALS); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_max_signals_number/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_max_signals_number/index.ts new file mode 100644 index 0000000000000..535f9397c7afb --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_max_signals_number/index.ts @@ -0,0 +1,26 @@ +/* + * 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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { max_signals } from '../max_signals'; +import { DEFAULT_MAX_SIGNALS } from '../constants'; + +/** + * Types the default max signal: + * - Natural Number (positive integer and not a float), + * - greater than 1 + * - If undefined then it will use DEFAULT_MAX_SIGNALS (100) as the default + */ +export const DefaultMaxSignalsNumber = new t.Type<number, number | undefined, unknown>( + 'DefaultMaxSignals', + t.number.is, + (input, context): Either<t.Errors, number> => { + return input == null ? t.success(DEFAULT_MAX_SIGNALS) : max_signals.validate(input, context); + }, + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_page/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_page/index.test.ts new file mode 100644 index 0000000000000..d9e63e0f9ec14 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_page/index.test.ts @@ -0,0 +1,84 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { DefaultPage } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('default_page', () => { + test('it should validate a regular number greater than zero', () => { + const payload = 5; + const decoded = DefaultPage.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate a string of a number', () => { + const payload = '5'; + const decoded = DefaultPage.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(5); + }); + + test('it should not validate a junk string', () => { + const payload = 'invalid-string'; + const decoded = DefaultPage.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "NaN" supplied to "DefaultPerPage"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not validate an empty string', () => { + const payload = ''; + const decoded = DefaultPage.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "NaN" supplied to "DefaultPerPage"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not validate a zero', () => { + const payload = 0; + const decoded = DefaultPage.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "0" supplied to "DefaultPerPage"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not validate a negative number', () => { + const payload = -1; + const decoded = DefaultPage.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "-1" supplied to "DefaultPerPage"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should return a default of 20', () => { + const payload = null; + const decoded = DefaultPage.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(1); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_page/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_page/index.ts new file mode 100644 index 0000000000000..6ae23dd8c676f --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_page/index.ts @@ -0,0 +1,31 @@ +/* + * 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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { PositiveIntegerGreaterThanZero } from '@kbn/securitysolution-io-ts-types'; + +/** + * Types the DefaultPerPage as: + * - If a string this will convert the string to a number + * - If null or undefined, then a default of 1 will be used + * - If the number is 0 or less this will not validate as it has to be a positive number greater than zero + */ +export const DefaultPage = new t.Type<number, number | undefined, unknown>( + 'DefaultPerPage', + t.number.is, + (input, context): Either<t.Errors, number> => { + if (input == null) { + return t.success(1); + } else if (typeof input === 'string') { + return PositiveIntegerGreaterThanZero.validate(parseInt(input, 10), context); + } else { + return PositiveIntegerGreaterThanZero.validate(input, context); + } + }, + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_per_page/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_per_page/index.test.ts new file mode 100644 index 0000000000000..07a6358ba2e89 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_per_page/index.test.ts @@ -0,0 +1,84 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { DefaultPerPage } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('default_per_page', () => { + test('it should validate a regular number greater than zero', () => { + const payload = 5; + const decoded = DefaultPerPage.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate a string of a number', () => { + const payload = '5'; + const decoded = DefaultPerPage.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(5); + }); + + test('it should not validate a junk string', () => { + const payload = 'invalid-string'; + const decoded = DefaultPerPage.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "NaN" supplied to "DefaultPerPage"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not validate an empty string', () => { + const payload = ''; + const decoded = DefaultPerPage.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "NaN" supplied to "DefaultPerPage"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not validate a zero', () => { + const payload = 0; + const decoded = DefaultPerPage.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "0" supplied to "DefaultPerPage"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not validate a negative number', () => { + const payload = -1; + const decoded = DefaultPerPage.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "-1" supplied to "DefaultPerPage"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should return a default of 20', () => { + const payload = null; + const decoded = DefaultPerPage.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(20); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_per_page/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_per_page/index.ts new file mode 100644 index 0000000000000..320945311d3b6 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_per_page/index.ts @@ -0,0 +1,31 @@ +/* + * 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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { PositiveIntegerGreaterThanZero } from '@kbn/securitysolution-io-ts-types'; + +/** + * Types the DefaultPerPage as: + * - If a string this will convert the string to a number + * - If null or undefined, then a default of 20 will be used + * - If the number is 0 or less this will not validate as it has to be a positive number greater than zero + */ +export const DefaultPerPage = new t.Type<number, number | undefined, unknown>( + 'DefaultPerPage', + t.number.is, + (input, context): Either<t.Errors, number> => { + if (input == null) { + return t.success(20); + } else if (typeof input === 'string') { + return PositiveIntegerGreaterThanZero.validate(parseInt(input, 10), context); + } else { + return PositiveIntegerGreaterThanZero.validate(input, context); + } + }, + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_risk_score_mapping_array/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_risk_score_mapping_array/index.ts new file mode 100644 index 0000000000000..a457c827e25f6 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_risk_score_mapping_array/index.ts @@ -0,0 +1,26 @@ +/* + * 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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { RiskScoreMapping } from '../risk_score_mapping'; + +/** + * Types the DefaultStringArray as: + * - If null or undefined, then a default RiskScoreMapping array will be set + */ +export const DefaultRiskScoreMappingArray = new t.Type< + RiskScoreMapping, + RiskScoreMapping | undefined, + unknown +>( + 'DefaultRiskScoreMappingArray', + RiskScoreMapping.is, + (input, context): Either<t.Errors, RiskScoreMapping> => + input == null ? t.success([]) : RiskScoreMapping.validate(input, context), + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_severity_mapping_array/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_severity_mapping_array/index.ts new file mode 100644 index 0000000000000..8d7b581146eac --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_severity_mapping_array/index.ts @@ -0,0 +1,26 @@ +/* + * 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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { SeverityMapping } from '../severity_mapping'; + +/** + * Types the DefaultStringArray as: + * - If null or undefined, then a default SeverityMapping array will be set + */ +export const DefaultSeverityMappingArray = new t.Type< + SeverityMapping, + SeverityMapping | undefined, + unknown +>( + 'DefaultSeverityMappingArray', + SeverityMapping.is, + (input, context): Either<t.Errors, SeverityMapping> => + input == null ? t.success([]) : SeverityMapping.validate(input, context), + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_threat_array/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_threat_array/index.test.ts new file mode 100644 index 0000000000000..ed42de41effcc --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_threat_array/index.test.ts @@ -0,0 +1,65 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { Threats } from '../threat'; +import { DefaultThreatArray } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('default_threat_null', () => { + test('it should validate an empty array', () => { + const payload: Threats = []; + const decoded = DefaultThreatArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate an array of threats', () => { + const payload: Threats = [ + { + framework: 'MITRE ATTACK', + technique: [{ reference: 'https://test.com', name: 'Audio Capture', id: 'T1123' }], + tactic: { reference: 'https://test.com', name: 'Collection', id: 'TA000999' }, + }, + ]; + const decoded = DefaultThreatArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not validate an array with a number', () => { + const payload = [ + { + framework: 'MITRE ATTACK', + technique: [{ reference: 'https://test.com', name: 'Audio Capture', id: 'T1123' }], + tactic: { reference: 'https://test.com', name: 'Collection', id: 'TA000999' }, + }, + 5, + ]; + const decoded = DefaultThreatArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "5" supplied to "DefaultThreatArray"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should return a default empty array if not provided a value', () => { + const payload = null; + const decoded = DefaultThreatArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual([]); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_threat_array/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_threat_array/index.ts new file mode 100644 index 0000000000000..8ed8abc587504 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_threat_array/index.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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { threats, Threats } from '../threat'; + +/** + * Types the DefaultThreatArray as: + * - If null or undefined, then an empty array will be set + */ +export const DefaultThreatArray = new t.Type<Threats, Threats | undefined, unknown>( + 'DefaultThreatArray', + threats.is, + (input, context): Either<t.Errors, Threats> => + input == null ? t.success([]) : threats.validate(input, context), + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_to_string/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_to_string/index.test.ts new file mode 100644 index 0000000000000..f87b1c4f24a9e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_to_string/index.test.ts @@ -0,0 +1,42 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { DefaultToString } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('default_to_string', () => { + test('it should validate a to string', () => { + const payload = 'now-5m'; + const decoded = DefaultToString.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not validate a number', () => { + const payload = 5; + const decoded = DefaultToString.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "5" supplied to "DefaultToString"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should return a default of "now"', () => { + const payload = null; + const decoded = DefaultToString.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual('now'); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_to_string/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_to_string/index.ts new file mode 100644 index 0000000000000..d2e58f423b592 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_to_string/index.ts @@ -0,0 +1,21 @@ +/* + * 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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; + +/** + * Types the DefaultToString as: + * - If null or undefined, then a default of the string "now" will be used + */ +export const DefaultToString = new t.Type<string, string | undefined, unknown>( + 'DefaultToString', + t.string.is, + (input, context): Either<t.Errors, string> => + input == null ? t.success('now') : t.string.validate(input, context), + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_uuid/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_uuid/index.test.ts new file mode 100644 index 0000000000000..ee605a5c4383a --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_uuid/index.test.ts @@ -0,0 +1,42 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { DefaultUuid } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('default_uuid', () => { + test('it should validate a regular string', () => { + const payload = '1'; + const decoded = DefaultUuid.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not validate a number', () => { + const payload = 5; + const decoded = DefaultUuid.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "5" supplied to "DefaultUuid"']); + expect(message.schema).toEqual({}); + }); + + test('it should return a default of a uuid', () => { + const payload = null; + const decoded = DefaultUuid.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toMatch( + /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i + ); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_uuid/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_uuid/index.ts new file mode 100644 index 0000000000000..b3d6fda5b134a --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/default_uuid/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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { v4 as uuidv4 } from 'uuid'; +import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; + +/** + * Types the DefaultUuid as: + * - If null or undefined, then a default string uuidv4() will be + * created otherwise it will be checked just against an empty string + */ +export const DefaultUuid = new t.Type<string, string | undefined, unknown>( + 'DefaultUuid', + t.string.is, + (input, context): Either<t.Errors, string> => + input == null ? t.success(uuidv4()) : NonEmptyString.validate(input, context), + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/frequency/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/frequency/index.ts new file mode 100644 index 0000000000000..318408f145823 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/frequency/index.ts @@ -0,0 +1,36 @@ +/* + * 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 * as t from 'io-ts'; + +import { RuleActionThrottle } from '../throttle'; + +/** + * Action summary indicates whether we will send a summary notification about all the generate alerts or notification per individual alert + */ +export type RuleActionSummary = t.TypeOf<typeof RuleActionSummary>; +export const RuleActionSummary = t.boolean; + +/** + * The condition for throttling the notification: `onActionGroupChange`, `onActiveAlert`, or `onThrottleInterval` + */ +export type RuleActionNotifyWhen = t.TypeOf<typeof RuleActionNotifyWhen>; +export const RuleActionNotifyWhen = t.union([ + t.literal('onActionGroupChange'), + t.literal('onActiveAlert'), + t.literal('onThrottleInterval'), +]); + +/** + * The action frequency defines when the action runs (for example, only on rule execution or at specific time intervals). + */ +export type RuleActionFrequency = t.TypeOf<typeof RuleActionFrequency>; +export const RuleActionFrequency = t.type({ + summary: RuleActionSummary, + notifyWhen: RuleActionNotifyWhen, + throttle: t.union([RuleActionThrottle, t.null]), +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/from/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/from/index.ts new file mode 100644 index 0000000000000..d0330fae61404 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/from/index.ts @@ -0,0 +1,25 @@ +/* + * 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 { Either } from 'fp-ts/lib/Either'; +import * as t from 'io-ts'; +import { parseScheduleDates } from '@kbn/securitysolution-io-ts-utils'; + +const stringValidator = (input: unknown): input is string => typeof input === 'string'; + +export type From = t.TypeOf<typeof From>; +export const From = new t.Type<string, string, unknown>( + 'From', + t.string.is, + (input, context): Either<t.Errors, string> => { + if (stringValidator(input) && parseScheduleDates(input) == null) { + return t.failure(input, context, 'Failed to parse "from" on rule param'); + } + return t.string.validate(input, context); + }, + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/language/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/language/index.ts new file mode 100644 index 0000000000000..63ad102a41349 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/language/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 * as t from 'io-ts'; + +export const language = t.keyof({ eql: null, kuery: null, lucene: null, esql: null }); +export type Language = t.TypeOf<typeof language>; + +export const languageOrUndefined = t.union([language, t.undefined]); +export type LanguageOrUndefined = t.TypeOf<typeof languageOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/machine_learning_job_id/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/machine_learning_job_id/index.ts new file mode 100644 index 0000000000000..8e6453ac7e7b8 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/machine_learning_job_id/index.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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; + +import { machine_learning_job_id_normalized } from '../normalized_ml_job_id'; + +export const machine_learning_job_id = t.union([t.string, machine_learning_job_id_normalized]); +export type MachineLearningJobId = t.TypeOf<typeof machine_learning_job_id>; + +export const machineLearningJobIdOrUndefined = t.union([machine_learning_job_id, t.undefined]); +export type MachineLearningJobIdOrUndefined = t.TypeOf<typeof machineLearningJobIdOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/max_signals/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/max_signals/index.ts new file mode 100644 index 0000000000000..64ded4827b5eb --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/max_signals/index.ts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; +import { PositiveIntegerGreaterThanZero } from '@kbn/securitysolution-io-ts-types'; + +export const max_signals = PositiveIntegerGreaterThanZero; +export type MaxSignals = t.TypeOf<typeof max_signals>; + +export const maxSignalsOrUndefined = t.union([max_signals, t.undefined]); +export type MaxSignalsOrUndefined = t.TypeOf<typeof maxSignalsOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/normalized_ml_job_id/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/normalized_ml_job_id/index.ts new file mode 100644 index 0000000000000..f81c3da1db5d2 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/normalized_ml_job_id/index.ts @@ -0,0 +1,23 @@ +/* + * 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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; + +import { NonEmptyArray } from '@kbn/securitysolution-io-ts-types'; + +export const machine_learning_job_id_normalized = NonEmptyArray(t.string); +export type MachineLearningJobIdNormalized = t.TypeOf<typeof machine_learning_job_id_normalized>; + +export const machineLearningJobIdNormalizedOrUndefined = t.union([ + machine_learning_job_id_normalized, + t.undefined, +]); +export type MachineLearningJobIdNormalizedOrUndefined = t.TypeOf< + typeof machineLearningJobIdNormalizedOrUndefined +>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/references_default_array/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/references_default_array/index.test.ts new file mode 100644 index 0000000000000..7c5e9bb29877f --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/references_default_array/index.test.ts @@ -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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { ReferencesDefaultArray } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('default_string_array', () => { + test('it should validate an empty array', () => { + const payload: string[] = []; + const decoded = ReferencesDefaultArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate an array of strings', () => { + const payload = ['value 1', 'value 2']; + const decoded = ReferencesDefaultArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not validate an array with a number', () => { + const payload = ['value 1', 5]; + const decoded = ReferencesDefaultArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "5" supplied to "referencesWithDefaultArray"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should return a default array entry', () => { + const payload = null; + const decoded = ReferencesDefaultArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual([]); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/references_default_array/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/references_default_array/index.ts new file mode 100644 index 0000000000000..e5ccac3650434 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/references_default_array/index.ts @@ -0,0 +1,21 @@ +/* + * 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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; + +/** + * Types the ReferencesDefaultArray as: + * - If null or undefined, then a default array will be set + */ +export const ReferencesDefaultArray = new t.Type<string[], string[] | undefined, unknown>( + 'referencesWithDefaultArray', + t.array(t.string).is, + (input, context): Either<t.Errors, string[]> => + input == null ? t.success([]) : t.array(t.string).validate(input, context), + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/risk_score/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/risk_score/index.test.ts new file mode 100644 index 0000000000000..b55ef415fbbb5 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/risk_score/index.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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { RiskScore } from '.'; + +describe('risk_score', () => { + test('it should validate a positive number', () => { + const payload = 1; + const decoded = RiskScore.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate a zero', () => { + const payload = 0; + const decoded = RiskScore.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT validate a negative number', () => { + const payload = -1; + const decoded = RiskScore.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "-1" supplied to "RiskScore"']); + expect(message.schema).toEqual({}); + }); + + test('it should NOT validate a string', () => { + const payload = 'some string'; + const decoded = RiskScore.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "some string" supplied to "RiskScore"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT validate a risk score greater than 100', () => { + const payload = 101; + const decoded = RiskScore.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "101" supplied to "RiskScore"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/risk_score/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/risk_score/index.ts new file mode 100644 index 0000000000000..143ea2e727543 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/risk_score/index.ts @@ -0,0 +1,26 @@ +/* + * 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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; + +/** + * Types the risk score as: + * - Natural Number (positive integer and not a float), + * - Between the values [0 and 100] inclusive. + */ +export type RiskScore = t.TypeOf<typeof RiskScore>; +export const RiskScore = new t.Type<number, number, unknown>( + 'RiskScore', + t.number.is, + (input, context): Either<t.Errors, number> => { + return typeof input === 'number' && Number.isSafeInteger(input) && input >= 0 && input <= 100 + ? t.success(input) + : t.failure(input, context); + }, + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/risk_score_mapping/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/risk_score_mapping/index.ts new file mode 100644 index 0000000000000..0856806d48989 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/risk_score_mapping/index.ts @@ -0,0 +1,23 @@ +/* + * 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 * as t from 'io-ts'; +import { operator } from '@kbn/securitysolution-io-ts-types'; +import { RiskScore } from '../risk_score'; + +export type RiskScoreMappingItem = t.TypeOf<typeof RiskScoreMappingItem>; +export const RiskScoreMappingItem = t.exact( + t.type({ + field: t.string, + value: t.string, + operator, + risk_score: t.union([RiskScore, t.undefined]), + }) +); + +export type RiskScoreMapping = t.TypeOf<typeof RiskScoreMapping>; +export const RiskScoreMapping = t.array(RiskScoreMappingItem); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/rule_schedule/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/rule_schedule/index.ts new file mode 100644 index 0000000000000..16bc6dc153104 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/rule_schedule/index.ts @@ -0,0 +1,21 @@ +/* + * 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 * as t from 'io-ts'; +import { From } from '../from'; + +export type RuleInterval = t.TypeOf<typeof RuleInterval>; +export const RuleInterval = t.string; // we need a more specific schema + +export type RuleIntervalFrom = t.TypeOf<typeof RuleIntervalFrom>; +export const RuleIntervalFrom = From; + +/** + * TODO: Create a regular expression type or custom date math part type here + */ +export type RuleIntervalTo = t.TypeOf<typeof RuleIntervalTo>; +export const RuleIntervalTo = t.string; // we need a more specific schema diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/saved_object_attributes/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/saved_object_attributes/index.ts new file mode 100644 index 0000000000000..33db222f098e1 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/saved_object_attributes/index.ts @@ -0,0 +1,62 @@ +/* + * 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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; + +/** + * TODO: This type are originally from "src/core/types/saved_objects.ts", once that is package friendly remove + * this copied type. + * + * Don't use this type, it's simply a helper type for {@link SavedObjectAttribute} + * + * @public + */ +export type SavedObjectAttributeSingle = + | string + | number + | boolean + | null + | undefined + | SavedObjectAttributes; + +/** + * TODO: This type are originally from "src/core/types/saved_objects.ts", once that is package friendly remove + * this copied type. + * + * Type definition for a Saved Object attribute value + * + * @public + */ +export type SavedObjectAttribute = SavedObjectAttributeSingle | SavedObjectAttributeSingle[]; + +/** + * TODO: This type are originally from "src/core/types/saved_objects.ts", once that is package friendly remove + * this copied type. + * + * The data for a Saved Object is stored as an object in the `attributes` + * property. + * + * @public + */ +export interface SavedObjectAttributes { + [key: string]: SavedObjectAttribute; +} + +export const saved_object_attribute_single: t.Type<SavedObjectAttributeSingle> = t.recursion( + 'saved_object_attribute_single', + () => t.union([t.string, t.number, t.boolean, t.null, t.undefined, saved_object_attributes]) +); +export const saved_object_attribute: t.Type<SavedObjectAttribute> = t.recursion( + 'saved_object_attribute', + () => t.union([saved_object_attribute_single, t.array(saved_object_attribute_single)]) +); +export const saved_object_attributes: t.Type<SavedObjectAttributes> = t.recursion( + 'saved_object_attributes', + () => t.record(t.string, saved_object_attribute) +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/severity/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/severity/index.ts new file mode 100644 index 0000000000000..1b27423eb0dba --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/severity/index.ts @@ -0,0 +1,11 @@ +/* + * 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 * as t from 'io-ts'; + +export type Severity = t.TypeOf<typeof Severity>; +export const Severity = t.keyof({ low: null, medium: null, high: null, critical: null }); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/severity_mapping/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/severity_mapping/index.ts new file mode 100644 index 0000000000000..4256314b32a2c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/severity_mapping/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 * as t from 'io-ts'; + +import { operator } from '@kbn/securitysolution-io-ts-types'; +import { Severity } from '../severity'; + +export type SeverityMappingItem = t.TypeOf<typeof SeverityMappingItem>; +export const SeverityMappingItem = t.exact( + t.type({ + field: t.string, + operator, + value: t.string, + severity: Severity, + }) +); + +export type SeverityMapping = t.TypeOf<typeof SeverityMapping>; +export const SeverityMapping = t.array(SeverityMappingItem); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/threat/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/threat/index.ts new file mode 100644 index 0000000000000..4b5b7aa16c2dc --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/threat/index.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; +import { threat_tactic } from '../threat_tactic'; +import { threat_techniques } from '../threat_technique'; + +export const threat_framework = t.string; + +export const threat = t.intersection([ + t.exact( + t.type({ + framework: threat_framework, + tactic: threat_tactic, + }) + ), + t.exact( + t.partial({ + technique: threat_techniques, + }) + ), +]); + +export type Threat = t.TypeOf<typeof threat>; + +export const threats = t.array(threat); +export type Threats = t.TypeOf<typeof threats>; + +export const threatsOrUndefined = t.union([threats, t.undefined]); +export type ThreatsOrUndefined = t.TypeOf<typeof threatsOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_mapping/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_mapping/index.test.ts new file mode 100644 index 0000000000000..781b5b89ebe6c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_mapping/index.test.ts @@ -0,0 +1,235 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { + concurrent_searches, + items_per_search, + ThreatMapping, + threatMappingEntries, + ThreatMappingEntries, + threat_mapping, +} from '.'; +import { foldLeftRight, getPaths, exactCheck } from '@kbn/securitysolution-io-ts-utils'; + +describe('threat_mapping', () => { + describe('threatMappingEntries', () => { + test('it should validate an entry', () => { + const payload: ThreatMappingEntries = [ + { + field: 'field.one', + type: 'mapping', + value: 'field.one', + }, + ]; + const decoded = threatMappingEntries.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should fail validation with an extra entry item', () => { + const payload: Array<ThreatMappingEntries[0] & { extra: string }> = [ + { + field: 'field.one', + type: 'mapping', + value: 'field.one', + extra: 'blah', + }, + ]; + const decoded = threatMappingEntries.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extra"']); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation with a non string', () => { + const payload = [ + { + field: 5, + type: 'mapping', + value: 'field.one', + }, + ] as unknown as ThreatMappingEntries[]; + const decoded = threatMappingEntries.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "5" supplied to "field"']); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation with a wrong type', () => { + const payload = [ + { + field: 'field.one', + type: 'invalid', + value: 'field.one', + }, + ] as unknown as ThreatMappingEntries[]; + const decoded = threatMappingEntries.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "invalid" supplied to "type"', + ]); + expect(message.schema).toEqual({}); + }); + }); + + describe('threat_mapping', () => { + test('it should validate a threat mapping', () => { + const payload: ThreatMapping = [ + { + entries: [ + { + field: 'field.one', + type: 'mapping', + value: 'field.one', + }, + ], + }, + ]; + const decoded = threat_mapping.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + }); + + test('it should fail validate with an extra key', () => { + const payload: Array<ThreatMapping[0] & { extra: string }> = [ + { + entries: [ + { + field: 'field.one', + type: 'mapping', + value: 'field.one', + }, + ], + extra: 'invalid', + }, + ]; + + const decoded = threat_mapping.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extra"']); + expect(message.schema).toEqual({}); + }); + + test('it should fail validate with an extra inner entry', () => { + const payload: Array<ThreatMapping[0] & { entries: Array<{ extra: string }> }> = [ + { + entries: [ + { + field: 'field.one', + type: 'mapping', + value: 'field.one', + extra: 'blah', + }, + ], + }, + ]; + + const decoded = threat_mapping.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extra"']); + expect(message.schema).toEqual({}); + }); + + test('it should fail validate with an extra inner entry with the wrong data type', () => { + const payload = [ + { + entries: [ + { + field: 5, + type: 'mapping', + value: 'field.one', + }, + ], + }, + ] as unknown as ThreatMapping; + + const decoded = threat_mapping.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "5" supplied to "entries,field"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should fail validate with empty array', () => { + const payload: string[] = []; + + const decoded = threat_mapping.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "[]" supplied to "NonEmptyArray<ThreatMap>"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation when concurrent_searches is < 0', () => { + const payload = -1; + const decoded = concurrent_searches.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "-1" supplied to "PositiveIntegerGreaterThanZero"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation when concurrent_searches is 0', () => { + const payload = 0; + const decoded = concurrent_searches.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "0" supplied to "PositiveIntegerGreaterThanZero"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation when items_per_search is 0', () => { + const payload = 0; + const decoded = items_per_search.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "0" supplied to "PositiveIntegerGreaterThanZero"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation when items_per_search is < 0', () => { + const payload = -1; + const decoded = items_per_search.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "-1" supplied to "PositiveIntegerGreaterThanZero"', + ]); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_mapping/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_mapping/index.ts new file mode 100644 index 0000000000000..3bf4f84aeec8e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_mapping/index.ts @@ -0,0 +1,77 @@ +/* + * 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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; +import { + NonEmptyArray, + NonEmptyString, + PositiveIntegerGreaterThanZero, +} from '@kbn/securitysolution-io-ts-types'; +import { language } from '../language'; + +export const threat_query = t.string; +export type ThreatQuery = t.TypeOf<typeof threat_query>; +export const threatQueryOrUndefined = t.union([threat_query, t.undefined]); +export type ThreatQueryOrUndefined = t.TypeOf<typeof threatQueryOrUndefined>; + +export const threat_indicator_path = t.string; +export type ThreatIndicatorPath = t.TypeOf<typeof threat_indicator_path>; +export const threatIndicatorPathOrUndefined = t.union([threat_indicator_path, t.undefined]); +export type ThreatIndicatorPathOrUndefined = t.TypeOf<typeof threatIndicatorPathOrUndefined>; + +export const threat_filters = t.array(t.unknown); // Filters are not easily type-able yet +export type ThreatFilters = t.TypeOf<typeof threat_filters>; +export const threatFiltersOrUndefined = t.union([threat_filters, t.undefined]); +export type ThreatFiltersOrUndefined = t.TypeOf<typeof threatFiltersOrUndefined>; + +export const threatMapEntry = t.exact( + t.type({ + field: NonEmptyString, + type: t.keyof({ mapping: null }), + value: NonEmptyString, + }) +); + +export type ThreatMapEntry = t.TypeOf<typeof threatMapEntry>; + +export const threatMappingEntries = t.array(threatMapEntry); +export type ThreatMappingEntries = t.TypeOf<typeof threatMappingEntries>; + +export const threatMap = t.exact( + t.type({ + entries: threatMappingEntries, + }) +); +export type ThreatMap = t.TypeOf<typeof threatMap>; + +export const threat_mapping = NonEmptyArray(threatMap, 'NonEmptyArray<ThreatMap>'); +export type ThreatMapping = t.TypeOf<typeof threat_mapping>; + +export const threatMappingOrUndefined = t.union([threat_mapping, t.undefined]); +export type ThreatMappingOrUndefined = t.TypeOf<typeof threatMappingOrUndefined>; + +export const threat_index = t.array(t.string); +export type ThreatIndex = t.TypeOf<typeof threat_index>; +export const threatIndexOrUndefined = t.union([threat_index, t.undefined]); +export type ThreatIndexOrUndefined = t.TypeOf<typeof threatIndexOrUndefined>; + +export const threat_language = t.union([language, t.undefined]); +export type ThreatLanguage = t.TypeOf<typeof threat_language>; +export const threatLanguageOrUndefined = t.union([threat_language, t.undefined]); +export type ThreatLanguageOrUndefined = t.TypeOf<typeof threatLanguageOrUndefined>; + +export const concurrent_searches = PositiveIntegerGreaterThanZero; +export type ConcurrentSearches = t.TypeOf<typeof concurrent_searches>; +export const concurrentSearchesOrUndefined = t.union([concurrent_searches, t.undefined]); +export type ConcurrentSearchesOrUndefined = t.TypeOf<typeof concurrentSearchesOrUndefined>; + +export const items_per_search = PositiveIntegerGreaterThanZero; +export type ItemsPerSearch = t.TypeOf<typeof concurrent_searches>; +export const itemsPerSearchOrUndefined = t.union([items_per_search, t.undefined]); +export type ItemsPerSearchOrUndefined = t.TypeOf<typeof itemsPerSearchOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_subtechnique/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_subtechnique/index.ts new file mode 100644 index 0000000000000..b5f2d95a139b5 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_subtechnique/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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; + +export const threat_subtechnique_id = t.string; +export const threat_subtechnique_name = t.string; +export const threat_subtechnique_reference = t.string; + +export const threat_subtechnique = t.type({ + id: threat_subtechnique_id, + name: threat_subtechnique_name, + reference: threat_subtechnique_reference, +}); + +export const threat_subtechniques = t.array(threat_subtechnique); + +export type ThreatSubtechnique = t.TypeOf<typeof threat_subtechnique>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_tactic/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_tactic/index.ts new file mode 100644 index 0000000000000..a4c63cb632892 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_tactic/index.ts @@ -0,0 +1,20 @@ +/* + * 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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; + +export const threat_tactic_id = t.string; +export const threat_tactic_name = t.string; +export const threat_tactic_reference = t.string; + +export const threat_tactic = t.type({ + id: threat_tactic_id, + name: threat_tactic_name, + reference: threat_tactic_reference, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_technique/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_technique/index.ts new file mode 100644 index 0000000000000..992c5b15ba655 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/threat_technique/index.ts @@ -0,0 +1,33 @@ +/* + * 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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; +import { threat_subtechniques } from '../threat_subtechnique'; + +export const threat_technique_id = t.string; +export const threat_technique_name = t.string; +export const threat_technique_reference = t.string; + +export const threat_technique = t.intersection([ + t.exact( + t.type({ + id: threat_technique_id, + name: threat_technique_name, + reference: threat_technique_reference, + }) + ), + t.exact( + t.partial({ + subtechnique: threat_subtechniques, + }) + ), +]); +export const threat_techniques = t.array(threat_technique); + +export type ThreatTechnique = t.TypeOf<typeof threat_technique>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/throttle/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/throttle/index.ts new file mode 100644 index 0000000000000..b4be7a4a97ff7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/throttle/index.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 * as t from 'io-ts'; +import { TimeDuration } from '@kbn/securitysolution-io-ts-types'; + +export type RuleActionThrottle = t.TypeOf<typeof RuleActionThrottle>; +export const RuleActionThrottle = t.union([ + t.literal('no_actions'), + t.literal('rule'), + TimeDuration({ allowedUnits: ['s', 'm', 'h', 'd'] }), +]); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/type/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/type/index.ts new file mode 100644 index 0000000000000..92b71faf14fe8 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/type/index.ts @@ -0,0 +1,23 @@ +/* + * 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 * as t from 'io-ts'; + +export const type = t.keyof({ + eql: null, + machine_learning: null, + query: null, + saved_query: null, + threshold: null, + threat_match: null, + new_terms: null, + esql: null, +}); +export type Type = t.TypeOf<typeof type>; + +export const typeOrUndefined = t.union([type, t.undefined]); +export type TypeOrUndefined = t.TypeOf<typeof typeOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json new file mode 100644 index 0000000000000..9b61aea31d977 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts" + ], + "kbn_references": [ + "@kbn/securitysolution-io-ts-types", + "@kbn/securitysolution-io-ts-utils" + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/packages/kbn-securitysolution-io-ts-list-types/README.md b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/README.md similarity index 100% rename from packages/kbn-securitysolution-io-ts-list-types/README.md rename to x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/README.md diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/index.ts new file mode 100644 index 0000000000000..90db551881094 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/index.ts @@ -0,0 +1,11 @@ +/* + * 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. + */ + +export * from './src/common'; +export * from './src/request'; +export * from './src/response'; +export * from './src/typescript_types'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/jest.config.js b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/jest.config.js new file mode 100644 index 0000000000000..1e8525371d27c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/jest.config.js @@ -0,0 +1,12 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types'], +}; diff --git a/packages/kbn-securitysolution-io-ts-list-types/kibana.jsonc b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/kibana.jsonc similarity index 100% rename from packages/kbn-securitysolution-io-ts-list-types/kibana.jsonc rename to x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/kibana.jsonc diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/package.json b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/package.json new file mode 100644 index 0000000000000..da6c209015847 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/package.json @@ -0,0 +1,8 @@ +{ + "name": "@kbn/securitysolution-io-ts-list-types", + "version": "1.0.0", + "description": "io ts utilities and types to be shared with plugins from the security solution project", + "license": "Elastic License 2.0", + "private": true, + "sideEffects": false +} \ No newline at end of file diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/comment/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/comment/index.mock.ts new file mode 100644 index 0000000000000..69ad828a480ed --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/comment/index.mock.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 { Comment, CommentsArray } from '.'; +import { DATE_NOW, ID, USER } from '../../constants/index.mock'; + +export const getCommentsMock = (): Comment => ({ + comment: 'some old comment', + created_at: DATE_NOW, + created_by: USER, + id: ID, +}); + +export const getCommentsArrayMock = (): CommentsArray => [getCommentsMock(), getCommentsMock()]; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/comment/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/comment/index.test.ts new file mode 100644 index 0000000000000..32a230fcf586d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/comment/index.test.ts @@ -0,0 +1,236 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { getCommentsArrayMock, getCommentsMock } from './index.mock'; +import { + Comment, + comment, + CommentsArray, + commentsArray, + CommentsArrayOrUndefined, + commentsArrayOrUndefined, +} from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { DATE_NOW } from '../../constants/index.mock'; + +describe('Comment', () => { + describe('comment', () => { + test('it fails validation when "id" is undefined', () => { + const payload = { ...getCommentsMock(), id: undefined }; + const decoded = comment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it passes validation with a typical comment', () => { + const payload = getCommentsMock(); + const decoded = comment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it passes validation with "updated_at" and "updated_by" fields included', () => { + const payload = getCommentsMock(); + payload.updated_at = DATE_NOW; + payload.updated_by = 'someone'; + const decoded = comment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it fails validation when undefined', () => { + const payload = undefined; + const decoded = comment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>)"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it fails validation when "comment" is an empty string', () => { + const payload: Omit<Comment, 'comment'> & { comment: string } = { + ...getCommentsMock(), + comment: '', + }; + const decoded = comment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "comment"']); + expect(message.schema).toEqual({}); + }); + + test('it fails validation when "comment" is not a string', () => { + const payload: Omit<Comment, 'comment'> & { comment: string[] } = { + ...getCommentsMock(), + comment: ['some value'], + }; + const decoded = comment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "["some value"]" supplied to "comment"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it fails validation when "created_at" is not a string', () => { + const payload: Omit<Comment, 'created_at'> & { created_at: number } = { + ...getCommentsMock(), + created_at: 1, + }; + const decoded = comment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "created_at"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it fails validation when "created_by" is not a string', () => { + const payload: Omit<Comment, 'created_by'> & { created_by: number } = { + ...getCommentsMock(), + created_by: 1, + }; + const decoded = comment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "created_by"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it fails validation when "updated_at" is not a string', () => { + const payload: Omit<Comment, 'updated_at'> & { updated_at: number } = { + ...getCommentsMock(), + updated_at: 1, + }; + const decoded = comment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "updated_at"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it fails validation when "updated_by" is not a string', () => { + const payload: Omit<Comment, 'updated_by'> & { updated_by: number } = { + ...getCommentsMock(), + updated_by: 1, + }; + const decoded = comment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "updated_by"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should strip out extra keys', () => { + const payload: Comment & { + extraKey?: string; + } = getCommentsMock(); + payload.extraKey = 'some value'; + const decoded = comment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getCommentsMock()); + }); + }); + + describe('commentsArray', () => { + test('it passes validation an array of Comment', () => { + const payload = getCommentsArrayMock(); + const decoded = commentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it passes validation when a Comment includes "updated_at" and "updated_by"', () => { + const commentsPayload = getCommentsMock(); + commentsPayload.updated_at = DATE_NOW; + commentsPayload.updated_by = 'someone'; + const payload = [{ ...commentsPayload }, ...getCommentsArrayMock()]; + const decoded = commentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it fails validation when undefined', () => { + const payload = undefined; + const decoded = commentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "Array<({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>)>"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it fails validation when array includes non Comment types', () => { + const payload = [1] as unknown as CommentsArray; + const decoded = commentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "Array<({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>)>"', + ]); + expect(message.schema).toEqual({}); + }); + }); + + describe('commentsArrayOrUndefined', () => { + test('it passes validation an array of Comment', () => { + const payload = getCommentsArrayMock(); + const decoded = commentsArrayOrUndefined.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it passes validation when undefined', () => { + const payload = undefined; + const decoded = commentsArrayOrUndefined.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it fails validation when array includes non Comment types', () => { + const payload = [1] as unknown as CommentsArrayOrUndefined; + const decoded = commentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "Array<({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>)>"', + ]); + expect(message.schema).toEqual({}); + }); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/comment/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/comment/index.ts new file mode 100644 index 0000000000000..48bce8fabafe7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/comment/index.ts @@ -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 * as t from 'io-ts'; + +import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; +import { created_at } from '../created_at'; +import { created_by } from '../created_by'; +import { id } from '../id'; +import { updated_at } from '../updated_at'; +import { updated_by } from '../updated_by'; + +export const comment = t.intersection([ + t.exact( + t.type({ + comment: NonEmptyString, + created_at, + created_by, + id, + }) + ), + t.exact( + t.partial({ + updated_at, + updated_by, + }) + ), +]); + +export const commentsArray = t.array(comment); +export type CommentsArray = t.TypeOf<typeof commentsArray>; +export type Comment = t.TypeOf<typeof comment>; +export const commentsArrayOrUndefined = t.union([commentsArray, t.undefined]); +export type CommentsArrayOrUndefined = t.TypeOf<typeof commentsArrayOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/create_comment/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/create_comment/index.mock.ts new file mode 100644 index 0000000000000..67be8d1f15da4 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/create_comment/index.mock.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 { CreateComment, CreateCommentsArray } from '.'; + +export const getCreateCommentsMock = (): CreateComment => ({ + comment: 'some comments', +}); + +export const getCreateCommentsArrayMock = (): CreateCommentsArray => [getCreateCommentsMock()]; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/create_comment/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/create_comment/index.test.ts new file mode 100644 index 0000000000000..15fab1c35a19c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/create_comment/index.test.ts @@ -0,0 +1,133 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { getCreateCommentsArrayMock, getCreateCommentsMock } from './index.mock'; +import { + CreateComment, + createComment, + CreateCommentsArray, + createCommentsArray, + CreateCommentsArrayOrUndefined, + createCommentsArrayOrUndefined, +} from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('CreateComment', () => { + describe('createComment', () => { + test('it passes validation with a default comment', () => { + const payload = getCreateCommentsMock(); + const decoded = createComment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it fails validation when undefined', () => { + const payload = undefined; + const decoded = createComment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "{| comment: NonEmptyString |}"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it fails validation when "comment" is not a string', () => { + const payload: Omit<CreateComment, 'comment'> & { comment: string[] } = { + ...getCreateCommentsMock(), + comment: ['some value'], + }; + const decoded = createComment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "["some value"]" supplied to "comment"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should strip out extra keys', () => { + const payload: CreateComment & { + extraKey?: string; + } = getCreateCommentsMock(); + payload.extraKey = 'some value'; + const decoded = createComment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getCreateCommentsMock()); + }); + }); + + describe('createCommentsArray', () => { + test('it passes validation an array of comments', () => { + const payload = getCreateCommentsArrayMock(); + const decoded = createCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it fails validation when undefined', () => { + const payload = undefined; + const decoded = createCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "Array<{| comment: NonEmptyString |}>"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it fails validation when array includes non comments types', () => { + const payload = [1] as unknown as CreateCommentsArray; + const decoded = createCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "Array<{| comment: NonEmptyString |}>"', + ]); + expect(message.schema).toEqual({}); + }); + }); + + describe('createCommentsArrayOrUndefined', () => { + test('it passes validation an array of comments', () => { + const payload = getCreateCommentsArrayMock(); + const decoded = createCommentsArrayOrUndefined.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it passes validation when undefined', () => { + const payload = undefined; + const decoded = createCommentsArrayOrUndefined.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it fails validation when array includes non comments types', () => { + const payload = [1] as unknown as CreateCommentsArrayOrUndefined; + const decoded = createCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "Array<{| comment: NonEmptyString |}>"', + ]); + expect(message.schema).toEqual({}); + }); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/create_comment/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/create_comment/index.ts new file mode 100644 index 0000000000000..e0942203bac66 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/create_comment/index.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 * as t from 'io-ts'; +import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; + +export const createComment = t.exact( + t.type({ + comment: NonEmptyString, + }) +); + +export type CreateComment = t.TypeOf<typeof createComment>; +export const createCommentsArray = t.array(createComment); +export type CreateCommentsArray = t.TypeOf<typeof createCommentsArray>; +export type CreateComments = t.TypeOf<typeof createComment>; +export const createCommentsArrayOrUndefined = t.union([createCommentsArray, t.undefined]); +export type CreateCommentsArrayOrUndefined = t.TypeOf<typeof createCommentsArrayOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/created_at/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/created_at/index.ts new file mode 100644 index 0000000000000..e962946e447e8 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/created_at/index.ts @@ -0,0 +1,12 @@ +/* + * 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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; + +export const created_at = t.string; // TODO: Make this into an ISO Date string check diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/created_by/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/created_by/index.ts new file mode 100644 index 0000000000000..ccf8d816f8e82 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/created_by/index.ts @@ -0,0 +1,12 @@ +/* + * 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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; + +export const created_by = t.string; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/cursor/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/cursor/index.ts new file mode 100644 index 0000000000000..626b510ec8958 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/cursor/index.ts @@ -0,0 +1,13 @@ +/* + * 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 * as t from 'io-ts'; + +export const cursor = t.string; +export type Cursor = t.TypeOf<typeof cursor>; +export const cursorOrUndefined = t.union([cursor, t.undefined]); +export type CursorOrUndefined = t.TypeOf<typeof cursorOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_comments_array/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_comments_array/index.test.ts new file mode 100644 index 0000000000000..af9f342c15e55 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_comments_array/index.test.ts @@ -0,0 +1,64 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { CommentsArray } from '../comment'; +import { DefaultCommentsArray } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { getCommentsArrayMock } from '../comment/index.mock'; + +describe('default_comments_array', () => { + test('it should pass validation when supplied an empty array', () => { + const payload: CommentsArray = []; + const decoded = DefaultCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should pass validation when supplied an array of comments', () => { + const payload: CommentsArray = getCommentsArrayMock(); + const decoded = DefaultCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should fail validation when supplied an array of numbers', () => { + const payload = [1]; + const decoded = DefaultCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "Array<({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>)>"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation when supplied an array of strings', () => { + const payload = ['some string']; + const decoded = DefaultCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "some string" supplied to "Array<({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>)>"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should return a default array entry', () => { + const payload = null; + const decoded = DefaultCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual([]); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_comments_array/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_comments_array/index.ts new file mode 100644 index 0000000000000..af1576237b9ca --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_comments_array/index.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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { comment, CommentsArray } from '../comment'; + +/** + * Types the DefaultCommentsArray as: + * - If null or undefined, then a default array of type entry will be set + */ +export const DefaultCommentsArray = new t.Type<CommentsArray, CommentsArray, unknown>( + 'DefaultCommentsArray', + t.array(comment).is, + (input): Either<t.Errors, CommentsArray> => + input == null ? t.success([]) : t.array(comment).decode(input), + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_create_comments_array/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_create_comments_array/index.test.ts new file mode 100644 index 0000000000000..9f4aba07c9bf1 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_create_comments_array/index.test.ts @@ -0,0 +1,64 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { CommentsArray } from '../comment'; +import { DefaultCommentsArray } from '../default_comments_array'; +import { getCommentsArrayMock } from '../comment/index.mock'; + +describe('default_comments_array', () => { + test('it should pass validation when supplied an empty array', () => { + const payload: CommentsArray = []; + const decoded = DefaultCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should pass validation when supplied an array of comments', () => { + const payload: CommentsArray = getCommentsArrayMock(); + const decoded = DefaultCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should fail validation when supplied an array of numbers', () => { + const payload = [1]; + const decoded = DefaultCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "Array<({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>)>"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation when supplied an array of strings', () => { + const payload = ['some string']; + const decoded = DefaultCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "some string" supplied to "Array<({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>)>"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should return a default array entry', () => { + const payload = null; + const decoded = DefaultCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual([]); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_create_comments_array/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_create_comments_array/index.ts new file mode 100644 index 0000000000000..5b825578191f9 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_create_comments_array/index.ts @@ -0,0 +1,26 @@ +/* + * 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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { createComment, CreateCommentsArray } from '../create_comment'; + +/** + * Types the DefaultCreateComments as: + * - If null or undefined, then a default array of type entry will be set + */ +export const DefaultCreateCommentsArray = new t.Type< + CreateCommentsArray, + CreateCommentsArray, + unknown +>( + 'DefaultCreateComments', + t.array(createComment).is, + (input): Either<t.Errors, CreateCommentsArray> => + input == null ? t.success([]) : t.array(createComment).decode(input), + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_import_comments_array/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_import_comments_array/index.test.ts new file mode 100644 index 0000000000000..ea59988dfe0c5 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_import_comments_array/index.test.ts @@ -0,0 +1,86 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { ImportCommentsArray } from '../import_comment'; +import { DefaultImportCommentsArray } from '.'; +import { getCommentsArrayMock } from '../comment/index.mock'; +import { getCreateCommentsArrayMock } from '../create_comment/index.mock'; + +describe('default_import_comments_array', () => { + test('it should pass validation when supplied an empty array', () => { + const payload: ImportCommentsArray = []; + const decoded = DefaultImportCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should pass validation when supplied an array of comments', () => { + const payload: ImportCommentsArray = getCommentsArrayMock(); + const decoded = DefaultImportCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should pass validation when supplied an array of new comments', () => { + const payload: ImportCommentsArray = getCreateCommentsArrayMock(); + const decoded = DefaultImportCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should pass validation when supplied an array of new and existing comments', () => { + const payload: ImportCommentsArray = [ + ...getCommentsArrayMock(), + ...getCreateCommentsArrayMock(), + ]; + const decoded = DefaultImportCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should fail validation when supplied an array of numbers', () => { + const payload = [1]; + const decoded = DefaultImportCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "DefaultImportComments"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation when supplied an array of strings', () => { + const payload = ['some string']; + const decoded = DefaultImportCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "some string" supplied to "DefaultImportComments"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should return a default array entry', () => { + const payload = null; + const decoded = DefaultImportCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual([]); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_import_comments_array/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_import_comments_array/index.ts new file mode 100644 index 0000000000000..135288c2dd3f5 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_import_comments_array/index.ts @@ -0,0 +1,26 @@ +/* + * 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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { importComment, ImportCommentsArray } from '../import_comment'; + +/** + * Types the DefaultImportCommentsArray as: + * - If null or undefined, then a default array of type ImportCommentsArray will be set + */ +export const DefaultImportCommentsArray = new t.Type< + ImportCommentsArray, + ImportCommentsArray, + unknown +>( + 'DefaultImportComments', + t.array(importComment).is, + (input, context): Either<t.Errors, ImportCommentsArray> => + input == null ? t.success([]) : t.array(importComment).validate(input, context), + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace/index.test.ts new file mode 100644 index 0000000000000..fc271855fc12e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace/index.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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { DefaultNamespace } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('default_namespace', () => { + test('it should validate "single"', () => { + const payload = 'single'; + const decoded = DefaultNamespace.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate "agnostic"', () => { + const payload = 'agnostic'; + const decoded = DefaultNamespace.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it defaults to "single" if "undefined"', () => { + const payload = undefined; + const decoded = DefaultNamespace.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual('single'); + }); + + test('it defaults to "single" if "null"', () => { + const payload = null; + const decoded = DefaultNamespace.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual('single'); + }); + + test('it should FAIL validation if not "single" or "agnostic"', () => { + const payload = 'something else'; + const decoded = DefaultNamespace.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + `Invalid value "something else" supplied to "DefaultNamespace"`, + ]); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace/index.ts new file mode 100644 index 0000000000000..667ddbb82253d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace/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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; + +export const namespaceType = t.keyof({ agnostic: null, single: null }); +export type NamespaceType = t.TypeOf<typeof namespaceType>; + +/** + * Types the DefaultNamespace as: + * - If null or undefined, then a default string/enumeration of "single" will be used. + */ +export const DefaultNamespace = new t.Type<NamespaceType, NamespaceType | undefined, unknown>( + 'DefaultNamespace', + namespaceType.is, + (input, context): Either<t.Errors, NamespaceType> => + input == null ? t.success('single') : namespaceType.validate(input, context), + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace_array/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace_array/index.test.ts new file mode 100644 index 0000000000000..cb7012503d382 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace_array/index.test.ts @@ -0,0 +1,98 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { DefaultNamespaceArray, DefaultNamespaceArrayType } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('default_namespace_array', () => { + test('it should validate "null" single item as an array with a "single" value', () => { + const payload: DefaultNamespaceArrayType = null; + const decoded = DefaultNamespaceArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(['single']); + }); + + test('it should FAIL validation of numeric value', () => { + const payload = 5; + const decoded = DefaultNamespaceArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "5" supplied to "DefaultNamespaceArray"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should validate "undefined" item as an array with a "single" value', () => { + const payload: DefaultNamespaceArrayType = undefined; + const decoded = DefaultNamespaceArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(['single']); + }); + + test('it should validate "single" as an array of a "single" value', () => { + const payload: DefaultNamespaceArrayType = 'single'; + const decoded = DefaultNamespaceArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual([payload]); + }); + + test('it should validate "agnostic" as an array of a "agnostic" value', () => { + const payload: DefaultNamespaceArrayType = 'agnostic'; + const decoded = DefaultNamespaceArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual([payload]); + }); + + test('it should validate "single,agnostic" as an array of 2 values of ["single", "agnostic"] values', () => { + const payload: DefaultNamespaceArrayType = 'agnostic,single'; + const decoded = DefaultNamespaceArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(['agnostic', 'single']); + }); + + test('it should validate 3 elements of "single,agnostic,single" as an array of 3 values of ["single", "agnostic", "single"] values', () => { + const payload: DefaultNamespaceArrayType = 'single,agnostic,single'; + const decoded = DefaultNamespaceArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(['single', 'agnostic', 'single']); + }); + + test('it should validate 3 elements of "single,agnostic, single" as an array of 3 values of ["single", "agnostic", "single"] values when there are spaces', () => { + const payload: DefaultNamespaceArrayType = ' single, agnostic, single '; + const decoded = DefaultNamespaceArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(['single', 'agnostic', 'single']); + }); + + test('it should FAIL validation when given 3 elements of "single,agnostic,junk" since the 3rd value is junk', () => { + const payload: DefaultNamespaceArrayType = 'single,agnostic,junk'; + const decoded = DefaultNamespaceArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "junk" supplied to "DefaultNamespaceArray"', + ]); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace_array/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace_array/index.ts new file mode 100644 index 0000000000000..494c6025f198e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_namespace_array/index.ts @@ -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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { namespaceType } from '../default_namespace'; + +export const namespaceTypeArray = t.array(namespaceType); +export type NamespaceTypeArray = t.TypeOf<typeof namespaceTypeArray>; + +/** + * Types the DefaultNamespaceArray as: + * - If null or undefined, then a default string array of "single" will be used. + * - If it contains a string, then it is split along the commas and puts them into an array and validates it + */ +export const DefaultNamespaceArray = new t.Type< + NamespaceTypeArray, + string | undefined | null, + unknown +>( + 'DefaultNamespaceArray', + namespaceTypeArray.is, + (input, context): Either<t.Errors, NamespaceTypeArray> => { + if (input == null) { + return t.success(['single']); + } else if (typeof input === 'string') { + const commaSeparatedValues = input + .trim() + .split(',') + .map((value) => value.trim()); + return namespaceTypeArray.validate(commaSeparatedValues, context); + } + return t.failure(input, context); + }, + String +); + +export type DefaultNamespaceArrayType = t.OutputOf<typeof DefaultNamespaceArray>; +export type DefaultNamespaceArrayTypeDecoded = t.TypeOf<typeof DefaultNamespaceArray>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_update_comments_array/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_update_comments_array/index.test.ts new file mode 100644 index 0000000000000..3cced7284425c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_update_comments_array/index.test.ts @@ -0,0 +1,64 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { UpdateCommentsArray } from '../update_comment'; +import { DefaultUpdateCommentsArray } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { getUpdateCommentsArrayMock } from '../update_comment/index.mock'; + +describe('default_update_comments_array', () => { + test('it should pass validation when supplied an empty array', () => { + const payload: UpdateCommentsArray = []; + const decoded = DefaultUpdateCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should pass validation when supplied an array of comments', () => { + const payload: UpdateCommentsArray = getUpdateCommentsArrayMock(); + const decoded = DefaultUpdateCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should fail validation when supplied an array of numbers', () => { + const payload = [1]; + const decoded = DefaultUpdateCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "DefaultUpdateComments"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation when supplied an array of strings', () => { + const payload = ['some string']; + const decoded = DefaultUpdateCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "some string" supplied to "DefaultUpdateComments"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should return a default array entry', () => { + const payload = null; + const decoded = DefaultUpdateCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual([]); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_update_comments_array/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_update_comments_array/index.ts new file mode 100644 index 0000000000000..28edd4af353e6 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/default_update_comments_array/index.ts @@ -0,0 +1,26 @@ +/* + * 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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { updateCommentsArray, UpdateCommentsArray } from '../update_comment'; + +/** + * Types the DefaultUpdateComments as: + * - If null or undefined, then a default array of type UpdateCommentsArray will be set + */ +export const DefaultUpdateCommentsArray = new t.Type< + UpdateCommentsArray, + UpdateCommentsArray, + unknown +>( + 'DefaultUpdateComments', + updateCommentsArray.is, + (input, context): Either<t.Errors, UpdateCommentsArray> => + input == null ? t.success([]) : updateCommentsArray.validate(input, context), + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/description/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/description/index.ts new file mode 100644 index 0000000000000..adba3ae0ef4fa --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/description/index.ts @@ -0,0 +1,13 @@ +/* + * 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 * as t from 'io-ts'; + +export const description = t.string; +export type Description = t.TypeOf<typeof description>; +export const descriptionOrUndefined = t.union([description, t.undefined]); +export type DescriptionOrUndefined = t.TypeOf<typeof descriptionOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/deserializer/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/deserializer/index.ts new file mode 100644 index 0000000000000..4956736b5cf4e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/deserializer/index.ts @@ -0,0 +1,13 @@ +/* + * 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 * as t from 'io-ts'; + +export const deserializer = t.string; +export type Deserializer = t.TypeOf<typeof deserializer>; +export const deserializerOrUndefined = t.union([deserializer, t.undefined]); +export type DeserializerOrUndefined = t.TypeOf<typeof deserializerOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entries/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entries/index.mock.ts new file mode 100644 index 0000000000000..1d46d6412e122 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entries/index.mock.ts @@ -0,0 +1,19 @@ +/* + * 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 { EndpointEntriesArray } from '.'; +import { getEndpointEntryMatchMock } from '../entry_match/index.mock'; +import { getEndpointEntryMatchAnyMock } from '../entry_match_any/index.mock'; +import { getEndpointEntryNestedMock } from '../entry_nested/index.mock'; +import { getEndpointEntryMatchWildcardMock } from '../entry_match_wildcard/index.mock'; + +export const getEndpointEntriesArrayMock = (): EndpointEntriesArray => [ + getEndpointEntryMatchMock(), + getEndpointEntryMatchAnyMock(), + getEndpointEntryNestedMock(), + getEndpointEntryMatchWildcardMock(), +]; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entries/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entries/index.test.ts new file mode 100644 index 0000000000000..4a317d5c9152d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entries/index.test.ts @@ -0,0 +1,120 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { getEndpointEntryMatchMock } from '../entry_match/index.mock'; +import { + endpointEntriesArray, + nonEmptyEndpointEntriesArray, + NonEmptyEndpointEntriesArray, +} from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { getEndpointEntryMatchAnyMock } from '../entry_match_any/index.mock'; +import { getEndpointEntryNestedMock } from '../entry_nested/index.mock'; +import { getEndpointEntriesArrayMock } from './index.mock'; +import { getEntryListMock } from '../../entries_list/index.mock'; +import { getEntryExistsMock } from '../../entries_exist/index.mock'; +import { getEndpointEntryMatchWildcardMock } from '../entry_match_wildcard/index.mock'; + +describe('Endpoint', () => { + describe('entriesArray', () => { + test('it should validate an array with match entry', () => { + const payload = [getEndpointEntryMatchMock()]; + const decoded = endpointEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate an array with match_any entry', () => { + const payload = [getEndpointEntryMatchAnyMock()]; + const decoded = endpointEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT validate an empty array', () => { + const payload: NonEmptyEndpointEntriesArray = []; + const decoded = nonEmptyEndpointEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "[]" supplied to "NonEmptyEndpointEntriesArray"', + ]); + expect(message.schema).toEqual({}); + }); + + test('type guard for nonEmptyEndpointNestedEntries should allow array of endpoint entries', () => { + const payload: NonEmptyEndpointEntriesArray = [getEndpointEntryMatchAnyMock()]; + const guarded = nonEmptyEndpointEntriesArray.is(payload); + expect(guarded).toBeTruthy(); + }); + + test('type guard for nonEmptyEndpointNestedEntries should disallow empty arrays', () => { + const payload: NonEmptyEndpointEntriesArray = []; + const guarded = nonEmptyEndpointEntriesArray.is(payload); + expect(guarded).toBeFalsy(); + }); + + test('it should NOT validate an array with exists entry', () => { + const payload = [getEntryExistsMock()]; + const decoded = endpointEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "exists" supplied to "type"', + 'Invalid value "undefined" supplied to "value"', + 'Invalid value "undefined" supplied to "entries"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT validate an array with list entry', () => { + const payload = [getEntryListMock()]; + const decoded = endpointEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "list" supplied to "type"', + 'Invalid value "undefined" supplied to "value"', + 'Invalid value "undefined" supplied to "entries"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should validate an array with nested entry', () => { + const payload = [getEndpointEntryNestedMock()]; + const decoded = endpointEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate an array with wildcard entry', () => { + const payload = [getEndpointEntryMatchWildcardMock()]; + const decoded = endpointEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate an array with all types of entries', () => { + const payload = getEndpointEntriesArrayMock(); + const decoded = endpointEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entries/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entries/index.ts new file mode 100644 index 0000000000000..c9a74ae525734 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entries/index.ts @@ -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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { endpointEntryMatch } from '../entry_match'; +import { endpointEntryMatchAny } from '../entry_match_any'; +import { endpointEntryNested } from '../entry_nested'; +import { endpointEntryMatchWildcard } from '../entry_match_wildcard'; + +export const endpointEntriesArray = t.array( + t.union([ + endpointEntryMatch, + endpointEntryMatchAny, + endpointEntryMatchWildcard, + endpointEntryNested, + ]) +); +export type EndpointEntriesArray = t.TypeOf<typeof endpointEntriesArray>; + +/** + * Types the nonEmptyEndpointEntriesArray as: + * - An array of entries of length 1 or greater + * + */ +export const nonEmptyEndpointEntriesArray = new t.Type< + EndpointEntriesArray, + EndpointEntriesArray, + unknown +>( + 'NonEmptyEndpointEntriesArray', + (u: unknown): u is EndpointEntriesArray => endpointEntriesArray.is(u) && u.length > 0, + (input, context): Either<t.Errors, EndpointEntriesArray> => { + if (Array.isArray(input) && input.length === 0) { + return t.failure(input, context); + } else { + return endpointEntriesArray.validate(input, context); + } + }, + t.identity +); + +export type NonEmptyEndpointEntriesArray = t.OutputOf<typeof nonEmptyEndpointEntriesArray>; +export type NonEmptyEndpointEntriesArrayDecoded = t.TypeOf<typeof nonEmptyEndpointEntriesArray>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match/index.mock.ts new file mode 100644 index 0000000000000..ddcda0e1e2d98 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match/index.mock.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 { EndpointEntryMatch } from '.'; +import { ENTRY_VALUE, FIELD, MATCH, OPERATOR } from '../../../constants/index.mock'; + +export const getEndpointEntryMatchMock = (): EndpointEntryMatch => ({ + field: FIELD, + operator: OPERATOR, + type: MATCH, + value: ENTRY_VALUE, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match/index.test.ts new file mode 100644 index 0000000000000..561a36ab194c7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match/index.test.ts @@ -0,0 +1,101 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { getEndpointEntryMatchMock } from './index.mock'; +import { EndpointEntryMatch, endpointEntryMatch } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { getEntryMatchMock } from '../../entry_match/index.mock'; + +describe('endpointEntryMatch', () => { + test('it should validate an entry', () => { + const payload = getEndpointEntryMatchMock(); + const decoded = endpointEntryMatch.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT validate when "operator" is "excluded"', () => { + // Use the generic entry mock so we can test operator: excluded + const payload = getEntryMatchMock(); + payload.operator = 'excluded'; + const decoded = endpointEntryMatch.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "excluded" supplied to "operator"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "field" is empty string', () => { + const payload: Omit<EndpointEntryMatch, 'field'> & { field: string } = { + ...getEndpointEntryMatchMock(), + field: '', + }; + const decoded = endpointEntryMatch.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "field"']); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "value" is not string', () => { + const payload: Omit<EndpointEntryMatch, 'value'> & { value: string[] } = { + ...getEndpointEntryMatchMock(), + value: ['some value'], + }; + const decoded = endpointEntryMatch.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "["some value"]" supplied to "value"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "value" is empty string', () => { + const payload: Omit<EndpointEntryMatch, 'value'> & { value: string } = { + ...getEndpointEntryMatchMock(), + value: '', + }; + const decoded = endpointEntryMatch.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "value"']); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "type" is not "match"', () => { + const payload: Omit<EndpointEntryMatch, 'type'> & { type: string } = { + ...getEndpointEntryMatchMock(), + type: 'match_any', + }; + const decoded = endpointEntryMatch.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "match_any" supplied to "type"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should strip out extra keys', () => { + const payload: EndpointEntryMatch & { + extraKey?: string; + } = getEndpointEntryMatchMock(); + payload.extraKey = 'some value'; + const decoded = endpointEntryMatch.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getEntryMatchMock()); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match/index.ts new file mode 100644 index 0000000000000..7cc51636cf583 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match/index.ts @@ -0,0 +1,19 @@ +/* + * 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 * as t from 'io-ts'; +import { NonEmptyString, operatorIncluded } from '@kbn/securitysolution-io-ts-types'; + +export const endpointEntryMatch = t.exact( + t.type({ + field: NonEmptyString, + operator: operatorIncluded, + type: t.keyof({ match: null }), + value: NonEmptyString, + }) +); +export type EndpointEntryMatch = t.TypeOf<typeof endpointEntryMatch>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_any/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_any/index.mock.ts new file mode 100644 index 0000000000000..6c04a6b596d63 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_any/index.mock.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 { ENTRY_VALUE, FIELD, MATCH_ANY, OPERATOR } from '../../../constants/index.mock'; +import { EndpointEntryMatchAny } from '.'; + +export const getEndpointEntryMatchAnyMock = (): EndpointEntryMatchAny => ({ + field: FIELD, + operator: OPERATOR, + type: MATCH_ANY, + value: [ENTRY_VALUE], +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_any/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_any/index.test.ts new file mode 100644 index 0000000000000..feb04606adf9c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_any/index.test.ts @@ -0,0 +1,99 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { getEndpointEntryMatchAnyMock } from './index.mock'; +import { EndpointEntryMatchAny, endpointEntryMatchAny } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { getEntryMatchAnyMock } from '../../entry_match_any/index.mock'; + +describe('endpointEntryMatchAny', () => { + test('it should validate an entry', () => { + const payload = getEndpointEntryMatchAnyMock(); + const decoded = endpointEntryMatchAny.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT validate when operator is "excluded"', () => { + // Use the generic entry mock so we can test operator: excluded + const payload = getEntryMatchAnyMock(); + payload.operator = 'excluded'; + const decoded = endpointEntryMatchAny.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "excluded" supplied to "operator"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when field is empty string', () => { + const payload: Omit<EndpointEntryMatchAny, 'field'> & { field: string } = { + ...getEndpointEntryMatchAnyMock(), + field: '', + }; + const decoded = endpointEntryMatchAny.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "field"']); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when value is empty array', () => { + const payload: Omit<EndpointEntryMatchAny, 'value'> & { value: string[] } = { + ...getEndpointEntryMatchAnyMock(), + value: [], + }; + const decoded = endpointEntryMatchAny.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "[]" supplied to "value"']); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when value is not string array', () => { + const payload: Omit<EndpointEntryMatchAny, 'value'> & { value: string } = { + ...getEndpointEntryMatchAnyMock(), + value: 'some string', + }; + const decoded = endpointEntryMatchAny.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "some string" supplied to "value"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "type" is not "match_any"', () => { + const payload: Omit<EndpointEntryMatchAny, 'type'> & { type: string } = { + ...getEndpointEntryMatchAnyMock(), + type: 'match', + }; + const decoded = endpointEntryMatchAny.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "match" supplied to "type"']); + expect(message.schema).toEqual({}); + }); + + test('it should strip out extra keys', () => { + const payload: EndpointEntryMatchAny & { + extraKey?: string; + } = getEndpointEntryMatchAnyMock(); + payload.extraKey = 'some extra key'; + const decoded = endpointEntryMatchAny.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getEntryMatchAnyMock()); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_any/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_any/index.ts new file mode 100644 index 0000000000000..7d23e7338e71a --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_any/index.ts @@ -0,0 +1,23 @@ +/* + * 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 * as t from 'io-ts'; +import { + NonEmptyString, + nonEmptyOrNullableStringArray, + operatorIncluded, +} from '@kbn/securitysolution-io-ts-types'; + +export const endpointEntryMatchAny = t.exact( + t.type({ + field: NonEmptyString, + operator: operatorIncluded, + type: t.keyof({ match_any: null }), + value: nonEmptyOrNullableStringArray, + }) +); +export type EndpointEntryMatchAny = t.TypeOf<typeof endpointEntryMatchAny>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_wildcard/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_wildcard/index.mock.ts new file mode 100644 index 0000000000000..ca8f01d3e30e0 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_wildcard/index.mock.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 { ENTRY_VALUE, FIELD, OPERATOR, WILDCARD } from '../../../constants/index.mock'; +import { EndpointEntryMatchWildcard } from '.'; + +export const getEndpointEntryMatchWildcardMock = (): EndpointEntryMatchWildcard => ({ + field: FIELD, + operator: OPERATOR, + type: WILDCARD, + value: ENTRY_VALUE, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_wildcard/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_wildcard/index.test.ts new file mode 100644 index 0000000000000..95ea73b2aac11 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_wildcard/index.test.ts @@ -0,0 +1,96 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { getEndpointEntryMatchWildcardMock } from './index.mock'; +import { EndpointEntryMatchWildcard, endpointEntryMatchWildcard } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { getEntryMatchWildcardMock } from '../../entry_match_wildcard/index.mock'; + +describe('endpointEntryMatchWildcard', () => { + test('it should validate an entry', () => { + const payload = getEndpointEntryMatchWildcardMock(); + const decoded = endpointEntryMatchWildcard.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate when "operator" is "excluded"', () => { + const payload = getEntryMatchWildcardMock(); + payload.operator = 'excluded'; + const decoded = endpointEntryMatchWildcard.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should FAIL validation when "field" is empty string', () => { + const payload: Omit<EndpointEntryMatchWildcard, 'field'> & { field: string } = { + ...getEndpointEntryMatchWildcardMock(), + field: '', + }; + const decoded = endpointEntryMatchWildcard.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "field"']); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "value" is not string', () => { + const payload: Omit<EndpointEntryMatchWildcard, 'value'> & { value: string[] } = { + ...getEndpointEntryMatchWildcardMock(), + value: ['some value'], + }; + const decoded = endpointEntryMatchWildcard.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "["some value"]" supplied to "value"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "value" is empty string', () => { + const payload: Omit<EndpointEntryMatchWildcard, 'value'> & { value: string } = { + ...getEndpointEntryMatchWildcardMock(), + value: '', + }; + const decoded = endpointEntryMatchWildcard.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "value"']); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "type" is not "wildcard"', () => { + const payload: Omit<EndpointEntryMatchWildcard, 'type'> & { type: string } = { + ...getEndpointEntryMatchWildcardMock(), + type: 'match', + }; + const decoded = endpointEntryMatchWildcard.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "match" supplied to "type"']); + expect(message.schema).toEqual({}); + }); + + test('it should strip out extra keys', () => { + const payload: EndpointEntryMatchWildcard & { + extraKey?: string; + } = getEndpointEntryMatchWildcardMock(); + payload.extraKey = 'some value'; + const decoded = endpointEntryMatchWildcard.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getEntryMatchWildcardMock()); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_wildcard/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_wildcard/index.ts new file mode 100644 index 0000000000000..cfc96337b6276 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_match_wildcard/index.ts @@ -0,0 +1,23 @@ +/* + * 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 * as t from 'io-ts'; +import { + NonEmptyString, + operatorExcluded, + operatorIncluded, +} from '@kbn/securitysolution-io-ts-types'; + +export const endpointEntryMatchWildcard = t.exact( + t.type({ + field: NonEmptyString, + operator: t.union([operatorIncluded, operatorExcluded]), + type: t.keyof({ wildcard: null }), + value: NonEmptyString, + }) +); +export type EndpointEntryMatchWildcard = t.TypeOf<typeof endpointEntryMatchWildcard>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_nested/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_nested/index.mock.ts new file mode 100644 index 0000000000000..93b99e71b0bca --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_nested/index.mock.ts @@ -0,0 +1,17 @@ +/* + * 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 { EndpointEntryNested } from '.'; +import { FIELD, NESTED } from '../../../constants/index.mock'; +import { getEndpointEntryMatchMock } from '../entry_match/index.mock'; +import { getEndpointEntryMatchAnyMock } from '../entry_match_any/index.mock'; + +export const getEndpointEntryNestedMock = (): EndpointEntryNested => ({ + entries: [getEndpointEntryMatchMock(), getEndpointEntryMatchAnyMock()], + field: FIELD, + type: NESTED, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_nested/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_nested/index.test.ts new file mode 100644 index 0000000000000..d68a0686a4391 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_nested/index.test.ts @@ -0,0 +1,136 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { EndpointEntryNested, endpointEntryNested } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { getEndpointEntryNestedMock } from './index.mock'; +import { getEndpointEntryMatchAnyMock } from '../entry_match_any/index.mock'; +import { + nonEmptyEndpointNestedEntriesArray, + NonEmptyEndpointNestedEntriesArray, +} from '../non_empty_nested_entries_array'; +import { getEndpointEntryMatchMock } from '../entry_match/index.mock'; +import { getEntryExistsMock } from '../../entries_exist/index.mock'; + +describe('endpointEntryNested', () => { + test('it should validate a nested entry', () => { + const payload = getEndpointEntryNestedMock(); + const decoded = endpointEntryNested.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should FAIL validation when "type" is not "nested"', () => { + const payload: Omit<EndpointEntryNested, 'type'> & { type: 'match' } = { + ...getEndpointEntryNestedMock(), + type: 'match', + }; + const decoded = endpointEntryNested.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "match" supplied to "type"']); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "field" is empty string', () => { + const payload: Omit<EndpointEntryNested, 'field'> & { + field: string; + } = { ...getEndpointEntryNestedMock(), field: '' }; + const decoded = endpointEntryNested.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "field"']); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "field" is not a string', () => { + const payload: Omit<EndpointEntryNested, 'field'> & { + field: number; + } = { ...getEndpointEntryNestedMock(), field: 1 }; + const decoded = endpointEntryNested.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "1" supplied to "field"']); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "entries" is not an array', () => { + const payload: Omit<EndpointEntryNested, 'entries'> & { + entries: string; + } = { ...getEndpointEntryNestedMock(), entries: 'im a string' }; + const decoded = endpointEntryNested.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "im a string" supplied to "entries"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should validate when "entries" contains an entry item that is type "match"', () => { + const payload = { ...getEndpointEntryNestedMock(), entries: [getEndpointEntryMatchAnyMock()] }; + const decoded = endpointEntryNested.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual({ + entries: [ + { + field: 'host.name', + operator: 'included', + type: 'match_any', + value: ['some host name'], + }, + ], + field: 'host.name', + type: 'nested', + }); + }); + + test('it should NOT validate when "entries" contains an entry item that is type "exists"', () => { + const payload = { ...getEndpointEntryNestedMock(), entries: [getEntryExistsMock()] }; + const decoded = endpointEntryNested.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "exists" supplied to "entries,type"', + 'Invalid value "undefined" supplied to "entries,value"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should strip out extra keys', () => { + const payload: EndpointEntryNested & { + extraKey?: string; + } = getEndpointEntryNestedMock(); + payload.extraKey = 'some extra key'; + const decoded = endpointEntryNested.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getEndpointEntryNestedMock()); + }); + + test('type guard for nonEmptyEndpointNestedEntries should allow array of endpoint entries', () => { + const payload: NonEmptyEndpointNestedEntriesArray = [ + getEndpointEntryMatchMock(), + getEndpointEntryMatchAnyMock(), + ]; + const guarded = nonEmptyEndpointNestedEntriesArray.is(payload); + expect(guarded).toBeTruthy(); + }); + + test('type guard for nonEmptyEndpointNestedEntries should disallow empty arrays', () => { + const payload: NonEmptyEndpointNestedEntriesArray = []; + const guarded = nonEmptyEndpointNestedEntriesArray.is(payload); + expect(guarded).toBeFalsy(); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_nested/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_nested/index.ts new file mode 100644 index 0000000000000..f02570af1013e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/entry_nested/index.ts @@ -0,0 +1,19 @@ +/* + * 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 * as t from 'io-ts'; +import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; +import { nonEmptyEndpointNestedEntriesArray } from '../non_empty_nested_entries_array'; + +export const endpointEntryNested = t.exact( + t.type({ + entries: nonEmptyEndpointNestedEntriesArray, + field: NonEmptyString, + type: t.keyof({ nested: null }), + }) +); +export type EndpointEntryNested = t.TypeOf<typeof endpointEntryNested>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/index.ts new file mode 100644 index 0000000000000..5138682f463b2 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/index.ts @@ -0,0 +1,9 @@ +/* + * 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. + */ + +export * from './entries'; +export * from './non_empty_nested_entries_array'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/non_empty_nested_entries_array/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/non_empty_nested_entries_array/index.ts new file mode 100644 index 0000000000000..5085b4fdacac7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/endpoint/non_empty_nested_entries_array/index.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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { endpointEntryMatch } from '../entry_match'; +import { endpointEntryMatchAny } from '../entry_match_any'; + +export const endpointNestedEntriesArray = t.array( + t.union([endpointEntryMatch, endpointEntryMatchAny]) +); +export type EndpointNestedEntriesArray = t.TypeOf<typeof endpointNestedEntriesArray>; + +/** + * Types the nonEmptyNestedEntriesArray as: + * - An array of entries of length 1 or greater + * + */ +export const nonEmptyEndpointNestedEntriesArray = new t.Type< + EndpointNestedEntriesArray, + EndpointNestedEntriesArray, + unknown +>( + 'NonEmptyEndpointNestedEntriesArray', + (u: unknown): u is EndpointNestedEntriesArray => endpointNestedEntriesArray.is(u) && u.length > 0, + (input, context): Either<t.Errors, EndpointNestedEntriesArray> => { + if (Array.isArray(input) && input.length === 0) { + return t.failure(input, context); + } else { + return endpointNestedEntriesArray.validate(input, context); + } + }, + t.identity +); + +export type NonEmptyEndpointNestedEntriesArray = t.OutputOf< + typeof nonEmptyEndpointNestedEntriesArray +>; +export type NonEmptyEndpointNestedEntriesArrayDecoded = t.TypeOf< + typeof nonEmptyEndpointNestedEntriesArray +>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.mock.ts new file mode 100644 index 0000000000000..1aeea284751b6 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.mock.ts @@ -0,0 +1,30 @@ +/* + * 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 { EntriesArray } from '.'; +import { getEntryExistsMock } from '../entries_exist/index.mock'; +import { getEntryListMock } from '../entries_list/index.mock'; +import { getEntryMatchMock } from '../entry_match/index.mock'; +import { getEntryMatchAnyMock } from '../entry_match_any/index.mock'; +import { getEntryNestedMock } from '../entry_nested/index.mock'; + +export const getListAndNonListEntriesArrayMock = (): EntriesArray => [ + getEntryMatchMock(), + getEntryMatchAnyMock(), + getEntryListMock(), + getEntryExistsMock(), + getEntryNestedMock(), +]; + +export const getListEntriesArrayMock = (): EntriesArray => [getEntryListMock(), getEntryListMock()]; + +export const getEntriesArrayMock = (): EntriesArray => [ + getEntryMatchMock(), + getEntryMatchAnyMock(), + getEntryExistsMock(), + getEntryNestedMock(), +]; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.test.ts new file mode 100644 index 0000000000000..25c52b68a6f9d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.test.ts @@ -0,0 +1,147 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { getEntryMatchMock } from '../entry_match/index.mock'; +import { entriesArray, entriesArrayOrUndefined, entry } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { getEntryMatchAnyMock } from '../entry_match_any/index.mock'; +import { getEntryExistsMock } from '../entries_exist/index.mock'; +import { getEntryListMock } from '../entries_list/index.mock'; +import { getEntryNestedMock } from '../entry_nested/index.mock'; +import { getEntriesArrayMock } from './index.mock'; + +describe('Entries', () => { + describe('entry', () => { + test('it should validate a match entry', () => { + const payload = getEntryMatchMock(); + const decoded = entry.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate a match_any entry', () => { + const payload = getEntryMatchAnyMock(); + const decoded = entry.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate a exists entry', () => { + const payload = getEntryExistsMock(); + const decoded = entry.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate a list entry', () => { + const payload = getEntryListMock(); + const decoded = entry.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should FAIL validation of nested entry', () => { + const payload = getEntryNestedMock(); + const decoded = entry.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "operator"', + 'Invalid value "nested" supplied to "type"', + 'Invalid value "undefined" supplied to "value"', + 'Invalid value "undefined" supplied to "list"', + ]); + expect(message.schema).toEqual({}); + }); + }); + + describe('entriesArray', () => { + test('it should validate an array with match entry', () => { + const payload = [getEntryMatchMock()]; + const decoded = entriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate an array with match_any entry', () => { + const payload = [getEntryMatchAnyMock()]; + const decoded = entriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate an array with exists entry', () => { + const payload = [getEntryExistsMock()]; + const decoded = entriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate an array with list entry', () => { + const payload = [getEntryListMock()]; + const decoded = entriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate an array with nested entry', () => { + const payload = [getEntryNestedMock()]; + const decoded = entriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate an array with all types of entries', () => { + const payload = [...getEntriesArrayMock()]; + const decoded = entriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + }); + + describe('entriesArrayOrUndefined', () => { + test('it should validate undefined', () => { + const payload = undefined; + const decoded = entriesArrayOrUndefined.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate an array with nested entry', () => { + const payload = [getEntryNestedMock()]; + const decoded = entriesArrayOrUndefined.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.ts new file mode 100644 index 0000000000000..73340d2c0af54 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries/index.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 * as t from 'io-ts'; +import { entriesExists } from '../entries_exist'; +import { entriesList } from '../entries_list'; +import { entriesMatch } from '../entry_match'; +import { entriesMatchAny } from '../entry_match_any'; +import { entriesMatchWildcard } from '../entry_match_wildcard'; +import { entriesNested } from '../entry_nested'; + +// NOTE: Type nested is not included here to denote it's non-recursive nature. +// So a nested entry is really just a collection of `Entry` types. +export const entry = t.union([ + entriesMatch, + entriesMatchAny, + entriesList, + entriesExists, + entriesMatchWildcard, +]); +export type Entry = t.TypeOf<typeof entry>; + +export const entriesArray = t.array( + t.union([ + entriesMatch, + entriesMatchAny, + entriesList, + entriesExists, + entriesNested, + entriesMatchWildcard, + ]) +); +export type EntriesArray = t.TypeOf<typeof entriesArray>; + +export const entriesArrayOrUndefined = t.union([entriesArray, t.undefined]); +export type EntriesArrayOrUndefined = t.TypeOf<typeof entriesArrayOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_exist/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_exist/index.mock.ts new file mode 100644 index 0000000000000..e66d14c3c7af7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_exist/index.mock.ts @@ -0,0 +1,20 @@ +/* + * 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 { EntryExists } from '.'; +import { EXISTS, FIELD, OPERATOR } from '../../constants/index.mock'; + +export const getEntryExistsMock = (): EntryExists => ({ + field: FIELD, + operator: OPERATOR, + type: EXISTS, +}); + +export const getEntryExistsExcludedMock = (): EntryExists => ({ + ...getEntryExistsMock(), + operator: 'excluded', +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_exist/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_exist/index.test.ts new file mode 100644 index 0000000000000..dcc6d47a437a1 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_exist/index.test.ts @@ -0,0 +1,78 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { getEntryExistsMock } from './index.mock'; +import { entriesExists, EntryExists } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('entriesExists', () => { + test('it should validate an entry', () => { + const payload = getEntryExistsMock(); + const decoded = entriesExists.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate when "operator" is "included"', () => { + const payload = getEntryExistsMock(); + const decoded = entriesExists.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate when "operator" is "excluded"', () => { + const payload = getEntryExistsMock(); + payload.operator = 'excluded'; + const decoded = entriesExists.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should FAIL validation when "field" is empty string', () => { + const payload: Omit<EntryExists, 'field'> & { field: string } = { + ...getEntryExistsMock(), + field: '', + }; + const decoded = entriesExists.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "field"']); + expect(message.schema).toEqual({}); + }); + + test('it should strip out extra keys', () => { + const payload: EntryExists & { + extraKey?: string; + } = getEntryExistsMock(); + payload.extraKey = 'some extra key'; + const decoded = entriesExists.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getEntryExistsMock()); + }); + + test('it should FAIL validation when "type" is not "exists"', () => { + const payload: Omit<EntryExists, 'type'> & { type: string } = { + ...getEntryExistsMock(), + type: 'match', + }; + const decoded = entriesExists.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "match" supplied to "type"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_exist/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_exist/index.ts new file mode 100644 index 0000000000000..44c83c3f5b640 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_exist/index.ts @@ -0,0 +1,20 @@ +/* + * 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 * as t from 'io-ts'; + +import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; +import { listOperator as operator } from '../list_operator'; + +export const entriesExists = t.exact( + t.type({ + field: NonEmptyString, + operator, + type: t.keyof({ exists: null }), + }) +); +export type EntryExists = t.TypeOf<typeof entriesExists>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_list/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_list/index.mock.ts new file mode 100644 index 0000000000000..77c73d0bcfa38 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_list/index.mock.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 { EntryList } from '.'; +import { FIELD, LIST, LIST_ID, OPERATOR, TYPE } from '../../constants/index.mock'; + +export const getEntryListMock = (): EntryList => ({ + field: FIELD, + list: { id: LIST_ID, type: TYPE }, + operator: OPERATOR, + type: LIST, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_list/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_list/index.test.ts new file mode 100644 index 0000000000000..a9b56207d9590 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_list/index.test.ts @@ -0,0 +1,95 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { getEntryListMock } from './index.mock'; +import { entriesList, EntryList } from '.'; + +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('entriesList', () => { + test('it should validate an entry', () => { + const payload = getEntryListMock(); + const decoded = entriesList.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate when operator is "included"', () => { + const payload = getEntryListMock(); + const decoded = entriesList.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate when "operator" is "excluded"', () => { + const payload = getEntryListMock(); + payload.operator = 'excluded'; + const decoded = entriesList.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should FAIL validation when "list" is not expected value', () => { + const payload: Omit<EntryList, 'list'> & { list: string } = { + ...getEntryListMock(), + list: 'someListId', + }; + const decoded = entriesList.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "someListId" supplied to "list"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "list.id" is empty string', () => { + const payload: Omit<EntryList, 'list'> & { list: { id: string; type: 'ip' } } = { + ...getEntryListMock(), + list: { id: '', type: 'ip' }, + }; + const decoded = entriesList.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "list,id"']); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "type" is not "lists"', () => { + const payload: Omit<EntryList, 'type'> & { type: 'match_any' } = { + ...getEntryListMock(), + type: 'match_any', + }; + const decoded = entriesList.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "match_any" supplied to "type"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should strip out extra keys', () => { + const payload: EntryList & { + extraKey?: string; + } = getEntryListMock(); + payload.extraKey = 'some extra key'; + const decoded = entriesList.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getEntryListMock()); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_list/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_list/index.ts new file mode 100644 index 0000000000000..214f0c92db221 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entries_list/index.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 * as t from 'io-ts'; +import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; + +import { type } from '../type'; +import { listOperator as operator } from '../list_operator'; + +export const entriesList = t.exact( + t.type({ + field: NonEmptyString, + list: t.exact(t.type({ id: NonEmptyString, type })), + operator, + type: t.keyof({ list: null }), + }) +); +export type EntryList = t.TypeOf<typeof entriesList>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match/index.mock.ts new file mode 100644 index 0000000000000..9af6cf08090b9 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match/index.mock.ts @@ -0,0 +1,21 @@ +/* + * 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 { EntryMatch } from '.'; +import { ENTRY_VALUE, FIELD, MATCH, OPERATOR } from '../../constants/index.mock'; + +export const getEntryMatchMock = (): EntryMatch => ({ + field: FIELD, + operator: OPERATOR, + type: MATCH, + value: ENTRY_VALUE, +}); + +export const getEntryMatchExcludeMock = (): EntryMatch => ({ + ...getEntryMatchMock(), + operator: 'excluded', +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match/index.test.ts new file mode 100644 index 0000000000000..6f2fc7fd9e8d6 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match/index.test.ts @@ -0,0 +1,106 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { getEntryMatchMock } from './index.mock'; +import { entriesMatch, EntryMatch } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('entriesMatch', () => { + test('it should validate an entry', () => { + const payload = getEntryMatchMock(); + const decoded = entriesMatch.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate when operator is "included"', () => { + const payload = getEntryMatchMock(); + const decoded = entriesMatch.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate when "operator" is "excluded"', () => { + const payload = getEntryMatchMock(); + payload.operator = 'excluded'; + const decoded = entriesMatch.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should FAIL validation when "field" is empty string', () => { + const payload: Omit<EntryMatch, 'field'> & { field: string } = { + ...getEntryMatchMock(), + field: '', + }; + const decoded = entriesMatch.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "field"']); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "value" is not string', () => { + const payload: Omit<EntryMatch, 'value'> & { value: string[] } = { + ...getEntryMatchMock(), + value: ['some value'], + }; + const decoded = entriesMatch.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "["some value"]" supplied to "value"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "value" is empty string', () => { + const payload: Omit<EntryMatch, 'value'> & { value: string } = { + ...getEntryMatchMock(), + value: '', + }; + const decoded = entriesMatch.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "value"']); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "type" is not "match"', () => { + const payload: Omit<EntryMatch, 'type'> & { type: string } = { + ...getEntryMatchMock(), + type: 'match_any', + }; + const decoded = entriesMatch.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "match_any" supplied to "type"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should strip out extra keys', () => { + const payload: EntryMatch & { + extraKey?: string; + } = getEntryMatchMock(); + payload.extraKey = 'some value'; + const decoded = entriesMatch.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getEntryMatchMock()); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match/index.ts new file mode 100644 index 0000000000000..8e56991b977a7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match/index.ts @@ -0,0 +1,20 @@ +/* + * 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 * as t from 'io-ts'; +import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; +import { listOperator as operator } from '../list_operator'; + +export const entriesMatch = t.exact( + t.type({ + field: NonEmptyString, + operator, + type: t.keyof({ match: null }), + value: NonEmptyString, + }) +); +export type EntryMatch = t.TypeOf<typeof entriesMatch>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_any/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_any/index.mock.ts new file mode 100644 index 0000000000000..a564d4e8fd95b --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_any/index.mock.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 { EntryMatchAny } from '.'; +import { ENTRY_VALUE, FIELD, MATCH_ANY, OPERATOR } from '../../constants/index.mock'; + +export const getEntryMatchAnyMock = (): EntryMatchAny => ({ + field: FIELD, + operator: OPERATOR, + type: MATCH_ANY, + value: [ENTRY_VALUE], +}); + +export const getEntryMatchAnyExcludeMock = (): EntryMatchAny => ({ + ...getEntryMatchAnyMock(), + operator: 'excluded', + value: [ENTRY_VALUE, 'some other host name'], +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_any/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_any/index.test.ts new file mode 100644 index 0000000000000..84844c432aa2c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_any/index.test.ts @@ -0,0 +1,104 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { getEntryMatchAnyMock } from './index.mock'; +import { entriesMatchAny, EntryMatchAny } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('entriesMatchAny', () => { + test('it should validate an entry', () => { + const payload = getEntryMatchAnyMock(); + const decoded = entriesMatchAny.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate when operator is "included"', () => { + const payload = getEntryMatchAnyMock(); + const decoded = entriesMatchAny.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate when operator is "excluded"', () => { + const payload = getEntryMatchAnyMock(); + payload.operator = 'excluded'; + const decoded = entriesMatchAny.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should FAIL validation when field is empty string', () => { + const payload: Omit<EntryMatchAny, 'field'> & { field: string } = { + ...getEntryMatchAnyMock(), + field: '', + }; + const decoded = entriesMatchAny.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "field"']); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when value is empty array', () => { + const payload: Omit<EntryMatchAny, 'value'> & { value: string[] } = { + ...getEntryMatchAnyMock(), + value: [], + }; + const decoded = entriesMatchAny.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "[]" supplied to "value"']); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when value is not string array', () => { + const payload: Omit<EntryMatchAny, 'value'> & { value: string } = { + ...getEntryMatchAnyMock(), + value: 'some string', + }; + const decoded = entriesMatchAny.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "some string" supplied to "value"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "type" is not "match_any"', () => { + const payload: Omit<EntryMatchAny, 'type'> & { type: string } = { + ...getEntryMatchAnyMock(), + type: 'match', + }; + const decoded = entriesMatchAny.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "match" supplied to "type"']); + expect(message.schema).toEqual({}); + }); + + test('it should strip out extra keys', () => { + const payload: EntryMatchAny & { + extraKey?: string; + } = getEntryMatchAnyMock(); + payload.extraKey = 'some extra key'; + const decoded = entriesMatchAny.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getEntryMatchAnyMock()); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_any/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_any/index.ts new file mode 100644 index 0000000000000..989c729f8b1b1 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_any/index.ts @@ -0,0 +1,21 @@ +/* + * 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 * as t from 'io-ts'; + +import { NonEmptyString, nonEmptyOrNullableStringArray } from '@kbn/securitysolution-io-ts-types'; +import { listOperator as operator } from '../list_operator'; + +export const entriesMatchAny = t.exact( + t.type({ + field: NonEmptyString, + operator, + type: t.keyof({ match_any: null }), + value: nonEmptyOrNullableStringArray, + }) +); +export type EntryMatchAny = t.TypeOf<typeof entriesMatchAny>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_wildcard/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_wildcard/index.mock.ts new file mode 100644 index 0000000000000..c279fe3ed45dd --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_wildcard/index.mock.ts @@ -0,0 +1,21 @@ +/* + * 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 { EntryMatchWildcard } from '.'; +import { ENTRY_VALUE, FIELD, OPERATOR, WILDCARD } from '../../constants/index.mock'; + +export const getEntryMatchWildcardMock = (): EntryMatchWildcard => ({ + field: FIELD, + operator: OPERATOR, + type: WILDCARD, + value: ENTRY_VALUE, +}); + +export const getEntryMatchWildcardExcludeMock = (): EntryMatchWildcard => ({ + ...getEntryMatchWildcardMock(), + operator: 'excluded', +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_wildcard/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_wildcard/index.test.ts new file mode 100644 index 0000000000000..4bd2d146412a8 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_wildcard/index.test.ts @@ -0,0 +1,104 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { getEntryMatchWildcardMock } from './index.mock'; +import { entriesMatchWildcard, EntryMatchWildcard } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('entriesMatchWildcard', () => { + test('it should validate an entry', () => { + const payload = getEntryMatchWildcardMock(); + const decoded = entriesMatchWildcard.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate when operator is "included"', () => { + const payload = getEntryMatchWildcardMock(); + const decoded = entriesMatchWildcard.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate when "operator" is "excluded"', () => { + const payload = getEntryMatchWildcardMock(); + payload.operator = 'excluded'; + const decoded = entriesMatchWildcard.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should FAIL validation when "field" is empty string', () => { + const payload: Omit<EntryMatchWildcard, 'field'> & { field: string } = { + ...getEntryMatchWildcardMock(), + field: '', + }; + const decoded = entriesMatchWildcard.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "field"']); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "value" is not string', () => { + const payload: Omit<EntryMatchWildcard, 'value'> & { value: string[] } = { + ...getEntryMatchWildcardMock(), + value: ['some value'], + }; + const decoded = entriesMatchWildcard.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "["some value"]" supplied to "value"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "value" is empty string', () => { + const payload: Omit<EntryMatchWildcard, 'value'> & { value: string } = { + ...getEntryMatchWildcardMock(), + value: '', + }; + const decoded = entriesMatchWildcard.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "value"']); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "type" is not "wildcard"', () => { + const payload: Omit<EntryMatchWildcard, 'type'> & { type: string } = { + ...getEntryMatchWildcardMock(), + type: 'match', + }; + const decoded = entriesMatchWildcard.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "match" supplied to "type"']); + expect(message.schema).toEqual({}); + }); + + test('it should strip out extra keys', () => { + const payload: EntryMatchWildcard & { + extraKey?: string; + } = getEntryMatchWildcardMock(); + payload.extraKey = 'some value'; + const decoded = entriesMatchWildcard.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getEntryMatchWildcardMock()); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_wildcard/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_wildcard/index.ts new file mode 100644 index 0000000000000..af168e33fa70a --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_match_wildcard/index.ts @@ -0,0 +1,20 @@ +/* + * 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 * as t from 'io-ts'; +import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; +import { listOperator as operator } from '../list_operator'; + +export const entriesMatchWildcard = t.exact( + t.type({ + field: NonEmptyString, + operator, + type: t.keyof({ wildcard: null }), + value: NonEmptyString, + }) +); +export type EntryMatchWildcard = t.TypeOf<typeof entriesMatchWildcard>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_nested/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_nested/index.mock.ts new file mode 100644 index 0000000000000..890c3d379d27d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_nested/index.mock.ts @@ -0,0 +1,28 @@ +/* + * 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 { EntryNested } from '.'; +import { NESTED, NESTED_FIELD } from '../../constants/index.mock'; +import { getEntryExistsMock } from '../entries_exist/index.mock'; +import { getEntryMatchExcludeMock, getEntryMatchMock } from '../entry_match/index.mock'; +import { getEntryMatchAnyExcludeMock, getEntryMatchAnyMock } from '../entry_match_any/index.mock'; + +export const getEntryNestedMock = (): EntryNested => ({ + entries: [getEntryMatchMock(), getEntryMatchAnyMock()], + field: NESTED_FIELD, + type: NESTED, +}); + +export const getEntryNestedExcludeMock = (): EntryNested => ({ + ...getEntryNestedMock(), + entries: [getEntryMatchExcludeMock(), getEntryMatchAnyExcludeMock()], +}); + +export const getEntryNestedMixedEntries = (): EntryNested => ({ + ...getEntryNestedMock(), + entries: [getEntryMatchMock(), getEntryMatchAnyExcludeMock(), getEntryExistsMock()], +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_nested/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_nested/index.test.ts new file mode 100644 index 0000000000000..be37a0273bce9 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_nested/index.test.ts @@ -0,0 +1,123 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { getEntryNestedMock } from './index.mock'; +import { entriesNested, EntryNested } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { getEntryMatchAnyMock } from '../entry_match_any/index.mock'; +import { getEntryExistsMock } from '../entries_exist/index.mock'; + +describe('entriesNested', () => { + test('it should validate a nested entry', () => { + const payload = getEntryNestedMock(); + const decoded = entriesNested.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should FAIL validation when "type" is not "nested"', () => { + const payload: Omit<EntryNested, 'type'> & { type: 'match' } = { + ...getEntryNestedMock(), + type: 'match', + }; + const decoded = entriesNested.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "match" supplied to "type"']); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "field" is empty string', () => { + const payload: Omit<EntryNested, 'field'> & { + field: string; + } = { ...getEntryNestedMock(), field: '' }; + const decoded = entriesNested.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "field"']); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "field" is not a string', () => { + const payload: Omit<EntryNested, 'field'> & { + field: number; + } = { ...getEntryNestedMock(), field: 1 }; + const decoded = entriesNested.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "1" supplied to "field"']); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when "entries" is not a an array', () => { + const payload: Omit<EntryNested, 'entries'> & { + entries: string; + } = { ...getEntryNestedMock(), entries: 'im a string' }; + const decoded = entriesNested.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "im a string" supplied to "entries"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should validate when "entries" contains an entry item that is type "match"', () => { + const payload = { ...getEntryNestedMock(), entries: [getEntryMatchAnyMock()] }; + const decoded = entriesNested.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual({ + entries: [ + { + field: 'host.name', + operator: 'included', + type: 'match_any', + value: ['some host name'], + }, + ], + field: 'parent.field', + type: 'nested', + }); + }); + + test('it should validate when "entries" contains an entry item that is type "exists"', () => { + const payload = { ...getEntryNestedMock(), entries: [getEntryExistsMock()] }; + const decoded = entriesNested.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual({ + entries: [ + { + field: 'host.name', + operator: 'included', + type: 'exists', + }, + ], + field: 'parent.field', + type: 'nested', + }); + }); + + test('it should strip out extra keys', () => { + const payload: EntryNested & { + extraKey?: string; + } = getEntryNestedMock(); + payload.extraKey = 'some extra key'; + const decoded = entriesNested.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getEntryNestedMock()); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_nested/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_nested/index.ts new file mode 100644 index 0000000000000..dac5d6a3d5a88 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/entry_nested/index.ts @@ -0,0 +1,19 @@ +/* + * 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 * as t from 'io-ts'; +import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; +import { nonEmptyNestedEntriesArray } from '../non_empty_nested_entries_array'; + +export const entriesNested = t.exact( + t.type({ + entries: nonEmptyNestedEntriesArray, + field: NonEmptyString, + type: t.keyof({ nested: null }), + }) +); +export type EntryNested = t.TypeOf<typeof entriesNested>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_export_details/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_export_details/index.mock.ts new file mode 100644 index 0000000000000..ded6a6bfbb8ab --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_export_details/index.mock.ts @@ -0,0 +1,28 @@ +/* + * 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 { ExportExceptionDetails } from '.'; + +export interface ExportExceptionDetailsMock { + listCount?: number; + missingListsCount?: number; + missingLists?: Array<Record<'list_id', string>>; + itemCount?: number; + missingItemCount?: number; + missingItems?: Array<Record<'item_id', string>>; +} + +export const getExceptionExportDetailsMock = ( + details?: ExportExceptionDetailsMock +): ExportExceptionDetails => ({ + exported_exception_list_count: details?.listCount ?? 0, + exported_exception_list_item_count: details?.itemCount ?? 0, + missing_exception_list_item_count: details?.missingItemCount ?? 0, + missing_exception_list_items: details?.missingItems ?? [], + missing_exception_lists: details?.missingLists ?? [], + missing_exception_lists_count: details?.missingListsCount ?? 0, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_export_details/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_export_details/index.test.ts new file mode 100644 index 0000000000000..fe8150fd6f3be --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_export_details/index.test.ts @@ -0,0 +1,35 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { getExceptionExportDetailsMock } from './index.mock'; +import { exportExceptionDetailsSchema, ExportExceptionDetails } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('exportExceptionDetails', () => { + test('it should validate export meta', () => { + const payload = getExceptionExportDetailsMock(); + const decoded = exportExceptionDetailsSchema.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should strip out extra keys', () => { + const payload: ExportExceptionDetails & { + extraKey?: string; + } = getExceptionExportDetailsMock(); + payload.extraKey = 'some extra key'; + const decoded = exportExceptionDetailsSchema.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getExceptionExportDetailsMock()); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_export_details/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_export_details/index.ts new file mode 100644 index 0000000000000..358e987d8b178 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_export_details/index.ts @@ -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 * as t from 'io-ts'; +import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; + +export const exportExceptionDetails = { + exported_exception_list_count: t.number, + exported_exception_list_item_count: t.number, + missing_exception_list_item_count: t.number, + missing_exception_list_items: t.array( + t.exact( + t.type({ + item_id: NonEmptyString, + }) + ) + ), + missing_exception_lists: t.array( + t.exact( + t.type({ + list_id: NonEmptyString, + }) + ) + ), + missing_exception_lists_count: t.number, +}; + +export const exportExceptionDetailsSchema = t.exact(t.type(exportExceptionDetails)); + +export type ExportExceptionDetails = t.TypeOf<typeof exportExceptionDetailsSchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list/index.test.ts new file mode 100644 index 0000000000000..ac57828355d36 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list/index.test.ts @@ -0,0 +1,53 @@ +/* + * 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 { exceptionListType, ExceptionListTypeEnum } from '.'; + +import { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('exceptionListType', () => { + test('it should validate for "detection"', () => { + const payload = 'detection'; + const decoded = exceptionListType.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate for "rule_default"', () => { + const payload = 'rule_default'; + const decoded = exceptionListType.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate for "endpoint"', () => { + const payload = 'endpoint'; + const decoded = exceptionListType.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should contain same amount of keys as enum', () => { + // Might seem like a weird test, but its meant to + // ensure that if exceptionListType is updated, you + // also update the ExceptionListTypeEnum, a workaround + // for io-ts not yet supporting enums + // https://github.com/gcanti/io-ts/issues/67 + const keys = Object.keys(exceptionListType.keys).sort().join(',').toLowerCase(); + const enumKeys = Object.keys(ExceptionListTypeEnum).sort().join(',').toLowerCase(); + + expect(keys).toEqual(enumKeys); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list/index.ts new file mode 100644 index 0000000000000..50273a9c55a99 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list/index.ts @@ -0,0 +1,30 @@ +/* + * 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 * as t from 'io-ts'; + +export const exceptionListType = t.keyof({ + detection: null, + rule_default: null, + endpoint: null, + endpoint_trusted_apps: null, + endpoint_events: null, + endpoint_host_isolation_exceptions: null, + endpoint_blocklists: null, +}); +export const exceptionListTypeOrUndefined = t.union([exceptionListType, t.undefined]); +export type ExceptionListType = t.TypeOf<typeof exceptionListType>; +export type ExceptionListTypeOrUndefined = t.TypeOf<typeof exceptionListTypeOrUndefined>; +export enum ExceptionListTypeEnum { + DETECTION = 'detection', // shared exception list type + RULE_DEFAULT = 'rule_default', // rule default, cannot be shared + ENDPOINT = 'endpoint', + ENDPOINT_TRUSTED_APPS = 'endpoint', + ENDPOINT_EVENTS = 'endpoint_events', + ENDPOINT_HOST_ISOLATION_EXCEPTIONS = 'endpoint_host_isolation_exceptions', + ENDPOINT_BLOCKLISTS = 'endpoint_blocklists', +} diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list_item_type/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list_item_type/index.ts new file mode 100644 index 0000000000000..36857aec92dfd --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/exception_list_item_type/index.ts @@ -0,0 +1,13 @@ +/* + * 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 * as t from 'io-ts'; + +export const exceptionListItemType = t.keyof({ simple: null }); +export const exceptionListItemTypeOrUndefined = t.union([exceptionListItemType, t.undefined]); +export type ExceptionListItemType = t.TypeOf<typeof exceptionListItemType>; +export type ExceptionListItemTypeOrUndefined = t.TypeOf<typeof exceptionListItemTypeOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/expire_time/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/expire_time/index.ts new file mode 100644 index 0000000000000..9a3f4db110ed1 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/expire_time/index.ts @@ -0,0 +1,13 @@ +/* + * 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 * as t from 'io-ts'; +import { IsoDateString } from '@kbn/securitysolution-io-ts-types'; + +export const expireTime = IsoDateString; +export const expireTimeOrUndefined = t.union([expireTime, t.undefined]); +export type ExpireTimeOrUndefined = t.TypeOf<typeof expireTimeOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/file/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/file/index.ts new file mode 100644 index 0000000000000..885d714de4411 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/file/index.ts @@ -0,0 +1,10 @@ +/* + * 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 * as t from 'io-ts'; + +export const file = t.object; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/filter/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/filter/index.ts new file mode 100644 index 0000000000000..43ac9592ed31e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/filter/index.ts @@ -0,0 +1,13 @@ +/* + * 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 * as t from 'io-ts'; + +export const filter = t.string; +export type Filter = t.TypeOf<typeof filter>; +export const filterOrUndefined = t.union([filter, t.undefined]); +export type FilterOrUndefined = t.TypeOf<typeof filterOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/id/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/id/index.ts new file mode 100644 index 0000000000000..967282c158a27 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/id/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 * as t from 'io-ts'; +import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; + +export const id = NonEmptyString; +export type Id = t.TypeOf<typeof id>; +export const idOrUndefined = t.union([id, t.undefined]); +export type IdOrUndefined = t.TypeOf<typeof idOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/immutable/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/immutable/index.ts new file mode 100644 index 0000000000000..afeb2de36ea1d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/immutable/index.ts @@ -0,0 +1,13 @@ +/* + * 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 * as t from 'io-ts'; + +export const immutable = t.boolean; +export type Immutable = t.TypeOf<typeof immutable>; +export const immutableOrUndefined = t.union([immutable, t.undefined]); +export type ImmutableOrUndefined = t.TypeOf<typeof immutableOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/import_comment/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/import_comment/index.test.ts new file mode 100644 index 0000000000000..a447d1f535071 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/import_comment/index.test.ts @@ -0,0 +1,134 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { getCommentsArrayMock, getCommentsMock } from '../comment/index.mock'; +import { getCreateCommentsArrayMock } from '../create_comment/index.mock'; +import { + importComment, + ImportCommentsArray, + importCommentsArray, + ImportCommentsArrayOrUndefined, + importCommentsArrayOrUndefined, +} from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('ImportComment', () => { + describe('importComment', () => { + test('it passes validation with a typical comment', () => { + const payload = getCommentsMock(); + const decoded = importComment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it passes validation with a new comment', () => { + const payload = { comment: 'new comment' }; + const decoded = importComment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it fails validation when undefined', () => { + const payload = undefined; + const decoded = importComment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "(({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>) | {| comment: NonEmptyString |})"', + ]); + expect(message.schema).toEqual({}); + }); + }); + + describe('importCommentsArray', () => { + test('it passes validation an array of Comment', () => { + const payload = getCommentsArrayMock(); + const decoded = importCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it passes validation an array of CreateComment', () => { + const payload = getCreateCommentsArrayMock(); + const decoded = importCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it passes validation an array of Comment and CreateComment', () => { + const payload = [...getCommentsArrayMock(), ...getCreateCommentsArrayMock()]; + const decoded = importCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it fails validation when undefined', () => { + const payload = undefined; + const decoded = importCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "Array<(({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>) | {| comment: NonEmptyString |})>"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it fails validation when array includes non ImportComment types', () => { + const payload = [1] as unknown as ImportCommentsArray; + const decoded = importCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "Array<(({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>) | {| comment: NonEmptyString |})>"', + ]); + expect(message.schema).toEqual({}); + }); + }); + + describe('importCommentsArrayOrUndefined', () => { + test('it passes validation an array of ImportComment', () => { + const payload = [...getCommentsArrayMock(), ...getCreateCommentsArrayMock()]; + const decoded = importCommentsArrayOrUndefined.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it passes validation when undefined', () => { + const payload = undefined; + const decoded = importCommentsArrayOrUndefined.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it fails validation when array includes non ImportComment types', () => { + const payload = [1] as unknown as ImportCommentsArrayOrUndefined; + const decoded = importCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "Array<(({| comment: NonEmptyString, created_at: string, created_by: string, id: NonEmptyString |} & Partial<{| updated_at: string, updated_by: string |}>) | {| comment: NonEmptyString |})>"', + ]); + expect(message.schema).toEqual({}); + }); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/import_comment/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/import_comment/index.ts new file mode 100644 index 0000000000000..c4c906117ecdb --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/import_comment/index.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 * as t from 'io-ts'; +import { createComment } from '../create_comment'; +import { comment } from '../comment'; + +export const importComment = t.union([comment, createComment]); + +export type ImportComment = t.TypeOf<typeof importComment>; +export const importCommentsArray = t.array(importComment); +export type ImportCommentsArray = t.TypeOf<typeof importCommentsArray>; +export const importCommentsArrayOrUndefined = t.union([importCommentsArray, t.undefined]); +export type ImportCommentsArrayOrUndefined = t.TypeOf<typeof importCommentsArrayOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/include_expired_exceptions/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/include_expired_exceptions/index.ts new file mode 100644 index 0000000000000..0c3d5e4959bc4 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/include_expired_exceptions/index.ts @@ -0,0 +1,19 @@ +/* + * 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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; + +export const include_expired_exceptions = t.keyof({ true: null, false: null }); +export const includeExpiredExceptionsOrUndefined = t.union([ + include_expired_exceptions, + t.undefined, +]); +export type IncludeExpiredExceptionsOrUndefined = t.TypeOf< + typeof includeExpiredExceptionsOrUndefined +>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/index.ts new file mode 100644 index 0000000000000..0ff54c5e5a726 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/index.ts @@ -0,0 +1,65 @@ +/* + * 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. + */ + +export * from './comment'; +export * from './create_comment'; +export * from './created_at'; +export * from './created_by'; +export * from './cursor'; +export * from './default_namespace'; +export * from './default_namespace_array'; +export * from './default_create_comments_array'; +export * from './default_import_comments_array'; +export * from './description'; +export * from './deserializer'; +export * from './endpoint'; +export * from './entries'; +export * from './entries_exist'; +export * from './entries_list'; +export * from './entry_match'; +export * from './entry_match_any'; +export * from './entry_match_wildcard'; +export * from './entry_nested'; +export * from './exception_export_details'; +export * from './exception_list'; +export * from './exception_list_item_type'; +export * from './expire_time'; +export * from './filter'; +export * from './id'; +export * from './immutable'; +export * from './import_comment'; +export * from './item_id'; +export * from './list_id'; +export * from './list_operator'; +export * from './list_type'; +export * from './lists'; +export * from './lists_default_array'; +export * from './max_size'; +export * from './meta'; +export * from './name'; +export * from './namespace_type'; +export * from './non_empty_entries_array'; +export * from './non_empty_nested_entries_array'; +export * from './os_type'; +export * from './page'; +export * from './per_page'; +export * from './pit'; +export * from './search'; +export * from './search_after'; +export * from './serializer'; +export * from './sort_field'; +export * from './sort_order'; +export * from './tags'; +export * from './tie_breaker_id'; +export * from './timestamp'; +export * from './total'; +export * from './type'; +export * from './underscore_version'; +export * from './update_comment'; +export * from './updated_at'; +export * from './updated_by'; +export * from './refresh'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/item/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/item/index.ts new file mode 100644 index 0000000000000..5a71e1242d26e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/item/index.ts @@ -0,0 +1,10 @@ +/* + * 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 * as t from 'io-ts'; + +export const item = t.string; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/item_id/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/item_id/index.ts new file mode 100644 index 0000000000000..44ccc97d46664 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/item_id/index.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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; +import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; + +export const item_id = NonEmptyString; +export type ItemId = t.TypeOf<typeof item_id>; +export const itemIdOrUndefined = t.union([item_id, t.undefined]); +export type ItemIdOrUndefined = t.TypeOf<typeof itemIdOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/list_id/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/list_id/index.ts new file mode 100644 index 0000000000000..c813d7170e8ad --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/list_id/index.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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; +import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; + +export const list_id = NonEmptyString; +export type ListId = t.TypeOf<typeof list_id>; +export const list_idOrUndefined = t.union([list_id, t.undefined]); +export type ListIdOrUndefined = t.TypeOf<typeof list_idOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/list_operator/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/list_operator/index.test.ts new file mode 100644 index 0000000000000..d3d67a8fd60a8 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/list_operator/index.test.ts @@ -0,0 +1,44 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { ListOperatorEnum as OperatorEnum, listOperator as operator } from '.'; + +describe('operator', () => { + test('it should validate for "included"', () => { + const payload = 'included'; + const decoded = operator.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate for "excluded"', () => { + const payload = 'excluded'; + const decoded = operator.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should contain same amount of keys as enum', () => { + // Might seem like a weird test, but its meant to + // ensure that if operator is updated, you + // also update the operatorEnum, a workaround + // for io-ts not yet supporting enums + // https://github.com/gcanti/io-ts/issues/67 + const keys = Object.keys(operator.keys).sort().join(',').toLowerCase(); + const enumKeys = Object.keys(OperatorEnum).sort().join(',').toLowerCase(); + + expect(keys).toEqual(enumKeys); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/list_operator/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/list_operator/index.ts new file mode 100644 index 0000000000000..096b21ec20f90 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/list_operator/index.ts @@ -0,0 +1,33 @@ +/* + * 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 * as t from 'io-ts'; + +export const listOperator = t.keyof({ excluded: null, included: null }); +export type ListOperator = t.TypeOf<typeof listOperator>; +export enum ListOperatorEnum { + INCLUDED = 'included', + EXCLUDED = 'excluded', +} + +export const listOperatorType = t.keyof({ + nested: null, + match: null, + match_any: null, + wildcard: null, + exists: null, + list: null, +}); +export type ListOperatorType = t.TypeOf<typeof listOperatorType>; +export enum ListOperatorTypeEnum { + NESTED = 'nested', + MATCH = 'match', + MATCH_ANY = 'match_any', + WILDCARD = 'wildcard', + EXISTS = 'exists', + LIST = 'list', +} diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/list_type/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/list_type/index.ts new file mode 100644 index 0000000000000..7a160486c3994 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/list_type/index.ts @@ -0,0 +1,13 @@ +/* + * 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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; + +export const list_type = t.keyof({ item: null, list: null }); +export type ListType = t.TypeOf<typeof list_type>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.mock.ts new file mode 100644 index 0000000000000..6ad3c6a371d18 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.mock.ts @@ -0,0 +1,25 @@ +/* + * 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 { List, ListArray } from '.'; +import { ENDPOINT_LIST_ID } from '@kbn/securitysolution-list-constants'; + +export const getListMock = (): List => ({ + id: 'some_uuid', + list_id: 'list_id_single', + namespace_type: 'single', + type: 'detection', +}); + +export const getEndpointListMock = (): List => ({ + id: ENDPOINT_LIST_ID, + list_id: ENDPOINT_LIST_ID, + namespace_type: 'agnostic', + type: 'endpoint', +}); + +export const getListArrayMock = (): ListArray => [getListMock(), getEndpointListMock()]; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.test.ts new file mode 100644 index 0000000000000..aecfe9501ac17 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.test.ts @@ -0,0 +1,125 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { getEndpointListMock, getListArrayMock, getListMock } from './index.mock'; +import { List, list, ListArray, listArray, ListArrayOrUndefined, listArrayOrUndefined } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('Lists', () => { + describe('list', () => { + test('it should validate a list', () => { + const payload = getListMock(); + const decoded = list.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate a list with "namespace_type" of "agnostic"', () => { + const payload = getEndpointListMock(); + const decoded = list.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT validate a list without an "id"', () => { + const payload = getListMock(); + // @ts-expect-error + delete payload.id; + const decoded = list.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT validate a list without "namespace_type"', () => { + const payload = getListMock(); + // @ts-expect-error + delete payload.namespace_type; + const decoded = list.decode(payload); + const message = pipe(decoded, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "namespace_type"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should strip out extra keys', () => { + const payload: List & { + extraKey?: string; + } = getListMock(); + payload.extraKey = 'some value'; + const decoded = list.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getListMock()); + }); + }); + + describe('listArray', () => { + test('it should validate an array of lists', () => { + const payload = getListArrayMock(); + const decoded = listArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not validate when unexpected type found in array', () => { + const payload = [1] as unknown as ListArray; + const decoded = listArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "Array<{| id: NonEmptyString, list_id: NonEmptyString, type: "detection" | "rule_default" | "endpoint" | "endpoint_trusted_apps" | "endpoint_events" | "endpoint_host_isolation_exceptions" | "endpoint_blocklists", namespace_type: "agnostic" | "single" |}>"', + ]); + expect(message.schema).toEqual({}); + }); + }); + + describe('listArrayOrUndefined', () => { + test('it should validate an array of lists', () => { + const payload = getListArrayMock(); + const decoded = listArrayOrUndefined.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate when undefined', () => { + const payload = undefined; + const decoded = listArrayOrUndefined.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not allow an item that is not of type "list" in array', () => { + const payload = [1] as unknown as ListArrayOrUndefined; + const decoded = listArrayOrUndefined.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "(Array<{| id: NonEmptyString, list_id: NonEmptyString, type: "detection" | "rule_default" | "endpoint" | "endpoint_trusted_apps" | "endpoint_events" | "endpoint_host_isolation_exceptions" | "endpoint_blocklists", namespace_type: "agnostic" | "single" |}> | undefined)"', + 'Invalid value "[1]" supplied to "(Array<{| id: NonEmptyString, list_id: NonEmptyString, type: "detection" | "rule_default" | "endpoint" | "endpoint_trusted_apps" | "endpoint_events" | "endpoint_host_isolation_exceptions" | "endpoint_blocklists", namespace_type: "agnostic" | "single" |}> | undefined)"', + ]); + expect(message.schema).toEqual({}); + }); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.ts new file mode 100644 index 0000000000000..bbc99142ffc7b --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/lists/index.ts @@ -0,0 +1,26 @@ +/* + * 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 * as t from 'io-ts'; +import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; +import { exceptionListType } from '../exception_list'; +import { namespaceType } from '../default_namespace'; + +export const list = t.exact( + t.type({ + id: NonEmptyString, + list_id: NonEmptyString, + type: exceptionListType, + namespace_type: namespaceType, + }) +); + +export type List = t.TypeOf<typeof list>; +export const listArray = t.array(list); +export type ListArray = t.TypeOf<typeof listArray>; +export const listArrayOrUndefined = t.union([listArray, t.undefined]); +export type ListArrayOrUndefined = t.TypeOf<typeof listArrayOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/lists_default_array/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/lists_default_array/index.test.ts new file mode 100644 index 0000000000000..b702f617d17c7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/lists_default_array/index.test.ts @@ -0,0 +1,62 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { DefaultListArray } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { getListArrayMock } from '../lists/index.mock'; + +describe('lists_default_array', () => { + test('it should return a default array when null', () => { + const payload = null; + const decoded = DefaultListArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual([]); + }); + + test('it should return a default array when undefined', () => { + const payload = undefined; + const decoded = DefaultListArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual([]); + }); + + test('it should validate an empty array', () => { + const payload: string[] = []; + const decoded = DefaultListArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate an array of lists', () => { + const payload = getListArrayMock(); + const decoded = DefaultListArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not validate an array of non accepted types', () => { + // Terrible casting for purpose of tests + const payload = [1] as unknown; + const decoded = DefaultListArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "DefaultListArray"', + ]); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/lists_default_array/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/lists_default_array/index.ts new file mode 100644 index 0000000000000..33ab281a6f176 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/lists_default_array/index.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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { list, ListArray } from '../lists'; + +/** + * Types the DefaultListArray as: + * - If null or undefined, then a default array of type list will be set + */ +export const DefaultListArray = new t.Type<ListArray, ListArray | undefined, unknown>( + 'DefaultListArray', + t.array(list).is, + (input, context): Either<t.Errors, ListArray> => + input == null ? t.success([]) : t.array(list).validate(input, context), + t.identity +); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/max_size/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/max_size/index.test.ts new file mode 100644 index 0000000000000..2c733c93ee778 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/max_size/index.test.ts @@ -0,0 +1,56 @@ +/* + * 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 { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { maxSizeOrUndefined } from '.'; + +import { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; + +describe('maxSizeOrUndefined', () => { + test('it will validate a correct max value', () => { + const payload = 123; + const decoded = maxSizeOrUndefined.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it will fail to validate a 0', () => { + const payload = 0; + const decoded = maxSizeOrUndefined.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "0" supplied to "(PositiveIntegerGreaterThanZero | undefined)"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it will fail to validate a -1', () => { + const payload = -1; + const decoded = maxSizeOrUndefined.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "-1" supplied to "(PositiveIntegerGreaterThanZero | undefined)"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it will fail to validate a string', () => { + const payload = '123'; + const decoded = maxSizeOrUndefined.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "123" supplied to "(PositiveIntegerGreaterThanZero | undefined)"', + ]); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/max_size/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/max_size/index.ts new file mode 100644 index 0000000000000..c652ae81d6c41 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/max_size/index.ts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import { PositiveIntegerGreaterThanZero } from '@kbn/securitysolution-io-ts-types'; +import * as t from 'io-ts'; + +export const max_size = PositiveIntegerGreaterThanZero; +export type MaxSize = t.TypeOf<typeof max_size>; + +export const maxSizeOrUndefined = t.union([max_size, t.undefined]); +export type MaxSizeOrUndefined = t.TypeOf<typeof maxSizeOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/meta/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/meta/index.ts new file mode 100644 index 0000000000000..547b45969be71 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/meta/index.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 * as t from 'io-ts'; + +export const meta = t.object; +export type Meta = t.TypeOf<typeof meta>; +export const metaOrUndefined = t.union([meta, t.undefined]); +export type MetaOrUndefined = t.TypeOf<typeof metaOrUndefined>; + +export const nullableMetaOrUndefined = t.union([metaOrUndefined, t.null]); +export type NullableMetaOrUndefined = t.TypeOf<typeof nullableMetaOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/name/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/name/index.ts new file mode 100644 index 0000000000000..020f3642306a9 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/name/index.ts @@ -0,0 +1,13 @@ +/* + * 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 * as t from 'io-ts'; + +export const name = t.string; +export type Name = t.TypeOf<typeof name>; +export const nameOrUndefined = t.union([name, t.undefined]); +export type NameOrUndefined = t.TypeOf<typeof nameOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/namespace_type/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/namespace_type/index.ts new file mode 100644 index 0000000000000..ae16f8b4521ca --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/namespace_type/index.ts @@ -0,0 +1,12 @@ +/* + * 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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import { DefaultNamespace } from '../default_namespace'; + +export const namespace_type = DefaultNamespace; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.test.ts new file mode 100644 index 0000000000000..321a57dd4feea --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.test.ts @@ -0,0 +1,130 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { EntriesArray } from '../entries'; +import { nonEmptyEntriesArray } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { getEntryMatchMock } from '../entry_match/index.mock'; +import { getEntryMatchAnyMock } from '../entry_match_any/index.mock'; +import { getEntryExistsMock } from '../entries_exist/index.mock'; +import { + getEntriesArrayMock, + getListAndNonListEntriesArrayMock, + getListEntriesArrayMock, +} from '../entries/index.mock'; +import { getEntryNestedMock } from '../entry_nested/index.mock'; + +describe('non_empty_entries_array', () => { + test('it should FAIL validation when given an empty array', () => { + const payload: EntriesArray = []; + const decoded = nonEmptyEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "[]" supplied to "NonEmptyEntriesArray"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when given "undefined"', () => { + const payload = undefined; + const decoded = nonEmptyEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "NonEmptyEntriesArray"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when given "null"', () => { + const payload = null; + const decoded = nonEmptyEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "null" supplied to "NonEmptyEntriesArray"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should validate an array of "match" entries', () => { + const payload: EntriesArray = [getEntryMatchMock(), getEntryMatchMock()]; + const decoded = nonEmptyEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate an array of "match_any" entries', () => { + const payload: EntriesArray = [getEntryMatchAnyMock(), getEntryMatchAnyMock()]; + const decoded = nonEmptyEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate an array of "exists" entries', () => { + const payload: EntriesArray = [getEntryExistsMock(), getEntryExistsMock()]; + const decoded = nonEmptyEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate an array of "list" entries', () => { + const payload: EntriesArray = [...getListEntriesArrayMock()]; + const decoded = nonEmptyEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate an array of "nested" entries', () => { + const payload: EntriesArray = [getEntryNestedMock(), getEntryNestedMock()]; + const decoded = nonEmptyEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate an array of entries', () => { + const payload: EntriesArray = [...getEntriesArrayMock()]; + const decoded = nonEmptyEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should FAIL validation when given an array of entries of value list and non-value list entries', () => { + const payload: EntriesArray = [...getListAndNonListEntriesArrayMock()]; + const decoded = nonEmptyEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Cannot have entry of type list and other']); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when given an array of non entries', () => { + const payload = [1]; + const decoded = nonEmptyEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "NonEmptyEntriesArray"', + ]); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.ts new file mode 100644 index 0000000000000..8d6812077d4e2 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_entries_array/index.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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { entriesArray, EntriesArray } from '../entries'; +import { entriesList } from '../entries_list'; + +/** + * Types the nonEmptyEntriesArray as: + * - An array of entries of length 1 or greater + * + */ +export const nonEmptyEntriesArray = new t.Type<EntriesArray, EntriesArray, unknown>( + 'NonEmptyEntriesArray', + entriesArray.is, + (input, context): Either<t.Errors, EntriesArray> => { + if (Array.isArray(input) && input.length === 0) { + return t.failure(input, context); + } else { + if ( + Array.isArray(input) && + input.some((entry) => entriesList.is(entry)) && + input.some((entry) => !entriesList.is(entry)) + ) { + // fail when an exception item contains both a value list entry and a non-value list entry + return t.failure(input, context, 'Cannot have entry of type list and other'); + } + return entriesArray.validate(input, context); + } + }, + t.identity +); + +export type NonEmptyEntriesArray = t.OutputOf<typeof nonEmptyEntriesArray>; +export type NonEmptyEntriesArrayDecoded = t.TypeOf<typeof nonEmptyEntriesArray>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_nested_entries_array/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_nested_entries_array/index.test.ts new file mode 100644 index 0000000000000..1d1d659f028c4 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_nested_entries_array/index.test.ts @@ -0,0 +1,115 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { EntriesArray } from '../entries'; +import { nonEmptyNestedEntriesArray } from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { getEntryMatchMock } from '../entry_match/index.mock'; +import { getEntryMatchAnyMock } from '../entry_match_any/index.mock'; +import { getEntryExistsMock } from '../entries_exist/index.mock'; +import { getEntryNestedMock } from '../entry_nested/index.mock'; + +describe('non_empty_nested_entries_array', () => { + test('it should FAIL validation when given an empty array', () => { + const payload: EntriesArray = []; + const decoded = nonEmptyNestedEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "[]" supplied to "NonEmptyNestedEntriesArray"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when given "undefined"', () => { + const payload = undefined; + const decoded = nonEmptyNestedEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "NonEmptyNestedEntriesArray"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should FAIL validation when given "null"', () => { + const payload = null; + const decoded = nonEmptyNestedEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "null" supplied to "NonEmptyNestedEntriesArray"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should validate an array of "match" entries', () => { + const payload: EntriesArray = [getEntryMatchMock(), getEntryMatchMock()]; + const decoded = nonEmptyNestedEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate an array of "match_any" entries', () => { + const payload: EntriesArray = [getEntryMatchAnyMock(), getEntryMatchAnyMock()]; + const decoded = nonEmptyNestedEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate an array of "exists" entries', () => { + const payload: EntriesArray = [getEntryExistsMock(), getEntryExistsMock()]; + const decoded = nonEmptyNestedEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should FAIL validation when given an array of "nested" entries', () => { + const payload: EntriesArray = [getEntryNestedMock(), getEntryNestedMock()]; + const decoded = nonEmptyNestedEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "operator"', + 'Invalid value "nested" supplied to "type"', + 'Invalid value "undefined" supplied to "value"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should validate an array of entries', () => { + const payload: EntriesArray = [ + getEntryExistsMock(), + getEntryMatchAnyMock(), + getEntryMatchMock(), + ]; + const decoded = nonEmptyNestedEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should FAIL validation when given an array of non entries', () => { + const payload = [1]; + const decoded = nonEmptyNestedEntriesArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "NonEmptyNestedEntriesArray"', + ]); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_nested_entries_array/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_nested_entries_array/index.ts new file mode 100644 index 0000000000000..eb2d1074b9f44 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/non_empty_nested_entries_array/index.ts @@ -0,0 +1,41 @@ +/* + * 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 * as t from 'io-ts'; +import { Either } from 'fp-ts/lib/Either'; +import { entriesMatch } from '../entry_match'; +import { entriesMatchAny } from '../entry_match_any'; +import { entriesExists } from '../entries_exist'; + +export const nestedEntryItem = t.union([entriesMatch, entriesMatchAny, entriesExists]); +export const nestedEntriesArray = t.array(nestedEntryItem); +export type NestedEntriesArray = t.TypeOf<typeof nestedEntriesArray>; + +/** + * Types the nonEmptyNestedEntriesArray as: + * - An array of entries of length 1 or greater + * + */ +export const nonEmptyNestedEntriesArray = new t.Type< + NestedEntriesArray, + NestedEntriesArray, + unknown +>( + 'NonEmptyNestedEntriesArray', + nestedEntriesArray.is, + (input, context): Either<t.Errors, NestedEntriesArray> => { + if (Array.isArray(input) && input.length === 0) { + return t.failure(input, context); + } else { + return nestedEntriesArray.validate(input, context); + } + }, + t.identity +); + +export type NonEmptyNestedEntriesArray = t.OutputOf<typeof nonEmptyNestedEntriesArray>; +export type NonEmptyNestedEntriesArrayDecoded = t.TypeOf<typeof nonEmptyNestedEntriesArray>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/os_type/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/os_type/index.test.ts new file mode 100644 index 0000000000000..3b8ca29afa4e9 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/os_type/index.test.ts @@ -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 { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { osType, osTypeArrayOrUndefined } from '.'; + +import { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; + +describe('osType', () => { + test('it will validate a correct osType', () => { + const payload = 'windows'; + const decoded = osType.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it will fail to validate an incorrect osType', () => { + const payload = 'foo'; + const decoded = osType.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "foo" supplied to ""linux" | "macos" | "windows""', + ]); + expect(message.schema).toEqual({}); + }); + + test('it will default to an empty array when osTypeArrayOrUndefined is used', () => { + const payload = undefined; + const decoded = osTypeArrayOrUndefined.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual([]); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/os_type/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/os_type/index.ts new file mode 100644 index 0000000000000..6e8cbb85b6312 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/os_type/index.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 * as t from 'io-ts'; +import { DefaultArray } from '@kbn/securitysolution-io-ts-types'; + +export const osType = t.keyof({ + linux: null, + macos: null, + windows: null, +}); +export type OsType = t.TypeOf<typeof osType>; + +export const osTypeArray = DefaultArray(osType); +export type OsTypeArray = t.TypeOf<typeof osTypeArray>; + +export const osTypeArrayOrUndefined = t.union([osTypeArray, t.undefined]); +export type OsTypeArrayOrUndefined = t.OutputOf<typeof osTypeArray>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/page/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/page/index.ts new file mode 100644 index 0000000000000..36faf8e7e5e24 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/page/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 * as t from 'io-ts'; + +export const page = t.number; // TODO: Change this out for PositiveNumber from siem +export type Page = t.TypeOf<typeof page>; + +export const pageOrUndefined = t.union([page, t.undefined]); +export type PageOrUndefined = t.TypeOf<typeof pageOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/per_page/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/per_page/index.ts new file mode 100644 index 0000000000000..669e0699b366c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/per_page/index.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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; + +export const per_page = t.number; // TODO: Change this out for PositiveNumber from siem +export type PerPage = t.TypeOf<typeof per_page>; + +export const perPageOrUndefined = t.union([per_page, t.undefined]); +export type PerPageOrUndefined = t.TypeOf<typeof perPageOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/pit/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/pit/index.test.ts new file mode 100644 index 0000000000000..9cafd8ed5ec0f --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/pit/index.test.ts @@ -0,0 +1,62 @@ +/* + * 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 { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { pitOrUndefined } from '.'; + +import * as t from 'io-ts'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; + +describe('pitOrUndefined', () => { + test('it will validate a correct pit', () => { + const payload = { id: '123', keepAlive: '1m' }; + const decoded = pitOrUndefined.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it will validate with the value of "undefined"', () => { + const obj = t.exact( + t.type({ + pit_id: pitOrUndefined, + }) + ); + const payload: t.TypeOf<typeof obj> = { + pit_id: undefined, + }; + const decoded = obj.decode({ + pit_id: undefined, + }); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it will validate a correct pit without having a "keepAlive"', () => { + const payload = { id: '123' }; + const decoded = pitOrUndefined.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it will fail to validate an incorrect pit', () => { + const payload = 'foo'; + const decoded = pitOrUndefined.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "foo" supplied to "({| id: string, keepAlive: (string | undefined) |} | undefined)"', + ]); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/pit/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/pit/index.ts new file mode 100644 index 0000000000000..97b6957e07e53 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/pit/index.ts @@ -0,0 +1,21 @@ +/* + * 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 * as t from 'io-ts'; + +export const pitId = t.string; +export const pit = t.exact( + t.type({ + id: pitId, + keepAlive: t.union([t.string, t.undefined]), + }) +); +export const pitOrUndefined = t.union([pit, t.undefined]); + +export type Pit = t.TypeOf<typeof pit>; +export type PitId = t.TypeOf<typeof pitId>; +export type PitOrUndefined = t.TypeOf<typeof pitOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/refresh/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/refresh/index.ts new file mode 100644 index 0000000000000..d1a7fe34fc704 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/refresh/index.ts @@ -0,0 +1,17 @@ +/* + * 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 * as t from 'io-ts'; + +export const refresh = t.union([t.literal('true'), t.literal('false')]); +export const refreshWithWaitFor = t.union([ + t.literal('true'), + t.literal('false'), + t.literal('wait_for'), +]); +export type Refresh = t.TypeOf<typeof refresh>; +export type RefreshWithWaitFor = t.TypeOf<typeof refreshWithWaitFor>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/required_keep_undefined/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/required_keep_undefined/index.ts new file mode 100644 index 0000000000000..5854fc42a3a78 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/required_keep_undefined/index.ts @@ -0,0 +1,23 @@ +/* + * 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. + */ + +/** + * This makes any optional property the same as Required<T> would but also has the + * added benefit of keeping your undefined. + * + * For example: + * type A = RequiredKeepUndefined<{ a?: undefined; b: number }>; + * + * will yield a type of: + * type A = { a: undefined; b: number; } + * @deprecated This has no replacement. We should stop using/relying on this and just remove it. + */ +export type RequiredKeepUndefined<T> = { [K in keyof T]-?: [T[K]] } extends infer U + ? U extends Record<keyof U, [unknown]> + ? { [K in keyof U]: U[K][0] } + : never + : never; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/search/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/search/index.test.ts new file mode 100644 index 0000000000000..6c45f50c9c894 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/search/index.test.ts @@ -0,0 +1,53 @@ +/* + * 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 { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { searchOrUndefined } from '.'; + +import * as t from 'io-ts'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; + +describe('search', () => { + test('it will validate a correct search', () => { + const payload = 'name:foo'; + const decoded = searchOrUndefined.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it will validate with the value of "undefined"', () => { + const obj = t.exact( + t.type({ + search: searchOrUndefined, + }) + ); + const payload: t.TypeOf<typeof obj> = { + search: undefined, + }; + const decoded = obj.decode({ + pit_id: undefined, + }); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it will fail to validate an incorrect search', () => { + const payload = ['foo']; + const decoded = searchOrUndefined.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "["foo"]" supplied to "(string | undefined)"', + ]); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/search/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/search/index.ts new file mode 100644 index 0000000000000..b93c4631cd223 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/search/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 * as t from 'io-ts'; + +export const search = t.string; +export type Search = t.TypeOf<typeof search>; + +export const searchOrUndefined = t.union([search, t.undefined]); +export type SearchOrUndefined = t.TypeOf<typeof searchOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/search_after/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/search_after/index.test.ts new file mode 100644 index 0000000000000..bc176af4fa307 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/search_after/index.test.ts @@ -0,0 +1,53 @@ +/* + * 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 { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { searchAfterOrUndefined } from '.'; + +import * as t from 'io-ts'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; + +describe('searchAfter', () => { + test('it will validate a correct search_after', () => { + const payload = ['test-1', 'test-2']; + const decoded = searchAfterOrUndefined.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it will validate with the value of "undefined"', () => { + const obj = t.exact( + t.type({ + search_after: searchAfterOrUndefined, + }) + ); + const payload: t.TypeOf<typeof obj> = { + search_after: undefined, + }; + const decoded = obj.decode({ + pit_id: undefined, + }); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it will fail to validate an incorrect search_after', () => { + const payload = 'foo'; + const decoded = searchAfterOrUndefined.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "foo" supplied to "(Array<string> | undefined)"', + ]); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/search_after/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/search_after/index.ts new file mode 100644 index 0000000000000..17735728d3418 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/search_after/index.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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; + +export const search_after = t.array(t.string); +export type SearchAfter = t.TypeOf<typeof search_after>; + +export const searchAfterOrUndefined = t.union([search_after, t.undefined]); +export type SearchAfterOrUndefined = t.TypeOf<typeof searchAfterOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/serializer/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/serializer/index.ts new file mode 100644 index 0000000000000..28322ff2e9910 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/serializer/index.ts @@ -0,0 +1,13 @@ +/* + * 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 * as t from 'io-ts'; + +export const serializer = t.string; +export type Serializer = t.TypeOf<typeof serializer>; +export const serializerOrUndefined = t.union([serializer, t.undefined]); +export type SerializerOrUndefined = t.TypeOf<typeof serializerOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/sort_field/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/sort_field/index.ts new file mode 100644 index 0000000000000..762fdf80c227d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/sort_field/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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; + +export const sort_field = t.string; +export const sortFieldOrUndefined = t.union([sort_field, t.undefined]); +export type SortFieldOrUndefined = t.TypeOf<typeof sortFieldOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/sort_order/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/sort_order/index.ts new file mode 100644 index 0000000000000..a849e45c316ea --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/sort_order/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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; + +export const sort_order = t.keyof({ asc: null, desc: null }); +export const sortOrderOrUndefined = t.union([sort_order, t.undefined]); +export type SortOrderOrUndefined = t.TypeOf<typeof sortOrderOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/tags/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/tags/index.ts new file mode 100644 index 0000000000000..0ad756f057718 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/tags/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 * as t from 'io-ts'; + +import { DefaultStringArray } from '@kbn/securitysolution-io-ts-types'; + +export const tags = DefaultStringArray; +export type Tags = t.TypeOf<typeof tags>; +export const tagsOrUndefined = t.union([tags, t.undefined]); +export type TagsOrUndefined = t.TypeOf<typeof tagsOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/tie_breaker_id/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/tie_breaker_id/index.ts new file mode 100644 index 0000000000000..362e500890818 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/tie_breaker_id/index.ts @@ -0,0 +1,12 @@ +/* + * 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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; + +export const tie_breaker_id = t.string; // TODO: Use UUID for this instead of a string for validation diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/timestamp/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/timestamp/index.ts new file mode 100644 index 0000000000000..30472bcd101f9 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/timestamp/index.ts @@ -0,0 +1,12 @@ +/* + * 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 * as t from 'io-ts'; +import { IsoDateString } from '@kbn/securitysolution-io-ts-types'; + +export const timestamp = IsoDateString; +export const timestampOrUndefined = t.union([IsoDateString, t.undefined]); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/total/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/total/index.ts new file mode 100644 index 0000000000000..f67ca0f2fc5e5 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/total/index.ts @@ -0,0 +1,12 @@ +/* + * 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 * as t from 'io-ts'; + +export const total = t.number; // TODO: Change this out for PositiveNumber from siem +export const totalUndefined = t.union([total, t.undefined]); +export type TotalOrUndefined = t.TypeOf<typeof totalUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/type/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/type/index.test.ts new file mode 100644 index 0000000000000..d87ea94728b13 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/type/index.test.ts @@ -0,0 +1,33 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { Type, type } from '.'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('type', () => { + test('it will work with a given expected type', () => { + const payload: Type = 'keyword'; + const decoded = type.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it will give an error if given a type that does not exist', () => { + const payload: Type | 'madeup' = 'madeup'; + const decoded = type.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "madeup" supplied to ""binary" | "boolean" | "byte" | "date" | "date_nanos" | "date_range" | "double" | "double_range" | "float" | "float_range" | "geo_point" | "geo_shape" | "half_float" | "integer" | "integer_range" | "ip" | "ip_range" | "keyword" | "long" | "long_range" | "shape" | "short" | "text""', + ]); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/type/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/type/index.ts new file mode 100644 index 0000000000000..5a1d234d5f2fc --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/type/index.ts @@ -0,0 +1,42 @@ +/* + * 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 * as t from 'io-ts'; + +/** + * Types of all the regular single value list items but not exception list + * or exception list types. Those types are in the list_types folder. + */ +export const type = t.keyof({ + binary: null, + boolean: null, + byte: null, + date: null, + date_nanos: null, + date_range: null, + double: null, + double_range: null, + float: null, + float_range: null, + geo_point: null, + geo_shape: null, + half_float: null, + integer: null, + integer_range: null, + ip: null, + ip_range: null, + keyword: null, + long: null, + long_range: null, + shape: null, + short: null, + text: null, +}); + +export const typeOrUndefined = t.union([type, t.undefined]); +export type Type = t.TypeOf<typeof type>; +export type TypeOrUndefined = t.TypeOf<typeof typeOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/underscore_version/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/underscore_version/index.ts new file mode 100644 index 0000000000000..6e47b89af8163 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/underscore_version/index.ts @@ -0,0 +1,12 @@ +/* + * 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 * as t from 'io-ts'; + +export const _version = t.string; +export const _versionOrUndefined = t.union([_version, t.undefined]); +export type _VersionOrUndefined = t.TypeOf<typeof _versionOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.mock.ts new file mode 100644 index 0000000000000..c0cbfe5e3019c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.mock.ts @@ -0,0 +1,19 @@ +/* + * 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 { UpdateComment, UpdateCommentsArray } from '.'; +import { ID } from '../../constants/index.mock'; + +export const getUpdateCommentMock = (): UpdateComment => ({ + comment: 'some comment', + id: ID, +}); + +export const getUpdateCommentsArrayMock = (): UpdateCommentsArray => [ + getUpdateCommentMock(), + getUpdateCommentMock(), +]; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.test.ts new file mode 100644 index 0000000000000..c1f1be8be9c1c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.test.ts @@ -0,0 +1,148 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { getUpdateCommentMock, getUpdateCommentsArrayMock } from './index.mock'; +import { + UpdateComment, + updateComment, + UpdateCommentsArray, + updateCommentsArray, + UpdateCommentsArrayOrUndefined, + updateCommentsArrayOrUndefined, +} from '.'; +import { foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +describe('UpdateComment', () => { + describe('updateComment', () => { + test('it should pass validation when supplied typical comment update', () => { + const payload = getUpdateCommentMock(); + const decoded = updateComment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should fail validation when supplied an undefined for "comment"', () => { + const payload = getUpdateCommentMock(); + // @ts-expect-error + delete payload.comment; + const decoded = updateComment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "comment"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation when supplied an empty string for "comment"', () => { + const payload = { ...getUpdateCommentMock(), comment: '' }; + const decoded = updateComment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "comment"']); + expect(message.schema).toEqual({}); + }); + + test('it should pass validation when supplied an undefined for "id"', () => { + const payload = getUpdateCommentMock(); + delete payload.id; + const decoded = updateComment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should fail validation when supplied an empty string for "id"', () => { + const payload = { ...getUpdateCommentMock(), id: '' }; + const decoded = updateComment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "" supplied to "id"']); + expect(message.schema).toEqual({}); + }); + + test('it should strip out extra key passed in', () => { + const payload: UpdateComment & { + extraKey?: string; + } = { ...getUpdateCommentMock(), extraKey: 'some new value' }; + const decoded = updateComment.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getUpdateCommentMock()); + }); + }); + + describe('updateCommentsArray', () => { + test('it should pass validation when supplied an array of comments', () => { + const payload = getUpdateCommentsArrayMock(); + const decoded = updateCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should fail validation when undefined', () => { + const payload = undefined; + const decoded = updateCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "Array<({| comment: NonEmptyString |} & Partial<{| id: NonEmptyString |}>)>"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation when array includes non comments types', () => { + const payload = [1] as unknown as UpdateCommentsArray; + const decoded = updateCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "Array<({| comment: NonEmptyString |} & Partial<{| id: NonEmptyString |}>)>"', + ]); + expect(message.schema).toEqual({}); + }); + }); + + describe('updateCommentsArrayOrUndefined', () => { + test('it should pass validation when supplied an array of comments', () => { + const payload = getUpdateCommentsArrayMock(); + const decoded = updateCommentsArrayOrUndefined.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should pass validation when supplied when undefined', () => { + const payload = undefined; + const decoded = updateCommentsArrayOrUndefined.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should fail validation when array includes non comments types', () => { + const payload = [1] as unknown as UpdateCommentsArrayOrUndefined; + const decoded = updateCommentsArray.decode(payload); + const message = pipe(decoded, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "1" supplied to "Array<({| comment: NonEmptyString |} & Partial<{| id: NonEmptyString |}>)>"', + ]); + expect(message.schema).toEqual({}); + }); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.ts new file mode 100644 index 0000000000000..6a0b4b08c7722 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/update_comment/index.ts @@ -0,0 +1,29 @@ +/* + * 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 * as t from 'io-ts'; +import { NonEmptyString } from '@kbn/securitysolution-io-ts-types'; +import { id } from '../id'; + +export const updateComment = t.intersection([ + t.exact( + t.type({ + comment: NonEmptyString, + }) + ), + t.exact( + t.partial({ + id, + }) + ), +]); + +export type UpdateComment = t.TypeOf<typeof updateComment>; +export const updateCommentsArray = t.array(updateComment); +export type UpdateCommentsArray = t.TypeOf<typeof updateCommentsArray>; +export const updateCommentsArrayOrUndefined = t.union([updateCommentsArray, t.undefined]); +export type UpdateCommentsArrayOrUndefined = t.TypeOf<typeof updateCommentsArrayOrUndefined>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/updated_at/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/updated_at/index.ts new file mode 100644 index 0000000000000..bafbadcd8f09b --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/updated_at/index.ts @@ -0,0 +1,12 @@ +/* + * 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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; + +export const updated_at = t.string; // TODO: Make this into an ISO Date string check diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/updated_by/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/updated_by/index.ts new file mode 100644 index 0000000000000..58c5b2d666bd8 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/updated_by/index.ts @@ -0,0 +1,12 @@ +/* + * 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. + */ + +/* eslint-disable @typescript-eslint/naming-convention */ + +import * as t from 'io-ts'; + +export const updated_by = t.string; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/value/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/value/index.ts new file mode 100644 index 0000000000000..38530a942275c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/common/value/index.ts @@ -0,0 +1,11 @@ +/* + * 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 * as t from 'io-ts'; + +export const value = t.string; +export const valueOrUndefined = t.union([value, t.undefined]); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/constants/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/constants/index.mock.ts new file mode 100644 index 0000000000000..ae91d63d6b7e3 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/constants/index.mock.ts @@ -0,0 +1,113 @@ +/* + * 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 { EndpointEntriesArray } from '../common/endpoint/entries'; +import { EntriesArray, Entry } from '../common/entries'; +import { EntryMatch } from '../common/entry_match'; +import { EntryNested } from '../common/entry_nested'; +import { OsTypeArray } from '../common/os_type'; + +export const DATE_NOW = '2020-04-20T15:25:31.830Z'; +export const OLD_DATE_RELATIVE_TO_DATE_NOW = '2020-04-19T15:25:31.830Z'; +export const USER = 'some user'; +export const ELASTIC_USER = 'elastic'; +export const LIST_INDEX = '.lists'; +export const LIST_ITEM_INDEX = '.items'; +export const NAME = 'some name'; +export const DESCRIPTION = 'some description'; +export const LIST_ID = 'some-list-id'; +export const LIST_ITEM_ID = 'some-list-item-id'; +export const TIE_BREAKER = '6a76b69d-80df-4ab2-8c3e-85f466b06a0e'; +export const TIE_BREAKERS = [ + '21530991-4051-46ec-bc35-2afa09a1b0b5', + '3c662054-ae37-4aa9-9936-3e8e2ea26775', + '60e49a20-3a23-48b6-8bf9-ed5e3b70f7a0', + '38814080-a40f-4358-992a-3b875f9b7dec', + '29fa61be-aaaf-411c-a78a-7059e3f723f1', + '9c19c959-cb9d-4cd2-99e4-1ea2baf0ef0e', + 'd409308c-f94b-4b3a-8234-bbd7a80c9140', + '87824c99-cd83-45c4-8aa6-4ad95dfea62c', + '7b940c17-9355-479f-b882-f3e575718f79', + '5983ad0c-4ef4-4fa0-8308-80ab9ecc4f74', +]; +export const META = {}; +export const TYPE = 'ip'; +export const VALUE = '127.0.0.1'; +export const VALUE_2 = '255.255.255'; +export const NAMESPACE_TYPE = 'single'; +export const NESTED_FIELD = 'parent.field'; + +// Exception List specific +export const ID = 'uuid_here'; +export const ITEM_ID = 'some-list-item-id'; +export const DETECTION_TYPE = 'detection'; +export const ENDPOINT_TYPE = 'endpoint'; +export const FIELD = 'host.name'; +export const OPERATOR = 'included'; +export const OPERATOR_EXCLUDED = 'excluded'; +export const ENTRY_VALUE = 'some host name'; +export const MATCH = 'match'; +export const MATCH_ANY = 'match_any'; +export const WILDCARD = 'wildcard'; +export const MAX_IMPORT_PAYLOAD_BYTES = 9000000; +export const IMPORT_BUFFER_SIZE = 1000; +export const LIST = 'list'; +export const EXISTS = 'exists'; +export const NESTED = 'nested'; +export const ENTRIES: EntriesArray = [ + { + entries: [{ field: 'nested.field', operator: 'included', type: 'match', value: 'some value' }], + field: 'some.parentField', + type: 'nested', + }, + { field: 'some.not.nested.field', operator: 'included', type: 'match', value: 'some value' }, +]; +export const ENDPOINT_ENTRIES: EndpointEntriesArray = [ + { + entries: [{ field: 'nested.field', operator: 'included', type: 'match', value: 'some value' }], + field: 'some.parentField', + type: 'nested', + }, + { field: 'some.not.nested.field', operator: 'included', type: 'match', value: 'some value' }, +]; +// ENTRIES_WITH_IDS should only be used to mock out functionality of a collection of transforms +// that are UI specific and useful for UI concerns that are inserted between the +// API and the actual user interface. In some ways these might be viewed as +// technical debt or to compensate for the differences and preferences +// of how ReactJS might prefer data vs. how we want to model data. +export const ENTRIES_WITH_IDS: EntriesArray = [ + { + entries: [ + { + field: 'nested.field', + id: '123', + operator: 'included', + type: 'match', + value: 'some value', + } as EntryMatch & { id: string }, + ], + field: 'some.parentField', + id: '123', + type: 'nested', + } as EntryNested & { id: string }, + { + field: 'some.not.nested.field', + id: '123', + operator: 'included', + type: 'match', + value: 'some value', + } as Entry & { id: string }, +]; +export const ITEM_TYPE = 'simple'; +export const OS_TYPES: OsTypeArray = ['windows']; +export const TAGS = []; +export const COMMENTS = []; +export const FILTER = 'name:Nicolas Bourbaki'; +export const CURSOR = 'c29tZXN0cmluZ2ZvcnlvdQ=='; +export const _VERSION = 'WzI5NywxXQ=='; +export const VERSION = 1; +export const IMMUTABLE = false; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..0efac9d4de7f5 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.mock.ts @@ -0,0 +1,30 @@ +/* + * 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 { CreateEndpointListItemSchema } from '.'; +import { + COMMENTS, + DESCRIPTION, + ENDPOINT_ENTRIES, + ITEM_TYPE, + META, + NAME, + OS_TYPES, + TAGS, +} from '../../constants/index.mock'; + +export const getCreateEndpointListItemSchemaMock = (): CreateEndpointListItemSchema => ({ + comments: COMMENTS, + description: DESCRIPTION, + entries: ENDPOINT_ENTRIES, + item_id: undefined, + meta: META, + name: NAME, + os_types: OS_TYPES, + tags: TAGS, + type: ITEM_TYPE, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.test.ts new file mode 100644 index 0000000000000..78d578dd5d475 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.test.ts @@ -0,0 +1,205 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { getCreateEndpointListItemSchemaMock } from './index.mock'; +import { CreateEndpointListItemSchema, createEndpointListItemSchema } from '.'; +import { getCreateCommentsArrayMock } from '../../common/create_comment/index.mock'; +import { getCommentsMock } from '../../common/comment/index.mock'; +import { CommentsArray } from '../../common/comment'; + +describe('create_endpoint_list_item_schema', () => { + test('it should pass validation when supplied a typical list item request not counting the auto generated uuid', () => { + const payload = getCreateEndpointListItemSchemaMock(); + const decoded = createEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as CreateEndpointListItemSchema).item_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should fail validation when supplied an undefined for "description"', () => { + const payload = getCreateEndpointListItemSchemaMock(); + // @ts-expect-error + delete payload.description; + const decoded = createEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "description"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation when supplied an undefined for "name"', () => { + const payload = getCreateEndpointListItemSchemaMock(); + // @ts-expect-error + delete payload.name; + const decoded = createEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "name"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation when supplied an undefined for "type"', () => { + const payload = getCreateEndpointListItemSchemaMock(); + // @ts-expect-error + delete payload.type; + const decoded = createEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "type"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation when supplied a "list_id" since it does not required one', () => { + const inputPayload: CreateEndpointListItemSchema & { list_id: string } = { + ...getCreateEndpointListItemSchemaMock(), + list_id: 'list-123', + }; + const decoded = createEndpointListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "list_id"']); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation when supplied a "namespace_type" since it does not required one', () => { + const inputPayload: CreateEndpointListItemSchema & { namespace_type: string } = { + ...getCreateEndpointListItemSchemaMock(), + namespace_type: 'single', + }; + const decoded = createEndpointListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "namespace_type"']); + expect(message.schema).toEqual({}); + }); + + test('it should pass validation when supplied an undefined for "meta" but strip it out and generate a correct body not counting the auto generated uuid', () => { + const payload = getCreateEndpointListItemSchemaMock(); + const outputPayload = getCreateEndpointListItemSchemaMock(); + delete payload.meta; + delete outputPayload.meta; + const decoded = createEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as CreateEndpointListItemSchema).item_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should pass validation when supplied an undefined for "comments" but return an array and generate a correct body not counting the auto generated uuid', () => { + const inputPayload = getCreateEndpointListItemSchemaMock(); + const outputPayload = getCreateEndpointListItemSchemaMock(); + delete inputPayload.comments; + outputPayload.comments = []; + const decoded = createEndpointListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as CreateEndpointListItemSchema).item_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should pass validation when supplied "comments" array', () => { + const inputPayload = { + ...getCreateEndpointListItemSchemaMock(), + comments: getCreateCommentsArrayMock(), + }; + const decoded = createEndpointListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as CreateEndpointListItemSchema).item_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(inputPayload); + }); + + test('it should fail validation when supplied "comments" with "created_at", "created_by", or "id" values', () => { + const inputPayload: Omit<CreateEndpointListItemSchema, 'comments'> & { + comments?: CommentsArray; + } = { + ...getCreateEndpointListItemSchemaMock(), + comments: [getCommentsMock()], + }; + const decoded = createEndpointListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "created_at,created_by,id"']); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation when supplied an undefined for "entries"', () => { + const inputPayload = getCreateEndpointListItemSchemaMock(); + const outputPayload = getCreateEndpointListItemSchemaMock(); + // @ts-expect-error + delete inputPayload.entries; + outputPayload.entries = []; + const decoded = createEndpointListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as CreateEndpointListItemSchema).item_id; + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "entries"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should pass validation when supplied an undefined for "tags" but return an array and generate a correct body not counting the auto generated uuid', () => { + const inputPayload = getCreateEndpointListItemSchemaMock(); + const outputPayload = getCreateEndpointListItemSchemaMock(); + delete inputPayload.tags; + outputPayload.tags = []; + const decoded = createEndpointListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as CreateEndpointListItemSchema).item_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should pass validation when supplied an undefined for "item_id" and auto generate a uuid', () => { + const inputPayload = getCreateEndpointListItemSchemaMock(); + delete inputPayload.item_id; + const decoded = createEndpointListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect((message.schema as CreateEndpointListItemSchema).item_id).toMatch( + /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i + ); + }); + + test('it should pass validation when supplied an undefined for "item_id" and generate a correct body not counting the uuid', () => { + const inputPayload = getCreateEndpointListItemSchemaMock(); + delete inputPayload.item_id; + const decoded = createEndpointListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as CreateEndpointListItemSchema).item_id; + expect(message.schema).toEqual(inputPayload); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: CreateEndpointListItemSchema & { + extraKey: string; + } = { ...getCreateEndpointListItemSchemaMock(), extraKey: 'some new value' }; + const decoded = createEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.ts new file mode 100644 index 0000000000000..08fd5e339ade9 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_endpoint_list_item_schema/index.ts @@ -0,0 +1,56 @@ +/* + * 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 * as t from 'io-ts'; + +import { DefaultUuid } from '@kbn/securitysolution-io-ts-types'; +import { nonEmptyEndpointEntriesArray } from '../../common/endpoint/entries'; +import { exceptionListItemType } from '../../common/exception_list_item_type'; +import { DefaultCreateCommentsArray } from '../../common/default_create_comments_array'; +import { OsTypeArray, osTypeArrayOrUndefined } from '../../common/os_type'; +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { CreateCommentsArray } from '../../common/create_comment'; +import { Tags, tags } from '../../common/tags'; +import { ItemId } from '../../common/item_id'; +import { EntriesArray } from '../../common/entries'; +import { description } from '../../common/description'; +import { name } from '../../common/name'; +import { meta } from '../../common/meta'; + +export const createEndpointListItemSchema = t.intersection([ + t.exact( + t.type({ + description, + entries: nonEmptyEndpointEntriesArray, + name, + type: exceptionListItemType, + }) + ), + t.exact( + t.partial({ + comments: DefaultCreateCommentsArray, // defaults to empty array if not set during decode + item_id: DefaultUuid, // defaults to GUID (uuid v4) if not set during decode + meta, // defaults to undefined if not set during decode + os_types: osTypeArrayOrUndefined, // defaults to empty array if not set during decode + tags, // defaults to empty array if not set during decode + }) + ), +]); + +export type CreateEndpointListItemSchema = t.OutputOf<typeof createEndpointListItemSchema>; + +// This type is used after a decode since some things are defaults after a decode. +export type CreateEndpointListItemSchemaDecoded = Omit< + RequiredKeepUndefined<t.TypeOf<typeof createEndpointListItemSchema>>, + 'tags' | 'item_id' | 'entries' | 'comments' | 'os_types' +> & { + comments: CreateCommentsArray; + tags: Tags; + item_id: ItemId; + entries: EntriesArray; + os_types: OsTypeArray; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..4ccc82bf2af05 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.mock.ts @@ -0,0 +1,61 @@ +/* + * 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 { CreateExceptionListItemSchema } from '.'; +import { + COMMENTS, + DESCRIPTION, + ENTRIES, + ITEM_ID, + ITEM_TYPE, + LIST_ID, + META, + NAME, + NAMESPACE_TYPE, + OS_TYPES, + TAGS, +} from '../../constants/index.mock'; + +export const getCreateExceptionListItemSchemaMock = (): CreateExceptionListItemSchema => ({ + comments: COMMENTS, + description: DESCRIPTION, + entries: ENTRIES, + item_id: undefined, + list_id: LIST_ID, + meta: META, + name: NAME, + namespace_type: NAMESPACE_TYPE, + os_types: OS_TYPES, + tags: TAGS, + type: ITEM_TYPE, +}); + +/** + * Useful for end to end testing + */ +export const getCreateExceptionListItemMinimalSchemaMock = (): CreateExceptionListItemSchema => ({ + description: DESCRIPTION, + entries: ENTRIES, + item_id: ITEM_ID, + list_id: LIST_ID, + name: NAME, + os_types: OS_TYPES, + type: ITEM_TYPE, +}); + +/** + * Useful for end to end testing + */ +export const getCreateExceptionListItemMinimalSchemaMockWithoutId = + (): CreateExceptionListItemSchema => ({ + description: DESCRIPTION, + entries: ENTRIES, + list_id: LIST_ID, + name: NAME, + os_types: OS_TYPES, + type: ITEM_TYPE, + }); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.test.ts new file mode 100644 index 0000000000000..4d03b83112a3f --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.test.ts @@ -0,0 +1,209 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getCreateExceptionListItemSchemaMock } from './index.mock'; +import { CreateExceptionListItemSchema, createExceptionListItemSchema } from '.'; +import { getCreateCommentsArrayMock } from '../../common/create_comment/index.mock'; +import { getCommentsMock } from '../../common/comment/index.mock'; +import { CommentsArray } from '../../common/comment'; + +describe('create_exception_list_item_schema', () => { + test('it should pass validation when supplied a typical exception list item request not counting the auto generated uuid', () => { + const payload = getCreateExceptionListItemSchemaMock(); + const decoded = createExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as CreateExceptionListItemSchema).item_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should fail validation when supplied an undefined for "description"', () => { + const payload = getCreateExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.description; + const decoded = createExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "description"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation when supplied an undefined for "name"', () => { + const payload = getCreateExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.name; + const decoded = createExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "name"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation when supplied an undefined for "type"', () => { + const payload = getCreateExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.type; + const decoded = createExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "type"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation when supplied an undefined for "list_id"', () => { + const inputPayload = getCreateExceptionListItemSchemaMock(); + // @ts-expect-error + delete inputPayload.list_id; + const decoded = createExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "list_id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should pass validation when supplied an undefined for "meta" but strip it out and generate a correct body not counting the auto generated uuid', () => { + const payload = getCreateExceptionListItemSchemaMock(); + const outputPayload = getCreateExceptionListItemSchemaMock(); + delete payload.meta; + delete outputPayload.meta; + const decoded = createExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as CreateExceptionListItemSchema).item_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should pass validation when supplied an undefined for "comments" but return an array and generate a correct body not counting the auto generated uuid', () => { + const inputPayload = getCreateExceptionListItemSchemaMock(); + const outputPayload = getCreateExceptionListItemSchemaMock(); + delete inputPayload.comments; + outputPayload.comments = []; + const decoded = createExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as CreateExceptionListItemSchema).item_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should pass validation when supplied "comments" array', () => { + const inputPayload = { + ...getCreateExceptionListItemSchemaMock(), + comments: getCreateCommentsArrayMock(), + }; + const decoded = createExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as CreateExceptionListItemSchema).item_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(inputPayload); + }); + + test('it should fail validation when supplied "comments" with "created_at" or "created_by" values', () => { + const inputPayload: Omit<CreateExceptionListItemSchema, 'comments'> & { + comments?: CommentsArray; + } = { + ...getCreateExceptionListItemSchemaMock(), + comments: [getCommentsMock()], + }; + const decoded = createExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "created_at,created_by,id"']); + expect(message.schema).toEqual({}); + }); + + test('it should fail validation when supplied an undefined for "entries"', () => { + const inputPayload = getCreateExceptionListItemSchemaMock(); + const outputPayload = getCreateExceptionListItemSchemaMock(); + // @ts-expect-error + delete inputPayload.entries; + outputPayload.entries = []; + const decoded = createExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as CreateExceptionListItemSchema).item_id; + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "entries"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should pass validation when supplied an undefined for "namespace_type" but return enum "single" and generate a correct body not counting the auto generated uuid', () => { + const inputPayload = getCreateExceptionListItemSchemaMock(); + const outputPayload = getCreateExceptionListItemSchemaMock(); + delete inputPayload.namespace_type; + outputPayload.namespace_type = 'single'; + const decoded = createExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as CreateExceptionListItemSchema).item_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should pass validation when supplied an undefined for "tags" but return an array and generate a correct body not counting the auto generated uuid', () => { + const inputPayload = getCreateExceptionListItemSchemaMock(); + const outputPayload = getCreateExceptionListItemSchemaMock(); + delete inputPayload.tags; + outputPayload.tags = []; + const decoded = createExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as CreateExceptionListItemSchema).item_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should pass validation when supplied an undefined for "item_id" and auto generate a uuid', () => { + const inputPayload = getCreateExceptionListItemSchemaMock(); + delete inputPayload.item_id; + const decoded = createExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect((message.schema as CreateExceptionListItemSchema).item_id).toMatch( + /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i + ); + }); + + test('it should pass validation when supplied an undefined for "item_id" and generate a correct body not counting the uuid', () => { + const inputPayload = getCreateExceptionListItemSchemaMock(); + delete inputPayload.item_id; + const decoded = createExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as CreateExceptionListItemSchema).item_id; + expect(message.schema).toEqual(inputPayload); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: CreateExceptionListItemSchema & { + extraKey?: string; + } = getCreateExceptionListItemSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = createExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.ts new file mode 100644 index 0000000000000..9276a0dafa8b5 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_item_schema/index.ts @@ -0,0 +1,65 @@ +/* + * 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 * as t from 'io-ts'; +import { DefaultUuid } from '@kbn/securitysolution-io-ts-types'; + +import { DefaultCreateCommentsArray } from '../../common/default_create_comments_array'; +import { CreateCommentsArray } from '../../common/create_comment'; +import { Tags, tags } from '../../common/tags'; +import { ItemId } from '../../common/item_id'; +import { EntriesArray } from '../../common/entries'; +import { NamespaceType } from '../../common/default_namespace'; +import { OsTypeArray, osTypeArrayOrUndefined } from '../../common/os_type'; +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { description } from '../../common/description'; +import { list_id } from '../../common/list_id'; +import { name } from '../../common/name'; +import { exceptionListItemType } from '../../common/exception_list_item_type'; +import { meta } from '../../common/meta'; +import { namespace_type } from '../../common/namespace_type'; +import { nonEmptyEntriesArray } from '../../common/non_empty_entries_array'; +import { ExpireTimeOrUndefined, expireTimeOrUndefined } from '../../common'; + +export const createExceptionListItemSchema = t.intersection([ + t.exact( + t.type({ + description, + entries: nonEmptyEntriesArray, + list_id, + name, + type: exceptionListItemType, + }) + ), + t.exact( + t.partial({ + comments: DefaultCreateCommentsArray, // defaults to empty array if not set during decode + expire_time: expireTimeOrUndefined, + item_id: DefaultUuid, // defaults to GUID (uuid v4) if not set during decode + meta, // defaults to undefined if not set during decode + namespace_type, // defaults to 'single' if not set during decode + os_types: osTypeArrayOrUndefined, // defaults to empty array if not set during decode + tags, // defaults to empty array if not set during decode + }) + ), +]); + +export type CreateExceptionListItemSchema = t.OutputOf<typeof createExceptionListItemSchema>; + +// This type is used after a decode since some things are defaults after a decode. +export type CreateExceptionListItemSchemaDecoded = Omit< + RequiredKeepUndefined<t.TypeOf<typeof createExceptionListItemSchema>>, + 'tags' | 'item_id' | 'entries' | 'namespace_type' | 'comments' | 'expire_time' +> & { + comments: CreateCommentsArray; + expire_time: ExpireTimeOrUndefined; + tags: Tags; + item_id: ItemId; + entries: EntriesArray; + namespace_type: NamespaceType; + os_types: OsTypeArray; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_schema/index.mock.ts new file mode 100644 index 0000000000000..2110a0056f0c4 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_schema/index.mock.ts @@ -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 { + DESCRIPTION, + ENDPOINT_TYPE, + LIST_ID, + META, + NAME, + NAMESPACE_TYPE, + VERSION, +} from '../../constants/index.mock'; + +import { CreateExceptionListSchema } from '.'; + +export const getCreateExceptionListSchemaMock = (): CreateExceptionListSchema => ({ + description: DESCRIPTION, + list_id: undefined, + meta: META, + name: NAME, + namespace_type: NAMESPACE_TYPE, + os_types: [], + tags: [], + type: ENDPOINT_TYPE, + version: VERSION, +}); + +/** + * Useful for end to end testing + */ +export const getCreateExceptionListMinimalSchemaMock = (): CreateExceptionListSchema => ({ + description: DESCRIPTION, + list_id: LIST_ID, + name: NAME, + type: ENDPOINT_TYPE, +}); + +/** + * Useful for end to end testing + */ +export const getCreateExceptionListMinimalSchemaMockWithoutId = (): CreateExceptionListSchema => ({ + description: DESCRIPTION, + name: NAME, + type: ENDPOINT_TYPE, +}); + +/** + * Useful for end to end testing with detections + */ +export const getCreateExceptionListDetectionSchemaMock = (): CreateExceptionListSchema => ({ + description: DESCRIPTION, + list_id: LIST_ID, + name: NAME, + type: 'detection', +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_schema/index.test.ts new file mode 100644 index 0000000000000..26399804591e2 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_schema/index.test.ts @@ -0,0 +1,83 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { CreateExceptionListSchema, createExceptionListSchema } from '.'; +import { getCreateExceptionListSchemaMock } from './index.mock'; + +describe('create_exception_list_schema', () => { + test('it should validate a typical exception lists request and generate a correct body not counting the uuid', () => { + const payload = getCreateExceptionListSchemaMock(); + const decoded = createExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as CreateExceptionListSchema).list_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "meta" and generate a correct body not counting the uuid', () => { + const payload = getCreateExceptionListSchemaMock(); + delete payload.meta; + const decoded = createExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as CreateExceptionListSchema).list_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "tags" but return an array and generate a correct body not counting the uuid', () => { + const inputPayload = getCreateExceptionListSchemaMock(); + const outputPayload = getCreateExceptionListSchemaMock(); + delete inputPayload.tags; + outputPayload.tags = []; + const decoded = createExceptionListSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as CreateExceptionListSchema).list_id; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should accept an undefined for "list_id" and auto generate a uuid', () => { + const inputPayload = getCreateExceptionListSchemaMock(); + delete inputPayload.list_id; + const decoded = createExceptionListSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect((message.schema as CreateExceptionListSchema).list_id).toMatch( + /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i + ); + }); + + test('it should accept an undefined for "list_id" and generate a correct body not counting the uuid', () => { + const inputPayload = getCreateExceptionListSchemaMock(); + delete inputPayload.list_id; + const decoded = createExceptionListSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as CreateExceptionListSchema).list_id; + expect(message.schema).toEqual(inputPayload); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: CreateExceptionListSchema & { + extraKey?: string; + } = getCreateExceptionListSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = createExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_schema/index.ts new file mode 100644 index 0000000000000..000b4c65a01f4 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_exception_list_schema/index.ts @@ -0,0 +1,58 @@ +/* + * 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 * as t from 'io-ts'; +import { + DefaultUuid, + DefaultVersionNumber, + DefaultVersionNumberDecoded, +} from '@kbn/securitysolution-io-ts-types'; + +import { exceptionListType } from '../../common/exception_list'; +import { OsTypeArray, osTypeArrayOrUndefined } from '../../common/os_type'; +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { Tags, tags } from '../../common/tags'; +import { ListId } from '../../common/list_id'; +import { NamespaceType } from '../../common/default_namespace'; +import { name } from '../../common/name'; +import { description } from '../../common/description'; +import { namespace_type } from '../../common/namespace_type'; +import { meta } from '../../common/meta'; + +export const createExceptionListSchema = t.intersection([ + t.exact( + t.type({ + description, + name, + type: exceptionListType, + }) + ), + t.exact( + t.partial({ + list_id: DefaultUuid, // defaults to a GUID (UUID v4) string if not set during decode + meta, // defaults to undefined if not set during decode + namespace_type, // defaults to 'single' if not set during decode + os_types: osTypeArrayOrUndefined, // defaults to empty array if not set during decode + tags, // defaults to empty array if not set during decode + version: DefaultVersionNumber, // defaults to numerical 1 if not set during decode + }) + ), +]); + +export type CreateExceptionListSchema = t.OutputOf<typeof createExceptionListSchema>; + +// This type is used after a decode since some things are defaults after a decode. +export type CreateExceptionListSchemaDecoded = Omit< + RequiredKeepUndefined<t.TypeOf<typeof createExceptionListSchema>>, + 'tags' | 'list_id' | 'namespace_type' | 'os_types' +> & { + tags: Tags; + list_id: ListId; + namespace_type: NamespaceType; + os_types: OsTypeArray; + version: DefaultVersionNumberDecoded; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..03085b3cfa8e7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_item_schema/index.mock.ts @@ -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 { LIST_ID, LIST_ITEM_ID, META, VALUE } from '../../constants/index.mock'; + +import { CreateListItemSchema } from '.'; + +export const getCreateListItemSchemaMock = (): CreateListItemSchema => ({ + id: LIST_ITEM_ID, + list_id: LIST_ID, + meta: META, + value: VALUE, +}); + +/** + * Useful for end to end testing + */ +export const getCreateMinimalListItemSchemaMock = (): CreateListItemSchema => ({ + id: LIST_ITEM_ID, + list_id: LIST_ID, + value: VALUE, +}); + +/** + * Useful for end to end testing + */ +export const getCreateMinimalListItemSchemaMockWithoutId = (): CreateListItemSchema => ({ + list_id: LIST_ID, + value: VALUE, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_item_schema/index.test.ts new file mode 100644 index 0000000000000..509cbdbf0465a --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_item_schema/index.test.ts @@ -0,0 +1,57 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getCreateListItemSchemaMock } from './index.mock'; +import { CreateListItemSchema, createListItemSchema } from '.'; + +describe('create_list_item_schema', () => { + test('it should validate a typical list item request', () => { + const payload = getCreateListItemSchemaMock(); + const decoded = createListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for an id', () => { + const payload = getCreateListItemSchemaMock(); + delete payload.id; + const decoded = createListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for meta', () => { + const payload = getCreateListItemSchemaMock(); + delete payload.meta; + const decoded = createListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: CreateListItemSchema & { extraKey?: string } = getCreateListItemSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = createListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_item_schema/index.ts new file mode 100644 index 0000000000000..d18e7930c3eec --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_item_schema/index.ts @@ -0,0 +1,30 @@ +/* + * 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 * as t from 'io-ts'; + +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { list_id } from '../../common/list_id'; +import { value } from '../../common/value'; +import { id } from '../../common/id'; +import { meta } from '../../common/meta'; +import { refreshWithWaitFor } from '../../common/refresh'; + +export const createListItemSchema = t.intersection([ + t.exact( + t.type({ + list_id, + value, + }) + ), + t.exact(t.partial({ id, meta, refresh: refreshWithWaitFor })), +]); + +export type CreateListItemSchema = t.OutputOf<typeof createListItemSchema>; +export type CreateListItemSchemaDecoded = RequiredKeepUndefined< + t.TypeOf<typeof createListItemSchema> +>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.mock.ts new file mode 100644 index 0000000000000..aa4f45d74f4ad --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.mock.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 { DESCRIPTION, LIST_ID, META, NAME, TYPE, VERSION } from '../../constants/index.mock'; + +import { CreateListSchema } from '.'; + +export const getCreateListSchemaMock = (): CreateListSchema => ({ + description: DESCRIPTION, + deserializer: undefined, + id: LIST_ID, + meta: META, + name: NAME, + serializer: undefined, + type: TYPE, + version: VERSION, +}); + +/** + * Useful for end to end tests and other mechanisms which want to fill in the values + */ +export const getCreateMinimalListSchemaMock = (): CreateListSchema => ({ + description: DESCRIPTION, + id: LIST_ID, + name: NAME, + type: TYPE, +}); + +/** + * Useful for end to end tests and other mechanisms which want to fill in the values + */ +export const getCreateMinimalListSchemaMockWithoutId = (): CreateListSchema => ({ + description: DESCRIPTION, + name: NAME, + type: TYPE, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.test.ts new file mode 100644 index 0000000000000..a6043addd72a1 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.test.ts @@ -0,0 +1,75 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { CreateListSchema, createListSchema } from '.'; +import { getCreateListSchemaMock } from './index.mock'; + +describe('create_list_schema', () => { + test('it should validate a typical lists request', () => { + const payload = getCreateListSchemaMock(); + const decoded = createListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for an id', () => { + const payload = getCreateListSchemaMock(); + delete payload.id; + const decoded = createListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for meta', () => { + const payload = getCreateListSchemaMock(); + delete payload.meta; + const decoded = createListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for serializer', () => { + const payload = getCreateListSchemaMock(); + delete payload.serializer; + const decoded = createListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for deserializer', () => { + const payload = getCreateListSchemaMock(); + delete payload.deserializer; + const decoded = createListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: CreateListSchema & { extraKey?: string } = getCreateListSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = createListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.ts new file mode 100644 index 0000000000000..fd771d40a501c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_list_schema/index.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 * as t from 'io-ts'; +import { + DefaultVersionNumber, + DefaultVersionNumberDecoded, +} from '@kbn/securitysolution-io-ts-types'; + +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { name } from '../../common/name'; +import { description } from '../../common/description'; +import { type } from '../../common/type'; +import { deserializer } from '../../common/deserializer'; +import { id } from '../../common/id'; +import { meta } from '../../common/meta'; +import { serializer } from '../../common/serializer'; + +export const createListSchema = t.intersection([ + t.exact( + t.type({ + description, + name, + type, + }) + ), + t.exact( + t.partial({ + deserializer, // defaults to undefined if not set during decode + id, // defaults to undefined if not set during decode + meta, // defaults to undefined if not set during decode + serializer, // defaults to undefined if not set during decode + version: DefaultVersionNumber, // defaults to a numerical 1 if not set during decode + }) + ), +]); + +export type CreateListSchema = t.OutputOf<typeof createListSchema>; +export type CreateListSchemaDecoded = RequiredKeepUndefined< + Omit<t.TypeOf<typeof createListSchema>, 'version'> +> & { version: DefaultVersionNumberDecoded }; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_rule_exception_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_rule_exception_item_schema/index.test.ts new file mode 100644 index 0000000000000..bd95fdd0e0866 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_rule_exception_item_schema/index.test.ts @@ -0,0 +1,125 @@ +/* + * 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 { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { left } from 'fp-ts/lib/Either'; +import { CreateRuleExceptionListItemSchema, createRuleExceptionListItemSchema } from '.'; +import { CreateExceptionListItemSchema } from '../create_exception_list_item_schema'; + +const getCreateExceptionListItemSchemaMock = (): CreateExceptionListItemSchema => ({ + comments: [], + description: 'some description', + entries: [ + { + field: 'host.name', + operator: 'included', + type: 'match_any', + value: ['foo', 'bar'], + }, + ], + item_id: undefined, + list_id: 'some-list-id', + name: 'some name', + namespace_type: 'single', + os_types: [], + tags: [], + type: 'simple', +}); + +describe('createRuleExceptionListItemSchema', () => { + test('empty objects do not validate', () => { + const payload = {} as CreateRuleExceptionListItemSchema; + + const decoded = createRuleExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "description"', + 'Invalid value "undefined" supplied to "entries"', + 'Invalid value "undefined" supplied to "name"', + 'Invalid value "undefined" supplied to "type"', + ]); + expect(message.schema).toEqual({}); + }); + + test('items without list_id validate', () => { + const payload: CreateRuleExceptionListItemSchema = { + description: 'Exception item for rule default exception list', + entries: [ + { + field: 'some.not.nested.field', + operator: 'included', + type: 'match', + value: 'some value', + }, + ], + name: 'Sample exception item', + type: 'simple', + }; + + const decoded = createRuleExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual( + expect.objectContaining({ + comments: [], + description: 'Exception item for rule default exception list', + entries: [ + { + field: 'some.not.nested.field', + operator: 'included', + type: 'match', + value: 'some value', + }, + ], + name: 'Sample exception item', + os_types: [], + tags: [], + type: 'simple', + }) + ); + }); + + test('items with list_id do not validate', () => { + const payload = + getCreateExceptionListItemSchemaMock() as unknown as CreateRuleExceptionListItemSchema; + + const decoded = createRuleExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "some-list-id" supplied to "list_id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('made up parameters do not validate', () => { + const payload: Partial<CreateRuleExceptionListItemSchema> & { madeUp: string } = { + description: 'Exception item for rule default exception list', + entries: [ + { + field: 'some.not.nested.field', + operator: 'included', + type: 'match', + value: 'some value', + }, + ], + name: 'Sample exception item', + type: 'simple', + madeUp: 'invalid value', + }; + + const decoded = createRuleExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "madeUp"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_rule_exception_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_rule_exception_item_schema/index.ts new file mode 100644 index 0000000000000..ef0446d9207a7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/create_rule_exception_item_schema/index.ts @@ -0,0 +1,71 @@ +/* + * 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 * as t from 'io-ts'; +import { DefaultUuid } from '@kbn/securitysolution-io-ts-types'; + +import { + CreateCommentsArray, + DefaultCreateCommentsArray, + description, + EntriesArray, + exceptionListItemType, + ItemId, + meta, + NamespaceType, + namespaceType, + nonEmptyEntriesArray, + OsTypeArray, + osTypeArrayOrUndefined, + Tags, + tags, + name, + ExpireTimeOrUndefined, + expireTimeOrUndefined, +} from '../../common'; +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; + +export const createRuleExceptionListItemSchema = t.intersection([ + t.exact( + t.type({ + description, + entries: nonEmptyEntriesArray, + name, + type: exceptionListItemType, + }) + ), + t.exact( + t.partial({ + comments: DefaultCreateCommentsArray, // defaults to empty array if not set during decode + item_id: DefaultUuid, // defaults to GUID (uuid v4) if not set during decode + list_id: t.undefined, + meta, // defaults to undefined if not set during decode + namespace_type: namespaceType, // defaults to 'single' if not set during decode + os_types: osTypeArrayOrUndefined, // defaults to empty array if not set during decode + tags, // defaults to empty array if not set during decode + expire_time: expireTimeOrUndefined, + }) + ), +]); + +export type CreateRuleExceptionListItemSchema = t.OutputOf< + typeof createRuleExceptionListItemSchema +>; + +// This type is used after a decode since some things are defaults after a decode. +export type CreateRuleExceptionListItemSchemaDecoded = Omit< + RequiredKeepUndefined<t.TypeOf<typeof createRuleExceptionListItemSchema>>, + 'tags' | 'item_id' | 'entries' | 'namespace_type' | 'comments' | 'expire_time' +> & { + comments: CreateCommentsArray; + tags: Tags; + item_id: ItemId; + entries: EntriesArray; + namespace_type: NamespaceType; + os_types: OsTypeArray; + expire_time: ExpireTimeOrUndefined; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_endpoint_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_endpoint_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..2547180e114f7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_endpoint_list_item_schema/index.mock.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 { ID } from '../../constants/index.mock'; + +import { DeleteEndpointListItemSchema } from '.'; + +export const getDeleteEndpointListItemSchemaMock = (): DeleteEndpointListItemSchema => ({ + id: ID, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_endpoint_list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_endpoint_list_item_schema/index.test.ts new file mode 100644 index 0000000000000..09697db0c5f42 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_endpoint_list_item_schema/index.test.ts @@ -0,0 +1,49 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { DeleteEndpointListItemSchema, deleteEndpointListItemSchema } from '.'; +import { getDeleteEndpointListItemSchemaMock } from './index.mock'; + +describe('delete_endpoint_list_item_schema', () => { + test('it should validate a typical endpoint list item request', () => { + const payload = getDeleteEndpointListItemSchemaMock(); + const decoded = deleteEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept a value for "namespace_type" since it does not require one', () => { + const payload: DeleteEndpointListItemSchema & { + namespace_type: string; + } = { ...getDeleteEndpointListItemSchemaMock(), namespace_type: 'single' }; + // @ts-expect-error + delete payload.namespace_type; + const decoded = deleteEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getDeleteEndpointListItemSchemaMock()); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: DeleteEndpointListItemSchema & { + extraKey?: string; + } = { ...getDeleteEndpointListItemSchemaMock(), extraKey: 'some new value' }; + const decoded = deleteEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_endpoint_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_endpoint_list_item_schema/index.ts new file mode 100644 index 0000000000000..9825b74142382 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_endpoint_list_item_schema/index.ts @@ -0,0 +1,26 @@ +/* + * 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 * as t from 'io-ts'; + +import { id } from '../../common/id'; +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { item_id } from '../../common/item_id'; + +export const deleteEndpointListItemSchema = t.exact( + t.partial({ + id, + item_id, + }) +); + +export type DeleteEndpointListItemSchema = t.OutputOf<typeof deleteEndpointListItemSchema>; + +// This type is used after a decode since some things are defaults after a decode. +export type DeleteEndpointListItemSchemaDecoded = RequiredKeepUndefined< + t.TypeOf<typeof deleteEndpointListItemSchema> +>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..98404e189beb7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_item_schema/index.mock.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 { ID, NAMESPACE_TYPE } from '../../constants/index.mock'; + +import { DeleteExceptionListItemSchema } from '.'; + +export const getDeleteExceptionListItemSchemaMock = (): DeleteExceptionListItemSchema => ({ + id: ID, + namespace_type: NAMESPACE_TYPE, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_item_schema/index.test.ts new file mode 100644 index 0000000000000..7131a969a795b --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_item_schema/index.test.ts @@ -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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { DeleteExceptionListItemSchema, deleteExceptionListItemSchema } from '.'; +import { getDeleteExceptionListItemSchemaMock } from './index.mock'; + +describe('delete_exception_list_item_schema', () => { + test('it should validate a typical exception list item request', () => { + const payload = getDeleteExceptionListItemSchemaMock(); + const decoded = deleteExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "namespace_type" but default to "single"', () => { + const payload = getDeleteExceptionListItemSchemaMock(); + delete payload.namespace_type; + const decoded = deleteExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getDeleteExceptionListItemSchemaMock()); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: DeleteExceptionListItemSchema & { + extraKey?: string; + } = getDeleteExceptionListItemSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = deleteExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_item_schema/index.ts new file mode 100644 index 0000000000000..02bcd800712ea --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_item_schema/index.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 * as t from 'io-ts'; + +import { NamespaceType } from '../../common/default_namespace'; +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { id } from '../../common/id'; +import { item_id } from '../../common/item_id'; +import { namespace_type } from '../../common/namespace_type'; + +export const deleteExceptionListItemSchema = t.exact( + t.partial({ + id, + item_id, + namespace_type, // defaults to 'single' if not set during decode + }) +); + +export type DeleteExceptionListItemSchema = t.OutputOf<typeof deleteExceptionListItemSchema>; + +// This type is used after a decode since some things are defaults after a decode. +export type DeleteExceptionListItemSchemaDecoded = Omit< + RequiredKeepUndefined<t.TypeOf<typeof deleteExceptionListItemSchema>>, + 'namespace_type' +> & { + namespace_type: NamespaceType; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_schema/index.mock.ts new file mode 100644 index 0000000000000..7eca83a9d7135 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_schema/index.mock.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 { ID, NAMESPACE_TYPE } from '../../constants/index.mock'; + +import { DeleteExceptionListSchema } from '.'; + +export const getDeleteExceptionListSchemaMock = (): DeleteExceptionListSchema => ({ + id: ID, + namespace_type: NAMESPACE_TYPE, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_schema/index.test.ts new file mode 100644 index 0000000000000..a439ac0403225 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_schema/index.test.ts @@ -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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { DeleteExceptionListSchema, deleteExceptionListSchema } from '.'; +import { getDeleteExceptionListSchemaMock } from './index.mock'; + +describe('delete_exception_list_schema', () => { + test('it should validate a typical exception list request', () => { + const payload = getDeleteExceptionListSchemaMock(); + const decoded = deleteExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "namespace_type" but default to "single"', () => { + const payload = getDeleteExceptionListSchemaMock(); + delete payload.namespace_type; + const decoded = deleteExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getDeleteExceptionListSchemaMock()); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: DeleteExceptionListSchema & { + extraKey?: string; + } = getDeleteExceptionListSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = deleteExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_schema/index.ts new file mode 100644 index 0000000000000..1c04c0fdc17aa --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_exception_list_schema/index.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 * as t from 'io-ts'; + +import { NamespaceType } from '../../common/default_namespace'; +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { id } from '../../common/id'; +import { list_id } from '../../common/list_id'; +import { namespace_type } from '../../common/namespace_type'; + +export const deleteExceptionListSchema = t.exact( + t.partial({ + id, + list_id, + namespace_type, // defaults to 'single' if not set during decode + }) +); + +export type DeleteExceptionListSchema = t.OutputOf<typeof deleteExceptionListSchema>; + +// This type is used after a decode since some things are defaults after a decode. +export type DeleteExceptionListSchemaDecoded = Omit< + RequiredKeepUndefined<t.TypeOf<typeof deleteExceptionListSchema>>, + 'namespace_type' +> & { + namespace_type: NamespaceType; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..ef4ff721119a6 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_item_schema/index.mock.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 { ID, LIST_ID, VALUE } from '../../constants/index.mock'; + +import { DeleteListItemSchema } from '.'; + +export const getDeleteListItemSchemaMock = (): DeleteListItemSchema => ({ + id: ID, + list_id: LIST_ID, + value: VALUE, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_item_schema/index.test.ts new file mode 100644 index 0000000000000..07db295d3ef2d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_item_schema/index.test.ts @@ -0,0 +1,36 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { DeleteListItemSchema, deleteListItemSchema } from '.'; +import { getDeleteListItemSchemaMock } from './index.mock'; + +describe('delete_list_item_schema', () => { + test('it should validate a typical list item request', () => { + const payload = getDeleteListItemSchemaMock(); + const decoded = deleteListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: DeleteListItemSchema & { + extraKey?: string; + } = { ...getDeleteListItemSchemaMock(), extraKey: 'some new value' }; + const decoded = deleteListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_item_schema/index.ts new file mode 100644 index 0000000000000..4b9ef67630142 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_item_schema/index.ts @@ -0,0 +1,28 @@ +/* + * 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 * as t from 'io-ts'; + +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { id } from '../../common/id'; +import { list_id } from '../../common/list_id'; +import { valueOrUndefined } from '../../common/value'; +import { refresh } from '../../common/refresh'; + +export const deleteListItemSchema = t.intersection([ + t.exact( + t.type({ + value: valueOrUndefined, + }) + ), + t.exact(t.partial({ id, list_id, refresh })), +]); + +export type DeleteListItemSchema = t.OutputOf<typeof deleteListItemSchema>; +export type DeleteListItemSchemaDecoded = RequiredKeepUndefined< + t.TypeOf<typeof deleteListItemSchema> +>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_schema/index.mock.ts new file mode 100644 index 0000000000000..19b7a2aa15b94 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_schema/index.mock.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 { LIST_ID } from '../../constants/index.mock'; + +import { DeleteListSchema } from '.'; + +export const getDeleteListSchemaMock = (): DeleteListSchema => ({ + deleteReferences: false, + id: LIST_ID, + ignoreReferences: true, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_schema/index.test.ts new file mode 100644 index 0000000000000..5077c0795df34 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_schema/index.test.ts @@ -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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { DeleteListSchema, deleteListSchema } from '.'; +import { getDeleteListSchemaMock } from './index.mock'; + +describe('delete_list_schema', () => { + test('it should validate a typical lists request', () => { + const payload = getDeleteListSchemaMock(); + const decoded = deleteListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for an id', () => { + const payload = getDeleteListSchemaMock(); + // @ts-expect-error + delete payload.id; + const decoded = deleteListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['Invalid value "undefined" supplied to "id"']); + expect(message.schema).toEqual({}); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: DeleteListSchema & { extraKey?: string } = getDeleteListSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = deleteListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_schema/index.ts new file mode 100644 index 0000000000000..da1d252d9e368 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/delete_list_schema/index.ts @@ -0,0 +1,29 @@ +/* + * 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 * as t from 'io-ts'; +import { DefaultStringBooleanFalse } from '@kbn/securitysolution-io-ts-types'; + +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { id } from '../../common/id'; + +export const deleteListSchema = t.intersection([ + t.exact( + t.type({ + id, + }) + ), + t.exact( + t.partial({ + deleteReferences: DefaultStringBooleanFalse, + ignoreReferences: DefaultStringBooleanFalse, + }) + ), +]); + +export type DeleteListSchema = RequiredKeepUndefined<t.TypeOf<typeof deleteListSchema>>; +export type DeleteListSchemaEncoded = t.OutputOf<typeof deleteListSchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/duplicate_exception_list_query_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/duplicate_exception_list_query_schema/index.mock.ts new file mode 100644 index 0000000000000..d3f9b59d5cf0e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/duplicate_exception_list_query_schema/index.mock.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 { LIST_ID, NAMESPACE_TYPE } from '../../constants/index.mock'; + +import { DuplicateExceptionListQuerySchema } from '.'; + +export const getDuplicateExceptionListQuerySchemaMock = (): DuplicateExceptionListQuerySchema => ({ + list_id: LIST_ID, + namespace_type: NAMESPACE_TYPE, + include_expired_exceptions: 'true', +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/duplicate_exception_list_query_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/duplicate_exception_list_query_schema/index.test.ts new file mode 100644 index 0000000000000..73762793e3d2f --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/duplicate_exception_list_query_schema/index.test.ts @@ -0,0 +1,65 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { DuplicateExceptionListQuerySchema, duplicateExceptionListQuerySchema } from '.'; +import { getDuplicateExceptionListQuerySchemaMock } from './index.mock'; + +describe('duplicate_exceptionList_query_schema', () => { + test('it should validate a typical lists request', () => { + const payload = getDuplicateExceptionListQuerySchemaMock(); + const decoded = duplicateExceptionListQuerySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should default namespace_type to "single" if an undefined given for namespacetype', () => { + const payload = getDuplicateExceptionListQuerySchemaMock(); + delete payload.namespace_type; + const decoded = duplicateExceptionListQuerySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(message.schema).toEqual({ + include_expired_exceptions: 'true', + list_id: 'some-list-id', + namespace_type: 'single', + }); + }); + + test('it should NOT accept an undefined for an list_id', () => { + const payload = getDuplicateExceptionListQuerySchemaMock(); + // @ts-expect-error + delete payload.list_id; + const decoded = duplicateExceptionListQuerySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "list_id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: DuplicateExceptionListQuerySchema & { + extraKey?: string; + } = getDuplicateExceptionListQuerySchemaMock(); + payload.extraKey = 'some new value'; + const decoded = duplicateExceptionListQuerySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/duplicate_exception_list_query_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/duplicate_exception_list_query_schema/index.ts new file mode 100644 index 0000000000000..2a90eb4aeb05a --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/duplicate_exception_list_query_schema/index.ts @@ -0,0 +1,33 @@ +/* + * 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 * as t from 'io-ts'; +import { NamespaceType } from '../../common'; + +import { includeExpiredExceptionsOrUndefined } from '../../common/include_expired_exceptions'; +import { list_id } from '../../common/list_id'; +import { namespace_type } from '../../common/namespace_type'; + +export const duplicateExceptionListQuerySchema = t.exact( + t.type({ + list_id, + namespace_type, + include_expired_exceptions: includeExpiredExceptionsOrUndefined, + }) +); + +export type DuplicateExceptionListQuerySchema = t.OutputOf< + typeof duplicateExceptionListQuerySchema +>; + +// This type is used after a decode since some things are defaults after a decode. +export type DuplicateExceptionListQuerySchemaDecoded = Omit< + t.TypeOf<typeof duplicateExceptionListQuerySchema>, + 'namespace_type' +> & { + namespace_type: NamespaceType; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/export_exception_list_query_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/export_exception_list_query_schema/index.mock.ts new file mode 100644 index 0000000000000..2b1d6a439064e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/export_exception_list_query_schema/index.mock.ts @@ -0,0 +1,17 @@ +/* + * 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 { ID, LIST_ID, NAMESPACE_TYPE } from '../../constants/index.mock'; + +import { ExportExceptionListQuerySchema } from '.'; + +export const getExportExceptionListQuerySchemaMock = (): ExportExceptionListQuerySchema => ({ + id: ID, + list_id: LIST_ID, + namespace_type: NAMESPACE_TYPE, + include_expired_exceptions: 'true', +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/export_exception_list_query_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/export_exception_list_query_schema/index.test.ts new file mode 100644 index 0000000000000..dea087dca36d8 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/export_exception_list_query_schema/index.test.ts @@ -0,0 +1,78 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { ExportExceptionListQuerySchema, exportExceptionListQuerySchema } from '.'; +import { getExportExceptionListQuerySchemaMock } from './index.mock'; + +describe('export_exception_list_schema', () => { + test('it should validate a typical lists request', () => { + const payload = getExportExceptionListQuerySchemaMock(); + const decoded = exportExceptionListQuerySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for an id', () => { + const payload = getExportExceptionListQuerySchemaMock(); + // @ts-expect-error + delete payload.id; + const decoded = exportExceptionListQuerySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "undefined" supplied to "id"']); + expect(message.schema).toEqual({}); + }); + + test('it should default namespace_type to "single" if an undefined given for namespacetype', () => { + const payload = getExportExceptionListQuerySchemaMock(); + delete payload.namespace_type; + const decoded = exportExceptionListQuerySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(message.schema).toEqual({ + id: 'uuid_here', + include_expired_exceptions: 'true', + list_id: 'some-list-id', + namespace_type: 'single', + }); + }); + + test('it should NOT accept an undefined for an list_id', () => { + const payload = getExportExceptionListQuerySchemaMock(); + // @ts-expect-error + delete payload.list_id; + const decoded = exportExceptionListQuerySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "list_id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: ExportExceptionListQuerySchema & { + extraKey?: string; + } = getExportExceptionListQuerySchemaMock(); + payload.extraKey = 'some new value'; + const decoded = exportExceptionListQuerySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/export_exception_list_query_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/export_exception_list_query_schema/index.ts new file mode 100644 index 0000000000000..8967e45c5a61e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/export_exception_list_query_schema/index.ts @@ -0,0 +1,25 @@ +/* + * 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 * as t from 'io-ts'; + +import { id } from '../../common/id'; +import { includeExpiredExceptionsOrUndefined } from '../../common/include_expired_exceptions'; +import { list_id } from '../../common/list_id'; +import { namespace_type } from '../../common/namespace_type'; + +export const exportExceptionListQuerySchema = t.exact( + t.type({ + id, + list_id, + namespace_type, + include_expired_exceptions: includeExpiredExceptionsOrUndefined, + // TODO: Add file_name here with a default value + }) +); + +export type ExportExceptionListQuerySchema = t.OutputOf<typeof exportExceptionListQuerySchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/export_list_item_query_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/export_list_item_query_schema/index.mock.ts new file mode 100644 index 0000000000000..85076f592d16e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/export_list_item_query_schema/index.mock.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 { LIST_ID } from '../../constants/index.mock'; + +import { ExportListItemQuerySchema } from '.'; + +export const getExportListItemQuerySchemaMock = (): ExportListItemQuerySchema => ({ + list_id: LIST_ID, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/export_list_item_query_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/export_list_item_query_schema/index.test.ts new file mode 100644 index 0000000000000..f05e530cbb415 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/export_list_item_query_schema/index.test.ts @@ -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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { ExportListItemQuerySchema, exportListItemQuerySchema } from '.'; +import { getExportListItemQuerySchemaMock } from './index.mock'; + +describe('export_list_item_schema', () => { + test('it should validate a typical lists request', () => { + const payload = getExportListItemQuerySchemaMock(); + const decoded = exportListItemQuerySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for an id', () => { + const payload = getExportListItemQuerySchemaMock(); + // @ts-expect-error + delete payload.list_id; + const decoded = exportListItemQuerySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "list_id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: ExportListItemQuerySchema & { + extraKey?: string; + } = getExportListItemQuerySchemaMock(); + payload.extraKey = 'some new value'; + const decoded = exportListItemQuerySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/export_list_item_query_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/export_list_item_query_schema/index.ts new file mode 100644 index 0000000000000..a07e6c73434e5 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/export_list_item_query_schema/index.ts @@ -0,0 +1,23 @@ +/* + * 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 * as t from 'io-ts'; + +import { list_id } from '../../common/list_id'; +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; + +export const exportListItemQuerySchema = t.exact( + t.type({ + list_id, + // TODO: Add file_name here with a default value + }) +); + +export type ExportListItemQuerySchema = RequiredKeepUndefined< + t.TypeOf<typeof exportListItemQuerySchema> +>; +export type ExportListItemQuerySchemaEncoded = t.OutputOf<typeof exportListItemQuerySchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_endpoint_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_endpoint_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..5df0322cc803f --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_endpoint_list_item_schema/index.mock.ts @@ -0,0 +1,26 @@ +/* + * 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 { FILTER } from '../../constants/index.mock'; + +import { FindEndpointListItemSchema, FindEndpointListItemSchemaDecoded } from '.'; + +export const getFindEndpointListItemSchemaMock = (): FindEndpointListItemSchema => ({ + filter: FILTER, + page: '1', + per_page: '25', + sort_field: undefined, + sort_order: undefined, +}); + +export const getFindEndpointListItemSchemaDecodedMock = (): FindEndpointListItemSchemaDecoded => ({ + filter: FILTER, + page: 1, + per_page: 25, + sort_field: undefined, + sort_order: undefined, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_endpoint_list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_endpoint_list_item_schema/index.test.ts new file mode 100644 index 0000000000000..1ce9618781c46 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_endpoint_list_item_schema/index.test.ts @@ -0,0 +1,107 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { + getFindEndpointListItemSchemaDecodedMock, + getFindEndpointListItemSchemaMock, +} from './index.mock'; +import { FindEndpointListItemSchema, findEndpointListItemSchema } from '.'; + +describe('find_endpoint_list_item_schema', () => { + test('it should validate a typical find item request', () => { + const payload = getFindEndpointListItemSchemaMock(); + const decoded = findEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getFindEndpointListItemSchemaDecodedMock()); + }); + + test('it should validate and empty object since everything is optional and has defaults', () => { + const payload: FindEndpointListItemSchema = {}; + const decoded = findEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate with page missing', () => { + const payload = getFindEndpointListItemSchemaMock(); + delete payload.page; + const decoded = findEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindEndpointListItemSchemaDecodedMock(); + delete expected.page; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with pre_page missing', () => { + const payload = getFindEndpointListItemSchemaMock(); + delete payload.per_page; + const decoded = findEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindEndpointListItemSchemaDecodedMock(); + delete expected.per_page; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with filter missing', () => { + const payload = getFindEndpointListItemSchemaMock(); + delete payload.filter; + const decoded = findEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindEndpointListItemSchemaDecodedMock(); + delete expected.filter; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with sort_field missing', () => { + const payload = getFindEndpointListItemSchemaMock(); + delete payload.sort_field; + const decoded = findEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindEndpointListItemSchemaDecodedMock(); + delete expected.sort_field; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with sort_order missing', () => { + const payload = getFindEndpointListItemSchemaMock(); + delete payload.sort_order; + const decoded = findEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindEndpointListItemSchemaDecodedMock(); + delete expected.sort_order; + expect(message.schema).toEqual(expected); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: FindEndpointListItemSchema & { + extraKey: string; + } = { ...getFindEndpointListItemSchemaMock(), extraKey: 'some new value' }; + const decoded = findEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_endpoint_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_endpoint_list_item_schema/index.ts new file mode 100644 index 0000000000000..05f32f452f5d9 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_endpoint_list_item_schema/index.ts @@ -0,0 +1,31 @@ +/* + * 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 * as t from 'io-ts'; +import { StringToPositiveNumber } from '@kbn/securitysolution-io-ts-types'; + +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { filter } from '../../common/filter'; +import { sort_field } from '../../common/sort_field'; +import { sort_order } from '../../common/sort_order'; + +export const findEndpointListItemSchema = t.exact( + t.partial({ + filter, // defaults to undefined if not set during decode + page: StringToPositiveNumber, // defaults to undefined if not set during decode + per_page: StringToPositiveNumber, // defaults to undefined if not set during decode + sort_field, // defaults to undefined if not set during decode + sort_order, // defaults to undefined if not set during decode + }) +); + +export type FindEndpointListItemSchema = t.OutputOf<typeof findEndpointListItemSchema>; + +// This type is used after a decode since some things are defaults after a decode. +export type FindEndpointListItemSchemaDecoded = RequiredKeepUndefined< + t.TypeOf<typeof findEndpointListItemSchema> +>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..16b2ee7a8a370 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_item_schema/index.mock.ts @@ -0,0 +1,56 @@ +/* + * 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 { FILTER, LIST_ID, NAMESPACE_TYPE } from '../../constants/index.mock'; + +import { FindExceptionListItemSchema, FindExceptionListItemSchemaDecoded } from '.'; + +export const getFindExceptionListItemSchemaMock = (): FindExceptionListItemSchema => ({ + filter: FILTER, + list_id: LIST_ID, + namespace_type: NAMESPACE_TYPE, + page: '1', + per_page: '25', + search: undefined, + sort_field: undefined, + sort_order: undefined, +}); + +export const getFindExceptionListItemSchemaMultipleMock = (): FindExceptionListItemSchema => ({ + filter: 'name:Sofia Kovalevskaya,name:Hypatia,name:Sophie Germain', + list_id: 'list-1,list-2,list-3', + namespace_type: 'single,single,agnostic', + page: '1', + per_page: '25', + search: undefined, + sort_field: undefined, + sort_order: undefined, +}); + +export const getFindExceptionListItemSchemaDecodedMock = + (): FindExceptionListItemSchemaDecoded => ({ + filter: [FILTER], + list_id: [LIST_ID], + namespace_type: [NAMESPACE_TYPE], + page: 1, + per_page: 25, + search: undefined, + sort_field: undefined, + sort_order: undefined, + }); + +export const getFindExceptionListItemSchemaDecodedMultipleMock = + (): FindExceptionListItemSchemaDecoded => ({ + filter: ['name:Sofia Kovalevskaya', 'name:Hypatia', 'name:Sophie Germain'], + list_id: ['list-1', 'list-2', 'list-3'], + namespace_type: ['single', 'single', 'agnostic'], + page: 1, + per_page: 25, + search: undefined, + sort_field: undefined, + sort_order: undefined, + }); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_item_schema/index.test.ts new file mode 100644 index 0000000000000..1d66969333212 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_item_schema/index.test.ts @@ -0,0 +1,148 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { LIST_ID } from '../../constants/index.mock'; + +import { + getFindExceptionListItemSchemaDecodedMock, + getFindExceptionListItemSchemaDecodedMultipleMock, + getFindExceptionListItemSchemaMock, + getFindExceptionListItemSchemaMultipleMock, +} from './index.mock'; +import { + FindExceptionListItemSchema, + FindExceptionListItemSchemaDecoded, + findExceptionListItemSchema, +} from '.'; + +describe('find_list_item_schema', () => { + test('it should validate a typical find item request', () => { + const payload = getFindExceptionListItemSchemaMock(); + const decoded = findExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getFindExceptionListItemSchemaDecodedMock()); + }); + + test('it should validate a typical find item request with multiple input strings turned into array elements', () => { + const payload = getFindExceptionListItemSchemaMultipleMock(); + const decoded = findExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getFindExceptionListItemSchemaDecodedMultipleMock()); + }); + + test('it should validate just a list_id where it decodes into an array for list_id and adds a namespace_type of "single" as an array', () => { + const payload: FindExceptionListItemSchema = { list_id: LIST_ID }; + const decoded = findExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected: FindExceptionListItemSchemaDecoded = { + filter: [], + list_id: [LIST_ID], + namespace_type: ['single'], + page: undefined, + per_page: undefined, + search: undefined, + sort_field: undefined, + sort_order: undefined, + }; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with page missing', () => { + const payload = getFindExceptionListItemSchemaMock(); + delete payload.page; + const decoded = findExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindExceptionListItemSchemaDecodedMock(); + delete expected.page; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with per_page missing', () => { + const payload = getFindExceptionListItemSchemaMock(); + delete payload.per_page; + const decoded = findExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindExceptionListItemSchemaDecodedMock(); + delete expected.per_page; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with filter missing and add filter as an empty array', () => { + const payload = getFindExceptionListItemSchemaMock(); + delete payload.filter; + const decoded = findExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected: FindExceptionListItemSchemaDecoded = { + ...getFindExceptionListItemSchemaDecodedMock(), + filter: [], + }; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with sort_field missing', () => { + const payload = getFindExceptionListItemSchemaMock(); + delete payload.sort_field; + const decoded = findExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindExceptionListItemSchemaDecodedMock(); + delete expected.sort_field; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with sort_order missing', () => { + const payload = getFindExceptionListItemSchemaMock(); + delete payload.sort_order; + const decoded = findExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindExceptionListItemSchemaDecodedMock(); + delete expected.sort_order; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with search missing', () => { + const payload = getFindExceptionListItemSchemaMock(); + delete payload.search; + const decoded = findExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindExceptionListItemSchemaDecodedMock(); + delete expected.search; + expect(message.schema).toEqual(expected); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: FindExceptionListItemSchema & { + extraKey: string; + } = { ...getFindExceptionListItemSchemaMock(), extraKey: 'some new value' }; + const decoded = findExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_item_schema/index.ts new file mode 100644 index 0000000000000..7177a7144c7fb --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_item_schema/index.ts @@ -0,0 +1,53 @@ +/* + * 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 * as t from 'io-ts'; +import { + EmptyStringArray, + EmptyStringArrayDecoded, + NonEmptyStringArray, + StringToPositiveNumber, +} from '@kbn/securitysolution-io-ts-types'; + +import { + DefaultNamespaceArray, + DefaultNamespaceArrayTypeDecoded, +} from '../../common/default_namespace_array'; +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { sort_field } from '../../common/sort_field'; +import { sort_order } from '../../common/sort_order'; +import { search } from '../../common/search'; + +export const findExceptionListItemSchema = t.intersection([ + t.exact( + t.type({ + list_id: NonEmptyStringArray, + }) + ), + t.exact( + t.partial({ + filter: EmptyStringArray, // defaults to an empty array [] if not set during decode + namespace_type: DefaultNamespaceArray, // defaults to ['single'] if not set during decode + page: StringToPositiveNumber, // defaults to undefined if not set during decode + per_page: StringToPositiveNumber, // defaults to undefined if not set during decode + search, + sort_field, // defaults to undefined if not set during decode + sort_order, // defaults to undefined if not set during decode + }) + ), +]); + +export type FindExceptionListItemSchema = t.OutputOf<typeof findExceptionListItemSchema>; + +// This type is used after a decode since some things are defaults after a decode. +export type FindExceptionListItemSchemaDecoded = Omit< + RequiredKeepUndefined<t.TypeOf<typeof findExceptionListItemSchema>>, + 'namespace_type' | 'filter' +> & { + filter: EmptyStringArrayDecoded; + namespace_type: DefaultNamespaceArrayTypeDecoded; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_schema/index.mock.ts new file mode 100644 index 0000000000000..f963c6650cf29 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_schema/index.mock.ts @@ -0,0 +1,28 @@ +/* + * 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 { FILTER, NAMESPACE_TYPE } from '../../constants/index.mock'; + +import { FindExceptionListSchema, FindExceptionListSchemaDecoded } from '.'; + +export const getFindExceptionListSchemaMock = (): FindExceptionListSchema => ({ + filter: FILTER, + namespace_type: NAMESPACE_TYPE, + page: '1', + per_page: '25', + sort_field: undefined, + sort_order: undefined, +}); + +export const getFindExceptionListSchemaDecodedMock = (): FindExceptionListSchemaDecoded => ({ + filter: FILTER, + namespace_type: [NAMESPACE_TYPE], + page: 1, + per_page: 25, + sort_field: undefined, + sort_order: undefined, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_schema/index.test.ts new file mode 100644 index 0000000000000..8669a3657f025 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_schema/index.test.ts @@ -0,0 +1,119 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { + getFindExceptionListSchemaDecodedMock, + getFindExceptionListSchemaMock, +} from './index.mock'; +import { + FindExceptionListSchema, + FindExceptionListSchemaDecoded, + findExceptionListSchema, +} from '.'; + +describe('find_exception_list_schema', () => { + test('it should validate a typical find item request', () => { + const payload = getFindExceptionListSchemaMock(); + const decoded = findExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getFindExceptionListSchemaDecodedMock()); + }); + + test('it should validate and empty object since everything is optional and will respond only with namespace_type filled out to be "single"', () => { + const payload: FindExceptionListSchema = {}; + const decoded = findExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected: FindExceptionListSchemaDecoded = { + filter: undefined, + namespace_type: ['single'], + page: undefined, + per_page: undefined, + sort_field: undefined, + sort_order: undefined, + }; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with page missing', () => { + const payload = getFindExceptionListSchemaMock(); + delete payload.page; + const decoded = findExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindExceptionListSchemaDecodedMock(); + delete expected.page; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with pre_page missing', () => { + const payload = getFindExceptionListSchemaMock(); + delete payload.per_page; + const decoded = findExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindExceptionListSchemaDecodedMock(); + delete expected.per_page; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with filter missing', () => { + const payload = getFindExceptionListSchemaMock(); + delete payload.filter; + const decoded = findExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindExceptionListSchemaDecodedMock(); + delete expected.filter; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with sort_field missing', () => { + const payload = getFindExceptionListSchemaMock(); + delete payload.sort_field; + const decoded = findExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindExceptionListSchemaDecodedMock(); + delete expected.sort_field; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with sort_order missing', () => { + const payload = getFindExceptionListSchemaMock(); + delete payload.sort_order; + const decoded = findExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindExceptionListSchemaDecodedMock(); + delete expected.sort_order; + expect(message.schema).toEqual(expected); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: FindExceptionListSchema & { + extraKey: string; + } = { ...getFindExceptionListSchemaMock(), extraKey: 'some new value' }; + const decoded = findExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_schema/index.ts new file mode 100644 index 0000000000000..dc9acdefd7a97 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_exception_list_schema/index.ts @@ -0,0 +1,36 @@ +/* + * 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 * as t from 'io-ts'; +import { StringToPositiveNumber } from '@kbn/securitysolution-io-ts-types'; + +import { DefaultNamespaceArray, NamespaceTypeArray } from '../../common/default_namespace_array'; +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { filter } from '../../common/filter'; +import { sort_field } from '../../common/sort_field'; +import { sort_order } from '../../common/sort_order'; + +export const findExceptionListSchema = t.exact( + t.partial({ + filter, // defaults to undefined if not set during decode + namespace_type: DefaultNamespaceArray, // defaults to 'single' if not set during decode + page: StringToPositiveNumber, // defaults to undefined if not set during decode + per_page: StringToPositiveNumber, // defaults to undefined if not set during decode + sort_field, // defaults to undefined if not set during decode + sort_order, // defaults to undefined if not set during decode + }) +); + +export type FindExceptionListSchema = t.OutputOf<typeof findExceptionListSchema>; + +// This type is used after a decode since some things are defaults after a decode. +export type FindExceptionListSchemaDecoded = Omit< + RequiredKeepUndefined<t.TypeOf<typeof findExceptionListSchema>>, + 'namespace_type' +> & { + namespace_type: NamespaceTypeArray; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..44c952a9a3827 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_item_schema/index.mock.ts @@ -0,0 +1,30 @@ +/* + * 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 { CURSOR, FILTER, LIST_ID } from '../../constants/index.mock'; + +import { FindListItemSchema, FindListItemSchemaDecoded } from '.'; + +export const getFindListItemSchemaMock = (): FindListItemSchema => ({ + cursor: CURSOR, + filter: FILTER, + list_id: LIST_ID, + page: '1', + per_page: '25', + sort_field: undefined, + sort_order: undefined, +}); + +export const getFindListItemSchemaDecodedMock = (): FindListItemSchemaDecoded => ({ + cursor: CURSOR, + filter: FILTER, + list_id: LIST_ID, + page: 1, + per_page: 25, + sort_field: undefined, + sort_order: undefined, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_item_schema/index.test.ts new file mode 100644 index 0000000000000..589a40f641c67 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_item_schema/index.test.ts @@ -0,0 +1,103 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { LIST_ID } from '../../constants/index.mock'; + +import { FindListItemSchema, FindListItemSchemaDecoded, findListItemSchema } from '.'; +import { getFindListItemSchemaDecodedMock, getFindListItemSchemaMock } from './index.mock'; + +describe('find_list_item_schema', () => { + test('it should validate a typical find item request', () => { + const payload = getFindListItemSchemaMock(); + const decoded = findListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getFindListItemSchemaDecodedMock()); + }); + + test('it should validate just a list_id where it decodes into an array for list_id and adds a namespace_type of "single"', () => { + const payload: FindListItemSchema = { list_id: LIST_ID }; + const decoded = findListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected: FindListItemSchemaDecoded = { + cursor: undefined, + filter: undefined, + list_id: LIST_ID, + page: undefined, + per_page: undefined, + sort_field: undefined, + sort_order: undefined, + }; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with page missing', () => { + const payload = getFindListItemSchemaMock(); + delete payload.page; + const decoded = findListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindListItemSchemaDecodedMock(); + delete expected.page; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with pre_page missing', () => { + const payload = getFindListItemSchemaMock(); + delete payload.per_page; + const decoded = findListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindListItemSchemaDecodedMock(); + delete expected.per_page; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with sort_field missing', () => { + const payload = getFindListItemSchemaMock(); + delete payload.sort_field; + const decoded = findListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindListItemSchemaDecodedMock(); + delete expected.sort_field; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with sort_order missing', () => { + const payload = getFindListItemSchemaMock(); + delete payload.sort_order; + const decoded = findListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindListItemSchemaDecodedMock(); + delete expected.sort_order; + expect(message.schema).toEqual(expected); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: FindListItemSchema & { + extraKey: string; + } = { ...getFindListItemSchemaMock(), extraKey: 'some new value' }; + const decoded = findListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_item_schema/index.ts new file mode 100644 index 0000000000000..4279d5ef4a07f --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_item_schema/index.ts @@ -0,0 +1,35 @@ +/* + * 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 * as t from 'io-ts'; + +import { StringToPositiveNumber } from '@kbn/securitysolution-io-ts-types'; +import { filter } from '../../common/filter'; +import { cursor } from '../../common/cursor'; +import { sort_field } from '../../common/sort_field'; +import { sort_order } from '../../common/sort_order'; +import { list_id } from '../../common/list_id'; +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; + +export const findListItemSchema = t.intersection([ + t.exact(t.type({ list_id })), + t.exact( + t.partial({ + cursor, // defaults to undefined if not set during decode + filter, // defaults to undefined if not set during decode + page: StringToPositiveNumber, // defaults to undefined if not set during decode + per_page: StringToPositiveNumber, // defaults to undefined if not set during decode + sort_field, // defaults to undefined if not set during decode + sort_order, // defaults to undefined if not set during decode + }) + ), +]); + +export type FindListItemSchema = t.OutputOf<typeof findListItemSchema>; + +// This type is used after a decode since some things are defaults after a decode. +export type FindListItemSchemaDecoded = RequiredKeepUndefined<t.TypeOf<typeof findListItemSchema>>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_schema/index.mock.ts new file mode 100644 index 0000000000000..b80369fb6b432 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_schema/index.mock.ts @@ -0,0 +1,27 @@ +/* + * 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 { FILTER } from '../../constants/index.mock'; + +import { FindListSchema, FindListSchemaEncoded } from '.'; + +export const getFindListSchemaMock = (): FindListSchemaEncoded => ({ + filter: FILTER, + page: '1', + per_page: '25', + sort_field: undefined, + sort_order: undefined, +}); + +export const getFindListSchemaDecodedMock = (): FindListSchema => ({ + cursor: undefined, + filter: FILTER, + page: 1, + per_page: 25, + sort_field: undefined, + sort_order: undefined, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_schema/index.test.ts new file mode 100644 index 0000000000000..06b37bacf8452 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_schema/index.test.ts @@ -0,0 +1,104 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getFindListSchemaDecodedMock, getFindListSchemaMock } from './index.mock'; +import { FindListSchemaEncoded, findListSchema } from '.'; + +describe('find_list_schema', () => { + test('it should validate a typical find item request', () => { + const payload = getFindListSchemaMock(); + const decoded = findListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getFindListSchemaDecodedMock()); + }); + + test('it should validate and empty object since everything is optional and will respond with an empty object', () => { + const payload: FindListSchemaEncoded = {}; + const decoded = findListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should validate with page missing', () => { + const payload = getFindListSchemaMock(); + delete payload.page; + const decoded = findListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindListSchemaDecodedMock(); + delete expected.page; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with pre_page missing', () => { + const payload = getFindListSchemaMock(); + delete payload.per_page; + const decoded = findListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindListSchemaDecodedMock(); + delete expected.per_page; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with filter missing', () => { + const payload = getFindListSchemaMock(); + delete payload.filter; + const decoded = findListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindListSchemaDecodedMock(); + delete expected.filter; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with sort_field missing', () => { + const payload = getFindListSchemaMock(); + delete payload.sort_field; + const decoded = findListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindListSchemaDecodedMock(); + delete expected.sort_field; + expect(message.schema).toEqual(expected); + }); + + test('it should validate with sort_order missing', () => { + const payload = getFindListSchemaMock(); + delete payload.sort_order; + const decoded = findListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + const expected = getFindListSchemaDecodedMock(); + delete expected.sort_order; + expect(message.schema).toEqual(expected); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: FindListSchemaEncoded & { + extraKey: string; + } = { ...getFindListSchemaMock(), extraKey: 'some new value' }; + const decoded = findListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_schema/index.ts new file mode 100644 index 0000000000000..8f1520d0caf13 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/find_list_schema/index.ts @@ -0,0 +1,29 @@ +/* + * 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 * as t from 'io-ts'; + +import { StringToPositiveNumber } from '@kbn/securitysolution-io-ts-types'; +import { cursor } from '../../common/cursor'; +import { filter } from '../../common/filter'; +import { sort_field } from '../../common/sort_field'; +import { sort_order } from '../../common/sort_order'; +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; + +export const findListSchema = t.exact( + t.partial({ + cursor, // defaults to undefined if not set during decode + filter, // defaults to undefined if not set during decode + page: StringToPositiveNumber, // defaults to undefined if not set during decode + per_page: StringToPositiveNumber, // defaults to undefined if not set during decode + sort_field, // defaults to undefined if not set during decode + sort_order, // defaults to undefined if not set during decode + }) +); + +export type FindListSchema = RequiredKeepUndefined<t.TypeOf<typeof findListSchema>>; +export type FindListSchemaEncoded = t.OutputOf<typeof findListSchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/get_exception_filter_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/get_exception_filter_schema/index.ts new file mode 100644 index 0000000000000..656d6cea6164e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/get_exception_filter_schema/index.ts @@ -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 * as t from 'io-ts'; +import { namespaceType } from '../../common/default_namespace'; +import { exceptionListItemSchema } from '../../response'; +import { createExceptionListItemSchema } from '../create_exception_list_item_schema'; + +const exceptionListId = t.type({ + exception_list_id: t.string, + namespace_type: namespaceType, +}); + +export const exceptionListIds = t.type({ + exception_list_ids: t.array(exceptionListId), + type: t.literal('exception_list_ids'), +}); + +export const exceptions = t.type({ + exceptions: t.array(t.union([exceptionListItemSchema, createExceptionListItemSchema])), + type: t.literal('exception_items'), +}); + +const optionalExceptionParams = t.exact( + t.partial({ alias: t.string, chunk_size: t.number, exclude_exceptions: t.boolean }) +); + +export const getExceptionFilterSchema = t.intersection([ + t.union([exceptions, exceptionListIds]), + optionalExceptionParams, +]); + +export type GetExceptionFilterSchema = t.TypeOf<typeof getExceptionFilterSchema>; +export type ExceptionListId = t.TypeOf<typeof exceptionListId>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.mock.ts new file mode 100644 index 0000000000000..a50c455a9d60f --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.mock.ts @@ -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 { ENTRIES } from '../../constants/index.mock'; +import { ImportExceptionListItemSchema, ImportExceptionListItemSchemaDecoded } from '.'; + +export const getImportExceptionsListItemSchemaMock = ( + itemId = 'item_id_1', + listId = 'detection_list_id' +): ImportExceptionListItemSchema => ({ + description: 'some description', + entries: ENTRIES, + item_id: itemId, + list_id: listId, + name: 'Query with a rule id', + type: 'simple', +}); + +export const getImportExceptionsListItemSchemaDecodedMock = ( + itemId = 'item_id_1', + listId = 'detection_list_id' +): ImportExceptionListItemSchemaDecoded => ({ + ...getImportExceptionsListItemSchemaMock(itemId, listId), + comments: [], + meta: undefined, + namespace_type: 'single', + os_types: [], + tags: [], + expire_time: undefined, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.test.ts new file mode 100644 index 0000000000000..61e135bfd59a6 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.test.ts @@ -0,0 +1,172 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { importExceptionListItemSchema, ImportExceptionListItemSchema } from '.'; +import { + getImportExceptionsListItemSchemaDecodedMock, + getImportExceptionsListItemSchemaMock, +} from './index.mock'; +import { getCommentsArrayMock } from '../../common/comment/index.mock'; + +describe('import_list_item_schema', () => { + test('it should validate a typical item request', () => { + const payload = getImportExceptionsListItemSchemaMock(); + const decoded = importExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getImportExceptionsListItemSchemaDecodedMock()); + }); + + test('it should validate a typical item request with comments', () => { + const payload = { + ...getImportExceptionsListItemSchemaMock(), + comments: getCommentsArrayMock(), + }; + const decoded = importExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual({ + ...getImportExceptionsListItemSchemaDecodedMock(), + comments: [ + { + comment: 'some old comment', + created_at: '2020-04-20T15:25:31.830Z', + created_by: 'some user', + id: 'uuid_here', + }, + { + comment: 'some old comment', + created_at: '2020-04-20T15:25:31.830Z', + created_by: 'some user', + id: 'uuid_here', + }, + ], + }); + }); + + test('it should NOT accept an undefined for "item_id"', () => { + const payload: Partial<ReturnType<typeof getImportExceptionsListItemSchemaMock>> = + getImportExceptionsListItemSchemaMock(); + delete payload.item_id; + const decoded = importExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "item_id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "list_id"', () => { + const payload: Partial<ReturnType<typeof getImportExceptionsListItemSchemaMock>> = + getImportExceptionsListItemSchemaMock(); + delete payload.list_id; + const decoded = importExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "list_id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "description"', () => { + const payload: Partial<ReturnType<typeof getImportExceptionsListItemSchemaMock>> = + getImportExceptionsListItemSchemaMock(); + delete payload.description; + const decoded = importExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "description"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "name"', () => { + const payload: Partial<ReturnType<typeof getImportExceptionsListItemSchemaMock>> = + getImportExceptionsListItemSchemaMock(); + delete payload.name; + const decoded = importExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "name"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "type"', () => { + const payload: Partial<ReturnType<typeof getImportExceptionsListItemSchemaMock>> = + getImportExceptionsListItemSchemaMock(); + delete payload.type; + const decoded = importExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "type"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "entries"', () => { + const payload: Partial<ReturnType<typeof getImportExceptionsListItemSchemaMock>> = + getImportExceptionsListItemSchemaMock(); + delete payload.entries; + const decoded = importExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "entries"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should accept any partial fields', () => { + const payload: ImportExceptionListItemSchema = { + ...getImportExceptionsListItemSchemaMock(), + id: '123', + namespace_type: 'single', + comments: [], + os_types: [], + tags: ['123'], + created_at: '2018-08-24T17:49:30.145142000', + created_by: 'elastic', + updated_at: '2018-08-24T17:49:30.145142000', + updated_by: 'elastic', + tie_breaker_id: '123', + _version: '3', + meta: undefined, + }; + + const decoded = importExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: ImportExceptionListItemSchema & { + extraKey?: string; + } = getImportExceptionsListItemSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = importExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.ts new file mode 100644 index 0000000000000..a2d60e292aff5 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_item_schema/index.ts @@ -0,0 +1,86 @@ +/* + * 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 * as t from 'io-ts'; + +import { OsTypeArray, osTypeArrayOrUndefined } from '../../common/os_type'; +import { Tags, tags } from '../../common/tags'; +import { NamespaceType } from '../../common/default_namespace'; +import { name } from '../../common/name'; +import { description } from '../../common/description'; +import { namespace_type } from '../../common/namespace_type'; +import { meta } from '../../common/meta'; +import { list_id } from '../../common/list_id'; +import { item_id, ItemId } from '../../common/item_id'; +import { id } from '../../common/id'; +import { created_at } from '../../common/created_at'; +import { created_by } from '../../common/created_by'; +import { updated_at } from '../../common/updated_at'; +import { updated_by } from '../../common/updated_by'; +import { _version } from '../../common/underscore_version'; +import { tie_breaker_id } from '../../common/tie_breaker_id'; +import { nonEmptyEntriesArray } from '../../common/non_empty_entries_array'; +import { exceptionListItemType } from '../../common/exception_list_item_type'; +import { EntriesArray } from '../../common/entries'; +import { DefaultImportCommentsArray } from '../../common/default_import_comments_array'; +import { ExpireTimeOrUndefined, expireTimeOrUndefined, ImportCommentsArray } from '../../common'; + +/** + * Differences from this and the createExceptionsListItemSchema are + * - item_id is required + * - id is optional (but ignored in the import code - item_id is exclusively used for imports) + * - immutable is optional but if it is any value other than false it will be rejected + * - created_at is optional (but ignored in the import code) + * - updated_at is optional (but ignored in the import code) + * - created_by is optional (but ignored in the import code) + * - updated_by is optional (but ignored in the import code) + */ +export const importExceptionListItemSchema = t.intersection([ + t.exact( + t.type({ + description, + entries: nonEmptyEntriesArray, + item_id, + list_id, + name, + type: exceptionListItemType, + }) + ), + t.exact( + t.partial({ + id, // defaults to undefined if not set during decode + comments: DefaultImportCommentsArray, // defaults to empty array if not set during decode + created_at, // defaults undefined if not set during decode + updated_at, // defaults undefined if not set during decode + created_by, // defaults undefined if not set during decode + updated_by, // defaults undefined if not set during decode + _version, // defaults to undefined if not set during decode + tie_breaker_id, + meta, // defaults to undefined if not set during decode + namespace_type, // defaults to 'single' if not set during decode + os_types: osTypeArrayOrUndefined, // defaults to empty array if not set during decode + tags, // defaults to empty array if not set during decode + expire_time: expireTimeOrUndefined, + }) + ), +]); + +export type ImportExceptionListItemSchema = t.OutputOf<typeof importExceptionListItemSchema>; + +// This type is used after a decode since some things are defaults after a decode. +export type ImportExceptionListItemSchemaDecoded = Omit< + ImportExceptionListItemSchema, + 'tags' | 'item_id' | 'entries' | 'namespace_type' | 'comments' | 'expire_time' +> & { + comments: ImportCommentsArray; + tags: Tags; + item_id: ItemId; + entries: EntriesArray; + namespace_type: NamespaceType; + os_types: OsTypeArray; + expire_time: ExpireTimeOrUndefined; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_list_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_list_schema/index.mock.ts new file mode 100644 index 0000000000000..438b0cd54fb09 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_list_schema/index.mock.ts @@ -0,0 +1,29 @@ +/* + * 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 { ImportExceptionListSchemaDecoded, ImportExceptionsListSchema } from '.'; + +export const getImportExceptionsListSchemaMock = ( + listId = 'detection_list_id' +): ImportExceptionsListSchema => ({ + description: 'some description', + list_id: listId, + name: 'Query with a rule id', + type: 'detection', +}); + +export const getImportExceptionsListSchemaDecodedMock = ( + listId = 'detection_list_id' +): ImportExceptionListSchemaDecoded => ({ + ...getImportExceptionsListSchemaMock(listId), + immutable: false, + meta: undefined, + namespace_type: 'single', + os_types: [], + tags: [], + version: 1, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_list_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_list_schema/index.test.ts new file mode 100644 index 0000000000000..e1d0a55a17704 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_list_schema/index.test.ts @@ -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. + */ + +import { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { importExceptionsListSchema, ImportExceptionsListSchema } from '.'; +import { + getImportExceptionsListSchemaMock, + getImportExceptionsListSchemaDecodedMock, +} from './index.mock'; + +describe('import_list_item_schema', () => { + test('it should validate a typical lists request', () => { + const payload = getImportExceptionsListSchemaMock(); + const decoded = importExceptionsListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getImportExceptionsListSchemaDecodedMock()); + }); + + test('it should NOT accept an undefined for "list_id"', () => { + const payload: Partial<ReturnType<typeof getImportExceptionsListSchemaMock>> = + getImportExceptionsListSchemaMock(); + delete payload.list_id; + const decoded = importExceptionsListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "list_id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "description"', () => { + const payload: Partial<ReturnType<typeof getImportExceptionsListSchemaMock>> = + getImportExceptionsListSchemaMock(); + delete payload.description; + const decoded = importExceptionsListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "description"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "name"', () => { + const payload: Partial<ReturnType<typeof getImportExceptionsListSchemaMock>> = + getImportExceptionsListSchemaMock(); + delete payload.name; + const decoded = importExceptionsListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "name"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "type"', () => { + const payload: Partial<ReturnType<typeof getImportExceptionsListSchemaMock>> = + getImportExceptionsListSchemaMock(); + delete payload.type; + const decoded = importExceptionsListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "type"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept value of "true" for "immutable"', () => { + const payload: ImportExceptionsListSchema = { + ...getImportExceptionsListSchemaMock(), + immutable: true, + }; + + const decoded = importExceptionsListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "true" supplied to "immutable"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should accept any partial fields', () => { + const payload: ImportExceptionsListSchema = { + ...getImportExceptionsListSchemaMock(), + namespace_type: 'single', + immutable: false, + os_types: [], + tags: ['123'], + created_at: '2018-08-24T17:49:30.145142000', + created_by: 'elastic', + updated_at: '2018-08-24T17:49:30.145142000', + updated_by: 'elastic', + version: 3, + tie_breaker_id: '123', + _version: '3', + meta: undefined, + }; + + const decoded = importExceptionsListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: ImportExceptionsListSchema & { + extraKey?: string; + } = getImportExceptionsListSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = importExceptionsListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_list_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_list_schema/index.ts new file mode 100644 index 0000000000000..98f5988daf1cc --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_exception_list_schema/index.ts @@ -0,0 +1,84 @@ +/* + * 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 * as t from 'io-ts'; + +import { + DefaultVersionNumber, + DefaultVersionNumberDecoded, + OnlyFalseAllowed, +} from '@kbn/securitysolution-io-ts-types'; + +import { exceptionListType } from '../../common/exception_list'; +import { OsTypeArray, osTypeArrayOrUndefined } from '../../common/os_type'; +import { Tags, tags } from '../../common/tags'; +import { ListId, list_id } from '../../common/list_id'; +import { NamespaceType } from '../../common/default_namespace'; +import { name } from '../../common/name'; +import { description } from '../../common/description'; +import { namespace_type } from '../../common/namespace_type'; +import { meta } from '../../common/meta'; +import { id } from '../../common/id'; +import { created_at } from '../../common/created_at'; +import { created_by } from '../../common/created_by'; +import { updated_at } from '../../common/updated_at'; +import { updated_by } from '../../common/updated_by'; +import { _version } from '../../common/underscore_version'; +import { tie_breaker_id } from '../../common/tie_breaker_id'; + +/** + * Differences from this and the createExceptionsSchema are + * - list_id is required + * - id is optional (but ignored in the import code - list_id is exclusively used for imports) + * - immutable is optional but if it is any value other than false it will be rejected + * - created_at is optional (but ignored in the import code) + * - updated_at is optional (but ignored in the import code) + * - created_by is optional (but ignored in the import code) + * - updated_by is optional (but ignored in the import code) + */ +export const importExceptionsListSchema = t.intersection([ + t.exact( + t.type({ + description, + name, + type: exceptionListType, + list_id, + }) + ), + t.exact( + t.partial({ + id, // defaults to undefined if not set during decode + immutable: OnlyFalseAllowed, + meta, // defaults to undefined if not set during decode + namespace_type, // defaults to 'single' if not set during decode + os_types: osTypeArrayOrUndefined, // defaults to empty array if not set during decode + tags, // defaults to empty array if not set during decode + created_at, // defaults "undefined" if not set during decode + updated_at, // defaults "undefined" if not set during decode + created_by, // defaults "undefined" if not set during decode + updated_by, // defaults "undefined" if not set during decode + _version, // defaults to undefined if not set during decode + tie_breaker_id, + version: DefaultVersionNumber, // defaults to numerical 1 if not set during decode + }) + ), +]); + +export type ImportExceptionsListSchema = t.TypeOf<typeof importExceptionsListSchema>; + +// This type is used after a decode since some things are defaults after a decode. +export type ImportExceptionListSchemaDecoded = Omit< + ImportExceptionsListSchema, + 'tags' | 'list_id' | 'namespace_type' | 'os_types' | 'immutable' +> & { + immutable: false; + tags: Tags; + list_id: ListId; + namespace_type: NamespaceType; + os_types: OsTypeArray; + version: DefaultVersionNumberDecoded; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.mock.ts new file mode 100644 index 0000000000000..fc5fc0ca703b0 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.mock.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 { LIST_ID, TYPE } from '../../constants/index.mock'; + +import { ImportListItemQuerySchema } from '.'; + +export const getImportListItemQuerySchemaMock = (): ImportListItemQuerySchema => ({ + deserializer: undefined, + list_id: LIST_ID, + serializer: undefined, + type: TYPE, + refresh: 'false', +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.test.ts new file mode 100644 index 0000000000000..26d1ba486468f --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.test.ts @@ -0,0 +1,88 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { ImportListItemQuerySchema, importListItemQuerySchema } from '.'; +import { getImportListItemQuerySchemaMock } from './index.mock'; + +describe('import_list_item_schema', () => { + test('it should validate a typical lists request', () => { + const payload = getImportListItemQuerySchemaMock(); + const decoded = importListItemQuerySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "list_id"', () => { + const payload = getImportListItemQuerySchemaMock(); + delete payload.list_id; + const decoded = importListItemQuerySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "type"', () => { + const payload = getImportListItemQuerySchemaMock(); + delete payload.type; + const decoded = importListItemQuerySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "type" and "list_id', () => { + const payload = getImportListItemQuerySchemaMock(); + delete payload.type; + delete payload.list_id; + const decoded = importListItemQuerySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "serializer"', () => { + const payload = getImportListItemQuerySchemaMock(); + delete payload.serializer; + const decoded = importListItemQuerySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "deserializer"', () => { + const payload = getImportListItemQuerySchemaMock(); + delete payload.deserializer; + const decoded = importListItemQuerySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: ImportListItemQuerySchema & { + extraKey?: string; + } = getImportListItemQuerySchemaMock(); + payload.extraKey = 'some new value'; + const decoded = importListItemQuerySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/index.ts new file mode 100644 index 0000000000000..19cd873825d2d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_query_schema/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 * as t from 'io-ts'; + +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { deserializer } from '../../common/deserializer'; +import { list_id } from '../../common/list_id'; +import { type } from '../../common/type'; +import { serializer } from '../../common/serializer'; +import { refreshWithWaitFor } from '../../common/refresh'; + +export const importListItemQuerySchema = t.exact( + t.partial({ deserializer, list_id, serializer, type, refresh: refreshWithWaitFor }) +); + +export type ImportListItemQuerySchema = RequiredKeepUndefined< + t.TypeOf<typeof importListItemQuerySchema> +>; +export type ImportListItemQuerySchemaEncoded = t.OutputOf<typeof importListItemQuerySchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..32fee251c0781 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_schema/index.mock.ts @@ -0,0 +1,21 @@ +/* + * 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 { ImportListItemSchema } from '.'; + +export const getImportListItemSchemaMock = (): ImportListItemSchema => ({ + file: {}, +}); + +/** + * This is useful for end to end tests, it will return a buffer given a string array + * of things to import. + * @param input Array of strings of things to import + */ +export const getImportListItemAsBuffer = (input: string[]): Buffer => { + return Buffer.from(input.join('\r\n')); +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_schema/index.test.ts new file mode 100644 index 0000000000000..0e572255b5741 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_schema/index.test.ts @@ -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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { ImportListItemSchema, importListItemSchema } from '.'; +import { getImportListItemSchemaMock } from './index.mock'; + +describe('import_list_item_schema', () => { + test('it should validate a typical lists request', () => { + const payload = getImportListItemSchemaMock(); + const decoded = importListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for a file', () => { + const payload = getImportListItemSchemaMock(); + // @ts-expect-error + delete payload.file; + const decoded = importListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "file"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: ImportListItemSchema & { + extraKey?: string; + } = getImportListItemSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = importListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_schema/index.ts new file mode 100644 index 0000000000000..4072cf029bae9 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/import_list_item_schema/index.ts @@ -0,0 +1,20 @@ +/* + * 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 * as t from 'io-ts'; + +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { file } from '../../common/file'; + +export const importListItemSchema = t.exact( + t.type({ + file, + }) +); + +export type ImportListItemSchema = RequiredKeepUndefined<t.TypeOf<typeof importListItemSchema>>; +export type ImportListItemSchemaEncoded = t.OutputOf<typeof importListItemSchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/index.ts new file mode 100644 index 0000000000000..a6a3099ddde8c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/index.ts @@ -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. + */ + +export * from './create_endpoint_list_item_schema'; +export * from './create_exception_list_item_schema'; +export * from './create_exception_list_schema'; +export * from './create_rule_exception_item_schema'; +export * from './create_list_item_schema'; +export * from './create_list_schema'; +export * from './delete_endpoint_list_item_schema'; +export * from './delete_exception_list_schema'; +export * from './delete_exception_list_item_schema'; +export * from './delete_list_item_schema'; +export * from './delete_list_schema'; +export * from './duplicate_exception_list_query_schema'; +export * from './export_exception_list_query_schema'; +export * from './export_list_item_query_schema'; +export * from './find_endpoint_list_item_schema'; +export * from './find_exception_list_schema'; +export * from './find_exception_list_item_schema'; +export * from './find_list_item_schema'; +export * from './find_list_schema'; +export * from './get_exception_filter_schema'; +export * from './import_list_item_query_schema'; +export * from './import_exception_list_schema'; +export * from './import_exception_item_schema'; +export * from './import_list_item_schema'; +export * from './patch_list_item_schema'; +export * from './patch_list_schema'; +export * from './read_endpoint_list_item_schema'; +export * from './read_exception_list_item_schema'; +export * from './read_exception_list_schema'; +export * from './read_list_item_schema'; +export * from './read_list_schema'; +export * from './summary_exception_list_schema'; +export * from './update_endpoint_list_item_schema'; +export * from './update_exception_list_item_schema'; +export * from './update_exception_list_schema'; +export * from './update_list_item_schema'; +export * from './update_list_schema'; + +// Internal routes +export * from './internal/create_exception_list_schema'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/internal/create_exception_list_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/internal/create_exception_list_schema/index.test.ts new file mode 100644 index 0000000000000..8ab58a7b0bdd4 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/internal/create_exception_list_schema/index.test.ts @@ -0,0 +1,68 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; + +import { ExceptionListTypeEnum } from '../../../common/exception_list'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { internalCreateExceptionListSchema } from '.'; +import { getCreateExceptionListSchemaMock } from '../../create_exception_list_schema/index.mock'; + +describe('create_exception_list_schema', () => { + test('it should accept artifact list_id', () => { + const payload = { + ...getCreateExceptionListSchemaMock(), + list_id: ExceptionListTypeEnum.ENDPOINT_BLOCKLISTS, + }; + const decoded = internalCreateExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + test('it should fail when invalid list_id', () => { + const payload = { + ...getCreateExceptionListSchemaMock(), + list_id: ExceptionListTypeEnum.DETECTION, + }; + const decoded = internalCreateExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "detection" supplied to "list_id"', + ]); + expect(message.schema).toEqual({}); + }); + test('it should accept artifact type', () => { + const payload = { + ...getCreateExceptionListSchemaMock(), + list_id: ExceptionListTypeEnum.ENDPOINT_BLOCKLISTS, + type: ExceptionListTypeEnum.ENDPOINT_BLOCKLISTS, + }; + const decoded = internalCreateExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + test('it should fail when invalid type', () => { + const payload = { + ...getCreateExceptionListSchemaMock(), + list_id: ExceptionListTypeEnum.ENDPOINT_BLOCKLISTS, + type: ExceptionListTypeEnum.DETECTION, + }; + const decoded = internalCreateExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "detection" supplied to "type"', + ]); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/internal/create_exception_list_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/internal/create_exception_list_schema/index.ts new file mode 100644 index 0000000000000..ff8f9670a4e03 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/internal/create_exception_list_schema/index.ts @@ -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 { ENDPOINT_ARTIFACT_LIST_IDS } from '@kbn/securitysolution-list-constants'; +import * as t from 'io-ts'; + +import { + createExceptionListSchema, + CreateExceptionListSchemaDecoded, +} from '../../create_exception_list_schema'; + +export const internalCreateExceptionListSchema = t.intersection([ + t.exact( + t.type({ + type: t.keyof({ + endpoint: null, + endpoint_events: null, + endpoint_host_isolation_exceptions: null, + endpoint_blocklists: null, + }), + }) + ), + t.exact( + t.partial({ + list_id: t.keyof( + ENDPOINT_ARTIFACT_LIST_IDS.reduce<Record<string, null>>((mapOfListIds, listId) => { + mapOfListIds[listId] = null; + + return mapOfListIds; + }, {}) + ), + }) + ), + createExceptionListSchema, +]); + +export type InternalCreateExceptionListSchema = t.OutputOf< + typeof internalCreateExceptionListSchema +>; + +// This type is used after a decode since some things are defaults after a decode. +export type InternalCreateExceptionListSchemaDecoded = CreateExceptionListSchemaDecoded; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..fd30cba204398 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_item_schema/index.mock.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 { LIST_ITEM_ID, META, VALUE } from '../../constants/index.mock'; + +import { PatchListItemSchema } from '.'; + +export const getPathListItemSchemaMock = (): PatchListItemSchema => ({ + id: LIST_ITEM_ID, + meta: META, + value: VALUE, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_item_schema/index.test.ts new file mode 100644 index 0000000000000..55050ea6eab86 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_item_schema/index.test.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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getPathListItemSchemaMock } from './index.mock'; +import { PatchListItemSchema, patchListItemSchema } from '.'; + +describe('patch_list_item_schema', () => { + test('it should validate a typical list item request', () => { + const payload = getPathListItemSchemaMock(); + const decoded = patchListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for "id"', () => { + const payload = getPathListItemSchemaMock(); + // @ts-expect-error + delete payload.id; + const decoded = patchListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "undefined" supplied to "id"']); + expect(message.schema).toEqual({}); + }); + + test('it should accept an undefined for "meta"', () => { + const payload = getPathListItemSchemaMock(); + delete payload.meta; + const decoded = patchListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "value"', () => { + const payload = getPathListItemSchemaMock(); + delete payload.value; + const decoded = patchListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "meta" and "value"', () => { + const payload = getPathListItemSchemaMock(); + delete payload.meta; + delete payload.value; + const decoded = patchListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: PatchListItemSchema & { extraKey?: string } = getPathListItemSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = patchListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_item_schema/index.ts new file mode 100644 index 0000000000000..caa0d62f003f1 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_item_schema/index.ts @@ -0,0 +1,29 @@ +/* + * 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 * as t from 'io-ts'; + +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { _version } from '../../common/underscore_version'; +import { id } from '../../common/id'; +import { meta } from '../../common/meta'; +import { value } from '../../common/value'; +import { refresh } from '../../common/refresh'; + +export const patchListItemSchema = t.intersection([ + t.exact( + t.type({ + id, + }) + ), + t.exact(t.partial({ _version, meta, value, refresh })), +]); + +export type PatchListItemSchema = t.OutputOf<typeof patchListItemSchema>; +export type PatchListItemSchemaDecoded = RequiredKeepUndefined< + t.TypeOf<typeof patchListItemSchema> +>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_schema/index.mock.ts new file mode 100644 index 0000000000000..2b71a46c46659 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_schema/index.mock.ts @@ -0,0 +1,17 @@ +/* + * 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 { DESCRIPTION, LIST_ITEM_ID, META, NAME } from '../../constants/index.mock'; + +import { PatchListSchema } from '.'; + +export const getPathListSchemaMock = (): PatchListSchema => ({ + description: DESCRIPTION, + id: LIST_ITEM_ID, + meta: META, + name: NAME, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_schema/index.test.ts new file mode 100644 index 0000000000000..be0dd3b2f6eaa --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_schema/index.test.ts @@ -0,0 +1,129 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getPathListSchemaMock } from './index.mock'; +import { PatchListSchema, patchListSchema } from '.'; + +describe('patch_list_schema', () => { + test('it should validate a typical list item request', () => { + const payload = getPathListSchemaMock(); + const decoded = patchListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for "id"', () => { + const payload = getPathListSchemaMock(); + // @ts-expect-error + delete payload.id; + const decoded = patchListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "undefined" supplied to "id"']); + expect(message.schema).toEqual({}); + }); + + test('it should accept an undefined for "meta"', () => { + const payload = getPathListSchemaMock(); + delete payload.meta; + const decoded = patchListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "name"', () => { + const payload = getPathListSchemaMock(); + delete payload.name; + const decoded = patchListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "description"', () => { + const payload = getPathListSchemaMock(); + delete payload.description; + const decoded = patchListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "description", "meta", "name', () => { + const payload = getPathListSchemaMock(); + delete payload.description; + delete payload.name; + delete payload.meta; + const decoded = patchListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "description", "meta"', () => { + const payload = getPathListSchemaMock(); + delete payload.description; + delete payload.meta; + const decoded = patchListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "description", "name"', () => { + const payload = getPathListSchemaMock(); + delete payload.description; + delete payload.name; + const decoded = patchListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "meta", "name"', () => { + const payload = getPathListSchemaMock(); + delete payload.meta; + delete payload.name; + const decoded = patchListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: PatchListSchema & { extraKey?: string } = getPathListSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = patchListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_schema/index.ts new file mode 100644 index 0000000000000..cb72d902f1896 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/patch_list_schema/index.ts @@ -0,0 +1,36 @@ +/* + * 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 * as t from 'io-ts'; +import { version } from '@kbn/securitysolution-io-ts-types'; + +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { id } from '../../common/id'; +import { _version } from '../../common/underscore_version'; +import { meta } from '../../common/meta'; +import { name } from '../../common/name'; +import { description } from '../../common/description'; + +export const patchListSchema = t.intersection([ + t.exact( + t.type({ + id, + }) + ), + t.exact( + t.partial({ + _version, // is undefined if not set during decode + description, // is undefined if not set during decode + meta, // is undefined if not set during decode + name, // is undefined if not set during decode + version, // is undefined if not set during decode + }) + ), +]); + +export type PatchListSchema = t.OutputOf<typeof patchListSchema>; +export type PatchListSchemaDecoded = RequiredKeepUndefined<t.TypeOf<typeof patchListSchema>>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_endpoint_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_endpoint_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..7b83368ad73e4 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_endpoint_list_item_schema/index.mock.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 { ID, ITEM_ID } from '../../constants/index.mock'; + +import { ReadEndpointListItemSchema } from '.'; + +export const getReadEndpointListItemSchemaMock = (): ReadEndpointListItemSchema => ({ + id: ID, + item_id: ITEM_ID, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_endpoint_list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_endpoint_list_item_schema/index.test.ts new file mode 100644 index 0000000000000..dc8a14b2ef101 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_endpoint_list_item_schema/index.test.ts @@ -0,0 +1,85 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getReadEndpointListItemSchemaMock } from './index.mock'; +import { ReadEndpointListItemSchema, readEndpointListItemSchema } from '.'; + +describe('read_endpoint_list_item_schema', () => { + test('it should validate a typical list request', () => { + const payload = getReadEndpointListItemSchemaMock(); + const decoded = readEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "id"', () => { + const payload = getReadEndpointListItemSchemaMock(); + delete payload.id; + const decoded = readEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "item_id"', () => { + const payload = getReadEndpointListItemSchemaMock(); + delete payload.item_id; + const decoded = readEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept "namespace_type" since endpoint list items do not need it', () => { + const payload: ReadEndpointListItemSchema & { + namespace_type: string; + } = { ...getReadEndpointListItemSchemaMock(), namespace_type: 'single' }; + // @ts-expect-error + delete payload.namespace_type; + const decoded = readEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getReadEndpointListItemSchemaMock()); + }); + + test('it should accept an undefined for "id", "item_id"', () => { + const payload = getReadEndpointListItemSchemaMock(); + delete payload.id; + delete payload.item_id; + const decoded = readEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: ReadEndpointListItemSchema & { + extraKey?: string; + } = getReadEndpointListItemSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = readEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_endpoint_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_endpoint_list_item_schema/index.ts new file mode 100644 index 0000000000000..6e32b1fe5186c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_endpoint_list_item_schema/index.ts @@ -0,0 +1,26 @@ +/* + * 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 * as t from 'io-ts'; + +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { id } from '../../common/id'; +import { item_id } from '../../common/item_id'; + +export const readEndpointListItemSchema = t.exact( + t.partial({ + id, + item_id, + }) +); + +export type ReadEndpointListItemSchema = t.OutputOf<typeof readEndpointListItemSchema>; + +// This type is used after a decode since some things are defaults after a decode. +export type ReadEndpointListItemSchemaDecoded = RequiredKeepUndefined< + t.TypeOf<typeof readEndpointListItemSchema> +>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..6ce6e68ec6e0a --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_item_schema/index.mock.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 { ID, ITEM_ID, NAMESPACE_TYPE } from '../../constants/index.mock'; + +import { ReadExceptionListItemSchema } from '.'; + +export const getReadExceptionListItemSchemaMock = (): ReadExceptionListItemSchema => ({ + id: ID, + item_id: ITEM_ID, + namespace_type: NAMESPACE_TYPE, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_item_schema/index.test.ts new file mode 100644 index 0000000000000..68f636ccb8705 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_item_schema/index.test.ts @@ -0,0 +1,126 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getReadExceptionListItemSchemaMock } from './index.mock'; +import { ReadExceptionListItemSchema, readExceptionListItemSchema } from '.'; + +describe('read_exception_list_item_schema', () => { + test('it should validate a typical exception list request', () => { + const payload = getReadExceptionListItemSchemaMock(); + const decoded = readExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "id"', () => { + const payload = getReadExceptionListItemSchemaMock(); + delete payload.id; + const decoded = readExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "item_id"', () => { + const payload = getReadExceptionListItemSchemaMock(); + delete payload.item_id; + const decoded = readExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "namespace_type" but default to "single"', () => { + const payload = getReadExceptionListItemSchemaMock(); + delete payload.namespace_type; + const decoded = readExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getReadExceptionListItemSchemaMock()); + }); + + test('it should accept an undefined for "id", "item_id", "namespace_type" but default "namespace_type" to "single"', () => { + const payload = getReadExceptionListItemSchemaMock(); + delete payload.id; + delete payload.namespace_type; + delete payload.item_id; + const output = getReadExceptionListItemSchemaMock(); + delete output.id; + delete output.item_id; + const decoded = readExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(output); + }); + + test('it should accept an undefined for "id", "item_id"', () => { + const payload = getReadExceptionListItemSchemaMock(); + delete payload.id; + delete payload.item_id; + const decoded = readExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "id", "namespace_type" but default "namespace_type" to "single"', () => { + const payload = getReadExceptionListItemSchemaMock(); + delete payload.id; + delete payload.namespace_type; + const output = getReadExceptionListItemSchemaMock(); + delete output.id; + const decoded = readExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(output); + }); + + test('it should accept an undefined for "item_id", "namespace_type" but default "namespace_type" to "single"', () => { + const payload = getReadExceptionListItemSchemaMock(); + delete payload.namespace_type; + delete payload.item_id; + const output = getReadExceptionListItemSchemaMock(); + delete output.item_id; + const decoded = readExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(output); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: ReadExceptionListItemSchema & { + extraKey?: string; + } = getReadExceptionListItemSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = readExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_item_schema/index.ts new file mode 100644 index 0000000000000..9111587af7e93 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_item_schema/index.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 * as t from 'io-ts'; + +import { NamespaceType } from '../../common/default_namespace'; +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { id } from '../../common/id'; +import { item_id } from '../../common/item_id'; +import { namespace_type } from '../../common/namespace_type'; + +export const readExceptionListItemSchema = t.exact( + t.partial({ + id, + item_id, + namespace_type, // defaults to 'single' if not set during decode + }) +); + +export type ReadExceptionListItemSchema = t.OutputOf<typeof readExceptionListItemSchema>; + +// This type is used after a decode since some things are defaults after a decode. +export type ReadExceptionListItemSchemaDecoded = Omit< + RequiredKeepUndefined<t.TypeOf<typeof readExceptionListItemSchema>>, + 'namespace_type' +> & { + namespace_type: NamespaceType; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_schema/index.mock.ts new file mode 100644 index 0000000000000..f122f1d20339e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_schema/index.mock.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 { ID, LIST_ID, NAMESPACE_TYPE } from '../../constants/index.mock'; + +import { ReadExceptionListSchema } from '.'; + +export const getReadExceptionListSchemaMock = (): ReadExceptionListSchema => ({ + id: ID, + list_id: LIST_ID, + namespace_type: NAMESPACE_TYPE, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_schema/index.test.ts new file mode 100644 index 0000000000000..89cd869bd17c1 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_schema/index.test.ts @@ -0,0 +1,126 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getReadExceptionListSchemaMock } from './index.mock'; +import { ReadExceptionListSchema, readExceptionListSchema } from '.'; + +describe('read_exception_list_schema', () => { + test('it should validate a typical exception list request', () => { + const payload = getReadExceptionListSchemaMock(); + const decoded = readExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "id"', () => { + const payload = getReadExceptionListSchemaMock(); + delete payload.id; + const decoded = readExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "list_id"', () => { + const payload = getReadExceptionListSchemaMock(); + delete payload.list_id; + const decoded = readExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "namespace_type" but default to "single"', () => { + const payload = getReadExceptionListSchemaMock(); + delete payload.namespace_type; + const decoded = readExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getReadExceptionListSchemaMock()); + }); + + test('it should accept an undefined for "id", "list_id", "namespace_type" but default "namespace_type" to "single"', () => { + const payload = getReadExceptionListSchemaMock(); + delete payload.id; + delete payload.namespace_type; + delete payload.list_id; + const output = getReadExceptionListSchemaMock(); + delete output.id; + delete output.list_id; + const decoded = readExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(output); + }); + + test('it should accept an undefined for "id", "list_id"', () => { + const payload = getReadExceptionListSchemaMock(); + delete payload.id; + delete payload.list_id; + const decoded = readExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "id", "namespace_type" but default "namespace_type" to "single"', () => { + const payload = getReadExceptionListSchemaMock(); + delete payload.id; + delete payload.namespace_type; + const output = getReadExceptionListSchemaMock(); + delete output.id; + const decoded = readExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(output); + }); + + test('it should accept an undefined for "list_id", "namespace_type" but default "namespace_type" to "single"', () => { + const payload = getReadExceptionListSchemaMock(); + delete payload.namespace_type; + delete payload.list_id; + const output = getReadExceptionListSchemaMock(); + delete output.list_id; + const decoded = readExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(output); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: ReadExceptionListSchema & { + extraKey?: string; + } = getReadExceptionListSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = readExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_schema/index.ts new file mode 100644 index 0000000000000..b4d9b7309fb5f --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_exception_list_schema/index.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 * as t from 'io-ts'; + +import { NamespaceType } from '../../common/default_namespace'; +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { id } from '../../common/id'; +import { list_id } from '../../common/list_id'; +import { namespace_type } from '../../common/namespace_type'; + +export const readExceptionListSchema = t.exact( + t.partial({ + id, + list_id, + namespace_type, // defaults to 'single' if not set during decode + }) +); + +export type ReadExceptionListSchema = t.OutputOf<typeof readExceptionListSchema>; + +// This type is used after a decode since some things are defaults after a decode. +export type ReadExceptionListSchemaDecoded = Omit< + RequiredKeepUndefined<t.TypeOf<typeof readExceptionListSchema>>, + 'namespace_type' +> & { + namespace_type: NamespaceType; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..a239111231404 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_item_schema/index.mock.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 { LIST_ID, LIST_ITEM_ID, VALUE } from '../../constants/index.mock'; + +import { ReadListItemSchema } from '.'; + +export const getReadListItemSchemaMock = (): ReadListItemSchema => ({ + id: LIST_ITEM_ID, + list_id: LIST_ID, + value: VALUE, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_item_schema/index.test.ts new file mode 100644 index 0000000000000..9370aa5e3d459 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_item_schema/index.test.ts @@ -0,0 +1,117 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getReadListItemSchemaMock } from './index.mock'; +import { ReadListItemSchema, readListItemSchema } from '.'; + +describe('read_list_item_schema', () => { + test('it should validate a typical list item request', () => { + const payload = getReadListItemSchemaMock(); + const decoded = readListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "id"', () => { + const payload = getReadListItemSchemaMock(); + delete payload.id; + const decoded = readListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "list_id"', () => { + const payload = getReadListItemSchemaMock(); + delete payload.list_id; + const decoded = readListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "value"', () => { + const payload = getReadListItemSchemaMock(); + delete payload.value; + const decoded = readListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "id", "list_id", "value"', () => { + const payload = getReadListItemSchemaMock(); + delete payload.id; + delete payload.value; + delete payload.list_id; + const decoded = readListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "id", "list_id"', () => { + const payload = getReadListItemSchemaMock(); + delete payload.id; + delete payload.list_id; + const decoded = readListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "id", "value"', () => { + const payload = getReadListItemSchemaMock(); + delete payload.id; + delete payload.value; + const decoded = readListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "list_id", "value"', () => { + const payload = getReadListItemSchemaMock(); + delete payload.value; + delete payload.list_id; + const decoded = readListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: ReadListItemSchema & { extraKey?: string } = getReadListItemSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = readListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_item_schema/index.ts new file mode 100644 index 0000000000000..571f37ff403e0 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_item_schema/index.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 * as t from 'io-ts'; + +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { id } from '../../common/id'; +import { list_id } from '../../common/list_id'; +import { value } from '../../common/value'; + +export const readListItemSchema = t.exact(t.partial({ id, list_id, value })); + +export type ReadListItemSchema = t.OutputOf<typeof readListItemSchema>; +export type ReadListItemSchemaDecoded = RequiredKeepUndefined<t.TypeOf<typeof readListItemSchema>>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_schema/index.mock.ts new file mode 100644 index 0000000000000..c82b343815540 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_schema/index.mock.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 { LIST_ID } from '../../constants/index.mock'; + +import { ReadListSchema } from '.'; + +export const getReadListSchemaMock = (): ReadListSchema => ({ + id: LIST_ID, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_schema/index.test.ts new file mode 100644 index 0000000000000..1953341d2be41 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_schema/index.test.ts @@ -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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getReadListSchemaMock } from './index.mock'; +import { ReadListSchema, readListSchema } from '.'; + +describe('read_list_schema', () => { + test('it should validate a typical list item request', () => { + const payload = getReadListSchemaMock(); + const decoded = readListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for "id"', () => { + const payload = getReadListSchemaMock(); + // @ts-expect-error + delete payload.id; + const decoded = readListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "undefined" supplied to "id"']); + expect(message.schema).toEqual({}); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: ReadListSchema & { extraKey?: string } = getReadListSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = readListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_schema/index.ts new file mode 100644 index 0000000000000..6382a7c0ad975 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/read_list_schema/index.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 * as t from 'io-ts'; + +import { id } from '../../common/id'; + +export const readListSchema = t.exact( + t.type({ + id, + }) +); + +export type ReadListSchema = t.OutputOf<typeof readListSchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/summary_exception_list_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/summary_exception_list_schema/index.mock.ts new file mode 100644 index 0000000000000..af6dc55b61da7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/summary_exception_list_schema/index.mock.ts @@ -0,0 +1,17 @@ +/* + * 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 { FILTER, ID, LIST_ID, NAMESPACE_TYPE } from '../../constants/index.mock'; + +import { SummaryExceptionListSchema } from '.'; + +export const getSummaryExceptionListSchemaMock = (): SummaryExceptionListSchema => ({ + filter: FILTER, + id: ID, + list_id: LIST_ID, + namespace_type: NAMESPACE_TYPE, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/summary_exception_list_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/summary_exception_list_schema/index.test.ts new file mode 100644 index 0000000000000..53a734ed034e7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/summary_exception_list_schema/index.test.ts @@ -0,0 +1,136 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getSummaryExceptionListSchemaMock } from './index.mock'; +import { SummaryExceptionListSchema, summaryExceptionListSchema } from '.'; + +describe('summary_exception_list_schema', () => { + test('it should validate a typical exception list request', () => { + const payload = getSummaryExceptionListSchemaMock(); + const decoded = summaryExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = foldLeftRight(checked); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "filter"', () => { + const payload = getSummaryExceptionListSchemaMock(); + delete payload.filter; + const decoded = summaryExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = foldLeftRight(checked); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "id"', () => { + const payload = getSummaryExceptionListSchemaMock(); + delete payload.id; + const decoded = summaryExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = foldLeftRight(checked); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "list_id"', () => { + const payload = getSummaryExceptionListSchemaMock(); + delete payload.list_id; + const decoded = summaryExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = foldLeftRight(checked); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "namespace_type" but default to "single"', () => { + const payload = getSummaryExceptionListSchemaMock(); + delete payload.namespace_type; + const decoded = summaryExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = foldLeftRight(checked); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(getSummaryExceptionListSchemaMock()); + }); + + test('it should accept an undefined for "id", "list_id", "namespace_type" but default "namespace_type" to "single"', () => { + const payload = getSummaryExceptionListSchemaMock(); + delete payload.id; + delete payload.namespace_type; + delete payload.list_id; + const output = getSummaryExceptionListSchemaMock(); + delete output.id; + delete output.list_id; + const decoded = summaryExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = foldLeftRight(checked); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(output); + }); + + test('it should accept an undefined for "id", "list_id"', () => { + const payload = getSummaryExceptionListSchemaMock(); + delete payload.id; + delete payload.list_id; + const decoded = summaryExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = foldLeftRight(checked); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "id", "namespace_type" but default "namespace_type" to "single"', () => { + const payload = getSummaryExceptionListSchemaMock(); + delete payload.id; + delete payload.namespace_type; + const output = getSummaryExceptionListSchemaMock(); + delete output.id; + const decoded = summaryExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = foldLeftRight(checked); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(output); + }); + + test('it should accept an undefined for "list_id", "namespace_type" but default "namespace_type" to "single"', () => { + const payload = getSummaryExceptionListSchemaMock(); + delete payload.namespace_type; + delete payload.list_id; + const output = getSummaryExceptionListSchemaMock(); + delete output.list_id; + const decoded = summaryExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = foldLeftRight(checked); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(output); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: SummaryExceptionListSchema & { + extraKey?: string; + } = getSummaryExceptionListSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = summaryExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = foldLeftRight(checked); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/summary_exception_list_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/summary_exception_list_schema/index.ts new file mode 100644 index 0000000000000..6be4f0c57b086 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/summary_exception_list_schema/index.ts @@ -0,0 +1,35 @@ +/* + * 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 * as t from 'io-ts'; + +import { NamespaceType } from '../../common/default_namespace'; +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { id } from '../../common/id'; +import { filter, Filter } from '../../common/filter'; +import { list_id } from '../../common/list_id'; +import { namespace_type } from '../../common/namespace_type'; + +export const summaryExceptionListSchema = t.exact( + t.partial({ + filter, + id, + list_id, + namespace_type, // defaults to 'single' if not set during decode + }) +); + +export type SummaryExceptionListSchema = t.OutputOf<typeof summaryExceptionListSchema>; + +// This type is used after a decode since some things are defaults after a decode. +export type SummaryExceptionListSchemaDecoded = Omit< + RequiredKeepUndefined<t.TypeOf<typeof summaryExceptionListSchema>>, + 'namespace_type' +> & { + namespace_type: NamespaceType; + filter: Filter; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..57244aac0426f --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.mock.ts @@ -0,0 +1,35 @@ +/* + * 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 { + COMMENTS, + DESCRIPTION, + ENTRIES, + ID, + ITEM_TYPE, + LIST_ITEM_ID, + META, + NAME, + OS_TYPES, + TAGS, +} from '../../constants/index.mock'; + +import { UpdateEndpointListItemSchema } from '.'; + +export const getUpdateEndpointListItemSchemaMock = (): UpdateEndpointListItemSchema => ({ + _version: undefined, + comments: COMMENTS, + description: DESCRIPTION, + entries: ENTRIES, + id: ID, + item_id: LIST_ITEM_ID, + meta: META, + name: NAME, + os_types: OS_TYPES, + tags: TAGS, + type: ITEM_TYPE, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.test.ts new file mode 100644 index 0000000000000..1def91ca1a8e2 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.test.ts @@ -0,0 +1,138 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { UpdateEndpointListItemSchema, updateEndpointListItemSchema } from '.'; +import { getUpdateEndpointListItemSchemaMock } from './index.mock'; + +describe('update_endpoint_list_item_schema', () => { + test('it should validate a typical list item request', () => { + const payload = getUpdateEndpointListItemSchemaMock(); + const decoded = updateEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not accept an undefined for "description"', () => { + const payload = getUpdateEndpointListItemSchemaMock(); + // @ts-expect-error + delete payload.description; + const decoded = updateEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "description"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not accept an undefined for "name"', () => { + const payload = getUpdateEndpointListItemSchemaMock(); + // @ts-expect-error + delete payload.name; + const decoded = updateEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "name"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not accept an undefined for "type"', () => { + const payload = getUpdateEndpointListItemSchemaMock(); + // @ts-expect-error + delete payload.type; + const decoded = updateEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "type"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not accept a value for "list_id"', () => { + const payload: UpdateEndpointListItemSchema & { + list_id?: string; + } = getUpdateEndpointListItemSchemaMock(); + payload.list_id = 'some new list_id'; + const decoded = updateEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "list_id"']); + expect(message.schema).toEqual({}); + }); + + test('it should accept an undefined for "meta" but strip it out', () => { + const payload = getUpdateEndpointListItemSchemaMock(); + const outputPayload = getUpdateEndpointListItemSchemaMock(); + delete payload.meta; + const decoded = updateEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + delete outputPayload.meta; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should accept an undefined for "comments" but return an array', () => { + const inputPayload = getUpdateEndpointListItemSchemaMock(); + const outputPayload = getUpdateEndpointListItemSchemaMock(); + delete inputPayload.comments; + outputPayload.comments = []; + const decoded = updateEndpointListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should NOT accept an undefined for "entries"', () => { + const inputPayload = getUpdateEndpointListItemSchemaMock(); + const outputPayload = getUpdateEndpointListItemSchemaMock(); + // @ts-expect-error + delete inputPayload.entries; + outputPayload.entries = []; + const decoded = updateEndpointListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "entries"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should accept an undefined for "tags" but return an array', () => { + const inputPayload = getUpdateEndpointListItemSchemaMock(); + const outputPayload = getUpdateEndpointListItemSchemaMock(); + delete inputPayload.tags; + outputPayload.tags = []; + const decoded = updateEndpointListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: UpdateEndpointListItemSchema & { + extraKey?: string; + } = getUpdateEndpointListItemSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = updateEndpointListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.ts new file mode 100644 index 0000000000000..e301137058afc --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_endpoint_list_item_schema/index.ts @@ -0,0 +1,57 @@ +/* + * 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 * as t from 'io-ts'; + +import { DefaultUpdateCommentsArray } from '../../common/default_update_comments_array'; +import { exceptionListItemType } from '../../common/exception_list_item_type'; +import { nonEmptyEntriesArray } from '../../common/non_empty_entries_array'; +import { OsTypeArray, osTypeArrayOrUndefined } from '../../common/os_type'; +import { description } from '../../common/description'; +import { name } from '../../common/name'; +import { _version } from '../../common/underscore_version'; +import { id } from '../../common/id'; +import { meta } from '../../common/meta'; +import { Tags, tags } from '../../common/tags'; +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { UpdateCommentsArray } from '../../common/update_comment'; +import { EntriesArray } from '../../common/entries'; + +export const updateEndpointListItemSchema = t.intersection([ + t.exact( + t.type({ + description, + entries: nonEmptyEntriesArray, + name, + type: exceptionListItemType, + }) + ), + t.exact( + t.partial({ + _version, // defaults to undefined if not set during decode + comments: DefaultUpdateCommentsArray, // defaults to empty array if not set during decode + id, // defaults to undefined if not set during decode + item_id: t.union([t.string, t.undefined]), + meta, // defaults to undefined if not set during decode + os_types: osTypeArrayOrUndefined, // defaults to empty array if not set during decode + tags, // defaults to empty array if not set during decode + }) + ), +]); + +export type UpdateEndpointListItemSchema = t.OutputOf<typeof updateEndpointListItemSchema>; + +// This type is used after a decode since some things are defaults after a decode. +export type UpdateEndpointListItemSchemaDecoded = Omit< + RequiredKeepUndefined<t.TypeOf<typeof updateEndpointListItemSchema>>, + 'tags' | 'entries' | 'comments' +> & { + comments: UpdateCommentsArray; + tags: Tags; + entries: EntriesArray; + os_types: OsTypeArray; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..c7560348179dc --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.mock.ts @@ -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 { + COMMENTS, + DESCRIPTION, + ENTRIES, + ID, + ITEM_ID, + ITEM_TYPE, + LIST_ITEM_ID, + META, + NAME, + NAMESPACE_TYPE, + OS_TYPES, + TAGS, +} from '../../constants/index.mock'; + +import { UpdateExceptionListItemSchema } from '.'; + +export const getUpdateExceptionListItemSchemaMock = (): UpdateExceptionListItemSchema => ({ + _version: undefined, + comments: COMMENTS, + description: DESCRIPTION, + entries: ENTRIES, + id: ID, + item_id: LIST_ITEM_ID, + meta: META, + name: NAME, + namespace_type: NAMESPACE_TYPE, + os_types: ['linux'], + tags: TAGS, + type: ITEM_TYPE, +}); + +/** + * Useful for end to end tests and other mechanisms which want to fill in the values + * after doing a get of the structure. + */ +export const getUpdateMinimalExceptionListItemSchemaMock = (): UpdateExceptionListItemSchema => ({ + description: DESCRIPTION, + entries: ENTRIES, + item_id: ITEM_ID, + name: NAME, + os_types: OS_TYPES, + type: ITEM_TYPE, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.test.ts new file mode 100644 index 0000000000000..0adbf1224d720 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.test.ts @@ -0,0 +1,160 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { UpdateExceptionListItemSchema, updateExceptionListItemSchema } from '.'; +import { getUpdateExceptionListItemSchemaMock } from './index.mock'; + +describe('update_exception_list_item_schema', () => { + test('it should validate a typical exception list item request', () => { + const payload = getUpdateExceptionListItemSchemaMock(); + const decoded = updateExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not accept an undefined for "description"', () => { + const payload = getUpdateExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.description; + const decoded = updateExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "description"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not accept an undefined for "name"', () => { + const payload = getUpdateExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.name; + const decoded = updateExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "name"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not accept an undefined for "type"', () => { + const payload = getUpdateExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.type; + const decoded = updateExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "type"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not accept a value for "list_id"', () => { + const payload: UpdateExceptionListItemSchema & { + list_id?: string; + } = getUpdateExceptionListItemSchemaMock(); + payload.list_id = 'some new list_id'; + const decoded = updateExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "list_id"']); + expect(message.schema).toEqual({}); + }); + + test('it should accept an undefined for "meta" but strip it out', () => { + const payload = getUpdateExceptionListItemSchemaMock(); + const outputPayload = getUpdateExceptionListItemSchemaMock(); + delete payload.meta; + const decoded = updateExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + delete outputPayload.meta; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should accept an undefined for "comments" but return an array', () => { + const inputPayload = getUpdateExceptionListItemSchemaMock(); + const outputPayload = getUpdateExceptionListItemSchemaMock(); + delete inputPayload.comments; + outputPayload.comments = []; + const decoded = updateExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should NOT accept an undefined for "entries"', () => { + const inputPayload = getUpdateExceptionListItemSchemaMock(); + const outputPayload = getUpdateExceptionListItemSchemaMock(); + // @ts-expect-error + delete inputPayload.entries; + outputPayload.entries = []; + const decoded = updateExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "entries"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should accept an undefined for "namespace_type" but return enum "single"', () => { + const inputPayload = getUpdateExceptionListItemSchemaMock(); + const outputPayload = getUpdateExceptionListItemSchemaMock(); + delete inputPayload.namespace_type; + outputPayload.namespace_type = 'single'; + const decoded = updateExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should accept an undefined for "tags" but return an array', () => { + const inputPayload = getUpdateExceptionListItemSchemaMock(); + const outputPayload = getUpdateExceptionListItemSchemaMock(); + delete inputPayload.tags; + outputPayload.tags = []; + const decoded = updateExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should accept an undefined for "item_id" and generate a correct body not counting the uuid', () => { + const inputPayload = getUpdateExceptionListItemSchemaMock(); + delete inputPayload.item_id; + const decoded = updateExceptionListItemSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as UpdateExceptionListItemSchema).item_id; + expect(message.schema).toEqual(inputPayload); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: UpdateExceptionListItemSchema & { + extraKey?: string; + } = getUpdateExceptionListItemSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = updateExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.ts new file mode 100644 index 0000000000000..910acbe2c942f --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_item_schema/index.ts @@ -0,0 +1,64 @@ +/* + * 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 * as t from 'io-ts'; +import { ExceptionListItemEntryArray } from '@kbn/securitysolution-exceptions-common/api'; +import { NamespaceType } from '../../common/default_namespace'; +import { DefaultUpdateCommentsArray } from '../../common/default_update_comments_array'; +import { exceptionListItemType } from '../../common/exception_list_item_type'; +import { nonEmptyEntriesArray } from '../../common/non_empty_entries_array'; +import { OsTypeArray, osTypeArrayOrUndefined } from '../../common/os_type'; +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { Tags, tags } from '../../common/tags'; +import { UpdateCommentsArray } from '../../common/update_comment'; +import { description } from '../../common/description'; +import { name } from '../../common/name'; +import { _version } from '../../common/underscore_version'; +import { id } from '../../common/id'; +import { item_id } from '../../common/item_id'; +import { meta } from '../../common/meta'; +import { namespace_type } from '../../common/namespace_type'; +import { ExpireTimeOrUndefined, expireTimeOrUndefined } from '../../common'; + +export const updateExceptionListItemSchema = t.intersection([ + t.exact( + t.type({ + description, + entries: nonEmptyEntriesArray, + name, + type: exceptionListItemType, + }) + ), + t.exact( + t.partial({ + _version, // defaults to undefined if not set during decode + comments: DefaultUpdateCommentsArray, // defaults to empty array if not set during decode + expire_time: expireTimeOrUndefined, + id, // defaults to undefined if not set during decode + item_id, + meta, // defaults to undefined if not set during decode + namespace_type, // defaults to 'single' if not set during decode + os_types: osTypeArrayOrUndefined, // defaults to empty array if not set during decode + tags, // defaults to empty array if not set during decode + }) + ), +]); + +export type UpdateExceptionListItemSchema = t.OutputOf<typeof updateExceptionListItemSchema>; + +// This type is used after a decode since some things are defaults after a decode. +export type UpdateExceptionListItemSchemaDecoded = Omit< + RequiredKeepUndefined<t.TypeOf<typeof updateExceptionListItemSchema>>, + 'tags' | 'entries' | 'namespace_type' | 'comments' | 'os_types' | 'expire_time' +> & { + comments: UpdateCommentsArray; + tags: Tags; + entries: ExceptionListItemEntryArray; + namespace_type: NamespaceType; + os_types: OsTypeArray; + expire_time: ExpireTimeOrUndefined; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_schema/index.mock.ts new file mode 100644 index 0000000000000..9aac2453a7beb --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_schema/index.mock.ts @@ -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 { DESCRIPTION, ID, LIST_ID, META, NAME, NAMESPACE_TYPE } from '../../constants/index.mock'; + +import { UpdateExceptionListSchema } from '.'; + +export const getUpdateExceptionListSchemaMock = (): UpdateExceptionListSchema => ({ + _version: undefined, + description: DESCRIPTION, + id: ID, + list_id: LIST_ID, + meta: META, + name: NAME, + namespace_type: NAMESPACE_TYPE, + os_types: [], + tags: ['malware'], + type: 'endpoint', +}); + +/** + * Useful for end to end tests and other mechanisms which want to fill in the values + * after doing a get of the structure. + */ +export const getUpdateMinimalExceptionListSchemaMock = (): UpdateExceptionListSchema => ({ + description: DESCRIPTION, + list_id: LIST_ID, + name: NAME, + type: 'endpoint', +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_schema/index.test.ts new file mode 100644 index 0000000000000..029751ac4d144 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_schema/index.test.ts @@ -0,0 +1,121 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { UpdateExceptionListSchema, updateExceptionListSchema } from '.'; +import { getUpdateExceptionListSchemaMock } from './index.mock'; + +describe('update_exception_list_schema', () => { + test('it should validate a typical exception list request', () => { + const payload = getUpdateExceptionListSchemaMock(); + const decoded = updateExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should not accept an undefined for "description"', () => { + const payload = getUpdateExceptionListSchemaMock(); + // @ts-expect-error + delete payload.description; + const decoded = updateExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "description"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not accept an undefined for "name"', () => { + const payload = getUpdateExceptionListSchemaMock(); + // @ts-expect-error + delete payload.name; + const decoded = updateExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "name"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not accept an undefined for "type"', () => { + const payload = getUpdateExceptionListSchemaMock(); + // @ts-expect-error + delete payload.type; + const decoded = updateExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "type"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should accept an undefined for "meta" but strip it out', () => { + const payload = getUpdateExceptionListSchemaMock(); + const outputPayload = getUpdateExceptionListSchemaMock(); + delete payload.meta; + const decoded = updateExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + delete outputPayload.meta; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should accept an undefined for "namespace_type" but return enum "single"', () => { + const inputPayload = getUpdateExceptionListSchemaMock(); + const outputPayload = getUpdateExceptionListSchemaMock(); + delete inputPayload.namespace_type; + outputPayload.namespace_type = 'single'; + const decoded = updateExceptionListSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should accept an undefined for "tags" but return an array', () => { + const inputPayload = getUpdateExceptionListSchemaMock(); + const outputPayload = getUpdateExceptionListSchemaMock(); + delete inputPayload.tags; + outputPayload.tags = []; + const decoded = updateExceptionListSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should accept an undefined for "list_id" and generate a correct body not counting the uuid', () => { + const inputPayload = getUpdateExceptionListSchemaMock(); + delete inputPayload.list_id; + const decoded = updateExceptionListSchema.decode(inputPayload); + const checked = exactCheck(inputPayload, decoded); + const message = pipe(checked, foldLeftRight); + delete (message.schema as UpdateExceptionListSchema).list_id; + expect(message.schema).toEqual(inputPayload); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: UpdateExceptionListSchema & { + extraKey?: string; + } = getUpdateExceptionListSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = updateExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_schema/index.ts new file mode 100644 index 0000000000000..be4006c3efa18 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_exception_list_schema/index.ts @@ -0,0 +1,56 @@ +/* + * 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 * as t from 'io-ts'; + +import { version } from '@kbn/securitysolution-io-ts-types'; +import { OsTypeArray, osTypeArrayOrUndefined } from '../../common/os_type'; +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { Tags, tags } from '../../common/tags'; +import { NamespaceType } from '../../common/default_namespace'; +import { description } from '../../common/description'; +import { name } from '../../common/name'; +import { _version } from '../../common/underscore_version'; +import { exceptionListType } from '../../common/exception_list'; +import { id } from '../../common/id'; +import { list_id } from '../../common/list_id'; +import { meta } from '../../common/meta'; +import { namespace_type } from '../../common/namespace_type'; + +export const updateExceptionListSchema = t.intersection([ + t.exact( + t.type({ + description, + name, + type: exceptionListType, + }) + ), + t.exact( + t.partial({ + _version, // defaults to undefined if not set during decode + id, // defaults to undefined if not set during decode + list_id, // defaults to undefined if not set during decode + meta, // defaults to undefined if not set during decode + namespace_type, // defaults to 'single' if not set during decode + os_types: osTypeArrayOrUndefined, // defaults to empty array if not set during decode + tags, // defaults to empty array if not set during decode + version, // defaults to undefined if not set during decode + }) + ), +]); + +export type UpdateExceptionListSchema = t.OutputOf<typeof updateExceptionListSchema>; + +// This type is used after a decode since the arrays turn into defaults of empty arrays. +export type UpdateExceptionListSchemaDecoded = Omit< + RequiredKeepUndefined<t.TypeOf<typeof updateExceptionListSchema>>, + 'tags | namespace_type' | 'os_types' +> & { + tags: Tags; + namespace_type: NamespaceType; + os_types: OsTypeArray; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..7d65f59aa8cda --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_item_schema/index.mock.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 { ID, LIST_ITEM_ID, META, VALUE } from '../../constants/index.mock'; + +import { UpdateListItemSchema } from '.'; + +export const getUpdateListItemSchemaMock = (): UpdateListItemSchema => ({ + id: ID, + meta: META, + value: VALUE, +}); + +/** + * Useful for end to end testing + */ +export const getUpdateMinimalListItemSchemaMock = (): UpdateListItemSchema => ({ + id: LIST_ITEM_ID, + value: VALUE, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_item_schema/index.test.ts new file mode 100644 index 0000000000000..ca6402455aabe --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_item_schema/index.test.ts @@ -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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { UpdateListItemSchema, updateListItemSchema } from '.'; +import { getUpdateListItemSchemaMock } from './index.mock'; + +describe('update_list_item_schema', () => { + test('it should validate a typical list item request', () => { + const payload = getUpdateListItemSchemaMock(); + const decoded = updateListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "meta" but strip it out', () => { + const payload = getUpdateListItemSchemaMock(); + const outputPayload = getUpdateListItemSchemaMock(); + delete payload.meta; + const decoded = updateListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + delete outputPayload.meta; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: UpdateListItemSchema & { + extraKey?: string; + } = getUpdateListItemSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = updateListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_item_schema/index.ts new file mode 100644 index 0000000000000..2df22b5c57b74 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_item_schema/index.ts @@ -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 * as t from 'io-ts'; + +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { _version } from '../../common/underscore_version'; +import { id } from '../../common/id'; +import { value } from '../../common/value'; +import { meta } from '../../common/meta'; + +export const updateListItemSchema = t.intersection([ + t.exact( + t.type({ + id, + value, + }) + ), + t.exact( + t.partial({ + _version, // defaults to undefined if not set during decode + meta, // defaults to undefined if not set during decode + }) + ), +]); + +export type UpdateListItemSchema = t.OutputOf<typeof updateListItemSchema>; +export type UpdateListItemSchemaDecoded = RequiredKeepUndefined< + t.TypeOf<typeof updateListItemSchema> +>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_schema/index.mock.ts new file mode 100644 index 0000000000000..99362d8ef8a7e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_schema/index.mock.ts @@ -0,0 +1,28 @@ +/* + * 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 { DESCRIPTION, LIST_ID, META, NAME, _VERSION } from '../../constants/index.mock'; + +import { UpdateListSchema } from '.'; + +export const getUpdateListSchemaMock = (): UpdateListSchema => ({ + _version: _VERSION, + description: DESCRIPTION, + id: LIST_ID, + meta: META, + name: NAME, +}); + +/** + * Useful for end to end tests and other mechanisms which want to fill in the values + * after doing a get of the structure. + */ +export const getUpdateMinimalListSchemaMock = (): UpdateListSchema => ({ + description: DESCRIPTION, + id: LIST_ID, + name: NAME, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_schema/index.test.ts new file mode 100644 index 0000000000000..c35861f66e910 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_schema/index.test.ts @@ -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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { UpdateListSchema, updateListSchema } from '.'; +import { getUpdateListSchemaMock } from './index.mock'; + +describe('update_list_schema', () => { + test('it should validate a typical list request', () => { + const payload = getUpdateListSchemaMock(); + const decoded = updateListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "meta" but strip it out', () => { + const payload = getUpdateListSchemaMock(); + const outputPayload = getUpdateListSchemaMock(); + delete payload.meta; + const decoded = updateListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + delete outputPayload.meta; + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(outputPayload); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: UpdateListSchema & { + extraKey?: string; + } = getUpdateListSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = updateListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_schema/index.ts new file mode 100644 index 0000000000000..c6182af2f23fa --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/request/update_list_schema/index.ts @@ -0,0 +1,36 @@ +/* + * 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 * as t from 'io-ts'; + +import { version } from '@kbn/securitysolution-io-ts-types'; +import { RequiredKeepUndefined } from '../../common/required_keep_undefined'; +import { id } from '../../common/id'; +import { name } from '../../common/name'; +import { description } from '../../common/description'; +import { _version } from '../../common/underscore_version'; +import { meta } from '../../common/meta'; + +export const updateListSchema = t.intersection([ + t.exact( + t.type({ + description, + id, + name, + }) + ), + t.exact( + t.partial({ + _version, // defaults to undefined if not set during decode + meta, // defaults to undefined if not set during decode + version, // defaults to undefined if not set during decode + }) + ), +]); + +export type UpdateListSchema = t.OutputOf<typeof updateListSchema>; +export type UpdateListSchemaDecoded = RequiredKeepUndefined<t.TypeOf<typeof updateListSchema>>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/acknowledge_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/acknowledge_schema/index.mock.ts new file mode 100644 index 0000000000000..2c4ac68f46132 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/acknowledge_schema/index.mock.ts @@ -0,0 +1,12 @@ +/* + * 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 { AcknowledgeSchema } from '.'; + +export const getAcknowledgeSchemaResponseMock = (): AcknowledgeSchema => ({ + acknowledged: true, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/acknowledge_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/acknowledge_schema/index.test.ts new file mode 100644 index 0000000000000..4fd4adf861bbd --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/acknowledge_schema/index.test.ts @@ -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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getAcknowledgeSchemaResponseMock } from './index.mock'; +import { AcknowledgeSchema, acknowledgeSchema } from '.'; + +describe('acknowledge_schema', () => { + test('it should validate a typical response', () => { + const payload = getAcknowledgeSchemaResponseMock(); + const decoded = acknowledgeSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + test('it should NOT accept an undefined for "ok"', () => { + const payload = getAcknowledgeSchemaResponseMock(); + // @ts-expect-error + delete payload.acknowledged; + const decoded = acknowledgeSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "acknowledged"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: AcknowledgeSchema & { extraKey?: string } = getAcknowledgeSchemaResponseMock(); + payload.extraKey = 'some new value'; + const decoded = acknowledgeSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/acknowledge_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/acknowledge_schema/index.ts new file mode 100644 index 0000000000000..97a0dc23682c4 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/acknowledge_schema/index.ts @@ -0,0 +1,12 @@ +/* + * 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 * as t from 'io-ts'; + +export const acknowledgeSchema = t.exact(t.type({ acknowledged: t.boolean })); + +export type AcknowledgeSchema = t.TypeOf<typeof acknowledgeSchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/create_endpoint_list_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/create_endpoint_list_schema/index.test.ts new file mode 100644 index 0000000000000..2ac63d9719e29 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/create_endpoint_list_schema/index.test.ts @@ -0,0 +1,73 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { CreateEndpointListSchema, createEndpointListSchema } from '.'; +import { getExceptionListSchemaMock } from '../exception_list_schema/index.mock'; + +describe('create_endpoint_list_schema', () => { + test('it should validate a typical endpoint list response', () => { + const payload = getExceptionListSchemaMock(); + const decoded = createEndpointListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an empty object when an endpoint list already exists', () => { + const payload: CreateEndpointListSchema = {}; + const decoded = createEndpointListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for "list_id"', () => { + const payload = getExceptionListSchemaMock(); + // @ts-expect-error + delete payload.list_id; + const decoded = createEndpointListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'invalid keys "_version,created_at,created_by,description,id,immutable,meta,{},name,namespace_type,os_types,["linux"],tags,["user added string for a tag","malware"],tie_breaker_id,type,updated_at,updated_by,version"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT allow missing fields', () => { + const payload = getExceptionListSchemaMock(); + // @ts-expect-error + delete payload.list_id; + const decoded = createEndpointListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors)).length).toEqual(1); + expect(message.schema).toEqual({}); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: CreateEndpointListSchema & { + extraKey?: string; + } = getExceptionListSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = createEndpointListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/create_endpoint_list_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/create_endpoint_list_schema/index.ts new file mode 100644 index 0000000000000..44f3629973a06 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/create_endpoint_list_schema/index.ts @@ -0,0 +1,13 @@ +/* + * 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 * as t from 'io-ts'; +import { exceptionListSchema } from '../exception_list_schema'; + +export const createEndpointListSchema = t.union([exceptionListSchema, t.exact(t.type({}))]); + +export type CreateEndpointListSchema = t.TypeOf<typeof createEndpointListSchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..fad9dc5990a85 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.mock.ts @@ -0,0 +1,70 @@ +/* + * 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 { + COMMENTS, + DATE_NOW, + DESCRIPTION, + ELASTIC_USER, + ENTRIES, + ITEM_ID, + ITEM_TYPE, + LIST_ID, + META, + NAME, + NAMESPACE_TYPE, + OS_TYPES, + TIE_BREAKER, + USER, +} from '../../constants/index.mock'; + +import { ExceptionListItemSchema } from '.'; + +export const getExceptionListItemSchemaMock = ( + overrides?: Partial<ExceptionListItemSchema> +): ExceptionListItemSchema => ({ + _version: undefined, + comments: COMMENTS, + created_at: DATE_NOW, + created_by: USER, + description: DESCRIPTION, + entries: ENTRIES, + expire_time: undefined, + id: '1', + item_id: 'endpoint_list_item', + list_id: 'endpoint_list_id', + meta: META, + name: NAME, + namespace_type: NAMESPACE_TYPE, + os_types: ['linux'], + tags: ['user added string for a tag', 'malware'], + tie_breaker_id: TIE_BREAKER, + type: ITEM_TYPE, + updated_at: DATE_NOW, + updated_by: USER, + ...(overrides || {}), +}); + +/** + * This is useful for end to end tests where we remove the auto generated parts for comparisons + * such as created_at, updated_at, and id. + */ +export const getExceptionListItemResponseMockWithoutAutoGeneratedValues = + (): Partial<ExceptionListItemSchema> => ({ + comments: [], + created_by: ELASTIC_USER, + description: DESCRIPTION, + entries: ENTRIES, + item_id: ITEM_ID, + list_id: LIST_ID, + name: NAME, + namespace_type: 'single', + os_types: OS_TYPES, + tags: [], + type: ITEM_TYPE, + updated_by: ELASTIC_USER, + }); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.test.ts new file mode 100644 index 0000000000000..1231764ae7f52 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.test.ts @@ -0,0 +1,240 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getExceptionListItemSchemaMock } from './index.mock'; +import { ExceptionListItemSchema, exceptionListItemSchema } from '.'; + +describe('exception_list_item_schema', () => { + test('it should validate a typical exception list item response', () => { + const payload = getExceptionListItemSchemaMock(); + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for "id"', () => { + const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.id; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "undefined" supplied to "id"']); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "list_id"', () => { + const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.list_id; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "list_id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "item_id"', () => { + const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.item_id; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "item_id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "comments"', () => { + const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.comments; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "comments"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "entries"', () => { + const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.entries; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "entries"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "name"', () => { + const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.name; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "name"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should accept an undefined for "namespace_type" and return "single" as a default value for "namespace_type"', () => { + const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.namespace_type; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect((message.schema as ExceptionListItemSchema).namespace_type).toEqual('single'); + }); + + test('it should NOT accept an undefined for "description"', () => { + const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.description; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "description"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should accept an undefined for "meta"', () => { + const payload = getExceptionListItemSchemaMock(); + delete payload.meta; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for "created_at"', () => { + const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.created_at; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "created_at"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "created_by"', () => { + const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.created_by; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "created_by"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "tie_breaker_id"', () => { + const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.tie_breaker_id; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "tie_breaker_id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "type"', () => { + const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.type; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "type"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "updated_at"', () => { + const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.updated_at; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "updated_at"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "updated_by"', () => { + const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.updated_by; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "updated_by"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: ExceptionListItemSchema & { + extraKey?: string; + } = getExceptionListItemSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = exceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.ts new file mode 100644 index 0000000000000..f3f3986c4ea37 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_item_schema/index.ts @@ -0,0 +1,54 @@ +/* + * 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 * as t from 'io-ts'; + +import { namespace_type } from '../../common/namespace_type'; +import { metaOrUndefined } from '../../common/meta'; +import { name } from '../../common/name'; +import { created_at } from '../../common/created_at'; +import { created_by } from '../../common/created_by'; +import { id } from '../../common/id'; +import { tie_breaker_id } from '../../common/tie_breaker_id'; +import { updated_at } from '../../common/updated_at'; +import { updated_by } from '../../common/updated_by'; +import { list_id } from '../../common/list_id'; +import { description } from '../../common/description'; +import { osTypeArray } from '../../common/os_type'; +import { tags } from '../../common/tags'; +import { _versionOrUndefined } from '../../common/underscore_version'; +import { commentsArray } from '../../common/comment'; +import { entriesArray } from '../../common/entries'; +import { item_id } from '../../common/item_id'; +import { exceptionListItemType } from '../../common/exception_list_item_type'; +import { expireTimeOrUndefined } from '../../common/expire_time'; + +export const exceptionListItemSchema = t.exact( + t.type({ + _version: _versionOrUndefined, + comments: commentsArray, + created_at, + created_by, + description, + entries: entriesArray, + expire_time: expireTimeOrUndefined, + id, + item_id, + list_id, + meta: metaOrUndefined, + name, + namespace_type, + os_types: osTypeArray, + tags, + tie_breaker_id, + type: exceptionListItemType, + updated_at, + updated_by, + }) +); + +export type ExceptionListItemSchema = t.TypeOf<typeof exceptionListItemSchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_schema/index.mock.ts new file mode 100644 index 0000000000000..07b47f91fead8 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_schema/index.mock.ts @@ -0,0 +1,77 @@ +/* + * 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 { + DATE_NOW, + DESCRIPTION, + ELASTIC_USER, + ENDPOINT_TYPE, + IMMUTABLE, + LIST_ID, + META, + NAME, + TIE_BREAKER, + USER, + VERSION, + _VERSION, +} from '../../constants/index.mock'; +import { + ENDPOINT_LIST_ID, + ENDPOINT_TRUSTED_APPS_LIST_DESCRIPTION, + ENDPOINT_TRUSTED_APPS_LIST_ID, + ENDPOINT_TRUSTED_APPS_LIST_NAME, +} from '@kbn/securitysolution-list-constants'; + +import { ExceptionListSchema } from '.'; + +export const getExceptionListSchemaMock = (): ExceptionListSchema => ({ + _version: _VERSION, + created_at: DATE_NOW, + created_by: USER, + description: DESCRIPTION, + id: '1', + immutable: IMMUTABLE, + list_id: ENDPOINT_LIST_ID, + meta: META, + name: 'Sample Endpoint Exception List', + namespace_type: 'agnostic', + os_types: ['linux'], + tags: ['user added string for a tag', 'malware'], + tie_breaker_id: TIE_BREAKER, + type: ENDPOINT_TYPE, + updated_at: DATE_NOW, + updated_by: 'user_name', + version: VERSION, +}); + +export const getTrustedAppsListSchemaMock = (): ExceptionListSchema => { + return { + ...getExceptionListSchemaMock(), + description: ENDPOINT_TRUSTED_APPS_LIST_DESCRIPTION, + list_id: ENDPOINT_TRUSTED_APPS_LIST_ID, + name: ENDPOINT_TRUSTED_APPS_LIST_NAME, + }; +}; + +/** + * This is useful for end to end tests where we remove the auto generated parts for comparisons + * such as created_at, updated_at, and id. + */ +export const getExceptionResponseMockWithoutAutoGeneratedValues = + (): Partial<ExceptionListSchema> => ({ + created_by: ELASTIC_USER, + description: DESCRIPTION, + immutable: IMMUTABLE, + list_id: LIST_ID, + name: NAME, + namespace_type: 'single', + os_types: [], + tags: [], + type: ENDPOINT_TYPE, + updated_by: ELASTIC_USER, + version: VERSION, + }); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_schema/index.test.ts new file mode 100644 index 0000000000000..b043cde4c3f0d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_schema/index.test.ts @@ -0,0 +1,198 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getExceptionListSchemaMock } from './index.mock'; +import { ExceptionListSchema, exceptionListSchema } from '.'; + +describe('exception_list_schema', () => { + test('it should validate a typical exception list response', () => { + const payload = getExceptionListSchemaMock(); + const decoded = exceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for "id"', () => { + const payload = getExceptionListSchemaMock(); + // @ts-expect-error + delete payload.id; + const decoded = exceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "undefined" supplied to "id"']); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "list_id"', () => { + const payload = getExceptionListSchemaMock(); + // @ts-expect-error + delete payload.list_id; + const decoded = exceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "list_id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "name"', () => { + const payload = getExceptionListSchemaMock(); + // @ts-expect-error + delete payload.name; + const decoded = exceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "name"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should accept an undefined for "namespace_type" and make "namespace_type" that of "single"', () => { + const payload = getExceptionListSchemaMock(); + // @ts-expect-error + delete payload.namespace_type; + const decoded = exceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect((message.schema as ExceptionListSchema).namespace_type).toEqual('single'); + }); + + test('it should NOT accept an undefined for "description"', () => { + const payload = getExceptionListSchemaMock(); + // @ts-expect-error + delete payload.description; + const decoded = exceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "description"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should accept an undefined for "meta"', () => { + const payload = getExceptionListSchemaMock(); + delete payload.meta; + const decoded = exceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for "created_at"', () => { + const payload = getExceptionListSchemaMock(); + // @ts-expect-error + delete payload.created_at; + const decoded = exceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "created_at"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "created_by"', () => { + const payload = getExceptionListSchemaMock(); + // @ts-expect-error + delete payload.created_by; + const decoded = exceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "created_by"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "tie_breaker_id"', () => { + const payload = getExceptionListSchemaMock(); + // @ts-expect-error + delete payload.tie_breaker_id; + const decoded = exceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "tie_breaker_id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "type"', () => { + const payload = getExceptionListSchemaMock(); + // @ts-expect-error + delete payload.type; + const decoded = exceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "type"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "updated_at"', () => { + const payload = getExceptionListSchemaMock(); + // @ts-expect-error + delete payload.updated_at; + const decoded = exceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "updated_at"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "updated_by"', () => { + const payload = getExceptionListSchemaMock(); + // @ts-expect-error + delete payload.updated_by; + const decoded = exceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "updated_by"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: ExceptionListSchema & { + extraKey?: string; + } = getExceptionListSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = exceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_schema/index.ts new file mode 100644 index 0000000000000..e04eadb707657 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_schema/index.ts @@ -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 * as t from 'io-ts'; + +import { version } from '@kbn/securitysolution-io-ts-types'; +import { _versionOrUndefined } from '../../common/underscore_version'; +import { namespace_type } from '../../common/namespace_type'; +import { metaOrUndefined } from '../../common/meta'; +import { name } from '../../common/name'; +import { created_at } from '../../common/created_at'; +import { created_by } from '../../common/created_by'; +import { id } from '../../common/id'; +import { tie_breaker_id } from '../../common/tie_breaker_id'; +import { immutable } from '../../common/immutable'; +import { updated_at } from '../../common/updated_at'; +import { updated_by } from '../../common/updated_by'; +import { list_id } from '../../common/list_id'; +import { description } from '../../common/description'; +import { osTypeArray } from '../../common/os_type'; +import { exceptionListType } from '../../common/exception_list'; +import { tags } from '../../common/tags'; + +export const exceptionListSchema = t.exact( + t.type({ + _version: _versionOrUndefined, + created_at, + created_by, + description, + id, + immutable, + list_id, + meta: metaOrUndefined, + name, + namespace_type, + os_types: osTypeArray, + tags, + tie_breaker_id, + type: exceptionListType, + updated_at, + updated_by, + version, + }) +); + +export type ExceptionListSchema = t.TypeOf<typeof exceptionListSchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_summary_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_summary_schema/index.mock.ts new file mode 100644 index 0000000000000..0acac1da648d5 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_summary_schema/index.mock.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 { ExceptionListSummarySchema } from '.'; + +export const getListSummaryResponseMock = (): ExceptionListSummarySchema => ({ + windows: 0, + linux: 1, + macos: 2, + total: 3, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_summary_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_summary_schema/index.test.ts new file mode 100644 index 0000000000000..b4b6de2e25d1e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_summary_schema/index.test.ts @@ -0,0 +1,93 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getListSummaryResponseMock } from './index.mock'; +import { ExceptionListSummarySchema, exceptionListSummarySchema } from '.'; + +describe('list_summary_schema', () => { + test('it should validate a typical list summary response', () => { + const payload = getListSummaryResponseMock(); + const decoded = exceptionListSummarySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for "windows"', () => { + const payload = getListSummaryResponseMock(); + // @ts-expect-error + delete payload.windows; + const decoded = exceptionListSummarySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "windows"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "linux"', () => { + const payload = getListSummaryResponseMock(); + // @ts-expect-error + delete payload.linux; + const decoded = exceptionListSummarySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "linux"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "macos"', () => { + const payload = getListSummaryResponseMock(); + // @ts-expect-error + delete payload.macos; + const decoded = exceptionListSummarySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "macos"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "total"', () => { + const payload = getListSummaryResponseMock(); + // @ts-expect-error + delete payload.total; + const decoded = exceptionListSummarySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "total"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: ExceptionListSummarySchema & { + extraKey?: string; + } = getListSummaryResponseMock(); + payload.extraKey = 'some new value'; + const decoded = exceptionListSummarySchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_summary_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_summary_schema/index.ts new file mode 100644 index 0000000000000..7414ca257fbd2 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/exception_list_summary_schema/index.ts @@ -0,0 +1,20 @@ +/* + * 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 { PositiveInteger } from '@kbn/securitysolution-io-ts-types'; +import * as t from 'io-ts'; + +export const exceptionListSummarySchema = t.exact( + t.type({ + windows: PositiveInteger, + linux: PositiveInteger, + macos: PositiveInteger, + total: PositiveInteger, + }) +); + +export type ExceptionListSummarySchema = t.TypeOf<typeof exceptionListSummarySchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_all_list_items_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_all_list_items_schema/index.mock.ts new file mode 100644 index 0000000000000..75330f4937432 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_all_list_items_schema/index.mock.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 { FoundAllListItemsSchema } from '.'; +import { getListItemResponseMock } from '../list_item_schema/index.mock'; + +export const getFoundAllListItemsSchemaMock = (): FoundAllListItemsSchema => ({ + data: [getListItemResponseMock()], + total: 1, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_all_list_items_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_all_list_items_schema/index.ts new file mode 100644 index 0000000000000..c5812499b3e77 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_all_list_items_schema/index.ts @@ -0,0 +1,20 @@ +/* + * 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 * as t from 'io-ts'; + +import { listItemSchema } from '../list_item_schema'; +import { total } from '../../common/total'; + +export const foundAllListItemsSchema = t.exact( + t.type({ + data: t.array(listItemSchema), + total, + }) +); + +export type FoundAllListItemsSchema = t.TypeOf<typeof foundAllListItemsSchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..6f8592320895d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.mock.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 { FoundExceptionListItemSchema } from '.'; +import { getExceptionListItemSchemaMock } from '../exception_list_item_schema/index.mock'; + +export const getFoundExceptionListItemSchemaMock = (): FoundExceptionListItemSchema => ({ + data: [getExceptionListItemSchemaMock()], + page: 1, + per_page: 1, + total: 1, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.test.ts new file mode 100644 index 0000000000000..33d26ca32a5bc --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.test.ts @@ -0,0 +1,152 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getFoundExceptionListItemSchemaMock } from './index.mock'; +import { FoundExceptionListItemSchema, foundExceptionListItemSchema } from '.'; +import { ExceptionListItemSchema } from '../exception_list_item_schema'; +import { getExceptionListItemSchemaMock } from '../exception_list_item_schema/index.mock'; + +describe('found_exception_list_item_schema', () => { + test('it should validate a typical exception list response', () => { + const payload = getFoundExceptionListItemSchemaMock(); + const decoded = foundExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept a malformed exception list item within "data"', () => { + const item: Omit<ExceptionListItemSchema, 'entries'> & { + entries?: string; + } = { ...getExceptionListItemSchemaMock(), entries: 'I should be an array' }; + const payload: Omit<FoundExceptionListItemSchema, 'data'> & { + data?: Array< + Omit<ExceptionListItemSchema, 'entries'> & { + entries?: string; + } + >; + } = { ...getFoundExceptionListItemSchemaMock(), data: [item] }; + const decoded = foundExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "I should be an array" supplied to "data,entries"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept a string for "page"', () => { + const payload: Omit<FoundExceptionListItemSchema, 'page'> & { + page?: string; + } = { ...getFoundExceptionListItemSchemaMock(), page: '1' }; + const decoded = foundExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "1" supplied to "page"']); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept a string for "per_page"', () => { + const payload: Omit<FoundExceptionListItemSchema, 'per_page'> & { + per_page?: string; + } = { ...getFoundExceptionListItemSchemaMock(), per_page: '20' }; + const decoded = foundExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "20" supplied to "per_page"']); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept a string for "total"', () => { + const payload: Omit<FoundExceptionListItemSchema, 'total'> & { + total?: string; + } = { ...getFoundExceptionListItemSchemaMock(), total: '1' }; + const decoded = foundExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "1" supplied to "total"']); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "page"', () => { + const payload = getFoundExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.page; + const decoded = foundExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "page"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "per_page"', () => { + const payload = getFoundExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.per_page; + const decoded = foundExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "per_page"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "total"', () => { + const payload = getFoundExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.total; + const decoded = foundExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "total"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "data"', () => { + const payload = getFoundExceptionListItemSchemaMock(); + // @ts-expect-error + delete payload.data; + const decoded = foundExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "data"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: FoundExceptionListItemSchema & { + extraKey?: string; + } = getFoundExceptionListItemSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = foundExceptionListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.ts new file mode 100644 index 0000000000000..50f57bf424593 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_item_schema/index.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 * as t from 'io-ts'; + +import { page } from '../../common/page'; +import { per_page } from '../../common/per_page'; +import { pitId } from '../../common/pit'; +import { total } from '../../common/total'; +import { exceptionListItemSchema } from '../exception_list_item_schema'; + +export const foundExceptionListItemSchema = t.intersection([ + t.exact( + t.type({ + data: t.array(exceptionListItemSchema), + page, + per_page, + total, + }) + ), + t.exact( + t.partial({ + pit: pitId, + }) + ), +]); + +export type FoundExceptionListItemSchema = t.TypeOf<typeof foundExceptionListItemSchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_schema/index.mock.ts new file mode 100644 index 0000000000000..8a6d9fe2d2a79 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_schema/index.mock.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 { FoundExceptionListSchema } from '.'; +import { getExceptionListSchemaMock } from '../exception_list_schema/index.mock'; + +export const getFoundExceptionListSchemaMock = (): FoundExceptionListSchema => ({ + data: [getExceptionListSchemaMock()], + page: 1, + per_page: 1, + total: 1, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_schema/index.test.ts new file mode 100644 index 0000000000000..18d96785ad2eb --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_schema/index.test.ts @@ -0,0 +1,152 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getFoundExceptionListSchemaMock } from './index.mock'; +import { FoundExceptionListSchema, foundExceptionListSchema } from '.'; +import { getExceptionListSchemaMock } from '../exception_list_schema/index.mock'; +import { ExceptionListSchema } from '../exception_list_schema'; + +describe('exception_list_schema', () => { + test('it should validate a typical exception list response', () => { + const payload = getFoundExceptionListSchemaMock(); + const decoded = foundExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept a malformed exception list item within "data"', () => { + const item: Omit<ExceptionListSchema, 'entries'> & { + entries?: string[]; + } = { ...getExceptionListSchemaMock(), entries: ['I should not be here'] }; + const payload: Omit<FoundExceptionListSchema, 'data'> & { + data?: Array< + Omit<ExceptionListSchema, 'entries'> & { + entries?: string[]; + } + >; + } = { ...getFoundExceptionListSchemaMock(), data: [item] }; + const decoded = foundExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'invalid keys "entries,["I should not be here"]"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept a string for "page"', () => { + const payload: Omit<FoundExceptionListSchema, 'page'> & { + page?: string; + } = { ...getFoundExceptionListSchemaMock(), page: '1' }; + const decoded = foundExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "1" supplied to "page"']); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept a string for "per_page"', () => { + const payload: Omit<FoundExceptionListSchema, 'per_page'> & { + per_page?: string; + } = { ...getFoundExceptionListSchemaMock(), per_page: '20' }; + const decoded = foundExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "20" supplied to "per_page"']); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept a string for "total"', () => { + const payload: Omit<FoundExceptionListSchema, 'total'> & { + total?: string; + } = { ...getFoundExceptionListSchemaMock(), total: '1' }; + const decoded = foundExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "1" supplied to "total"']); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "page"', () => { + const payload = getFoundExceptionListSchemaMock(); + // @ts-expect-error + delete payload.page; + const decoded = foundExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "page"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "per_page"', () => { + const payload = getFoundExceptionListSchemaMock(); + // @ts-expect-error + delete payload.per_page; + const decoded = foundExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "per_page"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "total"', () => { + const payload = getFoundExceptionListSchemaMock(); + // @ts-expect-error + delete payload.total; + const decoded = foundExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "total"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "data"', () => { + const payload = getFoundExceptionListSchemaMock(); + // @ts-expect-error + delete payload.data; + const decoded = foundExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "data"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: FoundExceptionListSchema & { + extraKey?: string; + } = getFoundExceptionListSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = foundExceptionListSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_schema/index.ts new file mode 100644 index 0000000000000..cb7867db7f295 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_exception_list_schema/index.ts @@ -0,0 +1,29 @@ +/* + * 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 * as t from 'io-ts'; + +import { page } from '../../common/page'; +import { per_page } from '../../common/per_page'; +import { pitId } from '../../common/pit'; +import { total } from '../../common/total'; + +import { exceptionListSchema } from '../exception_list_schema'; + +export const foundExceptionListSchema = t.intersection([ + t.exact( + t.type({ + data: t.array(exceptionListSchema), + page, + per_page, + total, + }) + ), + t.exact(t.partial({ pit: pitId })), +]); + +export type FoundExceptionListSchema = t.TypeOf<typeof foundExceptionListSchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..bc6c6b63dbea5 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_item_schema/index.mock.ts @@ -0,0 +1,17 @@ +/* + * 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 { FoundListItemSchema } from '.'; +import { getListItemResponseMock } from '../list_item_schema/index.mock'; + +export const getFoundListItemSchemaMock = (): FoundListItemSchema => ({ + cursor: 'WzI1LFsiNmE3NmI2OWQtODBkZi00YWIyLThjM2UtODVmNDY2YjA2YTBlIl1d', + data: [getListItemResponseMock()], + page: 1, + per_page: 25, + total: 1, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_item_schema/index.ts new file mode 100644 index 0000000000000..86801ed60bca9 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_item_schema/index.ts @@ -0,0 +1,26 @@ +/* + * 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 * as t from 'io-ts'; + +import { listItemSchema } from '../list_item_schema'; +import { cursor } from '../../common/cursor'; +import { page } from '../../common/page'; +import { per_page } from '../../common/per_page'; +import { total } from '../../common/total'; + +export const foundListItemSchema = t.exact( + t.type({ + cursor, + data: t.array(listItemSchema), + page, + per_page, + total, + }) +); + +export type FoundListItemSchema = t.TypeOf<typeof foundListItemSchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_schema/index.mock.ts new file mode 100644 index 0000000000000..07cbb1d03000f --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_schema/index.mock.ts @@ -0,0 +1,17 @@ +/* + * 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 { FoundListSchema } from '.'; +import { getListResponseMock } from '../list_schema/index.mock'; + +export const getFoundListSchemaMock = (): FoundListSchema => ({ + cursor: '123', + data: [getListResponseMock()], + page: 1, + per_page: 1, + total: 1, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_schema/index.ts new file mode 100644 index 0000000000000..16922174e7496 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_list_schema/index.ts @@ -0,0 +1,26 @@ +/* + * 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 * as t from 'io-ts'; + +import { listSchema } from '../list_schema'; +import { cursor } from '../../common/cursor'; +import { page } from '../../common/page'; +import { per_page } from '../../common/per_page'; +import { total } from '../../common/total'; + +export const foundListSchema = t.exact( + t.type({ + cursor, + data: t.array(listSchema), + page, + per_page, + total, + }) +); + +export type FoundListSchema = t.TypeOf<typeof foundListSchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_lists_by_size_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_lists_by_size_schema/index.mock.ts new file mode 100644 index 0000000000000..8d1a421acef2e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_lists_by_size_schema/index.mock.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 { FoundListsBySizeSchema } from '.'; +import { getListResponseMock } from '../list_schema/index.mock'; + +export const getFoundListsBySizeSchemaMock = (): FoundListsBySizeSchema => ({ + smallLists: [getListResponseMock()], + largeLists: [getListResponseMock()], +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_lists_by_size_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_lists_by_size_schema/index.ts new file mode 100644 index 0000000000000..0271416b5f3cf --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/found_lists_by_size_schema/index.ts @@ -0,0 +1,19 @@ +/* + * 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 * as t from 'io-ts'; + +import { listSchema } from '../list_schema'; + +export const foundListsBySizeSchema = t.exact( + t.type({ + largeLists: t.array(listSchema), + smallLists: t.array(listSchema), + }) +); + +export type FoundListsBySizeSchema = t.TypeOf<typeof foundListsBySizeSchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/import_exceptions_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/import_exceptions_schema/index.mock.ts new file mode 100644 index 0000000000000..9e8293b382cc5 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/import_exceptions_schema/index.mock.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 { ImportExceptionsResponseSchema } from '.'; + +export const getImportExceptionsResponseSchemaMock = ( + success = 0, + lists = 0, + items = 0 +): ImportExceptionsResponseSchema => ({ + errors: [], + success: true, + success_count: success, + success_exception_lists: true, + success_count_exception_lists: lists, + success_exception_list_items: true, + success_count_exception_list_items: items, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/import_exceptions_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/import_exceptions_schema/index.test.ts new file mode 100644 index 0000000000000..d5d481fe87bed --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/import_exceptions_schema/index.test.ts @@ -0,0 +1,128 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { importExceptionsResponseSchema, ImportExceptionsResponseSchema } from '.'; +import { getImportExceptionsResponseSchemaMock } from './index.mock'; + +describe('importExceptionsResponseSchema', () => { + test('it should validate a typical exceptions import response', () => { + const payload = getImportExceptionsResponseSchemaMock(); + const decoded = importExceptionsResponseSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for "errors"', () => { + const payload: Partial<ReturnType<typeof getImportExceptionsResponseSchemaMock>> = + getImportExceptionsResponseSchemaMock(); + delete payload.errors; + const decoded = importExceptionsResponseSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "errors"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "success"', () => { + const payload: Partial<ReturnType<typeof getImportExceptionsResponseSchemaMock>> = + getImportExceptionsResponseSchemaMock(); + delete payload.success; + const decoded = importExceptionsResponseSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "success"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "success_count"', () => { + const payload: Partial<ReturnType<typeof getImportExceptionsResponseSchemaMock>> = + getImportExceptionsResponseSchemaMock(); + delete payload.success_count; + const decoded = importExceptionsResponseSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "success_count"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "success_exception_lists"', () => { + const payload: Partial<ReturnType<typeof getImportExceptionsResponseSchemaMock>> = + getImportExceptionsResponseSchemaMock(); + delete payload.success_exception_lists; + const decoded = importExceptionsResponseSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "success_exception_lists"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "success_count_exception_lists"', () => { + const payload: Partial<ReturnType<typeof getImportExceptionsResponseSchemaMock>> = + getImportExceptionsResponseSchemaMock(); + delete payload.success_count_exception_lists; + const decoded = importExceptionsResponseSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "success_count_exception_lists"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "success_exception_list_items"', () => { + const payload: Partial<ReturnType<typeof getImportExceptionsResponseSchemaMock>> = + getImportExceptionsResponseSchemaMock(); + delete payload.success_exception_list_items; + const decoded = importExceptionsResponseSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "success_exception_list_items"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "success_count_exception_list_items"', () => { + const payload: Partial<ReturnType<typeof getImportExceptionsResponseSchemaMock>> = + getImportExceptionsResponseSchemaMock(); + delete payload.success_count_exception_list_items; + const decoded = importExceptionsResponseSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "success_count_exception_list_items"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: ImportExceptionsResponseSchema & { + extraKey?: string; + } = getImportExceptionsResponseSchemaMock(); + payload.extraKey = 'some new value'; + const decoded = importExceptionsResponseSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/import_exceptions_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/import_exceptions_schema/index.ts new file mode 100644 index 0000000000000..4a172d2ec10a7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/import_exceptions_schema/index.ts @@ -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 * as t from 'io-ts'; + +import { PositiveInteger } from '@kbn/securitysolution-io-ts-types'; + +import { id } from '../../common/id'; +import { list_id } from '../../common/list_id'; +import { item_id } from '../../common/item_id'; + +export const bulkErrorErrorSchema = t.exact( + t.type({ + status_code: t.number, + message: t.string, + }) +); + +export const bulkErrorSchema = t.intersection([ + t.exact( + t.type({ + error: bulkErrorErrorSchema, + }) + ), + t.partial({ + id, + list_id, + item_id, + }), +]); + +export type BulkErrorSchema = t.TypeOf<typeof bulkErrorSchema>; + +export const importExceptionsResponseSchema = t.exact( + t.type({ + errors: t.array(bulkErrorSchema), + success: t.boolean, + success_count: PositiveInteger, + success_exception_lists: t.boolean, + success_count_exception_lists: PositiveInteger, + success_exception_list_items: t.boolean, + success_count_exception_list_items: PositiveInteger, + }) +); + +export type ImportExceptionsResponseSchema = t.TypeOf<typeof importExceptionsResponseSchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/index.ts new file mode 100644 index 0000000000000..04b00f43c7029 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/index.ts @@ -0,0 +1,23 @@ +/* + * 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. + */ + +export * from './acknowledge_schema'; +export * from './create_endpoint_list_schema'; +export * from './exception_list_schema'; +export * from './exception_list_item_schema'; +export * from './found_exception_list_item_schema'; +export * from './found_exception_list_schema'; +export * from './found_all_list_items_schema'; +export * from './found_lists_by_size_schema'; +export * from './found_list_item_schema'; +export * from './found_list_schema'; +export * from './import_exceptions_schema'; +export * from './list_item_schema'; +export * from './list_schema'; +export * from './exception_list_summary_schema'; +export * from './list_item_index_exist_schema'; +export * from './search_list_item_schema'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_index_exist_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_index_exist_schema/index.mock.ts new file mode 100644 index 0000000000000..b3416ab76852e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_index_exist_schema/index.mock.ts @@ -0,0 +1,13 @@ +/* + * 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 { ListItemIndexExistSchema } from '.'; + +export const getListItemIndexExistSchemaResponseMock = (): ListItemIndexExistSchema => ({ + list_index: true, + list_item_index: true, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_index_exist_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_index_exist_schema/index.test.ts new file mode 100644 index 0000000000000..0c8812795935e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_index_exist_schema/index.test.ts @@ -0,0 +1,65 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getListItemIndexExistSchemaResponseMock } from './index.mock'; +import { ListItemIndexExistSchema, listItemIndexExistSchema } from '.'; + +describe('list_item_index_exist_schema', () => { + test('it should validate a typical list item request', () => { + const payload = getListItemIndexExistSchemaResponseMock(); + const decoded = listItemIndexExistSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for "list_index"', () => { + const payload = getListItemIndexExistSchemaResponseMock(); + // @ts-expect-error + delete payload.list_index; + const decoded = listItemIndexExistSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "list_index"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "list_item_index"', () => { + const payload = getListItemIndexExistSchemaResponseMock(); + // @ts-expect-error + delete payload.list_item_index; + const decoded = listItemIndexExistSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "list_item_index"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: ListItemIndexExistSchema & { + extraKey?: string; + } = getListItemIndexExistSchemaResponseMock(); + payload.extraKey = 'some new value'; + const decoded = listItemIndexExistSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_index_exist_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_index_exist_schema/index.ts new file mode 100644 index 0000000000000..fb1070f72daea --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_index_exist_schema/index.ts @@ -0,0 +1,17 @@ +/* + * 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 * as t from 'io-ts'; + +export const listItemIndexExistSchema = t.exact( + t.type({ + list_index: t.boolean, + list_item_index: t.boolean, + }) +); + +export type ListItemIndexExistSchema = t.TypeOf<typeof listItemIndexExistSchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..10283965276d2 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.mock.ts @@ -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 { ListItemSchema } from '.'; +import { + DATE_NOW, + ELASTIC_USER, + LIST_ID, + LIST_ITEM_ID, + META, + TIE_BREAKER, + TYPE, + USER, + VALUE, +} from '../../constants/index.mock'; + +export const getListItemResponseMock = (): ListItemSchema => ({ + _version: undefined, + '@timestamp': DATE_NOW, + created_at: DATE_NOW, + created_by: USER, + deserializer: undefined, + id: LIST_ITEM_ID, + list_id: LIST_ID, + meta: META, + serializer: undefined, + tie_breaker_id: TIE_BREAKER, + type: TYPE, + updated_at: DATE_NOW, + updated_by: USER, + value: VALUE, +}); + +/** + * This is useful for end to end tests where we remove the auto generated parts for comparisons + * such as created_at, updated_at, and id. + */ +export const getListItemResponseMockWithoutAutoGeneratedValues = (): Partial<ListItemSchema> => ({ + created_by: ELASTIC_USER, + list_id: LIST_ID, + type: TYPE, + updated_by: ELASTIC_USER, + value: VALUE, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.test.ts new file mode 100644 index 0000000000000..f855448ff26ef --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.test.ts @@ -0,0 +1,192 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getListItemResponseMock } from './index.mock'; +import { ListItemSchema, listItemSchema } from '.'; + +describe('list_item_schema', () => { + test('it should validate a typical list item response', () => { + const payload = getListItemResponseMock(); + const decoded = listItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for "id"', () => { + const payload = getListItemResponseMock(); + // @ts-expect-error + delete payload.id; + const decoded = listItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "undefined" supplied to "id"']); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "list_id"', () => { + const payload = getListItemResponseMock(); + // @ts-expect-error + delete payload.list_id; + const decoded = listItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "list_id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should accept an undefined for "meta"', () => { + const payload = getListItemResponseMock(); + delete payload.meta; + const decoded = listItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "serializer"', () => { + const payload = getListItemResponseMock(); + delete payload.serializer; + const decoded = listItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "deserializer"', () => { + const payload = getListItemResponseMock(); + delete payload.deserializer; + const decoded = listItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for "created_at"', () => { + const payload = getListItemResponseMock(); + // @ts-expect-error + delete payload.created_at; + const decoded = listItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "created_at"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "created_by"', () => { + const payload = getListItemResponseMock(); + // @ts-expect-error + delete payload.created_by; + const decoded = listItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "created_by"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "tie_breaker_id"', () => { + const payload = getListItemResponseMock(); + // @ts-expect-error + delete payload.tie_breaker_id; + const decoded = listItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "tie_breaker_id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "type"', () => { + const payload = getListItemResponseMock(); + // @ts-expect-error + delete payload.type; + const decoded = listItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "type"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "updated_at"', () => { + const payload = getListItemResponseMock(); + // @ts-expect-error + delete payload.updated_at; + const decoded = listItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "updated_at"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "updated_by"', () => { + const payload = getListItemResponseMock(); + // @ts-expect-error + delete payload.updated_by; + const decoded = listItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "updated_by"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "value"', () => { + const payload = getListItemResponseMock(); + // @ts-expect-error + delete payload.value; + const decoded = listItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "value"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: ListItemSchema & { extraKey?: string } = getListItemResponseMock(); + payload.extraKey = 'some new value'; + const decoded = listItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.ts new file mode 100644 index 0000000000000..0e7af6ab27267 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_item_schema/index.ts @@ -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 * as t from 'io-ts'; + +import { _versionOrUndefined } from '../../common/underscore_version'; +import { deserializerOrUndefined } from '../../common/deserializer'; +import { metaOrUndefined } from '../../common/meta'; +import { timestampOrUndefined } from '../../common/timestamp'; +import { serializerOrUndefined } from '../../common/serializer'; +import { created_at } from '../../common/created_at'; +import { created_by } from '../../common/created_by'; +import { id } from '../../common/id'; +import { tie_breaker_id } from '../../common/tie_breaker_id'; +import { type } from '../../common/type'; +import { updated_at } from '../../common/updated_at'; +import { updated_by } from '../../common/updated_by'; +import { list_id } from '../../common/list_id'; +import { value } from '../../common/value'; + +export const listItemSchema = t.exact( + t.type({ + _version: _versionOrUndefined, + '@timestamp': timestampOrUndefined, + created_at, + created_by, + deserializer: deserializerOrUndefined, + id, + list_id, + meta: metaOrUndefined, + serializer: serializerOrUndefined, + tie_breaker_id, + type, + updated_at, + updated_by, + value, + }) +); + +export type ListItemSchema = t.TypeOf<typeof listItemSchema>; + +export const listItemArraySchema = t.array(listItemSchema); +export type ListItemArraySchema = t.TypeOf<typeof listItemArraySchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.mock.ts new file mode 100644 index 0000000000000..3b6ff22ceb155 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.mock.ts @@ -0,0 +1,54 @@ +/* + * 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 { ListSchema } from '.'; +import { + DATE_NOW, + DESCRIPTION, + ELASTIC_USER, + IMMUTABLE, + LIST_ID, + META, + NAME, + TIE_BREAKER, + TYPE, + USER, + VERSION, +} from '../../constants/index.mock'; + +export const getListResponseMock = (): ListSchema => ({ + _version: undefined, + '@timestamp': DATE_NOW, + created_at: DATE_NOW, + created_by: USER, + description: DESCRIPTION, + deserializer: undefined, + id: LIST_ID, + immutable: IMMUTABLE, + meta: META, + name: NAME, + serializer: undefined, + tie_breaker_id: TIE_BREAKER, + type: TYPE, + updated_at: DATE_NOW, + updated_by: USER, + version: VERSION, +}); + +/** + * This is useful for end to end tests where we remove the auto generated parts for comparisons + * such as created_at, updated_at, and id. + */ +export const getListResponseMockWithoutAutoGeneratedValues = (): Partial<ListSchema> => ({ + created_by: ELASTIC_USER, + description: DESCRIPTION, + immutable: IMMUTABLE, + name: NAME, + type: TYPE, + updated_by: ELASTIC_USER, + version: VERSION, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.test.ts new file mode 100644 index 0000000000000..920941a2135a8 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.test.ts @@ -0,0 +1,192 @@ +/* + * 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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getListResponseMock } from './index.mock'; +import { ListSchema, listSchema } from '.'; + +describe('list_schema', () => { + test('it should validate a typical list response', () => { + const payload = getListResponseMock(); + const decoded = listSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for "id"', () => { + const payload = getListResponseMock(); + // @ts-expect-error + delete payload.id; + const decoded = listSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual(['Invalid value "undefined" supplied to "id"']); + expect(message.schema).toEqual({}); + }); + + test('it should accept an undefined for "meta"', () => { + const payload = getListResponseMock(); + delete payload.meta; + const decoded = listSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "serializer"', () => { + const payload = getListResponseMock(); + delete payload.serializer; + const decoded = listSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should accept an undefined for "deserializer"', () => { + const payload = getListResponseMock(); + delete payload.deserializer; + const decoded = listSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT accept an undefined for "created_at"', () => { + const payload = getListResponseMock(); + // @ts-expect-error + delete payload.created_at; + const decoded = listSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "created_at"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "created_by"', () => { + const payload = getListResponseMock(); + // @ts-expect-error + delete payload.created_by; + const decoded = listSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "created_by"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "tie_breaker_id"', () => { + const payload = getListResponseMock(); + // @ts-expect-error + delete payload.tie_breaker_id; + const decoded = listSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "tie_breaker_id"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "type"', () => { + const payload = getListResponseMock(); + // @ts-expect-error + delete payload.type; + const decoded = listSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "type"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "updated_at"', () => { + const payload = getListResponseMock(); + // @ts-expect-error + delete payload.updated_at; + const decoded = listSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "updated_at"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "updated_by"', () => { + const payload = getListResponseMock(); + // @ts-expect-error + delete payload.updated_by; + const decoded = listSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "updated_by"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "name"', () => { + const payload = getListResponseMock(); + // @ts-expect-error + delete payload.name; + const decoded = listSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "name"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should NOT accept an undefined for "description"', () => { + const payload = getListResponseMock(); + // @ts-expect-error + delete payload.description; + const decoded = listSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "description"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: ListSchema & { extraKey?: string } = getListResponseMock(); + payload.extraKey = 'some new value'; + const decoded = listSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.ts new file mode 100644 index 0000000000000..687c93ad6f6d0 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/list_schema/index.ts @@ -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 * as t from 'io-ts'; +import { version } from '@kbn/securitysolution-io-ts-types'; +import { _versionOrUndefined } from '../../common/underscore_version'; +import { deserializerOrUndefined } from '../../common/deserializer'; +import { metaOrUndefined } from '../../common/meta'; +import { serializerOrUndefined } from '../../common/serializer'; +import { created_at } from '../../common/created_at'; +import { timestampOrUndefined } from '../../common/timestamp'; +import { created_by } from '../../common/created_by'; +import { description } from '../../common/description'; +import { id } from '../../common/id'; +import { immutable } from '../../common/immutable'; +import { name } from '../../common/name'; +import { tie_breaker_id } from '../../common/tie_breaker_id'; +import { type } from '../../common/type'; +import { updated_at } from '../../common/updated_at'; +import { updated_by } from '../../common/updated_by'; + +export const listSchema = t.exact( + t.type({ + _version: _versionOrUndefined, + '@timestamp': timestampOrUndefined, + created_at, + created_by, + description, + deserializer: deserializerOrUndefined, + id, + immutable, + meta: metaOrUndefined, + name, + serializer: serializerOrUndefined, + tie_breaker_id, + type, + updated_at, + updated_by, + version, + }) +); + +export type ListSchema = t.TypeOf<typeof listSchema>; + +export const listArraySchema = t.array(listSchema); +export type ListArraySchema = t.TypeOf<typeof listArraySchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.mock.ts new file mode 100644 index 0000000000000..1ce8e23d4af5b --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.mock.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 { SearchListItemSchema } from '.'; +import { VALUE } from '../../constants/index.mock'; +import { getListItemResponseMock } from '../list_item_schema/index.mock'; + +export const getSearchListItemResponseMock = (): SearchListItemSchema => ({ + items: [getListItemResponseMock()], + value: VALUE, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.test.ts new file mode 100644 index 0000000000000..6f89a58e0bc3d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.test.ts @@ -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 { left } from 'fp-ts/lib/Either'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { exactCheck, foldLeftRight, getPaths } from '@kbn/securitysolution-io-ts-utils'; + +import { getSearchListItemResponseMock } from './index.mock'; +import { SearchListItemSchema, searchListItemSchema } from '.'; + +describe('search_list_item_schema', () => { + test('it should validate a typical search list item response', () => { + const payload = getSearchListItemResponseMock(); + const decoded = searchListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([]); + expect(message.schema).toEqual(payload); + }); + + test('it should NOT validate with an "undefined" for "items"', () => { + const { items, ...noItems } = getSearchListItemResponseMock(); + const decoded = searchListItemSchema.decode(noItems); + const checked = exactCheck(noItems, decoded); + const message = pipe(checked, foldLeftRight); + + expect(getPaths(left(message.errors))).toEqual([ + 'Invalid value "undefined" supplied to "items"', + ]); + expect(message.schema).toEqual({}); + }); + + test('it should not allow an extra key to be sent in', () => { + const payload: SearchListItemSchema & { extraKey?: string } = getSearchListItemResponseMock(); + payload.extraKey = 'some new value'; + const decoded = searchListItemSchema.decode(payload); + const checked = exactCheck(payload, decoded); + const message = pipe(checked, foldLeftRight); + expect(getPaths(left(message.errors))).toEqual(['invalid keys "extraKey"']); + expect(message.schema).toEqual({}); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.ts new file mode 100644 index 0000000000000..8c17db0765005 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/response/search_list_item_schema/index.ts @@ -0,0 +1,26 @@ +/* + * 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 * as t from 'io-ts'; +import { listItemArraySchema } from '../list_item_schema'; + +/** + * NOTE: Although this is defined within "response" this does not expose a REST API + * endpoint right now for this particular response. Instead this is only used internally + * for the plugins at this moment. If this changes, please remove this message. + */ +export const searchListItemSchema = t.exact( + t.type({ + items: listItemArraySchema, + value: t.unknown, + }) +); + +export type SearchListItemSchema = t.TypeOf<typeof searchListItemSchema>; + +export const searchListItemArraySchema = t.array(searchListItemSchema); +export type SearchListItemArraySchema = t.TypeOf<typeof searchListItemArraySchema>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts new file mode 100644 index 0000000000000..8b172753bbc5b --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/src/typescript_types/index.ts @@ -0,0 +1,242 @@ +/* + * 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 { HttpStart } from '@kbn/core-http-browser'; +import type { NotificationsStart } from '@kbn/core-notifications-browser'; +import type { Filter } from '@kbn/es-query'; +import { NamespaceType } from '../common/default_namespace'; +import { ExceptionListType, ExceptionListTypeEnum } from '../common/exception_list'; +import { Page } from '../common/page'; +import { PerPage } from '../common/per_page'; +import { TotalOrUndefined } from '../common/total'; +import { CreateExceptionListItemSchema } from '../request/create_exception_list_item_schema'; +import { CreateExceptionListSchema } from '../request/create_exception_list_schema'; +import { ExceptionListId } from '../request/get_exception_filter_schema'; +import { UpdateExceptionListItemSchema } from '../request/update_exception_list_item_schema'; +import { UpdateExceptionListSchema } from '../request/update_exception_list_schema'; +import { ExceptionListItemSchema } from '../response/exception_list_item_schema'; +import { ExceptionListSchema } from '../response/exception_list_schema'; + +interface BaseParams { + http: HttpStart; + signal: AbortSignal; +} + +export interface DuplicateExceptionListProps extends BaseParams { + listId: string; + namespaceType: NamespaceType; + includeExpiredExceptions: boolean; +} + +export interface ApiListDuplicateProps + extends Omit<DuplicateExceptionListProps, 'http' | 'signal'> { + onError: (err: Error) => void; + onSuccess: (newList: ExceptionListSchema) => void; +} + +export interface ExceptionListFilter { + name?: string | null; + list_id?: string | null; + created_by?: string | null; + types?: ExceptionListTypeEnum[] | null; + tags?: string | null; +} + +export interface UseExceptionListsProps { + errorMessage: string; + filterOptions?: ExceptionListFilter; + http: HttpStart; + namespaceTypes: NamespaceType[]; + notifications: NotificationsStart; + initialPagination?: Pagination; + hideLists?: readonly string[]; + initialSort?: Sort; +} + +export interface UseExceptionListProps { + http: HttpStart; + lists: ExceptionListIdentifiers[]; + onError?: (arg: string[]) => void; + filterOptions: FilterExceptionsOptions[]; + pagination?: Pagination; + showDetectionsListsOnly: boolean; + showEndpointListsOnly: boolean; + matchFilters: boolean; + onSuccess?: (arg: UseExceptionListItemsSuccess) => void; + sort?: Sort; +} + +export interface FilterExceptionsOptions { + filter: string; + tags: string[]; +} + +export interface ApiCallMemoProps { + id: string; + namespaceType: NamespaceType; + onError: (arg: Error) => void; + onSuccess: () => void; +} + +// TODO: Switch to use ApiCallMemoProps +// after cleaning up exceptions/api file to +// remove unnecessary validation checks +export interface ApiListExportProps { + id: string; + includeExpiredExceptions: boolean; + listId: string; + namespaceType: NamespaceType; + onError: (err: Error) => void; + onSuccess: (blob: Blob) => void; +} + +export interface Sort { + field: string; + order: string; +} +export interface Pagination { + page: Page; + perPage: PerPage; + total: TotalOrUndefined; +} + +export interface UseExceptionListItemsSuccess { + exceptions: ExceptionListItemSchema[]; + pagination: Pagination; +} + +export interface ExceptionListIdentifiers { + id: string; + listId: string; + namespaceType: NamespaceType; + type: ExceptionListType; +} + +export interface ApiCallFindListsItemsMemoProps { + lists: ExceptionListIdentifiers[]; + pagination: Partial<Pagination>; + showDetectionsListsOnly: boolean; + showEndpointListsOnly: boolean; + filter?: string; + onError: (arg: string[]) => void; + onSuccess: (arg: UseExceptionListItemsSuccess) => void; +} + +export interface ApiCallGetExceptionFilterFromIdsMemoProps extends GetExceptionFilterOptionalProps { + exceptionListIds: ExceptionListId[]; + onError: (arg: string[]) => void; + onSuccess: (arg: Filter) => void; +} + +export interface ApiCallGetExceptionFilterFromExceptionsMemoProps + extends GetExceptionFilterOptionalProps { + exceptions: Array<ExceptionListItemSchema | CreateExceptionListItemSchema>; + onError: (arg: string[]) => void; + onSuccess: (arg: Filter) => void; +} + +export interface ExportExceptionListProps { + http: HttpStart; + id: string; + listId: string; + namespaceType: NamespaceType; + includeExpiredExceptions: boolean; + signal: AbortSignal; +} + +export interface AddEndpointExceptionListProps { + http: HttpStart; + signal: AbortSignal; +} + +export interface UpdateExceptionListItemProps { + http: HttpStart; + listItem: UpdateExceptionListItemSchema; + signal: AbortSignal; +} + +export interface UpdateExceptionListProps { + http: HttpStart; + list: UpdateExceptionListSchema; + signal: AbortSignal; +} + +export interface AddExceptionListItemProps { + http: HttpStart; + listItem: CreateExceptionListItemSchema; + signal: AbortSignal; +} + +export interface AddExceptionListProps { + http: HttpStart; + list: CreateExceptionListSchema; + signal: AbortSignal; +} + +export interface UseExceptionListsSuccess { + exceptions: ExceptionListSchema[]; + pagination: Pagination; +} + +export interface ApiCallFetchExceptionListsProps { + http: HttpStart; + namespaceTypes: string; + pagination: Partial<Pagination>; + sort?: Sort; + filters: string; + signal: AbortSignal; +} + +export interface ApiCallByIdProps { + http: HttpStart; + id: string; + namespaceType: NamespaceType; + signal: AbortSignal; +} + +export interface ApiCallByListIdProps { + http: HttpStart; + listIds: string[]; + namespaceTypes: NamespaceType[]; + pagination: Partial<Pagination>; + search?: string; + filter?: string; + signal: AbortSignal; +} + +export type AddExceptionList = UpdateExceptionListSchema | CreateExceptionListSchema; + +export interface PersistHookProps { + http: HttpStart; + onError: (arg: Error) => void; +} + +export interface ExceptionList extends ExceptionListSchema { + totalItems: number; +} + +export interface GetExceptionFilterOptionalProps { + signal?: AbortSignal; + chunkSize?: number; + alias?: string; + excludeExceptions?: boolean; +} + +export interface GetExceptionFilterFromExceptionListIdsProps + extends GetExceptionFilterOptionalProps { + http: HttpStart; + exceptionListIds: ExceptionListId[]; +} + +export interface GetExceptionFilterFromExceptionsProps extends GetExceptionFilterOptionalProps { + http: HttpStart; + exceptions: Array<ExceptionListItemSchema | CreateExceptionListItemSchema>; +} + +export interface ExceptionFilterResponse { + filter: Filter; +} diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json new file mode 100644 index 0000000000000..b8097b0b7b12d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": ["jest", "node"] + }, + "include": ["**/*.ts"], + "kbn_references": [ + "@kbn/securitysolution-io-ts-types", + "@kbn/securitysolution-io-ts-utils", + "@kbn/securitysolution-list-constants", + "@kbn/es-query", + "@kbn/core-http-browser", + "@kbn/core-notifications-browser", + "@kbn/securitysolution-exceptions-common" + ], + "exclude": ["target/**/*"] +} diff --git a/packages/kbn-securitysolution-list-api/README.md b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/README.md similarity index 100% rename from packages/kbn-securitysolution-list-api/README.md rename to x-pack/solutions/security/packages/kbn-securitysolution-list-api/README.md diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-api/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/index.ts new file mode 100644 index 0000000000000..afe1280b9b856 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/index.ts @@ -0,0 +1,12 @@ +/* + * 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. + */ + +export * from './src/api'; +export * from './src/fp_utils'; +export * from './src/list_api'; +export * from './src/list_item_api'; +export * from './src/types'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-api/jest.config.js b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/jest.config.js new file mode 100644 index 0000000000000..9e9844e5cbd01 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/jest.config.js @@ -0,0 +1,12 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/packages/kbn-securitysolution-list-api'], +}; diff --git a/packages/kbn-securitysolution-list-api/kibana.jsonc b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/kibana.jsonc similarity index 100% rename from packages/kbn-securitysolution-list-api/kibana.jsonc rename to x-pack/solutions/security/packages/kbn-securitysolution-list-api/kibana.jsonc diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-api/package.json b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/package.json new file mode 100644 index 0000000000000..5159b04f62049 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/securitysolution-list-api", + "version": "1.0.0", + "description": "security solution list REST API", + "license": "Elastic License 2.0", + "private": true +} \ No newline at end of file diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/api/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/api/index.ts new file mode 100644 index 0000000000000..c8fe4143d1bdb --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/api/index.ts @@ -0,0 +1,664 @@ +/* + * 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 { chain, fromEither, tryCatch } from 'fp-ts/lib/TaskEither'; +import { flow } from 'fp-ts/lib/function'; +import { validateEither } from '@kbn/securitysolution-io-ts-utils'; +import { + CreateEndpointListSchema, + ExceptionListItemSchema, + ExceptionListSchema, + FoundExceptionListItemSchema, + FoundExceptionListSchema, + createEndpointListSchema, + exceptionListItemSchema, + exceptionListSchema, + foundExceptionListItemSchema, + foundExceptionListSchema, + AddEndpointExceptionListProps, + AddExceptionListItemProps, + AddExceptionListProps, + ApiCallByIdProps, + ApiCallByListIdProps, + ApiCallFetchExceptionListsProps, + ExportExceptionListProps, + UpdateExceptionListItemProps, + UpdateExceptionListProps, + GetExceptionFilterFromExceptionListIdsProps, + GetExceptionFilterFromExceptionsProps, + ExceptionFilterResponse, + DuplicateExceptionListProps, +} from '@kbn/securitysolution-io-ts-list-types'; + +import { + ENDPOINT_LIST_URL, + INTERNAL_EXCEPTION_FILTER, + EXCEPTION_LIST_ITEM_URL, + EXCEPTION_LIST_URL, +} from '@kbn/securitysolution-list-constants'; +import { toError, toPromise } from '../fp_utils'; + +const version = '2023-10-31'; + +/** + * Add new ExceptionList + * + * @param http Kibana http service + * @param list exception list to add + * @param signal to cancel request + * + * @throws An error if response is not OK + * + */ +const addExceptionList = async ({ + http, + list, + signal, +}: AddExceptionListProps): Promise<ExceptionListSchema> => + http.fetch<ExceptionListSchema>(EXCEPTION_LIST_URL, { + body: JSON.stringify(list), + method: 'POST', + signal, + version, + }); + +const addExceptionListWithValidation = async ({ + http, + list, + signal, +}: AddExceptionListProps): Promise<ExceptionListSchema> => + flow( + () => + tryCatch( + () => + addExceptionList({ + http, + list, + signal, + }), + toError + ), + chain((response) => fromEither(validateEither(exceptionListSchema, response))), + flow(toPromise) + )(); + +export { addExceptionListWithValidation as addExceptionList }; + +/** + * Add new ExceptionListItem + * + * @param http Kibana http service + * @param listItem exception list item to add + * @param signal to cancel request + * + * @throws An error if response is not OK + * + */ +const addExceptionListItem = async ({ + http, + listItem, + signal, +}: AddExceptionListItemProps): Promise<ExceptionListItemSchema> => + http.fetch<ExceptionListItemSchema>(EXCEPTION_LIST_ITEM_URL, { + body: JSON.stringify(listItem), + method: 'POST', + signal, + version, + }); + +const addExceptionListItemWithValidation = async ({ + http, + listItem, + signal, +}: AddExceptionListItemProps): Promise<ExceptionListItemSchema> => + flow( + () => + tryCatch( + () => + addExceptionListItem({ + http, + listItem, + signal, + }), + toError + ), + chain((response) => fromEither(validateEither(exceptionListItemSchema, response))), + flow(toPromise) + )(); + +export { addExceptionListItemWithValidation as addExceptionListItem }; + +/** + * Update existing ExceptionList + * + * @param http Kibana http service + * @param list exception list to add + * @param signal to cancel request + * + * @throws An error if response is not OK + * + */ +const updateExceptionList = async ({ + http, + list, + signal, +}: UpdateExceptionListProps): Promise<ExceptionListSchema> => + http.fetch<ExceptionListSchema>(EXCEPTION_LIST_URL, { + body: JSON.stringify(list), + method: 'PUT', + signal, + version, + }); + +const updateExceptionListWithValidation = async ({ + http, + list, + signal, +}: UpdateExceptionListProps): Promise<ExceptionListSchema> => + flow( + () => + tryCatch( + () => + updateExceptionList({ + http, + list, + signal, + }), + toError + ), + chain((response) => fromEither(validateEither(exceptionListSchema, response))), + flow(toPromise) + )(); + +export { updateExceptionListWithValidation as updateExceptionList }; + +/** + * Update existing ExceptionListItem + * + * @param http Kibana http service + * @param listItem exception list item to add + * @param signal to cancel request + * + * @throws An error if response is not OK + * + */ +const updateExceptionListItem = async ({ + http, + listItem, + signal, +}: UpdateExceptionListItemProps): Promise<ExceptionListItemSchema> => + http.fetch<ExceptionListItemSchema>(EXCEPTION_LIST_ITEM_URL, { + body: JSON.stringify(listItem), + method: 'PUT', + signal, + version, + }); + +const updateExceptionListItemWithValidation = async ({ + http, + listItem, + signal, +}: UpdateExceptionListItemProps): Promise<ExceptionListItemSchema> => + flow( + () => + tryCatch( + () => + updateExceptionListItem({ + http, + listItem, + signal, + }), + toError + ), + chain((response) => fromEither(validateEither(exceptionListItemSchema, response))), + flow(toPromise) + )(); + +export { updateExceptionListItemWithValidation as updateExceptionListItem }; + +/** + * Fetch all ExceptionLists (optionally by namespaceType) + * + * @param http Kibana http service + * @param namespaceTypes ExceptionList namespace_types of lists to find + * @param filters search bar filters + * @param pagination optional + * @param signal to cancel request + * + * @throws An error if request params or response is not OK + */ +const fetchExceptionLists = async ({ + http, + filters, + namespaceTypes, + pagination, + signal, + sort, +}: ApiCallFetchExceptionListsProps): Promise<FoundExceptionListSchema> => { + const query = { + filter: filters || undefined, + namespace_type: namespaceTypes, + page: pagination.page ? `${pagination.page}` : '1', + per_page: pagination.perPage ? `${pagination.perPage}` : '20', + sort_field: sort?.field ? sort?.field : 'exception-list.created_at', + sort_order: sort?.order ? sort?.order : 'desc', + }; + + return http.fetch<FoundExceptionListSchema>(`${EXCEPTION_LIST_URL}/_find`, { + method: 'GET', + query, + signal, + version, + }); +}; + +const fetchExceptionListsWithValidation = async ({ + filters, + http, + namespaceTypes, + pagination, + signal, + sort, +}: ApiCallFetchExceptionListsProps): Promise<FoundExceptionListSchema> => + flow( + () => + tryCatch( + () => + fetchExceptionLists({ + filters, + http, + namespaceTypes, + pagination, + signal, + sort, + }), + toError + ), + chain((response) => fromEither(validateEither(foundExceptionListSchema, response))), + flow(toPromise) + )(); + +export { fetchExceptionListsWithValidation as fetchExceptionLists }; + +/** + * Fetch an ExceptionList by providing a ExceptionList ID + * + * @param http Kibana http service + * @param id ExceptionList ID (not list_id) + * @param namespaceType ExceptionList namespace_type + * @param signal to cancel request + * + * @throws An error if response is not OK + */ +const fetchExceptionListById = async ({ + http, + id, + namespaceType, + signal, +}: ApiCallByIdProps): Promise<ExceptionListSchema> => + http.fetch<ExceptionListSchema>(EXCEPTION_LIST_URL, { + method: 'GET', + query: { id, namespace_type: namespaceType }, + signal, + version, + }); + +const fetchExceptionListByIdWithValidation = async ({ + http, + id, + namespaceType, + signal, +}: ApiCallByIdProps): Promise<ExceptionListSchema> => + flow( + () => + tryCatch( + () => + fetchExceptionListById({ + http, + id, + namespaceType, + signal, + }), + toError + ), + chain((response) => fromEither(validateEither(exceptionListSchema, response))), + flow(toPromise) + )(); + +export { fetchExceptionListByIdWithValidation as fetchExceptionListById }; + +/** + * Fetch an ExceptionList's ExceptionItems by providing a ExceptionList list_id + * + * @param http Kibana http service + * @param listIds ExceptionList list_ids (not ID) + * @param namespaceTypes ExceptionList namespace_types + * @param search optional - simple search string + * @param filter optional + * @param pagination optional + * @param signal to cancel request + * + * @throws An error if response is not OK + */ +const fetchExceptionListsItemsByListIds = async ({ + http, + listIds, + namespaceTypes, + filter, + pagination, + search, + signal, +}: ApiCallByListIdProps): Promise<FoundExceptionListItemSchema> => { + const query = { + list_id: listIds.join(','), + namespace_type: namespaceTypes.join(','), + page: pagination.page ? `${pagination.page}` : '1', + per_page: pagination.perPage ? `${pagination.perPage}` : '20', + search, + sort_field: 'exception-list.created_at', + sort_order: 'desc', + filter, + }; + + return http.fetch<FoundExceptionListItemSchema>(`${EXCEPTION_LIST_ITEM_URL}/_find`, { + method: 'GET', + query, + signal, + version, + }); +}; + +const fetchExceptionListsItemsByListIdsWithValidation = async ({ + filter, + http, + listIds, + namespaceTypes, + pagination, + search, + signal, +}: ApiCallByListIdProps): Promise<FoundExceptionListItemSchema> => + flow( + () => + tryCatch( + () => + fetchExceptionListsItemsByListIds({ + filter, + http, + listIds, + namespaceTypes, + pagination, + search, + signal, + }), + toError + ), + chain((response) => fromEither(validateEither(foundExceptionListItemSchema, response))), + flow(toPromise) + )(); + +export { fetchExceptionListsItemsByListIdsWithValidation as fetchExceptionListsItemsByListIds }; + +/** + * Fetch an ExceptionListItem by providing a ExceptionListItem ID + * + * @param http Kibana http service + * @param id ExceptionListItem ID (not item_id) + * @param namespaceType ExceptionList namespace_type + * @param signal to cancel request + * + * @throws An error if response is not OK + */ +const fetchExceptionListItemById = async ({ + http, + id, + namespaceType, + signal, +}: ApiCallByIdProps): Promise<ExceptionListItemSchema> => + http.fetch<ExceptionListItemSchema>(EXCEPTION_LIST_ITEM_URL, { + method: 'GET', + query: { id, namespace_type: namespaceType }, + signal, + version, + }); + +const fetchExceptionListItemByIdWithValidation = async ({ + http, + id, + namespaceType, + signal, +}: ApiCallByIdProps): Promise<ExceptionListItemSchema> => + flow( + () => tryCatch(() => fetchExceptionListItemById({ http, id, namespaceType, signal }), toError), + chain((response) => fromEither(validateEither(exceptionListItemSchema, response))), + flow(toPromise) + )(); + +export { fetchExceptionListItemByIdWithValidation as fetchExceptionListItemById }; + +/** + * Delete an ExceptionList by providing a ExceptionList ID + * + * @param http Kibana http service + * @param id ExceptionList ID (not list_id) + * @param namespaceType ExceptionList namespace_type + * @param signal to cancel request + * + * @throws An error if response is not OK + */ +const deleteExceptionListById = async ({ + http, + id, + namespaceType, + signal, +}: ApiCallByIdProps): Promise<ExceptionListSchema> => + http.fetch<ExceptionListSchema>(EXCEPTION_LIST_URL, { + method: 'DELETE', + query: { id, namespace_type: namespaceType }, + signal, + version, + }); + +const deleteExceptionListByIdWithValidation = async ({ + http, + id, + namespaceType, + signal, +}: ApiCallByIdProps): Promise<ExceptionListSchema> => + flow( + () => tryCatch(() => deleteExceptionListById({ http, id, namespaceType, signal }), toError), + chain((response) => fromEither(validateEither(exceptionListSchema, response))), + flow(toPromise) + )(); + +export { deleteExceptionListByIdWithValidation as deleteExceptionListById }; + +/** + * Delete an ExceptionListItem by providing a ExceptionListItem ID + * + * @param http Kibana http service + * @param id ExceptionListItem ID (not item_id) + * @param namespaceType ExceptionList namespace_type + * @param signal to cancel request + * + * @throws An error if response is not OK + */ +const deleteExceptionListItemById = async ({ + http, + id, + namespaceType, + signal, +}: ApiCallByIdProps): Promise<ExceptionListItemSchema> => + http.fetch<ExceptionListItemSchema>(EXCEPTION_LIST_ITEM_URL, { + method: 'DELETE', + query: { id, namespace_type: namespaceType }, + signal, + version, + }); + +const deleteExceptionListItemByIdWithValidation = async ({ + http, + id, + namespaceType, + signal, +}: ApiCallByIdProps): Promise<ExceptionListItemSchema> => + flow( + () => tryCatch(() => deleteExceptionListItemById({ http, id, namespaceType, signal }), toError), + chain((response) => fromEither(validateEither(exceptionListItemSchema, response))), + flow(toPromise) + )(); + +export { deleteExceptionListItemByIdWithValidation as deleteExceptionListItemById }; + +/** + * Add new Endpoint ExceptionList + * + * @param http Kibana http service + * @param signal to cancel request + * + * @throws An error if response is not OK + * + */ +const addEndpointExceptionList = async ({ + http, + signal, +}: AddEndpointExceptionListProps): Promise<CreateEndpointListSchema> => + http.fetch<ExceptionListItemSchema>(ENDPOINT_LIST_URL, { + method: 'POST', + signal, + version, + }); + +const addEndpointExceptionListWithValidation = async ({ + http, + signal, +}: AddEndpointExceptionListProps): Promise<CreateEndpointListSchema> => + flow( + () => tryCatch(() => addEndpointExceptionList({ http, signal }), toError), + chain((response) => fromEither(validateEither(createEndpointListSchema, response))), + flow(toPromise) + )(); + +export { addEndpointExceptionListWithValidation as addEndpointExceptionList }; + +/** + * Export an ExceptionList by providing a ExceptionList ID + * + * @param http Kibana http service + * @param id ExceptionList ID (not list_id) + * @param includeExpiredExceptions boolean for including expired exceptions + * @param listId ExceptionList LIST_ID (not id) + * @param namespaceType ExceptionList namespace_type + * @param signal to cancel request + * + * @throws An error if response is not OK + */ +export const exportExceptionList = async ({ + http, + id, + includeExpiredExceptions, + listId, + namespaceType, + signal, +}: ExportExceptionListProps): Promise<Blob> => + http.fetch<Blob>(`${EXCEPTION_LIST_URL}/_export`, { + method: 'POST', + query: { + id, + list_id: listId, + namespace_type: namespaceType, + include_expired_exceptions: includeExpiredExceptions, + }, + signal, + version, + }); + +/** + * Create a Filter query from an exception list id + * + * @param exceptionListId The id of the exception list from which create a Filter query + * @param signal AbortSignal for cancelling request + * + * @throws An error if response is not OK + */ +export const getExceptionFilterFromExceptionListIds = async ({ + alias, + chunkSize, + exceptionListIds, + excludeExceptions, + http, + signal, +}: GetExceptionFilterFromExceptionListIdsProps): Promise<ExceptionFilterResponse> => + http.fetch(INTERNAL_EXCEPTION_FILTER, { + method: 'POST', + version: '1', + body: JSON.stringify({ + exception_list_ids: exceptionListIds, + type: 'exception_list_ids', + alias, + exclude_exceptions: excludeExceptions, + chunk_size: chunkSize, + }), + signal, + }); + +/** + * Create a Filter query from a list of exceptions + * + * @param exceptions Exception items to be made into a `Filter` query + * @param signal AbortSignal for cancelling request + * + * @throws An error if response is not OK + */ +export const getExceptionFilterFromExceptions = async ({ + exceptions, + alias, + excludeExceptions, + http, + chunkSize, + signal, +}: GetExceptionFilterFromExceptionsProps): Promise<ExceptionFilterResponse> => + http.fetch(INTERNAL_EXCEPTION_FILTER, { + method: 'POST', + version: '1', + body: JSON.stringify({ + exceptions, + type: 'exception_items', + alias, + exclude_exceptions: excludeExceptions, + chunk_size: chunkSize, + }), + signal, + }); + +/** + * Duplicate an ExceptionList and its items by providing a ExceptionList list_id + * + * @param http Kibana http service + * @param includeExpiredExceptions boolean for including exception items with expired TTL + * @param listId ExceptionList LIST_ID (not id) + * @param namespaceType ExceptionList namespace_type + * @param signal to cancel request + * + * @throws An error if response is not OK + */ +export const duplicateExceptionList = async ({ + http, + includeExpiredExceptions, + listId, + namespaceType, + signal, +}: DuplicateExceptionListProps): Promise<ExceptionListSchema> => + http.fetch<ExceptionListSchema>(`${EXCEPTION_LIST_URL}/_duplicate`, { + method: 'POST', + query: { + list_id: listId, + namespace_type: namespaceType, + include_expired_exceptions: includeExpiredExceptions, + }, + signal, + version, + }); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/fp_utils/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/fp_utils/index.test.ts new file mode 100644 index 0000000000000..574c0f97292ef --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/fp_utils/index.test.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 { tryCatch } from 'fp-ts/lib/TaskEither'; + +import { toPromise } from '.'; + +describe('toPromise', () => { + it('rejects with left if TaskEither is left', async () => { + const task = tryCatch(() => Promise.reject(new Error('whoops')), String); + + await expect(toPromise(task)).rejects.toEqual('Error: whoops'); + }); + + it('resolves with right if TaskEither is right', async () => { + const task = tryCatch(() => Promise.resolve('success'), String); + + await expect(toPromise(task)).resolves.toEqual('success'); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/fp_utils/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/fp_utils/index.ts new file mode 100644 index 0000000000000..1360c78db59ef --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/fp_utils/index.ts @@ -0,0 +1,23 @@ +/* + * 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 { pipe } from 'fp-ts/lib/pipeable'; +import { TaskEither } from 'fp-ts/lib/TaskEither'; +import { fold } from 'fp-ts/lib/Either'; + +// TODO: This is copied in a few other spots and probably should live within its own kbn package +// rather than living here. A package such as kbn-security-solution-fp-utils +export const toPromise = async <E, A>(taskEither: TaskEither<E, A>): Promise<A> => + pipe( + await taskEither(), + fold( + (e) => Promise.reject(e), + (a) => Promise.resolve(a) + ) + ); + +export const toError = (e: unknown): Error => (e instanceof Error ? e : new Error(String(e))); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_api/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_api/index.test.ts new file mode 100644 index 0000000000000..1168b4e491951 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_api/index.test.ts @@ -0,0 +1,443 @@ +/* + * 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 { createListIndex, deleteList, exportList, findLists, importList, readListIndex } from '.'; +import { + ApiPayload, + DeleteListParams, + ExportListParams, + FindListsParams, + ImportListParams, +} from '../types'; + +import { HttpFetchOptions } from '@kbn/core-http-browser'; +import { httpServiceMock } from '@kbn/core-http-browser-mocks'; + +import { getFoundListSchemaMock } from './mocks/response/found_list_schema.mock'; +import { getListResponseMock } from './mocks/response/list_schema.mock'; +import { getListItemIndexExistSchemaResponseMock } from './mocks/response/list_item_index_exist_schema.mock'; +import { getAcknowledgeSchemaResponseMock } from './mocks/response/acknowledge_schema.mock'; + +describe('Value Lists API', () => { + let httpMock: ReturnType<typeof httpServiceMock.createStartContract>; + + beforeEach(() => { + httpMock = httpServiceMock.createStartContract(); + }); + describe('deleteList', () => { + beforeEach(() => { + httpMock.fetch.mockResolvedValue(getListResponseMock()); + }); + + it('DELETEs specifying the id as a query parameter', async () => { + const abortCtrl = new AbortController(); + const payload: ApiPayload<DeleteListParams> = { + deleteReferences: false, + id: 'list-id', + ignoreReferences: true, + }; + await deleteList({ + http: httpMock, + ...payload, + signal: abortCtrl.signal, + }); + + expect(httpMock.fetch).toHaveBeenCalledWith( + '/api/lists', + expect.objectContaining({ + method: 'DELETE', + query: { deleteReferences: false, id: 'list-id', ignoreReferences: true }, + }) + ); + }); + + it('rejects with an error if request payload is invalid (and does not make API call)', async () => { + const abortCtrl = new AbortController(); + const payload: Omit<ApiPayload<DeleteListParams>, 'id'> & { + id: number; + } = { id: 23 }; + + await expect( + deleteList({ + http: httpMock, + ...(payload as unknown as ApiPayload<DeleteListParams>), + signal: abortCtrl.signal, + }) + ).rejects.toEqual(new Error('Invalid value "23" supplied to "id"')); + expect(httpMock.fetch).not.toHaveBeenCalled(); + }); + + it('rejects with an error if response payload is invalid', async () => { + const abortCtrl = new AbortController(); + const payload: ApiPayload<DeleteListParams> = { id: 'list-id' }; + const badResponse = { ...getListResponseMock(), id: undefined }; + httpMock.fetch.mockResolvedValue(badResponse); + + await expect( + deleteList({ + http: httpMock, + ...payload, + signal: abortCtrl.signal, + }) + ).rejects.toEqual(new Error('Invalid value "undefined" supplied to "id"')); + }); + }); + describe('findLists', () => { + beforeEach(() => { + httpMock.fetch.mockResolvedValue(getFoundListSchemaMock()); + }); + + it('GETs from the lists endpoint', async () => { + const abortCtrl = new AbortController(); + await findLists({ + http: httpMock, + pageIndex: 1, + pageSize: 10, + signal: abortCtrl.signal, + }); + + expect(httpMock.fetch).toHaveBeenCalledWith( + '/api/lists/_find', + expect.objectContaining({ + method: 'GET', + }) + ); + }); + + it('sends pagination as query parameters', async () => { + const abortCtrl = new AbortController(); + await findLists({ + cursor: 'cursor', + http: httpMock, + pageIndex: 1, + pageSize: 10, + signal: abortCtrl.signal, + }); + + expect(httpMock.fetch).toHaveBeenCalledWith( + '/api/lists/_find', + expect.objectContaining({ + query: { + cursor: 'cursor', + page: 1, + per_page: 10, + }, + }) + ); + }); + + it('sends sort_field and sort_order as query parameters', async () => { + const abortCtrl = new AbortController(); + await findLists({ + cursor: 'cursor', + http: httpMock, + pageIndex: 1, + pageSize: 10, + signal: abortCtrl.signal, + sortField: 'created_at', + sortOrder: 'desc', + }); + + expect(httpMock.fetch).toHaveBeenCalledWith( + '/api/lists/_find', + expect.objectContaining({ + query: { + cursor: 'cursor', + page: 1, + per_page: 10, + sort_field: 'created_at', + sort_order: 'desc', + }, + }) + ); + }); + + it('rejects with an error if request payload is invalid (and does not make API call)', async () => { + const abortCtrl = new AbortController(); + const payload: ApiPayload<FindListsParams> = { + pageIndex: 10, + pageSize: 0, + }; + + await expect( + findLists({ + http: httpMock, + ...payload, + signal: abortCtrl.signal, + }) + ).rejects.toEqual(new Error('Invalid value "0" supplied to "per_page"')); + expect(httpMock.fetch).not.toHaveBeenCalled(); + }); + + it('rejects with an error if response payload is invalid', async () => { + const abortCtrl = new AbortController(); + const payload: ApiPayload<FindListsParams> = { + pageIndex: 1, + pageSize: 10, + }; + const badResponse = { ...getFoundListSchemaMock(), cursor: undefined }; + httpMock.fetch.mockResolvedValue(badResponse); + + await expect( + findLists({ + http: httpMock, + ...payload, + signal: abortCtrl.signal, + }) + ).rejects.toEqual(new Error('Invalid value "undefined" supplied to "cursor"')); + }); + }); + describe('importList', () => { + beforeEach(() => { + httpMock.fetch.mockResolvedValue(getListResponseMock()); + }); + + it('POSTs the file', async () => { + const abortCtrl = new AbortController(); + const file = new File([], 'name'); + + await importList({ + file, + http: httpMock, + listId: 'my_list', + signal: abortCtrl.signal, + type: 'keyword', + }); + expect(httpMock.fetch).toHaveBeenCalledWith( + '/api/lists/items/_import', + expect.objectContaining({ + method: 'POST', + }) + ); + + // httpmock's fetch signature is inferred incorrectly + const [[, { body }]] = httpMock.fetch.mock.calls as unknown as Array< + [unknown, HttpFetchOptions] + >; + const actualFile = (body as FormData).get('file'); + expect(actualFile).toEqual(file); + }); + + it('sends type and id as query parameters', async () => { + const abortCtrl = new AbortController(); + const file = new File([], 'name'); + + await importList({ + file, + http: httpMock, + listId: 'my_list', + signal: abortCtrl.signal, + type: 'keyword', + }); + + expect(httpMock.fetch).toHaveBeenCalledWith( + '/api/lists/items/_import', + expect.objectContaining({ + query: { list_id: 'my_list', type: 'keyword' }, + }) + ); + }); + + it('rejects with an error if request body is invalid (and does not make API call)', async () => { + const abortCtrl = new AbortController(); + const payload: ApiPayload<ImportListParams> = { + file: undefined as unknown as File, + listId: 'list-id', + type: 'ip', + }; + + await expect( + importList({ + http: httpMock, + ...payload, + signal: abortCtrl.signal, + }) + ).rejects.toEqual(new Error('Invalid value "undefined" supplied to "file"')); + expect(httpMock.fetch).not.toHaveBeenCalled(); + }); + + it('rejects with an error if request params are invalid (and does not make API call)', async () => { + const abortCtrl = new AbortController(); + const file = new File([], 'name'); + const payload: ApiPayload<ImportListParams> = { + file, + listId: 'list-id', + type: 'other' as 'ip', + }; + + await expect( + importList({ + http: httpMock, + ...payload, + signal: abortCtrl.signal, + }) + ).rejects.toEqual(new Error('Invalid value "other" supplied to "type"')); + expect(httpMock.fetch).not.toHaveBeenCalled(); + }); + + it('rejects with an error if response payload is invalid', async () => { + const abortCtrl = new AbortController(); + const file = new File([], 'name'); + const payload: ApiPayload<ImportListParams> = { + file, + listId: 'list-id', + type: 'ip', + }; + const badResponse = { ...getListResponseMock(), id: undefined }; + httpMock.fetch.mockResolvedValue(badResponse); + + await expect( + importList({ + http: httpMock, + ...payload, + signal: abortCtrl.signal, + }) + ).rejects.toEqual(new Error('Invalid value "undefined" supplied to "id"')); + }); + }); + describe('exportList', () => { + beforeEach(() => { + httpMock.fetch.mockResolvedValue({}); + }); + + it('POSTs to the export endpoint', async () => { + const abortCtrl = new AbortController(); + + await exportList({ + http: httpMock, + listId: 'my_list', + signal: abortCtrl.signal, + }); + expect(httpMock.fetch).toHaveBeenCalledWith( + '/api/lists/items/_export', + expect.objectContaining({ + method: 'POST', + }) + ); + }); + + it('sends type and id as query parameters', async () => { + const abortCtrl = new AbortController(); + + await exportList({ + http: httpMock, + listId: 'my_list', + signal: abortCtrl.signal, + }); + expect(httpMock.fetch).toHaveBeenCalledWith( + '/api/lists/items/_export', + expect.objectContaining({ + query: { list_id: 'my_list' }, + }) + ); + }); + + it('rejects with an error if request params are invalid (and does not make API call)', async () => { + const abortCtrl = new AbortController(); + const payload: ApiPayload<ExportListParams> = { + listId: 23 as unknown as string, + }; + + await expect( + exportList({ + http: httpMock, + ...payload, + signal: abortCtrl.signal, + }) + ).rejects.toEqual(new Error('Invalid value "23" supplied to "list_id"')); + expect(httpMock.fetch).not.toHaveBeenCalled(); + }); + }); + + describe('readListIndex', () => { + beforeEach(() => { + httpMock.fetch.mockResolvedValue(getListItemIndexExistSchemaResponseMock()); + }); + + it('GETs the list index', async () => { + const abortCtrl = new AbortController(); + await readListIndex({ + http: httpMock, + signal: abortCtrl.signal, + }); + + expect(httpMock.fetch).toHaveBeenCalledWith( + '/api/lists/index', + expect.objectContaining({ + method: 'GET', + }) + ); + }); + + it('returns the response when valid', async () => { + const abortCtrl = new AbortController(); + const result = await readListIndex({ + http: httpMock, + signal: abortCtrl.signal, + }); + + expect(result).toEqual(getListItemIndexExistSchemaResponseMock()); + }); + + it('rejects with an error if response payload is invalid', async () => { + const abortCtrl = new AbortController(); + const badResponse = { ...getListItemIndexExistSchemaResponseMock(), list_index: undefined }; + httpMock.fetch.mockResolvedValue(badResponse); + + await expect( + readListIndex({ + http: httpMock, + signal: abortCtrl.signal, + }) + ).rejects.toEqual(new Error('Invalid value "undefined" supplied to "list_index"')); + }); + }); + + describe('createListIndex', () => { + beforeEach(() => { + httpMock.fetch.mockResolvedValue(getAcknowledgeSchemaResponseMock()); + }); + + it('GETs the list index', async () => { + const abortCtrl = new AbortController(); + await createListIndex({ + http: httpMock, + signal: abortCtrl.signal, + }); + + expect(httpMock.fetch).toHaveBeenCalledWith( + '/api/lists/index', + expect.objectContaining({ + method: 'POST', + }) + ); + }); + + it('returns the response when valid', async () => { + const abortCtrl = new AbortController(); + const result = await createListIndex({ + http: httpMock, + signal: abortCtrl.signal, + }); + + expect(result).toEqual(getAcknowledgeSchemaResponseMock()); + }); + + it('rejects with an error if response payload is invalid', async () => { + const abortCtrl = new AbortController(); + const badResponse = { acknowledged: undefined }; + httpMock.fetch.mockResolvedValue(badResponse); + + await expect( + createListIndex({ + http: httpMock, + signal: abortCtrl.signal, + }) + ).rejects.toEqual(new Error('Invalid value "undefined" supplied to "acknowledged"')); + }); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_api/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_api/index.ts new file mode 100644 index 0000000000000..93160ca739e2e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_api/index.ts @@ -0,0 +1,342 @@ +/* + * 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 { chain, fromEither, map, tryCatch } from 'fp-ts/lib/TaskEither'; +import { flow } from 'fp-ts/lib/function'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { validateEither } from '@kbn/securitysolution-io-ts-utils'; +import { + AcknowledgeSchema, + DeleteListSchemaEncoded, + ExportListItemQuerySchemaEncoded, + FindListSchemaEncoded, + FoundListSchema, + ImportListItemQuerySchemaEncoded, + ImportListItemSchemaEncoded, + ListItemIndexExistSchema, + ListSchema, + ReadListSchema, + acknowledgeSchema, + deleteListSchema, + readListSchema, + exportListItemQuerySchema, + findListSchema, + foundListSchema, + importListItemQuerySchema, + importListItemSchema, + listItemIndexExistSchema, + listSchema, + foundListsBySizeSchema, + FoundListsBySizeSchema, +} from '@kbn/securitysolution-io-ts-list-types'; +import { + LIST_INDEX, + LIST_ITEM_URL, + LIST_PRIVILEGES_URL, + LIST_URL, + INTERNAL_FIND_LISTS_BY_SIZE, +} from '@kbn/securitysolution-list-constants'; +import { toError, toPromise } from '../fp_utils'; + +import { + ApiParams, + DeleteListParams, + ExportListParams, + FindListsParams, + ImportListParams, + GetListByIdParams, +} from '../types'; + +export type { + ApiParams, + DeleteListParams, + ExportListParams, + FindListsParams, + ImportListParams, +} from '../types'; + +const version = '2023-10-31'; + +const findLists = async ({ + http, + cursor, + page, + // eslint-disable-next-line @typescript-eslint/naming-convention + per_page, + signal, + // eslint-disable-next-line @typescript-eslint/naming-convention + sort_field, + // eslint-disable-next-line @typescript-eslint/naming-convention + sort_order, +}: ApiParams & FindListSchemaEncoded): Promise<FoundListSchema> => { + return http.fetch(`${LIST_URL}/_find`, { + method: 'GET', + query: { + cursor, + page, + per_page, + sort_field, + sort_order, + }, + signal, + version, + }); +}; + +const findListsWithValidation = async ({ + cursor, + http, + pageIndex, + pageSize, + signal, + sortField, + sortOrder, +}: FindListsParams): Promise<FoundListSchema> => + pipe( + { + cursor: cursor != null ? cursor.toString() : undefined, + page: pageIndex != null ? pageIndex.toString() : undefined, + per_page: pageSize != null ? pageSize.toString() : undefined, + sort_field: sortField != null ? sortField.toString() : undefined, + sort_order: sortOrder, + }, + (payload) => fromEither(validateEither(findListSchema, payload)), + chain((payload) => tryCatch(() => findLists({ http, signal, ...payload }), toError)), + chain((response) => fromEither(validateEither(foundListSchema, response))), + flow(toPromise) + ); + +export { findListsWithValidation as findLists }; + +const findListsBySize = async ({ + http, + cursor, + page, + // eslint-disable-next-line @typescript-eslint/naming-convention + per_page, + signal, +}: ApiParams & FindListSchemaEncoded): Promise<FoundListsBySizeSchema> => { + return http.fetch(`${INTERNAL_FIND_LISTS_BY_SIZE}`, { + method: 'GET', + version: '1', + query: { + cursor, + page, + per_page, + }, + signal, + }); +}; + +const findListsBySizeWithValidation = async ({ + cursor, + http, + pageIndex, + pageSize, + signal, +}: FindListsParams): Promise<FoundListsBySizeSchema> => + pipe( + { + cursor: cursor != null ? cursor.toString() : undefined, + page: pageIndex != null ? pageIndex.toString() : undefined, + per_page: pageSize != null ? pageSize.toString() : undefined, + }, + (payload) => fromEither(validateEither(findListSchema, payload)), + chain((payload) => tryCatch(() => findListsBySize({ http, signal, ...payload }), toError)), + chain((response) => fromEither(validateEither(foundListsBySizeSchema, response))), + flow(toPromise) + ); + +export { findListsBySizeWithValidation as findListsBySize }; + +const importList = async ({ + file, + http, + // eslint-disable-next-line @typescript-eslint/naming-convention + list_id, + type, + signal, + refresh, +}: ApiParams & + ImportListItemSchemaEncoded & + ImportListItemQuerySchemaEncoded): Promise<ListSchema> => { + const formData = new FormData(); + formData.append('file', file as Blob); + + return http.fetch<ListSchema>(`${LIST_ITEM_URL}/_import`, { + body: formData, + headers: { 'Content-Type': undefined }, + method: 'POST', + query: { list_id, type, refresh }, + signal, + version, + }); +}; + +const importListWithValidation = async ({ + file, + http, + listId, + type, + signal, + refresh, +}: ImportListParams): Promise<ListSchema> => + pipe( + { + list_id: listId, + type, + refresh, + }, + (query) => fromEither(validateEither(importListItemQuerySchema, query)), + chain((query) => + pipe( + fromEither(validateEither(importListItemSchema, { file })), + map((body) => ({ ...body, ...query })) + ) + ), + chain((payload) => tryCatch(() => importList({ http, signal, ...payload }), toError)), + chain((response) => fromEither(validateEither(listSchema, response))), + toPromise + ); + +export { importListWithValidation as importList }; + +const deleteList = async ({ + deleteReferences = false, + http, + id, + ignoreReferences = false, + signal, +}: ApiParams & DeleteListSchemaEncoded): Promise<ListSchema> => + http.fetch<ListSchema>(LIST_URL, { + method: 'DELETE', + query: { deleteReferences, id, ignoreReferences }, + signal, + version, + }); + +const deleteListWithValidation = async ({ + deleteReferences, + http, + id, + ignoreReferences, + signal, +}: DeleteListParams): Promise<ListSchema> => + pipe( + { deleteReferences, id, ignoreReferences }, + (payload) => fromEither(validateEither(deleteListSchema, payload)), + chain((payload) => tryCatch(() => deleteList({ http, signal, ...payload }), toError)), + chain((response) => fromEither(validateEither(listSchema, response))), + flow(toPromise) + ); + +export { deleteListWithValidation as deleteList }; + +const exportList = async ({ + http, + // eslint-disable-next-line @typescript-eslint/naming-convention + list_id, + signal, +}: ApiParams & ExportListItemQuerySchemaEncoded): Promise<Blob> => + http.fetch<Blob>(`${LIST_ITEM_URL}/_export`, { + method: 'POST', + query: { list_id }, + signal, + version, + }); + +const exportListWithValidation = async ({ + http, + listId, + signal, +}: ExportListParams): Promise<Blob> => + pipe( + { list_id: listId }, + (payload) => fromEither(validateEither(exportListItemQuerySchema, payload)), + chain((payload) => tryCatch(() => exportList({ http, signal, ...payload }), toError)), + flow(toPromise) + ); + +export { exportListWithValidation as exportList }; + +const readListIndex = async ({ http, signal }: ApiParams): Promise<ListItemIndexExistSchema> => + http.fetch<ListItemIndexExistSchema>(LIST_INDEX, { + method: 'GET', + signal, + version, + }); + +const readListIndexWithValidation = async ({ + http, + signal, +}: ApiParams): Promise<ListItemIndexExistSchema> => + flow( + () => tryCatch(() => readListIndex({ http, signal }), toError), + chain((response) => fromEither(validateEither(listItemIndexExistSchema, response))), + flow(toPromise) + )(); + +export { readListIndexWithValidation as readListIndex }; + +// TODO add types and validation +export const readListPrivileges = async ({ http, signal }: ApiParams): Promise<unknown> => + http.fetch<unknown>(LIST_PRIVILEGES_URL, { + method: 'GET', + signal, + version, + }); + +const createListIndex = async ({ http, signal }: ApiParams): Promise<AcknowledgeSchema> => + http.fetch<AcknowledgeSchema>(LIST_INDEX, { + method: 'POST', + signal, + version, + }); + +const createListIndexWithValidation = async ({ + http, + signal, +}: ApiParams): Promise<AcknowledgeSchema> => + flow( + () => tryCatch(() => createListIndex({ http, signal }), toError), + chain((response) => fromEither(validateEither(acknowledgeSchema, response))), + flow(toPromise) + )(); + +export { createListIndexWithValidation as createListIndex }; + +const getListById = async ({ + http, + signal, + id, +}: ApiParams & ReadListSchema): Promise<ListSchema> => { + return http.fetch(`${LIST_URL}`, { + method: 'GET', + query: { + id, + }, + signal, + version, + }); +}; + +const getListByIdWithValidation = async ({ + http, + signal, + id, +}: GetListByIdParams): Promise<ListSchema> => + pipe( + { + id, + }, + (payload) => fromEither(validateEither(readListSchema, payload)), + chain((payload) => tryCatch(() => getListById({ http, signal, ...payload }), toError)), + chain((response) => fromEither(validateEither(listSchema, response))), + flow(toPromise) + ); + +export { getListByIdWithValidation as getListById }; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_api/mocks/constants.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_api/mocks/constants.mock.ts new file mode 100644 index 0000000000000..b3ce62d03f486 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_api/mocks/constants.mock.ts @@ -0,0 +1,20 @@ +/* + * 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. + */ + +export const DATE_NOW = '2020-04-20T15:25:31.830Z'; +export const USER = 'some user'; +export const ELASTIC_USER = 'elastic'; +export const NAME = 'some name'; +export const DESCRIPTION = 'some description'; +export const LIST_ID = 'some-list-id'; +export const TIE_BREAKER = '6a76b69d-80df-4ab2-8c3e-85f466b06a0e'; + +export const META = {}; +export const TYPE = 'ip'; + +export const VERSION = 1; +export const IMMUTABLE = false; diff --git a/x-pack/plugins/lists/common/schemas/response/acknowledge_schema.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/acknowledge_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/response/acknowledge_schema.mock.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/acknowledge_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/response/found_list_schema.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/found_list_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/response/found_list_schema.mock.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/found_list_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/response/list_item_index_exist_schema.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/list_item_index_exist_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/response/list_item_index_exist_schema.mock.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/list_item_index_exist_schema.mock.ts diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/list_schema.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/list_schema.mock.ts new file mode 100644 index 0000000000000..b2b66ad4636c2 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_api/mocks/response/list_schema.mock.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 type { ListSchema } from '@kbn/securitysolution-io-ts-list-types'; + +import { + DATE_NOW, + DESCRIPTION, + ELASTIC_USER, + IMMUTABLE, + LIST_ID, + META, + NAME, + TIE_BREAKER, + TYPE, + USER, + VERSION, +} from '../constants.mock'; + +export const getListResponseMock = (): ListSchema => ({ + '@timestamp': DATE_NOW, + _version: undefined, + created_at: DATE_NOW, + created_by: USER, + description: DESCRIPTION, + deserializer: undefined, + id: LIST_ID, + immutable: IMMUTABLE, + meta: META, + name: NAME, + serializer: undefined, + tie_breaker_id: TIE_BREAKER, + type: TYPE, + updated_at: DATE_NOW, + updated_by: USER, + version: VERSION, +}); + +/** + * This is useful for end to end tests where we remove the auto generated parts for comparisons + * such as created_at, updated_at, and id. + */ +export const getListResponseMockWithoutAutoGeneratedValues = (): Partial<ListSchema> => ({ + created_by: ELASTIC_USER, + description: DESCRIPTION, + immutable: IMMUTABLE, + name: NAME, + type: TYPE, + updated_by: ELASTIC_USER, + version: VERSION, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_item_api/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_item_api/index.test.ts new file mode 100644 index 0000000000000..651edfe25cb18 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_item_api/index.test.ts @@ -0,0 +1,171 @@ +/* + * 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 { createListItem, deleteListItem, findListItems, patchListItem } from '.'; +import { httpServiceMock } from '@kbn/core-http-browser-mocks'; +import { + getFoundListSchemaMock, + getCreateListItemResponseMock, + getUpdatedListItemResponseMock, + getDeletedListItemResponseMock, +} from './mocks/response'; + +describe('Value list item API', () => { + let httpMock: ReturnType<typeof httpServiceMock.createStartContract>; + beforeEach(() => { + httpMock = httpServiceMock.createStartContract(); + }); + + describe('findListItems', () => { + beforeEach(() => { + httpMock.fetch.mockResolvedValue(getFoundListSchemaMock()); + }); + + it('GETs from the lists endpoint with query params', async () => { + const abortCtrl = new AbortController(); + await findListItems({ + http: httpMock, + pageIndex: 1, + pageSize: 10, + signal: abortCtrl.signal, + filter: '*:*', + listId: 'list_id', + sortField: 'updated_at', + sortOrder: 'asc', + }); + + expect(httpMock.fetch).toHaveBeenCalledWith( + '/api/lists/items/_find', + expect.objectContaining({ + method: 'GET', + query: { + cursor: undefined, + filter: '*:*', + list_id: 'list_id', + page: 1, + per_page: 10, + sort_field: 'updated_at', + sort_order: 'asc', + }, + }) + ); + }); + }); + + describe('createListItem', () => { + beforeEach(() => { + httpMock.fetch.mockResolvedValue(getCreateListItemResponseMock()); + }); + + it('POSTs to the lists endpoint with the list item', async () => { + const abortCtrl = new AbortController(); + await createListItem({ + http: httpMock, + signal: abortCtrl.signal, + value: '123', + listId: 'list_id', + }); + + expect(httpMock.fetch).toHaveBeenCalledWith( + '/api/lists/items', + expect.objectContaining({ + method: 'POST', + body: JSON.stringify({ + value: '123', + list_id: 'list_id', + }), + }) + ); + }); + + it('returns the created list item', async () => { + const abortCtrl = new AbortController(); + const result = await createListItem({ + http: httpMock, + signal: abortCtrl.signal, + value: '123', + listId: 'list_id', + }); + + expect(result).toEqual(getCreateListItemResponseMock()); + }); + }); + + describe('patchListItem', () => { + beforeEach(() => { + httpMock.fetch.mockResolvedValue(getUpdatedListItemResponseMock()); + }); + + it('PATCH to the lists endpoint with the list item', async () => { + const abortCtrl = new AbortController(); + await patchListItem({ + http: httpMock, + signal: abortCtrl.signal, + id: 'item_id', + value: '123', + }); + + expect(httpMock.fetch).toHaveBeenCalledWith( + '/api/lists/items', + expect.objectContaining({ + method: 'PATCH', + body: JSON.stringify({ + id: 'item_id', + value: '123', + }), + }) + ); + }); + + it('returns the updated list item', async () => { + const abortCtrl = new AbortController(); + const result = await patchListItem({ + http: httpMock, + signal: abortCtrl.signal, + id: 'item_id', + value: '123', + }); + + expect(result).toEqual(getUpdatedListItemResponseMock()); + }); + }); + + describe('deleteListItem', () => { + beforeEach(() => { + httpMock.fetch.mockResolvedValue(getCreateListItemResponseMock()); + }); + + it('DELETE to the lists endpoint with the list item', async () => { + const abortCtrl = new AbortController(); + await deleteListItem({ + http: httpMock, + signal: abortCtrl.signal, + id: 'item_id', + refresh: 'true', + }); + + expect(httpMock.fetch).toHaveBeenCalledWith( + '/api/lists/items', + expect.objectContaining({ + method: 'DELETE', + query: { id: 'item_id', refresh: 'true' }, + }) + ); + }); + + it('returns the deleted list item', async () => { + const abortCtrl = new AbortController(); + const result = await deleteListItem({ + http: httpMock, + signal: abortCtrl.signal, + id: 'item_id', + }); + + expect(result).toEqual(getDeletedListItemResponseMock()); + }); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_item_api/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_item_api/index.ts new file mode 100644 index 0000000000000..1605b68ee04cd --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_item_api/index.ts @@ -0,0 +1,225 @@ +/* + * 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 { + FindListItemSchema, + ListItemSchema, + deleteListItemSchema, + patchListItemSchema, + createListItemSchema, + findListItemSchema, + foundListItemSchema, + listItemSchema, + FoundListItemSchema, + DeleteListItemSchema, + PatchListItemSchema, + CreateListItemSchema, +} from '@kbn/securitysolution-io-ts-list-types'; +import { chain, fromEither, tryCatch } from 'fp-ts/lib/TaskEither'; +import { flow } from 'fp-ts/lib/function'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { validateEither } from '@kbn/securitysolution-io-ts-utils'; + +import { LIST_ITEM_URL } from '@kbn/securitysolution-list-constants'; +import { + ApiParams, + FindListItemsParams, + DeleteListItemParams, + PatchListItemParams, + CreateListItemParams, +} from '../types'; +import { toError, toPromise } from '../fp_utils'; + +const version = '2023-10-31'; + +/** + * Fetch list items + */ +const findListItems = async ({ + http, + cursor, + page, + // eslint-disable-next-line @typescript-eslint/naming-convention + list_id, + // eslint-disable-next-line @typescript-eslint/naming-convention + per_page, + signal, + // eslint-disable-next-line @typescript-eslint/naming-convention + sort_field, + // eslint-disable-next-line @typescript-eslint/naming-convention + sort_order, + filter, +}: ApiParams & FindListItemSchema): Promise<FoundListItemSchema> => { + return http.fetch(`${LIST_ITEM_URL}/_find`, { + method: 'GET', + query: { + cursor, + page, + per_page, + sort_field, + sort_order, + list_id, + filter, + }, + signal, + version, + }); +}; + +const findListItemsWithValidation = async ({ + cursor, + http, + pageIndex, + pageSize, + signal, + sortField, + sortOrder, + filter, + listId, +}: FindListItemsParams): Promise<FoundListItemSchema> => + pipe( + { + cursor: cursor != null ? cursor.toString() : undefined, + page: pageIndex != null ? pageIndex.toString() : undefined, + per_page: pageSize != null ? pageSize.toString() : undefined, + sort_field: sortField != null ? sortField.toString() : undefined, + filter: filter != null ? filter.toString() : undefined, + sort_order: sortOrder, + list_id: listId, + }, + (payload) => fromEither(validateEither(findListItemSchema, payload)), + chain((payload) => tryCatch(() => findListItems({ http, signal, ...payload }), toError)), + chain((response) => fromEither(validateEither(foundListItemSchema, response))), + flow(toPromise) + ); + +export { findListItemsWithValidation as findListItems }; + +const deleteListItem = async ({ + http, + id, + signal, + refresh, +}: ApiParams & DeleteListItemSchema): Promise<ListItemSchema> => + http.fetch<ListItemSchema>(LIST_ITEM_URL, { + method: 'DELETE', + query: { id, refresh }, + signal, + version, + }); + +const deleteListItemWithValidation = async ({ + http, + id, + signal, + refresh, +}: DeleteListItemParams): Promise<ListItemSchema> => + pipe( + { id, refresh }, + (payload) => fromEither(validateEither(deleteListItemSchema, payload)), + chain((payload) => + tryCatch( + () => + deleteListItem({ + http, + signal, + ...payload, + value: undefined, + list_id: undefined, + }), + toError + ) + ), + chain((response) => fromEither(validateEither(listItemSchema, response))), + flow(toPromise) + ); + +export { deleteListItemWithValidation as deleteListItem }; + +const patchListItem = async ({ + http, + id, + signal, + value, + _version, +}: ApiParams & PatchListItemSchema): Promise<ListItemSchema> => + http.fetch<ListItemSchema>(LIST_ITEM_URL, { + method: 'PATCH', + body: JSON.stringify({ id, value, _version }), + signal, + version, + }); + +const patchListItemWithValidation = async ({ + http, + id, + signal, + value, + refresh, + _version, +}: PatchListItemParams): Promise<ListItemSchema> => + pipe( + { id, value, _version, refresh }, + (payload) => fromEither(validateEither(patchListItemSchema, payload)), + chain((payload) => + tryCatch( + () => + patchListItem({ + http, + signal, + ...payload, + }), + toError + ) + ), + chain((response) => fromEither(validateEither(listItemSchema, response))), + flow(toPromise) + ); + +export { patchListItemWithValidation as patchListItem }; + +const createListItem = async ({ + http, + signal, + value, + // eslint-disable-next-line @typescript-eslint/naming-convention + list_id, + refresh, +}: ApiParams & CreateListItemSchema): Promise<ListItemSchema> => + http.fetch<ListItemSchema>(LIST_ITEM_URL, { + method: 'POST', + body: JSON.stringify({ value, list_id, refresh }), + signal, + version, + }); + +const createListItemWithValidation = async ({ + http, + signal, + value, + refresh, + listId, +}: CreateListItemParams): Promise<ListItemSchema> => + pipe( + { list_id: listId, value, refresh }, + (payload) => fromEither(validateEither(createListItemSchema, payload)), + chain((payload) => + tryCatch( + () => + createListItem({ + http, + signal, + ...payload, + }), + toError + ) + ), + chain((response) => fromEither(validateEither(listItemSchema, response))), + flow(toPromise) + ); + +export { createListItemWithValidation as createListItem }; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_item_api/mocks/response/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_item_api/mocks/response/index.ts new file mode 100644 index 0000000000000..2dddd844c5f23 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_item_api/mocks/response/index.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 { FoundListItemSchema, ListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; + +import { getListItemResponseMock } from './list_item_schema.mock'; + +export const getFoundListSchemaMock = (): FoundListItemSchema => ({ + cursor: '123', + data: [getListItemResponseMock()], + page: 1, + per_page: 1, + total: 1, +}); + +export const getCreateListItemResponseMock = (): ListItemSchema => getListItemResponseMock(); +export const getUpdatedListItemResponseMock = (): ListItemSchema => getListItemResponseMock(); +export const getDeletedListItemResponseMock = (): ListItemSchema => getListItemResponseMock(); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_item_api/mocks/response/list_item_schema.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_item_api/mocks/response/list_item_schema.mock.ts new file mode 100644 index 0000000000000..726f49e9d0d3f --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/list_item_api/mocks/response/list_item_schema.mock.ts @@ -0,0 +1,25 @@ +/* + * 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 { ListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; + +export const getListItemResponseMock = (): ListItemSchema => ({ + _version: '1', + '@timestamp': '2020-08-11T11:22:13.670Z', + created_at: '2020-08-11T11:22:13.670Z', + created_by: 'elastic', + deserializer: 'some deserializer', + id: 'bpdB3XMBx7pemMHopQ6M', + list_id: 'list_id', + meta: {}, + serializer: 'some serializer', + tie_breaker_id: '17d3befb-dc22-4b3c-a286-b5504c4fbeeb', + type: 'keyword', + updated_at: '2020-08-11T11:22:13.670Z', + updated_by: 'elastic', + value: 'some keyword', +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/types.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/types.ts new file mode 100644 index 0000000000000..54aa89936d73c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/types.ts @@ -0,0 +1,85 @@ +/* + * 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 { + SortFieldOrUndefined, + SortOrderOrUndefined, + Type, + Refresh, + RefreshWithWaitFor, +} from '@kbn/securitysolution-io-ts-list-types'; + +// TODO: Replace these with kbn packaged versions once we have those available to us +// These originally came from this location below before moving them to this hacked "any" types: +// import { HttpStart, NotificationsStart } from '../../../../../../../../src/core/public'; +interface HttpStart { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + fetch: <T>(...args: any) => any; +} + +export interface ApiParams { + http: HttpStart; + signal: AbortSignal; +} +export type ApiPayload<T extends ApiParams> = Omit<T, 'http' | 'signal'>; + +export interface FindListsParams extends ApiParams { + cursor?: string | undefined; + pageSize: number | undefined; + pageIndex: number | undefined; + sortOrder?: SortOrderOrUndefined; + sortField?: SortFieldOrUndefined; +} + +export interface FindListItemsParams extends ApiParams { + cursor?: string | undefined; + pageSize: number | undefined; + pageIndex: number | undefined; + sortOrder?: SortOrderOrUndefined; + sortField?: SortFieldOrUndefined; + filter: string | undefined; + listId: string; +} + +export interface ImportListParams extends ApiParams { + file: File; + listId: string | undefined; + type: Type | undefined; + refresh?: RefreshWithWaitFor; +} + +export interface DeleteListParams extends ApiParams { + deleteReferences?: boolean; + id: string; + ignoreReferences?: boolean; +} + +export interface DeleteListItemParams extends ApiParams { + refresh?: Refresh; + id: string; +} + +export interface PatchListItemParams extends ApiParams { + refresh?: Refresh; + id: string; + value: string; + _version?: string; +} + +export interface CreateListItemParams extends ApiParams { + refresh?: RefreshWithWaitFor; + value: string; + listId: string; +} + +export interface ExportListParams extends ApiParams { + listId: string; +} + +export interface GetListByIdParams extends ApiParams { + id: string; +} diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-api/tsconfig.json b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/tsconfig.json new file mode 100644 index 0000000000000..10dbca8030001 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts" + ], + "kbn_references": [ + "@kbn/securitysolution-io-ts-list-types", + "@kbn/securitysolution-io-ts-utils", + "@kbn/securitysolution-list-constants", + "@kbn/core-http-browser", + "@kbn/core-http-browser-mocks", + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/packages/kbn-securitysolution-list-constants/README.md b/x-pack/solutions/security/packages/kbn-securitysolution-list-constants/README.md similarity index 100% rename from packages/kbn-securitysolution-list-constants/README.md rename to x-pack/solutions/security/packages/kbn-securitysolution-list-constants/README.md diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-constants/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-constants/index.ts new file mode 100644 index 0000000000000..746294c8908fe --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-constants/index.ts @@ -0,0 +1,146 @@ +/* + * 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 { deepFreeze } from '@kbn/std'; + +/** + * Value list routes + */ +export const LIST_URL = '/api/lists'; +export const LIST_INDEX = `${LIST_URL}/index`; +export const LIST_ITEM_URL = `${LIST_URL}/items`; +export const LIST_PRIVILEGES_URL = `${LIST_URL}/privileges`; + +/** + * Internal value list routes + */ +export const INTERNAL_LIST_URL = '/internal/lists'; +export const INTERNAL_FIND_LISTS_BY_SIZE = `${INTERNAL_LIST_URL}/_find_lists_by_size` as const; +export const INTERNAL_EXCEPTION_FILTER = `${INTERNAL_LIST_URL}/_create_filter` as const; + +/** + * Exception list routes + */ +export const EXCEPTION_LIST_URL = '/api/exception_lists'; +export const EXCEPTION_LIST_ITEM_URL = '/api/exception_lists/items'; + +/** + * Internal exception list routes + */ +export const INTERNAL_EXCEPTION_LIST_URL = `/internal${EXCEPTION_LIST_URL}`; +export const INTERNAL_EXCEPTIONS_LIST_ENSURE_CREATED_URL = `${INTERNAL_EXCEPTION_LIST_URL}/_create`; + +/** + * Exception list spaces + */ +export const EXCEPTION_LIST_NAMESPACE_AGNOSTIC = 'exception-list-agnostic'; +export const EXCEPTION_LIST_NAMESPACE = 'exception-list'; + +/** + * Specific routes for the single global space agnostic endpoint list + */ +export const ENDPOINT_LIST_URL = '/api/endpoint_list'; + +/** + * Specific routes for the single global space agnostic endpoint list. These are convenience + * routes where they are going to try and create the global space agnostic endpoint list if it + * does not exist yet or if it was deleted at some point and re-create it before adding items to + * the list + */ +export const ENDPOINT_LIST_ITEM_URL = '/api/endpoint_list/items'; + +/** + * This ID is used for _both_ the Saved Object ID and for the list_id + * for the single global space agnostic endpoint list + */ +export const ENDPOINT_LIST_ID = 'endpoint_list'; + +/** The name of the single global space agnostic endpoint list */ +export const ENDPOINT_LIST_NAME = 'Endpoint Security Exception List'; + +/** The description of the single global space agnostic endpoint list */ +export const ENDPOINT_LIST_DESCRIPTION = 'Endpoint Security Exception List'; + +export const MAX_EXCEPTION_LIST_SIZE = 10000; + +export const MAXIMUM_SMALL_VALUE_LIST_SIZE = 65536; + +export const MAXIMUM_SMALL_IP_RANGE_VALUE_LIST_DASH_SIZE = 200; + +/** + * List definitions for Endpoint Artifact + */ +export const ENDPOINT_ARTIFACT_LISTS = deepFreeze({ + trustedApps: { + id: 'endpoint_trusted_apps', + name: 'Endpoint Security Trusted Apps List', + description: 'Endpoint Security Trusted Apps List', + }, + eventFilters: { + id: 'endpoint_event_filters', + name: 'Endpoint Security Event Filters List', + description: 'Endpoint Security Event Filters List', + }, + hostIsolationExceptions: { + id: 'endpoint_host_isolation_exceptions', + name: 'Endpoint Security Host isolation exceptions List', + description: 'Endpoint Security Host isolation exceptions List', + }, + blocklists: { + id: 'endpoint_blocklists', + name: 'Endpoint Security Blocklists List', + description: 'Endpoint Security Blocklists List', + }, +}); + +/** + * The IDs of all Endpoint artifact lists + */ +export const ENDPOINT_ARTIFACT_LIST_IDS = Object.freeze( + Object.values(ENDPOINT_ARTIFACT_LISTS).map(({ id }) => id) +); + +/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ +export const ENDPOINT_TRUSTED_APPS_LIST_ID = ENDPOINT_ARTIFACT_LISTS.trustedApps.id; + +/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ +export const ENDPOINT_TRUSTED_APPS_LIST_NAME = ENDPOINT_ARTIFACT_LISTS.trustedApps.name; + +/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ +export const ENDPOINT_TRUSTED_APPS_LIST_DESCRIPTION = + ENDPOINT_ARTIFACT_LISTS.trustedApps.description; + +/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ +export const ENDPOINT_EVENT_FILTERS_LIST_ID = ENDPOINT_ARTIFACT_LISTS.eventFilters.id; + +/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ +export const ENDPOINT_EVENT_FILTERS_LIST_NAME = ENDPOINT_ARTIFACT_LISTS.eventFilters.name; + +/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ +export const ENDPOINT_EVENT_FILTERS_LIST_DESCRIPTION = + ENDPOINT_ARTIFACT_LISTS.eventFilters.description; + +/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ +export const ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_ID = + ENDPOINT_ARTIFACT_LISTS.hostIsolationExceptions.id; + +/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ +export const ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_NAME = + ENDPOINT_ARTIFACT_LISTS.hostIsolationExceptions.name; + +/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ +export const ENDPOINT_HOST_ISOLATION_EXCEPTIONS_LIST_DESCRIPTION = + ENDPOINT_ARTIFACT_LISTS.hostIsolationExceptions.description; + +/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ +export const ENDPOINT_BLOCKLISTS_LIST_ID = ENDPOINT_ARTIFACT_LISTS.blocklists.id; + +/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ +export const ENDPOINT_BLOCKLISTS_LIST_NAME = ENDPOINT_ARTIFACT_LISTS.blocklists.name; + +/** @deprecated Use `ENDPOINT_ARTIFACT_LISTS` instead */ +export const ENDPOINT_BLOCKLISTS_LIST_DESCRIPTION = ENDPOINT_ARTIFACT_LISTS.blocklists.description; diff --git a/packages/kbn-securitysolution-list-constants/kibana.jsonc b/x-pack/solutions/security/packages/kbn-securitysolution-list-constants/kibana.jsonc similarity index 100% rename from packages/kbn-securitysolution-list-constants/kibana.jsonc rename to x-pack/solutions/security/packages/kbn-securitysolution-list-constants/kibana.jsonc diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-constants/package.json b/x-pack/solutions/security/packages/kbn-securitysolution-list-constants/package.json new file mode 100644 index 0000000000000..f57bdd68a2cc5 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-constants/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/securitysolution-list-constants", + "version": "1.0.0", + "description": "security solution list constants to use across plugins such lists, security_solution, cases, etc...", + "license": "Elastic License 2.0", + "private": true +} \ No newline at end of file diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-constants/tsconfig.json b/x-pack/solutions/security/packages/kbn-securitysolution-list-constants/tsconfig.json new file mode 100644 index 0000000000000..0d3f96d6a17b5 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-constants/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts" + ], + "kbn_references": [ + "@kbn/std" + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/packages/kbn-securitysolution-list-hooks/README.md b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/README.md similarity index 100% rename from packages/kbn-securitysolution-list-hooks/README.md rename to x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/README.md diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/index.ts new file mode 100644 index 0000000000000..8e5fdecab1863 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/index.ts @@ -0,0 +1,26 @@ +/* + * 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. + */ + +export * from './src/transforms'; +export * from './src/use_api'; +export * from './src/use_create_list_index'; +export * from './src/use_cursor'; +export * from './src/use_delete_list'; +export * from './src/use_exception_lists'; +export * from './src/use_export_list'; +export * from './src/use_find_lists'; +export * from './src/use_find_lists_by_size'; +export * from './src/use_import_list'; +export * from './src/use_persist_exception_item'; +export * from './src/use_persist_exception_list'; +export * from './src/use_read_list_index'; +export * from './src/use_read_list_privileges'; +export * from './src/use_find_list_items'; +export * from './src/use_create_list_item'; +export * from './src/use_delete_list_item'; +export * from './src/use_patch_list_item'; +export * from './src/use_get_list_by_id'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/jest.config.js b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/jest.config.js new file mode 100644 index 0000000000000..7b0430c9bf092 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/jest.config.js @@ -0,0 +1,12 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks'], +}; diff --git a/packages/kbn-securitysolution-list-hooks/kibana.jsonc b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/kibana.jsonc similarity index 100% rename from packages/kbn-securitysolution-list-hooks/kibana.jsonc rename to x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/kibana.jsonc diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/package.json b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/package.json new file mode 100644 index 0000000000000..8a2ead4291bd3 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/package.json @@ -0,0 +1,8 @@ +{ + "name": "@kbn/securitysolution-list-hooks", + "version": "1.0.0", + "description": "Security solution list ReactJS hooks", + "license": "Elastic License 2.0", + "private": true, + "sideEffects": false +} \ No newline at end of file diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/constants.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/constants.ts new file mode 100644 index 0000000000000..377c980531a4e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/constants.ts @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export const READ_INDEX_QUERY_KEY = ['detectionEngine', 'listIndex']; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/index.ts new file mode 100644 index 0000000000000..dd0e180eba269 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/index.ts @@ -0,0 +1,25 @@ +/* + * 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. + */ + +export * from './transforms'; +export * from './use_api'; +export * from './use_create_list_index'; +export * from './use_cursor'; +export * from './use_delete_list'; +export * from './use_exception_lists'; +export * from './use_export_list'; +export * from './use_find_lists'; +export * from './use_import_list'; +export * from './use_persist_exception_item'; +export * from './use_persist_exception_list'; +export * from './use_read_list_index'; +export * from './use_read_list_privileges'; +export * from './use_find_list_items'; +export * from './use_create_list_item'; +export * from './use_delete_list_item'; +export * from './use_patch_list_item'; +export * from './use_get_list_by_id'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/mocks/constants.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/mocks/constants.mock.ts new file mode 100644 index 0000000000000..762d1eb243cf7 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/mocks/constants.mock.ts @@ -0,0 +1,99 @@ +/* + * 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 { + CommentsArray, + EntriesArray, + Entry, + EntryMatch, + EntryNested, + OsTypeArray, +} from '@kbn/securitysolution-io-ts-list-types'; + +export const DATE_NOW = '2020-04-20T15:25:31.830Z'; +export const USER = 'some user'; +export const ELASTIC_USER = 'elastic'; +export const NAME = 'some name'; +export const DESCRIPTION = 'some description'; +export const LIST_ID = 'some-list-id'; +export const TIE_BREAKER = '6a76b69d-80df-4ab2-8c3e-85f466b06a0e'; + +export const META = {}; +export const TYPE = 'ip'; + +export const VERSION = 1; +export const IMMUTABLE = false; +// Exception List specific +export const ID = 'uuid_here'; +export const NAMESPACE_TYPE = 'single'; +export const OS_TYPES: OsTypeArray = ['windows']; +export const TAGS = []; +export const UPDATED_COMMENTS = [ + { + comment: 'old comment', + id: 'old_created_id', + }, + { + comment: 'new comment', + id: 'new_id', + }, +]; +export const COMMENTS = []; +export const ENTRIES: EntriesArray = [ + { + entries: [{ field: 'nested.field', operator: 'included', type: 'match', value: 'some value' }], + field: 'some.parentField', + type: 'nested', + }, + { field: 'some.not.nested.field', operator: 'included', type: 'match', value: 'some value' }, +]; +export const ITEM_ID = 'some-list-item-id'; +export const ITEM_TYPE = 'simple'; +export const LIST_ITEM_ID = 'some-list-item-id'; +// ENTRIES_WITH_IDS should only be used to mock out functionality of a collection of transforms +// that are UI specific and useful for UI concerns that are inserted between the +// API and the actual user interface. In some ways these might be viewed as +// technical debt or to compensate for the differences and preferences +// of how ReactJS might prefer data vs. how we want to model data. +export const ENTRIES_WITH_IDS: EntriesArray = [ + { + entries: [ + { + field: 'nested.field', + id: '123', + operator: 'included', + type: 'match', + value: 'some value', + } as EntryMatch & { id: string }, + ], + field: 'some.parentField', + id: '123', + type: 'nested', + } as EntryNested & { id: string }, + { + field: 'some.not.nested.field', + id: '123', + operator: 'included', + type: 'match', + value: 'some value', + } as Entry & { id: string }, +]; + +export const COMMENTS_WITH_CREATEDAT_CREATEDBY: CommentsArray = [ + { + comment: 'old comment', + id: 'old_created_id', + created_at: '2022-01-08T15:25:31.830Z', + created_by: 'elastic', + }, + { + comment: 'new comment', + id: 'new_id', + created_at: '2022-05-14T15:25:31.830Z', + created_by: 'elastic', + }, +]; diff --git a/packages/kbn-securitysolution-list-hooks/src/mocks/request/create_exception_list_item_schema.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/mocks/request/create_exception_list_item_schema.mock.ts similarity index 76% rename from packages/kbn-securitysolution-list-hooks/src/mocks/request/create_exception_list_item_schema.mock.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/mocks/request/create_exception_list_item_schema.mock.ts index 5727a271a9bf8..ff9789a7995b9 100644 --- a/packages/kbn-securitysolution-list-hooks/src/mocks/request/create_exception_list_item_schema.mock.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/mocks/request/create_exception_list_item_schema.mock.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { CreateExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/mocks/request/update_exception_list_item_schema.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/mocks/request/update_exception_list_item_schema.mock.ts new file mode 100644 index 0000000000000..47b0030c316aa --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/mocks/request/update_exception_list_item_schema.mock.ts @@ -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 type { UpdateExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; + +import { + DESCRIPTION, + ENTRIES, + ID, + ITEM_ID, + ITEM_TYPE, + LIST_ITEM_ID, + META, + NAME, + NAMESPACE_TYPE, + OS_TYPES, + TAGS, + UPDATED_COMMENTS, +} from '../constants.mock'; + +export const getUpdateExceptionListItemSchemaMock = (): UpdateExceptionListItemSchema => ({ + _version: undefined, + comments: UPDATED_COMMENTS, + description: DESCRIPTION, + entries: ENTRIES, + id: ID, + item_id: LIST_ITEM_ID, + meta: META, + name: NAME, + namespace_type: NAMESPACE_TYPE, + os_types: ['linux'], + tags: TAGS, + type: ITEM_TYPE, +}); + +/** + * Useful for end to end tests and other mechanisms which want to fill in the values + * after doing a get of the structure. + */ +export const getUpdateMinimalExceptionListItemSchemaMock = (): UpdateExceptionListItemSchema => ({ + description: DESCRIPTION, + entries: ENTRIES, + item_id: ITEM_ID, + name: NAME, + os_types: OS_TYPES, + type: ITEM_TYPE, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/mocks/response/exception_list_item_schema.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/mocks/response/exception_list_item_schema.mock.ts new file mode 100644 index 0000000000000..acb7204da9b76 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/mocks/response/exception_list_item_schema.mock.ts @@ -0,0 +1,70 @@ +/* + * 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 { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; + +import { + COMMENTS, + DATE_NOW, + DESCRIPTION, + ELASTIC_USER, + ENTRIES, + ITEM_ID, + ITEM_TYPE, + LIST_ID, + META, + NAME, + NAMESPACE_TYPE, + OS_TYPES, + TIE_BREAKER, + USER, +} from '../constants.mock'; + +export const getExceptionListItemSchemaMock = ( + overrides?: Partial<ExceptionListItemSchema> +): ExceptionListItemSchema => ({ + _version: undefined, + comments: COMMENTS, + created_at: DATE_NOW, + created_by: USER, + description: DESCRIPTION, + entries: ENTRIES, + expire_time: undefined, + id: '1', + item_id: 'endpoint_list_item', + list_id: 'endpoint_list_id', + meta: META, + name: NAME, + namespace_type: NAMESPACE_TYPE, + os_types: [], + tags: ['user added string for a tag', 'malware'], + tie_breaker_id: TIE_BREAKER, + type: ITEM_TYPE, + updated_at: DATE_NOW, + updated_by: USER, + ...(overrides || {}), +}); + +/** + * This is useful for end to end tests where we remove the auto generated parts for comparisons + * such as created_at, updated_at, and id. + */ +export const getExceptionListItemResponseMockWithoutAutoGeneratedValues = + (): Partial<ExceptionListItemSchema> => ({ + comments: [], + created_by: ELASTIC_USER, + description: DESCRIPTION, + entries: ENTRIES, + item_id: ITEM_ID, + list_id: LIST_ID, + name: NAME, + namespace_type: 'single', + os_types: OS_TYPES, + tags: [], + type: ITEM_TYPE, + updated_by: ELASTIC_USER, + }); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/mocks/response/found_list_schema.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/mocks/response/found_list_schema.mock.ts new file mode 100644 index 0000000000000..1691221842d39 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/mocks/response/found_list_schema.mock.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 type { FoundListSchema } from '@kbn/securitysolution-io-ts-list-types'; + +import { getListResponseMock } from './list_schema.mock'; + +export const getFoundListSchemaMock = (): FoundListSchema => ({ + cursor: '123', + data: [getListResponseMock()], + page: 1, + per_page: 1, + total: 1, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/mocks/response/list_schema.mock.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/mocks/response/list_schema.mock.ts new file mode 100644 index 0000000000000..b2b66ad4636c2 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/mocks/response/list_schema.mock.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 type { ListSchema } from '@kbn/securitysolution-io-ts-list-types'; + +import { + DATE_NOW, + DESCRIPTION, + ELASTIC_USER, + IMMUTABLE, + LIST_ID, + META, + NAME, + TIE_BREAKER, + TYPE, + USER, + VERSION, +} from '../constants.mock'; + +export const getListResponseMock = (): ListSchema => ({ + '@timestamp': DATE_NOW, + _version: undefined, + created_at: DATE_NOW, + created_by: USER, + description: DESCRIPTION, + deserializer: undefined, + id: LIST_ID, + immutable: IMMUTABLE, + meta: META, + name: NAME, + serializer: undefined, + tie_breaker_id: TIE_BREAKER, + type: TYPE, + updated_at: DATE_NOW, + updated_by: USER, + version: VERSION, +}); + +/** + * This is useful for end to end tests where we remove the auto generated parts for comparisons + * such as created_at, updated_at, and id. + */ +export const getListResponseMockWithoutAutoGeneratedValues = (): Partial<ListSchema> => ({ + created_by: ELASTIC_USER, + description: DESCRIPTION, + immutable: IMMUTABLE, + name: NAME, + type: TYPE, + updated_by: ELASTIC_USER, + version: VERSION, +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/transforms/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/transforms/index.test.ts new file mode 100644 index 0000000000000..dc94fcddd8498 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/transforms/index.test.ts @@ -0,0 +1,297 @@ +/* + * 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 { + CreateExceptionListItemSchema, + Entry, + EntryMatch, + EntryNested, + ExceptionListItemSchema, + UpdateExceptionListItemSchema, +} from '@kbn/securitysolution-io-ts-list-types'; +import { + addIdToExceptionItemEntries, + removeIdFromExceptionItemsEntries, + transformInput, + transformOutput, +} from '../..'; + +import { getCreateExceptionListItemSchemaMock } from '../mocks/request/create_exception_list_item_schema.mock'; +import { getUpdateExceptionListItemSchemaMock } from '../mocks/request/update_exception_list_item_schema.mock'; +import { getExceptionListItemSchemaMock } from '../mocks/response/exception_list_item_schema.mock'; +import { COMMENTS_WITH_CREATEDAT_CREATEDBY, ENTRIES_WITH_IDS } from '../mocks/constants.mock'; + +jest.mock('uuid', () => ({ + v4: jest.fn().mockReturnValue('123'), +})); + +describe('Exceptions transforms', () => { + describe('transformOutput', () => { + it('should return same output as input with stripped ids per entry - CreateExceptionListItemSchema', () => { + const mockCreateExceptionItem = { + ...getCreateExceptionListItemSchemaMock(), + entries: ENTRIES_WITH_IDS, + }; + const output = transformOutput(mockCreateExceptionItem); + const expectedOutput: CreateExceptionListItemSchema = getCreateExceptionListItemSchemaMock(); + + expect(output).toEqual(expectedOutput); + }); + + it('should return same output as input with stripped ids per entry - UpdateExceptionListItemSchema', () => { + const mockUpdateExceptionItem = { + ...getUpdateExceptionListItemSchemaMock(), + entries: ENTRIES_WITH_IDS, + }; + const output = transformOutput(mockUpdateExceptionItem); + const expectedOutput: UpdateExceptionListItemSchema = getUpdateExceptionListItemSchemaMock(); + + expect(output).toEqual(expectedOutput); + }); + it('should return output as input with stripped createdAt and createdBy per entry - UpdateExceptionListItemSchema', () => { + const mockUpdateExceptionItem = { + ...getUpdateExceptionListItemSchemaMock(), + entries: ENTRIES_WITH_IDS, + comments: COMMENTS_WITH_CREATEDAT_CREATEDBY, + }; + const output = transformOutput(mockUpdateExceptionItem); + const expectedOutput: UpdateExceptionListItemSchema = getUpdateExceptionListItemSchemaMock(); + + expect(output).toEqual(expectedOutput); + }); + }); + + describe('transformInput', () => { + it('should return same output as input with added ids per entry', () => { + const mockExceptionItem = getExceptionListItemSchemaMock(); + const output = transformInput(mockExceptionItem); + const expectedOutput: ExceptionListItemSchema = { + ...getExceptionListItemSchemaMock(), + entries: ENTRIES_WITH_IDS, + }; + + expect(output).toEqual(expectedOutput); + }); + }); + + describe('addIdToExceptionItemEntries', () => { + it('should return same output as input with added ids per entry', () => { + const mockExceptionItem: ExceptionListItemSchema = { + ...getExceptionListItemSchemaMock(), + entries: [ + { + field: 'some.not.nested.field', + operator: 'included', + type: 'match', + value: 'some value', + }, + ], + }; + const output = addIdToExceptionItemEntries(mockExceptionItem); + const expectedOutput: ExceptionListItemSchema = { + ...getExceptionListItemSchemaMock(), + entries: [ + { + field: 'some.not.nested.field', + id: '123', + operator: 'included', + type: 'match', + value: 'some value', + } as Entry & { id: string }, + ], + }; + + expect(output).toEqual(expectedOutput); + }); + + it('should return same output as input with added ids per nested entry', () => { + const mockExceptionItem: ExceptionListItemSchema = { + ...getExceptionListItemSchemaMock(), + entries: [ + { + entries: [ + { + field: 'nested.field', + operator: 'included', + type: 'match', + value: 'some value', + }, + ], + field: 'some.parentField', + type: 'nested', + }, + ], + }; + const output = addIdToExceptionItemEntries(mockExceptionItem); + const expectedOutput: ExceptionListItemSchema = { + ...getExceptionListItemSchemaMock(), + entries: [ + { + entries: [ + { + field: 'nested.field', + id: '123', + operator: 'included', + type: 'match', + value: 'some value', + } as EntryMatch & { id: string }, + ], + field: 'some.parentField', + id: '123', + type: 'nested', + } as EntryNested & { id: string }, + ], + }; + + expect(output).toEqual(expectedOutput); + }); + }); + + describe('removeIdFromExceptionItemsEntries', () => { + it('should return same output as input with stripped ids per entry - CreateExceptionListItemSchema', () => { + const mockCreateExceptionItem = { + ...getCreateExceptionListItemSchemaMock(), + entries: [ + { + field: 'some.not.nested.field', + id: '123', + operator: 'included', + type: 'match', + value: 'some value', + } as Entry & { id: string }, + ], + }; + const output = removeIdFromExceptionItemsEntries(mockCreateExceptionItem); + const expectedOutput: CreateExceptionListItemSchema = { + ...getCreateExceptionListItemSchemaMock(), + entries: [ + { + field: 'some.not.nested.field', + operator: 'included', + type: 'match', + value: 'some value', + }, + ], + }; + + expect(output).toEqual(expectedOutput); + }); + + it('should return same output as input with stripped ids per nested entry - CreateExceptionListItemSchema', () => { + const mockCreateExceptionItem = { + ...getCreateExceptionListItemSchemaMock(), + entries: [ + { + entries: [ + { + field: 'nested.field', + id: '123', + operator: 'included', + type: 'match', + value: 'some value', + } as EntryMatch & { id: string }, + ], + field: 'some.parentField', + id: '123', + type: 'nested', + } as EntryNested & { id: string }, + ], + }; + const output = removeIdFromExceptionItemsEntries(mockCreateExceptionItem); + const expectedOutput: CreateExceptionListItemSchema = { + ...getCreateExceptionListItemSchemaMock(), + entries: [ + { + entries: [ + { + field: 'nested.field', + operator: 'included', + type: 'match', + value: 'some value', + }, + ], + field: 'some.parentField', + type: 'nested', + }, + ], + }; + + expect(output).toEqual(expectedOutput); + }); + + it('should return same output as input with stripped ids per entry - UpdateExceptionListItemSchema', () => { + const mockUpdateExceptionItem = { + ...getUpdateExceptionListItemSchemaMock(), + entries: [ + { + field: 'some.not.nested.field', + id: '123', + operator: 'included', + type: 'match', + value: 'some value', + } as Entry & { id: string }, + ], + }; + const output = removeIdFromExceptionItemsEntries(mockUpdateExceptionItem); + const expectedOutput: UpdateExceptionListItemSchema = { + ...getUpdateExceptionListItemSchemaMock(), + entries: [ + { + field: 'some.not.nested.field', + operator: 'included', + type: 'match', + value: 'some value', + }, + ], + }; + + expect(output).toEqual(expectedOutput); + }); + + it('should return same output as input with stripped ids per nested entry - UpdateExceptionListItemSchema', () => { + const mockUpdateExceptionItem = { + ...getUpdateExceptionListItemSchemaMock(), + entries: [ + { + entries: [ + { + field: 'nested.field', + id: '123', + operator: 'included', + type: 'match', + value: 'some value', + } as EntryMatch & { id: string }, + ], + field: 'some.parentField', + id: '123', + type: 'nested', + } as EntryNested & { id: string }, + ], + }; + const output = removeIdFromExceptionItemsEntries(mockUpdateExceptionItem); + const expectedOutput: UpdateExceptionListItemSchema = { + ...getUpdateExceptionListItemSchemaMock(), + entries: [ + { + entries: [ + { + field: 'nested.field', + operator: 'included', + type: 'match', + value: 'some value', + }, + ], + field: 'some.parentField', + type: 'nested', + }, + ], + }; + + expect(output).toEqual(expectedOutput); + }); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/transforms/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/transforms/index.ts new file mode 100644 index 0000000000000..276c52b000af9 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/transforms/index.ts @@ -0,0 +1,136 @@ +/* + * 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 { flow } from 'fp-ts/lib/function'; +import { addIdToItem, removeIdFromItem } from '@kbn/securitysolution-utils'; +import type { + CreateExceptionListItemSchema, + EntriesArray, + Entry, + ExceptionListItemSchema, + UpdateExceptionListItemSchema, +} from '@kbn/securitysolution-io-ts-list-types'; + +// These are a collection of transforms that are UI specific and useful for UI concerns +// that are inserted between the API and the actual user interface. In some ways these +// might be viewed as technical debt or to compensate for the differences and preferences +// of how ReactJS might prefer data vs. how we want to model data. Each function should have +// a description giving context around the transform. + +/** + * Transforms the output of exception items to compensate for technical debt or UI concerns such as + * ReactJS preferences for having ids within arrays if the data is not modeled that way. + * + * If you add a new transform of the output called "myNewTransform" do it + * in the form of: + * flow(removeIdFromExceptionItemsEntries, myNewTransform)(exceptionItem) + * + * @param exceptionItem The exceptionItem to transform the output of + * @returns The exceptionItem transformed from the output + */ +export const transformOutput = ( + exceptionItem: UpdateExceptionListItemSchema | ExceptionListItemSchema +): UpdateExceptionListItemSchema | ExceptionListItemSchema => + flow( + removeCreatedAtCreatedByFromCommentsOnUpdate, + removeIdFromExceptionItemsEntries + )(exceptionItem); + +export const transformNewItemOutput = ( + exceptionItem: CreateExceptionListItemSchema +): CreateExceptionListItemSchema => flow(removeIdFromExceptionItemsEntries)(exceptionItem); + +/** + * Transforms the output of rules to compensate for technical debt or UI concerns such as + * ReactJS preferences for having ids within arrays if the data is not modeled that way. + * + * If you add a new transform of the input called "myNewTransform" do it + * in the form of: + * flow(addIdToExceptionItemEntries, myNewTransform)(exceptionItem) + * + * @param exceptionItem The exceptionItem to transform the output of + * @returns The exceptionItem transformed from the output + */ +export const transformInput = (exceptionItem: ExceptionListItemSchema): ExceptionListItemSchema => + flow(addIdToExceptionItemEntries)(exceptionItem); + +/** + * This adds an id to the incoming exception item entries as ReactJS prefers to have + * an id added to them for use as a stable id. Later if we decide to change the data + * model to have id's within the array then this code should be removed. If not, then + * this code should stay as an adapter for ReactJS. + * + * This does break the type system slightly as we are lying a bit to the type system as we return + * the same exceptionItem as we have previously but are augmenting the arrays with an id which TypeScript + * doesn't mind us doing here. However, downstream you will notice that you have an id when the type + * does not indicate it. In that case use (ExceptionItem & { id: string }) temporarily if you're using the id. If you're not, + * you can ignore the id and just use the normal TypeScript with ReactJS. + * + * @param exceptionItem The exceptionItem to add an id to the threat matches. + * @returns exceptionItem The exceptionItem but with id added to the exception item entries + */ +export const addIdToExceptionItemEntries = ( + exceptionItem: ExceptionListItemSchema +): ExceptionListItemSchema => { + const entries = exceptionItem.entries.map((entry) => { + if (entry.type === 'nested') { + return addIdToItem({ + ...entry, + entries: entry.entries.map((nestedEntry) => addIdToItem(nestedEntry)), + }); + } else { + return addIdToItem(entry); + } + }); + return { ...exceptionItem, entries }; +}; + +/** + * This removes an id from the exceptionItem entries as ReactJS prefers to have + * an id added to them for use as a stable id. Later if we decide to change the data + * model to have id's within the array then this code should be removed. If not, then + * this code should stay as an adapter for ReactJS. + * + * @param exceptionItem The exceptionItem to remove an id from the entries. + * @returns exceptionItem The exceptionItem but with id removed from the entries + */ +export const removeIdFromExceptionItemsEntries = <T extends { entries: EntriesArray }>( + exceptionItem: T +): T => { + const { entries } = exceptionItem; + const entriesNoId = entries.map((entry) => { + if (entry.type === 'nested') { + return removeIdFromItem({ + ...entry, + entries: entry.entries.map((nestedEntry) => removeIdFromItem(nestedEntry)), + }); + } else { + return removeIdFromItem<Entry>(entry); + } + }); + return { ...exceptionItem, entries: entriesNoId }; +}; + +/** + * This removes createdAt, createdBy from the exceptionItem if a comment was added to + * the Exception item, and return the comment message with id to prevent creating the commet + * twice + * @param exceptionItem The exceptionItem to remove createdAt, createdBy from the comments array. + * @returns exceptionItem The exceptionItem with comments do not have createdAt, createdBy. + */ +export const removeCreatedAtCreatedByFromCommentsOnUpdate = ( + exceptionItem: UpdateExceptionListItemSchema | ExceptionListItemSchema +) => { + const { comments } = exceptionItem; + if (!comments || !comments.length) return exceptionItem; + + const entriesNoCreatedAtAndBy = comments.map(({ comment, id }) => ({ + comment, + id, + })); + return { ...exceptionItem, comments: entriesNoCreatedAtAndBy }; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_api/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_api/index.ts new file mode 100644 index 0000000000000..673eaff90b1af --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_api/index.ts @@ -0,0 +1,315 @@ +/* + * 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 { useMemo } from 'react'; +import type { + CreateExceptionListItemSchema, + ExceptionListItemSchema, + ExceptionListSchema, + UpdateExceptionListItemSchema, + ApiCallFindListsItemsMemoProps, + ApiCallMemoProps, + ApiListExportProps, + ApiCallGetExceptionFilterFromIdsMemoProps, + ApiCallGetExceptionFilterFromExceptionsMemoProps, + ApiListDuplicateProps, +} from '@kbn/securitysolution-io-ts-list-types'; +import * as Api from '@kbn/securitysolution-list-api'; +import { getIdsAndNamespaces } from '@kbn/securitysolution-list-utils'; +import type { HttpStart } from '@kbn/core-http-browser'; + +import { transformInput, transformNewItemOutput, transformOutput } from '../transforms'; + +export interface ExceptionsApi { + addExceptionListItem: (arg: { + listItem: CreateExceptionListItemSchema; + }) => Promise<ExceptionListItemSchema>; + updateExceptionListItem: (arg: { + listItem: UpdateExceptionListItemSchema; + }) => Promise<ExceptionListItemSchema>; + deleteExceptionItem: (arg: ApiCallMemoProps) => Promise<void>; + deleteExceptionList: (arg: ApiCallMemoProps) => Promise<void>; + duplicateExceptionList: (arg: ApiListDuplicateProps) => Promise<void>; + getExceptionItem: ( + arg: ApiCallMemoProps & { onSuccess: (arg: ExceptionListItemSchema) => void } + ) => Promise<void>; + getExceptionList: ( + arg: ApiCallMemoProps & { onSuccess: (arg: ExceptionListSchema) => void } + ) => Promise<void>; + getExceptionListsItems: (arg: ApiCallFindListsItemsMemoProps) => Promise<void>; + getExceptionFilterFromIds: (arg: ApiCallGetExceptionFilterFromIdsMemoProps) => Promise<void>; + getExceptionFilterFromExceptions: ( + arg: ApiCallGetExceptionFilterFromExceptionsMemoProps + ) => Promise<void>; + exportExceptionList: (arg: ApiListExportProps) => Promise<void>; +} + +export const useApi = (http: HttpStart): ExceptionsApi => { + return useMemo( + (): ExceptionsApi => ({ + async addExceptionListItem({ + listItem, + }: { + listItem: CreateExceptionListItemSchema; + }): Promise<ExceptionListItemSchema> { + const abortCtrl = new AbortController(); + const sanitizedItem: CreateExceptionListItemSchema = transformNewItemOutput(listItem); + + return Api.addExceptionListItem({ + http, + listItem: sanitizedItem, + signal: abortCtrl.signal, + }); + }, + async deleteExceptionItem({ + id, + namespaceType, + onSuccess, + onError, + }: ApiCallMemoProps): Promise<void> { + const abortCtrl = new AbortController(); + + try { + await Api.deleteExceptionListItemById({ + http, + id, + namespaceType, + signal: abortCtrl.signal, + }); + onSuccess(); + } catch (error) { + onError(error); + } + }, + async deleteExceptionList({ + id, + namespaceType, + onSuccess, + onError, + }: ApiCallMemoProps): Promise<void> { + const abortCtrl = new AbortController(); + + try { + await Api.deleteExceptionListById({ + http, + id, + namespaceType, + signal: abortCtrl.signal, + }); + onSuccess(); + } catch (error) { + onError(error); + } + }, + async duplicateExceptionList({ + includeExpiredExceptions, + listId, + namespaceType, + onError, + onSuccess, + }: ApiListDuplicateProps): Promise<void> { + const abortCtrl = new AbortController(); + + try { + const newList = await Api.duplicateExceptionList({ + http, + includeExpiredExceptions, + listId, + namespaceType, + signal: abortCtrl.signal, + }); + onSuccess(newList); + } catch (error) { + onError(error); + } + }, + async exportExceptionList({ + id, + includeExpiredExceptions, + listId, + namespaceType, + onError, + onSuccess, + }: ApiListExportProps): Promise<void> { + const abortCtrl = new AbortController(); + + try { + const blob = await Api.exportExceptionList({ + http, + id, + includeExpiredExceptions, + listId, + namespaceType, + signal: abortCtrl.signal, + }); + onSuccess(blob); + } catch (error) { + onError(error); + } + }, + async getExceptionItem({ + id, + namespaceType, + onSuccess, + onError, + }: ApiCallMemoProps & { onSuccess: (arg: ExceptionListItemSchema) => void }): Promise<void> { + const abortCtrl = new AbortController(); + + try { + const item = transformInput( + await Api.fetchExceptionListItemById({ + http, + id, + namespaceType, + signal: abortCtrl.signal, + }) + ); + onSuccess(item); + } catch (error) { + onError(error); + } + }, + async getExceptionList({ + id, + namespaceType, + onSuccess, + onError, + }: ApiCallMemoProps & { onSuccess: (arg: ExceptionListSchema) => void }): Promise<void> { + const abortCtrl = new AbortController(); + + try { + const list = await Api.fetchExceptionListById({ + http, + id, + namespaceType, + signal: abortCtrl.signal, + }); + onSuccess(list); + } catch (error) { + onError(error); + } + }, + async getExceptionListsItems({ + lists, + filter, + pagination, + showDetectionsListsOnly, + showEndpointListsOnly, + onSuccess, + onError, + }: ApiCallFindListsItemsMemoProps): Promise<void> { + const abortCtrl = new AbortController(); + const { ids, namespaces } = getIdsAndNamespaces({ + lists, + showDetection: showDetectionsListsOnly, + showEndpoint: showEndpointListsOnly, + }); + + try { + if (ids.length > 0 && namespaces.length > 0) { + const { + data, + page, + per_page: perPage, + total, + } = await Api.fetchExceptionListsItemsByListIds({ + filter, + http, + listIds: ids, + namespaceTypes: namespaces, + pagination, + signal: abortCtrl.signal, + }); + onSuccess({ + // This data transform is UI specific and useful for UI concerns + // to compensate for the differences and preferences of how ReactJS might prefer + // data vs. how we want to model data. View `transformInput` for more details + exceptions: data.map((item) => transformInput(item)), + pagination: { + page, + perPage, + total, + }, + }); + } else { + onSuccess({ + exceptions: [], + pagination: { + page: 0, + perPage: pagination.perPage != null ? pagination.perPage : 0, + total: 0, + }, + }); + } + } catch (error) { + onError(error); + } + }, + async getExceptionFilterFromIds({ + exceptionListIds, + chunkSize, + alias, + excludeExceptions, + onSuccess, + onError, + }: ApiCallGetExceptionFilterFromIdsMemoProps): Promise<void> { + const abortCtrl = new AbortController(); + try { + const { filter } = await Api.getExceptionFilterFromExceptionListIds({ + http, + exceptionListIds, + signal: abortCtrl.signal, + chunkSize, + alias, + excludeExceptions, + }); + onSuccess(filter); + } catch (error) { + onError(error); + } + }, + async getExceptionFilterFromExceptions({ + exceptions, + chunkSize, + alias, + excludeExceptions, + onSuccess, + onError, + }: ApiCallGetExceptionFilterFromExceptionsMemoProps): Promise<void> { + const abortCtrl = new AbortController(); + try { + const { filter } = await Api.getExceptionFilterFromExceptions({ + http, + exceptions, + signal: abortCtrl.signal, + chunkSize, + alias, + excludeExceptions, + }); + onSuccess(filter); + } catch (error) { + onError(error); + } + }, + async updateExceptionListItem({ + listItem, + }: { + listItem: UpdateExceptionListItemSchema; + }): Promise<ExceptionListItemSchema> { + const abortCtrl = new AbortController(); + const sanitizedItem: UpdateExceptionListItemSchema = transformOutput(listItem); + + return Api.updateExceptionListItem({ + http, + listItem: sanitizedItem, + signal: abortCtrl.signal, + }); + }, + }), + [http] + ); +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_create_list_index/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_create_list_index/index.ts new file mode 100644 index 0000000000000..9cfaf30a9e2a4 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_create_list_index/index.ts @@ -0,0 +1,41 @@ +/* + * 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 { useMutation, useQueryClient } from '@tanstack/react-query'; + +import { createListIndex, ApiParams } from '@kbn/securitysolution-list-api'; +import { withOptionalSignal } from '@kbn/securitysolution-hook-utils'; + +import { READ_INDEX_QUERY_KEY } from '../constants'; + +const createListIndexWithOptionalSignal = withOptionalSignal(createListIndex); + +export const useCreateListIndex = ({ + http, + onError, +}: { + http: ApiParams['http']; + onError?: (err: unknown) => void; +}) => { + const queryClient = useQueryClient(); + + const { mutate, isLoading, error } = useMutation( + () => createListIndexWithOptionalSignal({ http }), + { + onSuccess: () => { + queryClient.invalidateQueries(READ_INDEX_QUERY_KEY); + }, + onError, + } + ); + + return { + start: mutate, + loading: isLoading, + error, + }; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_create_list_item/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_create_list_item/index.ts new file mode 100644 index 0000000000000..eaafc36d87334 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_create_list_item/index.ts @@ -0,0 +1,41 @@ +/* + * 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 { UseMutationOptions } from '@tanstack/react-query'; +import type { ListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; +import type { IHttpFetchError } from '@kbn/core-http-browser'; +import { useMutation } from '@tanstack/react-query'; +import { createListItem } from '@kbn/securitysolution-list-api'; +import type { CreateListItemParams } from '@kbn/securitysolution-list-api'; +import { withOptionalSignal } from '@kbn/securitysolution-hook-utils'; + +import { useInvalidateListItemQuery } from '../use_find_list_items'; + +const createListItemWithOptionalSignal = withOptionalSignal(createListItem); + +export const CREATE_LIST_ITEM_MUTATION_KEY = ['POST', 'LIST_ITEM_CREATE']; +type CreateListMutationParams = Omit<CreateListItemParams, 'refresh' | 'signal'>; + +export const useCreateListItemMutation = ( + options?: UseMutationOptions<ListItemSchema, IHttpFetchError<Error>, CreateListMutationParams> +) => { + const invalidateListItemQuery = useInvalidateListItemQuery(); + return useMutation<ListItemSchema, IHttpFetchError<Error>, CreateListMutationParams>( + ({ listId, value, http }) => + createListItemWithOptionalSignal({ listId, value, http, refresh: 'wait_for' }), + { + ...options, + mutationKey: CREATE_LIST_ITEM_MUTATION_KEY, + onSettled: (...args) => { + invalidateListItemQuery(); + if (options?.onSettled) { + options.onSettled(...args); + } + }, + } + ); +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_cursor/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_cursor/index.test.ts new file mode 100644 index 0000000000000..714c310f6d5ea --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_cursor/index.test.ts @@ -0,0 +1,119 @@ +/* + * 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 { renderHook, act } from '@testing-library/react'; + +import { UseCursorProps, useCursor } from '.'; + +describe('useCursor', () => { + it('returns undefined cursor if no values have been set', () => { + const { result } = renderHook((props: UseCursorProps) => useCursor(props), { + initialProps: { pageIndex: 0, pageSize: 0 }, + }); + + expect(result.current[0]).toBeUndefined(); + }); + + it('retrieves a cursor for the next page of a given page size', () => { + const { rerender, result } = renderHook((props: UseCursorProps) => useCursor(props), { + initialProps: { pageIndex: 0, pageSize: 0 }, + }); + rerender({ pageIndex: 1, pageSize: 1 }); + act(() => { + result.current[1]('new_cursor'); + }); + + expect(result.current[0]).toBeUndefined(); + + rerender({ pageIndex: 2, pageSize: 1 }); + expect(result.current[0]).toEqual('new_cursor'); + }); + + it('returns undefined cursor for an unknown search', () => { + const { rerender, result } = renderHook((props: UseCursorProps) => useCursor(props), { + initialProps: { pageIndex: 0, pageSize: 0 }, + }); + act(() => { + result.current[1]('new_cursor'); + }); + + rerender({ pageIndex: 1, pageSize: 2 }); + expect(result.current[0]).toBeUndefined(); + }); + + it('remembers cursor through rerenders', () => { + const { rerender, result } = renderHook((props: UseCursorProps) => useCursor(props), { + initialProps: { pageIndex: 0, pageSize: 0 }, + }); + + rerender({ pageIndex: 1, pageSize: 1 }); + act(() => { + result.current[1]('new_cursor'); + }); + + rerender({ pageIndex: 2, pageSize: 1 }); + expect(result.current[0]).toEqual('new_cursor'); + + rerender({ pageIndex: 0, pageSize: 0 }); + expect(result.current[0]).toBeUndefined(); + + rerender({ pageIndex: 2, pageSize: 1 }); + expect(result.current[0]).toEqual('new_cursor'); + }); + + it('remembers multiple cursors', () => { + const { rerender, result } = renderHook((props: UseCursorProps) => useCursor(props), { + initialProps: { pageIndex: 0, pageSize: 0 }, + }); + + rerender({ pageIndex: 1, pageSize: 1 }); + act(() => { + result.current[1]('new_cursor'); + }); + rerender({ pageIndex: 2, pageSize: 2 }); + act(() => { + result.current[1]('another_cursor'); + }); + + rerender({ pageIndex: 2, pageSize: 1 }); + expect(result.current[0]).toEqual('new_cursor'); + + rerender({ pageIndex: 3, pageSize: 2 }); + expect(result.current[0]).toEqual('another_cursor'); + }); + + it('returns the "nearest" cursor for the given page size', () => { + const { rerender, result } = renderHook((props: UseCursorProps) => useCursor(props), { + initialProps: { pageIndex: 0, pageSize: 0 }, + }); + + rerender({ pageIndex: 1, pageSize: 2 }); + act(() => { + result.current[1]('cursor1'); + }); + rerender({ pageIndex: 2, pageSize: 2 }); + act(() => { + result.current[1]('cursor2'); + }); + rerender({ pageIndex: 3, pageSize: 2 }); + act(() => { + result.current[1]('cursor3'); + }); + + rerender({ pageIndex: 2, pageSize: 2 }); + expect(result.current[0]).toEqual('cursor1'); + + rerender({ pageIndex: 3, pageSize: 2 }); + expect(result.current[0]).toEqual('cursor2'); + + rerender({ pageIndex: 4, pageSize: 2 }); + expect(result.current[0]).toEqual('cursor3'); + + rerender({ pageIndex: 6, pageSize: 2 }); + expect(result.current[0]).toEqual('cursor3'); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_cursor/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_cursor/index.ts new file mode 100644 index 0000000000000..1bc85c63363c8 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_cursor/index.ts @@ -0,0 +1,44 @@ +/* + * 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, useState } from 'react'; + +export interface UseCursorProps { + pageIndex: number; + pageSize: number; +} +type Cursor = string | undefined; +type SetCursor = (cursor: Cursor) => void; +type UseCursor = (props: UseCursorProps) => [Cursor, SetCursor]; + +const hash = (props: UseCursorProps): string => JSON.stringify(props); + +export const useCursor: UseCursor = ({ pageIndex, pageSize }) => { + const [cache, setCache] = useState<Record<string, Cursor>>({}); + + const setCursor = useCallback<SetCursor>( + (cursor) => { + setCache({ + ...cache, + [hash({ pageIndex: pageIndex + 1, pageSize })]: cursor, + }); + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [pageIndex, pageSize] + ); + + let cursor: Cursor; + for (let i = pageIndex; i >= 0; i--) { + const currentProps = { pageIndex: i, pageSize }; + cursor = cache[hash(currentProps)]; + if (cursor) { + break; + } + } + + return [cursor, setCursor]; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_delete_list/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_delete_list/index.ts new file mode 100644 index 0000000000000..ae427947ab66c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_delete_list/index.ts @@ -0,0 +1,13 @@ +/* + * 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 { deleteList } from '@kbn/securitysolution-list-api'; +import { useAsync, withOptionalSignal } from '@kbn/securitysolution-hook-utils'; + +const deleteListWithOptionalSignal = withOptionalSignal(deleteList); + +export const useDeleteList = () => useAsync(deleteListWithOptionalSignal); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_delete_list_item/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_delete_list_item/index.ts new file mode 100644 index 0000000000000..04c608f9c841f --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_delete_list_item/index.ts @@ -0,0 +1,39 @@ +/* + * 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 { UseMutationOptions } from '@tanstack/react-query'; +import type { ListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; +import { useMutation } from '@tanstack/react-query'; +import { deleteListItem } from '@kbn/securitysolution-list-api'; +import type { IHttpFetchError } from '@kbn/core-http-browser'; +import type { DeleteListItemParams } from '@kbn/securitysolution-list-api'; +import { withOptionalSignal } from '@kbn/securitysolution-hook-utils'; +import { useInvalidateListItemQuery } from '../use_find_list_items'; + +const deleteListItemWithOptionalSignal = withOptionalSignal(deleteListItem); + +export const DELETE_LIST_ITEM_MUTATION_KEY = ['POST', ' DELETE_LIST_ITEM_MUTATION']; +type DeleteListMutationParams = Omit<DeleteListItemParams, 'refresh' | 'signal'>; + +export const useDeleteListItemMutation = ( + options?: UseMutationOptions<ListItemSchema, IHttpFetchError<Error>, DeleteListMutationParams> +) => { + const invalidateListItemQuery = useInvalidateListItemQuery(); + return useMutation<ListItemSchema, IHttpFetchError<Error>, DeleteListMutationParams>( + ({ id, http }) => deleteListItemWithOptionalSignal({ id, http }), + { + ...options, + mutationKey: DELETE_LIST_ITEM_MUTATION_KEY, + onSettled: (...args) => { + invalidateListItemQuery(); + if (options?.onSettled) { + options.onSettled(...args); + } + }, + } + ); +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_exception_lists/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_exception_lists/index.ts new file mode 100644 index 0000000000000..8a8e2aadf258c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_exception_lists/index.ts @@ -0,0 +1,140 @@ +/* + * 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, useEffect, useMemo, useRef, useState } from 'react'; +import type { + ExceptionListSchema, + UseExceptionListsProps, + Pagination, + Sort, +} from '@kbn/securitysolution-io-ts-list-types'; +import { fetchExceptionLists } from '@kbn/securitysolution-list-api'; + +import { getFilters } from '@kbn/securitysolution-list-utils'; + +export type Func = () => void; +export type ReturnExceptionLists = [ + loading: boolean, + exceptionLists: ExceptionListSchema[], + pagination: Pagination, + setPagination: React.Dispatch<React.SetStateAction<Pagination>>, + fetchLists: Func | null, + sort: Sort, + setSort: React.Dispatch<React.SetStateAction<Sort>> +]; + +const DEFAULT_PAGINATION = { + page: 1, + perPage: 20, + total: 0, +}; + +const DEFAULT_SORT = { + field: 'created_at', + order: 'desc', +}; + +/** + * Hook for fetching ExceptionLists + * + * @param http Kibana http service + * @param errorMessage message shown to user if error occurs + * @param filterOptions filter by certain fields + * @param namespaceTypes spaces to be searched + * @param notifications kibana service for displaying toasters + * @param hideLists a list of listIds we don't want to query + * @param initialPagination + * + */ +export const useExceptionLists = ({ + errorMessage, + http, + initialPagination = DEFAULT_PAGINATION, + filterOptions = {}, + namespaceTypes, + notifications, + hideLists = [], + initialSort = DEFAULT_SORT, +}: UseExceptionListsProps): ReturnExceptionLists => { + const [exceptionLists, setExceptionLists] = useState<ExceptionListSchema[]>([]); + const [pagination, setPagination] = useState<Pagination>(initialPagination); + const [sort, setSort] = useState<Sort>(initialSort); + const [loading, setLoading] = useState(true); + const abortCtrlRef = useRef<AbortController>(); + + const namespaceTypesAsString = useMemo(() => namespaceTypes.join(','), [namespaceTypes]); + const filters = useMemo( + (): string => + getFilters({ + filters: filterOptions, + namespaceTypes, + hideLists, + }), + [namespaceTypes, filterOptions, hideLists] + ); + + const fetchData = useCallback(async (): Promise<void> => { + try { + setLoading(true); + + abortCtrlRef.current = new AbortController(); + + const { + page, + per_page: perPage, + total, + data, + } = await fetchExceptionLists({ + filters, + http, + namespaceTypes: namespaceTypesAsString, + pagination: { + page: pagination.page, + perPage: pagination.perPage, + }, + sort, + signal: abortCtrlRef.current.signal, + }); + + setPagination({ + page, + perPage, + total, + }); + setExceptionLists(data); + setLoading(false); + } catch (error) { + if (error.name !== 'AbortError') { + notifications.toasts.addError(error, { + title: errorMessage, + }); + setExceptionLists([]); + setPagination(DEFAULT_PAGINATION); + setLoading(false); + } + } + }, [ + errorMessage, + filters, + http, + namespaceTypesAsString, + notifications.toasts, + pagination.page, + pagination.perPage, + sort, + ]); + + useEffect(() => { + fetchData(); + + return (): void => { + abortCtrlRef.current?.abort(); + }; + }, [fetchData]); + + return [loading, exceptionLists, pagination, setPagination, fetchData, sort, setSort]; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_export_list/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_export_list/index.ts new file mode 100644 index 0000000000000..bdaec5e503615 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_export_list/index.ts @@ -0,0 +1,13 @@ +/* + * 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 { exportList } from '@kbn/securitysolution-list-api'; +import { useAsync, withOptionalSignal } from '@kbn/securitysolution-hook-utils'; + +const exportListWithOptionalSignal = withOptionalSignal(exportList); + +export const useExportList = () => useAsync(exportListWithOptionalSignal); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_find_list_items/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_find_list_items/index.ts new file mode 100644 index 0000000000000..86ed9892fa95e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_find_list_items/index.ts @@ -0,0 +1,73 @@ +/* + * 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 } from 'react'; +import { useQuery, useQueryClient } from '@tanstack/react-query'; +import { findListItems, ApiParams } from '@kbn/securitysolution-list-api'; +import { withOptionalSignal } from '@kbn/securitysolution-hook-utils'; +import { useCursor } from '../use_cursor'; + +const findListItemsWithOptionalSignal = withOptionalSignal(findListItems); + +const FIND_LIST_ITEMS_QUERY_KEY = 'FIND_LIST_ITEMS'; + +export const useInvalidateListItemQuery = () => { + const queryClient = useQueryClient(); + + return useCallback(() => { + queryClient.invalidateQueries([FIND_LIST_ITEMS_QUERY_KEY], { + refetchType: 'active', + }); + }, [queryClient]); +}; + +export const useFindListItems = ({ + pageIndex, + pageSize, + sortField, + sortOrder, + listId, + filter, + http, +}: { + pageIndex: number; + pageSize: number; + sortField: string; + sortOrder: 'asc' | 'desc'; + listId: string; + filter: string; + http: ApiParams['http']; +}) => { + const [cursor, setCursor] = useCursor({ pageIndex, pageSize }); + return useQuery( + [FIND_LIST_ITEMS_QUERY_KEY, pageIndex, pageSize, sortField, sortOrder, listId, filter], + async ({ signal }) => { + const response = await findListItemsWithOptionalSignal({ + http, + signal, + pageIndex, + pageSize, + sortField, + sortOrder, + listId, + cursor, + filter, + }); + return response; + }, + { + keepPreviousData: true, + refetchOnWindowFocus: false, + retry: false, + onSuccess: (data) => { + if (data?.cursor) { + setCursor(data?.cursor); + } + }, + } + ); +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_find_lists/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_find_lists/index.test.ts new file mode 100644 index 0000000000000..0c60b3ebebb3e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_find_lists/index.test.ts @@ -0,0 +1,37 @@ +/* + * 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 { waitFor, renderHook, act } from '@testing-library/react'; + +import { useFindLists } from '.'; +import { httpServiceMock } from '@kbn/core-http-browser-mocks'; +import * as Api from '@kbn/securitysolution-list-api'; + +import { getFoundListSchemaMock } from '../mocks/response/found_list_schema.mock'; + +jest.mock('@kbn/securitysolution-list-api'); + +describe('useFindLists', () => { + let httpMock: ReturnType<typeof httpServiceMock.createStartContract>; + + beforeEach(() => { + httpMock = httpServiceMock.createStartContract(); + (Api.findLists as jest.Mock).mockResolvedValue(getFoundListSchemaMock()); + }); + + it('invokes Api.findLists', async () => { + const { result } = renderHook(() => useFindLists()); + act(() => { + result.current.start({ http: httpMock, pageIndex: 1, pageSize: 10 }); + }); + await waitFor(() => + expect(Api.findLists).toHaveBeenCalledWith( + expect.objectContaining({ http: httpMock, pageIndex: 1, pageSize: 10 }) + ) + ); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_find_lists/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_find_lists/index.ts new file mode 100644 index 0000000000000..0ad30728be4a8 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_find_lists/index.ts @@ -0,0 +1,13 @@ +/* + * 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 { findLists } from '@kbn/securitysolution-list-api'; +import { useAsync, withOptionalSignal } from '@kbn/securitysolution-hook-utils'; + +const findListsWithOptionalSignal = withOptionalSignal(findLists); + +export const useFindLists = () => useAsync(findListsWithOptionalSignal); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_find_lists_by_size/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_find_lists_by_size/index.ts new file mode 100644 index 0000000000000..e1132bdaab293 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_find_lists_by_size/index.ts @@ -0,0 +1,13 @@ +/* + * 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 { findListsBySize } from '@kbn/securitysolution-list-api'; +import { useAsync, withOptionalSignal } from '@kbn/securitysolution-hook-utils'; + +const findListsBySizeWithOptionalSignal = withOptionalSignal(findListsBySize); + +export const useFindListsBySize = () => useAsync(findListsBySizeWithOptionalSignal); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_get_list_by_id/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_get_list_by_id/index.ts new file mode 100644 index 0000000000000..394b48352a32b --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_get_list_by_id/index.ts @@ -0,0 +1,26 @@ +/* + * 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 { getListById, ApiParams } from '@kbn/securitysolution-list-api'; +import { withOptionalSignal } from '@kbn/securitysolution-hook-utils'; + +const getListByIdWithOptionalSignal = withOptionalSignal(getListById); + +const GET_LIST_BY_ID_QUERY_KEY = 'GET_LIST_BY_ID'; +export const useGetListById = ({ http, id }: { http: ApiParams['http']; id: string }) => { + return useQuery( + [GET_LIST_BY_ID_QUERY_KEY, id], + async ({ signal }) => { + const respone = await getListByIdWithOptionalSignal({ http, signal, id }); + return respone; + }, + { + refetchOnWindowFocus: false, + } + ); +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_import_list/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_import_list/index.ts new file mode 100644 index 0000000000000..4499b7220128e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_import_list/index.ts @@ -0,0 +1,13 @@ +/* + * 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 { importList } from '@kbn/securitysolution-list-api'; +import { useAsync, withOptionalSignal } from '@kbn/securitysolution-hook-utils'; + +const importListWithOptionalSignal = withOptionalSignal(importList); + +export const useImportList = () => useAsync(importListWithOptionalSignal); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_patch_list_item/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_patch_list_item/index.ts new file mode 100644 index 0000000000000..e321006a0b687 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_patch_list_item/index.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 type { UseMutationOptions } from '@tanstack/react-query'; +import type { ListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; +import { useMutation } from '@tanstack/react-query'; +import type { PatchListItemParams } from '@kbn/securitysolution-list-api'; +import { patchListItem } from '@kbn/securitysolution-list-api'; +import type { IHttpFetchError } from '@kbn/core-http-browser'; +import { withOptionalSignal } from '@kbn/securitysolution-hook-utils'; +import { useInvalidateListItemQuery } from '../use_find_list_items'; + +const patchListItemWithOptionalSignal = withOptionalSignal(patchListItem); + +export const PATCH_LIST_ITEM_MUTATION_KEY = ['PATCH', 'LIST_ITEM_MUTATION']; +type PatchListMutationParams = Omit<PatchListItemParams, 'refresh' | 'signal'>; + +export const usePatchListItemMutation = ( + options?: UseMutationOptions<ListItemSchema, IHttpFetchError<Error>, PatchListMutationParams> +) => { + const invalidateListItemQuery = useInvalidateListItemQuery(); + return useMutation<ListItemSchema, IHttpFetchError<Error>, PatchListMutationParams>( + ({ id, value, _version, http }: PatchListMutationParams) => + patchListItemWithOptionalSignal({ id, value, http, refresh: 'true', _version }), + { + ...options, + mutationKey: PATCH_LIST_ITEM_MUTATION_KEY, + onSettled: (...args) => { + invalidateListItemQuery(); + if (options?.onSettled) { + options.onSettled(...args); + } + }, + } + ); +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.ts new file mode 100644 index 0000000000000..ad239016ed054 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.ts @@ -0,0 +1,109 @@ +/* + * 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 { Dispatch, useEffect, useRef, useState } from 'react'; +import type { + CreateExceptionListItemSchema, + PersistHookProps, + UpdateExceptionListItemSchema, +} from '@kbn/securitysolution-io-ts-list-types'; +import { addExceptionListItem, updateExceptionListItem } from '@kbn/securitysolution-list-api'; + +import { transformNewItemOutput, transformOutput } from '../transforms'; + +interface PersistReturnExceptionItem { + isLoading: boolean; + isSaved: boolean; +} + +export type ReturnPersistExceptionItem = [ + PersistReturnExceptionItem, + Dispatch<CreateExceptionListItemSchema | UpdateExceptionListItemSchema | null> +]; + +// TODO: Add this to @kbn/securitysolution-list-hooks + +/** + * Hook for creating or updating ExceptionListItem + * + * @param http Kibana http service + * @param onError error callback + * + */ +export const usePersistExceptionItem = ({ + http, + onError, +}: PersistHookProps): ReturnPersistExceptionItem => { + const [exceptionListItem, setExceptionItem] = useState< + CreateExceptionListItemSchema | UpdateExceptionListItemSchema | null + >(null); + const [isSaved, setIsSaved] = useState(false); + const [isLoading, setIsLoading] = useState(false); + const isUpdateExceptionItem = (item: unknown): item is UpdateExceptionListItemSchema => + Boolean(item && (item as UpdateExceptionListItemSchema).id != null); + const isSubscribed = useRef(false); + + useEffect(() => { + let abortCtrl: AbortController | null = null; + isSubscribed.current = true; + setIsSaved(false); + + const saveExceptionItem = async (): Promise<void> => { + if (exceptionListItem === null) { + return; + } + + try { + abortCtrl = new AbortController(); + setIsLoading(true); + + if (isUpdateExceptionItem(exceptionListItem)) { + // Please see `x-pack/solutions/security/plugins/lists/public/exceptions/transforms.ts` doc notes + // for context around the temporary `id` + const transformedList = transformOutput(exceptionListItem); + + await updateExceptionListItem({ + http, + listItem: transformedList, + signal: abortCtrl.signal, + }); + } else { + // Please see `x-pack/solutions/security/plugins/lists/public/exceptions/transforms.ts` doc notes + // for context around the temporary `id` + const transformedList = transformNewItemOutput(exceptionListItem); + + await addExceptionListItem({ + http, + listItem: transformedList, + signal: abortCtrl.signal, + }); + } + + if (isSubscribed.current) { + setIsSaved(true); + } + } catch (error) { + if (isSubscribed.current) { + onError(error); + } + } finally { + if (isSubscribed.current) { + setIsLoading(false); + } + } + }; + + saveExceptionItem(); + + return (): void => { + isSubscribed.current = false; + abortCtrl?.abort(); + }; + }, [http, exceptionListItem, onError]); + + return [{ isLoading, isSaved }, setExceptionItem]; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_list/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_list/index.ts new file mode 100644 index 0000000000000..6814a19679c57 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_list/index.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 { Dispatch, useEffect, useState } from 'react'; +import type { + AddExceptionList, + PersistHookProps, + UpdateExceptionListSchema, +} from '@kbn/securitysolution-io-ts-list-types'; +import { addExceptionList, updateExceptionList } from '@kbn/securitysolution-list-api'; + +interface PersistReturnExceptionList { + isLoading: boolean; + isSaved: boolean; +} + +export type ReturnPersistExceptionList = [ + PersistReturnExceptionList, + Dispatch<AddExceptionList | null> +]; + +/** + * Hook for creating or updating ExceptionList + * + * @param http Kibana http service + * @param onError error callback + * + */ +export const usePersistExceptionList = ({ + http, + onError, +}: PersistHookProps): ReturnPersistExceptionList => { + const [exceptionList, setExceptionList] = useState<AddExceptionList | null>(null); + const [isSaved, setIsSaved] = useState(false); + const [isLoading, setIsLoading] = useState(false); + const isUpdateExceptionList = (item: unknown): item is UpdateExceptionListSchema => + Boolean(item && (item as UpdateExceptionListSchema).id != null); + + useEffect(() => { + let isSubscribed = true; + const abortCtrl = new AbortController(); + setIsSaved(false); + + const saveExceptionList = async (): Promise<void> => { + if (exceptionList != null) { + try { + setIsLoading(true); + if (isUpdateExceptionList(exceptionList)) { + await updateExceptionList({ http, list: exceptionList, signal: abortCtrl.signal }); + } else { + await addExceptionList({ http, list: exceptionList, signal: abortCtrl.signal }); + } + if (isSubscribed) { + setIsSaved(true); + } + } catch (error) { + if (isSubscribed) { + onError(error); + } + } + if (isSubscribed) { + setIsLoading(false); + } + } + }; + + saveExceptionList(); + return (): void => { + isSubscribed = false; + abortCtrl.abort(); + }; + }, [http, exceptionList, onError]); + + return [{ isLoading, isSaved }, setExceptionList]; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_read_list_index/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_read_list_index/index.ts new file mode 100644 index 0000000000000..2bb2a7018857d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_read_list_index/index.ts @@ -0,0 +1,49 @@ +/* + * 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 { readListIndex, ApiParams } from '@kbn/securitysolution-list-api'; +import { withOptionalSignal } from '@kbn/securitysolution-hook-utils'; + +import { READ_INDEX_QUERY_KEY } from '../constants'; + +const readListIndexWithOptionalSignal = withOptionalSignal(readListIndex); + +export const useReadListIndex = ({ + http, + isEnabled, + onError, +}: { + isEnabled: boolean; + http: ApiParams['http']; + onError?: (err: unknown) => void; +}) => { + const query = useQuery( + READ_INDEX_QUERY_KEY, + async ({ signal }) => { + if (!isEnabled) { + return null; + } + + return readListIndexWithOptionalSignal({ http, signal }); + }, + { + onError, + retry: false, + refetchOnWindowFocus: false, + enabled: isEnabled, + staleTime: Infinity, + } + ); + + return { + result: query.data, + loading: query.isFetching, + error: query.error, + }; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_read_list_privileges/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_read_list_privileges/index.ts new file mode 100644 index 0000000000000..1e96118228b5d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_read_list_privileges/index.ts @@ -0,0 +1,13 @@ +/* + * 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 { readListPrivileges } from '@kbn/securitysolution-list-api'; +import { useAsync, withOptionalSignal } from '@kbn/securitysolution-hook-utils'; + +const readListPrivilegesWithOptionalSignal = withOptionalSignal(readListPrivileges); + +export const useReadListPrivileges = () => useAsync(readListPrivilegesWithOptionalSignal); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/tsconfig.json b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/tsconfig.json new file mode 100644 index 0000000000000..f2583861bced6 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/tsconfig.json @@ -0,0 +1,25 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ], + "kbn_references": [ + "@kbn/securitysolution-hook-utils", + "@kbn/securitysolution-io-ts-list-types", + "@kbn/securitysolution-list-api", + "@kbn/securitysolution-list-utils", + "@kbn/securitysolution-utils", + "@kbn/core-http-browser-mocks", + "@kbn/core-http-browser", + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/packages/kbn-securitysolution-list-utils/README.md b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/README.md similarity index 100% rename from packages/kbn-securitysolution-list-utils/README.md rename to x-pack/solutions/security/packages/kbn-securitysolution-list-utils/README.md diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/index.ts new file mode 100644 index 0000000000000..cd6928dd89e34 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/index.ts @@ -0,0 +1,17 @@ +/* + * 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. + */ + +export * from './src/autocomplete_operators'; +export * from './src/get_exception_list_type'; +export * from './src/get_filters'; +export * from './src/get_general_filters'; +export * from './src/get_ids_and_namespaces'; +export * from './src/get_saved_object_type'; +export * from './src/get_saved_object_types'; +export * from './src/has_large_value_list'; +export * from './src/helpers'; +export * from './src/types'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/jest.config.js b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/jest.config.js new file mode 100644 index 0000000000000..e3fc2abb342ab --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/jest.config.js @@ -0,0 +1,12 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/packages/kbn-securitysolution-list-utils'], +}; diff --git a/packages/kbn-securitysolution-list-utils/kibana.jsonc b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/kibana.jsonc similarity index 100% rename from packages/kbn-securitysolution-list-utils/kibana.jsonc rename to x-pack/solutions/security/packages/kbn-securitysolution-list-utils/kibana.jsonc diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/package.json b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/package.json new file mode 100644 index 0000000000000..585acd8e3d70c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/package.json @@ -0,0 +1,8 @@ +{ + "name": "@kbn/securitysolution-list-utils", + "version": "1.0.0", + "description": "security solution list utilities", + "license": "Elastic License 2.0", + "private": true, + "sideEffects": false +} \ No newline at end of file diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts new file mode 100644 index 0000000000000..430a0dbc3a1d8 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/autocomplete_operators/index.ts @@ -0,0 +1,158 @@ +/* + * 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 { + ListOperatorEnum as OperatorEnum, + ListOperatorTypeEnum as OperatorTypeEnum, +} from '@kbn/securitysolution-io-ts-list-types'; +import { OperatorOption } from '../types'; + +export const isOperator: OperatorOption = { + message: i18n.translate('lists.exceptions.isOperatorLabel', { + defaultMessage: 'is', + }), + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH, + value: 'is', +}; + +export const isNotOperator: OperatorOption = { + message: i18n.translate('lists.exceptions.isNotOperatorLabel', { + defaultMessage: 'is not', + }), + operator: OperatorEnum.EXCLUDED, + type: OperatorTypeEnum.MATCH, + value: 'is_not', +}; + +export const isOneOfOperator: OperatorOption = { + message: i18n.translate('lists.exceptions.isOneOfOperatorLabel', { + defaultMessage: 'is one of', + }), + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH_ANY, + value: 'is_one_of', +}; + +export const isNotOneOfOperator: OperatorOption = { + message: i18n.translate('lists.exceptions.isNotOneOfOperatorLabel', { + defaultMessage: 'is not one of', + }), + operator: OperatorEnum.EXCLUDED, + type: OperatorTypeEnum.MATCH_ANY, + value: 'is_not_one_of', +}; + +export const existsOperator: OperatorOption = { + message: i18n.translate('lists.exceptions.existsOperatorLabel', { + defaultMessage: 'exists', + }), + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.EXISTS, + value: 'exists', +}; + +export const doesNotExistOperator: OperatorOption = { + message: i18n.translate('lists.exceptions.doesNotExistOperatorLabel', { + defaultMessage: 'does not exist', + }), + operator: OperatorEnum.EXCLUDED, + type: OperatorTypeEnum.EXISTS, + value: 'does_not_exist', +}; + +export const isInListOperator: OperatorOption = { + message: i18n.translate('lists.exceptions.isInListOperatorLabel', { + defaultMessage: 'is in list', + }), + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.LIST, + value: 'is_in_list', +}; + +export const isNotInListOperator: OperatorOption = { + message: i18n.translate('lists.exceptions.isNotInListOperatorLabel', { + defaultMessage: 'is not in list', + }), + operator: OperatorEnum.EXCLUDED, + type: OperatorTypeEnum.LIST, + value: 'is_not_in_list', +}; + +export const matchesOperator: OperatorOption = { + message: i18n.translate('lists.exceptions.matchesOperatorLabel', { + defaultMessage: 'matches', + }), + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.WILDCARD, + value: 'matches', +}; + +export const doesNotMatchOperator: OperatorOption = { + message: i18n.translate('lists.exceptions.doesNotMatchOperatorLabel', { + defaultMessage: 'does not match', + }), + operator: OperatorEnum.EXCLUDED, + type: OperatorTypeEnum.WILDCARD, + value: 'does_not_match', +}; + +export const EVENT_FILTERS_OPERATORS: OperatorOption[] = [ + isOperator, + isNotOperator, + isOneOfOperator, + isNotOneOfOperator, + matchesOperator, + doesNotMatchOperator, +]; + +/* + * !IMPORTANT! - Please only add to this list if it is an operator + * supported by the detection engine. + */ +export const DETECTION_ENGINE_EXCEPTION_OPERATORS: OperatorOption[] = [ + isOperator, + isNotOperator, + isOneOfOperator, + isNotOneOfOperator, + existsOperator, + doesNotExistOperator, + isInListOperator, + isNotInListOperator, + matchesOperator, + doesNotMatchOperator, +]; + +export const ALL_OPERATORS: OperatorOption[] = [ + isOperator, + isNotOperator, + isOneOfOperator, + isNotOneOfOperator, + existsOperator, + doesNotExistOperator, + isInListOperator, + isNotInListOperator, + matchesOperator, + doesNotMatchOperator, +]; + +export const EXCEPTION_OPERATORS_SANS_LISTS: OperatorOption[] = [ + isOperator, + isNotOperator, + isOneOfOperator, + isNotOneOfOperator, + existsOperator, + doesNotExistOperator, + matchesOperator, + doesNotMatchOperator, +]; + +export const EXCEPTION_OPERATORS_ONLY_LISTS: OperatorOption[] = [ + isInListOperator, + isNotInListOperator, +]; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_exception_list_type/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_exception_list_type/index.ts new file mode 100644 index 0000000000000..29dba94f76761 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_exception_list_type/index.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 { NamespaceType } from '@kbn/securitysolution-io-ts-list-types'; + +import { exceptionListAgnosticSavedObjectType } from '../types'; + +export const getExceptionListType = ({ + savedObjectType, +}: { + savedObjectType: string; +}): NamespaceType => { + if (savedObjectType === exceptionListAgnosticSavedObjectType) { + return 'agnostic'; + } else { + return 'single'; + } +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_filters/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_filters/index.test.ts new file mode 100644 index 0000000000000..a88a78479cf54 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_filters/index.test.ts @@ -0,0 +1,207 @@ +/* + * 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 { getFilters } from '.'; + +describe('getFilters', () => { + describe('single', () => { + test('it properly formats when no filters and hide lists contains few list ids', () => { + const filter = getFilters({ + filters: {}, + namespaceTypes: ['single'], + hideLists: ['listId-1', 'listId-2', 'listId-3'], + }); + + expect(filter).toEqual( + '(not exception-list.attributes.list_id: listId-1*) AND (not exception-list.attributes.list_id: listId-2*) AND (not exception-list.attributes.list_id: listId-3*)' + ); + }); + test('it properly formats when no filters and hide lists contains one list id', () => { + const filter = getFilters({ + filters: {}, + namespaceTypes: ['single'], + hideLists: ['listId-1'], + }); + + expect(filter).toEqual('(not exception-list.attributes.list_id: listId-1*)'); + }); + test('it properly formats when no filters and no hide lists', () => { + const filter = getFilters({ + filters: {}, + namespaceTypes: ['single'], + hideLists: [], + }); + + expect(filter).toEqual(''); + }); + test('it properly formats when filters passed and hide lists contains few list ids', () => { + const filter = getFilters({ + filters: { created_by: 'moi', name: 'Sample' }, + namespaceTypes: ['single'], + hideLists: ['listId-1', 'listId-2', 'listId-3'], + }); + + expect(filter).toEqual( + '(exception-list.attributes.created_by:moi) AND (exception-list.attributes.name.text:Sample) AND (not exception-list.attributes.list_id: listId-1*) AND (not exception-list.attributes.list_id: listId-2*) AND (not exception-list.attributes.list_id: listId-3*)' + ); + }); + test('it properly formats when filters passed and hide lists contains one list id', () => { + const filter = getFilters({ + filters: { created_by: 'moi', name: 'Sample' }, + namespaceTypes: ['single'], + hideLists: ['listId-1'], + }); + + expect(filter).toEqual( + '(exception-list.attributes.created_by:moi) AND (exception-list.attributes.name.text:Sample) AND (not exception-list.attributes.list_id: listId-1*)' + ); + }); + test('it properly formats when filters passed and no hide lists', () => { + const filter = getFilters({ + filters: { created_by: 'moi', name: 'Sample' }, + namespaceTypes: ['single'], + hideLists: [], + }); + + expect(filter).toEqual( + '(exception-list.attributes.created_by:moi) AND (exception-list.attributes.name.text:Sample)' + ); + }); + }); + + describe('agnostic', () => { + test('it properly formats when no filters and hide lists contains few list ids', () => { + const filter = getFilters({ + filters: {}, + namespaceTypes: ['agnostic'], + hideLists: ['listId-1', 'listId-2', 'listId-3'], + }); + + expect(filter).toEqual( + '(not exception-list-agnostic.attributes.list_id: listId-1*) AND (not exception-list-agnostic.attributes.list_id: listId-2*) AND (not exception-list-agnostic.attributes.list_id: listId-3*)' + ); + }); + test('it properly formats when no filters and hide lists contains one list id', () => { + const filter = getFilters({ + filters: {}, + namespaceTypes: ['agnostic'], + hideLists: ['listId-1'], + }); + + expect(filter).toEqual('(not exception-list-agnostic.attributes.list_id: listId-1*)'); + }); + test('it properly formats when no filters and no hide lists', () => { + const filter = getFilters({ + filters: {}, + namespaceTypes: ['agnostic'], + hideLists: [], + }); + + expect(filter).toEqual(''); + }); + test('it properly formats when filters passed and hide lists contains few list ids', () => { + const filter = getFilters({ + filters: { created_by: 'moi', name: 'Sample' }, + namespaceTypes: ['agnostic'], + hideLists: ['listId-1', 'listId-2', 'listId-3'], + }); + + expect(filter).toEqual( + '(exception-list-agnostic.attributes.created_by:moi) AND (exception-list-agnostic.attributes.name.text:Sample) AND (not exception-list-agnostic.attributes.list_id: listId-1*) AND (not exception-list-agnostic.attributes.list_id: listId-2*) AND (not exception-list-agnostic.attributes.list_id: listId-3*)' + ); + }); + test('it properly formats when filters passed and hide lists contains one list id', () => { + const filter = getFilters({ + filters: { created_by: 'moi', name: 'Sample' }, + namespaceTypes: ['agnostic'], + hideLists: ['listId-1'], + }); + + expect(filter).toEqual( + '(exception-list-agnostic.attributes.created_by:moi) AND (exception-list-agnostic.attributes.name.text:Sample) AND (not exception-list-agnostic.attributes.list_id: listId-1*)' + ); + }); + test('it properly formats when filters passed and no hide lists', () => { + const filter = getFilters({ + filters: { created_by: 'moi', name: 'Sample' }, + namespaceTypes: ['agnostic'], + hideLists: [], + }); + + expect(filter).toEqual( + '(exception-list-agnostic.attributes.created_by:moi) AND (exception-list-agnostic.attributes.name.text:Sample)' + ); + }); + }); + + describe('single, agnostic', () => { + test('it properly formats when no filters and hide lists contains few list ids', () => { + const filter = getFilters({ + filters: {}, + namespaceTypes: ['single', 'agnostic'], + hideLists: ['listId-1', 'listId-2', 'listId-3'], + }); + + expect(filter).toEqual( + '(not exception-list.attributes.list_id: listId-1* AND not exception-list-agnostic.attributes.list_id: listId-1*) AND (not exception-list.attributes.list_id: listId-2* AND not exception-list-agnostic.attributes.list_id: listId-2*) AND (not exception-list.attributes.list_id: listId-3* AND not exception-list-agnostic.attributes.list_id: listId-3*)' + ); + }); + test('it properly formats when no filters and hide lists contains one list id', () => { + const filter = getFilters({ + filters: {}, + namespaceTypes: ['single', 'agnostic'], + hideLists: ['listId-1'], + }); + + expect(filter).toEqual( + '(not exception-list.attributes.list_id: listId-1* AND not exception-list-agnostic.attributes.list_id: listId-1*)' + ); + }); + test('it properly formats when no filters and no hide lists', () => { + const filter = getFilters({ + filters: {}, + namespaceTypes: ['single', 'agnostic'], + hideLists: [], + }); + + expect(filter).toEqual(''); + }); + test('it properly formats when filters passed and hide lists contains few list ids', () => { + const filter = getFilters({ + filters: { created_by: 'moi', name: 'Sample' }, + namespaceTypes: ['single', 'agnostic'], + hideLists: ['listId-1', 'listId-2', 'listId-3'], + }); + + expect(filter).toEqual( + '(exception-list.attributes.created_by:moi OR exception-list-agnostic.attributes.created_by:moi) AND (exception-list.attributes.name.text:Sample OR exception-list-agnostic.attributes.name.text:Sample) AND (not exception-list.attributes.list_id: listId-1* AND not exception-list-agnostic.attributes.list_id: listId-1*) AND (not exception-list.attributes.list_id: listId-2* AND not exception-list-agnostic.attributes.list_id: listId-2*) AND (not exception-list.attributes.list_id: listId-3* AND not exception-list-agnostic.attributes.list_id: listId-3*)' + ); + }); + test('it properly formats when filters passed and hide lists contains one list id', () => { + const filter = getFilters({ + filters: { created_by: 'moi', name: 'Sample' }, + namespaceTypes: ['single', 'agnostic'], + hideLists: ['listId-1'], + }); + + expect(filter).toEqual( + '(exception-list.attributes.created_by:moi OR exception-list-agnostic.attributes.created_by:moi) AND (exception-list.attributes.name.text:Sample OR exception-list-agnostic.attributes.name.text:Sample) AND (not exception-list.attributes.list_id: listId-1* AND not exception-list-agnostic.attributes.list_id: listId-1*)' + ); + }); + test('it properly formats when filters passed and no hide lists', () => { + const filter = getFilters({ + filters: { created_by: 'moi', name: 'Sample' }, + namespaceTypes: ['single', 'agnostic'], + hideLists: [], + }); + + expect(filter).toEqual( + '(exception-list.attributes.created_by:moi OR exception-list-agnostic.attributes.created_by:moi) AND (exception-list.attributes.name.text:Sample OR exception-list-agnostic.attributes.name.text:Sample)' + ); + }); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_filters/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_filters/index.ts new file mode 100644 index 0000000000000..2bc7960de7927 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_filters/index.ts @@ -0,0 +1,30 @@ +/* + * 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 { ExceptionListFilter, NamespaceType } from '@kbn/securitysolution-io-ts-list-types'; +import { getGeneralFilters } from '../get_general_filters'; +import { getSavedObjectTypes } from '../get_saved_object_types'; +export interface GetFiltersParams { + filters: ExceptionListFilter; + namespaceTypes: NamespaceType[]; + hideLists: readonly string[]; +} + +export const getFilters = ({ filters, namespaceTypes, hideLists }: GetFiltersParams): string => { + const namespaces = getSavedObjectTypes({ namespaceType: namespaceTypes }); + const generalFilters = getGeneralFilters(filters, namespaces); + const hideListsFilters = hideLists.map((listId) => { + const filtersByNamespace = namespaces.map((namespace) => { + return `not ${namespace}.attributes.list_id: ${listId}*`; + }); + return `(${filtersByNamespace.join(' AND ')})`; + }); + + return [generalFilters, ...hideListsFilters] + .filter((filter) => filter.trim() !== '') + .join(' AND '); +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_general_filters/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_general_filters/index.test.ts new file mode 100644 index 0000000000000..0262023497634 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_general_filters/index.test.ts @@ -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 { ExceptionListTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; +import { getGeneralFilters } from '.'; + +describe('getGeneralFilters', () => { + test('it returns empty string if no filters', () => { + const filters = getGeneralFilters({}, ['exception-list']); + + expect(filters).toEqual(''); + }); + + test('it properly formats filters when one namespace type passed in', () => { + const filters = getGeneralFilters({ created_by: 'moi', name: 'Sample' }, ['exception-list']); + + expect(filters).toEqual( + '(exception-list.attributes.created_by:moi) AND (exception-list.attributes.name.text:Sample)' + ); + }); + + test('it properly formats filters when two namespace types passed in', () => { + const filters = getGeneralFilters({ created_by: 'moi', name: 'Sample' }, [ + 'exception-list', + 'exception-list-agnostic', + ]); + + expect(filters).toEqual( + '(exception-list.attributes.created_by:moi OR exception-list-agnostic.attributes.created_by:moi) AND (exception-list.attributes.name.text:Sample OR exception-list-agnostic.attributes.name.text:Sample)' + ); + }); + + test('it properly formats filters when two types are passed in', () => { + const filters = getGeneralFilters( + { + created_by: 'moi', + name: 'Sample', + types: [ExceptionListTypeEnum.DETECTION, ExceptionListTypeEnum.RULE_DEFAULT], + }, + ['exception-list', 'exception-list-agnostic'] + ); + + expect(filters).toEqual( + '(exception-list.attributes.created_by:moi OR exception-list-agnostic.attributes.created_by:moi) AND (exception-list.attributes.name.text:Sample OR exception-list-agnostic.attributes.name.text:Sample) AND (exception-list.attributes.type:detection OR exception-list.attributes.type:rule_default OR exception-list-agnostic.attributes.type:detection OR exception-list-agnostic.attributes.type:rule_default)' + ); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_general_filters/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_general_filters/index.ts new file mode 100644 index 0000000000000..7960617fad485 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_general_filters/index.ts @@ -0,0 +1,35 @@ +/* + * 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 { ExceptionListFilter } from '@kbn/securitysolution-io-ts-list-types'; +import { isArray } from 'lodash'; +import { get } from 'lodash/fp'; +import { SavedObjectType } from '../types'; + +export const getGeneralFilters = ( + filters: ExceptionListFilter, + namespaceTypes: SavedObjectType[] +): string => { + return Object.keys(filters) + .map((filterKey) => { + const value = get(filterKey, filters); + if (isArray(value) || (value != null && value.trim() !== '')) { + const filtersByNamespace = namespaceTypes + .map((namespace) => { + const fieldToSearch = + filterKey === 'name' ? 'name.text' : filterKey === 'types' ? 'type' : filterKey; + return isArray(value) + ? value.map((val) => `${namespace}.attributes.${fieldToSearch}:${val}`).join(' OR ') + : `${namespace}.attributes.${fieldToSearch}:${value}`; + }) + .join(' OR '); + return `(${filtersByNamespace})`; + } else return null; + }) + .filter((item) => item != null) + .join(' AND '); +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_ids_and_namespaces/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_ids_and_namespaces/index.test.ts new file mode 100644 index 0000000000000..b76bc2df94ff8 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_ids_and_namespaces/index.test.ts @@ -0,0 +1,104 @@ +/* + * 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 { getIdsAndNamespaces } from '.'; + +describe('getIdsAndNamespaces', () => { + test('it returns empty arrays if no lists found', async () => { + const output = getIdsAndNamespaces({ + lists: [], + showDetection: false, + showEndpoint: false, + }); + + expect(output).toEqual({ ids: [], namespaces: [] }); + }); + + test('it returns all lists if "showDetection" and "showEndpoint" are "false"', async () => { + const output = getIdsAndNamespaces({ + lists: [ + { id: 'myListId', listId: 'list_id', namespaceType: 'single', type: 'detection' }, + { + id: 'myListIdEndpoint', + listId: 'list_id_endpoint', + namespaceType: 'agnostic', + type: 'endpoint', + }, + ], + showDetection: false, + showEndpoint: false, + }); + + expect(output).toEqual({ + ids: ['list_id', 'list_id_endpoint'], + namespaces: ['single', 'agnostic'], + }); + }); + + test('it returns only detections lists if "showDetection" is "true"', async () => { + const output = getIdsAndNamespaces({ + lists: [ + { id: 'myListId', listId: 'list_id', namespaceType: 'single', type: 'detection' }, + { + id: 'myListIdEndpoint', + listId: 'list_id_endpoint', + namespaceType: 'agnostic', + type: 'endpoint', + }, + ], + showDetection: true, + showEndpoint: false, + }); + + expect(output).toEqual({ + ids: ['list_id'], + namespaces: ['single'], + }); + }); + + test('it returns only endpoint lists if "showEndpoint" is "true"', async () => { + const output = getIdsAndNamespaces({ + lists: [ + { id: 'myListId', listId: 'list_id', namespaceType: 'single', type: 'detection' }, + { + id: 'myListIdEndpoint', + listId: 'list_id_endpoint', + namespaceType: 'agnostic', + type: 'endpoint', + }, + ], + showDetection: false, + showEndpoint: true, + }); + + expect(output).toEqual({ + ids: ['list_id_endpoint'], + namespaces: ['agnostic'], + }); + }); + + test('it returns only detection lists if both "showEndpoint" and "showDetection" are "true"', async () => { + const output = getIdsAndNamespaces({ + lists: [ + { id: 'myListId', listId: 'list_id', namespaceType: 'single', type: 'detection' }, + { + id: 'myListIdEndpoint', + listId: 'list_id_endpoint', + namespaceType: 'agnostic', + type: 'endpoint', + }, + ], + showDetection: true, + showEndpoint: true, + }); + + expect(output).toEqual({ + ids: ['list_id'], + namespaces: ['single'], + }); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_ids_and_namespaces/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_ids_and_namespaces/index.ts new file mode 100644 index 0000000000000..25a7ae1931e18 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_ids_and_namespaces/index.ts @@ -0,0 +1,35 @@ +/* + * 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 { ExceptionListIdentifiers, NamespaceType } from '@kbn/securitysolution-io-ts-list-types'; + +export const getIdsAndNamespaces = ({ + lists, + showDetection, + showEndpoint, +}: { + lists: ExceptionListIdentifiers[]; + showDetection: boolean; + showEndpoint: boolean; +}): { ids: string[]; namespaces: NamespaceType[] } => + lists + .filter((list) => { + if (showDetection) { + return list.type === 'detection'; + } else if (showEndpoint) { + return list.type === 'endpoint'; + } else { + return true; + } + }) + .reduce<{ ids: string[]; namespaces: NamespaceType[] }>( + (acc, { listId, namespaceType }) => ({ + ids: [...acc.ids, listId], + namespaces: [...acc.namespaces, namespaceType], + }), + { ids: [], namespaces: [] } + ); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_saved_object_type/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_saved_object_type/index.ts new file mode 100644 index 0000000000000..0ee1b134333ca --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_saved_object_type/index.ts @@ -0,0 +1,26 @@ +/* + * 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 { NamespaceType } from '@kbn/securitysolution-io-ts-list-types'; + +import { + exceptionListAgnosticSavedObjectType, + exceptionListSavedObjectType, + SavedObjectType, +} from '../types'; + +export const getSavedObjectType = ({ + namespaceType, +}: { + namespaceType: NamespaceType; +}): SavedObjectType => { + if (namespaceType === 'agnostic') { + return exceptionListAgnosticSavedObjectType; + } else { + return exceptionListSavedObjectType; + } +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_saved_object_types/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_saved_object_types/index.ts new file mode 100644 index 0000000000000..92b6ff4a92631 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/get_saved_object_types/index.ts @@ -0,0 +1,21 @@ +/* + * 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 { NamespaceTypeArray } from '@kbn/securitysolution-io-ts-list-types'; + +import { SavedObjectType } from '../types'; +import { getSavedObjectType } from '../get_saved_object_type'; + +export const getSavedObjectTypes = ({ + namespaceType, +}: { + namespaceType: NamespaceTypeArray; +}): SavedObjectType[] => { + return namespaceType.map((singleNamespaceType) => + getSavedObjectType({ namespaceType: singleNamespaceType }) + ); +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/has_large_value_list/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/has_large_value_list/index.ts new file mode 100644 index 0000000000000..350cb581153b5 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/has_large_value_list/index.ts @@ -0,0 +1,13 @@ +/* + * 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 { EntriesArray } from '@kbn/securitysolution-io-ts-list-types'; + +export const hasLargeValueList = (entries: EntriesArray): boolean => { + const found = entries.filter(({ type }) => type === 'list'); + return found.length > 0; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/helpers/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/helpers/index.test.ts new file mode 100644 index 0000000000000..fe75ad88e0129 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/helpers/index.test.ts @@ -0,0 +1,375 @@ +/* + * 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 { + getMappingConflictsInfo, + fieldSupportsMatches, + hasWrongOperatorWithWildcard, + hasPartialCodeSignatureEntry, +} from '.'; + +describe('Helpers', () => { + describe('getMappingConflictsInfo', () => { + test('it return null if there are not conflicts', () => { + const field = { + name: 'field1', + type: 'string', + }; + const conflictsInfo = getMappingConflictsInfo(field); + + expect(conflictsInfo).toBeNull(); + }); + test('it groups ".ds-" data stream indices', () => { + const field = { + name: 'field1', + type: 'conflict', + conflictDescriptions: { + text: [ + '.ds-logs-default-2023.01.18-000001', + '.ds-logs-default-2023.01.18-000002', + '.ds-logs-tortilla.process-default-2022.11.20-000011', + '.ds-logs-tortilla.process-default-2022.11.20-000012', + '.ds-logs-tortilla.process-default-2022.11.20-000016', + ], + long: [ + '.ds-logs-default-2023.01.18-000004', + '.ds-logs-default-2023.01.18-000005', + 'partial-.ds-logs-gcp.audit-2021.12.22-000240', + 'partial-.ds-logs-gcp.audit-2021.12.22-000242', + ], + }, + }; + const conflictsInfo = getMappingConflictsInfo(field); + + expect(conflictsInfo).toEqual([ + { + type: 'text', + totalIndexCount: 5, + groupedIndices: [ + { name: 'logs-tortilla.process-default', count: 3 }, + { name: 'logs-default', count: 2 }, + ], + }, + { + type: 'long', + totalIndexCount: 4, + groupedIndices: [ + { name: 'logs-default', count: 2 }, + { name: 'logs-gcp.audit', count: 2 }, + ], + }, + ]); + }); + test('it groups old ".siem-" indices', () => { + const field = { + name: 'field1', + type: 'conflict', + conflictDescriptions: { + text: [ + '.siem-signals-default-000001', + '.siem-signals-default-000002', + '.siem-signals-default-000011', + '.siem-signals-default-000012', + ], + unmapped: [ + '.siem-signals-default-000004', + '.siem-signals-default-000005', + '.siem-signals-default-000240', + ], + }, + }; + const conflictsInfo = getMappingConflictsInfo(field); + + expect(conflictsInfo).toEqual([ + { + type: 'text', + totalIndexCount: 4, + groupedIndices: [{ name: '.siem-signals-default', count: 4 }], + }, + { + type: 'unmapped', + totalIndexCount: 3, + groupedIndices: [{ name: '.siem-signals-default', count: 3 }], + }, + ]); + }); + test('it groups mixed indices', () => { + const field = { + name: 'field1', + type: 'conflict', + conflictDescriptions: { + boolean: [ + '.ds-logs-default-2023.01.18-000001', + '.ds-logs-tortilla.process-default-2022.11.20-000011', + '.ds-logs-tortilla.process-default-2022.11.20-000012', + '.ds-logs-tortilla.process-default-2022.11.20-000016', + '.siem-signals-default-000001', + '.siem-signals-default-000002', + '.siem-signals-default-000012', + 'my-own-index-1', + 'my-own-index-2', + ], + unmapped: [ + '.siem-signals-default-000004', + 'partial-.ds-logs-gcp.audit-2021.12.22-000240', + 'partial-.ds-logs-gcp.audit-2021.12.22-000242', + 'my-own-index-3', + ], + }, + }; + const conflictsInfo = getMappingConflictsInfo(field); + + expect(conflictsInfo).toEqual([ + { + type: 'boolean', + totalIndexCount: 9, + groupedIndices: [ + { name: 'logs-tortilla.process-default', count: 3 }, + { name: '.siem-signals-default', count: 3 }, + { name: 'logs-default', count: 1 }, + { name: 'my-own-index-1', count: 1 }, + { name: 'my-own-index-2', count: 1 }, + ], + }, + { + type: 'unmapped', + totalIndexCount: 4, + groupedIndices: [ + { name: 'logs-gcp.audit', count: 2 }, + { name: '.siem-signals-default', count: 1 }, + { name: 'my-own-index-3', count: 1 }, + ], + }, + ]); + }); + }); + + describe('fieldSupportsMatches', () => { + test('it returns true if esTypes is keyword', () => { + expect( + fieldSupportsMatches({ name: 'field', type: 'conflict', esTypes: ['keyword'] }) + ).toBeTruthy(); + }); + + test('it returns true if one of the esTypes is kibana type string and another is not', () => { + expect( + fieldSupportsMatches({ name: 'field', type: 'conflict', esTypes: ['keyword', 'object'] }) + ).toBeTruthy(); + }); + + test('it returns true if one of the esTypes is keyword', () => { + expect( + fieldSupportsMatches({ name: 'field', type: 'conflict', esTypes: ['keyword', 'unmapped'] }) + ).toBeTruthy(); + }); + + test('it returns true if one of the esTypes is text', () => { + expect( + fieldSupportsMatches({ name: 'field', type: 'conflict', esTypes: ['text', 'unmapped'] }) + ).toBeTruthy(); + }); + + test('it returns true if all of the esTypes is map to kibana type string', () => { + expect( + fieldSupportsMatches({ name: 'field', type: 'conflict', esTypes: ['text', 'keyword'] }) + ).toBeTruthy(); + }); + + test('it returns false if none of the esTypes map to kibana type string', () => { + expect( + fieldSupportsMatches({ name: 'field', type: 'conflict', esTypes: ['bool', 'unmapped'] }) + ).toBeFalsy(); + }); + }); + describe('hasWrongOperatorWithWildcard', () => { + test('it returns true if there is at least one exception entry with a wildcard and the wrong operator', () => { + expect( + hasWrongOperatorWithWildcard([ + { + description: '', + name: '', + type: 'simple', + entries: [{ type: 'match', value: 'withwildcard*', field: '', operator: 'included' }], + }, + ]) + ).toBeTruthy(); + expect( + hasWrongOperatorWithWildcard([ + { + description: '', + name: '', + type: 'simple', + entries: [{ type: 'match', value: 'withwildcard?', field: '', operator: 'included' }], + }, + ]) + ).toBeTruthy(); + }); + + test('it returns true if there are entries joined with an OR that have a wildcard and the wrong operator', () => { + expect( + hasWrongOperatorWithWildcard([ + { + description: '', + name: '', + type: 'simple', + entries: [{ type: 'match', value: 'withwildcard?', field: '', operator: 'included' }], + }, + { + description: '', + name: '', + type: 'simple', + entries: [{ type: 'match', value: 'withwildcard?*', field: '', operator: 'included' }], + }, + ]) + ).toBeTruthy(); + }); + + test('it returns false if there are no exception entries with a wildcard and the wrong operator', () => { + expect( + hasWrongOperatorWithWildcard([ + { + description: '', + name: '', + type: 'simple', + entries: [ + { type: 'match', value: 'nowildcard', field: '', operator: 'excluded' }, + { type: 'wildcard', value: 'withwildcard*?', field: '', operator: 'included' }, + ], + }, + ]) + ).toBeFalsy(); + }); + + test('it returns true if there are nested entries with a wildcard and the wrong operator', () => { + expect( + hasWrongOperatorWithWildcard([ + { + description: '', + name: '', + type: 'simple', + entries: [ + { type: 'match', value: 'nowildcard', field: '', operator: 'excluded' }, + { + field: '', + type: 'nested', + entries: [{ type: 'match', value: 'wildcard?', field: '', operator: 'excluded' }], + }, + ], + }, + ]) + ).toBeTruthy(); + }); + }); + + describe('hasPartialCodeSignatureEntry', () => { + it('returns false if the entry has neither code signature subject name nor trusted field', () => { + expect( + hasPartialCodeSignatureEntry([ + { + description: '', + name: '', + type: 'simple', + os_types: ['windows'], + entries: [{ type: 'match', value: 'asdf', field: 'someField', operator: 'excluded' }], + }, + ]) + ).toBeFalsy(); + }); + it('returns true if the entry has code signature subject name but not trusted field', () => { + expect( + hasPartialCodeSignatureEntry([ + { + description: '', + name: '', + type: 'simple', + os_types: ['windows'], + entries: [ + { + type: 'match', + value: 'asdf', + field: 'process.code_signature.subject_name', + operator: 'excluded', + }, + ], + }, + ]) + ).toBeTruthy(); + }); + it('returns true if the entry has code signature trusted but not the subject name field', () => { + expect( + hasPartialCodeSignatureEntry([ + { + description: '', + name: '', + type: 'simple', + os_types: ['windows'], + entries: [ + { + type: 'match', + value: 'asdf', + field: 'process.code_signature.trusted', + operator: 'excluded', + }, + ], + }, + ]) + ).toBeTruthy(); + }); + it('returns false if the entry has both code signature subject name and trusted field', () => { + expect( + hasPartialCodeSignatureEntry([ + { + description: '', + name: '', + type: 'simple', + os_types: ['windows'], + entries: [ + { + type: 'match', + value: 'asdf', + field: 'process.code_signature.subject_name', + operator: 'excluded', + }, + { + type: 'match', + value: 'true', + field: 'process.code_signature.trusted', + operator: 'excluded', + }, + ], + }, + ]) + ).toBeFalsy(); + }); + it('returns false if the entry has both code signature team_id and trusted fields for mac os', () => { + expect( + hasPartialCodeSignatureEntry([ + { + description: '', + name: '', + type: 'simple', + os_types: ['macos'], + entries: [ + { + type: 'match', + value: 'asdf', + field: 'process.code_signature.team_id', + operator: 'excluded', + }, + { + type: 'match', + value: 'true', + field: 'process.code_signature.trusted', + operator: 'excluded', + }, + ], + }, + ]) + ).toBeFalsy(); + }); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/helpers/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/helpers/index.ts new file mode 100644 index 0000000000000..6cbdbe55cfeb6 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/helpers/index.ts @@ -0,0 +1,1088 @@ +/* + * 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 { v4 as uuidv4 } from 'uuid'; +import { + addIdToItem, + removeIdFromItem, + validateHasWildcardWithWrongOperator, +} from '@kbn/securitysolution-utils'; +import { validate } from '@kbn/securitysolution-io-ts-utils'; +import { + CreateExceptionListItemSchema, + EntriesArray, + Entry, + EntryNested, + ExceptionListType, + ListSchema, + NamespaceType, + ListOperatorEnum as OperatorEnum, + ListOperatorTypeEnum as OperatorTypeEnum, + createExceptionListItemSchema, + entriesList, + entriesNested, + entry, + exceptionListItemSchema, + nestedEntryItem, + CreateRuleExceptionListItemSchema, + createRuleExceptionListItemSchema, +} from '@kbn/securitysolution-io-ts-list-types'; +import { + DataViewBase, + DataViewFieldBase, + getDataViewFieldSubtypeNested, + isDataViewFieldSubtypeNested, +} from '@kbn/es-query'; +import { castEsToKbnFieldTypeName, KBN_FIELD_TYPES } from '@kbn/field-types'; + +import { + ALL_OPERATORS, + EXCEPTION_OPERATORS_SANS_LISTS, + doesNotExistOperator, + existsOperator, + isNotOperator, + isOneOfOperator, + isOperator, + DETECTION_ENGINE_EXCEPTION_OPERATORS, + isNotOneOfOperator, + isInListOperator, + isNotInListOperator, + matchesOperator, + doesNotMatchOperator, +} from '../autocomplete_operators'; + +import { + BuilderEntry, + CreateExceptionListItemBuilderSchema, + DataViewField, + EmptyEntry, + EmptyNestedEntry, + ExceptionsBuilderExceptionItem, + ExceptionsBuilderReturnExceptionItem, + FormattedBuilderEntry, + OperatorOption, + SavedObjectType, +} from '../types'; + +export const isEntryNested = (item: BuilderEntry): item is EntryNested => { + return (item as EntryNested).entries != null; +}; + +export const filterExceptionItems = ( + exceptions: ExceptionsBuilderExceptionItem[] +): ExceptionsBuilderReturnExceptionItem[] => { + return exceptions.reduce<ExceptionsBuilderReturnExceptionItem[]>((acc, exception) => { + const entries = exception.entries.reduce<BuilderEntry[]>((nestedAcc, singleEntry) => { + const strippedSingleEntry = removeIdFromItem(singleEntry); + if (entriesNested.is(strippedSingleEntry)) { + const nestedEntriesArray = strippedSingleEntry.entries.filter((singleNestedEntry) => { + const noIdSingleNestedEntry = removeIdFromItem(singleNestedEntry); + const [validatedNestedEntry] = validate(noIdSingleNestedEntry, nestedEntryItem); + return validatedNestedEntry != null; + }); + const noIdNestedEntries = nestedEntriesArray.map((singleNestedEntry) => + removeIdFromItem(singleNestedEntry) + ); + + const [validatedNestedEntry] = validate( + { ...strippedSingleEntry, entries: noIdNestedEntries }, + entriesNested + ); + + if (validatedNestedEntry != null) { + return [...nestedAcc, { ...singleEntry, entries: nestedEntriesArray }]; + } + return nestedAcc; + } else { + const [validatedEntry] = validate(strippedSingleEntry, entry); + if (validatedEntry != null) { + return [...nestedAcc, singleEntry]; + } + return nestedAcc; + } + }, []); + + if (entries.length === 0) { + return acc; + } + + const item = { ...exception, entries }; + + if (exceptionListItemSchema.is(item)) { + return [...acc, item]; + } else if ( + createExceptionListItemSchema.is(item) || + createRuleExceptionListItemSchema.is(item) + ) { + const { meta, ...rest } = item; + const itemSansMetaId: CreateExceptionListItemSchema | CreateRuleExceptionListItemSchema = { + ...rest, + meta: undefined, + }; + return [...acc, itemSansMetaId]; + } else { + return acc; + } + }, []); +}; + +export const addIdToEntries = (entries: EntriesArray): EntriesArray => { + return entries.map((singleEntry) => { + if (singleEntry.type === 'nested') { + return addIdToItem({ + ...singleEntry, + entries: singleEntry.entries.map((nestedEntry) => addIdToItem(nestedEntry)), + }); + } else { + return addIdToItem(singleEntry); + } + }); +}; + +export const getNewExceptionItem = ({ + listId, + namespaceType, + name, +}: { + listId: string | undefined; + namespaceType: NamespaceType | undefined; + name: string; +}): CreateExceptionListItemBuilderSchema => { + return { + comments: [], + description: `Exception list item`, + entries: addIdToEntries([ + { + field: '', + operator: 'included', + type: 'match', + value: '', + }, + ]), + item_id: undefined, + list_id: listId, + meta: { + temporaryUuid: uuidv4(), + }, + name, + namespace_type: namespaceType, + tags: [], + type: 'simple', + }; +}; + +/** + * Returns the operator type, may not need this if using io-ts types + * + * @param item a single ExceptionItem entry + */ +export const getOperatorType = (item: BuilderEntry): OperatorTypeEnum => { + switch (item.type) { + case 'match': + return OperatorTypeEnum.MATCH; + case 'match_any': + return OperatorTypeEnum.MATCH_ANY; + case 'wildcard': + return OperatorTypeEnum.WILDCARD; + case 'list': + return OperatorTypeEnum.LIST; + default: + return OperatorTypeEnum.EXISTS; + } +}; + +/** + * Determines operator selection (is/is not/is one of, etc.) + * Default operator is "is" + * + * @param item a single ExceptionItem entry + */ +export const getExceptionOperatorSelect = (item: BuilderEntry): OperatorOption => { + if (item.type === 'nested') { + return isOperator; + } else { + const operatorType = getOperatorType(item); + const foundOperator = ALL_OPERATORS.find((operatorOption) => { + return item.operator === operatorOption.operator && operatorType === operatorOption.type; + }); + + return foundOperator != null ? foundOperator : isOperator; + } +}; + +/** + * Returns the fields corresponding value for an entry + * + * @param item a single ExceptionItem entry + */ +export const getEntryValue = (item: BuilderEntry): string | string[] | undefined => { + switch (item.type) { + case OperatorTypeEnum.MATCH: + case OperatorTypeEnum.MATCH_ANY: + case OperatorTypeEnum.WILDCARD: + return item.value; + case OperatorTypeEnum.EXISTS: + return undefined; + case OperatorTypeEnum.LIST: + return item.list.id; + default: + return undefined; + } +}; + +/** + * Determines whether an entire entry, exception item, or entry within a nested + * entry needs to be removed + * + * @param exceptionItem + * @param entryIndex index of given entry, for nested entries, this will correspond + * to their parent index + * @param nestedEntryIndex index of nested entry + * + */ +export const getUpdatedEntriesOnDelete = ( + exceptionItem: ExceptionsBuilderExceptionItem, + entryIndex: number, + nestedParentIndex: number | null +): ExceptionsBuilderExceptionItem => { + const itemOfInterest: BuilderEntry = + exceptionItem.entries[nestedParentIndex != null ? nestedParentIndex : entryIndex]; + + if (nestedParentIndex != null && itemOfInterest.type === OperatorTypeEnum.NESTED) { + const updatedEntryEntries = [ + ...itemOfInterest.entries.slice(0, entryIndex), + ...itemOfInterest.entries.slice(entryIndex + 1), + ]; + + if (updatedEntryEntries.length === 0) { + return { + ...exceptionItem, + entries: [ + ...exceptionItem.entries.slice(0, nestedParentIndex), + ...exceptionItem.entries.slice(nestedParentIndex + 1), + ], + }; + } else { + const { field } = itemOfInterest; + const updatedItemOfInterest: EntryNested | EmptyNestedEntry = { + entries: updatedEntryEntries, + field, + id: itemOfInterest.id != null ? itemOfInterest.id : `${entryIndex}`, + type: OperatorTypeEnum.NESTED, + }; + + return { + ...exceptionItem, + entries: [ + ...exceptionItem.entries.slice(0, nestedParentIndex), + updatedItemOfInterest, + ...exceptionItem.entries.slice(nestedParentIndex + 1), + ], + }; + } + } else { + return { + ...exceptionItem, + entries: [ + ...exceptionItem.entries.slice(0, entryIndex), + ...exceptionItem.entries.slice(entryIndex + 1), + ], + }; + } +}; + +/** + * Returns filtered index patterns based on the field - if a user selects to + * add nested entry, should only show nested fields, if item is the parent + * field of a nested entry, we only display the parent field + * + * @param patterns DataViewBase containing available fields on rule index + * @param item exception item entry + * set to add a nested field + */ +export const getFilteredIndexPatterns = ( + patterns: DataViewBase, + item: FormattedBuilderEntry +): DataViewBase => { + if (item.nested === 'child' && item.parent != null) { + // when user has selected a nested entry, only fields with the common parent are shown + return { + ...patterns, + fields: patterns.fields + .filter((indexField) => { + const subTypeNested = getDataViewFieldSubtypeNested(indexField); + const fieldHasCommonParentPath = + subTypeNested && + item.parent != null && + subTypeNested.nested.path === item.parent.parent.field; + + return fieldHasCommonParentPath; + }) + .map((f) => { + const [fieldNameWithoutParentPath] = f.name.split('.').slice(-1); + return { ...f, name: fieldNameWithoutParentPath }; + }), + }; + } else if (item.nested === 'parent' && item.field != null) { + // when user has selected a nested entry, right above it we show the common parent + return { ...patterns, fields: [item.field] }; + } else if (item.nested === 'parent' && item.field == null) { + // when user selects to add a nested entry, only nested fields are shown as options + return { + ...patterns, + fields: patterns.fields.filter((field) => isDataViewFieldSubtypeNested(field)), + }; + } else { + return patterns; + } +}; + +/** + * Determines proper entry update when user selects new field + * + * @param item - current exception item entry values + * @param newField - newly selected field + * + */ +export const getEntryOnFieldChange = ( + item: FormattedBuilderEntry, + newField: DataViewFieldBase +): { index: number; updatedEntry: BuilderEntry } => { + const { parent, entryIndex, nested } = item; + const newChildFieldValue = newField != null ? newField.name.split('.').slice(-1)[0] : ''; + + if (nested === 'parent') { + // For nested entries, when user first selects to add a nested + // entry, they first see a row similar to what is shown for when + // a user selects "exists", as soon as they make a selection + // we can now identify the 'parent' and 'child' this is where + // we first convert the entry into type "nested" + const subTypeNested = getDataViewFieldSubtypeNested(newField); + const newParentFieldValue = subTypeNested?.nested.path || ''; + + return { + index: entryIndex, + updatedEntry: { + entries: [ + addIdToItem({ + field: newChildFieldValue != null ? newChildFieldValue : '', + operator: isOperator.operator, + type: OperatorTypeEnum.MATCH, + value: '', + }), + ], + field: newParentFieldValue, + id: item.id, + type: OperatorTypeEnum.NESTED, + }, + }; + } else if (nested === 'child' && parent != null) { + return { + index: parent.parentIndex, + updatedEntry: { + ...parent.parent, + entries: [ + ...parent.parent.entries.slice(0, entryIndex), + { + field: newChildFieldValue != null ? newChildFieldValue : '', + id: item.id, + operator: isOperator.operator, + type: OperatorTypeEnum.MATCH, + value: '', + }, + ...parent.parent.entries.slice(entryIndex + 1), + ], + }, + }; + } else { + return { + index: entryIndex, + updatedEntry: { + field: newField != null ? newField.name : '', + id: item.id, + operator: isOperator.operator, + type: OperatorTypeEnum.MATCH, + value: '', + }, + }; + } +}; + +/** + * Determines proper entry update when user updates value + * when operator is of type "list" + * + * @param item - current exception item entry values + * @param newField - newly selected list + * + */ +export const getEntryOnListChange = ( + item: FormattedBuilderEntry, + newField: ListSchema +): { index: number; updatedEntry: BuilderEntry } => { + const { entryIndex, field, operator } = item; + const { id, type } = newField; + + return { + index: entryIndex, + updatedEntry: { + field: field != null ? field.name : '', + id: item.id, + list: { id, type }, + operator: operator.operator, + type: OperatorTypeEnum.LIST, + }, + }; +}; + +/** + * Determines proper entry update when user updates value + * when operator is of type "match_any" + * + * @param item - current exception item entry values + * @param newField - newly entered value + * + */ +export const getEntryOnMatchAnyChange = ( + item: FormattedBuilderEntry, + newField: string[] +): { index: number; updatedEntry: BuilderEntry } => { + const { nested, parent, entryIndex, field, operator } = item; + + if (nested != null && parent != null) { + const fieldName = field != null ? field.name.split('.').slice(-1)[0] : ''; + + return { + index: parent.parentIndex, + updatedEntry: { + ...parent.parent, + entries: [ + ...parent.parent.entries.slice(0, entryIndex), + { + field: fieldName, + id: item.id, + operator: operator.operator, + type: OperatorTypeEnum.MATCH_ANY, + value: newField, + }, + ...parent.parent.entries.slice(entryIndex + 1), + ], + }, + }; + } else { + return { + index: entryIndex, + updatedEntry: { + field: field != null ? field.name : '', + id: item.id, + operator: operator.operator, + type: OperatorTypeEnum.MATCH_ANY, + value: newField, + }, + }; + } +}; + +/** + * Determines proper entry update when user updates value + * when operator is of type "match" + * + * @param item - current exception item entry values + * @param newField - newly entered value + * + */ +export const getEntryOnMatchChange = ( + item: FormattedBuilderEntry, + newField: string +): { index: number; updatedEntry: BuilderEntry } => { + const { nested, parent, entryIndex, field, operator } = item; + + if (nested != null && parent != null) { + const fieldName = field != null ? field.name.split('.').slice(-1)[0] : ''; + + return { + index: parent.parentIndex, + updatedEntry: { + ...parent.parent, + entries: [ + ...parent.parent.entries.slice(0, entryIndex), + { + field: fieldName, + id: item.id, + operator: operator.operator, + type: OperatorTypeEnum.MATCH, + value: newField, + }, + ...parent.parent.entries.slice(entryIndex + 1), + ], + }, + }; + } else { + return { + index: entryIndex, + updatedEntry: { + field: field != null ? field.name : '', + id: item.id, + operator: operator.operator, + type: OperatorTypeEnum.MATCH, + value: newField, + }, + }; + } +}; + +/** + * Determines proper entry update when user updates value + * when operator is of type "wildcard" + * + * @param item - current exception item entry values + * @param newField - newly entered value + * + */ +export const getEntryOnWildcardChange = ( + item: FormattedBuilderEntry, + newField: string +): { index: number; updatedEntry: BuilderEntry } => { + const { nested, parent, entryIndex, field, operator } = item; + + if (nested != null && parent != null) { + const fieldName = field != null ? field.name.split('.').slice(-1)[0] : ''; + + return { + index: parent.parentIndex, + updatedEntry: { + ...parent.parent, + entries: [ + ...parent.parent.entries.slice(0, entryIndex), + { + field: fieldName, + id: item.id, + operator: operator.operator, + type: OperatorTypeEnum.WILDCARD, + value: newField, + }, + ...parent.parent.entries.slice(entryIndex + 1), + ], + }, + }; + } else { + return { + index: entryIndex, + updatedEntry: { + field: field != null ? field.name : '', + id: item.id, + operator: operator.operator, + type: OperatorTypeEnum.WILDCARD, + value: newField, + }, + }; + } +}; + +/** + * On operator change, determines whether value needs to be cleared or not + * + * @param field + * @param selectedOperator + * @param currentEntry + * + */ +export const getEntryFromOperator = ( + selectedOperator: OperatorOption, + currentEntry: FormattedBuilderEntry +): Entry & { id?: string } => { + const isSameOperatorType = currentEntry.operator.type === selectedOperator.type; + const fieldValue = currentEntry.field != null ? currentEntry.field.name : ''; + switch (selectedOperator.type) { + case 'match': + return { + field: fieldValue, + id: currentEntry.id, + operator: selectedOperator.operator, + type: OperatorTypeEnum.MATCH, + value: + isSameOperatorType && typeof currentEntry.value === 'string' ? currentEntry.value : '', + }; + case 'match_any': + return { + field: fieldValue, + id: currentEntry.id, + operator: selectedOperator.operator, + type: OperatorTypeEnum.MATCH_ANY, + value: isSameOperatorType && Array.isArray(currentEntry.value) ? currentEntry.value : [], + }; + case 'list': + return { + field: fieldValue, + id: currentEntry.id, + list: { id: '', type: 'ip' }, + operator: selectedOperator.operator, + type: OperatorTypeEnum.LIST, + }; + case 'wildcard': + return { + field: fieldValue, + id: currentEntry.id, + operator: selectedOperator.operator, + type: OperatorTypeEnum.WILDCARD, + value: + isSameOperatorType && typeof currentEntry.value === 'string' ? currentEntry.value : '', + }; + default: + return { + field: fieldValue, + id: currentEntry.id, + operator: selectedOperator.operator, + type: OperatorTypeEnum.EXISTS, + }; + } +}; + +/** + * Determines proper entry update when user selects new operator + * + * @param item - current exception item entry values + * @param newOperator - newly selected operator + * + */ +export const getEntryOnOperatorChange = ( + item: FormattedBuilderEntry, + newOperator: OperatorOption +): { updatedEntry: BuilderEntry; index: number } => { + const { parent, entryIndex, field, nested } = item; + const newEntry = getEntryFromOperator(newOperator, item); + + if (!entriesList.is(newEntry) && nested != null && parent != null) { + return { + index: parent.parentIndex, + updatedEntry: { + ...parent.parent, + entries: [ + ...parent.parent.entries.slice(0, entryIndex), + { + ...newEntry, + field: field != null ? field.name.split('.').slice(-1)[0] : '', + }, + ...parent.parent.entries.slice(entryIndex + 1), + ], + }, + }; + } else { + return { index: entryIndex, updatedEntry: newEntry }; + } +}; + +export const isKibanaStringType = (type: string) => { + const kbnFieldType = castEsToKbnFieldTypeName(type); + return kbnFieldType === KBN_FIELD_TYPES.STRING; +}; + +export const fieldSupportsMatches = (field: DataViewFieldBase) => { + return field.esTypes?.some(isKibanaStringType); +}; + +/** + * Determines which operators to make available + * + * @param item + * @param listType + * @param isBoolean + * @param includeValueListOperators whether or not to include the 'is in list' and 'is not in list' operators + */ +export const getOperatorOptions = ( + item: FormattedBuilderEntry, + listType: ExceptionListType, + isBoolean: boolean, + includeValueListOperators = true +): OperatorOption[] => { + if (item.nested === 'parent' || item.field == null) { + return [isOperator]; + } else if (listType === 'endpoint') { + if (isBoolean) { + return [isOperator]; + } else { + return fieldSupportsMatches(item.field) + ? [isOperator, isOneOfOperator, matchesOperator, doesNotMatchOperator] + : [isOperator, isOneOfOperator]; + } + } else if (item.nested != null && listType === 'detection') { + return isBoolean ? [isOperator, existsOperator] : [isOperator, isOneOfOperator, existsOperator]; + } else if (isBoolean) { + return [isOperator, isNotOperator, existsOperator, doesNotExistOperator]; + } else if (!includeValueListOperators) { + return fieldSupportsMatches(item.field) + ? EXCEPTION_OPERATORS_SANS_LISTS + : [ + isOperator, + isNotOperator, + isOneOfOperator, + isNotOneOfOperator, + existsOperator, + doesNotExistOperator, + ]; + } else { + return listType === 'detection' + ? fieldSupportsMatches(item.field) + ? DETECTION_ENGINE_EXCEPTION_OPERATORS + : [ + isOperator, + isNotOperator, + isOneOfOperator, + isNotOneOfOperator, + existsOperator, + doesNotExistOperator, + isInListOperator, + isNotInListOperator, + ] + : ALL_OPERATORS; + } +}; + +/** + * Fields of type 'text' do not generate autocomplete values, we want + * to find it's corresponding keyword type (if available) which does + * generate autocomplete values + * + * @param fields DataViewFieldBase fields + * @param selectedField the field name that was selected + * @param isTextType we only want a corresponding keyword field if + * the selected field is of type 'text' + * + */ +export const getCorrespondingKeywordField = ({ + fields, + selectedField, +}: { + fields: DataViewFieldBase[]; + selectedField: string | undefined; +}): DataViewFieldBase | undefined => { + const selectedFieldBits = + selectedField != null && selectedField !== '' ? selectedField.split('.') : []; + const selectedFieldIsTextType = selectedFieldBits.slice(-1)[0] === 'text'; + + if (selectedFieldIsTextType && selectedFieldBits.length > 0) { + const keywordField = selectedFieldBits.slice(0, selectedFieldBits.length - 1).join('.'); + const [foundKeywordField] = fields.filter( + ({ name }) => keywordField !== '' && keywordField === name + ); + return foundKeywordField; + } + + return undefined; +}; + +/** + * Formats the entry into one that is easily usable for the UI, most of the + * complexity was introduced with nested fields + * + * @param patterns DataViewBase containing available fields on rule index + * @param item exception item entry + * @param itemIndex entry index + * @param parent nested entries hold copy of their parent for use in various logic + * @param parentIndex corresponds to the entry index, this might seem obvious, but + * was added to ensure that nested items could be identified with their parent entry + * @param allowCustomFieldOptions determines if field must be found to match in indexPattern or not + */ +export const getFormattedBuilderEntry = ( + indexPattern: DataViewBase, + item: BuilderEntry, + itemIndex: number, + parent: EntryNested | undefined, + parentIndex: number | undefined, + allowCustomFieldOptions: boolean +): FormattedBuilderEntry => { + const { fields } = indexPattern; + const field = parent != null ? `${parent.field}.${item.field}` : item.field; + const [foundField] = fields.filter(({ name }) => field != null && field === name); + const correspondingKeywordField = getCorrespondingKeywordField({ + fields, + selectedField: field, + }); + + if (parent != null && parentIndex != null) { + return { + correspondingKeywordField, + entryIndex: itemIndex, + field: + foundField != null + ? { ...foundField, name: foundField.name.split('.').slice(-1)[0] } + : foundField, + id: item.id != null ? item.id : `${itemIndex}`, + nested: 'child', + operator: getExceptionOperatorSelect(item), + parent: { parent, parentIndex }, + value: getEntryValue(item), + }; + } else { + const fieldToUse = allowCustomFieldOptions + ? foundField ?? { name: item.field, type: 'keyword' } + : foundField; + + return { + correspondingKeywordField, + entryIndex: itemIndex, + field: fieldToUse, + id: item.id != null ? item.id : `${itemIndex}`, + nested: undefined, + operator: getExceptionOperatorSelect(item), + parent: undefined, + value: getEntryValue(item), + }; + } +}; + +/** + * Formats the entries to be easily usable for the UI, most of the + * complexity was introduced with nested fields + * + * @param patterns DataViewBase containing available fields on rule index + * @param entries exception item entries + * @param allowCustomFieldOptions determines if field must be found to match in indexPattern or not + * @param parent nested entries hold copy of their parent for use in various logic + * @param parentIndex corresponds to the entry index, this might seem obvious, but + * was added to ensure that nested items could be identified with their parent entry + */ +export const getFormattedBuilderEntries = ( + indexPattern: DataViewBase, + entries: BuilderEntry[], + allowCustomFieldOptions: boolean, + parent?: EntryNested, + parentIndex?: number +): FormattedBuilderEntry[] => { + return entries.reduce<FormattedBuilderEntry[]>((acc, item, index) => { + const isNewNestedEntry = item.type === 'nested' && item.entries.length === 0; + if (item.type !== 'nested' && !isNewNestedEntry) { + const newItemEntry: FormattedBuilderEntry = getFormattedBuilderEntry( + indexPattern, + item, + index, + parent, + parentIndex, + allowCustomFieldOptions + ); + return [...acc, newItemEntry]; + } else { + const parentEntry: FormattedBuilderEntry = { + correspondingKeywordField: undefined, + entryIndex: index, + field: isNewNestedEntry + ? undefined + : // This type below is really a FieldSpec type from "src/plugins/data/common/index_patterns/fields/types.ts", we cast it here to keep using the DataViewFieldBase interface + ({ + aggregatable: false, + esTypes: ['nested'], + name: item.field != null ? item.field : '', + searchable: false, + type: 'string', + } as DataViewFieldBase), + id: item.id != null ? item.id : `${index}`, + nested: 'parent', + operator: isOperator, + parent: undefined, + value: undefined, + }; + + // User has selected to add a nested field, but not yet selected the field + if (isNewNestedEntry) { + return [...acc, parentEntry]; + } + + if (isEntryNested(item)) { + const nestedItems = getFormattedBuilderEntries( + indexPattern, + item.entries, + allowCustomFieldOptions, + item, + index + ); + + return [...acc, parentEntry, ...nestedItems]; + } + + return [...acc]; + } + }, []); +}; + +export const getDefaultEmptyEntry = (): EmptyEntry => ({ + field: '', + id: uuidv4(), + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH, + value: '', +}); + +export const getDefaultNestedEmptyEntry = (): EmptyNestedEntry => ({ + entries: [], + field: '', + id: uuidv4(), + type: OperatorTypeEnum.NESTED, +}); + +export const containsValueListEntry = (items: ExceptionsBuilderExceptionItem[]): boolean => + items.some((item) => item.entries.some(({ type }) => type === OperatorTypeEnum.LIST)); + +export const buildShowActiveExceptionsFilter = (savedObjectPrefix: SavedObjectType[]): string => { + const now = new Date().toISOString(); + const filters = savedObjectPrefix.map( + (prefix) => + `${prefix}.attributes.expire_time > "${now}" OR NOT ${prefix}.attributes.expire_time: *` + ); + return filters.join(','); +}; + +export const buildShowExpiredExceptionsFilter = (savedObjectPrefix: SavedObjectType[]): string => { + const now = new Date().toISOString(); + const filters = savedObjectPrefix.map((prefix) => `${prefix}.attributes.expire_time <= "${now}"`); + return filters.join(','); +}; + +const getIndexGroupName = (indexName: string): string => { + // Check whether it is a Data Stream index + const dataStreamExp = /.ds-(.*?)-[0-9]{4}\.[0-9]{2}\.[0-9]{2}-[0-9]{6}/; + let result = indexName.match(dataStreamExp); + if (result && result.length === 2) { + return result[1]; + } + + // Check whether it is an old '.siem' index group + const siemSignalsExp = /.siem-(.*?)-[0-9]{6}/; + result = indexName.match(siemSignalsExp); + if (result && result.length === 2) { + return `.siem-${result[1]}`; + } + + // Otherwise return index name + return indexName; +}; + +export interface FieldConflictsInfo { + /** + * Kibana field type + */ + type: string; + /** + * Total count of the indices of this type + */ + totalIndexCount: number; + /** + * Grouped indices info + */ + groupedIndices: Array<{ + /** + * Index group name (like '.ds-...' or '.siem-signals-...') + */ + name: string; + /** + * Count of indices in the group + */ + count: number; + }>; +} + +export const getMappingConflictsInfo = (field: DataViewField): FieldConflictsInfo[] | null => { + if (!field.conflictDescriptions) { + return null; + } + const conflicts: FieldConflictsInfo[] = []; + for (const [key, value] of Object.entries(field.conflictDescriptions)) { + const groupedIndices: Array<{ + name: string; + count: number; + }> = []; + + // Group indices and calculate count of indices in each group + const groupedInfo: { [key: string]: number } = {}; + value.forEach((index) => { + const groupName = getIndexGroupName(index); + if (!groupedInfo[groupName]) { + groupedInfo[groupName] = 0; + } + groupedInfo[groupName]++; + }); + for (const [name, count] of Object.entries(groupedInfo)) { + groupedIndices.push({ + name, + count, + }); + } + + // Sort groups by the indices count + groupedIndices.sort((group1, group2) => { + return group2.count - group1.count; + }); + + conflicts.push({ + type: key, + totalIndexCount: value.length, + groupedIndices, + }); + } + return conflicts; +}; + +/** + * Given an exceptions list, determine if any entries have an "IS" operator with a wildcard value + */ +export const hasWrongOperatorWithWildcard = ( + items: ExceptionsBuilderReturnExceptionItem[] +): boolean => { + // flattens array of multiple entries added with OR + const multipleEntries = items.flatMap((item) => item.entries); + // flattens nested entries + const allEntries = multipleEntries.flatMap((item) => { + if (item.type === 'nested') { + return item.entries; + } + return item; + }); + + // eslint-disable-next-line array-callback-return + return allEntries.some((e) => { + if (e.type !== 'list' && 'value' in e) { + return validateHasWildcardWithWrongOperator({ + operator: e.type, + value: e.value, + }); + } + }); +}; + +/** + * Event filters helper where given an exceptions list, + * determine if both 'subject_name' and 'trusted' are + * included in an entry with 'code_signature' + */ +export const hasPartialCodeSignatureEntry = ( + items: ExceptionsBuilderReturnExceptionItem[] +): boolean => { + const { os_types: os = ['windows'], entries = [] } = items[0] || {}; + let name = false; + let trusted = false; + + for (const e of entries) { + if (e.type === 'nested' && e.field === 'process.Ext.code_signature') { + const includesNestedName = e.entries.some( + (nestedEntry) => nestedEntry.field === 'subject_name' + ); + const includesNestedTrusted = e.entries.some( + (nestedEntry) => nestedEntry.field === 'trusted' + ); + if (includesNestedName !== includesNestedTrusted) { + return true; + } + } else if ( + e.field === 'process.code_signature.subject_name' || + (os.includes('macos') && e.field === 'process.code_signature.team_id') + ) { + name = true; + } else if (e.field === 'process.code_signature.trusted') { + trusted = true; + } + } + return name !== trusted; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/types/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/types/index.ts new file mode 100644 index 0000000000000..1730a0e9a8291 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/src/types/index.ts @@ -0,0 +1,122 @@ +/* + * 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 { DataViewFieldBase } from '@kbn/es-query'; +import type { + CreateExceptionListItemSchema, + CreateRuleExceptionListItemSchema, + Entry, + EntryExists, + EntryMatch, + EntryMatchAny, + EntryMatchWildcard, + EntryNested, + ExceptionListItemSchema, + ListOperatorEnum as OperatorEnum, + ListOperatorTypeEnum as OperatorTypeEnum, + NamespaceType, +} from '@kbn/securitysolution-io-ts-list-types'; +import { + EXCEPTION_LIST_NAMESPACE, + EXCEPTION_LIST_NAMESPACE_AGNOSTIC, +} from '@kbn/securitysolution-list-constants'; + +export interface DataViewField extends DataViewFieldBase { + conflictDescriptions?: Record<string, string[]>; +} + +export interface OperatorOption { + message: string; + value: string; + operator: OperatorEnum; + type: OperatorTypeEnum; +} + +export interface FormattedBuilderEntry { + id: string; + field: DataViewField | undefined; + operator: OperatorOption; + value: string | string[] | undefined; + nested: 'parent' | 'child' | undefined; + entryIndex: number; + parent: { parent: BuilderEntryNested; parentIndex: number } | undefined; + correspondingKeywordField: DataViewFieldBase | undefined; +} + +export interface EmptyEntry { + id: string; + field: string | undefined; + operator: OperatorEnum; + type: OperatorTypeEnum.MATCH | OperatorTypeEnum.MATCH_ANY | OperatorTypeEnum.WILDCARD; + value: string | string[] | undefined; +} + +export interface EmptyListEntry { + id: string; + field: string | undefined; + operator: OperatorEnum; + type: OperatorTypeEnum.LIST; + list: { id: string | undefined; type: string | undefined }; +} + +export interface EmptyNestedEntry { + id: string; + field: string | undefined; + type: OperatorTypeEnum.NESTED; + entries: Array< + | (EntryMatch & { id?: string }) + | (EntryMatchAny & { id?: string }) + | (EntryMatchWildcard & { id?: string }) + | (EntryExists & { id?: string }) + >; +} + +export type BuilderEntry = + | (Entry & { id?: string }) + | EmptyListEntry + | EmptyEntry + | BuilderEntryNested + | EmptyNestedEntry; + +export type BuilderEntryNested = Omit<EntryNested, 'entries'> & { + id?: string; + entries: Array< + | (EntryMatch & { id?: string }) + | (EntryMatchAny & { id?: string }) + | (EntryMatchWildcard & { id?: string }) + | (EntryExists & { id?: string }) + >; +}; + +export type ExceptionListItemBuilderSchema = Omit<ExceptionListItemSchema, 'entries'> & { + entries: BuilderEntry[]; +}; + +export type CreateExceptionListItemBuilderSchema = Omit< + CreateExceptionListItemSchema, + 'meta' | 'entries' | 'list_id' | 'namespace_type' +> & { + meta: { temporaryUuid: string }; + entries: BuilderEntry[]; + list_id: string | undefined; + namespace_type: NamespaceType | undefined; +}; + +export type ExceptionsBuilderExceptionItem = + | ExceptionListItemBuilderSchema + | CreateExceptionListItemBuilderSchema; + +export type ExceptionsBuilderReturnExceptionItem = + | ExceptionListItemSchema + | CreateExceptionListItemSchema + | CreateRuleExceptionListItemSchema; + +export const exceptionListSavedObjectType = EXCEPTION_LIST_NAMESPACE; +export const exceptionListAgnosticSavedObjectType = EXCEPTION_LIST_NAMESPACE_AGNOSTIC; +export type SavedObjectType = + | typeof EXCEPTION_LIST_NAMESPACE + | typeof EXCEPTION_LIST_NAMESPACE_AGNOSTIC; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/tsconfig.json b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/tsconfig.json new file mode 100644 index 0000000000000..0b6eb353950df --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-utils/tsconfig.json @@ -0,0 +1,25 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts" + ], + "kbn_references": [ + "@kbn/es-query", + "@kbn/i18n", + "@kbn/securitysolution-io-ts-list-types", + "@kbn/securitysolution-io-ts-utils", + "@kbn/securitysolution-list-constants", + "@kbn/securitysolution-utils", + "@kbn/field-types" + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/packages/kbn-securitysolution-lists-common/README.md b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/README.md similarity index 100% rename from packages/kbn-securitysolution-lists-common/README.md rename to x-pack/solutions/security/packages/kbn-securitysolution-lists-common/README.md diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list/create_list.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list/create_list.gen.ts new file mode 100644 index 0000000000000..cf603f3ac3bdb --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list/create_list.gen.ts @@ -0,0 +1,42 @@ +/* + * 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. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Create list API endpoint + * version: 2023-10-31 + */ + +import { z } from '@kbn/zod'; + +import { + ListId, + ListName, + ListDescription, + ListType, + ListMetadata, +} from '../model/list_common.gen'; +import { List } from '../model/list_schemas.gen'; + +export type CreateListRequestBody = z.infer<typeof CreateListRequestBody>; +export const CreateListRequestBody = z.object({ + id: ListId.optional(), + name: ListName, + description: ListDescription, + type: ListType, + serializer: z.string().optional(), + deserializer: z.string().optional(), + meta: ListMetadata.optional(), + version: z.number().int().min(1).optional().default(1), +}); +export type CreateListRequestBodyInput = z.input<typeof CreateListRequestBody>; + +export type CreateListResponse = z.infer<typeof CreateListResponse>; +export const CreateListResponse = List; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list/create_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list/create_list.schema.yaml new file mode 100644 index 0000000000000..3c1d090687fe6 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list/create_list.schema.yaml @@ -0,0 +1,81 @@ +openapi: 3.0.0 +info: + title: Create list API endpoint + version: '2023-10-31' +paths: + /api/lists: + post: + x-labels: [serverless, ess] + operationId: CreateList + x-codegen-enabled: true + summary: Create a list + description: Create a new list. + requestBody: + description: List's properties + required: true + content: + application/json: + schema: + type: object + properties: + id: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' + name: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListName' + description: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListDescription' + type: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListType' + serializer: + type: string + deserializer: + type: string + meta: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListMetadata' + version: + type: integer + minimum: 1 + default: 1 + required: + - name + - description + - type + responses: + 200: + description: Successful response + content: + application/json: + schema: + $ref: '../model/list_schemas.schema.yaml#/components/schemas/List' + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 409: + description: List already exists response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.gen.ts new file mode 100644 index 0000000000000..7eb20ada7f322 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.gen.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. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Create list DS API endpoint + * version: 2023-10-31 + */ + +import { z } from '@kbn/zod'; + +export type CreateListIndexResponse = z.infer<typeof CreateListIndexResponse>; +export const CreateListIndexResponse = z.object({ + acknowledged: z.boolean(), +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.schema.yaml new file mode 100644 index 0000000000000..8f79811144374 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_index/create_list_index.schema.yaml @@ -0,0 +1,55 @@ +openapi: 3.0.0 +info: + title: Create list DS API endpoint + version: '2023-10-31' +paths: + /api/lists/index: + post: + x-labels: [serverless, ess] + operationId: CreateListIndex + x-codegen-enabled: true + summary: Create list data streams + description: Create `.lists` and `.items` data streams in the relevant space. + responses: + 200: + description: Successful response + content: + application/json: + schema: + type: object + properties: + acknowledged: + type: boolean + required: [acknowledged] + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 409: + description: List data stream exists response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.gen.ts new file mode 100644 index 0000000000000..ce4744f3c4418 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.gen.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Create list item API endpoint + * version: 2023-10-31 + */ + +import { z } from '@kbn/zod'; + +import { ListItemId, ListId, ListItemValue, ListItemMetadata } from '../model/list_common.gen'; +import { ListItem } from '../model/list_schemas.gen'; + +export type CreateListItemRequestBody = z.infer<typeof CreateListItemRequestBody>; +export const CreateListItemRequestBody = z.object({ + id: ListItemId.optional(), + list_id: ListId, + value: ListItemValue, + meta: ListItemMetadata.optional(), + /** + * Determines when changes made by the request are made visible to search + */ + refresh: z.enum(['true', 'false', 'wait_for']).optional(), +}); +export type CreateListItemRequestBodyInput = z.input<typeof CreateListItemRequestBody>; + +export type CreateListItemResponse = z.infer<typeof CreateListItemResponse>; +export const CreateListItemResponse = ListItem; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.schema.yaml new file mode 100644 index 0000000000000..bdf266c8926f6 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/create_list_item/create_list_item.schema.yaml @@ -0,0 +1,82 @@ +openapi: 3.0.0 +info: + title: Create list item API endpoint + version: '2023-10-31' +paths: + /api/lists/items: + post: + x-labels: [serverless, ess] + operationId: CreateListItem + x-codegen-enabled: true + summary: Create a list item + description: | + Create a list item and associate it with the specified list. + + All list items in the same list must be the same type. For example, each list item in an `ip` list must define a specific IP address. + > info + > Before creating a list item, you must create a list. + requestBody: + description: List item's properties + required: true + content: + application/json: + schema: + type: object + properties: + id: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListItemId' + list_id: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' + value: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListItemValue' + meta: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListItemMetadata' + refresh: + type: string + enum: + - 'true' + - 'false' + - wait_for + description: Determines when changes made by the request are made visible to search + required: + - list_id + - value + responses: + 200: + description: Successful response + content: + application/json: + schema: + $ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem' + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 409: + description: List item already exists response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.gen.ts new file mode 100644 index 0000000000000..3dd638be564ee --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.gen.ts @@ -0,0 +1,35 @@ +/* + * 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. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Delete list API endpoint + * version: 2023-10-31 + */ + +import { z } from '@kbn/zod'; +import { BooleanFromString } from '@kbn/zod-helpers'; + +import { ListId } from '../model/list_common.gen'; +import { List } from '../model/list_schemas.gen'; + +export type DeleteListRequestQuery = z.infer<typeof DeleteListRequestQuery>; +export const DeleteListRequestQuery = z.object({ + /** + * List's `id` value + */ + id: ListId, + deleteReferences: BooleanFromString.optional().default(false), + ignoreReferences: BooleanFromString.optional().default(false), +}); +export type DeleteListRequestQueryInput = z.input<typeof DeleteListRequestQuery>; + +export type DeleteListResponse = z.infer<typeof DeleteListResponse>; +export const DeleteListResponse = List; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.schema.yaml new file mode 100644 index 0000000000000..d8440aa347cde --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list/delete_list.schema.yaml @@ -0,0 +1,73 @@ +openapi: 3.0.0 +info: + title: Delete list API endpoint + version: '2023-10-31' +paths: + /api/lists: + delete: + x-labels: [serverless, ess] + operationId: DeleteList + x-codegen-enabled: true + summary: Delete a list + description: | + Delete a list using the list ID. + > info + > When you delete a list, all of its list items are also deleted. + parameters: + - name: id + in: query + required: true + description: List's `id` value + schema: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' + - name: deleteReferences + in: query + required: false + schema: + type: boolean + default: false + - name: ignoreReferences + in: query + required: false + schema: + type: boolean + default: false + responses: + 200: + description: Successful response + content: + application/json: + schema: + $ref: '../model/list_schemas.schema.yaml#/components/schemas/List' + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 404: + description: List not found response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.gen.ts new file mode 100644 index 0000000000000..4ffd90f6fb8b0 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.gen.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. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Delete list DS API endpoint + * version: 2023-10-31 + */ + +import { z } from '@kbn/zod'; + +export type DeleteListIndexResponse = z.infer<typeof DeleteListIndexResponse>; +export const DeleteListIndexResponse = z.object({ + acknowledged: z.boolean(), +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.schema.yaml new file mode 100644 index 0000000000000..8773925e358b1 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_index/delete_list_index.schema.yaml @@ -0,0 +1,55 @@ +openapi: 3.0.0 +info: + title: Delete list DS API endpoint + version: '2023-10-31' +paths: + /api/lists/index: + delete: + x-labels: [serverless, ess] + operationId: DeleteListIndex + x-codegen-enabled: true + summary: Delete list data streams + description: Delete the `.lists` and `.items` data streams. + responses: + 200: + description: Successful response + content: + application/json: + schema: + type: object + properties: + acknowledged: + type: boolean + required: [acknowledged] + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 404: + description: List data stream not found response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.gen.ts similarity index 76% rename from packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.gen.ts index 178641cd8d6af..fe9f7bee0e688 100644 --- a/packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.schema.yaml new file mode 100644 index 0000000000000..752a246bdd9b3 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/delete_list_item/delete_list_item.schema.yaml @@ -0,0 +1,82 @@ +openapi: 3.0.0 +info: + title: Delete list item API endpoint + version: '2023-10-31' +paths: + /api/lists/items: + delete: + x-labels: [serverless, ess] + operationId: DeleteListItem + x-codegen-enabled: true + summary: Delete a list item + description: Delete a list item using its `id`, or its `list_id` and `value` fields. + parameters: + - name: id + in: query + required: false + description: Required if `list_id` and `value` are not specified + schema: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' + - name: list_id + in: query + required: false + description: Required if `id` is not specified + schema: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' + - name: value + in: query + required: false + description: Required if `id` is not specified + schema: + type: string + - name: refresh + in: query + required: false + description: Determines when changes made by the request are made visible to search + schema: + type: string + enum: ['true', 'false', 'wait_for'] + default: 'false' + responses: + 200: + description: Successful response + content: + application/json: + schema: + oneOf: + - $ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem' + - type: array + items: + $ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem' + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 404: + description: List item not found response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.gen.ts new file mode 100644 index 0000000000000..87e05bd24e481 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.gen.ts @@ -0,0 +1,28 @@ +/* + * 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. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Export list items API endpoint + * version: 2023-10-31 + */ + +import { z } from '@kbn/zod'; + +import { ListId } from '../model/list_common.gen'; + +export type ExportListItemsRequestQuery = z.infer<typeof ExportListItemsRequestQuery>; +export const ExportListItemsRequestQuery = z.object({ + /** + * List's id to export + */ + list_id: ListId, +}); +export type ExportListItemsRequestQueryInput = z.input<typeof ExportListItemsRequestQuery>; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.schema.yaml new file mode 100644 index 0000000000000..2dd518904d0f8 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/export_list_items/export_list_items.schema.yaml @@ -0,0 +1,60 @@ +openapi: 3.0.0 +info: + title: Export list items API endpoint + version: '2023-10-31' +paths: + /api/lists/items/_export: + post: + x-labels: [serverless, ess] + operationId: ExportListItems + x-codegen-enabled: true + summary: Export list items + description: Export list item values from the specified list. + parameters: + - name: list_id + in: query + required: true + description: List's id to export + schema: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' + responses: + 200: + description: Successful response + content: + application/ndjson: + schema: + type: string + format: binary + description: A `.txt` file containing list items from the specified list + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 404: + description: List not found response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.gen.ts similarity index 85% rename from packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.gen.ts index f693965e91e2e..e40c6fe9e2fc1 100644 --- a/packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.schema.yaml similarity index 75% rename from packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.schema.yaml index 21cf4ffd61841..5cb15220e17cc 100644 --- a/packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_list_items/find_list_items.schema.yaml @@ -34,7 +34,7 @@ paths: required: false description: Determines which field is used to sort the results schema: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' - name: sort_order in: query required: false @@ -94,31 +94,31 @@ paths: application/json: schema: oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' components: schemas: FindListItemsCursor: - $ref: '../../../kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' FindListItemsFilter: type: string diff --git a/packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.gen.ts similarity index 84% rename from packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.gen.ts index ec104f2e6c2b1..74f8ba0217d68 100644 --- a/packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.schema.yaml new file mode 100644 index 0000000000000..44713827d29f9 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/find_lists/find_lists.schema.yaml @@ -0,0 +1,118 @@ +openapi: 3.0.0 +info: + title: Find lists API endpoint + version: '2023-10-31' +paths: + /api/lists/_find: + get: + x-labels: [serverless, ess] + operationId: FindLists + x-codegen-enabled: true + summary: Get lists + description: Get a paginated subset of lists. By default, the first page is returned, with 20 results per page. + parameters: + - name: page + in: query + required: false + description: The page number to return + schema: + type: integer + - name: per_page + in: query + required: false + description: The number of lists to return per page + schema: + type: integer + - name: sort_field + in: query + required: false + description: Determines which field is used to sort the results + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + - name: sort_order + in: query + required: false + description: Determines the sort order, which can be `desc` or `asc` + schema: + type: string + enum: [desc, asc] + - name: cursor + in: query + required: false + description: | + Returns the list that come after the last list returned in the previous call + (use the cursor value returned in the previous call). This parameter uses + the `tie_breaker_id` field to ensure all lists are sorted and returned correctly. + schema: + $ref: '#/components/schemas/FindListsCursor' + - name: filter + in: query + required: false + description: | + Filters the returned results according to the value of the specified field, + using the <field name>:<field value> syntax. + schema: + $ref: '#/components/schemas/FindListsFilter' + responses: + 200: + description: Successful response + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '../model/list_schemas.schema.yaml#/components/schemas/List' + page: + type: integer + minimum: 0 + per_page: + type: integer + minimum: 0 + total: + type: integer + minimum: 0 + cursor: + $ref: '#/components/schemas/FindListsCursor' + required: + - data + - page + - per_page + - total + - cursor + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + +components: + schemas: + FindListsCursor: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + + FindListsFilter: + type: string diff --git a/packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.gen.ts similarity index 77% rename from packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.gen.ts index b71b05bd75955..baf9d9308a93c 100644 --- a/packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.schema.yaml new file mode 100644 index 0000000000000..78f44f7dd7f71 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/import_list_items/import_list_items.schema.yaml @@ -0,0 +1,101 @@ +openapi: 3.0.0 +info: + title: Import list items API endpoint + version: '2023-10-31' +paths: + /api/lists/items/_import: + post: + x-labels: [serverless, ess] + operationId: ImportListItems + x-codegen-enabled: true + summary: Import list items + description: | + Import list items from a TXT or CSV file. The maximum file size is 9 million bytes. + + You can import items to a new or existing list. + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + description: A `.txt` or `.csv` file containing newline separated list items + parameters: + - name: list_id + in: query + required: false + description: | + List's id. + + Required when importing to an existing list. + schema: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' + - name: type + in: query + required: false + description: | + Type of the importing list. + + Required when importing a new list that is `list_id` is not specified. + schema: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListType' + - name: serializer + in: query + required: false + schema: + type: string + - name: deserializer + in: query + required: false + schema: + type: string + - name: refresh + in: query + required: false + description: Determines when changes made by the request are made visible to search + schema: + type: string + enum: ['true', 'false', 'wait_for'] + responses: + 200: + description: Successful response + content: + application/json: + schema: + $ref: '../model/list_schemas.schema.yaml#/components/schemas/List' + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 409: + description: List with specified list_id does not exist response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/index.ts new file mode 100644 index 0000000000000..6ff15e6109c68 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/index.ts @@ -0,0 +1,26 @@ +/* + * 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. + */ + +export * from './model/list_common.gen'; +export * from './model/list_schemas.gen'; +export * from './create_list_index/create_list_index.gen'; +export * from './create_list_item/create_list_item.gen'; +export * from './create_list/create_list.gen'; +export * from './delete_list_index/delete_list_index.gen'; +export * from './delete_list_item/delete_list_item.gen'; +export * from './delete_list/delete_list.gen'; +export * from './find_list_items/find_list_items.gen'; +export * from './find_lists/find_lists.gen'; +export * from './export_list_items/export_list_items.gen'; +export * from './import_list_items/import_list_items.gen'; +export * from './patch_list_item/patch_list_item.gen'; +export * from './patch_list/patch_list.gen'; +export * from './read_list_index/read_list_index.gen'; +export * from './read_list_item/read_list_item.gen'; +export * from './read_list/read_list.gen'; +export * from './update_list_item/update_list_item.gen'; +export * from './update_list/update_list.gen'; diff --git a/packages/kbn-securitysolution-lists-common/api/model/list_common.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/model/list_common.gen.ts similarity index 82% rename from packages/kbn-securitysolution-lists-common/api/model/list_common.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/model/list_common.gen.ts index 9a51bd0eeb5ad..536e0b859e45a 100644 --- a/packages/kbn-securitysolution-lists-common/api/model/list_common.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/model/list_common.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/model/list_common.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/model/list_common.schema.yaml new file mode 100644 index 0000000000000..ef29224a5b73c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/model/list_common.schema.yaml @@ -0,0 +1,59 @@ +openapi: 3.0.0 +info: + title: Common List Attributes + version: 'not applicable' +paths: {} +components: + schemas: + ListId: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + + ListType: + type: string + enum: + - binary + - boolean + - byte + - date + - date_nanos + - date_range + - double + - double_range + - float + - float_range + - geo_point + - geo_shape + - half_float + - integer + - integer_range + - ip + - ip_range + - keyword + - long + - long_range + - shape + - short + - text + + ListName: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + + ListDescription: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + + ListMetadata: + type: object + additionalProperties: true + + ListItemId: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + + ListItemValue: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + + ListItemDescription: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/primitives.schema.yaml#/components/schemas/NonEmptyString' + + ListItemMetadata: + type: object + additionalProperties: true diff --git a/packages/kbn-securitysolution-lists-common/api/model/list_schemas.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/model/list_schemas.gen.ts similarity index 80% rename from packages/kbn-securitysolution-lists-common/api/model/list_schemas.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/model/list_schemas.gen.ts index 14d9547c35b59..cd95d20853c11 100644 --- a/packages/kbn-securitysolution-lists-common/api/model/list_schemas.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/model/list_schemas.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/packages/kbn-securitysolution-lists-common/api/model/list_schemas.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/model/list_schemas.schema.yaml similarity index 100% rename from packages/kbn-securitysolution-lists-common/api/model/list_schemas.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/model/list_schemas.schema.yaml diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.gen.ts new file mode 100644 index 0000000000000..f2a67181d396d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.gen.ts @@ -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. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Patch list API endpoint + * version: 2023-10-31 + */ + +import { z } from '@kbn/zod'; + +import { ListId, ListName, ListDescription, ListMetadata } from '../model/list_common.gen'; +import { List } from '../model/list_schemas.gen'; + +export type PatchListRequestBody = z.infer<typeof PatchListRequestBody>; +export const PatchListRequestBody = z.object({ + id: ListId, + name: ListName.optional(), + description: ListDescription.optional(), + meta: ListMetadata.optional(), + version: z.number().int().min(1).optional(), + _version: z.string().optional(), +}); +export type PatchListRequestBodyInput = z.input<typeof PatchListRequestBody>; + +export type PatchListResponse = z.infer<typeof PatchListResponse>; +export const PatchListResponse = List; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.schema.yaml new file mode 100644 index 0000000000000..be8c5871413fc --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list/patch_list.schema.yaml @@ -0,0 +1,74 @@ +openapi: 3.0.0 +info: + title: Patch list API endpoint + version: '2023-10-31' +paths: + /api/lists: + patch: + x-labels: [serverless, ess] + operationId: PatchList + x-codegen-enabled: true + summary: Patch a list + description: Update specific fields of an existing list using the list ID. + requestBody: + description: List's properties + required: true + content: + application/json: + schema: + type: object + properties: + id: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' + name: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListName' + description: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListDescription' + meta: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListMetadata' + version: + type: integer + minimum: 1 + _version: + type: string + required: + - id + responses: + 200: + description: Successful response + content: + application/json: + schema: + $ref: '../model/list_schemas.schema.yaml#/components/schemas/List' + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 404: + description: List not found response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.gen.ts new file mode 100644 index 0000000000000..e5c06ddd7c251 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.gen.ts @@ -0,0 +1,36 @@ +/* + * 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. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Patch list item API endpoint + * version: 2023-10-31 + */ + +import { z } from '@kbn/zod'; + +import { ListItemId, ListItemValue, ListItemMetadata } from '../model/list_common.gen'; +import { ListItem } from '../model/list_schemas.gen'; + +export type PatchListItemRequestBody = z.infer<typeof PatchListItemRequestBody>; +export const PatchListItemRequestBody = z.object({ + id: ListItemId, + value: ListItemValue.optional(), + meta: ListItemMetadata.optional(), + _version: z.string().optional(), + /** + * Determines when changes made by the request are made visible to search + */ + refresh: z.enum(['true', 'false', 'wait_for']).optional(), +}); +export type PatchListItemRequestBodyInput = z.input<typeof PatchListItemRequestBody>; + +export type PatchListItemResponse = z.infer<typeof PatchListItemResponse>; +export const PatchListItemResponse = ListItem; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.schema.yaml new file mode 100644 index 0000000000000..7802133dc4b16 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/patch_list_item/patch_list_item.schema.yaml @@ -0,0 +1,76 @@ +openapi: 3.0.0 +info: + title: Patch list item API endpoint + version: '2023-10-31' +paths: + /api/lists/items: + patch: + x-labels: [serverless, ess] + operationId: PatchListItem + x-codegen-enabled: true + summary: Patch a list item + description: Update specific fields of an existing list item using the list item ID. + requestBody: + description: List item's properties + required: true + content: + application/json: + schema: + type: object + properties: + id: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListItemId' + value: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListItemValue' + meta: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListItemMetadata' + _version: + type: string + refresh: + type: string + enum: + - 'true' + - 'false' + - wait_for + description: Determines when changes made by the request are made visible to search + required: + - id + responses: + 200: + description: Successful response + content: + application/json: + schema: + $ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem' + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 404: + description: List item not found response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/quickstart_client.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/quickstart_client.gen.ts new file mode 100644 index 0000000000000..232f4b00540c5 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/quickstart_client.gen.ts @@ -0,0 +1,428 @@ +/* + * 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. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Lists API client for quickstart + * version: Bundle (no version) + */ + +import type { KbnClient } from '@kbn/test'; +import { ToolingLog } from '@kbn/tooling-log'; +import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common'; +import { catchAxiosErrorFormatAndThrow } from '@kbn/securitysolution-utils'; + +import type { CreateListIndexResponse } from './create_list_index/create_list_index.gen'; +import type { + CreateListItemRequestBodyInput, + CreateListItemResponse, +} from './create_list_item/create_list_item.gen'; +import type { CreateListRequestBodyInput, CreateListResponse } from './create_list/create_list.gen'; +import type { DeleteListIndexResponse } from './delete_list_index/delete_list_index.gen'; +import type { + DeleteListItemRequestQueryInput, + DeleteListItemResponse, +} from './delete_list_item/delete_list_item.gen'; +import type { + DeleteListRequestQueryInput, + DeleteListResponse, +} from './delete_list/delete_list.gen'; +import type { ExportListItemsRequestQueryInput } from './export_list_items/export_list_items.gen'; +import type { + FindListItemsRequestQueryInput, + FindListItemsResponse, +} from './find_list_items/find_list_items.gen'; +import type { FindListsRequestQueryInput, FindListsResponse } from './find_lists/find_lists.gen'; +import type { + ImportListItemsRequestQueryInput, + ImportListItemsResponse, +} from './import_list_items/import_list_items.gen'; +import type { + PatchListItemRequestBodyInput, + PatchListItemResponse, +} from './patch_list_item/patch_list_item.gen'; +import type { PatchListRequestBodyInput, PatchListResponse } from './patch_list/patch_list.gen'; +import type { ReadListIndexResponse } from './read_list_index/read_list_index.gen'; +import type { + ReadListItemRequestQueryInput, + ReadListItemResponse, +} from './read_list_item/read_list_item.gen'; +import type { ReadListPrivilegesResponse } from './read_list_privileges/read_list_privileges.gen'; +import type { ReadListRequestQueryInput, ReadListResponse } from './read_list/read_list.gen'; +import type { + UpdateListItemRequestBodyInput, + UpdateListItemResponse, +} from './update_list_item/update_list_item.gen'; +import type { UpdateListRequestBodyInput, UpdateListResponse } from './update_list/update_list.gen'; + +export interface ClientOptions { + kbnClient: KbnClient; + log: ToolingLog; +} + +export class Client { + readonly kbnClient: KbnClient; + readonly log: ToolingLog; + + constructor(options: ClientOptions) { + this.kbnClient = options.kbnClient; + this.log = options.log; + } + /** + * Create a new list. + */ + async createList(props: CreateListProps) { + this.log.info(`${new Date().toISOString()} Calling API CreateList`); + return this.kbnClient + .request<CreateListResponse>({ + path: '/api/lists', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'POST', + body: props.body, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Create `.lists` and `.items` data streams in the relevant space. + */ + async createListIndex() { + this.log.info(`${new Date().toISOString()} Calling API CreateListIndex`); + return this.kbnClient + .request<CreateListIndexResponse>({ + path: '/api/lists/index', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'POST', + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Create a list item and associate it with the specified list. + +All list items in the same list must be the same type. For example, each list item in an `ip` list must define a specific IP address. +> info +> Before creating a list item, you must create a list. + + */ + async createListItem(props: CreateListItemProps) { + this.log.info(`${new Date().toISOString()} Calling API CreateListItem`); + return this.kbnClient + .request<CreateListItemResponse>({ + path: '/api/lists/items', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'POST', + body: props.body, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Delete a list using the list ID. +> info +> When you delete a list, all of its list items are also deleted. + + */ + async deleteList(props: DeleteListProps) { + this.log.info(`${new Date().toISOString()} Calling API DeleteList`); + return this.kbnClient + .request<DeleteListResponse>({ + path: '/api/lists', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'DELETE', + + query: props.query, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Delete the `.lists` and `.items` data streams. + */ + async deleteListIndex() { + this.log.info(`${new Date().toISOString()} Calling API DeleteListIndex`); + return this.kbnClient + .request<DeleteListIndexResponse>({ + path: '/api/lists/index', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'DELETE', + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Delete a list item using its `id`, or its `list_id` and `value` fields. + */ + async deleteListItem(props: DeleteListItemProps) { + this.log.info(`${new Date().toISOString()} Calling API DeleteListItem`); + return this.kbnClient + .request<DeleteListItemResponse>({ + path: '/api/lists/items', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'DELETE', + + query: props.query, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Export list item values from the specified list. + */ + async exportListItems(props: ExportListItemsProps) { + this.log.info(`${new Date().toISOString()} Calling API ExportListItems`); + return this.kbnClient + .request({ + path: '/api/lists/items/_export', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'POST', + + query: props.query, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Get all list items in the specified list. + */ + async findListItems(props: FindListItemsProps) { + this.log.info(`${new Date().toISOString()} Calling API FindListItems`); + return this.kbnClient + .request<FindListItemsResponse>({ + path: '/api/lists/items/_find', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'GET', + + query: props.query, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Get a paginated subset of lists. By default, the first page is returned, with 20 results per page. + */ + async findLists(props: FindListsProps) { + this.log.info(`${new Date().toISOString()} Calling API FindLists`); + return this.kbnClient + .request<FindListsResponse>({ + path: '/api/lists/_find', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'GET', + + query: props.query, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Import list items from a TXT or CSV file. The maximum file size is 9 million bytes. + +You can import items to a new or existing list. + + */ + async importListItems(props: ImportListItemsProps) { + this.log.info(`${new Date().toISOString()} Calling API ImportListItems`); + return this.kbnClient + .request<ImportListItemsResponse>({ + path: '/api/lists/items/_import', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'POST', + body: props.attachment, + query: props.query, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Update specific fields of an existing list using the list ID. + */ + async patchList(props: PatchListProps) { + this.log.info(`${new Date().toISOString()} Calling API PatchList`); + return this.kbnClient + .request<PatchListResponse>({ + path: '/api/lists', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'PATCH', + body: props.body, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Update specific fields of an existing list item using the list item ID. + */ + async patchListItem(props: PatchListItemProps) { + this.log.info(`${new Date().toISOString()} Calling API PatchListItem`); + return this.kbnClient + .request<PatchListItemResponse>({ + path: '/api/lists/items', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'PATCH', + body: props.body, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Get the details of a list using the list ID. + */ + async readList(props: ReadListProps) { + this.log.info(`${new Date().toISOString()} Calling API ReadList`); + return this.kbnClient + .request<ReadListResponse>({ + path: '/api/lists', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'GET', + + query: props.query, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Verify that `.lists` and `.items` data streams exist. + */ + async readListIndex() { + this.log.info(`${new Date().toISOString()} Calling API ReadListIndex`); + return this.kbnClient + .request<ReadListIndexResponse>({ + path: '/api/lists/index', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'GET', + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Get the details of a list item. + */ + async readListItem(props: ReadListItemProps) { + this.log.info(`${new Date().toISOString()} Calling API ReadListItem`); + return this.kbnClient + .request<ReadListItemResponse>({ + path: '/api/lists/items', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'GET', + + query: props.query, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + async readListPrivileges() { + this.log.info(`${new Date().toISOString()} Calling API ReadListPrivileges`); + return this.kbnClient + .request<ReadListPrivilegesResponse>({ + path: '/api/lists/privileges', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'GET', + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Update a list using the list ID. The original list is replaced, and all unspecified fields are deleted. +> info +> You cannot modify the `id` value. + + */ + async updateList(props: UpdateListProps) { + this.log.info(`${new Date().toISOString()} Calling API UpdateList`); + return this.kbnClient + .request<UpdateListResponse>({ + path: '/api/lists', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'PUT', + body: props.body, + }) + .catch(catchAxiosErrorFormatAndThrow); + } + /** + * Update a list item using the list item ID. The original list item is replaced, and all unspecified fields are deleted. +> info +> You cannot modify the `id` value. + + */ + async updateListItem(props: UpdateListItemProps) { + this.log.info(`${new Date().toISOString()} Calling API UpdateListItem`); + return this.kbnClient + .request<UpdateListItemResponse>({ + path: '/api/lists/items', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'PUT', + body: props.body, + }) + .catch(catchAxiosErrorFormatAndThrow); + } +} + +export interface CreateListProps { + body: CreateListRequestBodyInput; +} +export interface CreateListItemProps { + body: CreateListItemRequestBodyInput; +} +export interface DeleteListProps { + query: DeleteListRequestQueryInput; +} +export interface DeleteListItemProps { + query: DeleteListItemRequestQueryInput; +} +export interface ExportListItemsProps { + query: ExportListItemsRequestQueryInput; +} +export interface FindListItemsProps { + query: FindListItemsRequestQueryInput; +} +export interface FindListsProps { + query: FindListsRequestQueryInput; +} +export interface ImportListItemsProps { + query: ImportListItemsRequestQueryInput; + attachment: FormData; +} +export interface PatchListProps { + body: PatchListRequestBodyInput; +} +export interface PatchListItemProps { + body: PatchListItemRequestBodyInput; +} +export interface ReadListProps { + query: ReadListRequestQueryInput; +} +export interface ReadListItemProps { + query: ReadListItemRequestQueryInput; +} +export interface UpdateListProps { + body: UpdateListRequestBodyInput; +} +export interface UpdateListItemProps { + body: UpdateListItemRequestBodyInput; +} diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list/read_list.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list/read_list.gen.ts new file mode 100644 index 0000000000000..d2967d71d57e5 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list/read_list.gen.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. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Read list API endpoint + * version: 2023-10-31 + */ + +import { z } from '@kbn/zod'; + +import { ListId } from '../model/list_common.gen'; +import { List } from '../model/list_schemas.gen'; + +export type ReadListRequestQuery = z.infer<typeof ReadListRequestQuery>; +export const ReadListRequestQuery = z.object({ + /** + * List's `id` value + */ + id: ListId, +}); +export type ReadListRequestQueryInput = z.input<typeof ReadListRequestQuery>; + +export type ReadListResponse = z.infer<typeof ReadListResponse>; +export const ReadListResponse = List; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list/read_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list/read_list.schema.yaml new file mode 100644 index 0000000000000..e4a72d6555096 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list/read_list.schema.yaml @@ -0,0 +1,58 @@ +openapi: 3.0.0 +info: + title: Read list API endpoint + version: '2023-10-31' +paths: + /api/lists: + get: + x-labels: [serverless, ess] + operationId: ReadList + x-codegen-enabled: true + summary: Get list details + description: Get the details of a list using the list ID. + parameters: + - name: id + in: query + required: true + description: List's `id` value + schema: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' + responses: + 200: + description: Successful response + content: + application/json: + schema: + $ref: '../model/list_schemas.schema.yaml#/components/schemas/List' + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 404: + description: List not found response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.gen.ts new file mode 100644 index 0000000000000..bf0aec4dc6bcf --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.gen.ts @@ -0,0 +1,23 @@ +/* + * 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. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Read list DS existence status API endpoint + * version: 2023-10-31 + */ + +import { z } from '@kbn/zod'; + +export type ReadListIndexResponse = z.infer<typeof ReadListIndexResponse>; +export const ReadListIndexResponse = z.object({ + list_index: z.boolean(), + list_item_index: z.boolean(), +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.schema.yaml new file mode 100644 index 0000000000000..b06b78ac34147 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_index/read_list_index.schema.yaml @@ -0,0 +1,57 @@ +openapi: 3.0.0 +info: + title: Read list DS existence status API endpoint + version: '2023-10-31' +paths: + /api/lists/index: + get: + x-labels: [serverless, ess] + operationId: ReadListIndex + x-codegen-enabled: true + summary: Get status of list data streams + description: Verify that `.lists` and `.items` data streams exist. + responses: + 200: + description: Successful response + content: + application/json: + schema: + type: object + properties: + list_index: + type: boolean + list_item_index: + type: boolean + required: [list_index, list_item_index] + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 404: + description: List data stream(s) not found response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.gen.ts new file mode 100644 index 0000000000000..d22ee46022266 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.gen.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. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Read list item API endpoint + * version: 2023-10-31 + */ + +import { z } from '@kbn/zod'; + +import { ListId } from '../model/list_common.gen'; +import { ListItem } from '../model/list_schemas.gen'; + +export type ReadListItemRequestQuery = z.infer<typeof ReadListItemRequestQuery>; +export const ReadListItemRequestQuery = z.object({ + /** + * Required if `list_id` and `value` are not specified + */ + id: ListId.optional(), + /** + * Required if `id` is not specified + */ + list_id: ListId.optional(), + /** + * Required if `id` is not specified + */ + value: z.string().optional(), +}); +export type ReadListItemRequestQueryInput = z.input<typeof ReadListItemRequestQuery>; + +export type ReadListItemResponse = z.infer<typeof ReadListItemResponse>; +export const ReadListItemResponse = z.union([ListItem, z.array(ListItem)]); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.schema.yaml new file mode 100644 index 0000000000000..c1bb0697152bd --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_item/read_list_item.schema.yaml @@ -0,0 +1,74 @@ +openapi: 3.0.0 +info: + title: Read list item API endpoint + version: '2023-10-31' +paths: + /api/lists/items: + get: + x-labels: [serverless, ess] + operationId: ReadListItem + x-codegen-enabled: true + summary: Get a list item + description: Get the details of a list item. + parameters: + - name: id + in: query + required: false + description: Required if `list_id` and `value` are not specified + schema: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' + - name: list_id + in: query + required: false + description: Required if `id` is not specified + schema: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' + - name: value + in: query + required: false + description: Required if `id` is not specified + schema: + type: string + responses: + 200: + description: Successful response + content: + application/json: + schema: + oneOf: + - $ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem' + - type: array + items: + $ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem' + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 404: + description: List item not found response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.gen.ts similarity index 76% rename from packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.gen.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.gen.ts index 356915ba03cff..da6e7e95076da 100644 --- a/packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.gen.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.gen.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ /* diff --git a/packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.schema.yaml similarity index 75% rename from packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.schema.yaml index ec8604e80694e..d51e420aa4a94 100644 --- a/packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.schema.yaml +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/read_list_privileges/read_list_privileges.schema.yaml @@ -33,26 +33,26 @@ paths: application/json: schema: oneOf: - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' - - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' 401: description: Unsuccessful authentication response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 403: description: Not enough privileges response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' 500: description: Internal server error response content: application/json: schema: - $ref: '../../../kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' components: schemas: diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list/update_list.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list/update_list.gen.ts new file mode 100644 index 0000000000000..ffb28c3d0b530 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list/update_list.gen.ts @@ -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. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Update list API endpoint + * version: 2023-10-31 + */ + +import { z } from '@kbn/zod'; + +import { ListId, ListName, ListDescription, ListMetadata } from '../model/list_common.gen'; +import { List } from '../model/list_schemas.gen'; + +export type UpdateListRequestBody = z.infer<typeof UpdateListRequestBody>; +export const UpdateListRequestBody = z.object({ + id: ListId, + name: ListName, + description: ListDescription, + meta: ListMetadata.optional(), + version: z.number().int().min(1).optional(), + _version: z.string().optional(), +}); +export type UpdateListRequestBodyInput = z.input<typeof UpdateListRequestBody>; + +export type UpdateListResponse = z.infer<typeof UpdateListResponse>; +export const UpdateListResponse = List; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list/update_list.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list/update_list.schema.yaml new file mode 100644 index 0000000000000..077a96d25d9ed --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list/update_list.schema.yaml @@ -0,0 +1,79 @@ +openapi: 3.0.0 +info: + title: Update list API endpoint + version: '2023-10-31' +paths: + /api/lists: + put: + x-labels: [serverless, ess] + operationId: UpdateList + x-codegen-enabled: true + summary: Update a list + description: | + Update a list using the list ID. The original list is replaced, and all unspecified fields are deleted. + > info + > You cannot modify the `id` value. + requestBody: + description: List's properties + required: true + content: + application/json: + schema: + type: object + properties: + id: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListId' + name: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListName' + description: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListDescription' + meta: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListMetadata' + version: + type: integer + minimum: 1 + _version: + type: string + required: + - id + - name + - description + responses: + 200: + description: Successful response + content: + application/json: + schema: + $ref: '../model/list_schemas.schema.yaml#/components/schemas/List' + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 404: + description: List not found response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.gen.ts b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.gen.ts new file mode 100644 index 0000000000000..f5667676ab4c6 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.gen.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. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Update list item API endpoint + * version: 2023-10-31 + */ + +import { z } from '@kbn/zod'; + +import { ListItemId, ListItemValue, ListItemMetadata } from '../model/list_common.gen'; +import { ListItem } from '../model/list_schemas.gen'; + +export type UpdateListItemRequestBody = z.infer<typeof UpdateListItemRequestBody>; +export const UpdateListItemRequestBody = z.object({ + id: ListItemId, + value: ListItemValue, + meta: ListItemMetadata.optional(), + _version: z.string().optional(), +}); +export type UpdateListItemRequestBodyInput = z.input<typeof UpdateListItemRequestBody>; + +export type UpdateListItemResponse = z.infer<typeof UpdateListItemResponse>; +export const UpdateListItemResponse = ListItem; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.schema.yaml new file mode 100644 index 0000000000000..8971372210475 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/update_list_item/update_list_item.schema.yaml @@ -0,0 +1,73 @@ +openapi: 3.0.0 +info: + title: Update list item API endpoint + version: '2023-10-31' +paths: + /api/lists/items: + put: + x-labels: [serverless, ess] + operationId: UpdateListItem + x-codegen-enabled: true + summary: Update a list item + description: | + Update a list item using the list item ID. The original list item is replaced, and all unspecified fields are deleted. + > info + > You cannot modify the `id` value. + requestBody: + description: List item's properties + required: true + content: + application/json: + schema: + type: object + properties: + id: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListItemId' + value: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListItemValue' + meta: + $ref: '../model/list_common.schema.yaml#/components/schemas/ListItemMetadata' + _version: + type: string + required: + - id + - value + responses: + 200: + description: Successful response + content: + application/json: + schema: + $ref: '../model/list_schemas.schema.yaml#/components/schemas/ListItem' + 400: + description: Invalid input data response + content: + application/json: + schema: + oneOf: + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + - $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 401: + description: Unsuccessful authentication response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 403: + description: Not enough privileges response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/PlatformErrorResponse' + 404: + description: List item not found response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' + 500: + description: Internal server error response + content: + application/json: + schema: + $ref: '../../../../../../../src/platform/packages/shared/kbn-openapi-common/schemas/error_responses.schema.yaml#/components/schemas/SiemErrorResponse' diff --git a/packages/kbn-securitysolution-lists-common/docs/openapi/ess/security_solution_lists_api_2023_10_31.bundled.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/docs/openapi/ess/security_solution_lists_api_2023_10_31.bundled.schema.yaml similarity index 100% rename from packages/kbn-securitysolution-lists-common/docs/openapi/ess/security_solution_lists_api_2023_10_31.bundled.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-lists-common/docs/openapi/ess/security_solution_lists_api_2023_10_31.bundled.schema.yaml diff --git a/packages/kbn-securitysolution-lists-common/docs/openapi/serverless/security_solution_lists_api_2023_10_31.bundled.schema.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/docs/openapi/serverless/security_solution_lists_api_2023_10_31.bundled.schema.yaml similarity index 100% rename from packages/kbn-securitysolution-lists-common/docs/openapi/serverless/security_solution_lists_api_2023_10_31.bundled.schema.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-lists-common/docs/openapi/serverless/security_solution_lists_api_2023_10_31.bundled.schema.yaml diff --git a/packages/kbn-securitysolution-lists-common/kibana.jsonc b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/kibana.jsonc similarity index 100% rename from packages/kbn-securitysolution-lists-common/kibana.jsonc rename to x-pack/solutions/security/packages/kbn-securitysolution-lists-common/kibana.jsonc diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/package.json b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/package.json new file mode 100644 index 0000000000000..4e2b035218592 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/package.json @@ -0,0 +1,11 @@ +{ + "description": "Security Solution Lists common package", + "license": "Elastic License 2.0", + "name": "@kbn/securitysolution-lists-common", + "private": true, + "version": "1.0.0", + "scripts": { + "openapi:generate": "node scripts/openapi_generate", + "openapi:bundle": "node scripts/openapi_bundle" + } +} diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle.js b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle.js new file mode 100644 index 0000000000000..609ed8bb08078 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle.js @@ -0,0 +1,39 @@ +/* + * 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. + */ + +require('../../../../../../src/setup_node_env'); +// eslint-disable-next-line import/no-nodejs-modules +const { join, resolve } = require('path'); +const { bundle } = require('@kbn/openapi-bundler'); + +const ROOT = resolve(__dirname, '..'); + +(async () => { + await bundle({ + sourceGlob: join(ROOT, 'api/**/*.schema.yaml'), + outputFilePath: join( + ROOT, + 'docs/openapi/serverless/security_solution_lists_api_{version}.bundled.schema.yaml' + ), + options: { + includeLabels: ['serverless'], + prototypeDocument: join(ROOT, 'scripts/openapi_bundle_info/lists_serverless.info.yaml'), + }, + }); + + await bundle({ + sourceGlob: join(ROOT, 'api/**/*.schema.yaml'), + outputFilePath: join( + ROOT, + 'docs/openapi/ess/security_solution_lists_api_{version}.bundled.schema.yaml' + ), + options: { + includeLabels: ['ess'], + prototypeDocument: join(ROOT, 'scripts/openapi_bundle_info/lists_ess.info.yaml'), + }, + }); +})(); diff --git a/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle_info/lists_ess.info.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle_info/lists_ess.info.yaml similarity index 100% rename from packages/kbn-securitysolution-lists-common/scripts/openapi_bundle_info/lists_ess.info.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle_info/lists_ess.info.yaml diff --git a/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle_info/lists_serverless.info.yaml b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle_info/lists_serverless.info.yaml similarity index 100% rename from packages/kbn-securitysolution-lists-common/scripts/openapi_bundle_info/lists_serverless.info.yaml rename to x-pack/solutions/security/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle_info/lists_serverless.info.yaml diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/scripts/openapi_generate.js b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/scripts/openapi_generate.js new file mode 100644 index 0000000000000..ecda1a791e1fc --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/scripts/openapi_generate.js @@ -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. + */ + +require('../../../../../../src/setup_node_env'); +// eslint-disable-next-line import/no-nodejs-modules +const { join, resolve } = require('path'); +const { generate } = require('@kbn/openapi-generator'); +const { REPO_ROOT } = require('@kbn/repo-info'); + +const ROOT = resolve(__dirname, '..'); + +(async () => { + await generate({ + title: 'OpenAPI Lists API Schemas', + rootDir: ROOT, + sourceGlob: './api/**/*.schema.yaml', + templateName: 'zod_operation_schema', + }); + + await generate({ + title: 'Lists API client for tests', + rootDir: ROOT, + sourceGlob: './api/**/*.schema.yaml', + templateName: 'api_client_supertest', + skipLinting: true, + bundle: { + outFile: join( + REPO_ROOT, + 'x-pack/test/api_integration/services/security_solution_lists_api.gen.ts' + ), + }, + }); + + await generate({ + title: 'Lists API client for quickstart', + rootDir: ROOT, + sourceGlob: './api/**/*.schema.yaml', + templateName: 'api_client_quickstart', + skipLinting: true, + bundle: { + outFile: join( + REPO_ROOT, + 'x-pack/solutions/security/packages/kbn-securitysolution-lists-common/api/quickstart_client.gen.ts' + ), + }, + }); +})(); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/tsconfig.json b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/tsconfig.json new file mode 100644 index 0000000000000..6a6637ff64a2c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-lists-common/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "outDir": "target/types", + "types": ["jest", "node"] + }, + "exclude": ["target/**/*"], + "extends": "../../../../../tsconfig.base.json", + "include": ["**/*.ts"], + "kbn_references": [ + "@kbn/zod-helpers", + "@kbn/openapi-common", + "@kbn/test", + "@kbn/tooling-log", + "@kbn/core-http-common", + "@kbn/securitysolution-utils", + "@kbn/zod", + ] +} diff --git a/packages/kbn-securitysolution-t-grid/README.md b/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/README.md similarity index 100% rename from packages/kbn-securitysolution-t-grid/README.md rename to x-pack/solutions/security/packages/kbn-securitysolution-t-grid/README.md diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/index.ts new file mode 100644 index 0000000000000..371d48e06c148 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/index.ts @@ -0,0 +1,11 @@ +/* + * 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. + */ + +export * from './src/constants'; +export * from './src/utils'; +// eslint-disable-next-line @kbn/imports/no_boundary_crossing +export * from './src/mock'; diff --git a/packages/kbn-securitysolution-t-grid/kibana.jsonc b/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/kibana.jsonc similarity index 100% rename from packages/kbn-securitysolution-t-grid/kibana.jsonc rename to x-pack/solutions/security/packages/kbn-securitysolution-t-grid/kibana.jsonc diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/package.json b/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/package.json new file mode 100644 index 0000000000000..d2f04084da369 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/securitysolution-t-grid", + "version": "1.0.0", + "description": "security solution t-grid packages will allow sharing components between timelines and security_solution plugin until we transfer all functionality to timelines plugin", + "license": "Elastic License 2.0", + "private": true +} \ No newline at end of file diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/src/constants/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/src/constants/index.ts new file mode 100644 index 0000000000000..a57893d639955 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/src/constants/index.ts @@ -0,0 +1,25 @@ +/* + * 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. + */ + +export const HIGHLIGHTED_DROP_TARGET_CLASS_NAME = 'highlighted-drop-target'; +export const EMPTY_PROVIDERS_GROUP_CLASS_NAME = 'empty-providers-group'; + +/** The draggable will move this many pixels via the keyboard when the arrow key is pressed */ +export const KEYBOARD_DRAG_OFFSET = 20; + +export const DRAGGABLE_KEYBOARD_WRAPPER_CLASS_NAME = 'draggable-keyboard-wrapper'; + +export const ROW_RENDERER_CLASS_NAME = 'row-renderer'; + +export const NOTES_CONTAINER_CLASS_NAME = 'notes-container'; + +export const NOTE_CONTENT_CLASS_NAME = 'note-content'; + +/** This class is added to the document body while dragging */ +export const IS_DRAGGING_CLASS_NAME = 'is-dragging'; + +export const HOVER_ACTIONS_ALWAYS_SHOW_CLASS_NAME = 'hover-actions-always-show'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/src/mock/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/src/mock/index.ts new file mode 100644 index 0000000000000..770bf1ffb0189 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/src/mock/index.ts @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export * from './mock_event_details'; diff --git a/packages/kbn-securitysolution-t-grid/src/mock/mock_event_details.ts b/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/src/mock/mock_event_details.ts similarity index 97% rename from packages/kbn-securitysolution-t-grid/src/mock/mock_event_details.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-t-grid/src/mock/mock_event_details.ts index 5152132cda4bb..538f6fa2cadc0 100644 --- a/packages/kbn-securitysolution-t-grid/src/mock/mock_event_details.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/src/mock/mock_event_details.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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. */ export const eventHit = { diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/src/utils/api/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/src/utils/api/index.ts new file mode 100644 index 0000000000000..add7df10fe13e --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/src/utils/api/index.ts @@ -0,0 +1,41 @@ +/* + * 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 { has } from 'lodash/fp'; + +export interface AppError extends Error { + body: { + message: string; + }; +} + +export interface KibanaError extends AppError { + body: { + message: string; + statusCode: number; + }; +} + +export interface SecurityAppError extends AppError { + body: { + message: string; + status_code: number; + }; +} + +export const isKibanaError = (error: unknown): error is KibanaError => + has('message', error) && has('body.message', error) && has('body.statusCode', error); + +export const isSecurityAppError = (error: unknown): error is SecurityAppError => + has('message', error) && has('body.message', error) && has('body.status_code', error); + +export const isAppError = (error: unknown): error is AppError => + isKibanaError(error) || isSecurityAppError(error); + +export const isNotFoundError = (error: unknown) => + (isKibanaError(error) && error.body.statusCode === 404) || + (isSecurityAppError(error) && error.body.status_code === 404); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/src/utils/drag_and_drop/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/src/utils/drag_and_drop/index.ts new file mode 100644 index 0000000000000..d954ebb055f1d --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/src/utils/drag_and_drop/index.ts @@ -0,0 +1,132 @@ +/* + * 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 { DropResult } from '@hello-pangea/dnd'; + +export const draggableIdPrefix = 'draggableId'; + +export const droppableIdPrefix = 'droppableId'; + +export const draggableContentPrefix = `${draggableIdPrefix}.content.`; + +export const draggableTimelineProvidersPrefix = `${draggableIdPrefix}.timelineProviders.`; + +export const draggableFieldPrefix = `${draggableIdPrefix}.field.`; + +export const droppableContentPrefix = `${droppableIdPrefix}.content.`; + +export const droppableFieldPrefix = `${droppableIdPrefix}.field.`; + +export const droppableTimelineProvidersPrefix = `${droppableIdPrefix}.timelineProviders.`; + +export const droppableTimelineColumnsPrefix = `${droppableIdPrefix}.timelineColumns.`; + +export const droppableTimelineFlyoutBottomBarPrefix = `${droppableIdPrefix}.flyoutButton.`; + +export const getDraggableId = (dataProviderId: string): string => + `${draggableContentPrefix}${dataProviderId}`; + +export const getDraggableFieldId = ({ + contextId, + fieldId, +}: { + contextId: string; + fieldId: string; +}): string => `${draggableFieldPrefix}${escapeContextId(contextId)}.${escapeFieldId(fieldId)}`; + +export const getTimelineProviderDroppableId = ({ + groupIndex, + timelineId, +}: { + groupIndex: number; + timelineId: string; +}): string => `${droppableTimelineProvidersPrefix}${timelineId}.group.${groupIndex}`; + +export const getTimelineProviderDraggableId = ({ + dataProviderId, + groupIndex, + timelineId, +}: { + dataProviderId: string; + groupIndex: number; + timelineId: string; +}): string => + `${draggableTimelineProvidersPrefix}${timelineId}.group.${groupIndex}.${dataProviderId}`; + +export const getDroppableId = (visualizationPlaceholderId: string): string => + `${droppableContentPrefix}${visualizationPlaceholderId}`; + +export const sourceIsContent = (result: DropResult): boolean => + result.source.droppableId.startsWith(droppableContentPrefix); + +export const sourceAndDestinationAreSameTimelineProviders = (result: DropResult): boolean => { + const regex = /^droppableId\.timelineProviders\.(\S+)\./; + const sourceMatches = result.source.droppableId.match(regex) || []; + const destinationMatches = + (result.destination && result.destination.droppableId.match(regex)) || []; + + return ( + sourceMatches.length >= 2 && + destinationMatches.length >= 2 && + sourceMatches[1] === destinationMatches[1] + ); +}; + +export const draggableIsContent = (result: DropResult | { draggableId: string }): boolean => + result.draggableId.startsWith(draggableContentPrefix); + +export const draggableIsField = (result: DropResult | { draggableId: string }): boolean => + result.draggableId.startsWith(draggableFieldPrefix); + +export const reasonIsDrop = (result: DropResult): boolean => result.reason === 'DROP'; + +export const destinationIsTimelineProviders = (result: DropResult): boolean => + result.destination != null && + result.destination.droppableId.startsWith(droppableTimelineProvidersPrefix); + +export const destinationIsTimelineColumns = (result: DropResult): boolean => + result.destination != null && + result.destination.droppableId.startsWith(droppableTimelineColumnsPrefix); + +export const destinationIsTimelineButton = (result: DropResult): boolean => + result.destination != null && + result.destination.droppableId.startsWith(droppableTimelineFlyoutBottomBarPrefix); + +export const getProviderIdFromDraggable = (result: DropResult): string => + result.draggableId.substring(result.draggableId.lastIndexOf('.') + 1); + +export const getFieldIdFromDraggable = (result: DropResult): string => + unEscapeFieldId(result.draggableId.substring(result.draggableId.lastIndexOf('.') + 1)); + +export const escapeDataProviderId = (path: string) => path.replace(/\./g, '_'); + +export const escapeContextId = (path: string) => path.replace(/\./g, '_'); + +export const escapeFieldId = (path: string) => path.replace(/\./g, '!!!DOT!!!'); + +export const unEscapeFieldId = (path: string) => path.replace(/!!!DOT!!!/g, '.'); + +export const providerWasDroppedOnTimeline = (result: DropResult): boolean => + reasonIsDrop(result) && + draggableIsContent(result) && + sourceIsContent(result) && + destinationIsTimelineProviders(result); + +export const userIsReArrangingProviders = (result: DropResult): boolean => + reasonIsDrop(result) && sourceAndDestinationAreSameTimelineProviders(result); + +export const fieldWasDroppedOnTimelineColumns = (result: DropResult): boolean => + reasonIsDrop(result) && draggableIsField(result) && destinationIsTimelineColumns(result); + +/** + * Prevents fields from being dragged or dropped to any area other than column + * header drop zone in the timeline + */ +export const DRAG_TYPE_FIELD = 'drag-type-field'; + +/** This class is added to the document body while timeline field dragging */ +export const IS_TIMELINE_FIELD_DRAGGING_CLASS_NAME = 'is-timeline-field-dragging'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/src/utils/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/src/utils/index.ts new file mode 100644 index 0000000000000..cafe8ec570c86 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/src/utils/index.ts @@ -0,0 +1,9 @@ +/* + * 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. + */ + +export * from './api'; +export * from './drag_and_drop'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/tsconfig.json b/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/tsconfig.json new file mode 100644 index 0000000000000..131ff3e6bb433 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-t-grid/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts" + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/packages/kbn-securitysolution-utils/README.md b/x-pack/solutions/security/packages/kbn-securitysolution-utils/README.md similarity index 100% rename from packages/kbn-securitysolution-utils/README.md rename to x-pack/solutions/security/packages/kbn-securitysolution-utils/README.md diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-utils/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-utils/index.ts new file mode 100644 index 0000000000000..dcf5ee7c47791 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/index.ts @@ -0,0 +1,13 @@ +/* + * 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. + */ + +export * from './src/add_remove_id_to_item'; +export * from './src/axios'; +export * from './src/transform_data_to_ndjson'; +export * from './src/path_validations'; +export * from './src/esql'; +export * from './src/debounce_async/debounce_async'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-utils/jest.config.js b/x-pack/solutions/security/packages/kbn-securitysolution-utils/jest.config.js new file mode 100644 index 0000000000000..c25893390c684 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/jest.config.js @@ -0,0 +1,12 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/packages/kbn-securitysolution-utils'], +}; diff --git a/packages/kbn-securitysolution-utils/kibana.jsonc b/x-pack/solutions/security/packages/kbn-securitysolution-utils/kibana.jsonc similarity index 100% rename from packages/kbn-securitysolution-utils/kibana.jsonc rename to x-pack/solutions/security/packages/kbn-securitysolution-utils/kibana.jsonc diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-utils/package.json b/x-pack/solutions/security/packages/kbn-securitysolution-utils/package.json new file mode 100644 index 0000000000000..d9311ef37a28b --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/package.json @@ -0,0 +1,8 @@ +{ + "name": "@kbn/securitysolution-utils", + "version": "1.0.0", + "description": "security solution utilities to use across plugins such lists, security_solution, cases, etc...", + "license": "Elastic License 2.0", + "private": true, + "sideEffects": false +} \ No newline at end of file diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/add_remove_id_to_item/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/add_remove_id_to_item/index.test.ts new file mode 100644 index 0000000000000..13d13b2acf89c --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/add_remove_id_to_item/index.test.ts @@ -0,0 +1,77 @@ +/* + * 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 { addIdToItem, removeIdFromItem } from '.'; + +jest.mock('uuid', () => ({ + v4: jest.fn().mockReturnValue('123'), +})); + +describe('add_remove_id_to_item', () => { + afterEach(() => { + jest.clearAllMocks(); + }); + + describe('addIdToItem', () => { + test('it adds an id to an empty item', () => { + expect(addIdToItem({})).toEqual({ id: '123' }); + }); + + test('it adds a complex object', () => { + expect( + addIdToItem({ + field: '', + type: 'mapping', + value: '', + }) + ).toEqual({ + id: '123', + field: '', + type: 'mapping', + value: '', + }); + }); + + test('it adds an id to an existing item', () => { + expect(addIdToItem({ test: '456' })).toEqual({ id: '123', test: '456' }); + }); + + test('it does not change the id if it already exists', () => { + expect(addIdToItem({ id: '456' })).toEqual({ id: '456' }); + }); + + test('it returns the same reference if it has an id already', () => { + const obj = { id: '456' }; + expect(addIdToItem(obj)).toBe(obj); + }); + + test('it returns a new reference if it adds an id to an item', () => { + const obj = { test: '456' }; + expect(addIdToItem(obj)).not.toBe(obj); + }); + }); + + describe('removeIdFromItem', () => { + test('it removes an id from an item', () => { + expect(removeIdFromItem({ id: '456' })).toEqual({}); + }); + + test('it returns a new reference if it removes an id from an item', () => { + const obj = { id: '123', test: '456' }; + expect(removeIdFromItem(obj)).not.toBe(obj); + }); + + test('it does not effect an item without an id', () => { + expect(removeIdFromItem({ test: '456' })).toEqual({ test: '456' }); + }); + + test('it returns the same reference if it does not have an id already', () => { + const obj = { test: '456' }; + expect(removeIdFromItem(obj)).toBe(obj); + }); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/add_remove_id_to_item/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/add_remove_id_to_item/index.ts new file mode 100644 index 0000000000000..5133a13bdbecf --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/add_remove_id_to_item/index.ts @@ -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 { v4 as uuidv4 } from 'uuid'; + +/** + * This is useful for when you have arrays without an ID and need to add one for + * ReactJS keys. I break the types slightly by introducing an id to an arbitrary item + * but then cast it back to the regular type T. + * Usage of this could be considered tech debt as I am adding an ID when the backend + * could be doing the same thing but it depends on how you want to model your data and + * if you view modeling your data with id's to please ReactJS a good or bad thing. + * @param item The item to add an id to. + */ +type NotArray<T> = T extends unknown[] ? never : T; +export const addIdToItem = <T>(item: NotArray<T>): T => { + const maybeId = item as typeof item & { id?: string }; + if (maybeId.id != null) { + return item; + } else { + return { ...item, id: uuidv4() }; + } +}; + +/** + * This is to reverse the id you added to your arrays for ReactJS keys. + * @param item The item to remove the id from. + */ +export const removeIdFromItem = <T>( + item: NotArray<T> +): + | T + | Pick< + T & { + id?: string | undefined; + }, + Exclude<keyof T, 'id'> + > => { + const maybeId = item as typeof item & { id?: string }; + if (maybeId.id != null) { + const { id, ...noId } = maybeId; + return noId; + } else { + return item; + } +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/axios/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/axios/index.ts new file mode 100644 index 0000000000000..44972dba93565 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/axios/index.ts @@ -0,0 +1,71 @@ +/* + * 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 { AxiosError } from 'axios'; + +export class FormattedAxiosError extends Error { + public readonly request: { + method: string; + url: string; + data: unknown; + }; + public readonly response: { + status: number; + statusText: string; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + data: any; + }; + + constructor(axiosError: AxiosError) { + const method = axiosError.config?.method ?? ''; + const url = axiosError.config?.url ?? ''; + + super( + `${axiosError.message}${ + axiosError?.response?.data ? `: ${JSON.stringify(axiosError?.response?.data)}` : '' + }${url ? `\n(Request: ${method} ${url})` : ''}` + ); + + this.request = { + method, + url, + data: axiosError.config?.data ?? '', + }; + + this.response = { + status: axiosError?.response?.status ?? 0, + statusText: axiosError?.response?.statusText ?? '', + data: axiosError?.response?.data, + }; + + this.name = this.constructor.name; + } + + toJSON() { + return { + message: this.message, + request: this.request, + response: this.response, + }; + } + + toString() { + return JSON.stringify(this.toJSON(), null, 2); + } +} + +/** + * Used with `promise.catch()`, it will format the Axios error to a new error and will re-throw + * @param error + */ +export const catchAxiosErrorFormatAndThrow = (error: Error): never => { + if (error instanceof AxiosError) { + throw new FormattedAxiosError(error); + } + + throw error; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/client_concurrency/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/client_concurrency/index.ts new file mode 100644 index 0000000000000..3a44e5061d095 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/client_concurrency/index.ts @@ -0,0 +1,35 @@ +/* + * 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 limit from 'p-limit'; + +/** + * This type is just an async function's type + */ +type RequestFactory<Output> = () => Promise<Output>; + +/** + * Helper function to call a large number of async functions with limited concurrency. + * Example pattern of how to create functions to pass in: + * + * const ruleCopies = duplicateRuleParams(basicRule, 200); + * const functions = ruleCopies.map((rule) => () => detectionsClient.createRule({ body: rule })); + * + * Note that the `map` call in the example returns a *function* that calls detectionsClient.createRule, it doesn't call createRule immediately. + * + * @param functions Async functions to call with limited concurrency + * @param concurrency Maximum number of concurrent function calls + * @returns Results from all functions passed in + */ +export const concurrentlyExec = async <Output>( + requestFactories: Array<RequestFactory<Output>>, + concurrency: number = 10 +) => { + const limiter = limit(concurrency); + const promises = requestFactories.map((f) => limiter(f)); + return Promise.all(promises); +}; diff --git a/packages/kbn-securitysolution-utils/src/debounce_async/debounce_async.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/debounce_async/debounce_async.test.ts similarity index 77% rename from packages/kbn-securitysolution-utils/src/debounce_async/debounce_async.test.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-utils/src/debounce_async/debounce_async.test.ts index d7e1201e44e8d..7508e99a891fa 100644 --- a/packages/kbn-securitysolution-utils/src/debounce_async/debounce_async.test.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/debounce_async/debounce_async.test.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { debounceAsync } from './debounce_async'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/debounce_async/debounce_async.ts b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/debounce_async/debounce_async.ts new file mode 100644 index 0000000000000..ac9f2348d0be8 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/debounce_async/debounce_async.ts @@ -0,0 +1,41 @@ +/* + * 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. + */ + +/** + * Unlike lodash's debounce, which resolves intermediate calls with the most + * recent value, this implementation waits to resolve intermediate calls until + * the next invocation resolves. + * + * @param fn an async function + * + * @returns A debounced async function that resolves on the next invocation + */ +export function debounceAsync<Args extends unknown[], Result>( + fn: (...args: Args) => Result, + intervalMs: number +): (...args: Args) => Promise<Awaited<Result>> { + let timeoutId: ReturnType<typeof setTimeout> | undefined; + let resolve: (value: Awaited<Result>) => void; + let promise = new Promise<Awaited<Result>>((_resolve) => { + resolve = _resolve; + }); + + return (...args) => { + if (timeoutId) { + clearTimeout(timeoutId); + } + + timeoutId = setTimeout(async () => { + resolve(await fn(...args)); + promise = new Promise((_resolve) => { + resolve = _resolve; + }); + }, intervalMs); + + return promise; + }; +} diff --git a/packages/kbn-securitysolution-utils/src/esql/compute_if_esql_query_aggregating.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/compute_if_esql_query_aggregating.test.ts similarity index 84% rename from packages/kbn-securitysolution-utils/src/esql/compute_if_esql_query_aggregating.test.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/compute_if_esql_query_aggregating.test.ts index cb92d34b33ec7..41268ac0fa851 100644 --- a/packages/kbn-securitysolution-utils/src/esql/compute_if_esql_query_aggregating.test.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/compute_if_esql_query_aggregating.test.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { computeIsESQLQueryAggregating } from './compute_if_esql_query_aggregating'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/compute_if_esql_query_aggregating.ts b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/compute_if_esql_query_aggregating.ts new file mode 100644 index 0000000000000..d38abdaa481a8 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/compute_if_esql_query_aggregating.ts @@ -0,0 +1,21 @@ +/* + * 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 ESQLAstQueryExpression, parse } from '@kbn/esql-ast'; + +export const isAggregatingQuery = (astExpression: ESQLAstQueryExpression): boolean => + astExpression.commands.some((command) => command.name === 'stats'); + +/** + * compute if esqlQuery is aggregating/grouping, i.e. using STATS...BY command + * @param esqlQuery + * @returns boolean + */ +export const computeIsESQLQueryAggregating = (esqlQuery: string): boolean => { + const { root } = parse(esqlQuery); + return isAggregatingQuery(root); +}; diff --git a/packages/kbn-securitysolution-utils/src/esql/get_index_list_from_esql_query.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/get_index_list_from_esql_query.test.ts similarity index 80% rename from packages/kbn-securitysolution-utils/src/esql/get_index_list_from_esql_query.test.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/get_index_list_from_esql_query.test.ts index 7a7726c47e143..39dc934dcdd2d 100644 --- a/packages/kbn-securitysolution-utils/src/esql/get_index_list_from_esql_query.test.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/get_index_list_from_esql_query.test.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { getIndexPatternFromESQLQuery } from '@kbn/esql-utils'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/get_index_list_from_esql_query.ts b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/get_index_list_from_esql_query.ts new file mode 100644 index 0000000000000..654f09cd0b846 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/get_index_list_from_esql_query.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 { getIndexPatternFromESQLQuery } from '@kbn/esql-utils'; + +/** + * parses ES|QL query and returns array of indices + */ +export const getIndexListFromEsqlQuery = (query: string | undefined): string[] => { + try { + const indexString = getIndexPatternFromESQLQuery(query); + + return getIndexListFromIndexString(indexString); + } catch (e) { + return []; + } +}; + +/** + * transforms sting of indices, separated by commas to array + * index*, index2* => [index*, index2*] + */ +export const getIndexListFromIndexString = (indexString: string | undefined): string[] => { + if (!indexString) { + return []; + } + return indexString.split(',').map((index) => index.trim()); +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/index.ts new file mode 100644 index 0000000000000..ff6f8a4552446 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/index.ts @@ -0,0 +1,10 @@ +/* + * 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. + */ + +export * from './compute_if_esql_query_aggregating'; +export * from './get_index_list_from_esql_query'; +export * from './parse_esql_query'; diff --git a/packages/kbn-securitysolution-utils/src/esql/parse_esql_query.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/parse_esql_query.test.ts similarity index 90% rename from packages/kbn-securitysolution-utils/src/esql/parse_esql_query.test.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/parse_esql_query.test.ts index 6c4fdafd8e70b..1e7484fd6e4b5 100644 --- a/packages/kbn-securitysolution-utils/src/esql/parse_esql_query.test.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/parse_esql_query.test.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 { parseEsqlQuery } from './parse_esql_query'; diff --git a/packages/kbn-securitysolution-utils/src/esql/parse_esql_query.ts b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/parse_esql_query.ts similarity index 83% rename from packages/kbn-securitysolution-utils/src/esql/parse_esql_query.ts rename to x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/parse_esql_query.ts index 2a62aed8873a0..6e088bf386fbb 100644 --- a/packages/kbn-securitysolution-utils/src/esql/parse_esql_query.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/esql/parse_esql_query.ts @@ -1,10 +1,8 @@ /* * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * 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 ESQLAstQueryExpression, parse, ESQLCommandOption, EditorError } from '@kbn/esql-ast'; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/path_validations/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/path_validations/index.test.ts new file mode 100644 index 0000000000000..5304c3a710613 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/path_validations/index.test.ts @@ -0,0 +1,758 @@ +/* + * 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 { + isPathValid, + hasSimpleExecutableName, + OperatingSystem, + ConditionEntryField, + validateWildcardInput, + validateHasWildcardWithWrongOperator, + validatePotentialWildcardInput, + validateFilePathInput, + WILDCARD_WARNING, + FILEPATH_WARNING, +} from '.'; + +describe('validatePotentialWildcardInput', () => { + it('warns on wildcard when field is file.path.text', () => { + expect( + validatePotentialWildcardInput({ + field: 'file.path.text', + os: OperatingSystem.WINDOWS, + value: 'c:\\path*.exe', + }) + ).toEqual(WILDCARD_WARNING); + }); + it('warns on wildcard when field is not file.path.text', () => { + expect( + validatePotentialWildcardInput({ + field: 'event.category', + os: OperatingSystem.WINDOWS, + value: 'some*value', + }) + ).toEqual(WILDCARD_WARNING); + }); +}); + +describe('validateWildcardInput', () => { + it('warns on wildcard for fields that are not file paths', () => { + expect(validateWildcardInput('*')).toEqual(WILDCARD_WARNING); + }); + it('does not warn if no wildcard', () => { + expect(validateWildcardInput('non-wildcard')).toEqual(undefined); + }); +}); + +describe('validateFilePathInput', () => { + describe('windows', () => { + const os = OperatingSystem.WINDOWS; + + it('does not warn on valid filenames', () => { + expect( + validateFilePathInput({ + os, + value: 'C:\\Windows\\*\\FILENAME.EXE-1231205124.gz', + }) + ).not.toBeDefined(); + expect( + validateFilePathInput({ + os, + value: "C:\\Windows\\*\\test$ as2@13---12!@#A,DS.#$^&$!#~ 'as'd.华语.txt", + }) + ).toEqual(undefined); + }); + + it('warns on wildcard in file name at the end of the path', () => { + expect(validateFilePathInput({ os, value: 'c:\\path*.exe' })).toEqual(WILDCARD_WARNING); + expect( + validateFilePathInput({ + os, + value: 'C:\\Windows\\*\\FILENAME.EXE-*.gz', + }) + ).toEqual(WILDCARD_WARNING); + }); + + it('warns on unix paths or non-windows paths', () => { + expect(validateFilePathInput({ os, value: '/opt/bin' })).toEqual(FILEPATH_WARNING); + }); + + it('warns on malformed paths', () => { + expect(validateFilePathInput({ os, value: 'c:\\path/opt' })).toEqual(FILEPATH_WARNING); + expect(validateFilePathInput({ os, value: '1242' })).toEqual(FILEPATH_WARNING); + expect(validateFilePathInput({ os, value: 'w12efdfa' })).toEqual(FILEPATH_WARNING); + expect(validateFilePathInput({ os, value: 'c:\\folder\\' })).toEqual(FILEPATH_WARNING); + }); + }); + describe('unix paths', () => { + const os = + parseInt((Math.random() * 2).toString(), 10) === 1 + ? OperatingSystem.MAC + : OperatingSystem.LINUX; + + it('does not warn on valid filenames', () => { + expect( + validateFilePathInput({ + os, + value: '/opt/*/FILENAME.EXE-1231205124.gz', + }) + ).not.toEqual(WILDCARD_WARNING); + expect( + validateFilePathInput({ + os, + value: "/opt/*/test$ as2@13---12!@#A,DS.#$^&$!#~ 'as'd.华语.txt", + }) + ).not.toEqual(WILDCARD_WARNING); + }); + it('warns on wildcard in file name at the end of the path', () => { + expect(validateFilePathInput({ os, value: '/opt/bin*' })).toEqual(WILDCARD_WARNING); + expect(validateFilePathInput({ os, value: '/opt/FILENAME.EXE-*.gz' })).toEqual( + WILDCARD_WARNING + ); + }); + + it('warns on windows paths', () => { + expect(validateFilePathInput({ os, value: 'd:\\path\\file.exe' })).toEqual(FILEPATH_WARNING); + }); + + it('warns on malformed paths', () => { + expect(validateFilePathInput({ os, value: 'opt/bin\\file.exe' })).toEqual(FILEPATH_WARNING); + expect(validateFilePathInput({ os, value: '1242' })).toEqual(FILEPATH_WARNING); + expect(validateFilePathInput({ os, value: 'w12efdfa' })).toEqual(FILEPATH_WARNING); + expect(validateFilePathInput({ os, value: '/folder/' })).toEqual(FILEPATH_WARNING); + }); + }); +}); + +describe('Wildcard and invalid operator', () => { + it('should return TRUE when operator is not "WILDCARD" and value contains a wildcard', () => { + expect(validateHasWildcardWithWrongOperator({ operator: 'match', value: 'asdf*' })).toEqual( + true + ); + }); + it('should return FALSE when operator is not "WILDCARD" and value does not contain a wildcard', () => { + expect(validateHasWildcardWithWrongOperator({ operator: 'match', value: 'asdf' })).toEqual( + false + ); + }); + it('should return FALSE when operator is "WILDCARD" and value contains a wildcard', () => { + expect(validateHasWildcardWithWrongOperator({ operator: 'wildcard', value: 'asdf*' })).toEqual( + false + ); + }); + it('should return FALSE when operator is "WILDCARD" and value does not contain a wildcard', () => { + expect(validateHasWildcardWithWrongOperator({ operator: 'wildcard', value: 'asdf' })).toEqual( + false + ); + }); +}); + +describe('No Warnings', () => { + it('should not show warnings on non path entries ', () => { + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.HASH, + type: 'match', + value: '5d5b09f6dcb2d53a5fffc60c4ac0d55fabdf556069d6631545f42aa6e3500f2e', + }) + ).toEqual(true); + + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.SIGNER, + type: 'match', + value: '', + }) + ).toEqual(true); + }); +}); + +describe('Unacceptable Windows wildcard paths', () => { + it('should not accept paths that do not have a folder name with a wildcard ', () => { + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: 'c:\\folder', + }) + ).toEqual(false); + }); + + it('should not accept paths that do not have a file name with a wildcard ', () => { + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: 'c:\\path.exe', + }) + ).toEqual(false); + }); + + it('should not accept nested paths that do not have a wildcard', () => { + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: 'c:\\folder\\path.exe', + }) + ).toEqual(false); + }); + + it('should not accept paths with * wildcard and /', () => { + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: 'c:/**/path.exe', + }) + ).toEqual(false); + }); + + it('should not accept paths with ? wildcard and /', () => { + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: 'C:/?indows/pat?', + }) + ).toEqual(false); + }); +}); + +describe('Acceptable Windows wildcard paths', () => { + it('should accept wildcards for folders', () => { + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: 'c:\\**\\path.exe', + }) + ).toEqual(true); + }); + + it('should accept wildcards for folders and files', () => { + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: 'e:\\**\\*.exe', + }) + ).toEqual(true); + }); + + it('should accept paths with single wildcard', () => { + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: 'f:\\*', + }) + ).toEqual(true); + + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: 'f:\\?', + }) + ).toEqual(true); + }); + + it('should accept paths that have wildcard in filenames', () => { + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: 'a:\\*.*', + }) + ).toEqual(true); + }); + + it('should accept paths with ? as wildcard', () => { + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: 'C:\\?indows\\pat?', + }) + ).toEqual(true); + }); + + it('should accept paths with both ? and * as wildcards', () => { + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: 'C:\\*?', + }) + ).toEqual(true); + }); + + it('should accept paths with multiple wildcards', () => { + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: 'C:\\**', + }) + ).toEqual(true); + + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: 'C:\\??', + }) + ).toEqual(true); + }); +}); + +describe('Acceptable Windows exact paths', () => { + it('should accept paths when it ends with a folder name', () => { + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'match', + value: 'c:\\folder', + }) + ).toEqual(true); + }); + + it('should accept paths when it ends with a file name', () => { + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'match', + value: 'c:\\path.exe', + }) + ).toEqual(true); + }); + + it('should accept paths when it ends with a filename in a folder', () => { + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'match', + value: 'c:\\folder\\path.exe', + }) + ).toEqual(true); + }); +}); + +describe('Acceptable Windows exact paths with hyphens', () => { + it('should accept paths when paths have folder names with hyphens', () => { + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'match', + value: 'c:\\hype-folder-name', + }) + ).toEqual(true); + }); + + it('should accept paths when file names have hyphens', () => { + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'match', + value: 'c:\\file-name.exe', + }) + ).toEqual(true); + }); +}); + +describe('Unacceptable Windows exact paths', () => { + it('should not accept paths with /', () => { + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'match', + value: 'c:/folder/path.exe', + }) + ).toEqual(false); + }); + + it('should not accept paths not having a <char:> in the suffix', () => { + expect( + isPathValid({ + os: OperatingSystem.WINDOWS, + field: ConditionEntryField.PATH, + type: 'match', + value: '\\folder\\path.exe', + }) + ).toEqual(false); + }); +}); + +/// +describe('Unacceptable Mac/Linux wildcard paths', () => { + it('should not accept paths that do not have a folder name with a wildcard ', () => { + expect( + isPathValid({ + os: OperatingSystem.MAC, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: '/folder', + }) + ).toEqual(false); + }); + + it('should not accept paths that do not have a file name with a wildcard ', () => { + expect( + isPathValid({ + os: OperatingSystem.LINUX, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: '/zip.zip', + }) + ).toEqual(false); + }); + + it('should not accept nested paths that do not have a wildcard', () => { + expect( + isPathValid({ + os: OperatingSystem.MAC, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: '/opt/pack.tar', + }) + ).toEqual(false); + }); + + it('should not accept paths with * wildcard and \\', () => { + expect( + isPathValid({ + os: OperatingSystem.LINUX, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: 'c:\\**\\path.exe', + }) + ).toEqual(false); + }); + + it('should not accept paths with ? wildcard and \\', () => { + expect( + isPathValid({ + os: OperatingSystem.LINUX, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: 'C:\\?indows\\pat?', + }) + ).toEqual(false); + }); +}); + +describe('Acceptable Mac/Linux wildcard paths', () => { + it('should accept wildcards for folders', () => { + expect( + isPathValid({ + os: OperatingSystem.MAC, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: '/**/file.', + }) + ).toEqual(true); + }); + + it('should accept wildcards for folders and files', () => { + expect( + isPathValid({ + os: OperatingSystem.LINUX, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: '/usr/bi?/*.js', + }) + ).toEqual(true); + }); + + it('should accept paths with single wildcard', () => { + expect( + isPathValid({ + os: OperatingSystem.MAC, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: '/op*', + }) + ).toEqual(true); + + expect( + isPathValid({ + os: OperatingSystem.LINUX, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: '/op?', + }) + ).toEqual(true); + }); + + it('should accept paths that have wildcard in filenames', () => { + expect( + isPathValid({ + os: OperatingSystem.MAC, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: '/*.*', + }) + ).toEqual(true); + }); + + it('should accept paths with ? as wildcard', () => { + expect( + isPathValid({ + os: OperatingSystem.LINUX, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: '/usr/?inux/pat?', + }) + ).toEqual(true); + }); + + it('should accept paths with both ? and * as wildcards', () => { + expect( + isPathValid({ + os: OperatingSystem.MAC, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: '/usr/*?', + }) + ).toEqual(true); + }); + + it('should accept paths with multiple wildcards', () => { + expect( + isPathValid({ + os: OperatingSystem.LINUX, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: '/usr/**', + }) + ).toEqual(true); + + expect( + isPathValid({ + os: OperatingSystem.MAC, + field: ConditionEntryField.PATH, + type: 'wildcard', + value: '/opt/??', + }) + ).toEqual(true); + }); +}); + +describe('Acceptable Mac/Linux exact paths', () => { + it('should accept paths when it is the root path', () => { + expect( + isPathValid({ + os: OperatingSystem.LINUX, + field: ConditionEntryField.PATH, + type: 'match', + value: '/', + }) + ).toEqual(true); + }); + + it('should accept paths when it ends with a file name', () => { + expect( + isPathValid({ + os: OperatingSystem.MAC, + field: ConditionEntryField.PATH, + type: 'match', + value: '/usr/file.ts', + }) + ).toEqual(true); + }); + + it('should accept paths when it ends with a filename in a folder', () => { + expect( + isPathValid({ + os: OperatingSystem.LINUX, + field: ConditionEntryField.PATH, + type: 'match', + value: '/opt/z.dmg', + }) + ).toEqual(true); + }); +}); + +describe('Acceptable Mac/Linux exact paths with hyphens', () => { + it('should accept paths when paths have folder names with hyphens', () => { + expect( + isPathValid({ + os: OperatingSystem.MAC, + field: ConditionEntryField.PATH, + type: 'match', + value: '/hype-folder-name', + }) + ).toEqual(true); + }); + + it('should accept paths when file names have hyphens', () => { + expect( + isPathValid({ + os: OperatingSystem.LINUX, + field: ConditionEntryField.PATH, + type: 'match', + value: '/file-name.dmg', + }) + ).toEqual(true); + }); +}); + +describe('Unacceptable Mac/Linux exact paths', () => { + it('should not accept paths with \\', () => { + expect( + isPathValid({ + os: OperatingSystem.MAC, + field: ConditionEntryField.PATH, + type: 'match', + value: 'c:\\folder\\path.exe', + }) + ).toEqual(false); + }); + + it('should not accept paths not starting with /', () => { + expect( + isPathValid({ + os: OperatingSystem.LINUX, + field: ConditionEntryField.PATH, + type: 'match', + value: 'opt/bin', + }) + ).toEqual(false); + }); + + it('should not accept paths ending with /', () => { + expect( + isPathValid({ + os: OperatingSystem.MAC, + field: ConditionEntryField.PATH, + type: 'match', + value: '/opt/bin/', + }) + ).toEqual(false); + }); + + it('should not accept file extensions with hyphens', () => { + expect( + isPathValid({ + os: OperatingSystem.LINUX, + field: ConditionEntryField.PATH, + type: 'match', + value: '/opt/bin/file.d-mg', + }) + ).toEqual(false); + }); +}); + +describe('hasSimpleExecutableName', () => { + it('should return TRUE when MAC/LINUX wildcard paths have an executable name', () => { + const os = + parseInt((Math.random() * 2).toString(), 10) === 1 + ? OperatingSystem.MAC + : OperatingSystem.LINUX; + + expect( + hasSimpleExecutableName({ + os, + type: 'wildcard', + value: '/opt/*/app', + }) + ).toEqual(true); + expect( + hasSimpleExecutableName({ + os, + type: 'wildcard', + value: '/op*/**/app.dmg', + }) + ).toEqual(true); + expect( + hasSimpleExecutableName({ + os, + type: 'wildcard', + value: "/sy*/test$ as2@13---12!@#A,DS.#$^&$!#~ 'as'd.华语.txt", + }) + ).toEqual(true); + }); + + it('should return FALSE when MAC/LINUX wildcard paths have a wildcard in executable name', () => { + const os = + parseInt((Math.random() * 2).toString(), 10) === 1 + ? OperatingSystem.MAC + : OperatingSystem.LINUX; + + expect( + hasSimpleExecutableName({ + os, + type: 'wildcard', + value: '/op/*/*pp', + }) + ).toEqual(false); + expect( + hasSimpleExecutableName({ + os, + type: 'wildcard', + value: '/op*/b**/ap.m**', + }) + ).toEqual(false); + }); + + it('should return TRUE when WINDOWS wildcards paths have a executable name', () => { + expect( + hasSimpleExecutableName({ + os: OperatingSystem.WINDOWS, + type: 'wildcard', + value: 'c:\\**\\path.exe', + }) + ).toEqual(true); + expect( + hasSimpleExecutableName({ + os: OperatingSystem.WINDOWS, + type: 'wildcard', + value: 'C:\\*\\file-name.path华语 1234.txt', + }) + ).toEqual(true); + expect( + hasSimpleExecutableName({ + os: OperatingSystem.WINDOWS, + type: 'wildcard', + value: "C:\\*\\test$ as2@13---12!@#A,DS.#$^&$!#~ 'as'd.华语.txt", + }) + ).toEqual(true); + }); + + it('should return FALSE when WINDOWS wildcards paths have a wildcard in executable name', () => { + expect( + hasSimpleExecutableName({ + os: OperatingSystem.WINDOWS, + type: 'wildcard', + value: 'c:\\**\\pa*h.exe', + }) + ).toEqual(false); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/path_validations/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/path_validations/index.ts new file mode 100644 index 0000000000000..965a5b9fbe0fe --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/path_validations/index.ts @@ -0,0 +1,243 @@ +/* + * 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'; + +export const WILDCARD_WARNING = i18n.translate('utils.wildcardWarning', { + defaultMessage: `Using wildcards can impact Endpoint performance`, +}); + +export const FILEPATH_WARNING = i18n.translate('utils.filename.pathWarning', { + defaultMessage: `Path may be formed incorrectly; verify value`, +}); + +export enum ConditionEntryField { + HASH = 'process.hash.*', + PATH = 'process.executable.caseless', + SIGNER = 'process.Ext.code_signature', + SIGNER_MAC = 'process.code_signature', +} + +export enum EntryFieldType { + HASH = '.hash.', + EXECUTABLE = '.executable.caseless', + PATH = '.path', + SIGNER = '.code_signature', +} + +export type TrustedAppConditionEntryField = + | 'process.hash.*' + | 'process.executable.caseless' + | 'process.Ext.code_signature' + | 'process.code_signature'; + +export type BlocklistConditionEntryField = + | 'file.hash.*' + | 'file.path' + | 'file.Ext.code_signature' + | 'file.path.caseless'; +export type AllConditionEntryFields = + | TrustedAppConditionEntryField + | BlocklistConditionEntryField + | 'file.path.text'; + +export enum OperatingSystem { + LINUX = 'linux', + MAC = 'macos', + WINDOWS = 'windows', +} + +export type EntryTypes = 'match' | 'wildcard' | 'match_any'; +export type TrustedAppEntryTypes = Extract<EntryTypes, 'match' | 'wildcard'>; +export type EventFiltersTypes = EntryTypes | 'exists' | 'nested'; + +export const validatePotentialWildcardInput = ({ + field = '', + os, + value = '', +}: { + field?: string; + os: OperatingSystem; + value?: string; +}): string | undefined => { + const textInput = value.trim(); + if (field === 'file.path.text') { + return validateFilePathInput({ os, value: textInput }); + } + return validateWildcardInput(textInput); +}; + +export const validateFilePathInput = ({ + os, + value, +}: { + os: OperatingSystem; + value: string; +}): string | undefined => { + const isValidFilePath = isPathValid({ + os, + field: 'file.path.text', + type: 'wildcard', + value, + }); + const hasSimpleFileName = hasSimpleExecutableName({ + os, + type: 'wildcard', + value, + }); + + if (!value.length) { + return FILEPATH_WARNING; + } + + if (isValidFilePath) { + if (hasSimpleFileName !== undefined && !hasSimpleFileName) { + return WILDCARD_WARNING; + } + } else { + return FILEPATH_WARNING; + } +}; + +export const validateWildcardInput = (value: string | string[]): string | undefined => { + const wildcardRegex = /[*?]/; + if (Array.isArray(value)) { + const doesAnyValueContainWildcardInput = value.some((v) => wildcardRegex.test(v)); + if (doesAnyValueContainWildcardInput) { + return WILDCARD_WARNING; + } + } else { + if (wildcardRegex.test(value)) { + return WILDCARD_WARNING; + } + } +}; + +export const validateHasWildcardWithWrongOperator = ({ + operator, + value, +}: { + operator: TrustedAppEntryTypes | EventFiltersTypes; + value: string | string[]; +}): boolean => { + if (operator !== 'wildcard' && validateWildcardInput(value)) { + return true; + } else { + return false; + } +}; + +export const hasSimpleExecutableName = ({ + os, + type, + value, +}: { + os: OperatingSystem; + type: EntryTypes; + value: string; +}): boolean | undefined => { + const separator = os === OperatingSystem.WINDOWS ? '\\' : '/'; + const lastString = value.split(separator).pop(); + if (!lastString) { + return; + } + if (type === 'wildcard') { + return (lastString.split('*').length || lastString.split('?').length) === 1; + } + return true; +}; + +export const isPathValid = ({ + os, + field, + type, + value, +}: { + os: OperatingSystem; + field: AllConditionEntryFields; + type: EntryTypes; + value: string; +}): boolean => { + const pathFields: AllConditionEntryFields[] = [ + 'process.executable.caseless', + 'file.path', + 'file.path.text', + ]; + if (pathFields.includes(field)) { + if (type === 'wildcard') { + return os === OperatingSystem.WINDOWS + ? isWindowsWildcardPathValid(value) + : isLinuxMacWildcardPathValid(value); + } + return doesPathMatchRegex({ value, os }); + } + return true; +}; + +const doesPathMatchRegex = ({ os, value }: { os: OperatingSystem; value: string }): boolean => { + if (os === OperatingSystem.WINDOWS) { + const filePathRegex = + /^[a-z]:(?:|\\\\[^<>:"'/\\|?*]+\\[^<>:"'/\\|?*]+|%\w+%|)[\\](?:[^<>:"'/\\|?*]+[\\/])*([^<>:"'/\\|?*])+$/i; + return filePathRegex.test(value); + } + return /^(\/|(\/[\w\-]+)+|\/[\w\-]+\.[\w]+|(\/[\w-]+)+\/[\w\-]+\.[\w]+)$/i.test(value); +}; + +const isWindowsWildcardPathValid = (path: string): boolean => { + const firstCharacter = path[0]; + const lastCharacter = path.slice(-1); + const trimmedValue = path.trim(); + const hasSlash = /\//.test(trimmedValue); + if (path.length === 0) { + return false; + } else if ( + hasSlash || + trimmedValue.length !== path.length || + firstCharacter === '^' || + lastCharacter === '\\' || + !hasWildcard({ path, isWindowsPath: true }) + ) { + return false; + } else { + return true; + } +}; + +const isLinuxMacWildcardPathValid = (path: string): boolean => { + const firstCharacter = path[0]; + const lastCharacter = path.slice(-1); + const trimmedValue = path.trim(); + if (path.length === 0) { + return false; + } else if ( + trimmedValue.length !== path.length || + firstCharacter !== '/' || + lastCharacter === '/' || + path.length > 1024 === true || + path.includes('//') === true || + !hasWildcard({ path, isWindowsPath: false }) + ) { + return false; + } else { + return true; + } +}; + +const hasWildcard = ({ + path, + isWindowsPath, +}: { + path: string; + isWindowsPath: boolean; +}): boolean => { + for (const pathComponent of path.split(isWindowsPath ? '\\' : '/')) { + if (/[\*|\?]+/.test(pathComponent) === true) { + return true; + } + } + return false; +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/transform_data_to_ndjson/index.test.ts b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/transform_data_to_ndjson/index.test.ts new file mode 100644 index 0000000000000..d91eb687d86db --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/transform_data_to_ndjson/index.test.ts @@ -0,0 +1,83 @@ +/* + * 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 { transformDataToNdjson } from '.'; + +export const ANCHOR_DATE = '2020-02-20T03:57:54.037Z'; + +const getRulesSchemaMock = (anchorDate: string = ANCHOR_DATE) => ({ + author: [], + id: '7a7065d7-6e8b-4aae-8d20-c93613dec9f9', + created_at: new Date(anchorDate).toISOString(), + updated_at: new Date(anchorDate).toISOString(), + created_by: 'elastic', + description: 'some description', + enabled: true, + false_positives: ['false positive 1', 'false positive 2'], + from: 'now-6m', + immutable: false, + name: 'Query with a rule id', + query: 'user.name: root or user.name: admin', + references: ['test 1', 'test 2'], + severity: 'high', + severity_mapping: [], + updated_by: 'elastic_kibana', + tags: ['some fake tag 1', 'some fake tag 2'], + to: 'now', + type: 'query', + threat: [], + version: 1, + output_index: '.siem-signals-default', + max_signals: 100, + risk_score: 55, + risk_score_mapping: [], + language: 'kuery', + rule_id: 'query-rule-id', + interval: '5m', + exceptions_list: [], +}); + +describe('transformDataToNdjson', () => { + test('if rules are empty it returns an empty string', () => { + const ruleNdjson = transformDataToNdjson([]); + expect(ruleNdjson).toEqual(''); + }); + + test('single rule will transform with new line ending character for ndjson', () => { + const rule = getRulesSchemaMock(); + const ruleNdjson = transformDataToNdjson([rule]); + expect(ruleNdjson.endsWith('\n')).toBe(true); + }); + + test('multiple rules will transform with two new line ending characters for ndjson', () => { + const result1 = getRulesSchemaMock(); + const result2 = getRulesSchemaMock(); + result2.id = 'some other id'; + result2.rule_id = 'some other id'; + result2.name = 'Some other rule'; + + const ruleNdjson = transformDataToNdjson([result1, result2]); + // this is how we count characters in JavaScript :-) + const count = ruleNdjson.split('\n').length - 1; + expect(count).toBe(2); + }); + + test('you can parse two rules back out without errors', () => { + const result1 = getRulesSchemaMock(); + const result2 = getRulesSchemaMock(); + result2.id = 'some other id'; + result2.rule_id = 'some other id'; + result2.name = 'Some other rule'; + + const ruleNdjson = transformDataToNdjson([result1, result2]); + const ruleStrings = ruleNdjson.split('\n'); + const reParsed1 = JSON.parse(ruleStrings[0]); + const reParsed2 = JSON.parse(ruleStrings[1]); + expect(reParsed1).toEqual(result1); + expect(reParsed2).toEqual(result2); + }); +}); diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/transform_data_to_ndjson/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/transform_data_to_ndjson/index.ts new file mode 100644 index 0000000000000..572b777731c48 --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/src/transform_data_to_ndjson/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. + */ + +export const transformDataToNdjson = (data: unknown[]): string => { + if (data.length !== 0) { + const dataString = data.map((item) => JSON.stringify(item)).join('\n'); + return `${dataString}\n`; + } else { + return ''; + } +}; diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-utils/tsconfig.json b/x-pack/solutions/security/packages/kbn-securitysolution-utils/tsconfig.json new file mode 100644 index 0000000000000..063735a114dad --- /dev/null +++ b/x-pack/solutions/security/packages/kbn-securitysolution-utils/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts" + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/esql-utils", + "@kbn/esql-ast", + "@kbn/esql-validation-autocomplete" + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/x-pack/solutions/security/packages/navigation/src/constants.ts b/x-pack/solutions/security/packages/navigation/src/constants.ts index eb77907b59f52..9d998622f0807 100644 --- a/x-pack/solutions/security/packages/navigation/src/constants.ts +++ b/x-pack/solutions/security/packages/navigation/src/constants.ts @@ -97,7 +97,7 @@ export enum ExternalPageName { // Cloud UI // These are links to Cloud UI outside Kibana // Special Format: <cloud>:<cloudUrlKey> - // cloudUrlKey Ref: x-pack/plugins/security_solution_serverless/public/navigation/links/util.ts + // cloudUrlKey Ref: x-pack/solutions/security/plugins/security_solution_serverless/public/navigation/links/util.ts cloudUsersAndRoles = 'cloud:usersAndRoles', cloudBilling = 'cloud:billing', cloudPerformance = 'cloud:performance', diff --git a/x-pack/solutions/security/plugins/asset_inventory/README.md b/x-pack/solutions/security/plugins/asset_inventory/README.md new file mode 100755 index 0000000000000..313a45cec6f76 --- /dev/null +++ b/x-pack/solutions/security/plugins/asset_inventory/README.md @@ -0,0 +1,21 @@ +# Asset Inventory Kibana Plugin + +Centralized asset inventory experience within the Elastic Security solution. A central place for users to view and manage all their assets from different environments. + +--- + +## Development + +See the [kibana contributing guide](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md) for instructions setting up your development environment. + +### Feature flag + +First, enable the `assetInventoryStoreEnabled` experimental feature flag by adding the following to your `kibana.dev.yml`: + +```yml +xpack.securitySolution.enableExperimental: ['assetInventoryStoreEnabled'] +``` + +## Testing + +For general guidelines, read [Kibana Testing Guide](https://www.elastic.co/guide/en/kibana/current/development-tests.html) for more details diff --git a/x-pack/plugins/asset_inventory/common/index.ts b/x-pack/solutions/security/plugins/asset_inventory/common/index.ts similarity index 100% rename from x-pack/plugins/asset_inventory/common/index.ts rename to x-pack/solutions/security/plugins/asset_inventory/common/index.ts diff --git a/x-pack/plugins/asset_inventory/kibana.jsonc b/x-pack/solutions/security/plugins/asset_inventory/kibana.jsonc similarity index 100% rename from x-pack/plugins/asset_inventory/kibana.jsonc rename to x-pack/solutions/security/plugins/asset_inventory/kibana.jsonc diff --git a/x-pack/plugins/asset_inventory/package.json b/x-pack/solutions/security/plugins/asset_inventory/package.json similarity index 100% rename from x-pack/plugins/asset_inventory/package.json rename to x-pack/solutions/security/plugins/asset_inventory/package.json diff --git a/x-pack/plugins/asset_inventory/public/application.tsx b/x-pack/solutions/security/plugins/asset_inventory/public/application.tsx similarity index 100% rename from x-pack/plugins/asset_inventory/public/application.tsx rename to x-pack/solutions/security/plugins/asset_inventory/public/application.tsx diff --git a/x-pack/plugins/asset_inventory/public/components/app.tsx b/x-pack/solutions/security/plugins/asset_inventory/public/components/app.tsx similarity index 100% rename from x-pack/plugins/asset_inventory/public/components/app.tsx rename to x-pack/solutions/security/plugins/asset_inventory/public/components/app.tsx diff --git a/x-pack/plugins/asset_inventory/public/index.ts b/x-pack/solutions/security/plugins/asset_inventory/public/index.ts similarity index 100% rename from x-pack/plugins/asset_inventory/public/index.ts rename to x-pack/solutions/security/plugins/asset_inventory/public/index.ts diff --git a/x-pack/plugins/asset_inventory/public/plugin.ts b/x-pack/solutions/security/plugins/asset_inventory/public/plugin.ts similarity index 100% rename from x-pack/plugins/asset_inventory/public/plugin.ts rename to x-pack/solutions/security/plugins/asset_inventory/public/plugin.ts diff --git a/x-pack/plugins/asset_inventory/public/types.ts b/x-pack/solutions/security/plugins/asset_inventory/public/types.ts similarity index 100% rename from x-pack/plugins/asset_inventory/public/types.ts rename to x-pack/solutions/security/plugins/asset_inventory/public/types.ts diff --git a/x-pack/plugins/asset_inventory/server/create_transforms/create_transforms.ts b/x-pack/solutions/security/plugins/asset_inventory/server/create_transforms/create_transforms.ts similarity index 100% rename from x-pack/plugins/asset_inventory/server/create_transforms/create_transforms.ts rename to x-pack/solutions/security/plugins/asset_inventory/server/create_transforms/create_transforms.ts diff --git a/x-pack/plugins/asset_inventory/server/index.ts b/x-pack/solutions/security/plugins/asset_inventory/server/index.ts similarity index 100% rename from x-pack/plugins/asset_inventory/server/index.ts rename to x-pack/solutions/security/plugins/asset_inventory/server/index.ts diff --git a/x-pack/plugins/asset_inventory/server/plugin.ts b/x-pack/solutions/security/plugins/asset_inventory/server/plugin.ts similarity index 100% rename from x-pack/plugins/asset_inventory/server/plugin.ts rename to x-pack/solutions/security/plugins/asset_inventory/server/plugin.ts diff --git a/x-pack/plugins/asset_inventory/server/routes/index.ts b/x-pack/solutions/security/plugins/asset_inventory/server/routes/index.ts similarity index 100% rename from x-pack/plugins/asset_inventory/server/routes/index.ts rename to x-pack/solutions/security/plugins/asset_inventory/server/routes/index.ts diff --git a/x-pack/plugins/asset_inventory/server/types.ts b/x-pack/solutions/security/plugins/asset_inventory/server/types.ts similarity index 100% rename from x-pack/plugins/asset_inventory/server/types.ts rename to x-pack/solutions/security/plugins/asset_inventory/server/types.ts diff --git a/x-pack/solutions/security/plugins/asset_inventory/tsconfig.json b/x-pack/solutions/security/plugins/asset_inventory/tsconfig.json new file mode 100644 index 0000000000000..b733fc545be25 --- /dev/null +++ b/x-pack/solutions/security/plugins/asset_inventory/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "common/**/*.ts", + "common/**/*.json", + "public/**/*.ts", + "public/**/*.tsx", + "public/**/*.json", + "server/**/*.ts", + "server/**/*.json", + "../../../../../typings/**/*" + ], + "exclude": ["target/**/*"], + "kbn_references": [ + "@kbn/core", + "@kbn/i18n-react", + "@kbn/shared-ux-router", + "@kbn/securitysolution-es-utils" + ] +} diff --git a/x-pack/plugins/cloud_defend/.i18nrc.json b/x-pack/solutions/security/plugins/cloud_defend/.i18nrc.json similarity index 100% rename from x-pack/plugins/cloud_defend/.i18nrc.json rename to x-pack/solutions/security/plugins/cloud_defend/.i18nrc.json diff --git a/x-pack/solutions/security/plugins/cloud_defend/README.md b/x-pack/solutions/security/plugins/cloud_defend/README.md new file mode 100755 index 0000000000000..8b12271d52535 --- /dev/null +++ b/x-pack/solutions/security/plugins/cloud_defend/README.md @@ -0,0 +1,49 @@ +# Cloud Defend (for containers) + +This plugin currently only exists to provide custom fleet policy UX for a set of new BPF LSM features. The first feature being container "drift prevention". + +Drift prevention is a way to block when executables are created or modified. Our agent service detects these events, and applies a set of selectors and responses configured to either block, alert or both. + +## Example configuration +``` +selectors: + # default selector (user can modify or remove if they want) + - name: default + operation: [createExecutable, modifyExecutable, execMemFd] + + # example custom selector + - name: nginxOnly + containerImageName: + - nginx + + # example selector used for exclude + - name: excludeCustomNginxBuild + containerImageTag: + - staging + +# responses are evaluated from top to bottom +# only the first response with a match will run its actions +responses: + - match: [nginxOnly] + exclude: [excludeCustomNginxBuild] + actions: [alert, block] + + # default response + # delete this if no default response needed + - match: [default] + actions: [alert] +``` + +--- + +## Development + +## pre commit checks + +``` +node scripts/type_check.js --project x-pack/solutions/security/plugins/cloud_defend/tsconfig.json +node scripts/eslint.js x-pack/solutions/security/plugins/cloud_defend +yarn test:jest x-pack/solutions/security/plugins/cloud_defend +``` + +See the [kibana contributing guide](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md) for instructions setting up your development environment. diff --git a/x-pack/plugins/cloud_defend/common/constants.ts b/x-pack/solutions/security/plugins/cloud_defend/common/constants.ts similarity index 100% rename from x-pack/plugins/cloud_defend/common/constants.ts rename to x-pack/solutions/security/plugins/cloud_defend/common/constants.ts diff --git a/x-pack/plugins/cloud_defend/common/index.ts b/x-pack/solutions/security/plugins/cloud_defend/common/index.ts similarity index 100% rename from x-pack/plugins/cloud_defend/common/index.ts rename to x-pack/solutions/security/plugins/cloud_defend/common/index.ts diff --git a/x-pack/plugins/cloud_defend/common/latest.ts b/x-pack/solutions/security/plugins/cloud_defend/common/latest.ts similarity index 100% rename from x-pack/plugins/cloud_defend/common/latest.ts rename to x-pack/solutions/security/plugins/cloud_defend/common/latest.ts diff --git a/x-pack/plugins/cloud_defend/common/schemas/v1.ts b/x-pack/solutions/security/plugins/cloud_defend/common/schemas/v1.ts similarity index 100% rename from x-pack/plugins/cloud_defend/common/schemas/v1.ts rename to x-pack/solutions/security/plugins/cloud_defend/common/schemas/v1.ts diff --git a/x-pack/plugins/cloud_defend/common/utils/helpers.test.ts b/x-pack/solutions/security/plugins/cloud_defend/common/utils/helpers.test.ts similarity index 100% rename from x-pack/plugins/cloud_defend/common/utils/helpers.test.ts rename to x-pack/solutions/security/plugins/cloud_defend/common/utils/helpers.test.ts diff --git a/x-pack/plugins/cloud_defend/common/utils/helpers.ts b/x-pack/solutions/security/plugins/cloud_defend/common/utils/helpers.ts similarity index 100% rename from x-pack/plugins/cloud_defend/common/utils/helpers.ts rename to x-pack/solutions/security/plugins/cloud_defend/common/utils/helpers.ts diff --git a/x-pack/plugins/cloud_defend/common/utils/subscription.test.ts b/x-pack/solutions/security/plugins/cloud_defend/common/utils/subscription.test.ts similarity index 100% rename from x-pack/plugins/cloud_defend/common/utils/subscription.test.ts rename to x-pack/solutions/security/plugins/cloud_defend/common/utils/subscription.test.ts diff --git a/x-pack/plugins/cloud_defend/common/utils/subscription.ts b/x-pack/solutions/security/plugins/cloud_defend/common/utils/subscription.ts similarity index 100% rename from x-pack/plugins/cloud_defend/common/utils/subscription.ts rename to x-pack/solutions/security/plugins/cloud_defend/common/utils/subscription.ts diff --git a/x-pack/plugins/cloud_defend/common/v1.ts b/x-pack/solutions/security/plugins/cloud_defend/common/v1.ts similarity index 100% rename from x-pack/plugins/cloud_defend/common/v1.ts rename to x-pack/solutions/security/plugins/cloud_defend/common/v1.ts diff --git a/x-pack/solutions/security/plugins/cloud_defend/jest.config.js b/x-pack/solutions/security/plugins/cloud_defend/jest.config.js new file mode 100644 index 0000000000000..1a923a89d2da0 --- /dev/null +++ b/x-pack/solutions/security/plugins/cloud_defend/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +/** @type {import('@jest/types').Config.InitialOptions} */ +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/cloud_defend'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/cloud_defend', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/cloud_defend/{common,public,server}/**/*.{ts,tsx}', + ], +}; diff --git a/x-pack/plugins/cloud_defend/kibana.jsonc b/x-pack/solutions/security/plugins/cloud_defend/kibana.jsonc similarity index 100% rename from x-pack/plugins/cloud_defend/kibana.jsonc rename to x-pack/solutions/security/plugins/cloud_defend/kibana.jsonc diff --git a/x-pack/plugins/cloud_defend/public/application/route.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/application/route.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/application/route.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/application/route.tsx diff --git a/x-pack/plugins/cloud_defend/public/application/router.test.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/application/router.test.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/application/router.test.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/application/router.test.tsx diff --git a/x-pack/plugins/cloud_defend/public/application/router.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/application/router.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/application/router.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/application/router.tsx diff --git a/x-pack/plugins/cloud_defend/public/application/security_solution_context.ts b/x-pack/solutions/security/plugins/cloud_defend/public/application/security_solution_context.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/application/security_solution_context.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/application/security_solution_context.ts diff --git a/x-pack/plugins/cloud_defend/public/application/setup_context.ts b/x-pack/solutions/security/plugins/cloud_defend/public/application/setup_context.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/application/setup_context.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/application/setup_context.ts diff --git a/x-pack/plugins/cloud_defend/public/assets/icons/logo.svg b/x-pack/solutions/security/plugins/cloud_defend/public/assets/icons/logo.svg similarity index 100% rename from x-pack/plugins/cloud_defend/public/assets/icons/logo.svg rename to x-pack/solutions/security/plugins/cloud_defend/public/assets/icons/logo.svg diff --git a/x-pack/plugins/cloud_defend/public/common/api/use_cloud_defend_integration.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/common/api/use_cloud_defend_integration.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/common/api/use_cloud_defend_integration.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/common/api/use_cloud_defend_integration.tsx diff --git a/x-pack/plugins/cloud_defend/public/common/api/use_setup_status_api.ts b/x-pack/solutions/security/plugins/cloud_defend/public/common/api/use_setup_status_api.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/common/api/use_setup_status_api.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/common/api/use_setup_status_api.ts diff --git a/x-pack/plugins/cloud_defend/public/common/constants.ts b/x-pack/solutions/security/plugins/cloud_defend/public/common/constants.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/common/constants.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/common/constants.ts diff --git a/x-pack/plugins/cloud_defend/public/common/hooks/use_kibana.ts b/x-pack/solutions/security/plugins/cloud_defend/public/common/hooks/use_kibana.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/common/hooks/use_kibana.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/common/hooks/use_kibana.ts diff --git a/x-pack/plugins/cloud_defend/public/common/hooks/use_page_size.ts b/x-pack/solutions/security/plugins/cloud_defend/public/common/hooks/use_page_size.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/common/hooks/use_page_size.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/common/hooks/use_page_size.ts diff --git a/x-pack/plugins/cloud_defend/public/common/hooks/use_subscription_status.ts b/x-pack/solutions/security/plugins/cloud_defend/public/common/hooks/use_subscription_status.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/common/hooks/use_subscription_status.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/common/hooks/use_subscription_status.ts diff --git a/x-pack/plugins/cloud_defend/public/common/navigation/constants.ts b/x-pack/solutions/security/plugins/cloud_defend/public/common/navigation/constants.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/common/navigation/constants.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/common/navigation/constants.ts diff --git a/x-pack/plugins/cloud_defend/public/common/navigation/security_solution_links.test.ts b/x-pack/solutions/security/plugins/cloud_defend/public/common/navigation/security_solution_links.test.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/common/navigation/security_solution_links.test.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/common/navigation/security_solution_links.test.ts diff --git a/x-pack/plugins/cloud_defend/public/common/navigation/security_solution_links.ts b/x-pack/solutions/security/plugins/cloud_defend/public/common/navigation/security_solution_links.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/common/navigation/security_solution_links.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/common/navigation/security_solution_links.ts diff --git a/x-pack/solutions/security/plugins/cloud_defend/public/common/navigation/types.ts b/x-pack/solutions/security/plugins/cloud_defend/public/common/navigation/types.ts new file mode 100644 index 0000000000000..f17c9dc7dfb2b --- /dev/null +++ b/x-pack/solutions/security/plugins/cloud_defend/public/common/navigation/types.ts @@ -0,0 +1,23 @@ +/* + * 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. + */ +export interface CloudDefendNavigationItem { + readonly name: string; + readonly path: string; + readonly disabled?: boolean; +} + +export interface CloudDefendPageNavigationItem extends CloudDefendNavigationItem { + id: CloudDefendPageId; +} + +export type CloudDefendPage = 'policies' | 'dashboard'; + +/** + * All the IDs for the cloud defend pages. + * This needs to match the cloud defend page entries in `SecurityPageName` in `x-pack/solutions/security/plugins/security_solution/common/constants.ts`. + */ +export type CloudDefendPageId = 'cloud_defend-policies' | 'kubernetes_security-dashboard'; diff --git a/x-pack/plugins/cloud_defend/public/common/navigation/use_cloud_defend_integration_links.ts b/x-pack/solutions/security/plugins/cloud_defend/public/common/navigation/use_cloud_defend_integration_links.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/common/navigation/use_cloud_defend_integration_links.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/common/navigation/use_cloud_defend_integration_links.ts diff --git a/x-pack/plugins/cloud_defend/public/common/utils.test.ts b/x-pack/solutions/security/plugins/cloud_defend/public/common/utils.test.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/common/utils.test.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/common/utils.test.ts diff --git a/x-pack/plugins/cloud_defend/public/common/utils.ts b/x-pack/solutions/security/plugins/cloud_defend/public/common/utils.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/common/utils.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/common/utils.ts diff --git a/x-pack/plugins/cloud_defend/public/components/cloud_defend_page/index.test.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/cloud_defend_page/index.test.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/cloud_defend_page/index.test.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/cloud_defend_page/index.test.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/cloud_defend_page/index.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/cloud_defend_page/index.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/cloud_defend_page/index.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/cloud_defend_page/index.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/cloud_defend_page_title/index.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/cloud_defend_page_title/index.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/cloud_defend_page_title/index.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/cloud_defend_page_title/index.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/control_general_view/index.test.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/control_general_view/index.test.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/control_general_view/index.test.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/control_general_view/index.test.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/control_general_view/index.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/control_general_view/index.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/control_general_view/index.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/control_general_view/index.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/control_general_view/styles.ts b/x-pack/solutions/security/plugins/cloud_defend/public/components/control_general_view/styles.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/control_general_view/styles.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/components/control_general_view/styles.ts diff --git a/x-pack/plugins/cloud_defend/public/components/control_general_view/translations.ts b/x-pack/solutions/security/plugins/cloud_defend/public/components/control_general_view/translations.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/control_general_view/translations.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/components/control_general_view/translations.ts diff --git a/x-pack/plugins/cloud_defend/public/components/control_general_view_response/index.test.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/control_general_view_response/index.test.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/control_general_view_response/index.test.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/control_general_view_response/index.test.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/control_general_view_response/index.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/control_general_view_response/index.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/control_general_view_response/index.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/control_general_view_response/index.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/control_general_view_response/styles.ts b/x-pack/solutions/security/plugins/cloud_defend/public/components/control_general_view_response/styles.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/control_general_view_response/styles.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/components/control_general_view_response/styles.ts diff --git a/x-pack/plugins/cloud_defend/public/components/control_general_view_selector/index.test.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/control_general_view_selector/index.test.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/control_general_view_selector/index.test.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/control_general_view_selector/index.test.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/control_general_view_selector/index.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/control_general_view_selector/index.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/control_general_view_selector/index.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/control_general_view_selector/index.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/control_general_view_selector/styles.ts b/x-pack/solutions/security/plugins/cloud_defend/public/components/control_general_view_selector/styles.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/control_general_view_selector/styles.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/components/control_general_view_selector/styles.ts diff --git a/x-pack/plugins/cloud_defend/public/components/control_settings/index.test.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/control_settings/index.test.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/control_settings/index.test.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/control_settings/index.test.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/control_settings/index.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/control_settings/index.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/control_settings/index.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/control_settings/index.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/control_settings/translations.ts b/x-pack/solutions/security/plugins/cloud_defend/public/components/control_settings/translations.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/control_settings/translations.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/components/control_settings/translations.ts diff --git a/x-pack/plugins/cloud_defend/public/components/control_yaml_view/hooks/policy_schema.json b/x-pack/solutions/security/plugins/cloud_defend/public/components/control_yaml_view/hooks/policy_schema.json similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/control_yaml_view/hooks/policy_schema.json rename to x-pack/solutions/security/plugins/cloud_defend/public/components/control_yaml_view/hooks/policy_schema.json diff --git a/x-pack/plugins/cloud_defend/public/components/control_yaml_view/hooks/use_config_model.ts b/x-pack/solutions/security/plugins/cloud_defend/public/components/control_yaml_view/hooks/use_config_model.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/control_yaml_view/hooks/use_config_model.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/components/control_yaml_view/hooks/use_config_model.ts diff --git a/x-pack/plugins/cloud_defend/public/components/control_yaml_view/index.test.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/control_yaml_view/index.test.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/control_yaml_view/index.test.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/control_yaml_view/index.test.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/control_yaml_view/index.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/control_yaml_view/index.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/control_yaml_view/index.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/control_yaml_view/index.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/control_yaml_view/styles.ts b/x-pack/solutions/security/plugins/cloud_defend/public/components/control_yaml_view/styles.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/control_yaml_view/styles.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/components/control_yaml_view/styles.ts diff --git a/x-pack/plugins/cloud_defend/public/components/control_yaml_view/translations.ts b/x-pack/solutions/security/plugins/cloud_defend/public/components/control_yaml_view/translations.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/control_yaml_view/translations.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/components/control_yaml_view/translations.ts diff --git a/x-pack/plugins/cloud_defend/public/components/fleet_extensions/custom_assets_extension.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/fleet_extensions/custom_assets_extension.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/fleet_extensions/custom_assets_extension.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/fleet_extensions/custom_assets_extension.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/fleet_extensions/package_policy_replace_define_step_extension.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/fleet_extensions/package_policy_replace_define_step_extension.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/fleet_extensions/package_policy_replace_define_step_extension.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/fleet_extensions/package_policy_replace_define_step_extension.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/full_size_page/index.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/full_size_page/index.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/full_size_page/index.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/full_size_page/index.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/loading_state/index.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/loading_state/index.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/loading_state/index.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/loading_state/index.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/policies_table/index.test.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/policies_table/index.test.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/policies_table/index.test.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/policies_table/index.test.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/policies_table/index.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/policies_table/index.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/policies_table/index.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/policies_table/index.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/policy_settings/index.test.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/policy_settings/index.test.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/policy_settings/index.test.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/policy_settings/index.test.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/policy_settings/index.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/policy_settings/index.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/policy_settings/index.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/policy_settings/index.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/policy_settings/translations.ts b/x-pack/solutions/security/plugins/cloud_defend/public/components/policy_settings/translations.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/policy_settings/translations.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/components/policy_settings/translations.ts diff --git a/x-pack/plugins/cloud_defend/public/components/subscription_not_allowed/index.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/subscription_not_allowed/index.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/subscription_not_allowed/index.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/subscription_not_allowed/index.tsx diff --git a/x-pack/plugins/cloud_defend/public/components/timestamp_table_cell/index.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/components/timestamp_table_cell/index.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/components/timestamp_table_cell/index.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/components/timestamp_table_cell/index.tsx diff --git a/x-pack/plugins/cloud_defend/public/index.ts b/x-pack/solutions/security/plugins/cloud_defend/public/index.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/index.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/index.ts diff --git a/x-pack/plugins/cloud_defend/public/pages/index.ts b/x-pack/solutions/security/plugins/cloud_defend/public/pages/index.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/pages/index.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/pages/index.ts diff --git a/x-pack/plugins/cloud_defend/public/pages/policies/index.test.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/pages/policies/index.test.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/pages/policies/index.test.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/pages/policies/index.test.tsx diff --git a/x-pack/plugins/cloud_defend/public/pages/policies/index.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/pages/policies/index.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/pages/policies/index.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/pages/policies/index.tsx diff --git a/x-pack/plugins/cloud_defend/public/pages/policies/test_subjects.ts b/x-pack/solutions/security/plugins/cloud_defend/public/pages/policies/test_subjects.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/pages/policies/test_subjects.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/pages/policies/test_subjects.ts diff --git a/x-pack/plugins/cloud_defend/public/pages/policies/use_cloud_defend_policies.ts b/x-pack/solutions/security/plugins/cloud_defend/public/pages/policies/use_cloud_defend_policies.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/pages/policies/use_cloud_defend_policies.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/pages/policies/use_cloud_defend_policies.ts diff --git a/x-pack/plugins/cloud_defend/public/plugin.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/plugin.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/plugin.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/plugin.tsx diff --git a/x-pack/plugins/cloud_defend/public/test/__mocks__/worker.js b/x-pack/solutions/security/plugins/cloud_defend/public/test/__mocks__/worker.js similarity index 100% rename from x-pack/plugins/cloud_defend/public/test/__mocks__/worker.js rename to x-pack/solutions/security/plugins/cloud_defend/public/test/__mocks__/worker.js diff --git a/x-pack/plugins/cloud_defend/public/test/fixtures/cloud_defend_integration.ts b/x-pack/solutions/security/plugins/cloud_defend/public/test/fixtures/cloud_defend_integration.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/test/fixtures/cloud_defend_integration.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/test/fixtures/cloud_defend_integration.ts diff --git a/x-pack/plugins/cloud_defend/public/test/fixtures/navigation_item.ts b/x-pack/solutions/security/plugins/cloud_defend/public/test/fixtures/navigation_item.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/test/fixtures/navigation_item.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/test/fixtures/navigation_item.ts diff --git a/x-pack/plugins/cloud_defend/public/test/fixtures/react_query.ts b/x-pack/solutions/security/plugins/cloud_defend/public/test/fixtures/react_query.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/test/fixtures/react_query.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/test/fixtures/react_query.ts diff --git a/x-pack/plugins/cloud_defend/public/test/mocks.ts b/x-pack/solutions/security/plugins/cloud_defend/public/test/mocks.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/test/mocks.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/test/mocks.ts diff --git a/x-pack/plugins/cloud_defend/public/test/test_provider.tsx b/x-pack/solutions/security/plugins/cloud_defend/public/test/test_provider.tsx similarity index 100% rename from x-pack/plugins/cloud_defend/public/test/test_provider.tsx rename to x-pack/solutions/security/plugins/cloud_defend/public/test/test_provider.tsx diff --git a/x-pack/plugins/cloud_defend/public/test/utils.ts b/x-pack/solutions/security/plugins/cloud_defend/public/test/utils.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/test/utils.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/test/utils.ts diff --git a/x-pack/plugins/cloud_defend/public/types.ts b/x-pack/solutions/security/plugins/cloud_defend/public/types.ts similarity index 100% rename from x-pack/plugins/cloud_defend/public/types.ts rename to x-pack/solutions/security/plugins/cloud_defend/public/types.ts diff --git a/x-pack/plugins/cloud_defend/server/index.ts b/x-pack/solutions/security/plugins/cloud_defend/server/index.ts similarity index 100% rename from x-pack/plugins/cloud_defend/server/index.ts rename to x-pack/solutions/security/plugins/cloud_defend/server/index.ts diff --git a/x-pack/plugins/cloud_defend/server/lib/check_index_status.ts b/x-pack/solutions/security/plugins/cloud_defend/server/lib/check_index_status.ts similarity index 100% rename from x-pack/plugins/cloud_defend/server/lib/check_index_status.ts rename to x-pack/solutions/security/plugins/cloud_defend/server/lib/check_index_status.ts diff --git a/x-pack/plugins/cloud_defend/server/lib/fleet_util.ts b/x-pack/solutions/security/plugins/cloud_defend/server/lib/fleet_util.ts similarity index 100% rename from x-pack/plugins/cloud_defend/server/lib/fleet_util.ts rename to x-pack/solutions/security/plugins/cloud_defend/server/lib/fleet_util.ts diff --git a/x-pack/plugins/cloud_defend/server/lib/telemetry/collectors/accounts_stats_collector.ts b/x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/accounts_stats_collector.ts similarity index 100% rename from x-pack/plugins/cloud_defend/server/lib/telemetry/collectors/accounts_stats_collector.ts rename to x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/accounts_stats_collector.ts diff --git a/x-pack/plugins/cloud_defend/server/lib/telemetry/collectors/indices_stats_collector.ts b/x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/indices_stats_collector.ts similarity index 100% rename from x-pack/plugins/cloud_defend/server/lib/telemetry/collectors/indices_stats_collector.ts rename to x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/indices_stats_collector.ts diff --git a/x-pack/plugins/cloud_defend/server/lib/telemetry/collectors/installation_stats_collector.ts b/x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/installation_stats_collector.ts similarity index 100% rename from x-pack/plugins/cloud_defend/server/lib/telemetry/collectors/installation_stats_collector.ts rename to x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/installation_stats_collector.ts diff --git a/x-pack/plugins/cloud_defend/server/lib/telemetry/collectors/pods_stats_collector.ts b/x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/pods_stats_collector.ts similarity index 100% rename from x-pack/plugins/cloud_defend/server/lib/telemetry/collectors/pods_stats_collector.ts rename to x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/pods_stats_collector.ts diff --git a/x-pack/plugins/cloud_defend/server/lib/telemetry/collectors/register.ts b/x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/register.ts similarity index 100% rename from x-pack/plugins/cloud_defend/server/lib/telemetry/collectors/register.ts rename to x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/register.ts diff --git a/x-pack/plugins/cloud_defend/server/lib/telemetry/collectors/schema.ts b/x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/schema.ts similarity index 100% rename from x-pack/plugins/cloud_defend/server/lib/telemetry/collectors/schema.ts rename to x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/schema.ts diff --git a/x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/types.ts b/x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/types.ts new file mode 100644 index 0000000000000..6aca6936af649 --- /dev/null +++ b/x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/types.ts @@ -0,0 +1,121 @@ +/* + * 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. + */ +// for some reason we can't reference common/index.ts because +// the `node scripts/check_telemetry.js --fix` command fails with the error +// ERROR Error: Error extracting collector in x-pack/solutions/security/plugins/cloud_defend/server/lib/telemetry/collectors/register.ts +// Error: Unable to find identifier in source Selector +// at createFailError (dev_cli_errors.ts:27:24) +// at parseUsageCollection (ts_parser.ts:226:32) +// at parseUsageCollection.next (<anonymous>) +// at extractCollectors (extract_collectors.ts:58:32) +// at extractCollectors.next (<anonymous>) +// at Task.task (extract_collectors_task.ts:43:53) +// at runMicrotasks (<anonymous>) +// at processTicksAndRejections (node:internal/process/task_queues:96:5) +// +// I guess the intermediate import/export is causing problems +// for now we will just point to the current version (v1) +import type { + Selector, + Response, + SelectorType, + SelectorCondition, + ResponseAction, +} from '../../../../common/v1'; + +export interface CloudDefendUsage { + indices: CloudDefendIndicesStats; + pods_stats: CloudDefendPodsStats[]; + accounts_stats: CloudDefendAccountsStats[]; + installation_stats: CloudDefendInstallationStats[]; +} + +export interface PackageSetupStatus { + status: string; + installedPackagePolicies: number; + healthyAgents: number; +} + +export interface CloudDefendIndicesStats { + alerts: IndexStats | {}; + file: IndexStats | {}; + process: IndexStats | {}; + latestPackageVersion: string; + packageStatus: PackageSetupStatus; +} + +export interface IndexStats { + doc_count: number; + deleted: number; + size_in_bytes: number; + last_doc_timestamp: string | null; +} + +export interface CloudDefendPodsStats { + account_id: string; + pod_name: string; + container_image_name: string; + container_image_tag: string; + total_doc_count: number; + file_doc_count: number; + process_doc_count: number; + alert_doc_count: number; +} + +export interface CloudDefendAccountsStats { + account_id: string; + total_doc_count: number; + cloud_provider: string; + kubernetes_version: string | null; + file_doc_count: number; + process_doc_count: number; + alert_doc_count: number; + agents_count: number; + nodes_count: number; + pods_count: number; +} + +export type CloudDefendSelectorTypeCounts = { + [key in SelectorType]: number; +}; + +export type CloudDefendResponseTypeCounts = { + [key in SelectorType]: number; +}; + +export type CloudDefendConditionsCounts = { + [key in SelectorCondition]?: number; +}; + +export type CloudDefendActionCounts = { + [key in ResponseAction]?: number; +}; + +export interface CloudDefendPolicyYamlStats { + policy_yaml: string; + policy_json: string; // to be used for further digging in BigQuery + selector_counts: CloudDefendSelectorTypeCounts; + response_counts: CloudDefendResponseTypeCounts; + selector_conditions_counts: CloudDefendConditionsCounts; + response_actions_counts: CloudDefendActionCounts; + response_match_names: string[]; + response_exclude_names: string[]; +} + +type CloudDefendSelector = Omit<Selector, 'hasErrors'>; +type CloudDefendResponse = Omit<Response, 'hasErrors'>; + +export interface CloudDefendInstallationStats { + package_policy_id: string; + package_version: string; + agent_policy_id: string; + created_at: string; + agent_count: number; + policy_yaml: string; + selectors: CloudDefendSelector[]; + responses: CloudDefendResponse[]; +} diff --git a/x-pack/plugins/cloud_defend/server/mocks.ts b/x-pack/solutions/security/plugins/cloud_defend/server/mocks.ts similarity index 100% rename from x-pack/plugins/cloud_defend/server/mocks.ts rename to x-pack/solutions/security/plugins/cloud_defend/server/mocks.ts diff --git a/x-pack/plugins/cloud_defend/server/plugin.test.ts b/x-pack/solutions/security/plugins/cloud_defend/server/plugin.test.ts similarity index 100% rename from x-pack/plugins/cloud_defend/server/plugin.test.ts rename to x-pack/solutions/security/plugins/cloud_defend/server/plugin.test.ts diff --git a/x-pack/plugins/cloud_defend/server/plugin.ts b/x-pack/solutions/security/plugins/cloud_defend/server/plugin.ts similarity index 100% rename from x-pack/plugins/cloud_defend/server/plugin.ts rename to x-pack/solutions/security/plugins/cloud_defend/server/plugin.ts diff --git a/x-pack/plugins/cloud_defend/server/routes/policies/policies.test.ts b/x-pack/solutions/security/plugins/cloud_defend/server/routes/policies/policies.test.ts similarity index 100% rename from x-pack/plugins/cloud_defend/server/routes/policies/policies.test.ts rename to x-pack/solutions/security/plugins/cloud_defend/server/routes/policies/policies.test.ts diff --git a/x-pack/plugins/cloud_defend/server/routes/policies/policies.ts b/x-pack/solutions/security/plugins/cloud_defend/server/routes/policies/policies.ts similarity index 100% rename from x-pack/plugins/cloud_defend/server/routes/policies/policies.ts rename to x-pack/solutions/security/plugins/cloud_defend/server/routes/policies/policies.ts diff --git a/x-pack/plugins/cloud_defend/server/routes/setup_routes.ts b/x-pack/solutions/security/plugins/cloud_defend/server/routes/setup_routes.ts similarity index 100% rename from x-pack/plugins/cloud_defend/server/routes/setup_routes.ts rename to x-pack/solutions/security/plugins/cloud_defend/server/routes/setup_routes.ts diff --git a/x-pack/plugins/cloud_defend/server/routes/status/status.test.ts b/x-pack/solutions/security/plugins/cloud_defend/server/routes/status/status.test.ts similarity index 100% rename from x-pack/plugins/cloud_defend/server/routes/status/status.test.ts rename to x-pack/solutions/security/plugins/cloud_defend/server/routes/status/status.test.ts diff --git a/x-pack/plugins/cloud_defend/server/routes/status/status.ts b/x-pack/solutions/security/plugins/cloud_defend/server/routes/status/status.ts similarity index 100% rename from x-pack/plugins/cloud_defend/server/routes/status/status.ts rename to x-pack/solutions/security/plugins/cloud_defend/server/routes/status/status.ts diff --git a/x-pack/plugins/cloud_defend/server/types.ts b/x-pack/solutions/security/plugins/cloud_defend/server/types.ts similarity index 100% rename from x-pack/plugins/cloud_defend/server/types.ts rename to x-pack/solutions/security/plugins/cloud_defend/server/types.ts diff --git a/x-pack/solutions/security/plugins/cloud_defend/tsconfig.json b/x-pack/solutions/security/plugins/cloud_defend/tsconfig.json new file mode 100755 index 0000000000000..cce09d24d8d58 --- /dev/null +++ b/x-pack/solutions/security/plugins/cloud_defend/tsconfig.json @@ -0,0 +1,43 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*", + "../../../../../typings/**/*", + "public/**/*.json", + "server/**/*.json" + ], + "kbn_references": [ + "@kbn/core", + "@kbn/data-plugin", + "@kbn/security-plugin", + "@kbn/fleet-plugin", + "@kbn/i18n-react", + "@kbn/config-schema", + "@kbn/licensing-plugin", + "@kbn/data-plugin", + "@kbn/kibana-react-plugin", + "@kbn/monaco", + "@kbn/i18n", + "@kbn/usage-collection-plugin", + "@kbn/cloud-plugin", + "@kbn/shared-ux-router", + "@kbn/shared-ux-link-redirect-app", + "@kbn/core-logging-server-mocks", + "@kbn/securitysolution-es-utils", + "@kbn/es-types", + "@kbn/data-views-plugin", + "@kbn/utility-types", + "@kbn/kubernetes-security-plugin", + "@kbn/core-http-router-server-mocks", + "@kbn/core-elasticsearch-server", + "@kbn/code-editor", + "@kbn/code-editor-mock", + "@kbn/core-security-common" + ], + "exclude": ["target/**/*"] +} diff --git a/x-pack/solutions/security/plugins/cloud_security_posture/README.md b/x-pack/solutions/security/plugins/cloud_security_posture/README.md new file mode 100755 index 0000000000000..aaa1b3f2377a9 --- /dev/null +++ b/x-pack/solutions/security/plugins/cloud_security_posture/README.md @@ -0,0 +1,147 @@ +# Cloud Security Posture Kibana Plugin + +Cloud Posture automates the identification and remediation of risks across cloud infrastructures + +--- + +## Development + +Read [Kibana Contributing Guide](https://github.com/elastic/kibana/blob/main/CONTRIBUTING.md) for more details + +## Testing + +For general guidelines, read [Kibana Testing Guide](https://www.elastic.co/guide/en/kibana/current/development-tests.html) for more details + +### Tests + +1. Unit Tests (Jest) - located in sibling files to the source code +1. [API Integration Tests](../../../../test/api_integration/apis/cloud_security_posture/config.ts) +1. [Telemetry Integration Tests](../../../../test/cloud_security_posture_api/config.ts) +1. [End-to-End Tests](../../../../test/cloud_security_posture_functional/config.ts) +1. [Serverless API Integration tests](../../../../test_serverless/api_integration/test_suites/security/config.ts) +1. [Serverless End-to-End Tests](../../../../test_serverless/functional/test_suites/security/config.ts) +1. [Cypress End-to-End Tests](../../../../test/security_solution_cypress/cypress/e2e/cloud_security_posture) + + +### Tools + +Run **TypeScript**: + +```bash +node scripts/type_check.js --project=x-pack/solutions/security/plugins/cloud_security_posture/tsconfig.json +``` + +Run **ESLint**: + +```bash +yarn lint:es x-pack/solutions/security/plugins/cloud_security_posture +``` + +Run **i18n check**: +```bash +node scripts/i18n_check.js +``` + +> **Note** +> +> i18n should run on project scope as it checks translations files outside of our plugin. +> +> Fixes can be applied using the --fix flag + +Run [**Unit Tests**](https://www.elastic.co/guide/en/kibana/current/development-tests.html#_unit_testing): + +```bash +yarn test:jest --config x-pack/solutions/security/plugins/cloud_security_posture/jest.config.js +``` + +> **Note** +> +> for a coverage report, add the `--coverage` flag, and run `open target/kibana-coverage/jest/x-pack/solutions/security/plugins/cloud_security_posture/index.html` + +Run [**Integration Tests**](https://docs.elastic.dev/kibana-dev-docs/tutorials/testing-plugins#): + +```bash +yarn test:ftr --config x-pack/test/api_integration/config.ts +``` + +Run [**End-to-End Tests**](https://www.elastic.co/guide/en/kibana/current/development-tests.html#_running_functional_tests): + +```bash +yarn test:ftr --config x-pack/test/cloud_security_posture_functional/config.ts +yarn test:ftr --config x-pack/test/api_integration/apis/cloud_security_posture/config.ts +yarn test:ftr --config x-pack/test/cloud_security_posture_api/config.ts +yarn test:ftr --config x-pack/test_serverless/api_integration/test_suites/security/config.ts --include-tag=cloud_security_posture +yarn test:ftr --config x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture.ts +``` + +Run [**End-to-End Cypress Tests**](https://github.com/elastic/kibana/tree/main/x-pack/test/security_solution_cypress/cypress): +> **Note** +> +> Run this from security_solution_cypress folder +```bash +yarn cypress:open:serverless +yarn cypress:open:ess +yarn cypress:cloud_security_posture:run:serverless +yarn cypress:cloud_security_posture:run:ess +``` + +#### Run **FTR tests (integration or e2e) for development** + +Functional test runner (FTR) can be used separately with `ftr:runner` and `ftr:server`. This is convenient while developing tests. + +For example, + +run ESS (stateful) api integration tests: +```bash +yarn test:ftr:server --config x-pack/test/api_integration/config.ts +yarn test:ftr:runner --config x-pack/test/api_integration/apis/cloud_security_posture/config.ts +``` + +run ESS (stateful) telemetry integration tests: +```bash +yarn test:ftr:server --config x-pack/test/cloud_security_posture_api/config.ts +yarn test:ftr:runner --config x-pack/test/cloud_security_posture_api/config.ts +``` + +run ESS (stateful) e2e tests: +```bash +yarn test:ftr:server --config x-pack/test/cloud_security_posture_functional/config.ts +yarn test:ftr:runner --config x-pack/test/cloud_security_posture_functional/config.ts +``` + +run serverless api integration tests: +```bash +yarn test:ftr:server --config x-pack/test_serverless/api_integration/test_suites/security/config.ts +yarn test:ftr:runner --config x-pack/test_serverless/api_integration/test_suites/security/config.ts --include-tag=cloud_security_posture +``` + +run serverless e2e tests: +```bash +yarn test:ftr:server --config x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture.ts +yarn test:ftr:runner ---config x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture.ts +``` + +#### Run **Cypress tests (e2e) for development** +When developing feature outside our plugin folder, instead of using FTRs for e2e test, we may use Cypress. Before running cypress, make sure you have installed it first. Like FTRs, we can run cypress in different environment, for example: + +run ess e2e tests: +```bash +yarn cypress:open:ess +``` + +run ess Cloud Security Posture e2e tests: +```bash +yarn cypress:cloud_security_posture:run:ess +``` + +run serverless e2e tests: +```bash +yarn cypress:open:serverless +``` + +run serverless Cloud Security Posture e2e tests: +```bash +yarn cypress:cloud_security_posture:run:serverless +``` + +Unlike FTR where we have to set server and runner separately, Cypress handles everything in 1 go, so just running the above the script is enough to get it running \ No newline at end of file diff --git a/x-pack/plugins/cloud_security_posture/common/constants.ts b/x-pack/solutions/security/plugins/cloud_security_posture/common/constants.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/constants.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/common/constants.ts diff --git a/x-pack/solutions/security/plugins/cloud_security_posture/common/dev_docs/__auto_generated_csp_requirements_test_coverage.md b/x-pack/solutions/security/plugins/cloud_security_posture/common/dev_docs/__auto_generated_csp_requirements_test_coverage.md new file mode 100644 index 0000000000000..a7cf161697027 --- /dev/null +++ b/x-pack/solutions/security/plugins/cloud_security_posture/common/dev_docs/__auto_generated_csp_requirements_test_coverage.md @@ -0,0 +1,993 @@ +# Cloud Security Posture - Requirements Test Coverage + +<!-- This file is auto-generated. Any changes will be overwritten. -->This document provides a summary of the requirements test coverage for Cloud Security Posture. + +You can also check out the dedicated app view, which enables easier search and filter functionalities. +[Requirement test coverage app](https://vxgs2c.csb.app/) + +## Directory: x-pack/packages/kbn-cloud-security-posture + +**Total Tests:** 10 | **Skipped:** 0 (0.00%) | **Todo:** 0 (0.00%) + +![](https://img.shields.io/badge/KBN-PACKAGE-blueviolet) + +<details> +<summary>Test Details</summary> + +| Test Label | Type | Skipped | Todo | +|------------|------|---------|------| +| [test helper methods](x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts) | describe | | | +| [extractErrorMessage Test](x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts) | describe | | | +| [should return error message if input is instance of Error](x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts) | it | | | +| [should return string if input is string](x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts) | it | | | +| [should return fallbackMessage is input is not string nor instance of Error](x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts) | it | | | +| [should return default message when input is not string nor instance of Error and fallbackMessage is not provided](x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts) | it | | | +| [buildMutedRulesFilter Test](x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts) | describe | | | +| [should return an empty array if no rules are muted](x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts) | it | | | +| [should return the correct query for a single muted rule](x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts) | it | | | +| [should return the correct queries for multiple muted rules](x-pack/packages/kbn-cloud-security-posture-common/utils/helpers.test.ts) | it | | | +</details> + +## Directory: x-pack/solutions/security/plugins/cloud_security_posture + +**Total Tests:** 463 | **Skipped:** 7 (1.51%) | **Todo:** 0 (0.00%) + +![](https://img.shields.io/badge/UT-brightgreen) ![](https://img.shields.io/badge/HAS-SKIP-yellow) + +<details> +<summary>Test Details</summary> + +| Test Label | Type | Skipped | Todo | +|------------|------|---------|------| +| [Detection rules utils](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | describe | | | +| [should convert tags to KQL format with AND operator](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | +| [Should convert tags to KQL format with AND Operator (empty array)](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | +| [should convert tags to KQL format with OR Operator](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | +| [Should convert tags to KQL format with OR Operator (empty array)](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | +| [Should generate search tags for a CSP benchmark rule](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | +| [Should handle undefined benchmark object gracefully](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | +| [Should handle undefined rule number gracefully](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | +| [Should generate search tags for a CSP benchmark rule given an array of Benchmarks](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | +| [Should handle undefined benchmark object gracefully given an array of empty benchmark](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | +| [Should generate tags for a CSPM benchmark rule](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | +| [Should generate tags for a KSPM benchmark rule](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/detection_rules.test.ts) | it | | | +| [test helper methods](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts) | describe | | | +| [get default integration type from inputs with multiple enabled types](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | +| [get default integration type from inputs without any enabled types](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | +| [get EKS integration type](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | +| [get Vanilla K8S integration type](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | +| [get benchmark type filter based on a benchmark id](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | +| [should return a string with the correct filter when given a benchmark type and section](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | +| [get benchmark filter query based on a benchmark Id, version](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | +| [get benchmark filter query based on a benchmark Id, version and multiple sections and rule numbers](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | +| [get benchmark filter query based on a benchmark Id, version and just sections](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | +| [get benchmark filter query based on a benchmark Id, version and just rule numbers](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | +| [cleanupCredentials](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts) | describe | | | +| [cleans unused aws credential methods, except role_arn when using assume_role](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | +| [cleans unused aws credential methods, when using cloud formation](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | +| [cleans unused aws credential methods, when using direct_access_keys method ](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | +| [when aws credential type is undefined, return unchanged policy](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | +| [cleans unused gcp credential methods, when using credentials-file method ](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | +| [when gcp credential type is undefined, return unchanged policy](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts) | it | | | +| [isSubscriptionAllowed](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/subscription.test.ts) | describe | | | +| [should allow any cloud subscription](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/subscription.test.ts) | it | | | +| [should allow enterprise and trial licenses for on-prem](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/subscription.test.ts) | it | | | +| [should not allow enterprise and trial licenses for on-prem](x-pack/solutions/security/plugins/cloud_security_posture/common/utils/subscription.test.ts) | it | | | +| [CspRouter](x-pack/solutions/security/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | describe | | | +| [happy path](x-pack/solutions/security/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | describe | | | +| [should render Findings](x-pack/solutions/security/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | it | | | +| [should render Dashboards](x-pack/solutions/security/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | it | | | +| [should render the Vulnerability Dashboard](x-pack/solutions/security/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | it | | | +| [should render Benchmarks](x-pack/solutions/security/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | it | | | +| [should render Rules](x-pack/solutions/security/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | it | | | +| [unhappy path](x-pack/solutions/security/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | describe | | | +| [should redirect base path to dashboard](x-pack/solutions/security/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | it | | | +| [CspRoute](x-pack/solutions/security/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | describe | | | +| [should not render disabled path](x-pack/solutions/security/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | it | | | +| [should render SpyRoute for static paths](x-pack/solutions/security/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | it | | | +| [should not render SpyRoute for dynamic paths](x-pack/solutions/security/plugins/cloud_security_posture/public/application/csp_router.test.tsx) | it | | | +| [useBenchmarkDynamicValues](x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.test.ts) | describe | | | +| [should return the correct dynamic benchmark values for each provided benchmark ID](x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.test.ts) | it | | | +| [should return the correct resource plurals based on the provided resource count](x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.test.ts) | it | | | +| [useNavigateFindings](x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_navigate_findings.test.ts) | describe | | | +| [creates a URL to findings page with correct path, filter and dataViewId](x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_navigate_findings.test.ts) | it | | | +| [creates a URL to findings page with correct path and negated filter](x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_navigate_findings.test.ts) | it | | | +| [creates a URL to vulnerabilities page with correct path, filter and dataViewId](x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_navigate_findings.test.ts) | it | | | +| [useUrlQuery](x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_url_query.test.ts) | describe | | | +| [uses default query when no query is provided](x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_url_query.test.ts) | it | | | +| [merges default query, partial first query and partial second query](x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_url_query.test.ts) | it | | | +| [getSecuritySolutionLink](x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/security_solution_links.test.ts) | describe | | | +| [gets the correct link properties](x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/security_solution_links.test.ts) | it | | | +| [getAbbreviatedNumber](x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_abbreviated_number.test.ts) | describe | | | +| [should return the same value if it is less than 1000](x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_abbreviated_number.test.ts) | it | | | +| [should use numeral to format the value if it is greater than or equal to 1000](x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_abbreviated_number.test.ts) | it | | | +| [should return 0 if the value is NaN](x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_abbreviated_number.test.ts) | it | | | +| [getCvsScoreColor](x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | describe | | | +| [returns correct color for low severity score](x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | it | | | +| [returns correct color for medium severity score](x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | it | | | +| [returns correct color for high severity score](x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | it | | | +| [returns correct color for critical severity score](x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | it | | | +| [returns correct color for low severity score for undefined value](x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | it | | | +| [getSeverityStatusColor](x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | describe | | | +| [should return the correct color for LOW severity](x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | it | | | +| [should return the correct color for MEDIUM severity](x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | it | | | +| [should return the correct color for HIGH severity](x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | it | | | +| [should return the correct color for CRITICAL severity](x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | it | | | +| [should return #aaa for an unknown severity](x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts) | it | | | +| [AccountsEvaluatedWidget](x-pack/solutions/security/plugins/cloud_security_posture/public/components/accounts_evaluated_widget.test.tsx) | describe | | | +| [renders the component with benchmark data correctly](x-pack/solutions/security/plugins/cloud_security_posture/public/components/accounts_evaluated_widget.test.tsx) | it | | | +| [calls navToFindingsByCloudProvider when a benchmark with provider is clicked](x-pack/solutions/security/plugins/cloud_security_posture/public/components/accounts_evaluated_widget.test.tsx) | it | | | +| [calls navToFindingsByCisBenchmark when a benchmark with benchmarkId is clicked](x-pack/solutions/security/plugins/cloud_security_posture/public/components/accounts_evaluated_widget.test.tsx) | it | | | +| [<ChartPanel />](x-pack/solutions/security/plugins/cloud_security_posture/public/components/chart_panel.test.tsx) | describe | | | +| [renders loading state](x-pack/solutions/security/plugins/cloud_security_posture/public/components/chart_panel.test.tsx) | it | | | +| [renders error state](x-pack/solutions/security/plugins/cloud_security_posture/public/components/chart_panel.test.tsx) | it | | | +| [renders chart component](x-pack/solutions/security/plugins/cloud_security_posture/public/components/chart_panel.test.tsx) | it | | | +| [<CloudPosturePage />](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx) | describe | | | +| [renders children if setup status is indexed](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx) | it | | | +| [renders default loading text when query isLoading](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx) | it | | | +| [renders default loading text when query is idle](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx) | it | | | +| [renders default error texts when query isError](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx) | it | | | +| [prefers custom error render](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx) | it | | | +| [prefers custom loading render](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx) | it | | | +| [renders no data prompt when query data is undefined](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx) | it | | | +| [prefers custom no data prompt](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx) | it | | | +| [CloudSecurityDataTable](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.test.tsx) | describe | | | +| [renders loading state](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.test.tsx) | it | | | +| [renders empty state when no rows are present](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.test.tsx) | it | | | +| [renders data table with rows](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.test.tsx) | it | | | +| [renders data table with actions button](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.test.tsx) | it | | | +| [renders data table without actions button](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.test.tsx) | it | | | +| [FieldsSelectorTable](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | describe | | | +| [renders the table with data correctly](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | +| [calls onAddColumn when a checkbox is checked](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | +| [calls onRemoveColumn when a checkbox is unchecked](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | +| [View selected](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | describe | | | +| [should show "view all" option by default](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | +| [should render "view selected" option when previous selection was "view selected"](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | +| [should show "view all" option after the "view all" is selected](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | +| [should show only selected columns after the "view selected" option is selected](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | +| [should show all columns available after the "view all" option is selected](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | +| [should open the view selector with button click](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | +| [Searching columns](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | describe | | | +| [should find all columns match the search term](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | +| [should find all columns match the search term and are selected](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx) | it | | | +| [firstNonNullValue](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.test.ts) | describe | | | +| [returns the value itself for non-null single value](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.test.ts) | it | | | +| [returns undefined for a null single value](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.test.ts) | it | | | +| [returns undefined for an array of all null values](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.test.ts) | it | | | +| [returns the first non-null value in an array of mixed values](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.test.ts) | it | | | +| [returns the first value in an array of all non-null values](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.test.ts) | it | | | +| [returns undefined for an empty array](x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.test.ts) | it | | | +| [DetectionRuleCounter](x-pack/solutions/security/plugins/cloud_security_posture/public/components/detection_rule_counter.test.tsx) | describe | | | +| [should render loading skeleton when both rules and alerts are loading](x-pack/solutions/security/plugins/cloud_security_posture/public/components/detection_rule_counter.test.tsx) | it | | | +| [should render create rule link when no rules exist](x-pack/solutions/security/plugins/cloud_security_posture/public/components/detection_rule_counter.test.tsx) | it | | | +| [should render alert and rule count when rules exist](x-pack/solutions/security/plugins/cloud_security_posture/public/components/detection_rule_counter.test.tsx) | it | | | +| [should show loading spinner when creating a rule](x-pack/solutions/security/plugins/cloud_security_posture/public/components/detection_rule_counter.test.tsx) | it | | | +| [<CspPolicyTemplateForm />](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | describe | | | +| [shows license block if subscription is not allowed](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [license block renders with license url locator](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [license block renders without license url locator](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [updates package policy namespace to default when it changes](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders and updates name field](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders and updates description field](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders KSPM input selector](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [updates selected KSPM input](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders CSPM input selector](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders disabled KSPM input when editing](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders disabled CSPM input when editing](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [selects default KSPM input selector](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [selects default VULN_MGMT input selector](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [selects default CSPM input selector](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [K8S](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | describe | | | +| [K8S or KSPM Vanilla should not render any Setup Access option](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [EKS Credentials input fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | describe | | | +| [documentation Hyperlink should have correct URL to redirect users to AWS page](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders ${CLOUDBEAT_EKS} Assume Role fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [updates ${CLOUDBEAT_EKS} Assume Role fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders ${CLOUDBEAT_EKS} Direct Access Keys fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [updates ${CLOUDBEAT_EKS} Direct Access Keys fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders ${CLOUDBEAT_EKS} Temporary Keys fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [updates ${CLOUDBEAT_EKS} Temporary Keys fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders ${CLOUDBEAT_EKS} Shared Credentials fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [updates ${CLOUDBEAT_EKS} Shared Credentials fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [AWS Credentials input fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | describe | | | +| [renders ${CLOUDBEAT_AWS} Account Type field, AWS Organization is enabled for supported versions](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [${CLOUDBEAT_AWS} form displays upgrade message for unsupported versions and aws organization option is disabled](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [${CLOUDBEAT_AWS} form do not displays upgrade message for supported versions and aws organization option is enabled](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [Getting started Hyperlink should have correct URL to redirect users to elastic page](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [documentation Hyperlink should have correct URL to redirect users to elastic page if user chose Manual](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [documentation Hyperlink should have correct URL to redirect users to AWS page if user chose Cloudformation](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders ${CLOUDBEAT_AWS} Assume Role fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [updates ${CLOUDBEAT_AWS} Assume Role fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders ${CLOUDBEAT_AWS} Direct Access Keys fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [updates ${CLOUDBEAT_AWS} Direct Access Keys fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders ${CLOUDBEAT_AWS} Temporary Keys fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [updates ${CLOUDBEAT_AWS} Temporary Keys fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders ${CLOUDBEAT_AWS} Shared Credentials fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [updates ${CLOUDBEAT_AWS} Shared Credentials fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [Vuln Mgmt](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | describe | | | +| [Update Agent Policy CloudFormation template from vars](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [Additional Charge Callout message should be rendered](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [GCP Credentials input fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | describe | | | +| [renders ${CLOUDBEAT_GCP} Not supported when version is not at least version 1.5.2](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [documentation Hyperlink should have correct URL to redirect users to elastic page](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders Google Cloud Shell forms when Setup Access is set to Google Cloud Shell](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders ${CLOUDBEAT_GCP} Credentials File fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [updates ${CLOUDBEAT_GCP} Credentials File fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [${CLOUDBEAT_GCP} form do not displays upgrade message for supported versions and gcp organization option is enabled](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders ${CLOUDBEAT_GCP} Organization fields when account type is Organization and Setup Access is Google Cloud Shell](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders ${CLOUDBEAT_GCP} Organization fields when account type is Organization and Setup Access is manual](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [Should not render ${CLOUDBEAT_GCP} Organization fields when account type is Single](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [updates ${CLOUDBEAT_GCP} organization id](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [Azure Credentials input fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | describe | | | +| [renders ${CLOUDBEAT_AZURE} Not supported when version is not at least version 1.6.0](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [doesnt render ${CLOUDBEAT_AZURE} Manual fields when version is not at least version 1.7.0](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [selects default ${CLOUDBEAT_AZURE} fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders ${CLOUDBEAT_AZURE} Service Principal with Client Secret fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [updates ${CLOUDBEAT_AZURE} Service Principal with Client Secret fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [Agentless](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | describe | | | +| [should not render setup technology selector if agentless is not available and CSPM integration supports agentless](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [should render setup technology selector for AWS and allow to select agentless](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [should render setup technology selector for GCP for organisation account type](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [should render setup technology selector for GCP for single-account](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [should render setup technology selector for Azure for Organisation type](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [should render setup technology selector for Azure for Single Subscription type](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [should not render setup technology selector for KSPM](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [should not render setup technology selector for CNVM](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders Service principal with Client Certificate fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [updates Service principal with Client Certificate fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [should not render Service principal with Client Username and Password option](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | | | +| [renders Service principal with Client Username and Password fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [updates Service principal with Client Username and Password fields](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [useSetupTechnology](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | describe | | | +| [create page flow](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | describe | | | +| [initializes with AGENT_BASED technology](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | +| [sets to AGENT-BASED when agentless is available and AWS cloud](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | +| [sets to AGENT-BASED when agentless is available and GCP cloud](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | +| [sets to AGENT-BASED when agentless is available and Azure cloud](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | +| [sets to AGENT_BASED when agentless is available but input is not supported for agentless](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | +| [sets to AGENT_BASED when isAgentlessEnabled is false](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | +| [calls handleSetupTechnologyChange when setupTechnology changes](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | +| [edit page flow](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | describe | | | +| [initializes with AGENT_BASED technology](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | +| [initializes with agentless when is in edit mode and is agentless selected](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | +| [should not call handleSetupTechnologyChange when setupTechnology changes](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | +| [should not update setupTechnology when agentlessPolicyId becomes available](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts) | it | | | +| [getPosturePolicy](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | describe | | | +| [updates package policy with hidden vars for ${name}](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [updates package policy required vars (posture/deployment)](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [updates package policy with a single enabled input](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [should correctly increment cspm package name](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [should return correctly increment vuln_mgmt package name](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [should return correctly increment kspm package name](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [should return package name with -1 when no matching package policies are found](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [should return empty string when policy_templates is missing](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [should return empty string when policy_templates.name is not cspm](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [should return empty string when policy_templates.inputs is missing](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [should return empty string when policy_templates.inputs is empty](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [should return empty string when policy_templates.inputs is undefined](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [should return empty string when policy_templates.inputs.vars does not have cloud_shell_url](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [should return empty string when policy_templates.inputs.varshave cloud_shell_url but no default](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [should cloud shell url when policy_templates.inputs.vars have cloud_shell_url](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [should return "direct_access_key" for agentless](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [should return "assume_role" for agent-based, when cloudformation is not available](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [should return "cloud_formation" for agent-based, when cloudformation is available](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [should return "service_principal_with_client_secret" for agentless](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [shold return "arm_template" for agent-based, when arm_template is available](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [should return "managed_identity" for agent-based, when arm_template is not available](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [should return manual credentials-json credentials type for agentless](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [should return google_cloud_shell setup access for agent-based if cloud_shell_url is available](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [should return manual setup access for agent-based if cloud_shell_url is not available](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [Should return var item when key exist](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [Should return undefined when key is invalid](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [Should return undefined when datastream is undefined](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [Should return undefined when stream is undefined](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [Should return undefined when stream.var is invalid](x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts) | it | | | +| [NoFindingsStates](x-pack/solutions/security/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx) | describe | | | +| [shows integrations installation prompt with installation links when integration is not-installed](x-pack/solutions/security/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx) | it | | | +| [shows install agent prompt with install agent link when status is not-deployed](x-pack/solutions/security/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx) | it | | | +| [shows install agent prompt with install agent link when status is not-deployed and postureType is KSPM](x-pack/solutions/security/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx) | it | | | +| [shows indexing message when status is indexing](x-pack/solutions/security/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx) | it | | | +| [shows timeout message when status is index-timeout](x-pack/solutions/security/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx) | it | | | +| [shows unprivileged message when status is unprivileged](x-pack/solutions/security/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx) | it | | | +| [renders empty container when the status does not match a no finding status](x-pack/solutions/security/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx) | it | | | +| [<BenchmarksTable />](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx) | describe | | | +| [renders cis integration name](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx) | it | | | +| [renders benchmark version](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx) | it | | | +| [renders applicable to](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx) | it | | | +| [renders evaluated](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx) | it | | | +| [renders compliance](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx) | it | | | +| [<Benchmarks />](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx) | describe | | | +| [renders the page header](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx) | it | | | +| [renders the "add integration" button](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx) | it | | | +| [renders error state while there is an error](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx) | it | | | +| [renders the benchmarks table](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx) | it | | | +| [getTopRisks](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.test.ts) | describe | | | +| [returns sorted by posture score](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.test.ts) | it | | | +| [return sorted array with the correct number of elements](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.test.ts) | it | | | +| [<ComplianceDashboard />](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | describe | | | +| [shows package not installed page instead of tabs](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [no findings state: not-deployed - shows NotDeployed instead of dashboard](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [no findings state: indexing - shows Indexing instead of dashboard](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [no findings state: indexing - shows Indexing instead of dashboard when waiting_for_results](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [no findings state: index-timeout - shows IndexTimeout instead of dashboard](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [no findings state: unprivileged - shows Unprivileged instead of dashboard](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [shows dashboard when there are findings in latest findings index](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [Show Kubernetes dashboard if there are KSPM findings](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [Show Cloud dashboard if there are CSPM findings](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [Show Cloud dashboard "no findings prompt" if the CSPM integration is installed without findings](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [Show Kubernetes dashboard "no findings prompt" if the KSPM integration is installed without findings](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [Prefer Cloud dashboard if both integration are installed](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [Prefer Cloud dashboard if both integration have findings](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [Show CSPM installation prompt if CSPM is not installed and KSPM is installed ,NO AGENT](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [Show KSPM installation prompt if KSPM is not installed and CSPM is installed , NO AGENT](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [getDefaultTab](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | describe | | | +| [returns CSPM tab if only CSPM has findings](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [returns CSPM tab if both CSPM and KSPM has findings](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [returns KSPM tab if only KSPM has findings](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [when no findings preffers CSPM tab unless not-installed or unprivileged](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [should returns undefined when plugin status and cspm stats is not provided](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [should return undefined is plugin status and csp status is not provided ](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [should return undefined when plugins status or cspm stats data is not provided](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx) | it | | | +| [<BenchmarksSection />](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.test.tsx) | describe | | | +| [Sorting](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.test.tsx) | describe | | | +| [sorts by ascending order of compliance scores](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.test.tsx) | it | | | +| [toggles sort order when clicking Posture Score](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.test.tsx) | it | | | +| [<CloudSummarySection />](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.test.tsx) | describe | | | +| [renders all counter cards](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.test.tsx) | it | | | +| [renders counters content according to mock](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.test.tsx) | it | | | +| [renders counters value in compact abbreviation if its above one million](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.test.tsx) | it | | | +| [<Findings />](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | describe | | | +| [renders integrations installation prompt if integration is not installed and there are no findings](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | it | | | +| [SearchBar](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | describe | | | +| [set search query](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | it | | | +| [renders no results message and reset button when search query does not match](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | it | | | +| [add filter](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | it | | | +| [remove filter](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | it | | | +| [DistributionBar](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | describe | | | +| [renders the distribution bar](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | it | | | +| [filters by passed findings when clicking on the passed findings button](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | it | | | +| [filters by failed findings when clicking on the failed findings button](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx) | it | | | +| [<FindingsFlyout/>](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | describe | | | +| [Overview Tab](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | describe | | | +| [details and remediation accordions are open](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | +| [displays text details summary info](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | +| [displays missing info callout when data source is not CSP](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | +| [does not display missing info callout when data source is CSP](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | +| [Rule Tab](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | describe | | | +| [displays rule text details](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | +| [displays missing info callout when data source is not CSP](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | +| [does not display missing info callout when data source is CSP](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | +| [Table Tab](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | describe | | | +| [displays resource name and id](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | +| [does not display missing info callout for 3Ps](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | +| [JSON Tab](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | describe | | | +| [does not display missing info callout for 3Ps](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | +| [should allow pagination with next](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | +| [should allow pagination with previous](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx) | it | | | +| [Get Filters](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/utils/get_filters.test.ts) | describe | | | +| [negate an existing filter](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/utils/get_filters.test.ts) | it | | | +| [<RulesContainer />](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx) | describe | | | +| [displays rules with their initial state](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx) | it | | | +| [<Rules />](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx) | describe | | | +| [calls Benchmark API](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx) | it | | | +| [Display success state when result request is resolved](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx) | it | | | +| [use_change_csp_rule_state](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx) | describe | | | +| [should call http.post with the correct parameters](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx) | it | | | +| [should cancel queries and update query data onMutate](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx) | it | | | +| [should invalidate queries onSettled](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx) | it | | | +| [should restore previous query data onError](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx) | it | | | +| [creates the new set of cache rules in a muted state when calling createRulesWithUpdatedState](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx) | it | | | +| [creates the new cache with rules in a unmute state](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx) | it | | | +| [<VulnerabilityFindingFlyout/>](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | describe | | | +| [Header Info](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | describe | | | +| [displays text details flyout header info](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | it | | | +| [JSON Tab](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | describe | | | +| [show display Vulnerability JSON Tab](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | it | | | +| [Overview Summary Details Tab](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | describe | | | +| [show display Vulnerability details in a Overview Tab](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | it | | | +| [show empty state for no fixes](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | it | | | +| [Flyout Pagination](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | +| [should allow pagination with next](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [should allow pagination with previous](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [<Vulnerabilities />](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx) | describe | | | +| [No vulnerabilities state: not-deployed - shows NotDeployed instead of vulnerabilities ](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx) | it | | | +| [No vulnerabilities state: indexing - shows Indexing instead of vulnerabilities ](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx) | it | | | +| [No vulnerabilities state: index-timeout - shows IndexTimeout instead of vulnerabilities ](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx) | it | | | +| [No vulnerabilities state: unprivileged - shows Unprivileged instead of vulnerabilities ](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx) | it | | | +| [renders vuln_mgmt integrations installation prompt if vuln_mgmt integration is not installed](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx) | it | | | +| [<VulnerabilityDashboard />](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx) | describe | | | +| [renders vuln_mgmt integrations installation prompt if vuln_mgmt integration is not installed](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx) | it | | | +| [No vulnerabilities state: not-deployed - shows NotDeployed instead of vulnerabilities ](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx) | it | | | +| [No vulnerabilities state: indexing - shows Indexing instead of vulnerabilities ](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx) | it | | | +| [No vulnerabilities state: index-timeout - shows IndexTimeout instead of vulnerabilities ](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx) | it | | | +| [No vulnerabilities state: unprivileged - shows Unprivileged instead of vulnerabilities ](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx) | it | | | +| [Vulnerabilities state: indexed - renders dashboard container on indexed state ](x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx) | it | | | +| [createBenchmarkScoreIndex](x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/create_indices.test.ts) | describe | | | +| [should delete old index template from prev verions first](x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/create_indices.test.ts) | it | | | +| [should create index template with the correct index pattern, index name and default ingest pipeline](x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/create_indices.test.ts) | it | | | +| [should create index template the correct index patter, index name and default ingest pipeline but without lifecycle in serverless](x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/create_indices.test.ts) | it | | | +| [should create index if does not exist](x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/create_indices.test.ts) | it | | | +| [should updat index mapping if index exists](x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/create_indices.test.ts) | it | | | +| [createTransformIfNotExist](x-pack/solutions/security/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts) | describe | | | +| [expect not to create if already exists](x-pack/solutions/security/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts) | it | | | +| [expect to create if does not already exist](x-pack/solutions/security/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts) | it | | | +| [expect not to create if get error is not 404](x-pack/solutions/security/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts) | it | | | +| [startTransformIfNotStarted](x-pack/solutions/security/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts) | describe | | | +| [expect not to start if state is ${state}](x-pack/solutions/security/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts) | it | | | +| [expect not to start if transform not found](x-pack/solutions/security/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts) | it | | | +| [expect to start if state is stopped](x-pack/solutions/security/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts) | it | | | +| [expect to attempt restart if state is failed](x-pack/solutions/security/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts) | it | | | +| [Benchmark Field Key Functions](x-pack/solutions/security/plugins/cloud_security_posture/server/lib/mapping_field_util.test.ts) | describe | | | +| [toBenchmarkDocFieldKey should keep the same benchmark id and version key for benchmark document](x-pack/solutions/security/plugins/cloud_security_posture/server/lib/mapping_field_util.test.ts) | it | | | +| [toBenchmarkDocFieldKey should convert benchmark version with . delimiter correctly](x-pack/solutions/security/plugins/cloud_security_posture/server/lib/mapping_field_util.test.ts) | it | | | +| [toBenchmarkMappingFieldKey should convert benchmark version with _ delimiter correctly](x-pack/solutions/security/plugins/cloud_security_posture/server/lib/mapping_field_util.test.ts) | it | | | +| [toBenchmarkMappingFieldKey should handle benchmark version with dots correctly](x-pack/solutions/security/plugins/cloud_security_posture/server/lib/mapping_field_util.test.ts) | it | | | +| [MAPPING_VERSION_DELIMITER should be an underscore](x-pack/solutions/security/plugins/cloud_security_posture/server/lib/mapping_field_util.test.ts) | it | | | +| [Cloud Security Posture Plugin](x-pack/solutions/security/plugins/cloud_security_posture/server/plugin.test.ts) | describe | | | +| [start()](x-pack/solutions/security/plugins/cloud_security_posture/server/plugin.test.ts) | describe | | | +| [should initialize when package installed](x-pack/solutions/security/plugins/cloud_security_posture/server/plugin.test.ts) | it | | | +| [should not initialize when package is not installed](x-pack/solutions/security/plugins/cloud_security_posture/server/plugin.test.ts) | it | | | +| [should not initialize when other package is created](x-pack/solutions/security/plugins/cloud_security_posture/server/plugin.test.ts) | it | | | +| [packagePolicyPostCreate should return the same received policy](x-pack/solutions/security/plugins/cloud_security_posture/server/plugin.test.ts) | it | | | +| [getSortedCspBenchmarkRules](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts) | describe | | | +| [sorts by metadata.benchmark.rule_number, invalid semantic version still should still get sorted and empty values should be sorted last](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts) | it | | | +| [edge case - returns empty array if input is empty](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts) | it | | | +| [edge case - returns sorted array even if input only has one element](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts) | it | | | +| [returns sorted array even with undefined or null properties](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts) | it | | | +| [returns sorted array with invalid semantic versions](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts) | it | | | +| [benchmarks API](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | describe | | | +| [validate the API route path](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | +| [should accept to a user with fleet.all privilege](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | +| [should reject to a user without fleet.all privilege](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | +| [test input schema](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | describe | | | +| [expect to find default values](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | +| [expect to find package_policy_name](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | +| [should throw when page field is not a positive integer](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | +| [should throw when per_page field is not a positive integer](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | +| [should throw when sort_field is not string](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | +| [should not throw when sort_field is a string](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | +| [should throw when sort_order is not ](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | +| [should not throw when ](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | +| [should not throw when ](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | +| [should not throw when fields is a known string literal](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | +| [test benchmarks utils](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | describe | | | +| [test getAgentPolicies](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | describe | | | +| [should return one agent policy id when there is duplication](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | +| [should return full policy ids list when there is no id duplication](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | +| [test addPackagePolicyCspBenchmarkRule](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | describe | | | +| [should retrieve the rules count by the filtered benchmark type](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts) | it | | | +| [compliance dashboard permissions API](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.test.ts) | describe | | | +| [should accept to a user with fleet.all privilege](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.test.ts) | it | | | +| [should reject to a user without fleet.all privilege](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.test.ts) | it | | | +| [getBenchmarksFromAggs](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_benchmarks.test.ts) | describe | | | +| [should return value matching ComplianceDashboardDataV2["benchmarks"]](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_benchmarks.test.ts) | it | | | +| [getClustersFromAggs](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts) | describe | | | +| [should return value matching ComplianceDashboardData["clusters"]](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts) | it | | | +| [getPostureStatsFromAggs](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_grouped_findings_evaluation.test.ts) | describe | | | +| [should return value matching ComplianceDashboardData["resourcesTypes"]](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_grouped_findings_evaluation.test.ts) | it | | | +| [roundScore](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts) | describe | | | +| [should return decimal values with one fraction digit](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts) | it | | | +| [calculatePostureScore](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts) | describe | | | +| [should return calculated posture score](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts) | it | | | +| [getStatsFromFindingsEvaluationsAggs](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts) | describe | | | +| [should throw error in case no findings were found](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts) | it | | | +| [should return value matching ComplianceDashboardData["stats"]](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts) | it | | | +| [checks for stability in case one of the values is zero](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts) | it | | | +| [should return zero on all stats if there are no failed or passed findings](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts) | it | | | +| [getTrendsFromQueryResult](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.test.ts) | describe | | | +| [should return value matching Trends type definition, in descending order, and with postureScore](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.test.ts) | it | | | +| [calculateIntegrationStatus for cspm](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts) | describe | | | +| [Verify status when CSP package is not installed](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | +| [Verify status when there are no permission for cspm](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | +| [Verify status when there are no findings, no healthy agents and no installed policy templates](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | +| [Verify status when there are findings and installed policies but no healthy agents](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | +| [Verify status when there are findings ,installed policies and healthy agents](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | +| [Verify status when there are no findings ,installed policies and no healthy agents](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | +| [Verify status when there are installed policies, healthy agents and no findings](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | +| [Verify status when there are installed policies, healthy agents and no findings and been more than 10 minutes](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | +| [Verify status when there are installed policies, healthy agents past findings but no recent findings](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | +| [calculateIntegrationStatus for vul_mgmt](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts) | describe | | | +| [Verify status when there are no permission for vul_mgmt](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | +| [Verify status when there are no vul_mgmt findings, no healthy agents and no installed policy templates](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | +| [Verify status when there are vul_mgmt findings and installed policies but no healthy agents](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | +| [Verify status when there are vul_mgmt findings ,installed policies and healthy agents](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | +| [Verify status when there are no vul_mgmt findings ,installed policies and no healthy agents](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | +| [Verify status when there are installed policies, healthy agents and no vul_mgmt findings](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | +| [Verify status when there are installed policies, healthy agents and no vul_mgmt findings and been more than 10 minutes](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | +| [Verify status when there are installed policies, healthy agents and no vul_mgmt findings and been more than 1 hour](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | +| [Verify status when there are installed policies, healthy agents past vul_mgmt findings but no recent findings](x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts) | it | | | +| [finding stats task state](x-pack/solutions/security/plugins/cloud_security_posture/server/tasks/task_state.test.ts) | describe | | | +| [v1](x-pack/solutions/security/plugins/cloud_security_posture/server/tasks/task_state.test.ts) | describe | | | +| [should work on empty object when running the up migration](x-pack/solutions/security/plugins/cloud_security_posture/server/tasks/task_state.test.ts) | it | | | +| [shouldn](x-pack/solutions/security/plugins/cloud_security_posture/server/tasks/task_state.test.ts) | it | | | +| [should drop unknown properties when running the up migration](x-pack/solutions/security/plugins/cloud_security_posture/server/tasks/task_state.test.ts) | it | | | +</details> + +## Directory: x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture + +**Total Tests:** 43 | **Skipped:** 6 (13.95%) | **Todo:** 0 (0.00%) + +![](https://img.shields.io/badge/FTR-blue) ![](https://img.shields.io/badge/SERVERLESS-pink) ![](https://img.shields.io/badge/API-INTEGRATION-purple) ![](https://img.shields.io/badge/HAS-SKIP-yellow) + +<details> +<summary>Test Details</summary> + +| Test Label | Type | Skipped | Todo | +|------------|------|---------|------| +| [GET /internal/cloud_security_posture/benchmark](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/benchmark/v1.ts) | describe | | | +| [Should return non-empty array filled with Rules if user has CSP integrations](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/benchmark/v1.ts) | it | | | +| [Should return array size 2 when we set per page to be only 2 (total element is still 3)](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/benchmark/v1.ts) | it | | | +| [Should return array size 2 when we set per page to be only 2 (total element is still 3)](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/benchmark/v1.ts) | it | | | +| [Should return empty array when we set page to be above the last page number](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/benchmark/v1.ts) | it | | | +| [GET /internal/cloud_security_posture/benchmark](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/benchmark/v2.ts) | describe | | | +| [Should return all benchmarks if user has CSP integrations](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/benchmark/v2.ts) | it | | | +| [GET internal/cloud_security_posture/rules/_find](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts) | describe | | | +| [Should return 500 error code when not provide package policy id or benchmark id](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | +| [Should return 500 error code when provide both package policy id and benchmark id](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | +| [Should return 404 status code when the package policy ID does not exist](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | +| [Should return 200 status code and filter rules by benchmarkId](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | +| [Should return 200 status code, and only requested fields in the response](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | +| [Should return 200 status code, items sorted by metadata.section field](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | +| [Should return 200 status code and paginate rules with a limit of PerPage](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | +| [cloud_security_posture](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/index.ts) | describe | | | +| [Intercept the usage API request sent by the metering background task manager](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/serverless_metering/cloud_security_metering.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Should intercept usage API request for CSPM](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/serverless_metering/cloud_security_metering.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Should intercept usage API request for KSPM](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/serverless_metering/cloud_security_metering.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Should intercept usage API request for CNVM](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/serverless_metering/cloud_security_metering.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Should intercept usage API request for Defend for Containers](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/serverless_metering/cloud_security_metering.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Should intercept usage API request with all integrations usage records](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/serverless_metering/cloud_security_metering.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [GET /internal/cloud_security_posture/status](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_indexed.ts) | describe | | | +| [STATUS = INDEXED TEST](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_indexed.ts) | describe | | | +| [Return kspm status indexed when logs-cloud_security_posture.findings_latest-default contains new kspm documents](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_indexed.ts) | it | | | +| [Return cspm status indexed when logs-cloud_security_posture.findings_latest-default contains new cspm documents](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_indexed.ts) | it | | | +| [Return vuln status indexed when logs-cloud_security_posture.vulnerabilities_latest-default contains new documents](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_indexed.ts) | it | | | +| [GET /internal/cloud_security_posture/status](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_indexing.ts) | describe | | | +| [STATUS = INDEXING TEST](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_indexing.ts) | describe | | | +| [Return kspm status indexing when logs-cloud_security_posture.findings_latest-default doesn](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_indexing.ts) | it | | | +| [Return cspm status indexing when logs-cloud_security_posture.findings_latest-default doesn](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_indexing.ts) | it | | | +| [Return vuln status indexing when logs-cloud_security_posture.vulnerabilities_latest-default doesn](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_indexing.ts) | it | | | +| [GET /internal/cloud_security_posture/status](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_not_deployed_not_installed.ts) | describe | | | +| [STATUS = NOT-DEPLOYED and STATUS = NOT-INSTALLED TEST](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_not_deployed_not_installed.ts) | describe | | | +| [Should return not-deployed when installed kspm, no findings on either indices and no healthy agents](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_not_deployed_not_installed.ts) | it | | | +| [Should return not-deployed when installed cspm, no findings on either indices and no healthy agents](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_not_deployed_not_installed.ts) | it | | | +| [Should return not-deployed when installed cnvm, no findings on either indices and no healthy agents](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/status/status_not_deployed_not_installed.ts) | it | | | +| [Verify cloud_security_posture telemetry payloads](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/telemetry.ts) | describe | | | +| [includes only KSPM findings](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/telemetry.ts) | it | | | +| [includes only CSPM findings](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/telemetry.ts) | it | | | +| [includes CSPM and KSPM findings](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/telemetry.ts) | it | | | +| [](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/telemetry.ts) | it | | | +| [includes KSPM findings without posture_type and CSPM findings as well](x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/telemetry.ts) | it | | | +</details> + +## Directory: x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture + +**Total Tests:** 33 | **Skipped:** 3 (9.09%) | **Todo:** 0 (0.00%) + +![](https://img.shields.io/badge/FTR-blue) ![](https://img.shields.io/badge/SERVERLESS-pink) ![](https://img.shields.io/badge/HAS-SKIP-yellow) + +<details> +<summary>Test Details</summary> + +| Test Label | Type | Skipped | Todo | +|------------|------|---------|------| +| [Agentless API Serverless](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless_api/create_agent.ts) | describe | | | +| [should create agentless-agent](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless_api/create_agent.ts) | it | | | +| [should create default agent-based agent](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless_api/create_agent.ts) | it | | | +| [cloud_security_posture](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless_api/index.ts) | describe | | | +| [Serverless - Agentless CIS Integration Page](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | describe | | | +| [Serverless - Agentless CIS_AWS Single Account Launch Cloud formation](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | describe | | | +| [should show CIS_AWS Launch Cloud formation button when credentials selector is direct access keys and package version is ${CLOUD_CREDENTIALS_PACKAGE_VERSION}](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | it | | | +| [should hide CIS_AWS Launch Cloud formation button when credentials selector is temporary keys and package version is less than ${previousPackageVersion}](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | it | | | +| [Serverless - Agentless CIS_AWS ORG Account Launch Cloud formation](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | describe | | | +| [should show CIS_AWS Launch Cloud formation button when credentials selector is direct access keys and package version is ${CLOUD_CREDENTIALS_PACKAGE_VERSION}](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [should hide CIS_AWS Launch Cloud formation button when credentials selector is temporary keys and package version is less than ${previousPackageVersion}](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | it | | | +| [Serverless - Agentless CIS_AWS edit flow](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | describe | | | +| [user should save and edit agentless integration policy](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | it | | | +| [Serverless - Agentless CIS_AWS Create flow](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | +| [user should save agentless integration policy when there are no api or validation errors and button is not disabled](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_aws.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Agentless CIS Integration Page](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_gcp.ts) | describe | | | +| [Agentless CIS_GCP Single Account Launch Cloud shell](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_gcp.ts) | describe | | | +| [should show CIS_GCP Launch Cloud Shell button when package version is ${CLOUD_CREDENTIALS_PACKAGE_VERSION}](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_gcp.ts) | it | | | +| [should hide CIS_GCP Launch Cloud Shell button when package version is less than ${CLOUD_CREDENTIALS_PACKAGE_VERSION}](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_gcp.ts) | it | | | +| [Agentless CIS_GCP ORG Account Launch Cloud Shell](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_gcp.ts) | describe | | | +| [should show CIS_GCP Launch Cloud Shell button when package version is ${CLOUD_CREDENTIALS_PACKAGE_VERSION}](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_gcp.ts) | it | | | +| [should hide CIS_GCP Launch Cloud shell button when package version is ${previousPackageVersion}](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_gcp.ts) | it | | | +| [Serverless - Agentless CIS_GCP edit flow](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_gcp.ts) | describe | | | +| [user should save and edit agentless integration policy](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/cis_integration_gcp.ts) | it | | | +| [cloud_security_posture](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/agentless/index.ts) | describe | | | +| [Cloud Posture Dashboard Page](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/compliance_dashboard.ts) | describe | | | +| [Kubernetes Dashboard](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/compliance_dashboard.ts) | describe | | | +| [displays accurate summary compliance score](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/compliance_dashboard.ts) | it | | | +| [[Essentials PLI] Test Cloud Security Posture Integrations on Serverless](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/csp_integrations_form.essentials.ts) | describe | | | +| [[Essentials PLI] Integration installation form should be available with Essentials or Complete PLI](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/csp_integrations_form.essentials.ts) | it | | | +| [Test Cloud Security Posture Integrations on Serverless](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/csp_integrations_form.ts) | describe | | | +| [Integration installation form should not be available without required PLI](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/csp_integrations_form.ts) | it | | | +| [cloud_security_posture](x-pack/test_serverless/functional/test_suites/security/ftr/cloud_security_posture/index.ts) | describe | | | +</details> + +## Directory: x-pack/test/api_integration/apis/cloud_security_posture + +**Total Tests:** 65 | **Skipped:** 0 (0.00%) | **Todo:** 0 (0.00%) + +![](https://img.shields.io/badge/FTR-blue) ![](https://img.shields.io/badge/API-INTEGRATION-purple) + +<details> +<summary>Test Details</summary> + +| Test Label | Type | Skipped | Todo | +|------------|------|---------|------| +| [GET /internal/cloud_security_posture/benchmark](x-pack/test/api_integration/apis/cloud_security_posture/benchmark/v1.ts) | describe | | | +| [Should return non-empty array filled with Rules if user has CSP integrations](x-pack/test/api_integration/apis/cloud_security_posture/benchmark/v1.ts) | it | | | +| [Should return array size 2 when we set per page to be only 2 (total element is still 3)](x-pack/test/api_integration/apis/cloud_security_posture/benchmark/v1.ts) | it | | | +| [Should return array size 2 when we set per page to be only 2 (total element is still 3)](x-pack/test/api_integration/apis/cloud_security_posture/benchmark/v1.ts) | it | | | +| [Should return empty array when we set page to be above the last page number](x-pack/test/api_integration/apis/cloud_security_posture/benchmark/v1.ts) | it | | | +| [GET /internal/cloud_security_posture/benchmark](x-pack/test/api_integration/apis/cloud_security_posture/benchmark/v2.ts) | describe | | | +| [Should return all benchmarks if user has CSP integrations](x-pack/test/api_integration/apis/cloud_security_posture/benchmark/v2.ts) | it | | | +| [GET internal/cloud_security_posture/rules/_find](x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts) | describe | | | +| [Should return 500 error code when not provide package policy id or benchmark id](x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | +| [Should return 500 error code when provide both package policy id and benchmark id](x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | +| [Should return 404 status code when the package policy ID does not exist](x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | +| [Should return 200 status code and filter rules by benchmarkId](x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | +| [Should return 200 status code, and only requested fields in the response](x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | +| [Should return 200 status code, items sorted by metadata.section field](x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | +| [Should return 200 status code and paginate rules with a limit of PerPage](x-pack/test/api_integration/apis/cloud_security_posture/find_csp_benchmark_rule.ts) | it | | | +| [cloud_security_posture](x-pack/test/api_integration/apis/cloud_security_posture/index.ts) | describe | | | +| [GET internal/cloud_security_posture/rules/_find](x-pack/test/api_integration/apis/cloud_security_posture/rules/v1.ts) | describe | | | +| [Should return 500 error code when not provide package policy id or benchmark id](x-pack/test/api_integration/apis/cloud_security_posture/rules/v1.ts) | it | | | +| [Should return 500 error code when provide both package policy id and benchmark id](x-pack/test/api_integration/apis/cloud_security_posture/rules/v1.ts) | it | | | +| [Should return 404 status code when the package policy ID does not exist](x-pack/test/api_integration/apis/cloud_security_posture/rules/v1.ts) | it | | | +| [Should return 200 status code and filter rules by benchmarkId](x-pack/test/api_integration/apis/cloud_security_posture/rules/v1.ts) | it | | | +| [Should return 200 status code, and only requested fields in the response](x-pack/test/api_integration/apis/cloud_security_posture/rules/v1.ts) | it | | | +| [Should return 200 status code, items sorted by metadata.section field](x-pack/test/api_integration/apis/cloud_security_posture/rules/v1.ts) | it | | | +| [Should return 200 status code and paginate rules with a limit of PerPage](x-pack/test/api_integration/apis/cloud_security_posture/rules/v1.ts) | it | | | +| [GET internal/cloud_security_posture/rules/_find](x-pack/test/api_integration/apis/cloud_security_posture/rules/v2.ts) | describe | | | +| [Should return 500 error code when not provide benchmark id](x-pack/test/api_integration/apis/cloud_security_posture/rules/v2.ts) | it | | | +| [Should return 200 status code and filter rules by benchmarkId and benchmarkVersion](x-pack/test/api_integration/apis/cloud_security_posture/rules/v2.ts) | it | | | +| [Should return 200 status code, and only requested fields in the response](x-pack/test/api_integration/apis/cloud_security_posture/rules/v2.ts) | it | | | +| [Should return 200 status code, items sorted by metadata.section field](x-pack/test/api_integration/apis/cloud_security_posture/rules/v2.ts) | it | | | +| [Should return 200 status code and paginate rules with a limit of PerPage](x-pack/test/api_integration/apis/cloud_security_posture/rules/v2.ts) | it | | | +| [GET /internal/cloud_security_posture/status](x-pack/test/api_integration/apis/cloud_security_posture/status/status_index_timeout.ts) | describe | | | +| [STATUS = INDEX_TIMEOUT TEST](x-pack/test/api_integration/apis/cloud_security_posture/status/status_index_timeout.ts) | describe | | | +| [Should return index-timeout when installed kspm, has findings only on logs-cloud_security_posture.findings-default* and it has been more than 10 minutes since the installation](x-pack/test/api_integration/apis/cloud_security_posture/status/status_index_timeout.ts) | it | | | +| [Should return index-timeout when installed cspm, has findings only on logs-cloud_security_posture.findings-default* and it has been more than 10 minutes since the installation](x-pack/test/api_integration/apis/cloud_security_posture/status/status_index_timeout.ts) | it | | | +| [Should return index-timeout when installed cnvm, has findings only on logs-cloud_security_posture.vulnerabilities-default* and it has been more than 4 hours minutes since the installation](x-pack/test/api_integration/apis/cloud_security_posture/status/status_index_timeout.ts) | it | | | +| [GET /internal/cloud_security_posture/status](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexed.ts) | describe | | | +| [STATUS = INDEXED TEST](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexed.ts) | describe | | | +| [Return hasMisconfigurationsFindings true when there are latest findings but no installed integrations](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexed.ts) | it | | | +| [Return hasMisconfigurationsFindings true when there are only findings in third party index](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexed.ts) | it | | | +| [Return hasMisconfigurationsFindings false when there are no findings](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexed.ts) | it | | | +| [Return kspm status indexed when logs-cloud_security_posture.findings_latest-default contains new kspm documents](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexed.ts) | it | | | +| [Return cspm status indexed when logs-cloud_security_posture.findings_latest-default contains new cspm documents](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexed.ts) | it | | | +| [Return vuln status indexed when logs-cloud_security_posture.vulnerabilities_latest-default contains new documents](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexed.ts) | it | | | +| [GET /internal/cloud_security_posture/status](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexing.ts) | describe | | | +| [STATUS = INDEXING TEST](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexing.ts) | describe | | | +| [Return kspm status indexing when logs-cloud_security_posture.findings_latest-default doesn](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexing.ts) | it | | | +| [Return cspm status indexing when logs-cloud_security_posture.findings_latest-default doesn](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexing.ts) | it | | | +| [Return vuln status indexing when logs-cloud_security_posture.vulnerabilities_latest-default doesn](x-pack/test/api_integration/apis/cloud_security_posture/status/status_indexing.ts) | it | | | +| [GET /internal/cloud_security_posture/status](x-pack/test/api_integration/apis/cloud_security_posture/status/status_not_deployed_not_installed.ts) | describe | | | +| [STATUS = NOT-DEPLOYED and STATUS = NOT-INSTALLED TEST](x-pack/test/api_integration/apis/cloud_security_posture/status/status_not_deployed_not_installed.ts) | describe | | | +| [Should return not-deployed when installed kspm, no findings on either indices and no healthy agents](x-pack/test/api_integration/apis/cloud_security_posture/status/status_not_deployed_not_installed.ts) | it | | | +| [Should return not-deployed when installed cspm, no findings on either indices and no healthy agents](x-pack/test/api_integration/apis/cloud_security_posture/status/status_not_deployed_not_installed.ts) | it | | | +| [Should return not-deployed when installed cnvm, no findings on either indices and no healthy agents](x-pack/test/api_integration/apis/cloud_security_posture/status/status_not_deployed_not_installed.ts) | it | | | +| [GET /internal/cloud_security_posture/status](x-pack/test/api_integration/apis/cloud_security_posture/status/status_unprivileged.ts) | describe | | | +| [STATUS = UNPRIVILEGED TEST](x-pack/test/api_integration/apis/cloud_security_posture/status/status_unprivileged.ts) | describe | | | +| [Return unprivileged for cspm, kspm, vuln_mgmt when users don](x-pack/test/api_integration/apis/cloud_security_posture/status/status_unprivileged.ts) | it | | | +| [status = unprivileged test indices](x-pack/test/api_integration/apis/cloud_security_posture/status/status_unprivileged.ts) | describe | | | +| [Return unprivileged when missing access to findings_latest index](x-pack/test/api_integration/apis/cloud_security_posture/status/status_unprivileged.ts) | it | | | +| [Return unprivileged when missing access to score index](x-pack/test/api_integration/apis/cloud_security_posture/status/status_unprivileged.ts) | it | | | +| [Return unprivileged when missing access to vulnerabilities_latest index](x-pack/test/api_integration/apis/cloud_security_posture/status/status_unprivileged.ts) | it | | | +| [GET /internal/cloud_security_posture/status](x-pack/test/api_integration/apis/cloud_security_posture/status/status_waiting_for_results.ts) | describe | | | +| [STATUS = WAITING_FOR_RESULT TEST](x-pack/test/api_integration/apis/cloud_security_posture/status/status_waiting_for_results.ts) | describe | | | +| [Should return waiting_for_result when installed kspm, has no findings and it has been less than 10 minutes since the installation](x-pack/test/api_integration/apis/cloud_security_posture/status/status_waiting_for_results.ts) | it | | | +| [Should return waiting_for_result when installed cspm, has no findings and it has been less than 10 minutes since the installation](x-pack/test/api_integration/apis/cloud_security_posture/status/status_waiting_for_results.ts) | it | | | +| [Should return waiting_for_result when installed cnvm, has no findings and it has been less than 4 hours minutes since the installation](x-pack/test/api_integration/apis/cloud_security_posture/status/status_waiting_for_results.ts) | it | | | +</details> + +## Directory: x-pack/test/cloud_security_posture_api + +**Total Tests:** 58 | **Skipped:** 2 (3.45%) | **Todo:** 0 (0.00%) + +![](https://img.shields.io/badge/FTR-blue) ![](https://img.shields.io/badge/API-INTEGRATION-purple) ![](https://img.shields.io/badge/HAS-SKIP-yellow) + +<details> +<summary>Test Details</summary> + +| Test Label | Type | Skipped | Todo | +|------------|------|---------|------| +| [GET /internal/cloud_security_posture/benchmarks](x-pack/test/cloud_security_posture_api/routes/benchmarks.ts) | describe | | | +| [Get Benchmark API](x-pack/test/cloud_security_posture_api/routes/benchmarks.ts) | describe | | | +| [Verify cspm benchmark score is updated when muting rules](x-pack/test/cloud_security_posture_api/routes/benchmarks.ts) | it | | | +| [Verify kspm benchmark score is updated when muting rules](x-pack/test/cloud_security_posture_api/routes/benchmarks.ts) | it | | | +| [Get Benchmark API](x-pack/test/cloud_security_posture_api/routes/benchmarks.ts) | describe | | | +| [Calling Benchmark API as User with no read access to Security](x-pack/test/cloud_security_posture_api/routes/benchmarks.ts) | it | | | +| [Calling Benchmark API as User with read access to Security](x-pack/test/cloud_security_posture_api/routes/benchmarks.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Verify update csp rules states API](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts) | describe | | | +| [mute benchmark rules successfully](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts) | it | | | +| [unmute rules successfully](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts) | it | | | +| [verify new rules are added and existing rules are set.](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts) | it | | | +| [mute detection rule successfully](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts) | it | | | +| [Expect to mute two benchmark rules and one detection rule](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts) | it | | | +| [Expect to save rules states when requesting to update empty object](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts) | it | | | +| [set wrong action input](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts) | it | | | +| [users without read privileges on cloud security should not be able to mute](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts) | it | | | +| [users with all privileges on cloud security should be able to mute](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts) | it | | | +| [Tests get rules states API](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_get_states.ts) | describe | | | +| [get rules states successfully](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_get_states.ts) | it | | | +| [get empty object when rules states not exists](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_get_states.ts) | it | | | +| [GET rules states API with user with read access](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_get_states.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [GET rules states API API with user without read access](x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_get_states.ts) | it | | | +| [/internal/cloud_security_posture/detection_engine_rules/alerts/_status](x-pack/test/cloud_security_posture_api/routes/get_detection_engine_alerts_count_by_rule_tags.ts) | describe | | | +| [GET detection_engine_rules API with user that has specific access](x-pack/test/cloud_security_posture_api/routes/get_detection_engine_alerts_count_by_rule_tags.ts) | describe | | | +| [GET detection_engine_rules API with user with read access](x-pack/test/cloud_security_posture_api/routes/get_detection_engine_alerts_count_by_rule_tags.ts) | it | | | +| [GET detection_engine_rules API with user without read access](x-pack/test/cloud_security_posture_api/routes/get_detection_engine_alerts_count_by_rule_tags.ts) | it | | | +| [Cloud Security Posture](x-pack/test/cloud_security_posture_api/routes/index.ts) | describe | | | +| [GET /internal/cloud_security_posture/stats](x-pack/test/cloud_security_posture_api/routes/stats.ts) | describe | | | +| [CSPM Compliance Dashboard Stats API](x-pack/test/cloud_security_posture_api/routes/stats.ts) | describe | | | +| [should return CSPM cluster V1 ](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | +| [should return CSPM benchmarks V2 ](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | +| [KSPM Compliance Dashboard Stats API](x-pack/test/cloud_security_posture_api/routes/stats.ts) | describe | | | +| [should return KSPM clusters V1 ](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | +| [should return KSPM benchmarks V2](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | +| [should return KSPM benchmarks V2](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | +| [Compliance dashboard based on enabled rules](x-pack/test/cloud_security_posture_api/routes/stats.ts) | describe | | | +| [should calculate cspm benchmarks posture score based only on enabled rules](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | +| [should calculate kspm benchmarks posture score based only on enabled rules](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | +| [GET stats API with user that has specific access](x-pack/test/cloud_security_posture_api/routes/stats.ts) | describe | | | +| [GET stats API V1 with user with read access](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | +| [GET stats API V1 with user with read access](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | +| [GET stats API V2 with user with read access](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | +| [GET stats API V2 with user without read access](x-pack/test/cloud_security_posture_api/routes/stats.ts) | it | | | +| [GET /internal/cloud_security_posture/status](x-pack/test/cloud_security_posture_api/routes/status.ts) | describe | | | +| [GET status API with user that has specific access](x-pack/test/cloud_security_posture_api/routes/status.ts) | describe | | | +| [GET stats API with user with read access](x-pack/test/cloud_security_posture_api/routes/status.ts) | it | | | +| [GET status API with user without read access](x-pack/test/cloud_security_posture_api/routes/status.ts) | it | | | +| [Vulnerability Dashboard API](x-pack/test/cloud_security_posture_api/routes/vulnerabilities_dashboard.ts) | describe | | | +| [responds with a 200 status code and matching data mock](x-pack/test/cloud_security_posture_api/routes/vulnerabilities_dashboard.ts) | it | | | +| [returns a 400 error when necessary indices are nonexistent](x-pack/test/cloud_security_posture_api/routes/vulnerabilities_dashboard.ts) | it | | | +| [GET vulnerabilities dashboard API with users with read access to cloud security posture](x-pack/test/cloud_security_posture_api/routes/vulnerabilities_dashboard.ts) | it | | | +| [GET vulnerabilities dashboard API with users without read access to cloud security posture](x-pack/test/cloud_security_posture_api/routes/vulnerabilities_dashboard.ts) | it | | | +| [Verify cloud_security_posture telemetry payloads](x-pack/test/cloud_security_posture_api/telemetry/telemetry.ts) | describe | | | +| [includes only KSPM findings](x-pack/test/cloud_security_posture_api/telemetry/telemetry.ts) | it | | | +| [includes only CSPM findings](x-pack/test/cloud_security_posture_api/telemetry/telemetry.ts) | it | | | +| [includes CSPM and KSPM findings](x-pack/test/cloud_security_posture_api/telemetry/telemetry.ts) | it | | | +| [](x-pack/test/cloud_security_posture_api/telemetry/telemetry.ts) | it | | | +| [includes KSPM findings without posture_type and CSPM findings as well](x-pack/test/cloud_security_posture_api/telemetry/telemetry.ts) | it | | | +</details> + +## Directory: x-pack/test/cloud_security_posture_functional + +**Total Tests:** 223 | **Skipped:** 69 (30.94%) | **Todo:** 3 (1.35%) + +![](https://img.shields.io/badge/FTR-blue) ![](https://img.shields.io/badge/HAS-SKIP-yellow) ![](https://img.shields.io/badge/HAS-TODO-green) + +<details> +<summary>Test Details</summary> + +| Test Label | Type | Skipped | Todo | +|------------|------|---------|------| +| [Agentless cloud](x-pack/test/cloud_security_posture_functional/agentless/create_agent.ts) | describe | | | +| [should create agentless-agent](x-pack/test/cloud_security_posture_functional/agentless/create_agent.ts) | it | | | +| [should create default agent-based agent](x-pack/test/cloud_security_posture_functional/agentless/create_agent.ts) | it | | | +| [Benchmark Page - Sanity Tests](x-pack/test/cloud_security_posture_functional/cloud_tests/benchmark_sanity.ts) | describe | | | +| [Benchmark table exists](x-pack/test/cloud_security_posture_functional/cloud_tests/benchmark_sanity.ts) | it | | | +| [Benchmarks count is more than 0](x-pack/test/cloud_security_posture_functional/cloud_tests/benchmark_sanity.ts) | it | | | +| [For each benchmark, evaluation and complience are not empty](x-pack/test/cloud_security_posture_functional/cloud_tests/benchmark_sanity.ts) | it | | | +| [Cloud Posture Dashboard Page - Sanity Tests](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | describe | | | +| [Cloud Dashboard](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | describe | | | +| [displays compliance score greater than 40](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | it | | | +| [displays all compliance scores](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | it | | | +| [displays a number of resources evaluated greater than 1500](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | it | | | +| [Compliance By CIS sections have non empty values](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | it | | | +| [Navigation to Findings page](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | it | | | +| [Kubernetes Dashboard](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | describe | | | +| [displays compliance score greater than 80](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | it | | | +| [displays a number of resources evaluated greater than 150](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | it | | | +| [Compliance By CIS sections have non empty values](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | it | | | +| [Navigation to Findings page](x-pack/test/cloud_security_posture_functional/cloud_tests/dashboard_sanity.ts) | it | | | +| [Findings Page - Sanity Tests](x-pack/test/cloud_security_posture_functional/cloud_tests/findings_sanity.ts) | describe | | | +| [Findings - Querying data](x-pack/test/cloud_security_posture_functional/cloud_tests/findings_sanity.ts) | describe | | | +| [Querying ${provider} provider data](x-pack/test/cloud_security_posture_functional/cloud_tests/findings_sanity.ts) | it | | | +| [Paginating and sorting data](x-pack/test/cloud_security_posture_functional/cloud_tests/findings_sanity.ts) | it | | | +| [Cloud Security Posture](x-pack/test/cloud_security_posture_functional/cloud_tests/index.ts) | describe | | | +| [Data Views](x-pack/test/cloud_security_posture_functional/data_views/data_views.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Verify data view is created once user reach the findings page - default space](x-pack/test/cloud_security_posture_functional/data_views/data_views.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Verify data view is created once user reach the dashboard page - default space](x-pack/test/cloud_security_posture_functional/data_views/data_views.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Verify data view is created once user reach the findings page - non default space](x-pack/test/cloud_security_posture_functional/data_views/data_views.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Verify data view is created once user reach the dashboard page - non default space](x-pack/test/cloud_security_posture_functional/data_views/data_views.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Verify data view is created once user with read permissions reach the dashboard page](x-pack/test/cloud_security_posture_functional/data_views/data_views.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Cloud Security Posture](x-pack/test/cloud_security_posture_functional/data_views/index.ts) | describe | | | +| [Access with custom roles](x-pack/test/cloud_security_posture_functional/pages/benchmark.ts) | describe | | | +| [Access with valid user role](x-pack/test/cloud_security_posture_functional/pages/benchmark.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Access with invalid user role](x-pack/test/cloud_security_posture_functional/pages/benchmark.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Access with custom roles - rule page](x-pack/test/cloud_security_posture_functional/pages/benchmark.ts) | describe | | | +| [Access with valid user role](x-pack/test/cloud_security_posture_functional/pages/benchmark.ts) | it | | | +| [Access with invalid user role](x-pack/test/cloud_security_posture_functional/pages/benchmark.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Test adding Cloud Security Posture Integrations CNVM](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cnvm/cis_integration_cnvm.ts) | describe | | | +| [CNVM AWS](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cnvm/cis_integration_cnvm.ts) | describe | | | +| [Hyperlink on PostInstallation Modal should have the correct URL](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cnvm/cis_integration_cnvm.ts) | it | | | +| [On Add Agent modal there should be modal that has Cloud Formation details as well as button that redirects user to Cloud formation page on AWS upon clicking them ](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cnvm/cis_integration_cnvm.ts) | it | | | +| [Clicking on Launch CloudFormation on post intall modal should lead user to Cloud Formation page](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cnvm/cis_integration_cnvm.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Test adding Cloud Security Posture Integrations CSPM AWS](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | | | +| [CIS_AWS Organization Cloud Formation](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | | | +| [Initial form state, AWS Org account, and CloudFormation should be selected by default](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | +| [Hyperlink on PostInstallation Modal should have the correct URL](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | +| [On Add Agent modal there should be modal that has Cloud Formation details as well as button that redirects user to Cloud formation page on AWS upon clicking them ](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | +| [Clicking on Launch CloudFormation on post intall modal should lead user to Cloud Formation page](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | +| [CIS_AWS Organization Manual Assume Role](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | +| [CIS_AWS Organization Manual Assume Role Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [CIS_AWS Organization Manual Direct Access](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | | | +| [CIS_AWS Organization Manual Direct Access Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | +| [CIS_AWS Organization Manual Temporary Keys](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | | | +| [CIS_AWS Organization Manual Temporary Keys Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | +| [CIS_AWS Organization Manual Shared Access](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | | | +| [CIS_AWS Organization Manual Shared Access Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | +| [CIS_AWS Single Cloud Formation](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | | | +| [CIS_AWS Single Cloud Formation workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | +| [CIS_AWS Single Manual Assume Role](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | | | +| [CIS_AWS Single Manual Assume Role Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | +| [CIS_AWS Single Manual Direct Access](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | | | +| [CIS_AWS Single Manual Direct Access Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | +| [CIS_AWS Single Manual Temporary Keys](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | | | +| [CIS_AWS Single Manual Temporary Keys Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | +| [CIS_AWS Single Manual Shared Access](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | describe | | | +| [CIS_AWS Single Manual Shared Access Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_aws.ts) | it | | | +| [Test adding Cloud Security Posture Integrations CSPM AZURE](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | describe | | | +| [Azure Organization ARM Template](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | describe | | | +| [Azure Organization ARM Template Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | it | | | +| [Azure Organization Manual Managed Identity](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | describe | | | +| [Azure Organization Manual Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | it | | | +| [Azure Organization Manual Service Principle with Client Secret](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | describe | | | +| [Azure Organization Manual Service Principle with Client Secret Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | it | | | +| [Azure Organization Manual Service Principle with Client Certificate](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | describe | | | +| [Azure Organization Manual Service Principle with Client Certificate Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | it | | | +| [Azure Single ARM Template](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | describe | | | +| [Azure Single ARM Template Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | it | | | +| [Azure Single Manual Managed Identity](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | describe | | | +| [Azure Single Manual Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | it | | | +| [Azure Single Manual Service Principle with Client Secret](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | describe | | | +| [Azure Single Manual Service Principle with Client Secret Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | it | | | +| [Azure Single Manual Service Principle with Client Certificate](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | describe | | | +| [Azure Single Manual Service Principle with Client Certificate Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_azure.ts) | it | | | +| [Test adding Cloud Security Posture Integrations CSPM GCP](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | describe | | | +| [CIS_GCP Organization](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Switch between Manual and Google cloud shell](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Post Installation Google Cloud Shell modal pops up after user clicks on Save button when adding integration, when there are no Project ID or Organization ID provided, it should use default value](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Post Installation Google Cloud Shell modal pops up after user clicks on Save button when adding integration, when there are Project ID or Organization ID provided, it should use that value](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Add Agent FLyout - Post Installation Google Cloud Shell modal pops up after user clicks on Save button when adding integration, when there are Project ID or Organization ID provided, it should use that value](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Organization ID field on cloud shell command should only be shown if user chose Google Cloud Shell, if user chose Single Account it shouldn not show up](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Hyperlink on PostInstallation Modal should have the correct URL](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Clicking on Launch CloudShell on post intall modal should lead user to CloudShell page](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [CIS_GCP Organization Credentials File](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | +| [CIS_GCP Organization Credentials File workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [CIS_GCP Organization Credentials JSON](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | describe | | | +| [CIS_GCP Organization Credentials JSON workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | | | +| [CIS_GCP Single](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Post Installation Google Cloud Shell modal pops up after user clicks on Save button when adding integration, when there are no Project ID, it should use default value](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Post Installation Google Cloud Shell modal pops up after user clicks on Save button when adding integration, when there are Project ID, it should use that value](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Add Agent FLyout - Organization ID field on cloud shell command should only be shown if user chose Google Cloud Shell, if user chose Single Account it shouldn not show up](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [On add agent modal, if user chose Google Cloud Shell as their setup access; a google cloud shell modal should show up and clicking on the launch button will redirect user to Google cloud shell page](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Users are able to add CIS_GCP Integration with Manual settings using Credentials File](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Users are able to switch credentials_type from/to Credential JSON fields ](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Users are able to add CIS_GCP Integration with Manual settings using Credentials JSON](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Users are able to switch credentials_type from/to Credential File fields ](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/cspm/cis_integration_gcp.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Test adding Cloud Security Posture Integrations KSPM EKS](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts) | describe | | | +| [KSPM EKS Assume Role](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts) | describe | | | +| [KSPM EKS Assume Role workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts) | it | | | +| [KSPM EKS Direct Access](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts) | describe | | | +| [KSPM EKS Direct Access Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts) | it | | | +| [KSPM EKS Temporary Keys](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts) | describe | | | +| [KSPM EKS Temporary Keys Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts) | it | | | +| [KSPM EKS Shared Credentials](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts) | describe | | | +| [KSPM EKS Shared Credentials Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_eks.ts) | it | | | +| [Test adding Cloud Security Posture Integrations KSPM K8S](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_k8s.ts) | describe | | | +| [KSPM K8S](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_k8s.ts) | describe | | | +| [KSPM K8S Workflow](x-pack/test/cloud_security_posture_functional/pages/cis_integrations/kspm/cis_integration_k8s.ts) | it | | | +| [Cloud Posture Dashboard Page](x-pack/test/cloud_security_posture_functional/pages/compliance_dashboard.ts) | describe | | | +| [Kubernetes Dashboard](x-pack/test/cloud_security_posture_functional/pages/compliance_dashboard.ts) | describe | | | +| [displays accurate summary compliance score](x-pack/test/cloud_security_posture_functional/pages/compliance_dashboard.ts) | it | | | +| [TODO - Cloud Dashboard](x-pack/test/cloud_security_posture_functional/pages/compliance_dashboard.ts) | describe | | ![](https://img.shields.io/badge/todo-green) | +| [todo - displays accurate summary compliance score](x-pack/test/cloud_security_posture_functional/pages/compliance_dashboard.ts) | it | | ![](https://img.shields.io/badge/todo-green) | +| [Access with custom roles](x-pack/test/cloud_security_posture_functional/pages/compliance_dashboard.ts) | describe | | | +| [Access with valid user role](x-pack/test/cloud_security_posture_functional/pages/compliance_dashboard.ts) | it | | | +| [todo - Access with invalid user role](x-pack/test/cloud_security_posture_functional/pages/compliance_dashboard.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | ![](https://img.shields.io/badge/todo-green) | +| [Findings Page - Alerts](x-pack/test/cloud_security_posture_functional/pages/findings_alerts.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Create detection rule](x-pack/test/cloud_security_posture_functional/pages/findings_alerts.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Creates a detection rule from the Take Action button and navigates to rule page](x-pack/test/cloud_security_posture_functional/pages/findings_alerts.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Creates a detection rule from the Alerts section and navigates to rule page](x-pack/test/cloud_security_posture_functional/pages/findings_alerts.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Rule details](x-pack/test/cloud_security_posture_functional/pages/findings_alerts.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | +| [The rule page contains the expected matching data](x-pack/test/cloud_security_posture_functional/pages/findings_alerts.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Navigation](x-pack/test/cloud_security_posture_functional/pages/findings_alerts.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Clicking on count of Rules should navigate to the rules page with benchmark tags as a filter](x-pack/test/cloud_security_posture_functional/pages/findings_alerts.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Clicking on count of Alerts should navigate to the alerts page](x-pack/test/cloud_security_posture_functional/pages/findings_alerts.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Findings Page - Grouping](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | describe | | | +| [Default Grouping](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | describe | | | +| [groups findings by resource and sort by compliance score desc](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | it | | | +| [groups findings by rule name and sort by compliance score desc](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | it | | | +| [groups findings by cloud account and sort by compliance score desc](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | it | | | +| [groups findings by Kubernetes cluster and sort by compliance score desc](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | it | | | +| [SearchBar](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | describe | | | +| [add filter](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | it | | | +| [remove filter](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | it | | | +| [set search query](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | it | | | +| [Group table](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | describe | | | +| [shows findings table when expanding](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | it | | | +| [Default Grouping - support muting rules](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | describe | | | +| [groups findings by resource after muting rule](x-pack/test/cloud_security_posture_functional/pages/findings_grouping.ts) | it | | | +| [Old Data](x-pack/test/cloud_security_posture_functional/pages/findings_old_data.ts) | describe | | | +| [Findings page with old data](x-pack/test/cloud_security_posture_functional/pages/findings_old_data.ts) | describe | | | +| [returns no Findings KSPM](x-pack/test/cloud_security_posture_functional/pages/findings_old_data.ts) | it | | | +| [returns no Findings CSPM](x-pack/test/cloud_security_posture_functional/pages/findings_old_data.ts) | it | | | +| [Findings Page onboarding](x-pack/test/cloud_security_posture_functional/pages/findings_onboarding.ts) | describe | | | +| [clicking on the ](x-pack/test/cloud_security_posture_functional/pages/findings_onboarding.ts) | it | | | +| [clicking on the ](x-pack/test/cloud_security_posture_functional/pages/findings_onboarding.ts) | it | | | +| [clicking on the ](x-pack/test/cloud_security_posture_functional/pages/findings_onboarding.ts) | it | | | +| [Findings Page - DataTable](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | describe | | | +| [Table Sort](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | describe | | | +| [sorts by a column, should be case sensitive/insensitive depending on the column](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | it | | | +| [Findings - Fields selector](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | describe | | | +| [Add fields to the Findings DataTable](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | it | | | +| [Remove fields from the Findings DataTable](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | it | | | +| [Reset fields to default](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | it | | | +| [Findings Page - support muting rules](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | describe | | | +| [verify only enabled rules appears](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | it | | | +| [Access with custom roles](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | describe | | | +| [Access with valid user role](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | it | | | +| [Access with invalid user role](x-pack/test/cloud_security_posture_functional/pages/findings.ts) | it | | | +| [Cloud Security Posture](x-pack/test/cloud_security_posture_functional/pages/index.ts) | describe | | | +| [Cloud Posture Rules Page](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Rules Page - Rules Counters](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Shows posture score when there are findings](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Clicking the posture score button leads to the dashboard](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Shows integrations count when there are findings](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Clicking the integrations counter button leads to the integration page](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Shows the failed findings counter when there are findings](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Clicking the failed findings button leads to the findings page](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Shows the disabled rules count](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Clicking the disabled rules button shows enables the disabled filter](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Shows empty state when there are no findings](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Rules Page - Bulk Action buttons](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | +| [It should disable Enable option when there are all rules selected are already enabled ](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [It should disable both Enable and Disable options when there are no rules selected](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [It should disable Disable option when there are all rules selected are already Disabled](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Both option should not be disabled if selected rules contains both enabled and disabled rules](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Rules Page - Enable Rules and Disabled Rules Filter Toggle](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Should only display Enabled rules when Enabled Rules filter is ON](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Should only display Disabled rules when Disabled Rules filter is ON](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Rules Page - CIS Section & Rule Number filters](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Table should only show result that has the same section as in the Section filter](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Table should only show result that has the same section as in the Rule number filter](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Table should only show result that passes both Section and Rule number filter](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Rules Page - Flyout](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | describe | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Users are able to Enable/Disable Rule from Switch on Rule Flyout](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Alerts section of Rules Flyout shows Disabled text when Rules are disabled](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Users are able to Enable/Disable Rule from Take Action on Rule Flyout](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Alerts section of Rules Flyout shows Detection Rule Counter component when Rules are enabled](x-pack/test/cloud_security_posture_functional/pages/rules.ts) | it | ![](https://img.shields.io/badge/skipped-yellow) | | +| [Vulnerabilities Page - Grouping](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | describe | | | +| [Default Grouping](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | describe | | | +| [groups vulnerabilities by cloud account and sort by number of vulnerabilities desc](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | it | | | +| [groups vulnerabilities by CVE and sort by number of vulnerabilities desc](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | it | | | +| [groups vulnerabilities by resource and sort by number of vulnerabilities desc](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | it | | | +| [SearchBar](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | describe | | | +| [add filter](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | it | | | +| [remove filter](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | it | | | +| [set search query](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | it | | | +| [Group table](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | describe | | | +| [shows vulnerabilities table when expanding](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities_grouping.ts) | it | | | +| [Vulnerabilities Page - DataTable](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities.ts) | describe | | | +| [SearchBar](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities.ts) | describe | | | +| [add filter](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities.ts) | it | | | +| [remove filter](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities.ts) | it | | | +| [set search query](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities.ts) | it | | | +| [Vulnerabilities - Fields selector](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities.ts) | describe | | | +| [Add fields to the Vulnerabilities DataTable](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities.ts) | it | | | +| [Remove fields from the Vulnerabilities DataTable](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities.ts) | it | | | +| [Reset fields to default](x-pack/test/cloud_security_posture_functional/pages/vulnerabilities.ts) | it | | | +| [Vulnerability Dashboard Page](x-pack/test/cloud_security_posture_functional/pages/vulnerability_dashboard.ts) | describe | | | +| [Vulnerability Dashboard](x-pack/test/cloud_security_posture_functional/pages/vulnerability_dashboard.ts) | describe | | | +| [Page Header renders on startup](x-pack/test/cloud_security_posture_functional/pages/vulnerability_dashboard.ts) | it | | | +| [Stats render accurate output](x-pack/test/cloud_security_posture_functional/pages/vulnerability_dashboard.ts) | it | | | +| [should navigate to vulnerability findings page with high severity filter](x-pack/test/cloud_security_posture_functional/pages/vulnerability_dashboard.ts) | it | | | +| [should navigate to vulnerability findings page with critical severity filter and no high severity filter](x-pack/test/cloud_security_posture_functional/pages/vulnerability_dashboard.ts) | it | | | +</details> + diff --git a/x-pack/plugins/cloud_security_posture/common/index.ts b/x-pack/solutions/security/plugins/cloud_security_posture/common/index.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/index.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/common/index.ts diff --git a/x-pack/plugins/cloud_security_posture/common/runtime_mappings/get_identifier_runtime_mapping.ts b/x-pack/solutions/security/plugins/cloud_security_posture/common/runtime_mappings/get_identifier_runtime_mapping.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/runtime_mappings/get_identifier_runtime_mapping.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/common/runtime_mappings/get_identifier_runtime_mapping.ts diff --git a/x-pack/plugins/cloud_security_posture/common/runtime_mappings/get_package_policy_id_mapping.ts b/x-pack/solutions/security/plugins/cloud_security_posture/common/runtime_mappings/get_package_policy_id_mapping.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/runtime_mappings/get_package_policy_id_mapping.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/common/runtime_mappings/get_package_policy_id_mapping.ts diff --git a/x-pack/plugins/cloud_security_posture/common/runtime_mappings/get_safe_posture_type_runtime_mapping.ts b/x-pack/solutions/security/plugins/cloud_security_posture/common/runtime_mappings/get_safe_posture_type_runtime_mapping.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/runtime_mappings/get_safe_posture_type_runtime_mapping.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/common/runtime_mappings/get_safe_posture_type_runtime_mapping.ts diff --git a/x-pack/plugins/cloud_security_posture/common/schemas/stats.ts b/x-pack/solutions/security/plugins/cloud_security_posture/common/schemas/stats.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/schemas/stats.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/common/schemas/stats.ts diff --git a/x-pack/plugins/cloud_security_posture/common/scripts/__auto_generated_csp_test_log.json b/x-pack/solutions/security/plugins/cloud_security_posture/common/scripts/__auto_generated_csp_test_log.json similarity index 98% rename from x-pack/plugins/cloud_security_posture/common/scripts/__auto_generated_csp_test_log.json rename to x-pack/solutions/security/plugins/cloud_security_posture/common/scripts/__auto_generated_csp_test_log.json index b2479277f0ee1..2fcada14f0ae3 100644 --- a/x-pack/plugins/cloud_security_posture/common/scripts/__auto_generated_csp_test_log.json +++ b/x-pack/solutions/security/plugins/cloud_security_posture/common/scripts/__auto_generated_csp_test_log.json @@ -230,9 +230,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/common/utils/detection_rules.test.ts", "fileName": "detection_rules.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -498,9 +498,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts", "fileName": "helpers.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -894,9 +894,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/common/utils/subscription.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/common/utils/subscription.test.ts", "fileName": "subscription.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -994,9 +994,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/application/csp_router.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/application/csp_router.test.tsx", "fileName": "csp_router.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -1289,9 +1289,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.test.ts", "fileName": "use_benchmark_dynamic_values.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -1368,9 +1368,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/common/hooks/use_navigate_findings.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_navigate_findings.test.ts", "fileName": "use_navigate_findings.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -1468,9 +1468,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/common/hooks/use_url_query.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_url_query.test.ts", "fileName": "use_url_query.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -1547,9 +1547,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/common/navigation/security_solution_links.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/security_solution_links.test.ts", "fileName": "security_solution_links.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -1605,9 +1605,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/common/utils/get_abbreviated_number.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_abbreviated_number.test.ts", "fileName": "get_abbreviated_number.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -1705,9 +1705,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_vulnerabiltity_colors.test.ts", "fileName": "get_vulnerabiltity_colors.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -1975,9 +1975,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/components/accounts_evaluated_widget.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/components/accounts_evaluated_widget.test.tsx", "fileName": "accounts_evaluated_widget.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -2075,9 +2075,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/components/chart_panel.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/components/chart_panel.test.tsx", "fileName": "chart_panel.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -2175,9 +2175,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx", "fileName": "cloud_posture_page.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -2380,9 +2380,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.test.tsx", "fileName": "cloud_security_data_table.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -2522,9 +2522,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx", "fileName": "fields_selector_table.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -2836,9 +2836,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.test.ts", "fileName": "first_non_null_value.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -2999,9 +2999,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/components/detection_rule_counter.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/components/detection_rule_counter.test.tsx", "fileName": "detection_rule_counter.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -3120,9 +3120,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx", "fileName": "policy_template_form.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT", "HAS SKIP" @@ -4747,9 +4747,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts", "fileName": "use_setup_technology.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -5061,9 +5061,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts", "fileName": "utils.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -5784,9 +5784,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx", "fileName": "no_findings_states.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -5968,9 +5968,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx", "fileName": "benchmarks_table.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -6110,9 +6110,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx", "fileName": "benchmarks.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -6231,9 +6231,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.test.ts", "fileName": "risks_table.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -6310,9 +6310,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx", "fileName": "compliance_dashboard.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -6832,9 +6832,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.test.tsx", "fileName": "benchmarks_section.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -6934,9 +6934,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.test.tsx", "fileName": "summary_section.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -7034,9 +7034,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx", "fileName": "configurations.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -7285,9 +7285,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx", "fileName": "findings_flyout.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -7666,9 +7666,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/pages/configurations/utils/get_filters.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/utils/get_filters.test.ts", "fileName": "get_filters.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -7724,9 +7724,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx", "fileName": "rules_container.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -7782,9 +7782,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx", "fileName": "rules.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -7861,9 +7861,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx", "fileName": "use_change_csp_rule_state.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -8024,9 +8024,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx", "fileName": "vulnerability_finding_flyout.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT", "HAS SKIP" @@ -8280,9 +8280,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx", "fileName": "vulnerabilties.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -8422,9 +8422,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx", "fileName": "vulnerability_dashboard.test.tsx", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -8585,9 +8585,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/server/create_indices/create_indices.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/create_indices.test.ts", "fileName": "create_indices.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -8727,9 +8727,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts", "fileName": "create_transforms.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -8934,9 +8934,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/server/lib/mapping_field_util.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/server/lib/mapping_field_util.test.ts", "fileName": "mapping_field_util.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -9076,9 +9076,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/server/plugin.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/server/plugin.test.ts", "fileName": "plugin.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -9220,9 +9220,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts", "fileName": "find.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -9362,9 +9362,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts", "fileName": "benchmarks.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -9827,9 +9827,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.test.ts", "fileName": "compliance_dashboard.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -9906,9 +9906,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_benchmarks.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_benchmarks.test.ts", "fileName": "get_benchmarks.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -9964,9 +9964,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts", "fileName": "get_clusters.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -10022,9 +10022,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_grouped_findings_evaluation.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_grouped_findings_evaluation.test.ts", "fileName": "get_grouped_findings_evaluation.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -10080,9 +10080,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts", "fileName": "get_stats.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -10289,9 +10289,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.test.ts", "fileName": "get_trends.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -10347,9 +10347,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts", "fileName": "status.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], @@ -10785,9 +10785,9 @@ ] }, { - "filePath": "x-pack/plugins/cloud_security_posture/server/tasks/task_state.test.ts", + "filePath": "x-pack/solutions/security/plugins/cloud_security_posture/server/tasks/task_state.test.ts", "fileName": "task_state.test.ts", - "directory": "x-pack/plugins/cloud_security_posture", + "directory": "x-pack/solutions/security/plugins/cloud_security_posture", "tags": [ "UT" ], diff --git a/x-pack/plugins/cloud_security_posture/common/scripts/get_tests.js b/x-pack/solutions/security/plugins/cloud_security_posture/common/scripts/get_tests.js similarity index 98% rename from x-pack/plugins/cloud_security_posture/common/scripts/get_tests.js rename to x-pack/solutions/security/plugins/cloud_security_posture/common/scripts/get_tests.js index d23498b24bd86..e44cd96a659a3 100644 --- a/x-pack/plugins/cloud_security_posture/common/scripts/get_tests.js +++ b/x-pack/solutions/security/plugins/cloud_security_posture/common/scripts/get_tests.js @@ -32,7 +32,7 @@ const FTR_CSP_API = 'x-pack/test/cloud_security_posture_api'; const FTR_CSP_FUNCTIONAL = 'x-pack/test/cloud_security_posture_functional'; // Unit tests -const UNIT_TEST_CSP = 'x-pack/plugins/cloud_security_posture'; +const UNIT_TEST_CSP = 'x-pack/solutions/security/plugins/cloud_security_posture'; // KBN Package const KBN_CSP_PACKAGE = 'x-pack/packages/kbn-cloud-security-posture'; @@ -51,7 +51,7 @@ const directoryPaths = [ // Output directories and file paths const MD_FILE_PATH = path.join( - 'x-pack/plugins/cloud_security_posture/common/dev_docs', + 'x-pack/solutions/security/plugins/cloud_security_posture/common/dev_docs', '__auto_generated_csp_requirements_test_coverage.md' ); const CSP_TEST_LOGS_FILE_PATH = path.join(__dirname, '__auto_generated_csp_test_log.json'); diff --git a/x-pack/plugins/cloud_security_posture/common/types/benchmarks/v1.ts b/x-pack/solutions/security/plugins/cloud_security_posture/common/types/benchmarks/v1.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/types/benchmarks/v1.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/common/types/benchmarks/v1.ts diff --git a/x-pack/plugins/cloud_security_posture/common/types/benchmarks/v2.ts b/x-pack/solutions/security/plugins/cloud_security_posture/common/types/benchmarks/v2.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/types/benchmarks/v2.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/common/types/benchmarks/v2.ts diff --git a/x-pack/plugins/cloud_security_posture/common/types/index.ts b/x-pack/solutions/security/plugins/cloud_security_posture/common/types/index.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/types/index.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/common/types/index.ts diff --git a/x-pack/plugins/cloud_security_posture/common/types/latest.ts b/x-pack/solutions/security/plugins/cloud_security_posture/common/types/latest.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/types/latest.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/common/types/latest.ts diff --git a/x-pack/plugins/cloud_security_posture/common/types_old.ts b/x-pack/solutions/security/plugins/cloud_security_posture/common/types_old.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/types_old.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/common/types_old.ts diff --git a/x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/common/utils/detection_rules.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/utils/detection_rules.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/common/utils/detection_rules.test.ts diff --git a/x-pack/plugins/cloud_security_posture/common/utils/detection_rules.ts b/x-pack/solutions/security/plugins/cloud_security_posture/common/utils/detection_rules.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/utils/detection_rules.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/common/utils/detection_rules.ts diff --git a/x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/utils/helpers.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.test.ts diff --git a/x-pack/plugins/cloud_security_posture/common/utils/helpers.ts b/x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/utils/helpers.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/common/utils/helpers.ts diff --git a/x-pack/plugins/cloud_security_posture/common/utils/rules_states.ts b/x-pack/solutions/security/plugins/cloud_security_posture/common/utils/rules_states.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/utils/rules_states.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/common/utils/rules_states.ts diff --git a/x-pack/plugins/cloud_security_posture/common/utils/subscription.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/common/utils/subscription.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/utils/subscription.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/common/utils/subscription.test.ts diff --git a/x-pack/plugins/cloud_security_posture/common/utils/subscription.ts b/x-pack/solutions/security/plugins/cloud_security_posture/common/utils/subscription.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/common/utils/subscription.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/common/utils/subscription.ts diff --git a/x-pack/solutions/security/plugins/cloud_security_posture/jest.config.js b/x-pack/solutions/security/plugins/cloud_security_posture/jest.config.js new file mode 100644 index 0000000000000..630c9292dd304 --- /dev/null +++ b/x-pack/solutions/security/plugins/cloud_security_posture/jest.config.js @@ -0,0 +1,28 @@ +/* + * 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. + */ + +/** @type {import('@jest/types').Config.InitialOptions} */ +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/cloud_security_posture'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/cloud_security_posture', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/cloud_security_posture/{common,public,server}/**/*.{ts,tsx}', + ], + // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation + transformIgnorePatterns: [ + // ignore all node_modules except the modules below (monaco-editor, monaco-yaml, react-monaco-editor, etc) which requires babel transforms to handle dynamic import() + // since ESM modules are not natively supported in Jest yet (https://github.com/facebook/jest/issues/4842) + '[/\\\\]node_modules(?![\\/\\\\](byte-size|monaco-editor|monaco-yaml|monaco-languageserver-types|monaco-marker-data-provider|monaco-worker-manager|vscode-languageserver-types|react-monaco-editor|d3-interpolate|d3-color|langchain|langsmith|@cfworker|gpt-tokenizer|flat|@langchain|msw|@bundled-es-modules))[/\\\\].+\\.js$', + 'packages/kbn-pm/dist/index.js', + '[/\\\\]node_modules(?![\\/\\\\](langchain|langsmith|@langchain))/dist/[/\\\\].+\\.js$', + '[/\\\\]node_modules(?![\\/\\\\](langchain|langsmith|@langchain))/dist/util/[/\\\\].+\\.js$', + ], +}; diff --git a/x-pack/plugins/cloud_security_posture/kibana.jsonc b/x-pack/solutions/security/plugins/cloud_security_posture/kibana.jsonc similarity index 100% rename from x-pack/plugins/cloud_security_posture/kibana.jsonc rename to x-pack/solutions/security/plugins/cloud_security_posture/kibana.jsonc diff --git a/x-pack/plugins/cloud_security_posture/public/application/csp_route.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/application/csp_route.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/application/csp_route.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/application/csp_route.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/application/csp_router.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/application/csp_router.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/application/csp_router.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/application/csp_router.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/application/csp_router.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/application/csp_router.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/application/csp_router.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/application/csp_router.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/application/security_solution_context.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/application/security_solution_context.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/application/security_solution_context.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/application/security_solution_context.ts diff --git a/x-pack/plugins/cloud_security_posture/public/application/setup_context.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/application/setup_context.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/application/setup_context.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/application/setup_context.ts diff --git a/x-pack/plugins/cloud_security_posture/public/assets/icons/cis_aks_logo.svg b/x-pack/solutions/security/plugins/cloud_security_posture/public/assets/icons/cis_aks_logo.svg similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/assets/icons/cis_aks_logo.svg rename to x-pack/solutions/security/plugins/cloud_security_posture/public/assets/icons/cis_aks_logo.svg diff --git a/x-pack/plugins/cloud_security_posture/public/assets/icons/cis_eks_logo.svg b/x-pack/solutions/security/plugins/cloud_security_posture/public/assets/icons/cis_eks_logo.svg similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/assets/icons/cis_eks_logo.svg rename to x-pack/solutions/security/plugins/cloud_security_posture/public/assets/icons/cis_eks_logo.svg diff --git a/x-pack/plugins/cloud_security_posture/public/assets/icons/cis_gke_logo.svg b/x-pack/solutions/security/plugins/cloud_security_posture/public/assets/icons/cis_gke_logo.svg similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/assets/icons/cis_gke_logo.svg rename to x-pack/solutions/security/plugins/cloud_security_posture/public/assets/icons/cis_gke_logo.svg diff --git a/x-pack/plugins/cloud_security_posture/public/assets/icons/cis_logo.svg b/x-pack/solutions/security/plugins/cloud_security_posture/public/assets/icons/cis_logo.svg similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/assets/icons/cis_logo.svg rename to x-pack/solutions/security/plugins/cloud_security_posture/public/assets/icons/cis_logo.svg diff --git a/x-pack/plugins/cloud_security_posture/public/assets/icons/google_cloud_logo.svg b/x-pack/solutions/security/plugins/cloud_security_posture/public/assets/icons/google_cloud_logo.svg similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/assets/icons/google_cloud_logo.svg rename to x-pack/solutions/security/plugins/cloud_security_posture/public/assets/icons/google_cloud_logo.svg diff --git a/x-pack/plugins/cloud_security_posture/public/assets/icons/nvd_logo_svg.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/assets/icons/nvd_logo_svg.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/assets/icons/nvd_logo_svg.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/assets/icons/nvd_logo_svg.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/assets/icons/redhat_logo.svg b/x-pack/solutions/security/plugins/cloud_security_posture/public/assets/icons/redhat_logo.svg similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/assets/icons/redhat_logo.svg rename to x-pack/solutions/security/plugins/cloud_security_posture/public/assets/icons/redhat_logo.svg diff --git a/x-pack/plugins/cloud_security_posture/public/assets/illustrations/clouds.svg b/x-pack/solutions/security/plugins/cloud_security_posture/public/assets/illustrations/clouds.svg similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/assets/illustrations/clouds.svg rename to x-pack/solutions/security/plugins/cloud_security_posture/public/assets/illustrations/clouds.svg diff --git a/x-pack/plugins/cloud_security_posture/public/assets/illustrations/illustration_product_no_results_magnifying_glass.svg b/x-pack/solutions/security/plugins/cloud_security_posture/public/assets/illustrations/illustration_product_no_results_magnifying_glass.svg similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/assets/illustrations/illustration_product_no_results_magnifying_glass.svg rename to x-pack/solutions/security/plugins/cloud_security_posture/public/assets/illustrations/illustration_product_no_results_magnifying_glass.svg diff --git a/x-pack/plugins/cloud_security_posture/public/assets/illustrations/misconfigurations_vendors.svg b/x-pack/solutions/security/plugins/cloud_security_posture/public/assets/illustrations/misconfigurations_vendors.svg similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/assets/illustrations/misconfigurations_vendors.svg rename to x-pack/solutions/security/plugins/cloud_security_posture/public/assets/illustrations/misconfigurations_vendors.svg diff --git a/x-pack/plugins/cloud_security_posture/public/assets/illustrations/no_data_illustration.svg b/x-pack/solutions/security/plugins/cloud_security_posture/public/assets/illustrations/no_data_illustration.svg similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/assets/illustrations/no_data_illustration.svg rename to x-pack/solutions/security/plugins/cloud_security_posture/public/assets/illustrations/no_data_illustration.svg diff --git a/x-pack/plugins/cloud_security_posture/public/assets/illustrations/vulnerabilities_vendors.svg b/x-pack/solutions/security/plugins/cloud_security_posture/public/assets/illustrations/vulnerabilities_vendors.svg similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/assets/illustrations/vulnerabilities_vendors.svg rename to x-pack/solutions/security/plugins/cloud_security_posture/public/assets/illustrations/vulnerabilities_vendors.svg diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/create_detection_rule.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/api/create_detection_rule.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/api/create_detection_rule.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/api/create_detection_rule.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/index.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/api/index.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/api/index.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/api/index.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_cis_kubernetes_integration.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/api/use_cis_kubernetes_integration.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/api/use_cis_kubernetes_integration.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/api/use_cis_kubernetes_integration.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_fetch_detection_rules_alerts_status.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/api/use_fetch_detection_rules_alerts_status.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/api/use_fetch_detection_rules_alerts_status.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/api/use_fetch_detection_rules_alerts_status.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_fetch_detection_rules_by_tags.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/api/use_fetch_detection_rules_by_tags.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/api/use_fetch_detection_rules_by_tags.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/api/use_fetch_detection_rules_by_tags.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_license_management_locator_api.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/api/use_license_management_locator_api.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/api/use_license_management_locator_api.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/api/use_license_management_locator_api.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_package_policy_list.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/api/use_package_policy_list.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/api/use_package_policy_list.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/api/use_package_policy_list.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_stats_api.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/api/use_stats_api.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/api/use_stats_api.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/api/use_stats_api.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_vulnerability_dashboard_api.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/api/use_vulnerability_dashboard_api.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/api/use_vulnerability_dashboard_api.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/api/use_vulnerability_dashboard_api.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/api/use_wiz_integration_route.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/api/use_wiz_integration_route.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/api/use_wiz_integration_route.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/api/use_wiz_integration_route.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/component/multi_select_filter.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/component/multi_select_filter.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/component/multi_select_filter.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/component/multi_select_filter.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/common/constants.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/constants.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/constants.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/constants.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/contexts/data_view_context.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/contexts/data_view_context.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/contexts/data_view_context.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/contexts/data_view_context.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.test.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_benchmark_dynamic_values.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/index.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/index.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/index.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/index.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/use_base_es_query.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/use_base_es_query.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/use_base_es_query.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/use_base_es_query.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/use_cloud_posture_data_table.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/use_cloud_posture_data_table.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/use_cloud_posture_data_table.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/use_cloud_posture_data_table.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/use_persisted_query.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/use_persisted_query.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/use_persisted_query.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/use_persisted_query.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/utils.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/utils.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/utils.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_cloud_posture_data_table/utils.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_is_subscription_status_valid.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_is_subscription_status_valid.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/hooks/use_is_subscription_status_valid.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_is_subscription_status_valid.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_kibana.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_kibana.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/hooks/use_kibana.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_kibana.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_page_size.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_page_size.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/hooks/use_page_size.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_page_size.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_url_query.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_url_query.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/hooks/use_url_query.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_url_query.test.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/hooks/use_url_query.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_url_query.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/hooks/use_url_query.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/hooks/use_url_query.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/navigation/constants.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/constants.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/navigation/constants.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/constants.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/navigation/security_solution_links.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/security_solution_links.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/navigation/security_solution_links.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/security_solution_links.test.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/navigation/security_solution_links.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/security_solution_links.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/navigation/security_solution_links.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/security_solution_links.ts diff --git a/x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/types.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/types.ts new file mode 100644 index 0000000000000..ae7a22efd0605 --- /dev/null +++ b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/types.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ +export interface CspNavigationItem { + readonly name: string; + readonly path: string; + readonly disabled?: boolean; +} + +export interface CspPageNavigationItem extends CspNavigationItem { + id: CloudSecurityPosturePageId; +} + +export type CspPage = + | 'dashboard' + | 'cspm_dashboard' + | 'kspm_dashboard' + | 'vulnerability_dashboard' + | 'findings' + | 'benchmarks'; +export type CspBenchmarksPage = 'rules'; + +/** + * All the IDs for the cloud security posture pages. + * This needs to match the cloud security posture page entries in `SecurityPageName` in `x-pack/solutions/security/plugins/security_solution/common/constants.ts`. + */ +export type CloudSecurityPosturePageId = + | 'cloud_security_posture-dashboard' + | 'cloud_security_posture-cspm-dashboard' + | 'cloud_security_posture-kspm-dashboard' + | 'cloud_security_posture-vulnerability_dashboard' + | 'cloud_security_posture-findings' + | 'cloud_security_posture-benchmarks' + | 'cloud_security_posture-benchmarks-rules'; diff --git a/x-pack/plugins/cloud_security_posture/public/common/navigation/use_csp_integration_link.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/use_csp_integration_link.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/navigation/use_csp_integration_link.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/use_csp_integration_link.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/navigation/use_navigate_to_cis_integration_policies.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/use_navigate_to_cis_integration_policies.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/navigation/use_navigate_to_cis_integration_policies.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/navigation/use_navigate_to_cis_integration_policies.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/types.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/types.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/types.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/types.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/utils/get_template_url_package_info.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_template_url_package_info.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/utils/get_template_url_package_info.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_template_url_package_info.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/utils/get_vendor_name.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_vendor_name.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/utils/get_vendor_name.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_vendor_name.test.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/utils/get_vendor_name.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_vendor_name.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/utils/get_vendor_name.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/get_vendor_name.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/utils/is_native_csp_finding.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/is_native_csp_finding.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/utils/is_native_csp_finding.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/is_native_csp_finding.test.ts diff --git a/x-pack/plugins/cloud_security_posture/public/common/utils/is_native_csp_finding.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/is_native_csp_finding.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/common/utils/is_native_csp_finding.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/common/utils/is_native_csp_finding.ts diff --git a/x-pack/plugins/cloud_security_posture/public/components/accounts_evaluated_widget.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/accounts_evaluated_widget.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/accounts_evaluated_widget.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/accounts_evaluated_widget.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/accounts_evaluated_widget.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/accounts_evaluated_widget.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/accounts_evaluated_widget.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/accounts_evaluated_widget.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/chart_panel.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/chart_panel.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/chart_panel.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/chart_panel.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/chart_panel.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/chart_panel.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/chart_panel.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/chart_panel.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/cis_benchmark_icon.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cis_benchmark_icon.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cis_benchmark_icon.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cis_benchmark_icon.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_posture_page.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_posture_page.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_posture_page.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page_title.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_posture_page_title.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_posture_page_title.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_posture_page_title.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_provider_icon.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_provider_icon.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_provider_icon.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_provider_icon.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/additional_controls.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/additional_controls.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/additional_controls.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/additional_controls.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/cloud_security_data_table.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_modal.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_modal.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_modal.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_modal.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/fields_selector_table.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/index.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/index.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/index.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/index.ts diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/use_fields_modal.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/use_fields_modal.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/use_fields_modal.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/fields_selector/use_fields_modal.ts diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/index.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/index.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/index.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/index.ts diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/use_styles.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/use_styles.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_security_data_table/use_styles.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_data_table/use_styles.ts diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/cloud_security_grouping.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/cloud_security_grouping.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/cloud_security_grouping.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/cloud_security_grouping.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/index.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/index.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/index.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/index.ts diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/loading_group.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/loading_group.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/loading_group.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/loading_group.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/null_group.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/null_group.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/null_group.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/null_group.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/use_cloud_security_grouping.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/use_cloud_security_grouping.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/use_cloud_security_grouping.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/use_cloud_security_grouping.ts diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.test.ts diff --git a/x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/cloud_security_grouping/utils/first_non_null_value.ts diff --git a/x-pack/plugins/cloud_security_posture/public/components/column_name_with_tooltip.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/column_name_with_tooltip.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/column_name_with_tooltip.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/column_name_with_tooltip.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/compact_formatted_number.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/compact_formatted_number.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/compact_formatted_number.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/compact_formatted_number.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/compliance_score_bar.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/compliance_score_bar.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/compliance_score_bar.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/compliance_score_bar.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/compliance_score_bar.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/compliance_score_bar.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/compliance_score_bar.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/compliance_score_bar.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/csp_counter_card.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/csp_counter_card.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/csp_counter_card.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/csp_counter_card.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/csp_inline_description_list.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/csp_inline_description_list.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/csp_inline_description_list.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/csp_inline_description_list.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/csp_loading_state.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/csp_loading_state.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/csp_loading_state.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/csp_loading_state.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/detection_rule_counter.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/detection_rule_counter.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/detection_rule_counter.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/detection_rule_counter.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/detection_rule_counter.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/detection_rule_counter.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/detection_rule_counter.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/detection_rule_counter.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/empty_state.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/empty_state.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/empty_state.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/empty_state.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/empty_states_illustration_container.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/empty_states_illustration_container.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/empty_states_illustration_container.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/empty_states_illustration_container.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_credentials_form.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_credentials_form.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_credentials_form.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_credentials_form.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_credentials_form_agentless.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_credentials_form_agentless.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_credentials_form_agentless.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_credentials_form_agentless.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_input_var_fields.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_input_var_fields.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_input_var_fields.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_input_var_fields.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/get_aws_credentials_form_options.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/get_aws_credentials_form_options.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/get_aws_credentials_form_options.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/get_aws_credentials_form_options.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/hooks.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/hooks.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/hooks.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/hooks.ts diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/azure_credentials_form.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/azure_credentials_form.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/azure_credentials_form.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/azure_credentials_form.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/azure_credentials_form_agentless.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/azure_credentials_form_agentless.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/azure_credentials_form_agentless.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/azure_credentials_form_agentless.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/get_azure_credentials_form_options.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/get_azure_credentials_form_options.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/get_azure_credentials_form_options.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/get_azure_credentials_form_options.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/hooks.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/hooks.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/hooks.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/azure_credentials_form/hooks.ts diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/csp_boxed_radio_group.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/csp_boxed_radio_group.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/csp_boxed_radio_group.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/csp_boxed_radio_group.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/custom_assets_extension.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/custom_assets_extension.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/custom_assets_extension.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/custom_assets_extension.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/eks_credentials_form.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/eks_credentials_form.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/eks_credentials_form.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/eks_credentials_form.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credentials_form/gcp_credential_form.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credentials_form/gcp_credential_form.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credentials_form/gcp_credential_form.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credentials_form/gcp_credential_form.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credentials_form/gcp_credentials_form_agentless.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credentials_form/gcp_credentials_form_agentless.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credentials_form/gcp_credentials_form_agentless.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/gcp_credentials_form/gcp_credentials_form_agentless.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/mocks.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/mocks.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/mocks.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/mocks.ts diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_form.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_selectors.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_selectors.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_selectors.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/policy_template_selectors.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/setup_technology_selector.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/setup_technology_selector.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/setup_technology_selector.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/setup_technology_selector.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.test.ts diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/setup_technology_selector/use_setup_technology.ts diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.test.ts diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/utils.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/fleet_extensions/utils.ts diff --git a/x-pack/plugins/cloud_security_posture/public/components/full_size_centered_page.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/full_size_centered_page.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/full_size_centered_page.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/full_size_centered_page.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/no_findings_states/index.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/no_findings_states/index.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/no_findings_states/index.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/no_findings_states/index.ts diff --git a/x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/no_findings_states/no_findings_states.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/no_vulnerabilities_states.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/no_vulnerabilities_states.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/no_vulnerabilities_states.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/no_vulnerabilities_states.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/subscription_not_allowed.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/subscription_not_allowed.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/subscription_not_allowed.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/subscription_not_allowed.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/take_action.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/take_action.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/take_action.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/take_action.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/test_subjects.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/test_subjects.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/test_subjects.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/test_subjects.ts diff --git a/x-pack/plugins/cloud_security_posture/public/components/timestamp_table_cell.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/timestamp_table_cell.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/timestamp_table_cell.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/timestamp_table_cell.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/vuln_counter_card.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/vuln_counter_card.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/vuln_counter_card.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/vuln_counter_card.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/components/vulnerability_severity_map.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/components/vulnerability_severity_map.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/components/vulnerability_severity_map.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/components/vulnerability_severity_map.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/index.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/index.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/index.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/index.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/benchmarks_table.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/index.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/index.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/benchmarks/index.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/index.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/test_subjects.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/test_subjects.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/benchmarks/test_subjects.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/test_subjects.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/benchmarks/use_csp_benchmark_integrations.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/use_csp_benchmark_integrations.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/benchmarks/use_csp_benchmark_integrations.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/benchmarks/use_csp_benchmark_integrations.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/compliance_score_chart.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/compliance_score_chart.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/compliance_score_chart.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/compliance_score_chart.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.test.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_charts/risks_table.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/compliance_dashboard.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmark_details_box.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmark_details_box.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmark_details_box.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmark_details_box.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/benchmarks_section.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/dashboard_sections/summary_section.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/index.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/index.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/index.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/index.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/mock.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/mock.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/mock.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/mock.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/test_subjects.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/test_subjects.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/compliance_dashboard/test_subjects.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/compliance_dashboard/test_subjects.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/__mocks__/findings.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/__mocks__/findings.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/__mocks__/findings.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/__mocks__/findings.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.handlers.mock.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/configurations.handlers.mock.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.handlers.mock.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/configurations.handlers.mock.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/configurations.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/configurations.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/configurations.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/configurations.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_detection_rule_counter.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_detection_rule_counter.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_detection_rule_counter.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_detection_rule_counter.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/findings_flyout.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/json_tab.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/json_tab.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/json_tab.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/json_tab.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/overview_tab.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/overview_tab.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/overview_tab.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/overview_tab.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/rule_tab.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/rule_tab.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/rule_tab.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/rule_tab.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/table_tab.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/table_tab.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/table_tab.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/findings_flyout/table_tab.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/index.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/index.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/index.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/index.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/constants.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/latest_findings/constants.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/constants.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/latest_findings/constants.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/findings_table_field_labels.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/latest_findings/findings_table_field_labels.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/findings_table_field_labels.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/latest_findings/findings_table_field_labels.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_container.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_container.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_container.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_container.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_group_renderer.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_group_renderer.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_group_renderer.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_group_renderer.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_group_renderer.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_group_renderer.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_group_renderer.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_group_renderer.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_table.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_table.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_table.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/latest_findings/latest_findings_table.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_grouped_findings.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_grouped_findings.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_grouped_findings.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_grouped_findings.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings_grouping.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings_grouping.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings_grouping.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings_grouping.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings_table.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings_table.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings_table.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/latest_findings/use_latest_findings_table.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/layout/error_callout.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/layout/error_callout.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/layout/error_callout.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/layout/error_callout.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/layout/findings_distribution_bar.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/layout/findings_distribution_bar.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/layout/findings_distribution_bar.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/layout/findings_distribution_bar.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/layout/findings_search_bar.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/layout/findings_search_bar.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/layout/findings_search_bar.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/layout/findings_search_bar.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/test_subjects.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/test_subjects.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/test_subjects.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/test_subjects.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/utils/create_detection_rule_from_benchmark.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/utils/create_detection_rule_from_benchmark.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/utils/create_detection_rule_from_benchmark.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/utils/create_detection_rule_from_benchmark.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/utils/get_filters.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/utils/get_filters.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/utils/get_filters.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/utils/get_filters.test.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/utils/get_filters.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/utils/get_filters.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/utils/get_filters.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/utils/get_filters.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/configurations/utils/utils.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/utils/utils.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/configurations/utils/utils.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/configurations/utils/utils.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/findings.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/findings/findings.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/findings/findings.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/findings/findings.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/index.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/findings/index.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/findings/index.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/findings/index.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/findings/third_party_integrations_callout.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/findings/third_party_integrations_callout.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/findings/third_party_integrations_callout.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/findings/third_party_integrations_callout.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/index.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/index.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/index.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/index.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/index.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/index.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/rules/index.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/index.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules_container.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules_container.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/rules/rules_container.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules_container.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_counters.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules_counters.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/rules/rules_counters.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules_counters.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_detection_rule_counter.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules_detection_rule_counter.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/rules/rules_detection_rule_counter.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules_detection_rule_counter.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_flyout.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules_flyout.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/rules/rules_flyout.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules_flyout.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_table.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules_table.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/rules/rules_table.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules_table.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/rules_table_header.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules_table_header.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/rules/rules_table_header.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/rules_table_header.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/test_subjects.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/test_subjects.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/rules/test_subjects.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/test_subjects.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/use_change_csp_rule_state.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_benchmark_rules.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/use_csp_benchmark_rules.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_benchmark_rules.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/use_csp_benchmark_rules.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_rules_state.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/use_csp_rules_state.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/rules/use_csp_rules_state.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/rules/use_csp_rules_state.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/_mocks_/vulnerability.mock.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/_mocks_/vulnerability.mock.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/_mocks_/vulnerability.mock.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/_mocks_/vulnerability.mock.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/constants.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/constants.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/constants.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/constants.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_grouped_vulnerabilities.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities_grouping.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities_grouping.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities_grouping.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities_grouping.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities_table.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities_table.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities_table.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/hooks/use_latest_vulnerabilities_table.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/index.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/index.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/index.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/index.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_container.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_container.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_container.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_container.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_group_renderer.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_group_renderer.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_group_renderer.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_group_renderer.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_table.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_table.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_table.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/latest_vulnerabilities_table.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/test_subjects.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/test_subjects.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/test_subjects.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/test_subjects.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/translations.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/translations.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/translations.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/translations.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/types.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/types.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/types.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/types.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/utils/create_detection_rule_from_vulnerability.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/utils/create_detection_rule_from_vulnerability.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/utils/create_detection_rule_from_vulnerability.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/utils/create_detection_rule_from_vulnerability.test.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/utils/create_detection_rule_from_vulnerability.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/utils/create_detection_rule_from_vulnerability.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/utils/create_detection_rule_from_vulnerability.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/utils/create_detection_rule_from_vulnerability.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/utils/custom_sort_script.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/utils/custom_sort_script.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/utils/custom_sort_script.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/utils/custom_sort_script.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/utils/get_vector_score_list.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/utils/get_vector_score_list.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/utils/get_vector_score_list.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/utils/get_vector_score_list.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_detection_rule_counter.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_detection_rule_counter.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_detection_rule_counter.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_detection_rule_counter.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_json_tab.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_json_tab.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_json_tab.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_json_tab.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_overview_tab.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_overview_tab.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_overview_tab.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_overview_tab.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_table_tab.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_table_tab.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_table_tab.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_table_tab.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_table_field_labels.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_table_field_labels.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_table_field_labels.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_table_field_labels.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilties.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/_mocks_/vulnerability_dashboard.mock.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/_mocks_/vulnerability_dashboard.mock.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/_mocks_/vulnerability_dashboard.mock.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/_mocks_/vulnerability_dashboard.mock.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.test.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_dashboard.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_statistics.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_statistics.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_statistics.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_statistics.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_table_panel.config.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_table_panel.config.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_table_panel.config.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_table_panel.config.ts diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_table_panel.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_table_panel.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_table_panel.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_table_panel.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_table_panel_section.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_table_panel_section.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_table_panel_section.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_table_panel_section.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_trend_graph.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_trend_graph.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_trend_graph.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerability_dashboard/vulnerability_trend_graph.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/plugin.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/plugin.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/plugin.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/plugin.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/test/fixtures/csp_benchmark_integration.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/test/fixtures/csp_benchmark_integration.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/test/fixtures/csp_benchmark_integration.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/test/fixtures/csp_benchmark_integration.ts diff --git a/x-pack/plugins/cloud_security_posture/public/test/fixtures/findings_fixture.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/test/fixtures/findings_fixture.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/test/fixtures/findings_fixture.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/test/fixtures/findings_fixture.ts diff --git a/x-pack/plugins/cloud_security_posture/public/test/fixtures/get_mock_dependencies.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/test/fixtures/get_mock_dependencies.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/test/fixtures/get_mock_dependencies.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/test/fixtures/get_mock_dependencies.ts diff --git a/x-pack/plugins/cloud_security_posture/public/test/fixtures/react_query.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/test/fixtures/react_query.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/test/fixtures/react_query.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/test/fixtures/react_query.ts diff --git a/x-pack/plugins/cloud_security_posture/public/test/mock_server/handlers/dataview.handlers.mock.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/test/mock_server/handlers/dataview.handlers.mock.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/test/mock_server/handlers/dataview.handlers.mock.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/test/mock_server/handlers/dataview.handlers.mock.ts diff --git a/x-pack/plugins/cloud_security_posture/public/test/mock_server/handlers/fleet.handlers.mock.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/test/mock_server/handlers/fleet.handlers.mock.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/test/mock_server/handlers/fleet.handlers.mock.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/test/mock_server/handlers/fleet.handlers.mock.ts diff --git a/x-pack/plugins/cloud_security_posture/public/test/mock_server/handlers/index.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/test/mock_server/handlers/index.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/test/mock_server/handlers/index.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/test/mock_server/handlers/index.ts diff --git a/x-pack/plugins/cloud_security_posture/public/test/mock_server/handlers/licensing.handlers.mock.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/test/mock_server/handlers/licensing.handlers.mock.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/test/mock_server/handlers/licensing.handlers.mock.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/test/mock_server/handlers/licensing.handlers.mock.ts diff --git a/x-pack/plugins/cloud_security_posture/public/test/mock_server/mock_server.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/test/mock_server/mock_server.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/test/mock_server/mock_server.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/test/mock_server/mock_server.ts diff --git a/x-pack/plugins/cloud_security_posture/public/test/mock_server/mock_server_test_provider.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/test/mock_server/mock_server_test_provider.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/test/mock_server/mock_server_test_provider.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/test/mock_server/mock_server_test_provider.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/test/test_provider.tsx b/x-pack/solutions/security/plugins/cloud_security_posture/public/test/test_provider.tsx similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/test/test_provider.tsx rename to x-pack/solutions/security/plugins/cloud_security_posture/public/test/test_provider.tsx diff --git a/x-pack/plugins/cloud_security_posture/public/test/utils.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/test/utils.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/test/utils.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/test/utils.ts diff --git a/x-pack/plugins/cloud_security_posture/public/types.ts b/x-pack/solutions/security/plugins/cloud_security_posture/public/types.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/public/types.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/public/types.ts diff --git a/x-pack/plugins/cloud_security_posture/server/config.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/config.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/config.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/config.ts diff --git a/x-pack/plugins/cloud_security_posture/server/create_indices/benchmark_score_mapping.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/benchmark_score_mapping.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/create_indices/benchmark_score_mapping.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/benchmark_score_mapping.ts diff --git a/x-pack/plugins/cloud_security_posture/server/create_indices/create_indices.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/create_indices.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/create_indices/create_indices.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/create_indices.test.ts diff --git a/x-pack/plugins/cloud_security_posture/server/create_indices/create_indices.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/create_indices.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/create_indices/create_indices.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/create_indices.ts diff --git a/x-pack/plugins/cloud_security_posture/server/create_indices/create_processor.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/create_processor.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/create_indices/create_processor.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/create_processor.ts diff --git a/x-pack/plugins/cloud_security_posture/server/create_indices/ingest_pipelines.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/ingest_pipelines.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/create_indices/ingest_pipelines.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/ingest_pipelines.ts diff --git a/x-pack/plugins/cloud_security_posture/server/create_indices/latest_indices.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/latest_indices.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/create_indices/latest_indices.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/latest_indices.ts diff --git a/x-pack/plugins/cloud_security_posture/server/create_indices/types.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/types.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/create_indices/types.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/create_indices/types.ts diff --git a/x-pack/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/create_transforms/create_transforms.test.ts diff --git a/x-pack/plugins/cloud_security_posture/server/create_transforms/create_transforms.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/create_transforms/create_transforms.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/create_transforms/create_transforms.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/create_transforms/create_transforms.ts diff --git a/x-pack/plugins/cloud_security_posture/server/create_transforms/latest_findings_transform.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/create_transforms/latest_findings_transform.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/create_transforms/latest_findings_transform.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/create_transforms/latest_findings_transform.ts diff --git a/x-pack/plugins/cloud_security_posture/server/create_transforms/latest_vulnerabilities_transforms.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/create_transforms/latest_vulnerabilities_transforms.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/create_transforms/latest_vulnerabilities_transforms.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/create_transforms/latest_vulnerabilities_transforms.ts diff --git a/x-pack/plugins/cloud_security_posture/server/fleet_integration/fleet_integration.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/fleet_integration/fleet_integration.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/fleet_integration/fleet_integration.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/fleet_integration/fleet_integration.ts diff --git a/x-pack/plugins/cloud_security_posture/server/index.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/index.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/index.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/index.ts diff --git a/x-pack/plugins/cloud_security_posture/server/lib/check_index_status.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/lib/check_index_status.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/lib/check_index_status.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/lib/check_index_status.ts diff --git a/x-pack/plugins/cloud_security_posture/server/lib/fleet_util.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/lib/fleet_util.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/lib/fleet_util.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/lib/fleet_util.ts diff --git a/x-pack/plugins/cloud_security_posture/server/lib/mapping_field_util.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/lib/mapping_field_util.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/lib/mapping_field_util.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/lib/mapping_field_util.test.ts diff --git a/x-pack/plugins/cloud_security_posture/server/lib/mapping_field_util.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/lib/mapping_field_util.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/lib/mapping_field_util.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/lib/mapping_field_util.ts diff --git a/x-pack/plugins/cloud_security_posture/server/lib/task_manager_util.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/lib/task_manager_util.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/lib/task_manager_util.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/lib/task_manager_util.ts diff --git a/x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/accounts_stats_collector.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/accounts_stats_collector.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/accounts_stats_collector.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/accounts_stats_collector.ts diff --git a/x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/alert_stats_collector.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/alert_stats_collector.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/alert_stats_collector.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/alert_stats_collector.ts diff --git a/x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/cloud_accounts_stats_collector.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/cloud_accounts_stats_collector.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/cloud_accounts_stats_collector.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/cloud_accounts_stats_collector.ts diff --git a/x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/indices_stats_collector.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/indices_stats_collector.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/indices_stats_collector.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/indices_stats_collector.ts diff --git a/x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/installation_stats_collector.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/installation_stats_collector.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/installation_stats_collector.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/installation_stats_collector.ts diff --git a/x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/muted_rules_stats_collector.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/muted_rules_stats_collector.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/muted_rules_stats_collector.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/muted_rules_stats_collector.ts diff --git a/x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/register.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/register.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/register.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/register.ts diff --git a/x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/resources_stats_collector.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/resources_stats_collector.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/resources_stats_collector.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/resources_stats_collector.ts diff --git a/x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/rules_stats_collector.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/rules_stats_collector.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/rules_stats_collector.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/rules_stats_collector.ts diff --git a/x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/schema.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/schema.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/schema.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/schema.ts diff --git a/x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/types.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/types.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/lib/telemetry/collectors/types.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/lib/telemetry/collectors/types.ts diff --git a/x-pack/plugins/cloud_security_posture/server/mocks.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/mocks.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/mocks.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/mocks.ts diff --git a/x-pack/plugins/cloud_security_posture/server/plugin.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/plugin.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/plugin.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/plugin.test.ts diff --git a/x-pack/plugins/cloud_security_posture/server/plugin.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/plugin.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/plugin.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/plugin.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/bulk_action.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/bulk_action.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/bulk_action.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/bulk_action.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/utils.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/utils.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/utils.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/utils.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/v1.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/v1.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/v1.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/v1.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.test.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/find/find.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/utils.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/find/utils.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/utils.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/find/utils.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v1.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v1.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v1.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v1.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v2.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v2.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v2.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v2.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v3.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v3.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v3.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/find/v3.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/get_states/get_states.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/get_states/get_states.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/get_states/get_states.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/get_states/get_states.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/get_states/v1.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/get_states/v1.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/get_states/v1.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmark_rules/get_states/v1.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.handlers.mock.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.handlers.mock.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.handlers.mock.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.handlers.mock.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.test.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/benchmarks.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/utilities.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/utilities.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/benchmarks/utilities.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/utilities.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/v1.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/v1.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/benchmarks/v1.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/v1.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmarks/v2.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/v2.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/benchmarks/v2.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/benchmarks/v2.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/compliance_dashboard.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_benchmarks.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_benchmarks.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_benchmarks.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_benchmarks.test.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_benchmarks.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_benchmarks.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_benchmarks.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_benchmarks.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.test.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_clusters.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_grouped_findings_evaluation.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_grouped_findings_evaluation.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_grouped_findings_evaluation.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_grouped_findings_evaluation.test.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_grouped_findings_evaluation.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_grouped_findings_evaluation.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_grouped_findings_evaluation.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_grouped_findings_evaluation.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.test.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_stats.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.test.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/compliance_dashboard/get_trends.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/detection_engine/get_detection_engine_alerts_count_by_rule_tags.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/detection_engine/get_detection_engine_alerts_count_by_rule_tags.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/detection_engine/get_detection_engine_alerts_count_by_rule_tags.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/detection_engine/get_detection_engine_alerts_count_by_rule_tags.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/graph/route.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/graph/route.ts similarity index 94% rename from x-pack/plugins/cloud_security_posture/server/routes/graph/route.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/graph/route.ts index f9544b656f927..f655747815850 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/graph/route.ts +++ b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/graph/route.ts @@ -43,7 +43,7 @@ export const defineGraphRoute = (router: CspRouter) => const cspContext = await context.csp; const { nodesLimit, showUnknownTarget = false } = request.body; - const { eventIds, start, end, esQuery } = request.body.query as GraphRequest['query']; + const { originEventIds, start, end, esQuery } = request.body.query as GraphRequest['query']; const spaceId = (await cspContext.spaces?.spacesService?.getActiveSpace(request))?.id; try { @@ -53,7 +53,7 @@ export const defineGraphRoute = (router: CspRouter) => esClient: cspContext.esClient, }, query: { - eventIds, + originEventIds, spaceId, start, end, diff --git a/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/graph/v1.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/graph/v1.ts new file mode 100644 index 0000000000000..d506bb856e766 --- /dev/null +++ b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/graph/v1.ts @@ -0,0 +1,445 @@ +/* + * 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 { castArray } from 'lodash'; +import { v4 as uuidv4 } from 'uuid'; +import type { Logger, IScopedClusterClient } from '@kbn/core/server'; +import { ApiMessageCode } from '@kbn/cloud-security-posture-common/types/graph/latest'; +import type { + Color, + EdgeDataModel, + EntityNodeDataModel, + GraphRequest, + GraphResponse, + GroupNodeDataModel, + LabelNodeDataModel, + NodeDataModel, +} from '@kbn/cloud-security-posture-common/types/graph/v1'; +import type { EsqlToRecords } from '@elastic/elasticsearch/lib/helpers'; +import type { Writable } from '@kbn/utility-types'; + +type EsQuery = GraphRequest['query']['esQuery']; + +interface GraphEdge { + badge: number; + ips?: string[] | string; + hosts?: string[] | string; + users?: string[] | string; + actorIds: string[] | string; + action: string; + targetIds: string[] | string; + eventOutcome: string; + isOrigin: boolean; + isOriginAlert: boolean; +} + +interface LabelEdges { + source: string; + target: string; +} + +interface GraphContextServices { + logger: Logger; + esClient: IScopedClusterClient; +} + +interface OriginEventId { + id: string; + isAlert: boolean; +} + +interface GetGraphParams { + services: GraphContextServices; + query: { + originEventIds: OriginEventId[]; + spaceId?: string; + start: string | number; + end: string | number; + esQuery?: EsQuery; + }; + showUnknownTarget: boolean; + nodesLimit?: number; +} + +export const getGraph = async ({ + services: { esClient, logger }, + query: { originEventIds, spaceId = 'default', start, end, esQuery }, + showUnknownTarget, + nodesLimit, +}: GetGraphParams): Promise<Pick<GraphResponse, 'nodes' | 'edges' | 'messages'>> => { + logger.trace( + `Fetching graph for [originEventIds: ${originEventIds.join(', ')}] in [spaceId: ${spaceId}]` + ); + + const results = await fetchGraph({ + esClient, + showUnknownTarget, + logger, + start, + end, + originEventIds, + esQuery, + }); + + // Convert results into set of nodes and edges + return parseRecords(logger, results.records, nodesLimit); +}; + +interface ParseContext { + readonly nodesLimit?: number; + readonly nodesMap: Record<string, NodeDataModel>; + readonly edgesMap: Record<string, EdgeDataModel>; + readonly edgeLabelsNodes: Record<string, string[]>; + readonly labelEdges: Record<string, LabelEdges>; + readonly messages: ApiMessageCode[]; + readonly logger: Logger; +} + +const parseRecords = ( + logger: Logger, + records: GraphEdge[], + nodesLimit?: number +): Pick<GraphResponse, 'nodes' | 'edges' | 'messages'> => { + const ctx: ParseContext = { + nodesLimit, + logger, + nodesMap: {}, + edgeLabelsNodes: {}, + edgesMap: {}, + labelEdges: {}, + messages: [], + }; + + logger.trace(`Parsing records [length: ${records.length}] [nodesLimit: ${nodesLimit ?? 'none'}]`); + + createNodes(records, ctx); + createEdgesAndGroups(ctx); + + logger.trace( + `Parsed [nodes: ${Object.keys(ctx.nodesMap).length}, edges: ${ + Object.keys(ctx.edgesMap).length + }]` + ); + + // Sort groups to be first (fixes minor layout issue) + const nodes = sortNodes(ctx.nodesMap); + + return { + nodes, + edges: Object.values(ctx.edgesMap), + messages: ctx.messages.length > 0 ? ctx.messages : undefined, + }; +}; + +const fetchGraph = async ({ + esClient, + logger, + start, + end, + originEventIds, + showUnknownTarget, + esQuery, +}: { + esClient: IScopedClusterClient; + logger: Logger; + start: string | number; + end: string | number; + originEventIds: OriginEventId[]; + showUnknownTarget: boolean; + esQuery?: EsQuery; +}): Promise<EsqlToRecords<GraphEdge>> => { + const originAlertIds = originEventIds.filter((originEventId) => originEventId.isAlert); + const query = `from logs-* +| WHERE event.action IS NOT NULL AND actor.entity.id IS NOT NULL +| EVAL isOrigin = ${ + originEventIds.length > 0 + ? `event.id in (${originEventIds.map((_id, idx) => `?og_id${idx}`).join(', ')})` + : 'false' + } +| EVAL isOriginAlert = isOrigin AND ${ + originAlertIds.length > 0 + ? `event.id in (${originAlertIds.map((_id, idx) => `?og_alrt_id${idx}`).join(', ')})` + : 'false' + } +| STATS badge = COUNT(*), + ips = VALUES(related.ip), + // hosts = VALUES(related.hosts), + users = VALUES(related.user) + by actorIds = actor.entity.id, + action = event.action, + targetIds = target.entity.id, + eventOutcome = event.outcome, + isOrigin, + isOriginAlert +| LIMIT 1000 +| SORT isOrigin DESC`; + + logger.trace(`Executing query [${query}]`); + + const eventIds = originEventIds.map((originEventId) => originEventId.id); + return await esClient.asCurrentUser.helpers + .esql({ + columnar: false, + filter: buildDslFilter(eventIds, showUnknownTarget, start, end, esQuery), + query, + // @ts-ignore - types are not up to date + params: [ + ...originEventIds.map((originEventId, idx) => ({ [`og_id${idx}`]: originEventId.id })), + ...originEventIds + .filter((originEventId) => originEventId.isAlert) + .map((originEventId, idx) => ({ [`og_alrt_id${idx}`]: originEventId.id })), + ], + }) + .toRecords<GraphEdge>(); +}; + +const buildDslFilter = ( + eventIds: string[], + showUnknownTarget: boolean, + start: string | number, + end: string | number, + esQuery?: EsQuery +) => ({ + bool: { + filter: [ + { + range: { + '@timestamp': { + gte: start, + lte: end, + }, + }, + }, + ...(showUnknownTarget + ? [] + : [ + { + exists: { + field: 'target.entity.id', + }, + }, + ]), + { + bool: { + should: [ + ...(esQuery?.bool.filter?.length || + esQuery?.bool.must?.length || + esQuery?.bool.should?.length || + esQuery?.bool.must_not?.length + ? [esQuery] + : []), + { + terms: { + 'event.id': eventIds, + }, + }, + ], + minimum_should_match: 1, + }, + }, + ], + }, +}); + +const createNodes = (records: GraphEdge[], context: Omit<ParseContext, 'edgesMap'>) => { + const { nodesMap, edgeLabelsNodes, labelEdges } = context; + + for (const record of records) { + if (context.nodesLimit !== undefined && Object.keys(nodesMap).length >= context.nodesLimit) { + context.logger.debug( + `Reached nodes limit [limit: ${context.nodesLimit}] [current: ${ + Object.keys(nodesMap).length + }]` + ); + context.messages.push(ApiMessageCode.ReachedNodesLimit); + break; + } + + const { ips, hosts, users, actorIds, action, targetIds, isOriginAlert, eventOutcome } = record; + const actorIdsArray = castArray(actorIds); + const targetIdsArray = castArray(targetIds); + const unknownTargets: string[] = []; + + // Ensure all targets has an id (target can return null from the query) + targetIdsArray.forEach((id, idx) => { + if (!id) { + targetIdsArray[idx] = `unknown ${uuidv4()}`; + unknownTargets.push(targetIdsArray[idx]); + } + }); + + // Create entity nodes + [...actorIdsArray, ...targetIdsArray].forEach((id) => { + if (nodesMap[id] === undefined) { + nodesMap[id] = { + id, + label: unknownTargets.includes(id) ? 'Unknown' : undefined, + color: isOriginAlert ? 'danger' : 'primary', + ...determineEntityNodeShape( + id, + castArray(ips ?? []), + castArray(hosts ?? []), + castArray(users ?? []) + ), + }; + } + }); + + // Create label nodes + for (const actorId of actorIdsArray) { + for (const targetId of targetIdsArray) { + const edgeId = `a(${actorId})-b(${targetId})`; + + if (edgeLabelsNodes[edgeId] === undefined) { + edgeLabelsNodes[edgeId] = []; + } + + const labelNode: LabelNodeDataModel = { + id: edgeId + `label(${action})outcome(${eventOutcome})`, + label: action, + color: isOriginAlert ? 'danger' : eventOutcome === 'failed' ? 'warning' : 'primary', + shape: 'label', + }; + + nodesMap[labelNode.id] = labelNode; + edgeLabelsNodes[edgeId].push(labelNode.id); + labelEdges[labelNode.id] = { source: actorId, target: targetId }; + } + } + } +}; + +const determineEntityNodeShape = ( + actorId: string, + ips: string[], + hosts: string[], + users: string[] +): { + shape: EntityNodeDataModel['shape']; + icon: string; +} => { + // If actor is a user return ellipse + if (users.includes(actorId)) { + return { shape: 'ellipse', icon: 'user' }; + } + + // If actor is a host return hexagon + if (hosts.includes(actorId)) { + return { shape: 'hexagon', icon: 'storage' }; + } + + // If actor is an IP return diamond + if (ips.includes(actorId)) { + return { shape: 'diamond', icon: 'globe' }; + } + + return { shape: 'hexagon', icon: 'questionInCircle' }; +}; + +const sortNodes = (nodesMap: Record<string, NodeDataModel>) => { + const groupNodes = []; + const otherNodes = []; + + for (const node of Object.values(nodesMap)) { + if (node.shape === 'group') { + groupNodes.push(node); + } else { + otherNodes.push(node); + } + } + + return [...groupNodes, ...otherNodes]; +}; + +const createEdgesAndGroups = (context: ParseContext) => { + const { edgeLabelsNodes, edgesMap, nodesMap, labelEdges } = context; + + Object.entries(edgeLabelsNodes).forEach(([edgeId, edgeLabelsIds]) => { + // When there's more than one edge label, create a group node + if (edgeLabelsIds.length === 1) { + const edgeLabelId = edgeLabelsIds[0]; + + connectEntitiesAndLabelNode( + edgesMap, + nodesMap, + labelEdges[edgeLabelId].source, + edgeLabelId, + labelEdges[edgeLabelId].target + ); + } else { + const groupNode: GroupNodeDataModel = { + id: `grp(${edgeId})`, + shape: 'group', + }; + nodesMap[groupNode.id] = groupNode; + let groupEdgesColor: Color = 'primary'; + + edgeLabelsIds.forEach((edgeLabelId) => { + (nodesMap[edgeLabelId] as Writable<LabelNodeDataModel>).parentId = groupNode.id; + connectEntitiesAndLabelNode(edgesMap, nodesMap, groupNode.id, edgeLabelId, groupNode.id); + + if ((nodesMap[edgeLabelId] as LabelNodeDataModel).color === 'danger') { + groupEdgesColor = 'danger'; + } else if ( + (nodesMap[edgeLabelId] as LabelNodeDataModel).color === 'warning' && + groupEdgesColor !== 'danger' + ) { + // Use warning only if there's no danger color + groupEdgesColor = 'warning'; + } + }); + + connectEntitiesAndLabelNode( + edgesMap, + nodesMap, + labelEdges[edgeLabelsIds[0]].source, + groupNode.id, + labelEdges[edgeLabelsIds[0]].target, + groupEdgesColor + ); + } + }); +}; + +const connectEntitiesAndLabelNode = ( + edgesMap: Record<string, EdgeDataModel>, + nodesMap: Record<string, NodeDataModel>, + sourceNodeId: string, + labelNodeId: string, + targetNodeId: string, + colorOverride?: Color +) => { + [ + connectNodes(nodesMap, sourceNodeId, labelNodeId, colorOverride), + connectNodes(nodesMap, labelNodeId, targetNodeId, colorOverride), + ].forEach((edge) => { + edgesMap[edge.id] = edge; + }); +}; + +const connectNodes = ( + nodesMap: Record<string, NodeDataModel>, + sourceNodeId: string, + targetNodeId: string, + colorOverride?: Color +): EdgeDataModel => { + const sourceNode = nodesMap[sourceNodeId]; + const targetNode = nodesMap[targetNodeId]; + const color = + sourceNode.shape !== 'group' && targetNode.shape !== 'label' + ? sourceNode.color + : targetNode.shape !== 'group' + ? targetNode.color + : 'primary'; + + return { + id: `a(${sourceNodeId})-b(${targetNodeId})`, + source: sourceNodeId, + target: targetNodeId, + color: colorOverride ?? color, + }; +}; diff --git a/x-pack/plugins/cloud_security_posture/server/routes/setup_routes.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/setup_routes.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/setup_routes.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/setup_routes.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/status/status.handlers.mock.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.handlers.mock.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/status/status.handlers.mock.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.handlers.mock.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/status/status.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.test.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/status/status.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/status/status.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/status/status.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/get_top_patchable_vulnerabilities.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/get_top_patchable_vulnerabilities.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/get_top_patchable_vulnerabilities.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/get_top_patchable_vulnerabilities.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/get_top_vulnerabilities.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/get_top_vulnerabilities.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/get_top_vulnerabilities.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/get_top_vulnerabilities.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/get_top_vulnerable_resources.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/get_top_vulnerable_resources.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/get_top_vulnerable_resources.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/get_top_vulnerable_resources.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/get_vulnerabilities_statistics.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/get_vulnerabilities_statistics.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/get_vulnerabilities_statistics.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/get_vulnerabilities_statistics.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/get_vulnerabilities_trend.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/get_vulnerabilities_trend.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/get_vulnerabilities_trend.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/get_vulnerabilities_trend.ts diff --git a/x-pack/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/vulnerabilities_dashboard.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/vulnerabilities_dashboard.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/vulnerabilities_dashboard.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/routes/vulnerabilities_dashboard/vulnerabilities_dashboard.ts diff --git a/x-pack/plugins/cloud_security_posture/server/saved_objects/csp_benchmark_rule.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/saved_objects/csp_benchmark_rule.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/saved_objects/csp_benchmark_rule.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/saved_objects/csp_benchmark_rule.ts diff --git a/x-pack/plugins/cloud_security_posture/server/saved_objects/csp_settings.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/saved_objects/csp_settings.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/saved_objects/csp_settings.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/saved_objects/csp_settings.ts diff --git a/x-pack/plugins/cloud_security_posture/server/saved_objects/data_views.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/saved_objects/data_views.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/saved_objects/data_views.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/saved_objects/data_views.ts diff --git a/x-pack/plugins/cloud_security_posture/server/saved_objects/index.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/saved_objects/index.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/saved_objects/index.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/saved_objects/index.ts diff --git a/x-pack/plugins/cloud_security_posture/server/saved_objects/mappings.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/saved_objects/mappings.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/saved_objects/mappings.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/saved_objects/mappings.ts diff --git a/x-pack/plugins/cloud_security_posture/server/saved_objects/migrations/csp_benchmark_rule.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/saved_objects/migrations/csp_benchmark_rule.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/saved_objects/migrations/csp_benchmark_rule.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/saved_objects/migrations/csp_benchmark_rule.ts diff --git a/x-pack/plugins/cloud_security_posture/server/saved_objects/migrations/index.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/saved_objects/migrations/index.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/saved_objects/migrations/index.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/saved_objects/migrations/index.ts diff --git a/x-pack/plugins/cloud_security_posture/server/tasks/findings_stats_task.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/tasks/findings_stats_task.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/tasks/findings_stats_task.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/tasks/findings_stats_task.ts diff --git a/x-pack/plugins/cloud_security_posture/server/tasks/task_state.test.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/tasks/task_state.test.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/tasks/task_state.test.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/tasks/task_state.test.ts diff --git a/x-pack/plugins/cloud_security_posture/server/tasks/task_state.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/tasks/task_state.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/tasks/task_state.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/tasks/task_state.ts diff --git a/x-pack/plugins/cloud_security_posture/server/tasks/types.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/tasks/types.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/tasks/types.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/tasks/types.ts diff --git a/x-pack/plugins/cloud_security_posture/server/types.ts b/x-pack/solutions/security/plugins/cloud_security_posture/server/types.ts similarity index 100% rename from x-pack/plugins/cloud_security_posture/server/types.ts rename to x-pack/solutions/security/plugins/cloud_security_posture/server/types.ts diff --git a/x-pack/solutions/security/plugins/cloud_security_posture/tsconfig.json b/x-pack/solutions/security/plugins/cloud_security_posture/tsconfig.json new file mode 100755 index 0000000000000..e723ae3bc5d9f --- /dev/null +++ b/x-pack/solutions/security/plugins/cloud_security_posture/tsconfig.json @@ -0,0 +1,71 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*", + "scripts/**/*", + // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 + "server/**/*.json", + "public/**/*.json", + "../../../../../typings/**/*" + ], + "kbn_references": [ + "@kbn/core", + "@kbn/data-plugin", + "@kbn/fleet-plugin", + "@kbn/fleet-plugin", + "@kbn/task-manager-plugin", + "@kbn/security-plugin", + "@kbn/config-schema", + "@kbn/licensing-plugin", + "@kbn/kibana-react-plugin", + "@kbn/shared-ux-link-redirect-app", + "@kbn/usage-collection-plugin", + "@kbn/cloud-plugin", + "@kbn/unified-search-plugin", + "@kbn/charts-plugin", + "@kbn/discover-plugin", + "@kbn/i18n", + "@kbn/ui-theme", + "@kbn/i18n-react", + "@kbn/es-query", + "@kbn/data-views-plugin", + "@kbn/std", + "@kbn/monaco", + "@kbn/utility-types", + "@kbn/core-logging-server-mocks", + "@kbn/securitysolution-es-utils", + "@kbn/core-elasticsearch-client-server-mocks", + "@kbn/core-elasticsearch-server", + "@kbn/core-saved-objects-api-server", + "@kbn/shared-ux-router", + "@kbn/core-saved-objects-server", + "@kbn/share-plugin", + "@kbn/core-http-server", + "@kbn/core-http-browser", + "@kbn/discover-utils", + "@kbn/unified-data-table", + "@kbn/cell-actions", + "@kbn/unified-field-list", + "@kbn/unified-doc-viewer", + "@kbn/kibana-utils-plugin", + "@kbn/ui-actions-plugin", + "@kbn/core-http-server-mocks", + "@kbn/data-view-field-editor-plugin", + "@kbn/grouping", + "@kbn/alerting-plugin", + "@kbn/code-editor", + "@kbn/code-editor-mock", + "@kbn/search-types", + "@kbn/react-kibana-mount", + "@kbn/spaces-plugin", + "@kbn/cloud-security-posture-common", + "@kbn/cloud-security-posture", + "@kbn/analytics", + ], + "exclude": ["target/**/*"] +} diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/telemetry/event_based_telemetry.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/telemetry/event_based_telemetry.ts index 92330b4960e76..03e9e1d225ae1 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/lib/telemetry/event_based_telemetry.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/lib/telemetry/event_based_telemetry.ts @@ -77,13 +77,16 @@ export const INVOKE_ASSISTANT_SUCCESS_EVENT: EventTypeOpts<{ actionTypeId: string; isEnabledKnowledgeBase: boolean; durationMs: number; - ['toolsInvoked.AlertCountsTool']?: number; - ['toolsInvoked.NaturalLanguageESQLTool']?: number; - ['toolsInvoked.KnowledgeBaseRetrievalTool']?: number; - ['toolsInvoked.KnowledgeBaseWriteTool']?: number; - ['toolsInvoked.OpenAndAcknowledgedAlertsTool']?: number; - ['toolsInvoked.SecurityLabsKnowledgeBaseTool']?: number; - ['toolsInvoked.CustomTool']?: number; + toolsInvoked: { + AlertCountsTool?: number; + NaturalLanguageESQLTool?: number; + KnowledgeBaseRetrievalTool?: number; + KnowledgeBaseWriteTool?: number; + OpenAndAcknowledgedAlertsTool?: number; + SecurityLabsKnowledgeBaseTool?: number; + ProductDocumentationTool?: number; + CustomTool?: number; + }; model?: string; isOssModel?: boolean; }> = { @@ -127,53 +130,64 @@ export const INVOKE_ASSISTANT_SUCCESS_EVENT: EventTypeOpts<{ description: 'The duration of the request.', }, }, - 'toolsInvoked.AlertCountsTool': { - type: 'long', - _meta: { - description: 'Number of times tool was invoked.', - optional: true, - }, - }, - 'toolsInvoked.NaturalLanguageESQLTool': { - type: 'long', - _meta: { - description: 'Number of times tool was invoked.', - optional: true, - }, - }, - 'toolsInvoked.KnowledgeBaseRetrievalTool': { - type: 'long', - _meta: { - description: 'Number of times tool was invoked.', - optional: true, - }, - }, - 'toolsInvoked.KnowledgeBaseWriteTool': { - type: 'long', - _meta: { - description: 'Number of times tool was invoked.', - optional: true, - }, - }, - 'toolsInvoked.OpenAndAcknowledgedAlertsTool': { - type: 'long', - _meta: { - description: 'Number of times tool was invoked.', - optional: true, - }, - }, - 'toolsInvoked.SecurityLabsKnowledgeBaseTool': { - type: 'long', - _meta: { - description: 'Number of times tool was invoked.', - optional: true, - }, - }, - 'toolsInvoked.CustomTool': { - type: 'long', - _meta: { - description: 'Number of times tool was invoked.', - optional: true, + toolsInvoked: { + properties: { + AlertCountsTool: { + type: 'long', + _meta: { + description: 'Number of times tool was invoked.', + optional: true, + }, + }, + NaturalLanguageESQLTool: { + type: 'long', + _meta: { + description: 'Number of times tool was invoked.', + optional: true, + }, + }, + ProductDocumentationTool: { + type: 'long', + _meta: { + description: 'Number of times tool was invoked.', + optional: true, + }, + }, + KnowledgeBaseRetrievalTool: { + type: 'long', + _meta: { + description: 'Number of times tool was invoked.', + optional: true, + }, + }, + KnowledgeBaseWriteTool: { + type: 'long', + _meta: { + description: 'Number of times tool was invoked.', + optional: true, + }, + }, + OpenAndAcknowledgedAlertsTool: { + type: 'long', + _meta: { + description: 'Number of times tool was invoked.', + optional: true, + }, + }, + SecurityLabsKnowledgeBaseTool: { + type: 'long', + _meta: { + description: 'Number of times tool was invoked.', + optional: true, + }, + }, + CustomTool: { + type: 'long', + _meta: { + description: 'Number of times tool was invoked.', + optional: true, + }, + }, }, }, }, diff --git a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts index 5d75860c7e66f..b485125cc41e3 100644 --- a/x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts +++ b/x-pack/solutions/security/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts @@ -68,7 +68,7 @@ export const findUserConversationsRoute = (router: ElasticAssistantPluginRouter) const MAX_CONVERSATION_TOTAL = query.per_page; // TODO remove once we have pagination https://github.com/elastic/kibana/issues/192714 // do a separate search for default conversations and non-default conversations to ensure defaults always get included - // MUST MATCH THE LENGTH OF BASE_SECURITY_CONVERSATIONS from 'x-pack/plugins/security_solution/public/assistant/content/conversations/index.tsx' + // MUST MATCH THE LENGTH OF BASE_SECURITY_CONVERSATIONS from 'x-pack/solutions/security/plugins/security_solution/public/assistant/content/conversations/index.tsx' const MAX_DEFAULT_CONVERSATION_TOTAL = 7; const nonDefaultSize = MAX_CONVERSATION_TOTAL - MAX_DEFAULT_CONVERSATION_TOTAL; const result = await dataClient?.findDocuments<EsConversationSchema>({ diff --git a/x-pack/plugins/kubernetes_security/.eslintrc.json b/x-pack/solutions/security/plugins/kubernetes_security/.eslintrc.json similarity index 100% rename from x-pack/plugins/kubernetes_security/.eslintrc.json rename to x-pack/solutions/security/plugins/kubernetes_security/.eslintrc.json diff --git a/x-pack/plugins/kubernetes_security/README.md b/x-pack/solutions/security/plugins/kubernetes_security/README.md similarity index 100% rename from x-pack/plugins/kubernetes_security/README.md rename to x-pack/solutions/security/plugins/kubernetes_security/README.md diff --git a/x-pack/plugins/kubernetes_security/common/constants.ts b/x-pack/solutions/security/plugins/kubernetes_security/common/constants.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/common/constants.ts rename to x-pack/solutions/security/plugins/kubernetes_security/common/constants.ts diff --git a/x-pack/plugins/kubernetes_security/common/translations.ts b/x-pack/solutions/security/plugins/kubernetes_security/common/translations.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/common/translations.ts rename to x-pack/solutions/security/plugins/kubernetes_security/common/translations.ts diff --git a/x-pack/plugins/kubernetes_security/common/types/index.ts b/x-pack/solutions/security/plugins/kubernetes_security/common/types/index.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/common/types/index.ts rename to x-pack/solutions/security/plugins/kubernetes_security/common/types/index.ts diff --git a/x-pack/plugins/kubernetes_security/common/types/latest.ts b/x-pack/solutions/security/plugins/kubernetes_security/common/types/latest.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/common/types/latest.ts rename to x-pack/solutions/security/plugins/kubernetes_security/common/types/latest.ts diff --git a/x-pack/plugins/kubernetes_security/common/types/v1.ts b/x-pack/solutions/security/plugins/kubernetes_security/common/types/v1.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/common/types/v1.ts rename to x-pack/solutions/security/plugins/kubernetes_security/common/types/v1.ts diff --git a/x-pack/solutions/security/plugins/kubernetes_security/jest.config.js b/x-pack/solutions/security/plugins/kubernetes_security/jest.config.js new file mode 100644 index 0000000000000..0ab8dfc19a081 --- /dev/null +++ b/x-pack/solutions/security/plugins/kubernetes_security/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/kubernetes_security'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/kubernetes_security', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/kubernetes_security/{common,public,server}/**/*.{ts,tsx}', + ], + setupFiles: ['jest-canvas-mock'], +}; diff --git a/x-pack/plugins/kubernetes_security/kibana.jsonc b/x-pack/solutions/security/plugins/kubernetes_security/kibana.jsonc similarity index 100% rename from x-pack/plugins/kubernetes_security/kibana.jsonc rename to x-pack/solutions/security/plugins/kubernetes_security/kibana.jsonc diff --git a/x-pack/solutions/security/plugins/kubernetes_security/package.json b/x-pack/solutions/security/plugins/kubernetes_security/package.json new file mode 100644 index 0000000000000..b54e2d0381c93 --- /dev/null +++ b/x-pack/solutions/security/plugins/kubernetes_security/package.json @@ -0,0 +1,11 @@ +{ + "author": "Elastic", + "name": "@kbn/kubernetes-security-plugin", + "version": "1.0.0", + "private": true, + "license": "Elastic License 2.0", + "scripts": { + "test:jest": "node ../../../../scripts/jest", + "test:coverage": "node ../../../../scripts/jest --coverage" + } +} diff --git a/x-pack/plugins/kubernetes_security/public/components/charts_toggle/index.test.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/charts_toggle/index.test.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/charts_toggle/index.test.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/charts_toggle/index.test.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/charts_toggle/index.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/charts_toggle/index.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/charts_toggle/index.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/charts_toggle/index.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/container_name_widget/container_name_row.test.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/container_name_widget/container_name_row.test.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/container_name_widget/container_name_row.test.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/container_name_widget/container_name_row.test.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/container_name_widget/container_name_row.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/container_name_widget/container_name_row.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/container_name_widget/container_name_row.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/container_name_widget/container_name_row.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/container_name_widget/hooks.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/container_name_widget/hooks.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/container_name_widget/hooks.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/container_name_widget/hooks.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/container_name_widget/index.test.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/container_name_widget/index.test.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/container_name_widget/index.test.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/container_name_widget/index.test.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/container_name_widget/index.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/container_name_widget/index.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/container_name_widget/index.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/container_name_widget/index.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/container_name_widget/styles.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/container_name_widget/styles.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/container_name_widget/styles.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/container_name_widget/styles.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/count_widget/helpers.test.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/count_widget/helpers.test.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/count_widget/helpers.test.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/count_widget/helpers.test.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/count_widget/helpers.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/count_widget/helpers.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/count_widget/helpers.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/count_widget/helpers.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/count_widget/hooks.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/count_widget/hooks.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/count_widget/hooks.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/count_widget/hooks.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/count_widget/index.test.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/count_widget/index.test.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/count_widget/index.test.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/count_widget/index.test.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/count_widget/index.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/count_widget/index.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/count_widget/index.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/count_widget/index.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/count_widget/styles.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/count_widget/styles.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/count_widget/styles.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/count_widget/styles.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/kubernetes_security_routes/index.test.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/kubernetes_security_routes/index.test.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/kubernetes_security_routes/index.test.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/kubernetes_security_routes/index.test.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/kubernetes_security_routes/index.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/kubernetes_security_routes/index.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/kubernetes_security_routes/index.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/kubernetes_security_routes/index.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/kubernetes_security_routes/styles.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/kubernetes_security_routes/styles.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/kubernetes_security_routes/styles.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/kubernetes_security_routes/styles.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/percent_widget/hooks.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/percent_widget/hooks.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/percent_widget/hooks.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/percent_widget/hooks.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/percent_widget/index.test.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/percent_widget/index.test.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/percent_widget/index.test.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/percent_widget/index.test.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/percent_widget/index.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/percent_widget/index.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/percent_widget/index.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/percent_widget/index.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/percent_widget/styles.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/percent_widget/styles.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/percent_widget/styles.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/percent_widget/styles.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/assets/illustration_product_no_results_magnifying_glass.svg b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/assets/illustration_product_no_results_magnifying_glass.svg similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/assets/illustration_product_no_results_magnifying_glass.svg rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/assets/illustration_product_no_results_magnifying_glass.svg diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/helper.test.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/helper.test.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/helper.test.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/helper.test.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/helper.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/helper.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/helper.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/helper.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/index.test.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/index.test.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/index.test.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/index.test.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/index.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/index.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/index.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/index.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/styles.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/styles.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/styles.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/breadcrumb/styles.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/contexts.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/contexts.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/contexts.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/contexts.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/helpers.test.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/helpers.test.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/helpers.test.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/helpers.test.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/helpers.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/helpers.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/helpers.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/helpers.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/hooks.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/hooks.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/hooks.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/hooks.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/index.test.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/index.test.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/index.test.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/index.test.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/index.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/index.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/index.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/index.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/styles.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/styles.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/styles.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/styles.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/types.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/types.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/types.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/dynamic_tree_view/types.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/empty_state.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/empty_state.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/empty_state.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/empty_state.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/helpers.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/helpers.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/helpers.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/helpers.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/hooks.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/hooks.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/hooks.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/hooks.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/index.test.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/index.test.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/index.test.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/index.test.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/index.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/index.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/index.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/index.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/mocks.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/mocks.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/mocks.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/mocks.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/styles.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/styles.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/styles.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/styles.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/translations.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/translations.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/translations.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/translations.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/constants.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/constants.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/constants.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/constants.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/index.test.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/index.test.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/index.test.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/index.test.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/index.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/index.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/index.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/index.tsx diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/styles.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/styles.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/styles.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/styles.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/translations.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/translations.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/translations.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/translations.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/types.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/types.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/types.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/tree_nav/types.ts diff --git a/x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_view_icon.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/tree_view_icon.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/components/tree_view_container/tree_view_icon.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/components/tree_view_container/tree_view_icon.tsx diff --git a/x-pack/plugins/kubernetes_security/public/hooks/index.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/hooks/index.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/hooks/index.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/hooks/index.ts diff --git a/x-pack/plugins/kubernetes_security/public/hooks/use_eui_theme.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/hooks/use_eui_theme.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/hooks/use_eui_theme.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/hooks/use_eui_theme.ts diff --git a/x-pack/plugins/kubernetes_security/public/hooks/use_filter.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/hooks/use_filter.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/hooks/use_filter.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/hooks/use_filter.ts diff --git a/x-pack/plugins/kubernetes_security/public/hooks/use_last_updated.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/hooks/use_last_updated.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/hooks/use_last_updated.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/hooks/use_last_updated.ts diff --git a/x-pack/plugins/kubernetes_security/public/hooks/use_scroll.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/hooks/use_scroll.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/hooks/use_scroll.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/hooks/use_scroll.ts diff --git a/x-pack/plugins/kubernetes_security/public/index.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/index.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/index.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/index.ts diff --git a/x-pack/plugins/kubernetes_security/public/methods/index.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/methods/index.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/methods/index.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/methods/index.tsx diff --git a/x-pack/plugins/kubernetes_security/public/plugin.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/plugin.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/plugin.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/plugin.ts diff --git a/x-pack/plugins/kubernetes_security/public/test/index.tsx b/x-pack/solutions/security/plugins/kubernetes_security/public/test/index.tsx similarity index 100% rename from x-pack/plugins/kubernetes_security/public/test/index.tsx rename to x-pack/solutions/security/plugins/kubernetes_security/public/test/index.tsx diff --git a/x-pack/plugins/kubernetes_security/public/types.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/types.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/types.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/types.ts diff --git a/x-pack/plugins/kubernetes_security/public/utils/add_commas_to_number.test.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/utils/add_commas_to_number.test.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/utils/add_commas_to_number.test.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/utils/add_commas_to_number.test.ts diff --git a/x-pack/plugins/kubernetes_security/public/utils/add_commas_to_number.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/utils/add_commas_to_number.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/utils/add_commas_to_number.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/utils/add_commas_to_number.ts diff --git a/x-pack/plugins/kubernetes_security/public/utils/add_timerange_and_default_filter_to_query.test.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/utils/add_timerange_and_default_filter_to_query.test.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/utils/add_timerange_and_default_filter_to_query.test.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/utils/add_timerange_and_default_filter_to_query.test.ts diff --git a/x-pack/plugins/kubernetes_security/public/utils/add_timerange_and_default_filter_to_query.ts b/x-pack/solutions/security/plugins/kubernetes_security/public/utils/add_timerange_and_default_filter_to_query.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/public/utils/add_timerange_and_default_filter_to_query.ts rename to x-pack/solutions/security/plugins/kubernetes_security/public/utils/add_timerange_and_default_filter_to_query.ts diff --git a/x-pack/plugins/kubernetes_security/server/index.ts b/x-pack/solutions/security/plugins/kubernetes_security/server/index.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/server/index.ts rename to x-pack/solutions/security/plugins/kubernetes_security/server/index.ts diff --git a/x-pack/plugins/kubernetes_security/server/plugin.ts b/x-pack/solutions/security/plugins/kubernetes_security/server/plugin.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/server/plugin.ts rename to x-pack/solutions/security/plugins/kubernetes_security/server/plugin.ts diff --git a/x-pack/plugins/kubernetes_security/server/routes/aggregate.ts b/x-pack/solutions/security/plugins/kubernetes_security/server/routes/aggregate.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/server/routes/aggregate.ts rename to x-pack/solutions/security/plugins/kubernetes_security/server/routes/aggregate.ts diff --git a/x-pack/plugins/kubernetes_security/server/routes/count.ts b/x-pack/solutions/security/plugins/kubernetes_security/server/routes/count.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/server/routes/count.ts rename to x-pack/solutions/security/plugins/kubernetes_security/server/routes/count.ts diff --git a/x-pack/plugins/kubernetes_security/server/routes/index.ts b/x-pack/solutions/security/plugins/kubernetes_security/server/routes/index.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/server/routes/index.ts rename to x-pack/solutions/security/plugins/kubernetes_security/server/routes/index.ts diff --git a/x-pack/plugins/kubernetes_security/server/routes/multi_terms_aggregate.ts b/x-pack/solutions/security/plugins/kubernetes_security/server/routes/multi_terms_aggregate.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/server/routes/multi_terms_aggregate.ts rename to x-pack/solutions/security/plugins/kubernetes_security/server/routes/multi_terms_aggregate.ts diff --git a/x-pack/plugins/kubernetes_security/server/types.ts b/x-pack/solutions/security/plugins/kubernetes_security/server/types.ts similarity index 100% rename from x-pack/plugins/kubernetes_security/server/types.ts rename to x-pack/solutions/security/plugins/kubernetes_security/server/types.ts diff --git a/x-pack/solutions/security/plugins/kubernetes_security/tsconfig.json b/x-pack/solutions/security/plugins/kubernetes_security/tsconfig.json new file mode 100644 index 0000000000000..3acc6db4c9bd7 --- /dev/null +++ b/x-pack/solutions/security/plugins/kubernetes_security/tsconfig.json @@ -0,0 +1,42 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + }, + "include": [ + // add all the folders containg files to be compiled + "common/**/*", + "public/**/*", + "server/**/*", + "server/**/*.json", + "scripts/**/*", + "package.json", + "storybook/**/*", + "../../../../../typings/**/*" + ], + "kbn_references": [ + "@kbn/core", + // add references to other TypeScript projects the plugin depends on + + // requiredPlugins from ./kibana.json + "@kbn/data-plugin", + + // optionalPlugins from ./kibana.json + + // requiredBundles from ./kibana.json + "@kbn/kibana-react-plugin", + "@kbn/rule-registry-plugin", + "@kbn/session-view-plugin", + "@kbn/i18n", + "@kbn/timelines-plugin", + "@kbn/es-query", + "@kbn/ui-theme", + "@kbn/i18n-react", + "@kbn/config-schema", + "@kbn/shared-ux-router", + "@kbn/securitysolution-es-utils", + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/x-pack/plugins/observability_solution/slo/.storybook/main.js b/x-pack/solutions/security/plugins/lists/.storybook/main.js similarity index 100% rename from x-pack/plugins/observability_solution/slo/.storybook/main.js rename to x-pack/solutions/security/plugins/lists/.storybook/main.js diff --git a/x-pack/solutions/security/plugins/lists/README.md b/x-pack/solutions/security/plugins/lists/README.md new file mode 100644 index 0000000000000..b04d7097ddc6d --- /dev/null +++ b/x-pack/solutions/security/plugins/lists/README.md @@ -0,0 +1,238 @@ +README.md for developers working on the backend lists on how to get started +using the CURL scripts in the scripts folder. + +The scripts rely on CURL and jq: + +- [CURL](https://curl.haxx.se) +- [jq](https://stedolan.github.io/jq/) + +Install curl and jq (mac instructions) + +```sh +brew update +brew install curl +brew install jq +``` + +Open `$HOME/.zshrc` or `${HOME}.bashrc` depending on your SHELL output from `echo $SHELL` +and add these environment variables: + +```sh +export ELASTICSEARCH_USERNAME=${user} +export ELASTICSEARCH_PASSWORD=${password} +export ELASTICSEARCH_URL=https://${ip}:9200 +export KIBANA_URL=http://localhost:5601 +export TASK_MANAGER_INDEX=.kibana-task-manager-${your user id} +export KIBANA_INDEX=.kibana-${your user id} +``` + +source `$HOME/.zshrc` or `${HOME}.bashrc` to ensure variables are set: + +```sh +source ~/.zshrc +``` + +Open your `kibana.dev.yml` file and add these lines with your name: + +```sh +xpack.lists.listIndex: '.lists-your-name' +xpack.lists.listItemIndex: '.items-your-name' +``` + +Restart Kibana and ensure that you are using `--no-base-path` as changing the base path is a feature but will +get in the way of the CURL scripts written as is. + +Go to the scripts folder `cd kibana/x-pack/solutions/security/plugins/lists/server/scripts` and run: + +```sh +./hard_reset.sh +./post_list.sh +``` + +which will: + +- Delete any existing lists you have +- Delete any existing list items you have +- Delete any existing exception lists you have +- Delete any existing exception list items you have +- Delete any existing mapping, policies, and templates, you might have previously had. +- Add the latest list and list item index and its mappings using your settings from `kibana.dev.yml` environment variable of `xpack.lists.listIndex` and `xpack.lists.listItemIndex`. +- Posts the sample list from `./lists/new/ip_list.json` + +Now you can run + +```sh +./post_list.sh +``` + +You should see the new list created like so: + +```sh +{ + "id": "ip_list", + "created_at": "2020-05-28T19:15:22.344Z", + "created_by": "yo", + "description": "This list describes bad internet ip", + "name": "Simple list with an ip", + "tie_breaker_id": "c57efbc4-4977-4a32-995f-cfd296bed521", + "type": "ip", + "updated_at": "2020-05-28T19:15:22.344Z", + "updated_by": "yo" +} +``` + +You can add a list item like so: + +```sh + ./post_list_item.sh +``` + +You should see the new list item created and attached to the above list like so: + +```sh +{ + "id": "hand_inserted_item_id", + "type": "ip", + "value": "127.0.0.1", + "created_at": "2020-05-28T19:15:49.790Z", + "created_by": "yo", + "list_id": "ip_list", + "tie_breaker_id": "a881bf2e-1e17-4592-bba8-d567cb07d234", + "updated_at": "2020-05-28T19:15:49.790Z", + "updated_by": "yo" +} +``` + +If you want to post an exception list it would be like so: + +```sh +./post_exception_list.sh +``` + +You should see the new exception list created like so: + +```sh +{ + "created_at": "2020-05-28T19:16:31.052Z", + "created_by": "yo", + "description": "This is a sample endpoint type exception", + "id": "bcb94680-a117-11ea-ad9d-c71f4820e65b", + "list_id": "endpoint_list", + "name": "Sample Endpoint Exception List", + "namespace_type": "single", + "tags": [ + "user added string for a tag", + "malware" + ], + "tie_breaker_id": "86e08c8c-c970-4b08-a6e2-cdba7bb4e023", + "type": "endpoint", + "updated_at": "2020-05-28T19:16:31.080Z", + "updated_by": "yo" +} +``` + +And you can attach exception list items like so: + +```ts +{ + "comments": [], + "created_at": "2020-05-28T19:17:21.099Z", + "created_by": "yo", + "description": "This is a sample endpoint type exception", + "entries": [ + { + "field": "actingProcess.file.signer", + "operator": "included", + "type": "match", + "value": "Elastic, N.V." + }, + { + "field": "event.category", + "operator": "included", + "type": "match_any", + "value": [ + "process", + "malware" + ] + } + ], + "id": "da8d3b30-a117-11ea-ad9d-c71f4820e65b", + "item_id": "endpoint_list_item", + "list_id": "endpoint_list", + "name": "Sample Endpoint Exception List", + "namespace_type": "single", + "os_types": ["linux"], + "tags": [ + "user added string for a tag", + "malware" + ], + "tie_breaker_id": "21f84703-9476-4af8-a212-aad31e18dcb9", + "type": "simple", + "updated_at": "2020-05-28T19:17:21.123Z", + "updated_by": "yo" +} +``` + +You can then do find for each one like so: + +```sh +./find_lists.sh +``` + +```sh +{ + "cursor": "WzIwLFsiYzU3ZWZiYzQtNDk3Ny00YTMyLTk5NWYtY2ZkMjk2YmVkNTIxIl1d", + "data": [ + { + "id": "ip_list", + "created_at": "2020-05-28T19:15:22.344Z", + "created_by": "yo", + "description": "This list describes bad internet ip", + "name": "Simple list with an ip", + "tie_breaker_id": "c57efbc4-4977-4a32-995f-cfd296bed521", + "type": "ip", + "updated_at": "2020-05-28T19:15:22.344Z", + "updated_by": "yo" + } + ], + "page": 1, + "per_page": 20, + "total": 1 +} +``` + +or for finding exception lists: + +```sh +./find_exception_lists.sh +``` + +```sh +{ + "data": [ + { + "created_at": "2020-05-28T19:16:31.052Z", + "created_by": "yo", + "description": "This is a sample endpoint type exception", + "id": "bcb94680-a117-11ea-ad9d-c71f4820e65b", + "list_id": "endpoint_list", + "name": "Sample Endpoint Exception List", + "namespace_type": "single", + "os_types": ["linux"], + "tags": [ + "user added string for a tag", + "malware" + ], + "tie_breaker_id": "86e08c8c-c970-4b08-a6e2-cdba7bb4e023", + "type": "endpoint", + "updated_at": "2020-05-28T19:16:31.080Z", + "updated_by": "yo" + } + ], + "page": 1, + "per_page": 20, + "total": 1 +} +``` + +See the full scripts folder for all the capabilities. diff --git a/x-pack/plugins/lists/common/api/exceptions/create_exception_list/create_exception_list_route.ts b/x-pack/solutions/security/plugins/lists/common/api/exceptions/create_exception_list/create_exception_list_route.ts similarity index 100% rename from x-pack/plugins/lists/common/api/exceptions/create_exception_list/create_exception_list_route.ts rename to x-pack/solutions/security/plugins/lists/common/api/exceptions/create_exception_list/create_exception_list_route.ts diff --git a/x-pack/plugins/lists/common/api/exceptions/get_exception_filter/get_exception_filter_route.ts b/x-pack/solutions/security/plugins/lists/common/api/exceptions/get_exception_filter/get_exception_filter_route.ts similarity index 100% rename from x-pack/plugins/lists/common/api/exceptions/get_exception_filter/get_exception_filter_route.ts rename to x-pack/solutions/security/plugins/lists/common/api/exceptions/get_exception_filter/get_exception_filter_route.ts diff --git a/x-pack/plugins/lists/common/api/index.ts b/x-pack/solutions/security/plugins/lists/common/api/index.ts similarity index 100% rename from x-pack/plugins/lists/common/api/index.ts rename to x-pack/solutions/security/plugins/lists/common/api/index.ts diff --git a/x-pack/plugins/lists/common/api/values/find_lists_by_size/find_lists_by_size_route.ts b/x-pack/solutions/security/plugins/lists/common/api/values/find_lists_by_size/find_lists_by_size_route.ts similarity index 100% rename from x-pack/plugins/lists/common/api/values/find_lists_by_size/find_lists_by_size_route.ts rename to x-pack/solutions/security/plugins/lists/common/api/values/find_lists_by_size/find_lists_by_size_route.ts diff --git a/x-pack/plugins/lists/common/constants.mock.ts b/x-pack/solutions/security/plugins/lists/common/constants.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/constants.mock.ts rename to x-pack/solutions/security/plugins/lists/common/constants.mock.ts diff --git a/x-pack/plugins/lists/common/index.ts b/x-pack/solutions/security/plugins/lists/common/index.ts similarity index 100% rename from x-pack/plugins/lists/common/index.ts rename to x-pack/solutions/security/plugins/lists/common/index.ts diff --git a/x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/request/create_exception_list_item_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/request/create_exception_list_item_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/request/create_exception_list_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/request/create_exception_list_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/request/create_exception_list_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/request/create_exception_list_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/request/create_list_item_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/request/create_list_item_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/request/create_list_item_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/request/create_list_item_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/request/create_list_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/request/create_list_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/request/create_list_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/request/create_list_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/request/get_exception_filter_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/request/get_exception_filter_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/request/get_exception_filter_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/request/get_exception_filter_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/request/import_exceptions_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/request/import_exceptions_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/request/import_exceptions_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/request/import_exceptions_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/request/import_list_item_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/request/import_list_item_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/request/import_list_item_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/request/import_list_item_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/request/update_exception_list_item_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/request/update_exception_list_item_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/request/update_exception_list_item_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/request/update_exception_list_item_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/request/update_exception_list_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/request/update_exception_list_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/request/update_exception_list_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/request/update_exception_list_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/request/update_list_item_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/request/update_list_item_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/request/update_list_item_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/request/update_list_item_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/request/update_list_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/request/update_list_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/request/update_list_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/request/update_list_schema.mock.ts diff --git a/x-pack/solutions/security/plugins/lists/common/schemas/response/acknowledge_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/response/acknowledge_schema.mock.ts new file mode 100644 index 0000000000000..0aa6990d44b3d --- /dev/null +++ b/x-pack/solutions/security/plugins/lists/common/schemas/response/acknowledge_schema.mock.ts @@ -0,0 +1,12 @@ +/* + * 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 { AcknowledgeSchema } from '@kbn/securitysolution-io-ts-list-types'; + +export const getAcknowledgeSchemaResponseMock = (): AcknowledgeSchema => ({ + acknowledged: true, +}); diff --git a/x-pack/plugins/lists/common/schemas/response/exception_export_details_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/response/exception_export_details_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/response/exception_export_details_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/response/exception_export_details_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/response/exception_list_item_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/response/exception_list_item_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/response/exception_list_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/response/exception_list_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/response/exception_list_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/response/exception_list_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/response/exception_list_summary_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/response/exception_list_summary_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/response/exception_list_summary_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/response/exception_list_summary_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/response/found_all_list_items_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/response/found_all_list_items_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/response/found_all_list_items_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/response/found_all_list_items_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/response/found_exception_list_item_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/response/found_exception_list_item_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/response/found_exception_list_item_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/response/found_exception_list_item_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/response/found_exception_list_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/response/found_exception_list_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/response/found_exception_list_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/response/found_exception_list_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/response/found_list_item_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/response/found_list_item_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/response/found_list_item_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/response/found_list_item_schema.mock.ts diff --git a/x-pack/solutions/security/plugins/lists/common/schemas/response/found_list_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/response/found_list_schema.mock.ts new file mode 100644 index 0000000000000..1691221842d39 --- /dev/null +++ b/x-pack/solutions/security/plugins/lists/common/schemas/response/found_list_schema.mock.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 type { FoundListSchema } from '@kbn/securitysolution-io-ts-list-types'; + +import { getListResponseMock } from './list_schema.mock'; + +export const getFoundListSchemaMock = (): FoundListSchema => ({ + cursor: '123', + data: [getListResponseMock()], + page: 1, + per_page: 1, + total: 1, +}); diff --git a/x-pack/plugins/lists/common/schemas/response/found_lists_by_size_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/response/found_lists_by_size_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/response/found_lists_by_size_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/response/found_lists_by_size_schema.mock.ts diff --git a/x-pack/solutions/security/plugins/lists/common/schemas/response/list_item_index_exist_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/response/list_item_index_exist_schema.mock.ts new file mode 100644 index 0000000000000..afbb03cab870d --- /dev/null +++ b/x-pack/solutions/security/plugins/lists/common/schemas/response/list_item_index_exist_schema.mock.ts @@ -0,0 +1,13 @@ +/* + * 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 { ListItemIndexExistSchema } from '@kbn/securitysolution-io-ts-list-types'; + +export const getListItemIndexExistSchemaResponseMock = (): ListItemIndexExistSchema => ({ + list_index: true, + list_item_index: true, +}); diff --git a/x-pack/plugins/lists/common/schemas/response/list_item_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/response/list_item_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/response/list_item_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/response/list_item_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/response/list_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/response/list_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/response/list_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/response/list_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/response/search_list_item_schema.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/response/search_list_item_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/response/search_list_item_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/response/search_list_item_schema.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/types/comment.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/types/comment.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/types/comment.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/types/comment.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/types/create_comment.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/types/create_comment.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/types/create_comment.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/types/create_comment.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/types/entries.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/types/entries.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/types/entries.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/types/entries.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/types/entry_exists.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/types/entry_exists.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/types/entry_exists.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/types/entry_exists.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/types/entry_list.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/types/entry_list.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/types/entry_list.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/types/entry_list.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/types/entry_match.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/types/entry_match.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/types/entry_match.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/types/entry_match.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/types/entry_match_any.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/types/entry_match_any.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/types/entry_match_any.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/types/entry_match_any.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/types/entry_match_wildcard.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/types/entry_match_wildcard.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/types/entry_match_wildcard.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/types/entry_match_wildcard.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/types/entry_nested.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/types/entry_nested.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/types/entry_nested.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/types/entry_nested.mock.ts diff --git a/x-pack/plugins/lists/common/schemas/types/update_comment.mock.ts b/x-pack/solutions/security/plugins/lists/common/schemas/types/update_comment.mock.ts similarity index 100% rename from x-pack/plugins/lists/common/schemas/types/update_comment.mock.ts rename to x-pack/solutions/security/plugins/lists/common/schemas/types/update_comment.mock.ts diff --git a/x-pack/solutions/security/plugins/lists/jest.config.js b/x-pack/solutions/security/plugins/lists/jest.config.js new file mode 100644 index 0000000000000..3bbf109f51ab5 --- /dev/null +++ b/x-pack/solutions/security/plugins/lists/jest.config.js @@ -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. + */ + +module.exports = { + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/lists/{common,public,server}/**/*.{ts,tsx}', + ], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/lists', + coverageReporters: ['text', 'html'], + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/lists'], +}; diff --git a/x-pack/plugins/lists/kibana.jsonc b/x-pack/solutions/security/plugins/lists/kibana.jsonc similarity index 100% rename from x-pack/plugins/lists/kibana.jsonc rename to x-pack/solutions/security/plugins/lists/kibana.jsonc diff --git a/x-pack/plugins/lists/public/common/empty_value.ts b/x-pack/solutions/security/plugins/lists/public/common/empty_value.ts similarity index 100% rename from x-pack/plugins/lists/public/common/empty_value.ts rename to x-pack/solutions/security/plugins/lists/public/common/empty_value.ts diff --git a/x-pack/plugins/lists/public/exceptions/api.test.ts b/x-pack/solutions/security/plugins/lists/public/exceptions/api.test.ts similarity index 100% rename from x-pack/plugins/lists/public/exceptions/api.test.ts rename to x-pack/solutions/security/plugins/lists/public/exceptions/api.test.ts diff --git a/x-pack/plugins/lists/public/exceptions/components/__mock__/show_value_list_modal.mock.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/__mock__/show_value_list_modal.mock.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/__mock__/show_value_list_modal.mock.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/__mock__/show_value_list_modal.mock.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/and_or_badge/index.stories.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/and_or_badge/index.stories.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/and_or_badge/index.stories.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/and_or_badge/index.stories.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/and_or_badge/index.test.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/and_or_badge/index.test.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/and_or_badge/index.test.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/and_or_badge/index.test.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/and_or_badge/index.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/and_or_badge/index.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/and_or_badge/index.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/and_or_badge/index.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/and_or_badge/rounded_badge.test.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/and_or_badge/rounded_badge.test.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/and_or_badge/rounded_badge.test.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/and_or_badge/rounded_badge.test.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/and_or_badge/rounded_badge.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/and_or_badge/rounded_badge.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/and_or_badge/rounded_badge.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/and_or_badge/rounded_badge.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/and_or_badge/rounded_badge_antenna.test.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/and_or_badge/rounded_badge_antenna.test.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/and_or_badge/rounded_badge_antenna.test.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/and_or_badge/rounded_badge_antenna.test.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/and_or_badge/rounded_badge_antenna.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/and_or_badge/rounded_badge_antenna.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/and_or_badge/rounded_badge_antenna.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/and_or_badge/rounded_badge_antenna.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/and_or_badge/translations.ts b/x-pack/solutions/security/plugins/lists/public/exceptions/components/and_or_badge/translations.ts similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/and_or_badge/translations.ts rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/and_or_badge/translations.ts diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/and_badge.test.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/and_badge.test.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/builder/and_badge.test.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/and_badge.test.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/and_badge.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/and_badge.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/builder/and_badge.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/and_badge.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/builder.stories.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/builder.stories.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/builder/builder.stories.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/builder.stories.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/entry_delete_button.test.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/entry_delete_button.test.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/builder/entry_delete_button.test.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/entry_delete_button.test.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/entry_delete_button.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/entry_delete_button.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/builder/entry_delete_button.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/entry_delete_button.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.stories.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/entry_renderer.stories.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.stories.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/entry_renderer.stories.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/entry_renderer.test.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/entry_renderer.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.test.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/exception_item_renderer.test.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.test.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/exception_item_renderer.test.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/exception_item_renderer.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.test.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/exception_items_renderer.test.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.test.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/exception_items_renderer.test.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/exception_items_renderer.tsx diff --git a/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/helpers.test.ts b/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/helpers.test.ts new file mode 100644 index 0000000000000..c5afe22bb73c8 --- /dev/null +++ b/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/helpers.test.ts @@ -0,0 +1,1966 @@ +/* + * 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 { + EntryExists, + EntryList, + EntryMatch, + EntryMatchAny, + EntryNested, + ListOperatorEnum as OperatorEnum, + ListOperatorTypeEnum as OperatorTypeEnum, +} from '@kbn/securitysolution-io-ts-list-types'; +import { + ALL_OPERATORS, + BuilderEntry, + DETECTION_ENGINE_EXCEPTION_OPERATORS, + EXCEPTION_OPERATORS_SANS_LISTS, + EmptyEntry, + ExceptionsBuilderExceptionItem, + ExceptionsBuilderReturnExceptionItem, + FormattedBuilderEntry, + OperatorOption, + doesNotExistOperator, + doesNotMatchOperator, + existsOperator, + filterExceptionItems, + getCorrespondingKeywordField, + getEntryFromOperator, + getEntryOnFieldChange, + getEntryOnListChange, + getEntryOnMatchAnyChange, + getEntryOnMatchChange, + getEntryOnOperatorChange, + getEntryValue, + getExceptionOperatorSelect, + getFilteredIndexPatterns, + getFormattedBuilderEntries, + getFormattedBuilderEntry, + getNewExceptionItem, + getOperatorOptions, + getOperatorType, + getUpdatedEntriesOnDelete, + isEntryNested, + isInListOperator, + isNotInListOperator, + isNotOneOfOperator, + isNotOperator, + isOneOfOperator, + isOperator, + matchesOperator, +} from '@kbn/securitysolution-list-utils'; +import { DataViewBase, DataViewFieldBase } from '@kbn/es-query'; +import { fields, getField } from '@kbn/data-plugin/common/mocks'; +import type { FieldSpec } from '@kbn/data-plugin/common'; + +import { ENTRIES_WITH_IDS } from '../../../../common/constants.mock'; +import { getEntryExistsMock } from '../../../../common/schemas/types/entry_exists.mock'; +import { getExceptionListItemSchemaMock } from '../../../../common/schemas/response/exception_list_item_schema.mock'; +import { getEntryNestedMock } from '../../../../common/schemas/types/entry_nested.mock'; +import { getEntryMatchMock } from '../../../../common/schemas/types/entry_match.mock'; +import { getEntryMatchAnyMock } from '../../../../common/schemas/types/entry_match_any.mock'; +import { getListResponseMock } from '../../../../common/schemas/response/list_schema.mock'; +import { getEntryListMock } from '../../../../common/schemas/types/entry_list.mock'; + +// TODO: ALL THESE TESTS SHOULD BE MOVED TO @kbn/securitysolution-list-utils for its helper. The only reason why they're here is due to missing other packages we hae to create or missing things from kbn packages such as mocks from kibana core + +jest.mock('uuid', () => ({ + v4: jest.fn().mockReturnValue('123'), +})); + +const getEntryExistsWithIdMock = (): EntryExists & { id: string } => ({ + ...getEntryExistsMock(), + id: '123', +}); + +const getEntryNestedWithIdMock = (): EntryNested & { id: string } => ({ + ...getEntryNestedMock(), + id: '123', +}); + +const getEntryMatchWithIdMock = (): EntryMatch & { id: string } => ({ + ...getEntryMatchMock(), + id: '123', +}); + +const getEntryMatchAnyWithIdMock = (): EntryMatchAny & { id: string } => ({ + ...getEntryMatchAnyMock(), + id: '123', +}); + +const getMockIndexPattern = (): DataViewBase => ({ + fields, + id: '1234', + title: 'logstash-*', +}); + +const getMockBuilderEntry = (): FormattedBuilderEntry => ({ + correspondingKeywordField: undefined, + entryIndex: 0, + field: getField('ip'), + id: '123', + nested: undefined, + operator: isOperator, + parent: undefined, + value: 'some value', +}); + +const getMockNestedBuilderEntry = (): FormattedBuilderEntry => ({ + correspondingKeywordField: undefined, + entryIndex: 0, + field: getField('nestedField.child'), + id: '123', + nested: 'child', + operator: isOperator, + parent: { + parent: { + ...getEntryNestedWithIdMock(), + entries: [{ ...getEntryMatchWithIdMock(), field: 'child' }], + field: 'nestedField', + }, + parentIndex: 0, + }, + value: 'some value', +}); + +const getMockNestedParentBuilderEntry = (): FormattedBuilderEntry => ({ + correspondingKeywordField: undefined, + entryIndex: 0, + field: { + ...getField('nestedField.child'), + esTypes: ['nested'], + name: 'nestedField', + } as FieldSpec, + id: '123', + nested: 'parent', + operator: isOperator, + parent: undefined, + value: undefined, +}); + +const mockEndpointFields = [ + { + aggregatable: false, + count: 0, + esTypes: ['keyword'], + name: 'file.path.caseless', + readFromDocValues: false, + scripted: false, + searchable: true, + type: 'string', + }, + { + aggregatable: false, + count: 0, + esTypes: ['text'], + name: 'file.Ext.code_signature.status', + readFromDocValues: false, + scripted: false, + searchable: true, + subType: { nested: { path: 'file.Ext.code_signature' } }, + type: 'string', + }, +]; + +export const getEndpointField = (name: string): DataViewFieldBase => + mockEndpointFields.find((field) => field.name === name) as DataViewFieldBase; + +describe('Exception builder helpers', () => { + describe('#getFilteredIndexPatterns', () => { + describe('list type detections', () => { + test('it returns nested fields that match parent value when "item.nested" is "child"', () => { + const payloadIndexPattern = getMockIndexPattern(); + const payloadItem: FormattedBuilderEntry = getMockNestedBuilderEntry(); + const output = getFilteredIndexPatterns(payloadIndexPattern, payloadItem); + const expected: DataViewBase = { + fields: [{ ...getField('nestedField.child'), name: 'child' }], + id: '1234', + title: 'logstash-*', + }; + expect(output).toEqual(expected); + }); + + test('it returns only parent nested field when "item.nested" is "parent" and nested parent field is not undefined', () => { + const payloadIndexPattern = getMockIndexPattern(); + const payloadItem: FormattedBuilderEntry = getMockNestedParentBuilderEntry(); + const output = getFilteredIndexPatterns(payloadIndexPattern, payloadItem); + const expected: DataViewBase & { fields: Array<Partial<FieldSpec>> } = { + fields: [{ ...getField('nestedField.child'), esTypes: ['nested'], name: 'nestedField' }], + id: '1234', + title: 'logstash-*', + }; + expect(output).toEqual(expected); + }); + + test('it returns only nested fields when "item.nested" is "parent" and nested parent field is undefined', () => { + const payloadIndexPattern = getMockIndexPattern(); + const payloadItem: FormattedBuilderEntry = { + ...getMockNestedParentBuilderEntry(), + field: undefined, + }; + const output = getFilteredIndexPatterns(payloadIndexPattern, payloadItem); + const expected: DataViewBase = { + fields: [ + { ...getField('nestedField.child') }, + { ...getField('nestedField.nestedChild.doublyNestedChild') }, + ], + id: '1234', + title: 'logstash-*', + }; + expect(output).toEqual(expected); + }); + + test('it returns all fields unfiltered if "item.nested" is not "child" or "parent"', () => { + const payloadIndexPattern = getMockIndexPattern(); + const payloadItem: FormattedBuilderEntry = getMockBuilderEntry(); + const output = getFilteredIndexPatterns(payloadIndexPattern, payloadItem); + const expected: DataViewBase = { + fields: [...fields], + id: '1234', + title: 'logstash-*', + }; + expect(output).toEqual(expected); + }); + }); + + describe('list type endpoint', () => { + let payloadIndexPattern = getMockIndexPattern(); + + beforeAll(() => { + payloadIndexPattern = { + ...payloadIndexPattern, + fields: [...payloadIndexPattern.fields, ...mockEndpointFields], + }; + }); + + test('it returns nested fields that match parent value when "item.nested" is "child"', () => { + const payloadItem: FormattedBuilderEntry = { + correspondingKeywordField: undefined, + entryIndex: 0, + field: getEndpointField('file.Ext.code_signature.status'), + id: '123', + nested: 'child', + operator: isOperator, + parent: { + parent: { + ...getEntryNestedWithIdMock(), + entries: [{ ...getEntryMatchWithIdMock(), field: 'child' }], + field: 'file.Ext.code_signature', + }, + parentIndex: 0, + }, + value: 'some value', + }; + const output = getFilteredIndexPatterns(payloadIndexPattern, payloadItem); + const expected: DataViewBase = { + fields: [{ ...getEndpointField('file.Ext.code_signature.status'), name: 'status' }], + id: '1234', + title: 'logstash-*', + }; + expect(output).toEqual(expected); + }); + + test('it returns only parent nested field when "item.nested" is "parent" and nested parent field is not undefined', () => { + const field: FieldSpec = { + ...getEndpointField('file.Ext.code_signature.status'), + esTypes: ['nested'], + name: 'file.Ext.code_signature', + } as FieldSpec; + const payloadItem: FormattedBuilderEntry = { + ...getMockNestedParentBuilderEntry(), + field, + }; + const output = getFilteredIndexPatterns(payloadIndexPattern, payloadItem); + const fieldsExpected: FieldSpec[] = [ + { + aggregatable: false, + count: 0, + esTypes: ['nested'], + name: 'file.Ext.code_signature', + readFromDocValues: false, + scripted: false, + searchable: true, + subType: { + nested: { + path: 'file.Ext.code_signature', + }, + }, + type: 'string', + }, + ]; + const expected: DataViewBase = { + fields: fieldsExpected, + id: '1234', + title: 'logstash-*', + }; + expect(output).toEqual(expected); + }); + + test('it returns only nested fields when "item.nested" is "parent" and nested parent field is undefined', () => { + const payloadItem: FormattedBuilderEntry = { + ...getMockNestedParentBuilderEntry(), + field: undefined, + }; + const output = getFilteredIndexPatterns(payloadIndexPattern, payloadItem); + const expected: DataViewBase = { + fields: [ + { ...getField('nestedField.child') }, + { ...getField('nestedField.nestedChild.doublyNestedChild') }, + getEndpointField('file.Ext.code_signature.status'), + ], + id: '1234', + title: 'logstash-*', + }; + expect(output).toEqual(expected); + }); + }); + }); + + describe('#getEntryFromOperator', () => { + test('it returns current value when switching from "is" to "is not"', () => { + const payloadOperator: OperatorOption = isNotOperator; + const payloadEntry: FormattedBuilderEntry = { + ...getMockBuilderEntry(), + value: 'I should stay the same', + }; + const output = getEntryFromOperator(payloadOperator, payloadEntry); + const expected: EntryMatch & { id?: string } = { + field: 'ip', + id: '123', + operator: 'excluded', + type: OperatorTypeEnum.MATCH, + value: 'I should stay the same', + }; + expect(output).toEqual(expected); + }); + + test('it returns current value when switching from "is not" to "is"', () => { + const payloadOperator: OperatorOption = isOperator; + const payloadEntry: FormattedBuilderEntry = { + ...getMockBuilderEntry(), + operator: isNotOperator, + value: 'I should stay the same', + }; + const output = getEntryFromOperator(payloadOperator, payloadEntry); + const expected: EntryMatch & { id?: string } = { + field: 'ip', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH, + value: 'I should stay the same', + }; + expect(output).toEqual(expected); + }); + + test('it returns empty value when switching operator types to "match"', () => { + const payloadOperator: OperatorOption = isOperator; + const payloadEntry: FormattedBuilderEntry = { + ...getMockBuilderEntry(), + operator: isNotOneOfOperator, + value: ['I should stay the same'], + }; + const output = getEntryFromOperator(payloadOperator, payloadEntry); + const expected: EntryMatch & { id?: string } = { + field: 'ip', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH, + value: '', + }; + expect(output).toEqual(expected); + }); + + test('it returns current value when switching from "is one of" to "is not one of"', () => { + const payloadOperator: OperatorOption = isNotOneOfOperator; + const payloadEntry: FormattedBuilderEntry = { + ...getMockBuilderEntry(), + operator: isOneOfOperator, + value: ['I should stay the same'], + }; + const output = getEntryFromOperator(payloadOperator, payloadEntry); + const expected: EntryMatchAny & { id?: string } = { + field: 'ip', + id: '123', + operator: 'excluded', + type: OperatorTypeEnum.MATCH_ANY, + value: ['I should stay the same'], + }; + expect(output).toEqual(expected); + }); + + test('it returns current value when switching from "is not one of" to "is one of"', () => { + const payloadOperator: OperatorOption = isOneOfOperator; + const payloadEntry: FormattedBuilderEntry = { + ...getMockBuilderEntry(), + operator: isNotOneOfOperator, + value: ['I should stay the same'], + }; + const output = getEntryFromOperator(payloadOperator, payloadEntry); + const expected: EntryMatchAny & { id?: string } = { + field: 'ip', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH_ANY, + value: ['I should stay the same'], + }; + expect(output).toEqual(expected); + }); + + test('it returns empty value when switching operator types to "match_any"', () => { + const payloadOperator: OperatorOption = isOneOfOperator; + const payloadEntry: FormattedBuilderEntry = { + ...getMockBuilderEntry(), + operator: isOperator, + value: 'I should stay the same', + }; + const output = getEntryFromOperator(payloadOperator, payloadEntry); + const expected: EntryMatchAny & { id?: string } = { + field: 'ip', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH_ANY, + value: [], + }; + expect(output).toEqual(expected); + }); + + test('it returns current value when switching from "exists" to "does not exist"', () => { + const payloadOperator: OperatorOption = doesNotExistOperator; + const payloadEntry: FormattedBuilderEntry = { + ...getMockBuilderEntry(), + operator: existsOperator, + }; + const output = getEntryFromOperator(payloadOperator, payloadEntry); + const expected: EntryExists & { id?: string } = { + field: 'ip', + id: '123', + operator: 'excluded', + type: 'exists', + }; + expect(output).toEqual(expected); + }); + + test('it returns current value when switching from "does not exist" to "exists"', () => { + const payloadOperator: OperatorOption = existsOperator; + const payloadEntry: FormattedBuilderEntry = { + ...getMockBuilderEntry(), + operator: doesNotExistOperator, + }; + const output = getEntryFromOperator(payloadOperator, payloadEntry); + const expected: EntryExists & { id?: string } = { + field: 'ip', + id: '123', + operator: OperatorEnum.INCLUDED, + type: 'exists', + }; + expect(output).toEqual(expected); + }); + + test('it returns empty value when switching operator types to "exists"', () => { + const payloadOperator: OperatorOption = existsOperator; + const payloadEntry: FormattedBuilderEntry = { + ...getMockBuilderEntry(), + operator: isOperator, + value: 'I should stay the same', + }; + const output = getEntryFromOperator(payloadOperator, payloadEntry); + const expected: EntryExists & { id?: string } = { + field: 'ip', + id: '123', + operator: OperatorEnum.INCLUDED, + type: 'exists', + }; + expect(output).toEqual(expected); + }); + + test('it returns empty value when switching operator types to "list"', () => { + const payloadOperator: OperatorOption = isInListOperator; + const payloadEntry: FormattedBuilderEntry = { + ...getMockBuilderEntry(), + operator: isOperator, + value: 'I should stay the same', + }; + const output = getEntryFromOperator(payloadOperator, payloadEntry); + const expected: EntryList & { id?: string } = { + field: 'ip', + id: '123', + list: { id: '', type: 'ip' }, + operator: OperatorEnum.INCLUDED, + type: 'list', + }; + expect(output).toEqual(expected); + }); + }); + + describe('#getOperatorOptions', () => { + test('it returns "isOperator" when field type is nested but field itself has not yet been selected', () => { + const payloadItem: FormattedBuilderEntry = getMockNestedParentBuilderEntry(); + const output = getOperatorOptions(payloadItem, 'endpoint', false); + const expected: OperatorOption[] = [isOperator]; + expect(output).toEqual(expected); + }); + + test('it returns "isOperator" if no field selected', () => { + const payloadItem: FormattedBuilderEntry = { ...getMockBuilderEntry(), field: undefined }; + const output = getOperatorOptions(payloadItem, 'endpoint', false); + const expected: OperatorOption[] = [isOperator]; + expect(output).toEqual(expected); + }); + + describe('"endpoint" list type', () => { + test('it returns operators "is", "isOneOf", "matches" and "doesNotMatch" if item is nested and field supports "matches"', () => { + const payloadItem: FormattedBuilderEntry = getMockNestedBuilderEntry(); + const output = getOperatorOptions(payloadItem, 'endpoint', false); + const expected: OperatorOption[] = [ + isOperator, + isOneOfOperator, + matchesOperator, + doesNotMatchOperator, + ]; + expect(output).toEqual(expected); + }); + + test('it returns operators "is" and "isOneOf" if item is nested and field does not support "matches"', () => { + const payloadItem: FormattedBuilderEntry = { + ...getMockNestedBuilderEntry(), + field: getField('ip'), + }; + const output = getOperatorOptions(payloadItem, 'endpoint', false); + const expected: OperatorOption[] = [isOperator, isOneOfOperator]; + expect(output).toEqual(expected); + }); + + test('it returns operators "is", "isOneOf", "matches" and "doesNotMatch" if field supports "matches"', () => { + const payloadItem: FormattedBuilderEntry = { + ...getMockBuilderEntry(), + field: getField('@tags'), + }; + const output = getOperatorOptions(payloadItem, 'endpoint', false); + const expected: OperatorOption[] = [ + isOperator, + isOneOfOperator, + matchesOperator, + doesNotMatchOperator, + ]; + expect(output).toEqual(expected); + }); + + test('it returns "isOperator" and "isOneOfOperator" if field does not support "matches"', () => { + const payloadItem: FormattedBuilderEntry = getMockBuilderEntry(); + const output = getOperatorOptions(payloadItem, 'endpoint', false); + const expected: OperatorOption[] = [isOperator, isOneOfOperator]; + expect(output).toEqual(expected); + }); + + test('it returns "isOperator" and field type is boolean', () => { + const payloadItem: FormattedBuilderEntry = getMockBuilderEntry(); + const output = getOperatorOptions(payloadItem, 'endpoint', true); + const expected: OperatorOption[] = [isOperator]; + expect(output).toEqual(expected); + }); + }); + + test('it returns "isOperator", "isOneOfOperator", and "existsOperator" if item is nested and "listType" is "detection"', () => { + const payloadItem: FormattedBuilderEntry = getMockNestedBuilderEntry(); + const output = getOperatorOptions(payloadItem, 'detection', false); + const expected: OperatorOption[] = [isOperator, isOneOfOperator, existsOperator]; + expect(output).toEqual(expected); + }); + + test('it returns "isOperator" and "existsOperator" if item is nested, "listType" is "detection", and field type is boolean', () => { + const payloadItem: FormattedBuilderEntry = getMockNestedBuilderEntry(); + const output = getOperatorOptions(payloadItem, 'detection', true); + const expected: OperatorOption[] = [isOperator, existsOperator]; + expect(output).toEqual(expected); + }); + + test('it returns "isOperator", "isNotOperator", "doesNotExistOperator" and "existsOperator" if field type is boolean', () => { + const payloadItem: FormattedBuilderEntry = getMockBuilderEntry(); + const output = getOperatorOptions(payloadItem, 'detection', true); + const expected: OperatorOption[] = [ + isOperator, + isNotOperator, + existsOperator, + doesNotExistOperator, + ]; + expect(output).toEqual(expected); + }); + + test('it returns list operators if specified to', () => { + const payloadItem: FormattedBuilderEntry = getMockBuilderEntry(); + const output = getOperatorOptions(payloadItem, 'detection', false, true); + expect(output.some((operator) => operator.value === 'is_not_in_list')).toBeTruthy(); + expect(output.some((operator) => operator.value === 'is_in_list')).toBeTruthy(); + }); + + test('it does not return list operators if specified not to', () => { + const payloadItem: FormattedBuilderEntry = { + ...getMockBuilderEntry(), + field: getField('@tags'), + }; + const output = getOperatorOptions(payloadItem, 'detection', false, false); + expect(output).toEqual(EXCEPTION_OPERATORS_SANS_LISTS); + }); + + test('it returns all possible operators if list type is not "detection"', () => { + const payloadItem: FormattedBuilderEntry = getMockBuilderEntry(); + const output = getOperatorOptions(payloadItem, 'endpoint_events', false, true); + expect(output).toEqual(ALL_OPERATORS); + }); + + test('it returns all operators supported by detection engine if list type is "detection"', () => { + const payloadItem: FormattedBuilderEntry = { + ...getMockBuilderEntry(), + field: getField('@tags'), + }; + const output = getOperatorOptions(payloadItem, 'detection', false, true); + expect(output).toEqual(DETECTION_ENGINE_EXCEPTION_OPERATORS); + }); + + test('it excludes wildcard operators if list type is "detection" and field is not a string', () => { + const payloadItem: FormattedBuilderEntry = getMockBuilderEntry(); + const output = getOperatorOptions(payloadItem, 'detection', false, true); + const expected: OperatorOption[] = [ + isOperator, + isNotOperator, + isOneOfOperator, + isNotOneOfOperator, + existsOperator, + doesNotExistOperator, + isInListOperator, + isNotInListOperator, + ]; + expect(output).toEqual(expected); + }); + }); + + describe('#getEntryOnFieldChange', () => { + test('it returns nested entry with single new subentry when "item.nested" is "parent"', () => { + const payloadItem: FormattedBuilderEntry = getMockNestedParentBuilderEntry(); + const payloadIFieldType = getField('nestedField.child'); + const output = getEntryOnFieldChange(payloadItem, payloadIFieldType); + const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { + index: 0, + updatedEntry: { + entries: [ + { + field: 'child', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH, + value: '', + }, + ], + field: 'nestedField', + id: '123', + type: OperatorTypeEnum.NESTED, + }, + }; + expect(output).toEqual(expected); + }); + + test('it returns nested entry with newly selected field value when "item.nested" is "child"', () => { + const payloadItem: FormattedBuilderEntry = { + ...getMockNestedBuilderEntry(), + parent: { + parent: { + ...getEntryNestedWithIdMock(), + entries: [ + { ...getEntryMatchWithIdMock(), field: 'child' }, + getEntryMatchAnyWithIdMock(), + ], + field: 'nestedField', + }, + parentIndex: 0, + }, + }; + const payloadIFieldType = getField('nestedField.child'); + const output = getEntryOnFieldChange(payloadItem, payloadIFieldType); + const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { + index: 0, + updatedEntry: { + entries: [ + { + field: 'child', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH, + value: '', + }, + getEntryMatchAnyWithIdMock(), + ], + field: 'nestedField', + id: '123', + type: OperatorTypeEnum.NESTED, + }, + }; + expect(output).toEqual(expected); + }); + + test('it returns field of type "match" with updated field if not a nested entry', () => { + const payloadItem: FormattedBuilderEntry = getMockBuilderEntry(); + const payloadIFieldType = getField('ip'); + const output = getEntryOnFieldChange(payloadItem, payloadIFieldType); + const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { + index: 0, + updatedEntry: { + field: 'ip', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH, + value: '', + }, + }; + expect(output).toEqual(expected); + }); + }); + + describe('#getEntryOnOperatorChange', () => { + test('it returns updated subentry preserving its value when entry is not switching operator types', () => { + const payloadItem: FormattedBuilderEntry = getMockBuilderEntry(); + const payloadOperator: OperatorOption = isNotOperator; + const output = getEntryOnOperatorChange(payloadItem, payloadOperator); + const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { + index: 0, + updatedEntry: { + field: 'ip', + id: '123', + operator: 'excluded', + type: OperatorTypeEnum.MATCH, + value: 'some value', + }, + }; + expect(output).toEqual(expected); + }); + + test('it returns updated subentry resetting its value when entry is switching operator types', () => { + const payloadItem: FormattedBuilderEntry = getMockBuilderEntry(); + const payloadOperator: OperatorOption = isOneOfOperator; + const output = getEntryOnOperatorChange(payloadItem, payloadOperator); + const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { + index: 0, + updatedEntry: { + field: 'ip', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH_ANY, + value: [], + }, + }; + expect(output).toEqual(expected); + }); + + test('it returns updated subentry preserving its value when entry is nested and not switching operator types', () => { + const payloadItem: FormattedBuilderEntry = getMockNestedBuilderEntry(); + const payloadOperator: OperatorOption = isNotOperator; + const output = getEntryOnOperatorChange(payloadItem, payloadOperator); + const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { + index: 0, + updatedEntry: { + entries: [ + { + field: 'child', + id: '123', + operator: OperatorEnum.EXCLUDED, + type: OperatorTypeEnum.MATCH, + value: 'some value', + }, + ], + field: 'nestedField', + id: '123', + type: OperatorTypeEnum.NESTED, + }, + }; + expect(output).toEqual(expected); + }); + + test('it returns updated subentry resetting its value when entry is nested and switching operator types', () => { + const payloadItem: FormattedBuilderEntry = getMockNestedBuilderEntry(); + const payloadOperator: OperatorOption = isOneOfOperator; + const output = getEntryOnOperatorChange(payloadItem, payloadOperator); + const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { + index: 0, + updatedEntry: { + entries: [ + { + field: 'child', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH_ANY, + value: [], + }, + ], + field: 'nestedField', + id: '123', + type: OperatorTypeEnum.NESTED, + }, + }; + expect(output).toEqual(expected); + }); + }); + + describe('#getEntryOnMatchChange', () => { + test('it returns entry with updated value', () => { + const payload: FormattedBuilderEntry = getMockBuilderEntry(); + const output = getEntryOnMatchChange(payload, 'jibber jabber'); + const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { + index: 0, + updatedEntry: { + field: 'ip', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH, + value: 'jibber jabber', + }, + }; + expect(output).toEqual(expected); + }); + + test('it returns entry with updated value and "field" of empty string if entry does not have a "field" defined', () => { + const payload: FormattedBuilderEntry = { ...getMockBuilderEntry(), field: undefined }; + const output = getEntryOnMatchChange(payload, 'jibber jabber'); + const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { + index: 0, + updatedEntry: { + field: '', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH, + value: 'jibber jabber', + }, + }; + expect(output).toEqual(expected); + }); + + test('it returns nested entry with updated value', () => { + const payload: FormattedBuilderEntry = getMockNestedBuilderEntry(); + const output = getEntryOnMatchChange(payload, 'jibber jabber'); + const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { + index: 0, + updatedEntry: { + entries: [ + { + field: 'child', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH, + value: 'jibber jabber', + }, + ], + field: 'nestedField', + id: '123', + type: OperatorTypeEnum.NESTED, + }, + }; + expect(output).toEqual(expected); + }); + + test('it returns nested entry with updated value and "field" of empty string if entry does not have a "field" defined', () => { + const payload: FormattedBuilderEntry = { ...getMockNestedBuilderEntry(), field: undefined }; + const output = getEntryOnMatchChange(payload, 'jibber jabber'); + const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { + index: 0, + updatedEntry: { + entries: [ + { + field: '', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH, + value: 'jibber jabber', + }, + ], + field: 'nestedField', + id: '123', + type: OperatorTypeEnum.NESTED, + }, + }; + expect(output).toEqual(expected); + }); + }); + + describe('#getEntryOnMatchAnyChange', () => { + test('it returns entry with updated value', () => { + const payload: FormattedBuilderEntry = { + ...getMockBuilderEntry(), + operator: isOneOfOperator, + value: ['some value'], + }; + const output = getEntryOnMatchAnyChange(payload, ['jibber jabber']); + const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { + index: 0, + updatedEntry: { + field: 'ip', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH_ANY, + value: ['jibber jabber'], + }, + }; + expect(output).toEqual(expected); + }); + + test('it returns entry with updated value and "field" of empty string if entry does not have a "field" defined', () => { + const payload: FormattedBuilderEntry = { + ...getMockBuilderEntry(), + field: undefined, + operator: isOneOfOperator, + value: ['some value'], + }; + const output = getEntryOnMatchAnyChange(payload, ['jibber jabber']); + const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { + index: 0, + updatedEntry: { + field: '', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH_ANY, + value: ['jibber jabber'], + }, + }; + expect(output).toEqual(expected); + }); + + test('it returns nested entry with updated value', () => { + const payload: FormattedBuilderEntry = { + ...getMockNestedBuilderEntry(), + parent: { + parent: { + ...getEntryNestedWithIdMock(), + entries: [{ ...getEntryMatchAnyWithIdMock(), field: 'child' }], + field: 'nestedField', + }, + parentIndex: 0, + }, + }; + const output = getEntryOnMatchAnyChange(payload, ['jibber jabber']); + const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { + index: 0, + updatedEntry: { + entries: [ + { + field: 'child', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH_ANY, + value: ['jibber jabber'], + }, + ], + field: 'nestedField', + id: '123', + type: OperatorTypeEnum.NESTED, + }, + }; + expect(output).toEqual(expected); + }); + + test('it returns nested entry with updated value and "field" of empty string if entry does not have a "field" defined', () => { + const payload: FormattedBuilderEntry = { + ...getMockNestedBuilderEntry(), + field: undefined, + parent: { + parent: { + ...getEntryNestedWithIdMock(), + entries: [{ ...getEntryMatchAnyWithIdMock(), field: 'child' }], + field: 'nestedField', + }, + parentIndex: 0, + }, + }; + const output = getEntryOnMatchAnyChange(payload, ['jibber jabber']); + const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { + index: 0, + updatedEntry: { + entries: [ + { + field: '', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH_ANY, + value: ['jibber jabber'], + }, + ], + field: 'nestedField', + id: '123', + type: OperatorTypeEnum.NESTED, + }, + }; + expect(output).toEqual(expected); + }); + }); + + describe('#getEntryOnListChange', () => { + test('it returns entry with updated value', () => { + const payload: FormattedBuilderEntry = { + ...getMockBuilderEntry(), + operator: isOneOfOperator, + value: '1234', + }; + const output = getEntryOnListChange(payload, getListResponseMock()); + const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { + index: 0, + updatedEntry: { + field: 'ip', + id: '123', + list: { id: 'some-list-id', type: 'ip' }, + operator: OperatorEnum.INCLUDED, + type: 'list', + }, + }; + expect(output).toEqual(expected); + }); + + test('it returns entry with updated value and "field" of empty string if entry does not have a "field" defined', () => { + const payload: FormattedBuilderEntry = { + ...getMockBuilderEntry(), + field: undefined, + operator: isOneOfOperator, + value: '1234', + }; + const output = getEntryOnListChange(payload, getListResponseMock()); + const expected: { updatedEntry: BuilderEntry & { id?: string }; index: number } = { + index: 0, + updatedEntry: { + field: '', + id: '123', + list: { id: 'some-list-id', type: 'ip' }, + operator: OperatorEnum.INCLUDED, + type: 'list', + }, + }; + expect(output).toEqual(expected); + }); + }); + + describe('#getFormattedBuilderEntries', () => { + test('it returns formatted entry with field undefined if it unable to find a matching index pattern field and "allowCustomFieldOptions" is "false"', () => { + const payloadIndexPattern = getMockIndexPattern(); + const payloadItems: BuilderEntry[] = [getEntryMatchWithIdMock()]; + const output = getFormattedBuilderEntries(payloadIndexPattern, payloadItems, false); + const expected: FormattedBuilderEntry[] = [ + { + correspondingKeywordField: undefined, + entryIndex: 0, + field: undefined, + id: '123', + nested: undefined, + operator: isOperator, + parent: undefined, + value: 'some host name', + }, + ]; + expect(output).toEqual(expected); + }); + + test('it returns formatted entry with field even if it is unable to find a matching index pattern field and "allowCustomFieldOptions" is "true"', () => { + const payloadIndexPattern = getMockIndexPattern(); + const payloadItems: BuilderEntry[] = [getEntryMatchWithIdMock()]; + const output = getFormattedBuilderEntries(payloadIndexPattern, payloadItems, true); + const expected: FormattedBuilderEntry[] = [ + { + correspondingKeywordField: undefined, + entryIndex: 0, + field: { + name: 'host.name', + type: 'keyword', + }, + id: '123', + nested: undefined, + operator: isOperator, + parent: undefined, + value: 'some host name', + }, + ]; + expect(output).toEqual(expected); + }); + + test('it returns formatted entries when no nested entries exist', () => { + const payloadIndexPattern = getMockIndexPattern(); + const payloadItems: BuilderEntry[] = [ + { ...getEntryMatchWithIdMock(), field: 'ip', value: 'some ip' }, + { ...getEntryMatchAnyWithIdMock(), field: 'extension', value: ['some extension'] }, + ]; + const output = getFormattedBuilderEntries(payloadIndexPattern, payloadItems, false); + const field1: FieldSpec = { + aggregatable: true, + count: 0, + esTypes: ['ip'], + name: 'ip', + readFromDocValues: true, + scripted: false, + searchable: true, + type: 'ip', + }; + const field2: FieldSpec = { + aggregatable: true, + count: 0, + esTypes: ['keyword'], + name: 'extension', + readFromDocValues: true, + scripted: false, + searchable: true, + type: 'string', + }; + const expected: FormattedBuilderEntry[] = [ + { + correspondingKeywordField: undefined, + entryIndex: 0, + field: field1, + id: '123', + nested: undefined, + operator: isOperator, + parent: undefined, + value: 'some ip', + }, + { + correspondingKeywordField: undefined, + entryIndex: 1, + field: field2, + id: '123', + nested: undefined, + operator: isOneOfOperator, + parent: undefined, + value: ['some extension'], + }, + ]; + expect(output).toEqual(expected); + }); + + test('it returns formatted entries when nested entries exist', () => { + const payloadIndexPattern = getMockIndexPattern(); + const payloadParent: EntryNested = { + ...getEntryNestedWithIdMock(), + entries: [{ ...getEntryMatchWithIdMock(), field: 'child' }], + field: 'nestedField', + }; + const payloadItems: BuilderEntry[] = [ + { ...getEntryMatchWithIdMock(), field: 'ip', value: 'some ip' }, + { ...payloadParent }, + ]; + + const output = getFormattedBuilderEntries(payloadIndexPattern, payloadItems, false); + const field1: FieldSpec = { + aggregatable: true, + count: 0, + esTypes: ['ip'], + name: 'ip', + readFromDocValues: true, + scripted: false, + searchable: true, + type: 'ip', + }; + const field2: FieldSpec = { + aggregatable: false, + esTypes: ['nested'], + name: 'nestedField', + searchable: false, + type: 'string', + }; + const field3: FieldSpec = { + aggregatable: false, + count: 0, + esTypes: ['text'], + name: 'child', + readFromDocValues: false, + scripted: false, + searchable: true, + subType: { + nested: { + path: 'nestedField', + }, + }, + type: 'string', + }; + const expected: FormattedBuilderEntry[] = [ + { + correspondingKeywordField: undefined, + entryIndex: 0, + field: field1, + id: '123', + nested: undefined, + operator: isOperator, + parent: undefined, + value: 'some ip', + }, + { + correspondingKeywordField: undefined, + entryIndex: 1, + field: field2, + id: '123', + nested: 'parent', + operator: isOperator, + parent: undefined, + value: undefined, + }, + { + correspondingKeywordField: undefined, + entryIndex: 0, + field: field3, + id: '123', + nested: 'child', + operator: isOperator, + parent: { + parent: { + entries: [ + { + field: 'child', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH, + value: 'some host name', + }, + ], + field: 'nestedField', + id: '123', + type: OperatorTypeEnum.NESTED, + }, + parentIndex: 1, + }, + value: 'some host name', + }, + ]; + expect(output).toEqual(expected); + }); + }); + + describe('#getUpdatedEntriesOnDelete', () => { + test('it removes entry corresponding to "entryIndex"', () => { + const payloadItem: ExceptionsBuilderExceptionItem = { + ...getExceptionListItemSchemaMock(), + entries: ENTRIES_WITH_IDS, + }; + const output = getUpdatedEntriesOnDelete(payloadItem, 0, null); + const expected: ExceptionsBuilderExceptionItem = { + ...getExceptionListItemSchemaMock(), + entries: [ + { + field: 'some.not.nested.field', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH, + value: 'some value', + }, + ], + }; + expect(output).toEqual(expected); + }); + + test('it removes nested entry of "entryIndex" with corresponding parent index', () => { + const payloadItem: ExceptionsBuilderExceptionItem = { + ...getExceptionListItemSchemaMock(), + entries: [ + { + ...getEntryNestedWithIdMock(), + entries: [{ ...getEntryExistsWithIdMock() }, { ...getEntryMatchAnyWithIdMock() }], + }, + ], + }; + const output = getUpdatedEntriesOnDelete(payloadItem, 0, 0); + const expected: ExceptionsBuilderExceptionItem = { + ...getExceptionListItemSchemaMock(), + entries: [ + { ...getEntryNestedWithIdMock(), entries: [{ ...getEntryMatchAnyWithIdMock() }] }, + ], + }; + expect(output).toEqual(expected); + }); + + test('it removes entire nested entry if after deleting specified nested entry, there are no more nested entries left', () => { + const payloadItem: ExceptionsBuilderExceptionItem = { + ...getExceptionListItemSchemaMock(), + entries: [ + { + ...getEntryNestedWithIdMock(), + entries: [{ ...getEntryExistsWithIdMock() }], + }, + ], + }; + const output = getUpdatedEntriesOnDelete(payloadItem, 0, 0); + const expected: ExceptionsBuilderExceptionItem = { + ...getExceptionListItemSchemaMock(), + entries: [], + }; + expect(output).toEqual(expected); + }); + }); + + describe('#getFormattedBuilderEntry', () => { + test('it returns entry with a value for "correspondingKeywordField" when "item.field" is of type "text" and matching keyword field exists', () => { + const payloadIndexPattern: DataViewBase = { + ...getMockIndexPattern(), + fields: [ + ...fields, + { + aggregatable: false, + count: 0, + esTypes: ['text'], + name: 'machine.os.raw.text', + readFromDocValues: true, + scripted: false, + searchable: false, + type: 'string', + }, + ], + }; + const payloadItem: BuilderEntry = { + ...getEntryMatchWithIdMock(), + field: 'machine.os.raw.text', + value: 'some os', + }; + const output = getFormattedBuilderEntry( + payloadIndexPattern, + payloadItem, + 0, + undefined, + undefined, + false + ); + const field: FieldSpec = { + aggregatable: false, + count: 0, + esTypes: ['text'], + name: 'machine.os.raw.text', + readFromDocValues: true, + scripted: false, + searchable: false, + type: 'string', + }; + const expected: FormattedBuilderEntry = { + correspondingKeywordField: getField('machine.os.raw'), + entryIndex: 0, + field, + id: '123', + nested: undefined, + operator: isOperator, + parent: undefined, + value: 'some os', + }; + expect(output).toEqual(expected); + }); + + test('it returns entry with field value undefined if "allowCustomFieldOptions" is "false" and no matching field found', () => { + const payloadIndexPattern: DataViewBase = { + ...getMockIndexPattern(), + fields: [ + ...fields, + { + aggregatable: false, + count: 0, + esTypes: ['text'], + name: 'machine.os.raw.text', + readFromDocValues: true, + scripted: false, + searchable: false, + type: 'string', + }, + ], + }; + const payloadItem: BuilderEntry = { + ...getEntryMatchWithIdMock(), + field: 'custom.text', + value: 'some os', + }; + const output = getFormattedBuilderEntry( + payloadIndexPattern, + payloadItem, + 0, + undefined, + undefined, + false + ); + const expected: FormattedBuilderEntry = { + correspondingKeywordField: undefined, + entryIndex: 0, + field: undefined, + id: '123', + nested: undefined, + operator: isOperator, + parent: undefined, + value: 'some os', + }; + expect(output).toEqual(expected); + }); + + test('it returns entry with custom field value if "allowCustomFieldOptions" is "true" and no matching field found', () => { + const payloadIndexPattern: DataViewBase = { + ...getMockIndexPattern(), + fields: [ + ...fields, + { + aggregatable: false, + count: 0, + esTypes: ['text'], + name: 'machine.os.raw.text', + readFromDocValues: true, + scripted: false, + searchable: false, + type: 'string', + }, + ], + }; + const payloadItem: BuilderEntry = { + ...getEntryMatchWithIdMock(), + field: 'custom.text', + value: 'some os', + }; + const output = getFormattedBuilderEntry( + payloadIndexPattern, + payloadItem, + 0, + undefined, + undefined, + true + ); + const expected: FormattedBuilderEntry = { + correspondingKeywordField: undefined, + entryIndex: 0, + field: { + name: 'custom.text', + type: 'keyword', + }, + id: '123', + nested: undefined, + operator: isOperator, + parent: undefined, + value: 'some os', + }; + expect(output).toEqual(expected); + }); + + test('it returns "FormattedBuilderEntry" with value "nested" of "child" when "parent" and "parentIndex" are defined', () => { + const payloadIndexPattern = getMockIndexPattern(); + const payloadItem: BuilderEntry = { ...getEntryMatchWithIdMock(), field: 'child' }; + const payloadParent: EntryNested = { + ...getEntryNestedWithIdMock(), + entries: [{ ...getEntryMatchWithIdMock(), field: 'child' }], + field: 'nestedField', + }; + const output = getFormattedBuilderEntry( + payloadIndexPattern, + payloadItem, + 0, + payloadParent, + 1, + false + ); + const field: FieldSpec = { + aggregatable: false, + count: 0, + esTypes: ['text'], + name: 'child', + readFromDocValues: false, + scripted: false, + searchable: true, + subType: { + nested: { + path: 'nestedField', + }, + }, + type: 'string', + }; + const expected: FormattedBuilderEntry = { + correspondingKeywordField: undefined, + entryIndex: 0, + field, + id: '123', + nested: 'child', + operator: isOperator, + parent: { + parent: { + entries: [{ ...payloadItem }], + field: 'nestedField', + id: '123', + type: OperatorTypeEnum.NESTED, + }, + parentIndex: 1, + }, + value: 'some host name', + }; + expect(output).toEqual(expected); + }); + + test('it returns non nested "FormattedBuilderEntry" when "parent" and "parentIndex" are not defined', () => { + const payloadIndexPattern = getMockIndexPattern(); + const payloadItem: BuilderEntry = { + ...getEntryMatchWithIdMock(), + field: 'ip', + value: 'some ip', + }; + const output = getFormattedBuilderEntry( + payloadIndexPattern, + payloadItem, + 0, + undefined, + undefined, + false + ); + const field: FieldSpec = { + aggregatable: true, + count: 0, + esTypes: ['ip'], + name: 'ip', + readFromDocValues: true, + scripted: false, + searchable: true, + type: 'ip', + }; + const expected: FormattedBuilderEntry = { + correspondingKeywordField: undefined, + entryIndex: 0, + field, + id: '123', + nested: undefined, + operator: isOperator, + parent: undefined, + value: 'some ip', + }; + expect(output).toEqual(expected); + }); + }); + + describe('#isEntryNested', () => { + test('it returns "false" if payload is not of type EntryNested', () => { + const payload: BuilderEntry = getEntryMatchWithIdMock(); + const output = isEntryNested(payload); + const expected = false; + expect(output).toEqual(expected); + }); + + test('it returns "true if payload is of type EntryNested', () => { + const payload: EntryNested = getEntryNestedWithIdMock(); + const output = isEntryNested(payload); + const expected = true; + expect(output).toEqual(expected); + }); + }); + + describe('#getCorrespondingKeywordField', () => { + test('it returns matching keyword field if "selectedFieldIsTextType" is true and keyword field exists', () => { + const output = getCorrespondingKeywordField({ + fields, + selectedField: 'machine.os.raw.text', + }); + + expect(output).toEqual(getField('machine.os.raw')); + }); + + test('it returns undefined if "selectedFieldIsTextType" is false', () => { + const output = getCorrespondingKeywordField({ + fields, + selectedField: 'machine.os.raw', + }); + + expect(output).toEqual(undefined); + }); + + test('it returns undefined if "selectedField" is empty string', () => { + const output = getCorrespondingKeywordField({ + fields, + selectedField: '', + }); + + expect(output).toEqual(undefined); + }); + + test('it returns undefined if "selectedField" is undefined', () => { + const output = getCorrespondingKeywordField({ + fields, + selectedField: undefined, + }); + + expect(output).toEqual(undefined); + }); + }); + + describe('#getOperatorType', () => { + test('returns operator type "match" if entry.type is "match"', () => { + const payload = getEntryMatchMock(); + const operatorType = getOperatorType(payload); + + expect(operatorType).toEqual(OperatorTypeEnum.MATCH); + }); + + test('returns operator type "match_any" if entry.type is "match_any"', () => { + const payload = getEntryMatchAnyMock(); + const operatorType = getOperatorType(payload); + + expect(operatorType).toEqual(OperatorTypeEnum.MATCH_ANY); + }); + + test('returns operator type "list" if entry.type is "list"', () => { + const payload = getEntryListMock(); + const operatorType = getOperatorType(payload); + + expect(operatorType).toEqual(OperatorTypeEnum.LIST); + }); + + test('returns operator type "exists" if entry.type is "exists"', () => { + const payload = getEntryExistsMock(); + const operatorType = getOperatorType(payload); + + expect(operatorType).toEqual(OperatorTypeEnum.EXISTS); + }); + }); + + describe('#getExceptionOperatorSelect', () => { + test('it returns "isOperator" when "operator" is "included" and operator type is "match"', () => { + const payload = getEntryMatchMock(); + const result = getExceptionOperatorSelect(payload); + + expect(result).toEqual(isOperator); + }); + + test('it returns "isNotOperator" when "operator" is "excluded" and operator type is "match"', () => { + const payload = getEntryMatchMock(); + payload.operator = 'excluded'; + const result = getExceptionOperatorSelect(payload); + + expect(result).toEqual(isNotOperator); + }); + + test('it returns "isOneOfOperator" when "operator" is "included" and operator type is "match_any"', () => { + const payload = getEntryMatchAnyMock(); + const result = getExceptionOperatorSelect(payload); + + expect(result).toEqual(isOneOfOperator); + }); + + test('it returns "isNotOneOfOperator" when "operator" is "excluded" and operator type is "match_any"', () => { + const payload = getEntryMatchAnyMock(); + payload.operator = 'excluded'; + const result = getExceptionOperatorSelect(payload); + + expect(result).toEqual(isNotOneOfOperator); + }); + + test('it returns "existsOperator" when "operator" is "included" and no operator type is provided', () => { + const payload = getEntryExistsMock(); + const result = getExceptionOperatorSelect(payload); + + expect(result).toEqual(existsOperator); + }); + + test('it returns "doesNotExistsOperator" when "operator" is "excluded" and no operator type is provided', () => { + const payload = getEntryExistsMock(); + payload.operator = 'excluded'; + const result = getExceptionOperatorSelect(payload); + + expect(result).toEqual(doesNotExistOperator); + }); + + test('it returns "isInList" when "operator" is "included" and operator type is "list"', () => { + const payload = getEntryListMock(); + const result = getExceptionOperatorSelect(payload); + + expect(result).toEqual(isInListOperator); + }); + + test('it returns "isNotInList" when "operator" is "excluded" and operator type is "list"', () => { + const payload = getEntryListMock(); + payload.operator = 'excluded'; + const result = getExceptionOperatorSelect(payload); + + expect(result).toEqual(isNotInListOperator); + }); + }); + + describe('#filterExceptionItems', () => { + // Please see `x-pack/solutions/security/plugins/lists/public/exceptions/transforms.ts` doc notes + // for context around the temporary `id` + test('it correctly validates entries that include a temporary `id`', () => { + const output: ExceptionsBuilderReturnExceptionItem[] = filterExceptionItems([ + { ...getExceptionListItemSchemaMock(), entries: ENTRIES_WITH_IDS }, + ]); + + expect(output).toEqual([{ ...getExceptionListItemSchemaMock(), entries: ENTRIES_WITH_IDS }]); + }); + + test('it removes entry items with "value" of "undefined"', () => { + const { entries, ...rest } = getExceptionListItemSchemaMock(); + const mockEmptyException: EmptyEntry = { + field: 'host.name', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH, + value: undefined, + }; + const exceptions = filterExceptionItems([ + { + ...rest, + entries: [...entries, mockEmptyException], + }, + ]); + + expect(exceptions).toEqual([getExceptionListItemSchemaMock()]); + }); + + test('it removes "match" entry items with "value" of empty string', () => { + const { entries, ...rest } = { ...getExceptionListItemSchemaMock() }; + const mockEmptyException: EmptyEntry = { + field: 'host.name', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH, + value: '', + }; + const output: ExceptionsBuilderReturnExceptionItem[] = filterExceptionItems([ + { + ...rest, + entries: [...entries, mockEmptyException], + }, + ]); + + expect(output).toEqual([{ ...getExceptionListItemSchemaMock() }]); + }); + + test('it removes "match" entry items with "field" of empty string', () => { + const { entries, ...rest } = { ...getExceptionListItemSchemaMock() }; + const mockEmptyException: EmptyEntry = { + field: '', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH, + value: 'some value', + }; + const output: ExceptionsBuilderReturnExceptionItem[] = filterExceptionItems([ + { + ...rest, + entries: [...entries, mockEmptyException], + }, + ]); + + expect(output).toEqual([{ ...getExceptionListItemSchemaMock() }]); + }); + + test('it removes "match_any" entry items with "field" of empty string', () => { + const { entries, ...rest } = { ...getExceptionListItemSchemaMock() }; + const mockEmptyException: EmptyEntry = { + field: '', + id: '123', + operator: OperatorEnum.INCLUDED, + type: OperatorTypeEnum.MATCH_ANY, + value: ['some value'], + }; + const output: ExceptionsBuilderReturnExceptionItem[] = filterExceptionItems([ + { + ...rest, + entries: [...entries, mockEmptyException], + }, + ]); + + expect(output).toEqual([{ ...getExceptionListItemSchemaMock() }]); + }); + + test('it removes "nested" entry items with "field" of empty string', () => { + const { entries, ...rest } = { ...getExceptionListItemSchemaMock() }; + const mockEmptyException: EntryNested = { + entries: [getEntryMatchMock()], + field: '', + type: OperatorTypeEnum.NESTED, + }; + const output: ExceptionsBuilderReturnExceptionItem[] = filterExceptionItems([ + { + ...rest, + entries: [...entries, mockEmptyException], + }, + ]); + + expect(output).toEqual([{ ...getExceptionListItemSchemaMock() }]); + }); + + test('it removes the "nested" entry entries with "value" of empty string', () => { + const { entries, ...rest } = { ...getExceptionListItemSchemaMock() }; + const mockEmptyException: EntryNested = { + entries: [getEntryMatchMock(), { ...getEntryMatchMock(), value: '' }], + field: 'host.name', + type: OperatorTypeEnum.NESTED, + }; + const output: ExceptionsBuilderReturnExceptionItem[] = filterExceptionItems([ + { + ...rest, + entries: [...entries, mockEmptyException], + }, + ]); + + expect(output).toEqual([ + { + ...getExceptionListItemSchemaMock(), + entries: [ + ...getExceptionListItemSchemaMock().entries, + { ...mockEmptyException, entries: [getEntryMatchMock()] }, + ], + }, + ]); + }); + + test('it removes the "nested" entry item if all its entries are invalid', () => { + const { entries, ...rest } = { ...getExceptionListItemSchemaMock() }; + const mockEmptyException: EntryNested = { + entries: [{ ...getEntryMatchMock(), value: '' }], + field: 'host.name', + type: OperatorTypeEnum.NESTED, + }; + const output: ExceptionsBuilderReturnExceptionItem[] = filterExceptionItems([ + { + ...rest, + entries: [...entries, mockEmptyException], + }, + ]); + + expect(output).toEqual([{ ...getExceptionListItemSchemaMock() }]); + }); + + test('it removes `temporaryId` from "createExceptionListItemSchema" items', () => { + const { meta, ...rest } = getNewExceptionItem({ + listId: '123', + name: 'rule name', + namespaceType: 'single', + }); + const exceptions = filterExceptionItems([{ ...rest, entries: [getEntryMatchMock()], meta }]); + + expect(exceptions).toEqual([{ ...rest, entries: [getEntryMatchMock()], meta: undefined }]); + }); + + test('it removes `temporaryId` from "createRuleExceptionListItemSchema" items', () => { + const { meta, ...rest } = getNewExceptionItem({ + listId: undefined, + name: 'rule name', + namespaceType: undefined, + }); + const exceptions = filterExceptionItems([{ ...rest, entries: [getEntryMatchMock()], meta }]); + + expect(exceptions).toEqual([{ ...rest, entries: [getEntryMatchMock()], meta: undefined }]); + }); + }); + + describe('#getNewExceptionItem', () => { + it('returns new item with updated name', () => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { meta, ...rest } = getNewExceptionItem({ + listId: '123', + name: 'My Item Name', + namespaceType: 'single', + }); + + expect(rest.name).toEqual('My Item Name'); + }); + + it('returns new item with list_id if one is passed in', () => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { meta, ...rest } = getNewExceptionItem({ + listId: '123', + name: 'My Item Name', + namespaceType: 'single', + }); + + expect(rest).toEqual({ + comments: [], + description: 'Exception list item', + entries: [{ field: '', id: '123', operator: 'included', type: 'match', value: '' }], + item_id: undefined, + list_id: '123', + name: 'My Item Name', + namespace_type: 'single', + tags: [], + type: 'simple', + }); + }); + + it('returns new item without list_id if none is passed in', () => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { meta, ...rest } = getNewExceptionItem({ + listId: undefined, + name: 'My Item Name', + namespaceType: 'single', + }); + + expect(rest).toEqual({ + comments: [], + description: 'Exception list item', + entries: [{ field: '', id: '123', operator: 'included', type: 'match', value: '' }], + item_id: undefined, + list_id: undefined, + name: 'My Item Name', + namespace_type: 'single', + tags: [], + type: 'simple', + }); + }); + + it('returns new item with namespace_type if one is passed in', () => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { meta, ...rest } = getNewExceptionItem({ + listId: '123', + name: 'My Item Name', + namespaceType: 'single', + }); + + expect(rest).toEqual({ + comments: [], + description: 'Exception list item', + entries: [{ field: '', id: '123', operator: 'included', type: 'match', value: '' }], + item_id: undefined, + list_id: '123', + name: 'My Item Name', + namespace_type: 'single', + tags: [], + type: 'simple', + }); + }); + + it('returns new item without namespace_type if none is passed in', () => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { meta, ...rest } = getNewExceptionItem({ + listId: '123', + name: 'My Item Name', + namespaceType: undefined, + }); + + expect(rest).toEqual({ + comments: [], + description: 'Exception list item', + entries: [{ field: '', id: '123', operator: 'included', type: 'match', value: '' }], + item_id: undefined, + list_id: '123', + name: 'My Item Name', + namespace_type: undefined, + tags: [], + type: 'simple', + }); + }); + }); + + describe('#getEntryValue', () => { + it('returns "match" entry value', () => { + const payload = getEntryMatchMock(); + const result = getEntryValue(payload); + const expected = 'some host name'; + expect(result).toEqual(expected); + }); + + it('returns "match any" entry values', () => { + const payload = getEntryMatchAnyMock(); + const result = getEntryValue(payload); + const expected = ['some host name']; + expect(result).toEqual(expected); + }); + + it('returns "exists" entry value', () => { + const payload = getEntryExistsMock(); + const result = getEntryValue(payload); + const expected = undefined; + expect(result).toEqual(expected); + }); + + it('returns "list" entry value', () => { + const payload = getEntryListMock(); + const result = getEntryValue(payload); + const expected = 'some-list-id'; + expect(result).toEqual(expected); + }); + }); +}); diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/index.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/index.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/builder/index.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/index.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/logic_buttons.test.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/logic_buttons.test.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/builder/logic_buttons.test.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/logic_buttons.test.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/logic_buttons.tsx b/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/logic_buttons.tsx similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/builder/logic_buttons.tsx rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/logic_buttons.tsx diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/reducer.ts b/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/reducer.ts similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/builder/reducer.ts rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/reducer.ts diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/selectors.ts b/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/selectors.ts similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/builder/selectors.ts rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/selectors.ts diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/translations.ts b/x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/translations.ts similarity index 100% rename from x-pack/plugins/lists/public/exceptions/components/builder/translations.ts rename to x-pack/solutions/security/plugins/lists/public/exceptions/components/builder/translations.ts diff --git a/x-pack/plugins/lists/public/exceptions/hooks/persist_exception_item.test.ts b/x-pack/solutions/security/plugins/lists/public/exceptions/hooks/persist_exception_item.test.ts similarity index 96% rename from x-pack/plugins/lists/public/exceptions/hooks/persist_exception_item.test.ts rename to x-pack/solutions/security/plugins/lists/public/exceptions/hooks/persist_exception_item.test.ts index 95ca6285f0d74..029488f850d43 100644 --- a/x-pack/plugins/lists/public/exceptions/hooks/persist_exception_item.test.ts +++ b/x-pack/solutions/security/plugins/lists/public/exceptions/hooks/persist_exception_item.test.ts @@ -17,7 +17,7 @@ import { getExceptionListItemSchemaMock } from '../../../common/schemas/response const mockKibanaHttpService = coreMock.createStart().http; -// TODO: Port this test over to packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.test.ts once the other mocks are added to the kbn package system +// TODO: Port this test over to x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.test.ts once the other mocks are added to the kbn package system describe('usePersistExceptionItem', () => { let addExceptionListItemSpy: jest.SpyInstance<ReturnType<typeof api.addEndpointExceptionList>>; diff --git a/x-pack/plugins/lists/public/exceptions/hooks/persist_exception_list.test.ts b/x-pack/solutions/security/plugins/lists/public/exceptions/hooks/persist_exception_list.test.ts similarity index 95% rename from x-pack/plugins/lists/public/exceptions/hooks/persist_exception_list.test.ts rename to x-pack/solutions/security/plugins/lists/public/exceptions/hooks/persist_exception_list.test.ts index c27888b6d8cc6..159426d711601 100644 --- a/x-pack/plugins/lists/public/exceptions/hooks/persist_exception_list.test.ts +++ b/x-pack/solutions/security/plugins/lists/public/exceptions/hooks/persist_exception_list.test.ts @@ -18,7 +18,7 @@ const mockKibanaHttpService = coreMock.createStart().http; jest.mock('@kbn/securitysolution-list-api'); -// TODO: Port this to the kbn package of: packages/kbn-securitysolution-list-hooks/src/use_persist_exception_list/index.test.ts once the kibana mocks are ported +// TODO: Port this to the kbn package of: x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_list/index.test.ts once the kibana mocks are ported describe('usePersistExceptionList', () => { const onError = jest.fn(); diff --git a/x-pack/plugins/lists/public/exceptions/hooks/use_api.test.ts b/x-pack/solutions/security/plugins/lists/public/exceptions/hooks/use_api.test.ts similarity index 99% rename from x-pack/plugins/lists/public/exceptions/hooks/use_api.test.ts rename to x-pack/solutions/security/plugins/lists/public/exceptions/hooks/use_api.test.ts index a980261ba5f86..2ceaab63cc044 100644 --- a/x-pack/plugins/lists/public/exceptions/hooks/use_api.test.ts +++ b/x-pack/solutions/security/plugins/lists/public/exceptions/hooks/use_api.test.ts @@ -32,7 +32,7 @@ jest.mock('uuid', () => ({ const mockKibanaHttpService = coreMock.createStart().http; -// TODO: Once the mocks are figured out and the types are moved into kbn core this test should be moved next to the file: packages/kbn-securitysolution-list-hooks/src/use_api/index.test.ts +// TODO: Once the mocks are figured out and the types are moved into kbn core this test should be moved next to the file: x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_api/index.test.ts describe('useApi', () => { const onErrorMock = jest.fn(); diff --git a/x-pack/plugins/lists/public/exceptions/hooks/use_exception_lists.test.ts b/x-pack/solutions/security/plugins/lists/public/exceptions/hooks/use_exception_lists.test.ts similarity index 97% rename from x-pack/plugins/lists/public/exceptions/hooks/use_exception_lists.test.ts rename to x-pack/solutions/security/plugins/lists/public/exceptions/hooks/use_exception_lists.test.ts index 6c684d199e538..db01cc54e855f 100644 --- a/x-pack/plugins/lists/public/exceptions/hooks/use_exception_lists.test.ts +++ b/x-pack/solutions/security/plugins/lists/public/exceptions/hooks/use_exception_lists.test.ts @@ -20,7 +20,7 @@ const mockKibanaHttpService = coreMock.createStart().http; const mockKibanaNotificationsService = coreMock.createStart().notifications; jest.mock('@kbn/securitysolution-list-api'); -// TODO: Move this test to the kbn package: packages/kbn-securitysolution-list-hooks/src/use_exception_lists/index.test.ts once mocks are ported over +// TODO: Move this test to the kbn package: x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_exception_lists/index.test.ts once mocks are ported over describe('useExceptionLists', () => { beforeEach(() => { diff --git a/x-pack/plugins/lists/public/exceptions/transforms.test.ts b/x-pack/solutions/security/plugins/lists/public/exceptions/transforms.test.ts similarity index 100% rename from x-pack/plugins/lists/public/exceptions/transforms.test.ts rename to x-pack/solutions/security/plugins/lists/public/exceptions/transforms.test.ts diff --git a/x-pack/plugins/lists/public/index.ts b/x-pack/solutions/security/plugins/lists/public/index.ts similarity index 100% rename from x-pack/plugins/lists/public/index.ts rename to x-pack/solutions/security/plugins/lists/public/index.ts diff --git a/x-pack/plugins/lists/public/lists/hooks/use_create_list_index.test.ts b/x-pack/solutions/security/plugins/lists/public/lists/hooks/use_create_list_index.test.ts similarity index 93% rename from x-pack/plugins/lists/public/lists/hooks/use_create_list_index.test.ts rename to x-pack/solutions/security/plugins/lists/public/lists/hooks/use_create_list_index.test.ts index 7021d49940f26..806d8b6337088 100644 --- a/x-pack/plugins/lists/public/lists/hooks/use_create_list_index.test.ts +++ b/x-pack/solutions/security/plugins/lists/public/lists/hooks/use_create_list_index.test.ts @@ -15,7 +15,7 @@ import { createQueryWrapperMock } from '../mocks/query_wrapper'; jest.mock('@kbn/securitysolution-list-api'); -// TODO: This test should be ported to the package: packages/kbn-securitysolution-list-hooks/src/use_create_list_index/index.test.ts once we have mocks in kbn packages +// TODO: This test should be ported to the package: x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_create_list_index/index.test.ts once we have mocks in kbn packages const { wrapper: queryWrapper, queryClient } = createQueryWrapperMock(); diff --git a/x-pack/plugins/lists/public/lists/hooks/use_delete_list.test.ts b/x-pack/solutions/security/plugins/lists/public/lists/hooks/use_delete_list.test.ts similarity index 86% rename from x-pack/plugins/lists/public/lists/hooks/use_delete_list.test.ts rename to x-pack/solutions/security/plugins/lists/public/lists/hooks/use_delete_list.test.ts index 7a339f3e12a4a..72276e7c474de 100644 --- a/x-pack/plugins/lists/public/lists/hooks/use_delete_list.test.ts +++ b/x-pack/solutions/security/plugins/lists/public/lists/hooks/use_delete_list.test.ts @@ -14,7 +14,7 @@ import { getListResponseMock } from '../../../common/schemas/response/list_schem jest.mock('@kbn/securitysolution-list-api'); -// TODO: This test should be ported to the package: packages/kbn-securitysolution-list-hooks/src/use_delete_list/index.test.ts once we have mocks in kbn packages +// TODO: This test should be ported to the package: x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_delete_list/index.test.ts once we have mocks in kbn packages describe('useDeleteList', () => { let httpMock: ReturnType<typeof httpServiceMock.createStartContract>; diff --git a/x-pack/plugins/lists/public/lists/hooks/use_export_list.test.ts b/x-pack/solutions/security/plugins/lists/public/lists/hooks/use_export_list.test.ts similarity index 86% rename from x-pack/plugins/lists/public/lists/hooks/use_export_list.test.ts rename to x-pack/solutions/security/plugins/lists/public/lists/hooks/use_export_list.test.ts index 8f08ad5c8bd03..6cafd4958f7a7 100644 --- a/x-pack/plugins/lists/public/lists/hooks/use_export_list.test.ts +++ b/x-pack/solutions/security/plugins/lists/public/lists/hooks/use_export_list.test.ts @@ -12,7 +12,7 @@ import { httpServiceMock } from '@kbn/core/public/mocks'; jest.mock('@kbn/securitysolution-list-api'); -// TODO: Move this test to the kbn package: packages/kbn-securitysolution-list-hooks/src/use_export_list/index.ts once Mocks are ported from Kibana +// TODO: Move this test to the kbn package: x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_export_list/index.ts once Mocks are ported from Kibana describe('useExportList', () => { let httpMock: ReturnType<typeof httpServiceMock.createStartContract>; diff --git a/x-pack/plugins/lists/public/lists/hooks/use_import_list.test.ts b/x-pack/solutions/security/plugins/lists/public/lists/hooks/use_import_list.test.ts similarity index 94% rename from x-pack/plugins/lists/public/lists/hooks/use_import_list.test.ts rename to x-pack/solutions/security/plugins/lists/public/lists/hooks/use_import_list.test.ts index d56478a0321be..00a3a39f1f1aa 100644 --- a/x-pack/plugins/lists/public/lists/hooks/use_import_list.test.ts +++ b/x-pack/solutions/security/plugins/lists/public/lists/hooks/use_import_list.test.ts @@ -14,7 +14,7 @@ import { getListResponseMock } from '../../../common/schemas/response/list_schem jest.mock('@kbn/securitysolution-list-api'); -// TODO: Port this test over to: packages/kbn-securitysolution-list-hooks/src/use_import_list/index.ts once mocks are moved to packages +// TODO: Port this test over to: x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_import_list/index.ts once mocks are moved to packages describe('useImportList', () => { let httpMock: ReturnType<typeof httpServiceMock.createStartContract>; diff --git a/x-pack/plugins/lists/public/lists/hooks/use_read_list_index.test.ts b/x-pack/solutions/security/plugins/lists/public/lists/hooks/use_read_list_index.test.ts similarity index 91% rename from x-pack/plugins/lists/public/lists/hooks/use_read_list_index.test.ts rename to x-pack/solutions/security/plugins/lists/public/lists/hooks/use_read_list_index.test.ts index 643ac2df5b05b..cd36b6d531061 100644 --- a/x-pack/plugins/lists/public/lists/hooks/use_read_list_index.test.ts +++ b/x-pack/solutions/security/plugins/lists/public/lists/hooks/use_read_list_index.test.ts @@ -17,7 +17,7 @@ jest.mock('@kbn/securitysolution-list-api'); const { wrapper: queryWrapper } = createQueryWrapperMock(); -// TODO: Port this code over to the package: packages/kbn-securitysolution-list-hooks/src/use_read_list_index/index.test.ts once kibana has mocks in packages +// TODO: Port this code over to the package: x-pack/solutions/security/packages/kbn-securitysolution-list-hooks/src/use_read_list_index/index.test.ts once kibana has mocks in packages // FLAKY: https://github.com/elastic/kibana/issues/178026 describe.skip('useReadListIndex', () => { diff --git a/x-pack/plugins/lists/public/lists/mocks/query_wrapper.tsx b/x-pack/solutions/security/plugins/lists/public/lists/mocks/query_wrapper.tsx similarity index 100% rename from x-pack/plugins/lists/public/lists/mocks/query_wrapper.tsx rename to x-pack/solutions/security/plugins/lists/public/lists/mocks/query_wrapper.tsx diff --git a/x-pack/plugins/lists/public/lists/types.ts b/x-pack/solutions/security/plugins/lists/public/lists/types.ts similarity index 100% rename from x-pack/plugins/lists/public/lists/types.ts rename to x-pack/solutions/security/plugins/lists/public/lists/types.ts diff --git a/x-pack/plugins/lists/public/plugin.ts b/x-pack/solutions/security/plugins/lists/public/plugin.ts similarity index 100% rename from x-pack/plugins/lists/public/plugin.ts rename to x-pack/solutions/security/plugins/lists/public/plugin.ts diff --git a/x-pack/plugins/lists/public/shared_exports.ts b/x-pack/solutions/security/plugins/lists/public/shared_exports.ts similarity index 100% rename from x-pack/plugins/lists/public/shared_exports.ts rename to x-pack/solutions/security/plugins/lists/public/shared_exports.ts diff --git a/x-pack/plugins/lists/public/types.ts b/x-pack/solutions/security/plugins/lists/public/types.ts similarity index 100% rename from x-pack/plugins/lists/public/types.ts rename to x-pack/solutions/security/plugins/lists/public/types.ts diff --git a/x-pack/plugins/lists/scripts/storybook.js b/x-pack/solutions/security/plugins/lists/scripts/storybook.js similarity index 100% rename from x-pack/plugins/lists/scripts/storybook.js rename to x-pack/solutions/security/plugins/lists/scripts/storybook.js diff --git a/x-pack/plugins/lists/server/config.mock.ts b/x-pack/solutions/security/plugins/lists/server/config.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/config.mock.ts rename to x-pack/solutions/security/plugins/lists/server/config.mock.ts diff --git a/x-pack/plugins/lists/server/config.test.ts b/x-pack/solutions/security/plugins/lists/server/config.test.ts similarity index 100% rename from x-pack/plugins/lists/server/config.test.ts rename to x-pack/solutions/security/plugins/lists/server/config.test.ts diff --git a/x-pack/plugins/lists/server/config.ts b/x-pack/solutions/security/plugins/lists/server/config.ts similarity index 100% rename from x-pack/plugins/lists/server/config.ts rename to x-pack/solutions/security/plugins/lists/server/config.ts diff --git a/x-pack/plugins/lists/server/error_with_status_code.ts b/x-pack/solutions/security/plugins/lists/server/error_with_status_code.ts similarity index 100% rename from x-pack/plugins/lists/server/error_with_status_code.ts rename to x-pack/solutions/security/plugins/lists/server/error_with_status_code.ts diff --git a/x-pack/plugins/lists/server/get_space_id.test.ts b/x-pack/solutions/security/plugins/lists/server/get_space_id.test.ts similarity index 100% rename from x-pack/plugins/lists/server/get_space_id.test.ts rename to x-pack/solutions/security/plugins/lists/server/get_space_id.test.ts diff --git a/x-pack/plugins/lists/server/get_space_id.ts b/x-pack/solutions/security/plugins/lists/server/get_space_id.ts similarity index 100% rename from x-pack/plugins/lists/server/get_space_id.ts rename to x-pack/solutions/security/plugins/lists/server/get_space_id.ts diff --git a/x-pack/plugins/lists/server/get_user.test.ts b/x-pack/solutions/security/plugins/lists/server/get_user.test.ts similarity index 100% rename from x-pack/plugins/lists/server/get_user.test.ts rename to x-pack/solutions/security/plugins/lists/server/get_user.test.ts diff --git a/x-pack/plugins/lists/server/get_user.ts b/x-pack/solutions/security/plugins/lists/server/get_user.ts similarity index 100% rename from x-pack/plugins/lists/server/get_user.ts rename to x-pack/solutions/security/plugins/lists/server/get_user.ts diff --git a/x-pack/plugins/lists/server/handlers/create_exception_list_handler.ts b/x-pack/solutions/security/plugins/lists/server/handlers/create_exception_list_handler.ts similarity index 100% rename from x-pack/plugins/lists/server/handlers/create_exception_list_handler.ts rename to x-pack/solutions/security/plugins/lists/server/handlers/create_exception_list_handler.ts diff --git a/x-pack/plugins/lists/server/index.ts b/x-pack/solutions/security/plugins/lists/server/index.ts similarity index 100% rename from x-pack/plugins/lists/server/index.ts rename to x-pack/solutions/security/plugins/lists/server/index.ts diff --git a/x-pack/plugins/lists/server/mocks.ts b/x-pack/solutions/security/plugins/lists/server/mocks.ts similarity index 100% rename from x-pack/plugins/lists/server/mocks.ts rename to x-pack/solutions/security/plugins/lists/server/mocks.ts diff --git a/x-pack/plugins/lists/server/plugin.ts b/x-pack/solutions/security/plugins/lists/server/plugin.ts similarity index 100% rename from x-pack/plugins/lists/server/plugin.ts rename to x-pack/solutions/security/plugins/lists/server/plugin.ts diff --git a/x-pack/plugins/lists/server/routes/create_endpoint_list_item_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/create_endpoint_list_item_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/create_endpoint_list_item_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/create_endpoint_list_item_route.ts diff --git a/x-pack/plugins/lists/server/routes/create_endpoint_list_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/create_endpoint_list_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/create_endpoint_list_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/create_endpoint_list_route.ts diff --git a/x-pack/plugins/lists/server/routes/create_exception_list_item_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/create_exception_list_item_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/create_exception_list_item_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/create_exception_list_item_route.ts diff --git a/x-pack/plugins/lists/server/routes/create_exception_list_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/create_exception_list_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/create_exception_list_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/create_exception_list_route.ts diff --git a/x-pack/plugins/lists/server/routes/delete_endpoint_list_item_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/delete_endpoint_list_item_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/delete_endpoint_list_item_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/delete_endpoint_list_item_route.ts diff --git a/x-pack/plugins/lists/server/routes/delete_exception_list_item_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/delete_exception_list_item_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/delete_exception_list_item_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/delete_exception_list_item_route.ts diff --git a/x-pack/plugins/lists/server/routes/delete_exception_list_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/delete_exception_list_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/delete_exception_list_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/delete_exception_list_route.ts diff --git a/x-pack/plugins/lists/server/routes/duplicate_exception_list_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/duplicate_exception_list_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/duplicate_exception_list_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/duplicate_exception_list_route.ts diff --git a/x-pack/plugins/lists/server/routes/endpoint_disallowed_fields.ts b/x-pack/solutions/security/plugins/lists/server/routes/endpoint_disallowed_fields.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/endpoint_disallowed_fields.ts rename to x-pack/solutions/security/plugins/lists/server/routes/endpoint_disallowed_fields.ts diff --git a/x-pack/plugins/lists/server/routes/export_exception_list_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/export_exception_list_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/export_exception_list_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/export_exception_list_route.ts diff --git a/x-pack/plugins/lists/server/routes/find_endpoint_list_item_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/find_endpoint_list_item_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/find_endpoint_list_item_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/find_endpoint_list_item_route.ts diff --git a/x-pack/plugins/lists/server/routes/find_exception_list_item_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/find_exception_list_item_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/find_exception_list_item_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/find_exception_list_item_route.ts diff --git a/x-pack/plugins/lists/server/routes/find_exception_list_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/find_exception_list_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/find_exception_list_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/find_exception_list_route.ts diff --git a/x-pack/plugins/lists/server/routes/import_exceptions_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/import_exceptions_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/import_exceptions_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/import_exceptions_route.ts diff --git a/x-pack/plugins/lists/server/routes/index.ts b/x-pack/solutions/security/plugins/lists/server/routes/index.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/index.ts rename to x-pack/solutions/security/plugins/lists/server/routes/index.ts diff --git a/x-pack/plugins/lists/server/routes/init_routes.ts b/x-pack/solutions/security/plugins/lists/server/routes/init_routes.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/init_routes.ts rename to x-pack/solutions/security/plugins/lists/server/routes/init_routes.ts diff --git a/x-pack/plugins/lists/server/routes/internal/create_exception_filter_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/internal/create_exception_filter_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/internal/create_exception_filter_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/internal/create_exception_filter_route.ts diff --git a/x-pack/plugins/lists/server/routes/internal/create_exceptions_list_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/internal/create_exceptions_list_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/internal/create_exceptions_list_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/internal/create_exceptions_list_route.ts diff --git a/x-pack/plugins/lists/server/routes/internal/find_lists_by_size_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/internal/find_lists_by_size_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/internal/find_lists_by_size_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/internal/find_lists_by_size_route.ts diff --git a/x-pack/plugins/lists/server/routes/list/create_list_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/list/create_list_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/list/create_list_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/list/create_list_route.ts diff --git a/x-pack/plugins/lists/server/routes/list/delete_list_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/list/delete_list_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/list/delete_list_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/list/delete_list_route.ts diff --git a/x-pack/plugins/lists/server/routes/list/import_list_item_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/list/import_list_item_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/list/import_list_item_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/list/import_list_item_route.ts diff --git a/x-pack/plugins/lists/server/routes/list/patch_list_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/list/patch_list_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/list/patch_list_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/list/patch_list_route.ts diff --git a/x-pack/plugins/lists/server/routes/list/read_list_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/list/read_list_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/list/read_list_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/list/read_list_route.ts diff --git a/x-pack/plugins/lists/server/routes/list/update_list_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/list/update_list_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/list/update_list_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/list/update_list_route.ts diff --git a/x-pack/plugins/lists/server/routes/list_index/create_list_index_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/list_index/create_list_index_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/list_index/create_list_index_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/list_index/create_list_index_route.ts diff --git a/x-pack/plugins/lists/server/routes/list_index/delete_list_index_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/list_index/delete_list_index_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/list_index/delete_list_index_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/list_index/delete_list_index_route.ts diff --git a/x-pack/plugins/lists/server/routes/list_index/export_list_item_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/list_index/export_list_item_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/list_index/export_list_item_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/list_index/export_list_item_route.ts diff --git a/x-pack/plugins/lists/server/routes/list_index/find_list_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/list_index/find_list_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/list_index/find_list_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/list_index/find_list_route.ts diff --git a/x-pack/plugins/lists/server/routes/list_index/read_list_index_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/list_index/read_list_index_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/list_index/read_list_index_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/list_index/read_list_index_route.ts diff --git a/x-pack/plugins/lists/server/routes/list_item/create_list_item_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/list_item/create_list_item_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/list_item/create_list_item_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/list_item/create_list_item_route.ts diff --git a/x-pack/plugins/lists/server/routes/list_item/delete_list_item_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/list_item/delete_list_item_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/list_item/delete_list_item_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/list_item/delete_list_item_route.ts diff --git a/x-pack/plugins/lists/server/routes/list_item/find_list_item_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/list_item/find_list_item_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/list_item/find_list_item_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/list_item/find_list_item_route.ts diff --git a/x-pack/plugins/lists/server/routes/list_item/patch_list_item_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/list_item/patch_list_item_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/list_item/patch_list_item_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/list_item/patch_list_item_route.ts diff --git a/x-pack/plugins/lists/server/routes/list_item/read_list_item_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/list_item/read_list_item_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/list_item/read_list_item_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/list_item/read_list_item_route.ts diff --git a/x-pack/plugins/lists/server/routes/list_item/update_list_item_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/list_item/update_list_item_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/list_item/update_list_item_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/list_item/update_list_item_route.ts diff --git a/x-pack/plugins/lists/server/routes/list_privileges/read_list_privileges_route.mock.ts b/x-pack/solutions/security/plugins/lists/server/routes/list_privileges/read_list_privileges_route.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/list_privileges/read_list_privileges_route.mock.ts rename to x-pack/solutions/security/plugins/lists/server/routes/list_privileges/read_list_privileges_route.mock.ts diff --git a/x-pack/plugins/lists/server/routes/list_privileges/read_list_privileges_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/list_privileges/read_list_privileges_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/list_privileges/read_list_privileges_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/list_privileges/read_list_privileges_route.ts diff --git a/x-pack/plugins/lists/server/routes/read_endpoint_list_item_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/read_endpoint_list_item_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/read_endpoint_list_item_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/read_endpoint_list_item_route.ts diff --git a/x-pack/plugins/lists/server/routes/read_exception_list_item_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/read_exception_list_item_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/read_exception_list_item_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/read_exception_list_item_route.ts diff --git a/x-pack/plugins/lists/server/routes/read_exception_list_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/read_exception_list_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/read_exception_list_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/read_exception_list_route.ts diff --git a/x-pack/plugins/lists/server/routes/summary_exception_list_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/summary_exception_list_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/summary_exception_list_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/summary_exception_list_route.ts diff --git a/x-pack/plugins/lists/server/routes/update_endpoint_list_item_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/update_endpoint_list_item_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/update_endpoint_list_item_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/update_endpoint_list_item_route.ts diff --git a/x-pack/plugins/lists/server/routes/update_exception_list_item_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/update_exception_list_item_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/update_exception_list_item_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/update_exception_list_item_route.ts diff --git a/x-pack/plugins/lists/server/routes/update_exception_list_route.ts b/x-pack/solutions/security/plugins/lists/server/routes/update_exception_list_route.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/update_exception_list_route.ts rename to x-pack/solutions/security/plugins/lists/server/routes/update_exception_list_route.ts diff --git a/x-pack/plugins/lists/server/routes/utils/build_siem_response.ts b/x-pack/solutions/security/plugins/lists/server/routes/utils/build_siem_response.ts similarity index 89% rename from x-pack/plugins/lists/server/routes/utils/build_siem_response.ts rename to x-pack/solutions/security/plugins/lists/server/routes/utils/build_siem_response.ts index f4baa8779201f..dbf15b1faa5f4 100644 --- a/x-pack/plugins/lists/server/routes/utils/build_siem_response.ts +++ b/x-pack/solutions/security/plugins/lists/server/routes/utils/build_siem_response.ts @@ -13,7 +13,7 @@ import { } from '@kbn/core/server'; /** - * Copied from x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts + * Copied from x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/utils.ts * We cannot put this in kbn package just yet as the types from 'src/core/server' aren't a kbn package yet and this would pull in a lot of copied things. * TODO: Once more types are moved into kbn package we can move this into a kbn package. */ @@ -46,7 +46,7 @@ const statusToErrorMessage = ( }; /** - * Copied from x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts + * Copied from x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/utils.ts * We cannot put this in kbn package just yet as the types from 'src/core/server' aren't a kbn package yet and this would pull in a lot of copied things. * TODO: Once more types are moved into kbn package we can move this into a kbn package. */ @@ -87,7 +87,7 @@ export class SiemResponseFactory { } /** - * Copied from x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts + * Copied from x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/utils.ts * We cannot put this in kbn package just yet as the types from 'src/core/server' aren't a kbn package yet and this would pull in a lot of copied things. * TODO: Once more types are moved into kbn package we can move this into a kbn package. */ diff --git a/x-pack/plugins/lists/server/routes/utils/create_stream_from_buffer.ts b/x-pack/solutions/security/plugins/lists/server/routes/utils/create_stream_from_buffer.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/utils/create_stream_from_buffer.ts rename to x-pack/solutions/security/plugins/lists/server/routes/utils/create_stream_from_buffer.ts diff --git a/x-pack/plugins/lists/server/routes/utils/get_error_message_exception_list.ts b/x-pack/solutions/security/plugins/lists/server/routes/utils/get_error_message_exception_list.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/utils/get_error_message_exception_list.ts rename to x-pack/solutions/security/plugins/lists/server/routes/utils/get_error_message_exception_list.ts diff --git a/x-pack/plugins/lists/server/routes/utils/get_error_message_exception_list_item.ts b/x-pack/solutions/security/plugins/lists/server/routes/utils/get_error_message_exception_list_item.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/utils/get_error_message_exception_list_item.ts rename to x-pack/solutions/security/plugins/lists/server/routes/utils/get_error_message_exception_list_item.ts diff --git a/x-pack/plugins/lists/server/routes/utils/get_exception_list_client.ts b/x-pack/solutions/security/plugins/lists/server/routes/utils/get_exception_list_client.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/utils/get_exception_list_client.ts rename to x-pack/solutions/security/plugins/lists/server/routes/utils/get_exception_list_client.ts diff --git a/x-pack/plugins/lists/server/routes/utils/get_internal_list_client.ts b/x-pack/solutions/security/plugins/lists/server/routes/utils/get_internal_list_client.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/utils/get_internal_list_client.ts rename to x-pack/solutions/security/plugins/lists/server/routes/utils/get_internal_list_client.ts diff --git a/x-pack/plugins/lists/server/routes/utils/get_list_client.ts b/x-pack/solutions/security/plugins/lists/server/routes/utils/get_list_client.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/utils/get_list_client.ts rename to x-pack/solutions/security/plugins/lists/server/routes/utils/get_list_client.ts diff --git a/x-pack/plugins/lists/server/routes/utils/index.ts b/x-pack/solutions/security/plugins/lists/server/routes/utils/index.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/utils/index.ts rename to x-pack/solutions/security/plugins/lists/server/routes/utils/index.ts diff --git a/x-pack/plugins/lists/server/routes/utils/route_validation.test.ts b/x-pack/solutions/security/plugins/lists/server/routes/utils/route_validation.test.ts similarity index 96% rename from x-pack/plugins/lists/server/routes/utils/route_validation.test.ts rename to x-pack/solutions/security/plugins/lists/server/routes/utils/route_validation.test.ts index aeb5447285939..e7b9d936f4a6d 100644 --- a/x-pack/plugins/lists/server/routes/utils/route_validation.test.ts +++ b/x-pack/solutions/security/plugins/lists/server/routes/utils/route_validation.test.ts @@ -11,7 +11,7 @@ import { RouteValidationResultFactory } from '@kbn/core/server'; import { buildRouteValidation } from './route_validation'; /** - * Copied from x-pack/plugins/security_solution/server/utils/build_validation/route_validation.test.ts + * Copied from x-pack/solutions/security/plugins/security_solution/server/utils/build_validation/route_validation.test.ts * TODO: Once we can move this into a kbn package because the types such as RouteValidationResultFactory are in packages, then please do. */ describe('Route Validation with ', () => { diff --git a/x-pack/plugins/lists/server/routes/utils/route_validation.ts b/x-pack/solutions/security/plugins/lists/server/routes/utils/route_validation.ts similarity index 94% rename from x-pack/plugins/lists/server/routes/utils/route_validation.ts rename to x-pack/solutions/security/plugins/lists/server/routes/utils/route_validation.ts index ceeb63c002653..e88629955fa9d 100644 --- a/x-pack/plugins/lists/server/routes/utils/route_validation.ts +++ b/x-pack/solutions/security/plugins/lists/server/routes/utils/route_validation.ts @@ -32,7 +32,7 @@ type RequestValidationResult<T> = }; /** - * Copied from x-pack/plugins/security_solution/server/utils/build_validation/route_validation.ts + * Copied from x-pack/solutions/security/plugins/security_solution/server/utils/build_validation/route_validation.ts * This really should be in @kbn/securitysolution-io-ts-utils rather than copied yet again, however, this has types * from a lot of places such as RouteValidationResultFactory from core/server which in turn can pull in @kbn/schema * which cannot work on the front end and @kbn/securitysolution-io-ts-utils works on both front and backend. diff --git a/x-pack/plugins/lists/server/routes/utils/validate_comments_to_update.test.ts b/x-pack/solutions/security/plugins/lists/server/routes/utils/validate_comments_to_update.test.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/utils/validate_comments_to_update.test.ts rename to x-pack/solutions/security/plugins/lists/server/routes/utils/validate_comments_to_update.test.ts diff --git a/x-pack/plugins/lists/server/routes/utils/validate_comments_to_update.ts b/x-pack/solutions/security/plugins/lists/server/routes/utils/validate_comments_to_update.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/utils/validate_comments_to_update.ts rename to x-pack/solutions/security/plugins/lists/server/routes/utils/validate_comments_to_update.ts diff --git a/x-pack/plugins/lists/server/routes/validate.ts b/x-pack/solutions/security/plugins/lists/server/routes/validate.ts similarity index 100% rename from x-pack/plugins/lists/server/routes/validate.ts rename to x-pack/solutions/security/plugins/lists/server/routes/validate.ts diff --git a/x-pack/plugins/lists/server/saved_objects/exception_list.ts b/x-pack/solutions/security/plugins/lists/server/saved_objects/exception_list.ts similarity index 100% rename from x-pack/plugins/lists/server/saved_objects/exception_list.ts rename to x-pack/solutions/security/plugins/lists/server/saved_objects/exception_list.ts diff --git a/x-pack/plugins/lists/server/saved_objects/index.ts b/x-pack/solutions/security/plugins/lists/server/saved_objects/index.ts similarity index 100% rename from x-pack/plugins/lists/server/saved_objects/index.ts rename to x-pack/solutions/security/plugins/lists/server/saved_objects/index.ts diff --git a/x-pack/plugins/lists/server/saved_objects/init_saved_objects.ts b/x-pack/solutions/security/plugins/lists/server/saved_objects/init_saved_objects.ts similarity index 100% rename from x-pack/plugins/lists/server/saved_objects/init_saved_objects.ts rename to x-pack/solutions/security/plugins/lists/server/saved_objects/init_saved_objects.ts diff --git a/x-pack/plugins/lists/server/saved_objects/migrations.test.ts b/x-pack/solutions/security/plugins/lists/server/saved_objects/migrations.test.ts similarity index 100% rename from x-pack/plugins/lists/server/saved_objects/migrations.test.ts rename to x-pack/solutions/security/plugins/lists/server/saved_objects/migrations.test.ts diff --git a/x-pack/plugins/lists/server/saved_objects/migrations.ts b/x-pack/solutions/security/plugins/lists/server/saved_objects/migrations.ts similarity index 100% rename from x-pack/plugins/lists/server/saved_objects/migrations.ts rename to x-pack/solutions/security/plugins/lists/server/saved_objects/migrations.ts diff --git a/x-pack/plugins/lists/server/schemas/common/get_shard.mock.ts b/x-pack/solutions/security/plugins/lists/server/schemas/common/get_shard.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/schemas/common/get_shard.mock.ts rename to x-pack/solutions/security/plugins/lists/server/schemas/common/get_shard.mock.ts diff --git a/x-pack/plugins/lists/server/schemas/common/schemas.test.ts b/x-pack/solutions/security/plugins/lists/server/schemas/common/schemas.test.ts similarity index 100% rename from x-pack/plugins/lists/server/schemas/common/schemas.test.ts rename to x-pack/solutions/security/plugins/lists/server/schemas/common/schemas.test.ts diff --git a/x-pack/plugins/lists/server/schemas/common/schemas.ts b/x-pack/solutions/security/plugins/lists/server/schemas/common/schemas.ts similarity index 100% rename from x-pack/plugins/lists/server/schemas/common/schemas.ts rename to x-pack/solutions/security/plugins/lists/server/schemas/common/schemas.ts diff --git a/x-pack/plugins/lists/server/schemas/elastic_query/create_es_bulk_type.ts b/x-pack/solutions/security/plugins/lists/server/schemas/elastic_query/create_es_bulk_type.ts similarity index 100% rename from x-pack/plugins/lists/server/schemas/elastic_query/create_es_bulk_type.ts rename to x-pack/solutions/security/plugins/lists/server/schemas/elastic_query/create_es_bulk_type.ts diff --git a/x-pack/plugins/lists/server/schemas/elastic_query/index.ts b/x-pack/solutions/security/plugins/lists/server/schemas/elastic_query/index.ts similarity index 100% rename from x-pack/plugins/lists/server/schemas/elastic_query/index.ts rename to x-pack/solutions/security/plugins/lists/server/schemas/elastic_query/index.ts diff --git a/x-pack/plugins/lists/server/schemas/elastic_query/index_es_list_item_schema.mock.ts b/x-pack/solutions/security/plugins/lists/server/schemas/elastic_query/index_es_list_item_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/schemas/elastic_query/index_es_list_item_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/server/schemas/elastic_query/index_es_list_item_schema.mock.ts diff --git a/x-pack/plugins/lists/server/schemas/elastic_query/index_es_list_item_schema.ts b/x-pack/solutions/security/plugins/lists/server/schemas/elastic_query/index_es_list_item_schema.ts similarity index 100% rename from x-pack/plugins/lists/server/schemas/elastic_query/index_es_list_item_schema.ts rename to x-pack/solutions/security/plugins/lists/server/schemas/elastic_query/index_es_list_item_schema.ts diff --git a/x-pack/plugins/lists/server/schemas/elastic_query/index_es_list_schema.mock.ts b/x-pack/solutions/security/plugins/lists/server/schemas/elastic_query/index_es_list_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/schemas/elastic_query/index_es_list_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/server/schemas/elastic_query/index_es_list_schema.mock.ts diff --git a/x-pack/plugins/lists/server/schemas/elastic_query/index_es_list_schema.ts b/x-pack/solutions/security/plugins/lists/server/schemas/elastic_query/index_es_list_schema.ts similarity index 100% rename from x-pack/plugins/lists/server/schemas/elastic_query/index_es_list_schema.ts rename to x-pack/solutions/security/plugins/lists/server/schemas/elastic_query/index_es_list_schema.ts diff --git a/x-pack/plugins/lists/server/schemas/elastic_query/update_es_list_item_schema.ts b/x-pack/solutions/security/plugins/lists/server/schemas/elastic_query/update_es_list_item_schema.ts similarity index 100% rename from x-pack/plugins/lists/server/schemas/elastic_query/update_es_list_item_schema.ts rename to x-pack/solutions/security/plugins/lists/server/schemas/elastic_query/update_es_list_item_schema.ts diff --git a/x-pack/plugins/lists/server/schemas/elastic_query/update_es_list_schema.ts b/x-pack/solutions/security/plugins/lists/server/schemas/elastic_query/update_es_list_schema.ts similarity index 100% rename from x-pack/plugins/lists/server/schemas/elastic_query/update_es_list_schema.ts rename to x-pack/solutions/security/plugins/lists/server/schemas/elastic_query/update_es_list_schema.ts diff --git a/x-pack/plugins/lists/server/schemas/elastic_response/index.ts b/x-pack/solutions/security/plugins/lists/server/schemas/elastic_response/index.ts similarity index 100% rename from x-pack/plugins/lists/server/schemas/elastic_response/index.ts rename to x-pack/solutions/security/plugins/lists/server/schemas/elastic_response/index.ts diff --git a/x-pack/plugins/lists/server/schemas/elastic_response/search_es_list_item_schema.mock.ts b/x-pack/solutions/security/plugins/lists/server/schemas/elastic_response/search_es_list_item_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/schemas/elastic_response/search_es_list_item_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/server/schemas/elastic_response/search_es_list_item_schema.mock.ts diff --git a/x-pack/plugins/lists/server/schemas/elastic_response/search_es_list_item_schema.test.ts b/x-pack/solutions/security/plugins/lists/server/schemas/elastic_response/search_es_list_item_schema.test.ts similarity index 100% rename from x-pack/plugins/lists/server/schemas/elastic_response/search_es_list_item_schema.test.ts rename to x-pack/solutions/security/plugins/lists/server/schemas/elastic_response/search_es_list_item_schema.test.ts diff --git a/x-pack/plugins/lists/server/schemas/elastic_response/search_es_list_item_schema.ts b/x-pack/solutions/security/plugins/lists/server/schemas/elastic_response/search_es_list_item_schema.ts similarity index 100% rename from x-pack/plugins/lists/server/schemas/elastic_response/search_es_list_item_schema.ts rename to x-pack/solutions/security/plugins/lists/server/schemas/elastic_response/search_es_list_item_schema.ts diff --git a/x-pack/plugins/lists/server/schemas/elastic_response/search_es_list_schema.mock.ts b/x-pack/solutions/security/plugins/lists/server/schemas/elastic_response/search_es_list_schema.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/schemas/elastic_response/search_es_list_schema.mock.ts rename to x-pack/solutions/security/plugins/lists/server/schemas/elastic_response/search_es_list_schema.mock.ts diff --git a/x-pack/plugins/lists/server/schemas/elastic_response/search_es_list_schema.test.ts b/x-pack/solutions/security/plugins/lists/server/schemas/elastic_response/search_es_list_schema.test.ts similarity index 100% rename from x-pack/plugins/lists/server/schemas/elastic_response/search_es_list_schema.test.ts rename to x-pack/solutions/security/plugins/lists/server/schemas/elastic_response/search_es_list_schema.test.ts diff --git a/x-pack/plugins/lists/server/schemas/elastic_response/search_es_list_schema.ts b/x-pack/solutions/security/plugins/lists/server/schemas/elastic_response/search_es_list_schema.ts similarity index 100% rename from x-pack/plugins/lists/server/schemas/elastic_response/search_es_list_schema.ts rename to x-pack/solutions/security/plugins/lists/server/schemas/elastic_response/search_es_list_schema.ts diff --git a/x-pack/plugins/lists/server/schemas/saved_objects/exceptions_list_so_schema.ts b/x-pack/solutions/security/plugins/lists/server/schemas/saved_objects/exceptions_list_so_schema.ts similarity index 100% rename from x-pack/plugins/lists/server/schemas/saved_objects/exceptions_list_so_schema.ts rename to x-pack/solutions/security/plugins/lists/server/schemas/saved_objects/exceptions_list_so_schema.ts diff --git a/x-pack/plugins/lists/server/schemas/saved_objects/index.ts b/x-pack/solutions/security/plugins/lists/server/schemas/saved_objects/index.ts similarity index 100% rename from x-pack/plugins/lists/server/schemas/saved_objects/index.ts rename to x-pack/solutions/security/plugins/lists/server/schemas/saved_objects/index.ts diff --git a/x-pack/plugins/lists/server/scripts/check_env_variables.sh b/x-pack/solutions/security/plugins/lists/server/scripts/check_env_variables.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/check_env_variables.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/check_env_variables.sh diff --git a/x-pack/plugins/lists/server/scripts/delete_all_exception_lists.sh b/x-pack/solutions/security/plugins/lists/server/scripts/delete_all_exception_lists.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/delete_all_exception_lists.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/delete_all_exception_lists.sh diff --git a/x-pack/plugins/lists/server/scripts/delete_endpoint_list_item.sh b/x-pack/solutions/security/plugins/lists/server/scripts/delete_endpoint_list_item.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/delete_endpoint_list_item.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/delete_endpoint_list_item.sh diff --git a/x-pack/plugins/lists/server/scripts/delete_endpoint_list_item_by_id.sh b/x-pack/solutions/security/plugins/lists/server/scripts/delete_endpoint_list_item_by_id.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/delete_endpoint_list_item_by_id.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/delete_endpoint_list_item_by_id.sh diff --git a/x-pack/plugins/lists/server/scripts/delete_exception_list.sh b/x-pack/solutions/security/plugins/lists/server/scripts/delete_exception_list.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/delete_exception_list.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/delete_exception_list.sh diff --git a/x-pack/plugins/lists/server/scripts/delete_exception_list_by_id.sh b/x-pack/solutions/security/plugins/lists/server/scripts/delete_exception_list_by_id.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/delete_exception_list_by_id.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/delete_exception_list_by_id.sh diff --git a/x-pack/plugins/lists/server/scripts/delete_exception_list_item.sh b/x-pack/solutions/security/plugins/lists/server/scripts/delete_exception_list_item.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/delete_exception_list_item.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/delete_exception_list_item.sh diff --git a/x-pack/plugins/lists/server/scripts/delete_exception_list_item_by_id.sh b/x-pack/solutions/security/plugins/lists/server/scripts/delete_exception_list_item_by_id.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/delete_exception_list_item_by_id.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/delete_exception_list_item_by_id.sh diff --git a/x-pack/plugins/lists/server/scripts/delete_list.sh b/x-pack/solutions/security/plugins/lists/server/scripts/delete_list.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/delete_list.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/delete_list.sh diff --git a/x-pack/plugins/lists/server/scripts/delete_list_index.sh b/x-pack/solutions/security/plugins/lists/server/scripts/delete_list_index.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/delete_list_index.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/delete_list_index.sh diff --git a/x-pack/plugins/lists/server/scripts/delete_list_item_by_id.sh b/x-pack/solutions/security/plugins/lists/server/scripts/delete_list_item_by_id.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/delete_list_item_by_id.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/delete_list_item_by_id.sh diff --git a/x-pack/plugins/lists/server/scripts/delete_list_item_by_value.sh b/x-pack/solutions/security/plugins/lists/server/scripts/delete_list_item_by_value.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/delete_list_item_by_value.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/delete_list_item_by_value.sh diff --git a/x-pack/plugins/lists/server/scripts/download_load_lists_example.sh b/x-pack/solutions/security/plugins/lists/server/scripts/download_load_lists_example.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/download_load_lists_example.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/download_load_lists_example.sh diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/files/import.ndjson b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/files/import.ndjson similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/files/import.ndjson rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/files/import.ndjson diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/endpoint_list_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/endpoint_list_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/endpoint_list_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/endpoint_list_item.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/exception_list.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/exception_list.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_agnostic.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/exception_list_agnostic.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_agnostic.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/exception_list_agnostic.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_auto_id.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/exception_list_auto_id.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_auto_id.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/exception_list_auto_id.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_detection.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/exception_list_detection.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_detection.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/exception_list_detection.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/exception_list_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/exception_list_item.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_item_agnostic.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/exception_list_item_agnostic.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_item_agnostic.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/exception_list_item_agnostic.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_item_auto_id.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/exception_list_item_auto_id.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_item_auto_id.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/exception_list_item_auto_id.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_item_detection_auto_id.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/exception_list_item_detection_auto_id.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_item_detection_auto_id.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/exception_list_item_detection_auto_id.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_item_with_bad_ip_list.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/exception_list_item_with_bad_ip_list.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_item_with_bad_ip_list.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/exception_list_item_with_bad_ip_list.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_item_with_list.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/exception_list_item_with_list.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/exception_list_item_with_list.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/exception_list_item_with_list.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/references/exception_list_detection_1.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/references/exception_list_detection_1.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/references/exception_list_detection_1.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/references/exception_list_detection_1.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/references/exception_list_detection_2_agnostic.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/references/exception_list_detection_2_agnostic.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/references/exception_list_detection_2_agnostic.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/references/exception_list_detection_2_agnostic.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/references/exception_list_detection_3.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/references/exception_list_detection_3.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/references/exception_list_detection_3.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/references/exception_list_detection_3.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_1_multi_value_list.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_1_multi_value_list.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_1_multi_value_list.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_1_multi_value_list.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_1_non_value_list.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_1_non_value_list.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_1_non_value_list.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_1_non_value_list.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_2_multi_value_list.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_2_multi_value_list.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_2_multi_value_list.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_2_multi_value_list.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_2_non_value_list.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_2_non_value_list.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_2_non_value_list.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_2_non_value_list.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_3_non_value_list.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_3_non_value_list.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_3_non_value_list.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_3_non_value_list.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_3_single_value_list.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_3_single_value_list.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_3_single_value_list.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/references/exception_list_item_3_single_value_list.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/new/trusted_app_list_item_agnostic.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/trusted_app_list_item_agnostic.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/new/trusted_app_list_item_agnostic.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/new/trusted_app_list_item_agnostic.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/updates/simple_update.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/updates/simple_update.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/updates/simple_update.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/updates/simple_update.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/updates/simple_update_agnostic.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/updates/simple_update_agnostic.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/updates/simple_update_agnostic.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/updates/simple_update_agnostic.json diff --git a/x-pack/plugins/lists/server/scripts/exception_lists/updates/simple_update_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/updates/simple_update_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/exception_lists/updates/simple_update_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/exception_lists/updates/simple_update_item.json diff --git a/x-pack/plugins/lists/server/scripts/export_list_items.sh b/x-pack/solutions/security/plugins/lists/server/scripts/export_list_items.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/export_list_items.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/export_list_items.sh diff --git a/x-pack/plugins/lists/server/scripts/export_list_items_to_file.sh b/x-pack/solutions/security/plugins/lists/server/scripts/export_list_items_to_file.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/export_list_items_to_file.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/export_list_items_to_file.sh diff --git a/x-pack/plugins/lists/server/scripts/find_endpoint_list_items.sh b/x-pack/solutions/security/plugins/lists/server/scripts/find_endpoint_list_items.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/find_endpoint_list_items.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/find_endpoint_list_items.sh diff --git a/x-pack/plugins/lists/server/scripts/find_exception_list_items.sh b/x-pack/solutions/security/plugins/lists/server/scripts/find_exception_list_items.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/find_exception_list_items.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/find_exception_list_items.sh diff --git a/x-pack/plugins/lists/server/scripts/find_exception_list_items_by_filter.sh b/x-pack/solutions/security/plugins/lists/server/scripts/find_exception_list_items_by_filter.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/find_exception_list_items_by_filter.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/find_exception_list_items_by_filter.sh diff --git a/x-pack/plugins/lists/server/scripts/find_exception_lists.sh b/x-pack/solutions/security/plugins/lists/server/scripts/find_exception_lists.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/find_exception_lists.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/find_exception_lists.sh diff --git a/x-pack/plugins/lists/server/scripts/find_exception_lists_by_filter.sh b/x-pack/solutions/security/plugins/lists/server/scripts/find_exception_lists_by_filter.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/find_exception_lists_by_filter.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/find_exception_lists_by_filter.sh diff --git a/x-pack/plugins/lists/server/scripts/find_list_items.sh b/x-pack/solutions/security/plugins/lists/server/scripts/find_list_items.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/find_list_items.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/find_list_items.sh diff --git a/x-pack/plugins/lists/server/scripts/find_list_items_with_cursor.sh b/x-pack/solutions/security/plugins/lists/server/scripts/find_list_items_with_cursor.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/find_list_items_with_cursor.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/find_list_items_with_cursor.sh diff --git a/x-pack/plugins/lists/server/scripts/find_list_items_with_sort.sh b/x-pack/solutions/security/plugins/lists/server/scripts/find_list_items_with_sort.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/find_list_items_with_sort.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/find_list_items_with_sort.sh diff --git a/x-pack/plugins/lists/server/scripts/find_list_items_with_sort_cursor.sh b/x-pack/solutions/security/plugins/lists/server/scripts/find_list_items_with_sort_cursor.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/find_list_items_with_sort_cursor.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/find_list_items_with_sort_cursor.sh diff --git a/x-pack/plugins/lists/server/scripts/find_lists.sh b/x-pack/solutions/security/plugins/lists/server/scripts/find_lists.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/find_lists.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/find_lists.sh diff --git a/x-pack/plugins/lists/server/scripts/find_lists_with_cursor.sh b/x-pack/solutions/security/plugins/lists/server/scripts/find_lists_with_cursor.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/find_lists_with_cursor.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/find_lists_with_cursor.sh diff --git a/x-pack/plugins/lists/server/scripts/find_lists_with_filter.sh b/x-pack/solutions/security/plugins/lists/server/scripts/find_lists_with_filter.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/find_lists_with_filter.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/find_lists_with_filter.sh diff --git a/x-pack/plugins/lists/server/scripts/find_lists_with_sort.sh b/x-pack/solutions/security/plugins/lists/server/scripts/find_lists_with_sort.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/find_lists_with_sort.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/find_lists_with_sort.sh diff --git a/x-pack/plugins/lists/server/scripts/find_lists_with_sort_cursor.sh b/x-pack/solutions/security/plugins/lists/server/scripts/find_lists_with_sort_cursor.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/find_lists_with_sort_cursor.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/find_lists_with_sort_cursor.sh diff --git a/x-pack/plugins/lists/server/scripts/get_endpoint_list_item.sh b/x-pack/solutions/security/plugins/lists/server/scripts/get_endpoint_list_item.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/get_endpoint_list_item.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/get_endpoint_list_item.sh diff --git a/x-pack/plugins/lists/server/scripts/get_endpoint_list_item_by_id.sh b/x-pack/solutions/security/plugins/lists/server/scripts/get_endpoint_list_item_by_id.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/get_endpoint_list_item_by_id.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/get_endpoint_list_item_by_id.sh diff --git a/x-pack/plugins/lists/server/scripts/get_exception_list.sh b/x-pack/solutions/security/plugins/lists/server/scripts/get_exception_list.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/get_exception_list.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/get_exception_list.sh diff --git a/x-pack/plugins/lists/server/scripts/get_exception_list_by_id.sh b/x-pack/solutions/security/plugins/lists/server/scripts/get_exception_list_by_id.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/get_exception_list_by_id.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/get_exception_list_by_id.sh diff --git a/x-pack/plugins/lists/server/scripts/get_exception_list_item.sh b/x-pack/solutions/security/plugins/lists/server/scripts/get_exception_list_item.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/get_exception_list_item.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/get_exception_list_item.sh diff --git a/x-pack/plugins/lists/server/scripts/get_exception_list_item_by_id.sh b/x-pack/solutions/security/plugins/lists/server/scripts/get_exception_list_item_by_id.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/get_exception_list_item_by_id.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/get_exception_list_item_by_id.sh diff --git a/x-pack/plugins/lists/server/scripts/get_list.sh b/x-pack/solutions/security/plugins/lists/server/scripts/get_list.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/get_list.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/get_list.sh diff --git a/x-pack/plugins/lists/server/scripts/get_list_item_by_id.sh b/x-pack/solutions/security/plugins/lists/server/scripts/get_list_item_by_id.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/get_list_item_by_id.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/get_list_item_by_id.sh diff --git a/x-pack/plugins/lists/server/scripts/get_list_item_by_value.sh b/x-pack/solutions/security/plugins/lists/server/scripts/get_list_item_by_value.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/get_list_item_by_value.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/get_list_item_by_value.sh diff --git a/x-pack/plugins/lists/server/scripts/get_privileges.sh b/x-pack/solutions/security/plugins/lists/server/scripts/get_privileges.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/get_privileges.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/get_privileges.sh diff --git a/x-pack/plugins/lists/server/scripts/hard_reset.sh b/x-pack/solutions/security/plugins/lists/server/scripts/hard_reset.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/hard_reset.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/hard_reset.sh diff --git a/x-pack/plugins/lists/server/scripts/import_exception_lists.sh b/x-pack/solutions/security/plugins/lists/server/scripts/import_exception_lists.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/import_exception_lists.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/import_exception_lists.sh diff --git a/x-pack/plugins/lists/server/scripts/import_list_items.sh b/x-pack/solutions/security/plugins/lists/server/scripts/import_list_items.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/import_list_items.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/import_list_items.sh diff --git a/x-pack/plugins/lists/server/scripts/import_list_items_by_filename.sh b/x-pack/solutions/security/plugins/lists/server/scripts/import_list_items_by_filename.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/import_list_items_by_filename.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/import_list_items_by_filename.sh diff --git a/x-pack/plugins/lists/server/scripts/lists/files/binary.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/binary.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/binary.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/binary.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/boolean.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/boolean.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/boolean.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/boolean.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/byte.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/byte.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/byte.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/byte.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/date.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/date.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/date.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/date.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/date_nanos.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/date_nanos.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/date_nanos.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/date_nanos.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/date_range.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/date_range.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/date_range.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/date_range.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/date_range_custom_format.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/date_range_custom_format.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/date_range_custom_format.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/date_range_custom_format.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/double.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/double.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/double.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/double.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/double_range.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/double_range.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/double_range.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/double_range.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/float.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/float.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/float.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/float.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/float_range.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/float_range.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/float_range.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/float_range.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/geo_hash.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/geo_hash.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/geo_hash.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/geo_hash.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/geo_point.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/geo_point.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/geo_point.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/geo_point.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/geo_point_wkt.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/geo_point_wkt.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/geo_point_wkt.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/geo_point_wkt.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/half_float.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/half_float.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/half_float.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/half_float.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/hosts.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/hosts.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/hosts.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/hosts.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/integer.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/integer.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/integer.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/integer.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/integer_range.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/integer_range.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/integer_range.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/integer_range.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/ip_range.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/ip_range.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/ip_range.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/ip_range.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/ip_range_cidr.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/ip_range_cidr.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/ip_range_cidr.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/ip_range_cidr.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/ip_range_mixed.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/ip_range_mixed.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/ip_range_mixed.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/ip_range_mixed.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/ips.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/ips.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/ips.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/ips.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/long.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/long.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/long.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/long.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/long_range.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/long_range.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/long_range.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/long_range.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/short.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/short.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/short.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/short.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/files/text.txt b/x-pack/solutions/security/plugins/lists/server/scripts/lists/files/text.txt similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/files/text.txt rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/files/text.txt diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/binary_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/binary_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/binary_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/binary_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/boolean_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/boolean_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/boolean_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/boolean_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/byte_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/byte_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/byte_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/byte_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/date_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/date_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/date_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/date_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/date_nanos_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/date_nanos_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/date_nanos_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/date_nanos_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/date_range_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/date_range_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/date_range_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/date_range_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/double_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/double_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/double_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/double_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/double_range_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/double_range_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/double_range_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/double_range_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/float_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/float_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/float_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/float_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/float_range_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/float_range_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/float_range_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/float_range_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/geo_point_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/geo_point_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/geo_point_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/geo_point_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/geo_shape_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/geo_shape_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/geo_shape_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/geo_shape_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/half_float_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/half_float_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/half_float_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/half_float_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/integer_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/integer_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/integer_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/integer_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/integer_range_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/integer_range_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/integer_range_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/integer_range_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/ip_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/ip_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/ip_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/ip_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/ip_item_everything.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/ip_item_everything.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/ip_item_everything.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/ip_item_everything.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/ip_range_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/ip_range_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/ip_range_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/ip_range_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/keyword_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/keyword_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/keyword_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/keyword_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/long_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/long_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/long_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/long_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/long_range_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/long_range_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/long_range_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/long_range_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/shape_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/shape_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/shape_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/shape_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/short_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/short_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/short_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/short_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/items/text_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/text_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/items/text_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/items/text_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/list_ip_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/list_ip_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/list_ip_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/list_ip_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/list_keyword_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/list_keyword_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/list_keyword_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/list_keyword_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/auto_id.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/auto_id.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/auto_id.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/auto_id.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/binary.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/binary.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/binary.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/binary.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/boolean.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/boolean.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/boolean.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/boolean.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/byte.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/byte.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/byte.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/byte.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/date.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/date.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/date.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/date.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/date_nanos.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/date_nanos.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/date_nanos.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/date_nanos.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/date_range.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/date_range.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/date_range.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/date_range.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/date_range_custom_format.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/date_range_custom_format.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/date_range_custom_format.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/date_range_custom_format.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/double.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/double.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/double.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/double.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/double_range.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/double_range.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/double_range.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/double_range.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/everything.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/everything.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/everything.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/everything.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/float.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/float.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/float.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/float.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/float_range.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/float_range.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/float_range.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/float_range.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/geo_point.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/geo_point.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/geo_point.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/geo_point.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/geo_shape.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/geo_shape.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/geo_shape.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/geo_shape.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/half_float.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/half_float.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/half_float.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/half_float.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/integer.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/integer.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/integer.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/integer.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/integer_range.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/integer_range.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/integer_range.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/integer_range.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/ip.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/ip.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/ip.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/ip.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/ip_custom_format.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/ip_custom_format.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/ip_custom_format.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/ip_custom_format.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/ip_no_id.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/ip_no_id.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/ip_no_id.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/ip_no_id.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/ip_range.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/ip_range.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/ip_range.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/ip_range.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/keyword.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/keyword.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/keyword.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/keyword.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/keyword_custom_format.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/keyword_custom_format.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/keyword_custom_format.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/keyword_custom_format.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/long.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/long.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/long.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/long.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/shape.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/shape.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/shape.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/shape.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/short.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/short.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/short.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/short.json diff --git a/x-pack/plugins/lists/server/scripts/lists/new/lists/text.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/text.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/new/lists/text.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/new/lists/text.json diff --git a/x-pack/plugins/lists/server/scripts/lists/patches/ip_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/patches/ip_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/patches/ip_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/patches/ip_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/patches/simplest_updated_name.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/patches/simplest_updated_name.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/patches/simplest_updated_name.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/patches/simplest_updated_name.json diff --git a/x-pack/plugins/lists/server/scripts/lists/updates/ip_item.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/updates/ip_item.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/updates/ip_item.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/updates/ip_item.json diff --git a/x-pack/plugins/lists/server/scripts/lists/updates/simple_update.json b/x-pack/solutions/security/plugins/lists/server/scripts/lists/updates/simple_update.json similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists/updates/simple_update.json rename to x-pack/solutions/security/plugins/lists/server/scripts/lists/updates/simple_update.json diff --git a/x-pack/plugins/lists/server/scripts/lists_index_exists.sh b/x-pack/solutions/security/plugins/lists/server/scripts/lists_index_exists.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/lists_index_exists.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/lists_index_exists.sh diff --git a/x-pack/plugins/lists/server/scripts/patch_list.sh b/x-pack/solutions/security/plugins/lists/server/scripts/patch_list.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/patch_list.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/patch_list.sh diff --git a/x-pack/plugins/lists/server/scripts/patch_list_item.sh b/x-pack/solutions/security/plugins/lists/server/scripts/patch_list_item.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/patch_list_item.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/patch_list_item.sh diff --git a/x-pack/plugins/lists/server/scripts/post_endpoint_list.sh b/x-pack/solutions/security/plugins/lists/server/scripts/post_endpoint_list.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/post_endpoint_list.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/post_endpoint_list.sh diff --git a/x-pack/plugins/lists/server/scripts/post_endpoint_list_item.sh b/x-pack/solutions/security/plugins/lists/server/scripts/post_endpoint_list_item.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/post_endpoint_list_item.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/post_endpoint_list_item.sh diff --git a/x-pack/plugins/lists/server/scripts/post_exception_list.sh b/x-pack/solutions/security/plugins/lists/server/scripts/post_exception_list.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/post_exception_list.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/post_exception_list.sh diff --git a/x-pack/plugins/lists/server/scripts/post_exception_list_item.sh b/x-pack/solutions/security/plugins/lists/server/scripts/post_exception_list_item.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/post_exception_list_item.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/post_exception_list_item.sh diff --git a/x-pack/plugins/lists/server/scripts/post_list.sh b/x-pack/solutions/security/plugins/lists/server/scripts/post_list.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/post_list.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/post_list.sh diff --git a/x-pack/plugins/lists/server/scripts/post_list_index.sh b/x-pack/solutions/security/plugins/lists/server/scripts/post_list_index.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/post_list_index.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/post_list_index.sh diff --git a/x-pack/plugins/lists/server/scripts/post_list_item.sh b/x-pack/solutions/security/plugins/lists/server/scripts/post_list_item.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/post_list_item.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/post_list_item.sh diff --git a/x-pack/plugins/lists/server/scripts/post_x_exception_list_items.sh b/x-pack/solutions/security/plugins/lists/server/scripts/post_x_exception_list_items.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/post_x_exception_list_items.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/post_x_exception_list_items.sh diff --git a/x-pack/plugins/lists/server/scripts/quick_start.sh b/x-pack/solutions/security/plugins/lists/server/scripts/quick_start.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/quick_start.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/quick_start.sh diff --git a/x-pack/plugins/lists/server/scripts/quick_start_value_list_references.sh b/x-pack/solutions/security/plugins/lists/server/scripts/quick_start_value_list_references.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/quick_start_value_list_references.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/quick_start_value_list_references.sh diff --git a/x-pack/plugins/lists/server/scripts/summary_exception_list.sh b/x-pack/solutions/security/plugins/lists/server/scripts/summary_exception_list.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/summary_exception_list.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/summary_exception_list.sh diff --git a/x-pack/plugins/lists/server/scripts/update_endpoint_item.sh b/x-pack/solutions/security/plugins/lists/server/scripts/update_endpoint_item.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/update_endpoint_item.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/update_endpoint_item.sh diff --git a/x-pack/plugins/lists/server/scripts/update_exception_list.sh b/x-pack/solutions/security/plugins/lists/server/scripts/update_exception_list.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/update_exception_list.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/update_exception_list.sh diff --git a/x-pack/plugins/lists/server/scripts/update_exception_list_item.sh b/x-pack/solutions/security/plugins/lists/server/scripts/update_exception_list_item.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/update_exception_list_item.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/update_exception_list_item.sh diff --git a/x-pack/plugins/lists/server/scripts/update_list.sh b/x-pack/solutions/security/plugins/lists/server/scripts/update_list.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/update_list.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/update_list.sh diff --git a/x-pack/plugins/lists/server/scripts/update_list_item.sh b/x-pack/solutions/security/plugins/lists/server/scripts/update_list_item.sh similarity index 100% rename from x-pack/plugins/lists/server/scripts/update_list_item.sh rename to x-pack/solutions/security/plugins/lists/server/scripts/update_list_item.sh diff --git a/x-pack/plugins/lists/server/services/exception_lists/build_exception_filter.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/build_exception_filter.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/build_exception_filter.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/build_exception_filter.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/build_exception_filter.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/build_exception_filter.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/build_exception_filter.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/build_exception_filter.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/bulk_create_exception_list_items.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/bulk_create_exception_list_items.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/bulk_create_exception_list_items.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/bulk_create_exception_list_items.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/close_point_in_time.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/close_point_in_time.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/close_point_in_time.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/close_point_in_time.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/create_endpoint_list.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/create_endpoint_list.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/create_endpoint_list.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/create_endpoint_list.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/create_endpoint_trusted_apps_list.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/create_endpoint_trusted_apps_list.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/create_endpoint_trusted_apps_list.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/create_endpoint_trusted_apps_list.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/create_exception_list.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/create_exception_list.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/create_exception_list.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/create_exception_list.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/create_exception_list_item.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/create_exception_list_item.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/create_exception_list_item.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/create_exception_list_item.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/delete_exception_list.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/delete_exception_list.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/delete_exception_list.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/delete_exception_list.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/delete_exception_list_item.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/delete_exception_list_item.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/delete_exception_list_item.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/delete_exception_list_item.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/delete_exception_list_items_by_list.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/delete_exception_list_items_by_list.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/delete_exception_list_items_by_list.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/delete_exception_list_items_by_list.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/duplicate_exception_list.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/duplicate_exception_list.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/duplicate_exception_list.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/duplicate_exception_list.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/duplicate_exception_list.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/duplicate_exception_list.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/duplicate_exception_list.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/duplicate_exception_list.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/exception_list_client.mock.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/exception_list_client.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/exception_list_client.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/exception_list_client.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/exception_list_client.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/exception_list_client.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/exception_list_client.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/exception_list_client.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/exception_list_client_types.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/exception_list_client_types.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/exception_list_client_types.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/export_exception_list_and_items.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/export_exception_list_and_items.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/export_exception_list_and_items.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/export_exception_list_and_items.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/export_exception_list_and_items.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/export_exception_list_and_items.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/export_exception_list_and_items.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/export_exception_list_and_items.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/find_exception_list.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/find_exception_list.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/find_exception_list.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/find_exception_list.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/find_exception_list_item.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/find_exception_list_item.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/find_exception_list_item.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/find_exception_list_item.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/find_exception_list_item_point_in_time_finder.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/find_exception_list_item_point_in_time_finder.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/find_exception_list_item_point_in_time_finder.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/find_exception_list_item_point_in_time_finder.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/find_exception_list_items.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/find_exception_list_items.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/find_exception_list_items.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/find_exception_list_items.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/find_exception_list_items_point_in_time_finder.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/find_exception_list_items_point_in_time_finder.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/find_exception_list_items_point_in_time_finder.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/find_exception_list_items_point_in_time_finder.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/find_exception_list_point_in_time_finder.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/find_exception_list_point_in_time_finder.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/find_exception_list_point_in_time_finder.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/find_exception_list_point_in_time_finder.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/find_value_list_exception_list_items.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/find_value_list_exception_list_items.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/find_value_list_exception_list_items.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/find_value_list_exception_list_items.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/find_value_list_exception_list_items_point_in_time_finder.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/find_value_list_exception_list_items_point_in_time_finder.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/find_value_list_exception_list_items_point_in_time_finder.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/find_value_list_exception_list_items_point_in_time_finder.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/get_exception_list.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/get_exception_list.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/get_exception_list.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/get_exception_list.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/get_exception_list_item.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/get_exception_list_item.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/get_exception_list_item.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/get_exception_list_item.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/get_exception_list_summary.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/get_exception_list_summary.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/get_exception_list_summary.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/get_exception_list_summary.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/get_exception_list_summary.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/get_exception_list_summary.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/get_exception_list_summary.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/get_exception_list_summary.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/import_exception_list_and_items.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/import_exception_list_and_items.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/import_exception_list_and_items.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/import_exception_list_and_items.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/import_exception_list_and_items.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/import_exception_list_and_items.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/import_exception_list_and_items.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/import_exception_list_and_items.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/index.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/index.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/index.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/index.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/open_point_in_time.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/open_point_in_time.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/open_point_in_time.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/open_point_in_time.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/update_exception_list.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/update_exception_list.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/update_exception_list.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/update_exception_list.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/update_exception_list_item.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/update_exception_list_item.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/update_exception_list_item.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/update_exception_list_item.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/update_overwrite_exception_list_item.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/update_overwrite_exception_list_item.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/update_overwrite_exception_list_item.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/update_overwrite_exception_list_item.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/errors.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/errors.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/errors.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/errors.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/get_exception_list_filter.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/get_exception_list_filter.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/get_exception_list_filter.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/get_exception_list_filter.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/get_exception_list_filter.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/get_exception_list_filter.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/get_exception_list_filter.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/get_exception_list_filter.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/get_exception_lists_item_filter.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/get_exception_lists_item_filter.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/get_exception_lists_item_filter.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/get_exception_lists_item_filter.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/get_exception_lists_item_filter.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/get_exception_lists_item_filter.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/get_exception_lists_item_filter.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/get_exception_lists_item_filter.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/bulk_create_imported_items.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/bulk_create_imported_items.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/bulk_create_imported_items.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/bulk_create_imported_items.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/bulk_create_imported_items.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/bulk_create_imported_items.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/bulk_create_imported_items.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/bulk_create_imported_items.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/bulk_create_imported_lists.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/bulk_create_imported_lists.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/bulk_create_imported_lists.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/bulk_create_imported_lists.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/bulk_create_imported_lists.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/bulk_create_imported_lists.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/bulk_create_imported_lists.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/bulk_create_imported_lists.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/bulk_update_imported_items.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/bulk_update_imported_items.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/bulk_update_imported_items.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/bulk_update_imported_items.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/bulk_update_imported_items.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/bulk_update_imported_items.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/bulk_update_imported_items.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/bulk_update_imported_items.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/bulk_update_imported_lists.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/bulk_update_imported_lists.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/bulk_update_imported_lists.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/bulk_update_imported_lists.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/bulk_update_imported_lists.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/bulk_update_imported_lists.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/bulk_update_imported_lists.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/bulk_update_imported_lists.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/create_exceptions_stream_logic.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/create_exceptions_stream_logic.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/create_exceptions_stream_logic.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/create_exceptions_stream_logic.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/create_exceptions_stream_logic.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/create_exceptions_stream_logic.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/create_exceptions_stream_logic.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/create_exceptions_stream_logic.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/dedupe_incoming_items.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/dedupe_incoming_items.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/dedupe_incoming_items.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/dedupe_incoming_items.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/dedupe_incoming_items.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/dedupe_incoming_items.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/dedupe_incoming_items.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/dedupe_incoming_items.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/dedupe_incoming_lists.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/dedupe_incoming_lists.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/dedupe_incoming_lists.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/dedupe_incoming_lists.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/dedupe_incoming_lists.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/dedupe_incoming_lists.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/dedupe_incoming_lists.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/dedupe_incoming_lists.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/delete_list_items_to_overwrite.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/delete_list_items_to_overwrite.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/delete_list_items_to_overwrite.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/delete_list_items_to_overwrite.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/delete_list_items_to_overwrite.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/delete_list_items_to_overwrite.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/delete_list_items_to_overwrite.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/delete_list_items_to_overwrite.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/find_all_exception_list_item_types.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/find_all_exception_list_item_types.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/find_all_exception_list_item_types.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/find_all_exception_list_item_types.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/find_all_exception_list_item_types.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/find_all_exception_list_item_types.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/find_all_exception_list_item_types.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/find_all_exception_list_item_types.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/find_all_exception_list_types.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/find_all_exception_list_types.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/find_all_exception_list_types.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/find_all_exception_list_types.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/find_all_exception_list_types.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/find_all_exception_list_types.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/find_all_exception_list_types.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/find_all_exception_list_types.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/import_exception_list_items.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/import_exception_list_items.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/import_exception_list_items.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/import_exception_list_items.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/import_exception_lists.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/import_exception_lists.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/import_exception_lists.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/import_exception_lists.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/is_import_regular.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/is_import_regular.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/is_import_regular.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/is_import_regular.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/is_import_regular.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/is_import_regular.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/is_import_regular.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/is_import_regular.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_items_to_create_or_update.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/sort_exception_items_to_create_or_update.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_items_to_create_or_update.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/sort_exception_items_to_create_or_update.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_items_to_create_update.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/sort_exception_items_to_create_update.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_items_to_create_update.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/sort_exception_items_to_create_update.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_lists_to_create_or_update.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/sort_exception_lists_to_create_or_update.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_lists_to_create_or_update.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/sort_exception_lists_to_create_or_update.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_lists_to_create_update.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/sort_exception_lists_to_create_update.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_exception_lists_to_create_update.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/sort_exception_lists_to_create_update.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_import_by_namespace.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/sort_import_by_namespace.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_import_by_namespace.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/sort_import_by_namespace.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_import_by_namespace.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/sort_import_by_namespace.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_import_by_namespace.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/sort_import_by_namespace.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_import_responses.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/sort_import_responses.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_import_responses.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/sort_import_responses.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_import_responses.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/sort_import_responses.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/import/sort_import_responses.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/import/sort_import_responses.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/index.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/index.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/index.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/index.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/index.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/index.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/index.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/index.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/validate_data.test.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/validate_data.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/validate_data.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/validate_data.test.ts diff --git a/x-pack/plugins/lists/server/services/exception_lists/utils/validate_data.ts b/x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/validate_data.ts similarity index 100% rename from x-pack/plugins/lists/server/services/exception_lists/utils/validate_data.ts rename to x-pack/solutions/security/plugins/lists/server/services/exception_lists/utils/validate_data.ts diff --git a/x-pack/plugins/lists/server/services/extension_points/errors.ts b/x-pack/solutions/security/plugins/lists/server/services/extension_points/errors.ts similarity index 100% rename from x-pack/plugins/lists/server/services/extension_points/errors.ts rename to x-pack/solutions/security/plugins/lists/server/services/extension_points/errors.ts diff --git a/x-pack/plugins/lists/server/services/extension_points/extension_point_storage.mock.ts b/x-pack/solutions/security/plugins/lists/server/services/extension_points/extension_point_storage.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/services/extension_points/extension_point_storage.mock.ts rename to x-pack/solutions/security/plugins/lists/server/services/extension_points/extension_point_storage.mock.ts diff --git a/x-pack/plugins/lists/server/services/extension_points/extension_point_storage.test.ts b/x-pack/solutions/security/plugins/lists/server/services/extension_points/extension_point_storage.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/extension_points/extension_point_storage.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/extension_points/extension_point_storage.test.ts diff --git a/x-pack/plugins/lists/server/services/extension_points/extension_point_storage.ts b/x-pack/solutions/security/plugins/lists/server/services/extension_points/extension_point_storage.ts similarity index 100% rename from x-pack/plugins/lists/server/services/extension_points/extension_point_storage.ts rename to x-pack/solutions/security/plugins/lists/server/services/extension_points/extension_point_storage.ts diff --git a/x-pack/plugins/lists/server/services/extension_points/extension_point_storage_client.test.ts b/x-pack/solutions/security/plugins/lists/server/services/extension_points/extension_point_storage_client.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/extension_points/extension_point_storage_client.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/extension_points/extension_point_storage_client.test.ts diff --git a/x-pack/plugins/lists/server/services/extension_points/extension_point_storage_client.ts b/x-pack/solutions/security/plugins/lists/server/services/extension_points/extension_point_storage_client.ts similarity index 100% rename from x-pack/plugins/lists/server/services/extension_points/extension_point_storage_client.ts rename to x-pack/solutions/security/plugins/lists/server/services/extension_points/extension_point_storage_client.ts diff --git a/x-pack/plugins/lists/server/services/extension_points/index.ts b/x-pack/solutions/security/plugins/lists/server/services/extension_points/index.ts similarity index 100% rename from x-pack/plugins/lists/server/services/extension_points/index.ts rename to x-pack/solutions/security/plugins/lists/server/services/extension_points/index.ts diff --git a/x-pack/plugins/lists/server/services/extension_points/types.ts b/x-pack/solutions/security/plugins/lists/server/services/extension_points/types.ts similarity index 100% rename from x-pack/plugins/lists/server/services/extension_points/types.ts rename to x-pack/solutions/security/plugins/lists/server/services/extension_points/types.ts diff --git a/x-pack/plugins/lists/server/services/items/buffer_lines.test.ts b/x-pack/solutions/security/plugins/lists/server/services/items/buffer_lines.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/buffer_lines.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/buffer_lines.test.ts diff --git a/x-pack/plugins/lists/server/services/items/buffer_lines.ts b/x-pack/solutions/security/plugins/lists/server/services/items/buffer_lines.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/buffer_lines.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/buffer_lines.ts diff --git a/x-pack/plugins/lists/server/services/items/create_list_item.mock.ts b/x-pack/solutions/security/plugins/lists/server/services/items/create_list_item.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/create_list_item.mock.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/create_list_item.mock.ts diff --git a/x-pack/plugins/lists/server/services/items/create_list_item.test.ts b/x-pack/solutions/security/plugins/lists/server/services/items/create_list_item.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/create_list_item.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/create_list_item.test.ts diff --git a/x-pack/plugins/lists/server/services/items/create_list_item.ts b/x-pack/solutions/security/plugins/lists/server/services/items/create_list_item.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/create_list_item.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/create_list_item.ts diff --git a/x-pack/plugins/lists/server/services/items/create_list_items_bulk.mock.ts b/x-pack/solutions/security/plugins/lists/server/services/items/create_list_items_bulk.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/create_list_items_bulk.mock.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/create_list_items_bulk.mock.ts diff --git a/x-pack/plugins/lists/server/services/items/create_list_items_bulk.test.ts b/x-pack/solutions/security/plugins/lists/server/services/items/create_list_items_bulk.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/create_list_items_bulk.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/create_list_items_bulk.test.ts diff --git a/x-pack/plugins/lists/server/services/items/create_list_items_bulk.ts b/x-pack/solutions/security/plugins/lists/server/services/items/create_list_items_bulk.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/create_list_items_bulk.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/create_list_items_bulk.ts diff --git a/x-pack/plugins/lists/server/services/items/delete_list_item.mock.ts b/x-pack/solutions/security/plugins/lists/server/services/items/delete_list_item.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/delete_list_item.mock.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/delete_list_item.mock.ts diff --git a/x-pack/plugins/lists/server/services/items/delete_list_item.test.ts b/x-pack/solutions/security/plugins/lists/server/services/items/delete_list_item.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/delete_list_item.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/delete_list_item.test.ts diff --git a/x-pack/plugins/lists/server/services/items/delete_list_item.ts b/x-pack/solutions/security/plugins/lists/server/services/items/delete_list_item.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/delete_list_item.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/delete_list_item.ts diff --git a/x-pack/plugins/lists/server/services/items/delete_list_item_by_value.mock.ts b/x-pack/solutions/security/plugins/lists/server/services/items/delete_list_item_by_value.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/delete_list_item_by_value.mock.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/delete_list_item_by_value.mock.ts diff --git a/x-pack/plugins/lists/server/services/items/delete_list_item_by_value.test.ts b/x-pack/solutions/security/plugins/lists/server/services/items/delete_list_item_by_value.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/delete_list_item_by_value.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/delete_list_item_by_value.test.ts diff --git a/x-pack/plugins/lists/server/services/items/delete_list_item_by_value.ts b/x-pack/solutions/security/plugins/lists/server/services/items/delete_list_item_by_value.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/delete_list_item_by_value.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/delete_list_item_by_value.ts diff --git a/x-pack/plugins/lists/server/services/items/find_all_list_items.mock.ts b/x-pack/solutions/security/plugins/lists/server/services/items/find_all_list_items.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/find_all_list_items.mock.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/find_all_list_items.mock.ts diff --git a/x-pack/plugins/lists/server/services/items/find_all_list_items.test.ts b/x-pack/solutions/security/plugins/lists/server/services/items/find_all_list_items.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/find_all_list_items.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/find_all_list_items.test.ts diff --git a/x-pack/plugins/lists/server/services/items/find_all_list_items.ts b/x-pack/solutions/security/plugins/lists/server/services/items/find_all_list_items.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/find_all_list_items.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/find_all_list_items.ts diff --git a/x-pack/plugins/lists/server/services/items/find_list_item.mock.ts b/x-pack/solutions/security/plugins/lists/server/services/items/find_list_item.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/find_list_item.mock.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/find_list_item.mock.ts diff --git a/x-pack/plugins/lists/server/services/items/find_list_item.test.ts b/x-pack/solutions/security/plugins/lists/server/services/items/find_list_item.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/find_list_item.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/find_list_item.test.ts diff --git a/x-pack/plugins/lists/server/services/items/find_list_item.ts b/x-pack/solutions/security/plugins/lists/server/services/items/find_list_item.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/find_list_item.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/find_list_item.ts diff --git a/x-pack/plugins/lists/server/services/items/get_list_item.test.ts b/x-pack/solutions/security/plugins/lists/server/services/items/get_list_item.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/get_list_item.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/get_list_item.test.ts diff --git a/x-pack/plugins/lists/server/services/items/get_list_item.ts b/x-pack/solutions/security/plugins/lists/server/services/items/get_list_item.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/get_list_item.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/get_list_item.ts diff --git a/x-pack/plugins/lists/server/services/items/get_list_item_by_value.mock.ts b/x-pack/solutions/security/plugins/lists/server/services/items/get_list_item_by_value.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/get_list_item_by_value.mock.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/get_list_item_by_value.mock.ts diff --git a/x-pack/plugins/lists/server/services/items/get_list_item_by_value.test.ts b/x-pack/solutions/security/plugins/lists/server/services/items/get_list_item_by_value.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/get_list_item_by_value.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/get_list_item_by_value.test.ts diff --git a/x-pack/plugins/lists/server/services/items/get_list_item_by_value.ts b/x-pack/solutions/security/plugins/lists/server/services/items/get_list_item_by_value.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/get_list_item_by_value.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/get_list_item_by_value.ts diff --git a/x-pack/plugins/lists/server/services/items/get_list_item_by_values.mock.ts b/x-pack/solutions/security/plugins/lists/server/services/items/get_list_item_by_values.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/get_list_item_by_values.mock.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/get_list_item_by_values.mock.ts diff --git a/x-pack/plugins/lists/server/services/items/get_list_item_by_values.test.ts b/x-pack/solutions/security/plugins/lists/server/services/items/get_list_item_by_values.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/get_list_item_by_values.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/get_list_item_by_values.test.ts diff --git a/x-pack/plugins/lists/server/services/items/get_list_item_by_values.ts b/x-pack/solutions/security/plugins/lists/server/services/items/get_list_item_by_values.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/get_list_item_by_values.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/get_list_item_by_values.ts diff --git a/x-pack/plugins/lists/server/services/items/get_list_item_index.test.ts b/x-pack/solutions/security/plugins/lists/server/services/items/get_list_item_index.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/get_list_item_index.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/get_list_item_index.test.ts diff --git a/x-pack/plugins/lists/server/services/items/get_list_item_index.ts b/x-pack/solutions/security/plugins/lists/server/services/items/get_list_item_index.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/get_list_item_index.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/get_list_item_index.ts diff --git a/x-pack/plugins/lists/server/services/items/get_list_item_template.test.ts b/x-pack/solutions/security/plugins/lists/server/services/items/get_list_item_template.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/get_list_item_template.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/get_list_item_template.test.ts diff --git a/x-pack/plugins/lists/server/services/items/get_list_item_template.ts b/x-pack/solutions/security/plugins/lists/server/services/items/get_list_item_template.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/get_list_item_template.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/get_list_item_template.ts diff --git a/x-pack/plugins/lists/server/services/items/index.ts b/x-pack/solutions/security/plugins/lists/server/services/items/index.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/index.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/index.ts diff --git a/x-pack/plugins/lists/server/services/items/list_item_mappings.json b/x-pack/solutions/security/plugins/lists/server/services/items/list_item_mappings.json similarity index 100% rename from x-pack/plugins/lists/server/services/items/list_item_mappings.json rename to x-pack/solutions/security/plugins/lists/server/services/items/list_item_mappings.json diff --git a/x-pack/plugins/lists/server/services/items/list_item_policy.json b/x-pack/solutions/security/plugins/lists/server/services/items/list_item_policy.json similarity index 100% rename from x-pack/plugins/lists/server/services/items/list_item_policy.json rename to x-pack/solutions/security/plugins/lists/server/services/items/list_item_policy.json diff --git a/x-pack/plugins/lists/server/services/items/search_list_item_by_values.mock.ts b/x-pack/solutions/security/plugins/lists/server/services/items/search_list_item_by_values.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/search_list_item_by_values.mock.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/search_list_item_by_values.mock.ts diff --git a/x-pack/plugins/lists/server/services/items/search_list_item_by_values.test.ts b/x-pack/solutions/security/plugins/lists/server/services/items/search_list_item_by_values.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/search_list_item_by_values.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/search_list_item_by_values.test.ts diff --git a/x-pack/plugins/lists/server/services/items/search_list_item_by_values.ts b/x-pack/solutions/security/plugins/lists/server/services/items/search_list_item_by_values.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/search_list_item_by_values.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/search_list_item_by_values.ts diff --git a/x-pack/plugins/lists/server/services/items/test_readable.mock.ts b/x-pack/solutions/security/plugins/lists/server/services/items/test_readable.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/test_readable.mock.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/test_readable.mock.ts diff --git a/x-pack/plugins/lists/server/services/items/update_list_item.mock.ts b/x-pack/solutions/security/plugins/lists/server/services/items/update_list_item.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/update_list_item.mock.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/update_list_item.mock.ts diff --git a/x-pack/plugins/lists/server/services/items/update_list_item.test.ts b/x-pack/solutions/security/plugins/lists/server/services/items/update_list_item.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/update_list_item.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/update_list_item.test.ts diff --git a/x-pack/plugins/lists/server/services/items/update_list_item.ts b/x-pack/solutions/security/plugins/lists/server/services/items/update_list_item.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/update_list_item.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/update_list_item.ts diff --git a/x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.mock.ts b/x-pack/solutions/security/plugins/lists/server/services/items/write_lines_to_bulk_list_items.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.mock.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/write_lines_to_bulk_list_items.mock.ts diff --git a/x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.test.ts b/x-pack/solutions/security/plugins/lists/server/services/items/write_lines_to_bulk_list_items.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/write_lines_to_bulk_list_items.test.ts diff --git a/x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.ts b/x-pack/solutions/security/plugins/lists/server/services/items/write_lines_to_bulk_list_items.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/write_lines_to_bulk_list_items.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/write_lines_to_bulk_list_items.ts diff --git a/x-pack/plugins/lists/server/services/items/write_list_items_to_stream.test.ts b/x-pack/solutions/security/plugins/lists/server/services/items/write_list_items_to_stream.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/write_list_items_to_stream.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/write_list_items_to_stream.test.ts diff --git a/x-pack/plugins/lists/server/services/items/write_list_items_to_stream.ts b/x-pack/solutions/security/plugins/lists/server/services/items/write_list_items_to_stream.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/write_list_items_to_stream.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/write_list_items_to_stream.ts diff --git a/x-pack/plugins/lists/server/services/items/write_list_items_to_streams.mock.ts b/x-pack/solutions/security/plugins/lists/server/services/items/write_list_items_to_streams.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/services/items/write_list_items_to_streams.mock.ts rename to x-pack/solutions/security/plugins/lists/server/services/items/write_list_items_to_streams.mock.ts diff --git a/x-pack/plugins/lists/server/services/lists/create_list.mock.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/create_list.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/create_list.mock.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/create_list.mock.ts diff --git a/x-pack/plugins/lists/server/services/lists/create_list.test.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/create_list.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/create_list.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/create_list.test.ts diff --git a/x-pack/plugins/lists/server/services/lists/create_list.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/create_list.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/create_list.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/create_list.ts diff --git a/x-pack/plugins/lists/server/services/lists/create_list_if_it_does_not_exist.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/create_list_if_it_does_not_exist.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/create_list_if_it_does_not_exist.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/create_list_if_it_does_not_exist.ts diff --git a/x-pack/plugins/lists/server/services/lists/delete_list.mock.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/delete_list.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/delete_list.mock.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/delete_list.mock.ts diff --git a/x-pack/plugins/lists/server/services/lists/delete_list.test.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/delete_list.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/delete_list.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/delete_list.test.ts diff --git a/x-pack/plugins/lists/server/services/lists/delete_list.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/delete_list.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/delete_list.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/delete_list.ts diff --git a/x-pack/plugins/lists/server/services/lists/find_list.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/find_list.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/find_list.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/find_list.ts diff --git a/x-pack/plugins/lists/server/services/lists/get_list.test.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/get_list.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/get_list.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/get_list.test.ts diff --git a/x-pack/plugins/lists/server/services/lists/get_list.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/get_list.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/get_list.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/get_list.ts diff --git a/x-pack/plugins/lists/server/services/lists/get_list_index.test.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/get_list_index.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/get_list_index.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/get_list_index.test.ts diff --git a/x-pack/plugins/lists/server/services/lists/get_list_index.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/get_list_index.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/get_list_index.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/get_list_index.ts diff --git a/x-pack/plugins/lists/server/services/lists/get_list_template.test.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/get_list_template.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/get_list_template.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/get_list_template.test.ts diff --git a/x-pack/plugins/lists/server/services/lists/get_list_template.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/get_list_template.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/get_list_template.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/get_list_template.ts diff --git a/x-pack/plugins/lists/server/services/lists/index.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/index.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/index.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/index.ts diff --git a/x-pack/plugins/lists/server/services/lists/list_client.mock.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/list_client.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/list_client.mock.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/list_client.mock.ts diff --git a/x-pack/plugins/lists/server/services/lists/list_client.test.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/list_client.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/list_client.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/list_client.test.ts diff --git a/x-pack/plugins/lists/server/services/lists/list_client.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/list_client.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/list_client.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/list_client.ts diff --git a/x-pack/plugins/lists/server/services/lists/list_client_types.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/list_client_types.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/list_client_types.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/list_client_types.ts diff --git a/x-pack/plugins/lists/server/services/lists/list_mappings.json b/x-pack/solutions/security/plugins/lists/server/services/lists/list_mappings.json similarity index 100% rename from x-pack/plugins/lists/server/services/lists/list_mappings.json rename to x-pack/solutions/security/plugins/lists/server/services/lists/list_mappings.json diff --git a/x-pack/plugins/lists/server/services/lists/list_policy.json b/x-pack/solutions/security/plugins/lists/server/services/lists/list_policy.json similarity index 100% rename from x-pack/plugins/lists/server/services/lists/list_policy.json rename to x-pack/solutions/security/plugins/lists/server/services/lists/list_policy.json diff --git a/x-pack/plugins/lists/server/services/lists/types.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/types.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/types.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/types.ts diff --git a/x-pack/plugins/lists/server/services/lists/update_list.mock.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/update_list.mock.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/update_list.mock.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/update_list.mock.ts diff --git a/x-pack/plugins/lists/server/services/lists/update_list.test.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/update_list.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/update_list.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/update_list.test.ts diff --git a/x-pack/plugins/lists/server/services/lists/update_list.ts b/x-pack/solutions/security/plugins/lists/server/services/lists/update_list.ts similarity index 100% rename from x-pack/plugins/lists/server/services/lists/update_list.ts rename to x-pack/solutions/security/plugins/lists/server/services/lists/update_list.ts diff --git a/x-pack/plugins/lists/server/services/utils/calculate_scroll_math.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/calculate_scroll_math.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/calculate_scroll_math.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/calculate_scroll_math.ts diff --git a/x-pack/plugins/lists/server/services/utils/check_version_conflict.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/check_version_conflict.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/check_version_conflict.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/check_version_conflict.ts diff --git a/x-pack/plugins/lists/server/services/utils/encode_decode_cursor.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/encode_decode_cursor.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/encode_decode_cursor.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/encode_decode_cursor.ts diff --git a/x-pack/plugins/lists/server/services/utils/escape_query.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/escape_query.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/escape_query.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/escape_query.ts diff --git a/x-pack/plugins/lists/server/services/utils/find_source_type.test.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/find_source_type.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/find_source_type.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/find_source_type.test.ts diff --git a/x-pack/plugins/lists/server/services/utils/find_source_type.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/find_source_type.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/find_source_type.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/find_source_type.ts diff --git a/x-pack/plugins/lists/server/services/utils/find_source_value.test.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/find_source_value.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/find_source_value.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/find_source_value.test.ts diff --git a/x-pack/plugins/lists/server/services/utils/find_source_value.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/find_source_value.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/find_source_value.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/find_source_value.ts diff --git a/x-pack/plugins/lists/server/services/utils/get_query_filter.test.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/get_query_filter.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/get_query_filter.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/get_query_filter.test.ts diff --git a/x-pack/plugins/lists/server/services/utils/get_query_filter.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/get_query_filter.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/get_query_filter.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/get_query_filter.ts diff --git a/x-pack/plugins/lists/server/services/utils/get_query_filter_from_type_value.test.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/get_query_filter_from_type_value.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/get_query_filter_from_type_value.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/get_query_filter_from_type_value.test.ts diff --git a/x-pack/plugins/lists/server/services/utils/get_query_filter_from_type_value.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/get_query_filter_from_type_value.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/get_query_filter_from_type_value.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/get_query_filter_from_type_value.ts diff --git a/x-pack/plugins/lists/server/services/utils/get_search_after_scroll.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/get_search_after_scroll.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/get_search_after_scroll.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/get_search_after_scroll.ts diff --git a/x-pack/plugins/lists/server/services/utils/get_search_after_with_tie_breaker.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/get_search_after_with_tie_breaker.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/get_search_after_with_tie_breaker.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/get_search_after_with_tie_breaker.ts diff --git a/x-pack/plugins/lists/server/services/utils/get_sort_with_tie_breaker.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/get_sort_with_tie_breaker.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/get_sort_with_tie_breaker.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/get_sort_with_tie_breaker.ts diff --git a/x-pack/plugins/lists/server/services/utils/get_source_with_tie_breaker.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/get_source_with_tie_breaker.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/get_source_with_tie_breaker.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/get_source_with_tie_breaker.ts diff --git a/x-pack/plugins/lists/server/services/utils/index.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/index.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/index.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/index.ts diff --git a/x-pack/plugins/lists/server/services/utils/scroll_to_start_page.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/scroll_to_start_page.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/scroll_to_start_page.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/scroll_to_start_page.ts diff --git a/x-pack/plugins/lists/server/services/utils/transform_elastic_named_search_to_list_item.test.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/transform_elastic_named_search_to_list_item.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/transform_elastic_named_search_to_list_item.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/transform_elastic_named_search_to_list_item.test.ts diff --git a/x-pack/plugins/lists/server/services/utils/transform_elastic_named_search_to_list_item.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/transform_elastic_named_search_to_list_item.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/transform_elastic_named_search_to_list_item.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/transform_elastic_named_search_to_list_item.ts diff --git a/x-pack/plugins/lists/server/services/utils/transform_elastic_to_list.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/transform_elastic_to_list.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/transform_elastic_to_list.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/transform_elastic_to_list.ts diff --git a/x-pack/plugins/lists/server/services/utils/transform_elastic_to_list_item.test.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/transform_elastic_to_list_item.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/transform_elastic_to_list_item.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/transform_elastic_to_list_item.test.ts diff --git a/x-pack/plugins/lists/server/services/utils/transform_elastic_to_list_item.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/transform_elastic_to_list_item.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/transform_elastic_to_list_item.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/transform_elastic_to_list_item.ts diff --git a/x-pack/plugins/lists/server/services/utils/transform_list_item_to_elastic_query.test.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/transform_list_item_to_elastic_query.test.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/transform_list_item_to_elastic_query.test.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/transform_list_item_to_elastic_query.test.ts diff --git a/x-pack/plugins/lists/server/services/utils/transform_list_item_to_elastic_query.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/transform_list_item_to_elastic_query.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/transform_list_item_to_elastic_query.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/transform_list_item_to_elastic_query.ts diff --git a/x-pack/plugins/lists/server/services/utils/wait_until_document_indexed.ts b/x-pack/solutions/security/plugins/lists/server/services/utils/wait_until_document_indexed.ts similarity index 100% rename from x-pack/plugins/lists/server/services/utils/wait_until_document_indexed.ts rename to x-pack/solutions/security/plugins/lists/server/services/utils/wait_until_document_indexed.ts diff --git a/x-pack/plugins/lists/server/types.ts b/x-pack/solutions/security/plugins/lists/server/types.ts similarity index 100% rename from x-pack/plugins/lists/server/types.ts rename to x-pack/solutions/security/plugins/lists/server/types.ts diff --git a/x-pack/solutions/security/plugins/lists/tsconfig.json b/x-pack/solutions/security/plugins/lists/tsconfig.json new file mode 100644 index 0000000000000..c0f751d665ee8 --- /dev/null +++ b/x-pack/solutions/security/plugins/lists/tsconfig.json @@ -0,0 +1,50 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*", + // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 + "server/**/*.json" + ], + "kbn_references": [ + "@kbn/core", + "@kbn/spaces-plugin", + "@kbn/security-plugin", + "@kbn/unified-search-plugin", + "@kbn/securitysolution-io-ts-list-types", + "@kbn/securitysolution-list-constants", + "@kbn/securitysolution-list-hooks", + "@kbn/securitysolution-list-api", + "@kbn/securitysolution-lists-common", + "@kbn/securitysolution-exceptions-common", + "@kbn/securitysolution-endpoint-exceptions-common", + "@kbn/kibana-react-plugin", + "@kbn/i18n", + "@kbn/data-plugin", + "@kbn/securitysolution-list-utils", + "@kbn/securitysolution-utils", + "@kbn/es-query", + "@kbn/i18n-react", + "@kbn/securitysolution-autocomplete", + "@kbn/config-schema", + "@kbn/securitysolution-io-ts-utils", + "@kbn/core-http-server", + "@kbn/securitysolution-es-utils", + "@kbn/securitysolution-io-ts-types", + "@kbn/std", + "@kbn/utils", + "@kbn/logging-mocks", + "@kbn/utility-types", + "@kbn/core-elasticsearch-client-server-mocks", + "@kbn/core-saved-objects-server", + "@kbn/zod-helpers", + "@kbn/core-security-server", + "@kbn/core-http-server-mocks", + "@kbn/core-http-server-utils" + ], + "exclude": ["target/**/*"] +} diff --git a/x-pack/plugins/security_solution/.storybook/main.js b/x-pack/solutions/security/plugins/security_solution/.storybook/main.js similarity index 100% rename from x-pack/plugins/security_solution/.storybook/main.js rename to x-pack/solutions/security/plugins/security_solution/.storybook/main.js diff --git a/x-pack/solutions/security/plugins/security_solution/README.md b/x-pack/solutions/security/plugins/security_solution/README.md new file mode 100644 index 0000000000000..ebaaf6d7f347b --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/README.md @@ -0,0 +1,144 @@ +# Security Solution + +Welcome to the Kibana Security Solution plugin! This README will go over getting started with development and testing. + +## Development + +## Tests + +The endpoint specific tests leverage the ingest manager to install the endpoint package. Before the api integration +and functional tests are run the ingest manager is initialized. This initialization process includes reaching out to +a package registry service to install the endpoint package. The endpoint tests support three different ways to run +the tests given the constraint on an available package registry. + +1. Using Docker +2. Running your own local package registry +3. Using the default external package registry + +These scenarios will be outlined the sections below. + +### Endpoint API Integration Tests Location + +The endpoint api integration tests are located [here](../../../../test/security_solution_endpoint_api_int) + +### Endpoint Functional Tests Location + +The endpoint functional tests are located [here](../../../../test/security_solution_endpoint) + +### Using Docker + +To run the tests using the recommended docker image version you must have `docker` installed. The testing infrastructure +will stand up a docker container using the image defined [here](../../../../test/fleet_api_integration/config.ts#L15) + +Make sure you're in the Kibana root directory. + +#### Endpoint API Integration Tests + +In one terminal, run: + +```bash +FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:server --config x-pack/test/security_solution_endpoint_api_int/config.ts +``` + +In another terminal, run: + +```bash +FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/security_solution_endpoint_api_int/config.ts +``` + +#### Endpoint Functional Tests + +In one terminal, run: + +```bash +FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:server --config x-pack/test/security_solution_endpoint/config.ts +``` + +In another terminal, run: + +```bash +FLEET_PACKAGE_REGISTRY_PORT=12345 yarn test:ftr:runner --config x-pack/test/security_solution_endpoint/config.ts +``` + +### Running your own package registry + +If you are doing endpoint package development it will be useful to run your own package registry to serve the latest package you're building. +To do this use the following commands: + +Make sure you're in the Kibana root directory. + +#### Endpoint API Integration Tests + +In one terminal, run: + +```bash +PACKAGE_REGISTRY_URL_OVERRIDE=<url to your package registry like http://localhost:8080> yarn test:ftr:server --config x-pack/test/security_solution_endpoint_api_int/config.ts +``` + +In another terminal, run: + +```bash +PACKAGE_REGISTRY_URL_OVERRIDE=<url to your package registry like http://localhost:8080> yarn test:ftr:runner --config x-pack/test/security_solution_endpoint_api_int/config.ts +``` + +#### Endpoint Functional Tests + +In one terminal, run: + +```bash +PACKAGE_REGISTRY_URL_OVERRIDE=<url to your package registry like http://localhost:8080> yarn test:ftr:server --config x-pack/test/security_solution_endpoint/config.ts +``` + +In another terminal, run: + +```bash +PACKAGE_REGISTRY_URL_OVERRIDE=<url to your package registry like http://localhost:8080> yarn test:ftr:runner --config x-pack/test/security_solution_endpoint/config.ts +``` + +### Using the default public registry + +If you don't have docker installed and don't want to run your own registry, you can run the tests using the ingest manager's default public package registry. The actual package registry used is [here](../../../../plugins/fleet/common/constants/epm.ts#L9) + +Make sure you're in the Kibana root directory. + +#### Endpoint API Integration Tests + +In one terminal, run: + +```bash +yarn test:ftr:server --config x-pack/test/security_solution_endpoint_api_int/config.ts +``` + +In another terminal, run: + +```bash +yarn test:ftr:runner --config x-pack/test/security_solution_endpoint_api_int/config.ts +``` + +#### Endpoint Functional Tests + +In one terminal, run: + +```bash +yarn test:ftr:server --config x-pack/test/security_solution_endpoint/config.ts +``` + +In another terminal, run: + +```bash +yarn test:ftr:runner --config x-pack/test/security_solution_endpoint/config.ts +``` + +#### Generate huge amount of indices with huge amount of fields + +The result of this operation will be 10 separate bucket folders within `mappings_folder`. Each bucket folder will contain a `mappings.json` file describing 50 indices. + +```bash +yarn mappings:generate --fieldsCount=10000 --indexCount=500 --indexPrefix='.ds-huge' --unmappedRate=.2 --buckets=10 --outputDirectory='mappings_folder' +``` + +#### Load generated mappings + +```bash +yarn mappings:load --mappings-dir='mappings_folder' --es-url=http://username:password@localhost:9200 --kibana-url=http://username:password@localhost:5601/app +``` diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/alert_assignees/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_assignees/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/alert_assignees/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_assignees/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/alert_assignees/mocks.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_assignees/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/alert_assignees/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_assignees/mocks.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/alert_assignees/set_alert_assignees_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_assignees/set_alert_assignees_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/alert_assignees/set_alert_assignees_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_assignees/set_alert_assignees_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/alert_assignees/set_alert_assignees_route.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_assignees/set_alert_assignees_route.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/alert_assignees/set_alert_assignees_route.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_assignees/set_alert_assignees_route.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/alert_assignees/set_alert_assignees_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_assignees/set_alert_assignees_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/alert_assignees/set_alert_assignees_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_assignees/set_alert_assignees_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/alert_tags/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_tags/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/alert_tags/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_tags/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/alert_tags/mocks.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_tags/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/alert_tags/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_tags/mocks.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/alert_tags/set_alert_tags/set_alert_tags.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_tags/set_alert_tags/set_alert_tags.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/alert_tags/set_alert_tags/set_alert_tags.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_tags/set_alert_tags/set_alert_tags.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/alert_tags/set_alert_tags/set_alert_tags.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_tags/set_alert_tags/set_alert_tags.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/alert_tags/set_alert_tags/set_alert_tags.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_tags/set_alert_tags/set_alert_tags.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/alert_tags/set_alert_tags/set_alert_tags_route.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_tags/set_alert_tags/set_alert_tags_route.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/alert_tags/set_alert_tags/set_alert_tags_route.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/alert_tags/set_alert_tags/set_alert_tags_route.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/fleet_integrations/get_all_integrations/get_all_integrations_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/fleet_integrations/get_all_integrations/get_all_integrations_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/fleet_integrations/get_all_integrations/get_all_integrations_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/fleet_integrations/get_all_integrations/get_all_integrations_route.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/fleet_integrations/get_installed_integrations/get_installed_integrations_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/fleet_integrations/get_installed_integrations/get_installed_integrations_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/fleet_integrations/get_installed_integrations/get_installed_integrations_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/fleet_integrations/get_installed_integrations/get_installed_integrations_route.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/fleet_integrations/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/fleet_integrations/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/fleet_integrations/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/fleet_integrations/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/fleet_integrations/model/installed_integrations.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/fleet_integrations/model/installed_integrations.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/fleet_integrations/model/installed_integrations.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/fleet_integrations/model/installed_integrations.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/fleet_integrations/model/integrations.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/fleet_integrations/model/integrations.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/fleet_integrations/model/integrations.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/fleet_integrations/model/integrations.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/fleet_integrations/urls.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/fleet_integrations/urls.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/fleet_integrations/urls.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/fleet_integrations/urls.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/index_management/create_index/create_index.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management/create_index/create_index.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/index_management/create_index/create_index.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management/create_index/create_index.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/index_management/create_index/create_index.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management/create_index/create_index.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/index_management/create_index/create_index.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management/create_index/create_index.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/index_management/delete_index/delete_index.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management/delete_index/delete_index.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/index_management/delete_index/delete_index.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management/delete_index/delete_index.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/index_management/delete_index/delete_index.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management/delete_index/delete_index.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/index_management/delete_index/delete_index.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management/delete_index/delete_index.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/index_management/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/index_management/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/index_management/read_alerts_index_exists/read_alerts_index_exists_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management/read_alerts_index_exists/read_alerts_index_exists_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/index_management/read_alerts_index_exists/read_alerts_index_exists_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management/read_alerts_index_exists/read_alerts_index_exists_route.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/index_management/read_index/read_index.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management/read_index/read_index.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/index_management/read_index/read_index.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management/read_index/read_index.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/index_management/read_index/read_index.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management/read_index/read_index.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/index_management/read_index/read_index.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management/read_index/read_index.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/index_management/read_privileges/read_privileges.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management/read_privileges/read_privileges.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/index_management/read_privileges/read_privileges.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management/read_privileges/read_privileges.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/index_management/read_privileges/read_privileges.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management/read_privileges/read_privileges.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/index_management/read_privileges/read_privileges.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/index_management/read_privileges/read_privileges.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/8.0.0/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.0.0/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/8.0.0/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.0.0/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/8.12.0/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.12.0/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/8.12.0/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.12.0/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/8.13.0/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.13.0/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/8.13.0/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.13.0/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/8.16.0/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.16.0/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/8.16.0/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.16.0/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/8.4.0/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.4.0/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/8.4.0/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.4.0/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/8.6.0/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.6.0/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/8.6.0/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.6.0/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/8.7.0/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.7.0/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/8.7.0/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.7.0/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/8.8.0/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.8.0/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/8.8.0/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.8.0/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/8.9.0/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.9.0/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/8.9.0/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/8.9.0/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/README.md b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/README.md new file mode 100644 index 0000000000000..bd3fff96b167a --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/README.md @@ -0,0 +1,54 @@ +# Summary + +Original PR: https://github.com/elastic/kibana/pull/127218 +The goal here is to create a system of schemas that are: + +- Easy to read +- Usable historical records of alert schemas from previous Kibana versions +- Accurate for every field +- Usable on both server and client side + +# Motivation - Development speed and quality + +We have already run into one bug (https://github.com/elastic/kibana/issues/125885) where a required field was not populated in some alert documents. Once a bug ships that creates documents incorrectly, any fix requires user action to initiate a re-index of the alerts in addition to the developer time to create and validate the fix. The changes proposed here would catch this bug at compile time. These sorts of bugs become harder to catch as the schema evolves over time and fields get added, removed, and changed. Keeping the schemas separated by version will help reduce the risk of repeated schema changes over time causing fields to be incorrectly included in or omitted from alert documents. + +We are also spending more time than necessary communicating details of the alerts schema over Slack and Zoom. It will be far more efficient for the code to clearly communicate more details about the alert schema. With a more comprehensive static schema, the knowledge will transfer to new developers more efficiently. + +Static types are a powerful tool for ensuring code correctness. However, each deviation of the static type from the actual runtime structure adds places where developers may need to cast, assert, or use conditional logic to satisfy the compiler. The current static types require frequent workarounds when the static types don't match what developers know or believe is true about the runtime type of the alert documents. These runtime workarounds establish patterns that evade the type system - costing developer time to create and maintain in addition to increasing the risk of bugs due to the additional complexity. Accurate static types are excellent documentation of the data structures we use but it's crucial that the static types are comprehensive to minimize cases where runtime checks are needed. + +# Structure - Common Alert Schema Directory + +The schemas in this directory have 2 primary purposes: (1) separate the alert document schemas from the FieldMaps, and (2) set up a code structure that enables easy versioning of alert schemas. During the Detection Engine migration to the rule registry we used the FieldMaps to define the alert schema, but ended up with numerous type casts and some bugs in the process. This common directory stores the various alert schemas by Kibana version. + +x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts initially contains index.ts and one folder, 8.0.0. index.ts imports the schemas from 8.0.0 and re-exports them as ...Latest, denoting that those are the "write" schemas. The reason for this is that as we add new schemas, there are many places server side where we want to ensure that we're writing the latest alert schema. By having index.ts re-export 8.0.0 schemas, when we add make a new alert schema in the future (e.g. adding an additional field in 8.x) we can simply update index.ts to re-export the new schema instead of the previous schema. index.ts also exports a DetectionAlert which is the "read" schema - this type will be maintained as a union of all versioned alert schemas, which is needed to accurately type alerts that are read from the alerts index. + +## Reading vs writing alerts + +When writing code that deals with creating a new alert document, always use the schema from alerts/index.ts, not from a specific version folder. This way when the schema is updated in the future, your code will automatically use the latest alert schema and the static type system will tell us if code is writing alerts that don't conform to the new schema. + +When writing code that deals with reading alerts, it must be able to handle alerts from any schema version. The "read schema" in index.ts DetectionAlert is a union of all of the versioned alert schemas since a valid alert from the .alerts index could be from any version. Initially there is only one versioned schema, so DetectionAlert is identical to DetectionAlert800. + +Generally, Solution code should not be directly importing alert schemas from a specific version. Alert writing code should use the latest schema, and alert reading code should use the union of all schemas. + +## Adding new schemas + +In the future, when we want to add new fields, we should create a new folder named with the version the field is being added in, create the updated schema in the new folder, and update index.ts to re-export the schemas for the new version instead of the previous version. Also, update the "read schema" DetectionAlert type in index.ts to include the new schema in addition to the previous schemas. The schema in the new version folder can either build on the previous version, e.g. 8.4.0 could import the schema from 8.0.0 and simply add a few new fields, or for larger changes the new version could build the schema from scratch. Old schemas should not change when new fields are added! + +## Changing existing schemas + +The schema in the 8.0.0 folder, and any future versioned folders after the version is released, should not be updated with new fields. Old schemas should only be updated if a bug is discovered and it is determined that the schema does not accurately represent the alert documents that were actually written by that version, e.g. if a field is typed as string in the schema but was actually written as string[]. The goal of these schemas is to represent documents accurately as they were written and since we aren't changing the documents that already exist, the schema should generally not change. + +## No changes + +If a version of Kibana makes no changes to the schema, a new folder for that version is not needed. + +# Design decisions + +- Why not combine the FieldMaps and alert schema, creating a single structure that can define both? + FieldMaps are integrated tightly with Elasticsearch mappings already, with minimal support for accurate TypeScript types of the fields. We want to avoid adding tons of extra information in to the FieldMaps that would not be used for the Elasticsearch mappings. Instead later we can write a bit of code to ensure that the alert schemas are compatible with the FieldMap schemas, essentially ensuring that the alert schemas extend the FieldMap schemas. + +- Why is | undefined used in field definitions instead of making fields optional? + Making all fields required, but some | undefined in the type, helps ensure that we don't forget to copy over fields that may be undefined. If the field is optional, e.g. [ALERT_RULE_NOTE]?: string, then the compiler won't complain if the field is completely left out when we build the alert document. However, when it's defined as [ALERT_RULE_NOTE]: string | undefined instead, the field must be explicitly provided when creating an object literal of the alert type - even if the value is undefined. This makes it harder to forget to populate all of the fields. This can be seen in build_alert.ts where removing one of the optional fields from the return value results in a compiler error. + +- Why do we need to version the schemas instead of adding all new fields as | undefined? + Adding new fields as | undefined when they're actually required reduces the accuracy of the schema, which makes it less useful and harder to work with. If we decide to add a new field and always populate it going forward then accurately representing that in the static type makes it easier to work with alerts during the alert creation process. When a field is typed as | undefined but a developer knows that it should always exist, it encourages patterns that fight the type system through type-casting, assertions, using ?? <some default value>, etc. This makes the code harder to read, harder to reason about, and thus harder to maintain because the knowledge of "this field is typed as | undefined but actually always exists here" is not represented in the code and only lives in developers minds. Versioned alert schemas aim to turn the static types into an asset that precisely documents what the alert document structure is. diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/alerts/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/alerts/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/error_schema.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/error_schema.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/error_schema.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/error_schema.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/error_schema.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/error_schema.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/error_schema.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/error_schema.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/error_schema.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/error_schema.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/error_schema.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/error_schema.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/pagination.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/pagination.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/pagination.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/pagination.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/pagination.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/pagination.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/pagination.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/pagination.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_response_actions/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_response_actions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_response_actions/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_response_actions/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_response_actions/response_actions.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_response_actions/response_actions.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_response_actions/response_actions.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_response_actions/response_actions.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_response_actions/response_actions.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_response_actions/response_actions.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_response_actions/response_actions.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_response_actions/response_actions.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/common_attributes.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/common_attributes.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/common_attributes.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/common_attributes.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/common_attributes.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/common_attributes.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/common_attributes.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/common_attributes.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/mocks.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/mocks.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_request_schema.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_request_schema.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_request_schema.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_request_schema.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_request_schema.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_request_schema.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_request_schema.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_request_schema.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_response_schema.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_response_schema.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_response_schema.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_response_schema.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_response_schema.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_response_schema.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_response_schema.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_response_schema.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_schemas.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_schemas.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_schemas.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_schemas.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_schemas.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_schemas.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_schemas.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_schemas.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/eql_attributes.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/eql_attributes.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/eql_attributes.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/eql_attributes.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/eql_attributes.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/eql_attributes.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/eql_attributes.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/eql_attributes.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/ml_attributes.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/ml_attributes.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/ml_attributes.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/ml_attributes.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/ml_attributes.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/ml_attributes.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/ml_attributes.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/ml_attributes.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/new_terms_attributes.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/new_terms_attributes.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/new_terms_attributes.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/new_terms_attributes.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/new_terms_attributes.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/new_terms_attributes.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/new_terms_attributes.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/new_terms_attributes.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/threat_match_attributes.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/threat_match_attributes.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/threat_match_attributes.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/threat_match_attributes.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/threat_match_attributes.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/threat_match_attributes.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/threat_match_attributes.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/threat_match_attributes.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/threshold_attributes.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/threshold_attributes.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/threshold_attributes.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/threshold_attributes.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/threshold_attributes.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/threshold_attributes.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/threshold_attributes.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/specific_attributes/threshold_attributes.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/time_duration.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/time_duration.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/time_duration.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/time_duration.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/time_duration.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/time_duration.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/time_duration.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/time_duration.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/utils.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/utils.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/utils.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/schemas.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/schemas.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/schemas.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/schemas.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/sorting.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/sorting.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/sorting.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/sorting.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/sorting.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/sorting.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/sorting.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/sorting.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/sorting.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/sorting.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/sorting.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/sorting.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/warning_schema.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/warning_schema.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/warning_schema.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/warning_schema.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/model/warning_schema.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/warning_schema.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/model/warning_schema.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/warning_schema.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/bootstrap_prebuilt_rules/bootstrap_prebuilt_rules.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/bootstrap_prebuilt_rules/bootstrap_prebuilt_rules.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/bootstrap_prebuilt_rules/bootstrap_prebuilt_rules.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/bootstrap_prebuilt_rules/bootstrap_prebuilt_rules.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/bootstrap_prebuilt_rules/bootstrap_prebuilt_rules.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/bootstrap_prebuilt_rules/bootstrap_prebuilt_rules.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/bootstrap_prebuilt_rules/bootstrap_prebuilt_rules.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/bootstrap_prebuilt_rules/bootstrap_prebuilt_rules.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/get_prebuilt_rules_status/get_prebuilt_rules_status_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/get_prebuilt_rules_status/get_prebuilt_rules_status_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/get_prebuilt_rules_status/get_prebuilt_rules_status_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/get_prebuilt_rules_status/get_prebuilt_rules_status_route.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/aggregated_prebuilt_rules_error.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/aggregated_prebuilt_rules_error.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/aggregated_prebuilt_rules_error.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/aggregated_prebuilt_rules_error.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/diffable_rule/diffable_field_types.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/diffable_rule/diffable_field_types.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/diffable_rule/diffable_field_types.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/diffable_rule/diffable_field_types.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/diffable_rule/diffable_rule.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/diffable_rule/diffable_rule.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/diffable_rule/diffable_rule.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/diffable_rule/diffable_rule.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/diffable_rule/diffable_rule.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/diffable_rule/diffable_rule.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/diffable_rule/diffable_rule.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/diffable_rule/diffable_rule.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/rule_diff/fields_diff.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/rule_diff/fields_diff.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/rule_diff/fields_diff.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/rule_diff/fields_diff.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/rule_diff/rule_diff.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/rule_diff/rule_diff.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/rule_diff/rule_diff.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/rule_diff/rule_diff.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/three_way_diff/three_way_diff.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/three_way_diff/three_way_diff.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/three_way_diff/three_way_diff.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/three_way_diff/three_way_diff.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/three_way_diff/three_way_diff_conflict.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/three_way_diff/three_way_diff_conflict.ts similarity index 78% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/three_way_diff/three_way_diff_conflict.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/three_way_diff/three_way_diff_conflict.ts index 541c51d4f571f..f116f27c18e84 100644 --- a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/three_way_diff/three_way_diff_conflict.ts +++ b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/three_way_diff/three_way_diff_conflict.ts @@ -12,7 +12,7 @@ * - NO_CONFLICT: * - current == target (value won't change) * - current != target && current == base (stock rule will get a new value) - * See RFC: https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/docs/rfcs/detection_response/prebuilt_rules_customization.md#concrete-field-diff-algorithms-by-type + * See RFC: https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/rfcs/detection_response/prebuilt_rules_customization.md#concrete-field-diff-algorithms-by-type */ export enum ThreeWayDiffConflict { NONE = 'NONE', diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/three_way_diff/three_way_diff_outcome.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/three_way_diff/three_way_diff_outcome.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/three_way_diff/three_way_diff_outcome.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/three_way_diff/three_way_diff_outcome.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/three_way_diff/three_way_merge_outcome.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/three_way_diff/three_way_merge_outcome.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/three_way_diff/three_way_merge_outcome.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/diff/three_way_diff/three_way_merge_outcome.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/model/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/perform_rule_installation/perform_rule_installation_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/perform_rule_installation/perform_rule_installation_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/perform_rule_installation/perform_rule_installation_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/perform_rule_installation/perform_rule_installation_route.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/perform_rule_upgrade/perform_rule_upgrade_route.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/perform_rule_upgrade/perform_rule_upgrade_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/perform_rule_upgrade/perform_rule_upgrade_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/perform_rule_upgrade/perform_rule_upgrade_route.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/perform_rule_upgrade/perform_rule_upgrade_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/perform_rule_upgrade/perform_rule_upgrade_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/perform_rule_upgrade/perform_rule_upgrade_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/perform_rule_upgrade/perform_rule_upgrade_route.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/read_prebuilt_rules_and_timelines_status/read_prebuilt_rules_and_timelines_status_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/read_prebuilt_rules_and_timelines_status/read_prebuilt_rules_and_timelines_status_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/read_prebuilt_rules_and_timelines_status/read_prebuilt_rules_and_timelines_status_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/read_prebuilt_rules_and_timelines_status/read_prebuilt_rules_and_timelines_status_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/read_prebuilt_rules_and_timelines_status/read_prebuilt_rules_and_timelines_status_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/read_prebuilt_rules_and_timelines_status/read_prebuilt_rules_and_timelines_status_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/read_prebuilt_rules_and_timelines_status/read_prebuilt_rules_and_timelines_status_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/read_prebuilt_rules_and_timelines_status/read_prebuilt_rules_and_timelines_status_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/read_prebuilt_rules_and_timelines_status/read_prebuilt_rules_and_timelines_status_route.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/read_prebuilt_rules_and_timelines_status/read_prebuilt_rules_and_timelines_status_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/read_prebuilt_rules_and_timelines_status/read_prebuilt_rules_and_timelines_status_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/read_prebuilt_rules_and_timelines_status/read_prebuilt_rules_and_timelines_status_route.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/review_rule_installation/review_rule_installation_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/review_rule_installation/review_rule_installation_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/review_rule_installation/review_rule_installation_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/review_rule_installation/review_rule_installation_route.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/review_rule_upgrade/review_rule_upgrade_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/review_rule_upgrade/review_rule_upgrade_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/review_rule_upgrade/review_rule_upgrade_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/review_rule_upgrade/review_rule_upgrade_route.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/urls.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/urls.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/urls.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/prebuilt_rules/urls.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_exceptions/create_rule_exceptions/create_rule_exceptions_route.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_exceptions/create_rule_exceptions/create_rule_exceptions_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_exceptions/create_rule_exceptions/create_rule_exceptions_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_exceptions/create_rule_exceptions/create_rule_exceptions_route.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_exceptions/create_rule_exceptions/create_rule_exceptions_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_exceptions/create_rule_exceptions/create_rule_exceptions_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_exceptions/create_rule_exceptions/create_rule_exceptions_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_exceptions/create_rule_exceptions/create_rule_exceptions_route.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_exceptions/create_shared_exceptions_list/create_shared_exceptions_list_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_exceptions/create_shared_exceptions_list/create_shared_exceptions_list_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_exceptions/create_shared_exceptions_list/create_shared_exceptions_list_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_exceptions/create_shared_exceptions_list/create_shared_exceptions_list_route.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_exceptions/find_exception_references/find_exception_references_route.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_exceptions/find_exception_references/find_exception_references_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_exceptions/find_exception_references/find_exception_references_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_exceptions/find_exception_references/find_exception_references_route.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_exceptions/find_exception_references/find_exception_references_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_exceptions/find_exception_references/find_exception_references_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_exceptions/find_exception_references/find_exception_references_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_exceptions/find_exception_references/find_exception_references_route.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_exceptions/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_exceptions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_exceptions/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_exceptions/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_exceptions/urls.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_exceptions/urls.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_exceptions/urls.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_exceptions/urls.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_route.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_route.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_route.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_route.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_route.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_route.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_types.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_types.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_types.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_actions/bulk_actions_types.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_create_rules/bulk_create_rules_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_create_rules/bulk_create_rules_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_create_rules/bulk_create_rules_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_create_rules/bulk_create_rules_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_create_rules/bulk_create_rules_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_create_rules/bulk_create_rules_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_create_rules/bulk_create_rules_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_create_rules/bulk_create_rules_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_create_rules/bulk_create_rules_route.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_create_rules/bulk_create_rules_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_create_rules/bulk_create_rules_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_create_rules/bulk_create_rules_route.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_delete_rules/bulk_delete_rules_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_delete_rules/bulk_delete_rules_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_delete_rules/bulk_delete_rules_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_delete_rules/bulk_delete_rules_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_delete_rules/bulk_delete_rules_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_delete_rules/bulk_delete_rules_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_delete_rules/bulk_delete_rules_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_delete_rules/bulk_delete_rules_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_delete_rules/bulk_delete_rules_route.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_delete_rules/bulk_delete_rules_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_delete_rules/bulk_delete_rules_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_delete_rules/bulk_delete_rules_route.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_patch_rules/bulk_patch_rules_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_patch_rules/bulk_patch_rules_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_patch_rules/bulk_patch_rules_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_patch_rules/bulk_patch_rules_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_patch_rules/bulk_patch_rules_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_patch_rules/bulk_patch_rules_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_patch_rules/bulk_patch_rules_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_patch_rules/bulk_patch_rules_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_patch_rules/bulk_patch_rules_route.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_patch_rules/bulk_patch_rules_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_patch_rules/bulk_patch_rules_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_patch_rules/bulk_patch_rules_route.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_update_rules/bulk_update_rules_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_update_rules/bulk_update_rules_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_update_rules/bulk_update_rules_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_update_rules/bulk_update_rules_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_update_rules/bulk_update_rules_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_update_rules/bulk_update_rules_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_update_rules/bulk_update_rules_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_update_rules/bulk_update_rules_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_update_rules/bulk_update_rules_route.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_update_rules/bulk_update_rules_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_update_rules/bulk_update_rules_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/bulk_update_rules/bulk_update_rules_route.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/response_schema.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/response_schema.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/response_schema.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/response_schema.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/response_schema.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/response_schema.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/response_schema.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/response_schema.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/response_schema.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/response_schema.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/response_schema.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/bulk_crud/response_schema.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/coverage_overview/coverage_overview_route.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/coverage_overview/coverage_overview_route.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/coverage_overview/coverage_overview_route.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/coverage_overview/coverage_overview_route.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/coverage_overview/coverage_overview_route.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/coverage_overview/coverage_overview_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/coverage_overview/coverage_overview_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/coverage_overview/coverage_overview_route.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/coverage_overview/coverage_overview_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/coverage_overview/coverage_overview_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/coverage_overview/coverage_overview_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/coverage_overview/coverage_overview_route.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/create_rule/create_rule_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/create_rule/create_rule_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/create_rule/create_rule_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/create_rule/create_rule_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/create_rule/create_rule_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/create_rule/create_rule_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/create_rule/create_rule_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/create_rule/create_rule_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/create_rule/request_schema_validation.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/create_rule/request_schema_validation.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/create_rule/request_schema_validation.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/create_rule/request_schema_validation.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/create_rule/request_schema_validation.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/create_rule/request_schema_validation.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/create_rule/request_schema_validation.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/create_rule/request_schema_validation.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/delete_rule/delete_rule_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/delete_rule/delete_rule_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/delete_rule/delete_rule_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/delete_rule/delete_rule_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/delete_rule/delete_rule_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/delete_rule/delete_rule_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/delete_rule/delete_rule_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/delete_rule/delete_rule_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/patch_rule_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/patch_rule_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/patch_rule_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/patch_rule_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/patch_rule_route.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/patch_rule_route.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/patch_rule_route.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/patch_rule_route.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/patch_rule_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/patch_rule_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/patch_rule_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/patch_rule_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/patch_rule_route.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/patch_rule_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/patch_rule_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/patch_rule_route.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/request_schema_validation.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/request_schema_validation.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/request_schema_validation.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/request_schema_validation.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/request_schema_validation.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/request_schema_validation.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/request_schema_validation.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/patch_rule/request_schema_validation.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/read_rule/read_rule_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/read_rule/read_rule_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/read_rule/read_rule_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/read_rule/read_rule_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/read_rule/read_rule_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/read_rule/read_rule_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/read_rule/read_rule_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/read_rule/read_rule_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/update_rule/request_schema_validation.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/update_rule/request_schema_validation.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/update_rule/request_schema_validation.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/update_rule/request_schema_validation.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/update_rule/request_schema_validation.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/update_rule/request_schema_validation.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/update_rule/request_schema_validation.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/update_rule/request_schema_validation.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/update_rule/update_rule_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/update_rule/update_rule_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/update_rule/update_rule_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/update_rule/update_rule_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/update_rule/update_rule_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/update_rule/update_rule_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/crud/update_rule/update_rule_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/crud/update_rule/update_rule_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_details_schema.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_details_schema.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_details_schema.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_details_schema.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_details_schema.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_details_schema.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_details_schema.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_details_schema.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_details_schema.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_details_schema.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_details_schema.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_details_schema.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_route.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/export_rules/export_rules_route.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/find_rules/find_rules_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/find_rules/find_rules_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/find_rules/find_rules_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/find_rules/find_rules_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/find_rules/find_rules_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/find_rules/find_rules_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/find_rules/find_rules_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/find_rules/find_rules_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/find_rules/find_rules_route.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/find_rules/find_rules_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/find_rules/find_rules_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/find_rules/find_rules_route.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/find_rules/request_schema_validation.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/find_rules/request_schema_validation.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/find_rules/request_schema_validation.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/find_rules/request_schema_validation.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/find_rules/request_schema_validation.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/find_rules/request_schema_validation.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/find_rules/request_schema_validation.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/find_rules/request_schema_validation.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/get_rule_management_filters/get_rule_management_filters_route.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/get_rule_management_filters/get_rule_management_filters_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/get_rule_management_filters/get_rule_management_filters_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/get_rule_management_filters/get_rule_management_filters_route.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/get_rule_management_filters/get_rule_management_filters_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/get_rule_management_filters/get_rule_management_filters_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/get_rule_management_filters/get_rule_management_filters_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/get_rule_management_filters/get_rule_management_filters_route.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/import_rules_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/import_rules_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/import_rules_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/import_rules_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/import_rules_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/import_rules_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/import_rules_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/import_rules_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/import_rules_route.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/import_rules_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/import_rules_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/import_rules_route.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import_validation.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import_validation.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import_validation.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import_validation.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import_validation.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import_validation.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import_validation.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import_validation.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/mocks.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/mocks.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/model/query_rule_by_ids_validation.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/model/query_rule_by_ids_validation.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/model/query_rule_by_ids_validation.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/model/query_rule_by_ids_validation.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/model/query_rule_by_ids_validation.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/model/query_rule_by_ids_validation.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/model/query_rule_by_ids_validation.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/model/query_rule_by_ids_validation.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/read_tags/read_tags_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/read_tags/read_tags_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/read_tags/read_tags_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/read_tags/read_tags_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/read_tags/read_tags_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/read_tags/read_tags_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/read_tags/read_tags_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/read_tags/read_tags_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/urls.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/urls.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_management/urls.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/urls.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/README.md b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/README.md similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/README.md rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/README.md diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/get_cluster_health/get_cluster_health_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/get_cluster_health/get_cluster_health_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/get_cluster_health/get_cluster_health_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/get_cluster_health/get_cluster_health_route.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/get_rule_health/get_rule_health_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/get_rule_health/get_rule_health_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/get_rule_health/get_rule_health_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/get_rule_health/get_rule_health_route.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/get_space_health/get_space_health_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/get_space_health/get_space_health_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/get_space_health/get_space_health_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/get_space_health/get_space_health_route.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/health_data.md b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/health_data.md similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/health_data.md rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/health_data.md diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/health_endpoints.md b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/health_endpoints.md similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/health_endpoints.md rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/health_endpoints.md diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/cluster_health.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/cluster_health.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/cluster_health.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/cluster_health.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/cluster_health.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/cluster_health.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/cluster_health.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/cluster_health.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/health_interval.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/health_interval.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/health_interval.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/health_interval.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/health_metadata.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/health_metadata.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/health_metadata.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/health_metadata.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/health_stats.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/health_stats.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/health_stats.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/health_stats.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/health_stats.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/health_stats.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/health_stats.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/health_stats.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/rule_health.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/rule_health.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/rule_health.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/rule_health.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/rule_health.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/rule_health.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/rule_health.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/rule_health.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/space_health.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/space_health.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/space_health.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/space_health.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/space_health.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/space_health.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/space_health.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/model/space_health.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/setup_health/setup_health_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/setup_health/setup_health_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/setup_health/setup_health_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/detection_engine_health/setup_health/setup_health_route.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/mocks.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/mocks.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_event.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_event.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_event.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_event.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_event.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_event.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_event.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_event.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_event.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_event.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_event.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_event.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_metrics.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_metrics.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_metrics.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_metrics.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_metrics.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_metrics.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_metrics.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_metrics.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_result.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_result.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_result.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_result.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_result.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_result.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_result.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_result.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_result.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_result.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_result.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_result.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_run_type.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_run_type.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_run_type.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_run_type.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_run_type.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_run_type.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_run_type.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_run_type.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_settings.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_settings.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_settings.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_settings.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_status.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_status.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_status.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_status.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_status.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_status.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_status.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_status.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_status.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_status.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_status.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_status.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_summary.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_summary.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_summary.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_summary.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_summary.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_summary.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_summary.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_summary.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_summary.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_summary.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_summary.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/execution_summary.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/log_level.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/log_level.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/log_level.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/model/log_level.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.test.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/urls.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/urls.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_monitoring/urls.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_monitoring/urls.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_preview/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_preview/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_preview/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_preview/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_preview/rule_preview.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_preview/rule_preview.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_preview/rule_preview.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_preview/rule_preview.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/rule_preview/rule_preview.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_preview/rule_preview.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/rule_preview/rule_preview.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_preview/rule_preview.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/signals/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/signals/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/signals/query_signals/query_signals_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals/query_signals/query_signals_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/signals/query_signals/query_signals_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals/query_signals/query_signals_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/signals/query_signals/query_signals_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals/query_signals/query_signals_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/signals/query_signals/query_signals_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals/query_signals/query_signals_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/signals/set_signal_status/set_signals_status_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals/set_signal_status/set_signals_status_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/signals/set_signal_status/set_signals_status_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals/set_signal_status/set_signals_status_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/signals/set_signal_status/set_signals_status_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals/set_signal_status/set_signals_status_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/signals/set_signal_status/set_signals_status_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals/set_signal_status/set_signals_status_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/create_signals_migration/create_signals_migration.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/create_signals_migration/create_signals_migration.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/create_signals_migration/create_signals_migration.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/create_signals_migration/create_signals_migration.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/create_signals_migration/create_signals_migration.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/create_signals_migration/create_signals_migration.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/create_signals_migration/create_signals_migration.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/create_signals_migration/create_signals_migration.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/create_signals_migration/create_signals_migration_route.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/create_signals_migration/create_signals_migration_route.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/create_signals_migration/create_signals_migration_route.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/create_signals_migration/create_signals_migration_route.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/delete_signals_migration/delete_signals_migration.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/delete_signals_migration/delete_signals_migration.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/delete_signals_migration/delete_signals_migration.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/delete_signals_migration/delete_signals_migration.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/delete_signals_migration/delete_signals_migration.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/delete_signals_migration/delete_signals_migration.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/delete_signals_migration/delete_signals_migration.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/delete_signals_migration/delete_signals_migration.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/finalize_signals_migration/finalize_signals_migration.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/finalize_signals_migration/finalize_signals_migration.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/finalize_signals_migration/finalize_signals_migration.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/finalize_signals_migration/finalize_signals_migration.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/finalize_signals_migration/finalize_signals_migration.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/finalize_signals_migration/finalize_signals_migration.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/finalize_signals_migration/finalize_signals_migration.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/finalize_signals_migration/finalize_signals_migration.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/finalize_signals_migration/finalize_signals_migration_route.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/finalize_signals_migration/finalize_signals_migration_route.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/finalize_signals_migration/finalize_signals_migration_route.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/finalize_signals_migration/finalize_signals_migration_route.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/mocks.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/mocks.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/read_signals_migration_status/read_signals_migration_status.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/read_signals_migration_status/read_signals_migration_status.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/read_signals_migration_status/read_signals_migration_status.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/read_signals_migration_status/read_signals_migration_status.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/read_signals_migration_status/read_signals_migration_status.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/read_signals_migration_status/read_signals_migration_status.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/read_signals_migration_status/read_signals_migration_status.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/read_signals_migration_status/read_signals_migration_status.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/read_signals_migration_status/read_signals_migration_status_route.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/read_signals_migration_status/read_signals_migration_status_route.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/signals_migration/read_signals_migration_status/read_signals_migration_status_route.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/signals_migration/read_signals_migration_status/read_signals_migration_status_route.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/users/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/users/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/users/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/users/index.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/users/suggest_user_profiles_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/users/suggest_user_profiles_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/users/suggest_user_profiles_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/users/suggest_user_profiles_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/users/suggest_user_profiles_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/users/suggest_user_profiles_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/detection_engine/users/suggest_user_profiles_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/users/suggest_user_profiles_route.schema.yaml diff --git a/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/README.md b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/README.md new file mode 100644 index 0000000000000..947dcb98c7e46 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/README.md @@ -0,0 +1,63 @@ +## Elastic Defend related APIs developer reference + + +### Directory structure and files + +- All the OpenAPI schemas are located under this directory and organized by sub-directories that reflect the API domain. +- Note that the sub-directory names for individual APIs are defined using snake_case to match the associated API path. +- The `model/` directory stores common schemas for re-use across multiple APIs. + +- Each API has at least the following set of files: + +``` +index.ts +<api_route_name>.ts +<api_route_name>.gen.ts +<api_route_name>.schema.yaml +``` + +#### `index.ts` file + +The `index.ts` file found under each API directory exports both the generated and the kibana config schemas. + + +#### `<api_route_name>.ts` file + +This file contains the Kibana `schema` definition that is used on the server side when the route is registered. This file is manually updated whenever needed. + + +#### `<api_route_name>.schema.yaml` file + +This file defines and describes the API using the OpenAPI standard. + + +#### `<api_route_name>.gen.ts` file + +This is a generated file and should not be updated manually. It contains schema validation code generated using the [Zod library](https://github.com/colinhacks/zod). + + + + + +### Making changes + +1. Update the OpenAPI schema YML file and/or the Kibana schema file (see References below for help with OpenAPI YAML format) +2. Generate/re-generate the Zod schema validation modules: +```shell +yarn --cwd x-pack/solutions/security/plugins/security_solution openapi:generate +``` +3. Create a new bundle with the updated APIs: +```shell +yarn --cwd x-pack/solutions/security/plugins/security_solution openapi:bundle:endpoint-management +``` +4. Ensure that the newly generated files are commited to source + + + +### References + +- [Kibana OpenAPI generator Usage Guide](https://github.com/elastic/kibana/blob/main/packages/kbn-openapi-generator/docs/USAGE_GUIDE.md) +- [Open API documentation](https://spec.openapis.org/oas/v3.0.3#document-structure) +- [Swagger documentation](https://swagger.io/docs/specification/basic-structure/) + + diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/action_log/action_log.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/action_log/action_log.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/action_log/action_log.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/action_log/action_log.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/action_log/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/action_log/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/action_log/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/action_log/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/common/base.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/common/base.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/common/base.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/common/base.ts diff --git a/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/common/response_actions.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/common/response_actions.ts new file mode 100644 index 0000000000000..3a765e0c83134 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/common/response_actions.ts @@ -0,0 +1,35 @@ +/* + * 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 { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; + +import { ExecuteActionRequestSchema } from '../response_actions/execute'; +import { EndpointActionGetFileSchema } from '../response_actions/get_file'; +import { ScanActionRequestSchema } from '../response_actions/scan'; +import { IsolateRouteRequestSchema } from '../response_actions/isolate'; +import { UnisolateRouteRequestSchema } from '../response_actions/unisolate'; +import { GetProcessesRouteRequestSchema } from '../response_actions/running_procs'; +import { KillProcessRouteRequestSchema } from '../response_actions/kill_process'; +import { SuspendProcessRouteRequestSchema } from '../response_actions/suspend_process'; +import { UploadActionRequestSchema } from '../response_actions/upload'; +import { RunScriptActionRequestSchema } from '../response_actions/run_script'; + +export const ResponseActionBodySchema = schema.oneOf([ + IsolateRouteRequestSchema.body, + UnisolateRouteRequestSchema.body, + GetProcessesRouteRequestSchema.body, + KillProcessRouteRequestSchema.body, + SuspendProcessRouteRequestSchema.body, + EndpointActionGetFileSchema.body, + ExecuteActionRequestSchema.body, + UploadActionRequestSchema.body, + ScanActionRequestSchema.body, + RunScriptActionRequestSchema.body, +]); + +export type ResponseActionsRequestBody = TypeOf<typeof ResponseActionBodySchema>; diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/details/details.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/details/details.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/details/details.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/details/details.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/details/details.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/details/details.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/details/details.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/details/details.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/details/details.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/details/details.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/details/details.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/details/details.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/details/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/details/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/details/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/details/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/file_download/file_download.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/file_download/file_download.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/file_download/file_download.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/file_download/file_download.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/file_download/file_download.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/file_download/file_download.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/file_download/file_download.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/file_download/file_download.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/file_download/file_download.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/file_download/file_download.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/file_download/file_download.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/file_download/file_download.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/file_download/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/file_download/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/file_download/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/file_download/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/file_info/file_info.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/file_info/file_info.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/file_info/file_info.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/file_info/file_info.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/file_info/file_info.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/file_info/file_info.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/file_info/file_info.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/file_info/file_info.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/file_info/file_info.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/file_info/file_info.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/file_info/file_info.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/file_info/file_info.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/file_info/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/file_info/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/file_info/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/file_info/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/list/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/list/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/list/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/list/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/list/list.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/list/list.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/list/list.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/list/list.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/list/list.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/list/list.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/list/list.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/list/list.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/list/list.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/list/list.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/list/list.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/list/list.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/execute/execute.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/execute/execute.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/execute/execute.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/execute/execute.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/execute/execute.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/execute/execute.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/execute/execute.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/execute/execute.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/execute/execute.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/execute/execute.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/execute/execute.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/execute/execute.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/execute/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/execute/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/execute/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/execute/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/get_file/get_file.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/get_file/get_file.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/get_file/get_file.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/get_file/get_file.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/get_file/get_file.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/get_file/get_file.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/get_file/get_file.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/get_file/get_file.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/get_file/get_file.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/get_file/get_file.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/get_file/get_file.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/get_file/get_file.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/get_file/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/get_file/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/get_file/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/get_file/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/isolate/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/isolate/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/isolate/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/isolate/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/isolate/isolate.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/isolate/isolate.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/isolate/isolate.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/isolate/isolate.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/isolate/isolate.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/isolate/isolate.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/isolate/isolate.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/isolate/isolate.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/isolate/isolate.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/isolate/isolate.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/isolate/isolate.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/isolate/isolate.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/kill_process/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/kill_process/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/kill_process/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/kill_process/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/kill_process/kill_process.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/kill_process/kill_process.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/kill_process/kill_process.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/kill_process/kill_process.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/kill_process/kill_process.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/kill_process/kill_process.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/kill_process/kill_process.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/kill_process/kill_process.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/kill_process/kill_process.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/kill_process/kill_process.ts similarity index 94% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/kill_process/kill_process.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/kill_process/kill_process.ts index 0d42cb8badda1..3bb193cc71092 100644 --- a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/kill_process/kill_process.ts +++ b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/kill_process/kill_process.ts @@ -11,7 +11,7 @@ import { BaseActionRequestSchema } from '../../common/base'; // -------------------------------------------------- // Tests for this module are at: -// x-pack/plugins/security_solution/common/endpoint/schema/actions.test.ts:604 +// x-pack/solutions/security/plugins/security_solution/common/endpoint/schema/actions.test.ts:604 // -------------------------------------------------- export const KillProcessRouteRequestSchema = { diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/run_script.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/run_script.ts similarity index 82% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/run_script.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/run_script.ts index dfa88941b34e0..95c035e866884 100644 --- a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/run_script.ts +++ b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/run_script.ts @@ -26,27 +26,27 @@ export const RunScriptActionRequestSchema = { /** * The script to run */ - Raw: schema.maybe(NonEmptyString), + raw: schema.maybe(NonEmptyString), /** * The path to the script on the host to run */ - HostPath: schema.maybe(NonEmptyString), + hostPath: schema.maybe(NonEmptyString), /** * The path to the script in the cloud to run */ - CloudFile: schema.maybe(NonEmptyString), + cloudFile: schema.maybe(NonEmptyString), /** * The command line to run */ - CommandLine: schema.maybe(NonEmptyString), + commandLine: schema.maybe(NonEmptyString), /** * The max timeout value before the command is killed. Number represents milliseconds */ - Timeout: schema.maybe(schema.number({ min: 1 })), + timeout: schema.maybe(schema.number({ min: 1 })), }, { validate: (params) => { - if (!params.Raw && !params.HostPath && !params.CloudFile) { + if (!params.raw && !params.hostPath && !params.cloudFile) { return 'At least one of Raw, HostPath, or CloudFile must be provided'; } }, diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/run_script.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/run_script.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/run_script.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/run_script.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/running_procs/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/running_procs/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/running_procs/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/running_procs/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/running_procs/running_procs.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/running_procs/running_procs.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/running_procs/running_procs.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/running_procs/running_procs.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/running_procs/running_procs.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/running_procs/running_procs.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/running_procs/running_procs.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/running_procs/running_procs.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/running_procs/running_procs.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/running_procs/running_procs.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/running_procs/running_procs.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/running_procs/running_procs.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/scan/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/scan/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/scan/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/scan/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/scan/scan.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/scan/scan.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/scan/scan.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/scan/scan.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/scan/scan.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/scan/scan.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/scan/scan.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/scan/scan.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/scan/scan.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/scan/scan.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/scan/scan.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/scan/scan.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/suspend_process/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/suspend_process/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/suspend_process/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/suspend_process/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/suspend_process/suspend_process.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/suspend_process/suspend_process.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/suspend_process/suspend_process.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/suspend_process/suspend_process.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/suspend_process/suspend_process.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/suspend_process/suspend_process.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/suspend_process/suspend_process.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/suspend_process/suspend_process.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/suspend_process/suspend_process.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/suspend_process/suspend_process.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/suspend_process/suspend_process.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/suspend_process/suspend_process.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/unisolate/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/unisolate/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/unisolate/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/unisolate/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/unisolate/unisolate.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/unisolate/unisolate.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/unisolate/unisolate.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/unisolate/unisolate.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/unisolate/unisolate.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/unisolate/unisolate.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/unisolate/unisolate.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/unisolate/unisolate.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/unisolate/unisolate.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/unisolate/unisolate.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/unisolate/unisolate.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/unisolate/unisolate.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/upload/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/upload/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/upload/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/upload/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/upload/upload.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/upload/upload.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/upload/upload.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/upload/upload.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/upload/upload.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/upload/upload.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/upload/upload.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/upload/upload.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/upload/upload.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/upload/upload.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/upload/upload.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/upload/upload.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/state/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/state/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/state/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/state/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/state/state.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/state/state.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/state/state.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/state/state.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/state/state.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/state/state.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/state/state.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/state/state.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/status/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/status/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/status/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/status/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/status/status.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/status/status.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/status/status.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/status/status.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/status/status.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/status/status.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/status/status.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/status/status.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/status/status.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/status/status.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/actions/status/status.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/status/status.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/agent/get_agent_status_route.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/agent/get_agent_status_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/agent/get_agent_status_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/agent/get_agent_status_route.test.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/agent/get_agent_status_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/agent/get_agent_status_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/agent/get_agent_status_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/agent/get_agent_status_route.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/metadata/get_metadata.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/metadata/get_metadata.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/metadata/get_metadata.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/metadata/get_metadata.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/metadata/get_metadata.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/metadata/get_metadata.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/metadata/get_metadata.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/metadata/get_metadata.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/metadata/get_metadata.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/metadata/get_metadata.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/metadata/get_metadata.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/metadata/get_metadata.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/metadata/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/metadata/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/metadata/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/metadata/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/metadata/list_metadata.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/metadata/list_metadata.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/metadata/list_metadata.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/metadata/list_metadata.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/metadata/list_metadata.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/metadata/list_metadata.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/metadata/list_metadata.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/metadata/list_metadata.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/metadata/list_metadata.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/metadata/list_metadata.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/metadata/list_metadata.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/metadata/list_metadata.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/model/schema/common.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/model/schema/common.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/model/schema/common.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/model/schema/common.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/model/schema/common.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/model/schema/common.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/model/schema/common.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/model/schema/common.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/policy/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/policy/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/policy/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/policy/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/policy/policy_response.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/policy/policy_response.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/policy/policy_response.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/policy/policy_response.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/policy/policy_response.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/policy/policy_response.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/policy/policy_response.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/policy/policy_response.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/policy/policy_response.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/policy/policy_response.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/policy/policy_response.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/policy/policy_response.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/protection_updates_note/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/protection_updates_note/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/protection_updates_note/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/protection_updates_note/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/protection_updates_note/protection_updates_note.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/protection_updates_note/protection_updates_note.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/protection_updates_note/protection_updates_note.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/protection_updates_note/protection_updates_note.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/protection_updates_note/protection_updates_note.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/protection_updates_note/protection_updates_note.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/protection_updates_note/protection_updates_note.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/protection_updates_note/protection_updates_note.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/protection_updates_note/protection_updates_note.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/protection_updates_note/protection_updates_note.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/protection_updates_note/protection_updates_note.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/protection_updates_note/protection_updates_note.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/suggestions/get_suggestions.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/suggestions/get_suggestions.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/suggestions/get_suggestions.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/suggestions/get_suggestions.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/suggestions/get_suggestions.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/suggestions/get_suggestions.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/suggestions/get_suggestions.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/suggestions/get_suggestions.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/suggestions/get_suggestions.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/suggestions/get_suggestions.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/suggestions/get_suggestions.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/suggestions/get_suggestions.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/suggestions/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/suggestions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/suggestions/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/suggestions/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/workflow_insights/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/workflow_insights/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/workflow_insights/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/workflow_insights/index.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/workflow_insights/workflow_insights.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/workflow_insights/workflow_insights.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/workflow_insights/workflow_insights.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/workflow_insights/workflow_insights.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/workflow_insights/workflow_insights.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/workflow_insights/workflow_insights.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/workflow_insights/workflow_insights.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/workflow_insights/workflow_insights.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/endpoint/workflow_insights/workflow_insights.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/workflow_insights/workflow_insights.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/workflow_insights/workflow_insights.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/workflow_insights/workflow_insights.test.ts diff --git a/x-pack/plugins/security_solution/common/api/endpoint/workflow_insights/workflow_insights.ts b/x-pack/solutions/security/plugins/security_solution/common/api/endpoint/workflow_insights/workflow_insights.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/endpoint/workflow_insights/workflow_insights.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/endpoint/workflow_insights/workflow_insights.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/bulk_upload_asset_criticality.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/bulk_upload_asset_criticality.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/bulk_upload_asset_criticality.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/bulk_upload_asset_criticality.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/bulk_upload_asset_criticality.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/bulk_upload_asset_criticality.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/bulk_upload_asset_criticality.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/bulk_upload_asset_criticality.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/common.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/common.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/common.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/common.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/common.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/common.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/common.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/common.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/create_asset_criticality.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/create_asset_criticality.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/create_asset_criticality.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/create_asset_criticality.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/create_asset_criticality.schema.yaml b/x-pack/solutions/security/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/entity_analytics/asset_criticality/create_asset_criticality.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/create_asset_criticality.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/delete_asset_criticality.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/delete_asset_criticality.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/delete_asset_criticality.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/delete_asset_criticality.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/delete_asset_criticality.schema.yaml b/x-pack/solutions/security/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/entity_analytics/asset_criticality/delete_asset_criticality.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/delete_asset_criticality.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality.schema.yaml b/x-pack/solutions/security/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/entity_analytics/asset_criticality/get_asset_criticality.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality_privileges.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality_privileges.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality_privileges.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality_privileges.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality_privileges.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality_privileges.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality_privileges.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality_privileges.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/get_asset_criticality_status.gen.ts b/x-pack/solutions/security/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/entity_analytics/asset_criticality/get_asset_criticality_status.gen.ts rename to x-pack/solutions/security/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/entity_analytics/asset_criticality/get_asset_criticality_status.schema.yaml b/x-pack/solutions/security/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/entity_analytics/asset_criticality/get_asset_criticality_status.schema.yaml rename to x-pack/solutions/security/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/entity_analytics/asset_criticality/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/index.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/list_asset_criticality.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/list_asset_criticality.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/list_asset_criticality.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/list_asset_criticality.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/list_asset_criticality.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/list_asset_criticality.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/list_asset_criticality.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/list_asset_criticality.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/upload_asset_criticality_csv.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/upload_asset_criticality_csv.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/upload_asset_criticality_csv.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/upload_asset_criticality_csv.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/upload_asset_criticality_csv.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/upload_asset_criticality_csv.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/asset_criticality/upload_asset_criticality_csv.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/asset_criticality/upload_asset_criticality_csv.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/common/after_keys.schema.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/common/after_keys.schema.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/common/after_keys.schema.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/common/after_keys.schema.test.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/common/common.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/common/common.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/common/common.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/common/common.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/common/common.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/common/common.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/common/common.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/common/common.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/common/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/common/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/common/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/common/index.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/common/risk_weights.schema.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/common/risk_weights.schema.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/common/risk_weights.schema.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/common/risk_weights.schema.test.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/common.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/common.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/common.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/common.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/common.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/common.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/common.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/common.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/enable.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/enable.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/enable.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/enable.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/enable.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/enable.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/enable.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/enable.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/apply_dataview_indices.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/apply_dataview_indices.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/apply_dataview_indices.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/apply_dataview_indices.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/apply_dataview_indices.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/apply_dataview_indices.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/apply_dataview_indices.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/apply_dataview_indices.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/delete.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/delete.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/delete.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/delete.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/delete.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/delete.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/delete.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/delete.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/get.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/get.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/get.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/get.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/get.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/get.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/get.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/get.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/get_privileges.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/get_privileges.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/get_privileges.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/get_privileges.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/get_privileges.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/get_privileges.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/get_privileges.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/get_privileges.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/index.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/init.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/init.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/init.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/init.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/init.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/init.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/init.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/init.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/list.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/list.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/list.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/list.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/list.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/list.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/list.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/list.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/start.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/start.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/start.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/start.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/start.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/start.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/start.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/start.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/stop.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/stop.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/stop.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/stop.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/stop.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/stop.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/engine/stop.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/engine/stop.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/entities/common.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/entities/common.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/entities/common.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/entities/common.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/entities/common.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/entities/common.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/entities/common.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/entities/common.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/entities/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/entities/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/entities/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/entities/index.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/entities/list_entities.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/entities/list_entities.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/entities/list_entities.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/entities/list_entities.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/entities/list_entities.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/entities/list_entities.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/entities/list_entities.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/entities/list_entities.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/index.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/status.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/status.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/status.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/status.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/status.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/status.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/entity_store/status.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/entity_store/status.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/index.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/calculation_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/calculation_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/calculation_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/calculation_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/calculation_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/calculation_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/calculation_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/calculation_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_cleanup_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_cleanup_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_cleanup_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_cleanup_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_cleanup_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_cleanup_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_cleanup_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_cleanup_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_configure_saved_object_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_configure_saved_object_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_configure_saved_object_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_configure_saved_object_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_configure_saved_object_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_configure_saved_object_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_configure_saved_object_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_configure_saved_object_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_disable_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_disable_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_disable_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_disable_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_disable_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_disable_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_disable_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_disable_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_enable_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_enable_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_enable_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_enable_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_enable_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_enable_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_enable_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_enable_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_init_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_init_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_init_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_init_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_init_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_init_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_init_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_init_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_schedule_now_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_schedule_now_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_schedule_now_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_schedule_now_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_schedule_now_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_schedule_now_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_schedule_now_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_schedule_now_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_settings_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_settings_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_settings_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_settings_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_settings_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_settings_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_settings_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_settings_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_status_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_status_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_status_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_status_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_status_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_status_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_status_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_status_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/entity_calculation_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/entity_calculation_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/entity_calculation_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/entity_calculation_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/entity_calculation_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/entity_calculation_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/entity_calculation_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/entity_calculation_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/get_risk_engine_privileges.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/get_risk_engine_privileges.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/get_risk_engine_privileges.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/get_risk_engine_privileges.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/get_risk_engine_privileges.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/get_risk_engine_privileges.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/get_risk_engine_privileges.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/get_risk_engine_privileges.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/index.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/preview_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/preview_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/preview_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/preview_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/preview_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/preview_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/preview_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_engine/preview_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/create_index/create_index_route.ts b/x-pack/solutions/security/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/entity_analytics/risk_score/create_index/create_index_route.ts rename to x-pack/solutions/security/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/entity_analytics/risk_score/create_prebuilt_saved_objects/create_prebuilt_saved_objects_route.test.ts b/x-pack/solutions/security/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/entity_analytics/risk_score/create_prebuilt_saved_objects/create_prebuilt_saved_objects_route.test.ts rename to x-pack/solutions/security/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/entity_analytics/risk_score/create_prebuilt_saved_objects/create_prebuilt_saved_objects_route.ts b/x-pack/solutions/security/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/entity_analytics/risk_score/create_prebuilt_saved_objects/create_prebuilt_saved_objects_route.ts rename to x-pack/solutions/security/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/entity_analytics/risk_score/create_stored_script/create_stored_script_route.ts b/x-pack/solutions/security/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/entity_analytics/risk_score/create_stored_script/create_stored_script_route.ts rename to x-pack/solutions/security/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/entity_analytics/risk_score/delete_indices/delete_indices_route.ts b/x-pack/solutions/security/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/entity_analytics/risk_score/delete_indices/delete_indices_route.ts rename to x-pack/solutions/security/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/entity_analytics/risk_score/delete_prebuilt_saved_objects/delete_prebuilt_saved_objects_route.ts b/x-pack/solutions/security/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/entity_analytics/risk_score/delete_prebuilt_saved_objects/delete_prebuilt_saved_objects_route.ts rename to x-pack/solutions/security/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/entity_analytics/risk_score/delete_stored_script/delete_stored_script_route.ts b/x-pack/solutions/security/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/entity_analytics/risk_score/delete_stored_script/delete_stored_script_route.ts rename to x-pack/solutions/security/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/entity_analytics/risk_score/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_score/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_score/index.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/index_status/index_status_route.ts b/x-pack/solutions/security/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/entity_analytics/risk_score/index_status/index_status_route.ts rename to x-pack/solutions/security/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/entity_analytics/risk_score/install_modules/install_modules_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_score/install_modules/install_modules_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/install_modules/install_modules_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/risk_score/install_modules/install_modules_route.ts diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_score/read_prebuilt_dev_tool_content/read_prebuilt_dev_tool_content_route.ts b/x-pack/solutions/security/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/entity_analytics/risk_score/read_prebuilt_dev_tool_content/read_prebuilt_dev_tool_content_route.ts rename to x-pack/solutions/security/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/common/api/model/alert.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/model/alert.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/model/alert.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/model/alert.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/model/alert.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/model/alert.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/model/alert.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/model/alert.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/model/error_responses.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/model/error_responses.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/model/error_responses.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/model/error_responses.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/model/error_responses.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/model/error_responses.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/model/error_responses.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/model/error_responses.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/model/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/model/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/model/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/model/index.ts diff --git a/x-pack/plugins/security_solution/common/api/model/primitives.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/model/primitives.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/model/primitives.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/model/primitives.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/model/primitives.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/model/primitives.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/model/primitives.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/model/primitives.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/quickstart_client.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/quickstart_client.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/quickstart_client.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/quickstart_client.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/asset_criticality/all.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/asset_criticality/all.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/asset_criticality/all.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/asset_criticality/all.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/cti/cti.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/cti/cti.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/cti/cti.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/cti/cti.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/cti/event_enrichment.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/cti/event_enrichment.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/cti/event_enrichment.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/cti/event_enrichment.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/cti/threat_intel_source.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/cti/threat_intel_source.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/cti/threat_intel_source.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/cti/threat_intel_source.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/endpoint_fields/endpoint_fields.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/endpoint_fields/endpoint_fields.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/endpoint_fields/endpoint_fields.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/endpoint_fields/endpoint_fields.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/first_seen_last_seen/first_seen_last_seen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/first_seen_last_seen/first_seen_last_seen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/first_seen_last_seen/first_seen_last_seen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/first_seen_last_seen/first_seen_last_seen.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/hosts/all.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/hosts/all.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/hosts/all.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/hosts/all.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/hosts/details.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/hosts/details.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/hosts/details.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/hosts/details.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/hosts/hosts.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/hosts/hosts.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/hosts/hosts.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/hosts/hosts.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/hosts/model/sort.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/hosts/model/sort.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/hosts/model/sort.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/hosts/model/sort.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/hosts/overview.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/hosts/overview.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/hosts/overview.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/hosts/overview.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/hosts/uncommon_processes.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/hosts/uncommon_processes.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/hosts/uncommon_processes.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/hosts/uncommon_processes.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/index.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/matrix_histogram/matrix_histogram.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/matrix_histogram/matrix_histogram.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/matrix_histogram/matrix_histogram.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/matrix_histogram/matrix_histogram.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/model/factory_query_type.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/model/factory_query_type.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/model/factory_query_type.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/model/factory_query_type.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/model/filter_query.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/model/filter_query.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/model/filter_query.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/model/filter_query.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/model/inspect.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/model/inspect.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/model/inspect.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/model/inspect.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/model/order.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/model/order.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/model/order.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/model/order.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/model/pagination.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/model/pagination.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/model/pagination.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/model/pagination.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/model/request_basic_options.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/model/request_basic_options.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/model/request_basic_options.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/model/request_basic_options.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/model/request_paginated_options.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/model/request_paginated_options.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/model/request_paginated_options.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/model/request_paginated_options.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/model/runtime_mappings.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/model/runtime_mappings.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/model/runtime_mappings.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/model/runtime_mappings.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/model/sort.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/model/sort.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/model/sort.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/model/sort.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/model/timerange.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/model/timerange.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/model/timerange.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/model/timerange.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/network/details.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/details.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/network/details.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/details.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/network/dns.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/dns.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/network/dns.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/dns.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/network/http.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/http.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/network/http.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/http.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/network/model/flow_target.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/model/flow_target.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/network/model/flow_target.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/model/flow_target.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/network/model/top_tables_fields.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/model/top_tables_fields.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/network/model/top_tables_fields.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/model/top_tables_fields.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/network/network.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/network.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/network/network.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/network.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/network/overview.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/overview.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/network/overview.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/overview.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/network/tls.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/tls.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/network/tls.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/tls.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/network/top_countries.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/top_countries.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/network/top_countries.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/top_countries.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/network/top_n_flow.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/top_n_flow.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/network/top_n_flow.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/top_n_flow.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/network/users.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/users.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/network/users.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/network/users.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/related_entities/related_entities.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/related_entities/related_entities.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/related_entities/related_entities.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/related_entities/related_entities.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/related_entities/related_hosts.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/related_entities/related_hosts.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/related_entities/related_hosts.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/related_entities/related_hosts.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/related_entities/related_users.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/related_entities/related_users.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/related_entities/related_users.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/related_entities/related_users.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/risk_score/all.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/risk_score/all.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/risk_score/all.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/risk_score/all.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/risk_score/kpi.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/risk_score/kpi.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/risk_score/kpi.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/risk_score/kpi.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/risk_score/model/risk_score_entity.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/risk_score/model/risk_score_entity.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/risk_score/model/risk_score_entity.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/risk_score/model/risk_score_entity.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/risk_score/risk_score.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/risk_score/risk_score.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/risk_score/risk_score.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/risk_score/risk_score.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/users/all.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/users/all.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/users/all.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/users/all.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/users/authentications.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/users/authentications.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/users/authentications.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/users/authentications.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/users/managed_details.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/users/managed_details.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/users/managed_details.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/users/managed_details.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/users/observed_details.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/users/observed_details.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/users/observed_details.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/users/observed_details.ts diff --git a/x-pack/plugins/security_solution/common/api/search_strategy/users/users.ts b/x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/users/users.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/search_strategy/users/users.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/search_strategy/users/users.ts diff --git a/x-pack/plugins/security_solution/common/api/tags/create_tag/create_tag_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/tags/create_tag/create_tag_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/tags/create_tag/create_tag_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/tags/create_tag/create_tag_route.ts diff --git a/x-pack/plugins/security_solution/common/api/tags/get_dashboards_by_tags/get_dashboards_by_tags_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/tags/get_dashboards_by_tags/get_dashboards_by_tags_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/tags/get_dashboards_by_tags/get_dashboards_by_tags_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/tags/get_dashboards_by_tags/get_dashboards_by_tags_route.ts diff --git a/x-pack/plugins/security_solution/common/api/tags/get_tags_by_name/get_tags_by_name_route.ts b/x-pack/solutions/security/plugins/security_solution/common/api/tags/get_tags_by_name/get_tags_by_name_route.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/tags/get_tags_by_name/get_tags_by_name_route.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/tags/get_tags_by_name/get_tags_by_name_route.ts diff --git a/x-pack/plugins/security_solution/common/api/tags/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/tags/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/tags/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/tags/index.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/clean_draft_timelines/clean_draft_timelines_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/clean_draft_timelines/clean_draft_timelines_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/clean_draft_timelines/clean_draft_timelines_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/clean_draft_timelines/clean_draft_timelines_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/clean_draft_timelines/clean_draft_timelines_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/clean_draft_timelines/clean_draft_timelines_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/clean_draft_timelines/clean_draft_timelines_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/clean_draft_timelines/clean_draft_timelines_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/timeline/copy_timeline/copy_timeline_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/copy_timeline/copy_timeline_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/copy_timeline/copy_timeline_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/copy_timeline/copy_timeline_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/copy_timeline/copy_timeline_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/copy_timeline/copy_timeline_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/copy_timeline/copy_timeline_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/copy_timeline/copy_timeline_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/timeline/create_timelines/create_timelines_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/create_timelines/create_timelines_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/create_timelines/create_timelines_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/create_timelines/create_timelines_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/create_timelines/create_timelines_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/create_timelines/create_timelines_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/create_timelines/create_timelines_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/create_timelines/create_timelines_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/timeline/delete_note/delete_note_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/delete_note/delete_note_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/delete_note/delete_note_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/delete_note/delete_note_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/delete_note/delete_note_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/delete_note/delete_note_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/delete_note/delete_note_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/delete_note/delete_note_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/timeline/delete_timelines/delete_timelines_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/delete_timelines/delete_timelines_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/delete_timelines/delete_timelines_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/delete_timelines/delete_timelines_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/delete_timelines/delete_timelines_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/delete_timelines/delete_timelines_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/delete_timelines/delete_timelines_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/delete_timelines/delete_timelines_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/timeline/export_timelines/export_timelines_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/export_timelines/export_timelines_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/export_timelines/export_timelines_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/export_timelines/export_timelines_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/export_timelines/export_timelines_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/export_timelines/export_timelines_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/export_timelines/export_timelines_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/export_timelines/export_timelines_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/timeline/get_draft_timelines/get_draft_timelines_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/get_draft_timelines/get_draft_timelines_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/get_draft_timelines/get_draft_timelines_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/get_draft_timelines/get_draft_timelines_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/get_draft_timelines/get_draft_timelines_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/get_draft_timelines/get_draft_timelines_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/get_draft_timelines/get_draft_timelines_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/get_draft_timelines/get_draft_timelines_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/timeline/get_notes/get_notes_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/get_notes/get_notes_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/get_notes/get_notes_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/get_notes/get_notes_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/get_notes/get_notes_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/get_notes/get_notes_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/get_notes/get_notes_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/get_notes/get_notes_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/timeline/get_timeline/get_timeline_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/get_timeline/get_timeline_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/get_timeline/get_timeline_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/get_timeline/get_timeline_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/get_timeline/get_timeline_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/get_timeline/get_timeline_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/get_timeline/get_timeline_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/get_timeline/get_timeline_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/timeline/get_timelines/get_timelines_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/get_timelines/get_timelines_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/get_timelines/get_timelines_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/get_timelines/get_timelines_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/get_timelines/get_timelines_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/get_timelines/get_timelines_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/get_timelines/get_timelines_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/get_timelines/get_timelines_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/timeline/import_timelines/import_timelines_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/import_timelines/import_timelines_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/import_timelines/import_timelines_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/import_timelines/import_timelines_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/import_timelines/import_timelines_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/import_timelines/import_timelines_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/import_timelines/import_timelines_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/import_timelines/import_timelines_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/timeline/index.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/index.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/install_prepackaged_timelines/install_prepackaged_timelines_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/install_prepackaged_timelines/install_prepackaged_timelines_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/install_prepackaged_timelines/install_prepackaged_timelines_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/install_prepackaged_timelines/install_prepackaged_timelines_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/install_prepackaged_timelines/install_prepackaged_timelines_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/install_prepackaged_timelines/install_prepackaged_timelines_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/install_prepackaged_timelines/install_prepackaged_timelines_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/install_prepackaged_timelines/install_prepackaged_timelines_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/timeline/model/api.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/model/api.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/model/api.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/model/api.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/model/components.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/model/components.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/model/components.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/model/components.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/model/components.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/model/components.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/model/components.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/model/components.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/timeline/model/error_schema.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/model/error_schema.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/model/error_schema.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/model/error_schema.mock.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/model/error_schema.test.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/model/error_schema.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/model/error_schema.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/model/error_schema.test.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/model/error_schema.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/model/error_schema.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/model/error_schema.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/model/error_schema.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/patch_timelines/patch_timeline_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/patch_timelines/patch_timeline_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/patch_timelines/patch_timeline_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/patch_timelines/patch_timeline_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/patch_timelines/patch_timeline_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/patch_timelines/patch_timeline_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/patch_timelines/patch_timeline_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/patch_timelines/patch_timeline_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/timeline/persist_favorite/persist_favorite_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/persist_favorite/persist_favorite_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/persist_favorite/persist_favorite_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/persist_favorite/persist_favorite_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/persist_favorite/persist_favorite_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/persist_favorite/persist_favorite_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/persist_favorite/persist_favorite_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/persist_favorite/persist_favorite_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/timeline/persist_note/persist_note_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/persist_note/persist_note_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/persist_note/persist_note_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/persist_note/persist_note_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/persist_note/persist_note_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/persist_note/persist_note_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/persist_note/persist_note_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/persist_note/persist_note_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/timeline/pinned_events/pinned_events_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/pinned_events/pinned_events_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/pinned_events/pinned_events_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/pinned_events/pinned_events_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/pinned_events/pinned_events_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/pinned_events/pinned_events_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/pinned_events/pinned_events_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/pinned_events/pinned_events_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/timeline/resolve_timeline/resolve_timeline_route.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/resolve_timeline/resolve_timeline_route.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/resolve_timeline/resolve_timeline_route.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/resolve_timeline/resolve_timeline_route.gen.ts diff --git a/x-pack/plugins/security_solution/common/api/timeline/resolve_timeline/resolve_timeline_route.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/resolve_timeline/resolve_timeline_route.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/resolve_timeline/resolve_timeline_route.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/resolve_timeline/resolve_timeline_route.schema.yaml diff --git a/x-pack/plugins/security_solution/common/api/timeline/routes.ts b/x-pack/solutions/security/plugins/security_solution/common/api/timeline/routes.ts similarity index 100% rename from x-pack/plugins/security_solution/common/api/timeline/routes.ts rename to x-pack/solutions/security/plugins/security_solution/common/api/timeline/routes.ts diff --git a/x-pack/plugins/security_solution/common/config_settings.ts b/x-pack/solutions/security/plugins/security_solution/common/config_settings.ts similarity index 100% rename from x-pack/plugins/security_solution/common/config_settings.ts rename to x-pack/solutions/security/plugins/security_solution/common/config_settings.ts diff --git a/x-pack/plugins/security_solution/common/constants.ts b/x-pack/solutions/security/plugins/security_solution/common/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/common/constants.ts rename to x-pack/solutions/security/plugins/security_solution/common/constants.ts diff --git a/x-pack/plugins/security_solution/common/cti/constants.ts b/x-pack/solutions/security/plugins/security_solution/common/cti/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/common/cti/constants.ts rename to x-pack/solutions/security/plugins/security_solution/common/cti/constants.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/constants.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/constants.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/constants.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/convert_rule_to_diffable.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/convert_rule_to_diffable.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/convert_rule_to_diffable.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/convert_rule_to_diffable.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_building_block_object.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_building_block_object.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_building_block_object.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_building_block_object.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_data_query.test.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_data_query.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_data_query.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_data_query.test.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_data_query.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_data_query.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_data_query.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_data_query.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_data_source.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_data_source.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_data_source.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_data_source.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_name_override_object.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_name_override_object.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_name_override_object.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_name_override_object.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_schedule.test.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_schedule.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_schedule.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_schedule.test.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_schedule.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_schedule.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_schedule.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_schedule.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_threat_array.test.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_threat_array.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_threat_array.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_threat_array.test.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_threat_array.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_threat_array.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_threat_array.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_threat_array.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_timeline_template_reference.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_timeline_template_reference.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_timeline_template_reference.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_timeline_template_reference.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_timestamp_override_object.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_timestamp_override_object.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_timestamp_override_object.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_timestamp_override_object.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/rule_management/constants.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/rule_management/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/rule_management/constants.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/rule_management/constants.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/rule_management/execution_log.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/rule_management/execution_log.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/rule_management/execution_log.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/rule_management/execution_log.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/rule_management/rule_fields.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/rule_management/rule_fields.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/rule_management/rule_fields.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/rule_management/rule_fields.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/rule_management/rule_filtering.test.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/rule_management/rule_filtering.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/rule_management/rule_filtering.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/rule_management/rule_filtering.test.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/rule_management/rule_filtering.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/rule_management/rule_filtering.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/rule_management/rule_filtering.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/rule_management/rule_filtering.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/rule_management/utils.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/rule_management/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/rule_management/utils.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/rule_management/utils.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/types/lists.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/schemas/types/lists.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/schemas/types/lists.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/schemas/types/lists.mock.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/types/threat.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/schemas/types/threat.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/schemas/types/threat.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/schemas/types/threat.mock.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/transform_actions.test.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/transform_actions.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/transform_actions.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/transform_actions.test.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/transform_actions.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/transform_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/transform_actions.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/transform_actions.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/types.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/types.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/types.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/types.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/utils.test.ts diff --git a/x-pack/plugins/security_solution/common/detection_engine/utils.ts b/x-pack/solutions/security/plugins/security_solution/common/detection_engine/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/common/detection_engine/utils.ts rename to x-pack/solutions/security/plugins/security_solution/common/detection_engine/utils.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/constants.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/constants.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/constants.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/base_data_generator.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/base_data_generator.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_generators/base_data_generator.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/base_data_generator.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/common/alerts_ecs_fields.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/common/alerts_ecs_fields.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_generators/common/alerts_ecs_fields.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/common/alerts_ecs_fields.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/common/artifact_list_item_entry_values.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/common/artifact_list_item_entry_values.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_generators/common/artifact_list_item_entry_values.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/common/artifact_list_item_entry_values.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/endpoint_action_generator.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/endpoint_action_generator.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_generators/endpoint_action_generator.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/endpoint_action_generator.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/endpoint_exceptions_generator.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/endpoint_exceptions_generator.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_generators/endpoint_exceptions_generator.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/endpoint_exceptions_generator.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/endpoint_metadata_generator.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/endpoint_metadata_generator.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_generators/endpoint_metadata_generator.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/endpoint_metadata_generator.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/endpoint_policy_response_generator.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/endpoint_policy_response_generator.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_generators/endpoint_policy_response_generator.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/endpoint_policy_response_generator.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/endpoint_rule_alert_generator.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/endpoint_rule_alert_generator.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_generators/endpoint_rule_alert_generator.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/endpoint_rule_alert_generator.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/event_filters_generator.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/event_filters_generator.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_generators/event_filters_generator.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/event_filters_generator.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/exceptions_list_item_generator.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/exceptions_list_item_generator.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_generators/exceptions_list_item_generator.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/exceptions_list_item_generator.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/fleet_action_generator.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/fleet_action_generator.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_generators/fleet_action_generator.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/fleet_action_generator.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/fleet_agent_generator.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/fleet_agent_generator.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_generators/fleet_agent_generator.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/fleet_agent_generator.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/fleet_agent_policy_generator.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/fleet_agent_policy_generator.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_generators/fleet_agent_policy_generator.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/fleet_agent_policy_generator.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/fleet_package_policy_generator.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/fleet_package_policy_generator.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_generators/fleet_package_policy_generator.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/fleet_package_policy_generator.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/host_isolation_exception_generator.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/host_isolation_exception_generator.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_generators/host_isolation_exception_generator.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/host_isolation_exception_generator.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/sentinelone_data_generator.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/sentinelone_data_generator.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_generators/sentinelone_data_generator.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/sentinelone_data_generator.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_generators/trusted_app_generator.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/trusted_app_generator.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_generators/trusted_app_generator.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_generators/trusted_app_generator.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_alerts.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/index_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_loaders/index_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/index_alerts.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_case.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/index_case.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_loaders/index_case.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/index_case.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_fleet_actions.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_fleet_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_fleet_actions.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_fleet_actions.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_hearbeats.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_hearbeats.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_hearbeats.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_hearbeats.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_hosts.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_hosts.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_hosts.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_hosts.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_policy_response.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_policy_response.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_policy_response.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_policy_response.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_rule_alerts.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_rule_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_rule_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/index_endpoint_rule_alerts.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_fleet_agent.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/index_fleet_agent.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_loaders/index_fleet_agent.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/index_fleet_agent.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_fleet_endpoint_policy.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/index_fleet_endpoint_policy.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_loaders/index_fleet_endpoint_policy.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/index_fleet_endpoint_policy.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_loaders/index_fleet_server.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/index_fleet_server.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_loaders/index_fleet_server.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/index_fleet_server.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_loaders/setup_fleet_for_endpoint.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/setup_fleet_for_endpoint.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_loaders/setup_fleet_for_endpoint.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/setup_fleet_for_endpoint.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_loaders/usage_tracker.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/usage_tracker.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_loaders/usage_tracker.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/usage_tracker.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/data_loaders/utils.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/data_loaders/utils.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/utils.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/errors.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/errors.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/errors.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/errors.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/format_axios_error.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/format_axios_error.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/format_axios_error.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/format_axios_error.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/generate_data.test.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/generate_data.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/generate_data.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/generate_data.test.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/generate_data.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/generate_data.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/generate_data.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/generate_data.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/index_data.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/index_data.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/index_data.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/index_data.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/models/ecs_safety_helpers.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/models/ecs_safety_helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/models/ecs_safety_helpers.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/models/ecs_safety_helpers.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/models/event.test.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/models/event.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/models/event.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/models/event.test.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/models/event.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/models/event.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/models/event.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/models/event.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/models/node.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/models/node.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/models/node.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/models/node.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/models/policy_config.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/models/policy_config.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/models/policy_config.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/models/policy_config.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/models/policy_config_helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/models/policy_config_helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/models/policy_config_helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/models/policy_config_helpers.test.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/models/policy_config_helpers.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/models/policy_config_helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/models/policy_config_helpers.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/models/policy_config_helpers.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/schema/actions.test.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/schema/actions.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/schema/actions.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/schema/actions.test.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/schema/automated_actions.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/schema/automated_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/schema/automated_actions.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/schema/automated_actions.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/schema/common.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/schema/common.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/schema/common.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/schema/common.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/schema/manifest.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/schema/manifest.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/schema/manifest.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/schema/manifest.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/schema/metadata.test.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/schema/metadata.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/schema/metadata.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/schema/metadata.test.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/schema/resolver.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/schema/resolver.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/schema/resolver.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/schema/resolver.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/schema/trusted_apps.test.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/schema/trusted_apps.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/schema/trusted_apps.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/schema/trusted_apps.test.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/schema/trusted_apps.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/schema/trusted_apps.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/schema/trusted_apps.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/schema/trusted_apps.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/service/artifacts/constants.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/artifacts/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/service/artifacts/constants.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/service/artifacts/constants.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/service/artifacts/index.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/artifacts/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/service/artifacts/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/service/artifacts/index.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/service/artifacts/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/artifacts/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/service/artifacts/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/service/artifacts/utils.test.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/service/artifacts/utils.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/artifacts/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/service/artifacts/utils.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/service/artifacts/utils.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/service/artifacts/validations.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/artifacts/validations.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/service/artifacts/validations.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/service/artifacts/validations.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/service/authz/authz.test.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/authz/authz.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/service/authz/authz.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/service/authz/authz.test.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/service/authz/authz.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/authz/authz.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/service/authz/authz.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/service/authz/authz.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/service/authz/index.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/authz/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/service/authz/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/service/authz/index.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/service/authz/mocks.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/authz/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/service/authz/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/service/authz/mocks.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/service/policy/get_policy_data_for_update.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/policy/get_policy_data_for_update.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/service/policy/get_policy_data_for_update.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/service/policy/get_policy_data_for_update.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/service/policy/index.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/policy/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/service/policy/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/service/policy/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/response_actions/constants.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/response_actions/constants.ts new file mode 100644 index 0000000000000..b6970222d0d55 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/response_actions/constants.ts @@ -0,0 +1,213 @@ +/* + * 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 { EndpointAuthzKeyList } from '../../types/authz'; + +export const RESPONSE_ACTION_STATUS = ['failed', 'pending', 'successful'] as const; +export type ResponseActionStatus = (typeof RESPONSE_ACTION_STATUS)[number]; + +export const RESPONSE_ACTION_TYPE = ['automated', 'manual'] as const; +export type ResponseActionType = (typeof RESPONSE_ACTION_TYPE)[number]; + +export const RESPONSE_ACTION_AGENT_TYPE = ['endpoint', 'sentinel_one', 'crowdstrike'] as const; +export type ResponseActionAgentType = (typeof RESPONSE_ACTION_AGENT_TYPE)[number]; + +/** + * The Command names that are used in the API payload for the `{ command: '' }` attribute + */ +export const RESPONSE_ACTION_API_COMMANDS_NAMES = [ + 'isolate', + 'unisolate', + 'kill-process', + 'suspend-process', + 'running-processes', + 'get-file', + 'execute', + 'upload', + 'scan', + 'runscript', +] as const; + +export type ResponseActionsApiCommandNames = (typeof RESPONSE_ACTION_API_COMMANDS_NAMES)[number]; + +export const ENABLED_AUTOMATED_RESPONSE_ACTION_COMMANDS: ResponseActionsApiCommandNames[] = [ + 'isolate', + // TODO: TC- Uncomment these when we go GA with automated process actions + // 'kill-process', + // 'suspend-process' +]; + +export type EnabledAutomatedResponseActionsCommands = + (typeof ENABLED_AUTOMATED_RESPONSE_ACTION_COMMANDS)[number]; + +/** + * The list of possible capabilities, reported by the endpoint in the metadata document + */ +export const ENDPOINT_CAPABILITIES = [ + 'isolation', + 'kill_process', + 'suspend_process', + 'running_processes', + 'get_file', + 'execute', + 'upload_file', + 'scan', + 'runscript', +] as const; + +export type EndpointCapabilities = (typeof ENDPOINT_CAPABILITIES)[number]; + +/** + * The list of possible console command names that generate a Response Action to be dispatched + * to the Endpoint. (FYI: not all console commands are response actions) + */ +export const CONSOLE_RESPONSE_ACTION_COMMANDS = [ + 'isolate', + 'release', + 'processes', + 'kill-process', + 'suspend-process', + 'get-file', + 'execute', + 'upload', + 'scan', + 'runscript', +] as const; + +export type ConsoleResponseActionCommands = (typeof CONSOLE_RESPONSE_ACTION_COMMANDS)[number]; + +export type ResponseConsoleRbacControls = + | 'writeHostIsolation' + | 'writeHostIsolationRelease' + | 'writeProcessOperations' + | 'writeFileOperations' + | 'writeExecuteOperations' + | 'writeScanOperations'; + +/** + * maps the console command to the RBAC control (kibana feature control) that is required to access it via console + */ +export const RESPONSE_CONSOLE_ACTION_COMMANDS_TO_RBAC_FEATURE_CONTROL: Record< + ConsoleResponseActionCommands, + ResponseConsoleRbacControls +> = Object.freeze({ + isolate: 'writeHostIsolation', + release: 'writeHostIsolationRelease', + 'kill-process': 'writeProcessOperations', + 'suspend-process': 'writeProcessOperations', + processes: 'writeProcessOperations', + 'get-file': 'writeFileOperations', + execute: 'writeExecuteOperations', + upload: 'writeFileOperations', + scan: 'writeScanOperations', + runscript: 'writeExecuteOperations', +}); + +export const RESPONSE_ACTION_API_COMMAND_TO_CONSOLE_COMMAND_MAP = Object.freeze< + Record<ResponseActionsApiCommandNames, ConsoleResponseActionCommands> +>({ + isolate: 'isolate', + unisolate: 'release', + execute: 'execute', + 'get-file': 'get-file', + 'running-processes': 'processes', + 'kill-process': 'kill-process', + 'suspend-process': 'suspend-process', + upload: 'upload', + scan: 'scan', + runscript: 'runscript', +}); + +export const RESPONSE_CONSOLE_COMMAND_TO_API_COMMAND_MAP = Object.freeze< + Record<ConsoleResponseActionCommands, ResponseActionsApiCommandNames> +>({ + isolate: 'isolate', + release: 'unisolate', + execute: 'execute', + 'get-file': 'get-file', + processes: 'running-processes', + 'kill-process': 'kill-process', + 'suspend-process': 'suspend-process', + upload: 'upload', + scan: 'scan', + runscript: 'runscript', +}); + +export const RESPONSE_CONSOLE_ACTION_COMMANDS_TO_ENDPOINT_CAPABILITY = Object.freeze< + Record<ConsoleResponseActionCommands, EndpointCapabilities> +>({ + isolate: 'isolation', + release: 'isolation', + execute: 'execute', + 'get-file': 'get_file', + processes: 'running_processes', + 'kill-process': 'kill_process', + 'suspend-process': 'suspend_process', + upload: 'upload_file', + scan: 'scan', + runscript: 'runscript', +}); + +/** + * The list of console commands mapped to the required EndpointAuthz to access that command + */ +export const RESPONSE_CONSOLE_ACTION_COMMANDS_TO_REQUIRED_AUTHZ = Object.freeze< + Record<ConsoleResponseActionCommands, EndpointAuthzKeyList[number]> +>({ + isolate: 'canIsolateHost', + release: 'canUnIsolateHost', + execute: 'canWriteExecuteOperations', + 'get-file': 'canWriteFileOperations', + upload: 'canWriteFileOperations', + processes: 'canGetRunningProcesses', + 'kill-process': 'canKillProcess', + 'suspend-process': 'canSuspendProcess', + scan: 'canWriteScanOperations', + runscript: 'canWriteExecuteOperations', +}); + +// 4 hrs in seconds +// 4 * 60 * 60 +export const DEFAULT_EXECUTE_ACTION_TIMEOUT = 14400; + +/** + * The passcodes used for accessing the content of a zip file (ex. from a `get-file` response action) + */ +export const RESPONSE_ACTIONS_ZIP_PASSCODE: Readonly<Record<ResponseActionAgentType, string>> = + Object.freeze({ + endpoint: 'elastic', + sentinel_one: 'Elastic@123', + crowdstrike: 'tbd..', + }); + +/** + * Map of Agent Type to alert fields that holds the Agent ID for that agent type. + * Multiple alert fields are supported since different data sources define the agent + * id in different paths. + * + * NOTE: there are utilities in `x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils` + * that facilitate working with alert (ECS) fields to determine if the give event/alert supports + * response actions, including: + * - `getAgentTypeForAgentIdField()` + * - `getEventDetailsAgentIdField()` + * - `isResponseActionsAlertAgentIdField()` + */ +export const RESPONSE_ACTIONS_ALERT_AGENT_ID_FIELDS: Readonly< + Record<ResponseActionAgentType, string[]> +> = Object.freeze({ + endpoint: ['agent.id'], + sentinel_one: [ + 'sentinel_one.alert.agent.id', + 'sentinel_one.threat.agent.id', + 'sentinel_one.activity.agent.id', + 'sentinel_one.agent.agent.id', + ], + crowdstrike: ['device.id'], +}); + +export const SUPPORTED_AGENT_ID_ALERT_FIELDS: Readonly<string[]> = Object.values( + RESPONSE_ACTIONS_ALERT_AGENT_ID_FIELDS +).flat(); diff --git a/x-pack/plugins/security_solution/common/endpoint/service/response_actions/get_file_download_id.test.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/response_actions/get_file_download_id.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/service/response_actions/get_file_download_id.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/service/response_actions/get_file_download_id.test.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/service/response_actions/get_file_download_id.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/response_actions/get_file_download_id.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/service/response_actions/get_file_download_id.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/service/response_actions/get_file_download_id.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/service/response_actions/is_response_action_supported.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/response_actions/is_response_action_supported.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/service/response_actions/is_response_action_supported.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/service/response_actions/is_response_action_supported.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/service/response_actions/mocks/agent_status.mocks.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/response_actions/mocks/agent_status.mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/service/response_actions/mocks/agent_status.mocks.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/service/response_actions/mocks/agent_status.mocks.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/service/response_actions/sentinel_one.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/response_actions/sentinel_one.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/service/response_actions/sentinel_one.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/service/response_actions/sentinel_one.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/service/response_actions/type_guards.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/response_actions/type_guards.ts similarity index 86% rename from x-pack/plugins/security_solution/common/endpoint/service/response_actions/type_guards.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/service/response_actions/type_guards.ts index 707be0a4d1e65..ece0a9501e3fe 100644 --- a/x-pack/plugins/security_solution/common/endpoint/service/response_actions/type_guards.ts +++ b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/response_actions/type_guards.ts @@ -15,6 +15,8 @@ import type { ResponseActionUploadOutputContent, ResponseActionUploadParameters, GetProcessesActionOutputContent, + ResponseActionRunScriptOutputContent, + ResponseActionRunScriptParameters, } from '../../types'; import { RESPONSE_ACTION_AGENT_TYPE, RESPONSE_ACTION_TYPE } from './constants'; @@ -47,6 +49,15 @@ export const isProcessesAction = ( return action.command === 'running-processes'; }; +export const isRunScriptAction = ( + action: MaybeImmutable<SomeObjectWithCommand> +): action is ActionDetails< + ResponseActionRunScriptOutputContent, + ResponseActionRunScriptParameters +> => { + return action.command === 'runscript'; +}; + // type guards to ensure only the matching string values are attached to the types filter type export const isAgentType = (type: string): type is (typeof RESPONSE_ACTION_AGENT_TYPE)[number] => RESPONSE_ACTION_AGENT_TYPE.includes(type as (typeof RESPONSE_ACTION_AGENT_TYPE)[number]); diff --git a/x-pack/plugins/security_solution/common/endpoint/service/response_actions/utils.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/response_actions/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/service/response_actions/utils.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/service/response_actions/utils.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/service/trusted_apps/mapping.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/service/trusted_apps/mapping.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/service/trusted_apps/mapping.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/service/trusted_apps/mapping.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/types/actions.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/types/actions.ts similarity index 99% rename from x-pack/plugins/security_solution/common/endpoint/types/actions.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/types/actions.ts index 131a8d0c6df5c..e3c47102ce719 100644 --- a/x-pack/plugins/security_solution/common/endpoint/types/actions.ts +++ b/x-pack/solutions/security/plugins/security_solution/common/endpoint/types/actions.ts @@ -97,7 +97,8 @@ export interface ResponseActionScanOutputContent { } export interface ResponseActionRunScriptOutputContent { - output: string; + stdout: string; + stderr: string; code: string; } diff --git a/x-pack/plugins/security_solution/common/endpoint/types/agents.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/types/agents.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/types/agents.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/types/agents.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/types/authz.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/types/authz.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/types/authz.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/types/authz.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/types/crowdstrike.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/types/crowdstrike.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/types/crowdstrike.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/types/crowdstrike.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/types/exception_list_items.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/types/exception_list_items.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/types/exception_list_items.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/types/exception_list_items.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/types/generator.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/types/generator.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/types/generator.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/types/generator.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/types/heartbeat.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/types/heartbeat.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/types/heartbeat.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/types/heartbeat.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/types/index.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/types/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/types/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/types/index.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/types/os.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/types/os.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/types/os.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/types/os.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/types/sentinel_one.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/types/sentinel_one.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/types/sentinel_one.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/types/sentinel_one.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/types/trusted_apps.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/types/trusted_apps.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/types/trusted_apps.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/types/trusted_apps.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/types/utility_types.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/types/utility_types.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/types/utility_types.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/types/utility_types.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/types/workflow_insights.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/types/workflow_insights.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/types/workflow_insights.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/types/workflow_insights.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/utils/controlled_artifact_rollout.test.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/controlled_artifact_rollout.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/utils/controlled_artifact_rollout.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/controlled_artifact_rollout.test.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/utils/controlled_artifact_rollout.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/controlled_artifact_rollout.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/utils/controlled_artifact_rollout.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/controlled_artifact_rollout.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/utils/fetch_fleet_version.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/fetch_fleet_version.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/utils/fetch_fleet_version.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/fetch_fleet_version.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/utils/index_name_utilities.test.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/index_name_utilities.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/utils/index_name_utilities.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/index_name_utilities.test.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/utils/index_name_utilities.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/index_name_utilities.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/utils/index_name_utilities.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/index_name_utilities.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/utils/is_valid_ip.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/is_valid_ip.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/utils/is_valid_ip.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/is_valid_ip.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/utils/kibana_status.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/kibana_status.ts similarity index 93% rename from x-pack/plugins/security_solution/common/endpoint/utils/kibana_status.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/kibana_status.ts index f1fcac6e758c0..1f8fc7b37b0a3 100644 --- a/x-pack/plugins/security_solution/common/endpoint/utils/kibana_status.ts +++ b/x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/kibana_status.ts @@ -12,7 +12,7 @@ import { catchAxiosErrorFormatAndThrow } from '../format_axios_error'; export const fetchKibanaStatus = async (kbnClient: KbnClient): Promise<StatusResponse> => { // We DO NOT use `kbnClient.status.get()` here because the `kbnClient` passed on input could be our enhanced - // client (created by `x-pack/plugins/security_solution/scripts/endpoint/common/stack_services.ts:267`) + // client (created by `x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/stack_services.ts:267`) // which could be using an API key (which the core KbnClient does not support) return kbnClient .request<StatusResponse>({ diff --git a/x-pack/plugins/security_solution/common/endpoint/utils/package.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/package.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/utils/package.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/package.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/utils/package_v2.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/package_v2.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/utils/package_v2.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/package_v2.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/utils/transforms.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/transforms.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/utils/transforms.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/transforms.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/utils/update_antivirus_registration_enabled.test.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/update_antivirus_registration_enabled.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/utils/update_antivirus_registration_enabled.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/update_antivirus_registration_enabled.test.ts diff --git a/x-pack/plugins/security_solution/common/endpoint/utils/update_antivirus_registration_enabled.ts b/x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/update_antivirus_registration_enabled.ts similarity index 100% rename from x-pack/plugins/security_solution/common/endpoint/utils/update_antivirus_registration_enabled.ts rename to x-pack/solutions/security/plugins/security_solution/common/endpoint/utils/update_antivirus_registration_enabled.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/asset_criticality/constants.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/asset_criticality/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/asset_criticality/constants.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/asset_criticality/constants.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/asset_criticality/index.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/asset_criticality/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/asset_criticality/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/asset_criticality/index.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/asset_criticality/indices.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/asset_criticality/indices.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/asset_criticality/indices.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/asset_criticality/indices.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/asset_criticality/parse_asset_criticality_csv_row.test.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/asset_criticality/parse_asset_criticality_csv_row.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/asset_criticality/parse_asset_criticality_csv_row.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/asset_criticality/parse_asset_criticality_csv_row.test.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/asset_criticality/parse_asset_criticality_csv_row.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/asset_criticality/parse_asset_criticality_csv_row.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/asset_criticality/parse_asset_criticality_csv_row.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/asset_criticality/parse_asset_criticality_csv_row.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/asset_criticality/types.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/asset_criticality/types.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/asset_criticality/types.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/asset_criticality/types.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/constants.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/constants.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/constants.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/entity_store/constants.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/entity_store/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/entity_store/constants.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/entity_store/constants.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/privileges.test.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/privileges.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/privileges.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/privileges.test.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/privileges.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/privileges.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/privileges.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/privileges.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/risk_engine/constants.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/risk_engine/constants.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/constants.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/risk_engine/identifier_types.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/identifier_types.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/risk_engine/identifier_types.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/identifier_types.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/risk_engine/index.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/risk_engine/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/index.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/risk_engine/indices.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/indices.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/risk_engine/indices.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/indices.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/risk_engine/privileges.test.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/privileges.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/risk_engine/privileges.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/privileges.test.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/risk_engine/privileges.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/privileges.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/risk_engine/privileges.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/privileges.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/risk_engine/range.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/range.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/risk_engine/range.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/range.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/risk_engine/risk_levels.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/risk_levels.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/risk_engine/risk_levels.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/risk_levels.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/risk_engine/risk_weights/index.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/risk_weights/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/risk_engine/risk_weights/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/risk_weights/index.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/risk_engine/risk_weights/types.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/risk_weights/types.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/risk_engine/risk_weights/types.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/risk_weights/types.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/risk_engine/types.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/types.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/risk_engine/types.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/types.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/risk_engine/utils.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/risk_engine/utils.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_engine/utils.ts diff --git a/x-pack/plugins/security_solution/common/entity_analytics/risk_score/constants.ts b/x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_score/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/common/entity_analytics/risk_score/constants.ts rename to x-pack/solutions/security/plugins/security_solution/common/entity_analytics/risk_score/constants.ts diff --git a/x-pack/plugins/security_solution/common/experimental_features.ts b/x-pack/solutions/security/plugins/security_solution/common/experimental_features.ts similarity index 99% rename from x-pack/plugins/security_solution/common/experimental_features.ts rename to x-pack/solutions/security/plugins/security_solution/common/experimental_features.ts index 428a48cf4b7be..56f4657500c45 100644 --- a/x-pack/plugins/security_solution/common/experimental_features.ts +++ b/x-pack/solutions/security/plugins/security_solution/common/experimental_features.ts @@ -109,11 +109,6 @@ export const allowedExperimentalValues = Object.freeze({ */ securitySolutionNotesDisabled: false, - /** - * Disables entity and alert previews - */ - entityAlertPreviewDisabled: false, - /** * Enables the Assistant Model Evaluation advanced setting and API endpoint, introduced in `8.11.0`. */ @@ -266,8 +261,12 @@ export const allowedExperimentalValues = Object.freeze({ /** * Enables CrowdStrike's RunScript RTR command */ - crowdstrikeRunScriptEnabled: false, + + /** + * Enables the Asset Inventory feature + */ + assetInventoryStoreEnabled: false, }); type ExperimentalConfigKeys = Array<keyof ExperimentalFeatures>; diff --git a/x-pack/plugins/security_solution/common/field_maps/8.0.0/alerts.ts b/x-pack/solutions/security/plugins/security_solution/common/field_maps/8.0.0/alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/common/field_maps/8.0.0/alerts.ts rename to x-pack/solutions/security/plugins/security_solution/common/field_maps/8.0.0/alerts.ts diff --git a/x-pack/plugins/security_solution/common/field_maps/8.0.0/index.ts b/x-pack/solutions/security/plugins/security_solution/common/field_maps/8.0.0/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/field_maps/8.0.0/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/field_maps/8.0.0/index.ts diff --git a/x-pack/plugins/security_solution/common/field_maps/8.0.0/rules.ts b/x-pack/solutions/security/plugins/security_solution/common/field_maps/8.0.0/rules.ts similarity index 100% rename from x-pack/plugins/security_solution/common/field_maps/8.0.0/rules.ts rename to x-pack/solutions/security/plugins/security_solution/common/field_maps/8.0.0/rules.ts diff --git a/x-pack/plugins/security_solution/common/field_maps/8.13.0/alerts.ts b/x-pack/solutions/security/plugins/security_solution/common/field_maps/8.13.0/alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/common/field_maps/8.13.0/alerts.ts rename to x-pack/solutions/security/plugins/security_solution/common/field_maps/8.13.0/alerts.ts diff --git a/x-pack/plugins/security_solution/common/field_maps/8.13.0/index.ts b/x-pack/solutions/security/plugins/security_solution/common/field_maps/8.13.0/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/field_maps/8.13.0/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/field_maps/8.13.0/index.ts diff --git a/x-pack/plugins/security_solution/common/field_maps/8.16.0/alerts.ts b/x-pack/solutions/security/plugins/security_solution/common/field_maps/8.16.0/alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/common/field_maps/8.16.0/alerts.ts rename to x-pack/solutions/security/plugins/security_solution/common/field_maps/8.16.0/alerts.ts diff --git a/x-pack/plugins/security_solution/common/field_maps/8.16.0/index.ts b/x-pack/solutions/security/plugins/security_solution/common/field_maps/8.16.0/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/field_maps/8.16.0/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/field_maps/8.16.0/index.ts diff --git a/x-pack/plugins/security_solution/common/field_maps/8.4.0/alerts.ts b/x-pack/solutions/security/plugins/security_solution/common/field_maps/8.4.0/alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/common/field_maps/8.4.0/alerts.ts rename to x-pack/solutions/security/plugins/security_solution/common/field_maps/8.4.0/alerts.ts diff --git a/x-pack/plugins/security_solution/common/field_maps/8.4.0/index.ts b/x-pack/solutions/security/plugins/security_solution/common/field_maps/8.4.0/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/field_maps/8.4.0/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/field_maps/8.4.0/index.ts diff --git a/x-pack/plugins/security_solution/common/field_maps/field_names.ts b/x-pack/solutions/security/plugins/security_solution/common/field_maps/field_names.ts similarity index 100% rename from x-pack/plugins/security_solution/common/field_maps/field_names.ts rename to x-pack/solutions/security/plugins/security_solution/common/field_maps/field_names.ts diff --git a/x-pack/plugins/security_solution/common/field_maps/index.ts b/x-pack/solutions/security/plugins/security_solution/common/field_maps/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/field_maps/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/field_maps/index.ts diff --git a/x-pack/plugins/security_solution/common/guided_onboarding/siem_guide_config.test.ts b/x-pack/solutions/security/plugins/security_solution/common/guided_onboarding/siem_guide_config.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/guided_onboarding/siem_guide_config.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/guided_onboarding/siem_guide_config.test.ts diff --git a/x-pack/plugins/security_solution/common/guided_onboarding/siem_guide_config.ts b/x-pack/solutions/security/plugins/security_solution/common/guided_onboarding/siem_guide_config.ts similarity index 100% rename from x-pack/plugins/security_solution/common/guided_onboarding/siem_guide_config.ts rename to x-pack/solutions/security/plugins/security_solution/common/guided_onboarding/siem_guide_config.ts diff --git a/x-pack/plugins/security_solution/common/guided_onboarding/translations.ts b/x-pack/solutions/security/plugins/security_solution/common/guided_onboarding/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/common/guided_onboarding/translations.ts rename to x-pack/solutions/security/plugins/security_solution/common/guided_onboarding/translations.ts diff --git a/x-pack/plugins/security_solution/common/index.ts b/x-pack/solutions/security/plugins/security_solution/common/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/common/jest.config.js b/x-pack/solutions/security/plugins/security_solution/common/jest.config.js new file mode 100644 index 0000000000000..e5cfc70c6dde6 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/common/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/common'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/common', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/common/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/common/license/index.ts b/x-pack/solutions/security/plugins/security_solution/common/license/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/license/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/license/index.ts diff --git a/x-pack/plugins/security_solution/common/license/license.ts b/x-pack/solutions/security/plugins/security_solution/common/license/license.ts similarity index 100% rename from x-pack/plugins/security_solution/common/license/license.ts rename to x-pack/solutions/security/plugins/security_solution/common/license/license.ts diff --git a/x-pack/plugins/security_solution/common/license/mocks.ts b/x-pack/solutions/security/plugins/security_solution/common/license/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/common/license/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/common/license/mocks.ts diff --git a/x-pack/plugins/security_solution/common/license/policy_config.test.ts b/x-pack/solutions/security/plugins/security_solution/common/license/policy_config.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/license/policy_config.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/license/policy_config.test.ts diff --git a/x-pack/plugins/security_solution/common/license/policy_config.ts b/x-pack/solutions/security/plugins/security_solution/common/license/policy_config.ts similarity index 100% rename from x-pack/plugins/security_solution/common/license/policy_config.ts rename to x-pack/solutions/security/plugins/security_solution/common/license/policy_config.ts diff --git a/x-pack/plugins/security_solution/common/machine_learning/affected_job_ids.ts b/x-pack/solutions/security/plugins/security_solution/common/machine_learning/affected_job_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/common/machine_learning/affected_job_ids.ts rename to x-pack/solutions/security/plugins/security_solution/common/machine_learning/affected_job_ids.ts diff --git a/x-pack/plugins/security_solution/common/machine_learning/empty_ml_capabilities.ts b/x-pack/solutions/security/plugins/security_solution/common/machine_learning/empty_ml_capabilities.ts similarity index 100% rename from x-pack/plugins/security_solution/common/machine_learning/empty_ml_capabilities.ts rename to x-pack/solutions/security/plugins/security_solution/common/machine_learning/empty_ml_capabilities.ts diff --git a/x-pack/plugins/security_solution/common/machine_learning/has_ml_admin_permissions.test.ts b/x-pack/solutions/security/plugins/security_solution/common/machine_learning/has_ml_admin_permissions.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/machine_learning/has_ml_admin_permissions.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/machine_learning/has_ml_admin_permissions.test.ts diff --git a/x-pack/plugins/security_solution/common/machine_learning/has_ml_admin_permissions.ts b/x-pack/solutions/security/plugins/security_solution/common/machine_learning/has_ml_admin_permissions.ts similarity index 100% rename from x-pack/plugins/security_solution/common/machine_learning/has_ml_admin_permissions.ts rename to x-pack/solutions/security/plugins/security_solution/common/machine_learning/has_ml_admin_permissions.ts diff --git a/x-pack/plugins/security_solution/common/machine_learning/has_ml_license.test.ts b/x-pack/solutions/security/plugins/security_solution/common/machine_learning/has_ml_license.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/machine_learning/has_ml_license.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/machine_learning/has_ml_license.test.ts diff --git a/x-pack/plugins/security_solution/common/machine_learning/has_ml_license.ts b/x-pack/solutions/security/plugins/security_solution/common/machine_learning/has_ml_license.ts similarity index 100% rename from x-pack/plugins/security_solution/common/machine_learning/has_ml_license.ts rename to x-pack/solutions/security/plugins/security_solution/common/machine_learning/has_ml_license.ts diff --git a/x-pack/plugins/security_solution/common/machine_learning/has_ml_user_permissions.test.ts b/x-pack/solutions/security/plugins/security_solution/common/machine_learning/has_ml_user_permissions.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/machine_learning/has_ml_user_permissions.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/machine_learning/has_ml_user_permissions.test.ts diff --git a/x-pack/plugins/security_solution/common/machine_learning/has_ml_user_permissions.ts b/x-pack/solutions/security/plugins/security_solution/common/machine_learning/has_ml_user_permissions.ts similarity index 100% rename from x-pack/plugins/security_solution/common/machine_learning/has_ml_user_permissions.ts rename to x-pack/solutions/security/plugins/security_solution/common/machine_learning/has_ml_user_permissions.ts diff --git a/x-pack/plugins/security_solution/common/machine_learning/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/common/machine_learning/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/machine_learning/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/machine_learning/helpers.test.ts diff --git a/x-pack/plugins/security_solution/common/machine_learning/helpers.ts b/x-pack/solutions/security/plugins/security_solution/common/machine_learning/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/common/machine_learning/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/common/machine_learning/helpers.ts diff --git a/x-pack/plugins/security_solution/common/machine_learning/is_security_job.test.ts b/x-pack/solutions/security/plugins/security_solution/common/machine_learning/is_security_job.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/machine_learning/is_security_job.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/machine_learning/is_security_job.test.ts diff --git a/x-pack/plugins/security_solution/common/machine_learning/is_security_job.ts b/x-pack/solutions/security/plugins/security_solution/common/machine_learning/is_security_job.ts similarity index 100% rename from x-pack/plugins/security_solution/common/machine_learning/is_security_job.ts rename to x-pack/solutions/security/plugins/security_solution/common/machine_learning/is_security_job.ts diff --git a/x-pack/plugins/security_solution/common/notes/constants.ts b/x-pack/solutions/security/plugins/security_solution/common/notes/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/common/notes/constants.ts rename to x-pack/solutions/security/plugins/security_solution/common/notes/constants.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/common/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/common/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/common/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/common/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/endpoint/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/endpoint/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/endpoint/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/endpoint/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/endpoint/response_actions/action.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/endpoint/response_actions/action.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/endpoint/response_actions/action.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/endpoint/response_actions/action.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/endpoint/response_actions/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/endpoint/response_actions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/endpoint/response_actions/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/endpoint/response_actions/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/endpoint/response_actions/response.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/endpoint/response_actions/response.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/endpoint/response_actions/response.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/endpoint/response_actions/response.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/endpoint/response_actions/types.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/endpoint/response_actions/types.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/endpoint/response_actions/types.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/endpoint/response_actions/types.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/eql/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/eql/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/eql/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/eql/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/eql/validation/helpers.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/eql/validation/helpers.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/eql/validation/helpers.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/eql/validation/helpers.mock.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/eql/validation/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/eql/validation/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/eql/validation/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/eql/validation/helpers.test.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/eql/validation/helpers.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/eql/validation/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/eql/validation/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/eql/validation/helpers.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/eql/validation/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/eql/validation/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/eql/validation/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/eql/validation/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/index_fields/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/index_fields/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/index_fields/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/cti/index.mock.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/cti/index.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/cti/index.mock.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/cti/index.mock.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/cti/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/cti/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/cti/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/cti/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/first_last_seen/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/first_last_seen/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/first_last_seen/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/first_last_seen/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/all/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/hosts/all/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/all/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/hosts/all/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/common/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/hosts/common/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/common/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/hosts/common/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/details/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/hosts/details/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/details/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/hosts/details/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/hosts/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/hosts/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/overview/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/hosts/overview/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/overview/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/hosts/overview/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/uncommon_processes/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/hosts/uncommon_processes/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/uncommon_processes/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/hosts/uncommon_processes/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/common/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network/common/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/network/common/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network/common/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/details/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network/details/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/network/details/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network/details/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/dns/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network/dns/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/network/dns/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network/dns/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/http/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network/http/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/network/http/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network/http/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/network/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/overview/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network/overview/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/network/overview/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network/overview/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/tls/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network/tls/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/network/tls/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network/tls/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/top_countries/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network/top_countries/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/network/top_countries/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network/top_countries/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/top_n_flow/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network/top_n_flow/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/network/top_n_flow/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network/top_n_flow/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/network/users/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network/users/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/network/users/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/network/users/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/related_entities/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/related_entities/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/related_entities/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/related_entities/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/related_entities/related_hosts/index.tsx b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/related_entities/related_hosts/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/related_entities/related_hosts/index.tsx rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/related_entities/related_hosts/index.tsx diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/related_entities/related_users/index.tsx b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/related_entities/related_users/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/related_entities/related_users/index.tsx rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/related_entities/related_users/index.tsx diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/all/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/risk_score/all/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/all/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/risk_score/all/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/common/index.test.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/risk_score/common/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/common/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/risk_score/common/index.test.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/common/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/risk_score/common/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/common/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/risk_score/common/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/risk_score/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/risk_score/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/kpi/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/risk_score/kpi/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/risk_score/kpi/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/risk_score/kpi/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/all/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/users/all/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/users/all/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/users/all/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/authentications/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/users/authentications/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/users/authentications/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/users/authentications/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/common/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/users/common/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/users/common/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/users/common/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/users/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/users/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/users/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/managed_details/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/users/managed_details/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/users/managed_details/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/users/managed_details/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/security_solution/users/observed_details/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/users/observed_details/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/security_solution/users/observed_details/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/security_solution/users/observed_details/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/timeline/events/all/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/timeline/events/all/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/timeline/events/all/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/timeline/events/all/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/timeline/events/common/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/timeline/events/common/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/timeline/events/common/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/timeline/events/common/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/timeline/events/details/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/timeline/events/details/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/timeline/events/details/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/timeline/events/details/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/timeline/events/eql/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/timeline/events/eql/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/timeline/events/eql/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/timeline/events/eql/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/timeline/events/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/timeline/events/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/timeline/events/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/timeline/events/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/timeline/events/last_event_time/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/timeline/events/last_event_time/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/timeline/events/last_event_time/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/timeline/events/last_event_time/index.ts diff --git a/x-pack/plugins/security_solution/common/search_strategy/timeline/index.ts b/x-pack/solutions/security/plugins/security_solution/common/search_strategy/timeline/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/search_strategy/timeline/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/search_strategy/timeline/index.ts diff --git a/x-pack/plugins/security_solution/common/security_integrations/cribl/translator.test.ts b/x-pack/solutions/security/plugins/security_solution/common/security_integrations/cribl/translator.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/security_integrations/cribl/translator.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/security_integrations/cribl/translator.test.ts diff --git a/x-pack/plugins/security_solution/common/security_integrations/cribl/translator.ts b/x-pack/solutions/security/plugins/security_solution/common/security_integrations/cribl/translator.ts similarity index 100% rename from x-pack/plugins/security_solution/common/security_integrations/cribl/translator.ts rename to x-pack/solutions/security/plugins/security_solution/common/security_integrations/cribl/translator.ts diff --git a/x-pack/plugins/security_solution/common/security_integrations/cribl/types.ts b/x-pack/solutions/security/plugins/security_solution/common/security_integrations/cribl/types.ts similarity index 100% rename from x-pack/plugins/security_solution/common/security_integrations/cribl/types.ts rename to x-pack/solutions/security/plugins/security_solution/common/security_integrations/cribl/types.ts diff --git a/x-pack/solutions/security/plugins/security_solution/common/siem_migrations/constants.ts b/x-pack/solutions/security/plugins/security_solution/common/siem_migrations/constants.ts new file mode 100644 index 0000000000000..88ed777c21d69 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/common/siem_migrations/constants.ts @@ -0,0 +1,64 @@ +/* + * 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 { Severity } from '@kbn/securitysolution-io-ts-alerting-types'; + +export const SIEM_MIGRATIONS_PATH = '/internal/siem_migrations' as const; +export const SIEM_RULE_MIGRATIONS_PATH = `${SIEM_MIGRATIONS_PATH}/rules` as const; + +export const SIEM_RULE_MIGRATIONS_ALL_STATS_PATH = `${SIEM_RULE_MIGRATIONS_PATH}/stats` as const; +export const SIEM_RULE_MIGRATION_CREATE_PATH = + `${SIEM_RULE_MIGRATIONS_PATH}/{migration_id?}` as const; +export const SIEM_RULE_MIGRATION_PATH = `${SIEM_RULE_MIGRATIONS_PATH}/{migration_id}` as const; +export const SIEM_RULE_MIGRATION_START_PATH = `${SIEM_RULE_MIGRATION_PATH}/start` as const; +export const SIEM_RULE_MIGRATION_RETRY_PATH = `${SIEM_RULE_MIGRATION_PATH}/retry` as const; +export const SIEM_RULE_MIGRATION_STATS_PATH = `${SIEM_RULE_MIGRATION_PATH}/stats` as const; +export const SIEM_RULE_MIGRATION_TRANSLATION_STATS_PATH = + `${SIEM_RULE_MIGRATION_PATH}/translation_stats` as const; +export const SIEM_RULE_MIGRATION_STOP_PATH = `${SIEM_RULE_MIGRATION_PATH}/stop` as const; +export const SIEM_RULE_MIGRATION_INSTALL_PATH = `${SIEM_RULE_MIGRATION_PATH}/install` as const; +export const SIEM_RULE_MIGRATION_INSTALL_TRANSLATED_PATH = + `${SIEM_RULE_MIGRATION_PATH}/install_translated` as const; +export const SIEM_RULE_MIGRATIONS_PREBUILT_RULES_PATH = + `${SIEM_RULE_MIGRATION_PATH}/prebuilt_rules` as const; + +export const SIEM_RULE_MIGRATION_RESOURCES_PATH = `${SIEM_RULE_MIGRATION_PATH}/resources` as const; +export const SIEM_RULE_MIGRATION_RESOURCES_MISSING_PATH = + `${SIEM_RULE_MIGRATION_RESOURCES_PATH}/missing` as const; + +export enum SiemMigrationTaskStatus { + READY = 'ready', + RUNNING = 'running', + STOPPED = 'stopped', + FINISHED = 'finished', +} + +export enum SiemMigrationStatus { + PENDING = 'pending', + PROCESSING = 'processing', + COMPLETED = 'completed', + FAILED = 'failed', +} + +export enum RuleTranslationResult { + FULL = 'full', + PARTIAL = 'partial', + UNTRANSLATABLE = 'untranslatable', +} + +export const DEFAULT_TRANSLATION_RISK_SCORE = 21; +export const DEFAULT_TRANSLATION_SEVERITY: Severity = 'low'; + +export const DEFAULT_TRANSLATION_FIELDS = { + risk_score: DEFAULT_TRANSLATION_RISK_SCORE, + severity: DEFAULT_TRANSLATION_SEVERITY, + from: 'now-360s', + to: 'now', + interval: '5m', +} as const; + +export const EMPTY_RESOURCE_PLACEHOLDER = '<empty>'; diff --git a/x-pack/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.gen.ts diff --git a/x-pack/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.schema.yaml diff --git a/x-pack/plugins/security_solution/common/siem_migrations/model/common.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/siem_migrations/model/common.gen.ts similarity index 100% rename from x-pack/plugins/security_solution/common/siem_migrations/model/common.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/siem_migrations/model/common.gen.ts diff --git a/x-pack/plugins/security_solution/common/siem_migrations/model/common.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/siem_migrations/model/common.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/common/siem_migrations/model/common.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/siem_migrations/model/common.schema.yaml diff --git a/x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.gen.ts b/x-pack/solutions/security/plugins/security_solution/common/siem_migrations/model/rule_migration.gen.ts similarity index 89% rename from x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.gen.ts rename to x-pack/solutions/security/plugins/security_solution/common/siem_migrations/model/rule_migration.gen.ts index d9c33ebbdf704..27db56aedb451 100644 --- a/x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.gen.ts +++ b/x-pack/solutions/security/plugins/security_solution/common/siem_migrations/model/rule_migration.gen.ts @@ -285,21 +285,47 @@ export const RuleMigrationTranslationStats = z.object({ */ rules: z.object({ /** - * The total number of rules to migrate. + * The total number of rules in the migration. */ total: z.number().int(), /** - * The number of rules that matched Elastic prebuilt rules. - */ - prebuilt: z.number().int(), - /** - * The number of rules that did not match Elastic prebuilt rules and will be installed as custom rules. + * The number of rules that have been successfully translated. */ - custom: z.number().int(), + success: z.object({ + /** + * The total number of rules that have been successfully translated. + */ + total: z.number().int(), + /** + * The translation results + */ + result: z.object({ + /** + * The number of rules that have been fully translated. + */ + full: z.number().int(), + /** + * The number of rules that have been partially translated. + */ + partial: z.number().int(), + /** + * The number of rules that could not be translated. + */ + untranslatable: z.number().int(), + }), + /** + * The number of rules that have been successfully translated and can be installed. + */ + installable: z.number().int(), + /** + * The number of rules that have been successfully translated and matched Elastic prebuilt rules. + */ + prebuilt: z.number().int(), + }), /** - * The number of rules that can be installed. + * The number of rules that have failed translation. */ - installable: z.number().int(), + failed: z.number().int(), }), }); diff --git a/x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.schema.yaml b/x-pack/solutions/security/plugins/security_solution/common/siem_migrations/model/rule_migration.schema.yaml similarity index 86% rename from x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/common/siem_migrations/model/rule_migration.schema.yaml index 6fce9f0d51f5d..f3a85b3e37443 100644 --- a/x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.schema.yaml +++ b/x-pack/solutions/security/plugins/security_solution/common/siem_migrations/model/rule_migration.schema.yaml @@ -234,23 +234,50 @@ components: description: The rules migration translation stats. required: - total - - prebuilt - - custom - - installable + - success + - failed properties: total: type: integer - description: The total number of rules to migrate. - prebuilt: - type: integer - description: The number of rules that matched Elastic prebuilt rules. - custom: - type: integer - description: The number of rules that did not match Elastic prebuilt rules and will be installed as custom rules. - installable: + description: The total number of rules in the migration. + success: + type: object + description: The number of rules that have been successfully translated. + required: + - total + - result + - installable + - prebuilt + properties: + total: + type: integer + description: The total number of rules that have been successfully translated. + result: + type: object + description: The translation results + required: + - full + - partial + - untranslatable + properties: + full: + type: integer + description: The number of rules that have been fully translated. + partial: + type: integer + description: The number of rules that have been partially translated. + untranslatable: + type: integer + description: The number of rules that could not be translated. + installable: + type: integer + description: The number of rules that have been successfully translated and can be installed. + prebuilt: + type: integer + description: The number of rules that have been successfully translated and matched Elastic prebuilt rules. + failed: type: integer - description: The number of rules that can be installed. - + description: The number of rules that have failed translation. RuleMigrationTranslationResult: type: string description: The rule translation result. diff --git a/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/index.ts b/x-pack/solutions/security/plugins/security_solution/common/siem_migrations/rules/resources/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/siem_migrations/rules/resources/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/siem_migrations/rules/resources/index.ts diff --git a/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk/index.ts b/x-pack/solutions/security/plugins/security_solution/common/siem_migrations/rules/resources/splunk/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/siem_migrations/rules/resources/splunk/index.ts diff --git a/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk/splunk_identifier.test.ts b/x-pack/solutions/security/plugins/security_solution/common/siem_migrations/rules/resources/splunk/splunk_identifier.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk/splunk_identifier.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/siem_migrations/rules/resources/splunk/splunk_identifier.test.ts diff --git a/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk/splunk_identifier.ts b/x-pack/solutions/security/plugins/security_solution/common/siem_migrations/rules/resources/splunk/splunk_identifier.ts similarity index 100% rename from x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk/splunk_identifier.ts rename to x-pack/solutions/security/plugins/security_solution/common/siem_migrations/rules/resources/splunk/splunk_identifier.ts diff --git a/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/types.ts b/x-pack/solutions/security/plugins/security_solution/common/siem_migrations/rules/resources/types.ts similarity index 100% rename from x-pack/plugins/security_solution/common/siem_migrations/rules/resources/types.ts rename to x-pack/solutions/security/plugins/security_solution/common/siem_migrations/rules/resources/types.ts diff --git a/x-pack/plugins/security_solution/common/siem_migrations/rules/utils.ts b/x-pack/solutions/security/plugins/security_solution/common/siem_migrations/rules/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/common/siem_migrations/rules/utils.ts rename to x-pack/solutions/security/plugins/security_solution/common/siem_migrations/rules/utils.ts diff --git a/x-pack/plugins/security_solution/common/test/ess_roles.json b/x-pack/solutions/security/plugins/security_solution/common/test/ess_roles.json similarity index 100% rename from x-pack/plugins/security_solution/common/test/ess_roles.json rename to x-pack/solutions/security/plugins/security_solution/common/test/ess_roles.json diff --git a/x-pack/plugins/security_solution/common/test/index.ts b/x-pack/solutions/security/plugins/security_solution/common/test/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/test/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/test/index.ts diff --git a/x-pack/plugins/security_solution/common/timelines/zod_errors.ts b/x-pack/solutions/security/plugins/security_solution/common/timelines/zod_errors.ts similarity index 100% rename from x-pack/plugins/security_solution/common/timelines/zod_errors.ts rename to x-pack/solutions/security/plugins/security_solution/common/timelines/zod_errors.ts diff --git a/x-pack/plugins/security_solution/common/translations.ts b/x-pack/solutions/security/plugins/security_solution/common/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/common/translations.ts rename to x-pack/solutions/security/plugins/security_solution/common/translations.ts diff --git a/x-pack/plugins/security_solution/common/typed_json.ts b/x-pack/solutions/security/plugins/security_solution/common/typed_json.ts similarity index 100% rename from x-pack/plugins/security_solution/common/typed_json.ts rename to x-pack/solutions/security/plugins/security_solution/common/typed_json.ts diff --git a/x-pack/plugins/security_solution/common/types/bulk_actions/index.ts b/x-pack/solutions/security/plugins/security_solution/common/types/bulk_actions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/types/bulk_actions/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/types/bulk_actions/index.ts diff --git a/x-pack/plugins/security_solution/common/types/header_actions/index.ts b/x-pack/solutions/security/plugins/security_solution/common/types/header_actions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/types/header_actions/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/types/header_actions/index.ts diff --git a/x-pack/plugins/security_solution/common/types/index.ts b/x-pack/solutions/security/plugins/security_solution/common/types/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/types/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/types/index.ts diff --git a/x-pack/plugins/security_solution/common/types/response_actions/index.ts b/x-pack/solutions/security/plugins/security_solution/common/types/response_actions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/types/response_actions/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/types/response_actions/index.ts diff --git a/x-pack/plugins/security_solution/common/types/risk_scores.ts b/x-pack/solutions/security/plugins/security_solution/common/types/risk_scores.ts similarity index 100% rename from x-pack/plugins/security_solution/common/types/risk_scores.ts rename to x-pack/solutions/security/plugins/security_solution/common/types/risk_scores.ts diff --git a/x-pack/plugins/security_solution/common/types/session_view/index.ts b/x-pack/solutions/security/plugins/security_solution/common/types/session_view/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/types/session_view/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/types/session_view/index.ts diff --git a/x-pack/plugins/security_solution/common/types/timeline/cells/index.ts b/x-pack/solutions/security/plugins/security_solution/common/types/timeline/cells/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/types/timeline/cells/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/types/timeline/cells/index.ts diff --git a/x-pack/plugins/security_solution/common/types/timeline/columns/index.ts b/x-pack/solutions/security/plugins/security_solution/common/types/timeline/columns/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/types/timeline/columns/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/types/timeline/columns/index.ts diff --git a/x-pack/plugins/security_solution/common/types/timeline/data_provider/index.ts b/x-pack/solutions/security/plugins/security_solution/common/types/timeline/data_provider/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/types/timeline/data_provider/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/types/timeline/data_provider/index.ts diff --git a/x-pack/plugins/security_solution/common/types/timeline/index.ts b/x-pack/solutions/security/plugins/security_solution/common/types/timeline/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/types/timeline/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/types/timeline/index.ts diff --git a/x-pack/plugins/security_solution/common/types/timeline/note/saved_object.ts b/x-pack/solutions/security/plugins/security_solution/common/types/timeline/note/saved_object.ts similarity index 100% rename from x-pack/plugins/security_solution/common/types/timeline/note/saved_object.ts rename to x-pack/solutions/security/plugins/security_solution/common/types/timeline/note/saved_object.ts diff --git a/x-pack/plugins/security_solution/common/types/timeline/pinned_event/saved_object.ts b/x-pack/solutions/security/plugins/security_solution/common/types/timeline/pinned_event/saved_object.ts similarity index 100% rename from x-pack/plugins/security_solution/common/types/timeline/pinned_event/saved_object.ts rename to x-pack/solutions/security/plugins/security_solution/common/types/timeline/pinned_event/saved_object.ts diff --git a/x-pack/plugins/security_solution/common/types/timeline/rows/index.ts b/x-pack/solutions/security/plugins/security_solution/common/types/timeline/rows/index.ts similarity index 100% rename from x-pack/plugins/security_solution/common/types/timeline/rows/index.ts rename to x-pack/solutions/security/plugins/security_solution/common/types/timeline/rows/index.ts diff --git a/x-pack/plugins/security_solution/common/types/timeline/saved_object.ts b/x-pack/solutions/security/plugins/security_solution/common/types/timeline/saved_object.ts similarity index 100% rename from x-pack/plugins/security_solution/common/types/timeline/saved_object.ts rename to x-pack/solutions/security/plugins/security_solution/common/types/timeline/saved_object.ts diff --git a/x-pack/plugins/security_solution/common/types/timeline/store.ts b/x-pack/solutions/security/plugins/security_solution/common/types/timeline/store.ts similarity index 100% rename from x-pack/plugins/security_solution/common/types/timeline/store.ts rename to x-pack/solutions/security/plugins/security_solution/common/types/timeline/store.ts diff --git a/x-pack/plugins/security_solution/common/utility_types.ts b/x-pack/solutions/security/plugins/security_solution/common/utility_types.ts similarity index 100% rename from x-pack/plugins/security_solution/common/utility_types.ts rename to x-pack/solutions/security/plugins/security_solution/common/utility_types.ts diff --git a/x-pack/plugins/security_solution/common/utils/__snapshots__/risk_score_modules.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/common/utils/__snapshots__/risk_score_modules.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/common/utils/__snapshots__/risk_score_modules.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/common/utils/__snapshots__/risk_score_modules.test.ts.snap diff --git a/x-pack/plugins/security_solution/common/utils/alert_detail_path.ts b/x-pack/solutions/security/plugins/security_solution/common/utils/alert_detail_path.ts similarity index 100% rename from x-pack/plugins/security_solution/common/utils/alert_detail_path.ts rename to x-pack/solutions/security/plugins/security_solution/common/utils/alert_detail_path.ts diff --git a/x-pack/plugins/security_solution/common/utils/enum_from_string.test.ts b/x-pack/solutions/security/plugins/security_solution/common/utils/enum_from_string.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/utils/enum_from_string.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/utils/enum_from_string.test.ts diff --git a/x-pack/plugins/security_solution/common/utils/enum_from_string.ts b/x-pack/solutions/security/plugins/security_solution/common/utils/enum_from_string.ts similarity index 100% rename from x-pack/plugins/security_solution/common/utils/enum_from_string.ts rename to x-pack/solutions/security/plugins/security_solution/common/utils/enum_from_string.ts diff --git a/x-pack/plugins/security_solution/common/utils/expand_dotted.test.ts b/x-pack/solutions/security/plugins/security_solution/common/utils/expand_dotted.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/utils/expand_dotted.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/utils/expand_dotted.test.ts diff --git a/x-pack/plugins/security_solution/common/utils/expand_dotted.ts b/x-pack/solutions/security/plugins/security_solution/common/utils/expand_dotted.ts similarity index 100% rename from x-pack/plugins/security_solution/common/utils/expand_dotted.ts rename to x-pack/solutions/security/plugins/security_solution/common/utils/expand_dotted.ts diff --git a/x-pack/plugins/security_solution/common/utils/format_page_filter_search_param.test.ts b/x-pack/solutions/security/plugins/security_solution/common/utils/format_page_filter_search_param.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/utils/format_page_filter_search_param.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/utils/format_page_filter_search_param.test.ts diff --git a/x-pack/plugins/security_solution/common/utils/format_page_filter_search_param.ts b/x-pack/solutions/security/plugins/security_solution/common/utils/format_page_filter_search_param.ts similarity index 100% rename from x-pack/plugins/security_solution/common/utils/format_page_filter_search_param.ts rename to x-pack/solutions/security/plugins/security_solution/common/utils/format_page_filter_search_param.ts diff --git a/x-pack/plugins/security_solution/common/utils/get_ramdom_color.ts b/x-pack/solutions/security/plugins/security_solution/common/utils/get_ramdom_color.ts similarity index 100% rename from x-pack/plugins/security_solution/common/utils/get_ramdom_color.ts rename to x-pack/solutions/security/plugins/security_solution/common/utils/get_ramdom_color.ts diff --git a/x-pack/plugins/security_solution/common/utils/invariant.ts b/x-pack/solutions/security/plugins/security_solution/common/utils/invariant.ts similarity index 100% rename from x-pack/plugins/security_solution/common/utils/invariant.ts rename to x-pack/solutions/security/plugins/security_solution/common/utils/invariant.ts diff --git a/x-pack/plugins/security_solution/common/utils/kql.test.ts b/x-pack/solutions/security/plugins/security_solution/common/utils/kql.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/utils/kql.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/utils/kql.test.ts diff --git a/x-pack/plugins/security_solution/common/utils/kql.ts b/x-pack/solutions/security/plugins/security_solution/common/utils/kql.ts similarity index 100% rename from x-pack/plugins/security_solution/common/utils/kql.ts rename to x-pack/solutions/security/plugins/security_solution/common/utils/kql.ts diff --git a/x-pack/plugins/security_solution/common/utils/path_placeholder.test.ts b/x-pack/solutions/security/plugins/security_solution/common/utils/path_placeholder.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/utils/path_placeholder.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/utils/path_placeholder.test.ts diff --git a/x-pack/plugins/security_solution/common/utils/path_placeholder.ts b/x-pack/solutions/security/plugins/security_solution/common/utils/path_placeholder.ts similarity index 100% rename from x-pack/plugins/security_solution/common/utils/path_placeholder.ts rename to x-pack/solutions/security/plugins/security_solution/common/utils/path_placeholder.ts diff --git a/x-pack/plugins/security_solution/common/utils/risk_score_modules.test.ts b/x-pack/solutions/security/plugins/security_solution/common/utils/risk_score_modules.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/utils/risk_score_modules.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/utils/risk_score_modules.test.ts diff --git a/x-pack/plugins/security_solution/common/utils/risk_score_modules.ts b/x-pack/solutions/security/plugins/security_solution/common/utils/risk_score_modules.ts similarity index 100% rename from x-pack/plugins/security_solution/common/utils/risk_score_modules.ts rename to x-pack/solutions/security/plugins/security_solution/common/utils/risk_score_modules.ts diff --git a/x-pack/plugins/security_solution/common/utils/sourcerer.test.ts b/x-pack/solutions/security/plugins/security_solution/common/utils/sourcerer.test.ts similarity index 100% rename from x-pack/plugins/security_solution/common/utils/sourcerer.test.ts rename to x-pack/solutions/security/plugins/security_solution/common/utils/sourcerer.test.ts diff --git a/x-pack/plugins/security_solution/common/utils/sourcerer.ts b/x-pack/solutions/security/plugins/security_solution/common/utils/sourcerer.ts similarity index 100% rename from x-pack/plugins/security_solution/common/utils/sourcerer.ts rename to x-pack/solutions/security/plugins/security_solution/common/utils/sourcerer.ts diff --git a/x-pack/plugins/security_solution/docs/adrs/threat_hunting/0001_saving_of_timeline_associated_saved_objects.md b/x-pack/solutions/security/plugins/security_solution/docs/adrs/threat_hunting/0001_saving_of_timeline_associated_saved_objects.md similarity index 96% rename from x-pack/plugins/security_solution/docs/adrs/threat_hunting/0001_saving_of_timeline_associated_saved_objects.md rename to x-pack/solutions/security/plugins/security_solution/docs/adrs/threat_hunting/0001_saving_of_timeline_associated_saved_objects.md index a2d98fcb750e1..8f6ddf150c9db 100644 --- a/x-pack/plugins/security_solution/docs/adrs/threat_hunting/0001_saving_of_timeline_associated_saved_objects.md +++ b/x-pack/solutions/security/plugins/security_solution/docs/adrs/threat_hunting/0001_saving_of_timeline_associated_saved_objects.md @@ -13,11 +13,11 @@ When commenting on an unsaved timeline or an event in a timeline or when pinning What's causing this bug is that the associated saved objects have a field `timelineId` that connects them to the timeline. When a (pin/note) save request comes in, the server checks for that field and if it doesn't exist, it will create a new timeline on the fly and return its `timelineId` and `timelineVersion` as part of the saved object's response. -https://github.com/elastic/kibana/blob/2df44b9f7f76f3d03f6e32be7f2a39034f97c22e/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/saved_object.ts#L138-L148 +https://github.com/elastic/kibana/blob/2df44b9f7f76f3d03f6e32be7f2a39034f97c22e/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/notes/saved_object.ts#L138-L148 These two fields are currently not used in the timeline middleware: -https://github.com/elastic/kibana/blob/2df44b9f7f76f3d03f6e32be7f2a39034f97c22e/x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_note.ts#L60 +https://github.com/elastic/kibana/blob/2df44b9f7f76f3d03f6e32be7f2a39034f97c22e/x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_note.ts#L60 This gives the false impression that the associated saved object has been stored but it actually has been associated to a different timeline. Subsequent saves of the active timeline (which is not the associated timeline) will then create a new `timelineId`. When the page is reloaded, the associated saved objects will be gone from that timeline. diff --git a/x-pack/solutions/security/plugins/security_solution/docs/openapi/README.md b/x-pack/solutions/security/plugins/security_solution/docs/openapi/README.md new file mode 100644 index 0000000000000..3cbe1c1f42336 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/docs/openapi/README.md @@ -0,0 +1,66 @@ +# Security Solution API reference documentation + +Documentation about Security Solution OpenAPI bundling workflow and configuration. See [Kibana wide docs](../../../../../../../oas_docs/README.md) for general information. + +## Workflow + +Security Solution uses **specification first approach**. It means we define OpenAPI spec files describing individual API endpoints (also known as source OpenAPI specs) at first. After that we use tooling in particular [`kbn-openapi-bundler`](../../../../../../../packages/kbn-openapi-bundler/README.md) to process source OpenAPI specs to produce domain OpenAPI bundles. + +The workflow consists of multiple steps and visualized below + +![workflow diagram](workflow.png) + +This document describes **step 0** implemented on Security Solution's side. + +#### Bundling automation (CI integration) + +Bundling Security Solution domain OpenAPI bundles is **Step 0** of the workflow. To keep the domain OpenAPI bundles always up-to-date and in sync with the source OpenAPI specs, the bundling runs as part of the `Checks` step in CI on every PR build and on merge builds. If there are any changes to the source OpenAPI files, these changes get propagated to the domain OpenAPI bundles and CI commits the changes. In that case the build is marked as failed and needs to be restarted. + +### API Domains + +Security Solution has multiple API domains scattered across Kibana. Currently the following API domains are handled in the workflow: + +- Security AI Assistant + + - Bundling script: `x-pack/platform/packages/shared/kbn-elastic-assistant-common/scripts/openapi/bundle.js` + - Bundles location: `x-pack/platform/packages/shared/kbn-elastic-assistant-common/docs/openapi/{ess|serverless}` + +- Security Detections + + - Bundling script: `x-pack/solutions/security/plugins/security_solution/scripts/openapi/bundle_detections.js` + - Bundles location: `x-pack/solutions/security/plugins/security_solution/docs/openapi/{ess|serverless}` + +- Security Endpoint Exceptions + + - Bundling script: `x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/scripts/openapi_bundle.js` + - Bundles location: `x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/{ess|serverless}` + +- Security Endpoint Management + + - Bundling script: `x-pack/solutions/security/plugins/security_solution/scripts/openapi/bundle_endpoint_management.js` + - Bundles location: `x-pack/solutions/security/plugins/security_solution/docs/openapi/{ess|serverless}` + +- Security Endpoint Management + + - Bundling script: `x-pack/solutions/security/plugins/security_solution/scripts/openapi/bundle_entity_analytics.js` + - Bundles location: `x-pack/solutions/security/plugins/security_solution/docs/openapi/{ess|serverless}` + +- Security Security Exceptions + + - Bundling script: `x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle.js` + - Bundles location: `x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common/docs/openapi/{ess|serverless}` + +- Security Lists + + - Bundling script: `x-pack/solutions/security/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle.js` + - Bundles location: `x-pack/solutions/security/packages/kbn-securitysolution-lists-common/docs/openapi/{ess|serverless}` + +- Security Osquery + + - Bundling script: `x-pack/platform/plugins/shared/osquery/scripts/openapi/bundle.js` + - Bundles location: `x-pack/platform/plugins/shared/osquery/docs/openapi/{ess|serverless}` + +- Security Timeline + + - Bundling script: `x-pack/solutions/security/plugins/security_solution/scripts/openapi/bundle_timeline.js` + - Bundles location: `x-pack/solutions/security/plugins/security_solution/docs/openapi/{ess|serverless}` diff --git a/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_detections_api_2023_10_31.bundled.schema.yaml b/x-pack/solutions/security/plugins/security_solution/docs/openapi/ess/security_solution_detections_api_2023_10_31.bundled.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/docs/openapi/ess/security_solution_detections_api_2023_10_31.bundled.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/docs/openapi/ess/security_solution_detections_api_2023_10_31.bundled.schema.yaml diff --git a/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_endpoint_management_api_2023_10_31.bundled.schema.yaml b/x-pack/solutions/security/plugins/security_solution/docs/openapi/ess/security_solution_endpoint_management_api_2023_10_31.bundled.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/docs/openapi/ess/security_solution_endpoint_management_api_2023_10_31.bundled.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/docs/openapi/ess/security_solution_endpoint_management_api_2023_10_31.bundled.schema.yaml diff --git a/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_entity_analytics_api_2023_10_31.bundled.schema.yaml b/x-pack/solutions/security/plugins/security_solution/docs/openapi/ess/security_solution_entity_analytics_api_2023_10_31.bundled.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/docs/openapi/ess/security_solution_entity_analytics_api_2023_10_31.bundled.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/docs/openapi/ess/security_solution_entity_analytics_api_2023_10_31.bundled.schema.yaml diff --git a/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_timeline_api_2023_10_31.bundled.schema.yaml b/x-pack/solutions/security/plugins/security_solution/docs/openapi/ess/security_solution_timeline_api_2023_10_31.bundled.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/docs/openapi/ess/security_solution_timeline_api_2023_10_31.bundled.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/docs/openapi/ess/security_solution_timeline_api_2023_10_31.bundled.schema.yaml diff --git a/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_detections_api_2023_10_31.bundled.schema.yaml b/x-pack/solutions/security/plugins/security_solution/docs/openapi/serverless/security_solution_detections_api_2023_10_31.bundled.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_detections_api_2023_10_31.bundled.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/docs/openapi/serverless/security_solution_detections_api_2023_10_31.bundled.schema.yaml diff --git a/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_endpoint_management_api_2023_10_31.bundled.schema.yaml b/x-pack/solutions/security/plugins/security_solution/docs/openapi/serverless/security_solution_endpoint_management_api_2023_10_31.bundled.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_endpoint_management_api_2023_10_31.bundled.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/docs/openapi/serverless/security_solution_endpoint_management_api_2023_10_31.bundled.schema.yaml diff --git a/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_entity_analytics_api_2023_10_31.bundled.schema.yaml b/x-pack/solutions/security/plugins/security_solution/docs/openapi/serverless/security_solution_entity_analytics_api_2023_10_31.bundled.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_entity_analytics_api_2023_10_31.bundled.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/docs/openapi/serverless/security_solution_entity_analytics_api_2023_10_31.bundled.schema.yaml diff --git a/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_timeline_api_2023_10_31.bundled.schema.yaml b/x-pack/solutions/security/plugins/security_solution/docs/openapi/serverless/security_solution_timeline_api_2023_10_31.bundled.schema.yaml similarity index 100% rename from x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_timeline_api_2023_10_31.bundled.schema.yaml rename to x-pack/solutions/security/plugins/security_solution/docs/openapi/serverless/security_solution_timeline_api_2023_10_31.bundled.schema.yaml diff --git a/x-pack/plugins/security_solution/docs/openapi/workflow.png b/x-pack/solutions/security/plugins/security_solution/docs/openapi/workflow.png similarity index 100% rename from x-pack/plugins/security_solution/docs/openapi/workflow.png rename to x-pack/solutions/security/plugins/security_solution/docs/openapi/workflow.png diff --git a/x-pack/plugins/security_solution/docs/rfcs/detection_response/prebuilt_rules_customization.md b/x-pack/solutions/security/plugins/security_solution/docs/rfcs/detection_response/prebuilt_rules_customization.md similarity index 89% rename from x-pack/plugins/security_solution/docs/rfcs/detection_response/prebuilt_rules_customization.md rename to x-pack/solutions/security/plugins/security_solution/docs/rfcs/detection_response/prebuilt_rules_customization.md index 97f7be2b8cd69..7ebf8a464df5f 100644 --- a/x-pack/plugins/security_solution/docs/rfcs/detection_response/prebuilt_rules_customization.md +++ b/x-pack/solutions/security/plugins/security_solution/docs/rfcs/detection_response/prebuilt_rules_customization.md @@ -188,7 +188,7 @@ Notice, as well, that `immutable` and `rule_source` will continue to be part **o The OpenAPI schema will need to be modified so: -_Source: [x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/common_attributes.schema.yaml](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/common_attributes.schema.yaml)_ +_Source: [x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/common_attributes.schema.yaml](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/common_attributes.schema.yaml)_ ```yaml # [... file continues above...] @@ -242,7 +242,7 @@ RuleSource: # [... file continues below ...] ``` -_Source: [x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_schemas.schema.yaml](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_schemas.schema.yaml)_ +_Source: [x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_schemas.schema.yaml](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/model/rule_schema/rule_schemas.schema.yaml)_ ```yaml # [... file continues above...] @@ -289,7 +289,7 @@ See the detailed explanation for this mechanism in the [Exporting and importing The `immutable` and `rule_source` fields will be ignored if passed in the request payload. -_Source: [x-pack/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import.ts](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import.ts)_ +_Source: [x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import.ts](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/common/api/detection_engine/rule_management/import_rules/rule_to_import.ts)_ ```ts // [... file continues above...] @@ -314,7 +314,7 @@ export const RuleToImport = BaseCreateProps.and(TypeSpecificCreateProps).and( **The internal rule schema** needs to represent that the `immutable` and the new `ruleSource` field may not always exist, so they must be optional. -_Source: [x-pack/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_schemas.ts](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_schemas.ts)_ +_Source: [x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_schemas.ts](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_schemas.ts)_ ```ts export type BaseRuleParams = z.infer<typeof BaseRuleParams>; @@ -331,7 +331,7 @@ export const BaseRuleParams = z.object({ In the internal rule schema, there are two additional important reasons why we need to make sure that these two fields optional: -- When rules are executed, a call to the method `validateRuleTypeParams` is done, which is a method that validates the passed rule's parameters using the validators defined in `x-pack/plugins/security_solution/server/lib/detection_engine/rule_types`, within each of the rule query types files (for [EQL rules](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/create_eql_alert_type.ts#L27), for example). The validation is done based on the internal rule schema `BaseRulesParams` displayed above. Having `ruleSource` as required field would cause custom rules or prebuilt rules that haven't had their schema migrated to fail during runtime. +- When rules are executed, a call to the method `validateRuleTypeParams` is done, which is a method that validates the passed rule's parameters using the validators defined in `x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types`, within each of the rule query types files (for [EQL rules](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/eql/create_eql_alert_type.ts#L27), for example). The validation is done based on the internal rule schema `BaseRulesParams` displayed above. Having `ruleSource` as required field would cause custom rules or prebuilt rules that haven't had their schema migrated to fail during runtime. - The Rule Client `update` method also calls the `validateRuleTypeParams` to validate the rule's params. Since the Rule Client's `update` method is used in our endpoint handlers, such as and `/rules/patch` and `/_bulk_actions`, these would fail when executed against a payload of custom rule. #### Prebuilt Rule asset schema @@ -340,7 +340,7 @@ The `PrebuiltRuleAsset` type needs to be updated to include the new `source_upda Notice that this field will be a **top-level field in the Prebuilt Rule asset** schema, but will be part of the `rule_source` field in the API rule schema and internal rule schema. -_Source: [x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset.ts](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset.ts)_ +_Source: [x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset.ts](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset.ts)_ ```ts export const PrebuiltRuleAsset = BaseCreateProps.and(TypeSpecificCreateProps).and( @@ -375,7 +375,7 @@ Both the docs and the custom response header should communicate that the `immuta - is maintained for backwards compatibility reasons only - will be removed after a specific date/release -The endpoints should be updated to include a custom response header, using the [format we already use for our bulk CRUD endpoints.](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/deprecation.ts#L34-L43) +The endpoints should be updated to include a custom response header, using the [format we already use for our bulk CRUD endpoints.](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/deprecation.ts#L34-L43) ## Mapping changes @@ -385,7 +385,7 @@ No changes will be needed for the [mapping of rule saved objects](https://github **Security Rules (prebuilt rule assets) mapping** -No changes will be needed either for the `security-rule` [mapping](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_assets/prebuilt_rule_assets_type.ts), our prebuilt rule assets. We currently have mappings for the `rule_id` and `version` fields, since we perform aggregations and filtering on those in the rule install and upgrade endpoints. No additional fields needs to be mapped in this phase. +No changes will be needed either for the `security-rule` [mapping](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_assets/prebuilt_rule_assets_type.ts), our prebuilt rule assets. We currently have mappings for the `rule_id` and `version` fields, since we perform aggregations and filtering on those in the rule install and upgrade endpoints. No additional fields needs to be mapped in this phase. ## Plan for carrying out migrations of rule SOs @@ -403,9 +403,9 @@ Since the migration of rules will be performed as the user calls the pertinent e All endpoints belonging to Detection Rules Management that create and update -including upgrade of prebuilt rules to new version- use three CRUD methods under the hood: -- [`createRules`](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/crud/create_rules.ts) -- [`patchRules`](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/crud/patch_rules.ts) -- [`updateRules`](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/crud/update_rules.ts) +- [`createRules`](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/crud/create_rules.ts) +- [`patchRules`](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/crud/patch_rules.ts) +- [`updateRules`](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/crud/update_rules.ts) This "overuse" of these 3 methods for a variety of user actions makes their logic tightly coupled and creates a considerable amount of complexity to CRUD functions that should remain logically simple. @@ -464,7 +464,7 @@ The **normalization on read** will be carried out by a new `normalizeRuleSourceS Inside this method, we will use `normalizeRuleSourceSchemaOnRuleRead` to calculate the normalized values of `rule_source` and `immutable`. -_Source: [x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_converters.ts](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_converters.ts)_ +_Source: [x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_converters.ts](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_converters.ts)_ ```ts export const internalRuleToAPIResponse = (rule) => { @@ -488,7 +488,7 @@ export const commonParamsCamelToSnake = (params: BaseRuleParams) => { And the `normalizeRuleSourceSchemaOnRuleRead` can be defined so: -_Source: x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/prebuilt_rule_schema_migrations.ts_ (New file) +_Source: x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/prebuilt_rule_schema_migrations.ts_ (New file) ```ts interface OnReadNormalizationResult { @@ -833,13 +833,13 @@ As mentioned before, we need to assume that at any point in time, there will be This means that we will need to update the constants and KQL filters that we have hardcoded in our application to reflect the new schema: -_See source of rule params keys: [x-pack/plugins/security_solution/common/detection_engine/rule_management/rule_fields.ts](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/common/detection_engine/rule_management/rule_fields.ts)_ +_See source of rule params keys: [x-pack/solutions/security/plugins/security_solution/common/detection_engine/rule_management/rule_fields.ts](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/common/detection_engine/rule_management/rule_fields.ts)_ -Will need to update the `x-pack/plugins/security_solution/common/detection_engine/rule_management/rule_filtering.ts` file, where the `convertRulesFilterToKQL` method is defined. This method is used both in the frontend and in the serverside, and translates rule filter options to KQL filters that Elasticsearch can understand. +Will need to update the `x-pack/solutions/security/plugins/security_solution/common/detection_engine/rule_management/rule_filtering.ts` file, where the `convertRulesFilterToKQL` method is defined. This method is used both in the frontend and in the serverside, and translates rule filter options to KQL filters that Elasticsearch can understand. Here, we need to update the KQL filters and the logic for fetching Elastic prebuilt and custom rules, relying on `rule_source` but with fallback to `immutable`: -_Source for `convertRulesFilterToKQL`: [x-pack/plugins/security_solution/common/detection_engine/rule_management/rule_filtering.ts](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/common/detection_engine/rule_management/rule_filtering.ts)_ +_Source for `convertRulesFilterToKQL`: [x-pack/solutions/security/plugins/security_solution/common/detection_engine/rule_management/rule_filtering.ts](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/common/detection_engine/rule_management/rule_filtering.ts)_ In order to retrieve Elastic prebuilt rules, we can filter for rules in which `alert.attributes.params.rule_source.type` is `external`, with a fallback to rules in which `alert.attributes.params.immutable` is `true`, for rules which have not had their schema migrated and `rule_source` does not still exists for them. @@ -861,46 +861,46 @@ Creating new methods for those unrelated actions should help clean the `createRu This endpoint currently depends on rules `alert.attributes.params.immutable` to fetch number of custom rules and number of prebuilt rules. We need to adapt its logic to rely on new `alert.attributes.params.rule_source` field, with fallback to the original, for backwards compatibility. -Specifically, the endpoint handler uses the [`findRules` utility](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/find_rules.ts) to fetch rules based on their `immutable` param. +Specifically, the endpoint handler uses the [`findRules` utility](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/find_rules.ts) to fetch rules based on their `immutable` param. This needs to be changed so that we rely on the `rule_source.type` param, but fallback to `immutable` if that parameter doesn't exist - i.e., in the case of non-migrated-on-write rules. We need to modify the KQL queries in a similar way to the already described in the section `KQL filters and the convertRulesFilterToKQL`. -We need to modify the `x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/filters/route.ts` file; specifically the `fetchRulesCount` function, which contains the KQL query filters that should be updated. +We need to modify the `x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/filters/route.ts` file; specifically the `fetchRulesCount` function, which contains the KQL query filters that should be updated. -_See Source: [x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/filters/route.ts](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/filters/route.ts)_ +_See Source: [x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/filters/route.ts](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/filters/route.ts)_ - **Coverage Overview** - `/rules_coverage_overview` (Internal): This endpoint is called to retrieve the data that populates the MITRE Coverage Overview table, and currently depends on the `immutable` field to fetch the user's installed rules. Similarly to what was described in the previous endpoint, we should update the logic so that we rely on the `rule_source.type` field, but fallback to `immutable` if that parameter doesn't exist - i.e., in the case of non-migrated-on-write rules. -This endpoint handler also uses the [`findRules` utility](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/find_rules.ts) to fetch rules, but the KQL filter that is passed to that utility is created by the reusable [`convertRulesFilterToKQL` utility function](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/common/detection_engine/rule_management/rule_filtering.ts): +This endpoint handler also uses the [`findRules` utility](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/find_rules.ts) to fetch rules, but the KQL filter that is passed to that utility is created by the reusable [`convertRulesFilterToKQL` utility function](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/common/detection_engine/rule_management/rule_filtering.ts): -_See Source: [x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/coverage_overview/handle_coverage_overview_request.ts](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/coverage_overview/handle_coverage_overview_request.ts)_ +_See Source: [x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/coverage_overview/handle_coverage_overview_request.ts](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/coverage_overview/handle_coverage_overview_request.ts)_ Therefor, it is enough to modify the `convertRulesFilterToKQL` utility logic as was described in the section above: [KQL filters and the `convertRulesFilterToKQL` method](#kql-filters-and-the-convertrulesfiltertokql-method) ### Prebuilt Rules endpoints -- [**(LEGACY) Get Prebuilt Rules and Timeline Status** - `/rules/prepackaged/_status`](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_and_timelines_status/get_prebuilt_rules_and_timelines_status_route.ts) +- [**(LEGACY) Get Prebuilt Rules and Timeline Status** - `/rules/prepackaged/_status`](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_and_timelines_status/get_prebuilt_rules_and_timelines_status_route.ts) This currently depends on rules `alert.attributes.params.immutable` to fetch the number of custom rules and number of prebuilt rules. We need to adapt these filters used in the `findRules` method used in the endpoint handler to rely on new `alert.attributes.params.rule_source.type` field, with fallback to the original, for backwards compatibility: -_See Source: [x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_and_timelines_status/get_prebuilt_rules_and_timelines_status_route.ts](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_and_timelines_status/get_prebuilt_rules_and_timelines_status_route.ts)_ +_See Source: [x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_and_timelines_status/get_prebuilt_rules_and_timelines_status_route.ts](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_and_timelines_status/get_prebuilt_rules_and_timelines_status_route.ts)_ As explained above, this endpoint fetches the installed prebuilt rules, as well, using the `getExistingPrepackagedRules` reusable utility. This function needs to be modified as well to update its KQL query filters: -_See source for `getExistingPrepackagedRules`: [x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/get_existing_prepackaged_rules.ts](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/get_existing_prepackaged_rules.ts)_ +_See source for `getExistingPrepackagedRules`: [x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/get_existing_prepackaged_rules.ts](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/get_existing_prepackaged_rules.ts)_ -- [**Get Prebuilt Rules Status** - `GET /prebuilt_rules/status` (Internal)](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_status/get_prebuilt_rules_status_route.ts) +- [**Get Prebuilt Rules Status** - `GET /prebuilt_rules/status` (Internal)](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_status/get_prebuilt_rules_status_route.ts) Uses `IPrebuiltRuleObjectsClient` to retrieve instances of prebuilt rules according to the `immutable` field. The Prebuilt Rule Objects client fetches prebuilt rules using the `getExistingPrepackagedRules` function mentioned above, so modifying it as described above will suffice: -_Source: [x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_objects/prebuilt_rule_objects_client.ts](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_objects/prebuilt_rule_objects_client.ts)_ +_Source: [x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_objects/prebuilt_rule_objects_client.ts](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_objects/prebuilt_rule_objects_client.ts)_ -- [**(LEGACY) Install Prebuilt Rules And Timelines** - `PUT /rules/prepackaged`](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.ts) +- [**(LEGACY) Install Prebuilt Rules And Timelines** - `PUT /rules/prepackaged`](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.ts) This endpoint fetches the installed prebuilt rules using the `getExistingPrepackagedRules` reusable utility, as well: -_Source: [x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.ts](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.ts)_ +_Source: [x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.ts](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.ts)_ Therefore, modifying the `getExistingPrepackagedRules` function as described above will suffice. @@ -910,11 +910,11 @@ All four endpoints use the Prebuilt Rule Saved Objects client (`IPrebuiltRuleObj Additionally: -- [**Review Rule Installation** - `POST /prebuilt_rules/installation/_review` (Internal)](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_installation/review_rule_installation_route.ts) +- [**Review Rule Installation** - `POST /prebuilt_rules/installation/_review` (Internal)](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_installation/review_rule_installation_route.ts) This endpoint uses the `convertPrebuiltRuleAssetToRuleResponse` method, which takes in a prebuilt rule asset and converts it to an object of type `RuleResponse`. This method has to be modified so that new prebuilt rules objects are returned by the endpoint with a `rule_source` field of type `external` and its other corresponding subfields, as well as the legacy `immutable` value of `true`. -_Source: [x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_converters.ts](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_converters.ts)_ +_Source: [x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_converters.ts](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_converters.ts)_ ```ts // [... file continues above ...] @@ -946,19 +946,19 @@ export const convertPrebuiltRuleAssetToRuleResponse = ( }; ``` -- [**Perform Rule Installation** - `POST /prebuilt_rules/installation/_install` (Internal)](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_installation/perform_rule_installation_route.ts) +- [**Perform Rule Installation** - `POST /prebuilt_rules/installation/_install` (Internal)](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_installation/perform_rule_installation_route.ts) -To install a new prebuilt rule, this endpoint uses the [`createPrebuiltRules` method](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_objects/create_prebuilt_rules.ts), which in turn calls the [`createRules` method](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/crud/create_rules.ts). +To install a new prebuilt rule, this endpoint uses the [`createPrebuiltRules` method](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_objects/create_prebuilt_rules.ts), which in turn calls the [`createRules` method](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/crud/create_rules.ts). This endpoint also suffers from the issue of tightly coupled logic explained above: using th `createRules` method for creating, importing and upgrading -in some cases- rules. We need to create a new CRUD method specifically for installing prebuilt rules, that extracts that responsibility out of the `createRules` method. -- [**Review Rule Upgrade** - `POST /prebuilt_rules/upgrade/_review` (Internal)](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_upgrade/review_rule_upgrade_route.ts) +- [**Review Rule Upgrade** - `POST /prebuilt_rules/upgrade/_review` (Internal)](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_upgrade/review_rule_upgrade_route.ts) This endpoint uses the `convertPrebuiltRuleAssetToRuleResponse` method to get a `RuleResponse`-type object from a target version of a rule provided from upstream. This method needs to be modified as described in the section that details the changes needed for the **Review Rule Installation** - `POST /prebuilt_rules/installation/_review`. This endpoint will need further changes, which will be detailed further down, and are out of the scope of Saved Object, migration and rule schema updates. -- [**Perform Rule Upgrade** - `POST /prebuilt_rules/upgrade/_perform` (Internal)](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/perform_rule_upgrade_route.ts) +- [**Perform Rule Upgrade** - `POST /prebuilt_rules/upgrade/_perform` (Internal)](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/perform_rule_upgrade_route.ts) This endpoint will require major changes to add the capability of letting users selecting a custom version of the rule with custom values for rule fields. This will be explained further below in the "Changes to upgrade `_review` and `_perform` endpoints" section. @@ -968,19 +968,19 @@ Again, this endpoint suffers from tightly coupled logic explained in [`Problem w ### Rule monitoring endpoints -- [**Detection Engine Health: Get Cluster Health** - `GET or POST /detection_engine/health/_cluster` (internal):](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_route.ts) +- [**Detection Engine Health: Get Cluster Health** - `GET or POST /detection_engine/health/_cluster` (internal):](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_route.ts) -This endpoint uses the [Detection Engine Health Client (`IDetectionEngineHealthClient`)](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/detection_engine_health_client_interface.ts), calling its [`calculateClusterHealth` method](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/detection_engine_health_client.ts) in the request handler. +This endpoint uses the [Detection Engine Health Client (`IDetectionEngineHealthClient`)](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/detection_engine_health_client_interface.ts), calling its [`calculateClusterHealth` method](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/detection_engine_health_client.ts) in the request handler. -The Detection Engine Health client receives as its parameter the [Rule Objects Health client (`IRuleObjectsHealthClient`)](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/rule_objects_health_client.ts), whose method `calculateClusterHealth` performs an aggregation on rule stats based on different rule attributes and parameters. +The Detection Engine Health client receives as its parameter the [Rule Objects Health client (`IRuleObjectsHealthClient`)](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/rule_objects_health_client.ts), whose method `calculateClusterHealth` performs an aggregation on rule stats based on different rule attributes and parameters. -This is done in the [`getRuleStatsAggregation` method](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/aggregations/rule_stats.ts), where an aggregation is done over the `immutable` param. This needs to be updated to the new `rule_source.type` param, with a fallback to `immutable`: +This is done in the [`getRuleStatsAggregation` method](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/aggregations/rule_stats.ts), where an aggregation is done over the `immutable` param. This needs to be updated to the new `rule_source.type` param, with a fallback to `immutable`: -_Source: x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/aggregations/rule_stats.ts(https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/aggregations/rule_stats.ts)_ +_Source: x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/aggregations/rule_stats.ts(https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/aggregations/rule_stats.ts)_ - **Detection Engine Health: Get Space Health** - `GET or POST /detection_engine/health/_space` (internal): -In this endpoint, the `getSpaceHealthAggregation` method of the Rule Objects Health client (`IRuleObjectsHealthClient`) is called instead, but it internally calls the same [`getRuleStatsAggregation` method](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/aggregations/rule_stats.ts) as in the previous endpoint. +In this endpoint, the `getSpaceHealthAggregation` method of the Rule Objects Health client (`IRuleObjectsHealthClient`) is called instead, but it internally calls the same [`getRuleStatsAggregation` method](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/aggregations/rule_stats.ts) as in the previous endpoint. Therefore, the update described in the endpoint above would cover this endpoint too. @@ -1017,8 +1017,8 @@ This normalization will take place within the `internalRuleToAPIResponse` method There are two helper functions used for exporting: -- [getExportByObjectIds](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_by_object_ids.ts) -- [getExportAll](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_all.ts) +- [getExportByObjectIds](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_by_object_ids.ts) +- [getExportAll](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_all.ts) The **Export Rules** - `POST /rules/_export` endpoint uses either the first or the second helper depending on the request payload, while **Bulk Actions** - `POST /rules/_bulk_action` uses only `getExportByObjectIds`. @@ -1026,10 +1026,10 @@ Both of these methods use `internalRuleToAPIResponse` internally to transform ru Also, in order to allow the endpoint to export both custom **and** prebuilt rules, we need to update the logic and remove the checks that we currently do server-side in both of these methods, and which filter out prebuilt rules from the response payload: -_Source for `getRulesFromObjects`: [x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_by_object_ids.ts](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_by_object_ids.ts)_ +_Source for `getRulesFromObjects`: [x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_by_object_ids.ts](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_by_object_ids.ts)_ -_Source for `getExportAll`: [x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_all.ts](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_all.ts)_ +_Source for `getExportAll`: [x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_all.ts](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_all.ts)_ ### Importing rules diff --git a/x-pack/plugins/security_solution/docs/siem_migration/README.md b/x-pack/solutions/security/plugins/security_solution/docs/siem_migration/README.md similarity index 100% rename from x-pack/plugins/security_solution/docs/siem_migration/README.md rename to x-pack/solutions/security/plugins/security_solution/docs/siem_migration/README.md diff --git a/x-pack/plugins/security_solution/docs/siem_migration/img/agent_graph.png b/x-pack/solutions/security/plugins/security_solution/docs/siem_migration/img/agent_graph.png similarity index 100% rename from x-pack/plugins/security_solution/docs/siem_migration/img/agent_graph.png rename to x-pack/solutions/security/plugins/security_solution/docs/siem_migration/img/agent_graph.png diff --git a/x-pack/plugins/security_solution/docs/testing/test_plans/README.md b/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/README.md similarity index 100% rename from x-pack/plugins/security_solution/docs/testing/test_plans/README.md rename to x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/README.md diff --git a/x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/alerts/user_assignment.md b/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/alerts/user_assignment.md similarity index 100% rename from x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/alerts/user_assignment.md rename to x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/alerts/user_assignment.md diff --git a/x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/exporting.md b/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/exporting.md similarity index 100% rename from x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/exporting.md rename to x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/exporting.md diff --git a/x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/importing.md b/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/importing.md similarity index 100% rename from x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/importing.md rename to x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/importing.md diff --git a/x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/installation_and_upgrade.md b/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/installation_and_upgrade.md similarity index 100% rename from x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/installation_and_upgrade.md rename to x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/installation_and_upgrade.md diff --git a/x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/upgrade_review_algorithms.md b/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/upgrade_review_algorithms.md similarity index 100% rename from x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/upgrade_review_algorithms.md rename to x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/upgrade_review_algorithms.md diff --git a/x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management/coverage_overview_dashboard.md b/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management/coverage_overview_dashboard.md similarity index 100% rename from x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management/coverage_overview_dashboard.md rename to x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management/coverage_overview_dashboard.md diff --git a/x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management/todo b/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management/todo similarity index 100% rename from x-pack/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management/todo rename to x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/rule_management/todo diff --git a/x-pack/plugins/security_solution/docs/testing/test_plans/test_plan_template.md b/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/test_plan_template.md similarity index 100% rename from x-pack/plugins/security_solution/docs/testing/test_plans/test_plan_template.md rename to x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/test_plan_template.md diff --git a/x-pack/solutions/security/plugins/security_solution/jest.config.dev.js b/x-pack/solutions/security/plugins/security_solution/jest.config.dev.js new file mode 100644 index 0000000000000..af3cb65d0547c --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/jest.config.dev.js @@ -0,0 +1,17 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../', + projects: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/common/*/jest.config.js', + '<rootDir>/x-pack/solutions/security/plugins/security_solution/server/*/jest.config.js', + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/*/jest.config.js', + '<rootDir>/x-pack/solutions/security/plugins/security_solution/scripts/junit_transformer/*/jest.config.js', + ], +}; diff --git a/x-pack/solutions/security/plugins/security_solution/jest.integration.config.js b/x-pack/solutions/security/plugins/security_solution/jest.integration.config.js new file mode 100644 index 0000000000000..4fe389d2ec246 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/jest.integration.config.js @@ -0,0 +1,12 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution'], +}; diff --git a/x-pack/plugins/security_solution/kibana.jsonc b/x-pack/solutions/security/plugins/security_solution/kibana.jsonc similarity index 100% rename from x-pack/plugins/security_solution/kibana.jsonc rename to x-pack/solutions/security/plugins/security_solution/kibana.jsonc diff --git a/x-pack/solutions/security/plugins/security_solution/package.json b/x-pack/solutions/security/plugins/security_solution/package.json new file mode 100644 index 0000000000000..b015d9ae3ac60 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/package.json @@ -0,0 +1,39 @@ +{ + "author": "Elastic", + "name": "@kbn/security-solution-plugin", + "version": "1.0.0", + "private": true, + "license": "Elastic License 2.0", + "scripts": { + "extract-mitre-attacks": "node scripts/extract_tactics_techniques_mitre.js && node ../../../../../scripts/eslint ./public/detections/mitre/mitre_tactics_techniques.ts --fix", + "build-beat-doc": "node scripts/beat_docs/build.js && node ../../../../../scripts/eslint ../timelines/server/utils/beat_schema/fields.ts --fix", + "cypress": "NODE_OPTIONS=--openssl-legacy-provider ../../../../../node_modules/.bin/cypress", + "cypress:burn": "yarn cypress:dw run --env burn=2 --headed", + "cypress:changed-specs-only": "yarn cypress:dw run --changed-specs-only --env burn=2", + "cypress:dw": "NODE_OPTIONS=--openssl-legacy-provider node ./scripts/start_cypress_parallel --config-file plugins/security_solution/public/management/cypress/cypress.config.ts --ftr-config-file ../../../../test/defend_workflows_cypress/cli_config", + "cypress:dw:open": "yarn cypress:dw open", + "cypress:dw:run": "yarn cypress:dw run", + "cypress:dw:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ./scripts/start_cypress_parallel --config-file plugins/security_solution/public/management/cypress/cypress_serverless.config.ts --ftr-config-file ../../../../test/defend_workflows_cypress/serverless_config", + "cypress:dw:serverless:open": "yarn cypress:dw:serverless open", + "cypress:dw:serverless:run": "yarn cypress:dw:serverless run", + "cypress:dw:qa:serverless": "NODE_OPTIONS=--openssl-legacy-provider node ./scripts/start_cypress_parallel_serverless --config-file plugins/security_solution/public/management/cypress/cypress_serverless_qa.config.ts", + "cypress:dw:qa:serverless:run": "yarn cypress:dw:qa:serverless run", + "cypress:dw:serverless:changed-specs-only": "yarn cypress:dw:serverless run --changed-specs-only --env burn=2", + "cypress:dw:endpoint": "echo '\n** WARNING **: Run script `cypress:dw:endpoint` no longer valid! Use `cypress:dw` instead\n'", + "cypress:dw:endpoint:run": "echo '\n** WARNING **: Run script `cypress:dw:endpoint:run` no longer valid! Use `cypress:dw:run` instead\n'", + "cypress:dw:endpoint:open": "echo '\n** WARNING **: Run script `cypress:dw:endpoint:open` no longer valid! Use `cypress:dw:open` instead\n'", + "junit:merge": "../../../../../node_modules/.bin/mochawesome-merge ../../../target/kibana-security-solution/cypress/results/mochawesome*.json > ../../../target/kibana-security-solution/cypress/results/output.json && ../../../node_modules/.bin/marge ../../../target/kibana-security-solution/cypress/results/output.json --reportDir ../../../target/kibana-security-solution/cypress/results && yarn junit:transform && mkdir -p ../../../target/junit && cp ../../../target/kibana-security-solution/cypress/results/*.xml ../../../target/junit/", + "test:generate": "node scripts/endpoint/resolver_generator", + "test:generate:serverless-dev": "NODE_TLS_REJECT_UNAUTHORIZED=0 node --no-warnings scripts/endpoint/resolver_generator --node https://elastic_serverless:changeme@127.0.0.1:9200 --kibana http://elastic_serverless:changeme@127.0.0.1:5601", + "mappings:generate": "node scripts/mappings/mappings_generator", + "mappings:load": "node scripts/mappings/mappings_loader", + "siem-migrations:graph:draw": "node scripts/siem_migration/draw_graphs", + "junit:transform": "node scripts/junit_transformer --pathPattern '../../../../../target/kibana-security-solution/cypress/results/*.xml' --rootDirectory ../../../ --reportName 'Security Solution Cypress' --writeInPlace", + "openapi:generate": "node scripts/openapi/generate", + "openapi:generate:debug": "node --inspect-brk scripts/openapi/generate", + "openapi:bundle:detections": "node scripts/openapi/bundle_detections", + "openapi:bundle:timeline": "node scripts/openapi/bundle_timeline", + "openapi:bundle:entity-analytics": "node scripts/openapi/bundle_entity_analytics", + "openapi:bundle:endpoint-management": "node scripts/openapi/bundle_endpoint_management" + } +} \ No newline at end of file diff --git a/x-pack/plugins/security_solution/public/app/404.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/404.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/404.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/404.tsx diff --git a/x-pack/plugins/security_solution/public/app/actions/add_to_timeline/cell_action/add_to_timeline.test.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/cell_action/add_to_timeline.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/add_to_timeline/cell_action/add_to_timeline.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/cell_action/add_to_timeline.test.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/add_to_timeline/cell_action/add_to_timeline.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/cell_action/add_to_timeline.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/add_to_timeline/cell_action/add_to_timeline.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/cell_action/add_to_timeline.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/add_to_timeline/cell_action/investigate_in_new_timeline.test.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/cell_action/investigate_in_new_timeline.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/add_to_timeline/cell_action/investigate_in_new_timeline.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/cell_action/investigate_in_new_timeline.test.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/add_to_timeline/cell_action/investigate_in_new_timeline.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/cell_action/investigate_in_new_timeline.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/add_to_timeline/cell_action/investigate_in_new_timeline.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/cell_action/investigate_in_new_timeline.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/add_to_timeline/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/add_to_timeline/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/constants.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/add_to_timeline/data_provider.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/data_provider.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/add_to_timeline/data_provider.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/data_provider.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/add_to_timeline/discover/add_to_timeline.test.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/discover/add_to_timeline.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/add_to_timeline/discover/add_to_timeline.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/discover/add_to_timeline.test.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/add_to_timeline/discover/add_to_timeline.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/discover/add_to_timeline.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/add_to_timeline/discover/add_to_timeline.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/discover/add_to_timeline.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/add_to_timeline/index.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/add_to_timeline/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/index.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/add_to_timeline/lens/add_to_timeline.test.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/lens/add_to_timeline.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/add_to_timeline/lens/add_to_timeline.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/lens/add_to_timeline.test.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/add_to_timeline/lens/add_to_timeline.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/lens/add_to_timeline.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/add_to_timeline/lens/add_to_timeline.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/add_to_timeline/lens/add_to_timeline.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/constants.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/copy_to_clipboard/cell_action/copy_to_clipboard.test.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/copy_to_clipboard/cell_action/copy_to_clipboard.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/copy_to_clipboard/cell_action/copy_to_clipboard.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/copy_to_clipboard/cell_action/copy_to_clipboard.test.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/copy_to_clipboard/cell_action/copy_to_clipboard.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/copy_to_clipboard/cell_action/copy_to_clipboard.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/copy_to_clipboard/cell_action/copy_to_clipboard.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/copy_to_clipboard/cell_action/copy_to_clipboard.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/copy_to_clipboard/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/copy_to_clipboard/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/copy_to_clipboard/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/copy_to_clipboard/constants.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/copy_to_clipboard/discover/copy_to_clipboard.test.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/copy_to_clipboard/discover/copy_to_clipboard.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/copy_to_clipboard/discover/copy_to_clipboard.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/copy_to_clipboard/discover/copy_to_clipboard.test.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/copy_to_clipboard/discover/copy_to_clipboard.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/copy_to_clipboard/discover/copy_to_clipboard.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/copy_to_clipboard/discover/copy_to_clipboard.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/copy_to_clipboard/discover/copy_to_clipboard.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/copy_to_clipboard/index.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/copy_to_clipboard/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/copy_to_clipboard/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/copy_to_clipboard/index.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/copy_to_clipboard/lens/copy_to_clipboard.test.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/copy_to_clipboard/lens/copy_to_clipboard.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/copy_to_clipboard/lens/copy_to_clipboard.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/copy_to_clipboard/lens/copy_to_clipboard.test.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/copy_to_clipboard/lens/copy_to_clipboard.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/copy_to_clipboard/lens/copy_to_clipboard.ts similarity index 94% rename from x-pack/plugins/security_solution/public/app/actions/copy_to_clipboard/lens/copy_to_clipboard.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/copy_to_clipboard/lens/copy_to_clipboard.ts index f4c61c1e7bf7b..1666a2e65f9cd 100644 --- a/x-pack/plugins/security_solution/public/app/actions/copy_to_clipboard/lens/copy_to_clipboard.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/app/actions/copy_to_clipboard/lens/copy_to_clipboard.ts @@ -9,9 +9,10 @@ import type { CellValueContext, IEmbeddable } from '@kbn/embeddable-plugin/publi import { isErrorEmbeddable } from '@kbn/embeddable-plugin/public'; import { createAction } from '@kbn/ui-actions-plugin/public'; import copy from 'copy-to-clipboard'; +import { isLensApi } from '@kbn/lens-plugin/public'; import { isInSecurityApp } from '../../../../common/hooks/is_in_security_app'; import { KibanaServices } from '../../../../common/lib/kibana'; -import { fieldHasCellActions, isCountField, isLensEmbeddable } from '../../utils'; +import { fieldHasCellActions, isCountField } from '../../utils'; import { COPY_TO_CLIPBOARD, COPY_TO_CLIPBOARD_ICON, COPY_TO_CLIPBOARD_SUCCESS } from '../constants'; export const ACTION_ID = 'embeddable_copyToClipboard'; @@ -39,7 +40,7 @@ export const createCopyToClipboardLensAction = ({ order }: { order?: number }) = getDisplayName: () => COPY_TO_CLIPBOARD, isCompatible: async ({ embeddable, data }) => !isErrorEmbeddable(embeddable as IEmbeddable) && - isLensEmbeddable(embeddable as IEmbeddable) && + isLensApi(embeddable) && isDataColumnsValid(data) && isInSecurityApp(currentAppId), execute: async ({ data }) => { diff --git a/x-pack/plugins/security_solution/public/app/actions/filter/cell_action/filter_in.test.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/cell_action/filter_in.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/filter/cell_action/filter_in.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/cell_action/filter_in.test.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/filter/cell_action/filter_in.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/cell_action/filter_in.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/filter/cell_action/filter_in.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/cell_action/filter_in.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/filter/cell_action/filter_out.test.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/cell_action/filter_out.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/filter/cell_action/filter_out.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/cell_action/filter_out.test.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/filter/cell_action/filter_out.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/cell_action/filter_out.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/filter/cell_action/filter_out.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/cell_action/filter_out.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/filter/discover/filter_in.test.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/discover/filter_in.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/filter/discover/filter_in.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/discover/filter_in.test.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/filter/discover/filter_in.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/discover/filter_in.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/filter/discover/filter_in.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/discover/filter_in.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/filter/discover/filter_out.test.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/discover/filter_out.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/filter/discover/filter_out.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/discover/filter_out.test.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/filter/discover/filter_out.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/discover/filter_out.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/filter/discover/filter_out.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/discover/filter_out.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/filter/index.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/filter/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/index.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/filter/lens/create_action.test.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/lens/create_action.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/filter/lens/create_action.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/lens/create_action.test.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/filter/lens/create_action.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/lens/create_action.ts similarity index 96% rename from x-pack/plugins/security_solution/public/app/actions/filter/lens/create_action.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/lens/create_action.ts index e264466767287..79bcd0e87ced5 100644 --- a/x-pack/plugins/security_solution/public/app/actions/filter/lens/create_action.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/lens/create_action.ts @@ -16,9 +16,10 @@ import type { CellValueContext, IEmbeddable } from '@kbn/embeddable-plugin/publi import { createAction } from '@kbn/ui-actions-plugin/public'; import { ACTION_INCOMPATIBLE_VALUE_WARNING } from '@kbn/cell-actions/src/actions/translations'; import { i18n } from '@kbn/i18n'; +import { isLensApi } from '@kbn/lens-plugin/public'; import { isInSecurityApp } from '../../../../common/hooks/is_in_security_app'; import { timelineSelectors } from '../../../../timelines/store'; -import { fieldHasCellActions, isLensEmbeddable } from '../../utils'; +import { fieldHasCellActions } from '../../utils'; import { TimelineId } from '../../../../../common/types'; import { DefaultCellActionTypes } from '../../constants'; import type { SecurityAppStore } from '../../../../common/store'; @@ -79,7 +80,7 @@ export const createFilterLensAction = ({ type: DefaultCellActionTypes.FILTER, isCompatible: async ({ embeddable, data }) => !isErrorEmbeddable(embeddable as IEmbeddable) && - isLensEmbeddable(embeddable as IEmbeddable) && + isLensApi(embeddable) && isDataColumnsValid(data) && isInSecurityApp(currentAppId), execute: async ({ data }) => { diff --git a/x-pack/plugins/security_solution/public/app/actions/filter/lens/filter_in.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/lens/filter_in.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/filter/lens/filter_in.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/lens/filter_in.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/filter/lens/filter_out.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/lens/filter_out.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/filter/lens/filter_out.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/filter/lens/filter_out.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/index.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/index.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/register.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/register.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/register.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/register.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/register_discover_histogram_actions.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/register_discover_histogram_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/register_discover_histogram_actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/register_discover_histogram_actions.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/show_top_n/cell_action/show_top_n.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/actions/show_top_n/cell_action/show_top_n.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/show_top_n/cell_action/show_top_n.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/show_top_n/cell_action/show_top_n.test.tsx diff --git a/x-pack/plugins/security_solution/public/app/actions/show_top_n/cell_action/show_top_n.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/actions/show_top_n/cell_action/show_top_n.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/show_top_n/cell_action/show_top_n.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/show_top_n/cell_action/show_top_n.tsx diff --git a/x-pack/plugins/security_solution/public/app/actions/show_top_n/index.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/show_top_n/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/show_top_n/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/show_top_n/index.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/telemetry.test.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/telemetry.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/telemetry.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/telemetry.test.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/telemetry.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/telemetry.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/telemetry.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/telemetry.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/toggle_asset_column/cell_action/toggle_asset_column.test.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/toggle_asset_column/cell_action/toggle_asset_column.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/toggle_asset_column/cell_action/toggle_asset_column.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/toggle_asset_column/cell_action/toggle_asset_column.test.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/toggle_asset_column/cell_action/toggle_asset_column.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/toggle_asset_column/cell_action/toggle_asset_column.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/toggle_asset_column/cell_action/toggle_asset_column.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/toggle_asset_column/cell_action/toggle_asset_column.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/toggle_asset_column/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/actions/toggle_asset_column/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/toggle_asset_column/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/toggle_asset_column/index.tsx diff --git a/x-pack/plugins/security_solution/public/app/actions/toggle_column/cell_action/toggle_column.test.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/toggle_column/cell_action/toggle_column.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/toggle_column/cell_action/toggle_column.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/toggle_column/cell_action/toggle_column.test.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/toggle_column/cell_action/toggle_column.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/toggle_column/cell_action/toggle_column.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/toggle_column/cell_action/toggle_column.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/toggle_column/cell_action/toggle_column.ts diff --git a/x-pack/plugins/security_solution/public/app/actions/toggle_column/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/actions/toggle_column/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/toggle_column/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/toggle_column/index.tsx diff --git a/x-pack/plugins/security_solution/public/app/actions/types.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/actions/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/actions/types.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/app/actions/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/app/actions/utils.ts new file mode 100644 index 0000000000000..568a5f10f31ec --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/app/actions/utils.ts @@ -0,0 +1,26 @@ +/* + * 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 { Serializable } from '@kbn/utility-types'; + +// All cell actions are disabled for these fields in Security +const FIELDS_WITHOUT_CELL_ACTIONS = [ + 'signal.rule.risk_score', + 'kibana.alert.risk_score', + 'signal.reason', + 'kibana.alert.reason', +]; + +export const fieldHasCellActions = (field?: string): boolean => { + return !!field && !FIELDS_WITHOUT_CELL_ACTIONS.includes(field); +}; + +export const isCountField = ( + fieldType: string | undefined, + sourceParamType: Serializable | undefined +) => { + return fieldType === 'number' && sourceParamType === 'value_count'; +}; diff --git a/x-pack/plugins/security_solution/public/app/app.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/app.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/app.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/app.tsx diff --git a/x-pack/plugins/security_solution/public/app/app_routes.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/app_routes.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/app_routes.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/app_routes.test.tsx diff --git a/x-pack/plugins/security_solution/public/app/app_routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/app_routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/app_routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/app_routes.tsx diff --git a/x-pack/plugins/security_solution/public/app/components/top_values_popover/top_values_popover.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/components/top_values_popover/top_values_popover.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/components/top_values_popover/top_values_popover.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/components/top_values_popover/top_values_popover.test.tsx diff --git a/x-pack/plugins/security_solution/public/app/components/top_values_popover/top_values_popover.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/components/top_values_popover/top_values_popover.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/components/top_values_popover/top_values_popover.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/components/top_values_popover/top_values_popover.tsx diff --git a/x-pack/plugins/security_solution/public/app/components/top_values_popover/top_values_popover_service.ts b/x-pack/solutions/security/plugins/security_solution/public/app/components/top_values_popover/top_values_popover_service.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/components/top_values_popover/top_values_popover_service.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/components/top_values_popover/top_values_popover_service.ts diff --git a/x-pack/plugins/security_solution/public/app/home/global_header/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/home/global_header/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/home/global_header/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/home/global_header/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/app/home/global_header/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/home/global_header/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/home/global_header/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/home/global_header/index.tsx diff --git a/x-pack/plugins/security_solution/public/app/home/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/home/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/home/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/home/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/app/home/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/home/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/home/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/home/index.tsx diff --git a/x-pack/plugins/security_solution/public/app/home/template_wrapper/global_kql_header/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/home/template_wrapper/global_kql_header/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/home/template_wrapper/global_kql_header/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/home/template_wrapper/global_kql_header/index.tsx diff --git a/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/home/template_wrapper/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/home/template_wrapper/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/home/template_wrapper/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/home/template_wrapper/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/home/template_wrapper/index.tsx diff --git a/x-pack/plugins/security_solution/public/app/home/template_wrapper/timeline/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/home/template_wrapper/timeline/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/home/template_wrapper/timeline/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/home/template_wrapper/timeline/index.tsx diff --git a/x-pack/plugins/security_solution/public/app/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/index.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/app/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/app/jest.config.js new file mode 100644 index 0000000000000..41a934d84b16d --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/app/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/app'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/app', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/app/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/app/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/routes.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/categories.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/categories.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/categories.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/categories.ts diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/index.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/index.ts diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/app_links.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/app_links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/app_links.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/app_links.ts diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/nav.links.test.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/nav.links.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/nav.links.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/nav.links.test.ts diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/nav_links.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/nav_links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/nav_links.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/nav_links.ts diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/assets_links.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/assets_links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/assets_links.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/assets_links.ts diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/assets_translations.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/assets_translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/assets_translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/assets_translations.ts diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/dev_tools_links.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/dev_tools_links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/dev_tools_links.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/dev_tools_links.ts diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/dev_tools_translations.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/dev_tools_translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/dev_tools_translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/dev_tools_translations.ts diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/discover_links.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/discover_links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/discover_links.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/discover_links.ts diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/discover_translations.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/discover_translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/discover_translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/discover_translations.ts diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/chart_arrow.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/chart_arrow.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/chart_arrow.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/chart_arrow.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/dashboard.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/dashboard.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/dashboard.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/dashboard.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/data_view.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/data_view.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/data_view.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/data_view.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/ecctl.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/ecctl.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/ecctl.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/ecctl.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/endpoint.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/endpoint.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/endpoint.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/endpoint.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/filebeat.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/filebeat.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/filebeat.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/filebeat.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/filebeat_chart.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/filebeat_chart.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/filebeat_chart.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/filebeat_chart.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/fleet.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/fleet.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/fleet.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/fleet.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/infra.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/infra.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/infra.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/infra.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/intuitive.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/intuitive.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/intuitive.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/intuitive.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/jobs.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/jobs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/jobs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/jobs.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/keyword.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/keyword.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/keyword.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/keyword.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/lens.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/lens.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/lens.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/lens.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/manager.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/manager.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/manager.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/manager.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/marketing.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/marketing.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/marketing.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/marketing.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/osquery.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/osquery.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/osquery.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/osquery.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/rapid_bar_graph.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/rapid_bar_graph.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/rapid_bar_graph.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/rapid_bar_graph.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/replication.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/replication.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/replication.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/replication.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/settings.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/settings.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/settings.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/settings.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/timeline.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/timeline.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/timeline.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/timeline.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/visualization.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/visualization.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/icons/visualization.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/icons/visualization.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/investigations_links.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/investigations_links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/investigations_links.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/investigations_links.ts diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/investigations_translations.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/investigations_translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/investigations_translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/investigations_translations.ts diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/lazy_icons.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/lazy_icons.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/lazy_icons.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/lazy_icons.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/ml_links.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/ml_links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/ml_links.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/ml_links.ts diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/ml_translations.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/ml_translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/ml_translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/ml_translations.ts diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/settings_links.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/settings_links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/settings_links.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/settings_links.ts diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/settings_translations.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/settings_translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/links/sections/settings_translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/links/sections/settings_translations.ts diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/navigation_tree.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/navigation_tree.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/navigation_tree.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/navigation_tree.ts diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/solution_navigation.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/solution_navigation.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/solution_navigation.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/solution_navigation.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/use_panel_side_nav_items.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/use_panel_side_nav_items.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/use_panel_side_nav_items.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/use_panel_side_nav_items.test.tsx diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/use_panel_side_nav_items.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/use_panel_side_nav_items.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/use_panel_side_nav_items.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/use_panel_side_nav_items.ts diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/util.test.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/util.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/util.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/util.test.ts diff --git a/x-pack/plugins/security_solution/public/app/solution_navigation/util.ts b/x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/util.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/solution_navigation/util.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/solution_navigation/util.ts diff --git a/x-pack/plugins/security_solution/public/app/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/app/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/translations.ts diff --git a/x-pack/plugins/security_solution/public/app/types.ts b/x-pack/solutions/security/plugins/security_solution/public/app/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/app/types.ts diff --git a/x-pack/plugins/security_solution/public/app_links.test.ts b/x-pack/solutions/security/plugins/security_solution/public/app_links.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app_links.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/app_links.test.ts diff --git a/x-pack/plugins/security_solution/public/app_links.ts b/x-pack/solutions/security/plugins/security_solution/public/app_links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/app_links.ts rename to x-pack/solutions/security/plugins/security_solution/public/app_links.ts diff --git a/x-pack/plugins/security_solution/public/assets/assets.tsx b/x-pack/solutions/security/plugins/security_solution/public/assets/assets.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assets/assets.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assets/assets.tsx diff --git a/x-pack/plugins/security_solution/public/assets/index.ts b/x-pack/solutions/security/plugins/security_solution/public/assets/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/assets/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/assets/index.ts diff --git a/x-pack/plugins/security_solution/public/assets/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/assets/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assets/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assets/routes.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/comment_actions/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/comment_actions/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/comment_actions/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/comment_actions/index.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/comment_actions/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/assistant/comment_actions/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/comment_actions/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/assistant/comment_actions/translations.ts diff --git a/x-pack/plugins/security_solution/public/assistant/content/conversations/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/content/conversations/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/content/conversations/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/content/conversations/index.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/content/conversations/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/assistant/content/conversations/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/content/conversations/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/assistant/content/conversations/translations.ts diff --git a/x-pack/plugins/security_solution/public/assistant/content/prompt_contexts/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/content/prompt_contexts/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/content/prompt_contexts/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/content/prompt_contexts/index.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/content/prompt_contexts/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/assistant/content/prompt_contexts/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/content/prompt_contexts/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/assistant/content/prompt_contexts/translations.ts diff --git a/x-pack/plugins/security_solution/public/assistant/content/prompts/user/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/assistant/content/prompts/user/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/content/prompts/user/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/assistant/content/prompts/user/translations.ts diff --git a/x-pack/plugins/security_solution/public/assistant/content/quick_prompts/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/content/quick_prompts/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/content/quick_prompts/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/content/quick_prompts/index.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/content/quick_prompts/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/assistant/content/quick_prompts/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/content/quick_prompts/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/assistant/content/quick_prompts/translations.ts diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/custom_codeblock/custom_code_block.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/custom_codeblock/custom_code_block.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/get_comments/custom_codeblock/custom_code_block.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/custom_codeblock/custom_code_block.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/custom_codeblock/custom_codeblock_markdown_plugin.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/custom_codeblock/custom_codeblock_markdown_plugin.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/get_comments/custom_codeblock/custom_codeblock_markdown_plugin.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/custom_codeblock/custom_codeblock_markdown_plugin.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/get_comments/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/get_comments/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/index.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/stream/buttons/regenerate_response_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/buttons/regenerate_response_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/get_comments/stream/buttons/regenerate_response_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/buttons/regenerate_response_button.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/stream/buttons/stop_generating_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/buttons/stop_generating_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/get_comments/stream/buttons/stop_generating_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/buttons/stop_generating_button.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/stream/failed_to_load_response.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/failed_to_load_response.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/get_comments/stream/failed_to_load_response.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/failed_to_load_response.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/stream/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/get_comments/stream/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/stream/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/get_comments/stream/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/index.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/stream/message_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/message_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/get_comments/stream/message_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/message_panel.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/stream/message_text.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/message_text.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/get_comments/stream/message_text.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/message_text.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/stream/stream_observable.test.ts b/x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/stream_observable.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/get_comments/stream/stream_observable.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/stream_observable.test.ts diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/stream/stream_observable.ts b/x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/stream_observable.ts similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/get_comments/stream/stream_observable.ts rename to x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/stream_observable.ts diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/stream/types.ts b/x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/get_comments/stream/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/types.ts diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/stream/use_stream.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/use_stream.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/get_comments/stream/use_stream.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/use_stream.test.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/stream/use_stream.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/use_stream.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/get_comments/stream/use_stream.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/stream/use_stream.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/get_comments/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/assistant/get_comments/translations.ts diff --git a/x-pack/plugins/security_solution/public/assistant/header_link.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/header_link.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/header_link.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/header_link.test.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/header_link.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/header_link.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/header_link.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/header_link.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/helpers.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/assistant/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/assistant/jest.config.js new file mode 100644 index 0000000000000..64d32fe9e0de5 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/assistant/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/assistant'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/assistant', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/assistant/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/assistant/overlay.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/overlay.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/overlay.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/overlay.test.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/overlay.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/overlay.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/overlay.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/overlay.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/provider.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/provider.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/provider.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/provider.test.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/provider.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/provider.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/provider.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/provider.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/send_to_timeline/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/send_to_timeline/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/send_to_timeline/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/send_to_timeline/index.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/stack_management/management_settings.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/stack_management/management_settings.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/stack_management/management_settings.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/stack_management/management_settings.test.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/stack_management/management_settings.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/stack_management/management_settings.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/stack_management/management_settings.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/stack_management/management_settings.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/update_query_in_form/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/update_query_in_form/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/update_query_in_form/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/update_query_in_form/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/update_query_in_form/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/update_query_in_form/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/update_query_in_form/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/update_query_in_form/index.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/update_query_in_form/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/assistant/update_query_in_form/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/update_query_in_form/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/assistant/update_query_in_form/translations.ts diff --git a/x-pack/plugins/security_solution/public/assistant/use_assistant_availability/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/use_assistant_availability/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/use_assistant_availability/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/use_assistant_availability/index.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/use_assistant_telemetry/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/use_assistant_telemetry/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/use_assistant_telemetry/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/use_assistant_telemetry/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/use_assistant_telemetry/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/use_assistant_telemetry/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/use_assistant_telemetry/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/use_assistant_telemetry/index.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/use_conversation_store/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/use_conversation_store/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/use_conversation_store/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/use_conversation_store/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/assistant/use_conversation_store/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/assistant/use_conversation_store/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/assistant/use_conversation_store/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/assistant/use_conversation_store/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/helpers.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/index.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/jest.config.js new file mode 100644 index 0000000000000..8b15d99be93f2 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/attack_discovery'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/attack_discovery', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/attack_discovery/links.test.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/links.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/links.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/links.test.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/links.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/links.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/links.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/header/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/header/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/header/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/header/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/alerts_settings/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/alerts_settings/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/alerts_settings/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/alerts_settings/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/alerts_settings/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/alerts_settings/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/alerts_settings/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/alerts_settings/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/footer/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/footer/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/footer/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/footer/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/footer/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/footer/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/footer/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/footer/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/is_tour_enabled/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/is_tour_enabled/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/is_tour_enabled/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/is_tour_enabled/index.test.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/is_tour_enabled/index.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/is_tour_enabled/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/is_tour_enabled/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/is_tour_enabled/index.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/settings_modal/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/header/status_bell/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/status_bell/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/header/status_bell/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/status_bell/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/header/status_bell/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/status_bell/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/header/status_bell/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/status_bell/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/header/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/header/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/header/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/helpers.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/generation_timing/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/generation_timing/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/generation_timing/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/generation_timing/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/generation_timing/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/generation_timing/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/generation_timing/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/generation_timing/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/helpers.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/last_times_popover/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/countdown/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/info_popover_body/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/info_popover_body/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/info_popover_body/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/info_popover_body/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/info_popover_body/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/info_popover_body/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/info_popover_body/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/info_popover_body/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/loading_messages/get_loading_callout_alerts_count/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/loading_messages/get_loading_callout_alerts_count/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/loading_messages/get_loading_callout_alerts_count/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/loading_messages/get_loading_callout_alerts_count/index.test.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/loading_messages/get_loading_callout_alerts_count/index.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/loading_messages/get_loading_callout_alerts_count/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/loading_messages/get_loading_callout_alerts_count/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/loading_messages/get_loading_callout_alerts_count/index.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/loading_messages/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/loading_messages/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/loading_messages/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/loading_messages/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/loading_messages/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/loading_messages/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/loading_messages/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/loading_messages/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/loading_callout/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/loading_callout/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/mock/mock_attack_discovery.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/mock/mock_attack_discovery.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/mock/mock_attack_discovery.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/mock/mock_attack_discovery.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/mock/mock_find_anonymization_fields_response.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/mock/mock_find_anonymization_fields_response.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/mock/mock_find_anonymization_fields_response.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/mock/mock_find_anonymization_fields_response.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/mock/mock_use_attack_discovery.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/mock/mock_use_attack_discovery.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/mock/mock_use_attack_discovery.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/mock/mock_use_attack_discovery.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/page_title/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/page_title/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/page_title/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/page_title/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/page_title/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/page_title/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/page_title/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/page_title/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/page_title/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/page_title/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/page_title/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/page_title/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/attack_discovery_markdown_parser/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/attack_discovery_markdown_parser/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/attack_discovery_markdown_parser/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/attack_discovery_markdown_parser/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/attack_discovery_markdown_parser/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/attack_discovery_markdown_parser/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/attack_discovery_markdown_parser/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/attack_discovery_markdown_parser/helpers.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/attack_discovery_markdown_parser/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/attack_discovery_markdown_parser/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/attack_discovery_markdown_parser/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/attack_discovery_markdown_parser/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/attack_discovery_markdown_parser/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/attack_discovery_markdown_parser/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/attack_discovery_markdown_parser/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/attack_discovery_markdown_parser/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/get_host_flyout_panel_props.test.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/get_host_flyout_panel_props.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/get_host_flyout_panel_props.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/get_host_flyout_panel_props.test.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/get_host_flyout_panel_props.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/get_host_flyout_panel_props.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/get_host_flyout_panel_props.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/get_host_flyout_panel_props.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/get_user_flyout_panel_props.test.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/get_user_flyout_panel_props.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/get_user_flyout_panel_props.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/get_user_flyout_panel_props.test.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/get_user_flyout_panel_props.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/get_user_flyout_panel_props.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/get_user_flyout_panel_props.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/get_user_flyout_panel_props.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/helpers.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/field_markdown_renderer/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/types.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_markdown_formatter/types.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actionable_summary/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actionable_summary/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actionable_summary/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actionable_summary/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actionable_summary/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actionable_summary/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actionable_summary/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actionable_summary/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/actions_placeholder/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/actions_placeholder/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/actions_placeholder/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/actions_placeholder/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/actions_placeholder/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/actions_placeholder/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/actions_placeholder/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/actions_placeholder/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/alerts_badge/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/alerts_badge/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/alerts_badge/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/alerts_badge/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/alerts_badge/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/alerts_badge/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/alerts_badge/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/alerts_badge/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/take_action/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/take_action/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/take_action/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/take_action/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/take_action/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/take_action/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/take_action/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/take_action/helpers.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/take_action/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/take_action/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/take_action/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/take_action/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/take_action/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/take_action/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/take_action/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/take_action/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/take_action/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/take_action/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/take_action/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/take_action/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_case/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_case/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_case/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_case/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_case/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_case/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_case/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_case/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_case/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_case/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_case/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_case/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_existing_case/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_existing_case/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_existing_case/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_existing_case/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_existing_case/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_existing_case/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_existing_case/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_existing_case/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_existing_case/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_existing_case/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_existing_case/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_existing_case/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/get_attack_discovery_markdown/get_attack_discovery_markdown.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/get_attack_discovery_markdown/get_attack_discovery_markdown.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/get_attack_discovery_markdown/get_attack_discovery_markdown.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/get_attack_discovery_markdown/get_attack_discovery_markdown.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/get_attack_discovery_markdown/get_attack_discovery_markdown.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/get_attack_discovery_markdown/get_attack_discovery_markdown.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/get_attack_discovery_markdown/get_attack_discovery_markdown.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/get_attack_discovery_markdown/get_attack_discovery_markdown.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/alerts_tab/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/alerts_tab/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/alerts_tab/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/alerts_tab/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/alerts_tab/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/alerts_tab/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/alerts_tab/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/alerts_tab/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/axis_tick/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/axis_tick/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/axis_tick/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/axis_tick/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/axis_tick/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/axis_tick/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/axis_tick/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/axis_tick/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/tactic/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/tactic/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/tactic/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/tactic/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/tactic/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/tactic/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/tactic/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/attack_chain/tactic/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/mini_attack_chain/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/mini_attack_chain/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/mini_attack_chain/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/mini_attack_chain/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/mini_attack_chain/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/mini_attack_chain/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/mini_attack_chain/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/mini_attack_chain/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/mini_attack_chain/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/mini_attack_chain/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/mini_attack_chain/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/attack/mini_attack_chain/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/attack_discovery_tab/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/get_tabs.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/get_tabs.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/get_tabs.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/get_tabs.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/get_tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/get_tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/get_tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/get_tabs.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/tabs/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/title/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/title/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/title/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/title/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/title/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/title/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/title/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/title/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/use_view_in_ai_assistant.test.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/use_view_in_ai_assistant.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/use_view_in_ai_assistant.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/use_view_in_ai_assistant.test.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/use_view_in_ai_assistant.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/use_view_in_ai_assistant.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/use_view_in_ai_assistant.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/use_view_in_ai_assistant.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/animated_counter/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/animated_counter/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/animated_counter/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/animated_counter/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/animated_counter/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/animated_counter/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/animated_counter/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/animated_counter/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/empty_prompt/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/failure/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/failure/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/failure/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/failure/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/failure/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/failure/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/failure/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/failure/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/failure/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/failure/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/failure/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/failure/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/generate/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/generate/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/generate/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/generate/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/generate/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/generate/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/generate/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/generate/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/helpers/show_empty_states/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/helpers/show_empty_states/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/helpers/show_empty_states/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/helpers/show_empty_states/index.test.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/helpers/show_empty_states/index.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/helpers/show_empty_states/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/helpers/show_empty_states/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/helpers/show_empty_states/index.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/no_alerts/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/no_alerts/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/no_alerts/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/no_alerts/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/no_alerts/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/no_alerts/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/no_alerts/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/no_alerts/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/no_alerts/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/no_alerts/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/no_alerts/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/no_alerts/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/welcome/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/welcome/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/welcome/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/welcome/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/welcome/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/welcome/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/welcome/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/welcome/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/welcome/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/welcome/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/empty_states/welcome/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/empty_states/welcome/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/summary/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/summary/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/summary/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/summary/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/summary/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/summary/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/summary/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/summary/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/summary/summary_count/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/summary/summary_count/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/summary/summary_count/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/summary/summary_count/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/summary/summary_count/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/summary/summary_count/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/summary/summary_count/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/summary/summary_count/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/summary/summary_count/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/summary/summary_count/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/results/summary/summary_count/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/results/summary/summary_count/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/translations.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/helpers.ts diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/index.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/use_poll_api/use_poll_api.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/use_poll_api/use_poll_api.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/use_poll_api/use_poll_api.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/use_poll_api/use_poll_api.test.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/use_poll_api/use_poll_api.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/use_poll_api/use_poll_api.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/use_poll_api/use_poll_api.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/use_poll_api/use_poll_api.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/routes.tsx diff --git a/x-pack/plugins/security_solution/public/attack_discovery/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/attack_discovery/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/attack_discovery/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/attack_discovery/translations.ts diff --git a/x-pack/plugins/security_solution/public/cases/attachments/external_reference.tsx b/x-pack/solutions/security/plugins/security_solution/public/cases/attachments/external_reference.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cases/attachments/external_reference.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cases/attachments/external_reference.tsx diff --git a/x-pack/plugins/security_solution/public/cases/attachments/external_reference_children.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/cases/attachments/external_reference_children.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cases/attachments/external_reference_children.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cases/attachments/external_reference_children.test.tsx diff --git a/x-pack/plugins/security_solution/public/cases/attachments/external_reference_children.tsx b/x-pack/solutions/security/plugins/security_solution/public/cases/attachments/external_reference_children.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cases/attachments/external_reference_children.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cases/attachments/external_reference_children.tsx diff --git a/x-pack/plugins/security_solution/public/cases/attachments/external_reference_event.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/cases/attachments/external_reference_event.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cases/attachments/external_reference_event.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cases/attachments/external_reference_event.test.tsx diff --git a/x-pack/plugins/security_solution/public/cases/attachments/external_reference_event.tsx b/x-pack/solutions/security/plugins/security_solution/public/cases/attachments/external_reference_event.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cases/attachments/external_reference_event.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cases/attachments/external_reference_event.tsx diff --git a/x-pack/plugins/security_solution/public/cases/attachments/lazy_external_reference_children_content.tsx b/x-pack/solutions/security/plugins/security_solution/public/cases/attachments/lazy_external_reference_children_content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cases/attachments/lazy_external_reference_children_content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cases/attachments/lazy_external_reference_children_content.tsx diff --git a/x-pack/plugins/security_solution/public/cases/attachments/lazy_external_reference_content.tsx b/x-pack/solutions/security/plugins/security_solution/public/cases/attachments/lazy_external_reference_content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cases/attachments/lazy_external_reference_content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cases/attachments/lazy_external_reference_content.tsx diff --git a/x-pack/plugins/security_solution/public/cases/attachments/types.ts b/x-pack/solutions/security/plugins/security_solution/public/cases/attachments/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/cases/attachments/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/cases/attachments/types.ts diff --git a/x-pack/plugins/security_solution/public/cases/components/use_insert_timeline/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/cases/components/use_insert_timeline/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cases/components/use_insert_timeline/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cases/components/use_insert_timeline/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/cases/components/use_insert_timeline/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/cases/components/use_insert_timeline/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cases/components/use_insert_timeline/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cases/components/use_insert_timeline/index.tsx diff --git a/x-pack/plugins/security_solution/public/cases/index.ts b/x-pack/solutions/security/plugins/security_solution/public/cases/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/cases/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/cases/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/cases/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/cases/jest.config.js new file mode 100644 index 0000000000000..cf6bc6e0ead89 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/cases/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/cases'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/cases', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/cases/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/cases/links.ts b/x-pack/solutions/security/plugins/security_solution/public/cases/links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/cases/links.ts rename to x-pack/solutions/security/plugins/security_solution/public/cases/links.ts diff --git a/x-pack/plugins/security_solution/public/cases/pages/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/cases/pages/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cases/pages/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cases/pages/index.tsx diff --git a/x-pack/plugins/security_solution/public/cases/pages/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/cases/pages/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/cases/pages/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/cases/pages/translations.ts diff --git a/x-pack/plugins/security_solution/public/cases/pages/use_fetch_alert_data.ts b/x-pack/solutions/security/plugins/security_solution/public/cases/pages/use_fetch_alert_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/cases/pages/use_fetch_alert_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/cases/pages/use_fetch_alert_data.ts diff --git a/x-pack/plugins/security_solution/public/cases/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/cases/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cases/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cases/routes.tsx diff --git a/x-pack/plugins/security_solution/public/cases_test_utils.ts b/x-pack/solutions/security/plugins/security_solution/public/cases_test_utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/cases_test_utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/cases_test_utils.ts diff --git a/x-pack/plugins/security_solution/public/cloud_defend/index.ts b/x-pack/solutions/security/plugins/security_solution/public/cloud_defend/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_defend/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/cloud_defend/index.ts diff --git a/x-pack/plugins/security_solution/public/cloud_defend/links.ts b/x-pack/solutions/security/plugins/security_solution/public/cloud_defend/links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_defend/links.ts rename to x-pack/solutions/security/plugins/security_solution/public/cloud_defend/links.ts diff --git a/x-pack/plugins/security_solution/public/cloud_defend/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/cloud_defend/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_defend/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cloud_defend/routes.tsx diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/breadcrumbs.ts b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/breadcrumbs.ts similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_security_posture/breadcrumbs.ts rename to x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/breadcrumbs.ts diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/cloud_security_posture_pli_auth_block_extension.tsx b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/cloud_security_posture_pli_auth_block_extension.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_security_posture/cloud_security_posture_pli_auth_block_extension.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/cloud_security_posture_pli_auth_block_extension.tsx diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/components/alerts/alerts_preview.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/alerts/alerts_preview.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_security_posture/components/alerts/alerts_preview.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/alerts/alerts_preview.test.tsx diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/components/alerts/alerts_preview.tsx b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/alerts/alerts_preview.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_security_posture/components/alerts/alerts_preview.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/alerts/alerts_preview.tsx diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/components/csp_details/alerts_findings_details_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/csp_details/alerts_findings_details_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_security_posture/components/csp_details/alerts_findings_details_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/csp_details/alerts_findings_details_table.tsx diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/components/csp_details/insights_tab_csp.tsx b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/csp_details/insights_tab_csp.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_security_posture/components/csp_details/insights_tab_csp.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/csp_details/insights_tab_csp.tsx diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/components/csp_details/misconfiguration_findings_details_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/csp_details/misconfiguration_findings_details_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_security_posture/components/csp_details/misconfiguration_findings_details_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/csp_details/misconfiguration_findings_details_table.tsx diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/components/csp_details/vulnerabilities_findings_details_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/csp_details/vulnerabilities_findings_details_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_security_posture/components/csp_details/vulnerabilities_findings_details_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/csp_details/vulnerabilities_findings_details_table.tsx diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/components/entity_insight.tsx b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/entity_insight.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_security_posture/components/entity_insight.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/entity_insight.tsx diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/components/misconfiguration/misconfiguration_preview.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/misconfiguration/misconfiguration_preview.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_security_posture/components/misconfiguration/misconfiguration_preview.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/misconfiguration/misconfiguration_preview.test.tsx diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/components/misconfiguration/misconfiguration_preview.tsx b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/misconfiguration/misconfiguration_preview.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_security_posture/components/misconfiguration/misconfiguration_preview.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/misconfiguration/misconfiguration_preview.tsx diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/components/vulnerabilities/vulnerabilities_preview.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/vulnerabilities/vulnerabilities_preview.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_security_posture/components/vulnerabilities/vulnerabilities_preview.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/vulnerabilities/vulnerabilities_preview.test.tsx diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/components/vulnerabilities/vulnerabilities_preview.tsx b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/vulnerabilities/vulnerabilities_preview.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_security_posture/components/vulnerabilities/vulnerabilities_preview.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/components/vulnerabilities/vulnerabilities_preview.tsx diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/hooks/use_entity_insight.ts b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/hooks/use_entity_insight.ts similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_security_posture/hooks/use_entity_insight.ts rename to x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/hooks/use_entity_insight.ts diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/hooks/use_non_closed_alerts.ts b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/hooks/use_non_closed_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_security_posture/hooks/use_non_closed_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/hooks/use_non_closed_alerts.ts diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/hooks/use_risk_score_data.ts b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/hooks/use_risk_score_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_security_posture/hooks/use_risk_score_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/hooks/use_risk_score_data.ts diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/index.ts b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_security_posture/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/jest.config.js new file mode 100644 index 0000000000000..de934c750ae5a --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/jest.config.js @@ -0,0 +1,21 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture', + ], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/lazy_cloud_security_posture_pli_auth_block_extension.tsx b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/lazy_cloud_security_posture_pli_auth_block_extension.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_security_posture/lazy_cloud_security_posture_pli_auth_block_extension.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/lazy_cloud_security_posture_pli_auth_block_extension.tsx diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/links.ts b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_security_posture/links.ts rename to x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/links.ts diff --git a/x-pack/plugins/security_solution/public/cloud_security_posture/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/cloud_security_posture/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/cloud_security_posture/routes.tsx diff --git a/x-pack/plugins/security_solution/public/common/__mocks__/experimental_features_service.ts b/x-pack/solutions/security/plugins/security_solution/public/common/__mocks__/experimental_features_service.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/__mocks__/experimental_features_service.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/__mocks__/experimental_features_service.ts diff --git a/x-pack/plugins/security_solution/public/common/__mocks__/query_wrapper.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/__mocks__/query_wrapper.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/__mocks__/query_wrapper.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/__mocks__/query_wrapper.tsx diff --git a/x-pack/plugins/security_solution/public/common/breadcrumbs/breadcrumbs.ts b/x-pack/solutions/security/plugins/security_solution/public/common/breadcrumbs/breadcrumbs.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/breadcrumbs/breadcrumbs.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/breadcrumbs/breadcrumbs.ts diff --git a/x-pack/plugins/security_solution/public/common/breadcrumbs/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/breadcrumbs/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/breadcrumbs/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/breadcrumbs/index.ts diff --git a/x-pack/plugins/security_solution/public/common/breadcrumbs/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/breadcrumbs/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/breadcrumbs/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/breadcrumbs/types.ts diff --git a/x-pack/plugins/security_solution/public/common/components/accessibility/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/accessibility/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/accessibility/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/accessibility/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/accessibility/interval_abbr_screen_reader/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/accessibility/interval_abbr_screen_reader/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/accessibility/interval_abbr_screen_reader/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/accessibility/interval_abbr_screen_reader/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/accessibility/interval_abbr_screen_reader/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/accessibility/interval_abbr_screen_reader/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/accessibility/interval_abbr_screen_reader/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/accessibility/interval_abbr_screen_reader/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/accessibility/interval_abbr_screen_reader/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/accessibility/interval_abbr_screen_reader/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/accessibility/interval_abbr_screen_reader/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/accessibility/interval_abbr_screen_reader/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/accessibility/tooltip_with_keyboard_shortcut/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/accessibility/tooltip_with_keyboard_shortcut/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/accessibility/tooltip_with_keyboard_shortcut/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/accessibility/tooltip_with_keyboard_shortcut/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/accessibility/tooltip_with_keyboard_shortcut/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/accessibility/tooltip_with_keyboard_shortcut/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/accessibility/tooltip_with_keyboard_shortcut/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/accessibility/tooltip_with_keyboard_shortcut/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/accessibility/tooltip_with_keyboard_shortcut/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/accessibility/tooltip_with_keyboard_shortcut/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/accessibility/tooltip_with_keyboard_shortcut/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/accessibility/tooltip_with_keyboard_shortcut/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/alert_count_by_status/alert_count_by_rule_by_status.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status/alert_count_by_rule_by_status.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/alert_count_by_status/alert_count_by_rule_by_status.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status/alert_count_by_rule_by_status.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/alert_count_by_status/alert_count_by_rule_by_status.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status/alert_count_by_rule_by_status.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/alert_count_by_status/alert_count_by_rule_by_status.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status/alert_count_by_rule_by_status.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/alert_count_by_status/components/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status/components/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/alert_count_by_status/components/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status/components/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/alert_count_by_status/components/multiselect_popover/multiselect_popover.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status/components/multiselect_popover/multiselect_popover.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/alert_count_by_status/components/multiselect_popover/multiselect_popover.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status/components/multiselect_popover/multiselect_popover.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/alert_count_by_status/components/multiselect_popover/multiselect_popover.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status/components/multiselect_popover/multiselect_popover.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/alert_count_by_status/components/multiselect_popover/multiselect_popover.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status/components/multiselect_popover/multiselect_popover.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/alert_count_by_status/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/alert_count_by_status/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/alert_count_by_status/mock_data.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status/mock_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/alert_count_by_status/mock_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status/mock_data.ts diff --git a/x-pack/plugins/security_solution/public/common/components/alert_count_by_status/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/alert_count_by_status/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/alert_count_by_status/use_alert_count_by_rule_by_status.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status/use_alert_count_by_rule_by_status.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/alert_count_by_status/use_alert_count_by_rule_by_status.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status/use_alert_count_by_rule_by_status.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/alert_count_by_status/use_alert_count_by_rule_by_status.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status/use_alert_count_by_rule_by_status.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/alert_count_by_status/use_alert_count_by_rule_by_status.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/alert_count_by_status/use_alert_count_by_rule_by_status.ts diff --git a/x-pack/plugins/security_solution/public/common/components/and_or_badge/__examples__/index.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/and_or_badge/__examples__/index.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/and_or_badge/__examples__/index.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/and_or_badge/__examples__/index.stories.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/and_or_badge/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/and_or_badge/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/and_or_badge/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/and_or_badge/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/and_or_badge/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/and_or_badge/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/and_or_badge/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/and_or_badge/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/and_or_badge/rounded_badge.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/and_or_badge/rounded_badge.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/and_or_badge/rounded_badge.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/and_or_badge/rounded_badge.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/and_or_badge/rounded_badge.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/and_or_badge/rounded_badge.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/and_or_badge/rounded_badge.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/and_or_badge/rounded_badge.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/and_or_badge/rounded_badge_antenna.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/and_or_badge/rounded_badge_antenna.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/and_or_badge/rounded_badge_antenna.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/and_or_badge/rounded_badge_antenna.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/and_or_badge/rounded_badge_antenna.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/and_or_badge/rounded_badge_antenna.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/and_or_badge/rounded_badge_antenna.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/and_or_badge/rounded_badge_antenna.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/and_or_badge/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/and_or_badge/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/and_or_badge/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/and_or_badge/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/assignees/assignees_apply_panel.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/assignees_apply_panel.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/assignees/assignees_apply_panel.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/assignees_apply_panel.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/assignees/assignees_apply_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/assignees_apply_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/assignees/assignees_apply_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/assignees_apply_panel.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/assignees/assignees_selectable.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/assignees_selectable.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/assignees/assignees_selectable.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/assignees_selectable.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/assignees/assignees_selectable.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/assignees_selectable.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/assignees/assignees_selectable.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/assignees_selectable.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/assignees/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/assignees/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/constants.ts diff --git a/x-pack/plugins/security_solution/public/common/components/assignees/mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/assignees/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/mocks.ts diff --git a/x-pack/plugins/security_solution/public/common/components/assignees/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/test_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/assignees/test_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/test_ids.ts diff --git a/x-pack/plugins/security_solution/public/common/components/assignees/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/assignees/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/assignees/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/assignees/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/types.ts diff --git a/x-pack/plugins/security_solution/public/common/components/assignees/utils.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/utils.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/assignees/utils.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/utils.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/assignees/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/assignees/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/assignees/utils.ts diff --git a/x-pack/plugins/security_solution/public/common/components/auto_download/auto_download.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/auto_download/auto_download.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/auto_download/auto_download.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/auto_download/auto_download.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/auto_download/auto_download.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/auto_download/auto_download.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/auto_download/auto_download.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/auto_download/auto_download.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/autofocus_button/autofocus_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/autofocus_button/autofocus_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/autofocus_button/autofocus_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/autofocus_button/autofocus_button.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/callouts/callout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/callouts/callout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/callouts/callout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/callouts/callout.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/callouts/callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/callouts/callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/callouts/callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/callouts/callout.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/callouts/callout_dismiss_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/callouts/callout_dismiss_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/callouts/callout_dismiss_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/callouts/callout_dismiss_button.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/callouts/callout_persistent_switcher.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/callouts/callout_persistent_switcher.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/callouts/callout_persistent_switcher.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/callouts/callout_persistent_switcher.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/callouts/callout_switcher.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/callouts/callout_switcher.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/callouts/callout_switcher.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/callouts/callout_switcher.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/callouts/callout_types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/callouts/callout_types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/callouts/callout_types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/callouts/callout_types.ts diff --git a/x-pack/plugins/security_solution/public/common/components/callouts/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/callouts/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/callouts/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/callouts/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/callouts/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/callouts/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/callouts/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/callouts/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/callouts/use_callout_storage.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/callouts/use_callout_storage.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/callouts/use_callout_storage.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/callouts/use_callout_storage.ts diff --git a/x-pack/plugins/security_solution/public/common/components/cell_actions/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/cell_actions/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/cell_actions/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/cell_actions/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/cell_actions/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/cell_actions/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/cell_actions/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/cell_actions/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/cell_actions/mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/cell_actions/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/cell_actions/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/cell_actions/mocks.ts diff --git a/x-pack/plugins/security_solution/public/common/components/centered_loading_spinner/centered_loading_spinner.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/centered_loading_spinner/centered_loading_spinner.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/centered_loading_spinner/centered_loading_spinner.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/centered_loading_spinner/centered_loading_spinner.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/centered_loading_spinner/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/centered_loading_spinner/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/centered_loading_spinner/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/centered_loading_spinner/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/chart_settings_popover/configurations/default/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/chart_settings_popover/configurations/default/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/chart_settings_popover/configurations/default/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/chart_settings_popover/configurations/default/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/chart_settings_popover/configurations/default/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/chart_settings_popover/configurations/default/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/chart_settings_popover/configurations/default/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/chart_settings_popover/configurations/default/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/chart_settings_popover/configurations/default/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/chart_settings_popover/configurations/default/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/chart_settings_popover/configurations/default/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/chart_settings_popover/configurations/default/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/chart_settings_popover/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/chart_settings_popover/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/chart_settings_popover/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/chart_settings_popover/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/chart_settings_popover/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/chart_settings_popover/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/chart_settings_popover/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/chart_settings_popover/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/chart_settings_popover/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/chart_settings_popover/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/chart_settings_popover/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/chart_settings_popover/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/charts/__snapshots__/areachart.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/__snapshots__/areachart.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/__snapshots__/areachart.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/__snapshots__/areachart.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/charts/__snapshots__/barchart.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/__snapshots__/barchart.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/__snapshots__/barchart.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/__snapshots__/barchart.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/charts/areachart.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/areachart.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/areachart.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/areachart.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/charts/areachart.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/areachart.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/areachart.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/areachart.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/charts/barchart.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/barchart.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/barchart.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/barchart.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/charts/barchart.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/barchart.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/barchart.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/barchart.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/charts/chart_place_holder.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/chart_place_holder.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/chart_place_holder.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/chart_place_holder.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/charts/chart_place_holder.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/chart_place_holder.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/chart_place_holder.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/chart_place_holder.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/charts/common.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/common.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/common.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/common.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/charts/common.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/common.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/common.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/common.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/charts/donutchart.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/donutchart.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/donutchart.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/donutchart.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/charts/donutchart.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/donutchart.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/donutchart.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/donutchart.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/charts/donutchart_empty.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/donutchart_empty.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/donutchart_empty.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/donutchart_empty.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/charts/donutchart_empty.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/donutchart_empty.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/donutchart_empty.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/donutchart_empty.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/charts/draggable_legend.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/draggable_legend.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/draggable_legend.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/draggable_legend.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/charts/draggable_legend.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/draggable_legend.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/draggable_legend.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/draggable_legend.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/charts/draggable_legend_item.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/draggable_legend_item.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/draggable_legend_item.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/draggable_legend_item.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/charts/draggable_legend_item.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/draggable_legend_item.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/draggable_legend_item.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/draggable_legend_item.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/charts/legend.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/legend.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/legend.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/legend.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/charts/legend_item.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/legend_item.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/legend_item.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/legend_item.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/charts/translation.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/charts/translation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/charts/translation.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/charts/translation.ts diff --git a/x-pack/plugins/security_solution/public/common/components/conditions_table/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/conditions_table/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/conditions_table/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/conditions_table/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/conditions_table/index.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/conditions_table/index.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/conditions_table/index.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/conditions_table/index.stories.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/conditions_table/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/conditions_table/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/conditions_table/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/conditions_table/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/conditions_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/conditions_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/conditions_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/conditions_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/conditions_table/test_utils.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/conditions_table/test_utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/conditions_table/test_utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/conditions_table/test_utils.ts diff --git a/x-pack/plugins/security_solution/public/common/components/control_columns/checkbox.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/control_columns/checkbox.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/control_columns/checkbox.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/control_columns/checkbox.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/control_columns/checkbox.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/control_columns/checkbox.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/control_columns/checkbox.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/control_columns/checkbox.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/control_columns/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/control_columns/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/control_columns/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/control_columns/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/control_columns/row_action/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/control_columns/row_action/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/control_columns/row_action/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/control_columns/row_action/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/control_columns/row_action/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/control_columns/row_action/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/control_columns/row_action/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/control_columns/row_action/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/control_columns/transform_control_columns.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/control_columns/transform_control_columns.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/control_columns/transform_control_columns.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/control_columns/transform_control_columns.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/control_columns/transform_control_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/control_columns/transform_control_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/control_columns/transform_control_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/control_columns/transform_control_columns.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/control_columns/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/control_columns/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/control_columns/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/control_columns/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/current_license/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/current_license/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/current_license/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/current_license/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/__mocks__/use_discover_in_timeline_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/discover_in_timeline/__mocks__/use_discover_in_timeline_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/discover_in_timeline/__mocks__/use_discover_in_timeline_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/discover_in_timeline/__mocks__/use_discover_in_timeline_actions.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/__mocks__/use_discover_in_timeline_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/discover_in_timeline/__mocks__/use_discover_in_timeline_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/discover_in_timeline/__mocks__/use_discover_in_timeline_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/discover_in_timeline/__mocks__/use_discover_in_timeline_context.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/context.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/discover_in_timeline/context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/discover_in_timeline/context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/discover_in_timeline/context.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/mocks/discover_in_timeline_provider.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/discover_in_timeline/mocks/discover_in_timeline_provider.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/discover_in_timeline/mocks/discover_in_timeline_provider.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/discover_in_timeline/mocks/discover_in_timeline_provider.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/provider.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/discover_in_timeline/provider.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/discover_in_timeline/provider.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/discover_in_timeline/provider.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/discover_in_timeline/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/discover_in_timeline/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/discover_in_timeline/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_actions.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_actions.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_actions.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_actions.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_actions.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/discover_in_timeline/use_discover_in_timeline_context.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/__snapshots__/drag_drop_context_wrapper.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/__snapshots__/drag_drop_context_wrapper.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/drag_and_drop/__snapshots__/drag_drop_context_wrapper.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/__snapshots__/drag_drop_context_wrapper.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/__snapshots__/draggable_wrapper.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/__snapshots__/draggable_wrapper.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/drag_and_drop/__snapshots__/draggable_wrapper.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/__snapshots__/draggable_wrapper.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/__snapshots__/droppable_wrapper.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/__snapshots__/droppable_wrapper.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/drag_and_drop/__snapshots__/droppable_wrapper.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/__snapshots__/droppable_wrapper.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/cell_actions_wrapper.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/cell_actions_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/drag_and_drop/cell_actions_wrapper.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/cell_actions_wrapper.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/cell_actions_wrapper.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/cell_actions_wrapper.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/drag_and_drop/cell_actions_wrapper.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/cell_actions_wrapper.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_keyboard_wrapper_hook/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/draggable_keyboard_wrapper_hook/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_keyboard_wrapper_hook/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/draggable_keyboard_wrapper_hook/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_keyboard_wrapper_hook/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/draggable_keyboard_wrapper_hook/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_keyboard_wrapper_hook/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/draggable_keyboard_wrapper_hook/helpers.ts diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_keyboard_wrapper_hook/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/draggable_keyboard_wrapper_hook/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_keyboard_wrapper_hook/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/draggable_keyboard_wrapper_hook/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/droppable_wrapper.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/droppable_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/drag_and_drop/droppable_wrapper.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/droppable_wrapper.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/droppable_wrapper.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/droppable_wrapper.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/drag_and_drop/droppable_wrapper.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/droppable_wrapper.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/provider_container.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/provider_container.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/drag_and_drop/provider_container.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/provider_container.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/drag_and_drop/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/drag_and_drop/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/draggables/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/draggables/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/draggables/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/draggables/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/draggables/field_badge/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/draggables/field_badge/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/draggables/field_badge/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/draggables/field_badge/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/draggables/field_badge/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/draggables/field_badge/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/draggables/field_badge/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/draggables/field_badge/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/draggables/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/draggables/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/draggables/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/draggables/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/draggables/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/draggables/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/draggables/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/draggables/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/empty_page/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_page/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/empty_page/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/empty_page/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/empty_page/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_page/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/empty_page/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/empty_page/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/empty_page/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_page/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/empty_page/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/empty_page/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/empty_prompt/__mocks__/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_prompt/__mocks__/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/empty_prompt/__mocks__/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/empty_prompt/__mocks__/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/empty_prompt/empty_prompt.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_prompt/empty_prompt.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/empty_prompt/empty_prompt.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/empty_prompt/empty_prompt.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/empty_prompt/empty_prompt.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_prompt/empty_prompt.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/empty_prompt/empty_prompt.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/empty_prompt/empty_prompt.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/empty_prompt/images/cloud1.svg b/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_prompt/images/cloud1.svg similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/empty_prompt/images/cloud1.svg rename to x-pack/solutions/security/plugins/security_solution/public/common/components/empty_prompt/images/cloud1.svg diff --git a/x-pack/plugins/security_solution/public/common/components/empty_prompt/images/endpoint1.svg b/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_prompt/images/endpoint1.svg similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/empty_prompt/images/endpoint1.svg rename to x-pack/solutions/security/plugins/security_solution/public/common/components/empty_prompt/images/endpoint1.svg diff --git a/x-pack/plugins/security_solution/public/common/components/empty_prompt/images/siem1.svg b/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_prompt/images/siem1.svg similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/empty_prompt/images/siem1.svg rename to x-pack/solutions/security/plugins/security_solution/public/common/components/empty_prompt/images/siem1.svg diff --git a/x-pack/plugins/security_solution/public/common/components/empty_prompt/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_prompt/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/empty_prompt/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/empty_prompt/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/empty_prompt/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_prompt/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/empty_prompt/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/empty_prompt/translations.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/empty_value/__snapshots__/empty_value.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_value/__snapshots__/empty_value.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/empty_value/__snapshots__/empty_value.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/empty_value/__snapshots__/empty_value.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/empty_value/empty_value.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_value/empty_value.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/empty_value/empty_value.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/empty_value/empty_value.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/empty_value/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_value/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/empty_value/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/empty_value/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/empty_value/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/empty_value/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/empty_value/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/empty_value/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/__snapshots__/link_to_app.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/__snapshots__/link_to_app.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/__snapshots__/link_to_app.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/__snapshots__/link_to_app.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_status/agent_response_action_status.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_status/agent_response_action_status.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_status/agent_response_action_status.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_status/agent_response_action_status.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_status/agent_status.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_status/agent_status.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_status/agent_status.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_status/agent_status.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_status/agent_status.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_status/agent_status.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_status/agent_status.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_status/agent_status.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_status/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_status/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_status/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_status/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_status/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_status/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_status/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_status/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_type_integration/agent_type_integration.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_type_integration/agent_type_integration.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_type_integration/agent_type_integration.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_type_integration/agent_type_integration.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_type_integration/agent_type_integration.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_type_integration/agent_type_integration.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_type_integration/agent_type_integration.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_type_integration/agent_type_integration.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_type_integration/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_type_integration/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_type_integration/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_type_integration/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_type_vendor_logo/agent_type_vendor_logo.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_type_vendor_logo/agent_type_vendor_logo.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_type_vendor_logo/agent_type_vendor_logo.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_type_vendor_logo/agent_type_vendor_logo.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_type_vendor_logo/agent_type_vendor_logo.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_type_vendor_logo/agent_type_vendor_logo.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_type_vendor_logo/agent_type_vendor_logo.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_type_vendor_logo/agent_type_vendor_logo.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_type_vendor_logo/images/crowdstrike_logo.svg b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_type_vendor_logo/images/crowdstrike_logo.svg similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_type_vendor_logo/images/crowdstrike_logo.svg rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_type_vendor_logo/images/crowdstrike_logo.svg diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_type_vendor_logo/images/sentinelone_logo.svg b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_type_vendor_logo/images/sentinelone_logo.svg similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_type_vendor_logo/images/sentinelone_logo.svg rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_type_vendor_logo/images/sentinelone_logo.svg diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_type_vendor_logo/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_type_vendor_logo/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/agents/agent_type_vendor_logo/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/agents/agent_type_vendor_logo/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/action_completion_return_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/action_completion_return_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/action_completion_return_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/action_completion_return_button.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/__mocks__/use_host_isolation_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/__mocks__/use_host_isolation_action.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/__mocks__/use_host_isolation_action.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/__mocks__/use_host_isolation_action.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/host_isolation_panel.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/host_isolation_panel.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/host_isolation_panel.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/host_isolation_panel.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/host_isolation_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/host_isolation_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/host_isolation_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/host_isolation_panel.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/isolate.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/isolate.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/isolate.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/isolate.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/unisolate.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/unisolate.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/unisolate.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/unisolate.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_isolation.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_isolation.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_isolation.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_isolation.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_isolation_action.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_isolation_action.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_isolation_action.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_isolation_action.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_isolation_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_isolation_action.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_isolation_action.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_isolation_action.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_isolation_status.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_isolation_status.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_isolation_status.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_isolation_status.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_unisolation.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_unisolation.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_unisolation.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_alerts/use_host_unisolation.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_cases/endpoint_host_isolation_cases_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_cases/endpoint_host_isolation_cases_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_cases/endpoint_host_isolation_cases_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_cases/endpoint_host_isolation_cases_context.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_cases/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_cases/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/from_cases/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/from_cases/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/isolate_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/isolate_form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/isolate_form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/isolate_form.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/isolate_success.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/isolate_success.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/isolate_success.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/isolate_success.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/unisolate_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/unisolate_form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/host_isolation/unisolate_form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/host_isolation/unisolate_form.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/link_to_app.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/link_to_app.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/link_to_app.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/link_to_app.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/link_to_app.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/link_to_app.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/link_to_app.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/link_to_app.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/responder/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/responder/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/__mocks__/use_responder_action_data.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/__mocks__/use_responder_action_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/__mocks__/use_responder_action_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/__mocks__/use_responder_action_data.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/__mocks__/use_responder_action_item.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/__mocks__/use_responder_action_item.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/__mocks__/use_responder_action_item.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/__mocks__/use_responder_action_item.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/responder_action_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/responder_action_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/responder_action_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/responder_action_button.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/use_responder_action_data.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/use_responder_action_data.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/use_responder_action_data.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/use_responder_action_data.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/use_responder_action_data.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/use_responder_action_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/use_responder_action_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/use_responder_action_data.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/use_responder_action_item.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/use_responder_action_item.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/use_responder_action_item.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/use_responder_action_item.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/use_responder_action_item.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/use_responder_action_item.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/use_responder_action_item.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/from_alerts/use_responder_action_item.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/responder/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/responder/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/responder/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/endpoint/route_capture.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/route_capture.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/endpoint/route_capture.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/endpoint/route_capture.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/error_toast_dispatcher/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/error_toast_dispatcher/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/error_toast_dispatcher/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/error_toast_dispatcher/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/error_toast_dispatcher/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/error_toast_dispatcher/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/error_toast_dispatcher/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/error_toast_dispatcher/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/event_id.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/event_id.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/event_details/event_id.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/event_id.ts diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/event_details/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/event_details/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/investigate_in_timeline_button.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/investigate_in_timeline_button.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/event_details/investigate_in_timeline_button.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/investigate_in_timeline_button.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/investigate_in_timeline_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/investigate_in_timeline_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/event_details/investigate_in_timeline_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/investigate_in_timeline_button.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/event_details/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/mocks.ts diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/event_details/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/event_details/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/types.ts diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/use_action_cell_data_provider.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/use_action_cell_data_provider.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/event_details/use_action_cell_data_provider.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/use_action_cell_data_provider.ts diff --git a/x-pack/plugins/security_solution/public/common/components/events_tab/events_query_tab_body.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_tab/events_query_tab_body.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_tab/events_query_tab_body.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_tab/events_query_tab_body.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/events_tab/events_query_tab_body.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_tab/events_query_tab_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_tab/events_query_tab_body.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_tab/events_query_tab_body.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/events_tab/histogram_configurations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_tab/histogram_configurations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_tab/histogram_configurations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_tab/histogram_configurations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/events_tab/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_tab/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_tab/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_tab/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/events_tab/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_tab/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_tab/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_tab/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/default_alert_headers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/default_alert_headers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_viewer/default_alert_headers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/default_alert_headers.ts diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/default_event_headers.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/default_event_headers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_viewer/default_event_headers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/default_event_headers.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/default_model.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/default_model.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_viewer/default_model.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/default_model.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/event_details_width_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/event_details_width_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_viewer/event_details_width_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/event_details_width_context.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/external_alerts_filter.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/external_alerts_filter.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_viewer/external_alerts_filter.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/external_alerts_filter.ts diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_viewer/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_viewer/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_viewer/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_viewer/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/mock.ts diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/right_top_menu.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/right_top_menu.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_viewer/right_top_menu.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/right_top_menu.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/selectors/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/selectors/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_viewer/selectors/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/selectors/index.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/selectors/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/selectors/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_viewer/selectors/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/selectors/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/selectors/mock_state.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/selectors/mock_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_viewer/selectors/mock_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/selectors/mock_state.ts diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/shared/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/shared/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_viewer/shared/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/shared/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/stateful_event_context.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/stateful_event_context.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_viewer/stateful_event_context.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/stateful_event_context.ts diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/styles.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/styles.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_viewer/styles.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/styles.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/summary_view_select/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/summary_view_select/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_viewer/summary_view_select/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/summary_view_select/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_viewer/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/use_alert_bulk_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/use_alert_bulk_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_viewer/use_alert_bulk_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/use_alert_bulk_actions.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/events_viewer/use_timelines_events.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/use_timelines_events.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/events_viewer/use_timelines_events.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/events_viewer/use_timelines_events.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/exit_full_screen/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/exit_full_screen/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/exit_full_screen/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/exit_full_screen/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/exit_full_screen/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/exit_full_screen/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/exit_full_screen/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/exit_full_screen/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/exit_full_screen/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/exit_full_screen/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/exit_full_screen/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/exit_full_screen/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/field_selection/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/field_selection/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/field_selection/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/field_selection/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/field_selection/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/field_selection/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/field_selection/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/field_selection/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/filter_bar/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/filter_bar/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/filter_bar/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/filter_bar/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/filter_by_assignees_popover/filter_by_assignees_popover.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/filter_by_assignees_popover/filter_by_assignees_popover.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/filter_by_assignees_popover/filter_by_assignees_popover.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/filter_by_assignees_popover/filter_by_assignees_popover.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/filter_by_assignees_popover/filter_by_assignees_popover.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/filter_by_assignees_popover/filter_by_assignees_popover.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/filter_by_assignees_popover/filter_by_assignees_popover.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/filter_by_assignees_popover/filter_by_assignees_popover.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/filter_by_assignees_popover/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/filter_by_assignees_popover/test_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/filter_by_assignees_popover/test_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/filter_by_assignees_popover/test_ids.ts diff --git a/x-pack/plugins/security_solution/public/common/components/filters_global/__snapshots__/filters_global.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/filters_global/__snapshots__/filters_global.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/filters_global/__snapshots__/filters_global.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/filters_global/__snapshots__/filters_global.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/filters_global/filters_global.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/filters_global/filters_global.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/filters_global/filters_global.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/filters_global/filters_global.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/filters_global/filters_global.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/filters_global/filters_global.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/filters_global/filters_global.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/filters_global/filters_global.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/filters_global/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/filters_global/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/filters_global/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/filters_global/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/first_last_seen/first_last_seen.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/first_last_seen/first_last_seen.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/first_last_seen/first_last_seen.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/first_last_seen/first_last_seen.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/first_last_seen/first_last_seen.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/first_last_seen/first_last_seen.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/first_last_seen/first_last_seen.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/first_last_seen/first_last_seen.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/first_last_seen/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/first_last_seen/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/first_last_seen/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/first_last_seen/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/formatted_bytes/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_bytes/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/formatted_bytes/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_bytes/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/formatted_bytes/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_bytes/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/formatted_bytes/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_bytes/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/formatted_bytes/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_bytes/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/formatted_bytes/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_bytes/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/formatted_date/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_date/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/formatted_date/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_date/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/formatted_date/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_date/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/formatted_date/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_date/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/formatted_date/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_date/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/formatted_date/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_date/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/formatted_date/maybe_date.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_date/maybe_date.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/formatted_date/maybe_date.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_date/maybe_date.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/formatted_date/maybe_date.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_date/maybe_date.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/formatted_date/maybe_date.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_date/maybe_date.ts diff --git a/x-pack/plugins/security_solution/public/common/components/formatted_number/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_number/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/formatted_number/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_number/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/formatted_number/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_number/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/formatted_number/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/formatted_number/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/README.md b/x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/README.md similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/README.md rename to x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/README.md diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/__mocks__/tour_step.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/__mocks__/tour_step.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/__mocks__/tour_step.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/__mocks__/tour_step.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/cases_tour_steps.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/cases_tour_steps.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/cases_tour_steps.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/cases_tour_steps.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/cases_tour_steps.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/cases_tour_steps.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/cases_tour_steps.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/cases_tour_steps.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/tour.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/tour.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/tour.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/tour.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_config.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_config.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_config.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_config.ts diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/use_hidden_by_flyout.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/use_hidden_by_flyout.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/use_hidden_by_flyout.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/guided_onboarding_tour/use_hidden_by_flyout.ts diff --git a/x-pack/plugins/security_solution/public/common/components/header_actions/action_icon_item.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/action_icon_item.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_actions/action_icon_item.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/action_icon_item.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/header_actions/actions.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/actions.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_actions/actions.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/actions.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/header_actions/actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_actions/actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/actions.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/header_actions/add_note_icon_item.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/add_note_icon_item.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_actions/add_note_icon_item.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/add_note_icon_item.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/header_actions/add_note_icon_item.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/add_note_icon_item.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_actions/add_note_icon_item.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/add_note_icon_item.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/header_actions/header_actions.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/header_actions.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_actions/header_actions.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/header_actions.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/header_actions/header_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/header_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_actions/header_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/header_actions.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/header_actions/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_actions/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/header_actions/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_actions/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/helpers.ts diff --git a/x-pack/plugins/security_solution/public/common/components/header_actions/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_actions/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/header_actions/pin_event_action.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/pin_event_action.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_actions/pin_event_action.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/pin_event_action.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/header_actions/pin_event_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/pin_event_action.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_actions/pin_event_action.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/pin_event_action.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/header_actions/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_actions/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_actions/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/header_page/__snapshots__/editable_title.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/__snapshots__/editable_title.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_page/__snapshots__/editable_title.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/__snapshots__/editable_title.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/header_page/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_page/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/header_page/__snapshots__/title.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/__snapshots__/title.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_page/__snapshots__/title.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/__snapshots__/title.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/header_page/editable_title.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/editable_title.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_page/editable_title.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/editable_title.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/header_page/editable_title.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/editable_title.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_page/editable_title.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/editable_title.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/header_page/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_page/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/header_page/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_page/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/header_page/title.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/title.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_page/title.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/title.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/header_page/title.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/title.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_page/title.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/title.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/header_page/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_page/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/header_page/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_page/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_page/types.ts diff --git a/x-pack/plugins/security_solution/public/common/components/header_section/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_section/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_section/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_section/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/header_section/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_section/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_section/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_section/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/header_section/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/header_section/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/header_section/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/header_section/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/health_truncate_text/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/health_truncate_text/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/health_truncate_text/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/health_truncate_text/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/health_truncate_text/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/health_truncate_text/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/health_truncate_text/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/health_truncate_text/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/help_menu/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/help_menu/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/help_menu/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/help_menu/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/hover_popover/hover_popover.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/hover_popover/hover_popover.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/hover_popover/hover_popover.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/hover_popover/hover_popover.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/hover_popover/hover_popover.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/hover_popover/hover_popover.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/hover_popover/hover_popover.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/hover_popover/hover_popover.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/hover_popover/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/hover_popover/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/hover_popover/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/hover_popover/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/hover_visibility_container/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/hover_visibility_container/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/hover_visibility_container/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/hover_visibility_container/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/hover_visibility_container/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/hover_visibility_container/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/hover_visibility_container/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/hover_visibility_container/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/import_data_modal/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/import_data_modal/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/import_data_modal/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/import_data_modal/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/import_data_modal/action_connectors_warning/__snapshots__/action_connectors_warning.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/import_data_modal/action_connectors_warning/__snapshots__/action_connectors_warning.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/import_data_modal/action_connectors_warning/__snapshots__/action_connectors_warning.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/import_data_modal/action_connectors_warning/__snapshots__/action_connectors_warning.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/import_data_modal/action_connectors_warning/action_connectors_warning.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/import_data_modal/action_connectors_warning/action_connectors_warning.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/import_data_modal/action_connectors_warning/action_connectors_warning.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/import_data_modal/action_connectors_warning/action_connectors_warning.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/import_data_modal/action_connectors_warning/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/import_data_modal/action_connectors_warning/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/import_data_modal/action_connectors_warning/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/import_data_modal/action_connectors_warning/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/import_data_modal/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/import_data_modal/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/import_data_modal/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/import_data_modal/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/import_data_modal/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/import_data_modal/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/import_data_modal/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/import_data_modal/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/import_data_modal/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/import_data_modal/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/import_data_modal/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/import_data_modal/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/import_data_modal/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/import_data_modal/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/import_data_modal/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/import_data_modal/utils.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/import_data_modal/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/import_data_modal/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/import_data_modal/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/import_data_modal/utils.ts diff --git a/x-pack/plugins/security_solution/public/common/components/inspect/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/inspect/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/inspect/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/inspect/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/inspect/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/inspect/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/inspect/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/inspect/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/inspect/modal.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/inspect/modal.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/inspect/modal.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/inspect/modal.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/inspect/modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/inspect/modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/inspect/modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/inspect/modal.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/inspect/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/inspect/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/inspect/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/inspect/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/inspect/use_inspect.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/inspect/use_inspect.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/inspect/use_inspect.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/inspect/use_inspect.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/item_details_card/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/item_details_card/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/item_details_card/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/item_details_card/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/item_details_card/index.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/item_details_card/index.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/item_details_card/index.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/item_details_card/index.stories.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/item_details_card/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/item_details_card/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/item_details_card/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/item_details_card/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/item_details_card/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/item_details_card/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/item_details_card/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/item_details_card/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/last_event_time/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/last_event_time/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/last_event_time/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/last_event_time/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/last_event_time/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/last_event_time/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/last_event_time/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/last_event_time/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/last_updated_at/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/last_updated_at/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/last_updated_at/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/last_updated_at/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/last_updated_at/last_updated_at.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/last_updated_at/last_updated_at.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/last_updated_at/last_updated_at.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/last_updated_at/last_updated_at.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/last_updated_at/last_updated_at.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/last_updated_at/last_updated_at.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/last_updated_at/last_updated_at.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/last_updated_at/last_updated_at.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/line_clamp/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/line_clamp/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/line_clamp/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/line_clamp/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/line_clamp/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/line_clamp/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/line_clamp/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/line_clamp/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/line_clamp/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/line_clamp/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/line_clamp/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/line_clamp/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/link_icon/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/link_icon/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/link_icon/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/link_icon/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/link_icon/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/link_icon/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/link_icon/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/link_icon/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/link_icon/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/link_icon/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/link_icon/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/link_icon/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/link_to/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/link_to/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/link_to/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/link_to/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/link_to/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/link_to/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/helpers.ts diff --git a/x-pack/plugins/security_solution/public/common/components/link_to/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/link_to/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_case.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/redirect_to_case.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_case.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/redirect_to_case.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_detection_engine.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/redirect_to_detection_engine.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_detection_engine.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/redirect_to_detection_engine.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_hosts.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/redirect_to_hosts.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_hosts.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/redirect_to_hosts.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_kubernetes.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/redirect_to_kubernetes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_kubernetes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/redirect_to_kubernetes.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_landing.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/redirect_to_landing.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_landing.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/redirect_to_landing.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_network.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/redirect_to_network.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_network.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/redirect_to_network.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_timelines.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/redirect_to_timelines.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_timelines.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/redirect_to_timelines.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_users.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/redirect_to_users.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/link_to/redirect_to_users.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/link_to/redirect_to_users.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/links/__mocks__/link_props.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/links/__mocks__/link_props.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/links/__mocks__/link_props.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/links/__mocks__/link_props.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/links/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/links/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/links/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/links/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/links/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/links/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/links/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/links/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/links/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/links/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/links/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/links/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/links/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/links/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/links/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/links/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/links/link_props.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/links/link_props.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/links/link_props.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/links/link_props.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/links/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/links/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/links/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/links/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/links_to_docs/doc_link.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/links_to_docs/doc_link.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/links_to_docs/doc_link.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/links_to_docs/doc_link.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/links_to_docs/external_link.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/links_to_docs/external_link.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/links_to_docs/external_link.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/links_to_docs/external_link.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/links_to_docs/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/links_to_docs/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/links_to_docs/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/links_to_docs/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/links_to_docs/links_components.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/links_to_docs/links_components.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/links_to_docs/links_components.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/links_to_docs/links_components.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/links_to_docs/links_translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/links_to_docs/links_translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/links_to_docs/links_translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/links_to_docs/links_translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/loader/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/loader/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/loader/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/loader/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/loader/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/loader/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/loader/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/loader/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/loader/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/loader/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/loader/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/loader/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/local_storage/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/local_storage/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/local_storage/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/local_storage/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/local_storage/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/local_storage/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/local_storage/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/local_storage/helpers.ts diff --git a/x-pack/plugins/security_solution/public/common/components/local_storage/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/local_storage/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/local_storage/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/local_storage/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/local_storage/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/local_storage/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/local_storage/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/local_storage/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/localized_date_tooltip/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/localized_date_tooltip/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/localized_date_tooltip/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/localized_date_tooltip/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/localized_date_tooltip/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/localized_date_tooltip/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/localized_date_tooltip/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/localized_date_tooltip/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/editor.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/editor.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/editor.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/editor.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/eui_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/eui_form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/eui_form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/eui_form.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/markdown_link.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/markdown_link.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/markdown_link.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/markdown_link.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/provider.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/provider.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/provider.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/provider.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/provider.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/provider.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/provider.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/provider.ts diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/replace_params_query.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/replace_params_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/replace_params_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/replace_params_query.ts diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_data_providers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_data_providers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_data_providers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_data_providers.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_data_providers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_data_providers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_data_providers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_data_providers.ts diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_query.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_query.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_query.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_query.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_query.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/insight/use_insight_query.ts diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/label_field.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/label_field.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/label_field.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/label_field.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/not_available_prompt.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/not_available_prompt.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/not_available_prompt.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/not_available_prompt.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/osquery_icon/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/osquery_icon/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/osquery_icon/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/osquery_icon/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/osquery_icon/osquery.svg b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/osquery_icon/osquery.svg similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/osquery_icon/osquery.svg rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/osquery_icon/osquery.svg diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/parser.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/parser.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/parser.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/parser.ts diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/plugin.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/plugin.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/plugin.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/plugin.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/osquery/renderer.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/constants.ts diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/parser.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/parser.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/parser.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/parser.ts diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/plugin.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/plugin.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/plugin.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/plugin.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/processor.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/processor.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/processor.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/processor.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/types.ts diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/renderer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/renderer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/renderer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/renderer.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/renderer.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/markdown_editor/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/markdown_editor/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/matrix_histogram/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/matrix_histogram/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/matrix_histogram/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/matrix_histogram/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/matrix_histogram/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/matrix_histogram/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/matrix_histogram/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/matrix_histogram/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/matrix_histogram/matrix_loader.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/matrix_histogram/matrix_loader.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/matrix_histogram/matrix_loader.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/matrix_histogram/matrix_loader.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/matrix_histogram/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/matrix_histogram/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/matrix_histogram/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/matrix_histogram/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/matrix_histogram/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/matrix_histogram/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/matrix_histogram/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/matrix_histogram/types.ts diff --git a/x-pack/plugins/security_solution/public/common/components/matrix_histogram/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/matrix_histogram/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/matrix_histogram/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/matrix_histogram/utils.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/__snapshots__/entity.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/__snapshots__/entity.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/__snapshots__/entity.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/__snapshots__/entity.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/ml/anomaly/anomaly_table_provider.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/anomaly/anomaly_table_provider.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/anomaly/anomaly_table_provider.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/anomaly/anomaly_table_provider.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/anomaly/get_interval_from_anomalies.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/anomaly/get_interval_from_anomalies.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/anomaly/get_interval_from_anomalies.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/anomaly/get_interval_from_anomalies.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/anomaly/get_interval_from_anomalies.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/anomaly/get_interval_from_anomalies.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/anomaly/get_interval_from_anomalies.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/anomaly/get_interval_from_anomalies.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/anomaly/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/anomaly/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/anomaly/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/anomaly/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_search.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_search.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_search.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_search.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_search.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_search.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_search.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_search.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_table_data.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_table_data.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_table_data.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_table_data.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_table_data.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_table_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_table_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/anomaly/use_anomalies_table_data.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/api/anomalies_search.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/api/anomalies_search.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/api/anomalies_search.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/api/anomalies_search.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/api/anomalies_table_data.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/api/anomalies_table_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/api/anomalies_table_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/api/anomalies_table_data.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/api/errors.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/api/errors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/api/errors.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/api/errors.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/api/get_jobs.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/api/get_jobs.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/api/get_jobs.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/api/get_jobs.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/api/get_jobs_summary.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/api/get_jobs_summary.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/api/get_jobs_summary.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/api/get_jobs_summary.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/api/get_ml_capabilities.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/api/get_ml_capabilities.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/api/get_ml_capabilities.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/api/get_ml_capabilities.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/api/throw_if_not_ok.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/api/throw_if_not_ok.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/api/throw_if_not_ok.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/api/throw_if_not_ok.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/api/throw_if_not_ok.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/api/throw_if_not_ok.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/api/throw_if_not_ok.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/api/throw_if_not_ok.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/api/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/api/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/api/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/api/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/conditional_links/add_entities_to_kql.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/add_entities_to_kql.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/conditional_links/add_entities_to_kql.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/add_entities_to_kql.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/conditional_links/add_entities_to_kql.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/add_entities_to_kql.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/conditional_links/add_entities_to_kql.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/add_entities_to_kql.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/conditional_links/entity_helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/entity_helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/conditional_links/entity_helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/entity_helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/conditional_links/entity_helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/entity_helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/conditional_links/entity_helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/entity_helpers.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/conditional_links/ml_host_conditional_container.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/ml_host_conditional_container.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/conditional_links/ml_host_conditional_container.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/ml_host_conditional_container.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/conditional_links/ml_network_conditional_container.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/ml_network_conditional_container.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/conditional_links/ml_network_conditional_container.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/ml_network_conditional_container.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/conditional_links/remove_kql_variables.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/remove_kql_variables.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/conditional_links/remove_kql_variables.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/remove_kql_variables.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/conditional_links/remove_kql_variables.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/remove_kql_variables.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/conditional_links/remove_kql_variables.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/remove_kql_variables.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/conditional_links/replace_kql_commas_with_or.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/replace_kql_commas_with_or.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/conditional_links/replace_kql_commas_with_or.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/replace_kql_commas_with_or.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/conditional_links/replace_kql_commas_with_or.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/replace_kql_commas_with_or.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/conditional_links/replace_kql_commas_with_or.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/replace_kql_commas_with_or.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/conditional_links/replace_kql_parts.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/replace_kql_parts.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/conditional_links/replace_kql_parts.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/replace_kql_parts.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/conditional_links/replace_kql_parts.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/replace_kql_parts.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/conditional_links/replace_kql_parts.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/replace_kql_parts.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/conditional_links/rison_helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/rison_helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/conditional_links/rison_helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/rison_helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/conditional_links/rison_helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/rison_helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/conditional_links/rison_helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/conditional_links/rison_helpers.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_host_type.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_host_type.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_host_type.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_host_type.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_host_type.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_host_type.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_host_type.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_host_type.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_network_type.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_network_type.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_network_type.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_network_type.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_network_type.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_network_type.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_network_type.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_network_type.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_users_type.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_users_type.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_users_type.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_users_type.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_users_type.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_users_type.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_users_type.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/criteria/get_criteria_from_users_type.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/criteria/host_to_criteria.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/criteria/host_to_criteria.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/criteria/host_to_criteria.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/criteria/host_to_criteria.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/criteria/host_to_criteria.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/criteria/host_to_criteria.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/criteria/host_to_criteria.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/criteria/host_to_criteria.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/criteria/network_to_criteria.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/criteria/network_to_criteria.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/criteria/network_to_criteria.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/criteria/network_to_criteria.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/criteria/network_to_criteria.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/criteria/network_to_criteria.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/criteria/network_to_criteria.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/criteria/network_to_criteria.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/entity.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/entity.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/entity.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/entity.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/entity.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/entity.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/entity.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/entity.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/get_entries.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/get_entries.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/get_entries.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/get_entries.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/get_entries.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/get_entries.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/get_entries.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/get_entries.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/hooks/use_fetch_jobs_summary_query.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/hooks/use_fetch_jobs_summary_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/hooks/use_fetch_jobs_summary_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/hooks/use_fetch_jobs_summary_query.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/hooks/use_get_jobs.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/hooks/use_get_jobs.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/hooks/use_get_jobs.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/hooks/use_get_jobs.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/hooks/use_get_ml_capabilities.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/hooks/use_get_ml_capabilities.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/hooks/use_get_ml_capabilities.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/hooks/use_get_ml_capabilities.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/hooks/use_installed_security_jobs.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/hooks/use_installed_security_jobs.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/hooks/use_installed_security_jobs.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/hooks/use_installed_security_jobs.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/hooks/use_installed_security_jobs.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/hooks/use_installed_security_jobs.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/hooks/use_installed_security_jobs.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/hooks/use_installed_security_jobs.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/hooks/use_ml_capabilities.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/hooks/use_ml_capabilities.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/hooks/use_ml_capabilities.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/hooks/use_ml_capabilities.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/hooks/use_ml_rule_config.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/hooks/use_ml_rule_config.ts similarity index 88% rename from x-pack/plugins/security_solution/public/common/components/ml/hooks/use_ml_rule_config.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/hooks/use_ml_rule_config.ts index 139acb0473c8b..9b60c15dc1354 100644 --- a/x-pack/plugins/security_solution/public/common/components/ml/hooks/use_ml_rule_config.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/hooks/use_ml_rule_config.ts @@ -5,16 +5,15 @@ * 2.0. */ -import { useMemo } from 'react'; import type { DataViewFieldBase } from '@kbn/es-query'; import type { FieldSpec } from '@kbn/data-plugin/common'; -import { getTermsAggregationFields } from '../../../../detection_engine/rule_creation_ui/components/step_define_rule/utils'; import { useRuleFields } from '../../../../detection_engine/rule_management/logic/use_rule_fields'; import { useMlCapabilities } from './use_ml_capabilities'; import { useMlRuleValidations } from './use_ml_rule_validations'; import { hasMlAdminPermissions } from '../../../../../common/machine_learning/has_ml_admin_permissions'; import { hasMlLicense } from '../../../../../common/machine_learning/has_ml_license'; +import { useTermsAggregationFields } from '../../../hooks/use_terms_aggregation_fields'; export interface UseMlRuleConfigReturn { hasMlAdminPermissions: boolean; @@ -45,10 +44,7 @@ export const useMLRuleConfig = ({ const { loading: mlFieldsLoading, fields: mlFields } = useRuleFields({ machineLearningJobId, }); - const mlSuppressionFields = useMemo( - () => getTermsAggregationFields(mlFields as FieldSpec[]), - [mlFields] - ); + const mlSuppressionFields = useTermsAggregationFields(mlFields); return { hasMlAdminPermissions: hasMlAdminPermissions(mlCapabilities), diff --git a/x-pack/plugins/security_solution/public/common/components/ml/hooks/use_ml_rule_validations.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/hooks/use_ml_rule_validations.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/hooks/use_ml_rule_validations.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/hooks/use_ml_rule_validations.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/hooks/use_ml_rule_validations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/hooks/use_ml_rule_validations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/hooks/use_ml_rule_validations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/hooks/use_ml_rule_validations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/influencers/__snapshots__/create_influencers.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/__snapshots__/create_influencers.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/influencers/__snapshots__/create_influencers.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/__snapshots__/create_influencers.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/ml/influencers/create_influencers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/create_influencers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/influencers/create_influencers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/create_influencers.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/influencers/create_influencers.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/create_influencers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/influencers/create_influencers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/create_influencers.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/influencers/get_host_name_from_influencers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/get_host_name_from_influencers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/influencers/get_host_name_from_influencers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/get_host_name_from_influencers.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/influencers/get_host_name_from_influencers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/get_host_name_from_influencers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/influencers/get_host_name_from_influencers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/get_host_name_from_influencers.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/influencers/get_network_from_influencers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/get_network_from_influencers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/influencers/get_network_from_influencers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/get_network_from_influencers.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/influencers/get_network_from_influencers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/get_network_from_influencers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/influencers/get_network_from_influencers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/get_network_from_influencers.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/influencers/get_user_name_from_influencers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/get_user_name_from_influencers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/influencers/get_user_name_from_influencers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/get_user_name_from_influencers.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/influencers/get_user_name_from_influencers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/get_user_name_from_influencers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/influencers/get_user_name_from_influencers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/get_user_name_from_influencers.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/influencers/host_to_influencers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/host_to_influencers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/influencers/host_to_influencers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/host_to_influencers.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/influencers/host_to_influencers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/host_to_influencers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/influencers/host_to_influencers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/host_to_influencers.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/influencers/network_to_influencers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/network_to_influencers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/influencers/network_to_influencers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/network_to_influencers.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/influencers/network_to_influencers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/network_to_influencers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/influencers/network_to_influencers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/influencers/network_to_influencers.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/links/create_explorer_link.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/links/create_explorer_link.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/links/create_explorer_link.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/links/create_explorer_link.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/links/create_explorer_link.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/links/create_explorer_link.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/links/create_explorer_link.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/links/create_explorer_link.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/links/create_series_link.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/links/create_series_link.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/links/create_series_link.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/links/create_series_link.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/links/create_series_link.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/links/create_series_link.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/links/create_series_link.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/links/create_series_link.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/mock.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/permissions/ml_capabilities_provider.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/permissions/ml_capabilities_provider.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/permissions/ml_capabilities_provider.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/permissions/ml_capabilities_provider.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/permissions/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/permissions/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/permissions/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/permissions/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/__snapshots__/anomaly_score.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/__snapshots__/anomaly_score.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/__snapshots__/anomaly_score.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/__snapshots__/anomaly_score.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/__snapshots__/anomaly_scores.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/__snapshots__/anomaly_scores.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/__snapshots__/anomaly_scores.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/__snapshots__/anomaly_scores.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/__snapshots__/create_descriptions_list.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/__snapshots__/create_descriptions_list.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/__snapshots__/create_descriptions_list.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/__snapshots__/create_descriptions_list.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/__snapshots__/score.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/__snapshots__/score.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/__snapshots__/score.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/__snapshots__/score.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/anomaly_score.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/anomaly_score.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/anomaly_score.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/anomaly_score.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/anomaly_score.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/anomaly_score.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/anomaly_score.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/anomaly_score.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/anomaly_scores.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/anomaly_scores.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/anomaly_scores.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/anomaly_scores.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/anomaly_scores.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/anomaly_scores.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/anomaly_scores.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/anomaly_scores.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/create_description_list.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/create_description_list.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/create_description_list.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/create_description_list.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/create_descriptions_list.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/create_descriptions_list.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/create_descriptions_list.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/create_descriptions_list.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/create_entities_from_score.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/create_entities_from_score.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/create_entities_from_score.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/create_entities_from_score.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/create_entities_from_score.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/create_entities_from_score.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/create_entities_from_score.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/create_entities_from_score.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/get_score_string.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/get_score_string.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/get_score_string.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/get_score_string.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/get_top_severity.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/get_top_severity.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/get_top_severity.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/get_top_severity.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/get_top_severity.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/get_top_severity.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/get_top_severity.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/get_top_severity.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/score.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/score.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/score.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/score.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/score.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/score.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/score.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/score.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/score_health.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/score_health.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/score_health.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/score_health.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/score_interval_to_datetime.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/score_interval_to_datetime.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/score_interval_to_datetime.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/score_interval_to_datetime.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/score_interval_to_datetime.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/score_interval_to_datetime.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/score_interval_to_datetime.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/score_interval_to_datetime.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/score/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/score/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/score/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/anomalies_host_table.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/anomalies_host_table.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/anomalies_host_table.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/anomalies_host_table.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/anomalies_host_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/anomalies_host_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/anomalies_host_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/anomalies_host_table.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/anomalies_network_table.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/anomalies_network_table.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/anomalies_network_table.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/anomalies_network_table.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/anomalies_network_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/anomalies_network_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/anomalies_network_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/anomalies_network_table.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/anomalies_user_table.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/anomalies_user_table.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/anomalies_user_table.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/anomalies_user_table.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/anomalies_user_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/anomalies_user_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/anomalies_user_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/anomalies_user_table.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/basic_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/basic_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/basic_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/basic_table.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_hosts.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_hosts.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_hosts.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_hosts.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_hosts.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_hosts.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_hosts.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_hosts.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_network.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_network.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_network.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_network.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_network.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_network.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_network.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_network.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_users.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_users.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_users.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_users.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_users.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_users.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_users.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/convert_anomalies_to_users.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/create_compound_key.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/create_compound_key.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/create_compound_key.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/create_compound_key.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/create_compound_key.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/create_compound_key.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/create_compound_key.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/create_compound_key.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_host_table_columns.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/get_anomalies_host_table_columns.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_host_table_columns.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/get_anomalies_host_table_columns.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_host_table_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/get_anomalies_host_table_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_host_table_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/get_anomalies_host_table_columns.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_network_table_columns.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/get_anomalies_network_table_columns.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_network_table_columns.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/get_anomalies_network_table_columns.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_network_table_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/get_anomalies_network_table_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_network_table_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/get_anomalies_network_table_columns.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_table_columns.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/get_anomalies_table_columns.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_table_columns.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/get_anomalies_table_columns.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_table_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/get_anomalies_table_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_table_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/get_anomalies_table_columns.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_user_table_columns.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/get_anomalies_user_table_columns.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_user_table_columns.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/get_anomalies_user_table_columns.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_user_table_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/get_anomalies_user_table_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/get_anomalies_user_table_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/get_anomalies_user_table_columns.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/job_id_filter.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/job_id_filter.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/job_id_filter.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/job_id_filter.stories.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/job_id_filter.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/job_id_filter.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/job_id_filter.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/job_id_filter.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/job_id_filter.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/job_id_filter.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/job_id_filter.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/job_id_filter.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/select_interval.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/select_interval.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/select_interval.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/select_interval.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/select_interval.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/select_interval.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/select_interval.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/select_interval.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml/tables/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/tables/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/tables/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/types.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/types.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/types.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/types.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml/types.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/__snapshots__/popover_description.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/__snapshots__/popover_description.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/__snapshots__/popover_description.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/__snapshots__/popover_description.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/__snapshots__/upgrade_contents.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/__snapshots__/upgrade_contents.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/__snapshots__/upgrade_contents.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/__snapshots__/upgrade_contents.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/api.mock.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/api.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/api.mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/api.mock.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/api.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/api.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/hooks/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/hooks/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/use_enable_data_feed.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/hooks/use_enable_data_feed.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/use_enable_data_feed.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/hooks/use_enable_data_feed.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/use_enable_data_feed.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/hooks/use_enable_data_feed.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/use_enable_data_feed.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/hooks/use_enable_data_feed.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/use_fetch_modules_query.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/hooks/use_fetch_modules_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/use_fetch_modules_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/hooks/use_fetch_modules_query.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/use_fetch_recognizer_query.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/hooks/use_fetch_recognizer_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/use_fetch_recognizer_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/hooks/use_fetch_recognizer_query.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/use_security_jobs.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/hooks/use_security_jobs.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/use_security_jobs.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/hooks/use_security_jobs.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/use_security_jobs.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/hooks/use_security_jobs.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/use_security_jobs.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/hooks/use_security_jobs.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/use_security_jobs_helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/hooks/use_security_jobs_helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/use_security_jobs_helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/hooks/use_security_jobs_helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/use_security_jobs_helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/hooks/use_security_jobs_helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/hooks/use_security_jobs_helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/hooks/use_security_jobs_helpers.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/__snapshots__/job_switch.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/__snapshots__/job_switch.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/__snapshots__/job_switch.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/__snapshots__/job_switch.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/__snapshots__/showing_count.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/__snapshots__/showing_count.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/__snapshots__/showing_count.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/__snapshots__/showing_count.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/__snapshots__/groups_filter_popover.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/__snapshots__/groups_filter_popover.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/__snapshots__/groups_filter_popover.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/__snapshots__/groups_filter_popover.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/groups_filter_popover.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/groups_filter_popover.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/groups_filter_popover.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/groups_filter_popover.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/groups_filter_popover.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/groups_filter_popover.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/groups_filter_popover.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/groups_filter_popover.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/jobs_table_filters.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/jobs_table_filters.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/jobs_table_filters.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/jobs_table_filters.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/jobs_table_filters.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/jobs_table_filters.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/jobs_table_filters.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/jobs_table_filters.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/toggle_selected_group.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/toggle_selected_group.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/toggle_selected_group.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/toggle_selected_group.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/toggle_selected_group.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/toggle_selected_group.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/toggle_selected_group.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/toggle_selected_group.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/filters/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/job_switch.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/job_switch.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/job_switch.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/job_switch.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/job_switch.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/job_switch.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/job_switch.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/job_switch.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/jobs_table.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/jobs_table.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/jobs_table.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/jobs_table.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/jobs_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/jobs_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/jobs_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/jobs_table.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/showing_count.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/showing_count.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/showing_count.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/showing_count.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/showing_count.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/showing_count.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/showing_count.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/showing_count.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/jobs_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/jobs_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/ml_modules.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/ml_modules.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/ml_modules.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/ml_modules.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/ml_popover.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/ml_popover.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/ml_popover.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/ml_popover.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/ml_popover.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/ml_popover.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/ml_popover.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/ml_popover.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/popover_description.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/popover_description.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/popover_description.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/popover_description.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/popover_description.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/popover_description.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/popover_description.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/popover_description.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/types.ts diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/upgrade_contents.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/upgrade_contents.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/upgrade_contents.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/upgrade_contents.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/ml_popover/upgrade_contents.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/upgrade_contents.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/ml_popover/upgrade_contents.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/ml_popover/upgrade_contents.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/multiselect_filter/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/multiselect_filter/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/multiselect_filter/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/multiselect_filter/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/__mocks__/use_url_state_query_params.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/__mocks__/use_url_state_query_params.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/__mocks__/use_url_state_query_params.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/__mocks__/use_url_state_query_params.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/breadcrumbs/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/trailing_breadcrumbs.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/breadcrumbs/trailing_breadcrumbs.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/trailing_breadcrumbs.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/breadcrumbs/trailing_breadcrumbs.ts diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/breadcrumbs/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/breadcrumbs/types.ts diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/use_breadcrumbs_nav.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/breadcrumbs/use_breadcrumbs_nav.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/use_breadcrumbs_nav.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/breadcrumbs/use_breadcrumbs_nav.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/use_breadcrumbs_nav.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/breadcrumbs/use_breadcrumbs_nav.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/breadcrumbs/use_breadcrumbs_nav.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/breadcrumbs/use_breadcrumbs_nav.ts diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/helpers.ts diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/nav_item_beta_badge.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/nav_item_beta_badge.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/nav_item_beta_badge.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/nav_item_beta_badge.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/security_side_nav/categories.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/security_side_nav/categories.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/security_side_nav/categories.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/security_side_nav/categories.ts diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/security_side_nav/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/security_side_nav/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/security_side_nav/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/security_side_nav/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/security_side_nav/security_side_nav.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/security_side_nav/security_side_nav.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/security_side_nav/security_side_nav.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/security_side_nav/security_side_nav.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/security_side_nav/security_side_nav.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/security_side_nav/security_side_nav.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/security_side_nav/security_side_nav.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/security_side_nav/security_side_nav.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/tab_navigation/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/tab_navigation/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/tab_navigation/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/tab_navigation/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/tab_navigation/tab_navigation.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/tab_navigation/tab_navigation.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/tab_navigation/tab_navigation.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/tab_navigation/tab_navigation.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/tab_navigation/tab_navigation.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/tab_navigation/tab_navigation.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/tab_navigation/tab_navigation.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/tab_navigation/tab_navigation.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/tab_navigation/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/tab_navigation/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/tab_navigation/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/tab_navigation/types.ts diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/types.ts diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_security_solution_navigation.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_security_solution_navigation.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_security_solution_navigation.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_security_solution_navigation.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_security_solution_navigation.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_security_solution_navigation.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_security_solution_navigation.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/use_security_solution_navigation/use_security_solution_navigation.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/navigation/use_url_state_query_params.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/use_url_state_query_params.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/navigation/use_url_state_query_params.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/navigation/use_url_state_query_params.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/news_feed/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/news_feed/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/news_feed/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/news_feed/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/news_feed/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/news_feed/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/news_feed/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/news_feed/helpers.ts diff --git a/x-pack/plugins/security_solution/public/common/components/news_feed/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/news_feed/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/news_feed/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/news_feed/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/news_feed/news_feed.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/news_feed/news_feed.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/news_feed/news_feed.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/news_feed/news_feed.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/news_feed/news_link/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/news_feed/news_link/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/news_feed/news_link/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/news_feed/news_link/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/news_feed/no_news/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/news_feed/no_news/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/news_feed/no_news/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/news_feed/no_news/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/news_feed/post/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/news_feed/post/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/news_feed/post/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/news_feed/post/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/news_feed/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/news_feed/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/news_feed/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/news_feed/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/news_feed/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/news_feed/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/news_feed/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/news_feed/types.ts diff --git a/x-pack/plugins/security_solution/public/common/components/no_privileges/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/no_privileges/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/no_privileges/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/no_privileges/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/no_privileges/no_privileges.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/no_privileges/no_privileges.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/no_privileges/no_privileges.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/no_privileges/no_privileges.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/no_privileges/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/no_privileges/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/no_privileges/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/no_privileges/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/overview_description_list/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/overview_description_list/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/overview_description_list/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/overview_description_list/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/page/__mocks__/use_refetch_by_session.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/page/__mocks__/use_refetch_by_session.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/page/__mocks__/use_refetch_by_session.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/page/__mocks__/use_refetch_by_session.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/page/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/page/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/page/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/page/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/page/manage_query.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/page/manage_query.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/page/manage_query.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/page/manage_query.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/page/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/page/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/page/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/page/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/page/use_refetch_by_session.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/page/use_refetch_by_session.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/page/use_refetch_by_session.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/page/use_refetch_by_session.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/page/use_refetch_by_session.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/page/use_refetch_by_session.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/page/use_refetch_by_session.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/page/use_refetch_by_session.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/page_wrapper/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/page_wrapper/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/page_wrapper/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/page_wrapper/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/page_wrapper/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/page_wrapper/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/page_wrapper/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/page_wrapper/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/panel/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/panel/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/panel/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/panel/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/panel/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/panel/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/panel/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/panel/index.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/common/components/panel_text/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/panel_text/index.ts new file mode 100644 index 0000000000000..e11d5f18e46be --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/common/components/panel_text/index.ts @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export { PanelText, type PanelTextProps } from './panel_text'; diff --git a/x-pack/solutions/security/plugins/security_solution/public/common/components/panel_text/panel_text.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/panel_text/panel_text.tsx new file mode 100644 index 0000000000000..5c1fc6746bcd0 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/common/components/panel_text/panel_text.tsx @@ -0,0 +1,35 @@ +/* + * 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, { type PropsWithChildren } from 'react'; +import { css, type CSSInterpolation } from '@emotion/css'; +import { EuiText, useEuiTheme, COLOR_MODES_STANDARD, type EuiTextProps } from '@elastic/eui'; + +export interface PanelTextProps extends PropsWithChildren<EuiTextProps> { + subdued?: true; + semiBold?: true; +} +export const PanelText = React.memo<PanelTextProps>(({ children, subdued, semiBold, ...props }) => { + const { euiTheme, colorMode } = useEuiTheme(); + const isDarkMode = colorMode === COLOR_MODES_STANDARD.dark; + + let color; + if (subdued && !isDarkMode) { + color = 'subdued'; + } + + const style: CSSInterpolation = {}; + if (semiBold) { + style.fontWeight = euiTheme.font.weight.semiBold; + } + + return ( + <EuiText {...props} color={color} className={css(style)}> + {children} + </EuiText> + ); +}); +PanelText.displayName = 'PanelText'; diff --git a/x-pack/plugins/security_solution/public/common/components/plugin_template_wrapper/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/plugin_template_wrapper/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/plugin_template_wrapper/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/plugin_template_wrapper/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/plugin_template_wrapper/plugin_template_wrapper.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/plugin_template_wrapper/plugin_template_wrapper.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/plugin_template_wrapper/plugin_template_wrapper.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/plugin_template_wrapper/plugin_template_wrapper.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/popover_items/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/popover_items/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/popover_items/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/popover_items/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/popover_items/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/popover_items/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/popover_items/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/popover_items/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/progress_inline/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/progress_inline/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/progress_inline/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/progress_inline/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/progress_inline/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/progress_inline/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/progress_inline/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/progress_inline/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/progress_inline/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/progress_inline/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/progress_inline/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/progress_inline/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/query_bar/convert_to_query_type.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/query_bar/convert_to_query_type.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/query_bar/convert_to_query_type.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/query_bar/convert_to_query_type.ts diff --git a/x-pack/plugins/security_solution/public/common/components/query_bar/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/query_bar/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/query_bar/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/query_bar/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/query_bar/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/query_bar/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/query_bar/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/query_bar/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/response_actions/endpoint_action_results.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/response_actions/endpoint_action_results.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/response_actions/endpoint_action_results.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/response_actions/endpoint_action_results.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/response_actions/response_actions_empty_prompt.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/response_actions/response_actions_empty_prompt.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/response_actions/response_actions_empty_prompt.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/response_actions/response_actions_empty_prompt.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/response_actions/response_actions_results.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/response_actions/response_actions_results.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/response_actions/response_actions_results.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/response_actions/response_actions_results.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/response_actions/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/response_actions/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/response_actions/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/response_actions/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/response_actions/use_load_connectors/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/response_actions/use_load_connectors/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/response_actions/use_load_connectors/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/response_actions/use_load_connectors/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/rule_name/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/rule_name/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/rule_name/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/rule_name/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/scroll_to_top/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/scroll_to_top/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/scroll_to_top/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/scroll_to_top/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/scroll_to_top/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/scroll_to_top/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/scroll_to_top/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/scroll_to_top/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/search_bar/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/search_bar/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/search_bar/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/search_bar/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/search_bar/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/search_bar/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/search_bar/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/search_bar/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/search_bar/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/search_bar/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/search_bar/selectors.ts diff --git a/x-pack/plugins/security_solution/public/common/components/security_route_page_wrapper/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/security_route_page_wrapper/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/security_route_page_wrapper/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/security_route_page_wrapper/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/security_route_page_wrapper/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/security_route_page_wrapper/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/security_route_page_wrapper/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/security_route_page_wrapper/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/selectable_text/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/selectable_text/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/selectable_text/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/selectable_text/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/selectable_text/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/selectable_text/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/selectable_text/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/selectable_text/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/selectable_text/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/selectable_text/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/selectable_text/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/selectable_text/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/sessions_viewer/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/sessions_viewer/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/sessions_viewer/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/sessions_viewer/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/sessions_viewer/default_headers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/sessions_viewer/default_headers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/sessions_viewer/default_headers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/sessions_viewer/default_headers.ts diff --git a/x-pack/plugins/security_solution/public/common/components/sessions_viewer/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/sessions_viewer/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/sessions_viewer/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/sessions_viewer/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/sessions_viewer/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/sessions_viewer/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/sessions_viewer/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/sessions_viewer/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/sessions_viewer/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/sessions_viewer/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/sessions_viewer/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/sessions_viewer/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/sessions_viewer/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/sessions_viewer/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/sessions_viewer/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/sessions_viewer/types.ts diff --git a/x-pack/plugins/security_solution/public/common/components/severity_badge/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/severity_badge/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/severity_badge/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/severity_badge/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/severity_badge/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/severity_badge/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/severity_badge/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/severity_badge/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/sidebar_header/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/sidebar_header/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/sidebar_header/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/sidebar_header/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/split_accordion/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/split_accordion/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/split_accordion/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/split_accordion/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/split_accordion/split_accordion.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/split_accordion/split_accordion.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/split_accordion/split_accordion.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/split_accordion/split_accordion.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/subtitle/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/subtitle/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/subtitle/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/subtitle/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/subtitle/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/subtitle/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/subtitle/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/subtitle/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/subtitle/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/subtitle/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/subtitle/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/subtitle/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/super_date_picker/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/super_date_picker/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/super_date_picker/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/super_date_picker/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/super_date_picker/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/super_date_picker/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/super_date_picker/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/super_date_picker/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/super_date_picker/selectors.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/super_date_picker/selectors.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/super_date_picker/selectors.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/super_date_picker/selectors.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/super_date_picker/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/super_date_picker/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/super_date_picker/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/super_date_picker/selectors.ts diff --git a/x-pack/plugins/security_solution/public/common/components/tables/__snapshots__/helpers.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/tables/__snapshots__/helpers.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/tables/__snapshots__/helpers.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/tables/__snapshots__/helpers.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/tables/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/tables/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/tables/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/tables/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/tables/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/tables/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/tables/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/tables/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/technical_preview_badge/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/technical_preview_badge/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/technical_preview_badge/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/technical_preview_badge/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/technical_preview_badge/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/technical_preview_badge/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/technical_preview_badge/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/technical_preview_badge/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/text_field_value/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/text_field_value/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/text_field_value/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/text_field_value/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/text_field_value/index.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/text_field_value/index.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/text_field_value/index.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/text_field_value/index.stories.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/text_field_value/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/text_field_value/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/text_field_value/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/text_field_value/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/text_field_value/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/text_field_value/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/text_field_value/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/text_field_value/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/and_badge.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/and_badge.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/threat_match/and_badge.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/and_badge.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/and_badge.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/and_badge.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/threat_match/and_badge.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/and_badge.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/entry_delete_button.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/entry_delete_button.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/threat_match/entry_delete_button.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/entry_delete_button.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/entry_delete_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/entry_delete_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/threat_match/entry_delete_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/entry_delete_button.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/entry_item.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/entry_item.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/entry_item.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/threat_match/entry_item.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/entry_item.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/threat_match/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/threat_match/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/threat_match/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/threat_match/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/list_item.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/threat_match/list_item.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/list_item.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/list_item.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/threat_match/list_item.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/list_item.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/logic_buttons.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/logic_buttons.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/threat_match/logic_buttons.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/logic_buttons.stories.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/logic_buttons.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/logic_buttons.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/threat_match/logic_buttons.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/logic_buttons.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/logic_buttons.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/logic_buttons.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/threat_match/logic_buttons.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/logic_buttons.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/reducer.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/reducer.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/threat_match/reducer.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/reducer.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/threat_match/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/reducer.ts diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/threat_match/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/threat_match/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/threat_match/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/threat_match/types.ts diff --git a/x-pack/plugins/security_solution/public/common/components/toasters/__snapshots__/modal_all_errors.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/__snapshots__/modal_all_errors.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toasters/__snapshots__/modal_all_errors.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/__snapshots__/modal_all_errors.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/toasters/errors.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/errors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toasters/errors.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/errors.ts diff --git a/x-pack/plugins/security_solution/public/common/components/toasters/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toasters/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/index.test.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/index.tsx new file mode 100644 index 0000000000000..28d506ac178c6 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/index.tsx @@ -0,0 +1,181 @@ +/* + * 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 { EuiGlobalToastListToast as Toast } from '@elastic/eui'; +import { EuiButton, EuiGlobalToastList } from '@elastic/eui'; +import { noop } from 'lodash/fp'; +import type { Dispatch } from 'react'; +import React, { createContext, useContext, useReducer, useState } from 'react'; +import styled from 'styled-components'; + +import { ModalAllErrors } from './modal_all_errors'; +import * as i18n from './translations'; + +export * from './utils'; +export * from './errors'; + +/** + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + */ +export interface AppToast extends Toast { + // FunFact: In a very rare case of errors this can be something other than array. We have a unit test case for it and am leaving it like this type for now. + errors?: string[]; +} + +/** + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + */ +interface ToastState { + toasts: AppToast[]; +} + +/** + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + */ +const initialToasterState: ToastState = { + toasts: [], +}; + +/** + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + */ +export type ActionToaster = + | { type: 'addToaster'; toast: AppToast } + | { type: 'deleteToaster'; id: string } + | { type: 'toggleWaitToShowNextToast' }; + +/** + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + */ +export const StateToasterContext = createContext<[ToastState, Dispatch<ActionToaster>]>([ + initialToasterState, + () => noop, +]); + +/** + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + */ +export const useStateToaster = () => useContext(StateToasterContext); + +/** + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + */ +interface ManageGlobalToasterProps { + children: React.ReactNode; +} + +/** + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + */ +export const ManageGlobalToaster = ({ children }: ManageGlobalToasterProps) => { + const reducerToaster = (state: ToastState, action: ActionToaster) => { + switch (action.type) { + case 'addToaster': + return { ...state, toasts: [...state.toasts, action.toast] }; + case 'deleteToaster': + return { ...state, toasts: state.toasts.filter((msg) => msg.id !== action.id) }; + default: + return state; + } + }; + + return ( + <StateToasterContext.Provider value={useReducer(reducerToaster, initialToasterState)}> + {children} + </StateToasterContext.Provider> + ); +}; + +/** + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + */ +const GlobalToasterListContainer = styled.div` + position: absolute; + right: 0; + bottom: 0; +`; + +/** + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + */ +interface GlobalToasterProps { + toastLifeTimeMs?: number; +} + +/** + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + */ +export const GlobalToaster = ({ toastLifeTimeMs = 5000 }: GlobalToasterProps) => { + const [{ toasts }, dispatch] = useStateToaster(); + const [isShowing, setIsShowing] = useState(false); + const [toastInModal, setToastInModal] = useState<AppToast | null>(null); + + const toggle = (toast: AppToast) => { + if (isShowing) { + dispatch({ type: 'deleteToaster', id: toast.id }); + setToastInModal(null); + } else { + setToastInModal(toast); + } + setIsShowing(!isShowing); + }; + + return ( + <> + {toasts.length > 0 && !isShowing && ( + <GlobalToasterListContainer> + <EuiGlobalToastList + toasts={[formatToErrorToastIfNeeded(toasts[0], toggle)]} + dismissToast={({ id }) => { + dispatch({ type: 'deleteToaster', id }); + }} + toastLifeTimeMs={toastLifeTimeMs} + /> + </GlobalToasterListContainer> + )} + {toastInModal != null && ( + <ModalAllErrors isShowing={isShowing} toast={toastInModal} toggle={toggle} /> + )} + </> + ); +}; + +/** + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + */ +const formatToErrorToastIfNeeded = ( + toast: AppToast, + toggle: (toast: AppToast) => void +): AppToast => { + if (toast != null && toast.errors != null && toast.errors.length > 0) { + toast.text = ( + <ErrorToastContainer> + <EuiButton + data-test-subj="toaster-show-all-error-modal" + size="s" + color="danger" + onClick={() => toast != null && toggle(toast)} + > + {i18n.SEE_ALL_ERRORS} + </EuiButton> + </ErrorToastContainer> + ); + } + return toast; +}; + +/** + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + */ +const ErrorToastContainer = styled.div` + text-align: right; +`; + +/** + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + */ +ErrorToastContainer.displayName = 'ErrorToastContainer'; diff --git a/x-pack/plugins/security_solution/public/common/components/toasters/modal_all_errors.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/modal_all_errors.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toasters/modal_all_errors.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/modal_all_errors.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/toasters/modal_all_errors.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/modal_all_errors.tsx similarity index 79% rename from x-pack/plugins/security_solution/public/common/components/toasters/modal_all_errors.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/modal_all_errors.tsx index da19968971ec9..1199a361a98a7 100644 --- a/x-pack/plugins/security_solution/public/common/components/toasters/modal_all_errors.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/modal_all_errors.tsx @@ -24,7 +24,7 @@ import type { AppToast } from '.'; import * as i18n from './translations'; /** - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead */ interface FullErrorProps { isShowing: boolean; @@ -33,7 +33,7 @@ interface FullErrorProps { } /** - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead */ const ModalAllErrorsComponent: React.FC<FullErrorProps> = ({ isShowing, toast, toggle }) => { const handleClose = useCallback(() => toggle(toast), [toggle, toast]); @@ -73,18 +73,18 @@ const ModalAllErrorsComponent: React.FC<FullErrorProps> = ({ isShowing, toast, t }; /** - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead */ export const ModalAllErrors = React.memo(ModalAllErrorsComponent); /** - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead */ const MyEuiCodeBlock = styled(EuiCodeBlock)` margin-top: 4px; `; /** - * @deprecated Use x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead */ MyEuiCodeBlock.displayName = 'MyEuiCodeBlock'; diff --git a/x-pack/plugins/security_solution/public/common/components/toasters/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toasters/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/toasters/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toasters/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/utils.test.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/utils.ts new file mode 100644 index 0000000000000..a1b75a4b4af0c --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/common/components/toasters/utils.ts @@ -0,0 +1,133 @@ +/* + * 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 React from 'react'; +import { v4 as uuidv4 } from 'uuid'; +import { isError } from 'lodash/fp'; +import { isAppError } from '@kbn/securitysolution-t-grid'; + +import type { AppToast, ActionToaster } from '.'; +import { isToasterError } from './errors'; + +/** + * Displays an error toast for the provided title and message + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + * @param errorTitle Title of error to display in toaster and modal + * @param errorMessages Message to display in error modal when clicked + * @param dispatchToaster provided by useStateToaster() + */ +export const displayErrorToast = ( + errorTitle: string, + errorMessages: string[], + dispatchToaster: React.Dispatch<ActionToaster>, + id: string = uuidv4() +): void => { + const toast: AppToast = { + id, + title: errorTitle, + color: 'danger', + iconType: 'error', + errors: errorMessages, + }; + dispatchToaster({ + type: 'addToaster', + toast, + }); +}; + +/** + * Displays a success toast for the provided title and message + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + * @param title success message to display in toaster and modal + * @param dispatchToaster provided by useStateToaster() + */ +export const displaySuccessToast = ( + title: string, + dispatchToaster: React.Dispatch<ActionToaster>, + id: string = uuidv4() +): void => { + const toast: AppToast = { + id, + title, + color: 'success', + iconType: 'check', + }; + dispatchToaster({ + type: 'addToaster', + toast, + }); +}; + +export type ErrorToToasterArgs = Partial<AppToast> & { + error: unknown; + dispatchToaster: React.Dispatch<ActionToaster>; +}; + +/** + * Displays an error toast with messages parsed from the error. + * + * This has shortcomings and bugs compared to using the use_app_toasts because it takes naive guesses at the + * underlying data structure and does not display much about the error. This is not compatible with bsearch (async search) + * and sometimes can display to the user blank messages. + * + * The use_app_toasts has more feature rich logic and uses the Kibana toaster system to figure out which type of + * error you have in a more robust way then this function does and supersedes this function. + * + * @deprecated Use x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts instead + * @param title error message to display in toaster and modal + * @param error the error from which messages will be parsed + * @param dispatchToaster provided by useStateToaster() + */ +export const errorToToaster = ({ + id = uuidv4(), + title, + error, + color = 'danger', + iconType = 'error', + dispatchToaster, +}: ErrorToToasterArgs) => { + let toast: AppToast; + + if (isToasterError(error)) { + toast = { + id, + title, + color, + iconType, + errors: error.messages, + }; + } else if (isAppError(error)) { + toast = { + id, + title, + color, + iconType, + errors: [error.body.message], + }; + } else if (isError(error)) { + toast = { + id, + title, + color, + iconType, + errors: [error.message], + }; + } else { + toast = { + id, + title, + color, + iconType, + errors: ['Network Error'], + }; + } + + dispatchToaster({ + type: 'addToaster', + toast, + }); +}; diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/alert_bulk_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/alert_bulk_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/alert_bulk_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/alert_bulk_actions.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/alert_bulk_assignees.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/alert_bulk_assignees.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/alert_bulk_assignees.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/alert_bulk_assignees.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/alert_bulk_assignees.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/alert_bulk_assignees.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/alert_bulk_assignees.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/alert_bulk_assignees.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/alert_bulk_tags.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/alert_bulk_tags.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/alert_bulk_tags.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/alert_bulk_tags.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/alert_bulk_tags.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/alert_bulk_tags.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/alert_bulk_tags.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/alert_bulk_tags.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/helpers.ts diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/reducer.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/reducer.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/reducer.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/reducer.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/reducer.ts diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/types.ts diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/update_alerts.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/update_alerts.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/update_alerts.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/update_alerts.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/update_alerts.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/update_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/update_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/update_alerts.ts diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_bulk_action_items.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_bulk_action_items.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_bulk_action_items.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_bulk_action_items.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_bulk_alert_assignees_items.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_bulk_alert_assignees_items.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_bulk_alert_assignees_items.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_bulk_alert_assignees_items.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_bulk_alert_assignees_items.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_bulk_alert_assignees_items.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_bulk_alert_assignees_items.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_bulk_alert_assignees_items.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_bulk_alert_tags_items.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_bulk_alert_tags_items.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_bulk_alert_tags_items.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_bulk_alert_tags_items.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_bulk_alert_tags_items.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_bulk_alert_tags_items.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_bulk_alert_tags_items.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_bulk_alert_tags_items.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_set_alert_assignees.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_set_alert_assignees.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_set_alert_assignees.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_set_alert_assignees.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_set_alert_tags.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_set_alert_tags.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_set_alert_tags.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/bulk_actions/use_set_alert_tags.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/unit/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/unit/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/unit/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/unit/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/unit/styles.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/unit/styles.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/unit/styles.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/unit/styles.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/toolbar/unit/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/unit/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/toolbar/unit/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/toolbar/unit/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/top_n/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/top_n/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/top_n/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/top_n/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/top_n/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/top_n/helpers.ts diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/top_n/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/top_n/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/top_n/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/top_n/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/top_n/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/top_n/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/top_n.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/top_n/top_n.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/top_n/top_n.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/top_n/top_n.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/top_n/top_n.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/top_n/top_n.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/top_n/top_n.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/top_n/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/top_n/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/top_n/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/top_n/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/truncatable_text/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/truncatable_text/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/truncatable_text/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/truncatable_text/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/truncatable_text/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/truncatable_text/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/truncatable_text/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/truncatable_text/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/truncatable_text/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/truncatable_text/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/truncatable_text/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/truncatable_text/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/truncatable_text/truncatable_text.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/truncatable_text/truncatable_text.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/truncatable_text/truncatable_text.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/truncatable_text/truncatable_text.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/upselling_provider/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/upselling_provider/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/upselling_provider/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/upselling_provider/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/upselling_provider/upselling_provider.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/upselling_provider/upselling_provider.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/upselling_provider/upselling_provider.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/upselling_provider/upselling_provider.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/use_combo_box_reset/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/use_combo_box_reset/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/use_combo_box_reset/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/use_combo_box_reset/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/use_combo_box_reset/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/use_combo_box_reset/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/use_combo_box_reset/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/use_combo_box_reset/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/user_privileges/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_privileges/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_privileges/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_privileges/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/user_privileges/endpoint/__mocks__/use_endpoint_privileges.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_privileges/endpoint/__mocks__/use_endpoint_privileges.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_privileges/endpoint/__mocks__/use_endpoint_privileges.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_privileges/endpoint/__mocks__/use_endpoint_privileges.ts diff --git a/x-pack/plugins/security_solution/public/common/components/user_privileges/endpoint/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_privileges/endpoint/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_privileges/endpoint/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_privileges/endpoint/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/user_privileges/endpoint/mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_privileges/endpoint/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_privileges/endpoint/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_privileges/endpoint/mocks.ts diff --git a/x-pack/plugins/security_solution/public/common/components/user_privileges/endpoint/security_solution_start_dependencies.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_privileges/endpoint/security_solution_start_dependencies.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_privileges/endpoint/security_solution_start_dependencies.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_privileges/endpoint/security_solution_start_dependencies.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/user_privileges/endpoint/use_endpoint_privileges.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_privileges/endpoint/use_endpoint_privileges.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_privileges/endpoint/use_endpoint_privileges.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_privileges/endpoint/use_endpoint_privileges.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/user_privileges/endpoint/use_endpoint_privileges.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_privileges/endpoint/use_endpoint_privileges.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_privileges/endpoint/use_endpoint_privileges.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_privileges/endpoint/use_endpoint_privileges.ts diff --git a/x-pack/plugins/security_solution/public/common/components/user_privileges/endpoint/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_privileges/endpoint/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_privileges/endpoint/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_privileges/endpoint/utils.ts diff --git a/x-pack/plugins/security_solution/public/common/components/user_privileges/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_privileges/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_privileges/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_privileges/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/user_privileges/user_privileges_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_privileges/user_privileges_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_privileges/user_privileges_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_privileges/user_privileges_context.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/user_profiles/__mocks__/api.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/__mocks__/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_profiles/__mocks__/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/__mocks__/api.ts diff --git a/x-pack/plugins/security_solution/public/common/components/user_profiles/api.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/api.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_profiles/api.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/api.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/user_profiles/api.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_profiles/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/api.ts diff --git a/x-pack/plugins/security_solution/public/common/components/user_profiles/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_profiles/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/mock.ts diff --git a/x-pack/plugins/security_solution/public/common/components/user_profiles/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/test_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_profiles/test_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/test_ids.ts diff --git a/x-pack/plugins/security_solution/public/common/components/user_profiles/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_profiles/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/user_profiles/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_profiles/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/types.ts diff --git a/x-pack/plugins/security_solution/public/common/components/user_profiles/use_bulk_get_user_profiles.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/use_bulk_get_user_profiles.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_profiles/use_bulk_get_user_profiles.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/use_bulk_get_user_profiles.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/user_profiles/use_bulk_get_user_profiles.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/use_bulk_get_user_profiles.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_profiles/use_bulk_get_user_profiles.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/use_bulk_get_user_profiles.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/user_profiles/use_get_current_user_profile.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/use_get_current_user_profile.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_profiles/use_get_current_user_profile.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/use_get_current_user_profile.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/user_profiles/use_get_current_user_profile.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/use_get_current_user_profile.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_profiles/use_get_current_user_profile.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/use_get_current_user_profile.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/user_profiles/use_suggest_users.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/use_suggest_users.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_profiles/use_suggest_users.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/use_suggest_users.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/user_profiles/use_suggest_users.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/use_suggest_users.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_profiles/use_suggest_users.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/use_suggest_users.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/user_profiles/users_avatars_panel.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/users_avatars_panel.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_profiles/users_avatars_panel.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/users_avatars_panel.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/user_profiles/users_avatars_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/users_avatars_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/user_profiles/users_avatars_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/user_profiles/users_avatars_panel.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/utility_bar/__snapshots__/utility_bar.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/__snapshots__/utility_bar.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/utility_bar/__snapshots__/utility_bar.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/__snapshots__/utility_bar.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/utility_bar/__snapshots__/utility_bar_action.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/__snapshots__/utility_bar_action.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/utility_bar/__snapshots__/utility_bar_action.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/__snapshots__/utility_bar_action.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/utility_bar/__snapshots__/utility_bar_group.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/__snapshots__/utility_bar_group.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/utility_bar/__snapshots__/utility_bar_group.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/__snapshots__/utility_bar_group.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/utility_bar/__snapshots__/utility_bar_section.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/__snapshots__/utility_bar_section.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/utility_bar/__snapshots__/utility_bar_section.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/__snapshots__/utility_bar_section.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/utility_bar/__snapshots__/utility_bar_text.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/__snapshots__/utility_bar_text.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/utility_bar/__snapshots__/utility_bar_text.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/__snapshots__/utility_bar_text.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/common/components/utility_bar/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/utility_bar/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/utility_bar/styles.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/styles.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/utility_bar/styles.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/styles.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar_action.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar_action.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar_action.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar_action.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar_action.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar_action.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar_action.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar_group.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar_group.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar_group.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar_group.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar_group.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar_group.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar_group.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar_group.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar_section.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar_section.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar_section.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar_section.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar_section.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar_section.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar_section.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar_section.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar_spacer.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar_spacer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar_spacer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar_spacer.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar_text.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar_text.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar_text.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar_text.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar_text.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar_text.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/utility_bar/utility_bar_text.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/utility_bar/utility_bar_text.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/utils.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/__mocks__/actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/__mocks__/actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/__mocks__/actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/__mocks__/actions.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/__mocks__/lens_embeddable.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/__mocks__/lens_embeddable.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/__mocks__/lens_embeddable.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/__mocks__/lens_embeddable.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/__mocks__/use_actions.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/__mocks__/use_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/__mocks__/use_actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/__mocks__/use_actions.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/__mocks__/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/__mocks__/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/__mocks__/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/__mocks__/utils.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/__mocks__/visualization_embeddable.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/__mocks__/visualization_embeddable.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/__mocks__/visualization_embeddable.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/__mocks__/visualization_embeddable.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/__snapshots__/utils.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/__snapshots__/utils.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/__snapshots__/utils.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/__snapshots__/utils.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/actions.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/actions.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/actions.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/actions.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/actions.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/__snapshots__/authentication.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/__snapshots__/authentication.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/__snapshots__/authentication.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/__snapshots__/authentication.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/__snapshots__/external_alert.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/__snapshots__/external_alert.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/__snapshots__/external_alert.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/__snapshots__/external_alert.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/__snapshots__/alerts_by_status_donut.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/__snapshots__/alerts_by_status_donut.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/__snapshots__/alerts_by_status_donut.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/__snapshots__/alerts_by_status_donut.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/__snapshots__/alerts_histogram.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/__snapshots__/alerts_histogram.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/__snapshots__/alerts_histogram.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/__snapshots__/alerts_histogram.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/__snapshots__/alerts_table.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/__snapshots__/alerts_table.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/__snapshots__/alerts_table.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/__snapshots__/alerts_table.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/__snapshots__/rule_preview.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/__snapshots__/rule_preview.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/__snapshots__/rule_preview.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/__snapshots__/rule_preview.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_by_status_donut.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_by_status_donut.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_by_status_donut.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_by_status_donut.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_by_status_donut.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_by_status_donut.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_by_status_donut.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_by_status_donut.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_histogram.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_histogram.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_histogram.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_histogram.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_histogram.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_histogram.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_histogram.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_histogram.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_table.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_table.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_table.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_table.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_table.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_table.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_table.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/alerts_table.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/rule_preview.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/rule_preview.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/rule_preview.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/rule_preview.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/rule_preview.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/rule_preview.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/rule_preview.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/alerts/rule_preview.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/authentication.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/authentication.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/authentication.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/authentication.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/authentication.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/authentication.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/authentication.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/authentication.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/event.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/event.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/event.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/event.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/events.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/events.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/events.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/events.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/external_alert.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/external_alert.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/external_alert.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/external_alert.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/external_alert.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/external_alert.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/external_alert.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/common/external_alert.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_host_area.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_host_area.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_host_area.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_host_area.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_host_metric.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_host_metric.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_host_metric.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_host_metric.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_unique_ips_area.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_unique_ips_area.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_unique_ips_area.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_unique_ips_area.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_unique_ips_bar.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_unique_ips_bar.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_unique_ips_bar.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_unique_ips_bar.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_unique_ips_destination_metric.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_unique_ips_destination_metric.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_unique_ips_destination_metric.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_unique_ips_destination_metric.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_unique_ips_source_metric.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_unique_ips_source_metric.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_unique_ips_source_metric.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/__snapshots__/kpi_unique_ips_source_metric.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_host_area.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_host_area.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_host_area.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_host_area.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_host_area.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_host_area.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_host_area.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_host_area.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_host_metric.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_host_metric.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_host_metric.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_host_metric.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_host_metric.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_host_metric.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_host_metric.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_host_metric.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_area.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_area.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_area.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_area.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_area.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_area.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_area.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_area.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_bar.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_bar.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_bar.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_bar.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_bar.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_bar.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_bar.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_bar.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_destination_metric.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_destination_metric.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_destination_metric.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_destination_metric.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_destination_metric.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_destination_metric.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_destination_metric.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_destination_metric.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_source_metric.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_source_metric.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_source_metric.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_source_metric.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_source_metric.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_source_metric.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_source_metric.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/hosts/kpi_unique_ips_source_metric.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/dns_top_domains.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/dns_top_domains.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/dns_top_domains.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/dns_top_domains.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_dns_queries.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_dns_queries.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_dns_queries.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_dns_queries.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_network_events.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_network_events.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_network_events.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_network_events.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_tls_handshakes.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_tls_handshakes.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_tls_handshakes.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_tls_handshakes.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_flow_ids.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_flow_ids.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_flow_ids.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_flow_ids.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_private_ips_area.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_private_ips_area.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_private_ips_area.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_private_ips_area.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_private_ips_bar.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_private_ips_bar.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_private_ips_bar.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_private_ips_bar.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_private_ips_destination_metric.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_private_ips_destination_metric.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_private_ips_destination_metric.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_private_ips_destination_metric.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_private_ips_source_metric.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_private_ips_source_metric.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_private_ips_source_metric.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/__snapshots__/kpi_unique_private_ips_source_metric.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/dns_top_domains.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/dns_top_domains.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/dns_top_domains.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/dns_top_domains.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/dns_top_domains.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/dns_top_domains.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/dns_top_domains.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/dns_top_domains.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_dns_queries.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_dns_queries.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_dns_queries.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_dns_queries.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_dns_queries.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_dns_queries.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_dns_queries.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_dns_queries.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_network_events.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_network_events.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_network_events.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_network_events.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_network_events.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_network_events.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_network_events.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_network_events.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_tls_handshakes.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_tls_handshakes.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_tls_handshakes.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_tls_handshakes.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_tls_handshakes.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_tls_handshakes.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_tls_handshakes.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_tls_handshakes.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_flow_ids.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_flow_ids.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_flow_ids.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_flow_ids.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_flow_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_flow_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_flow_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_flow_ids.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_area.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_area.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_area.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_area.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_area.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_area.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_area.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_area.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_bar.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_bar.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_bar.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_bar.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_bar.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_bar.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_bar.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_bar.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_destination_metric.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_destination_metric.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_destination_metric.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_destination_metric.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_destination_metric.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_destination_metric.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_destination_metric.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_destination_metric.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_source_metric.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_source_metric.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_source_metric.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_source_metric.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_source_metric.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_source_metric.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_source_metric.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/network/kpi_unique_private_ips_source_metric.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/readme.md b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/readme.md similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/readme.md rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/readme.md diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_total_users_area.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_total_users_area.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_total_users_area.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_total_users_area.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_total_users_metric.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_total_users_metric.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_total_users_metric.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_total_users_metric.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_user_authentication_metric_failure.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_user_authentication_metric_failure.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_user_authentication_metric_failure.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_user_authentication_metric_failure.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_user_authentications_area.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_user_authentications_area.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_user_authentications_area.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_user_authentications_area.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_user_authentications_bar.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_user_authentications_bar.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_user_authentications_bar.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_user_authentications_bar.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_user_authentications_metric_success.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_user_authentications_metric_success.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_user_authentications_metric_success.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/__snapshots__/kpi_user_authentications_metric_success.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_total_users_area.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_total_users_area.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_total_users_area.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_total_users_area.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_total_users_area.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_total_users_area.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_total_users_area.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_total_users_area.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_total_users_metric.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_total_users_metric.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_total_users_metric.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_total_users_metric.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_total_users_metric.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_total_users_metric.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_total_users_metric.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_total_users_metric.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentication_metric_failure.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentication_metric_failure.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentication_metric_failure.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentication_metric_failure.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentication_metric_failure.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentication_metric_failure.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentication_metric_failure.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentication_metric_failure.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_area.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_area.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_area.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_area.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_area.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_area.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_area.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_area.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_bar.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_bar.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_bar.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_bar.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_bar.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_bar.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_bar.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_bar.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_metric_success.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_metric_success.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_metric_success.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_metric_success.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_metric_success.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_metric_success.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_metric_success.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_attributes/users/kpi_user_authentications_metric_success.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_embeddable.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_embeddable.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_embeddable.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_embeddable.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_embeddable.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_embeddable.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/lens_embeddable.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/lens_embeddable.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/mocks.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/mocks.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/mocks.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/mocks.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/types.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_actions.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_actions.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/use_actions.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_actions.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_actions.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/use_actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_actions.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_existing_case.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_add_to_existing_case.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_existing_case.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_add_to_existing_case.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_existing_case.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_add_to_existing_case.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_existing_case.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_add_to_existing_case.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_new_case.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_add_to_new_case.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_new_case.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_add_to_new_case.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_new_case.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_add_to_new_case.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/use_add_to_new_case.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_add_to_new_case.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_embeddable_inspect.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_embeddable_inspect.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/use_embeddable_inspect.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_embeddable_inspect.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_lens_attributes.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_lens_attributes.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/use_lens_attributes.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_lens_attributes.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_lens_attributes.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_lens_attributes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/use_lens_attributes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_lens_attributes.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_redirect_to_dashboard_from_lens.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_redirect_to_dashboard_from_lens.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/use_redirect_to_dashboard_from_lens.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_redirect_to_dashboard_from_lens.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_save_to_library.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_save_to_library.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/use_save_to_library.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_save_to_library.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_save_to_library.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_save_to_library.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/use_save_to_library.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_save_to_library.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_visualization_response.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_visualization_response.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/use_visualization_response.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_visualization_response.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/use_visualization_response.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_visualization_response.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/use_visualization_response.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/use_visualization_response.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/utils.test.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/utils.ts diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/visualization_embeddable.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/visualization_embeddable.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/visualization_embeddable.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/visualization_embeddable.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/visualization_actions/visualization_embeddable.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/visualization_embeddable.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/visualization_actions/visualization_embeddable.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/visualization_actions/visualization_embeddable.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/with_data_view/data_view_error.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/with_data_view/data_view_error.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/with_data_view/data_view_error.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/with_data_view/data_view_error.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/with_data_view/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/with_data_view/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/with_data_view/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/with_data_view/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/with_data_view/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/with_data_view/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/with_data_view/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/with_data_view/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/with_data_view/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/with_data_view/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/with_data_view/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/with_data_view/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/components/with_lazy_hook/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/with_lazy_hook/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/with_lazy_hook/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/with_lazy_hook/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/with_security_context/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/with_security_context/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/with_security_context/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/with_security_context/index.ts diff --git a/x-pack/plugins/security_solution/public/common/components/with_security_context/render_context_providers.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/with_security_context/render_context_providers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/with_security_context/render_context_providers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/with_security_context/render_context_providers.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/with_security_context/store.ts b/x-pack/solutions/security/plugins/security_solution/public/common/components/with_security_context/store.ts similarity index 96% rename from x-pack/plugins/security_solution/public/common/components/with_security_context/store.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/components/with_security_context/store.ts index 5a1179a4f5695..b6c98bf218542 100644 --- a/x-pack/plugins/security_solution/public/common/components/with_security_context/store.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/common/components/with_security_context/store.ts @@ -54,7 +54,7 @@ export const createFleetContextReduxStore = ({ additionalMiddleware = [], }: CreateFleetContextReduxStoreProps) => { // Most of the code here was copied form - // x-pack/plugins/security_solution/public/management/index.ts + // x-pack/solutions/security/plugins/security_solution/public/management/index.ts return createStore( combineReducers(reducersObject), preloadedState, diff --git a/x-pack/plugins/security_solution/public/common/components/with_security_context/with_security_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/with_security_context/with_security_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/with_security_context/with_security_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/with_security_context/with_security_context.tsx diff --git a/x-pack/plugins/security_solution/public/common/components/with_space_id/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/components/with_space_id/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/components/with_space_id/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/components/with_space_id/index.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/common/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/common/constants.ts new file mode 100644 index 0000000000000..a9761e87c20e1 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/common/constants.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 { euiLightVars } from '@kbn/ui-theme'; + +export const RISK_COLOR_LOW = euiLightVars.euiColorVis0; +export const RISK_COLOR_MEDIUM = euiLightVars.euiColorVis5; +export const RISK_COLOR_HIGH = euiLightVars.euiColorVis7; +export const RISK_COLOR_CRITICAL = euiLightVars.euiColorVis9; + +export const RISK_SCORE_LOW = 21; +export const RISK_SCORE_MEDIUM = 47; +export const RISK_SCORE_HIGH = 73; +export const RISK_SCORE_CRITICAL = 99; + +export const ONBOARDING_VIDEO_SOURCE = '//play.vidyard.com/K6kKDBbP9SpXife9s2tHNP.html?'; + +export const DEFAULT_HISTORY_WINDOW_SIZE = '7d'; diff --git a/x-pack/plugins/security_solution/public/common/containers/alert_assignees/api.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/alert_assignees/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/alert_assignees/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/alert_assignees/api.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/alert_tags/api.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/alert_tags/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/alert_tags/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/alert_tags/api.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/histogram_configs.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/histogram_configs.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/histogram_configs.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/histogram_configs.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/types.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/anomalies/anomalies_query_tab_body/utils.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/dashboards/__mocks__/api.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/dashboards/__mocks__/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/dashboards/__mocks__/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/dashboards/__mocks__/api.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/dashboards/api.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/dashboards/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/dashboards/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/dashboards/api.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/events/last_event_time/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/events/last_event_time/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/events/last_event_time/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/events/last_event_time/index.test.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/events/last_event_time/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/events/last_event_time/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/events/last_event_time/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/events/last_event_time/index.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/events/last_event_time/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/events/last_event_time/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/events/last_event_time/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/events/last_event_time/mock.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/events/last_event_time/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/events/last_event_time/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/events/last_event_time/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/events/last_event_time/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/helpers.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/local_storage/use_messages_storage.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/containers/local_storage/use_messages_storage.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/local_storage/use_messages_storage.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/local_storage/use_messages_storage.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/containers/local_storage/use_messages_storage.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/containers/local_storage/use_messages_storage.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/local_storage/use_messages_storage.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/local_storage/use_messages_storage.tsx diff --git a/x-pack/plugins/security_solution/public/common/containers/query_client/query_client_provider.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/containers/query_client/query_client_provider.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/query_client/query_client_provider.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/query_client/query_client_provider.tsx diff --git a/x-pack/plugins/security_solution/public/common/containers/query_toggle/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/containers/query_toggle/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/query_toggle/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/query_toggle/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/containers/query_toggle/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/containers/query_toggle/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/query_toggle/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/query_toggle/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/containers/query_toggle/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/containers/query_toggle/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/query_toggle/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/query_toggle/translations.tsx diff --git a/x-pack/plugins/security_solution/public/common/containers/related_entities/related_hosts/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/containers/related_entities/related_hosts/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/related_entities/related_hosts/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/related_entities/related_hosts/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/containers/related_entities/related_hosts/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/containers/related_entities/related_hosts/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/related_entities/related_hosts/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/related_entities/related_hosts/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/containers/related_entities/related_hosts/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/related_entities/related_hosts/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/related_entities/related_hosts/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/related_entities/related_hosts/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/related_entities/related_users/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/containers/related_entities/related_users/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/related_entities/related_users/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/related_entities/related_users/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/containers/related_entities/related_users/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/containers/related_entities/related_users/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/related_entities/related_users/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/related_entities/related_users/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/containers/related_entities/related_users/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/related_entities/related_users/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/related_entities/related_users/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/related_entities/related_users/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/source/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/containers/source/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/source/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/source/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/containers/source/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/containers/source/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/source/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/source/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/containers/source/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/source/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/source/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/source/mock.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/source/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/source/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/source/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/source/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/source/use_data_view.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/containers/source/use_data_view.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/source/use_data_view.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/source/use_data_view.tsx diff --git a/x-pack/plugins/security_solution/public/common/containers/tags/__mocks__/api.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/tags/__mocks__/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/tags/__mocks__/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/tags/__mocks__/api.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/tags/api.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/tags/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/tags/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/tags/api.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/use_first_last_seen/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/use_first_last_seen/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/use_first_last_seen/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/use_first_last_seen/index.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/use_first_last_seen/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/use_first_last_seen/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/use_first_last_seen/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/use_first_last_seen/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/use_first_last_seen/use_first_last_seen.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/use_first_last_seen/use_first_last_seen.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/use_first_last_seen/use_first_last_seen.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/use_first_last_seen/use_first_last_seen.test.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/use_first_last_seen/use_first_last_seen.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/containers/use_first_last_seen/use_first_last_seen.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/use_first_last_seen/use_first_last_seen.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/use_first_last_seen/use_first_last_seen.tsx diff --git a/x-pack/plugins/security_solution/public/common/containers/use_full_screen/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/containers/use_full_screen/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/use_full_screen/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/use_full_screen/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/containers/use_full_screen/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/containers/use_full_screen/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/use_full_screen/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/use_full_screen/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/containers/use_global_time/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/containers/use_global_time/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/use_global_time/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/use_global_time/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/containers/use_global_time/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/containers/use_global_time/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/use_global_time/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/use_global_time/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/containers/use_global_time/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/use_global_time/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/use_global_time/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/use_global_time/types.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/use_search_strategy/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/use_search_strategy/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/use_search_strategy/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/use_search_strategy/index.test.ts diff --git a/x-pack/plugins/security_solution/public/common/containers/use_search_strategy/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/containers/use_search_strategy/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/use_search_strategy/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/use_search_strategy/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/containers/use_search_strategy/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/containers/use_search_strategy/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/containers/use_search_strategy/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/containers/use_search_strategy/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/demo_data/endgame_ecs/creation.ts b/x-pack/solutions/security/plugins/security_solution/public/common/demo_data/endgame_ecs/creation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/demo_data/endgame_ecs/creation.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/demo_data/endgame_ecs/creation.ts diff --git a/x-pack/plugins/security_solution/public/common/demo_data/endgame_ecs/dns.ts b/x-pack/solutions/security/plugins/security_solution/public/common/demo_data/endgame_ecs/dns.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/demo_data/endgame_ecs/dns.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/demo_data/endgame_ecs/dns.ts diff --git a/x-pack/plugins/security_solution/public/common/demo_data/endgame_ecs/file_events.ts b/x-pack/solutions/security/plugins/security_solution/public/common/demo_data/endgame_ecs/file_events.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/demo_data/endgame_ecs/file_events.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/demo_data/endgame_ecs/file_events.ts diff --git a/x-pack/plugins/security_solution/public/common/demo_data/endgame_ecs/ipv4.ts b/x-pack/solutions/security/plugins/security_solution/public/common/demo_data/endgame_ecs/ipv4.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/demo_data/endgame_ecs/ipv4.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/demo_data/endgame_ecs/ipv4.ts diff --git a/x-pack/plugins/security_solution/public/common/demo_data/endgame_ecs/termination.ts b/x-pack/solutions/security/plugins/security_solution/public/common/demo_data/endgame_ecs/termination.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/demo_data/endgame_ecs/termination.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/demo_data/endgame_ecs/termination.ts diff --git a/x-pack/plugins/security_solution/public/common/demo_data/endgame_ecs/user_logon.ts b/x-pack/solutions/security/plugins/security_solution/public/common/demo_data/endgame_ecs/user_logon.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/demo_data/endgame_ecs/user_logon.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/demo_data/endgame_ecs/user_logon.ts diff --git a/x-pack/plugins/security_solution/public/common/demo_data/endpoint/library_load_event.ts b/x-pack/solutions/security/plugins/security_solution/public/common/demo_data/endpoint/library_load_event.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/demo_data/endpoint/library_load_event.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/demo_data/endpoint/library_load_event.ts diff --git a/x-pack/plugins/security_solution/public/common/demo_data/endpoint/process_execution_malware_prevention_alert.ts b/x-pack/solutions/security/plugins/security_solution/public/common/demo_data/endpoint/process_execution_malware_prevention_alert.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/demo_data/endpoint/process_execution_malware_prevention_alert.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/demo_data/endpoint/process_execution_malware_prevention_alert.ts diff --git a/x-pack/plugins/security_solution/public/common/demo_data/endpoint/registry_modification_event.ts b/x-pack/solutions/security/plugins/security_solution/public/common/demo_data/endpoint/registry_modification_event.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/demo_data/endpoint/registry_modification_event.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/demo_data/endpoint/registry_modification_event.ts diff --git a/x-pack/plugins/security_solution/public/common/demo_data/netflow.ts b/x-pack/solutions/security/plugins/security_solution/public/common/demo_data/netflow.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/demo_data/netflow.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/demo_data/netflow.ts diff --git a/x-pack/plugins/security_solution/public/common/demo_data/timeline.ts b/x-pack/solutions/security/plugins/security_solution/public/common/demo_data/timeline.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/demo_data/timeline.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/demo_data/timeline.ts diff --git a/x-pack/plugins/security_solution/public/common/experimental_features_service.ts b/x-pack/solutions/security/plugins/security_solution/public/common/experimental_features_service.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/experimental_features_service.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/experimental_features_service.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/__mocks__/use_data_table_filters.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/__mocks__/use_data_table_filters.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/__mocks__/use_data_table_filters.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/__mocks__/use_data_table_filters.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/__mocks__/use_experimental_features.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/__mocks__/use_experimental_features.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/__mocks__/use_experimental_features.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/__mocks__/use_experimental_features.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/__mocks__/use_get_field_spec.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/__mocks__/use_get_field_spec.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/__mocks__/use_get_field_spec.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/__mocks__/use_get_field_spec.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/__mocks__/use_license.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/__mocks__/use_license.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/__mocks__/use_license.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/__mocks__/use_license.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/endpoint/__mocks__/use_alert_response_actions_support.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/endpoint/__mocks__/use_alert_response_actions_support.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/endpoint/__mocks__/use_alert_response_actions_support.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/endpoint/__mocks__/use_alert_response_actions_support.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/endpoint/use_alert_response_actions_support.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/endpoint/use_alert_response_actions_support.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/endpoint/use_alert_response_actions_support.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/endpoint/use_alert_response_actions_support.test.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/endpoint/use_alert_response_actions_support.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/endpoint/use_alert_response_actions_support.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/endpoint/use_alert_response_actions_support.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/endpoint/use_alert_response_actions_support.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/endpoint/use_navigate_by_router_event_handler.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/endpoint/use_navigate_by_router_event_handler.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/endpoint/use_navigate_by_router_event_handler.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/endpoint/use_navigate_by_router_event_handler.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/hooks/endpoint/use_navigate_by_router_event_handler.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/endpoint/use_navigate_by_router_event_handler.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/endpoint/use_navigate_by_router_event_handler.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/endpoint/use_navigate_by_router_event_handler.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/endpoint/use_navigate_to_app_event_handler.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/endpoint/use_navigate_to_app_event_handler.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/endpoint/use_navigate_to_app_event_handler.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/endpoint/use_navigate_to_app_event_handler.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/eql/api.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/eql/api.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/eql/api.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/eql/api.test.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/eql/api.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/eql/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/eql/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/eql/api.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/esql/use_esql_availability.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/esql/use_esql_availability.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/esql/use_esql_availability.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/esql/use_esql_availability.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/is_in_security_app.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/is_in_security_app.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/is_in_security_app.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/is_in_security_app.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/search_bar/use_init_search_bar_url_params.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/search_bar/use_init_search_bar_url_params.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/search_bar/use_init_search_bar_url_params.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/search_bar/use_init_search_bar_url_params.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/search_bar/use_init_timerange_url_params.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/search_bar/use_init_timerange_url_params.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/search_bar/use_init_timerange_url_params.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/search_bar/use_init_timerange_url_params.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/search_bar/use_sync_search_bar_url_param.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/search_bar/use_sync_search_bar_url_param.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/search_bar/use_sync_search_bar_url_param.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/search_bar/use_sync_search_bar_url_param.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/search_bar/use_sync_timerange_url_param.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/search_bar/use_sync_timerange_url_param.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/search_bar/use_sync_timerange_url_param.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/search_bar/use_sync_timerange_url_param.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/search_bar/use_update_timerange_on_page_change.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/search_bar/use_update_timerange_on_page_change.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/search_bar/use_update_timerange_on_page_change.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/search_bar/use_update_timerange_on_page_change.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/timeline/use_init_timeline_url_param.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/timeline/use_init_timeline_url_param.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/timeline/use_init_timeline_url_param.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/timeline/use_init_timeline_url_param.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/timeline/use_query_timeline_by_id_on_url_change.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/timeline/use_query_timeline_by_id_on_url_change.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/timeline/use_query_timeline_by_id_on_url_change.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/timeline/use_query_timeline_by_id_on_url_change.test.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/timeline/use_query_timeline_by_id_on_url_change.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/timeline/use_query_timeline_by_id_on_url_change.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/timeline/use_query_timeline_by_id_on_url_change.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/timeline/use_query_timeline_by_id_on_url_change.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/timeline/use_sync_timeline_url_param.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/timeline/use_sync_timeline_url_param.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/timeline/use_sync_timeline_url_param.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/timeline/use_sync_timeline_url_param.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/timeline/use_timeline_save_prompt.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/timeline/use_timeline_save_prompt.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/timeline/use_timeline_save_prompt.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/timeline/use_timeline_save_prompt.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/types.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_add_integrations_url.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_add_integrations_url.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_add_integrations_url.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_add_integrations_url.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.mock.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.mock.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.test.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts similarity index 99% rename from x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts index 7a810fa9247d2..b98adfb4a875c 100644 --- a/x-pack/plugins/security_solution/public/common/hooks/use_app_toasts.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts @@ -84,7 +84,7 @@ export type MaybeESError = IEsError & { err?: Record<string, unknown> }; * supported in the future. However, for now, this is _hopefully_ temporary. * * Also see the file: - * x-pack/plugins/security_solution/public/app/home/setup.tsx + * x-pack/solutions/security/plugins/security_solution/public/app/home/setup.tsx * * Where this same technique of overriding and changing the stack is occurring. */ diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_bool_state.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_bool_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_bool_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_bool_state.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_confirm_validation_errors_modal/confirm_validation_errors_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_confirm_validation_errors_modal/confirm_validation_errors_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_confirm_validation_errors_modal/confirm_validation_errors_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_confirm_validation_errors_modal/confirm_validation_errors_modal.tsx diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_confirm_validation_errors_modal/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_confirm_validation_errors_modal/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_confirm_validation_errors_modal/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_confirm_validation_errors_modal/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_confirm_validation_errors_modal/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_confirm_validation_errors_modal/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_confirm_validation_errors_modal/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_confirm_validation_errors_modal/translations.tsx diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_confirm_validation_errors_modal/use_confirm_validation_errors_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_confirm_validation_errors_modal/use_confirm_validation_errors_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_confirm_validation_errors_modal/use_confirm_validation_errors_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_confirm_validation_errors_modal/use_confirm_validation_errors_modal.tsx diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_contract_component.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_contract_component.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_contract_component.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_contract_component.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_dashboard_href.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_dashboard_href.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_dashboard_href.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_dashboard_href.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_data_table_filters.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_data_table_filters.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_data_table_filters.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_data_table_filters.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_data_view_id.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_data_view_id.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_data_view_id.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_data_view_id.test.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_data_view_id.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_data_view_id.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_data_view_id.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_data_view_id.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_error_toast.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_error_toast.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_error_toast.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_error_toast.test.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_error_toast.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_error_toast.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_error_toast.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_error_toast.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_experimental_features.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_experimental_features.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_experimental_features.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_experimental_features.test.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_experimental_features.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_experimental_features.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_experimental_features.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_experimental_features.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_fetch/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_fetch/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_fetch/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_fetch/index.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_fetch/request_names.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_fetch/request_names.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_fetch/request_names.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_fetch/request_names.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_fetch/use_fetch.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_fetch/use_fetch.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_fetch/use_fetch.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_fetch/use_fetch.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_fetch/use_fetch.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_fetch/use_fetch.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_fetch/use_fetch.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_fetch/use_fetch.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_form_with_warnings/extract_validation_results.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_form_with_warnings/extract_validation_results.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_form_with_warnings/extract_validation_results.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_form_with_warnings/extract_validation_results.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_form_with_warnings/form_hook_with_warnings.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_form_with_warnings/form_hook_with_warnings.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_form_with_warnings/form_hook_with_warnings.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_form_with_warnings/form_hook_with_warnings.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_form_with_warnings/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_form_with_warnings/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_form_with_warnings/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_form_with_warnings/index.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_form_with_warnings/use_form_with_warnings.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_form_with_warnings/use_form_with_warnings.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_form_with_warnings/use_form_with_warnings.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_form_with_warnings/use_form_with_warnings.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_form_with_warnings/use_form_with_warnings.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_form_with_warnings/use_form_with_warnings.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_form_with_warnings/use_form_with_warnings.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_form_with_warnings/use_form_with_warnings.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_form_with_warnings/validation_results.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_form_with_warnings/validation_results.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_form_with_warnings/validation_results.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_form_with_warnings/validation_results.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_get_field_spec.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_get_field_spec.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_get_field_spec.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_get_field_spec.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_global_filter_query.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_global_filter_query.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_global_filter_query.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_global_filter_query.test.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_global_filter_query.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_global_filter_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_global_filter_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_global_filter_query.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_global_header_portal.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_global_header_portal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_global_header_portal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_global_header_portal.tsx diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_invalid_filter_query.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_invalid_filter_query.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_invalid_filter_query.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_invalid_filter_query.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_invalid_filter_query.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_invalid_filter_query.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_invalid_filter_query.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_invalid_filter_query.tsx diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_is_overflow.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_is_overflow.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_is_overflow.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_is_overflow.tsx diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_license.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_license.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_license.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_license.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_navigate_to_alerts_page_with_filters.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_navigate_to_alerts_page_with_filters.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_navigate_to_alerts_page_with_filters.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_navigate_to_alerts_page_with_filters.test.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_navigate_to_alerts_page_with_filters.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_navigate_to_alerts_page_with_filters.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_navigate_to_alerts_page_with_filters.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_navigate_to_alerts_page_with_filters.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_refetch_queries.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_refetch_queries.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_refetch_queries.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_refetch_queries.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_resolve_conflict.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_resolve_conflict.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_resolve_conflict.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_resolve_conflict.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_resolve_conflict.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_resolve_conflict.tsx similarity index 86% rename from x-pack/plugins/security_solution/public/common/hooks/use_resolve_conflict.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_resolve_conflict.tsx index c73b21c3b8418..fd148cf259786 100644 --- a/x-pack/plugins/security_solution/public/common/hooks/use_resolve_conflict.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_resolve_conflict.tsx @@ -18,14 +18,8 @@ import { useKibana } from '../lib/kibana'; import { URL_PARAM_KEY } from './use_url_state'; /** - * Unfortunately the url change initiated when clicking the button to otherObjectPath doesn't seem to be - * respected by the useSetInitialStateFromUrl here: x-pack/plugins/security_solution/public/common/components/url_state/initialize_redux_by_url.tsx - * - * FYI: It looks like the routing causes replaceStateInLocation to be called instead: - * x-pack/plugins/security_solution/public/common/components/url_state/helpers.ts - * * Potentially why the markdown component needs a click handler as well for timeline? - * see: /x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/processor.tsx + * see: x-pack/solutions/security/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/processor.tsx */ export const useResolveConflict = () => { const { search, pathname } = useLocation(); diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_resolve_redirect.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_resolve_redirect.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_resolve_redirect.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_resolve_redirect.test.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_resolve_redirect.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_resolve_redirect.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_resolve_redirect.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_resolve_redirect.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_selector.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_selector.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_selector.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_selector.tsx diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_space_id.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_space_id.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_space_id.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_space_id.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_terms_aggregation_fields.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_terms_aggregation_fields.ts new file mode 100644 index 0000000000000..e62b16e826766 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_terms_aggregation_fields.ts @@ -0,0 +1,29 @@ +/* + * 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 { useMemo } from 'react'; +import type { FieldSpec } from '@kbn/data-views-plugin/common'; +import type { DataViewFieldBase } from '@kbn/es-query'; +import { getTermsAggregationFields } from '../../detection_engine/rule_creation_ui/components/step_define_rule/utils'; + +export function useTermsAggregationFields(fields?: DataViewFieldBase[]) { + const termsAggregationFields = useMemo( + /** + * Typecasting to FieldSpec because fields is + * typed as DataViewFieldBase[] which does not have + * the 'aggregatable' property, however the type is incorrect + * + * fields does contain elements with the aggregatable property. + * We will need to determine where these types are defined and + * figure out where the discrepancy is. + */ + () => getTermsAggregationFields((fields as FieldSpec[]) ?? []), + [fields] + ); + + return termsAggregationFields; +} diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_timeline_events_count.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_timeline_events_count.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_timeline_events_count.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_timeline_events_count.tsx diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_update_browser_title.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_update_browser_title.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_update_browser_title.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_update_browser_title.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_update_execution_context.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_update_execution_context.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_update_execution_context.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_update_execution_context.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_upselling.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_upselling.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_upselling.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_upselling.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_upselling.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_upselling.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_upselling.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_upselling.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_url_state.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_url_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_url_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_url_state.ts diff --git a/x-pack/plugins/security_solution/public/common/hooks/use_value_changed.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_value_changed.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/hooks/use_value_changed.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_value_changed.ts diff --git a/x-pack/plugins/security_solution/public/common/icons/asset_criticality.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/icons/asset_criticality.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/icons/asset_criticality.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/icons/asset_criticality.tsx diff --git a/x-pack/plugins/security_solution/public/common/icons/cloud_defend.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/icons/cloud_defend.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/icons/cloud_defend.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/icons/cloud_defend.tsx diff --git a/x-pack/plugins/security_solution/public/common/icons/console.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/icons/console.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/icons/console.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/icons/console.tsx diff --git a/x-pack/plugins/security_solution/public/common/icons/console_cloud.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/icons/console_cloud.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/icons/console_cloud.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/icons/console_cloud.tsx diff --git a/x-pack/plugins/security_solution/public/common/icons/dashboards.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/icons/dashboards.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/icons/dashboards.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/icons/dashboards.tsx diff --git a/x-pack/plugins/security_solution/public/common/icons/endpoints.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/icons/endpoints.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/icons/endpoints.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/icons/endpoints.tsx diff --git a/x-pack/plugins/security_solution/public/common/icons/entity_analytics.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/icons/entity_analytics.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/icons/entity_analytics.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/icons/entity_analytics.tsx diff --git a/x-pack/plugins/security_solution/public/common/icons/pipeline.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/icons/pipeline.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/icons/pipeline.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/icons/pipeline.tsx diff --git a/x-pack/plugins/security_solution/public/common/icons/rollup.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/icons/rollup.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/icons/rollup.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/icons/rollup.tsx diff --git a/x-pack/plugins/security_solution/public/common/icons/saved_object.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/icons/saved_object.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/icons/saved_object.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/icons/saved_object.tsx diff --git a/x-pack/plugins/security_solution/public/common/icons/shield.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/icons/shield.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/icons/shield.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/icons/shield.tsx diff --git a/x-pack/plugins/security_solution/public/common/icons/siem_migrations.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/icons/siem_migrations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/icons/siem_migrations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/icons/siem_migrations.tsx diff --git a/x-pack/plugins/security_solution/public/common/icons/tool.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/icons/tool.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/icons/tool.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/icons/tool.tsx diff --git a/x-pack/plugins/security_solution/public/common/images/alerts.png b/x-pack/solutions/security/plugins/security_solution/public/common/images/alerts.png similarity index 100% rename from x-pack/plugins/security_solution/public/common/images/alerts.png rename to x-pack/solutions/security/plugins/security_solution/public/common/images/alerts.png diff --git a/x-pack/plugins/security_solution/public/common/images/cloud_native_vulnerability_management_dashboard_page.png b/x-pack/solutions/security/plugins/security_solution/public/common/images/cloud_native_vulnerability_management_dashboard_page.png similarity index 100% rename from x-pack/plugins/security_solution/public/common/images/cloud_native_vulnerability_management_dashboard_page.png rename to x-pack/solutions/security/plugins/security_solution/public/common/images/cloud_native_vulnerability_management_dashboard_page.png diff --git a/x-pack/plugins/security_solution/public/common/images/cloud_security_posture_dashboard_page.png b/x-pack/solutions/security/plugins/security_solution/public/common/images/cloud_security_posture_dashboard_page.png similarity index 100% rename from x-pack/plugins/security_solution/public/common/images/cloud_security_posture_dashboard_page.png rename to x-pack/solutions/security/plugins/security_solution/public/common/images/cloud_security_posture_dashboard_page.png diff --git a/x-pack/plugins/security_solution/public/common/images/data_quality_dashboard_page.png b/x-pack/solutions/security/plugins/security_solution/public/common/images/data_quality_dashboard_page.png similarity index 100% rename from x-pack/plugins/security_solution/public/common/images/data_quality_dashboard_page.png rename to x-pack/solutions/security/plugins/security_solution/public/common/images/data_quality_dashboard_page.png diff --git a/x-pack/plugins/security_solution/public/common/images/default.png b/x-pack/solutions/security/plugins/security_solution/public/common/images/default.png similarity index 100% rename from x-pack/plugins/security_solution/public/common/images/default.png rename to x-pack/solutions/security/plugins/security_solution/public/common/images/default.png diff --git a/x-pack/plugins/security_solution/public/common/images/detection_response_page.png b/x-pack/solutions/security/plugins/security_solution/public/common/images/detection_response_page.png similarity index 100% rename from x-pack/plugins/security_solution/public/common/images/detection_response_page.png rename to x-pack/solutions/security/plugins/security_solution/public/common/images/detection_response_page.png diff --git a/x-pack/plugins/security_solution/public/common/images/endpoint.svg b/x-pack/solutions/security/plugins/security_solution/public/common/images/endpoint.svg similarity index 100% rename from x-pack/plugins/security_solution/public/common/images/endpoint.svg rename to x-pack/solutions/security/plugins/security_solution/public/common/images/endpoint.svg diff --git a/x-pack/plugins/security_solution/public/common/images/entity_analytics_dashboard.png b/x-pack/solutions/security/plugins/security_solution/public/common/images/entity_analytics_dashboard.png similarity index 100% rename from x-pack/plugins/security_solution/public/common/images/entity_analytics_dashboard.png rename to x-pack/solutions/security/plugins/security_solution/public/common/images/entity_analytics_dashboard.png diff --git a/x-pack/plugins/security_solution/public/common/images/hosts_page.png b/x-pack/solutions/security/plugins/security_solution/public/common/images/hosts_page.png similarity index 100% rename from x-pack/plugins/security_solution/public/common/images/hosts_page.png rename to x-pack/solutions/security/plugins/security_solution/public/common/images/hosts_page.png diff --git a/x-pack/plugins/security_solution/public/common/images/illustration_product_no_results_magnifying_glass.svg b/x-pack/solutions/security/plugins/security_solution/public/common/images/illustration_product_no_results_magnifying_glass.svg similarity index 100% rename from x-pack/plugins/security_solution/public/common/images/illustration_product_no_results_magnifying_glass.svg rename to x-pack/solutions/security/plugins/security_solution/public/common/images/illustration_product_no_results_magnifying_glass.svg diff --git a/x-pack/plugins/security_solution/public/common/images/kubernetes_page.png b/x-pack/solutions/security/plugins/security_solution/public/common/images/kubernetes_page.png similarity index 100% rename from x-pack/plugins/security_solution/public/common/images/kubernetes_page.png rename to x-pack/solutions/security/plugins/security_solution/public/common/images/kubernetes_page.png diff --git a/x-pack/plugins/security_solution/public/common/images/modified.png b/x-pack/solutions/security/plugins/security_solution/public/common/images/modified.png similarity index 100% rename from x-pack/plugins/security_solution/public/common/images/modified.png rename to x-pack/solutions/security/plugins/security_solution/public/common/images/modified.png diff --git a/x-pack/plugins/security_solution/public/common/images/network_page.png b/x-pack/solutions/security/plugins/security_solution/public/common/images/network_page.png similarity index 100% rename from x-pack/plugins/security_solution/public/common/images/network_page.png rename to x-pack/solutions/security/plugins/security_solution/public/common/images/network_page.png diff --git a/x-pack/plugins/security_solution/public/common/images/onboarding_tour_step_alerts.gif b/x-pack/solutions/security/plugins/security_solution/public/common/images/onboarding_tour_step_alerts.gif similarity index 100% rename from x-pack/plugins/security_solution/public/common/images/onboarding_tour_step_alerts.gif rename to x-pack/solutions/security/plugins/security_solution/public/common/images/onboarding_tour_step_alerts.gif diff --git a/x-pack/plugins/security_solution/public/common/images/onboarding_tour_step_cases.gif b/x-pack/solutions/security/plugins/security_solution/public/common/images/onboarding_tour_step_cases.gif similarity index 100% rename from x-pack/plugins/security_solution/public/common/images/onboarding_tour_step_cases.gif rename to x-pack/solutions/security/plugins/security_solution/public/common/images/onboarding_tour_step_cases.gif diff --git a/x-pack/plugins/security_solution/public/common/images/overview_page.png b/x-pack/solutions/security/plugins/security_solution/public/common/images/overview_page.png similarity index 100% rename from x-pack/plugins/security_solution/public/common/images/overview_page.png rename to x-pack/solutions/security/plugins/security_solution/public/common/images/overview_page.png diff --git a/x-pack/plugins/security_solution/public/common/images/siem.png b/x-pack/solutions/security/plugins/security_solution/public/common/images/siem.png similarity index 100% rename from x-pack/plugins/security_solution/public/common/images/siem.png rename to x-pack/solutions/security/plugins/security_solution/public/common/images/siem.png diff --git a/x-pack/plugins/security_solution/public/common/images/timeline.png b/x-pack/solutions/security/plugins/security_solution/public/common/images/timeline.png similarity index 100% rename from x-pack/plugins/security_solution/public/common/images/timeline.png rename to x-pack/solutions/security/plugins/security_solution/public/common/images/timeline.png diff --git a/x-pack/plugins/security_solution/public/common/images/timeline_alerts.png b/x-pack/solutions/security/plugins/security_solution/public/common/images/timeline_alerts.png similarity index 100% rename from x-pack/plugins/security_solution/public/common/images/timeline_alerts.png rename to x-pack/solutions/security/plugins/security_solution/public/common/images/timeline_alerts.png diff --git a/x-pack/plugins/security_solution/public/common/images/users_page.png b/x-pack/solutions/security/plugins/security_solution/public/common/images/users_page.png similarity index 100% rename from x-pack/plugins/security_solution/public/common/images/users_page.png rename to x-pack/solutions/security/plugins/security_solution/public/common/images/users_page.png diff --git a/x-pack/solutions/security/plugins/security_solution/public/common/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/common/jest.config.js new file mode 100644 index 0000000000000..de509516f5538 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/common/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/common'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/common', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/common/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/common/lib/apm/__mocks__/use_start_transaction.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/apm/__mocks__/use_start_transaction.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/apm/__mocks__/use_start_transaction.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/apm/__mocks__/use_start_transaction.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/apm/__mocks__/use_track_http_request.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/apm/__mocks__/use_track_http_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/apm/__mocks__/use_track_http_request.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/apm/__mocks__/use_track_http_request.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/apm/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/apm/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/apm/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/apm/constants.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/apm/service.mock.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/apm/service.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/apm/service.mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/apm/service.mock.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/apm/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/apm/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/apm/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/apm/types.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/apm/use_start_transaction.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/apm/use_start_transaction.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/apm/use_start_transaction.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/apm/use_start_transaction.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/apm/use_track_http_request.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/apm/use_track_http_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/apm/use_track_http_request.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/apm/use_track_http_request.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/apm/user_actions.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/apm/user_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/apm/user_actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/apm/user_actions.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/capabilities/has_capabilities.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/capabilities/has_capabilities.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/capabilities/has_capabilities.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/capabilities/has_capabilities.test.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/capabilities/has_capabilities.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/capabilities/has_capabilities.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/capabilities/has_capabilities.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/capabilities/has_capabilities.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/capabilities/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/capabilities/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/capabilities/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/capabilities/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/cell_actions/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/lib/cell_actions/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/cell_actions/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/cell_actions/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/common/lib/cell_actions/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/cell_actions/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/cell_actions/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/cell_actions/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/clipboard/clipboard.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/lib/clipboard/clipboard.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/clipboard/clipboard.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/clipboard/clipboard.tsx diff --git a/x-pack/plugins/security_solution/public/common/lib/clipboard/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/clipboard/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/clipboard/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/clipboard/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/clipboard/with_copy_to_clipboard.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/lib/clipboard/with_copy_to_clipboard.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/clipboard/with_copy_to_clipboard.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/clipboard/with_copy_to_clipboard.tsx diff --git a/x-pack/plugins/security_solution/public/common/lib/endpoint/endpoint_isolation/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/endpoint_isolation/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/endpoint/endpoint_isolation/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/endpoint_isolation/index.test.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/endpoint/endpoint_isolation/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/endpoint_isolation/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/endpoint/endpoint_isolation/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/endpoint_isolation/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/endpoint/endpoint_isolation/mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/endpoint_isolation/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/endpoint/endpoint_isolation/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/endpoint_isolation/mocks.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/endpoint/endpoint_pending_actions/endpoint_pending_actions.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/endpoint_pending_actions/endpoint_pending_actions.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/endpoint/endpoint_pending_actions/endpoint_pending_actions.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/endpoint_pending_actions/endpoint_pending_actions.test.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/endpoint/endpoint_pending_actions/endpoint_pending_actions.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/endpoint_pending_actions/endpoint_pending_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/endpoint/endpoint_pending_actions/endpoint_pending_actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/endpoint_pending_actions/endpoint_pending_actions.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/endpoint/endpoint_pending_actions/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/endpoint_pending_actions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/endpoint/endpoint_pending_actions/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/endpoint_pending_actions/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/endpoint/endpoint_pending_actions/mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/endpoint_pending_actions/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/endpoint/endpoint_pending_actions/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/endpoint_pending_actions/mocks.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/endpoint/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/endpoint/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/endpoint/utils/get_agent_type_for_agent_id_field.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/get_agent_type_for_agent_id_field.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/endpoint/utils/get_agent_type_for_agent_id_field.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/get_agent_type_for_agent_id_field.test.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/endpoint/utils/get_agent_type_for_agent_id_field.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/get_agent_type_for_agent_id_field.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/endpoint/utils/get_agent_type_for_agent_id_field.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/get_agent_type_for_agent_id_field.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/endpoint/utils/get_event_details_agent_id_field.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/get_event_details_agent_id_field.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/endpoint/utils/get_event_details_agent_id_field.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/get_event_details_agent_id_field.test.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/endpoint/utils/get_event_details_agent_id_field.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/get_event_details_agent_id_field.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/endpoint/utils/get_event_details_agent_id_field.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/get_event_details_agent_id_field.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/endpoint/utils/get_event_details_field_values.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/get_event_details_field_values.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/endpoint/utils/get_event_details_field_values.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/get_event_details_field_values.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/endpoint/utils/get_host_platform.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/get_host_platform.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/endpoint/utils/get_host_platform.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/get_host_platform.test.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/endpoint/utils/get_host_platform.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/get_host_platform.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/endpoint/utils/get_host_platform.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/get_host_platform.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/endpoint/utils/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/endpoint/utils/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/endpoint/utils/is_agent_type_and_action_supported.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/is_agent_type_and_action_supported.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/endpoint/utils/is_agent_type_and_action_supported.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/is_agent_type_and_action_supported.test.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/endpoint/utils/is_agent_type_and_action_supported.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/is_agent_type_and_action_supported.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/endpoint/utils/is_agent_type_and_action_supported.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/is_agent_type_and_action_supported.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/endpoint/utils/is_response_actions_alert_agent_id_field.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/is_response_actions_alert_agent_id_field.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/endpoint/utils/is_response_actions_alert_agent_id_field.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/is_response_actions_alert_agent_id_field.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/endpoint/utils/parse_ecs_field_path.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/parse_ecs_field_path.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/endpoint/utils/parse_ecs_field_path.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/endpoint/utils/parse_ecs_field_path.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/helpers/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/lib/helpers/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/helpers/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/helpers/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/lib/helpers/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/lib/helpers/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/helpers/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/helpers/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/lib/history/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/history/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/history/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/history/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/kibana/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/kibana/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/kibana/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/kibana/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/kibana/hooks.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/kibana/hooks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/kibana/hooks.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/kibana/hooks.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/kibana/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/kibana/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/kibana/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/kibana/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/kibana/kibana_react.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/kibana/kibana_react.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/kibana/kibana_react.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/kibana/services.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/kibana/services.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/kibana/services.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/kibana/services.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/kuery/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/kuery/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/kuery/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/kuery/index.test.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/kuery/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/kuery/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/kuery/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/kuery/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/local_storage/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/local_storage/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/local_storage/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/local_storage/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/local_storage/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/local_storage/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/local_storage/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/local_storage/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/note/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/note/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/note/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/note/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/process_actions/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/process_actions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/process_actions/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/process_actions/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/constants.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/ai_assistant/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/ai_assistant/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/ai_assistant/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/ai_assistant/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/ai_assistant/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/ai_assistant/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/ai_assistant/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/ai_assistant/types.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/alerts_grouping/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/alerts_grouping/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/alerts_grouping/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/alerts_grouping/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/alerts_grouping/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/alerts_grouping/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/alerts_grouping/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/alerts_grouping/types.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/app/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/app/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/app/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/app/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/app/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/app/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/app/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/app/types.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/data_quality/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/data_quality/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/data_quality/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/data_quality/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/data_quality/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/data_quality/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/data_quality/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/data_quality/types.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/document_details/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/document_details/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/document_details/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/document_details/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/document_details/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/document_details/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/document_details/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/document_details/types.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/entity_analytics/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/entity_analytics/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/entity_analytics/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/entity_analytics/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/entity_analytics/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/entity_analytics/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/entity_analytics/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/entity_analytics/types.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/event_log/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/event_log/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/event_log/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/event_log/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/event_log/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/event_log/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/event_log/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/event_log/types.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/manual_rule_run/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/manual_rule_run/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/manual_rule_run/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/manual_rule_run/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/manual_rule_run/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/manual_rule_run/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/manual_rule_run/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/manual_rule_run/types.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/notes/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/notes/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/notes/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/notes/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/notes/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/notes/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/notes/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/notes/types.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/onboarding/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/onboarding/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/onboarding/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/onboarding/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/onboarding/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/onboarding/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/onboarding/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/onboarding/types.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/preview_rule/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/preview_rule/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/preview_rule/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/preview_rule/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/preview_rule/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/preview_rule/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/preview_rule/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/preview_rule/types.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/telemetry_events.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/telemetry_events.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/telemetry_events.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/telemetry_events.test.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/events/telemetry_events.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/telemetry_events.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/events/telemetry_events.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/telemetry_events.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/index.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/middleware.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/middleware.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/middleware.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/middleware.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/telemetry_service.mock.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/telemetry_service.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/telemetry_service.mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/telemetry_service.mock.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/telemetry_service.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/telemetry_service.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/telemetry_service.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/telemetry_service.test.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/telemetry_service.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/telemetry_service.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/telemetry_service.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/telemetry_service.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/track.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/track.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/track.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/track.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/trackers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/trackers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/trackers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/trackers.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/telemetry/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/telemetry/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/types.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/theme/use_eui_theme.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/lib/theme/use_eui_theme.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/theme/use_eui_theme.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/theme/use_eui_theme.tsx diff --git a/x-pack/plugins/security_solution/public/common/lib/triggers_actions_ui/alert_table_scope_config.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/triggers_actions_ui/alert_table_scope_config.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/triggers_actions_ui/alert_table_scope_config.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/triggers_actions_ui/alert_table_scope_config.test.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/triggers_actions_ui/alert_table_scope_config.ts b/x-pack/solutions/security/plugins/security_solution/public/common/lib/triggers_actions_ui/alert_table_scope_config.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/triggers_actions_ui/alert_table_scope_config.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/triggers_actions_ui/alert_table_scope_config.ts diff --git a/x-pack/plugins/security_solution/public/common/lib/triggers_actions_ui/register_alerts_table_configuration.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/lib/triggers_actions_ui/register_alerts_table_configuration.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/lib/triggers_actions_ui/register_alerts_table_configuration.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/lib/triggers_actions_ui/register_alerts_table_configuration.tsx diff --git a/x-pack/plugins/security_solution/public/common/links/deep_links.ts b/x-pack/solutions/security/plugins/security_solution/public/common/links/deep_links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/links/deep_links.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/links/deep_links.ts diff --git a/x-pack/plugins/security_solution/public/common/links/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/links/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/links/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/links/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/links/links.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/links/links.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/links/links.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/links/links.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/links/links.ts b/x-pack/solutions/security/plugins/security_solution/public/common/links/links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/links/links.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/links/links.ts diff --git a/x-pack/plugins/security_solution/public/common/links/nav_links.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/links/nav_links.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/links/nav_links.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/links/nav_links.test.ts diff --git a/x-pack/plugins/security_solution/public/common/links/nav_links.ts b/x-pack/solutions/security/plugins/security_solution/public/common/links/nav_links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/links/nav_links.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/links/nav_links.ts diff --git a/x-pack/plugins/security_solution/public/common/links/test_utils.ts b/x-pack/solutions/security/plugins/security_solution/public/common/links/test_utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/links/test_utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/links/test_utils.ts diff --git a/x-pack/plugins/security_solution/public/common/links/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/links/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts diff --git a/x-pack/plugins/security_solution/public/common/links/use_find_app_links_by_path.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/links/use_find_app_links_by_path.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/links/use_find_app_links_by_path.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/links/use_find_app_links_by_path.test.ts diff --git a/x-pack/plugins/security_solution/public/common/links/use_find_app_links_by_path.ts b/x-pack/solutions/security/plugins/security_solution/public/common/links/use_find_app_links_by_path.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/links/use_find_app_links_by_path.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/links/use_find_app_links_by_path.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/create_react_query_wrapper.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/mock/create_react_query_wrapper.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/create_react_query_wrapper.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/create_react_query_wrapper.tsx diff --git a/x-pack/plugins/security_solution/public/common/mock/create_store.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/create_store.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/create_store.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/create_store.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/endpoint/app_context_render.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/mock/endpoint/app_context_render.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/endpoint/app_context_render.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/endpoint/app_context_render.tsx diff --git a/x-pack/plugins/security_solution/public/common/mock/endpoint/app_root_provider.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/mock/endpoint/app_root_provider.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/endpoint/app_root_provider.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/endpoint/app_root_provider.tsx diff --git a/x-pack/plugins/security_solution/public/common/mock/endpoint/dependencies_start_mock.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/endpoint/dependencies_start_mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/endpoint/dependencies_start_mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/endpoint/dependencies_start_mock.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/endpoint/endpoint_alert_data_mock.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/endpoint/endpoint_alert_data_mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/endpoint/endpoint_alert_data_mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/endpoint/endpoint_alert_data_mock.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/endpoint/http_handler_mock_factory.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/endpoint/http_handler_mock_factory.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/endpoint/http_handler_mock_factory.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/endpoint/http_handler_mock_factory.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/endpoint/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/endpoint/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/endpoint/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/endpoint/index.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/expandable_flyout.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/mock/expandable_flyout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/expandable_flyout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/expandable_flyout.tsx diff --git a/x-pack/plugins/security_solution/public/common/mock/formatted_relative.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/formatted_relative.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/formatted_relative.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/formatted_relative.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/global_state.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/global_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/global_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/global_state.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/header.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/header.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/header.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/header.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/hook_wrapper.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/mock/hook_wrapper.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/hook_wrapper.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/hook_wrapper.tsx diff --git a/x-pack/plugins/security_solution/public/common/mock/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/index.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/index_pattern.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/index_pattern.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/index_pattern.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/index_pattern.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/intersection_observer_mock.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/intersection_observer_mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/intersection_observer_mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/intersection_observer_mock.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/mock_assistant_provider.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_assistant_provider.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/mock_assistant_provider.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_assistant_provider.tsx diff --git a/x-pack/plugins/security_solution/public/common/mock/mock_detail_item.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_detail_item.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/mock_detail_item.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_detail_item.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/mock_detection_alerts.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_detection_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/mock_detection_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_detection_alerts.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/mock_detection_alerts_aad.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_detection_alerts_aad.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/mock_detection_alerts_aad.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_detection_alerts_aad.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/mock_discover_state.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_discover_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/mock_discover_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_discover_state.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/mock_endgame_ecs_data.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_endgame_ecs_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/mock_endgame_ecs_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_endgame_ecs_data.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/mock_local_storage.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_local_storage.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/mock_local_storage.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_local_storage.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/mock_timeline_control_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_timeline_control_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/mock_timeline_control_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_timeline_control_columns.tsx diff --git a/x-pack/plugins/security_solution/public/common/mock/mock_timeline_data.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_timeline_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/mock_timeline_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_timeline_data.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/mock_timelines_plugin.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_timelines_plugin.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/mock_timelines_plugin.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_timelines_plugin.tsx diff --git a/x-pack/plugins/security_solution/public/common/mock/mock_triggers_actions_ui_plugin.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_triggers_actions_ui_plugin.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/mock_triggers_actions_ui_plugin.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/mock_triggers_actions_ui_plugin.tsx diff --git a/x-pack/plugins/security_solution/public/common/mock/netflow.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/netflow.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/netflow.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/netflow.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/news.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/news.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/news.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/news.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/raw_news.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/raw_news.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/raw_news.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/raw_news.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/react_beautiful_dnd.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/react_beautiful_dnd.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/react_beautiful_dnd.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/react_beautiful_dnd.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/router.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/mock/router.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/router.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/router.tsx diff --git a/x-pack/plugins/security_solution/public/common/mock/storybook_providers.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/mock/storybook_providers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/storybook_providers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/storybook_providers.tsx diff --git a/x-pack/plugins/security_solution/public/common/mock/test_providers.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/mock/test_providers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/test_providers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/test_providers.tsx diff --git a/x-pack/plugins/security_solution/public/common/mock/timeline_results.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/timeline_results.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/timeline_results.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/timeline_results.ts diff --git a/x-pack/plugins/security_solution/public/common/mock/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/common/mock/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/mock/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/mock/utils.ts diff --git a/x-pack/plugins/security_solution/public/common/store/actions.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/actions.ts diff --git a/x-pack/plugins/security_solution/public/common/store/app/actions.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/app/actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/app/actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/app/actions.ts diff --git a/x-pack/plugins/security_solution/public/common/store/app/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/app/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/app/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/app/index.ts diff --git a/x-pack/plugins/security_solution/public/common/store/app/model.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/app/model.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/app/model.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/app/model.ts diff --git a/x-pack/plugins/security_solution/public/common/store/app/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/app/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/app/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/app/reducer.ts diff --git a/x-pack/plugins/security_solution/public/common/store/app/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/app/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/app/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/app/selectors.ts diff --git a/x-pack/plugins/security_solution/public/common/store/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/constants.ts diff --git a/x-pack/plugins/security_solution/public/common/store/data_table/middleware_local_storage.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/data_table/middleware_local_storage.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/data_table/middleware_local_storage.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/data_table/middleware_local_storage.ts diff --git a/x-pack/plugins/security_solution/public/common/store/data_table/middlware_local_storage.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/data_table/middlware_local_storage.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/data_table/middlware_local_storage.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/data_table/middlware_local_storage.test.ts diff --git a/x-pack/plugins/security_solution/public/common/store/discover/actions.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/discover/actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/discover/actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/discover/actions.ts diff --git a/x-pack/plugins/security_solution/public/common/store/discover/model.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/discover/model.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/discover/model.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/discover/model.ts diff --git a/x-pack/plugins/security_solution/public/common/store/discover/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/discover/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/discover/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/discover/reducer.ts diff --git a/x-pack/plugins/security_solution/public/common/store/discover/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/discover/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/discover/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/discover/selectors.ts diff --git a/x-pack/plugins/security_solution/public/common/store/drag_and_drop/actions.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/drag_and_drop/actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/drag_and_drop/actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/drag_and_drop/actions.ts diff --git a/x-pack/plugins/security_solution/public/common/store/drag_and_drop/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/drag_and_drop/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/drag_and_drop/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/drag_and_drop/index.ts diff --git a/x-pack/plugins/security_solution/public/common/store/drag_and_drop/model.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/drag_and_drop/model.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/drag_and_drop/model.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/drag_and_drop/model.ts diff --git a/x-pack/plugins/security_solution/public/common/store/drag_and_drop/reducer.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/drag_and_drop/reducer.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/drag_and_drop/reducer.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/drag_and_drop/reducer.test.ts diff --git a/x-pack/plugins/security_solution/public/common/store/drag_and_drop/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/drag_and_drop/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/drag_and_drop/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/drag_and_drop/reducer.ts diff --git a/x-pack/plugins/security_solution/public/common/store/drag_and_drop/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/drag_and_drop/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/drag_and_drop/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/drag_and_drop/selectors.ts diff --git a/x-pack/plugins/security_solution/public/common/store/global_url_param/actions.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/global_url_param/actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/global_url_param/actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/global_url_param/actions.ts diff --git a/x-pack/plugins/security_solution/public/common/store/global_url_param/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/global_url_param/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/global_url_param/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/global_url_param/index.ts diff --git a/x-pack/plugins/security_solution/public/common/store/global_url_param/reducer.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/global_url_param/reducer.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/global_url_param/reducer.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/global_url_param/reducer.test.ts diff --git a/x-pack/plugins/security_solution/public/common/store/global_url_param/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/global_url_param/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/global_url_param/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/global_url_param/reducer.ts diff --git a/x-pack/plugins/security_solution/public/common/store/global_url_param/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/global_url_param/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/global_url_param/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/global_url_param/selectors.ts diff --git a/x-pack/plugins/security_solution/public/common/store/grouping/actions.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/grouping/actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/grouping/actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/grouping/actions.ts diff --git a/x-pack/plugins/security_solution/public/common/store/grouping/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/grouping/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/grouping/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/grouping/index.ts diff --git a/x-pack/plugins/security_solution/public/common/store/grouping/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/grouping/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/grouping/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/grouping/reducer.ts diff --git a/x-pack/plugins/security_solution/public/common/store/grouping/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/grouping/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/grouping/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/grouping/selectors.ts diff --git a/x-pack/plugins/security_solution/public/common/store/grouping/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/grouping/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/grouping/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/grouping/types.ts diff --git a/x-pack/plugins/security_solution/public/common/store/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/index.ts diff --git a/x-pack/plugins/security_solution/public/common/store/inputs/actions.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/inputs/actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/inputs/actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/inputs/actions.ts diff --git a/x-pack/plugins/security_solution/public/common/store/inputs/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/inputs/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/inputs/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/inputs/constants.ts diff --git a/x-pack/plugins/security_solution/public/common/store/inputs/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/inputs/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/inputs/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/inputs/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/common/store/inputs/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/inputs/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/inputs/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/inputs/helpers.ts diff --git a/x-pack/plugins/security_solution/public/common/store/inputs/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/inputs/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/inputs/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/inputs/index.ts diff --git a/x-pack/plugins/security_solution/public/common/store/inputs/model.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/inputs/model.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/inputs/model.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/inputs/model.ts diff --git a/x-pack/plugins/security_solution/public/common/store/inputs/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/inputs/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/inputs/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/inputs/reducer.ts diff --git a/x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/inputs/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/inputs/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/inputs/selectors.ts diff --git a/x-pack/plugins/security_solution/public/common/store/middlewares.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/middlewares.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/middlewares.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/middlewares.ts diff --git a/x-pack/plugins/security_solution/public/common/store/model.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/model.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/model.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/model.ts diff --git a/x-pack/plugins/security_solution/public/common/store/reducer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/store/reducer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/reducer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/store/reducer.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/store/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/reducer.ts diff --git a/x-pack/plugins/security_solution/public/common/store/routing/action.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/routing/action.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/routing/action.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/routing/action.ts diff --git a/x-pack/plugins/security_solution/public/common/store/routing/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/routing/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/routing/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/routing/index.ts diff --git a/x-pack/plugins/security_solution/public/common/store/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/selectors.ts diff --git a/x-pack/plugins/security_solution/public/common/store/store.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/store.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/store.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/store.ts diff --git a/x-pack/plugins/security_solution/public/common/store/test_utils.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/test_utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/test_utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/test_utils.ts diff --git a/x-pack/plugins/security_solution/public/common/store/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/store/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/store/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/store/types.ts diff --git a/x-pack/plugins/security_solution/public/common/test/eui/combobox.ts b/x-pack/solutions/security/plugins/security_solution/public/common/test/eui/combobox.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/test/eui/combobox.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/test/eui/combobox.ts diff --git a/x-pack/plugins/security_solution/public/common/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/types.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/__mocks__/normalize_time_range.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/__mocks__/normalize_time_range.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/__mocks__/normalize_time_range.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/__mocks__/normalize_time_range.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/alerts.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/utils/alerts.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/alerts.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/alerts.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/utils/alerts.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/alerts.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/alerts.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/clone_http_fetch_query.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/clone_http_fetch_query.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/clone_http_fetch_query.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/clone_http_fetch_query.test.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/clone_http_fetch_query.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/clone_http_fetch_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/clone_http_fetch_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/clone_http_fetch_query.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/common/utils/date_math.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/date_math.ts new file mode 100644 index 0000000000000..28dbe15955a27 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/common/utils/date_math.ts @@ -0,0 +1,29 @@ +/* + * 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. + */ + +/** + * Converts a date math string to a duration string by removing the 'now-' prefix. + * + * @param historyStart - Date math string to convert. For example, "now-30d". + * @returns Resulting duration string. For example, "30d". + */ +export const convertDateMathToDuration = (dateMathString: string): string => { + if (dateMathString.startsWith('now-')) { + return dateMathString.substring(4); + } + + return dateMathString; +}; + +/** + * Converts a duration string to a dateMath string by adding the 'now-' prefix. + * + * @param durationString - Duration string to convert. For example, "30d". + * @returns Resulting date math string. For example, "now-30d". + */ +export const convertDurationToDateMath = (durationString: string): string => + `now-${durationString}`; diff --git a/x-pack/plugins/security_solution/public/common/utils/default_date_settings.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/default_date_settings.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/default_date_settings.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/default_date_settings.test.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/default_date_settings.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/default_date_settings.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/default_date_settings.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/default_date_settings.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/download_blob.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/download_blob.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/download_blob.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/download_blob.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/exception_list_items/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/exception_list_items/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/exception_list_items/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/exception_list_items/index.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/exception_list_items/mappers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/exception_list_items/mappers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/exception_list_items/mappers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/exception_list_items/mappers.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/exceptions/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/exceptions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/exceptions/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/exceptions/index.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/get_mapped_non_ecs_value.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/get_mapped_non_ecs_value.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/get_mapped_non_ecs_value.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/get_mapped_non_ecs_value.test.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/get_mapped_non_ecs_value.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/get_mapped_non_ecs_value.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/get_mapped_non_ecs_value.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/get_mapped_non_ecs_value.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/get_time_range.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/get_time_range.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/get_time_range.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/get_time_range.test.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/get_time_range.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/get_time_range.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/get_time_range.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/get_time_range.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/global_query_string/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/utils/global_query_string/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/global_query_string/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/global_query_string/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/utils/global_query_string/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/global_query_string/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/global_query_string/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/global_query_string/helpers.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/global_query_string/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/utils/global_query_string/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/global_query_string/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/global_query_string/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/utils/global_query_string/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/global_query_string/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/global_query_string/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/global_query_string/index.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/lens.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/lens.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/lens.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/lens.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/logo_endpoint/64_color.svg b/x-pack/solutions/security/plugins/security_solution/public/common/utils/logo_endpoint/64_color.svg similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/logo_endpoint/64_color.svg rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/logo_endpoint/64_color.svg diff --git a/x-pack/plugins/security_solution/public/common/utils/normalize_time_range.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/normalize_time_range.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/normalize_time_range.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/normalize_time_range.test.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/normalize_time_range.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/normalize_time_range.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/normalize_time_range.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/normalize_time_range.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/privileges/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/privileges/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/privileges/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/privileges/index.test.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/privileges/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/privileges/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/privileges/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/privileges/index.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/resolve_path_variables.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/resolve_path_variables.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/resolve_path_variables.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/resolve_path_variables.test.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/resolve_path_variables.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/resolve_path_variables.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/resolve_path_variables.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/resolve_path_variables.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/route/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/route/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/route/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/route/helpers.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/route/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/utils/route/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/route/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/route/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/utils/route/manage_spy_routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/utils/route/manage_spy_routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/route/manage_spy_routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/route/manage_spy_routes.tsx diff --git a/x-pack/plugins/security_solution/public/common/utils/route/mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/route/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/route/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/route/mocks.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/route/spy_routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/utils/route/spy_routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/route/spy_routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/route/spy_routes.tsx diff --git a/x-pack/plugins/security_solution/public/common/utils/route/types.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/route/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/route/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/route/types.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/route/use_route_spy.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/utils/route/use_route_spy.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/route/use_route_spy.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/route/use_route_spy.tsx diff --git a/x-pack/plugins/security_solution/public/common/utils/saved_query_services/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/utils/saved_query_services/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/saved_query_services/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/saved_query_services/index.tsx diff --git a/x-pack/plugins/security_solution/public/common/utils/shorten_count_into_string.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/shorten_count_into_string.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/shorten_count_into_string.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/shorten_count_into_string.test.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/shorten_count_into_string.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/shorten_count_into_string.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/shorten_count_into_string.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/shorten_count_into_string.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/timeline/use_show_timeline.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/utils/timeline/use_show_timeline.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/timeline/use_show_timeline.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/timeline/use_show_timeline.test.tsx diff --git a/x-pack/plugins/security_solution/public/common/utils/timeline/use_show_timeline.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/utils/timeline/use_show_timeline.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/timeline/use_show_timeline.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/timeline/use_show_timeline.tsx diff --git a/x-pack/plugins/security_solution/public/common/utils/timeline/use_show_timeline_for_path.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/timeline/use_show_timeline_for_path.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/timeline/use_show_timeline_for_path.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/timeline/use_show_timeline_for_path.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/timeline/use_timeline_click.tsx b/x-pack/solutions/security/plugins/security_solution/public/common/utils/timeline/use_timeline_click.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/timeline/use_timeline_click.tsx rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/timeline/use_timeline_click.tsx diff --git a/x-pack/plugins/security_solution/public/common/utils/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/translations.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/use_mount_appended.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/use_mount_appended.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/use_mount_appended.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/use_mount_appended.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/validators/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/validators/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/validators/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/validators/index.test.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/validators/index.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/validators/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/validators/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/validators/index.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/validators/is_endpoint_host_isolated.test.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/validators/is_endpoint_host_isolated.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/validators/is_endpoint_host_isolated.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/validators/is_endpoint_host_isolated.test.ts diff --git a/x-pack/plugins/security_solution/public/common/utils/validators/is_endpoint_host_isolated.ts b/x-pack/solutions/security/plugins/security_solution/public/common/utils/validators/is_endpoint_host_isolated.ts similarity index 100% rename from x-pack/plugins/security_solution/public/common/utils/validators/is_endpoint_host_isolated.ts rename to x-pack/solutions/security/plugins/security_solution/public/common/utils/validators/is_endpoint_host_isolated.ts diff --git a/x-pack/plugins/security_solution/public/contract_components.ts b/x-pack/solutions/security/plugins/security_solution/public/contract_components.ts similarity index 100% rename from x-pack/plugins/security_solution/public/contract_components.ts rename to x-pack/solutions/security/plugins/security_solution/public/contract_components.ts diff --git a/x-pack/plugins/security_solution/public/dashboards/components/dashboard_renderer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/components/dashboard_renderer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/components/dashboard_renderer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/components/dashboard_renderer.test.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/components/dashboard_renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/components/dashboard_renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/components/dashboard_renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/components/dashboard_renderer.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/components/dashboard_title.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/components/dashboard_title.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/components/dashboard_title.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/components/dashboard_title.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/components/dashboard_tool_bar.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/components/dashboard_tool_bar.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/components/dashboard_tool_bar.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/components/dashboard_tool_bar.test.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/components/dashboard_tool_bar.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/components/dashboard_tool_bar.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/components/dashboard_tool_bar.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/components/dashboard_tool_bar.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/components/dashboards_table.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/components/dashboards_table.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/components/dashboards_table.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/components/dashboards_table.test.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/components/dashboards_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/components/dashboards_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/components/dashboards_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/components/dashboards_table.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/components/status_prompt.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/components/status_prompt.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/components/status_prompt.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/components/status_prompt.test.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/components/status_prompt.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/components/status_prompt.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/components/status_prompt.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/components/status_prompt.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/containers/use_fetch_security_dashboards.test.ts b/x-pack/solutions/security/plugins/security_solution/public/dashboards/containers/use_fetch_security_dashboards.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/containers/use_fetch_security_dashboards.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/containers/use_fetch_security_dashboards.test.ts diff --git a/x-pack/plugins/security_solution/public/dashboards/containers/use_fetch_security_dashboards.ts b/x-pack/solutions/security/plugins/security_solution/public/dashboards/containers/use_fetch_security_dashboards.ts similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/containers/use_fetch_security_dashboards.ts rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/containers/use_fetch_security_dashboards.ts diff --git a/x-pack/plugins/security_solution/public/dashboards/containers/use_fetch_security_tags.test.ts b/x-pack/solutions/security/plugins/security_solution/public/dashboards/containers/use_fetch_security_tags.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/containers/use_fetch_security_tags.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/containers/use_fetch_security_tags.test.ts diff --git a/x-pack/plugins/security_solution/public/dashboards/containers/use_fetch_security_tags.ts b/x-pack/solutions/security/plugins/security_solution/public/dashboards/containers/use_fetch_security_tags.ts similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/containers/use_fetch_security_tags.ts rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/containers/use_fetch_security_tags.ts diff --git a/x-pack/plugins/security_solution/public/dashboards/context/dashboard_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/context/dashboard_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/context/dashboard_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/context/dashboard_context.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/hooks/use_create_security_dashboard_link.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/hooks/use_create_security_dashboard_link.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/hooks/use_create_security_dashboard_link.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/hooks/use_create_security_dashboard_link.test.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/hooks/use_create_security_dashboard_link.ts b/x-pack/solutions/security/plugins/security_solution/public/dashboards/hooks/use_create_security_dashboard_link.ts similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/hooks/use_create_security_dashboard_link.ts rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/hooks/use_create_security_dashboard_link.ts diff --git a/x-pack/plugins/security_solution/public/dashboards/hooks/use_dashboard_renderer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/hooks/use_dashboard_renderer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/hooks/use_dashboard_renderer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/hooks/use_dashboard_renderer.test.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/hooks/use_dashboard_renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/hooks/use_dashboard_renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/hooks/use_dashboard_renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/hooks/use_dashboard_renderer.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/hooks/use_dashboard_view_prompt_state.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/hooks/use_dashboard_view_prompt_state.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/hooks/use_dashboard_view_prompt_state.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/hooks/use_dashboard_view_prompt_state.test.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/hooks/use_dashboard_view_prompt_state.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/hooks/use_dashboard_view_prompt_state.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/hooks/use_dashboard_view_prompt_state.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/hooks/use_dashboard_view_prompt_state.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/hooks/use_security_dashboards_table.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/hooks/use_security_dashboards_table.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/hooks/use_security_dashboards_table.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/hooks/use_security_dashboards_table.test.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/hooks/use_security_dashboards_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/hooks/use_security_dashboards_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/hooks/use_security_dashboards_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/hooks/use_security_dashboards_table.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/index.ts b/x-pack/solutions/security/plugins/security_solution/public/dashboards/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/dashboards/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/dashboards/jest.config.js new file mode 100644 index 0000000000000..05eaceea239be --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/dashboards/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/dashboards'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/dashboards', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/dashboards/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/dashboards/links.ts b/x-pack/solutions/security/plugins/security_solution/public/dashboards/links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/links.ts rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/links.ts diff --git a/x-pack/plugins/security_solution/public/dashboards/pages/breadcrumbs.ts b/x-pack/solutions/security/plugins/security_solution/public/dashboards/pages/breadcrumbs.ts similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/pages/breadcrumbs.ts rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/pages/breadcrumbs.ts diff --git a/x-pack/plugins/security_solution/public/dashboards/pages/details/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/pages/details/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/pages/details/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/pages/details/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/pages/details/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/pages/details/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/pages/details/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/pages/details/index.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/pages/details/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/dashboards/pages/details/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/pages/details/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/pages/details/translations.ts diff --git a/x-pack/plugins/security_solution/public/dashboards/pages/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/pages/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/pages/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/pages/index.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/pages/landing_page/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/pages/landing_page/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/pages/landing_page/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/pages/landing_page/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/pages/landing_page/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/pages/landing_page/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/pages/landing_page/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/pages/landing_page/index.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/pages/landing_page/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/dashboards/pages/landing_page/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/pages/landing_page/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/pages/landing_page/translations.ts diff --git a/x-pack/plugins/security_solution/public/dashboards/pages/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/dashboards/pages/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/pages/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/pages/translations.ts diff --git a/x-pack/plugins/security_solution/public/dashboards/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/dashboards/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/routes.tsx diff --git a/x-pack/plugins/security_solution/public/dashboards/types.ts b/x-pack/solutions/security/plugins/security_solution/public/dashboards/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/dashboards/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/dashboards/types.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/endpoint_exceptions/endpoint_exceptions_viewer.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/endpoint_exceptions/endpoint_exceptions_viewer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/endpoint_exceptions/endpoint_exceptions_viewer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/endpoint_exceptions/endpoint_exceptions_viewer.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/endpoint_exceptions/use_get_endpoint_exceptions_unavailablle_component.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/endpoint_exceptions/use_get_endpoint_exceptions_unavailablle_component.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/endpoint_exceptions/use_get_endpoint_exceptions_unavailablle_component.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/endpoint_exceptions/use_get_endpoint_exceptions_unavailablle_component.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/fleet_integrations/api/__mocks__/api_client.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/fleet_integrations/api/__mocks__/api_client.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/fleet_integrations/api/__mocks__/api_client.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/fleet_integrations/api/__mocks__/api_client.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/fleet_integrations/api/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/fleet_integrations/api/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/fleet_integrations/api/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/fleet_integrations/api/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/fleet_integrations/api/api_client.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/fleet_integrations/api/api_client.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/fleet_integrations/api/api_client.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/fleet_integrations/api/api_client.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/fleet_integrations/api/api_client_interface.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/fleet_integrations/api/api_client_interface.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/fleet_integrations/api/api_client_interface.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/fleet_integrations/api/api_client_interface.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/fleet_integrations/api/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/fleet_integrations/api/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/fleet_integrations/api/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/fleet_integrations/api/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/fleet_integrations/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/fleet_integrations/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/fleet_integrations/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/fleet_integrations/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/jest.config.js new file mode 100644 index 0000000000000..0b7587837fd30 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/detection_engine'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/detection_engine', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/detection_engine/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/alert_suppression_edit.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/alert_suppression_edit.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/alert_suppression_edit.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/alert_suppression_edit.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/missing_fields_strategy_selector.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/missing_fields_strategy_selector.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/missing_fields_strategy_selector.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/missing_fields_strategy_selector.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/suppression_duration_selector.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/suppression_duration_selector.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/suppression_duration_selector.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/suppression_duration_selector.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/suppression_fields_selector.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/suppression_fields_selector.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/suppression_fields_selector.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/suppression_fields_selector.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/suppression_info_icon.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/suppression_info_icon.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/suppression_info_icon.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/suppression_info_icon.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/components/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/constants/default_duration.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/constants/default_duration.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/constants/default_duration.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/constants/default_duration.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/constants/fields.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/constants/fields.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/constants/fields.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/constants/fields.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/test_helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/test_helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/test_helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/alert_suppression_edit/test_helpers.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/duration_input/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/duration_input/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/duration_input/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/duration_input/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/duration_input/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/duration_input/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/duration_input/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/duration_input/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/eql_overview_link.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/eql_overview_link.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/eql_overview_link.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/eql_overview_link.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/eql_query_bar.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/eql_query_bar.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/eql_query_bar.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/eql_query_bar.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/eql_query_bar.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/eql_query_bar.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/eql_query_bar.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/eql_query_bar.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/eql_query_edit.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/eql_query_edit.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/eql_query_edit.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/eql_query_edit.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/errors_popover.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/errors_popover.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/errors_popover.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/errors_popover.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/errors_popover.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/errors_popover.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/errors_popover.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/errors_popover.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/footer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/footer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/footer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/footer.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/footer.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/footer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/footer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/footer.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/validators.mock.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/validators.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/validators.mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/validators.mock.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/validators/eql_query_validator_factory.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/validators/eql_query_validator_factory.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/validators/eql_query_validator_factory.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/eql_query_edit/validators/eql_query_validator_factory.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/esql_info_icon.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/esql_info_icon.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/esql_info_icon.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/esql_info_icon.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/esql_query_edit.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/esql_query_edit.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/esql_query_edit.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/esql_query_edit.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/validators/error_codes.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/validators/error_codes.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/validators/error_codes.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/validators/error_codes.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/validators/esql_query_required_validator.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/validators/esql_query_required_validator.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/validators/esql_query_required_validator.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/validators/esql_query_required_validator.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/validators/esql_query_validator_factory.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/validators/esql_query_validator_factory.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/validators/esql_query_validator_factory.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/validators/esql_query_validator_factory.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/validators/esql_query_validator_factory.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/validators/esql_query_validator_factory.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/validators/esql_query_validator_factory.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/validators/esql_query_validator_factory.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/validators/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/validators/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/validators/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/esql_query_edit/validators/translations.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/history_window_start_edit/history_window_start_edit.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/history_window_start_edit/history_window_start_edit.tsx new file mode 100644 index 0000000000000..c876fe926ce4f --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/history_window_start_edit/history_window_start_edit.tsx @@ -0,0 +1,44 @@ +/* + * 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 { ScheduleItemField } from '../schedule_item_field'; +import { type FieldConfig, UseField } from '../../../../shared_imports'; +import { type HistoryWindowStart } from '../../../../../common/api/detection_engine'; +import * as i18n from './translations'; +import { validateHistoryWindowStart } from './validate_history_window_start'; + +const COMPONENT_PROPS = { + idAria: 'historyWindowSize', + dataTestSubj: 'historyWindowSize', + timeTypes: ['m', 'h', 'd'], +}; + +interface HistoryWindowStartEditProps { + path: string; +} + +export function HistoryWindowStartEdit({ path }: HistoryWindowStartEditProps): JSX.Element { + return ( + <UseField + path={path} + config={HISTORY_WINDOW_START_FIELD_CONFIG} + component={ScheduleItemField} + componentProps={COMPONENT_PROPS} + /> + ); +} + +const HISTORY_WINDOW_START_FIELD_CONFIG: FieldConfig<HistoryWindowStart> = { + label: i18n.HISTORY_WINDOW_START_LABEL, + helpText: i18n.HELP_TEXT, + validations: [ + { + validator: validateHistoryWindowStart, + }, + ], +}; diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/history_window_start_edit/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/history_window_start_edit/index.tsx new file mode 100644 index 0000000000000..a904f5d427710 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/history_window_start_edit/index.tsx @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export { HistoryWindowStartEdit } from './history_window_start_edit'; diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/history_window_start_edit/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/history_window_start_edit/translations.ts new file mode 100644 index 0000000000000..75ff11fe5e1b6 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/history_window_start_edit/translations.ts @@ -0,0 +1,36 @@ +/* + * 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'; + +export const HISTORY_WINDOW_START_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.historyWindowSizeLabel', + { + defaultMessage: 'History Window Size', + } +); + +export const HELP_TEXT = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.historyWindowSizeHelpText', + { + defaultMessage: "New terms rules only alert if terms don't appear in historical data.", + } +); + +export const MUST_BE_POSITIVE_INTEGER_VALIDATION_ERROR = i18n.translate( + 'xpack.securitySolution.detectionEngine.validations.stepDefineRule.historyWindowSize.errNumber', + { + defaultMessage: 'History window size must be a positive number.', + } +); + +export const MUST_BE_GREATER_THAN_ZERO_VALIDATION_ERROR = i18n.translate( + 'xpack.securitySolution.detectionEngine.validations.stepDefineRule.historyWindowSize.errMin', + { + defaultMessage: 'History window size must be greater than 0.', + } +); diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/history_window_start_edit/validate_history_window_start.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/history_window_start_edit/validate_history_window_start.ts new file mode 100644 index 0000000000000..4e274683ad08b --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/history_window_start_edit/validate_history_window_start.ts @@ -0,0 +1,31 @@ +/* + * 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 ValidationFunc } from '../../../../shared_imports'; +import * as i18n from './translations'; + +export function validateHistoryWindowStart(...args: Parameters<ValidationFunc>) { + const [{ path, value }] = args; + + const historyWindowSize = Number.parseInt(String(value), 10); + + if (Number.isNaN(historyWindowSize)) { + return { + code: 'ERR_NOT_INT_NUMBER', + path, + message: i18n.MUST_BE_POSITIVE_INTEGER_VALIDATION_ERROR, + }; + } + + if (historyWindowSize <= 0) { + return { + code: 'ERR_MIN_LENGTH', + path, + message: i18n.MUST_BE_GREATER_THAN_ZERO_VALIDATION_ERROR, + }; + } +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_audit_icon/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_audit_icon/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_audit_icon/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_audit_icon/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_audit_icon/ml_audit_icon.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_audit_icon/ml_audit_icon.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_audit_icon/ml_audit_icon.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_audit_icon/ml_audit_icon.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_audit_icon/ml_audit_icon.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_audit_icon/ml_audit_icon.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_audit_icon/ml_audit_icon.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_audit_icon/ml_audit_icon.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_link/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_link/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_link/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_link/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_link/ml_job_link.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_link/ml_job_link.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_link/ml_job_link.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_link/ml_job_link.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_link/ml_job_link.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_link/ml_job_link.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_link/ml_job_link.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_link/ml_job_link.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_select/help_text.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_select/help_text.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_select/help_text.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_select/help_text.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_select/help_text.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_select/help_text.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_select/help_text.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_select/help_text.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_select/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_select/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_select/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_select/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_select/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_select/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_select/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_select/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_select/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_select/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_select/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_select/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_status_badge/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_status_badge/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_status_badge/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_status_badge/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_status_badge/ml_job_status_badge.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_status_badge/ml_job_status_badge.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_status_badge/ml_job_status_badge.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_status_badge/ml_job_status_badge.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_status_badge/ml_job_status_badge.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_status_badge/ml_job_status_badge.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_status_badge/ml_job_status_badge.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_status_badge/ml_job_status_badge.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_status_badge/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_status_badge/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_status_badge/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_job_status_badge/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/admin/ml_admin_job_description.integration.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/admin/ml_admin_job_description.integration.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/admin/ml_admin_job_description.integration.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/admin/ml_admin_job_description.integration.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/admin/ml_admin_job_description.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/admin/ml_admin_job_description.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/admin/ml_admin_job_description.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/admin/ml_admin_job_description.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/admin/ml_admin_jobs_description.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/admin/ml_admin_jobs_description.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/admin/ml_admin_jobs_description.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/admin/ml_admin_jobs_description.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/admin/ml_admin_jobs_description.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/admin/ml_admin_jobs_description.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/admin/ml_admin_jobs_description.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/admin/ml_admin_jobs_description.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/ml_job_item.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/ml_job_item.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/ml_job_item.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/ml_job_item.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/ml_jobs_description.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/ml_jobs_description.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/ml_jobs_description.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/ml_jobs_description.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/ml_jobs_description.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/ml_jobs_description.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/ml_jobs_description.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/ml_jobs_description.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/user/ml_user_job_description.integration.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/user/ml_user_job_description.integration.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/user/ml_user_job_description.integration.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/user/ml_user_job_description.integration.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/user/ml_user_job_description.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/user/ml_user_job_description.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/user/ml_user_job_description.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/user/ml_user_job_description.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/user/ml_user_jobs_description.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/user/ml_user_jobs_description.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/user/ml_user_jobs_description.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/user/ml_user_jobs_description.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/user/ml_user_jobs_description.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/user/ml_user_jobs_description.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/user/ml_user_jobs_description.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/ml_jobs_description/user/ml_user_jobs_description.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/new_terms_fields_edit/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/new_terms_fields_edit/index.tsx new file mode 100644 index 0000000000000..22c3c9e9047c0 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/new_terms_fields_edit/index.tsx @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export { NewTermsFieldsEdit } from './new_terms_fields_edit'; diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/new_terms_fields_edit/new_terms_fields_edit.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/new_terms_fields_edit/new_terms_fields_edit.tsx new file mode 100644 index 0000000000000..f50c62ed8f7a0 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/new_terms_fields_edit/new_terms_fields_edit.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, { memo } from 'react'; +import { UseField, fieldValidators } from '../../../../shared_imports'; +import { NewTermsFieldsField } from './new_terms_fields_field'; +import * as i18n from './translations'; + +interface NewTermsFieldsEditProps { + path: string; + fieldNames: string[]; +} + +export const NewTermsFieldsEdit = memo(function NewTermsFieldsEdit({ + path, + fieldNames, +}: NewTermsFieldsEditProps): JSX.Element { + return ( + <UseField + path={path} + config={NEW_TERMS_FIELDS_CONFIG} + component={NewTermsFieldsField} + componentProps={{ fieldNames }} + /> + ); +}); + +const NEW_TERMS_FIELDS_CONFIG = { + label: i18n.NEW_TERMS_FIELDS_LABEL, + helpText: i18n.HELP_TEXT, + validations: [ + { + validator: fieldValidators.emptyField(i18n.MIN_FIELDS_COUNT_VALIDATION_ERROR), + }, + { + validator: fieldValidators.maxLengthField(i18n.MAX_FIELDS_COUNT_VALIDATION_ERROR), + }, + ], +}; diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/new_terms_fields_edit/new_terms_fields_field.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/new_terms_fields_edit/new_terms_fields_field.tsx new file mode 100644 index 0000000000000..a9c1148402f12 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/new_terms_fields_edit/new_terms_fields_field.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 React, { memo } from 'react'; + +import type { DataViewFieldBase } from '@kbn/es-query'; +import { ComboBoxField } from '@kbn/es-ui-shared-plugin/static/forms/components'; +import type { FieldHook } from '../../../../shared_imports'; +import { PLACEHOLDER } from './translations'; + +interface NewTermsFieldsProps { + fieldNames: DataViewFieldBase[]; + field: FieldHook; +} + +const FIELD_COMBO_BOX_WIDTH = 410; + +const fieldDescribedByIds = 'newTermsFieldEdit'; + +export const NewTermsFieldsField = memo(function NewTermsFieldsField({ + fieldNames, + field, +}: NewTermsFieldsProps): JSX.Element { + const fieldEuiFieldProps = { + fullWidth: true, + noSuggestions: false, + options: fieldNames.map((name) => ({ label: name })), + placeholder: PLACEHOLDER, + onCreateOption: undefined, + style: { width: `${FIELD_COMBO_BOX_WIDTH}px` }, + }; + + return ( + <ComboBoxField field={field} idAria={fieldDescribedByIds} euiFieldProps={fieldEuiFieldProps} /> + ); +}); diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/new_terms_fields_edit/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/new_terms_fields_edit/translations.ts new file mode 100644 index 0000000000000..4eb18b9a318e0 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/new_terms_fields_edit/translations.ts @@ -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 { i18n } from '@kbn/i18n'; +import { MAX_NUMBER_OF_NEW_TERMS_FIELDS } from '../../../../../common/constants'; + +export const NEW_TERMS_FIELDS_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.newTermsFieldsLabel', + { + defaultMessage: 'Fields', + } +); + +export const PLACEHOLDER = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.newTermsField.placeholderText', + { + defaultMessage: 'Select a field', + } +); + +export const HELP_TEXT = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.fieldNewTermsFieldHelpText', + { + defaultMessage: 'Select a field to check for new terms.', + } +); + +export const MIN_FIELDS_COUNT_VALIDATION_ERROR = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.newTermsField.minFieldsCountError', + { + defaultMessage: 'A minimum of one field is required.', + } +); + +export const MAX_FIELDS_COUNT_VALIDATION_ERROR = { + length: MAX_NUMBER_OF_NEW_TERMS_FIELDS, + message: i18n.translate( + 'xpack.securitySolution.detectionEngine.validations.stepDefineRule.newTermsField.maxFieldsCountError', + { + defaultMessage: 'Number of fields must be 3 or less.', + } + ), +}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/pick_timeline/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/pick_timeline/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/pick_timeline/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/pick_timeline/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/pick_timeline/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/pick_timeline/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/pick_timeline/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/pick_timeline/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/default_related_integration.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/default_related_integration.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/default_related_integration.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/default_related_integration.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/integration_status_badge.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/integration_status_badge.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/integration_status_badge.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/integration_status_badge.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/related_integration_field.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/related_integration_field.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/related_integration_field.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/related_integration_field.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/related_integration_field_row.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/related_integration_field_row.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/related_integration_field_row.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/related_integration_field_row.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/related_integrations.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/related_integrations.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/related_integrations.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/related_integrations.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/related_integrations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/related_integrations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/related_integrations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/related_integrations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/related_integrations_help_info.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/related_integrations_help_info.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/related_integrations_help_info.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/related_integrations_help_info.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/test_helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/test_helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/test_helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/test_helpers.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/validate_related_integration.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/validate_related_integration.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/validate_related_integration.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/validate_related_integration.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/validate_related_integration.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/validate_related_integration.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/validate_related_integration.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/related_integrations/validate_related_integration.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/make_validate_required_field.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/make_validate_required_field.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/make_validate_required_field.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/make_validate_required_field.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/name_combobox.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/name_combobox.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/name_combobox.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/name_combobox.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/required_fields.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/required_fields.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/required_fields.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/required_fields.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/required_fields.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/required_fields.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/required_fields.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/required_fields.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/required_fields_help_info.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/required_fields_help_info.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/required_fields_help_info.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/required_fields_help_info.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/required_fields_row.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/required_fields_row.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/required_fields_row.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/required_fields_row.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/type_combobox.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/type_combobox.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/type_combobox.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/type_combobox.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/utils.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/utils.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/utils.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/utils.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/required_fields/utils.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/rule_actions_field/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/rule_actions_field/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/rule_actions_field/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/rule_actions_field/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/rule_actions_field/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/rule_actions_field/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/rule_actions_field/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/rule_actions_field/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/rule_actions_field/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/rule_actions_field/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/rule_actions_field/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/rule_actions_field/translations.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_field/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_field/index.ts new file mode 100644 index 0000000000000..f2458bbb5a4e1 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_field/index.ts @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export { ScheduleItemField } from './schedule_item_field'; diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_field/schedule_item_field.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_field/schedule_item_field.test.tsx new file mode 100644 index 0000000000000..bf019bd43f2fd --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_field/schedule_item_field.test.tsx @@ -0,0 +1,96 @@ +/* + * 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 { mount, shallow } from 'enzyme'; + +import { ScheduleItemField } from './schedule_item_field'; +import { TestProviders, useFormFieldMock } from '../../../../common/mock'; + +describe('ScheduleItemField', () => { + it('renders correctly', () => { + const mockField = useFormFieldMock<string>(); + const wrapper = shallow( + <ScheduleItemField + dataTestSubj="schedule-item" + idAria="idAria" + isDisabled={false} + field={mockField} + /> + ); + + expect(wrapper.find('[data-test-subj="schedule-item"]')).toHaveLength(1); + }); + + it('accepts a large number via user input', () => { + const mockField = useFormFieldMock<string>(); + const wrapper = mount( + <TestProviders> + <ScheduleItemField + dataTestSubj="schedule-item" + idAria="idAria" + isDisabled={false} + field={mockField} + /> + </TestProviders> + ); + + wrapper + .find('[data-test-subj="interval"]') + .last() + .simulate('change', { target: { value: '5000000' } }); + + expect(mockField.setValue).toHaveBeenCalledWith('5000000s'); + }); + + it('clamps a number value greater than MAX_SAFE_INTEGER to MAX_SAFE_INTEGER', () => { + const unsafeInput = '99999999999999999999999'; + + const mockField = useFormFieldMock<string>(); + const wrapper = mount( + <TestProviders> + <ScheduleItemField + dataTestSubj="schedule-item" + idAria="idAria" + isDisabled={false} + field={mockField} + /> + </TestProviders> + ); + + wrapper + .find('[data-test-subj="interval"]') + .last() + .simulate('change', { target: { value: unsafeInput } }); + + const expectedValue = `${Number.MAX_SAFE_INTEGER}s`; + expect(mockField.setValue).toHaveBeenCalledWith(expectedValue); + }); + + it('converts a non-numeric value to 0', () => { + const unsafeInput = 'this is not a number'; + + const mockField = useFormFieldMock<string>(); + const wrapper = mount( + <TestProviders> + <ScheduleItemField + dataTestSubj="schedule-item" + idAria="idAria" + isDisabled={false} + field={mockField} + /> + </TestProviders> + ); + + wrapper + .find('[data-test-subj="interval"]') + .last() + .simulate('change', { target: { value: unsafeInput } }); + + expect(mockField.setValue).toHaveBeenCalledWith('0s'); + }); +}); diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_field/schedule_item_field.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_field/schedule_item_field.tsx new file mode 100644 index 0000000000000..241e3869958a8 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_field/schedule_item_field.tsx @@ -0,0 +1,181 @@ +/* + * 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 { EuiSelectProps, EuiFieldNumberProps } from '@elastic/eui'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiFieldNumber, + EuiFormRow, + EuiSelect, + transparentize, +} from '@elastic/eui'; +import { isEmpty } from 'lodash/fp'; +import React, { useCallback, useEffect, useMemo, useState } from 'react'; +import styled from 'styled-components'; + +import type { FieldHook } from '../../../../shared_imports'; +import { getFieldValidityAndErrorMessage } from '../../../../shared_imports'; + +import * as I18n from './translations'; + +interface ScheduleItemProps { + field: FieldHook<string>; + dataTestSubj: string; + idAria: string; + isDisabled: boolean; + minimumValue?: number; + timeTypes?: string[]; + fullWidth?: boolean; +} + +const timeTypeOptions = [ + { value: 's', text: I18n.SECONDS }, + { value: 'm', text: I18n.MINUTES }, + { value: 'h', text: I18n.HOURS }, + { value: 'd', text: I18n.DAYS }, +]; + +// move optional label to the end of input +const StyledLabelAppend = styled(EuiFlexItem)` + &.euiFlexItem { + margin-left: 31px; + } +`; + +const StyledEuiFormRow = styled(EuiFormRow)` + max-width: none; + + .euiFormControlLayout__append { + padding-inline: 0 !important; + } + + .euiFormControlLayoutIcons { + color: ${({ theme }) => theme.eui.euiColorPrimary}; + } +`; + +const MyEuiSelect = styled(EuiSelect)` + min-width: 106px; // Preserve layout when disabled & dropdown arrow is not rendered + background: ${({ theme }) => + transparentize(theme.eui.euiColorPrimary, 0.1)} !important; // Override focus states etc. + color: ${({ theme }) => theme.eui.euiColorPrimary}; + box-shadow: none; +`; + +const getNumberFromUserInput = (input: string, minimumValue = 0): number => { + const number = parseInt(input, 10); + if (Number.isNaN(number)) { + return minimumValue; + } else { + return Math.max(minimumValue, Math.min(number, Number.MAX_SAFE_INTEGER)); + } +}; + +export const ScheduleItemField = ({ + dataTestSubj, + field, + idAria, + isDisabled, + minimumValue = 0, + timeTypes = ['s', 'm', 'h'], + fullWidth = false, +}: ScheduleItemProps) => { + const [timeType, setTimeType] = useState(timeTypes[0]); + const [timeVal, setTimeVal] = useState<number>(0); + const { isInvalid, errorMessage } = getFieldValidityAndErrorMessage(field); + const { value, setValue } = field; + + const onChangeTimeType = useCallback<NonNullable<EuiSelectProps['onChange']>>( + (e) => { + setTimeType(e.target.value); + setValue(`${timeVal}${e.target.value}`); + }, + [setValue, timeVal] + ); + + const onChangeTimeVal = useCallback<NonNullable<EuiFieldNumberProps['onChange']>>( + (e) => { + const sanitizedValue = getNumberFromUserInput(e.target.value, minimumValue); + setTimeVal(sanitizedValue); + setValue(`${sanitizedValue}${timeType}`); + }, + [minimumValue, setValue, timeType] + ); + + useEffect(() => { + if (value !== `${timeVal}${timeType}`) { + const filterTimeVal = value.match(/\d+/g); + const filterTimeType = value.match(/[a-zA-Z]+/g); + if ( + !isEmpty(filterTimeVal) && + filterTimeVal != null && + !isNaN(Number(filterTimeVal[0])) && + Number(filterTimeVal[0]) !== Number(timeVal) + ) { + setTimeVal(Number(filterTimeVal[0])); + } + if ( + !isEmpty(filterTimeType) && + filterTimeType != null && + timeTypes.includes(filterTimeType[0]) && + filterTimeType[0] !== timeType + ) { + setTimeType(filterTimeType[0]); + } + } + }, [timeType, timeTypes, timeVal, value]); + + // EUI missing some props + const rest = { disabled: isDisabled }; + const label = useMemo( + () => ( + <EuiFlexGroup gutterSize="s" justifyContent="flexStart" alignItems="center"> + <EuiFlexItem grow={false} component="span"> + {field.label} + </EuiFlexItem> + <StyledLabelAppend grow={false} component="span"> + {field.labelAppend} + </StyledLabelAppend> + </EuiFlexGroup> + ), + [field.label, field.labelAppend] + ); + + return ( + <StyledEuiFormRow + label={label} + helpText={field.helpText} + error={errorMessage} + isInvalid={isInvalid} + fullWidth={fullWidth} + data-test-subj={dataTestSubj} + describedByIds={idAria ? [idAria] : undefined} + > + <EuiFieldNumber + append={ + <MyEuiSelect + fullWidth + options={timeTypeOptions.filter((type) => timeTypes.includes(type.value))} + onChange={onChangeTimeType} + value={timeType} + aria-label={field.label} + data-test-subj="timeType" + {...rest} + /> + } + fullWidth + min={minimumValue} + max={Number.MAX_SAFE_INTEGER} + onChange={onChangeTimeVal} + value={timeVal} + data-test-subj="interval" + {...rest} + /> + </StyledEuiFormRow> + ); +}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_form/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_field/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_form/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_field/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_form/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_form/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_form/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_form/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_form/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_form/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_form/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_form/index.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_form/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_form/translations.ts new file mode 100644 index 0000000000000..c460d2f7198b3 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/schedule_item_form/translations.ts @@ -0,0 +1,36 @@ +/* + * 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'; + +export const SECONDS = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.stepScheduleRuleForm.secondsOptionDescription', + { + defaultMessage: 'Seconds', + } +); + +export const MINUTES = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.stepScheduleRuleForm.minutesOptionDescription', + { + defaultMessage: 'Minutes', + } +); + +export const HOURS = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.stepScheduleRuleForm.hoursOptionDescription', + { + defaultMessage: 'Hours', + } +); + +export const DAYS = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.stepScheduleRuleForm.daysOptionDescription', + { + defaultMessage: 'Days', + } +); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_about_rule_details/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_about_rule_details/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_about_rule_details/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_about_rule_details/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_about_rule_details/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_about_rule_details/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_about_rule_details/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_about_rule_details/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_about_rule_details/styles.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_about_rule_details/styles.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_about_rule_details/styles.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_about_rule_details/styles.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_about_rule_details/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_about_rule_details/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_about_rule_details/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_about_rule_details/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_content_wrapper/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_content_wrapper/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_content_wrapper/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_content_wrapper/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_content_wrapper/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_content_wrapper/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_content_wrapper/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_content_wrapper/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_panel/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_panel/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_panel/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_panel/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_panel/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_panel/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_panel/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_panel/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/get_schema.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/get_schema.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/get_schema.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/get_schema.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/notification_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/notification_action.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/notification_action.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/notification_action.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/response_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/response_action.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/response_action.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/response_action.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/rule_snooze_section.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/rule_snooze_section.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/rule_snooze_section.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/rule_snooze_section.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/step_rule_actions/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/threshold_alert_suppression_edit/fields.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/threshold_alert_suppression_edit/fields.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/threshold_alert_suppression_edit/fields.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/threshold_alert_suppression_edit/fields.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/threshold_alert_suppression_edit/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/threshold_alert_suppression_edit/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/threshold_alert_suppression_edit/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/threshold_alert_suppression_edit/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/threshold_alert_suppression_edit/threshold_alert_suppression_edit.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/threshold_alert_suppression_edit/threshold_alert_suppression_edit.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/threshold_alert_suppression_edit/threshold_alert_suppression_edit.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/threshold_alert_suppression_edit/threshold_alert_suppression_edit.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/threshold_alert_suppression_edit/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/threshold_alert_suppression_edit/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/components/threshold_alert_suppression_edit/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/components/threshold_alert_suppression_edit/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/constants/validation_warning_codes.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/constants/validation_warning_codes.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/constants/validation_warning_codes.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/constants/validation_warning_codes.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/logic/esql_query_columns.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/logic/esql_query_columns.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/logic/esql_query_columns.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/logic/esql_query_columns.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation/logic/extract_validation_messages.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/logic/extract_validation_messages.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation/logic/extract_validation_messages.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation/logic/extract_validation_messages.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/accordion_title/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/accordion_title/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/accordion_title/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/accordion_title/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/accordion_title/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/accordion_title/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/accordion_title/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/accordion_title/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/add_item_form/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/add_item_form/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/add_item_form/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/add_item_form/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/add_item_form/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/add_item_form/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/add_item_form/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/add_item_form/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/ai_assistant/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/ai_assistant/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/ai_assistant/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/ai_assistant/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/ai_assistant/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/ai_assistant/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/ai_assistant/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/ai_assistant/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/ai_assistant/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/ai_assistant/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/ai_assistant/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/ai_assistant/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/anomaly_threshold_slider/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/anomaly_threshold_slider/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/anomaly_threshold_slider/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/anomaly_threshold_slider/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/anomaly_threshold_slider/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/anomaly_threshold_slider/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/anomaly_threshold_slider/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/anomaly_threshold_slider/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/__mocks__/use_data_view_list_items.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/__mocks__/use_data_view_list_items.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/__mocks__/use_data_view_list_items.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/__mocks__/use_data_view_list_items.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/data_view_selector_field.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/data_view_selector_field.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/data_view_selector_field.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/data_view_selector_field.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/data_view_selector_field.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/data_view_selector_field.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/data_view_selector_field.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/data_view_selector_field.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/use_data_view_list_items.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/use_data_view_list_items.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/use_data_view_list_items.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/data_view_selector_field/use_data_view_list_items.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/actions_description.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/actions_description.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/actions_description.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/actions_description.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/alert_suppression_label.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/alert_suppression_label.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/alert_suppression_label.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/alert_suppression_label.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/alert_suppression_label.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/alert_suppression_label.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/alert_suppression_label.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/alert_suppression_label.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/assets/list_tree_icon.svg b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/assets/list_tree_icon.svg similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/assets/list_tree_icon.svg rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/assets/list_tree_icon.svg diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/build_ml_jobs_description.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/build_ml_jobs_description.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/build_ml_jobs_description.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/build_ml_jobs_description.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/index.test.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/index.tsx new file mode 100644 index 0000000000000..a91487afc4486 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/index.tsx @@ -0,0 +1,380 @@ +/* + * 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 { EuiDescriptionList, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { isEmpty, chunk, get, pick, isNumber } from 'lodash/fp'; +import React, { memo, useState } from 'react'; +import styled from 'styled-components'; +import type { ThreatMapping, Threats, Type } from '@kbn/securitysolution-io-ts-alerting-types'; +import type { DataViewBase, Filter } from '@kbn/es-query'; +import { FilterStateStore } from '@kbn/es-query'; +import { FilterManager } from '@kbn/data-plugin/public'; +import type { + RelatedIntegrationArray, + RequiredFieldArray, +} from '../../../../../common/api/detection_engine/model/rule_schema'; +import { buildRelatedIntegrationsDescription } from '../../../../detections/components/rules/related_integrations/integrations_description'; +import { DEFAULT_TIMELINE_TITLE } from '../../../../timelines/components/timeline/translations'; +import type { EqlOptions } from '../../../../../common/search_strategy'; +import { useKibana } from '../../../../common/lib/kibana'; +import type { + AboutStepRiskScore, + AboutStepSeverity, + Duration, +} from '../../../../detections/pages/detection_engine/rules/types'; +import type { FieldValueTimeline } from '../../../rule_creation/components/pick_timeline'; +import type { FormSchema } from '../../../../shared_imports'; +import type { ListItems } from './types'; +import { + buildQueryBarDescription, + buildSeverityDescription, + buildStringArrayDescription, + buildThreatDescription, + buildUnorderedListArrayDescription, + buildUrlsDescription, + buildNoteDescription, + buildRiskScoreDescription, + buildRuleTypeDescription, + buildThresholdDescription, + buildThreatMappingDescription, + buildEqlOptionsDescription, + buildRequiredFieldsDescription, + buildAlertSuppressionDescription, + buildAlertSuppressionWindowDescription, + buildAlertSuppressionMissingFieldsDescription, + buildHighlightedFieldsOverrideDescription, + buildSetupDescription, + getQueryLabel, + buildIntervalDescription, +} from './helpers'; +import * as i18n from './translations'; +import { buildMlJobsDescription } from './build_ml_jobs_description'; +import { buildActionsDescription } from './actions_description'; +import { buildThrottleDescription } from './throttle_description'; +import { THREAT_QUERY_LABEL } from './translations'; +import { filterEmptyThreats } from '../../pages/rule_creation/helpers'; +import { useLicense } from '../../../../common/hooks/use_license'; +import type { LicenseService } from '../../../../../common/license'; +import { + isThresholdRule, + isSuppressionRuleConfiguredWithMissingFields, + isSuppressionRuleConfiguredWithGroupBy, + isSuppressionRuleConfiguredWithDuration, +} from '../../../../../common/detection_engine/utils'; +import { + ALERT_SUPPRESSION_DURATION_FIELD_NAME, + ALERT_SUPPRESSION_DURATION_TYPE_FIELD_NAME, + ALERT_SUPPRESSION_FIELDS_FIELD_NAME, + ALERT_SUPPRESSION_MISSING_FIELDS_FIELD_NAME, +} from '../../../rule_creation/components/alert_suppression_edit'; +import { THRESHOLD_ALERT_SUPPRESSION_ENABLED } from '../../../rule_creation/components/threshold_alert_suppression_edit'; +import { NEW_TERMS_FIELDS_LABEL } from '../../../rule_creation/components/new_terms_fields_edit/translations'; +import { HISTORY_WINDOW_START_LABEL } from '../../../rule_creation/components/history_window_start_edit/translations'; +import type { FieldValueQueryBar } from '../query_bar_field'; + +const DescriptionListContainer = styled(EuiDescriptionList)` + max-width: 600px; + .euiDescriptionList__description { + overflow-wrap: anywhere; + } +`; + +const DESCRIPTION_LIST_COLUMN_WIDTHS: [string, string] = ['50%', '50%']; + +interface StepRuleDescriptionProps<T> { + columns?: 'multi' | 'single' | 'singleSplit'; + data: unknown; + indexPatterns?: DataViewBase; + // @ts-expect-error upgrade typescript v4.9.5 + schema: FormSchema<T>; +} + +export const StepRuleDescriptionComponent = <T,>({ + data, + columns = 'multi', + indexPatterns, + schema, +}: StepRuleDescriptionProps<T>) => { + const kibana = useKibana(); + const license = useLicense(); + const [filterManager] = useState<FilterManager>(new FilterManager(kibana.services.uiSettings)); + + const keys = Object.keys(schema); + const listItems = keys.reduce((acc: ListItems[], key: string) => { + if (key === 'machineLearningJobId') { + return [ + ...acc, + buildMlJobsDescription( + get(key, data) as string[], + (get(key, schema) as { label: string }).label + ), + ]; + } + + if (key === 'throttle') { + return [...acc, buildThrottleDescription(get(key, data), get([key, 'label'], schema))]; + } + + if (key === 'actions') { + return [...acc, buildActionsDescription(get(key, data), get([key, 'label'], schema))]; + } + + return [ + ...acc, + ...buildListItems(data, pick(key, schema), filterManager, license, indexPatterns), + ]; + }, []); + + if (columns === 'multi') { + return ( + <EuiFlexGroup> + {chunk(Math.ceil(listItems.length / 2), listItems).map((chunkListItems, index) => ( + <EuiFlexItem + data-test-subj="listItemColumnStepRuleDescription" + key={`description-step-rule-${index}`} + > + <EuiDescriptionList listItems={chunkListItems} /> + </EuiFlexItem> + ))} + </EuiFlexGroup> + ); + } + + return ( + <EuiFlexGroup> + <EuiFlexItem data-test-subj="listItemColumnStepRuleDescription"> + {columns === 'single' ? ( + <EuiDescriptionList listItems={listItems} /> + ) : ( + <DescriptionListContainer + data-test-subj="singleSplitStepRuleDescriptionList" + type="column" + columnWidths={DESCRIPTION_LIST_COLUMN_WIDTHS} + rowGutterSize="m" + listItems={listItems} + /> + )} + </EuiFlexItem> + </EuiFlexGroup> + ); +}; + +export const StepRuleDescription = memo(StepRuleDescriptionComponent); + +export const buildListItems = <T,>( + data: unknown, + // @ts-expect-error upgrade typescript v4.9.5 + schema: FormSchema<T>, + filterManager: FilterManager, + license: LicenseService, + indexPatterns?: DataViewBase +): ListItems[] => + Object.keys(schema).reduce<ListItems[]>( + (acc, field) => [ + ...acc, + ...getDescriptionItem( + field, + get([field, 'label'], schema), + data, + filterManager, + license, + indexPatterns + ), + ], + [] + ); + +export const addFilterStateIfNotThere = (filters: Filter[]): Filter[] => { + return filters.map((filter) => { + if (filter.$state == null) { + return { $state: { store: FilterStateStore.APP_STATE }, ...filter }; + } else { + return filter; + } + }); +}; + +/* eslint complexity: ["error", 25]*/ +// eslint-disable-next-line complexity +export const getDescriptionItem = ( + field: string, + label: string, + data: unknown, + filterManager: FilterManager, + license: LicenseService, + indexPatterns?: DataViewBase +): ListItems[] => { + if (field === 'queryBar') { + const queryBar = get('queryBar', data) as FieldValueQueryBar; + const filters = addFilterStateIfNotThere(queryBar.filters ?? []); + const query = queryBar.query.query as string; + const savedId = queryBar.saved_id ?? ''; + const savedQueryName = queryBar.title; + const ruleType: Type = get('ruleType', data) as Type; + const queryLabel = getQueryLabel(ruleType); + return buildQueryBarDescription({ + field, + filters, + filterManager, + query, + queryLabel, + savedId, + savedQueryName, + indexPatterns, + }); + } else if (field === 'responseActions') { + return []; + } else if (field === ALERT_SUPPRESSION_FIELDS_FIELD_NAME) { + const ruleType: Type = get('ruleType', data); + + const ruleCanHaveGroupByFields = isSuppressionRuleConfiguredWithGroupBy(ruleType); + if (!ruleCanHaveGroupByFields) { + return []; + } + const values: string[] = get(field, data); + return buildAlertSuppressionDescription(label, values, ruleType); + } else if (field === ALERT_SUPPRESSION_DURATION_TYPE_FIELD_NAME) { + return []; + } else if (field === ALERT_SUPPRESSION_DURATION_FIELD_NAME) { + const ruleType: Type = get('ruleType', data); + + const ruleCanHaveDuration = isSuppressionRuleConfiguredWithDuration(ruleType); + if (!ruleCanHaveDuration) { + return []; + } + + // threshold rule has suppression duration without grouping fields, but suppression should be explicitly enabled by user + // query rule have suppression duration only if group by fields selected + const showDuration = isThresholdRule(ruleType) + ? get(THRESHOLD_ALERT_SUPPRESSION_ENABLED, data) === true + : get(ALERT_SUPPRESSION_FIELDS_FIELD_NAME, data).length > 0; + + if (showDuration) { + const value: Duration = get(field, data); + return buildAlertSuppressionWindowDescription( + label, + value, + get(ALERT_SUPPRESSION_DURATION_TYPE_FIELD_NAME, data), + ruleType + ); + } else { + return []; + } + } else if (field === ALERT_SUPPRESSION_MISSING_FIELDS_FIELD_NAME) { + const ruleType: Type = get('ruleType', data); + const ruleCanHaveSuppressionMissingFields = + isSuppressionRuleConfiguredWithMissingFields(ruleType); + + if (!ruleCanHaveSuppressionMissingFields) { + return []; + } + if (get(ALERT_SUPPRESSION_FIELDS_FIELD_NAME, data).length > 0) { + const value = get(field, data); + return buildAlertSuppressionMissingFieldsDescription(label, value, ruleType); + } else { + return []; + } + } else if (field === 'eqlOptions') { + const eqlOptions: EqlOptions = get(field, data); + return buildEqlOptionsDescription(eqlOptions); + } else if (field === 'threat') { + const threats: Threats = get(field, data); + return buildThreatDescription({ label, threat: filterEmptyThreats(threats) }); + } else if (field === 'threshold') { + const threshold = get(field, data); + return buildThresholdDescription(label, threshold); + } else if (field === 'references') { + const urls: string[] = get(field, data); + return buildUrlsDescription(label, urls); + } else if (field === 'falsePositives') { + const values: string[] = get(field, data); + return buildUnorderedListArrayDescription(label, field, values); + } else if (field === 'investigationFields') { + const values: string[] = get(field, data); + return buildHighlightedFieldsOverrideDescription(label, values); + } else if (field === 'riskScore') { + const values: AboutStepRiskScore = get(field, data); + return buildRiskScoreDescription(values); + } else if (field === 'severity') { + const values: AboutStepSeverity = get(field, data); + return buildSeverityDescription(values); + } else if (field === 'requiredFields') { + const requiredFields: RequiredFieldArray = get(field, data); + return buildRequiredFieldsDescription(label, requiredFields); + } else if (field === 'relatedIntegrations') { + const relatedIntegrations: RelatedIntegrationArray = get(field, data); + return buildRelatedIntegrationsDescription(label, relatedIntegrations); + } else if (field === 'timeline') { + const timeline = get(field, data) as FieldValueTimeline; + return [ + { + title: label, + description: timeline.title ?? DEFAULT_TIMELINE_TITLE, + }, + ]; + } else if (field === 'note') { + const val: string = get(field, data); + return buildNoteDescription(label, val); + } else if (field === 'setup') { + const val: string = get(field, data); + return buildSetupDescription(label, val); + } else if (field === 'ruleType') { + const ruleType: Type = get(field, data); + return buildRuleTypeDescription(label, ruleType); + } else if (field === 'kibanaSiemAppUrl') { + return []; + } else if (field === 'threatQueryBar') { + const filters = addFilterStateIfNotThere(get('threatQueryBar.filters', data) ?? []); + const query = get('threatQueryBar.query.query', data); + const savedId = get('threatQueryBar.saved_id', data); + return buildQueryBarDescription({ + field, + filters, + filterManager, + query, + savedId, + indexPatterns, + queryLabel: THREAT_QUERY_LABEL, + }); + } else if (field === 'threatMapping') { + const threatMap: ThreatMapping = get(field, data); + return buildThreatMappingDescription(label, threatMap); + } else if (field === 'newTermsFields') { + const values: string[] = get(field, data); + return buildStringArrayDescription(NEW_TERMS_FIELDS_LABEL, field, values); + } else if (Array.isArray(get(field, data)) && field !== 'threatMapping') { + const values: string[] = get(field, data); + return buildStringArrayDescription(label, field, values); + } else if (field === 'index') { + if (get('dataViewId', data)) { + return []; + } + } else if (field === 'isBuildingBlock') { + return get('isBuildingBlock', data) + ? [{ title: i18n.BUILDING_BLOCK_LABEL, description: i18n.BUILDING_BLOCK_DESCRIPTION }] + : []; + } else if (['interval', 'from'].includes(field)) { + return buildIntervalDescription(label, get(field, data)); + } else if (field === 'maxSignals') { + const value: number | undefined = get(field, data); + return value ? [{ title: label, description: value }] : []; + } else if (field === 'historyWindowSize') { + const value: number = get(field, data); + return value ? [{ title: HISTORY_WINDOW_START_LABEL, description: value }] : []; + } + + const description: string = get(field, data); + if (isNumber(description) || !isEmpty(description)) { + return [ + { + title: label, + description, + }, + ]; + } + return []; +}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/threat_description.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/threat_description.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/threat_description.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/threat_description.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/throttle_description.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/throttle_description.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/throttle_description.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/throttle_description.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/description_step/types.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/es_field_selector_field/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/es_field_selector_field/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/es_field_selector_field/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/es_field_selector_field/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/esql_autocomplete/esql_autocomplete.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/esql_autocomplete/esql_autocomplete.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/esql_autocomplete/esql_autocomplete.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/esql_autocomplete/esql_autocomplete.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/esql_autocomplete/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/esql_autocomplete/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/esql_autocomplete/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/esql_autocomplete/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/esql_autocomplete/use_esql_fields_options.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/esql_autocomplete/use_esql_fields_options.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/esql_autocomplete/use_esql_fields_options.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/esql_autocomplete/use_esql_fields_options.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/esql_autocomplete/use_esql_fields_options.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/esql_autocomplete/use_esql_fields_options.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/esql_autocomplete/use_esql_fields_options.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/esql_autocomplete/use_esql_fields_options.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/max_signals/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/max_signals/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/max_signals/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/max_signals/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/max_signals/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/max_signals/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/max_signals/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/max_signals/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/helpers.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/subtechnique_fields.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/subtechnique_fields.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/subtechnique_fields.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/subtechnique_fields.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/technique_fields.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/technique_fields.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/technique_fields.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/technique_fields.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/mitre/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/multi_select_fields/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/multi_select_fields/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/multi_select_fields/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/multi_select_fields/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/multi_select_fields/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/multi_select_fields/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/multi_select_fields/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/multi_select_fields/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/next_step/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/next_step/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/next_step/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/next_step/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/next_step/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/next_step/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/next_step/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/next_step/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/next_step/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/next_step/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/next_step/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/next_step/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/optional_field_label/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/optional_field_label/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/optional_field_label/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/optional_field_label/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/optional_field_label/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/optional_field_label/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/optional_field_label/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/optional_field_label/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/default_queries.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/default_queries.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/default_queries.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/default_queries.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/query_field.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/query_field.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/query_field.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/query_field.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/query_field.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/query_field.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/query_field.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/query_field.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/types.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/risk_score_mapping/default_risk_score.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/risk_score_mapping/default_risk_score.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/risk_score_mapping/default_risk_score.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/risk_score_mapping/default_risk_score.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/risk_score_mapping/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/risk_score_mapping/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/risk_score_mapping/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/risk_score_mapping/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/risk_score_mapping/risk_score_override.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/risk_score_mapping/risk_score_override.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/risk_score_mapping/risk_score_override.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/risk_score_mapping/risk_score_override.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/risk_score_mapping/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/risk_score_mapping/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/risk_score_mapping/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/risk_score_mapping/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/__mocks__/preview_logs.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/__mocks__/preview_logs.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/__mocks__/preview_logs.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/__mocks__/preview_logs.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/helpers.test.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/helpers.ts new file mode 100644 index 0000000000000..fcbdfdf4f86b7 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/helpers.ts @@ -0,0 +1,151 @@ +/* + * 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 { isEmpty } from 'lodash'; +import type { EuiSelectOption } from '@elastic/eui'; +import type { Type, ThreatMapping } from '@kbn/securitysolution-io-ts-alerting-types'; +import * as i18n from './translations'; + +import type { FieldValueQueryBar } from '../query_bar_field'; +import type { TimeframePreviewOptions } from '../../../../detections/pages/detection_engine/rules/types'; +import { DataSourceType } from '../../../../detections/pages/detection_engine/rules/types'; +import { MAX_NUMBER_OF_NEW_TERMS_FIELDS } from '../../../../../common/constants'; + +/** + * Determines whether or not to display noise warning. + * Is considered noisy if alerts/hour rate > 1 + * @param hits Total query search hits + * @param timeframe Range selected by user (last hour, day...) + */ +export const isNoisy = (hits: number, timeframe: TimeframePreviewOptions): boolean => { + const oneHour = 1000 * 60 * 60; + const durationInHours = Math.max( + (timeframe.timeframeEnd.valueOf() - timeframe.timeframeStart.valueOf()) / oneHour, + 1.0 + ); + return hits / durationInHours > 1; +}; + +/** + * Determines what timerange options to show. + * Eql sequence queries tend to be slower, so decided + * not to include the last month option. + * @param ruleType + */ +export const getTimeframeOptions = (ruleType: Type): EuiSelectOption[] => { + if (ruleType === 'eql') { + return [ + { value: 'h', text: i18n.LAST_HOUR }, + { value: 'd', text: i18n.LAST_DAY }, + ]; + } else if (ruleType === 'threat_match') { + return [ + { value: 'h', text: i18n.LAST_HOUR }, + { value: 'd', text: i18n.LAST_DAY }, + { value: 'w', text: i18n.LAST_WEEK }, + ]; + } else if (ruleType === 'threshold') { + return [{ value: 'h', text: i18n.LAST_HOUR }]; + } else { + return [ + { value: 'h', text: i18n.LAST_HOUR }, + { value: 'd', text: i18n.LAST_DAY }, + { value: 'M', text: i18n.LAST_MONTH }, + ]; + } +}; + +const isNewTermsPreviewDisabled = (newTermsFields: string[]): boolean => { + return newTermsFields.length === 0 || newTermsFields.length > MAX_NUMBER_OF_NEW_TERMS_FIELDS; +}; + +const isEsqlPreviewDisabled = ({ + isQueryBarValid, + queryBar, +}: { + queryBar: FieldValueQueryBar; + isQueryBarValid: boolean; +}): boolean => { + return !isQueryBarValid || isEmpty(queryBar.query.query); +}; + +const isThreatMatchPreviewDisabled = ({ + isThreatQueryBarValid, + threatIndex, + threatMapping, +}: { + threatIndex: string[]; + threatMapping: ThreatMapping; + isThreatQueryBarValid: boolean; +}): boolean => { + if (!isThreatQueryBarValid || !threatIndex.length || !threatMapping) { + return true; + } else if ( + !threatMapping.length || + !threatMapping[0].entries?.length || + !threatMapping[0].entries[0].field || + !threatMapping[0].entries[0].value + ) { + return true; + } + + return false; +}; + +export const getIsRulePreviewDisabled = ({ + ruleType, + isQueryBarValid, + isThreatQueryBarValid, + index, + dataViewId, + dataSourceType, + threatIndex, + threatMapping, + machineLearningJobId, + queryBar, + newTermsFields = [], +}: { + ruleType: Type; + isQueryBarValid: boolean; + isThreatQueryBarValid: boolean; + index: string[]; + dataViewId: string | undefined; + dataSourceType: DataSourceType; + threatIndex: string[]; + threatMapping: ThreatMapping; + machineLearningJobId: string[]; + queryBar: FieldValueQueryBar; + newTermsFields: string[]; +}) => { + if (ruleType === 'esql') { + return isEsqlPreviewDisabled({ isQueryBarValid, queryBar }); + } + if (ruleType === 'machine_learning') { + return machineLearningJobId.length === 0; + } + if ( + !isQueryBarValid || + (dataSourceType === DataSourceType.DataView && !dataViewId) || + (dataSourceType === DataSourceType.IndexPatterns && index.length === 0) + ) { + return true; + } + if (ruleType === 'threat_match') { + return isThreatMatchPreviewDisabled({ + threatIndex, + threatMapping, + isThreatQueryBarValid, + }); + } + if (ruleType === 'eql' || ruleType === 'query' || ruleType === 'threshold') { + return isEmpty(queryBar.query.query) && isEmpty(queryBar.filters); + } + if (ruleType === 'new_terms') { + return isNewTermsPreviewDisabled(newTermsFields); + } + return false; +}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/loading_histogram.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/loading_histogram.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/loading_histogram.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/loading_histogram.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/logged_requests.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/logged_requests.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/logged_requests.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/logged_requests.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/logged_requests.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/logged_requests.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/logged_requests.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/logged_requests.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/logged_requests_item.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/logged_requests_item.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/logged_requests_item.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/logged_requests_item.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/optimized_accordion.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/optimized_accordion.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/optimized_accordion.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/optimized_accordion.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/optimized_accordion.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/optimized_accordion.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/optimized_accordion.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/optimized_accordion.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_histogram.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_histogram.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_histogram.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_histogram.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_histogram.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_histogram.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_histogram.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_histogram.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_logs.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_logs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_logs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_logs.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_table_cell_renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_table_cell_renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_table_cell_renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_table_cell_renderer.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_table_control_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_table_control_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_table_control_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/preview_table_control_columns.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/use_accordion_styling.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/use_accordion_styling.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/use_accordion_styling.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/use_accordion_styling.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/use_preview_invocation_count.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/use_preview_invocation_count.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/use_preview_invocation_count.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/use_preview_invocation_count.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/use_preview_route.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/use_preview_route.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/use_preview_route.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/use_preview_route.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/use_preview_rule.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/use_preview_rule.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/use_preview_rule.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/rule_preview/use_preview_rule.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/select_rule_type/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/select_rule_type/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/select_rule_type/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/select_rule_type/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/select_rule_type/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/select_rule_type/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/select_rule_type/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/select_rule_type/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/select_rule_type/ml_card_description.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/select_rule_type/ml_card_description.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/select_rule_type/ml_card_description.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/select_rule_type/ml_card_description.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/select_rule_type/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/select_rule_type/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/select_rule_type/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/select_rule_type/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/severity_mapping/default_severity.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/severity_mapping/default_severity.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/severity_mapping/default_severity.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/severity_mapping/default_severity.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/severity_mapping/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/severity_mapping/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/severity_mapping/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/severity_mapping/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/severity_mapping/severity_override.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/severity_mapping/severity_override.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/severity_mapping/severity_override.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/severity_mapping/severity_override.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/severity_mapping/styles.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/severity_mapping/styles.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/severity_mapping/styles.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/severity_mapping/styles.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/severity_mapping/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/severity_mapping/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/severity_mapping/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/severity_mapping/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/status_icon/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/status_icon/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/status_icon/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/status_icon/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/status_icon/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/status_icon/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/status_icon/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/status_icon/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/data.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/data.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/data.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/data.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/default_value.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/default_value.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/default_value.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/default_value.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/schema.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/schema.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/schema.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/schema.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_about_rule/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.test.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx new file mode 100644 index 0000000000000..f7845c31378af --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx @@ -0,0 +1,812 @@ +/* + * 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 { EuiButtonGroupOptionProps } from '@elastic/eui'; +import { + EuiButtonEmpty, + EuiFlexGroup, + EuiFlexItem, + EuiFormRow, + EuiSpacer, + EuiButtonGroup, + EuiText, +} from '@elastic/eui'; +import type { FC } from 'react'; +import React, { memo, useCallback, useState, useEffect, useMemo } from 'react'; + +import styled from 'styled-components'; +import { i18n as i18nCore } from '@kbn/i18n'; +import { isEqual } from 'lodash'; +import type { FieldSpec } from '@kbn/data-plugin/common'; + +import type { SavedQuery } from '@kbn/data-plugin/public'; +import type { DataViewBase } from '@kbn/es-query'; +import { FormattedMessage } from '@kbn/i18n-react'; +import type { SetRuleQuery } from '../../../../detections/containers/detection_engine/rules/use_rule_from_timeline'; +import { useRuleFromTimeline } from '../../../../detections/containers/detection_engine/rules/use_rule_from_timeline'; +import { isMlRule } from '../../../../../common/machine_learning/helpers'; +import { filterRuleFieldsForType, getStepDataDataSource } from '../../pages/rule_creation/helpers'; +import type { + DefineStepRule, + RuleStepProps, +} from '../../../../detections/pages/detection_engine/rules/types'; +import { DataSourceType } from '../../../../detections/pages/detection_engine/rules/types'; +import { StepRuleDescription } from '../description_step'; +import type { QueryBarFieldProps } from '../query_bar_field'; +import { QueryBarField } from '../query_bar_field'; +import { SelectRuleType } from '../select_rule_type'; +import { AnomalyThresholdSlider } from '../anomaly_threshold_slider'; +import { MlJobSelect } from '../../../rule_creation/components/ml_job_select'; +import { PickTimeline } from '../../../rule_creation/components/pick_timeline'; +import { StepContentWrapper } from '../../../rule_creation/components/step_content_wrapper'; +import { ThresholdInput } from '../threshold_input'; +import { + Field, + Form, + getUseField, + HiddenField, + UseField, + useFormData, + UseMultiFields, +} from '../../../../shared_imports'; +import type { FormHook, FieldHook } from '../../../../shared_imports'; +import { schema } from './schema'; +import { useExperimentalFeatureFieldsTransform } from './use_experimental_feature_fields_transform'; +import * as i18n from './translations'; +import { + isEqlRule, + isNewTermsRule, + isThreatMatchRule, + isThresholdRule as getIsThresholdRule, + isQueryRule, + isEsqlRule, + isEqlSequenceQuery, + isSuppressionRuleInGA, +} from '../../../../../common/detection_engine/utils'; +import { EqlQueryEdit } from '../../../rule_creation/components/eql_query_edit'; +import { DataViewSelectorField } from '../data_view_selector_field'; +import { ThreatMatchInput } from '../threatmatch_input'; +import { useFetchIndex } from '../../../../common/containers/source'; +import { RequiredFields } from '../../../rule_creation/components/required_fields'; +import { DocLink } from '../../../../common/components/links_to_docs/doc_link'; +import { useLicense } from '../../../../common/hooks/use_license'; +import { MINIMUM_LICENSE_FOR_SUPPRESSION } from '../../../../../common/detection_engine/constants'; +import { useUpsellingMessage } from '../../../../common/hooks/use_upselling'; +import { useAllEsqlRuleFields } from '../../hooks'; +import { useAlertSuppression } from '../../../rule_management/logic/use_alert_suppression'; +import { AiAssistant } from '../ai_assistant'; +import { RelatedIntegrations } from '../../../rule_creation/components/related_integrations'; +import { useMLRuleConfig } from '../../../../common/components/ml/hooks/use_ml_rule_config'; +import { + ALERT_SUPPRESSION_FIELDS_FIELD_NAME, + AlertSuppressionEdit, +} from '../../../rule_creation/components/alert_suppression_edit'; +import { ThresholdAlertSuppressionEdit } from '../../../rule_creation/components/threshold_alert_suppression_edit'; +import { usePersistentAlertSuppressionState } from './use_persistent_alert_suppression_state'; +import { useTermsAggregationFields } from '../../../../common/hooks/use_terms_aggregation_fields'; +import { HistoryWindowStartEdit } from '../../../rule_creation/components/history_window_start_edit'; +import { NewTermsFieldsEdit } from '../../../rule_creation/components/new_terms_fields_edit'; +import { usePersistentNewTermsState } from './use_persistent_new_terms_state'; +import { EsqlQueryEdit } from '../../../rule_creation/components/esql_query_edit'; +import { usePersistentQuery } from './use_persistent_query'; + +const CommonUseField = getUseField({ component: Field }); + +const StyledVisibleContainer = styled.div<{ isVisible: boolean }>` + display: ${(props) => (props.isVisible ? 'block' : 'none')}; +`; +export interface StepDefineRuleProps extends RuleStepProps { + indicesConfig: string[]; + threatIndicesConfig: string[]; + defaultSavedQuery?: SavedQuery; + form: FormHook<DefineStepRule>; + indexPattern: DataViewBase; + isIndexPatternLoading: boolean; + isQueryBarValid: boolean; + setIsQueryBarValid: (valid: boolean) => void; + setIsThreatQueryBarValid: (valid: boolean) => void; + index: string[]; + threatIndex: string[]; + alertSuppressionFields?: string[]; + dataSourceType: DataSourceType; + shouldLoadQueryDynamically: boolean; + queryBarTitle: string | undefined; + queryBarSavedId: string | null | undefined; + thresholdFields: string[] | undefined; +} + +interface StepDefineRuleReadOnlyProps { + addPadding: boolean; + descriptionColumns: 'multi' | 'single' | 'singleSplit'; + defaultValues: DefineStepRule; + indexPattern: DataViewBase; +} + +export const MyLabelButton = styled(EuiButtonEmpty)` + height: 18px; + font-size: 12px; + + .euiIcon { + width: 14px; + height: 14px; + } +`; + +MyLabelButton.defaultProps = { + flush: 'right', +}; + +const RuleTypeEuiFormRow = styled(EuiFormRow).attrs<{ $isVisible: boolean }>(({ $isVisible }) => ({ + style: { + display: $isVisible ? 'flex' : 'none', + }, +}))<{ $isVisible: boolean }>``; + +const StepDefineRuleComponent: FC<StepDefineRuleProps> = ({ + dataSourceType, + defaultSavedQuery, + form, + alertSuppressionFields, + index, + indexPattern, + indicesConfig, + isIndexPatternLoading, + isLoading, + isQueryBarValid, + isUpdateView = false, + queryBarSavedId, + queryBarTitle, + setIsQueryBarValid, + setIsThreatQueryBarValid, + shouldLoadQueryDynamically, + threatIndex, + threatIndicesConfig, + thresholdFields, +}) => { + const [{ ruleType, queryBar, machineLearningJobId }] = useFormData<DefineStepRule>({ + form, + watch: ['ruleType', 'queryBar', 'machineLearningJobId'], + }); + + const [openTimelineSearch, setOpenTimelineSearch] = useState(false); + const [indexModified, setIndexModified] = useState(false); + const [threatIndexModified, setThreatIndexModified] = useState(false); + const license = useLicense(); + + const { + allJobsStarted, + hasMlAdminPermissions, + hasMlLicense, + loading: mlRuleConfigLoading, + mlSuppressionFields, + } = useMLRuleConfig({ machineLearningJobId }); + + const isMlSuppressionIncomplete = + isMlRule(ruleType) && machineLearningJobId?.length > 0 && !allJobsStarted; + + const isAlertSuppressionLicenseValid = license.isAtLeast(MINIMUM_LICENSE_FOR_SUPPRESSION); + + const isThresholdRule = getIsThresholdRule(ruleType); + const alertSuppressionUpsellingMessage = useUpsellingMessage('alert_suppression_rule_form'); + const { getFields, reset, setFieldValue } = form; + + // Callback for when user toggles between Data Views and Index Patterns + const onChangeDataSource = useCallback( + (optionId: string) => { + form.setFieldValue('dataSourceType', optionId); + form.getFields().index.reset({ + resetValue: false, + }); + form.getFields().dataViewId.reset({ + resetValue: false, + }); + }, + [form] + ); + + const aggFields = useMemo( + () => (indexPattern.fields as FieldSpec[]).filter((field) => field.aggregatable === true), + [indexPattern.fields] + ); + + const termsAggregationFields = useTermsAggregationFields(indexPattern.fields); + const termsAggregationFieldNames = useMemo( + () => termsAggregationFields.map((field) => field.name), + [termsAggregationFields] + ); + + const [threatIndexPatternsLoading, { indexPatterns: threatIndexPatterns }] = + useFetchIndex(threatIndex); + + // reset form when rule type changes + useEffect(() => { + reset({ resetValues: false }); + }, [reset, ruleType]); + + useEffect(() => { + setIndexModified(!isEqual(index, indicesConfig)); + }, [index, indicesConfig]); + + useEffect(() => { + setThreatIndexModified(!isEqual(threatIndex, threatIndicesConfig)); + }, [threatIndex, threatIndicesConfig]); + + const { setPersistentEqlQuery, setPersistentEqlOptions } = usePersistentQuery({ + form, + }); + usePersistentAlertSuppressionState({ form }); + usePersistentNewTermsState({ + form, + ruleTypePath: 'ruleType', + newTermsFieldsPath: 'newTermsFields', + historyWindowStartPath: 'historyWindowSize', + }); + + const handleSetRuleFromTimeline = useCallback<SetRuleQuery>( + ({ index: timelineIndex, queryBar: timelineQueryBar, eqlOptions }) => { + const setQuery = () => { + setFieldValue('index', timelineIndex); + setFieldValue('queryBar', timelineQueryBar); + }; + if (timelineQueryBar.query.language === 'eql') { + setFieldValue('ruleType', 'eql'); + + // Rule type change takes as minimum two re-renders. Since we render a specific + // query editor component depending on rule type we need to first render + // the rule type specific query editor component (using UseField under the hood) to + // be able to set query's field value. + // + // setTimeout provides a simple solution to wait until the rule type specific query + // editor component is rendered. + setTimeout(() => { + setPersistentEqlQuery(timelineQueryBar); + setPersistentEqlOptions(eqlOptions ?? {}); + setQuery(); + setFieldValue('eqlOptions', eqlOptions ?? {}); + }); + } else { + setQuery(); + } + }, + [setFieldValue, setPersistentEqlQuery, setPersistentEqlOptions] + ); + + const { onOpenTimeline, loading: timelineQueryLoading } = + useRuleFromTimeline(handleSetRuleFromTimeline); + + // if saved query failed to load: + // - reset shouldLoadFormDynamically to false, as non existent query cannot be used for loading and execution + const handleSavedQueryError = useCallback(() => { + if (!isQueryBarValid) { + form.setFieldValue('shouldLoadQueryDynamically', false); + } + }, [isQueryBarValid, form]); + + const handleResetIndices = useCallback(() => { + const indexField = getFields().index; + indexField.setValue(indicesConfig); + }, [getFields, indicesConfig]); + + const handleResetThreatIndices = useCallback(() => { + const threatIndexField = getFields().threatIndex; + threatIndexField.setValue(threatIndicesConfig); + }, [getFields, threatIndicesConfig]); + + const handleOpenTimelineSearch = useCallback(() => { + setOpenTimelineSearch(true); + }, []); + + const handleCloseTimelineSearch = useCallback(() => { + setOpenTimelineSearch(false); + }, []); + + const ThresholdInputChildren = useCallback( + ({ + thresholdField, + thresholdValue, + thresholdCardinalityField, + thresholdCardinalityValue, + }: Record<string, FieldHook>) => ( + <ThresholdInput + browserFields={aggFields} + thresholdField={thresholdField} + thresholdValue={thresholdValue} + thresholdCardinalityField={thresholdCardinalityField} + thresholdCardinalityValue={thresholdCardinalityValue} + /> + ), + [aggFields] + ); + + const ThreatMatchInputChildren = useCallback( + ({ threatMapping }: Record<string, FieldHook>) => ( + <ThreatMatchInput + handleResetThreatIndices={handleResetThreatIndices} + indexPatterns={indexPattern} + threatIndexModified={threatIndexModified} + threatIndexPatterns={threatIndexPatterns} + threatIndexPatternsLoading={threatIndexPatternsLoading} + threatMapping={threatMapping} + onValidityChange={setIsThreatQueryBarValid} + /> + ), + [ + handleResetThreatIndices, + indexPattern, + setIsThreatQueryBarValid, + threatIndexModified, + threatIndexPatterns, + threatIndexPatternsLoading, + ] + ); + + const { fields: esqlSuppressionFields, isLoading: isEsqlSuppressionLoading } = + useAllEsqlRuleFields({ + esqlQuery: isEsqlRule(ruleType) ? (queryBar?.query?.query as string) : undefined, + indexPatternsFields: indexPattern.fields, + }); + + /** Suppression fields being selected is a special case for our form logic, as we can't + * disable these fields and leave users in a bad state that they cannot change. + * The exception is threshold rules, which use an existing threshold field for the same + * purpose and so are treated as if the field is always selected. */ + const areSuppressionFieldsSelected = isThresholdRule || Boolean(alertSuppressionFields?.length); + + const { isSuppressionEnabled: isAlertSuppressionEnabled } = useAlertSuppression( + isEqlSequenceQuery(queryBar?.query?.query as string) + ); + + /** If we don't have ML field information, users can't meaningfully interact with suppression fields */ + const areSuppressionFieldsDisabledByMlFields = + isMlRule(ruleType) && (mlRuleConfigLoading || !mlSuppressionFields.length); + + /** Suppression fields are generally disabled if either: + * - License is insufficient (i.e. less than platinum) + * - ML Field information is not available + */ + const areSuppressionFieldsDisabled = + !isAlertSuppressionLicenseValid || areSuppressionFieldsDisabledByMlFields; + + const isSuppressionGroupByDisabled = + (areSuppressionFieldsDisabled || isEsqlSuppressionLoading) && !areSuppressionFieldsSelected; + + const suppressionGroupByDisabledText = useMemo(() => { + if (areSuppressionFieldsDisabledByMlFields) { + return i18n.MACHINE_LEARNING_SUPPRESSION_DISABLED_LABEL; + } else { + return alertSuppressionUpsellingMessage; + } + }, [alertSuppressionUpsellingMessage, areSuppressionFieldsDisabledByMlFields]); + + const suppressionGroupByFields = useMemo(() => { + if (isEsqlRule(ruleType)) { + return esqlSuppressionFields; + } else if (isMlRule(ruleType)) { + return mlSuppressionFields; + } else { + return termsAggregationFields; + } + }, [esqlSuppressionFields, mlSuppressionFields, ruleType, termsAggregationFields]); + + const alertSuppressionFieldsAppendText = useMemo( + () => ( + <EuiText color="subdued" size="xs"> + {isSuppressionRuleInGA(ruleType) + ? i18n.ALERT_SUPPRESSION_FIELDS_GA_LABEL_APPEND + : i18n.ALERT_SUPPRESSION_FIELDS_TECH_PREVIEW_LABEL_APPEND} + </EuiText> + ), + [ruleType] + ); + + const dataViewIndexPatternToggleButtonOptions: EuiButtonGroupOptionProps[] = useMemo( + () => [ + { + id: DataSourceType.IndexPatterns, + label: i18nCore.translate( + 'xpack.securitySolution.ruleDefine.indexTypeSelect.indexPattern', + { + defaultMessage: 'Index Patterns', + } + ), + iconType: dataSourceType === DataSourceType.IndexPatterns ? 'checkInCircleFilled' : 'empty', + 'data-test-subj': `rule-index-toggle-${DataSourceType.IndexPatterns}`, + }, + { + id: DataSourceType.DataView, + label: i18nCore.translate('xpack.securitySolution.ruleDefine.indexTypeSelect.dataView', { + defaultMessage: 'Data View', + }), + iconType: dataSourceType === DataSourceType.DataView ? 'checkInCircleFilled' : 'empty', + 'data-test-subj': `rule-index-toggle-${DataSourceType.DataView}`, + }, + ], + [dataSourceType] + ); + + const DataSource = useMemo(() => { + return ( + <RuleTypeEuiFormRow label={i18n.SOURCE} $isVisible={true} fullWidth> + <EuiFlexGroup + direction="column" + gutterSize="s" + data-test-subj="dataViewIndexPatternButtonGroupFlexGroup" + > + <EuiFlexItem> + <EuiText size="xs"> + <FormattedMessage + id="xpack.securitySolution.dataViewSelectorText1" + defaultMessage="Use Kibana " + /> + <DocLink guidePath="kibana" docPath="data-views.html" linkText="Data Views" /> + <FormattedMessage + id="xpack.securitySolution.dataViewSelectorText2" + defaultMessage=" or specify individual " + /> + <DocLink + guidePath="kibana" + docPath="index-patterns-api-create.html" + linkText="index patterns" + /> + <FormattedMessage + id="xpack.securitySolution.dataViewSelectorText3" + defaultMessage=" as your rule's data source to be searched." + /> + </EuiText> + </EuiFlexItem> + <EuiFlexItem> + <RuleTypeEuiFormRow $isVisible={true}> + <EuiButtonGroup + isFullWidth={true} + legend="Rule index pattern or data view selector" + data-test-subj="dataViewIndexPatternButtonGroup" + idSelected={dataSourceType} + onChange={onChangeDataSource} + options={dataViewIndexPatternToggleButtonOptions} + color="primary" + /> + </RuleTypeEuiFormRow> + </EuiFlexItem> + + <EuiFlexItem> + <StyledVisibleContainer isVisible={dataSourceType === DataSourceType.DataView}> + <UseField + key="DataViewSelector" + path="dataViewId" + component={DataViewSelectorField} + /> + </StyledVisibleContainer> + <StyledVisibleContainer isVisible={dataSourceType === DataSourceType.IndexPatterns}> + <CommonUseField + path="index" + config={{ + ...schema.index, + labelAppend: indexModified ? ( + <MyLabelButton onClick={handleResetIndices} iconType="refresh"> + {i18n.RESET_DEFAULT_INDEX} + </MyLabelButton> + ) : null, + }} + componentProps={{ + idAria: 'detectionEngineStepDefineRuleIndices', + 'data-test-subj': 'detectionEngineStepDefineRuleIndices', + euiFieldProps: { + fullWidth: true, + placeholder: '', + isDisabled: timelineQueryLoading, + isLoading: timelineQueryLoading, + }, + }} + /> + </StyledVisibleContainer> + </EuiFlexItem> + </EuiFlexGroup> + </RuleTypeEuiFormRow> + ); + }, [ + timelineQueryLoading, + dataSourceType, + onChangeDataSource, + dataViewIndexPatternToggleButtonOptions, + indexModified, + handleResetIndices, + ]); + + const QueryBarMemo = useMemo( + () => ( + <UseField + key="QueryBarDefineRule" + path="queryBar" + config={{ + ...schema.queryBar, + label: i18n.QUERY_BAR_LABEL, + labelAppend: ( + <MyLabelButton + data-test-subj="importQueryFromSavedTimeline" + onClick={handleOpenTimelineSearch} + disabled={shouldLoadQueryDynamically} + > + {i18n.IMPORT_TIMELINE_QUERY} + </MyLabelButton> + ), + }} + component={QueryBarField} + componentProps={ + { + idAria: 'detectionEngineStepDefineRuleQueryBar', + indexPattern, + isDisabled: isLoading || shouldLoadQueryDynamically || timelineQueryLoading, + resetToSavedQuery: shouldLoadQueryDynamically, + isLoading: isIndexPatternLoading || timelineQueryLoading, + dataTestSubj: 'detectionEngineStepDefineRuleQueryBar', + openTimelineSearch, + onValidityChange: setIsQueryBarValid, + onCloseTimelineSearch: handleCloseTimelineSearch, + onSavedQueryError: handleSavedQueryError, + defaultSavedQuery, + onOpenTimeline, + } as QueryBarFieldProps + } + /> + ), + [ + handleOpenTimelineSearch, + shouldLoadQueryDynamically, + indexPattern, + isLoading, + timelineQueryLoading, + isIndexPatternLoading, + openTimelineSearch, + setIsQueryBarValid, + handleCloseTimelineSearch, + handleSavedQueryError, + defaultSavedQuery, + onOpenTimeline, + ] + ); + + const selectRuleTypeProps = useMemo( + () => ({ + describedByIds: ['detectionEngineStepDefineRuleType'], + isUpdateView, + hasValidLicense: hasMlLicense, + isMlAdmin: hasMlAdminPermissions, + }), + [hasMlAdminPermissions, hasMlLicense, isUpdateView] + ); + + return ( + <> + <StepContentWrapper addPadding={!isUpdateView}> + <Form form={form} data-test-subj="stepDefineRule"> + <UseField + path="dataSourceType" + component={HiddenField} + componentProps={{ + euiFieldProps: { + fullWidth: true, + placeholder: '', + }, + }} + /> + <UseField + path="ruleType" + component={SelectRuleType} + componentProps={selectRuleTypeProps} + /> + <RuleTypeEuiFormRow $isVisible={!isMlRule(ruleType) && !isEsqlRule(ruleType)} fullWidth> + <> + <EuiSpacer size="s" /> + {DataSource} + </> + </RuleTypeEuiFormRow> + <RuleTypeEuiFormRow + $isVisible={!isMlRule(ruleType)} + fullWidth + data-test-subj="defineRuleFormStepQueryEditor" + > + <> + <EuiSpacer size="s" /> + {isEqlRule(ruleType) ? ( + <EqlQueryEdit + path="queryBar" + eqlOptionsPath="eqlOptions" + fieldsToValidateOnChange={ALERT_SUPPRESSION_FIELDS_FIELD_NAME} + required + showFilterBar + dataView={indexPattern} + loading={isIndexPatternLoading} + disabled={isLoading} + onValidityChange={setIsQueryBarValid} + /> + ) : isEsqlRule(ruleType) ? ( + <EsqlQueryEdit + path="queryBar" + fieldsToValidateOnChange={ALERT_SUPPRESSION_FIELDS_FIELD_NAME} + required + dataView={indexPattern} + disabled={isLoading} + loading={isLoading} + onValidityChange={setIsQueryBarValid} + /> + ) : ( + QueryBarMemo + )} + </> + </RuleTypeEuiFormRow> + {!isMlRule(ruleType) && !isQueryBarValid && queryBar?.query?.query && ( + <AiAssistant + getFields={form.getFields} + setFieldValue={form.setFieldValue} + language={queryBar?.query?.language} + /> + )} + {isQueryRule(ruleType) && ( + <> + <EuiSpacer size="s" /> + <RuleTypeEuiFormRow + label={i18n.SAVED_QUERY_FORM_ROW_LABEL} + $isVisible={Boolean(queryBarSavedId)} + fullWidth + > + <CommonUseField + path="shouldLoadQueryDynamically" + componentProps={{ + idAria: 'detectionEngineStepDefineRuleShouldLoadQueryDynamically', + 'data-test-subj': 'detectionEngineStepDefineRuleShouldLoadQueryDynamically', + euiFieldProps: { + disabled: isLoading, + label: queryBarTitle + ? i18n.getSavedQueryCheckboxLabel(queryBarTitle) + : i18n.getSavedQueryCheckboxLabelWithoutName(), + }, + }} + /> + </RuleTypeEuiFormRow> + </> + )} + <RuleTypeEuiFormRow $isVisible={isMlRule(ruleType)} fullWidth> + <> + <UseField + path="machineLearningJobId" + component={MlJobSelect} + componentProps={{ + describedByIds: ['detectionEngineStepDefineRulemachineLearningJobId'], + }} + /> + <UseField + path="anomalyThreshold" + component={AnomalyThresholdSlider} + componentProps={{ + describedByIds: ['detectionEngineStepDefineRuleAnomalyThreshold'], + }} + /> + </> + </RuleTypeEuiFormRow> + <RuleTypeEuiFormRow + $isVisible={isThresholdRule} + data-test-subj="thresholdInput" + fullWidth + > + <> + <UseMultiFields + fields={{ + thresholdField: { + path: 'threshold.field', + }, + thresholdValue: { + path: 'threshold.value', + }, + thresholdCardinalityField: { + path: 'threshold.cardinality.field', + }, + thresholdCardinalityValue: { + path: 'threshold.cardinality.value', + }, + }} + > + {ThresholdInputChildren} + </UseMultiFields> + </> + </RuleTypeEuiFormRow> + <RuleTypeEuiFormRow + $isVisible={isThreatMatchRule(ruleType)} + data-test-subj="threatMatchInput" + fullWidth + > + <> + <UseMultiFields + fields={{ + threatMapping: { + path: 'threatMapping', + }, + }} + > + {ThreatMatchInputChildren} + </UseMultiFields> + </> + </RuleTypeEuiFormRow> + {isNewTermsRule(ruleType) && ( + <EuiFormRow data-test-subj="newTermsInput" fullWidth> + <> + <NewTermsFieldsEdit path="newTermsFields" fieldNames={termsAggregationFieldNames} /> + <HistoryWindowStartEdit path="historyWindowSize" /> + </> + </EuiFormRow> + )} + <EuiSpacer size="m" /> + + <RuleTypeEuiFormRow $isVisible={isAlertSuppressionEnabled} fullWidth> + {isThresholdRule ? ( + <ThresholdAlertSuppressionEdit + suppressionFieldNames={thresholdFields} + disabled={!isAlertSuppressionLicenseValid} + disabledText={alertSuppressionUpsellingMessage} + /> + ) : ( + <AlertSuppressionEdit + suppressibleFields={suppressionGroupByFields} + labelAppend={alertSuppressionFieldsAppendText} + warningText={ + isMlSuppressionIncomplete + ? i18n.MACHINE_LEARNING_SUPPRESSION_INCOMPLETE_LABEL + : undefined + } + disabled={isSuppressionGroupByDisabled} + disabledText={suppressionGroupByDisabledText} + /> + )} + </RuleTypeEuiFormRow> + {!isMlRule(ruleType) && ( + <> + <RequiredFields + path="requiredFields" + indexPatternFields={indexPattern.fields} + isIndexPatternLoading={isIndexPatternLoading} + /> + <EuiSpacer size="l" /> + </> + )} + <RelatedIntegrations path="relatedIntegrations" dataTestSubj="relatedIntegrations" /> + <UseField + path="timeline" + component={PickTimeline} + componentProps={{ + idAria: 'detectionEngineStepDefineRuleTimeline', + isDisabled: isLoading, + dataTestSubj: 'detectionEngineStepDefineRuleTimeline', + }} + /> + </Form> + </StepContentWrapper> + </> + ); +}; +export const StepDefineRule = memo(StepDefineRuleComponent); + +const StepDefineRuleReadOnlyComponent: FC<StepDefineRuleReadOnlyProps> = ({ + addPadding, + defaultValues: data, + descriptionColumns, + indexPattern, +}) => { + const dataForDescription: Partial<DefineStepRule> = getStepDataDataSource(data); + const transformFields = useExperimentalFeatureFieldsTransform(); + const fieldsToDisplay = transformFields(dataForDescription); + + return ( + <StepContentWrapper data-test-subj="definitionRule" addPadding={addPadding}> + <StepRuleDescription + columns={descriptionColumns} + schema={filterRuleFieldsForType(schema, data.ruleType)} + data={filterRuleFieldsForType(fieldsToDisplay, data.ruleType)} + indexPatterns={indexPattern} + /> + </StepContentWrapper> + ); +}; +export const StepDefineRuleReadOnly = memo(StepDefineRuleReadOnlyComponent); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/mock_browser_fields.json b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/mock_browser_fields.json similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/mock_browser_fields.json rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/mock_browser_fields.json diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/schema.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/schema.tsx similarity index 83% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/schema.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/schema.tsx index 323e321eee8d9..4f168d94388d5 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/schema.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/schema.tsx @@ -17,12 +17,10 @@ import { } from '../../../../common/components/threat_match/helpers'; import { isEsqlRule, - isNewTermsRule, isThreatMatchRule, isThresholdRule, isSuppressionRuleConfiguredWithGroupBy, } from '../../../../../common/detection_engine/utils'; -import { MAX_NUMBER_OF_NEW_TERMS_FIELDS } from '../../../../../common/constants'; import { isMlRule } from '../../../../../common/machine_learning/helpers'; import type { ERROR_CODE, FormSchema, ValidationFunc } from '../../../../shared_imports'; import { FIELD_TYPES, fieldValidators } from '../../../../shared_imports'; @@ -478,106 +476,8 @@ export const schema: FormSchema<DefineStepRule> = { }, ], }, - newTermsFields: { - type: FIELD_TYPES.COMBO_BOX, - label: i18n.translate( - 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.newTermsFieldsLabel', - { - defaultMessage: 'Fields', - } - ), - helpText: i18n.translate( - 'xpack.securitySolution.detectionEngine.createRule.stepAboutRule.fieldNewTermsFieldHelpText', - { - defaultMessage: 'Select a field to check for new terms.', - } - ), - validations: [ - { - validator: ( - ...args: Parameters<ValidationFunc> - ): ReturnType<ValidationFunc<{}, ERROR_CODE>> | undefined => { - const [{ formData }] = args; - const needsValidation = isNewTermsRule(formData.ruleType); - if (!needsValidation) { - return; - } - - return fieldValidators.emptyField( - i18n.translate( - 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.newTermsFieldsMin', - { - defaultMessage: 'A minimum of one field is required.', - } - ) - )(...args); - }, - }, - { - validator: ( - ...args: Parameters<ValidationFunc> - ): ReturnType<ValidationFunc<{}, ERROR_CODE>> | undefined => { - const [{ formData }] = args; - const needsValidation = isNewTermsRule(formData.ruleType); - if (!needsValidation) { - return; - } - return fieldValidators.maxLengthField({ - length: MAX_NUMBER_OF_NEW_TERMS_FIELDS, - message: i18n.translate( - 'xpack.securitySolution.detectionEngine.validations.stepDefineRule.newTermsFieldsMax', - { - defaultMessage: 'Number of fields must be 3 or less.', - } - ), - })(...args); - }, - }, - ], - }, - historyWindowSize: { - label: i18n.translate( - 'xpack.securitySolution.detectionEngine.createRule.stepDefineRule.historyWindowSizeLabel', - { - defaultMessage: 'History Window Size', - } - ), - helpText: i18n.translate( - 'xpack.securitySolution.detectionEngine.createRule.stepScheduleRule.historyWindowSizeHelpText', - { - defaultMessage: "New terms rules only alert if terms don't appear in historical data.", - } - ), - validations: [ - { - validator: ( - ...args: Parameters<ValidationFunc> - ): ReturnType<ValidationFunc<{}, ERROR_CODE>> | undefined => { - const [{ path, formData }] = args; - const needsValidation = isNewTermsRule(formData.ruleType); - - if (!needsValidation) { - return; - } - - const filterTimeVal = formData.historyWindowSize.match(/\d+/g); - - if (filterTimeVal <= 0) { - return { - code: 'ERR_MIN_LENGTH', - path, - message: i18n.translate( - 'xpack.securitySolution.detectionEngine.validations.stepDefineRule.historyWindowSize.errMin', - { - defaultMessage: 'History window size must be greater than 0.', - } - ), - }; - } - }, - }, - ], - }, + newTermsFields: {}, + historyWindowSize: {}, [ALERT_SUPPRESSION_FIELDS_FIELD_NAME]: { validations: [ { diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/use_experimental_feature_fields_transform.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/use_experimental_feature_fields_transform.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/use_experimental_feature_fields_transform.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/use_experimental_feature_fields_transform.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/use_persistent_alert_suppression_state.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/use_persistent_alert_suppression_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/use_persistent_alert_suppression_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/use_persistent_alert_suppression_state.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/use_persistent_new_terms_state.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/use_persistent_new_terms_state.tsx new file mode 100644 index 0000000000000..61bfa45ba8a72 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/use_persistent_new_terms_state.tsx @@ -0,0 +1,73 @@ +/* + * 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 { useEffect, useRef } from 'react'; +import usePrevious from 'react-use/lib/usePrevious'; +import { isNewTermsRule } from '../../../../../common/detection_engine/utils'; +import type { FormHook } from '../../../../shared_imports'; +import { useFormData } from '../../../../shared_imports'; +import { type DefineStepRule } from '../../../../detections/pages/detection_engine/rules/types'; +import { + type NewTermsFields, + type HistoryWindowStart, +} from '../../../../../common/api/detection_engine'; + +interface UsePersistentNewTermsStateParams { + form: FormHook<DefineStepRule>; + ruleTypePath: string; + newTermsFieldsPath: string; + historyWindowStartPath: string; +} + +interface LastNewTermsState { + newTermsFields: NewTermsFields; + historyWindowStart: HistoryWindowStart; +} + +export function usePersistentNewTermsState({ + form, + ruleTypePath, + newTermsFieldsPath, + historyWindowStartPath, +}: UsePersistentNewTermsStateParams): void { + const lastNewTermsState = useRef<LastNewTermsState | undefined>(); + const [formData] = useFormData({ form, watch: [newTermsFieldsPath, historyWindowStartPath] }); + + const { + [ruleTypePath]: ruleType, + [newTermsFieldsPath]: newTermsFields, + [historyWindowStartPath]: historyWindowStart, + } = formData; + const previousRuleType = usePrevious(ruleType); + + useEffect(() => { + if ( + isNewTermsRule(ruleType) && + !isNewTermsRule(previousRuleType) && + lastNewTermsState.current + ) { + form.updateFieldValues({ + [newTermsFieldsPath]: lastNewTermsState.current.newTermsFields, + [historyWindowStartPath]: lastNewTermsState.current.historyWindowStart, + }); + + return; + } + + if (isNewTermsRule(ruleType)) { + lastNewTermsState.current = { newTermsFields, historyWindowStart }; + } + }, [ + form, + ruleType, + previousRuleType, + newTermsFieldsPath, + historyWindowStartPath, + newTermsFields, + historyWindowStart, + ]); +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/use_persistent_query.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/use_persistent_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/use_persistent_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/use_persistent_query.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/utils.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_schedule_rule/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_schedule_rule/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_schedule_rule/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_schedule_rule/index.test.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_schedule_rule/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_schedule_rule/index.tsx new file mode 100644 index 0000000000000..7c309ed32a68b --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_schedule_rule/index.tsx @@ -0,0 +1,82 @@ +/* + * 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 { FC } from 'react'; +import styled from 'styled-components'; +import React, { memo } from 'react'; +import type { + RuleStepProps, + ScheduleStepRule, +} from '../../../../detections/pages/detection_engine/rules/types'; +import { StepRuleDescription } from '../description_step'; +import { Form, UseField } from '../../../../shared_imports'; +import type { FormHook } from '../../../../shared_imports'; +import { StepContentWrapper } from '../../../rule_creation/components/step_content_wrapper'; +import { schema } from './schema'; +import { ScheduleItemField } from '../../../rule_creation/components/schedule_item_field'; + +const StyledForm = styled(Form)` + max-width: 235px !important; +`; +interface StepScheduleRuleProps extends RuleStepProps { + form: FormHook<ScheduleStepRule>; +} + +interface StepScheduleRuleReadOnlyProps { + addPadding: boolean; + descriptionColumns: 'multi' | 'single' | 'singleSplit'; + defaultValues: ScheduleStepRule; +} + +const StepScheduleRuleComponent: FC<StepScheduleRuleProps> = ({ + isLoading, + isUpdateView = false, + form, +}) => { + return ( + <> + <StepContentWrapper addPadding={!isUpdateView}> + <StyledForm form={form} data-test-subj="stepScheduleRule"> + <UseField + path="interval" + component={ScheduleItemField} + componentProps={{ + idAria: 'detectionEngineStepScheduleRuleInterval', + isDisabled: isLoading, + dataTestSubj: 'detectionEngineStepScheduleRuleInterval', + minimumValue: 1, + }} + /> + <UseField + path="from" + component={ScheduleItemField} + componentProps={{ + idAria: 'detectionEngineStepScheduleRuleFrom', + isDisabled: isLoading, + dataTestSubj: 'detectionEngineStepScheduleRuleFrom', + minimumValue: 1, + }} + /> + </StyledForm> + </StepContentWrapper> + </> + ); +}; +export const StepScheduleRule = memo(StepScheduleRuleComponent); + +const StepScheduleRuleReadOnlyComponent: FC<StepScheduleRuleReadOnlyProps> = ({ + addPadding, + defaultValues: data, + descriptionColumns, +}) => { + return ( + <StepContentWrapper addPadding={addPadding}> + <StepRuleDescription columns={descriptionColumns} schema={schema} data={data} /> + </StepContentWrapper> + ); +}; +export const StepScheduleRuleReadOnly = memo(StepScheduleRuleReadOnlyComponent); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_schedule_rule/schema.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_schedule_rule/schema.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_schedule_rule/schema.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_schedule_rule/schema.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/threatmatch_input/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/threatmatch_input/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/threatmatch_input/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/threatmatch_input/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/threshold_input/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/threshold_input/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/threshold_input/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/threshold_input/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/threshold_input/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/threshold_input/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/threshold_input/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/threshold_input/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/throttle_select_field/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/throttle_select_field/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/throttle_select_field/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/throttle_select_field/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/throttle_select_field/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/throttle_select_field/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/throttle_select_field/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/throttle_select_field/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_all_esql_rule_fields.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_all_esql_rule_fields.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_all_esql_rule_fields.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_all_esql_rule_fields.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_all_esql_rule_fields.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_all_esql_rule_fields.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_all_esql_rule_fields.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_all_esql_rule_fields.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_esql_index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_esql_index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_esql_index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_esql_index.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_esql_index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_esql_index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_esql_index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_esql_index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_esql_query_for_about_step.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_esql_query_for_about_step.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_esql_query_for_about_step.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_esql_query_for_about_step.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/form.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/form.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/helpers.test.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/helpers.ts new file mode 100644 index 0000000000000..4610e26321797 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/helpers.ts @@ -0,0 +1,746 @@ +/* + * 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. + */ + +/* eslint-disable complexity */ + +import { has, isEmpty, get } from 'lodash/fp'; +import type { Unit } from '@kbn/datemath'; +import moment from 'moment'; +import deepmerge from 'deepmerge'; +import omit from 'lodash/omit'; + +import type { + ExceptionListType, + NamespaceType, + List, +} from '@kbn/securitysolution-io-ts-list-types'; +import type { + RiskScoreMappingItem, + Threats, + ThreatSubtechnique, + ThreatTechnique, + Type, +} from '@kbn/securitysolution-io-ts-alerting-types'; +import { ENDPOINT_LIST_ID } from '@kbn/securitysolution-list-constants'; +import type { + RuleAction as AlertingRuleAction, + RuleSystemAction as AlertingRuleSystemAction, +} from '@kbn/alerting-plugin/common'; + +import type { ActionTypeRegistryContract } from '@kbn/triggers-actions-ui-plugin/public'; + +import { assertUnreachable } from '../../../../../common/utility_types'; +import { + transformAlertToRuleAction, + transformAlertToRuleResponseAction, + transformAlertToRuleSystemAction, +} from '../../../../../common/detection_engine/transform_actions'; + +import type { + AboutStepRule, + DefineStepRule, + ScheduleStepRule, + ActionsStepRule, + DefineStepRuleJson, + ScheduleStepRuleJson, + AboutStepRuleJson, + ActionsStepRuleJson, +} from '../../../../detections/pages/detection_engine/rules/types'; +import { + DataSourceType, + AlertSuppressionDurationType, +} from '../../../../detections/pages/detection_engine/rules/types'; +import type { + RuleCreateProps, + AlertSuppression, + RequiredFieldInput, + SeverityMapping, + RelatedIntegrationArray, +} from '../../../../../common/api/detection_engine/model/rule_schema'; +import { stepActionsDefaultValue } from '../../../rule_creation/components/step_rule_actions'; +import { DEFAULT_SUPPRESSION_MISSING_FIELDS_STRATEGY } from '../../../../../common/detection_engine/constants'; +import { + ALERT_SUPPRESSION_DURATION_FIELD_NAME, + ALERT_SUPPRESSION_DURATION_TYPE_FIELD_NAME, + ALERT_SUPPRESSION_FIELDS_FIELD_NAME, + ALERT_SUPPRESSION_MISSING_FIELDS_FIELD_NAME, +} from '../../../rule_creation/components/alert_suppression_edit'; +import { THRESHOLD_ALERT_SUPPRESSION_ENABLED } from '../../../rule_creation/components/threshold_alert_suppression_edit'; +import { convertDurationToDateMath } from '../../../../common/utils/date_math'; + +export const getTimeTypeValue = (time: string): { unit: Unit; value: number } => { + const timeObj: { unit: Unit; value: number } = { + unit: 'ms', + value: 0, + }; + const filterTimeVal = time.match(/\d+/g); + const filterTimeType = time.match(/[a-zA-Z]+/g); + if (!isEmpty(filterTimeVal) && filterTimeVal != null && !isNaN(Number(filterTimeVal[0]))) { + timeObj.value = Number(filterTimeVal[0]); + } + if ( + !isEmpty(filterTimeType) && + filterTimeType != null && + ['s', 'm', 'h', 'd'].includes(filterTimeType[0]) + ) { + timeObj.unit = filterTimeType[0] as Unit; + } + return timeObj; +}; + +export interface RuleFields { + anomalyThreshold: unknown; + machineLearningJobId: unknown; + queryBar: unknown; + index: unknown; + dataViewId?: unknown; + ruleType: unknown; + threshold?: unknown; + threatIndex?: unknown; + threatQueryBar?: unknown; + threatMapping?: unknown; + threatLanguage?: unknown; + eqlOptions: unknown; + newTermsFields?: unknown; + historyWindowSize?: unknown; +} + +type QueryRuleFields<T> = Omit< + T, + | 'anomalyThreshold' + | 'machineLearningJobId' + | 'threshold' + | 'threatIndex' + | 'threatQueryBar' + | 'threatMapping' + | 'eqlOptions' + | 'newTermsFields' + | 'historyWindowSize' +>; +type EqlQueryRuleFields<T> = Omit< + T, + | 'anomalyThreshold' + | 'machineLearningJobId' + | 'threshold' + | 'threatIndex' + | 'threatQueryBar' + | 'threatMapping' + | 'newTermsFields' + | 'historyWindowSize' +>; +type ThresholdRuleFields<T> = Omit< + T, + | 'anomalyThreshold' + | 'machineLearningJobId' + | 'threatIndex' + | 'threatQueryBar' + | 'threatMapping' + | 'eqlOptions' + | 'newTermsFields' + | 'historyWindowSize' +>; +type MlRuleFields<T> = Omit< + T, + | 'queryBar' + | 'index' + | 'threshold' + | 'threatIndex' + | 'threatQueryBar' + | 'threatMapping' + | 'eqlOptions' + | 'newTermsFields' + | 'historyWindowSize' +>; +type ThreatMatchRuleFields<T> = Omit< + T, + | 'anomalyThreshold' + | 'machineLearningJobId' + | 'threshold' + | 'eqlOptions' + | 'newTermsFields' + | 'historyWindowSize' +>; +type NewTermsRuleFields<T> = Omit< + T, + | 'anomalyThreshold' + | 'machineLearningJobId' + | 'threshold' + | 'threatIndex' + | 'threatQueryBar' + | 'threatMapping' + | 'eqlOptions' +>; +type EsqlRuleFields<T> = Omit< + T, + | 'anomalyThreshold' + | 'machineLearningJobId' + | 'threshold' + | 'threatIndex' + | 'threatQueryBar' + | 'threatMapping' + | 'eqlOptions' + | 'index' + | 'newTermsFields' + | 'historyWindowSize' + | 'dataViewId' +>; + +const isMlFields = <T>( + fields: + | QueryRuleFields<T> + | EqlQueryRuleFields<T> + | MlRuleFields<T> + | ThresholdRuleFields<T> + | ThreatMatchRuleFields<T> + | NewTermsRuleFields<T> + | EsqlRuleFields<T> +): fields is MlRuleFields<T> => has('anomalyThreshold', fields); + +const isThresholdFields = <T>( + fields: + | QueryRuleFields<T> + | EqlQueryRuleFields<T> + | MlRuleFields<T> + | ThresholdRuleFields<T> + | ThreatMatchRuleFields<T> + | NewTermsRuleFields<T> + | EsqlRuleFields<T> +): fields is ThresholdRuleFields<T> => has('threshold', fields); + +const isThreatMatchFields = <T>( + fields: + | QueryRuleFields<T> + | EqlQueryRuleFields<T> + | MlRuleFields<T> + | ThresholdRuleFields<T> + | ThreatMatchRuleFields<T> + | NewTermsRuleFields<T> + | EsqlRuleFields<T> +): fields is ThreatMatchRuleFields<T> => has('threatIndex', fields); + +const isNewTermsFields = <T>( + fields: + | QueryRuleFields<T> + | EqlQueryRuleFields<T> + | MlRuleFields<T> + | ThresholdRuleFields<T> + | ThreatMatchRuleFields<T> + | NewTermsRuleFields<T> + | EsqlRuleFields<T> +): fields is NewTermsRuleFields<T> => has('newTermsFields', fields); + +const isEqlFields = <T>( + fields: + | QueryRuleFields<T> + | EqlQueryRuleFields<T> + | MlRuleFields<T> + | ThresholdRuleFields<T> + | ThreatMatchRuleFields<T> + | NewTermsRuleFields<T> + | EsqlRuleFields<T> +): fields is EqlQueryRuleFields<T> => has('eqlOptions', fields); + +const isEsqlFields = <T>( + fields: + | QueryRuleFields<T> + | EqlQueryRuleFields<T> + | MlRuleFields<T> + | ThresholdRuleFields<T> + | ThreatMatchRuleFields<T> + | NewTermsRuleFields<T> + | EsqlRuleFields<T> +): fields is EsqlRuleFields<T> => get('queryBar.query.language', fields) === 'esql'; + +export const filterRuleFieldsForType = <T extends Partial<RuleFields>>( + fields: T, + type: Type +): + | QueryRuleFields<T> + | EqlQueryRuleFields<T> + | MlRuleFields<T> + | ThresholdRuleFields<T> + | ThreatMatchRuleFields<T> + | EsqlRuleFields<T> + | NewTermsRuleFields<T> => { + switch (type) { + case 'machine_learning': + const { + index, + queryBar, + threshold, + threatIndex, + threatQueryBar, + threatMapping, + eqlOptions, + newTermsFields, + historyWindowSize, + ...mlRuleFields + } = fields; + return mlRuleFields; + case 'threshold': + const { + anomalyThreshold, + machineLearningJobId, + threatIndex: _removedThreatIndex, + threatQueryBar: _removedThreatQueryBar, + threatMapping: _removedThreatMapping, + eqlOptions: _eqlOptions, + newTermsFields: removedNewTermsFields, + historyWindowSize: removedHistoryWindowSize, + ...thresholdRuleFields + } = fields; + return thresholdRuleFields; + case 'threat_match': + const { + anomalyThreshold: _removedAnomalyThreshold, + machineLearningJobId: _removedMachineLearningJobId, + threshold: _removedThreshold, + eqlOptions: __eqlOptions, + newTermsFields: _removedNewTermsFields, + historyWindowSize: _removedHistoryWindowSize, + ...threatMatchRuleFields + } = fields; + return threatMatchRuleFields; + case 'query': + case 'saved_query': + const { + anomalyThreshold: _a, + machineLearningJobId: _m, + threshold: _t, + threatIndex: __removedThreatIndex, + threatQueryBar: __removedThreatQueryBar, + threatMapping: __removedThreatMapping, + eqlOptions: ___eqlOptions, + newTermsFields: __removedNewTermsFields, + historyWindowSize: __removedHistoryWindowSize, + ...queryRuleFields + } = fields; + return queryRuleFields; + case 'eql': + const { + anomalyThreshold: __a, + machineLearningJobId: __m, + threshold: __t, + threatIndex: ___removedThreatIndex, + threatQueryBar: ___removedThreatQueryBar, + threatMapping: ___removedThreatMapping, + newTermsFields: ___removedNewTermsFields, + historyWindowSize: ___removedHistoryWindowSize, + ...eqlRuleFields + } = fields; + return eqlRuleFields; + + case 'new_terms': + const { + anomalyThreshold: ___a, + machineLearningJobId: ___m, + threshold: ___t, + threatIndex: ____removedThreatIndex, + threatQueryBar: ____removedThreatQueryBar, + threatMapping: ____removedThreatMapping, + eqlOptions: ____eqlOptions, + ...newTermsRuleFields + } = fields; + return newTermsRuleFields; + + case 'esql': + const { + anomalyThreshold: _esql_a, + machineLearningJobId: _esql_m, + threshold: _esql_t, + threatIndex: _esql_removedThreatIndex, + threatQueryBar: _esql_removedThreatQueryBar, + threatMapping: _esql_removedThreatMapping, + newTermsFields: _esql_removedNewTermsFields, + historyWindowSize: _esql_removedHistoryWindowSize, + eqlOptions: _esql__eqlOptions, + index: _esql_index, + dataViewId: _esql_dataViewId, + ...esqlRuleFields + } = fields; + return esqlRuleFields; + } + assertUnreachable(type); +}; + +function trimThreatsWithNoName<T extends ThreatSubtechnique | ThreatTechnique>( + filterable: T[] +): T[] { + return filterable.filter((item) => item.name !== 'none'); +} + +/** + * Filter out unfilled/empty threat, technique, and subtechnique fields based on if their name is `none` + */ +export const filterEmptyThreats = (threats: Threats): Threats => { + return threats + .filter((singleThreat) => singleThreat.tactic.name !== 'none') + .map((threat) => { + return { + ...threat, + technique: trimThreatsWithNoName(threat.technique ?? []).map((technique) => { + return { + ...technique, + subtechnique: + technique.subtechnique != null + ? trimThreatsWithNoName(technique.subtechnique) + : undefined, + }; + }), + }; + }); +}; + +/** + * remove unused data source. + * Ex: rule is using a data view so we should not + * write an index property on the rule form. + * @param defineStepData + * @returns DefineStepRule + */ +export const getStepDataDataSource = ( + defineStepData: DefineStepRule +): Omit<DefineStepRule, 'dataViewId' | 'index' | 'dataSourceType'> & { + index?: string[]; + dataViewId?: string; +} => { + const copiedStepData = { ...defineStepData }; + if (defineStepData.dataSourceType === DataSourceType.DataView) { + return omit(copiedStepData, ['index', 'dataSourceType']); + } else if (defineStepData.dataSourceType === DataSourceType.IndexPatterns) { + return omit(copiedStepData, ['dataViewId', 'dataSourceType']); + } + return copiedStepData; +}; + +/** + * Strips away form rows that were not filled out by the user + */ +export const removeEmptyRequiredFields = ( + requiredFields: RequiredFieldInput[] +): RequiredFieldInput[] => requiredFields.filter((field) => field.name !== '' && field.type !== ''); + +export const formatDefineStepData = (defineStepData: DefineStepRule): DefineStepRuleJson => { + const stepData = getStepDataDataSource(defineStepData); + + const ruleFields = filterRuleFieldsForType(stepData, stepData.ruleType); + const { ruleType, timeline } = ruleFields; + + const baseFields = { + type: ruleType, + related_integrations: defineStepData.relatedIntegrations + ? filterOutEmptyRelatedIntegrations(defineStepData.relatedIntegrations) + : undefined, + ...(timeline.id != null && + timeline.title != null && { + timeline_id: timeline.id, + timeline_title: timeline.title, + }), + }; + + // Threshold rule won't contain alert suppression fields + const alertSuppressionFields = + ruleFields[ALERT_SUPPRESSION_FIELDS_FIELD_NAME]?.length > 0 + ? { + alert_suppression: { + group_by: ruleFields[ALERT_SUPPRESSION_FIELDS_FIELD_NAME], + duration: + ruleFields[ALERT_SUPPRESSION_DURATION_TYPE_FIELD_NAME] === + AlertSuppressionDurationType.PerTimePeriod + ? ruleFields[ALERT_SUPPRESSION_DURATION_FIELD_NAME] + : undefined, + missing_fields_strategy: (ruleFields[ALERT_SUPPRESSION_MISSING_FIELDS_FIELD_NAME] || + DEFAULT_SUPPRESSION_MISSING_FIELDS_STRATEGY) as AlertSuppression['missing_fields_strategy'], + }, + } + : {}; + + const requiredFields = removeEmptyRequiredFields(defineStepData.requiredFields ?? []); + + const typeFields = isMlFields(ruleFields) + ? { + anomaly_threshold: ruleFields.anomalyThreshold, + machine_learning_job_id: ruleFields.machineLearningJobId, + ...alertSuppressionFields, + } + : isThresholdFields(ruleFields) + ? { + index: ruleFields.index, + filters: ruleFields.queryBar?.filters, + language: ruleFields.queryBar?.query?.language, + query: ruleFields.queryBar?.query?.query as string, + saved_id: ruleFields.queryBar?.saved_id ?? undefined, + required_fields: requiredFields, + ...(ruleType === 'threshold' && { + threshold: { + field: ruleFields.threshold?.field ?? [], + value: parseInt(ruleFields.threshold?.value, 10) ?? 0, + cardinality: + !isEmpty(ruleFields.threshold.cardinality?.field) && + ruleFields.threshold.cardinality?.value != null + ? [ + { + field: ruleFields.threshold.cardinality.field[0], + value: parseInt(ruleFields.threshold.cardinality.value, 10), + }, + ] + : [], + }, + ...(ruleFields[THRESHOLD_ALERT_SUPPRESSION_ENABLED] && { + alert_suppression: { duration: ruleFields[ALERT_SUPPRESSION_DURATION_FIELD_NAME] }, + }), + }), + } + : isThreatMatchFields(ruleFields) + ? { + index: ruleFields.index, + filters: ruleFields.queryBar?.filters, + language: ruleFields.queryBar?.query?.language, + query: ruleFields.queryBar?.query?.query as string, + saved_id: ruleFields.queryBar?.saved_id ?? undefined, + required_fields: requiredFields, + threat_index: ruleFields.threatIndex, + threat_query: ruleFields.threatQueryBar?.query?.query as string, + threat_filters: ruleFields.threatQueryBar?.filters, + threat_mapping: ruleFields.threatMapping, + threat_language: ruleFields.threatQueryBar?.query?.language, + ...alertSuppressionFields, + } + : isEqlFields(ruleFields) + ? { + index: ruleFields.index, + filters: ruleFields.queryBar?.filters, + language: ruleFields.queryBar?.query?.language, + query: ruleFields.queryBar?.query?.query as string, + saved_id: ruleFields.queryBar?.saved_id ?? undefined, + required_fields: requiredFields, + timestamp_field: ruleFields.eqlOptions?.timestampField, + event_category_override: ruleFields.eqlOptions?.eventCategoryField, + tiebreaker_field: ruleFields.eqlOptions?.tiebreakerField, + ...alertSuppressionFields, + } + : isNewTermsFields(ruleFields) + ? { + index: ruleFields.index, + filters: ruleFields.queryBar?.filters, + language: ruleFields.queryBar?.query?.language, + query: ruleFields.queryBar?.query?.query as string, + required_fields: requiredFields, + new_terms_fields: ruleFields.newTermsFields, + history_window_start: convertDurationToDateMath(ruleFields.historyWindowSize), + ...alertSuppressionFields, + } + : isEsqlFields(ruleFields) && !('index' in ruleFields) + ? { + language: ruleFields.queryBar?.query?.language, + query: ruleFields.queryBar?.query?.query as string, + required_fields: requiredFields, + ...alertSuppressionFields, + } + : { + ...alertSuppressionFields, + index: ruleFields.index, + filters: ruleFields.queryBar?.filters, + language: ruleFields.queryBar?.query?.language, + query: ruleFields.queryBar?.query?.query as string, + saved_id: undefined, + required_fields: requiredFields, + type: 'query' as const, + // rule only be updated as saved_query type if it has saved_id and shouldLoadQueryDynamically checkbox checked + ...(['query', 'saved_query'].includes(ruleType) && + ruleFields.queryBar?.saved_id && + ruleFields.shouldLoadQueryDynamically && { + type: 'saved_query' as const, + query: undefined, + filters: undefined, + saved_id: ruleFields.queryBar.saved_id, + }), + }; + + return { + ...baseFields, + ...typeFields, + ...('dataViewId' in ruleFields ? { data_view_id: ruleFields.dataViewId } : {}), + }; +}; + +export const formatScheduleStepData = (scheduleData: ScheduleStepRule): ScheduleStepRuleJson => { + const { ...formatScheduleData } = scheduleData; + if (!isEmpty(formatScheduleData.interval) && !isEmpty(formatScheduleData.from)) { + const { unit: intervalUnit, value: intervalValue } = getTimeTypeValue( + formatScheduleData.interval + ); + const { unit: fromUnit, value: fromValue } = getTimeTypeValue(formatScheduleData.from); + const duration = moment.duration(intervalValue, intervalUnit); + duration.add(fromValue, fromUnit); + formatScheduleData.from = `now-${duration.asSeconds()}s`; + formatScheduleData.to = 'now'; + } + return { + ...formatScheduleData, + meta: { + from: scheduleData.from, + }, + }; +}; + +export const formatAboutStepData = ( + aboutStepData: AboutStepRule, + exceptionsList?: List[] +): AboutStepRuleJson => { + const { + author, + falsePositives, + investigationFields, + references, + riskScore, + severity, + threat, + isAssociatedToEndpointList, + isBuildingBlock, + maxSignals, + note, + ruleNameOverride, + threatIndicatorPath, + timestampOverride, + timestampOverrideFallbackDisabled, + ...rest + } = aboutStepData; + + const detectionExceptionLists = + exceptionsList != null ? exceptionsList.filter((list) => list.type !== 'endpoint') : []; + const isinvestigationFieldsEmpty = investigationFields.every((item) => isEmpty(item.trim())); + + const resp = { + author: author.filter((item) => !isEmpty(item)), + ...(isBuildingBlock ? { building_block_type: 'default' } : {}), + ...(isAssociatedToEndpointList + ? { + exceptions_list: [ + { + id: ENDPOINT_LIST_ID, + list_id: ENDPOINT_LIST_ID, + namespace_type: 'agnostic' as NamespaceType, + type: 'endpoint' as ExceptionListType, + }, + ...detectionExceptionLists, + ], + } + : exceptionsList != null + ? { + exceptions_list: [...detectionExceptionLists], + } + : {}), + false_positives: falsePositives.filter((item) => !isEmpty(item)), + references: references.filter((item) => !isEmpty(item)), + investigation_fields: isinvestigationFieldsEmpty + ? undefined + : { field_names: investigationFields }, + risk_score: riskScore.value, + risk_score_mapping: riskScore.isMappingChecked + ? filterOutEmptyRiskScoreMappingItems(riskScore.mapping) + : [], + rule_name_override: ruleNameOverride !== '' ? ruleNameOverride : undefined, + severity: severity.value, + severity_mapping: severity.isMappingChecked + ? filterOutEmptySeverityMappingItems(severity.mapping) + : [], + threat: filterEmptyThreats(threat).map((singleThreat) => ({ + ...singleThreat, + framework: 'MITRE ATT&CK', + })), + threat_indicator_path: threatIndicatorPath, + timestamp_override: timestampOverride !== '' ? timestampOverride : undefined, + timestamp_override_fallback_disabled: timestampOverrideFallbackDisabled, + ...(!isEmpty(note) ? { note } : {}), + max_signals: Number.isSafeInteger(maxSignals) ? maxSignals : undefined, + ...rest, + }; + return resp; +}; + +export const filterOutEmptyRiskScoreMappingItems = (riskScoreMapping: RiskScoreMappingItem[]) => + riskScoreMapping.filter((m) => m.field != null && m.field !== ''); + +export const filterOutEmptySeverityMappingItems = (severityMapping: SeverityMapping) => + severityMapping.filter((m) => m.field != null && m.field !== '' && m.value != null); + +export const filterOutEmptyRelatedIntegrations = (relatedIntegrations: RelatedIntegrationArray) => + relatedIntegrations.filter((ri) => !isEmpty(ri.package)); + +export const isRuleAction = ( + action: AlertingRuleAction | AlertingRuleSystemAction, + actionTypeRegistry: ActionTypeRegistryContract +): action is AlertingRuleAction => !actionTypeRegistry.get(action.actionTypeId).isSystemActionType; + +export const formatActionsStepData = ( + actionsStepData: ActionsStepRule, + actionTypeRegistry: ActionTypeRegistryContract +): ActionsStepRuleJson => { + const { actions = [], responseActions, enabled, kibanaSiemAppUrl } = actionsStepData; + + return { + actions: actions.map((action) => + isRuleAction(action, actionTypeRegistry) + ? transformAlertToRuleAction(action) + : transformAlertToRuleSystemAction(action) + ), + response_actions: responseActions?.map(transformAlertToRuleResponseAction), + enabled, + meta: { + kibana_siem_app_url: kibanaSiemAppUrl, + }, + }; +}; + +// Used to format form data in rule edit and +// create flows so "T" here would likely +// either be RuleCreateProps or Rule +export const formatRule = <T>( + defineStepData: DefineStepRule, + aboutStepData: AboutStepRule, + scheduleData: ScheduleStepRule, + actionsData: ActionsStepRule, + actionTypeRegistry: ActionTypeRegistryContract, + exceptionsList?: List[] +): T => + deepmerge.all([ + formatDefineStepData(defineStepData), + formatAboutStepData(aboutStepData, exceptionsList), + formatScheduleStepData(scheduleData), + formatActionsStepData(actionsData, actionTypeRegistry), + ]) as unknown as T; + +export const formatPreviewRule = ({ + defineRuleData, + aboutRuleData, + scheduleRuleData, + exceptionsList, + actionTypeRegistry, +}: { + defineRuleData: DefineStepRule; + aboutRuleData: AboutStepRule; + scheduleRuleData: ScheduleStepRule; + actionTypeRegistry: ActionTypeRegistryContract; + exceptionsList?: List[]; +}): RuleCreateProps => { + const aboutStepData = { + ...aboutRuleData, + name: 'Preview Rule', + description: 'Preview Rule', + }; + return { + ...formatRule<RuleCreateProps>( + defineRuleData, + aboutStepData, + scheduleRuleData, + stepActionsDefaultValue, + actionTypeRegistry, + exceptionsList + ), + }; +}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_creation/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/rule_editing/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/pages/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/alert_suppression_fields_validator_factory.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/alert_suppression_fields_validator_factory.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/alert_suppression_fields_validator_factory.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/alert_suppression_fields_validator_factory.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/data_view_id_validator_factory.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/data_view_id_validator_factory.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/data_view_id_validator_factory.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/data_view_id_validator_factory.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/default_risk_score_validator.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/default_risk_score_validator.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/default_risk_score_validator.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/default_risk_score_validator.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/index_pattern_validator_factory.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/index_pattern_validator_factory.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/index_pattern_validator_factory.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/index_pattern_validator_factory.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/kuery_validator_factory.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/kuery_validator_factory.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/kuery_validator_factory.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/kuery_validator_factory.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/max_signals_validator_factory.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/max_signals_validator_factory.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/max_signals_validator_factory.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/max_signals_validator_factory.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/query_required_validator_factory.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/query_required_validator_factory.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/query_required_validator_factory.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/validators/query_required_validator_factory.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/__mocks__/rule_details_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/__mocks__/rule_details_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/__mocks__/rule_details_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/__mocks__/rule_details_context.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/__snapshots__/execution_log_search_bar.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/__snapshots__/execution_log_search_bar.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/__snapshots__/execution_log_search_bar.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/__snapshots__/execution_log_search_bar.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_columns.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_search_bar.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_search_bar.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_search_bar.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_search_bar.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_search_bar.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_search_bar.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_search_bar.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_search_bar.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_table.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_table.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_table.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_table.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_table.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/rule_duration_format.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/rule_duration_format.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/rule_duration_format.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/rule_duration_format.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/rule_duration_format.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/rule_duration_format.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/rule_duration_format.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/rule_duration_format.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/legacy_url_conflict_callout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/legacy_url_conflict_callout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/legacy_url_conflict_callout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/legacy_url_conflict_callout.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/legacy_url_conflict_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/legacy_url_conflict_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/legacy_url_conflict_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/legacy_url_conflict_callout.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/rule_details_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/rule_details_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/rule_details_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/rule_details_context.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/use_redirect_legacy_url.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/use_redirect_legacy_url.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/use_redirect_legacy_url.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/use_redirect_legacy_url.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/use_redirect_legacy_url.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/use_redirect_legacy_url.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/use_redirect_legacy_url.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/use_redirect_legacy_url.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/use_rule_details_tabs.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/use_rule_details_tabs.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/use_rule_details_tabs.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/use_rule_details_tabs.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/use_rule_details_tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/use_rule_details_tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/use_rule_details_tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/use_rule_details_tabs.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/helpers.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/reducer.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/use_add_new_exceptions.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/use_add_new_exceptions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/use_add_new_exceptions.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/add_exception_flyout/use_add_new_exceptions.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/all_items.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/all_items.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/all_items.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/all_items.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/all_items.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/all_items.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/all_items.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/all_items.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/empty_viewer_state.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/empty_viewer_state.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/empty_viewer_state.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/empty_viewer_state.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/empty_viewer_state.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/empty_viewer_state.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/empty_viewer_state.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/empty_viewer_state.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/pagination.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/pagination.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/pagination.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/pagination.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/pagination.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/pagination.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/pagination.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/pagination.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/reducer.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/search_bar.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/search_bar.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/search_bar.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/search_bar.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/search_bar.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/search_bar.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/search_bar.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/search_bar.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/utility_bar.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/utility_bar.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/utility_bar.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/utility_bar.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/utility_bar.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/utility_bar.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/utility_bar.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/all_exception_items_table/utility_bar.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/reducer.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/use_edit_exception.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/use_edit_exception.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/use_edit_exception.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/edit_exception_flyout/use_edit_exception.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/error_callout/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/error_callout/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/error_callout/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/error_callout/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/error_callout/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/error_callout/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/error_callout/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/error_callout/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/comments.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/comments.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/comments.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/comments.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/conditions.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/conditions.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/conditions.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/conditions.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/conditions.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/conditions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/conditions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/conditions.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/header.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/header.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/header.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/header.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/header.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/header.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/meta.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/meta.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/meta.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/meta.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/meta.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/meta.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/meta.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/meta.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/exception_item_card/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_exception_to_rule_or_list/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_exception_to_rule_or_list/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_exception_to_rule_or_list/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_exception_to_rule_or_list/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_exception_to_rule_or_list/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_exception_to_rule_or_list/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_exception_to_rule_or_list/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_exception_to_rule_or_list/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_exception_to_rule_or_list/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_exception_to_rule_or_list/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_exception_to_rule_or_list/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_exception_to_rule_or_list/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_options/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_options/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_options/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_options/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_options/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_options/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_options/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_options/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_options/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_options/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_options/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_options/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/link_list_switch/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/link_list_switch/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/link_list_switch/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/link_list_switch/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/link_list_switch/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/link_list_switch/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/link_list_switch/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/link_list_switch/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/use_add_to_lists_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/use_add_to_lists_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/use_add_to_lists_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_lists_table/use_add_to_lists_table.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_options/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_options/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_options/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_options/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_options/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_options/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_options/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_options/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/link_rule_switch/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/link_rule_switch/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/link_rule_switch/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/link_rule_switch/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/link_rule_switch/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/link_rule_switch/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/link_rule_switch/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/link_rule_switch/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/use_add_to_rules_table.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/use_add_to_rules_table.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/use_add_to_rules_table.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/use_add_to_rules_table.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/use_add_to_rules_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/use_add_to_rules_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/use_add_to_rules_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/use_add_to_rules_table.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/utils.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/alerts_actions/utils.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/expire_time/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/expire_time/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/expire_time/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/expire_time/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/expire_time/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/expire_time/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/expire_time/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/expire_time/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/footer/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/footer/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/footer/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/footer/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/footer/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/footer/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/footer/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/footer/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/footer/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/footer/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/footer/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/footer/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/header/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/header/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/header/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/header/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/header/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/header/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/header/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/header/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/header/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/header/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/header/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/header/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_conditions/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_conditions/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_conditions/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_conditions/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_conditions/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_conditions/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_conditions/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_conditions/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_conditions/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_conditions/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_conditions/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_conditions/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_meta_form/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_meta_form/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_meta_form/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_meta_form/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_meta_form/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_meta_form/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_meta_form/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_meta_form/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_meta_form/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_meta_form/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_meta_form/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/item_meta_form/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_list/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_list/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_list/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_list/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_list/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_list/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_list/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_list/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_list/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_list/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_list/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_list/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_rule/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_rule/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_rule/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_rule/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_rule/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_rule/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_rule/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_rule/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_rule/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_rule/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_rule/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/linked_to_rule/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/utils.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/utils.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/utils.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/utils.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/utils.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/utils.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/utils.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/utils.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/item_comments/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/item_comments/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/item_comments/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/item_comments/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/item_comments/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/item_comments/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/item_comments/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/item_comments/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/item_comments/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/item_comments/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/item_comments/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/item_comments/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/__tests__/__snapshots__/value_with_space_warning.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/__tests__/__snapshots__/value_with_space_warning.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/__tests__/__snapshots__/value_with_space_warning.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/__tests__/__snapshots__/value_with_space_warning.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/__tests__/use_value_with_space_warning.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/__tests__/use_value_with_space_warning.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/__tests__/use_value_with_space_warning.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/__tests__/use_value_with_space_warning.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/__tests__/value_with_space_warning.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/__tests__/value_with_space_warning.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/__tests__/value_with_space_warning.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/__tests__/value_with_space_warning.test.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/index.ts new file mode 100644 index 0000000000000..968bc9666b090 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/index.ts @@ -0,0 +1,8 @@ +/* + * 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. + */ + +export { ValueWithSpaceWarning } from './value_with_space_warning'; diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/use_value_with_space_warning.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/use_value_with_space_warning.ts new file mode 100644 index 0000000000000..252f05f4d1020 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/use_value_with_space_warning.ts @@ -0,0 +1,31 @@ +/* + * 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 { paramContainsSpace, autoCompletei18n } from '@kbn/securitysolution-autocomplete'; + +interface UseValueWithSpaceWarningResult { + showSpaceWarningIcon: boolean; + warningText: string; +} +interface UseValueWithSpaceWarningProps { + value: string | string[]; + tooltipIconText?: string; +} + +export const useValueWithSpaceWarning = ({ + value, + tooltipIconText, +}: UseValueWithSpaceWarningProps): UseValueWithSpaceWarningResult => { + const showSpaceWarningIcon = Array.isArray(value) + ? value.find(paramContainsSpace) + : paramContainsSpace(value); + + return { + showSpaceWarningIcon: !!showSpaceWarningIcon, + warningText: tooltipIconText || autoCompletei18n.FIELD_SPACE_WARNING, + }; +}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/value_with_space_warning.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/value_with_space_warning.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/value_with_space_warning.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/value_with_space_warning.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/logic/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/logic/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_add_rule_exception.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_add_rule_exception.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_add_rule_exception.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_add_rule_exception.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_close_alerts.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_close_alerts.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_close_alerts.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_close_alerts.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_create_update_exception.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_create_update_exception.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_create_update_exception.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_create_update_exception.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_exception_flyout_data.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_exception_flyout_data.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_exception_flyout_data.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_exception_flyout_data.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_fetch_or_create_rule_exception_list.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_fetch_or_create_rule_exception_list.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_fetch_or_create_rule_exception_list.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_fetch_or_create_rule_exception_list.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_fetch_or_create_rule_exception_list.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_fetch_or_create_rule_exception_list.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_fetch_or_create_rule_exception_list.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_fetch_or_create_rule_exception_list.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_find_references.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_find_references.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_find_references.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_find_references.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/utils/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/utils/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/utils/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/utils/constants.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/utils/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/utils/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/utils/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/utils/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/utils/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/utils/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/utils/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/utils/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/utils/highlighted_fields_config.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/utils/highlighted_fields_config.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/utils/highlighted_fields_config.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/utils/highlighted_fields_config.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/utils/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/utils/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/utils/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/utils/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/utils/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/utils/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/utils/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_exceptions/utils/types.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/api/__mocks__/api.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/api/__mocks__/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/api/__mocks__/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/api/__mocks__/api.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/api/api.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/api/api.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/api/api.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/api/api.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/api/api.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/api/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/api/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/api/api.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/api/hooks/use_delete_backfill.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/api/hooks/use_delete_backfill.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/api/hooks/use_delete_backfill.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/api/hooks/use_delete_backfill.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/api/hooks/use_find_backfills_for_rules.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/api/hooks/use_find_backfills_for_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/api/hooks/use_find_backfills_for_rules.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/api/hooks/use_find_backfills_for_rules.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/api/hooks/use_schedule_rule_run_mutation.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/api/hooks/use_schedule_rule_run_mutation.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/api/hooks/use_schedule_rule_run_mutation.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/api/hooks/use_schedule_rule_run_mutation.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/api/hooks/use_schedule_rule_run_mutation.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/api/hooks/use_schedule_rule_run_mutation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/api/hooks/use_schedule_rule_run_mutation.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/api/hooks/use_schedule_rule_run_mutation.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/components/manual_rule_run/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/manual_rule_run/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/components/manual_rule_run/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/manual_rule_run/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/components/manual_rule_run/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/manual_rule_run/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/components/manual_rule_run/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/manual_rule_run/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/components/manual_rule_run/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/manual_rule_run/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/components/manual_rule_run/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/manual_rule_run/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/components/manual_rule_run/use_manual_rule_run_confirmation.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/manual_rule_run/use_manual_rule_run_confirmation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/components/manual_rule_run/use_manual_rule_run_confirmation.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/manual_rule_run/use_manual_rule_run_confirmation.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/backfill_status.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/backfill_status.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/backfill_status.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/backfill_status.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/stop_backfill.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/stop_backfill.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/stop_backfill.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/stop_backfill.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/stop_backfill.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/stop_backfill.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/stop_backfill.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/stop_backfill.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/utils.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/rule_backfills_info/utils.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/logic/__mocks__/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/logic/__mocks__/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/logic/__mocks__/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/logic/__mocks__/mock.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/logic/use_schedule_rule_run.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/logic/use_schedule_rule_run.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/logic/use_schedule_rule_run.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/logic/use_schedule_rule_run.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/logic/use_schedule_rule_run.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/logic/use_schedule_rule_run.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/logic/use_schedule_rule_run.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/logic/use_schedule_rule_run.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_gaps/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/types.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/__mocks__/api.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/__mocks__/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/__mocks__/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/__mocks__/api.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/api.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/api.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/api.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/api.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/api.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/api.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/__mocks__/mock_react_query_response.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/__mocks__/mock_react_query_response.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/__mocks__/mock_react_query_response.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/__mocks__/mock_react_query_response.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/__mocks__/use_prebuilt_rules_status_query.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/__mocks__/use_prebuilt_rules_status_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/__mocks__/use_prebuilt_rules_status_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/__mocks__/use_prebuilt_rules_status_query.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/constants.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_fetch_prebuilt_rules_install_review_query.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_fetch_prebuilt_rules_install_review_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_fetch_prebuilt_rules_install_review_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_fetch_prebuilt_rules_install_review_query.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_fetch_prebuilt_rules_status_query.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_fetch_prebuilt_rules_status_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_fetch_prebuilt_rules_status_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_fetch_prebuilt_rules_status_query.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_fetch_prebuilt_rules_upgrade_review_query.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_fetch_prebuilt_rules_upgrade_review_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_fetch_prebuilt_rules_upgrade_review_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_fetch_prebuilt_rules_upgrade_review_query.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_perform_all_rules_install_mutation.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_perform_all_rules_install_mutation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_perform_all_rules_install_mutation.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_perform_all_rules_install_mutation.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_perform_specific_rules_install_mutation.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_perform_specific_rules_install_mutation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_perform_specific_rules_install_mutation.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_perform_specific_rules_install_mutation.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_perform_specific_rules_upgrade_mutation.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_perform_specific_rules_upgrade_mutation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_perform_specific_rules_upgrade_mutation.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/prebuilt_rules/use_perform_specific_rules_upgrade_mutation.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bootstrap_prebuilt_rules.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bootstrap_prebuilt_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bootstrap_prebuilt_rules.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bootstrap_prebuilt_rules.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_action_mutation.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_action_mutation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_action_mutation.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_action_mutation.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_export_mutation.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_export_mutation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_export_mutation.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_bulk_export_mutation.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_create_rule_mutation.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_create_rule_mutation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_create_rule_mutation.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_create_rule_mutation.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_connector_types_query.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_connector_types_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_connector_types_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_connector_types_query.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_connectors_query.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_connectors_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_connectors_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_connectors_query.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_coverage_overview_query.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_coverage_overview_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_coverage_overview_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_coverage_overview_query.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_rule_by_id_query.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_rule_by_id_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_rule_by_id_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_rule_by_id_query.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_rule_management_filters_query.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_rule_management_filters_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_rule_management_filters_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_rule_management_filters_query.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_rules_snooze_settings_query.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_rules_snooze_settings_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_rules_snooze_settings_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_fetch_rules_snooze_settings_query.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_find_rules_query.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_find_rules_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_find_rules_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_find_rules_query.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_update_rule_mutation.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_update_rule_mutation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_update_rule_mutation.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/api/hooks/use_update_rule_mutation.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/badge_list.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/badge_list.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/badge_list.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/badge_list.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/constants.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/customized_prebuilt_rule_badge.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/customized_prebuilt_rule_badge.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/customized_prebuilt_rule_badge.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/customized_prebuilt_rule_badge.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/diff_components/field_diff.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/diff_components/field_diff.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/diff_components/field_diff.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/diff_components/field_diff.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/diff_components/header_bar.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/diff_components/header_bar.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/diff_components/header_bar.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/diff_components/header_bar.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/diff_components/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/diff_components/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/diff_components/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/diff_components/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/diff_components/rule_diff_section.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/diff_components/rule_diff_section.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/diff_components/rule_diff_section.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/diff_components/rule_diff_section.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/diff_components/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/diff_components/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/diff_components/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/diff_components/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/helpers.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/constants.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/diff_view.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/diff_view.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/diff_view.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/diff_view.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/hunks.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/hunks.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/hunks.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/hunks.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/json_diff.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/json_diff.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/json_diff.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/json_diff.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/mark_edits.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/mark_edits.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/mark_edits.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/mark_edits.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/unidiff.d.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/unidiff.d.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/unidiff.d.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/json_diff/unidiff.d.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/per_field_diff/get_field_diffs_for_grouped_fields.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/per_field_diff/get_field_diffs_for_grouped_fields.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/per_field_diff/get_field_diffs_for_grouped_fields.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/per_field_diff/get_field_diffs_for_grouped_fields.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/per_field_diff/get_formatted_field_diff.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/per_field_diff/get_formatted_field_diff.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/per_field_diff/get_formatted_field_diff.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/per_field_diff/get_formatted_field_diff.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/per_field_rule_diff_tab.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/per_field_rule_diff_tab.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/per_field_rule_diff_tab.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/per_field_rule_diff_tab.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/per_field_rule_diff_tab.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/per_field_rule_diff_tab.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/per_field_rule_diff_tab.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/per_field_rule_diff_tab.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/required_field_icon.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/required_field_icon.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/required_field_icon.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/required_field_icon.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_about_section.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_about_section.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_about_section.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_about_section.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_definition_section.styles.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_definition_section.styles.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_definition_section.styles.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_definition_section.styles.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_definition_section.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_definition_section.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_definition_section.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_definition_section.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_definition_section.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_definition_section.tsx similarity index 95% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_definition_section.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_definition_section.tsx index 3e08f4ce3acc8..de4fce3da3686 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_definition_section.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_definition_section.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React from 'react'; +import React, { useMemo } from 'react'; import { isEmpty } from 'lodash/fp'; import { EuiDescriptionList, @@ -23,8 +23,8 @@ import type { import type { Filter } from '@kbn/es-query'; import type { SavedQuery } from '@kbn/data-plugin/public'; import { mapAndFlattenFilters } from '@kbn/data-plugin/public'; -import type { DataView } from '@kbn/data-views-plugin/public'; import { FilterItems } from '@kbn/unified-search-plugin/public'; +import { isDataView } from '../../../../common/components/query_bar'; import type { AlertSuppressionMissingFieldsStrategy, EqlOptionalFields, @@ -40,10 +40,7 @@ import { AlertSuppressionLabel } from '../../../rule_creation_ui/components/desc import { useGetSavedQuery } from '../../../../detections/pages/detection_engine/rules/use_get_saved_query'; import * as threatMatchI18n from '../../../../common/components/threat_match/translations'; import * as timelinesI18n from '../../../../timelines/components/timeline/translations'; -import { useRuleIndexPattern } from '../../../rule_creation_ui/pages/form'; -import { DataSourceType } from '../../../../detections/pages/detection_engine/rules/types'; import type { Duration } from '../../../../detections/pages/detection_engine/rules/types'; -import { convertHistoryStartToSize } from '../../../../detections/pages/detection_engine/rules/helpers'; import { MlJobsDescription } from '../../../rule_creation/components/ml_jobs_description/ml_jobs_description'; import { MlJobLink } from '../../../rule_creation/components/ml_job_link/ml_job_link'; import { useSecurityJobs } from '../../../../common/components/ml_popover/hooks/use_security_jobs'; @@ -60,11 +57,14 @@ import { } from './rule_definition_section.styles'; import { getQueryLanguageLabel } from './helpers'; import { useDefaultIndexPattern } from '../../hooks/use_default_index_pattern'; +import { convertDateMathToDuration } from '../../../../common/utils/date_math'; +import { DEFAULT_HISTORY_WINDOW_SIZE } from '../../../../common/constants'; import { EQL_OPTIONS_EVENT_CATEGORY_FIELD_LABEL, EQL_OPTIONS_EVENT_TIEBREAKER_FIELD_LABEL, EQL_OPTIONS_EVENT_TIMESTAMP_FIELD_LABEL, } from '../../../rule_creation/components/eql_query_edit/translations'; +import { useDataView } from './three_way_diff/final_edit/fields/hooks/use_data_view'; interface SavedQueryNameProps { savedQueryName: string; @@ -89,16 +89,34 @@ export const Filters = ({ index, 'data-test-subj': dataTestSubj, }: FiltersProps) => { - const flattenedFilters = mapAndFlattenFilters(filters); - const defaultIndexPattern = useDefaultIndexPattern(); + const useDataViewParams = dataViewId + ? { dataViewId } + : { indexPatterns: index ?? defaultIndexPattern }; + const { dataView } = useDataView(useDataViewParams); + const isEsql = filters.some((filter) => filter?.query?.language === 'esql'); + const searchBarFilters = useMemo(() => { + if (!index || isDataView(index) || isEsql) { + return filters; + } + const filtersWithUpdatedMetaIndex = filters.map((filter) => { + return { + ...filter, + meta: { + ...filter.meta, + index: index.join(','), + }, + }; + }); - const { indexPattern } = useRuleIndexPattern({ - dataSourceType: dataViewId ? DataSourceType.DataView : DataSourceType.IndexPatterns, - index: index ?? defaultIndexPattern, - dataViewId, - }); + return filtersWithUpdatedMetaIndex; + }, [filters, index, isEsql]); + + if (!dataView) { + return null; + } + const flattenedFilters = mapAndFlattenFilters(searchBarFilters); const styles = filtersStyles; return ( @@ -109,7 +127,7 @@ export const Filters = ({ responsive={false} gutterSize="xs" > - <FilterItems filters={flattenedFilters} indexPatterns={[indexPattern as DataView]} readOnly /> + <FilterItems filters={flattenedFilters} indexPatterns={[dataView]} readOnly /> </EuiFlexGroup> ); }; @@ -418,7 +436,9 @@ interface HistoryWindowSizeProps { } export const HistoryWindowSize = ({ historyWindowStart }: HistoryWindowSizeProps) => { - const size = historyWindowStart ? convertHistoryStartToSize(historyWindowStart) : '7d'; + const size = historyWindowStart + ? convertDateMathToDuration(historyWindowStart) + : DEFAULT_HISTORY_WINDOW_SIZE; return ( <EuiText size="s" data-test-subj={`newTermsWindowSizePropertyValue-${historyWindowStart}`}> diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_details_flyout.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_details_flyout.tsx similarity index 92% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_details_flyout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_details_flyout.tsx index 3425779926f7d..3909a9af5a60c 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_details_flyout.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_details_flyout.tsx @@ -40,6 +40,13 @@ const StyledEuiFlyoutBody = styled(EuiFlyoutBody)` display: flex; flex: 1; overflow: hidden; + /* + Removes "transform: translateZ(0)" from EuiFlyoutBody styles to avoid creating a new stacking context. + Fixed elements inside the flyout body are now correctly positioned relative to the viewport. + See: https://github.com/elastic/eui/blob/ffd0cbca4d323ad0b1d5a73c252380d93178e5e7/packages/eui/src/global_styling/mixins/_helpers.ts#L122 + The Chrome bug mentioned in the link above no longer reproduces, so this change is safe. + */ + transform: none; .euiFlyoutBody__overflowContent { flex: 1; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_diff_tab.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_diff_tab.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_diff_tab.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_diff_tab.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_investigation_guide_tab.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_investigation_guide_tab.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_investigation_guide_tab.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_investigation_guide_tab.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_overview_tab.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_overview_tab.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_overview_tab.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_overview_tab.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_schedule_section.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_schedule_section.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_schedule_section.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_schedule_section.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_setup_guide_section.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_setup_guide_section.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_setup_guide_section.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_setup_guide_section.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/action_required.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/action_required.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/action_required.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/action_required.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/modified_badge.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/modified_badge.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/modified_badge.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/modified_badge.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/ready_for_upgrade_badge.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/ready_for_upgrade_badge.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/ready_for_upgrade_badge.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/ready_for_upgrade_badge.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/review_required_badge.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/review_required_badge.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/review_required_badge.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/review_required_badge.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/comparison_side_help_info.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/comparison_side_help_info.tsx similarity index 98% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/comparison_side_help_info.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/comparison_side_help_info.tsx index 37b23652bfcbe..1f4e6a255fb86 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/comparison_side_help_info.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/comparison_side_help_info.tsx @@ -57,7 +57,7 @@ export function ComparisonSideHelpInfo({ options }: ComparisonSideHelpInfoProps) <ul> {optionsWithDescriptions.map( ({ title: displayName, description: explanation }) => ( - <li> + <li key={displayName}> <strong>{displayName}</strong> {'-'} {explanation} </li> ) diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/constants.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/field_comparison_side.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/field_comparison_side.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/field_comparison_side.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/field_comparison_side.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/field_comparison_side.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/field_comparison_side.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/field_comparison_side.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/field_comparison_side.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/building_block.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/building_block.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/building_block.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/building_block.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/data_source.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/data_source.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/data_source.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/data_source.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/eql_query.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/eql_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/eql_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/eql_query.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/esql_query.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/esql_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/esql_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/esql_query.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/kql_query.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/kql_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/kql_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/kql_query.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/rule_name_override.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/rule_name_override.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/rule_name_override.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/rule_name_override.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/rule_schedule.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/rule_schedule.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/rule_schedule.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/rule_schedule.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/threat_query.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/threat_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/threat_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/threat_query.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/threshold.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/threshold.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/threshold.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/threshold.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/timeline_template.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/timeline_template.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/timeline_template.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/timeline_template.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/timestamp_override.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/timestamp_override.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/timestamp_override.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/timestamp_override.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/no_changes.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/no_changes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/no_changes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/no_changes.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/subfield.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/subfield.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/subfield.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/subfield.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/subfield_changes.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/subfield_changes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/subfield_changes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/subfield_changes.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/subfield_header.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/subfield_header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/subfield_header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/subfield_header.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/types.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/utils.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/constants.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/versions_picker.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/versions_picker.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/versions_picker.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/versions_picker.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/versions_picker.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/versions_picker.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/versions_picker.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/versions_picker.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_content.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_content.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_header.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_header.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_help_info.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_help_info.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_help_info.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_help_info.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/rule_field_edit_component_props.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/rule_field_edit_component_props.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/rule_field_edit_component_props.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/rule_field_edit_component_props.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/rule_field_edit_form_wrapper.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/rule_field_edit_form_wrapper.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/rule_field_edit_form_wrapper.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/rule_field_edit_form_wrapper.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/context/field_edit_form_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/context/field_edit_form_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/context/field_edit_form_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/context/field_edit_form_context.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_upgrade_side_header.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_upgrade_side_header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_upgrade_side_header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_upgrade_side_header.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/common_rule_field_edit.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/common_rule_field_edit.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/common_rule_field_edit.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/common_rule_field_edit.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/custom_query_rule_field_edit.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/custom_query_rule_field_edit.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/custom_query_rule_field_edit.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/custom_query_rule_field_edit.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/eql_rule_field_edit.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/eql_rule_field_edit.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/eql_rule_field_edit.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/eql_rule_field_edit.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/esql_rule_field_edit.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/esql_rule_field_edit.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/esql_rule_field_edit.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/esql_rule_field_edit.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/field_final_edit.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/field_final_edit.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/field_final_edit.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/field_final_edit.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/form_schema.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/form_schema.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/form_schema.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/form_schema.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/suppression_edit_adapter.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/suppression_edit_adapter.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/suppression_edit_adapter.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/suppression_edit_adapter.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/suppression_edit_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/suppression_edit_form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/suppression_edit_form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/suppression_edit_form.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/building_block.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/building_block.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/building_block.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/building_block.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_edit.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_edit.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_edit.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_edit.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_edit_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_edit_form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_edit_form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_edit_form.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_info_text.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_info_text.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_info_text.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_info_text.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_type_selector_field.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_type_selector_field.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_type_selector_field.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_type_selector_field.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_view_field.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_view_field.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_view_field.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_view_field.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/index_pattern_edit.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/index_pattern_edit.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/index_pattern_edit.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/index_pattern_edit.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/description.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/description.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/description.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/description.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/eql_query/eql_query_edit_adapter.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/eql_query/eql_query_edit_adapter.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/eql_query/eql_query_edit_adapter.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/eql_query/eql_query_edit_adapter.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/eql_query/eql_query_edit_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/eql_query/eql_query_edit_form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/eql_query/eql_query_edit_form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/eql_query/eql_query_edit_form.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/eql_query/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/eql_query/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/eql_query/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/eql_query/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/esql_query/esql_query_edit_adapter.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/esql_query/esql_query_edit_adapter.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/esql_query/esql_query_edit_adapter.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/esql_query/esql_query_edit_adapter.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/esql_query/esql_query_edit_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/esql_query/esql_query_edit_form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/esql_query/esql_query_edit_form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/esql_query/esql_query_edit_form.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/esql_query/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/esql_query/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/esql_query/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/esql_query/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/false_positives.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/false_positives.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/false_positives.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/false_positives.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/history_window_start/history_window_start_edit_adapter.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/history_window_start/history_window_start_edit_adapter.tsx new file mode 100644 index 0000000000000..084a81e3b9599 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/history_window_start/history_window_start_edit_adapter.tsx @@ -0,0 +1,13 @@ +/* + * 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 { HistoryWindowStartEdit } from '../../../../../../../rule_creation/components/history_window_start_edit'; + +export function HistoryWindowStartEditAdapter(): JSX.Element { + return <HistoryWindowStartEdit path="historyWindowSize" />; +} diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/history_window_start/history_window_start_edit_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/history_window_start/history_window_start_edit_form.tsx new file mode 100644 index 0000000000000..87ac2fee64e7b --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/history_window_start/history_window_start_edit_form.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 React from 'react'; +import { type FormData } from '../../../../../../../../shared_imports'; +import { HistoryWindowStartEditAdapter } from './history_window_start_edit_adapter'; +import type { HistoryWindowStart } from '../../../../../../../../../common/api/detection_engine'; +import { + convertDurationToDateMath, + convertDateMathToDuration, +} from '../../../../../../../../common/utils/date_math'; +import { DEFAULT_HISTORY_WINDOW_SIZE } from '../../../../../../../../common/constants'; +import { RuleFieldEditFormWrapper } from '../../../field_final_side'; + +export function HistoryWindowStartEditForm(): JSX.Element { + return ( + <RuleFieldEditFormWrapper + component={HistoryWindowStartEditAdapter} + ruleFieldFormSchema={schema} + deserializer={deserializer} + serializer={serializer} + /> + ); +} + +interface HistoryWindowFormData { + historyWindowSize: HistoryWindowStart; +} + +function deserializer(defaultValue: FormData): HistoryWindowFormData { + return { + historyWindowSize: defaultValue.history_window_start + ? convertDateMathToDuration(defaultValue.history_window_start) + : DEFAULT_HISTORY_WINDOW_SIZE, + }; +} + +function serializer(formData: FormData): { history_window_start: HistoryWindowStart } { + return { + history_window_start: convertDurationToDateMath(formData.historyWindowSize), + }; +} + +const schema = {}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/hooks/use_data_view.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/hooks/use_data_view.ts similarity index 94% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/hooks/use_data_view.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/hooks/use_data_view.ts index 4cfb307665308..123a7b3cffb58 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/hooks/use_data_view.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/hooks/use_data_view.ts @@ -9,7 +9,7 @@ import { useEffect, useState } from 'react'; import type { DataView } from '@kbn/data-views-plugin/common'; import { useKibana } from '../../../../../../../../common/lib/kibana'; -type UseDataViewParams = +export type UseDataViewParams = | { indexPatterns: string[]; dataViewId?: never } | { indexPatterns?: never; dataViewId: string }; @@ -33,6 +33,7 @@ export function useDataView(indexPatternsOrDataViewId: UseDataViewParams): UseDa if (indexPatternsOrDataViewId.indexPatterns) { const indexPatternsDataView = await dataViewsService.create({ title: indexPatternsOrDataViewId.indexPatterns.join(','), + id: indexPatternsOrDataViewId.indexPatterns.join(','), allowNoIndex: true, }); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/hooks/use_diffable_rule_data_view.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/hooks/use_diffable_rule_data_view.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/hooks/use_diffable_rule_data_view.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/hooks/use_diffable_rule_data_view.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/investigation_fields.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/investigation_fields.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/investigation_fields.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/investigation_fields.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/kql_query_edit.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/kql_query_edit.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/kql_query_edit.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/kql_query_edit.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/kql_query_edit_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/kql_query_edit_form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/kql_query_edit_form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/kql_query_edit_form.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/max_signals.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/max_signals.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/max_signals.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/max_signals.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/name.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/name.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/name.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/name.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/new_terms_fields/new_terms_fields_edit_adapter.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/new_terms_fields/new_terms_fields_edit_adapter.tsx new file mode 100644 index 0000000000000..476bf9869bd96 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/new_terms_fields/new_terms_fields_edit_adapter.tsx @@ -0,0 +1,26 @@ +/* + * 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 { NewTermsFieldsEdit } from '../../../../../../../rule_creation/components/new_terms_fields_edit'; +import { useDiffableRuleDataView } from '../hooks/use_diffable_rule_data_view'; +import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; +import { useTermsAggregationFields } from '../../../../../../../../common/hooks/use_terms_aggregation_fields'; + +interface NewTermsFieldsEditAdapterProps { + finalDiffableRule: DiffableRule; +} + +export function NewTermsFieldsEditAdapter({ + finalDiffableRule, +}: NewTermsFieldsEditAdapterProps): JSX.Element { + const { dataView } = useDiffableRuleDataView(finalDiffableRule); + const termsAggregationFields = useTermsAggregationFields(dataView?.fields ?? []); + const fieldNames = termsAggregationFields.map((field) => field.name); + + return <NewTermsFieldsEdit path="new_terms_fields" fieldNames={fieldNames} />; +} diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/new_terms_fields/new_terms_fields_edit_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/new_terms_fields/new_terms_fields_edit_form.tsx new file mode 100644 index 0000000000000..9b8d709b27f06 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/new_terms_fields/new_terms_fields_edit_form.tsx @@ -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 React from 'react'; +import { RuleFieldEditFormWrapper } from '../../../field_final_side'; +import { NewTermsFieldsEditAdapter } from './new_terms_fields_edit_adapter'; + +export function NewTermsFieldsEditForm(): JSX.Element { + return ( + <RuleFieldEditFormWrapper component={NewTermsFieldsEditAdapter} ruleFieldFormSchema={schema} /> + ); +} + +const schema = {}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/note.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/note.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/note.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/note.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/references.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/references.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/references.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/references.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/related_integrations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/related_integrations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/related_integrations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/related_integrations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/required_fields.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/required_fields.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/required_fields.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/required_fields.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/risk_score.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/risk_score.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/risk_score.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/risk_score.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/risk_score_mapping.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/risk_score_mapping.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/risk_score_mapping.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/risk_score_mapping.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/rule_name_override.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/rule_name_override.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/rule_name_override.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/rule_name_override.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/rule_schedule.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/rule_schedule.tsx similarity index 84% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/rule_schedule.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/rule_schedule.tsx index 12e7bbea9a20a..3acd7c3050fbb 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/rule_schedule.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/rule_schedule.tsx @@ -10,8 +10,8 @@ import { parseDuration } from '@kbn/alerting-plugin/common'; import { type FormSchema, type FormData, UseField } from '../../../../../../../shared_imports'; import { schema } from '../../../../../../rule_creation_ui/components/step_schedule_rule/schema'; import type { RuleSchedule } from '../../../../../../../../common/api/detection_engine'; -import { ScheduleItem } from '../../../../../../rule_creation/components/schedule_item_form'; import { secondsToDurationString } from '../../../../../../../detections/pages/detection_engine/rules/helpers'; +import { ScheduleItemField } from '../../../../../../rule_creation/components/schedule_item_field'; export const ruleScheduleSchema = { interval: schema.interval, @@ -28,8 +28,8 @@ const componentProps = { export function RuleScheduleEdit(): JSX.Element { return ( <> - <UseField path="interval" component={ScheduleItem} componentProps={componentProps} /> - <UseField path="from" component={ScheduleItem} componentProps={componentProps} /> + <UseField path="interval" component={ScheduleItemField} componentProps={componentProps} /> + <UseField path="from" component={ScheduleItemField} componentProps={componentProps} /> </> ); } diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/setup.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/setup.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/setup.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/setup.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/severity.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/severity.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/severity.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/severity.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/severity_mapping.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/severity_mapping.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/severity_mapping.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/severity_mapping.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/tags.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/tags.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/tags.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/tags.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/threat.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/threat.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/threat.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/threat.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/threshold_alert_suppression/form_schema.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/threshold_alert_suppression/form_schema.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/threshold_alert_suppression/form_schema.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/threshold_alert_suppression/form_schema.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/threshold_alert_suppression/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/threshold_alert_suppression/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/threshold_alert_suppression/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/threshold_alert_suppression/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/threshold_alert_suppression/suppression_edit_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/threshold_alert_suppression/suppression_edit_form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/threshold_alert_suppression/suppression_edit_form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/threshold_alert_suppression/suppression_edit_form.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/timeline_template.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/timeline_template.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/timeline_template.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/timeline_template.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/timestamp_override.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/timestamp_override.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/timestamp_override.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/timestamp_override.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/machine_learning_rule_field_edit.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/machine_learning_rule_field_edit.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/machine_learning_rule_field_edit.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/machine_learning_rule_field_edit.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/new_terms_rule_field_edit.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/new_terms_rule_field_edit.tsx new file mode 100644 index 0000000000000..f47607abe3844 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/new_terms_rule_field_edit.tsx @@ -0,0 +1,36 @@ +/* + * 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 { UpgradeableNewTermsFields } from '../../../../model/prebuilt_rule_upgrade/fields'; +import { AlertSuppressionEditForm } from './fields/alert_suppression'; +import { DataSourceEditForm } from './fields/data_source'; +import { HistoryWindowStartEditForm } from './fields/history_window_start/history_window_start_edit_form'; +import { KqlQueryEditForm } from './fields/kql_query'; +import { NewTermsFieldsEditForm } from './fields/new_terms_fields/new_terms_fields_edit_form'; +import { assertUnreachable } from '../../../../../../../common/utility_types'; + +interface NewTermsRuleFieldEditProps { + fieldName: UpgradeableNewTermsFields; +} + +export function NewTermsRuleFieldEdit({ fieldName }: NewTermsRuleFieldEditProps) { + switch (fieldName) { + case 'alert_suppression': + return <AlertSuppressionEditForm />; + case 'data_source': + return <DataSourceEditForm />; + case 'history_window_start': + return <HistoryWindowStartEditForm />; + case 'kql_query': + return <KqlQueryEditForm />; + case 'new_terms_fields': + return <NewTermsFieldsEditForm />; + default: + return assertUnreachable(fieldName); + } +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/saved_query_rule_field_edit.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/saved_query_rule_field_edit.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/saved_query_rule_field_edit.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/saved_query_rule_field_edit.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/threat_match_rule_field_edit.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/threat_match_rule_field_edit.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/threat_match_rule_field_edit.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/threat_match_rule_field_edit.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/threshold_rule_field_edit.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/threshold_rule_field_edit.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/threshold_rule_field_edit.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/threshold_rule_field_edit.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/utils.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/common_rule_field_readonly.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/common_rule_field_readonly.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/common_rule_field_readonly.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/common_rule_field_readonly.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/custom_query_rule_field_readonly.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/custom_query_rule_field_readonly.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/custom_query_rule_field_readonly.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/custom_query_rule_field_readonly.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/empty_field_value_placeholder/empty_field_value_placeholder.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/empty_field_value_placeholder/empty_field_value_placeholder.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/empty_field_value_placeholder/empty_field_value_placeholder.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/empty_field_value_placeholder/empty_field_value_placeholder.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/empty_field_value_placeholder/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/empty_field_value_placeholder/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/empty_field_value_placeholder/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/empty_field_value_placeholder/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/empty_field_value_placeholder/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/empty_field_value_placeholder/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/empty_field_value_placeholder/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/empty_field_value_placeholder/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/eql_rule_field_readonly.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/eql_rule_field_readonly.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/eql_rule_field_readonly.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/eql_rule_field_readonly.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/esql_rule_field_readonly.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/esql_rule_field_readonly.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/esql_rule_field_readonly.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/esql_rule_field_readonly.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/field_final_readonly.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/field_final_readonly.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/field_final_readonly.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/field_final_readonly.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/alert_suppression/alert_suppression.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/alert_suppression/alert_suppression.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/alert_suppression/alert_suppression.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/alert_suppression/alert_suppression.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/alert_suppression/alert_suppression.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/alert_suppression/alert_suppression.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/alert_suppression/alert_suppression.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/alert_suppression/alert_suppression.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/anomaly_threshold/anomaly_threshold.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/anomaly_threshold/anomaly_threshold.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/anomaly_threshold/anomaly_threshold.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/anomaly_threshold/anomaly_threshold.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/anomaly_threshold/anomaly_threshold.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/anomaly_threshold/anomaly_threshold.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/anomaly_threshold/anomaly_threshold.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/anomaly_threshold/anomaly_threshold.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/building_block/building_block.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/building_block/building_block.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/building_block/building_block.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/building_block/building_block.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/building_block/building_block.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/building_block/building_block.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/building_block/building_block.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/building_block/building_block.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/data_source/data_source.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/data_source/data_source.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/data_source/data_source.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/data_source/data_source.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/data_source/data_source.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/data_source/data_source.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/data_source/data_source.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/data_source/data_source.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/description/description.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/description/description.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/description/description.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/description/description.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/description/description.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/description/description.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/description/description.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/description/description.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/eql_query/eql_query.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/eql_query/eql_query.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/eql_query/eql_query.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/eql_query/eql_query.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/eql_query/eql_query.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/eql_query/eql_query.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/eql_query/eql_query.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/eql_query/eql_query.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/esql_query/esql_query.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/esql_query/esql_query.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/esql_query/esql_query.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/esql_query/esql_query.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/esql_query/esql_query.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/esql_query/esql_query.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/esql_query/esql_query.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/esql_query/esql_query.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/false_positives/false_positives.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/false_positives/false_positives.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/false_positives/false_positives.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/false_positives/false_positives.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/false_positives/false_positives.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/false_positives/false_positives.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/false_positives/false_positives.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/false_positives/false_positives.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/history_window_start/history_window_start.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/history_window_start/history_window_start.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/history_window_start/history_window_start.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/history_window_start/history_window_start.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/history_window_start/history_window_start.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/history_window_start/history_window_start.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/history_window_start/history_window_start.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/history_window_start/history_window_start.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/investigation_fields/investigation_fields.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/investigation_fields/investigation_fields.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/investigation_fields/investigation_fields.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/investigation_fields/investigation_fields.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/investigation_fields/investigation_fields.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/investigation_fields/investigation_fields.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/investigation_fields/investigation_fields.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/investigation_fields/investigation_fields.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/kql_query/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/kql_query/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/kql_query/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/kql_query/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/kql_query/inline_kql_query.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/kql_query/inline_kql_query.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/kql_query/inline_kql_query.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/kql_query/inline_kql_query.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/kql_query/kql_query.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/kql_query/kql_query.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/kql_query/kql_query.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/kql_query/kql_query.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/kql_query/saved_kql_query.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/kql_query/saved_kql_query.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/kql_query/saved_kql_query.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/kql_query/saved_kql_query.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/machine_learning_job_id/machine_learning_job_id.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/machine_learning_job_id/machine_learning_job_id.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/machine_learning_job_id/machine_learning_job_id.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/machine_learning_job_id/machine_learning_job_id.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/machine_learning_job_id/machine_learning_job_id.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/machine_learning_job_id/machine_learning_job_id.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/machine_learning_job_id/machine_learning_job_id.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/machine_learning_job_id/machine_learning_job_id.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/max_signals/max_signals.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/max_signals/max_signals.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/max_signals/max_signals.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/max_signals/max_signals.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/max_signals/max_signals.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/max_signals/max_signals.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/max_signals/max_signals.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/max_signals/max_signals.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/name/name.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/name/name.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/name/name.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/name/name.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/name/name.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/name/name.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/name/name.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/name/name.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/new_terms_fields/new_terms_fields.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/new_terms_fields/new_terms_fields.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/new_terms_fields/new_terms_fields.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/new_terms_fields/new_terms_fields.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/new_terms_fields/new_terms_fields.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/new_terms_fields/new_terms_fields.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/new_terms_fields/new_terms_fields.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/new_terms_fields/new_terms_fields.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/note/note.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/note/note.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/note/note.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/note/note.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/note/note.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/note/note.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/note/note.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/note/note.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/note/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/note/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/note/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/note/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/references/references.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/references/references.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/references/references.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/references/references.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/references/references.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/references/references.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/references/references.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/references/references.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/related_integrations/related_integrations.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/related_integrations/related_integrations.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/related_integrations/related_integrations.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/related_integrations/related_integrations.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/related_integrations/related_integrations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/related_integrations/related_integrations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/related_integrations/related_integrations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/related_integrations/related_integrations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/required_fields/required_fields.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/required_fields/required_fields.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/required_fields/required_fields.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/required_fields/required_fields.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/required_fields/required_fields.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/required_fields/required_fields.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/required_fields/required_fields.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/required_fields/required_fields.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score/risk_score.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score/risk_score.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score/risk_score.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score/risk_score.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score/risk_score.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score/risk_score.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score/risk_score.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score/risk_score.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score_mapping/risk_score_mapping.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score_mapping/risk_score_mapping.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score_mapping/risk_score_mapping.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score_mapping/risk_score_mapping.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score_mapping/risk_score_mapping.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score_mapping/risk_score_mapping.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score_mapping/risk_score_mapping.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score_mapping/risk_score_mapping.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_name_override/rule_name_override.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_name_override/rule_name_override.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_name_override/rule_name_override.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_name_override/rule_name_override.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_name_override/rule_name_override.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_name_override/rule_name_override.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_name_override/rule_name_override.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_name_override/rule_name_override.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_schedule/rule_schedule.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_schedule/rule_schedule.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_schedule/rule_schedule.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_schedule/rule_schedule.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_schedule/rule_schedule.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_schedule/rule_schedule.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_schedule/rule_schedule.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_schedule/rule_schedule.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/setup/setup.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/setup/setup.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/setup/setup.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/setup/setup.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/setup/setup.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/setup/setup.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/setup/setup.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/setup/setup.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity/severity.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity/severity.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity/severity.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity/severity.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity/severity.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity/severity.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity/severity.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity/severity.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity_mapping/severity_mapping.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity_mapping/severity_mapping.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity_mapping/severity_mapping.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity_mapping/severity_mapping.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity_mapping/severity_mapping.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity_mapping/severity_mapping.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity_mapping/severity_mapping.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity_mapping/severity_mapping.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/tags/tags.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/tags/tags.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/tags/tags.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/tags/tags.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/tags/tags.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/tags/tags.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/tags/tags.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/tags/tags.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat/threat.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat/threat.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat/threat.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat/threat.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat/threat.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat/threat.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat/threat.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat/threat.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_index/threat_index.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_index/threat_index.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_index/threat_index.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_index/threat_index.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_index/threat_index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_index/threat_index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_index/threat_index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_index/threat_index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_indicator_path/threat_indicator_path.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_indicator_path/threat_indicator_path.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_indicator_path/threat_indicator_path.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_indicator_path/threat_indicator_path.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_indicator_path/threat_indicator_path.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_indicator_path/threat_indicator_path.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_indicator_path/threat_indicator_path.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_indicator_path/threat_indicator_path.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_mapping/threat_mapping.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_mapping/threat_mapping.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_mapping/threat_mapping.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_mapping/threat_mapping.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_mapping/threat_mapping.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_mapping/threat_mapping.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_mapping/threat_mapping.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_mapping/threat_mapping.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_query/threat_query.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_query/threat_query.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_query/threat_query.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_query/threat_query.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_query/threat_query.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_query/threat_query.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_query/threat_query.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_query/threat_query.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threshold/threshold.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threshold/threshold.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threshold/threshold.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threshold/threshold.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threshold/threshold.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threshold/threshold.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threshold/threshold.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threshold/threshold.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timeline_template/timeline_template.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timeline_template/timeline_template.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timeline_template/timeline_template.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timeline_template/timeline_template.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timeline_template/timeline_template.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timeline_template/timeline_template.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timeline_template/timeline_template.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timeline_template/timeline_template.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timestamp_override/timestamp_override.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timestamp_override/timestamp_override.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timestamp_override/timestamp_override.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timestamp_override/timestamp_override.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timestamp_override/timestamp_override.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timestamp_override/timestamp_override.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timestamp_override/timestamp_override.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timestamp_override/timestamp_override.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/type/type.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/type/type.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/type/type.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/type/type.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/type/type.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/type/type.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/type/type.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/type/type.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/machine_learning_rule_field_readonly.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/machine_learning_rule_field_readonly.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/machine_learning_rule_field_readonly.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/machine_learning_rule_field_readonly.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/new_terms_rule_field_readonly.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/new_terms_rule_field_readonly.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/new_terms_rule_field_readonly.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/new_terms_rule_field_readonly.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/saved_query_rule_field_readonly.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/saved_query_rule_field_readonly.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/saved_query_rule_field_readonly.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/saved_query_rule_field_readonly.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/storybook/mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/storybook/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/storybook/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/storybook/mocks.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/storybook/three_way_diff_storybook_providers.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/storybook/three_way_diff_storybook_providers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/storybook/three_way_diff_storybook_providers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/storybook/three_way_diff_storybook_providers.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/threat_match_rule_field_readonly.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/threat_match_rule_field_readonly.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/threat_match_rule_field_readonly.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/threat_match_rule_field_readonly.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/threshold_rule_field_readonly.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/threshold_rule_field_readonly.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/threshold_rule_field_readonly.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/threshold_rule_field_readonly.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_context.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_header.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_header.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_state_info/field_upgrade_state_info.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_state_info/field_upgrade_state_info.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_state_info/field_upgrade_state_info.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_state_info/field_upgrade_state_info.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_state_info/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_state_info/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_state_info/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_state_info/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_state_info/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_state_info/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_state_info/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_state_info/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade_callout.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade_info_bar.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade_info_bar.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade_info_bar.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade_info_bar.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_snooze_badge/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_snooze_badge/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_snooze_badge/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_snooze_badge/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_snooze_badge/rule_snooze_badge.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_snooze_badge/rule_snooze_badge.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_snooze_badge/rule_snooze_badge.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_snooze_badge/rule_snooze_badge.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_snooze_badge/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_snooze_badge/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_snooze_badge/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_snooze_badge/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_snooze_badge/use_rule_snooze_settings.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_snooze_badge/use_rule_snooze_settings.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_snooze_badge/use_rule_snooze_settings.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_snooze_badge/use_rule_snooze_settings.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/hooks/use_default_index_pattern.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/hooks/use_default_index_pattern.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/hooks/use_default_index_pattern.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/hooks/use_default_index_pattern.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/hooks/use_is_prebuilt_rules_customization_enabled.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/hooks/use_is_prebuilt_rules_customization_enabled.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/hooks/use_is_prebuilt_rules_customization_enabled.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/hooks/use_is_prebuilt_rules_customization_enabled.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/__mocks__/use_bulk_export.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/__mocks__/use_bulk_export.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/__mocks__/use_bulk_export.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/__mocks__/use_bulk_export.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/__mocks__/use_execute_bulk_action.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/__mocks__/use_execute_bulk_action.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/__mocks__/use_execute_bulk_action.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/__mocks__/use_execute_bulk_action.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_bulk_export.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_bulk_export.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_bulk_export.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_bulk_export.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_bulk_export.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_bulk_export.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_bulk_export.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_bulk_export.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_download_exported_rules.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_download_exported_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_download_exported_rules.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_download_exported_rules.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_execute_bulk_action.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_execute_bulk_action.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_execute_bulk_action.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_execute_bulk_action.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_execute_bulk_action.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_execute_bulk_action.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_execute_bulk_action.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_execute_bulk_action.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_guess_rule_ids_for_bulk_action.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_guess_rule_ids_for_bulk_action.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_guess_rule_ids_for_bulk_action.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_guess_rule_ids_for_bulk_action.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_show_bulk_error_toast.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_show_bulk_error_toast.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_show_bulk_error_toast.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_show_bulk_error_toast.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_show_bulk_success_toast.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_show_bulk_success_toast.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_show_bulk_success_toast.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/bulk_actions/use_show_bulk_success_toast.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/coverage_overview/build_coverage_overview_dashboard_model.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/coverage_overview/build_coverage_overview_dashboard_model.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/coverage_overview/build_coverage_overview_dashboard_model.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/coverage_overview/build_coverage_overview_dashboard_model.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/coverage_overview/build_coverage_overview_dashboard_model.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/coverage_overview/build_coverage_overview_dashboard_model.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/coverage_overview/build_coverage_overview_dashboard_model.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/coverage_overview/build_coverage_overview_dashboard_model.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/coverage_overview/build_coverage_overview_mitre_graph.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/coverage_overview/build_coverage_overview_mitre_graph.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/coverage_overview/build_coverage_overview_mitre_graph.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/coverage_overview/build_coverage_overview_mitre_graph.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/coverage_overview/build_coverage_overview_mitre_graph.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/coverage_overview/build_coverage_overview_mitre_graph.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/coverage_overview/build_coverage_overview_mitre_graph.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/coverage_overview/build_coverage_overview_mitre_graph.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/mock.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/use_perform_rule_install.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/use_perform_rule_install.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/use_perform_rule_install.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/use_perform_rule_install.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/use_perform_rule_upgrade.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/use_perform_rule_upgrade.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/use_perform_rule_upgrade.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/use_perform_rule_upgrade.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/use_prebuilt_rules_install_review.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/use_prebuilt_rules_install_review.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/use_prebuilt_rules_install_review.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/use_prebuilt_rules_install_review.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/use_prebuilt_rules_status.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/use_prebuilt_rules_status.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/use_prebuilt_rules_status.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/use_prebuilt_rules_status.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/use_prebuilt_rules_upgrade_review.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/use_prebuilt_rules_upgrade_review.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/use_prebuilt_rules_upgrade_review.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/prebuilt_rules/use_prebuilt_rules_upgrade_review.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/types.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_alert_suppression.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_alert_suppression.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_alert_suppression.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_alert_suppression.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_alert_suppression.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_alert_suppression.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_alert_suppression.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_alert_suppression.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_create_rule.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_create_rule.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_create_rule.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_create_rule.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_disassociate_exception_list.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_disassociate_exception_list.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_disassociate_exception_list.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_disassociate_exception_list.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_dissasociate_exception_list.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_dissasociate_exception_list.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_dissasociate_exception_list.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_dissasociate_exception_list.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_find_rules.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_find_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_find_rules.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_find_rules.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_fields.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_fields.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_fields.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_fields.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_indices.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_indices.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_indices.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_indices.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_indices.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_indices.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_indices.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_indices.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_management_filters.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_management_filters.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_management_filters.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_management_filters.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_with_fallback.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_with_fallback.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_with_fallback.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_with_fallback.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_with_fallback.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_with_fallback.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_with_fallback.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_rule_with_fallback.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_start_ml_jobs.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_start_ml_jobs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_start_ml_jobs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_start_ml_jobs.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_update_rule.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_update_rule.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_update_rule.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_update_rule.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_upgrade_security_packages.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_upgrade_security_packages.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/logic/use_upgrade_security_packages.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/logic/use_upgrade_security_packages.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/dashboard.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/dashboard.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/dashboard.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/dashboard.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/mitre_subtechnique.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/mitre_subtechnique.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/mitre_subtechnique.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/mitre_subtechnique.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/mitre_subtechnique.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/mitre_subtechnique.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/mitre_subtechnique.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/mitre_subtechnique.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/mitre_tactic.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/mitre_tactic.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/mitre_tactic.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/mitre_tactic.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/mitre_technique.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/mitre_technique.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/mitre_technique.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/mitre_technique.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/mitre_technique.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/mitre_technique.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/mitre_technique.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/mitre_technique.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/rule.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/rule.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/rule.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/coverage_overview/rule.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/field_upgrade_state_enum.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/field_upgrade_state_enum.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/field_upgrade_state_enum.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/field_upgrade_state_enum.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/fields.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/fields.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/fields.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/fields.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/fields_upgrade_state.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/fields_upgrade_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/fields_upgrade_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/fields_upgrade_state.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/rule_upgrade_state.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/rule_upgrade_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/rule_upgrade_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/rule_upgrade_state.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/rules_upgrade_state.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/rules_upgrade_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/rules_upgrade_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/rules_upgrade_state.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/set_rule_field_resolved_value.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/set_rule_field_resolved_value.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/set_rule_field_resolved_value.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/set_rule_field_resolved_value.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/rule_details/rule_field_diff.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/rule_details/rule_field_diff.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/model/rule_details/rule_field_diff.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/model/rule_details/rule_field_diff.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/auto_refresh_button/auto_refresh_button.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/auto_refresh_button/auto_refresh_button.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/auto_refresh_button/auto_refresh_button.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/auto_refresh_button/auto_refresh_button.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/auto_refresh_button/auto_refresh_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/auto_refresh_button/auto_refresh_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/auto_refresh_button/auto_refresh_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/auto_refresh_button/auto_refresh_button.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/mini_callout/mini_callout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/mini_callout/mini_callout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/mini_callout/mini_callout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/mini_callout/mini_callout.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/mini_callout/mini_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/mini_callout/mini_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/mini_callout/mini_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/mini_callout/mini_callout.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/mini_callout/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/mini_callout/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/mini_callout/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/mini_callout/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/ml_rule_warning_popover/ml_rule_warning_popover.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/ml_rule_warning_popover/ml_rule_warning_popover.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/ml_rule_warning_popover/ml_rule_warning_popover.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/ml_rule_warning_popover/ml_rule_warning_popover.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rule_update_callouts/rule_update_callouts.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rule_update_callouts/rule_update_callouts.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rule_update_callouts/rule_update_callouts.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rule_update_callouts/rule_update_callouts.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/__mocks__/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/__mocks__/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/__mocks__/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/__mocks__/mock.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_header_buttons.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_header_buttons.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_header_buttons.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_header_buttons.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_install_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_install_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_install_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_install_button.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_no_items_message.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_no_items_message.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_no_items_message.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_no_items_message.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_table.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_table.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_table.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_table.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_table.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_table_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_table_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_table_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_table_context.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_table_filters.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_table_filters.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_table_filters.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_table_filters.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_utils.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/add_prebuilt_rules_utils.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/use_add_prebuilt_rules_table_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/use_add_prebuilt_rules_table_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/use_add_prebuilt_rules_table_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/use_add_prebuilt_rules_table_columns.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/use_filter_prebuilt_rules_to_install.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/use_filter_prebuilt_rules_to_install.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/use_filter_prebuilt_rules_to_install.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/use_filter_prebuilt_rules_to_install.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/alternative_tour/tour.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/alternative_tour/tour.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/alternative_tour/tour.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/alternative_tour/tour.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/alternative_tour/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/alternative_tour/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/alternative_tour/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/alternative_tour/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_dry_run_confirmation.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_dry_run_confirmation.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_dry_run_confirmation.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_dry_run_confirmation.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_rule_errors_list.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_rule_errors_list.test.tsx similarity index 95% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_rule_errors_list.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_rule_errors_list.test.tsx index 7354bd306d6ea..f1f79e911ec4f 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_rule_errors_list.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_rule_errors_list.test.tsx @@ -64,11 +64,11 @@ describe('Component BulkEditRuleErrorsList', () => { ], [ BulkActionsDryRunErrCode.MACHINE_LEARNING_INDEX_PATTERN, - "2 custom machine learning rules (these rules don't have index patterns)", + "2 machine learning rules (these rules don't have index patterns)", ], [ BulkActionsDryRunErrCode.ESQL_INDEX_PATTERN, - "2 custom ES|QL rules (these rules don't have index patterns)", + "2 ES|QL rules (these rules don't have index patterns)", ], [ BulkActionsDryRunErrCode.MACHINE_LEARNING_AUTH, diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_rule_errors_list.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_rule_errors_list.tsx similarity index 95% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_rule_errors_list.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_rule_errors_list.tsx index 72e380a1a7d5a..ce6be3edbf14c 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_rule_errors_list.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_action_rule_errors_list.tsx @@ -41,7 +41,7 @@ const BulkEditRuleErrorItem = ({ <li key={message}> <FormattedMessage id="xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.machineLearningRulesIndexEditDescription" - defaultMessage="{rulesCount, plural, =1 {# custom machine learning rule} other {# custom machine learning rules}} (these rules don't have index patterns)" + defaultMessage="{rulesCount, plural, =1 {# machine learning rule} other {# machine learning rules}} (these rules don't have index patterns)" values={{ rulesCount }} /> </li> @@ -61,7 +61,7 @@ const BulkEditRuleErrorItem = ({ <li key={message}> <FormattedMessage id="xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.esqlRulesIndexEditDescription" - defaultMessage="{rulesCount, plural, =1 {# custom ES|QL rule} other {# custom ES|QL rules}} (these rules don't have index patterns)" + defaultMessage="{rulesCount, plural, =1 {# ES|QL rule} other {# ES|QL rules}} (these rules don't have index patterns)" values={{ rulesCount }} /> </li> diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_duplicate_exceptions_confirmation.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_duplicate_exceptions_confirmation.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_duplicate_exceptions_confirmation.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_duplicate_exceptions_confirmation.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_edit_flyout.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_edit_flyout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_edit_flyout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_edit_flyout.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_manual_rule_run_limit_error_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_manual_rule_run_limit_error_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_manual_rule_run_limit_error_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/bulk_manual_rule_run_limit_error_modal.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/bulk_edit_form_wrapper.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/bulk_edit_form_wrapper.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/bulk_edit_form_wrapper.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/bulk_edit_form_wrapper.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/index_patterns_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/index_patterns_form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/index_patterns_form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/index_patterns_form.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/investigation_fields_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/investigation_fields_form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/investigation_fields_form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/investigation_fields_form.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/rule_actions_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/rule_actions_form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/rule_actions_form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/rule_actions_form.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/schedule_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/schedule_form.tsx similarity index 94% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/schedule_form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/schedule_form.tsx index 88e1411a5e0bc..518c18a59a413 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/schedule_form.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/schedule_form.tsx @@ -9,11 +9,11 @@ import { EuiCallOut } from '@elastic/eui'; import React, { useCallback } from 'react'; import type { BulkActionEditPayload } from '../../../../../../../common/api/detection_engine/rule_management'; import { BulkActionEditTypeEnum } from '../../../../../../../common/api/detection_engine/rule_management'; -import { ScheduleItem } from '../../../../../rule_creation/components/schedule_item_form'; import type { FormSchema } from '../../../../../../shared_imports'; import { UseField, useForm } from '../../../../../../shared_imports'; import { bulkSetSchedule as i18n } from '../translations'; import { BulkEditFormWrapper } from './bulk_edit_form_wrapper'; +import { ScheduleItemField } from '../../../../../rule_creation/components/schedule_item_field'; export interface ScheduleFormData { interval: string; @@ -79,7 +79,7 @@ export const ScheduleForm = ({ rulesCount, onClose, onConfirm }: ScheduleFormCom > <UseField path="interval" - component={ScheduleItem} + component={ScheduleItemField} componentProps={{ idAria: 'bulkEditRulesScheduleIntervalSelector', dataTestSubj: 'bulkEditRulesScheduleIntervalSelector', @@ -89,7 +89,7 @@ export const ScheduleForm = ({ rulesCount, onClose, onConfirm }: ScheduleFormCom /> <UseField path="lookback" - component={ScheduleItem} + component={ScheduleItemField} componentProps={{ idAria: 'bulkEditRulesScheduleLookbackSelector', dataTestSubj: 'bulkEditRulesScheduleLookbackSelector', diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/tags_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/tags_form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/tags_form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/tags_form.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/timeline_template_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/timeline_template_form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/timeline_template_form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/forms/timeline_template_form.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/types.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_actions.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_actions_confirmation.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_actions_confirmation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_actions_confirmation.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_actions_confirmation.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_actions_dry_run.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_actions_dry_run.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_actions_dry_run.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_actions_dry_run.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_duplicate_confirmation.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_duplicate_confirmation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_duplicate_confirmation.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_duplicate_confirmation.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_edit_form_flyout.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_edit_form_flyout.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_edit_form_flyout.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/use_bulk_edit_form_flyout.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/compute_dry_run_edit_payload.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/compute_dry_run_edit_payload.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/compute_dry_run_edit_payload.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/compute_dry_run_edit_payload.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/compute_dry_run_edit_payload.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/compute_dry_run_edit_payload.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/compute_dry_run_edit_payload.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/compute_dry_run_edit_payload.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/dry_run_result.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/dry_run_result.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/dry_run_result.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/dry_run_result.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/prepare_search_params.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/prepare_search_params.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/prepare_search_params.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/prepare_search_params.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/prepare_search_params.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/prepare_search_params.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/prepare_search_params.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/bulk_actions/utils/prepare_search_params.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/constants.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/feature_tour/README.md b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/feature_tour/README.md similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/feature_tour/README.md rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/feature_tour/README.md diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/feature_tour/rules_feature_tour.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/feature_tour/rules_feature_tour.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/feature_tour/rules_feature_tour.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/feature_tour/rules_feature_tour.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/feature_tour/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/feature_tour/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/feature_tour/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/feature_tour/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/helpers.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/ml_rule_warning_popover.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/ml_rule_warning_popover.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/ml_rule_warning_popover.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/ml_rule_warning_popover.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/popover_tooltip.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/popover_tooltip.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/popover_tooltip.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/popover_tooltip.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_changelog_link.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_changelog_link.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_changelog_link.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_changelog_link.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/__mocks__/mock_rules_table_persistent_state.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/__mocks__/mock_rules_table_persistent_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/__mocks__/mock_rules_table_persistent_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/__mocks__/mock_rules_table_persistent_state.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/__mocks__/rules_table_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/__mocks__/rules_table_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/__mocks__/rules_table_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/__mocks__/rules_table_context.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/guided_onboarding/rules_management_tour.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/guided_onboarding/rules_management_tour.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/guided_onboarding/rules_management_tour.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/guided_onboarding/rules_management_tour.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/guided_onboarding/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/guided_onboarding/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/guided_onboarding/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/guided_onboarding/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/guided_onboarding/use_is_element_mounted.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/guided_onboarding/use_is_element_mounted.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/guided_onboarding/use_is_element_mounted.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/guided_onboarding/use_is_element_mounted.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/rules_table_context.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/rules_table_context.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/rules_table_context.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/rules_table_context.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/rules_table_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/rules_table_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/rules_table_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/rules_table_context.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/rules_table_defaults.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/rules_table_defaults.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/rules_table_defaults.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/rules_table_defaults.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/rules_table_saved_state.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/rules_table_saved_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/rules_table_saved_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/rules_table_saved_state.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/use_async_confirmation.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/use_async_confirmation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/use_async_confirmation.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/use_async_confirmation.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/use_rules_table_saved_state.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/use_rules_table_saved_state.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/use_rules_table_saved_state.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/use_rules_table_saved_state.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/use_rules_table_saved_state.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/use_rules_table_saved_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/use_rules_table_saved_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/use_rules_table_saved_state.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/use_sync_rules_table_saved_state.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/use_sync_rules_table_saved_state.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/use_sync_rules_table_saved_state.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/use_sync_rules_table_saved_state.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/use_sync_rules_table_saved_state.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/use_sync_rules_table_saved_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/use_sync_rules_table_saved_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table/use_sync_rules_table_saved_state.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_empty_column_name.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_empty_column_name.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_empty_column_name.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_empty_column_name.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rule_execution_status_selector.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rule_execution_status_selector.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rule_execution_status_selector.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rule_execution_status_selector.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rule_search_field.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rule_search_field.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rule_search_field.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rule_search_field.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rule_search_field.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rule_search_field.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rule_search_field.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rule_search_field.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rules_table_filters.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rules_table_filters.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rules_table_filters.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/rules_table_filters.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/tags_filter_popover.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/tags_filter_popover.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/tags_filter_popover.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/tags_filter_popover.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/tags_filter_popover.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/tags_filter_popover.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/tags_filter_popover.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_filters/tags_filter_popover.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_toolbar.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_toolbar.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_toolbar.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_table_toolbar.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_tables.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_tables.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_tables.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_tables.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/table_header_tooltip_cell.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/table_header_tooltip_cell.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/table_header_tooltip_cell.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/table_header_tooltip_cell.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/table_header_tooltip_cell.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/table_header_tooltip_cell.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/table_header_tooltip_cell.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/table_header_tooltip_cell.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/rule_type_change_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/rule_type_change_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/rule_type_change_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/rule_type_change_callout.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_flyout_subheader.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_flyout_subheader.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_flyout_subheader.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_flyout_subheader.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table_buttons.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table_buttons.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table_buttons.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table_buttons.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table_context.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table_filters.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table_filters.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table_filters.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table_filters.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_rule_customization_filter_popover.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_rule_customization_filter_popover.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_rule_customization_filter_popover.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_rule_customization_filter_popover.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_filter_prebuilt_rules_to_upgrade.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_filter_prebuilt_rules_to_upgrade.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_filter_prebuilt_rules_to_upgrade.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_filter_prebuilt_rules_to_upgrade.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/ml_jobs_upgrade_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/ml_jobs_upgrade_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/ml_jobs_upgrade_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/ml_jobs_upgrade_modal.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/use_ml_jobs_upgrade_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/use_ml_jobs_upgrade_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/use_ml_jobs_upgrade_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/use_ml_jobs_upgrade_modal.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_prebuilt_rules_upgrade_state.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_prebuilt_rules_upgrade_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_prebuilt_rules_upgrade_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_prebuilt_rules_upgrade_state.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_prebuilt_rules_table_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_prebuilt_rules_table_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_prebuilt_rules_table_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_prebuilt_rules_table_columns.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/upgrade_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/upgrade_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/upgrade_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/upgrade_modal.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/use_upgrade_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/use_upgrade_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/use_upgrade_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/use_upgrade_modal.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_columns.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_has_actions_privileges.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_has_actions_privileges.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_has_actions_privileges.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_has_actions_privileges.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_has_ml_permissions.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_has_ml_permissions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_has_ml_permissions.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_has_ml_permissions.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_rule_preview_flyout.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_rule_preview_flyout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_rule_preview_flyout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_rule_preview_flyout.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_rules_table_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_rules_table_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_rules_table_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_rules_table_actions.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table_utility_bar/rules_table_utility_bar.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table_utility_bar/rules_table_utility_bar.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table_utility_bar/rules_table_utility_bar.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table_utility_bar/rules_table_utility_bar.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table_utility_bar/rules_table_utility_bar.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table_utility_bar/rules_table_utility_bar.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table_utility_bar/rules_table_utility_bar.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table_utility_bar/rules_table_utility_bar.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/add_rules/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/add_rules/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/add_rules/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/add_rules/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/add_rules/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/add_rules/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/add_rules/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/add_rules/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/constants.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/coverage_overview_dashboard.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/coverage_overview_dashboard.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/coverage_overview_dashboard.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/coverage_overview_dashboard.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/coverage_overview_dashboard.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/coverage_overview_dashboard.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/coverage_overview_dashboard.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/coverage_overview_dashboard.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/coverage_overview_dashboard_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/coverage_overview_dashboard_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/coverage_overview_dashboard_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/coverage_overview_dashboard_context.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/coverage_overview_dashboard_reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/coverage_overview_dashboard_reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/coverage_overview_dashboard_reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/coverage_overview_dashboard_reducer.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/filter_panel.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/filter_panel.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/filter_panel.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/filter_panel.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/filters_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/filters_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/filters_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/filters_panel.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/helpers.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/rule_activity_filter.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/rule_activity_filter.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/rule_activity_filter.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/rule_activity_filter.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/rule_source_filter.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/rule_source_filter.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/rule_source_filter.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/rule_source_filter.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/shared_components/dashboard_legend.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/shared_components/dashboard_legend.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/shared_components/dashboard_legend.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/shared_components/dashboard_legend.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/shared_components/panel_rule_stats.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/shared_components/panel_rule_stats.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/shared_components/panel_rule_stats.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/shared_components/panel_rule_stats.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/shared_components/popover_list_header.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/shared_components/popover_list_header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/shared_components/popover_list_header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/shared_components/popover_list_header.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/tactic_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/tactic_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/tactic_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/tactic_panel.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/technique_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/technique_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/technique_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/technique_panel.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/technique_panel_popover.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/technique_panel_popover.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/technique_panel_popover.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/technique_panel_popover.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/technique_panel_popover.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/technique_panel_popover.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/technique_panel_popover.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/technique_panel_popover.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/rule_management/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/rule_management/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/rule_management/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management_ui/pages/rule_management/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/api/__mocks__/api_client.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/api/__mocks__/api_client.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/api/__mocks__/api_client.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/api/__mocks__/api_client.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/api/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/api/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/api/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/api/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/api/api_client.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/api/api_client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/api/api_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/api/api_client.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/api/api_client.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/api/api_client.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/api/api_client.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/api/api_client.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/api/api_client_interface.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/api/api_client_interface.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/api/api_client_interface.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/api/api_client_interface.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/api/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/api/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/api/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/api/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/event_type_filter/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/event_type_filter/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/event_type_filter/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/event_type_filter/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/event_type_filter/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/event_type_filter/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/event_type_filter/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/event_type_filter/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/execution_run_type_filter/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/execution_run_type_filter/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/execution_run_type_filter/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/execution_run_type_filter/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/execution_run_type_filter/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/execution_run_type_filter/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/execution_run_type_filter/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/execution_run_type_filter/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/execution_run_type_filter/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/execution_run_type_filter/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/execution_run_type_filter/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/execution_run_type_filter/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/execution_status_filter/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/execution_status_filter/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/execution_status_filter/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/execution_status_filter/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/execution_status_filter/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/execution_status_filter/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/execution_status_filter/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/execution_status_filter/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/log_level_filter/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/log_level_filter/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/log_level_filter/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/log_level_filter/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/log_level_filter/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/log_level_filter/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/log_level_filter/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/log_level_filter/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/multiselect_filter/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/multiselect_filter/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/multiselect_filter/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/filters/multiselect_filter/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/event_type_indicator/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/event_type_indicator/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/event_type_indicator/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/event_type_indicator/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/event_type_indicator/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/event_type_indicator/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/event_type_indicator/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/event_type_indicator/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/event_type_indicator/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/event_type_indicator/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/event_type_indicator/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/event_type_indicator/utils.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/execution_status_indicator/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/execution_status_indicator/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/execution_status_indicator/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/execution_status_indicator/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/log_level_indicator/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/log_level_indicator/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/log_level_indicator/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/log_level_indicator/index.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/log_level_indicator/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/log_level_indicator/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/log_level_indicator/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/indicators/log_level_indicator/utils.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/tables/use_expandable_rows.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/tables/use_expandable_rows.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/tables/use_expandable_rows.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/tables/use_expandable_rows.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/tables/use_pagination.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/tables/use_pagination.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/tables/use_pagination.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/tables/use_pagination.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/tables/use_sorting.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/tables/use_sorting.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/tables/use_sorting.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/tables/use_sorting.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/text/text_block.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/text/text_block.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/text/text_block.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/text/text_block.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/text/truncated_text.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/text/truncated_text.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/text/truncated_text.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/basic/text/truncated_text.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/event_message_filter/event_message_filter.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/event_message_filter/event_message_filter.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/event_message_filter/event_message_filter.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/event_message_filter/event_message_filter.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/event_message_filter/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/event_message_filter/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/event_message_filter/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/event_message_filter/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/event_message_filter/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/event_message_filter/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/event_message_filter/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/event_message_filter/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/execution_events_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/execution_events_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/execution_events_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/execution_events_table.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/execution_events_table_row_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/execution_events_table_row_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/execution_events_table_row_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/execution_events_table_row_details.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_columns.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_execution_events.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_filters.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_filters.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_filters.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_events_table/use_filters.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/components/execution_results_table/use_execution_results.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/logic/detection_engine_health/use_setup_detection_engine_health_api.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/logic/detection_engine_health/use_setup_detection_engine_health_api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/logic/detection_engine_health/use_setup_detection_engine_health_api.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/logic/detection_engine_health/use_setup_detection_engine_health_api.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/logic/execution_settings/use_execution_settings.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/logic/execution_settings/use_execution_settings.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/logic/execution_settings/use_execution_settings.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/logic/execution_settings/use_execution_settings.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_monitoring/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_monitoring/mocks.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/constants.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/action_type_field.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/action_type_field.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/action_type_field.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/action_type_field.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/callout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/callout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/callout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/callout.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/callout.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/check_permissions.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/check_permissions.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/check_permissions.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/check_permissions.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/check_permissions.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/check_permissions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/check_permissions.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/check_permissions.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/comment_field.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/comment_field.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/comment_field.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/comment_field.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/config_fields.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/config_fields.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/config_fields.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/config_fields.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/endpoint_response_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/endpoint_response_action.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/endpoint_response_action.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/endpoint_response_action.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/field_name.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/field_name.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/field_name.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/field_name.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/overwrite_process_field.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/overwrite_process_field.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/overwrite_process_field.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/overwrite_process_field.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/utils.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/utils.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/utils.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/utils.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/v.8.10.0_process.json b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/v.8.10.0_process.json similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/v.8.10.0_process.json rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/endpoint/v.8.10.0_process.json diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/get_supported_response_actions.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/get_supported_response_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/get_supported_response_actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/get_supported_response_actions.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/osquery_investigation_guide_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/osquery_investigation_guide_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/osquery_investigation_guide_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/osquery_investigation_guide_panel.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/osquery_response_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/osquery_response_action.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/osquery_response_action.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/osquery_response_action.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/osquery_response_action_form_field.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/osquery_response_action_form_field.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/osquery_response_action_form_field.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/osquery_response_action_form_field.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/osquery/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/response_action_add_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/response_action_add_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/response_action_add_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/response_action_add_button.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/response_action_type_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/response_action_type_form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/response_action_type_form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/response_action_type_form.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/response_actions_form.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/response_actions_form.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/response_actions_form.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/response_actions_form.test.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/response_actions_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/response_actions_form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/response_actions_form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/response_actions_form.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/response_actions_header.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/response_actions_header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/response_actions_header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/response_actions_header.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/response_actions_list.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/response_actions_list.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/response_actions_list.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/response_actions_list.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/response_actions_wrapper.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/response_actions_wrapper.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/response_actions_wrapper.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/response_actions_wrapper.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/use_osquery_enabled.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/use_osquery_enabled.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/use_osquery_enabled.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/use_osquery_enabled.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/use_supported_response_action_types.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/use_supported_response_action_types.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/use_supported_response_action_types.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/use_supported_response_action_types.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/utils.test.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/utils.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/utils.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_response_actions/utils.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_response_actions/utils.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/alerts_by_rule.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/alerts_by_rule.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/alerts_by_rule.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/alerts_by_rule.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/alerts_by_rule.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/alerts_by_rule.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/alerts_by_rule.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/alerts_by_rule.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/mock_rule_data.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/mock_rule_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/mock_rule_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/mock_rule_data.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_by_rule_panel/types.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_count_panel/types.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/mock_data.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/mock_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/mock_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/mock_data.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_histogram_panel/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/alerts_progress_bar.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/alerts_progress_bar.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/alerts_progress_bar.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/alerts_progress_bar.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/alerts_progress_bar.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/alerts_progress_bar.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/alerts_progress_bar.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/alerts_progress_bar.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/mock_data.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/mock_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/mock_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/mock_data.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_progress_bar_panel/types.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/aggregations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/aggregations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/aggregations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/aggregations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/types.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/use_summary_chart_data.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/use_summary_chart_data.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/use_summary_chart_data.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/use_summary_chart_data.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/use_summary_chart_data.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/use_summary_chart_data.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/use_summary_chart_data.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_summary_charts_panel/use_summary_chart_data.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/chart_palette/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/chart_palette/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/chart_palette/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/chart_palette/index.test.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/chart_palette/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/chart_palette/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/chart_palette/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/chart_palette/index.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/flatten_bucket.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/flatten_bucket.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/flatten_bucket.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/flatten_bucket.test.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/flatten_bucket.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/flatten_bucket.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/flatten_bucket.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/flatten_bucket.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/get_flattened_buckets.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/get_flattened_buckets.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/get_flattened_buckets.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/get_flattened_buckets.test.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/get_flattened_buckets.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/get_flattened_buckets.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/get_flattened_buckets.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/get_flattened_buckets.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/mocks/mock_buckets.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/mocks/mock_buckets.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/mocks/mock_buckets.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/mocks/mock_buckets.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/mocks/mock_flattened_buckets.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/mocks/mock_flattened_buckets.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/mocks/mock_flattened_buckets.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/flatten/mocks/mock_flattened_buckets.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/helpers.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/labels/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/labels/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/labels/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/labels/index.test.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/labels/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/labels/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/labels/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/labels/index.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/layers/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/layers/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/layers/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/layers/index.test.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/layers/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/layers/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/layers/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/layers/index.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/legend/get_flattened_legend_items.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/legend/get_flattened_legend_items.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/legend/get_flattened_legend_items.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/legend/get_flattened_legend_items.test.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/legend/get_flattened_legend_items.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/legend/get_flattened_legend_items.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/legend/get_flattened_legend_items.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/legend/get_flattened_legend_items.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/legend/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/legend/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/legend/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/legend/index.test.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/legend/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/legend/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/legend/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/legend/index.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/mocks/mock_alert_search_response.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/mocks/mock_alert_search_response.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/mocks/mock_alert_search_response.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/lib/mocks/mock_alert_search_response.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/no_data/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/no_data/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/no_data/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/no_data/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/no_data/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/no_data/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/no_data/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/no_data/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/query/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/query/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/query/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/query/index.test.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/query/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/query/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/query/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/query/index.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/alerts_treemap/types.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/alerts_treemap_panel/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/alerts_local_storage/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/alerts_local_storage/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/alerts_local_storage/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/alerts_local_storage/constants.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/alerts_local_storage/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/alerts_local_storage/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/alerts_local_storage/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/alerts_local_storage/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/alerts_local_storage/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/alerts_local_storage/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/alerts_local_storage/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/alerts_local_storage/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/alerts_local_storage/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/alerts_local_storage/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/alerts_local_storage/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/alerts_local_storage/types.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/mock_data.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/mock_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/mock_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/mock_data.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_collapse/types.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_context_menu/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_context_menu/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_context_menu/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_context_menu/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_context_menu/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_context_menu/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_context_menu/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_context_menu/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_select/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_select/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_select/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_select/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_select/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_select/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_select/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_select/helpers.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_select/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_select/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_select/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_select/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_select/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_select/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_select/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_select/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_select/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_select/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_select/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/chart_select/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/chart_panels/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/components.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/common/components.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/components.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/common/components.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/components.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/common/components.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/components.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/common/components.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/config.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/common/config.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/config.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/common/config.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/hooks.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/common/hooks.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/hooks.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/common/hooks.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/hooks.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/common/hooks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/hooks.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/common/hooks.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/common/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/common/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/common/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/common/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/common/types.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/columns.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/mock_data.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/mock_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/mock_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/mock_data.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/severity_level_chart.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/severity_level_chart.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/severity_level_chart.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/severity_level_chart.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/severity_level_chart.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/severity_level_chart.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/severity_level_chart.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/severity_level_chart.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_kpis/severity_level_panel/types.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/actions.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/actions.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/actions.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/actions.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/actions.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/additional_filters_action/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/additional_filters_action/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/additional_filters_action/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/additional_filters_action/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/additional_filters_action/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/additional_filters_action/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/additional_filters_action/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/additional_filters_action/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/additional_filters_action/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/additional_filters_action/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/additional_filters_action/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/additional_filters_action/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/alerts_filter_group/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/alerts_filter_group/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/alerts_filter_group/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/alerts_filter_group/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/alerts_filter_group/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/alerts_filter_group/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/alerts_filter_group/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/alerts_filter_group/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/alerts_grouping.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/alerts_grouping.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/alerts_grouping.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/alerts_grouping.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/alerts_grouping.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/alerts_grouping.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/alerts_grouping.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/alerts_grouping.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/alerts_sub_grouping.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/alerts_sub_grouping.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/alerts_sub_grouping.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/alerts_sub_grouping.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/default_config.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/default_config.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/default_config.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_panel_renderers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_panel_renderers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_panel_renderers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_panel_renderers.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_panel_renderers.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_panel_renderers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_panel_renderers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_panel_renderers.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_stats.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_stats.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_stats.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_stats.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_stats.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_stats.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_stats.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_stats.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_take_action_items.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_take_action_items.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_take_action_items.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_take_action_items.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_take_action_items.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_take_action_items.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_take_action_items.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/group_take_action_items.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/mock.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/query_builder.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/query_builder.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/query_builder.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/query_builder.test.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/query_builder.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/query_builder.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/query_builder.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/query_builder.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/grouping_settings/types.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/helpers.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/alert_context_menu.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_resolver.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_resolver.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_resolver.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_resolver.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_resolver.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_resolver.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_resolver.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_resolver.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_timeline_action.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_timeline_action.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_timeline_action.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_timeline_action.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_timeline_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_timeline_action.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_timeline_action.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_timeline_action.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_bulk_to_timeline.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_bulk_to_timeline.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_bulk_to_timeline.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_bulk_to_timeline.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_exception_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_exception_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_exception_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_exception_actions.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_exception_flyout.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_exception_flyout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_exception_flyout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_exception_flyout.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_to_case_actions.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_to_case_actions.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_to_case_actions.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_to_case_actions.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_to_case_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_to_case_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_to_case_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_add_to_case_actions.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_alert_assignees_actions.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_alert_assignees_actions.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_alert_assignees_actions.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_alert_assignees_actions.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_alert_assignees_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_alert_assignees_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_alert_assignees_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_alert_assignees_actions.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_alert_tags_actions.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_alert_tags_actions.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_alert_tags_actions.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_alert_tags_actions.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_alert_tags_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_alert_tags_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_alert_tags_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_alert_tags_actions.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_alerts_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_alerts_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_alerts_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_alerts_actions.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_event_filter_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_event_filter_action.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_event_filter_action.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_event_filter_action.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_event_filter_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_event_filter_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_event_filter_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_event_filter_modal.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_investigate_in_timeline.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_investigate_in_timeline.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_investigate_in_timeline.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_investigate_in_timeline.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_investigate_in_timeline.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_investigate_in_timeline.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_investigate_in_timeline.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_investigate_in_timeline.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/alerts_table/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/alerts_table/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/types.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/callouts/missing_privileges_callout/comma_separated_values.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/missing_privileges_callout/comma_separated_values.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/callouts/missing_privileges_callout/comma_separated_values.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/missing_privileges_callout/comma_separated_values.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/callouts/missing_privileges_callout/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/missing_privileges_callout/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/callouts/missing_privileges_callout/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/missing_privileges_callout/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/callouts/missing_privileges_callout/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/missing_privileges_callout/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/callouts/missing_privileges_callout/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/missing_privileges_callout/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/callouts/missing_privileges_callout/use_missing_privileges.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/missing_privileges_callout/use_missing_privileges.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/callouts/missing_privileges_callout/use_missing_privileges.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/missing_privileges_callout/use_missing_privileges.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/callouts/ml_job_compatibility_callout/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/ml_job_compatibility_callout/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/callouts/ml_job_compatibility_callout/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/ml_job_compatibility_callout/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/callouts/ml_job_compatibility_callout/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/ml_job_compatibility_callout/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/callouts/ml_job_compatibility_callout/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/ml_job_compatibility_callout/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/callouts/ml_job_compatibility_callout/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/ml_job_compatibility_callout/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/callouts/ml_job_compatibility_callout/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/ml_job_compatibility_callout/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/callouts/need_admin_for_update_callout/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/need_admin_for_update_callout/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/callouts/need_admin_for_update_callout/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/need_admin_for_update_callout/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/callouts/need_admin_for_update_callout/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/need_admin_for_update_callout/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/callouts/need_admin_for_update_callout/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/need_admin_for_update_callout/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/callouts/need_admin_for_update_callout/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/need_admin_for_update_callout/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/callouts/need_admin_for_update_callout/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/need_admin_for_update_callout/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/callouts/no_api_integration_callout/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/no_api_integration_callout/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/callouts/no_api_integration_callout/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/no_api_integration_callout/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/callouts/no_api_integration_callout/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/no_api_integration_callout/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/callouts/no_api_integration_callout/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/no_api_integration_callout/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/callouts/no_api_integration_callout/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/no_api_integration_callout/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/callouts/no_api_integration_callout/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/callouts/no_api_integration_callout/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/detection_engine_filters/detection_engine_filters.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/detection_engine_filters/detection_engine_filters.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/detection_engine_filters/detection_engine_filters.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/detection_engine_filters/detection_engine_filters.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/detection_engine_filters/detection_engine_filters.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/detection_engine_filters/detection_engine_filters.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/detection_engine_filters/detection_engine_filters.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/detection_engine_filters/detection_engine_filters.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/osquery/osquery_action_item.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/osquery/osquery_action_item.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/osquery/osquery_action_item.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/osquery/osquery_action_item.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/osquery/osquery_flyout.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/osquery/osquery_flyout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/osquery/osquery_flyout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/osquery/osquery_flyout.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/osquery/osquery_flyout_footer.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/osquery/osquery_flyout_footer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/osquery/osquery_flyout_footer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/osquery/osquery_flyout_footer.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/osquery/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/osquery/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/osquery/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/osquery/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/osquery/use_osquery_context_action_item.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/osquery/use_osquery_context_action_item.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/osquery/use_osquery_context_action_item.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/osquery/use_osquery_context_action_item.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/add_elastic_rules_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/add_elastic_rules_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/add_elastic_rules_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/add_elastic_rules_button.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/load_empty_prompt.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/load_empty_prompt.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/load_empty_prompt.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/load_empty_prompt.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/integration_details.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/integration_details.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/integration_details.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/integration_details.test.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/integration_details.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/integration_details.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/integration_details.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/integration_details.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/integrations_description/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/integrations_description/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/integrations_description/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/integrations_description/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/integrations_description/integration_link.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/integrations_description/integration_link.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/integrations_description/integration_link.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/integrations_description/integration_link.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/integrations_description/integration_status_badge.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/integrations_description/integration_status_badge.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/integrations_description/integration_status_badge.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/integrations_description/integration_status_badge.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/integrations_description/integration_version_mismatch_icon.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/integrations_description/integration_version_mismatch_icon.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/integrations_description/integration_version_mismatch_icon.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/integrations_description/integration_version_mismatch_icon.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/integrations_popover/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/integrations_popover/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/integrations_popover/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/integrations_popover/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/mock.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_integrations.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/use_integrations.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_integrations.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/use_integrations.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_integrations.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/use_integrations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_integrations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/use_integrations.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_related_integrations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/use_related_integrations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/related_integrations/use_related_integrations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/related_integrations/use_related_integrations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_actions_overflow/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_execution_status/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_execution_status/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status/rule_status.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_execution_status/rule_status.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status/rule_status.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_execution_status/rule_status.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status/rule_status_badge.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_execution_status/rule_status_badge.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status/rule_status_badge.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_execution_status/rule_status_badge.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status/rule_status_badge.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_execution_status/rule_status_badge.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status/rule_status_badge.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_execution_status/rule_status_badge.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status/rule_status_failed_callout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_execution_status/rule_status_failed_callout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status/rule_status_failed_callout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_execution_status/rule_status_failed_callout.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status/rule_status_failed_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_execution_status/rule_status_failed_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status/rule_status_failed_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_execution_status/rule_status_failed_callout.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_execution_status/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_execution_status/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status/utils.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_execution_status/utils.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status/utils.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_execution_status/utils.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_execution_status/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/rule_execution_status/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_execution_status/utils.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_info/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_info/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/rule_info/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_info/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_info/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_info/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/rule_info/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_info/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_info/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_info/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/rule_info/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_info/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_switch/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_switch/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/rule_switch/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_switch/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_switch/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_switch/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/rule_switch/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_switch/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/rules/rule_switch/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_switch/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/rules/rule_switch/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/rules/rule_switch/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/severity/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/severity/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/severity/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/severity/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/severity/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/severity/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/severity/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/severity/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/status/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/status/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/status/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/status/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/status/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/status/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/status/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/status/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/user_info/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/user_info/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/user_info/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/user_info/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/user_info/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/user_info/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/user_info/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/user_info/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/user_privileges/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/user_privileges/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/user_privileges/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/user_privileges/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/user_privileges/use_fetch_detection_engine_privileges.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/user_privileges/use_fetch_detection_engine_privileges.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/user_privileges/use_fetch_detection_engine_privileges.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/user_privileges/use_fetch_detection_engine_privileges.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/user_privileges/use_fetch_list_privileges.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/user_privileges/use_fetch_list_privileges.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/user_privileges/use_fetch_list_privileges.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/user_privileges/use_fetch_list_privileges.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout/flyout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout/flyout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout/flyout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout/flyout.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout/flyout.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout/flyout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout/flyout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout/flyout.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout/form.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout/form.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout/form.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout/form.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout/form.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout/form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout/form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout/form.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout/reference_error_modal/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout/reference_error_modal/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout/reference_error_modal/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout/reference_error_modal/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout/reference_error_modal/reference_error_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout/reference_error_modal/reference_error_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout/reference_error_modal/reference_error_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout/reference_error_modal/reference_error_modal.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout/table_helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout/table_helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout/table_helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout/table_helpers.tsx diff --git a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/components/value_lists_management_flyout/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/components/value_lists_management_flyout/types.ts diff --git a/x-pack/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/columns.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/columns.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/columns.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/columns.ts diff --git a/x-pack/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/index.ts diff --git a/x-pack/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/render_cell_value.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/render_cell_value.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/render_cell_value.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/render_cell_value.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/render_cell_value.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/render_cell_value.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/render_cell_value.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/configurations/examples/observablity_alerts/render_cell_value.tsx diff --git a/x-pack/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/columns.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/columns.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/columns.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/columns.ts diff --git a/x-pack/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/index.ts diff --git a/x-pack/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/render_cell_value.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/render_cell_value.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/render_cell_value.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/render_cell_value.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/render_cell_value.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/render_cell_value.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/render_cell_value.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/configurations/examples/security_solution_rac/render_cell_value.tsx diff --git a/x-pack/plugins/security_solution/public/detections/configurations/security_solution_detections/columns.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/configurations/security_solution_detections/columns.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/configurations/security_solution_detections/columns.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/configurations/security_solution_detections/columns.ts diff --git a/x-pack/plugins/security_solution/public/detections/configurations/security_solution_detections/fetch_page_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/configurations/security_solution_detections/fetch_page_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/configurations/security_solution_detections/fetch_page_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/configurations/security_solution_detections/fetch_page_context.tsx diff --git a/x-pack/plugins/security_solution/public/detections/configurations/security_solution_detections/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/configurations/security_solution_detections/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/configurations/security_solution_detections/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/configurations/security_solution_detections/index.ts diff --git a/x-pack/plugins/security_solution/public/detections/configurations/security_solution_detections/render_cell_value.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/configurations/security_solution_detections/render_cell_value.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/configurations/security_solution_detections/render_cell_value.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/configurations/security_solution_detections/render_cell_value.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/configurations/security_solution_detections/render_cell_value.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/configurations/security_solution_detections/render_cell_value.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/configurations/security_solution_detections/render_cell_value.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/configurations/security_solution_detections/render_cell_value.tsx diff --git a/x-pack/plugins/security_solution/public/detections/configurations/security_solution_detections/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/configurations/security_solution_detections/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/configurations/security_solution_detections/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/configurations/security_solution_detections/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/constants.ts diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/__mocks__/api.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/__mocks__/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/__mocks__/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/__mocks__/api.ts diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/api.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/api.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/api.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/api.test.ts diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/api.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/api.ts diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/constants.ts diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/mock.ts diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/types.ts diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_alerts_privileges.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_alerts_privileges.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_alerts_privileges.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_alerts_privileges.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_alerts_privileges.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_alerts_privileges.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_alerts_privileges.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_alerts_privileges.tsx diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_cases_from_alerts.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_cases_from_alerts.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_cases_from_alerts.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_cases_from_alerts.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_cases_from_alerts.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_cases_from_alerts.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_cases_from_alerts.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_cases_from_alerts.tsx diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_check_signal_index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_check_signal_index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_check_signal_index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_check_signal_index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_query.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_query.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_query.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_query.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_query.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_query.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_query.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_query.tsx diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_signal_index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_signal_index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_signal_index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_signal_index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_signal_index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_signal_index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_signal_index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/alerts/use_signal_index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/exceptions/get_es_query_filter.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/exceptions/get_es_query_filter.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/exceptions/get_es_query_filter.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/exceptions/get_es_query_filter.ts diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/__mocks__/use_lists_config.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/lists/__mocks__/use_lists_config.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/__mocks__/use_lists_config.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/lists/__mocks__/use_lists_config.tsx diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/lists/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/lists/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_config.mock.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_config.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_config.mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_config.mock.ts diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_config.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_config.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_config.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_config.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_config.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_config.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_config.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_config.tsx diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_index.mock.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_index.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_index.mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_index.mock.ts diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_privileges.mock.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_privileges.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_privileges.mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_privileges.mock.ts diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_privileges.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_privileges.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_privileges.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_privileges.tsx diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/transforms.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/rules/transforms.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/transforms.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/rules/transforms.ts diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_rule_from_timeline.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/rules/use_rule_from_timeline.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_rule_from_timeline.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/rules/use_rule_from_timeline.test.ts diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_rule_from_timeline.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/rules/use_rule_from_timeline.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_rule_from_timeline.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/rules/use_rule_from_timeline.tsx diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/utils.test.ts diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/utils.ts diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/validate_rule_actions_field.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/validate_rule_actions_field.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/validate_rule_actions_field.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/validate_rule_actions_field.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/validate_rule_actions_field.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/validate_rule_actions_field.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/validate_rule_actions_field.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/containers/detection_engine/rules/validate_rule_actions_field/validate_rule_actions_field.ts diff --git a/x-pack/plugins/security_solution/public/detections/hooks/alerts_visualization/use_alert_histogram_count.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/hooks/alerts_visualization/use_alert_histogram_count.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/hooks/alerts_visualization/use_alert_histogram_count.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/hooks/alerts_visualization/use_alert_histogram_count.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/hooks/alerts_visualization/use_alert_histogram_count.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/hooks/alerts_visualization/use_alert_histogram_count.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/hooks/alerts_visualization/use_alert_histogram_count.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/hooks/alerts_visualization/use_alert_histogram_count.ts diff --git a/x-pack/plugins/security_solution/public/detections/hooks/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/hooks/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/hooks/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/hooks/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/mock/data.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/mock/data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/mock/data.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/mock/data.ts diff --git a/x-pack/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_actions_column.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_actions_column.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_actions_column.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_actions_column.tsx diff --git a/x-pack/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_alert_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_alert_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_alert_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_alert_actions.tsx diff --git a/x-pack/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_bulk_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_bulk_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_bulk_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_bulk_actions.tsx diff --git a/x-pack/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_cell_actions.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_cell_actions.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_cell_actions.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_cell_actions.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_cell_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_cell_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_cell_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_cell_actions.tsx diff --git a/x-pack/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_persistent_controls.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_persistent_controls.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_persistent_controls.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_persistent_controls.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_persistent_controls.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_persistent_controls.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_persistent_controls.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_persistent_controls.tsx diff --git a/x-pack/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_trigger_actions_browser_fields_options.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_trigger_actions_browser_fields_options.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_trigger_actions_browser_fields_options.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/hooks/trigger_actions_alert_table/use_trigger_actions_browser_fields_options.tsx diff --git a/x-pack/plugins/security_solution/public/detections/index.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/detections/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/detections/jest.config.js new file mode 100644 index 0000000000000..5a1c9b8dad1dc --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detections/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/detections'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/detections', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/detections/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/detections/links.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/links.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/links.ts diff --git a/x-pack/plugins/security_solution/public/detections/migrations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/migrations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/migrations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/migrations.ts diff --git a/x-pack/plugins/security_solution/public/detections/mitre/mitre_tactics_techniques.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/mitre/mitre_tactics_techniques.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/mitre/mitre_tactics_techniques.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/mitre/mitre_tactics_techniques.ts diff --git a/x-pack/plugins/security_solution/public/detections/mitre/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/mitre/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/mitre/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/mitre/types.ts diff --git a/x-pack/plugins/security_solution/public/detections/mitre/valid_threat_mock.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/mitre/valid_threat_mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/mitre/valid_threat_mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/mitre/valid_threat_mock.ts diff --git a/x-pack/plugins/security_solution/public/detections/pages/alerts/alert_details_redirect.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/alerts/alert_details_redirect.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/pages/alerts/alert_details_redirect.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/pages/alerts/alert_details_redirect.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/pages/alerts/alert_details_redirect.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/alerts/alert_details_redirect.tsx similarity index 96% rename from x-pack/plugins/security_solution/public/detections/pages/alerts/alert_details_redirect.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/pages/alerts/alert_details_redirect.tsx index 01e52d3ab7505..b8dd2a4cdcdb6 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/alerts/alert_details_redirect.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/alerts/alert_details_redirect.tsx @@ -26,7 +26,7 @@ export const AlertDetailsRedirect = () => { const timestamp = searchParams.get('timestamp'); // Although we use the 'default' space here when an index isn't provided or accidentally deleted // It's a safe catch all as we reset the '.internal.alerts-*` indices with the correct space in the flyout - // Here: x-pack/plugins/security_solution/public/timelines/components/side_panel/event_details/helpers.tsx + // Here: x-pack/solutions/security/plugins/security_solution/public/common/components/event_details/helpers.tsx const index = searchParams.get('index') ?? `.internal${DEFAULT_ALERTS_INDEX}-default`; const getInputSelector = useMemo(() => inputsSelectors.inputsSelector(), []); diff --git a/x-pack/plugins/security_solution/public/detections/pages/alerts/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/alerts/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/pages/alerts/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/pages/alerts/index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/pages/alerts/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/alerts/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/pages/alerts/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/pages/alerts/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/pages/alerts/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/alerts/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/pages/alerts/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/pages/alerts/utils.ts diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/detection_engine.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/detection_engine.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/pages/detection_engine/detection_engine.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/detection_engine.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/detection_engine.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/detection_engine.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/pages/detection_engine/detection_engine.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/detection_engine.tsx diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/detection_engine_no_index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/detection_engine_no_index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/pages/detection_engine/detection_engine_no_index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/detection_engine_no_index.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/detection_engine_no_index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/detection_engine_no_index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/pages/detection_engine/detection_engine_no_index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/detection_engine_no_index.tsx diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/detection_engine_user_unauthenticated.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/detection_engine_user_unauthenticated.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/pages/detection_engine/detection_engine_user_unauthenticated.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/detection_engine_user_unauthenticated.test.tsx diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/detection_engine_user_unauthenticated.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/detection_engine_user_unauthenticated.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/pages/detection_engine/detection_engine_user_unauthenticated.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/detection_engine_user_unauthenticated.tsx diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/breadcrumbs.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/rules/breadcrumbs.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/breadcrumbs.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/rules/breadcrumbs.ts diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/components/edit_rule_settings_button_link.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/rules/details/components/edit_rule_settings_button_link.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/components/edit_rule_settings_button_link.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/rules/details/components/edit_rule_settings_button_link.tsx diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.test.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx new file mode 100644 index 0000000000000..b244ecba07941 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx @@ -0,0 +1,492 @@ +/* + * 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 dateMath from '@kbn/datemath'; +import moment from 'moment'; +import memoizeOne from 'memoize-one'; +import { useLocation } from 'react-router-dom'; + +import styled from 'styled-components'; +import { EuiFlexItem } from '@elastic/eui'; +import type { + Severity, + SeverityMapping, + Threats, + Type, +} from '@kbn/securitysolution-io-ts-alerting-types'; +import { ENDPOINT_LIST_ID } from '@kbn/securitysolution-list-constants'; +import type { Filter } from '@kbn/es-query'; +import type { ActionVariables } from '@kbn/triggers-actions-ui-plugin/public'; +import { requiredOptional } from '@kbn/zod-helpers'; +import { + ALERT_SUPPRESSION_FIELDS_FIELD_NAME, + ALERT_SUPPRESSION_DURATION_TYPE_FIELD_NAME, + ALERT_SUPPRESSION_DURATION_FIELD_NAME, + ALERT_SUPPRESSION_MISSING_FIELDS_FIELD_NAME, +} from '../../../../detection_engine/rule_creation/components/alert_suppression_edit'; +import { THRESHOLD_ALERT_SUPPRESSION_ENABLED } from '../../../../detection_engine/rule_creation/components/threshold_alert_suppression_edit'; +import type { ResponseAction } from '../../../../../common/api/detection_engine/model/rule_response_actions'; +import { normalizeThresholdField } from '../../../../../common/detection_engine/utils'; +import { assertUnreachable } from '../../../../../common/utility_types'; +import { + transformRuleToAlertAction, + transformRuleToAlertResponseAction, +} from '../../../../../common/detection_engine/transform_actions'; +import type { + AboutStepRule, + AboutStepRuleDetails, + DefineStepRule, + ScheduleStepRule, + ActionsStepRule, +} from './types'; +import { DataSourceType, AlertSuppressionDurationType } from './types'; +import { severityOptions } from '../../../../detection_engine/rule_creation_ui/components/step_about_rule/data'; +import { DEFAULT_SUPPRESSION_MISSING_FIELDS_STRATEGY } from '../../../../../common/detection_engine/constants'; +import type { RuleAction, RuleResponse } from '../../../../../common/api/detection_engine'; +import { convertDateMathToDuration } from '../../../../common/utils/date_math'; +import { DEFAULT_HISTORY_WINDOW_SIZE } from '../../../../common/constants'; + +export interface GetStepsData { + aboutRuleData: AboutStepRule; + modifiedAboutRuleDetailsData: AboutStepRuleDetails; + defineRuleData: DefineStepRule; + scheduleRuleData: ScheduleStepRule; + ruleActionsData: ActionsStepRule; +} + +export const getStepsData = ({ + rule, + detailsView = false, +}: { + rule: RuleResponse; + detailsView?: boolean; +}): GetStepsData => { + const defineRuleData: DefineStepRule = getDefineStepsData(rule); + const aboutRuleData: AboutStepRule = getAboutStepsData(rule, detailsView); + const modifiedAboutRuleDetailsData: AboutStepRuleDetails = getModifiedAboutDetailsData(rule); + const scheduleRuleData: ScheduleStepRule = getScheduleStepsData(rule); + const ruleActionsData: ActionsStepRule = getActionsStepsData(rule); + + return { + aboutRuleData, + modifiedAboutRuleDetailsData, + defineRuleData, + scheduleRuleData, + ruleActionsData, + }; +}; + +export const getActionsStepsData = ( + rule: Omit<RuleResponse, 'actions'> & { + actions: RuleAction[]; + response_actions?: ResponseAction[]; + } +): ActionsStepRule => { + const { enabled, meta, actions = [], response_actions: responseActions } = rule; + + return { + actions: actions?.map((action) => transformRuleToAlertAction(action)), + responseActions: responseActions?.map(transformRuleToAlertResponseAction), + kibanaSiemAppUrl: + typeof meta?.kibana_siem_app_url === 'string' ? meta.kibana_siem_app_url : undefined, + enabled, + }; +}; + +export const getMachineLearningJobId = (rule: RuleResponse): string[] | undefined => { + if (rule.type === 'machine_learning') { + return typeof rule.machine_learning_job_id === 'string' + ? [rule.machine_learning_job_id] + : rule.machine_learning_job_id; + } + return undefined; +}; + +/* eslint-disable complexity */ +export const getDefineStepsData = (rule: RuleResponse): DefineStepRule => ({ + ruleType: rule.type, + anomalyThreshold: 'anomaly_threshold' in rule ? rule.anomaly_threshold : 50, + machineLearningJobId: getMachineLearningJobId(rule) || [], + index: ('index' in rule && rule.index) || [], + dataViewId: 'data_view_id' in rule ? rule.data_view_id : undefined, + threatIndex: ('threat_index' in rule && rule.threat_index) || [], + threatQueryBar: { + query: { + query: ('threat_query' in rule && rule.threat_query) || '', + language: ('threat_language' in rule && rule.threat_language) || '', + }, + filters: (('threat_filters' in rule && rule.threat_filters) || []) as Filter[], + saved_id: null, + }, + threatMapping: ('threat_mapping' in rule && rule.threat_mapping) || [], + queryBar: { + query: { + query: ('query' in rule && rule.query) || '', + language: ('language' in rule && rule.language) || '', + }, + filters: (('filters' in rule && rule.filters) || []) as Filter[], + saved_id: ('saved_id' in rule && rule.saved_id) || null, + }, + relatedIntegrations: rule.related_integrations ?? [], + requiredFields: rule.required_fields ?? [], + timeline: { + id: rule.timeline_id ?? null, + title: rule.timeline_title ?? null, + }, + threshold: { + field: normalizeThresholdField('threshold' in rule ? rule.threshold?.field : undefined), + value: `${('threshold' in rule && rule.threshold?.value) || 100}`, + ...('threshold' in rule && rule.threshold?.cardinality?.length + ? { + cardinality: { + field: [`${rule.threshold.cardinality[0].field}`], + value: `${rule.threshold.cardinality[0].value}`, + }, + } + : {}), + }, + eqlOptions: { + timestampField: 'timestamp_field' in rule ? rule.timestamp_field : undefined, + eventCategoryField: + 'event_category_override' in rule ? rule.event_category_override : undefined, + tiebreakerField: 'tiebreaker_field' in rule ? rule.tiebreaker_field : undefined, + }, + dataSourceType: + 'data_view_id' in rule && rule.data_view_id + ? DataSourceType.DataView + : DataSourceType.IndexPatterns, + newTermsFields: ('new_terms_fields' in rule && rule.new_terms_fields) || [], + historyWindowSize: + 'history_window_start' in rule && rule.history_window_start + ? convertDateMathToDuration(rule.history_window_start) + : DEFAULT_HISTORY_WINDOW_SIZE, + shouldLoadQueryDynamically: Boolean(rule.type === 'saved_query' && rule.saved_id), + [ALERT_SUPPRESSION_FIELDS_FIELD_NAME]: + ('alert_suppression' in rule && + rule.alert_suppression && + 'group_by' in rule.alert_suppression && + rule.alert_suppression.group_by) || + [], + [ALERT_SUPPRESSION_DURATION_TYPE_FIELD_NAME]: + 'alert_suppression' in rule && rule.alert_suppression?.duration + ? AlertSuppressionDurationType.PerTimePeriod + : AlertSuppressionDurationType.PerRuleExecution, + [ALERT_SUPPRESSION_DURATION_FIELD_NAME]: ('alert_suppression' in rule && + rule.alert_suppression?.duration) || { + value: 5, + unit: 'm', + }, + [ALERT_SUPPRESSION_MISSING_FIELDS_FIELD_NAME]: + ('alert_suppression' in rule && + rule.alert_suppression && + 'missing_fields_strategy' in rule.alert_suppression && + rule.alert_suppression.missing_fields_strategy) || + DEFAULT_SUPPRESSION_MISSING_FIELDS_STRATEGY, + [THRESHOLD_ALERT_SUPPRESSION_ENABLED]: Boolean( + 'alert_suppression' in rule && rule.alert_suppression?.duration + ), +}); + +export const getScheduleStepsData = (rule: RuleResponse): ScheduleStepRule => { + const { interval, from } = rule; + const fromHumanizedValue = getHumanizedDuration(from, interval); + + return { + interval, + from: fromHumanizedValue, + }; +}; + +/** + * Converts seconds to duration string, like "1h", "30m" or "15s" + */ +export const secondsToDurationString = (seconds: number): string => { + if (seconds === 0) { + return `0s`; + } + + if (seconds % 3600 === 0) { + return `${seconds / 3600}h`; + } else if (seconds % 60 === 0) { + return `${seconds / 60}m`; + } else { + return `${seconds}s`; + } +}; + +export const getHumanizedDuration = (from: string, interval: string): string => { + const fromValue = dateMath.parse(from) ?? moment(); + const intervalValue = dateMath.parse(`now-${interval}`) ?? moment(); + + const fromDuration = moment.duration(intervalValue.diff(fromValue)); + + // Basing calculations off floored seconds count as moment durations weren't precise + const intervalDuration = Math.floor(fromDuration.asSeconds()); + // For consistency of display value + + return secondsToDurationString(intervalDuration); +}; + +export const getAboutStepsData = (rule: RuleResponse, detailsView: boolean): AboutStepRule => { + const { name, description, note, setup } = determineDetailsValue(rule, detailsView); + const { + author, + building_block_type: buildingBlockType, + exceptions_list: exceptionsList, + license, + risk_score_mapping: riskScoreMapping, + rule_name_override: ruleNameOverride, + severity_mapping: severityMapping, + timestamp_override: timestampOverride, + timestamp_override_fallback_disabled: timestampOverrideFallbackDisabled, + references, + severity, + false_positives: falsePositives, + risk_score: riskScore, + investigation_fields: investigationFields, + tags, + threat, + max_signals: maxSignals, + } = rule; + const threatIndicatorPath = + 'threat_indicator_path' in rule ? rule.threat_indicator_path : undefined; + + return { + author, + isAssociatedToEndpointList: exceptionsList?.some(({ id }) => id === ENDPOINT_LIST_ID) ?? false, + isBuildingBlock: buildingBlockType !== undefined, + license: license ?? '', + ruleNameOverride: ruleNameOverride ?? '', + timestampOverride: timestampOverride ?? '', + timestampOverrideFallbackDisabled, + name, + description, + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + note: note!, + references, + severity: { + value: severity as Severity, + mapping: fillEmptySeverityMappings(severityMapping), + isMappingChecked: severityMapping.length > 0, + }, + tags, + riskScore: { + value: riskScore, + mapping: requiredOptional(riskScoreMapping), + isMappingChecked: riskScoreMapping.length > 0, + }, + falsePositives, + investigationFields: investigationFields?.field_names ?? [], + threat: threat as Threats, + threatIndicatorPath, + maxSignals, + setup, + }; +}; + +const severitySortMapping = { + low: 0, + medium: 1, + high: 2, + critical: 3, +}; + +export const fillEmptySeverityMappings = (mappings: SeverityMapping): SeverityMapping => { + const missingMappings: SeverityMapping = severityOptions.flatMap((so) => + mappings.find((mapping) => mapping.severity === so.value) == null + ? [{ field: '', value: '', operator: 'equals', severity: so.value }] + : [] + ); + return [...mappings, ...missingMappings].sort( + (a, b) => severitySortMapping[a.severity] - severitySortMapping[b.severity] + ); +}; + +export const determineDetailsValue = ( + rule: RuleResponse, + detailsView: boolean +): Pick<RuleResponse, 'name' | 'description' | 'note' | 'setup'> => { + const { name, description, note, setup } = rule; + if (detailsView) { + return { name: '', description: '', note: '', setup: '' }; + } + + return { name, description, setup, note: note ?? '' }; +}; + +export const getModifiedAboutDetailsData = (rule: RuleResponse): AboutStepRuleDetails => ({ + note: rule.note ?? '', + description: rule.description, + setup: rule.setup ?? '', +}); + +export const useQuery = () => new URLSearchParams(useLocation().search); + +export type PrePackagedRuleInstallationStatus = + | 'ruleInstalled' + | 'ruleNotInstalled' + | 'ruleNeedUpdate' + | 'someRuleUninstall' + | 'unknown'; + +export type PrePackagedTimelineInstallationStatus = + | 'timelinesNotInstalled' + | 'timelinesInstalled' + | 'someTimelineUninstall' + | 'timelineNeedUpdate' + | 'unknown'; + +export const getPrePackagedTimelineInstallationStatus = ( + timelinesInstalled?: number, + timelinesNotInstalled?: number, + timelinesNotUpdated?: number +): PrePackagedTimelineInstallationStatus => { + if ( + timelinesNotInstalled != null && + timelinesInstalled === 0 && + timelinesNotInstalled > 0 && + timelinesNotUpdated === 0 + ) { + return 'timelinesNotInstalled'; + } else if ( + timelinesInstalled != null && + timelinesInstalled > 0 && + timelinesNotInstalled === 0 && + timelinesNotUpdated === 0 + ) { + return 'timelinesInstalled'; + } else if ( + timelinesInstalled != null && + timelinesNotInstalled != null && + timelinesInstalled > 0 && + timelinesNotInstalled > 0 && + timelinesNotUpdated === 0 + ) { + return 'someTimelineUninstall'; + } else if ( + timelinesInstalled != null && + timelinesNotInstalled != null && + timelinesNotUpdated != null && + timelinesInstalled > 0 && + timelinesNotInstalled >= 0 && + timelinesNotUpdated > 0 + ) { + return 'timelineNeedUpdate'; + } + return 'unknown'; +}; + +export const redirectToDetections = ( + isSignalIndexExists: boolean | null, + isAuthenticated: boolean | null, + hasEncryptionKey: boolean | null, + needsListsConfiguration: boolean +) => + isSignalIndexExists === false || + isAuthenticated === false || + hasEncryptionKey === false || + needsListsConfiguration; + +const commonRuleParamsKeys = [ + 'id', + 'name', + 'description', + 'false_positives', + 'investigation_fields', + 'rule_id', + 'max_signals', + 'risk_score', + 'output_index', + 'references', + 'severity', + 'timeline_id', + 'timeline_title', + 'threat', + 'type', + 'version', +]; +const queryRuleParams = ['index', 'filters', 'language', 'query', 'saved_id', 'response_actions']; +const esqlRuleParams = ['filters', 'language', 'query', 'response_actions']; +const machineLearningRuleParams = ['anomaly_threshold', 'machine_learning_job_id']; +const thresholdRuleParams = ['threshold', ...queryRuleParams]; + +const getAllRuleParamsKeys = (): string[] => { + const allRuleParamsKeys = [ + ...commonRuleParamsKeys, + ...queryRuleParams, + ...machineLearningRuleParams, + ...thresholdRuleParams, + ].sort(); + + return Array.from(new Set<string>(allRuleParamsKeys)); +}; + +const getRuleSpecificRuleParamKeys = (ruleType: Type) => { + switch (ruleType) { + case 'machine_learning': + return machineLearningRuleParams; + case 'threshold': + return thresholdRuleParams; + case 'esql': + return esqlRuleParams; + case 'new_terms': + case 'threat_match': + case 'query': + case 'saved_query': + case 'eql': + return queryRuleParams; + } + assertUnreachable(ruleType); +}; + +export const getActionMessageRuleParams = (ruleType: Type): string[] => { + const ruleParamsKeys = [ + ...commonRuleParamsKeys, + ...getRuleSpecificRuleParamKeys(ruleType), + ].sort(); + + return ruleParamsKeys; +}; + +const transformRuleKeysToActionVariables = (actionMessageRuleParams: string[]): ActionVariables => { + return { + state: [{ name: 'signals_count', description: 'state.signals_count' }], + params: [], + context: [ + { + name: 'results_link', + description: 'context.results_link', + useWithTripleBracesInTemplates: true, + }, + { name: 'alerts', description: 'context.alerts' }, + ...actionMessageRuleParams.map((param) => { + const extendedParam = `rule.${param}`; + return { name: extendedParam, description: `context.${extendedParam}` }; + }), + ], + }; +}; + +export const getActionMessageParams = memoizeOne((ruleType: Type | undefined): ActionVariables => { + if (!ruleType) { + return { state: [], params: [] }; + } + const actionMessageRuleParams = getActionMessageRuleParams(ruleType); + + return transformRuleKeysToActionVariables(actionMessageRuleParams); +}); + +/** + * returns action variables available for all rule types + */ +export const getAllActionMessageParams = () => + transformRuleKeysToActionVariables(getAllRuleParamsKeys()); + +export const MaxWidthEuiFlexItem = styled(EuiFlexItem)` + max-width: 1000px; + overflow: hidden; +`; diff --git a/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/rules/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/rules/translations.ts new file mode 100644 index 0000000000000..b12355c109879 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/rules/translations.ts @@ -0,0 +1,1455 @@ +/* + * 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'; + +export const POPOVER_TOOLTIP_ARIA_LABEL = (columnName: string) => + i18n.translate('xpack.securitySolution.detectionEngine.rules.popoverTooltip.ariaLabel', { + defaultMessage: 'Tooltip for column: {columnName}', + values: { columnName }, + }); + +export const IMPORT_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.importRuleTitle', + { + defaultMessage: 'Import rules', + } +); + +export const IMPORT_VALUE_LISTS = i18n.translate( + 'xpack.securitySolution.lists.detectionEngine.rules.importValueListsButton', + { + defaultMessage: 'Manage value lists', + } +); + +export const UPLOAD_VALUE_LISTS_TOOLTIP = i18n.translate( + 'xpack.securitySolution.lists.detectionEngine.rules.uploadValueListsButtonTooltip', + { + defaultMessage: + 'Use value lists to create an exception when a field value matches a value found in a list', + } +); + +export const UPLOAD_VALUE_LISTS_PRIVILEGES_TOOLTIP = i18n.translate( + 'xpack.securitySolution.lists.detectionEngine.rules.uploadValueListsButtonPrivilegesTooltip', + { + defaultMessage: + 'A user with manage cluster privileges must visit the Rules page before you can import value lists.', + } +); + +export const ADD_NEW_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.addNewRuleTitle', + { + defaultMessage: 'Create new rule', + } +); + +export const PAGE_TITLE = i18n.translate('xpack.securitySolution.detectionEngine.rules.pageTitle', { + defaultMessage: 'Rules', +}); + +export const ADD_PAGE_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.addPageTitle', + { + defaultMessage: 'Create', + } +); + +export const EDIT_PAGE_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.editPageTitle', + { + defaultMessage: 'Edit', + } +); + +export const REFRESH = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.refreshTitle', + { + defaultMessage: 'Refresh', + } +); + +export const BATCH_ACTIONS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.batchActionsTitle', + { + defaultMessage: 'Bulk actions', + } +); + +export const BULK_ACTION_ENABLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.enableTitle', + { + defaultMessage: 'Enable', + } +); + +export const BULK_ACTION_DISABLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.disableTitle', + { + defaultMessage: 'Disable', + } +); + +export const BULK_ACTION_EXPORT = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.exportTitle', + { + defaultMessage: 'Export', + } +); + +export const BULK_ACTION_MANUAL_RULE_RUN = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.manualRuleRunTitle', + { + defaultMessage: 'Manual run', + } +); + +export const BULK_ACTION_DUPLICATE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.duplicateTitle', + { + defaultMessage: 'Duplicate', + } +); + +export const BULK_ACTION_DELETE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.deleteTitle', + { + defaultMessage: 'Delete', + } +); + +export const BULK_ACTION_INDEX_PATTERNS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.indexPatternsTitle', + { + defaultMessage: 'Index patterns', + } +); + +export const BULK_ACTION_TAGS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.tagsTitle', + { + defaultMessage: 'Tags', + } +); + +export const BULK_ACTION_ADD_INDEX_PATTERNS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.addIndexPatternsTitle', + { + defaultMessage: 'Add index patterns', + } +); + +export const BULK_ACTION_DELETE_INDEX_PATTERNS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.deleteIndexPatternsTitle', + { + defaultMessage: 'Delete index patterns', + } +); + +export const BULK_ACTION_ADD_TAGS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.addTagsTitle', + { + defaultMessage: 'Add tags', + } +); + +export const BULK_ACTION_DELETE_TAGS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.deleteTagsTitle', + { + defaultMessage: 'Delete tags', + } +); + +export const BULK_ACTION_INVESTIGATION_FIELDS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.investigationFieldsTitle', + { + defaultMessage: 'Custom highlighted fields', + } +); + +export const BULK_ACTION_ADD_INVESTIGATION_FIELDS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.addInvestigationFieldsTitle', + { + defaultMessage: 'Add custom highlighted fields', + } +); + +export const BULK_ACTION_DELETE_INVESTIGATION_FIELDS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.deleteInvestigationFieldsTitle', + { + defaultMessage: 'Delete custom highlighted fields', + } +); + +export const BULK_ACTION_APPLY_TIMELINE_TEMPLATE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.applyTimelineTemplateTitle', + { + defaultMessage: 'Apply Timeline template', + } +); + +export const BULK_ACTION_ADD_RULE_ACTIONS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.addRuleActionsTitle', + { + defaultMessage: 'Add rule actions', + } +); + +export const BULK_ACTION_SET_SCHEDULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.setScheduleTitle', + { + defaultMessage: 'Update rule schedules', + } +); + +export const BULK_ACTION_MENU_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.contextMenuTitle', + { + defaultMessage: 'Options', + } +); + +export const BULK_EDIT_WARNING_TOAST_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkEditWarningToastTitle', + { + defaultMessage: 'Rules updates are in progress', + } +); + +export const BULK_EDIT_WARNING_TOAST_DESCRIPTION = (rulesCount: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkEditWarningToastDescription', + { + values: { rulesCount }, + defaultMessage: '{rulesCount, plural, =1 {# rule is} other {# rules are}} updating.', + } + ); + +export const BULK_EDIT_WARNING_TOAST_NOTIFY = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkEditWarningToastNotifyButtonLabel', + { + defaultMessage: `Notify me when done`, + } +); + +export const BULK_EXPORT_CONFIRMATION_REJECTED_TITLE = (rulesCount: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkExportConfirmationDeniedTitle', + { + values: { rulesCount }, + defaultMessage: '{rulesCount, plural, =1 {# rule} other {# rules}} cannot be exported', + } + ); + +export const BULK_MANUAL_RULE_RUN_CONFIRMATION_REJECTED_TITLE = (rulesCount: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkManualRuleRunConfirmationDeniedTitle', + { + values: { rulesCount }, + defaultMessage: '{rulesCount, plural, =1 {# rule} other {# rules}} cannot be scheduled', + } + ); + +export const BULK_EDIT_CONFIRMATION_REJECTED_TITLE = (rulesCount: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkEditConfirmationDeniedTitle', + { + values: { rulesCount }, + defaultMessage: '{rulesCount, plural, =1 {# rule} other {# rules}} cannot be edited', + } + ); + +export const BULK_ACTION_CONFIRMATION_PARTLY_TITLE = (rulesCount: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkActionConfirmationPartlyTitle', + { + values: { rulesCount }, + defaultMessage: + 'This action can only be applied to {rulesCount, plural, =1 {# rule} other {# rules}}', + } + ); + +export const BULK_EDIT_CONFIRMATION_CANCEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditConfirmationCancelButtonLabel', + { + defaultMessage: 'Cancel', + } +); + +export const BULK_ACTION_CONFIRMATION_CLOSE = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkActionConfirmationCloseButtonLabel', + { + defaultMessage: 'Close', + } +); + +export const BULK_EDIT_CONFIRMATION_CONFIRM = (rulesCount: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditConfirmation.confirmButtonLabel', + { + values: { rulesCount }, + defaultMessage: 'Edit {rulesCount, plural, =1 {# rule} other {# rules}}', + } + ); + +export const BULK_EXPORT_CONFIRMATION_CONFIRM = (rulesCount: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkExportConfirmation.confirmButtonLabel', + { + values: { rulesCount }, + defaultMessage: 'Export {rulesCount, plural, =1 {# rule} other {# rules}}', + } + ); + +export const BULK_MANUAL_RULE_RUN_CONFIRMATION_CONFIRM = (rulesCount: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkManualRuleRunConfirmation.confirmButtonLabel', + { + values: { rulesCount }, + defaultMessage: 'Schedule {rulesCount, plural, =1 {# rule} other {# rules}}', + } + ); + +export const BULK_MANUAL_RULE_RUN_LIMIT_ERROR_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkManualRuleRunLimitErrorMessage', + { + defaultMessage: 'This action can only be applied', + } +); + +export const BULK_MANUAL_RULE_RUN_LIMIT_ERROR_MESSAGE = (rulesCount: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkManualRuleRunLimitErrorTitle', + { + values: { rulesCount }, + defaultMessage: + 'Manual rule run cannot be scheduled for more than {rulesCount, plural, =1 {# rule} other {# rules}}', + } + ); + +export const BULK_MANUAL_RULE_RUN_LIMIT_ERROR_CLOSE_BUTTON = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.bulkManualRuleRunLimitErrorCloseButton', + { + defaultMessage: 'Close', + } +); + +export const BULK_EDIT_FLYOUT_FORM_SAVE = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.saveButtonLabel', + { + defaultMessage: 'Save', + } +); + +export const BULK_EDIT_FLYOUT_FORM_CANCEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.cancelButtonLabel', + { + defaultMessage: 'Cancel', + } +); + +export const BULK_EDIT_FLYOUT_FORM_ADD_INDEX_PATTERNS_HELP_TEXT = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addIndexPatternsComboboxHelpText', + { + defaultMessage: + 'Enter the pattern of Elasticsearch indices that you would like to add. By default, the dropdown includes index patterns defined in Security Solution advanced settings.', + } +); + +export const BULK_EDIT_FLYOUT_FORM_DELETE_INDEX_PATTERNS_HELP_TEXT = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.deleteIndexPatternsComboboxHelpText', + { + defaultMessage: + 'Enter the pattern of Elasticsearch indices that you would like to delete. By default, the dropdown includes index patterns defined in Security Solution advanced settings.', + } +); + +export const BULK_EDIT_FLYOUT_FORM_ADD_INDEX_PATTERNS_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addIndexPatternsComboboxLabel', + { + defaultMessage: 'Add index patterns for selected rules', + } +); + +export const BULK_EDIT_FLYOUT_FORM_ADD_INDEX_PATTERNS_REQUIRED_ERROR = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.indexPatternsRequiredErrorMessage', + { + defaultMessage: 'A minimum of one index pattern is required.', + } +); + +export const BULK_EDIT_FLYOUT_FORM_ADD_INDEX_PATTERNS_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addIndexPatternsTitle', + { + defaultMessage: 'Add index patterns', + } +); + +export const BULK_EDIT_FLYOUT_FORM_ADD_INDEX_PATTERNS_OVERWRITE_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addIndexPatternsOverwriteCheckboxLabel', + { + defaultMessage: "Overwrite all selected rules' index patterns", + } +); + +export const BULK_EDIT_FLYOUT_FORM_DATA_VIEWS_OVERWRITE_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.dataViewsOverwriteCheckboxLabel', + { + defaultMessage: 'Apply changes to rules configured with data views', + } +); + +export const BULK_EDIT_FLYOUT_FORM_DELETE_INDEX_PATTERNS_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.deleteIndexPatternsComboboxLabel', + { + defaultMessage: 'Delete index patterns for selected rules', + } +); + +export const BULK_EDIT_FLYOUT_FORM_DELETE_INDEX_PATTERNS_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.deleteIndexPatternsTitle', + { + defaultMessage: 'Delete index patterns', + } +); + +export const BULK_EDIT_FLYOUT_FORM_ADD_TAGS_HELP_TEXT = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addTagsComboboxHelpText', + { + defaultMessage: + 'Add one or more tags for selected rules from the dropdown. You can also enter custom identifying tags and press Enter to begin a new one.', + } +); + +export const BULK_EDIT_FLYOUT_FORM_DELETE_TAGS_HELP_TEXT = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.deleteTagsComboboxHelpText', + { + defaultMessage: + 'Delete one or more tags for selected rules from the dropdown. You can also enter custom identifying tags and press Enter to begin a new one.', + } +); + +export const BULK_EDIT_FLYOUT_FORM_ADD_TAGS_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addTagsComboboxLabel', + { + defaultMessage: 'Add tags for selected rules', + } +); + +export const BULK_EDIT_FLYOUT_FORM_TAGS_REQUIRED_ERROR = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.tagsComoboxRequiredErrorMessage', + { + defaultMessage: 'A minimum of one tag is required.', + } +); + +export const BULK_EDIT_FLYOUT_FORM_ADD_TAGS_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addTagsTitle', + { + defaultMessage: 'Add tags', + } +); + +export const BULK_EDIT_FLYOUT_FORM_ADD_TAGS_OVERWRITE_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addTagsOverwriteCheckboxLabel', + { + defaultMessage: "Overwrite all selected rules' tags", + } +); + +export const BULK_EDIT_FLYOUT_FORM_DELETE_TAGS_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.deleteTagsComboboxLabel', + { + defaultMessage: 'Delete tags for selected rules', + } +); + +export const BULK_EDIT_FLYOUT_FORM_DELETE_TAGS_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.deleteTagsTitle', + { + defaultMessage: 'Delete tags', + } +); + +export const BULK_EDIT_FLYOUT_FORM_ADD_INVESTIGATION_FIELDS_REQUIRED_ERROR = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.investigationFieldsRequiredErrorMessage', + { + defaultMessage: 'A minimum of one custom highlighted field is required.', + } +); + +export const BULK_EDIT_FLYOUT_FORM_ADD_INVESTIGATION_FIELDS_OVERWRITE_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addInvestigationFieldsOverwriteCheckboxLabel', + { + defaultMessage: 'Overwrite the custom highlighted fields for the selected rules', + } +); + +export const BULK_EDIT_FLYOUT_FORM_ADD_INVESTIGATION_FIELDS_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addInvestigationFieldsComboboxLabel', + { + defaultMessage: 'Add custom highlighted fields for selected rules', + } +); + +export const BULK_EDIT_FLYOUT_FORM_ADD_INVESTIGATION_FIELDS_HELP_TEXT = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addInvestigationFieldsComboboxHelpText', + { + defaultMessage: + 'Enter fields that you want to add. You can choose from any of the fields included in the default Elastic Security indices.', + } +); + +export const BULK_EDIT_FLYOUT_FORM_ADD_INVESTIGATION_FIELDS_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.addInvestigationFieldsTitle', + { + defaultMessage: 'Add custom highlighted fields', + } +); + +export const BULK_EDIT_FLYOUT_FORM_DELETE_INVESTIGATION_FIELDS_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.deleteInvestigationFieldsComboboxLabel', + { + defaultMessage: 'Delete custom highlighted fields for selected rules', + } +); + +export const BULK_EDIT_FLYOUT_FORM_DELETE_INVESTIGATION_FIELDS_HELP_TEXT = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.deleteInvestigationFieldsComboboxHelpText', + { + defaultMessage: + 'Enter the fields that you want to remove from the selected rules. After you remove these fields, they will no longer appear in the Highlighted fields section of the alerts generated by selected rules.', + } +); + +export const BULK_EDIT_FLYOUT_FORM_DELETE_INVESTIGATION_FIELDS_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkActions.bulkEditFlyoutForm.deleteInvestigationFieldsTitle', + { + defaultMessage: 'Delete custom highlighted fields', + } +); + +export const EXPORT_FILENAME = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.exportFilenameTitle', + { + defaultMessage: 'rules_export', + } +); + +export const SEARCH_RULES = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.searchAriaLabel', + { + defaultMessage: 'Search rules', + } +); + +export const SEARCH_PLACEHOLDER = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.searchPlaceholder', + { + defaultMessage: + 'Rule name, index pattern (e.g., "filebeat-*"), or MITRE ATT&CK™ tactic or technique (e.g., "Defense Evasion" or "TA0005")', + } +); + +export const SHOWING_RULES = (firstInPage: number, lastOfPage: number, totalRules: number) => + i18n.translate('xpack.securitySolution.detectionEngine.rules.allRules.showingRulesTitle', { + values: { firstInPage, lastOfPage, totalRules }, + defaultMessage: + 'Showing {firstInPage}-{lastOfPage} of {totalRules} {totalRules, plural, =1 {rule} other {rules}}', + }); + +export const SELECT_ALL_RULES = (totalRules: number) => + i18n.translate('xpack.securitySolution.detectionEngine.rules.allRules.selectAllRulesTitle', { + values: { totalRules }, + defaultMessage: 'Select all {totalRules} {totalRules, plural, =1 {rule} other {rules}}', + }); + +export const CLEAR_SELECTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.clearSelectionTitle', + { + defaultMessage: 'Clear selection', + } +); + +export const SELECTED_RULES = (selectedRules: number) => + i18n.translate('xpack.securitySolution.detectionEngine.rules.allRules.selectedRulesTitle', { + values: { selectedRules }, + defaultMessage: 'Selected {selectedRules} {selectedRules, plural, =1 {rule} other {rules}}', + }); + +export const EDIT_RULE_SETTINGS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.actions.editRuleSettingsDescription', + { + defaultMessage: 'Edit rule settings', + } +); + +export const LACK_OF_KIBANA_ACTIONS_FEATURE_PRIVILEGES = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.actions.lackOfKibanaActionsFeaturePrivileges', + { + defaultMessage: 'You do not have Kibana Actions privileges', + } +); + +export const LACK_OF_KIBANA_SECURITY_PRIVILEGES = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.actions.lackOfKibanaSecurityPrivileges', + { + defaultMessage: 'You do not have Kibana Security privileges', + } +); + +export const DUPLICATE_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.actions.duplicateRuleDescription', + { + defaultMessage: 'Duplicate rule', + } +); + +export const EXPORT_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.actions.exportRuleDescription', + { + defaultMessage: 'Export rule', + } +); + +export const DELETE_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.actions.deleteRuleDescription', + { + defaultMessage: 'Delete rule', + } +); + +export const MANUAL_RULE_RUN = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.actions.manualRuleRunDescription', + { + defaultMessage: 'Manual run', + } +); + +export const MANUAL_RULE_RUN_TOOLTIP = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.actions.manualRuleRunTooltip', + { + defaultMessage: 'Manual run available only for enabled rules', + } +); + +export const COLUMN_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.ruleTitle', + { + defaultMessage: 'Rule', + } +); + +export const COLUMN_RISK_SCORE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.riskScoreTitle', + { + defaultMessage: 'Risk score', + } +); + +export const COLUMN_SEVERITY = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.severityTitle', + { + defaultMessage: 'Severity', + } +); + +export const COLUMN_LAST_COMPLETE_RUN = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.lastRunTitle', + { + defaultMessage: 'Last run', + } +); + +export const COLUMN_LAST_UPDATE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.lastUpdateTitle', + { + defaultMessage: 'Last updated', + } +); + +export const COLUMN_LAST_RESPONSE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.lastResponseTitle', + { + defaultMessage: 'Last response', + } +); + +export const COLUMN_TAGS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.tagsTitle', + { + defaultMessage: 'Tags', + } +); + +export const COLUMN_INTEGRATIONS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.integrationsTitle', + { + defaultMessage: 'Integrations', + } +); + +export const COLUMN_MODIFIED = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.modifiedTitle', + { + defaultMessage: 'MODIFIED', + } +); + +export const COLUMN_ENABLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.enabledTitle', + { + defaultMessage: 'Enabled', + } +); + +export const COLUMN_SNOOZE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.snoozeTitle', + { + defaultMessage: 'Notify', + } +); + +export const COLUMN_INDEXING_TIMES = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.indexingTimes', + { + defaultMessage: 'Indexing Time (ms)', + } +); + +export const COLUMN_INDEXING_TIMES_TOOLTIP = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.indexingTimesTooltip', + { + defaultMessage: 'Total time spent indexing alerts during last Rule execution', + } +); + +export const COLUMN_QUERY_TIMES = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.queryTimes', + { + defaultMessage: 'Query Time (ms)', + } +); + +export const COLUMN_QUERY_TIMES_TOOLTIP = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.queryTimesTooltip', + { + defaultMessage: 'Total time spent querying source indices during last Rule execution', + } +); + +export const COLUMN_GAP = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.gap', + { + defaultMessage: 'Last Gap (if any)', + } +); + +export const COLUMN_GAP_TOOLTIP_SEE_DOCUMENTATION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.columns.gapTooltipSeeDocsDescription', + { + defaultMessage: 'see documentation', + } +); + +export const RULES_TAB = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.tabs.rules', + { + defaultMessage: 'Rules', + } +); + +export const MONITORING_TAB = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.tabs.monitoring', + { + defaultMessage: 'Rule Monitoring', + } +); + +export const ENABLED_RULES = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.filters.enabledRulesTitle', + { + defaultMessage: 'Enabled rules', + } +); + +export const DISABLED_RULES = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.filters.disabledRulesTitle', + { + defaultMessage: 'Disabled rules', + } +); + +export const CUSTOM_RULES = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.filters.customRulesTitle', + { + defaultMessage: 'Custom rules', + } +); + +export const ELASTIC_RULES = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.filters.elasticRulesTitle', + { + defaultMessage: 'Elastic rules', + } +); + +export const TAGS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.filters.tagsLabel', + { + defaultMessage: 'Tags', + } +); + +export const SEARCH_TAGS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.filters.searchTagsPlaceholder', + { + defaultMessage: 'Search tags', + } +); + +export const RULES_TAG_SEARCH = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.filters.rulesTagSearchText', + { + defaultMessage: 'Rules tag search', + } +); + +export const NO_TAGS_AVAILABLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.filters.noTagsAvailableDescription', + { + defaultMessage: 'No tags available', + } +); + +export const RULE_SOURCE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.filters.ruleSourceLabel', + { + defaultMessage: 'Modifications', + } +); + +export const MODIFIED_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.upgradeRules.modifiedLabel', + { + defaultMessage: 'Modified', + } +); + +export const UNMODIFIED_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.upgradeRules.unmodifiedLabel', + { + defaultMessage: 'Unmodified', + } +); + +export const MODIFIED_TOOLTIP = i18n.translate( + 'xpack.securitySolution.detectionEngine.upgradeRules.modifiedTooltipDescription', + { + defaultMessage: 'This Elastic rule has been modified.', + } +); + +export const RULE_EXECTION_STATUS_FILTER = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.filters.ruleExecutionStatusFilter', + { + defaultMessage: 'Select rule execution status to filter by', + } +); + +export const NO_RULES = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.filters.noRulesTitle', + { + defaultMessage: 'No rules found', + } +); + +export const NO_RULES_BODY = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.filters.noRulesBodyTitle', + { + defaultMessage: "We weren't able to find any rules with the above filters.", + } +); + +export const NO_RULES_AVAILABLE_FOR_INSTALL = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.addRules.noRulesTitle', + { + defaultMessage: 'All Elastic rules have been installed', + } +); + +export const NO_RULES_AVAILABLE_FOR_INSTALL_BODY = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.addRules.noRulesBodyTitle', + { + defaultMessage: 'There are no prebuilt detection rules available for installation', + } +); +export const NO_RULES_AVAILABLE_FOR_UPGRADE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.noRulesTitle', + { + defaultMessage: 'All Elastic rules are up to date', + } +); + +export const NO_RULES_AVAILABLE_FOR_UPGRADE_BODY = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.noRulesBodyTitle', + { + defaultMessage: 'There are currently no available updates to your installed Elastic rules.', + } +); + +export const DEFINE_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.defineRuleTitle', + { + defaultMessage: 'Define rule', + } +); + +export const ABOUT_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.aboutRuleTitle', + { + defaultMessage: 'About rule', + } +); + +export const SCHEDULE_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.scheduleRuleTitle', + { + defaultMessage: 'Schedule rule', + } +); + +export const RULE_ACTIONS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.ruleActionsTitle', + { + defaultMessage: 'Rule actions', + } +); + +export const DEFINITION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.stepDefinitionTitle', + { + defaultMessage: 'Definition', + } +); + +export const ABOUT = i18n.translate('xpack.securitySolution.detectionEngine.rules.stepAboutTitle', { + defaultMessage: 'About', +}); + +export const SCHEDULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.stepScheduleTitle', + { + defaultMessage: 'Schedule', + } +); + +export const ACTIONS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.stepActionsTitle', + { + defaultMessage: 'Actions', + } +); + +export const OPTIONAL_FIELD = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.optionalFieldDescription', + { + defaultMessage: 'Optional', + } +); + +export const CONTINUE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.continueButtonTitle', + { + defaultMessage: 'Continue', + } +); + +export const UPDATE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.updateButtonTitle', + { + defaultMessage: 'Update', + } +); + +export const DELETE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.deleteDescription', + { + defaultMessage: 'Delete', + } +); + +export const IMPORT_RULE_BTN_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.importRuleModal.importRuleTitle', + { + defaultMessage: 'Import', + } +); + +export const SELECT_RULE = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.importRuleModal.selectRuleDescription', + { + defaultMessage: + 'Select rules to import. Associated rule actions and exceptions can be included.', + } +); + +export const INITIAL_PROMPT_TEXT = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.importRuleModal.initialPromptTextDescription', + { + defaultMessage: 'Select or drag and drop a valid rules_export.ndjson file', + } +); + +export const OVERWRITE_WITH_SAME_NAME = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.importRuleModal.overwriteDescription', + { + defaultMessage: 'Overwrite existing detection rules with conflicting "rule_id"', + } +); + +export const SUCCESSFULLY_IMPORTED_RULES = (totalRules: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.components.importRuleModal.successfullyImportedRulesTitle', + { + values: { totalRules }, + defaultMessage: + 'Successfully imported {totalRules} {totalRules, plural, =1 {rule} other {rules}}', + } + ); + +export const IMPORT_FAILED = (totalRules: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.components.importRuleModal.importFailedTitle', + { + values: { totalRules }, + defaultMessage: 'Failed to import {totalRules} {totalRules, plural, =1 {rule} other {rules}}', + } + ); + +export const IMPORT_FAILED_DETAILED = (message: string) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.components.importRuleModal.importFailedDetailedTitle', + { + values: { message }, + defaultMessage: '{message}', + } + ); + +export const BULK_DELETE_CONFIRMATION_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.bulkDeleteConfirmationTitle', + { + defaultMessage: 'Confirm bulk deletion', + } +); + +export const SINGLE_DELETE_CONFIRMATION_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.singleDeleteConfirmationTitle', + { + defaultMessage: 'Confirm deletion', + } +); + +export const DELETE_CONFIRMATION_CONFIRM = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.deleteConfirmationConfirm', + { + defaultMessage: 'Delete', + } +); + +export const DELETE_CONFIRMATION_CANCEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.components.allRules.deleteConfirmationCancel', + { + defaultMessage: 'Cancel', + } +); + +export const REFRESH_RULE_POPOVER_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.refreshRulePopoverDescription', + { + defaultMessage: 'Automatically refresh table', + } +); + +export const REFRESH_RULE_POPOVER_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.refreshRulePopoverLabel', + { + defaultMessage: 'Refresh settings', + } +); + +export const CLEAR_RULES_TABLE_FILTERS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.clearRulesTableFilters', + { + defaultMessage: 'Clear filters', + } +); + +/** + * Bulk Export + */ + +export const RULES_BULK_EXPORT_SUCCESS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.export.successToastTitle', + { + defaultMessage: 'Rules exported', + } +); + +export const RULES_BULK_EXPORT_SUCCESS_DESCRIPTION = (exportedRules: number, totalRules: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.export.successToastDescription', + { + values: { totalRules, exportedRules }, + defaultMessage: + 'Successfully exported {exportedRules} of {totalRules} {totalRules, plural, =1 {rule} other {rules}}.', + } + ); + +export const RULES_BULK_EXPORT_PREBUILT_RULES_EXCLUDED_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.export.prebuiltRulesExcludedToastDescription', + { + defaultMessage: 'Prebuilt rules were excluded from the resulting file.', + } +); + +export const RULES_BULK_EXPORT_FAILURE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.export.errorToastTitle', + { + defaultMessage: 'Error exporting rules', + } +); + +export const RULES_BULK_EXPORT_FAILURE_DESCRIPTION = (rulesCount: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.export.errorToastDescription', + { + values: { rulesCount }, + defaultMessage: '{rulesCount, plural, =1 {# rule is} other {# rules are}} failed to export.', + } + ); + +/** + * Bulk Duplicate + */ + +export const RULES_BULK_DUPLICATE_SUCCESS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.duplicate.successToastTitle', + { + defaultMessage: 'Rules duplicated', + } +); + +export const RULES_BULK_DUPLICATE_SUCCESS_DESCRIPTION = (totalRules: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.duplicate.successToastDescription', + { + values: { totalRules }, + defaultMessage: + 'Successfully duplicated {totalRules, plural, =1 {{totalRules} rule} other {{totalRules} rules}}', + } + ); + +export const RULES_BULK_DUPLICATE_FAILURE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.duplicate.errorToastTitle', + { + defaultMessage: 'Error duplicating rule', + } +); + +export const RULES_BULK_DUPLICATE_FAILURE_DESCRIPTION = (rulesCount: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.duplicate.errorToastDescription', + { + values: { rulesCount }, + defaultMessage: + '{rulesCount, plural, =1 {# rule is} other {# rules are}} failed to duplicate.', + } + ); + +/** + * Bulk Delete + */ + +export const RULES_BULK_DELETE_SUCCESS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.delete.successToastTitle', + { + defaultMessage: 'Rules deleted', + } +); + +export const RULES_BULK_DELETE_SUCCESS_DESCRIPTION = (totalRules: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.delete.successToastDescription', + { + values: { totalRules }, + defaultMessage: + 'Successfully deleted {totalRules, plural, =1 {{totalRules} rule} other {{totalRules} rules}}', + } + ); + +export const RULES_BULK_DELETE_FAILURE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.delete.errorToastTitle', + { + defaultMessage: 'Error deleting rules', + } +); + +export const RULES_BULK_DELETE_FAILURE_DESCRIPTION = (rulesCount: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.delete.errorToastDescription', + { + values: { rulesCount }, + defaultMessage: '{rulesCount, plural, =1 {# rule is} other {# rules are}} failed to delete.', + } + ); + +/** + * Bulk Enable + */ + +export const RULES_BULK_ENABLE_SUCCESS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.enable.successToastTitle', + { + defaultMessage: 'Rules enabled', + } +); + +export const RULES_BULK_ENABLE_SUCCESS_DESCRIPTION = (totalRules: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkAction.enable.successToastDescription', + { + values: { totalRules }, + defaultMessage: + 'Successfully enabled {totalRules, plural, =1 {{totalRules} rule} other {{totalRules} rules}}', + } + ); + +export const RULES_BULK_ENABLE_FAILURE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.enable.errorToastTitle', + { + defaultMessage: 'Error enabling rules', + } +); + +export const RULES_BULK_ENABLE_FAILURE_DESCRIPTION = (rulesCount: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.enable.errorToastDescription', + { + values: { rulesCount }, + defaultMessage: '{rulesCount, plural, =1 {# rule is} other {# rules are}} failed to enable.', + } + ); + +/** + * Bulk Disable + */ + +export const RULES_BULK_DISABLE_SUCCESS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.disable.successToastTitle', + { + defaultMessage: 'Rules disabled', + } +); + +export const RULES_BULK_DISABLE_SUCCESS_DESCRIPTION = (totalRules: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.disable.successToastDescription', + { + values: { totalRules }, + defaultMessage: + 'Successfully disabled {totalRules, plural, =1 {{totalRules} rule} other {{totalRules} rules}}', + } + ); + +export const RULES_BULK_DISABLE_FAILURE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.disable.errorToastTitle', + { + defaultMessage: 'Error disabling rules', + } +); + +export const RULES_BULK_DISABLE_FAILURE_DESCRIPTION = (rulesCount: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.disable.errorToastDescription', + { + values: { rulesCount }, + defaultMessage: '{rulesCount, plural, =1 {# rule is} other {# rules are}} failed to disable.', + } + ); + +/** + * Bulk Manual Rule Run + */ + +export const RULES_BULK_MANUAL_RULE_RUN_SUCCESS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.manualRuleRun.successToastTitle', + { + defaultMessage: 'Rules scheduled', + } +); + +export const RULES_BULK_MANUAL_RULE_RUN_FAILURE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.manualRuleRun.errorToastTitle', + { + defaultMessage: 'Error scheduling manual rule run', + } +); + +export const RULES_BULK_MANUAL_RULE_RUN_SUCCESS_DESCRIPTION = (totalRules: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.manualRuleRun.successToastDescription', + { + values: { totalRules }, + defaultMessage: + 'Successfully scheduled manual rule run for {totalRules, plural, =1 {{totalRules} rule} other {{totalRules} rules}}', + } + ); + +export const RULES_BULK_MANUAL_RULE_RUN_FAILURE_DESCRIPTION = (failedRulesCount: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.manualRuleRun.errorToastDescription', + { + values: { failedRulesCount }, + defaultMessage: + '{failedRulesCount, plural, =0 {} =1 {# rule} other {# rules}} failed to schedule manual rule run.', + } + ); + +/** + * Bulk Edit + */ + +export const RULES_BULK_EDIT_SUCCESS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.edit.successToastTitle', + { + defaultMessage: 'Rules updated', + } +); + +export const RULES_BULK_EDIT_SUCCESS_DESCRIPTION = ( + succeededRulesCount: number, + skippedRulesCount: number +) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.edit.successToastDescription', + { + values: { succeededRulesCount, skippedRulesCount }, + defaultMessage: `{succeededRulesCount, plural, =0 {} =1 {You've successfully updated # rule. } other {You've successfully updated # rules. }} + {skippedRulesCount, plural, =0 {} =1 { # rule was skipped.} other { # rules were skipped.}} + `, + } + ); + +export const RULES_BULK_EDIT_SUCCESS_DATA_VIEW_RULES_SKIPPED_DETAIL = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.edit.successIndexEditToastDescription', + { + defaultMessage: + 'If you did not select to apply changes to rules using Kibana data views, those rules were not updated and will continue using data views.', + } +); + +export const RULES_BULK_EDIT_FAILURE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.edit.errorToastTitle', + { + defaultMessage: 'Error updating rules', + } +); + +export const RULES_BULK_EDIT_FAILURE_DESCRIPTION = ( + failedRulesCount: number, + skippedRulesCount: number +) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.allRules.bulkActions.edit.errorToastDescription', + { + values: { failedRulesCount, skippedRulesCount }, + defaultMessage: + '{failedRulesCount, plural, =0 {} =1 {# rule} other {# rules}} failed to update. {skippedRulesCount, plural, =0 {} =1 { # rule was skipped.} other { # rules were skipped.}}', + } + ); + +export const CANCEL_BUTTON_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.createRule.cancelButtonLabel', + { + defaultMessage: 'Cancel', + } +); + +export const SAVED_QUERY_LOAD_ERROR_TOAST = i18n.translate( + 'xpack.securitySolution.hooks.useGetSavedQuery.errorToastMessage', + { + defaultMessage: 'Failed to load the saved query', + } +); + +// Prompt Context i18n +export const RULE_MANAGEMENT_CONTEXT_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.ruleManagement.ruleManagementContextDescription', + { + defaultMessage: 'Selected Detection Rules', + } +); + +export const EXPLAIN_THEN_SUMMARIZE_RULE_DETAILS = i18n.translate( + 'xpack.securitySolution.detectionEngine.ruleManagement.explainThenSummarizeRuleDetails', + { + defaultMessage: + "Please explain the selected rules above. For each rule, highlight why they are relevant, the query as published on Elastic's detection rules repository and an in-depth explanation of it, and what they typically mean for an organization if detected.", + } +); + +export const DETECTION_RULES_CONVERSATION_ID = i18n.translate( + 'xpack.securitySolution.detectionEngine.ruleManagement.detectionRulesConversationId', + { + defaultMessage: 'Detection Rules', + } +); + +export const RULE_MANAGEMENT_CONTEXT_TOOLTIP = i18n.translate( + 'xpack.securitySolution.detectionEngine.ruleManagement.ruleManagementContextTooltip', + { + defaultMessage: 'Add this alert as context', + } +); + +export const INSTALL_RULE_BUTTON = i18n.translate( + 'xpack.securitySolution.addRules.installRuleButton', + { + defaultMessage: 'Install rule', + } +); + +export const UPDATE_RULE_BUTTON = i18n.translate( + 'xpack.securitySolution.addRules.upgradeRuleButton', + { + defaultMessage: 'Update rule', + } +); + +export const UPDATE_RULE_BUTTON_TOOLTIP_CONFLICTS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.button.conflicts', + { + defaultMessage: 'Rule has conflicts. Resolve them manually.', + } +); + +export const GO_BACK_TO_RULES_TABLE_BUTTON = i18n.translate( + 'xpack.securitySolution.addRules.goBackToRulesTableButton', + { + defaultMessage: 'Go back to installed Elastic rules', + } +); + +export const RULE_UPDATES_DOCUMENTATION_LINK = i18n.translate( + 'xpack.securitySolution.ruleUpdates.documentationLink', + { + defaultMessage: "See what's new in Prebuilt Security Detection Rules", + } +); diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/use_get_saved_query.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/rules/use_get_saved_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/use_get_saved_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/rules/use_get_saved_query.ts diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/rules/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/rules/utils.ts diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detections/pages/detection_engine/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/detections/pages/detection_engine/translations.ts diff --git a/x-pack/plugins/security_solution/public/detections/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/detections/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detections/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/detections/routes.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/api.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/api.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/entity_store.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/entity_store.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/entity_store.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/entity_store.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_calculate_entity_risk_score.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_calculate_entity_risk_score.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_calculate_entity_risk_score.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_calculate_entity_risk_score.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_calculate_entity_risk_score.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_calculate_entity_risk_score.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_calculate_entity_risk_score.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_calculate_entity_risk_score.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_configure_risk_engine_saved_object.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_configure_risk_engine_saved_object.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_configure_risk_engine_saved_object.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_configure_risk_engine_saved_object.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_disable_risk_engine_mutation.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_disable_risk_engine_mutation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_disable_risk_engine_mutation.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_disable_risk_engine_mutation.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_enable_risk_engine_mutation.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_enable_risk_engine_mutation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_enable_risk_engine_mutation.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_enable_risk_engine_mutation.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_init_risk_engine_mutation.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_init_risk_engine_mutation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_init_risk_engine_mutation.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_init_risk_engine_mutation.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_preview_risk_scores.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_preview_risk_scores.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_preview_risk_scores.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_preview_risk_scores.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_refetch_overview_page_risk_score.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_refetch_overview_page_risk_score.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_refetch_overview_page_risk_score.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_refetch_overview_page_risk_score.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_refetch_query_by_id.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_refetch_query_by_id.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_refetch_query_by_id.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_refetch_query_by_id.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_engine_privileges.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_engine_privileges.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_engine_privileges.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_engine_privileges.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_engine_settings.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_engine_settings.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_engine_settings.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_engine_settings.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_engine_status.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_engine_status.ts similarity index 83% rename from x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_engine_status.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_engine_status.ts index 14ab3fc7ca15b..3c1aececa8666 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_engine_status.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_engine_status.ts @@ -7,6 +7,8 @@ import type { UseQueryOptions } from '@tanstack/react-query'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useCallback } from 'react'; +import moment from 'moment'; +import { i18n } from '@kbn/i18n'; import type { RiskEngineStatusResponse } from '../../../../common/api/entity_analytics/risk_engine/engine_status_route.gen'; import { RiskEngineStatusEnum } from '../../../../common/api/entity_analytics/risk_engine/engine_status_route.gen'; import { useEntityAnalyticsRoutes } from '../api'; @@ -38,6 +40,22 @@ export const useIsNewRiskScoreModuleInstalled = (): RiskScoreModuleStatus => { return { isLoading: false, installed: !!riskEngineStatus?.isNewRiskScoreModuleInstalled }; }; +export const useRiskEngineCountdownTime = ( + riskEngineStatus: RiskEngineStatus | undefined +): string => { + const { status, runAt } = riskEngineStatus?.risk_engine_task_status || {}; + const isRunning = status === 'running' || (!!runAt && new Date(runAt) < new Date()); + + return isRunning + ? i18n.translate( + 'xpack.securitySolution.entityAnalytics.assetCriticalityResultStep.riskEngine.nowRunningMessage', + { + defaultMessage: 'Now running', + } + ) + : moment(runAt).fromNow(true); +}; + export interface RiskEngineStatus extends RiskEngineStatusResponse { isUpdateAvailable: boolean; isNewRiskScoreModuleInstalled: boolean; diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_score.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_score.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_score.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_score.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_score.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_score.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_score.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_score.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_score_feature_status.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_score_feature_status.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_score_feature_status.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_score_feature_status.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_score_feature_status.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_score_feature_status.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_score_feature_status.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_score_feature_status.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_score_kpi.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_score_kpi.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_score_kpi.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_risk_score_kpi.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_schedule_now_risk_engine_mutation.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_schedule_now_risk_engine_mutation.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_schedule_now_risk_engine_mutation.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_schedule_now_risk_engine_mutation.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_schedule_now_risk_engine_mutation.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_schedule_now_risk_engine_mutation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_schedule_now_risk_engine_mutation.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/hooks/use_schedule_now_risk_engine_mutation.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/types.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/api/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/api/types.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/common/get_start_date_from_risk_score.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/common/get_start_date_from_risk_score.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/common/get_start_date_from_risk_score.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/common/get_start_date_from_risk_score.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/common/get_start_date_from_risk_score.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/common/get_start_date_from_risk_score.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/common/get_start_date_from_risk_score.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/common/get_start_date_from_risk_score.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/common/index.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/common/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/common/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/common/index.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/common/user_has_risk_engine_read_permissions.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/common/user_has_risk_engine_read_permissions.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/common/user_has_risk_engine_read_permissions.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/common/user_has_risk_engine_read_permissions.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/common/user_has_risk_engine_read_permissions.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/common/user_has_risk_engine_read_permissions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/common/user_has_risk_engine_read_permissions.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/common/user_has_risk_engine_read_permissions.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/common/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/common/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/common/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/common/utils.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/common/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/common/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/common/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/common/utils.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/__snapshots__/risk_score_configuration_section.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/__snapshots__/risk_score_configuration_section.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/__snapshots__/risk_score_configuration_section.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/__snapshots__/risk_score_configuration_section.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality/asset_criticality_badge.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality/asset_criticality_badge.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality/asset_criticality_badge.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality/asset_criticality_badge.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality/asset_criticality_filter.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality/asset_criticality_filter.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality/asset_criticality_filter.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality/asset_criticality_filter.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality/asset_criticality_selector.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality/asset_criticality_selector.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality/asset_criticality_selector.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality/asset_criticality_selector.stories.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality/asset_criticality_selector.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality/asset_criticality_selector.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality/asset_criticality_selector.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality/asset_criticality_selector.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality/asset_criticality_selector.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality/asset_criticality_selector.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality/asset_criticality_selector.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality/asset_criticality_selector.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality/index.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality/index.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality/translations.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality/use_asset_criticality.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality/use_asset_criticality.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality/use_asset_criticality.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality/use_asset_criticality.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality/use_asset_criticality.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality/use_asset_criticality.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality/use_asset_criticality.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality/use_asset_criticality.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/asset_criticality_file_uploader.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/asset_criticality_file_uploader.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/asset_criticality_file_uploader.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/asset_criticality_file_uploader.stories.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/asset_criticality_file_uploader.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/asset_criticality_file_uploader.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/asset_criticality_file_uploader.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/asset_criticality_file_uploader.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/file_picker_step.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/file_picker_step.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/file_picker_step.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/file_picker_step.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/file_picker_step.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/file_picker_step.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/file_picker_step.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/file_picker_step.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/result_step.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/result_step.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/result_step.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/result_step.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/result_step.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/result_step.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/result_step.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/result_step.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/schedule_risk_engine_callout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/schedule_risk_engine_callout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/schedule_risk_engine_callout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/schedule_risk_engine_callout.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/schedule_risk_engine_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/schedule_risk_engine_callout.tsx similarity index 81% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/schedule_risk_engine_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/schedule_risk_engine_callout.tsx index 432e03c231a4d..187dc67ff1beb 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/schedule_risk_engine_callout.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/schedule_risk_engine_callout.tsx @@ -12,15 +12,17 @@ import { EuiText, EuiFlexItem, } from '@elastic/eui'; -import React, { useCallback, useMemo } from 'react'; +import React, { useCallback } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { RiskEngineStatusEnum } from '../../../../../common/api/entity_analytics'; import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; -import { formatTimeFromNow } from '../helpers'; import { useScheduleNowRiskEngineMutation } from '../../../api/hooks/use_schedule_now_risk_engine_mutation'; -import { useRiskEngineStatus } from '../../../api/hooks/use_risk_engine_status'; +import { + useRiskEngineStatus, + useRiskEngineCountdownTime, +} from '../../../api/hooks/use_risk_engine_status'; const TEN_SECONDS = 10000; @@ -29,7 +31,7 @@ export const ScheduleRiskEngineCallout: React.FC = () => { refetchInterval: TEN_SECONDS, structuralSharing: false, // Force the component to rerender after every Risk Engine Status API call }); - + const isRunning = riskEngineStatus?.risk_engine_task_status?.status === 'running'; const { addSuccess, addError } = useAppToasts(); const { isLoading: isLoadingRiskEngineSchedule, mutate: scheduleRiskEngineMutation } = useScheduleNowRiskEngineMutation({ @@ -53,25 +55,7 @@ export const ScheduleRiskEngineCallout: React.FC = () => { }), }); - const { status, runAt } = riskEngineStatus?.risk_engine_task_status || {}; - - const isRunning = useMemo( - () => status === 'running' || (!!runAt && new Date(runAt) < new Date()), - [runAt, status] - ); - - const countDownText = useMemo( - () => - isRunning - ? i18n.translate( - 'xpack.securitySolution.entityAnalytics.assetCriticalityResultStep.riskEngine.nowRunningMessage', - { - defaultMessage: 'Now running', - } - ) - : formatTimeFromNow(riskEngineStatus?.risk_engine_task_status?.runAt), - [isRunning, riskEngineStatus?.risk_engine_task_status?.runAt] - ); + const countDownText = useRiskEngineCountdownTime(riskEngineStatus); const scheduleRiskEngine = useCallback(() => { scheduleRiskEngineMutation(); diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/validation_step.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/validation_step.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/validation_step.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/validation_step.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/validation_step.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/validation_step.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/validation_step.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/components/validation_step.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/constants.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/helpers.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/hooks.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/hooks.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/hooks.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/hooks.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/hooks.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/hooks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/hooks.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/hooks.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/index.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/index.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/reducer.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/reducer.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/reducer.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/reducer.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/reducer.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/types.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/types.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/validations.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/validations.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/validations.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/validations.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/validations.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/validations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/validations.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/validations.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/enable_risk_score/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/enable_risk_score/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/enable_risk_score/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/enable_risk_score/index.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/enable_risk_score/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/enable_risk_score/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/enable_risk_score/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/enable_risk_score/translations.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/anomalies_count_link.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/anomalies_count_link.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/anomalies_count_link.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/anomalies_count_link.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/anomalies_count_link.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/anomalies_count_link.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/anomalies_count_link.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/anomalies_count_link.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/columns.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/columns.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/columns.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/columns.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/columns.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/components/anomalies_tab_link.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/components/anomalies_tab_link.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/components/anomalies_tab_link.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/components/anomalies_tab_link.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/components/enable_job.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/components/enable_job.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/components/enable_job.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/components/enable_job.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/components/enable_job.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/components/enable_job.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/components/enable_job.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/components/enable_job.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/components/total_anomalies.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/components/total_anomalies.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/components/total_anomalies.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/components/total_anomalies.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/components/total_anomalies.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/components/total_anomalies.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/components/total_anomalies.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/components/total_anomalies.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/index.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/query/index.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/query/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/query/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/query/index.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_anomalies/translations.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_header/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_header/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_header/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_header/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_header/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_header/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_header/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_header/index.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_header/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_header/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_header/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_header/translations.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/chart_content.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/chart_content.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/chart_content.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/chart_content.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/chart_content.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/chart_content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/chart_content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/chart_content.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/columns.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/header_content.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/header_content.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/header_content.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/header_content.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/header_content.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/header_content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/header_content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/header_content.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/index.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/translations.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/use_entity.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/use_entity.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/use_entity.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/use_entity.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/use_entity.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/use_entity.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/use_entity.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_analytics_risk_score/use_entity.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/components/action_column.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/components/action_column.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/components/action_column.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/components/action_column.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/components/action_column.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/components/action_column.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/components/action_column.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/components/action_column.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/components/utility_bar.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/components/utility_bar.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/components/utility_bar.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/components/utility_bar.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/components/utility_bar.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/components/utility_bar.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/components/utility_bar.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/components/utility_bar.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/hooks/use_risk_input_actions.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/hooks/use_risk_input_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/hooks/use_risk_input_actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/hooks/use_risk_input_actions.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/hooks/use_risk_input_actions_panels.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/hooks/use_risk_input_actions_panels.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/hooks/use_risk_input_actions_panels.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/hooks/use_risk_input_actions_panels.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/hooks/use_risk_input_actions_panels.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/hooks/use_risk_input_actions_panels.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/hooks/use_risk_input_actions_panels.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/hooks/use_risk_input_actions_panels.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/index.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/mocks/index.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/mocks/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/mocks/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/mocks/index.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/tabs/risk_inputs/index.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/tabs/risk_inputs/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/tabs/risk_inputs/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/tabs/risk_inputs/index.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/tabs/risk_inputs/risk_inputs.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/tabs/risk_inputs/risk_inputs.test.tsx similarity index 86% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/tabs/risk_inputs/risk_inputs.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/tabs/risk_inputs/risk_inputs.test.tsx index 6995656db31a5..7ff2a6feb958f 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/tabs/risk_inputs/risk_inputs.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/tabs/risk_inputs/risk_inputs.test.tsx @@ -49,12 +49,6 @@ const riskScore = { }, }; -const mockUseIsExperimentalFeatureEnabled = jest.fn().mockReturnValue(false); - -jest.mock('../../../../../common/hooks/use_experimental_features', () => ({ - useIsExperimentalFeatureEnabled: () => mockUseIsExperimentalFeatureEnabled(), -})); - const riskScoreWithAssetCriticalityContribution = (contribution: number) => { const score = JSON.parse(JSON.stringify(riskScore)); score.user.risk.category_2_score = contribution; @@ -129,8 +123,7 @@ describe('RiskInputsTab', () => { expect(queryByTestId('risk-input-contexts-title')).toBeInTheDocument(); }); - it('it renders alert preview button when feature flag is enable', () => { - mockUseIsExperimentalFeatureEnabled.mockReturnValue(false); + it('it renders alert preview button', () => { mockUseRiskScore.mockReturnValue({ loading: false, error: false, @@ -151,28 +144,6 @@ describe('RiskInputsTab', () => { expect(getByTestId(EXPAND_ALERT_TEST_ID)).toBeInTheDocument(); }); - it('it does not render alert preview button when feature flag is disable', () => { - mockUseIsExperimentalFeatureEnabled.mockReturnValue(true); - mockUseRiskScore.mockReturnValue({ - loading: false, - error: false, - data: [riskScore], - }); - mockUseRiskContributingAlerts.mockReturnValue({ - loading: false, - error: false, - data: [alertInputDataMock], - }); - - const { queryByTestId } = render( - <TestProviders> - <RiskInputsTab entityType={RiskScoreEntity.user} entityName="elastic" scopeId={'scopeId'} /> - </TestProviders> - ); - - expect(queryByTestId(EXPAND_ALERT_TEST_ID)).not.toBeInTheDocument(); - }); - it('Displays 0.00 for the asset criticality contribution if the contribution value is less than -0.01', () => { mockUseUiSetting.mockReturnValue([true]); diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/tabs/risk_inputs/risk_inputs_tab.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/tabs/risk_inputs/risk_inputs_tab.tsx similarity index 94% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/tabs/risk_inputs/risk_inputs_tab.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/tabs/risk_inputs/risk_inputs_tab.tsx index 78010434ee593..72a6af0fe768f 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/tabs/risk_inputs/risk_inputs_tab.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_details_flyout/tabs/risk_inputs/risk_inputs_tab.tsx @@ -14,7 +14,6 @@ import { ALERT_RULE_NAME } from '@kbn/rule-data-utils'; import { get } from 'lodash/fp'; import { AlertPreviewButton } from '../../../../../flyout/shared/components/alert_preview_button'; -import { useIsExperimentalFeatureEnabled } from '../../../../../common/hooks/use_experimental_features'; import { useGlobalTime } from '../../../../../common/containers/use_global_time'; import { useQueryInspector } from '../../../../../common/components/page/manage_query'; import { formatRiskScore } from '../../../../common'; @@ -98,26 +97,20 @@ export const RiskInputsTab = ({ entityType, entityName, scopeId }: RiskInputsTab }), [] ); - const isPreviewEnabled = !useIsExperimentalFeatureEnabled('entityAlertPreviewDisabled'); const inputColumns: Array<EuiBasicTableColumn<InputAlert>> = useMemo( () => [ - ...(isPreviewEnabled - ? [ - { - render: (data: InputAlert) => ( - <AlertPreviewButton - id={data._id} - indexName={data.input.index} - scopeId={scopeId} - data-test-subj={EXPAND_ALERT_TEST_ID} - /> - ), - width: '5%', - }, - ] - : []), - + { + render: (data: InputAlert) => ( + <AlertPreviewButton + id={data._id} + indexName={data.input.index} + scopeId={scopeId} + data-test-subj={EXPAND_ALERT_TEST_ID} + /> + ), + width: '5%', + }, { name: ( <FormattedMessage @@ -172,7 +165,7 @@ export const RiskInputsTab = ({ entityType, entityName, scopeId }: RiskInputsTab render: formatContribution, }, ], - [isPreviewEnabled, scopeId] + [scopeId] ); if (riskScoreError) { diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/dashboard_enablement_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/dashboard_enablement_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/dashboard_enablement_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/dashboard_enablement_panel.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/dashboard_entity_store_panels.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/dashboard_entity_store_panels.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/dashboard_entity_store_panels.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/dashboard_entity_store_panels.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/enablement_modal.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/components/engine_components_status.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/components/engine_components_status.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/components/engine_components_status.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/components/engine_components_status.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/components/engine_components_status.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/components/engine_components_status.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/components/engine_components_status.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/components/engine_components_status.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/hooks/use_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/hooks/use_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/hooks/use_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/hooks/use_columns.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/engines_status/index.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/entity_source_filter.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/entity_source_filter.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/entity_source_filter.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/entity_source_filter.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/missing_privileges_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/missing_privileges_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/components/missing_privileges_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/components/missing_privileges_callout.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/constants.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/entities_list.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/entities_list.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/entities_list.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/entities_list.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/entities_list.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/entities_list.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/entities_list.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/entities_list.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_columns.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_filters.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_filters.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_filters.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_filters.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_filters.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_filters.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_filters.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_filters.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_query.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_query.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_query.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_query.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_query.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_query.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_query.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entities_list_query.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entity_engine_privileges.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entity_engine_privileges.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entity_engine_privileges.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entity_engine_privileges.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entity_store.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entity_store.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entity_store.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/hooks/use_entity_store.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/translations.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/types.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/entity_store/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/entity_store/types.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/host_risk_score_table/columns.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/host_risk_score_table/columns.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/host_risk_score_table/columns.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/host_risk_score_table/columns.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/host_risk_score_table/columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/host_risk_score_table/columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/host_risk_score_table/columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/host_risk_score_table/columns.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/host_risk_score_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/host_risk_score_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/host_risk_score_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/host_risk_score_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/host_risk_score_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/host_risk_score_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/host_risk_score_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/host_risk_score_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_details_tab_body/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_details_tab_body/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_details_tab_body/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_details_tab_body/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_details_tab_body/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_details_tab_body/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_details_tab_body/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_details_tab_body/index.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_details_tab_body/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_details_tab_body/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_details_tab_body/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_details_tab_body/translations.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_engine_privileges_callout/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_engine_privileges_callout/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_engine_privileges_callout/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_engine_privileges_callout/index.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_engine_privileges_callout/risk_engine_privileges_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_engine_privileges_callout/risk_engine_privileges_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_engine_privileges_callout/risk_engine_privileges_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_engine_privileges_callout/risk_engine_privileges_callout.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_engine_privileges_callout/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_engine_privileges_callout/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_engine_privileges_callout/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_engine_privileges_callout/translations.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_information/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_information/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_information/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_information/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_information/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_information/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_information/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_information/index.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_information/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_information/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_information/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_information/translations.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score/constants.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score/translations.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_configuration_section.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_configuration_section.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_configuration_section.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_configuration_section.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_configuration_section.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_configuration_section.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_configuration_section.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_configuration_section.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_donut_chart/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_donut_chart/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_donut_chart/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_donut_chart/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_donut_chart/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_donut_chart/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_donut_chart/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_donut_chart/index.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_donut_chart/use_risk_donut_chart_data.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_donut_chart/use_risk_donut_chart_data.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_donut_chart/use_risk_donut_chart_data.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_donut_chart/use_risk_donut_chart_data.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_donut_chart/use_risk_donut_chart_data.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_donut_chart/use_risk_donut_chart_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_donut_chart/use_risk_donut_chart_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_donut_chart/use_risk_donut_chart_data.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_enable_section.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_enable_section.tsx similarity index 99% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_enable_section.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_enable_section.tsx index 547ee0235e773..1c245dc779d01 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_enable_section.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_enable_section.tsx @@ -289,7 +289,7 @@ export const RiskScoreEnableSection: React.FC<{ <RiskEngineStatusRow currentRiskEngineStatus={currentRiskEngineStatus} onSwitchClick={onSwitchClick} - isLoading={isLoading} + isLoading={isLoading && !currentRiskEngineStatus} privileges={privileges} /> )} diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/entity_analytics_doc_link.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/entity_analytics_doc_link.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/entity_analytics_doc_link.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/entity_analytics_doc_link.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_enable_button.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_enable_button.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_enable_button.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_enable_button.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_enable_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_enable_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_enable_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_enable_button.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_header_title.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_header_title.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_header_title.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_header_title.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_no_data_detected.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_no_data_detected.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_no_data_detected.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_no_data_detected.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_restart_button.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_restart_button.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_restart_button.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_restart_button.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_restart_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_restart_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_restart_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/risk_score_restart_button.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/translations.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/use_risk_score_toast_content.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/use_risk_score_toast_content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/use_risk_score_toast_content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/use_risk_score_toast_content.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/utils.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_onboarding/utils.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_over_time/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_over_time/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_over_time/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_over_time/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_over_time/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_over_time/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_over_time/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_over_time/index.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_over_time/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_over_time/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_over_time/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_over_time/translations.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_page_styles.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_page_styles.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_page_styles.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_page_styles.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_preview_section.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_preview_section.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_preview_section.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_preview_section.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_preview_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_preview_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_preview_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_preview_table.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_update_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_update_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_update_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_update_panel.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_useful_links_section.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_useful_links_section.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_useful_links_section.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_score_useful_links_section.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/common.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/common.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/common.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/common.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/risk_summary.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/risk_summary.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/risk_summary.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/risk_summary.stories.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/risk_summary.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/risk_summary.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/risk_summary.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/risk_summary.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/risk_summary.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/risk_summary.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/risk_summary.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/risk_summary_flyout/risk_summary.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/severity/common/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/severity/common/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/severity/common/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/severity/common/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/severity/common/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/severity/common/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/severity/common/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/severity/common/index.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/severity/severity_badges.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/severity/severity_badges.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/severity/severity_badges.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/severity/severity_badges.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/severity/severity_bar.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/severity/severity_bar.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/severity/severity_bar.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/severity/severity_bar.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/severity/severity_filter.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/severity/severity_filter.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/severity/severity_filter.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/severity/severity_filter.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/severity/severity_filter.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/severity/severity_filter.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/severity/severity_filter.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/severity/severity_filter.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/severity/types.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/severity/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/severity/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/severity/types.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/styled_basic_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/styled_basic_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/styled_basic_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/styled_basic_table.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors/index.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors/translations.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors_alerts/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors_alerts/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors_alerts/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors_alerts/index.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors_alerts/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors_alerts/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors_alerts/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/top_risk_score_contributors_alerts/translations.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/user_risk_score_tab_body.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/user_risk_score_tab_body.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/user_risk_score_tab_body.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/user_risk_score_tab_body.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/user_risk_score_tab_body.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/user_risk_score_tab_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/user_risk_score_tab_body.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/user_risk_score_tab_body.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/columns.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/columns.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/columns.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/columns.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/columns.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/user_risk_score_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/index.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/index.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/ingest_pipelines.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/ingest_pipelines.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/ingest_pipelines.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/ingest_pipelines.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/ingest_pipelines.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/ingest_pipelines.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/ingest_pipelines.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/ingest_pipelines.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/onboarding.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/onboarding.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/onboarding.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/onboarding.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/saved_objects.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/saved_objects.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/saved_objects.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/saved_objects.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/stored_scripts.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/stored_scripts.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/stored_scripts.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/stored_scripts.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/stored_scripts.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/stored_scripts.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/stored_scripts.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/stored_scripts.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/transforms.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/transforms.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/transforms.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/transforms.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/transforms.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/transforms.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/transforms.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/transforms.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/translations.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/types.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/deprecated_risk_engine/api/types.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/hooks/use_missing_risk_engine_privileges.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/hooks/use_missing_risk_engine_privileges.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/hooks/use_missing_risk_engine_privileges.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/hooks/use_missing_risk_engine_privileges.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/hooks/use_risk_contributing_alerts.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/hooks/use_risk_contributing_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/hooks/use_risk_contributing_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/hooks/use_risk_contributing_alerts.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/images/entity_store_dashboard.png b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/images/entity_store_dashboard.png similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/images/entity_store_dashboard.png rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/images/entity_store_dashboard.png diff --git a/x-pack/plugins/security_solution/public/entity_analytics/index.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/jest.config.js new file mode 100644 index 0000000000000..c402b2783605e --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/entity_analytics'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/entity_analytics', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/entity_analytics/lens_attributes/__snapshots__/risk_score_donut.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/lens_attributes/__snapshots__/risk_score_donut.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/lens_attributes/__snapshots__/risk_score_donut.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/lens_attributes/__snapshots__/risk_score_donut.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/entity_analytics/lens_attributes/__snapshots__/risk_score_over_time_area.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/lens_attributes/__snapshots__/risk_score_over_time_area.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/lens_attributes/__snapshots__/risk_score_over_time_area.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/lens_attributes/__snapshots__/risk_score_over_time_area.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/entity_analytics/lens_attributes/__snapshots__/risk_score_summary.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/lens_attributes/__snapshots__/risk_score_summary.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/lens_attributes/__snapshots__/risk_score_summary.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/lens_attributes/__snapshots__/risk_score_summary.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_donut.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_donut.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_donut.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_donut.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_donut.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_donut.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_donut.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_donut.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_over_time_area.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_over_time_area.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_over_time_area.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_over_time_area.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_over_time_area.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_over_time_area.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_over_time_area.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_over_time_area.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_summary.test.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_summary.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_summary.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_summary.test.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_summary.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_summary.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_summary.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/lens_attributes/risk_score_summary.ts diff --git a/x-pack/plugins/security_solution/public/entity_analytics/pages/entity_analytics_dashboard.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/pages/entity_analytics_dashboard.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/pages/entity_analytics_dashboard.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/pages/entity_analytics_dashboard.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/pages/entity_analytics_management_page.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/pages/entity_analytics_management_page.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/pages/entity_analytics_management_page.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/pages/entity_analytics_management_page.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/pages/entity_store_management_page.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/pages/entity_store_management_page.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/pages/entity_store_management_page.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/pages/entity_store_management_page.test.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/pages/entity_store_management_page.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/pages/entity_store_management_page.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/pages/entity_store_management_page.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/pages/entity_store_management_page.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/routes.tsx diff --git a/x-pack/plugins/security_solution/public/entity_analytics/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/entity_analytics/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/entity_analytics/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/entity_analytics/translations.ts diff --git a/x-pack/plugins/security_solution/public/exceptions/api/exception_api.ts b/x-pack/solutions/security/plugins/security_solution/public/exceptions/api/exception_api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/api/exception_api.ts rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/api/exception_api.ts diff --git a/x-pack/plugins/security_solution/public/exceptions/api/index.ts b/x-pack/solutions/security/plugins/security_solution/public/exceptions/api/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/api/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/api/index.ts diff --git a/x-pack/plugins/security_solution/public/exceptions/api/list_api.ts b/x-pack/solutions/security/plugins/security_solution/public/exceptions/api/list_api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/api/list_api.ts rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/api/list_api.ts diff --git a/x-pack/plugins/security_solution/public/exceptions/api/types.ts b/x-pack/solutions/security/plugins/security_solution/public/exceptions/api/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/api/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/api/types.ts diff --git a/x-pack/plugins/security_solution/public/exceptions/components/create_shared_exception_list/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/components/create_shared_exception_list/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/components/create_shared_exception_list/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/components/create_shared_exception_list/index.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/components/exceptions_list_card/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/components/exceptions_list_card/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/components/exceptions_list_card/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/components/exceptions_list_card/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/components/exceptions_list_card/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/components/exceptions_list_card/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/components/exceptions_list_card/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/components/exceptions_list_card/index.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/components/exceptions_utility/exceptions_utility.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/components/exceptions_utility/exceptions_utility.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/components/exceptions_utility/exceptions_utility.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/components/exceptions_utility/exceptions_utility.test.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/components/exceptions_utility/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/components/exceptions_utility/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/components/exceptions_utility/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/components/exceptions_utility/index.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/components/expired_exceptions_list_items_modal/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/components/expired_exceptions_list_items_modal/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/components/expired_exceptions_list_items_modal/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/components/expired_exceptions_list_items_modal/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/components/expired_exceptions_list_items_modal/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/components/expired_exceptions_list_items_modal/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/components/expired_exceptions_list_items_modal/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/components/expired_exceptions_list_items_modal/index.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/components/import_exceptions_list_flyout/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/components/import_exceptions_list_flyout/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/components/import_exceptions_list_flyout/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/components/import_exceptions_list_flyout/index.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/components/index.ts b/x-pack/solutions/security/plugins/security_solution/public/exceptions/components/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/components/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/components/index.ts diff --git a/x-pack/plugins/security_solution/public/exceptions/components/link_to_list_details/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/components/link_to_list_details/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/components/link_to_list_details/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/components/link_to_list_details/index.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/components/link_to_rule_details/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/components/link_to_rule_details/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/components/link_to_rule_details/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/components/link_to_rule_details/index.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/components/list_exception_items/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/components/list_exception_items/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/components/list_exception_items/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/components/list_exception_items/index.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/components/list_search_bar/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/components/list_search_bar/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/components/list_search_bar/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/components/list_search_bar/index.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/components/list_with_search/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/components/list_with_search/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/components/list_with_search/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/components/list_with_search/index.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/components/manage_rules/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/components/manage_rules/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/components/manage_rules/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/components/manage_rules/index.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/components/shared_list_utilty_bar/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/components/shared_list_utilty_bar/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/components/shared_list_utilty_bar/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/components/shared_list_utilty_bar/index.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/components/shared_list_utilty_bar/shared_lists_utility_bar.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/components/shared_list_utilty_bar/shared_lists_utility_bar.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/components/shared_list_utilty_bar/shared_lists_utility_bar.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/components/shared_list_utilty_bar/shared_lists_utility_bar.test.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/components/title_badge/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/components/title_badge/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/components/title_badge/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/components/title_badge/index.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/config/index.ts b/x-pack/solutions/security/plugins/security_solution/public/exceptions/config/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/config/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/config/index.ts diff --git a/x-pack/plugins/security_solution/public/exceptions/hooks/index.ts b/x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/hooks/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/index.ts diff --git a/x-pack/plugins/security_solution/public/exceptions/hooks/use_all_exception_lists/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_all_exception_lists/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/hooks/use_all_exception_lists/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_all_exception_lists/index.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/hooks/use_create_shared_list/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_create_shared_list/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/hooks/use_create_shared_list/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_create_shared_list/index.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/hooks/use_endpoint_exceptions_capability/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_endpoint_exceptions_capability/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/hooks/use_endpoint_exceptions_capability/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_endpoint_exceptions_capability/index.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_exceptions_list.card/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_exceptions_list.card/index.tsx new file mode 100644 index 0000000000000..e56d31f24fbcb --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_exceptions_list.card/index.tsx @@ -0,0 +1,305 @@ +/* + * 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, useEffect, useMemo, useState } from 'react'; +import type { + ExceptionListItemSchema, + NamespaceType, +} from '@kbn/securitysolution-io-ts-list-types'; +import { ExceptionListTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; + +import { ViewerStatus } from '@kbn/securitysolution-exception-list-components'; +import { useGeneratedHtmlId } from '@elastic/eui'; +import { useGetSecuritySolutionLinkProps } from '../../../common/components/links'; +import { SecurityPageName } from '../../../../common/constants'; +import type { ExceptionListInfo } from '../use_all_exception_lists'; +import { useListExceptionItems } from '../use_list_exception_items'; +import * as i18n from '../../translations'; +import { checkIfListCannotBeEdited } from '../../utils/list.utils'; +import type { CheckExceptionTtlActionTypes } from '../../components/expired_exceptions_list_items_modal'; +import { CHECK_EXCEPTION_TTL_ACTION_TYPES } from '../../components/expired_exceptions_list_items_modal'; + +interface DuplicateListAction { + listId: string; + name: string; + namespaceType: NamespaceType; + includeExpiredExceptions: boolean; +} +interface ExportListAction { + id: string; + listId: string; + name: string; + namespaceType: NamespaceType; + includeExpiredExceptions: boolean; +} +interface ListAction { + id: string; + listId: string; + namespaceType: NamespaceType; +} +export const useExceptionsListCard = ({ + exceptionsList, + handleExport, + handleDelete, + handleDuplicate, + handleManageRules, +}: { + exceptionsList: ExceptionListInfo; + handleExport: ({ + id, + listId, + name, + namespaceType, + includeExpiredExceptions, + }: ExportListAction) => () => Promise<void>; + handleDelete: ({ id, listId, namespaceType }: ListAction) => () => Promise<void>; + handleDuplicate: ({ + listId, + name, + namespaceType, + includeExpiredExceptions, + }: DuplicateListAction) => () => Promise<void>; + handleManageRules: () => void; +}) => { + const [viewerStatus, setViewerStatus] = useState<ViewerStatus | string>(ViewerStatus.LOADING); + const [exceptionToEdit, setExceptionToEdit] = useState<ExceptionListItemSchema>(); + const [showAddExceptionFlyout, setShowAddExceptionFlyout] = useState(false); + const [showEditExceptionFlyout, setShowEditExceptionFlyout] = useState(false); + const [showIncludeExpiredExceptionsModal, setShowIncludeExpiredExceptionsModal] = + useState<CheckExceptionTtlActionTypes | null>(null); + + const { + name: listName, + list_id: listId, + rules: listRules, + type: listType, + created_by: createdBy, + created_at: createdAt, + description: listDescription, + } = exceptionsList; + + const onFinishFetchingExceptions = useCallback(() => { + setViewerStatus(''); + }, [setViewerStatus]); + + const onEditExceptionItem = (exception: ExceptionListItemSchema) => { + setExceptionToEdit(exception); + setShowEditExceptionFlyout(true); + }; + + const { + lastUpdated, + exceptionViewerStatus, + exceptions, + pagination, + ruleReferences, + fetchItems, + onDeleteException, + onPaginationChange, + } = useListExceptionItems({ + list: exceptionsList, + deleteToastTitle: i18n.EXCEPTION_ITEM_DELETE_TITLE, + deleteToastBody: (name) => i18n.EXCEPTION_ITEM_DELETE_TEXT(name), + errorToastBody: i18n.EXCEPTION_ERROR_DESCRIPTION, + errorToastTitle: i18n.EXCEPTION_ERROR_TITLE, + onEditListExceptionItem: onEditExceptionItem, + onFinishFetchingExceptions, + }); + + useEffect(() => { + fetchItems(null, ViewerStatus.LOADING); + }, [fetchItems]); + + const [toggleAccordion, setToggleAccordion] = useState(false); + const openAccordionId = useGeneratedHtmlId({ prefix: 'openAccordion' }); + + const listCannotBeEdited = checkIfListCannotBeEdited(exceptionsList); + + const emptyViewerTitle = useMemo(() => { + return viewerStatus === ViewerStatus.EMPTY ? i18n.EXCEPTION_LIST_EMPTY_VIEWER_TITLE : ''; + }, [viewerStatus]); + + const emptyViewerBody = useMemo(() => { + return viewerStatus === ViewerStatus.EMPTY + ? i18n.EXCEPTION_LIST_EMPTY_VIEWER_BODY(exceptionsList.name) + : ''; + }, [exceptionsList.name, viewerStatus]); + + const emptyViewerButtonText = useMemo(() => { + return exceptionsList.type === ExceptionListTypeEnum.ENDPOINT + ? i18n.EXCEPTION_LIST_EMPTY_VIEWER_BUTTON_ENDPOINT + : i18n.EXCEPTION_LIST_EMPTY_VIEWER_BUTTON; + }, [exceptionsList.type]); + + const menuActionItems = useMemo( + () => [ + { + key: 'Export', + icon: 'exportAction', + label: i18n.EXPORT_EXCEPTION_LIST, + onClick: (e: React.MouseEvent<Element, MouseEvent>) => { + if (listType === ExceptionListTypeEnum.ENDPOINT) { + handleExport({ + id: exceptionsList.id, + listId: exceptionsList.list_id, + name: exceptionsList.name, + namespaceType: exceptionsList.namespace_type, + includeExpiredExceptions: true, + })(); + } else { + setShowIncludeExpiredExceptionsModal(CHECK_EXCEPTION_TTL_ACTION_TYPES.EXPORT); + } + }, + }, + { + key: 'Duplicate', + icon: 'copy', + label: i18n.DUPLICATE_EXCEPTION_LIST, + disabled: listCannotBeEdited, + onClick: (_: React.MouseEvent<Element, MouseEvent>) => { + setShowIncludeExpiredExceptionsModal(CHECK_EXCEPTION_TTL_ACTION_TYPES.DUPLICATE); + }, + }, + { + key: 'Delete', + icon: 'trash', + disabled: listCannotBeEdited, + label: i18n.DELETE_EXCEPTION_LIST, + onClick: (e: React.MouseEvent<Element, MouseEvent>) => { + handleDelete({ + id: exceptionsList.id, + listId: exceptionsList.list_id, + namespaceType: exceptionsList.namespace_type, + })(); + }, + }, + { + key: 'LinkRules', + icon: 'gear', + disabled: listCannotBeEdited, + label: i18n.LINK_RULES_OVERFLOW_BUTTON_TITLE, + onClick: (e: React.MouseEvent<Element, MouseEvent>) => { + handleManageRules(); + }, + }, + ], + [ + listCannotBeEdited, + listType, + handleExport, + exceptionsList.id, + exceptionsList.list_id, + exceptionsList.name, + exceptionsList.namespace_type, + handleDelete, + handleManageRules, + ] + ); + + // Once details Page is added all of these methods will be used from it as well + // as their own states + const onAddExceptionClick = useCallback(() => { + setShowAddExceptionFlyout(true); + }, [setShowAddExceptionFlyout]); + + const handleCancelExceptionItemFlyout = () => { + setShowAddExceptionFlyout(false); + setShowEditExceptionFlyout(false); + }; + const handleConfirmExceptionFlyout = useCallback( + (didExceptionChange: boolean): void => { + setShowAddExceptionFlyout(false); + setShowEditExceptionFlyout(false); + if (!didExceptionChange) return; + fetchItems(); + }, + [fetchItems, setShowAddExceptionFlyout, setShowEditExceptionFlyout] + ); + + const onExportListClick = useCallback(() => { + setShowIncludeExpiredExceptionsModal(CHECK_EXCEPTION_TTL_ACTION_TYPES.EXPORT); + }, [setShowIncludeExpiredExceptionsModal]); + + const handleCancelExpiredExceptionsModal = () => { + setShowIncludeExpiredExceptionsModal(null); + }; + + const handleConfirmExpiredExceptionsModal = useCallback( + (includeExpiredExceptions: boolean): void => { + if (showIncludeExpiredExceptionsModal === CHECK_EXCEPTION_TTL_ACTION_TYPES.EXPORT) { + handleExport({ + id: exceptionsList.id, + listId: exceptionsList.list_id, + name: exceptionsList.name, + namespaceType: exceptionsList.namespace_type, + includeExpiredExceptions, + })(); + } + if (showIncludeExpiredExceptionsModal === CHECK_EXCEPTION_TTL_ACTION_TYPES.DUPLICATE) { + handleDuplicate({ + listId: exceptionsList.list_id, + name: exceptionsList.name, + namespaceType: exceptionsList.namespace_type, + includeExpiredExceptions, + })(); + } + }, + [ + showIncludeExpiredExceptionsModal, + handleExport, + exceptionsList.id, + exceptionsList.list_id, + exceptionsList.name, + exceptionsList.namespace_type, + handleDuplicate, + ] + ); + + // routes to x-pack/solutions/security/plugins/security_solution/public/exceptions/routes.tsx + // details component is here: x-pack/solutions/security/plugins/security_solution/public/exceptions/pages/list_detail_view/index.tsx + const { onClick: goToExceptionDetail } = useGetSecuritySolutionLinkProps()({ + deepLinkId: SecurityPageName.exceptions, + path: `/details/${exceptionsList.list_id}`, + }); + return { + listId, + listName, + listDescription, + createdAt: new Date(createdAt).toDateString(), + createdBy, + listRulesCount: listRules.length.toString(), + exceptionItemsCount: pagination.totalItemCount.toString(), + listType, + menuActionItems, + showAddExceptionFlyout, + toggleAccordion, + openAccordionId, + viewerStatus, + exceptionToEdit, + showEditExceptionFlyout, + lastUpdated, + exceptions, + ruleReferences, + pagination, + exceptionViewerStatus, + onEditExceptionItem, + onDeleteException, + onPaginationChange, + setToggleAccordion, + onAddExceptionClick, + handleConfirmExceptionFlyout, + handleCancelExceptionItemFlyout, + goToExceptionDetail, + emptyViewerTitle, + emptyViewerBody, + emptyViewerButtonText, + showIncludeExpiredExceptionsModal, + onExportListClick, + handleCancelExpiredExceptionsModal, + handleConfirmExpiredExceptionsModal, + }; +}; diff --git a/x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_import_exception_list/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_import_exception_list/index.tsx new file mode 100644 index 0000000000000..be88970ed5b23 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_import_exception_list/index.tsx @@ -0,0 +1,49 @@ +/* + * 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 { EXCEPTION_LIST_URL } from '@kbn/securitysolution-list-constants'; + +import type { ImportExceptionsResponseSchema } from '@kbn/securitysolution-io-ts-list-types'; + +import type { HttpStart } from '@kbn/core/public'; +import { useAsync, withOptionalSignal } from '@kbn/securitysolution-hook-utils'; + +export const importExceptionList = async ({ + file, + http, + signal, + overwrite, + overwriteExceptions, + asNewList, +}: { + // TODO: Replace these with kbn packaged versions once we have those available to us + // These originally came from this location below before moving them to this hacked "any" types: + // import { HttpStart, NotificationsStart } from '../../../../../../../src/core/public'; + http: HttpStart; + signal: AbortSignal; + file: File; + overwrite: boolean; + overwriteExceptions: boolean; + asNewList: boolean; +}): Promise<ImportExceptionsResponseSchema> => { + const formData = new FormData(); + formData.append('file', file as Blob); + + const res = await http.post<ImportExceptionsResponseSchema>(`${EXCEPTION_LIST_URL}/_import`, { + version: '2023-10-31', + body: formData, + query: { overwrite, overwrite_exceptions: overwriteExceptions, as_new_list: asNewList }, + headers: { 'Content-Type': undefined }, + method: 'POST', + signal, + }); + return res; +}; + +const importListWithOptionalSignal = withOptionalSignal(importExceptionList); + +export const useImportExceptionList = () => useAsync(importListWithOptionalSignal); diff --git a/x-pack/plugins/security_solution/public/exceptions/hooks/use_list_detail_view/index.ts b/x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_list_detail_view/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/hooks/use_list_detail_view/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_list_detail_view/index.ts diff --git a/x-pack/plugins/security_solution/public/exceptions/hooks/use_list_exception_items/index.ts b/x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_list_exception_items/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/hooks/use_list_exception_items/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_list_exception_items/index.ts diff --git a/x-pack/plugins/security_solution/public/exceptions/hooks/use_list_with_search/index.ts b/x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_list_with_search/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/hooks/use_list_with_search/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_list_with_search/index.ts diff --git a/x-pack/plugins/security_solution/public/exceptions/index.ts b/x-pack/solutions/security/plugins/security_solution/public/exceptions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/exceptions/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/exceptions/jest.config.js new file mode 100644 index 0000000000000..e6eb3cebe4036 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/exceptions/jest.config.js @@ -0,0 +1,29 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/exceptions'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/exceptions', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/exceptions/**/*.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution/public/exceptions/*.test.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution/public/exceptions/*.constants.{ts}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution/public/exceptions/{__test__,__snapshots__,__examples__,*mock*,tests,test_helpers,integration_tests,types}/**/*', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution/public/exceptions/*mock*.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution/public/exceptions/*.test.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution/public/exceptions/*.d.ts', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution/public/exceptions/*.config.ts', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution/public/exceptions/index.{js,ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution/public/exceptions/translations/*', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution/public/exceptions/*.translations', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/exceptions/pages/index.ts b/x-pack/solutions/security/plugins/security_solution/public/exceptions/pages/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/pages/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/pages/index.ts diff --git a/x-pack/plugins/security_solution/public/exceptions/pages/list_detail_view/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/pages/list_detail_view/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/pages/list_detail_view/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/pages/list_detail_view/index.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/pages/shared_lists/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/pages/shared_lists/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/pages/shared_lists/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/pages/shared_lists/index.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/pages/shared_lists/shared_lists.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/pages/shared_lists/shared_lists.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/pages/shared_lists/shared_lists.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/pages/shared_lists/shared_lists.test.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/routes.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/translations/index.ts b/x-pack/solutions/security/plugins/security_solution/public/exceptions/translations/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/translations/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/translations/index.ts diff --git a/x-pack/plugins/security_solution/public/exceptions/translations/list_details_view.ts b/x-pack/solutions/security/plugins/security_solution/public/exceptions/translations/list_details_view.ts similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/translations/list_details_view.ts rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/translations/list_details_view.ts diff --git a/x-pack/plugins/security_solution/public/exceptions/translations/list_exception_items.ts b/x-pack/solutions/security/plugins/security_solution/public/exceptions/translations/list_exception_items.ts similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/translations/list_exception_items.ts rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/translations/list_exception_items.ts diff --git a/x-pack/plugins/security_solution/public/exceptions/translations/shared_list.ts b/x-pack/solutions/security/plugins/security_solution/public/exceptions/translations/shared_list.ts similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/translations/shared_list.ts rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/translations/shared_list.ts diff --git a/x-pack/plugins/security_solution/public/exceptions/utils/breadcrumbs.ts b/x-pack/solutions/security/plugins/security_solution/public/exceptions/utils/breadcrumbs.ts similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/utils/breadcrumbs.ts rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/utils/breadcrumbs.ts diff --git a/x-pack/plugins/security_solution/public/exceptions/utils/list.utils.ts b/x-pack/solutions/security/plugins/security_solution/public/exceptions/utils/list.utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/utils/list.utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/utils/list.utils.ts diff --git a/x-pack/plugins/security_solution/public/exceptions/utils/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/exceptions/utils/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/utils/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/utils/translations.ts diff --git a/x-pack/plugins/security_solution/public/exceptions/utils/ui.helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/utils/ui.helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/utils/ui.helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/utils/ui.helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/exceptions/utils/ui.helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/utils/ui.helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/exceptions/utils/ui.helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/exceptions/utils/ui.helpers.tsx diff --git a/x-pack/plugins/security_solution/public/explore/components/authentication/__snapshots__/authentications_host_table.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/components/authentication/__snapshots__/authentications_host_table.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/authentication/__snapshots__/authentications_host_table.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/authentication/__snapshots__/authentications_host_table.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/components/authentication/__snapshots__/authentications_user_table.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/components/authentication/__snapshots__/authentications_user_table.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/authentication/__snapshots__/authentications_user_table.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/authentication/__snapshots__/authentications_user_table.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/components/authentication/authentications_host_table.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/components/authentication/authentications_host_table.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/authentication/authentications_host_table.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/authentication/authentications_host_table.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/components/authentication/authentications_host_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/components/authentication/authentications_host_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/authentication/authentications_host_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/authentication/authentications_host_table.tsx diff --git a/x-pack/plugins/security_solution/public/explore/components/authentication/authentications_user_table.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/components/authentication/authentications_user_table.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/authentication/authentications_user_table.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/authentication/authentications_user_table.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/components/authentication/authentications_user_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/components/authentication/authentications_user_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/authentication/authentications_user_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/authentication/authentications_user_table.tsx diff --git a/x-pack/plugins/security_solution/public/explore/components/authentication/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/components/authentication/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/authentication/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/authentication/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/explore/components/authentication/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/components/authentication/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/authentication/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/authentication/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/components/authentication/types.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/components/authentication/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/authentication/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/authentication/types.ts diff --git a/x-pack/plugins/security_solution/public/explore/components/kpi/__mocks__/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/components/kpi/__mocks__/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/kpi/__mocks__/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/kpi/__mocks__/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/components/kpi/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/components/kpi/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/kpi/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/kpi/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/components/paginated_table/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/components/paginated_table/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/paginated_table/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/paginated_table/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/components/paginated_table/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/components/paginated_table/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/paginated_table/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/paginated_table/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/explore/components/paginated_table/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/components/paginated_table/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/paginated_table/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/paginated_table/helpers.ts diff --git a/x-pack/plugins/security_solution/public/explore/components/paginated_table/index.mock.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/components/paginated_table/index.mock.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/paginated_table/index.mock.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/paginated_table/index.mock.tsx diff --git a/x-pack/plugins/security_solution/public/explore/components/paginated_table/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/components/paginated_table/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/paginated_table/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/paginated_table/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/components/paginated_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/components/paginated_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/paginated_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/paginated_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/components/paginated_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/components/paginated_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/paginated_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/paginated_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/components/stat_items/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/stat_items/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/components/stat_items/metric_embeddable.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/metric_embeddable.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/stat_items/metric_embeddable.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/metric_embeddable.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/components/stat_items/metric_embeddable.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/metric_embeddable.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/stat_items/metric_embeddable.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/metric_embeddable.tsx diff --git a/x-pack/plugins/security_solution/public/explore/components/stat_items/stat_item_header.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/stat_item_header.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/stat_items/stat_item_header.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/stat_item_header.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/components/stat_items/stat_item_header.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/stat_item_header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/stat_items/stat_item_header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/stat_item_header.tsx diff --git a/x-pack/plugins/security_solution/public/explore/components/stat_items/stat_items.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/stat_items.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/stat_items/stat_items.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/stat_items.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/components/stat_items/stat_items.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/stat_items.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/stat_items/stat_items.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/stat_items.tsx diff --git a/x-pack/plugins/security_solution/public/explore/components/stat_items/types.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/stat_items/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/types.ts diff --git a/x-pack/plugins/security_solution/public/explore/components/stat_items/use_toggle_status.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/use_toggle_status.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/stat_items/use_toggle_status.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/use_toggle_status.ts diff --git a/x-pack/plugins/security_solution/public/explore/components/stat_items/utils.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/utils.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/components/stat_items/utils.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/components/stat_items/utils.tsx diff --git a/x-pack/plugins/security_solution/public/explore/containers/authentications/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/containers/authentications/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/containers/authentications/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/containers/authentications/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/containers/authentications/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/containers/authentications/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/containers/authentications/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/containers/authentications/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/containers/authentications/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/containers/authentications/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/containers/authentications/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/containers/authentications/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/containers/fields/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/containers/fields/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/containers/fields/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/containers/fields/index.test.ts diff --git a/x-pack/plugins/security_solution/public/explore/containers/fields/index.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/containers/fields/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/containers/fields/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/containers/fields/index.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/hosts_table/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/hosts_table/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/hosts_table/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/hosts_table/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/hosts_table/columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/hosts_table/columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/hosts_table/columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/hosts_table/columns.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/hosts_table/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/hosts_table/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/hosts_table/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/hosts_table/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/hosts_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/hosts_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/hosts_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/hosts_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/hosts_table/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/hosts_table/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/hosts_table/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/hosts_table/mock.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/hosts_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/hosts_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/hosts_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/hosts_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/hosts/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/kpi_hosts/hosts/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/hosts/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/kpi_hosts/hosts/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/hosts/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/kpi_hosts/hosts/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/hosts/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/kpi_hosts/hosts/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/hosts/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/kpi_hosts/hosts/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/hosts/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/kpi_hosts/hosts/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/kpi_hosts/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/kpi_hosts/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/types.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/kpi_hosts/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/kpi_hosts/types.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/unique_ips/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/kpi_hosts/unique_ips/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/unique_ips/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/kpi_hosts/unique_ips/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/unique_ips/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/kpi_hosts/unique_ips/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/unique_ips/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/kpi_hosts/unique_ips/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/unique_ips/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/kpi_hosts/unique_ips/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/kpi_hosts/unique_ips/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/kpi_hosts/unique_ips/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/columns.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/columns.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/columns.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/columns.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/columns.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/mock.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/uncommon_process_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/containers/hosts/details/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/containers/hosts/details/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/containers/hosts/details/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/containers/hosts/details/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/containers/hosts/details/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/containers/hosts/details/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/containers/hosts/details/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/containers/hosts/details/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/containers/hosts/details/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/containers/hosts/details/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/containers/hosts/details/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/containers/hosts/details/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/containers/hosts/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/containers/hosts/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/containers/hosts/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/containers/hosts/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/containers/hosts/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/containers/hosts/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/containers/hosts/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/containers/hosts/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/containers/hosts/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/containers/hosts/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/containers/hosts/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/containers/hosts/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/containers/uncommon_processes/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/containers/uncommon_processes/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/containers/uncommon_processes/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/containers/uncommon_processes/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/containers/uncommon_processes/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/containers/uncommon_processes/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/containers/uncommon_processes/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/containers/uncommon_processes/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/containers/uncommon_processes/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/containers/uncommon_processes/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/containers/uncommon_processes/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/containers/uncommon_processes/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/details/breadcrumbs.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/details/breadcrumbs.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/details/breadcrumbs.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/details/breadcrumbs.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/details/details_tabs.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/details/details_tabs.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/details/details_tabs.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/details/details_tabs.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/details/details_tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/details/details_tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/details/details_tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/details/details_tabs.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/details/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/details/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/details/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/details/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/details/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/details/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/details/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/details/helpers.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/details/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/details/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/details/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/details/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/details/nav_tabs.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/details/nav_tabs.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/details/nav_tabs.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/details/nav_tabs.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/details/nav_tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/details/nav_tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/details/nav_tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/details/nav_tabs.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/details/types.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/details/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/details/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/details/types.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/display.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/display.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/display.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/display.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/hosts.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/hosts.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/hosts.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/hosts.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/hosts.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/hosts.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/hosts.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/hosts.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/hosts_tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/hosts_tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/hosts_tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/hosts_tabs.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/nav_tabs.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/nav_tabs.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/nav_tabs.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/nav_tabs.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/nav_tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/nav_tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/nav_tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/nav_tabs.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/navigation/authentications_query_tab_body.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/navigation/authentications_query_tab_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/navigation/authentications_query_tab_body.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/navigation/authentications_query_tab_body.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/navigation/host_risk_score_tab_body.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/navigation/host_risk_score_tab_body.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/navigation/host_risk_score_tab_body.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/navigation/host_risk_score_tab_body.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/navigation/host_risk_score_tab_body.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/navigation/host_risk_score_tab_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/navigation/host_risk_score_tab_body.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/navigation/host_risk_score_tab_body.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/navigation/hosts_query_tab_body.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/navigation/hosts_query_tab_body.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/navigation/hosts_query_tab_body.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/navigation/hosts_query_tab_body.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/navigation/hosts_query_tab_body.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/navigation/hosts_query_tab_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/navigation/hosts_query_tab_body.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/navigation/hosts_query_tab_body.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/navigation/index.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/navigation/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/navigation/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/navigation/index.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/navigation/sessions_tab_body.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/navigation/sessions_tab_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/navigation/sessions_tab_body.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/navigation/sessions_tab_body.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/navigation/types.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/navigation/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/navigation/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/navigation/types.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/navigation/uncommon_process_query_tab_body.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/navigation/uncommon_process_query_tab_body.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/navigation/uncommon_process_query_tab_body.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/navigation/uncommon_process_query_tab_body.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/navigation/uncommon_process_query_tab_body.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/navigation/uncommon_process_query_tab_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/navigation/uncommon_process_query_tab_body.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/navigation/uncommon_process_query_tab_body.tsx diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/pages/types.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/pages/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/pages/types.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/store/actions.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/store/actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/store/actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/store/actions.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/store/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/store/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/store/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/store/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/store/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/store/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/store/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/store/helpers.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/store/index.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/store/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/store/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/store/index.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/store/model.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/store/model.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/store/model.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/store/model.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/store/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/store/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/store/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/store/reducer.ts diff --git a/x-pack/plugins/security_solution/public/explore/hosts/store/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/store/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/hosts/store/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/hosts/store/selectors.ts diff --git a/x-pack/plugins/security_solution/public/explore/index.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/explore/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/explore/jest.config.js new file mode 100644 index 0000000000000..996b41f5d9114 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/explore/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/explore'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/explore', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/explore/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/explore/landing.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/landing.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/landing.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/landing.tsx diff --git a/x-pack/plugins/security_solution/public/explore/links.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/links.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/links.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/arrows/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/arrows/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/arrows/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/arrows/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/arrows/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/arrows/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/arrows/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/arrows/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/arrows/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/arrows/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/arrows/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/arrows/helpers.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/arrows/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/arrows/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/arrows/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/arrows/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/arrows/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/arrows/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/arrows/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/arrows/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/details/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/details/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/details/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/details/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/details/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/details/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/details/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/details/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/details/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/details/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/details/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/details/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/details/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/details/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/details/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/details/mock.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/details/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/details/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/details/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/details/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/direction/direction.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/direction/direction.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/direction/direction.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/direction/direction.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/direction/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/direction/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/direction/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/direction/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/__mocks__/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/__mocks__/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/__mocks__/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/__mocks__/mock.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/__snapshots__/embeddable.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/__snapshots__/embeddable.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/__snapshots__/embeddable.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/__snapshots__/embeddable.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/__snapshots__/index_patterns_missing_prompt.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/__snapshots__/index_patterns_missing_prompt.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/__snapshots__/index_patterns_missing_prompt.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/__snapshots__/index_patterns_missing_prompt.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/embeddable.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/embeddable.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/embeddable.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/embeddable.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/embeddable.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/embeddable.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/embeddable.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/embeddable.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/embedded_map.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/embedded_map.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/embedded_map.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/embedded_map.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/embedded_map.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/embedded_map.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/embedded_map.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/embedded_map.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/index_patterns_missing_prompt.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/index_patterns_missing_prompt.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/index_patterns_missing_prompt.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/index_patterns_missing_prompt.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/index_patterns_missing_prompt.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/index_patterns_missing_prompt.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/index_patterns_missing_prompt.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/index_patterns_missing_prompt.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_config.test.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_config.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_config.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_config.test.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_config.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_config.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_config.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_config.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/__snapshots__/line_tool_tip_content.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/__snapshots__/line_tool_tip_content.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/__snapshots__/line_tool_tip_content.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/__snapshots__/line_tool_tip_content.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/__snapshots__/map_tool_tip.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/__snapshots__/map_tool_tip.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/__snapshots__/map_tool_tip.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/__snapshots__/map_tool_tip.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/__snapshots__/point_tool_tip_content.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/__snapshots__/point_tool_tip_content.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/__snapshots__/point_tool_tip_content.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/__snapshots__/point_tool_tip_content.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/__snapshots__/tooltip_footer.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/__snapshots__/tooltip_footer.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/__snapshots__/tooltip_footer.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/__snapshots__/tooltip_footer.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/line_tool_tip_content.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/line_tool_tip_content.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/line_tool_tip_content.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/line_tool_tip_content.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/line_tool_tip_content.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/line_tool_tip_content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/line_tool_tip_content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/line_tool_tip_content.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/map_tool_tip.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/map_tool_tip.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/map_tool_tip.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/map_tool_tip.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/map_tool_tip.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/map_tool_tip.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/map_tool_tip.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/map_tool_tip.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/point_tool_tip_content.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/point_tool_tip_content.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/point_tool_tip_content.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/point_tool_tip_content.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/point_tool_tip_content.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/point_tool_tip_content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/point_tool_tip_content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/point_tool_tip_content.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/tooltip_footer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/tooltip_footer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/tooltip_footer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/tooltip_footer.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/tooltip_footer.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/tooltip_footer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/tooltip_footer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/map_tool_tip/tooltip_footer.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/embeddables/types.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/embeddables/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/embeddables/types.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/flow_controls/__snapshots__/flow_direction_select.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/flow_controls/__snapshots__/flow_direction_select.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/flow_controls/__snapshots__/flow_direction_select.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/flow_controls/__snapshots__/flow_direction_select.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/flow_controls/__snapshots__/flow_target_select.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/flow_controls/__snapshots__/flow_target_select.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/flow_controls/__snapshots__/flow_target_select.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/flow_controls/__snapshots__/flow_target_select.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/flow_controls/flow_direction_select.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/flow_controls/flow_direction_select.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/flow_controls/flow_direction_select.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/flow_controls/flow_direction_select.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/flow_controls/flow_direction_select.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/flow_controls/flow_direction_select.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/flow_controls/flow_direction_select.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/flow_controls/flow_direction_select.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/flow_controls/flow_target_select.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/flow_controls/flow_target_select.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/flow_controls/flow_target_select.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/flow_controls/flow_target_select.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/flow_controls/flow_target_select.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/flow_controls/flow_target_select.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/flow_controls/flow_target_select.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/flow_controls/flow_target_select.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/flow_controls/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/flow_controls/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/flow_controls/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/flow_controls/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/flow_target_select_connected/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/flow_target_select_connected/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/flow_target_select_connected/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/flow_target_select_connected/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/flow_target_select_connected/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/flow_target_select_connected/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/flow_target_select_connected/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/flow_target_select_connected/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/ip/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/ip/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/ip/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/ip/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/ip/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/ip/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/ip/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/ip/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/ip/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/ip/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/ip/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/ip/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/kpi_network/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/dns/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/dns/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/kpi_network/dns/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/dns/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/dns/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/dns/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/kpi_network/dns/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/dns/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/dns/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/dns/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/kpi_network/dns/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/dns/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/kpi_network/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/kpi_network/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/network_events/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/network_events/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/kpi_network/network_events/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/network_events/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/network_events/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/network_events/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/kpi_network/network_events/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/network_events/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/network_events/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/network_events/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/kpi_network/network_events/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/network_events/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/tls_handshakes/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/tls_handshakes/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/kpi_network/tls_handshakes/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/tls_handshakes/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/tls_handshakes/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/tls_handshakes/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/kpi_network/tls_handshakes/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/tls_handshakes/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/tls_handshakes/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/tls_handshakes/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/kpi_network/tls_handshakes/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/tls_handshakes/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/types.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/kpi_network/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/types.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_flows/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/unique_flows/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_flows/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/unique_flows/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_flows/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/unique_flows/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_flows/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/unique_flows/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_flows/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/unique_flows/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_flows/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/unique_flows/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_private_ips/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/unique_private_ips/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_private_ips/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/unique_private_ips/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_private_ips/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/unique_private_ips/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_private_ips/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/unique_private_ips/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_private_ips/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/unique_private_ips/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/kpi_network/unique_private_ips/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/kpi_network/unique_private_ips/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_dns_table/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_dns_table/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_dns_table/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_dns_table/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_dns_table/__snapshots__/is_ptr_included.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_dns_table/__snapshots__/is_ptr_included.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_dns_table/__snapshots__/is_ptr_included.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_dns_table/__snapshots__/is_ptr_included.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_dns_table/columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_dns_table/columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_dns_table/columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_dns_table/columns.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_dns_table/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_dns_table/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_dns_table/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_dns_table/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_dns_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_dns_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_dns_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_dns_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_dns_table/is_ptr_included.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_dns_table/is_ptr_included.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_dns_table/is_ptr_included.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_dns_table/is_ptr_included.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_dns_table/is_ptr_included.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_dns_table/is_ptr_included.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_dns_table/is_ptr_included.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_dns_table/is_ptr_included.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_dns_table/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_dns_table/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_dns_table/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_dns_table/mock.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_dns_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_dns_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_dns_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_dns_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_http_table/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_http_table/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_http_table/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_http_table/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_http_table/columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_http_table/columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_http_table/columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_http_table/columns.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_http_table/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_http_table/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_http_table/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_http_table/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_http_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_http_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_http_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_http_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_http_table/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_http_table/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_http_table/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_http_table/mock.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_http_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_http_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_http_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_http_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_top_countries_table/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_countries_table/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_top_countries_table/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_countries_table/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_top_countries_table/columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_countries_table/columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_top_countries_table/columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_countries_table/columns.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_top_countries_table/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_countries_table/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_top_countries_table/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_countries_table/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_top_countries_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_countries_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_top_countries_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_countries_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_top_countries_table/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_countries_table/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_top_countries_table/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_countries_table/mock.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_top_countries_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_countries_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_top_countries_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_countries_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/columns.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/mock.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/network_top_n_flow_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/port/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/port/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/port/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/port/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/port/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/port/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/port/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/port/helpers.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/port/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/port/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/port/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/port/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/port/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/port/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/port/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/port/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/source_destination/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/source_destination/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/source_destination/country_flag.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/country_flag.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/source_destination/country_flag.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/country_flag.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/source_destination/field_names.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/field_names.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/source_destination/field_names.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/field_names.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/source_destination/geo_fields.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/geo_fields.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/source_destination/geo_fields.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/geo_fields.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/source_destination/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/source_destination/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/source_destination/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/source_destination/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/source_destination/ip_with_port.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/ip_with_port.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/source_destination/ip_with_port.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/ip_with_port.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/source_destination/label.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/label.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/source_destination/label.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/label.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/source_destination/network.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/network.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/source_destination/network.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/network.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/source_destination/source_destination_arrows.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/source_destination_arrows.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/source_destination/source_destination_arrows.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/source_destination_arrows.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/source_destination/source_destination_ip.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/source_destination_ip.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/source_destination/source_destination_ip.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/source_destination_ip.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/source_destination/source_destination_ip.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/source_destination_ip.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/source_destination/source_destination_ip.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/source_destination_ip.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/source_destination/source_destination_with_arrows.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/source_destination_with_arrows.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/source_destination/source_destination_with_arrows.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/source_destination_with_arrows.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/source_destination/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/source_destination/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/source_destination/types.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/source_destination/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/source_destination/types.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/tls_table/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/tls_table/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/tls_table/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/tls_table/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/tls_table/columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/tls_table/columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/tls_table/columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/tls_table/columns.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/tls_table/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/tls_table/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/tls_table/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/tls_table/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/tls_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/tls_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/tls_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/tls_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/tls_table/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/tls_table/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/tls_table/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/tls_table/mock.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/tls_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/tls_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/tls_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/tls_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/users_table/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/users_table/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/users_table/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/users_table/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/explore/network/components/users_table/columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/users_table/columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/users_table/columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/users_table/columns.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/users_table/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/users_table/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/users_table/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/users_table/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/users_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/users_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/users_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/users_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/components/users_table/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/users_table/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/users_table/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/users_table/mock.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/components/users_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/components/users_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/components/users_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/components/users_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/details/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/details/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/details/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/details/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/details/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/details/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/details/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/details/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/details/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/details/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/details/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/details/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/network_dns/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_dns/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/network_dns/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_dns/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/network_dns/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_dns/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/network_dns/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_dns/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/network_dns/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_dns/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/network_dns/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_dns/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/network_http/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_http/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/network_http/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_http/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/network_http/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_http/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/network_http/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_http/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/network_http/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_http/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/network_http/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_http/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/network_top_countries/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_top_countries/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/network_top_countries/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_top_countries/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/network_top_countries/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_top_countries/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/network_top_countries/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_top_countries/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/network_top_countries/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_top_countries/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/network_top_countries/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_top_countries/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/network_top_n_flow/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_top_n_flow/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/network_top_n_flow/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_top_n_flow/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/network_top_n_flow/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_top_n_flow/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/network_top_n_flow/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_top_n_flow/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/network_top_n_flow/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_top_n_flow/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/network_top_n_flow/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/network_top_n_flow/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/tls/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/tls/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/tls/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/tls/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/tls/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/tls/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/tls/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/tls/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/tls/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/tls/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/tls/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/tls/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/users/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/users/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/users/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/users/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/users/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/users/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/users/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/users/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/containers/users/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/users/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/containers/users/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/containers/users/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/constants.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/details/breadcrumbs.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/details/breadcrumbs.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/details/breadcrumbs.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/details/breadcrumbs.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/details/details_tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/details/details_tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/details/details_tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/details/details_tabs.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/details/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/details/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/details/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/details/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/details/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/details/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/details/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/details/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/details/nav_tabs.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/details/nav_tabs.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/details/nav_tabs.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/details/nav_tabs.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/details/nav_tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/details/nav_tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/details/nav_tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/details/nav_tabs.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/details/types.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/details/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/details/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/details/types.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/navigation/conditional_flex_group.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/conditional_flex_group.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/navigation/conditional_flex_group.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/conditional_flex_group.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/navigation/countries_query_tab_body.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/countries_query_tab_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/navigation/countries_query_tab_body.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/countries_query_tab_body.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/navigation/dns_query_tab_body.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/dns_query_tab_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/navigation/dns_query_tab_body.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/dns_query_tab_body.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/navigation/http_query_tab_body.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/http_query_tab_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/navigation/http_query_tab_body.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/http_query_tab_body.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/navigation/index.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/navigation/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/index.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/navigation/ips_query_tab_body.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/ips_query_tab_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/navigation/ips_query_tab_body.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/ips_query_tab_body.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/navigation/nav_tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/nav_tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/navigation/nav_tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/nav_tabs.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/navigation/network_routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/network_routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/navigation/network_routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/network_routes.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/navigation/network_routes_loading.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/network_routes_loading.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/navigation/network_routes_loading.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/network_routes_loading.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/navigation/tls_query_tab_body.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/tls_query_tab_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/navigation/tls_query_tab_body.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/tls_query_tab_body.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/navigation/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/navigation/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/navigation/types.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/navigation/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/types.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/navigation/users_query_tab_body.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/users_query_tab_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/navigation/users_query_tab_body.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/users_query_tab_body.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/navigation/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/navigation/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/navigation/utils.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/network.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/network.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/network.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/network.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/network.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/network.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/network.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/network.tsx diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/pages/types.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/pages/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/pages/types.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/store/actions.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/store/actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/store/actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/store/actions.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/store/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/store/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/store/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/store/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/store/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/store/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/store/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/store/helpers.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/store/index.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/store/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/store/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/store/index.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/store/model.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/store/model.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/store/model.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/store/model.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/store/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/store/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/store/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/store/reducer.ts diff --git a/x-pack/plugins/security_solution/public/explore/network/store/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/network/store/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/network/store/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/network/store/selectors.ts diff --git a/x-pack/plugins/security_solution/public/explore/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/routes.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/components/all_users/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/components/all_users/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/components/all_users/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/components/all_users/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/components/all_users/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/components/all_users/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/components/all_users/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/components/all_users/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/components/all_users/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/components/all_users/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/components/all_users/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/components/all_users/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/authentications/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/components/kpi_users/authentications/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/components/kpi_users/authentications/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/components/kpi_users/authentications/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/authentications/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/components/kpi_users/authentications/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/components/kpi_users/authentications/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/components/kpi_users/authentications/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/authentications/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/components/kpi_users/authentications/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/components/kpi_users/authentications/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/components/kpi_users/authentications/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/components/kpi_users/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/components/kpi_users/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/components/kpi_users/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/total_users/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/components/kpi_users/total_users/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/components/kpi_users/total_users/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/components/kpi_users/total_users/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/total_users/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/components/kpi_users/total_users/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/components/kpi_users/total_users/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/components/kpi_users/total_users/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/total_users/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/components/kpi_users/total_users/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/components/kpi_users/total_users/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/components/kpi_users/total_users/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/components/kpi_users/types.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/components/kpi_users/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/components/kpi_users/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/components/kpi_users/types.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/containers/users/observed_details/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/containers/users/observed_details/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/containers/users/observed_details/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/containers/users/observed_details/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/containers/users/observed_details/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/containers/users/observed_details/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/containers/users/observed_details/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/containers/users/observed_details/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/containers/users/observed_details/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/containers/users/observed_details/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/containers/users/observed_details/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/containers/users/observed_details/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/constants.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/details/breadcrumbs.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/details/breadcrumbs.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/details/breadcrumbs.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/details/breadcrumbs.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/details/details_tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/details/details_tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/details/details_tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/details/details_tabs.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/details/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/details/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/details/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/details/helpers.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/details/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/details/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/details/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/details/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/details/nav_tabs.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/details/nav_tabs.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/details/nav_tabs.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/details/nav_tabs.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/details/nav_tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/details/nav_tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/details/nav_tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/details/nav_tabs.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/details/types.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/details/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/details/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/details/types.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/index.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/nav_tabs.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/nav_tabs.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/nav_tabs.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/nav_tabs.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/nav_tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/nav_tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/nav_tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/nav_tabs.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/navigation/all_users_query_tab_body.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/navigation/all_users_query_tab_body.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/navigation/all_users_query_tab_body.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/navigation/all_users_query_tab_body.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/navigation/all_users_query_tab_body.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/navigation/all_users_query_tab_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/navigation/all_users_query_tab_body.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/navigation/all_users_query_tab_body.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/navigation/authentications_query_tab_body.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/navigation/authentications_query_tab_body.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/navigation/authentications_query_tab_body.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/navigation/authentications_query_tab_body.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/navigation/authentications_query_tab_body.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/navigation/authentications_query_tab_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/navigation/authentications_query_tab_body.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/navigation/authentications_query_tab_body.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/navigation/index.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/navigation/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/navigation/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/navigation/index.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/navigation/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/navigation/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/navigation/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/navigation/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/navigation/types.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/navigation/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/navigation/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/navigation/types.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/translations.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/types.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/types.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/users.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/users.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/users.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/users.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/users_tabs.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/users_tabs.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/users_tabs.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/users_tabs.test.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/pages/users_tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/users_tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/pages/users_tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/pages/users_tabs.tsx diff --git a/x-pack/plugins/security_solution/public/explore/users/store/actions.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/store/actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/store/actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/store/actions.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/store/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/store/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/store/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/store/constants.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/store/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/store/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/store/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/store/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/store/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/store/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/store/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/store/helpers.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/store/index.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/store/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/store/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/store/index.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/store/middleware_storage.test.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/store/middleware_storage.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/store/middleware_storage.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/store/middleware_storage.test.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/store/middleware_storage.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/store/middleware_storage.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/store/middleware_storage.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/store/middleware_storage.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/store/model.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/store/model.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/store/model.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/store/model.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/store/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/store/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/store/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/store/reducer.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/store/selectors.test.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/store/selectors.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/store/selectors.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/store/selectors.test.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/store/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/store/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/store/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/store/selectors.ts diff --git a/x-pack/plugins/security_solution/public/explore/users/store/storage.ts b/x-pack/solutions/security/plugins/security_solution/public/explore/users/store/storage.ts similarity index 100% rename from x-pack/plugins/security_solution/public/explore/users/store/storage.ts rename to x-pack/solutions/security/plugins/security_solution/public/explore/users/store/storage.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/README.md b/x-pack/solutions/security/plugins/security_solution/public/flyout/README.md new file mode 100644 index 0000000000000..f12169aef7fd3 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/README.md @@ -0,0 +1,64 @@ +# Security Solution expandable flyouts + +For more info on the expandable flyout, see the `@kbn/expandable-flyout` package. + +## Description + +The Security Solution plugin aims at having a single instance of the expandable flyout. That instance can display as many panels as we need. This folder hosts all the panels that are can be displayed in the Security Solution flyout. Panels can be differentiated as to be displayed in different sections of the expandable flyout (right, left or preview), but ultimately, nothing prevents us from displaying a panel in any section we want. + +> Remember to add any new panels to the `index.tsx` at the root of the [flyout folder](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/flyout). These are passed to the `@kbn/expandable-flyout` package as `registeredPanels`. Failing to do so will result in the panel not being rendered. + +## Folder Structure + +The structure of the `flyout` folder is intended to work as follows: +- multiple top level folders referring to the _type_ of flyout (for example document details, user, host, rule, cases...) and would contain all the panels for that flyout _type_. Each of these top level folders can be organized the way you want, but we recommend following a similar structure to the one we have for the `document_details` flyout type, where the `right`, `left` and `preview` folders correspond to the panels displayed in the right, left and preview flyout sections respectively. The `shared` folder contains any shared components/hooks/services/helpers that are used within the other folders. +``` +document_details +└─── right +└─── left +└─── preview +└─── shared +``` +- one top level `shared` folder containing all the components/hooks/services/helpers that are used across multiple flyout types. Putting code in this folder should be very deliberate, and should follow some guidelines: + - code built in isolation (meaning that it should not be built with a specific flyout type or usage in mind) + - extensively tested + - components should have storybook stories + +The `flyout` folder structure should therefore look like this: +``` +flyout +│ index.tsx +│ jest.config.js +│ README.md +│ +└─── document_details +│ └─── right +│ └─── left +│ └─── preview +│ +└─── new_type +│ └─── right +│ └─── preview +│ +└─── other_new_type +│ └─── right +│ └─── left +│ +└─── ... +│ +└─── shared + └─── components +``` + +## Shared flyout components + +Here's a non-exhaustive list of the reusable component in the top-level `shared` folder. We recommend using these components to create a unified flyout experience. + + - [FlyoutNavigation](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_navigation.tsx): navigation menu on the **right panel** only, with expand/collapse button and option to pass in a list of actions to be displayed on top. Works best when used in combination with the header component below. + - [FlyoutHeader](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_header.tsx): wrapper of `EuiFlyoutHeader`, setting the recommended `16px` padding using a EuiPanel. + - [FlyoutTitle](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_title.tsx): title component with optional icon to indicate the type of document, works when the title is link or pure text + - [FlyoutHeaderTabs](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_header_tabs.tsx): Wrapper of `EuiTabs`, setting bottom margin to align with the flyout header divider + - [FlyoutBody](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_body.tsx): wrapper of `EuiFlyoutHeader`, setting the recommended `16px` padding using a EuiPanel. + - [FlyoutFooter](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_footer.tsx): wrapper of `EuiFlyoutFooter`, setting the recommended `16px` padding using a EuiPanel. + - [FlyoutError](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_error.tsx): displays a `EuiEmptyPrompt` for error messages, correctly positioned and sized when used in at the panel level (not for individual components) + - [FlyoutLoading](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_loading.tsx): displays an `EuiLoadingSpinner` component correctly positioned and sized when used in at the panel level (not for individual components) diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/alert_reason/alert_reason.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/alert_reason/alert_reason.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/alert_reason/alert_reason.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/alert_reason/alert_reason.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/alert_reason/alert_reason.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/alert_reason/alert_reason.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/alert_reason/alert_reason.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/alert_reason/alert_reason.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/alert_reason/context.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/alert_reason/context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/alert_reason/context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/alert_reason/context.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/alert_reason/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/alert_reason/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/alert_reason/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/alert_reason/index.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/alert_reason/mocks/mock_context.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/alert_reason/mocks/mock_context.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/alert_reason/mocks/mock_context.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/alert_reason/mocks/mock_context.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/alert_reason/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/alert_reason/test_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/alert_reason/test_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/alert_reason/test_ids.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/analyzer_panels/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/analyzer_panels/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/analyzer_panels/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/analyzer_panels/index.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/isolate_host/content.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/isolate_host/content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/isolate_host/content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/isolate_host/content.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/isolate_host/context.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/isolate_host/context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/isolate_host/context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/isolate_host/context.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/isolate_host/header.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/isolate_host/header.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/isolate_host/header.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/isolate_host/header.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/isolate_host/header.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/isolate_host/header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/isolate_host/header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/isolate_host/header.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/isolate_host/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/isolate_host/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/isolate_host/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/isolate_host/index.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/isolate_host/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/isolate_host/test_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/isolate_host/test_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/isolate_host/test_ids.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/analyze_graph.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/analyze_graph.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/analyze_graph.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/analyze_graph.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/analyze_graph.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/analyze_graph.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/analyze_graph.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/analyze_graph.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/attach_to_active_timeline.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/attach_to_active_timeline.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/attach_to_active_timeline.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/attach_to_active_timeline.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/attach_to_active_timeline.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/attach_to_active_timeline.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/attach_to_active_timeline.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/attach_to_active_timeline.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/correlations_details.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/correlations_details.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/correlations_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/correlations_details.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details_alerts_table.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/correlations_details_alerts_table.test.tsx similarity index 83% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details_alerts_table.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/correlations_details_alerts_table.test.tsx index 6fd56c3aa5195..7e5088b0195cb 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details_alerts_table.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/correlations_details_alerts_table.test.tsx @@ -11,7 +11,6 @@ import { TestProviders } from '../../../../common/mock'; import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; import { CorrelationsDetailsAlertsTable } from './correlations_details_alerts_table'; import { usePaginatedAlerts } from '../hooks/use_paginated_alerts'; -import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; import { mockFlyoutApi } from '../../shared/mocks/mock_flyout_context'; import { mockContextValue } from '../../shared/mocks/mock_context'; import { DocumentDetailsPreviewPanelKey } from '../../shared/constants/panel_keys'; @@ -20,8 +19,6 @@ import { DocumentDetailsContext } from '../../shared/context'; import { RulePreviewPanelKey, RULE_PREVIEW_BANNER } from '../../../rule_details/right'; jest.mock('../hooks/use_paginated_alerts'); -jest.mock('../../../../common/hooks/use_experimental_features'); -const mockUseIsExperimentalFeatureEnabled = useIsExperimentalFeatureEnabled as jest.Mock; jest.mock('@kbn/expandable-flyout'); @@ -47,7 +44,6 @@ const renderCorrelationsTable = (panelContext: DocumentDetailsContext) => describe('CorrelationsDetailsAlertsTable', () => { beforeEach(() => { jest.mocked(useExpandableFlyoutApi).mockReturnValue(mockFlyoutApi); - mockUseIsExperimentalFeatureEnabled.mockReturnValue(true); jest.mocked(usePaginatedAlerts).mockReturnValue({ setPagination: jest.fn(), setSorting: jest.fn(), @@ -88,16 +84,16 @@ describe('CorrelationsDetailsAlertsTable', () => { }); it('renders EuiBasicTable with correct props', () => { - const { getByTestId, queryByTestId, queryAllByRole } = + const { getByTestId, getAllByTestId, queryAllByRole } = renderCorrelationsTable(mockContextValue); expect(getByTestId(`${TEST_ID}InvestigateInTimeline`)).toBeInTheDocument(); expect(getByTestId(`${TEST_ID}Table`)).toBeInTheDocument(); - expect(queryByTestId(`${TEST_ID}AlertPreviewButton`)).not.toBeInTheDocument(); + expect(getAllByTestId(`${TEST_ID}AlertPreviewButton`)).toHaveLength(2); expect(jest.mocked(usePaginatedAlerts)).toHaveBeenCalled(); - expect(queryAllByRole('columnheader').length).toBe(4); + expect(queryAllByRole('columnheader').length).toBe(5); expect(queryAllByRole('row').length).toBe(3); // 1 header row and 2 data rows expect(queryAllByRole('row')[1].textContent).toContain('Jan 1, 2022 @ 00:00:00.000'); expect(queryAllByRole('row')[1].textContent).toContain('Reason1'); @@ -105,8 +101,7 @@ describe('CorrelationsDetailsAlertsTable', () => { expect(queryAllByRole('row')[1].textContent).toContain('Severity1'); }); - it('renders open preview button when feature flag is on', () => { - mockUseIsExperimentalFeatureEnabled.mockReturnValue(false); + it('renders open preview button', () => { const { getByTestId, getAllByTestId } = renderCorrelationsTable({ ...mockContextValue, isPreviewMode: true, @@ -128,8 +123,7 @@ describe('CorrelationsDetailsAlertsTable', () => { }); }); - it('opens rule preview when feature flag is on and isPreview is false', () => { - mockUseIsExperimentalFeatureEnabled.mockReturnValue(false); + it('opens rule preview when isPreview is false', () => { const { getAllByTestId } = renderCorrelationsTable(mockContextValue); expect(getAllByTestId(`${TEST_ID}RulePreview`).length).toBe(2); @@ -145,8 +139,7 @@ describe('CorrelationsDetailsAlertsTable', () => { }); }); - it('does not render preview link when feature flag is on and isPreview is true', () => { - mockUseIsExperimentalFeatureEnabled.mockReturnValue(false); + it('does not render preview link when isPreview is true', () => { const { queryByTestId } = renderCorrelationsTable({ ...mockContextValue, isPreview: true }); expect(queryByTestId(`${TEST_ID}RulePreview`)).not.toBeInTheDocument(); }); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details_alerts_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/correlations_details_alerts_table.tsx similarity index 88% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details_alerts_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/correlations_details_alerts_table.tsx index d8497ca984ea8..4d757b46edb27 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/correlations_details_alerts_table.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/correlations_details_alerts_table.tsx @@ -14,7 +14,6 @@ import { isRight } from 'fp-ts/lib/Either'; import { ALERT_REASON, ALERT_RULE_NAME } from '@kbn/rule-data-utils'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; -import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; import { CellTooltipWrapper } from '../../shared/components/cell_tooltip_wrapper'; import type { DataProvider } from '../../../../../common/types'; import { SeverityBadge } from '../../../../common/components/severity_badge'; @@ -82,8 +81,6 @@ export const CorrelationsDetailsAlertsTable: FC<CorrelationsDetailsAlertsTablePr sorting, error, } = usePaginatedAlerts(alertIds || []); - const isPreviewEnabled = !useIsExperimentalFeatureEnabled('entityAlertPreviewDisabled'); - const { isPreview } = useDocumentDetailsContext(); const onTableChange = useCallback( @@ -129,21 +126,17 @@ export const CorrelationsDetailsAlertsTable: FC<CorrelationsDetailsAlertsTablePr const columns = useMemo( () => [ - ...(isPreviewEnabled - ? [ - { - render: (row: Record<string, unknown>) => ( - <AlertPreviewButton - id={row.id as string} - indexName={row.index as string} - data-test-subj={`${dataTestSubj}AlertPreviewButton`} - scopeId={scopeId} - /> - ), - width: '5%', - }, - ] - : []), + { + render: (row: Record<string, unknown>) => ( + <AlertPreviewButton + id={row.id as string} + indexName={row.index as string} + data-test-subj={`${dataTestSubj}AlertPreviewButton`} + scopeId={scopeId} + /> + ), + width: '5%', + }, { field: '@timestamp', name: ( @@ -176,20 +169,16 @@ export const CorrelationsDetailsAlertsTable: FC<CorrelationsDetailsAlertsTablePr const ruleId = row['kibana.alert.rule.uuid'] as string; return ( <CellTooltipWrapper tooltip={ruleName}> - {isPreviewEnabled ? ( - <PreviewLink - field={ALERT_RULE_NAME} - value={ruleName} - scopeId={scopeId} - ruleId={ruleId} - isPreview={isPreview} - data-test-subj={`${dataTestSubj}RulePreview`} - > - <span>{ruleName}</span> - </PreviewLink> - ) : ( + <PreviewLink + field={ALERT_RULE_NAME} + value={ruleName} + scopeId={scopeId} + ruleId={ruleId} + isPreview={isPreview} + data-test-subj={`${dataTestSubj}RulePreview`} + > <span>{ruleName}</span> - )} + </PreviewLink> </CellTooltipWrapper> ); }, @@ -229,7 +218,7 @@ export const CorrelationsDetailsAlertsTable: FC<CorrelationsDetailsAlertsTablePr }, }, ], - [isPreviewEnabled, scopeId, dataTestSubj, isPreview] + [scopeId, dataTestSubj, isPreview] ); return ( diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/entities_details.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/entities_details.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/entities_details.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/entities_details.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/entities_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/entities_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/entities_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/entities_details.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/graph_visualization.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/graph_visualization.tsx new file mode 100644 index 0000000000000..3e7ab71b7f625 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/graph_visualization.tsx @@ -0,0 +1,73 @@ +/* + * 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 { css } from '@emotion/css'; +import { EuiLoadingSpinner } from '@elastic/eui'; +import { useGetScopedSourcererDataView } from '../../../../sourcerer/components/use_get_sourcerer_data_view'; +import { SourcererScopeName } from '../../../../sourcerer/store/model'; +import { useDocumentDetailsContext } from '../../shared/context'; +import { GRAPH_VISUALIZATION_TEST_ID } from './test_ids'; +import { useGraphPreview } from '../../shared/hooks/use_graph_preview'; + +const GraphInvestigationLazy = React.lazy(() => + import('@kbn/cloud-security-posture-graph').then((module) => ({ + default: module.GraphInvestigation, + })) +); + +export const GRAPH_ID = 'graph-visualization' as const; + +/** + * Graph visualization view displayed in the document details expandable flyout left section under the Visualize tab + */ +export const GraphVisualization: React.FC = memo(() => { + const dataView = useGetScopedSourcererDataView({ + sourcererScope: SourcererScopeName.default, + }); + const { getFieldsData, dataAsNestedObject, dataFormattedForFieldBrowser } = + useDocumentDetailsContext(); + const { + eventIds, + timestamp = new Date().toISOString(), + isAlert, + } = useGraphPreview({ + getFieldsData, + ecsData: dataAsNestedObject, + dataFormattedForFieldBrowser, + }); + + const originEventIds = eventIds.map((id) => ({ id, isAlert })); + + return ( + <div + data-test-subj={GRAPH_VISUALIZATION_TEST_ID} + css={css` + height: calc(100vh - 250px); + min-height: 400px; + width: 100%; + `} + > + {dataView && ( + <React.Suspense fallback={<EuiLoadingSpinner />}> + <GraphInvestigationLazy + initialState={{ + dataView, + originEventIds, + timeRange: { + from: `${timestamp}||-30m`, + to: `${timestamp}||+30m`, + }, + }} + /> + </React.Suspense> + )} + </div> + ); +}); + +GraphVisualization.displayName = 'GraphVisualization'; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/host_details.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/host_details.test.tsx similarity index 93% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/host_details.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/host_details.test.tsx index e08a794665222..86d04a9c94a77 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/host_details.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/host_details.test.tsx @@ -17,7 +17,6 @@ import { useMlCapabilities } from '../../../../common/components/ml/hooks/use_ml import { mockAnomalies } from '../../../../common/components/ml/mock'; import { useHostDetails } from '../../../../explore/hosts/containers/hosts/details'; import { useHostRelatedUsers } from '../../../../common/containers/related_entities/related_users'; -import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; import { RiskSeverity } from '../../../../../common/search_strategy'; import { HOST_DETAILS_TEST_ID, @@ -46,9 +45,6 @@ jest.mock('@kbn/expandable-flyout'); jest.mock('@kbn/cloud-security-posture/src/hooks/use_misconfiguration_preview'); jest.mock('@kbn/cloud-security-posture/src/hooks/use_vulnerabilities_preview'); -jest.mock('../../../../common/hooks/use_experimental_features'); -const mockUseIsExperimentalFeatureEnabled = useIsExperimentalFeatureEnabled as jest.Mock; - jest.mock('react-router-dom', () => { const actual = jest.requireActual('react-router-dom'); return { ...actual, useLocation: jest.fn().mockReturnValue({ pathname: '' }) }; @@ -180,20 +176,18 @@ describe('<HostDetails />', () => { mockUseHostDetails.mockReturnValue(mockHostDetailsResponse); mockUseRiskScore.mockReturnValue(mockRiskScoreResponse); mockUseHostsRelatedUsers.mockReturnValue(mockRelatedUsersResponse); - mockUseIsExperimentalFeatureEnabled.mockReturnValue(true); (useMisconfigurationPreview as jest.Mock).mockReturnValue({}); (useVulnerabilitiesPreview as jest.Mock).mockReturnValue({}); (useAlertsByStatus as jest.Mock).mockReturnValue({ isLoading: false, items: {} }); }); it('should render host details correctly', () => { - const { getByTestId, queryByTestId } = renderHostDetails(mockContextValue); + const { getByTestId } = renderHostDetails(mockContextValue); expect(getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(HOST_DETAILS_TEST_ID))).toBeInTheDocument(); - expect(queryByTestId(HOST_DETAILS_LINK_TEST_ID)).not.toBeInTheDocument(); + expect(getByTestId(HOST_DETAILS_LINK_TEST_ID)).toBeInTheDocument(); }); - it('should render host name as clicable link when preview is not disabled', () => { - mockUseIsExperimentalFeatureEnabled.mockReturnValue(false); + it('should render host name as clicable link', () => { const { getByTestId } = renderHostDetails(mockContextValue); expect(getByTestId(HOST_DETAILS_LINK_TEST_ID)).toBeInTheDocument(); @@ -242,7 +236,7 @@ describe('<HostDetails />', () => { describe('Related users', () => { it('should render the related user table with correct dates and indices', () => { - const { getByTestId, queryByTestId } = renderHostDetails(mockContextValue); + const { getByTestId } = renderHostDetails(mockContextValue); expect(mockUseHostsRelatedUsers).toBeCalledWith({ from: timestamp, hostName: 'test host', @@ -250,7 +244,7 @@ describe('<HostDetails />', () => { skip: false, }); expect(getByTestId(HOST_DETAILS_RELATED_USERS_TABLE_TEST_ID)).toBeInTheDocument(); - expect(queryByTestId(HOST_DETAILS_RELATED_USERS_LINK_TEST_ID)).not.toBeInTheDocument(); + expect(getByTestId(HOST_DETAILS_RELATED_USERS_LINK_TEST_ID)).toBeInTheDocument(); }); it('should render user risk score column when license and capabilities are valid', () => { @@ -296,8 +290,7 @@ describe('<HostDetails />', () => { ); }); - it('should render user name as clicable link when preview is not disabled', () => { - mockUseIsExperimentalFeatureEnabled.mockReturnValue(false); + it('should render user name as clicable link', () => { const { getAllByTestId } = renderHostDetails(mockContextValue); expect(getAllByTestId(HOST_DETAILS_RELATED_USERS_LINK_TEST_ID).length).toBe(1); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/host_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/host_details.tsx similarity index 92% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/host_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/host_details.tsx index e3fd2fef8bc6e..9555860a329b3 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/host_details.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/host_details.tsx @@ -25,14 +25,12 @@ import type { EuiBasicTableColumn } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; import { ExpandablePanel } from '../../../shared/components/expandable_panel'; import type { RelatedUser } from '../../../../../common/search_strategy/security_solution/related_entities/related_users'; import type { RiskSeverity } from '../../../../../common/search_strategy'; import { HostOverview } from '../../../../overview/components/host_overview'; import { AnomalyTableProvider } from '../../../../common/components/ml/anomaly/anomaly_table_provider'; import { InspectButton, InspectButtonContainer } from '../../../../common/components/inspect'; -import { NetworkDetailsLink } from '../../../../common/components/links'; import { RiskScoreEntity } from '../../../../../common/search_strategy'; import { RiskScoreLevel } from '../../../../entity_analytics/components/severity/common'; import { DefaultFieldRenderer } from '../../../../timelines/components/field_renderers/default_renderer'; @@ -110,7 +108,6 @@ export const HostDetails: React.FC<HostDetailsProps> = ({ hostName, timestamp, s const isEntityAnalyticsAuthorized = isPlatinumOrTrialLicense && hasEntityAnalyticsCapability; const { openPreviewPanel } = useExpandableFlyoutApi(); - const isPreviewEnabled = !useIsExperimentalFeatureEnabled('entityAlertPreviewDisabled'); const narrowDateRange = useCallback<NarrowDateRange>( (score, interval) => { @@ -176,16 +173,12 @@ export const HostDetails: React.FC<HostDetailsProps> = ({ hostName, timestamp, s render: (user: string) => ( <EuiText grow={false} size="xs"> <CellActions field={USER_NAME_FIELD_NAME} value={user}> - {isPreviewEnabled ? ( - <PreviewLink - field={USER_NAME_FIELD_NAME} - value={user} - scopeId={scopeId} - data-test-subj={HOST_DETAILS_RELATED_USERS_LINK_TEST_ID} - /> - ) : ( - <>{user}</> - )} + <PreviewLink + field={USER_NAME_FIELD_NAME} + value={user} + scopeId={scopeId} + data-test-subj={HOST_DETAILS_RELATED_USERS_LINK_TEST_ID} + /> </CellActions> </EuiText> ), @@ -208,15 +201,13 @@ export const HostDetails: React.FC<HostDetailsProps> = ({ hostName, timestamp, s render={(ip) => ip == null ? ( getEmptyTagValue() - ) : isPreviewEnabled ? ( + ) : ( <PreviewLink field={HOST_IP_FIELD_NAME} value={ip} scopeId={scopeId} data-test-subj={HOST_DETAILS_RELATED_USERS_IP_LINK_TEST_ID} /> - ) : ( - <NetworkDetailsLink ip={ip} /> ) } scopeId={scopeId} @@ -242,7 +233,7 @@ export const HostDetails: React.FC<HostDetailsProps> = ({ hostName, timestamp, s ] : []), ], - [isEntityAnalyticsAuthorized, scopeId, isPreviewEnabled] + [isEntityAnalyticsAuthorized, scopeId] ); const relatedUsersCount = useMemo( @@ -273,19 +264,14 @@ export const HostDetails: React.FC<HostDetailsProps> = ({ hostName, timestamp, s }; const hostLink = useMemo( - () => - isPreviewEnabled - ? { - callback: openHostPreview, - tooltip: i18n.translate( - 'xpack.securitySolution.flyout.left.insights.entities.host.hostPreviewTitle', - { - defaultMessage: 'Preview host', - } - ), - } - : undefined, - [isPreviewEnabled, openHostPreview] + () => ({ + callback: openHostPreview, + tooltip: i18n.translate( + 'xpack.securitySolution.flyout.left.insights.entities.host.hostPreviewTitle', + { defaultMessage: 'Preview host' } + ), + }), + [openHostPreview] ); return ( diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/investigation_guide.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/investigation_guide.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/investigation_guide.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/investigation_guide.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/investigation_guide.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/investigation_guide.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/investigation_guide.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/investigation_guide.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/investigation_guide_view.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/investigation_guide_view.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/investigation_guide_view.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/investigation_guide_view.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/investigation_guide_view.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/investigation_guide_view.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/investigation_guide_view.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/investigation_guide_view.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/notes_details.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/notes_details.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/notes_details.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/notes_details.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/notes_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/notes_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/notes_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/notes_details.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/prevalence_details.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/prevalence_details.test.tsx similarity index 95% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/prevalence_details.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/prevalence_details.test.tsx index e8b1b71e9cd0f..e0bef746b213b 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/prevalence_details.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/prevalence_details.test.tsx @@ -24,7 +24,6 @@ import { import { usePrevalence } from '../../shared/hooks/use_prevalence'; import { TestProviders } from '../../../../common/mock'; import { licenseService } from '../../../../common/hooks/use_license'; -import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; import { mockFlyoutApi } from '../../shared/mocks/mock_flyout_context'; import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; import { HostPreviewPanelKey } from '../../../entity_details/host_right'; @@ -46,9 +45,6 @@ jest.mock('../../../../common/lib/kibana', () => { }; }); -jest.mock('../../../../common/hooks/use_experimental_features'); -const mockUseIsExperimentalFeatureEnabled = useIsExperimentalFeatureEnabled as jest.Mock; - jest.mock('../../shared/hooks/use_prevalence'); const mockDispatch = jest.fn(); @@ -138,7 +134,6 @@ describe('PrevalenceDetails', () => { jest.clearAllMocks(); licenseServiceMock.isPlatinumPlus.mockReturnValue(true); jest.mocked(useExpandableFlyoutApi).mockReturnValue(mockFlyoutApi); - mockUseIsExperimentalFeatureEnabled.mockReturnValue(true); }); it('should render the table with all data if license is platinum', () => { @@ -162,13 +157,10 @@ describe('PrevalenceDetails', () => { ).toBeGreaterThan(1); expect(queryByTestId(PREVALENCE_DETAILS_UPSELL_TEST_ID)).not.toBeInTheDocument(); expect(queryByText(NO_DATA_MESSAGE)).not.toBeInTheDocument(); - expect( - queryByTestId(PREVALENCE_DETAILS_TABLE_PREVIEW_LINK_CELL_TEST_ID) - ).not.toBeInTheDocument(); + expect(getAllByTestId(PREVALENCE_DETAILS_TABLE_PREVIEW_LINK_CELL_TEST_ID)).toHaveLength(2); }); - it('should render host and user name as clickable link if preview is enabled', () => { - mockUseIsExperimentalFeatureEnabled.mockReturnValue(false); + it('should render host and user name as clickable link', () => { (usePrevalence as jest.Mock).mockReturnValue(mockPrevelanceReturnValue); const { getAllByTestId } = renderPrevalenceDetails(); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/prevalence_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/prevalence_details.tsx similarity index 96% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/prevalence_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/prevalence_details.tsx index 6491bc9ad2747..77ab6eb66df31 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/prevalence_details.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/prevalence_details.tsx @@ -22,7 +22,6 @@ import { useEuiTheme, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; -import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; import { FormattedCount } from '../../../../common/components/formatted_number'; import { useLicense } from '../../../../common/hooks/use_license'; import { InvestigateInTimelineButton } from '../../../../common/components/event_details/investigate_in_timeline_button'; @@ -81,10 +80,6 @@ interface PrevalenceDetailsRow extends PrevalenceData { * License to drive the rendering of the last 2 prevalence columns */ isPlatinumPlus: boolean; - /** - * If enabled, clicking host or user should open an entity preview - */ - isPreviewEnabled: boolean; /** * Scope id to pass to the preview link */ @@ -115,7 +110,7 @@ const columns: Array<EuiBasicTableColumn<PrevalenceDetailsRow>> = [ render: (data: PrevalenceDetailsRow) => ( <EuiFlexGroup direction="column" gutterSize="none"> {data.values.map((value) => { - if (data.isPreviewEnabled && hasPreview(data.field)) { + if (hasPreview(data.field)) { return ( <EuiFlexItem key={value}> <CellActions field={data.field} value={value}> @@ -331,7 +326,6 @@ export const PrevalenceDetails: React.FC = () => { useDocumentDetailsContext(); const isPlatinumPlus = useLicense().isPlatinumPlus(); - const isPreviewEnabled = !useIsExperimentalFeatureEnabled('entityAlertPreviewDisabled'); // these two are used by the usePrevalence hook to fetch the data const [start, setStart] = useState(DEFAULT_FROM); @@ -382,10 +376,9 @@ export const PrevalenceDetails: React.FC = () => { from: absoluteStart, to: absoluteEnd, isPlatinumPlus, - isPreviewEnabled, scopeId, })), - [data, absoluteStart, absoluteEnd, isPlatinumPlus, isPreviewEnabled, scopeId] + [data, absoluteStart, absoluteEnd, isPlatinumPlus, scopeId] ); const upsell = ( diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_ancestry.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_ancestry.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_ancestry.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_ancestry.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_ancestry.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_ancestry.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_ancestry.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_ancestry.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_same_source_event.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_same_source_event.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_same_source_event.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_same_source_event.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_same_source_event.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_same_source_event.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_same_source_event.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_same_source_event.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_session.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_session.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_session.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_session.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_session.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_session.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_session.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/related_alerts_by_session.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_cases.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/related_cases.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_cases.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/related_cases.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_cases.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/related_cases.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/related_cases.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/related_cases.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/response_details.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/response_details.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/response_details.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/response_details.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/response_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/response_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/response_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/response_details.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/session_view.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/session_view.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/session_view.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/session_view.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/session_view.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/session_view.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/session_view.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/session_view.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/suppressed_alerts.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/suppressed_alerts.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/suppressed_alerts.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/suppressed_alerts.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/suppressed_alerts.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/suppressed_alerts.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/suppressed_alerts.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/suppressed_alerts.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/test_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/test_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/test_ids.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_accordion.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_accordion.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_accordion.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_accordion.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_accordion.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_accordion.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_accordion.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_accordion.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_accordion_group.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_accordion_group.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_accordion_group.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_accordion_group.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_accordion_group.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_accordion_group.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_accordion_group.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_accordion_group.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_button_content.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_button_content.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_button_content.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_button_content.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_button_content.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_button_content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_button_content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_button_content.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_section.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_section.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_section.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_section.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_section.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_section.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_section.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_section.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_intelligence_details.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_intelligence_details.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_intelligence_details.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_intelligence_details.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_intelligence_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_intelligence_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_intelligence_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_intelligence_details.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_intelligence_view_enrichment_range_picker.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_intelligence_view_enrichment_range_picker.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_intelligence_view_enrichment_range_picker.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_intelligence_view_enrichment_range_picker.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_intelligence_view_enrichment_range_picker.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_intelligence_view_enrichment_range_picker.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/threat_intelligence_view_enrichment_range_picker.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_intelligence_view_enrichment_range_picker.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/user_details.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/user_details.test.tsx similarity index 92% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/user_details.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/user_details.test.tsx index 5bfb8a7df50db..993e9101ba0f0 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/user_details.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/user_details.test.tsx @@ -16,7 +16,6 @@ import { useMlCapabilities } from '../../../../common/components/ml/hooks/use_ml import { mockAnomalies } from '../../../../common/components/ml/mock'; import { useObservedUserDetails } from '../../../../explore/users/containers/users/observed_details'; import { useUserRelatedHosts } from '../../../../common/containers/related_entities/related_hosts'; -import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; import { RiskSeverity } from '../../../../../common/search_strategy'; import { USER_DETAILS_TEST_ID, @@ -43,9 +42,6 @@ import { useAlertsByStatus } from '../../../../overview/components/detection_res jest.mock('@kbn/expandable-flyout'); jest.mock('@kbn/cloud-security-posture/src/hooks/use_misconfiguration_preview'); -jest.mock('../../../../common/hooks/use_experimental_features'); -const mockUseIsExperimentalFeatureEnabled = useIsExperimentalFeatureEnabled as jest.Mock; - jest.mock('react-router-dom', () => { const actual = jest.requireActual('react-router-dom'); return { ...actual, useLocation: jest.fn().mockReturnValue({ pathname: '' }) }; @@ -174,19 +170,17 @@ describe('<UserDetails />', () => { mockUseObservedUserDetails.mockReturnValue(mockUserDetailsResponse); mockUseRiskScore.mockReturnValue(mockRiskScoreResponse); mockUseUsersRelatedHosts.mockReturnValue(mockRelatedHostsResponse); - mockUseIsExperimentalFeatureEnabled.mockReturnValue(true); (useMisconfigurationPreview as jest.Mock).mockReturnValue({}); (useAlertsByStatus as jest.Mock).mockReturnValue({ isLoading: false, items: {} }); }); it('should render user details correctly', () => { - const { getByTestId, queryByTestId } = renderUserDetails(mockContextValue); + const { getByTestId } = renderUserDetails(mockContextValue); expect(getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(USER_DETAILS_TEST_ID))).toBeInTheDocument(); - expect(queryByTestId(USER_DETAILS_LINK_TEST_ID)).not.toBeInTheDocument(); + expect(getByTestId(USER_DETAILS_LINK_TEST_ID)).toBeInTheDocument(); }); - it('should render user name as clicable link when feature flag is true', () => { - mockUseIsExperimentalFeatureEnabled.mockReturnValue(false); + it('should render user name as clicable link', () => { const { getByTestId } = renderUserDetails(mockContextValue); expect(getByTestId(USER_DETAILS_LINK_TEST_ID)).toBeInTheDocument(); @@ -233,7 +227,7 @@ describe('<UserDetails />', () => { describe('Related hosts', () => { it('should render the related host table with correct dates and indices', () => { - const { getByTestId, queryByTestId } = renderUserDetails(mockContextValue); + const { getByTestId } = renderUserDetails(mockContextValue); expect(mockUseUsersRelatedHosts).toBeCalledWith({ from: timestamp, userName: 'test user', @@ -241,7 +235,7 @@ describe('<UserDetails />', () => { skip: false, }); expect(getByTestId(USER_DETAILS_RELATED_HOSTS_TABLE_TEST_ID)).toBeInTheDocument(); - expect(queryByTestId(USER_DETAILS_RELATED_HOSTS_LINK_TEST_ID)).not.toBeInTheDocument(); + expect(getByTestId(USER_DETAILS_RELATED_HOSTS_LINK_TEST_ID)).toBeInTheDocument(); }); it('should render host risk score column when license is valid', () => { @@ -274,8 +268,7 @@ describe('<UserDetails />', () => { ); }); - it('should render host name and ip as clicable link when preview is enabled', () => { - mockUseIsExperimentalFeatureEnabled.mockReturnValue(false); + it('should render host name and ip as clicable link', () => { const { getAllByTestId } = renderUserDetails(mockContextValue); expect(getAllByTestId(USER_DETAILS_RELATED_HOSTS_LINK_TEST_ID).length).toBe(1); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/user_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/user_details.tsx similarity index 92% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/components/user_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/user_details.tsx index e88cbb54f9471..00366a367a81f 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/user_details.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/user_details.tsx @@ -25,14 +25,12 @@ import type { EuiBasicTableColumn } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; import { ExpandablePanel } from '../../../shared/components/expandable_panel'; import type { RelatedHost } from '../../../../../common/search_strategy/security_solution/related_entities/related_hosts'; import type { RiskSeverity } from '../../../../../common/search_strategy'; import { UserOverview } from '../../../../overview/components/user_overview'; import { AnomalyTableProvider } from '../../../../common/components/ml/anomaly/anomaly_table_provider'; import { InspectButton, InspectButtonContainer } from '../../../../common/components/inspect'; -import { NetworkDetailsLink } from '../../../../common/components/links'; import { RiskScoreEntity } from '../../../../../common/search_strategy'; import { RiskScoreLevel } from '../../../../entity_analytics/components/severity/common'; import { DefaultFieldRenderer } from '../../../../timelines/components/field_renderers/default_renderer'; @@ -109,7 +107,6 @@ export const UserDetails: React.FC<UserDetailsProps> = ({ userName, timestamp, s const isEntityAnalyticsAuthorized = isPlatinumOrTrialLicense && hasEntityAnalyticsCapability; const { openPreviewPanel } = useExpandableFlyoutApi(); - const isPreviewEnabled = !useIsExperimentalFeatureEnabled('entityAlertPreviewDisabled'); const narrowDateRange = useCallback<NarrowDateRange>( (score, interval) => { @@ -175,16 +172,12 @@ export const UserDetails: React.FC<UserDetailsProps> = ({ userName, timestamp, s render: (host: string) => ( <EuiText grow={false} size="xs"> <CellActions field={HOST_NAME_FIELD_NAME} value={host}> - {isPreviewEnabled ? ( - <PreviewLink - field={HOST_NAME_FIELD_NAME} - value={host} - scopeId={scopeId} - data-test-subj={USER_DETAILS_RELATED_HOSTS_LINK_TEST_ID} - /> - ) : ( - <>{host}</> - )} + <PreviewLink + field={HOST_NAME_FIELD_NAME} + value={host} + scopeId={scopeId} + data-test-subj={USER_DETAILS_RELATED_HOSTS_LINK_TEST_ID} + /> </CellActions> </EuiText> ), @@ -207,15 +200,13 @@ export const UserDetails: React.FC<UserDetailsProps> = ({ userName, timestamp, s render={(ip) => ip == null ? ( getEmptyTagValue() - ) : isPreviewEnabled ? ( + ) : ( <PreviewLink field={HOST_IP_FIELD_NAME} value={ip} scopeId={scopeId} data-test-subj={USER_DETAILS_RELATED_HOSTS_IP_LINK_TEST_ID} /> - ) : ( - <NetworkDetailsLink ip={ip} /> ) } scopeId={scopeId} @@ -241,7 +232,7 @@ export const UserDetails: React.FC<UserDetailsProps> = ({ userName, timestamp, s ] : []), ], - [isEntityAnalyticsAuthorized, scopeId, isPreviewEnabled] + [isEntityAnalyticsAuthorized, scopeId] ); const relatedHostsCount = useMemo( @@ -272,19 +263,14 @@ export const UserDetails: React.FC<UserDetailsProps> = ({ userName, timestamp, s }; const userLink = useMemo( - () => - isPreviewEnabled - ? { - callback: openUserPreview, - tooltip: i18n.translate( - 'xpack.securitySolution.flyout.left.insights.entities.user.userPreviewTitle', - { - defaultMessage: 'Preview user', - } - ), - } - : undefined, - [isPreviewEnabled, openUserPreview] + () => ({ + callback: openUserPreview, + tooltip: i18n.translate( + 'xpack.securitySolution.flyout.left.insights.entities.user.userPreviewTitle', + { defaultMessage: 'Preview user' } + ), + }), + [openUserPreview] ); return ( diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/content.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/content.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/header.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/header.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/hooks/use_fetch_alerts.test.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/hooks/use_fetch_alerts.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/hooks/use_fetch_alerts.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/hooks/use_fetch_alerts.test.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/hooks/use_fetch_alerts.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/hooks/use_fetch_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/hooks/use_fetch_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/hooks/use_fetch_alerts.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/hooks/use_paginated_alerts.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/hooks/use_paginated_alerts.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/hooks/use_paginated_alerts.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/hooks/use_paginated_alerts.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/hooks/use_pagination_and_sorting.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/hooks/use_pagination_and_sorting.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/hooks/use_pagination_and_sorting.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/hooks/use_pagination_and_sorting.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/hooks/use_response_actions_view.test.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/hooks/use_response_actions_view.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/hooks/use_response_actions_view.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/hooks/use_response_actions_view.test.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/hooks/use_response_actions_view.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/hooks/use_response_actions_view.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/hooks/use_response_actions_view.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/hooks/use_response_actions_view.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/hooks/use_threat_intelligence_details.test.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/hooks/use_threat_intelligence_details.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/hooks/use_threat_intelligence_details.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/hooks/use_threat_intelligence_details.test.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/hooks/use_threat_intelligence_details.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/hooks/use_threat_intelligence_details.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/hooks/use_threat_intelligence_details.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/hooks/use_threat_intelligence_details.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/index.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/mocks/indicator_with_nested_objects.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/mocks/indicator_with_nested_objects.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/mocks/indicator_with_nested_objects.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/mocks/indicator_with_nested_objects.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/services/find_alerts.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/services/find_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/services/find_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/services/find_alerts.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/tabs.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/insights_tab.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/tabs/insights_tab.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/insights_tab.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/tabs/insights_tab.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/investigation_tab.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/tabs/investigation_tab.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/investigation_tab.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/tabs/investigation_tab.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/notes_tab.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/tabs/notes_tab.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/notes_tab.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/tabs/notes_tab.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/response_tab.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/tabs/response_tab.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/response_tab.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/tabs/response_tab.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/tabs/test_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/test_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/tabs/test_ids.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/visualize_tab.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/tabs/visualize_tab.tsx similarity index 97% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/visualize_tab.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/tabs/visualize_tab.tsx index 89e00e06e3a49..1a8e5906e247e 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/visualize_tab.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/tabs/visualize_tab.tsx @@ -88,7 +88,8 @@ const graphVisualizationButton: EuiButtonGroupOptionProps = { * Visualize view displayed in the document details expandable flyout left section */ export const VisualizeTab = memo(() => { - const { scopeId, getFieldsData, dataAsNestedObject } = useDocumentDetailsContext(); + const { scopeId, getFieldsData, dataAsNestedObject, dataFormattedForFieldBrowser } = + useDocumentDetailsContext(); const { openPreviewPanel } = useExpandableFlyoutApi(); const panels = useExpandableFlyoutState(); const [activeVisualizationId, setActiveVisualizationId] = useState( @@ -123,6 +124,7 @@ export const VisualizeTab = memo(() => { const { hasGraphRepresentation } = useGraphPreview({ getFieldsData, ecsData: dataAsNestedObject, + dataFormattedForFieldBrowser, }); const isGraphFeatureEnabled = useIsExperimentalFeatureEnabled( diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/test_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/left/test_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/test_ids.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/preview/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/preview/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/preview/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/preview/constants.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/preview/footer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/preview/footer.test.tsx new file mode 100644 index 0000000000000..951d9916892f6 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/preview/footer.test.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. + */ +import React from 'react'; +import { render } from '@testing-library/react'; +import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; +import { TestProviders } from '../../../common/mock'; +import { DocumentDetailsRightPanelKey } from '../shared/constants/panel_keys'; +import { mockFlyoutApi } from '../shared/mocks/mock_flyout_context'; +import { mockContextValue } from '../shared/mocks/mock_context'; +import { DocumentDetailsContext } from '../shared/context'; +import { PreviewPanelFooter } from './footer'; +import { PREVIEW_FOOTER_TEST_ID, PREVIEW_FOOTER_LINK_TEST_ID } from './test_ids'; +import { FLYOUT_FOOTER_DROPDOWN_BUTTON_TEST_ID } from '../shared/components/test_ids'; +import { createTelemetryServiceMock } from '../../../common/lib/telemetry/telemetry_service.mock'; +import { useKibana } from '../../../common/lib/kibana'; +import { useAlertExceptionActions } from '../../../detections/components/alerts_table/timeline_actions/use_add_exception_actions'; +import { useInvestigateInTimeline } from '../../../detections/components/alerts_table/timeline_actions/use_investigate_in_timeline'; +import { useAddToCaseActions } from '../../../detections/components/alerts_table/timeline_actions/use_add_to_case_actions'; + +jest.mock('@kbn/expandable-flyout'); +jest.mock('react-router-dom', () => { + const original = jest.requireActual('react-router-dom'); + return { + ...original, + useLocation: jest.fn().mockReturnValue({ search: '' }), + }; +}); + +jest.mock('../../../common/lib/kibana'); +jest.mock('../../../detections/components/alerts_table/timeline_actions/use_add_exception_actions'); +jest.mock( + '../../../detections/components/alerts_table/timeline_actions/use_investigate_in_timeline' +); +jest.mock('../../../detections/components/alerts_table/timeline_actions/use_add_to_case_actions'); + +const mockedTelemetry = createTelemetryServiceMock(); + +describe('<PreviewPanelFooter />', () => { + beforeEach(() => { + jest.mocked(useExpandableFlyoutApi).mockReturnValue(mockFlyoutApi); + (useKibana as jest.Mock).mockReturnValue({ + services: { + osquery: { isOsqueryAvailable: jest.fn() }, + telemetry: mockedTelemetry, + cases: { hooks: { useIsAddToCaseOpen: jest.fn().mockReturnValue(false) } }, + }, + }); + (useAlertExceptionActions as jest.Mock).mockReturnValue({ exceptionActionItems: [] }); + (useInvestigateInTimeline as jest.Mock).mockReturnValue({ + investigateInTimelineActionItems: [], + }); + (useAddToCaseActions as jest.Mock).mockReturnValue({ addToCaseActionItems: [] }); + }); + + it('should not render the take action dropdown if preview mode', () => { + const { queryByTestId } = render( + <TestProviders> + <DocumentDetailsContext.Provider value={{ ...mockContextValue, isPreview: true }}> + <PreviewPanelFooter /> + </DocumentDetailsContext.Provider> + </TestProviders> + ); + + expect(queryByTestId(PREVIEW_FOOTER_TEST_ID)).not.toBeInTheDocument(); + }); + + it('should render footer for alert', () => { + const { getByTestId } = render( + <TestProviders> + <DocumentDetailsContext.Provider value={mockContextValue}> + <PreviewPanelFooter /> + </DocumentDetailsContext.Provider> + </TestProviders> + ); + expect(getByTestId(PREVIEW_FOOTER_TEST_ID)).toBeInTheDocument(); + expect(getByTestId(PREVIEW_FOOTER_LINK_TEST_ID)).toHaveTextContent('Show full alert details'); + }); + + it('should render footer for event', () => { + const { getByTestId } = render( + <TestProviders> + <DocumentDetailsContext.Provider + value={{ ...mockContextValue, getFieldsData: () => 'event' }} + > + <PreviewPanelFooter /> + </DocumentDetailsContext.Provider> + </TestProviders> + ); + expect(getByTestId(PREVIEW_FOOTER_LINK_TEST_ID)).toHaveTextContent('Show full event details'); + }); + + it('should render the take action button', () => { + (useInvestigateInTimeline as jest.Mock).mockReturnValue({ + investigateInTimelineActionItems: [{ name: 'test', onClick: jest.fn() }], + }); + const { getByTestId } = render( + <TestProviders> + <DocumentDetailsContext.Provider value={mockContextValue}> + <PreviewPanelFooter /> + </DocumentDetailsContext.Provider> + </TestProviders> + ); + expect(getByTestId(FLYOUT_FOOTER_DROPDOWN_BUTTON_TEST_ID)).toBeInTheDocument(); + }); + + it('should open document details flyout when clicked', () => { + const { getByTestId } = render( + <TestProviders> + <DocumentDetailsContext.Provider value={mockContextValue}> + <PreviewPanelFooter /> + </DocumentDetailsContext.Provider> + </TestProviders> + ); + + getByTestId(PREVIEW_FOOTER_LINK_TEST_ID).click(); + expect(mockFlyoutApi.openFlyout).toHaveBeenCalledWith({ + right: { + id: DocumentDetailsRightPanelKey, + params: { + id: mockContextValue.eventId, + indexName: mockContextValue.indexName, + scopeId: mockContextValue.scopeId, + }, + }, + }); + }); +}); diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/preview/footer.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/preview/footer.tsx new file mode 100644 index 0000000000000..1f05e368920f9 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/preview/footer.tsx @@ -0,0 +1,84 @@ +/* + * 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 { FC } from 'react'; +import React, { useCallback, useMemo } from 'react'; +import { EuiLink, EuiFlyoutFooter, EuiPanel, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; +import { TakeActionButton } from '../shared/components/take_action_button'; +import { getField } from '../shared/utils'; +import { EventKind } from '../shared/constants/event_kinds'; +import { DocumentDetailsRightPanelKey } from '../shared/constants/panel_keys'; +import { useDocumentDetailsContext } from '../shared/context'; +import { PREVIEW_FOOTER_TEST_ID, PREVIEW_FOOTER_LINK_TEST_ID } from './test_ids'; +import { useKibana } from '../../../common/lib/kibana'; +import { DocumentEventTypes } from '../../../common/lib/telemetry'; + +/** + * Footer at the bottom of preview panel with a link to open document details flyout + */ +export const PreviewPanelFooter: FC = () => { + const { eventId, indexName, scopeId, getFieldsData, isPreview } = useDocumentDetailsContext(); + const { openFlyout } = useExpandableFlyoutApi(); + const { telemetry } = useKibana().services; + + const isAlert = useMemo( + () => getField(getFieldsData('event.kind')) === EventKind.signal, + [getFieldsData] + ); + + const openDocumentFlyout = useCallback(() => { + openFlyout({ + right: { + id: DocumentDetailsRightPanelKey, + params: { + id: eventId, + indexName, + scopeId, + }, + }, + }); + telemetry.reportEvent(DocumentEventTypes.DetailsFlyoutOpened, { + location: scopeId, + panel: 'right', + }); + }, [openFlyout, eventId, indexName, scopeId, telemetry]); + + const fullDetailsLink = useMemo( + () => ( + <EuiLink + onClick={openDocumentFlyout} + target="_blank" + data-test-subj={PREVIEW_FOOTER_LINK_TEST_ID} + > + <> + {i18n.translate('xpack.securitySolution.flyout.preview.openFlyoutLabel', { + values: { isAlert }, + defaultMessage: 'Show full {isAlert, select, true{alert} other{event}} details', + })} + </> + </EuiLink> + ), + [isAlert, openDocumentFlyout] + ); + + if (isPreview) return null; + + return ( + <EuiFlyoutFooter data-test-subj={PREVIEW_FOOTER_TEST_ID}> + <EuiPanel color="transparent"> + <EuiFlexGroup justifyContent="flexEnd" alignItems="center"> + <EuiFlexItem grow={false}>{fullDetailsLink}</EuiFlexItem> + <EuiFlexItem grow={false}> + <TakeActionButton /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiPanel> + </EuiFlyoutFooter> + ); +}; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/preview/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/preview/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/preview/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/preview/index.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/preview/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/preview/test_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/preview/test_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/preview/test_ids.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/about_section.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/about_section.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/about_section.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/about_section.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/about_section.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/about_section.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/about_section.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/about_section.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/alert_description.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/alert_description.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/alert_description.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/alert_description.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/alert_description.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/alert_description.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/alert_description.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/alert_description.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/alert_header_block.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/alert_header_block.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/alert_header_block.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/alert_header_block.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/alert_header_block.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/alert_header_block.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/alert_header_block.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/alert_header_block.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/alert_header_title.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/alert_header_title.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/alert_header_title.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/alert_header_title.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/alert_header_title.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/alert_header_title.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/alert_header_title.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/alert_header_title.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/analyzer_preview.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/analyzer_preview.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/analyzer_preview.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/analyzer_preview.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/analyzer_preview.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/analyzer_preview.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/analyzer_preview.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/analyzer_preview.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/analyzer_preview_container.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/analyzer_preview_container.test.tsx new file mode 100644 index 0000000000000..8b12d95a25c6a --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/analyzer_preview_container.test.tsx @@ -0,0 +1,344 @@ +/* + * 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 { render, screen } from '@testing-library/react'; +import { TestProviders } from '../../../../common/mock'; +import React from 'react'; +import { DocumentDetailsContext } from '../../shared/context'; +import { mockContextValue } from '../../shared/mocks/mock_context'; +import { AnalyzerPreviewContainer } from './analyzer_preview_container'; +import { useIsInvestigateInResolverActionEnabled } from '../../../../detections/components/alerts_table/timeline_actions/investigate_in_resolver'; +import { ANALYZER_PREVIEW_TEST_ID } from './test_ids'; +import { useAlertPrevalenceFromProcessTree } from '../../shared/hooks/use_alert_prevalence_from_process_tree'; +import * as mock from '../mocks/mock_analyzer_data'; +import { + EXPANDABLE_PANEL_CONTENT_TEST_ID, + EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID, + EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID, + EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID, + EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID, +} from '../../../shared/components/test_ids'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; +import { useInvestigateInTimeline } from '../../../../detections/components/alerts_table/timeline_actions/use_investigate_in_timeline'; + +jest.mock( + '../../../../detections/components/alerts_table/timeline_actions/investigate_in_resolver' +); +jest.mock('../../shared/hooks/use_alert_prevalence_from_process_tree'); +jest.mock( + '../../../../detections/components/alerts_table/timeline_actions/use_investigate_in_timeline' +); +jest.mock('../../../../common/hooks/use_experimental_features'); + +const mockNavigateToAnalyzer = jest.fn(); +jest.mock('../../shared/hooks/use_navigate_to_analyzer', () => { + return { useNavigateToAnalyzer: () => ({ navigateToAnalyzer: mockNavigateToAnalyzer }) }; +}); + +jest.mock('@kbn/kibana-react-plugin/public', () => { + const original = jest.requireActual('@kbn/kibana-react-plugin/public'); + return { + ...original, + useUiSetting$: () => mockUseUiSetting(), + }; +}); + +jest.mock('react-router-dom', () => { + const actual = jest.requireActual('react-router-dom'); + return { ...actual, useLocation: jest.fn().mockReturnValue({ pathname: '' }) }; +}); +jest.mock('react-redux', () => { + const original = jest.requireActual('react-redux'); + + return { + ...original, + useDispatch: () => jest.fn(), + }; +}); + +const mockUseUiSetting = jest.fn().mockReturnValue([false]); +jest.mock('@kbn/kibana-react-plugin/public', () => { + const original = jest.requireActual('@kbn/kibana-react-plugin/public'); + return { + ...original, + useUiSetting$: () => mockUseUiSetting(), + }; +}); + +const NO_ANALYZER_MESSAGE = + 'You can only visualize events triggered by hosts configured with the Elastic Defend integration or any sysmon data from winlogbeat. Refer to Visual event analyzer(external, opens in a new tab or window) for more information.'; + +const renderAnalyzerPreview = (context = mockContextValue) => + render( + <TestProviders> + <DocumentDetailsContext.Provider value={context}> + <AnalyzerPreviewContainer /> + </DocumentDetailsContext.Provider> + </TestProviders> + ); + +describe('AnalyzerPreviewContainer', () => { + beforeEach(() => { + jest.clearAllMocks(); + (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(false); + }); + + it('should render component and link in header', () => { + (useIsInvestigateInResolverActionEnabled as jest.Mock).mockReturnValue(true); + (useAlertPrevalenceFromProcessTree as jest.Mock).mockReturnValue({ + loading: false, + error: false, + alertIds: ['alertid'], + statsNodes: mock.mockStatsNodes, + }); + (useInvestigateInTimeline as jest.Mock).mockReturnValue({ + investigateInTimelineAlertClick: jest.fn(), + }); + + const { getByTestId } = renderAnalyzerPreview(); + + expect(getByTestId(ANALYZER_PREVIEW_TEST_ID)).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + screen.queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + screen.getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + screen.getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + screen.queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + screen.getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) + ).not.toHaveTextContent(NO_ANALYZER_MESSAGE); + }); + + it('should render error message and text in header', () => { + (useIsInvestigateInResolverActionEnabled as jest.Mock).mockReturnValue(false); + (useInvestigateInTimeline as jest.Mock).mockReturnValue({ + investigateInTimelineAlertClick: jest.fn(), + }); + + const { getByTestId } = renderAnalyzerPreview(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) + ).toHaveTextContent(NO_ANALYZER_MESSAGE); + }); + + describe('when visualizationInFlyoutEnabled is disabled', () => { + it('should navigate to analyzer in timeline when clicking on title', () => { + (useIsInvestigateInResolverActionEnabled as jest.Mock).mockReturnValue(true); + (useAlertPrevalenceFromProcessTree as jest.Mock).mockReturnValue({ + loading: false, + error: false, + alertIds: ['alertid'], + statsNodes: mock.mockStatsNodes, + }); + (useInvestigateInTimeline as jest.Mock).mockReturnValue({ + investigateInTimelineAlertClick: jest.fn(), + }); + + const { getByTestId } = renderAnalyzerPreview(); + + const { investigateInTimelineAlertClick } = useInvestigateInTimeline({}); + + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(ANALYZER_PREVIEW_TEST_ID)).click(); + expect(investigateInTimelineAlertClick).toHaveBeenCalled(); + }); + + it('should not navigate to analyzer when in preview and clicking on title', () => { + (useIsInvestigateInResolverActionEnabled as jest.Mock).mockReturnValue(true); + (useAlertPrevalenceFromProcessTree as jest.Mock).mockReturnValue({ + loading: false, + error: false, + alertIds: ['alertid'], + statsNodes: mock.mockStatsNodes, + }); + (useInvestigateInTimeline as jest.Mock).mockReturnValue({ + investigateInTimelineAlertClick: jest.fn(), + }); + + const { queryByTestId } = renderAnalyzerPreview({ ...mockContextValue, isPreview: true }); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + const { investigateInTimelineAlertClick } = useInvestigateInTimeline({}); + expect(investigateInTimelineAlertClick).not.toHaveBeenCalled(); + }); + + it('should not navigate to analyzer when in preview mode', () => { + (useIsInvestigateInResolverActionEnabled as jest.Mock).mockReturnValue(true); + (useAlertPrevalenceFromProcessTree as jest.Mock).mockReturnValue({ + loading: false, + error: false, + alertIds: ['alertid'], + statsNodes: mock.mockStatsNodes, + }); + (useInvestigateInTimeline as jest.Mock).mockReturnValue({ + investigateInTimelineAlertClick: jest.fn(), + }); + + const { queryByTestId } = renderAnalyzerPreview({ ...mockContextValue, isPreviewMode: true }); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + const { investigateInTimelineAlertClick } = useInvestigateInTimeline({}); + expect(investigateInTimelineAlertClick).not.toHaveBeenCalled(); + }); + }); + + describe('when visualizationInFlyoutEnabled is enabled', () => { + it('should open left flyout visualization tab when clicking on title', () => { + mockUseUiSetting.mockReturnValue([true]); + + (useIsInvestigateInResolverActionEnabled as jest.Mock).mockReturnValue(true); + (useAlertPrevalenceFromProcessTree as jest.Mock).mockReturnValue({ + loading: false, + error: false, + alertIds: ['alertid'], + statsNodes: mock.mockStatsNodes, + }); + (useInvestigateInTimeline as jest.Mock).mockReturnValue({ + investigateInTimelineAlertClick: jest.fn(), + }); + + const { getByTestId } = renderAnalyzerPreview(); + + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(ANALYZER_PREVIEW_TEST_ID)).click(); + expect(mockNavigateToAnalyzer).toHaveBeenCalled(); + }); + + it('should disable link when in rule preview', () => { + mockUseUiSetting.mockReturnValue([true]); + (useIsInvestigateInResolverActionEnabled as jest.Mock).mockReturnValue(true); + (useAlertPrevalenceFromProcessTree as jest.Mock).mockReturnValue({ + loading: false, + error: false, + alertIds: ['alertid'], + statsNodes: mock.mockStatsNodes, + }); + (useInvestigateInTimeline as jest.Mock).mockReturnValue({ + investigateInTimelineAlertClick: jest.fn(), + }); + + const { queryByTestId } = renderAnalyzerPreview({ ...mockContextValue, isPreview: true }); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + }); + + it('should disable link when in preview mode', () => { + mockUseUiSetting.mockReturnValue([true]); + (useIsInvestigateInResolverActionEnabled as jest.Mock).mockReturnValue(true); + (useAlertPrevalenceFromProcessTree as jest.Mock).mockReturnValue({ + loading: false, + error: false, + alertIds: ['alertid'], + statsNodes: mock.mockStatsNodes, + }); + (useInvestigateInTimeline as jest.Mock).mockReturnValue({ + investigateInTimelineAlertClick: jest.fn(), + }); + + const { queryByTestId } = renderAnalyzerPreview({ ...mockContextValue, isPreviewMode: true }); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + }); + }); + + describe('when new navigation is enabled', () => { + beforeEach(() => { + (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(true); + }); + describe('when visualizationInFlyoutEnabled is enabled', () => { + beforeEach(() => { + mockUseUiSetting.mockReturnValue([true]); + (useIsInvestigateInResolverActionEnabled as jest.Mock).mockReturnValue(true); + (useAlertPrevalenceFromProcessTree as jest.Mock).mockReturnValue({ + loading: false, + error: false, + alertIds: ['alertid'], + statsNodes: mock.mockStatsNodes, + }); + (useInvestigateInTimeline as jest.Mock).mockReturnValue({ + investigateInTimelineAlertClick: jest.fn(), + }); + }); + it('should open left flyout visualization tab when clicking on title', () => { + const { getByTestId } = renderAnalyzerPreview(); + + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(ANALYZER_PREVIEW_TEST_ID)).click(); + expect(mockNavigateToAnalyzer).toHaveBeenCalled(); + }); + + it('should disable link when in rule preview', () => { + const { queryByTestId } = renderAnalyzerPreview({ ...mockContextValue, isPreview: true }); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + }); + + it('should render link when in preview mode', () => { + const { getByTestId } = renderAnalyzerPreview({ ...mockContextValue, isPreviewMode: true }); + + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(ANALYZER_PREVIEW_TEST_ID)).click(); + expect(mockNavigateToAnalyzer).toHaveBeenCalled(); + }); + }); + + describe('when visualizationInFlyoutEnabled is disabled', () => { + beforeEach(() => { + mockUseUiSetting.mockReturnValue([false]); + (useIsInvestigateInResolverActionEnabled as jest.Mock).mockReturnValue(true); + (useAlertPrevalenceFromProcessTree as jest.Mock).mockReturnValue({ + loading: false, + error: false, + alertIds: ['alertid'], + statsNodes: mock.mockStatsNodes, + }); + (useInvestigateInTimeline as jest.Mock).mockReturnValue({ + investigateInTimelineAlertClick: jest.fn(), + }); + }); + it('should navigate to analyzer in timeline when clicking on title', () => { + const { getByTestId } = renderAnalyzerPreview(); + const { investigateInTimelineAlertClick } = useInvestigateInTimeline({}); + + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(ANALYZER_PREVIEW_TEST_ID)).click(); + expect(investigateInTimelineAlertClick).toHaveBeenCalled(); + }); + + it('should not navigate to analyzer when in preview and clicking on title', () => { + const { queryByTestId } = renderAnalyzerPreview({ ...mockContextValue, isPreview: true }); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(ANALYZER_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + const { investigateInTimelineAlertClick } = useInvestigateInTimeline({}); + expect(investigateInTimelineAlertClick).not.toHaveBeenCalled(); + }); + + it('should open analyzer in timelinewhen in preview mode', () => { + const { getByTestId } = renderAnalyzerPreview({ + ...mockContextValue, + isPreviewMode: true, + }); + const { investigateInTimelineAlertClick } = useInvestigateInTimeline({}); + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(ANALYZER_PREVIEW_TEST_ID)).click(); + expect(investigateInTimelineAlertClick).toHaveBeenCalled(); + }); + }); + }); +}); diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/analyzer_preview_container.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/analyzer_preview_container.tsx new file mode 100644 index 0000000000000..1d11e8fb19951 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/analyzer_preview_container.tsx @@ -0,0 +1,150 @@ +/* + * 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, useMemo } from 'react'; +import { useDispatch } from 'react-redux'; +import { TimelineTabs } from '@kbn/securitysolution-data-table'; +import { EuiLink, EuiMark } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { useUiSetting$ } from '@kbn/kibana-react-plugin/public'; +import { ENABLE_VISUALIZATIONS_IN_FLYOUT_SETTING } from '../../../../../common/constants'; +import { useStartTransaction } from '../../../../common/lib/apm/use_start_transaction'; +import { useInvestigateInTimeline } from '../../../../detections/components/alerts_table/timeline_actions/use_investigate_in_timeline'; +import { ALERTS_ACTIONS } from '../../../../common/lib/apm/user_actions'; +import { getScopedActions } from '../../../../helpers'; +import { setActiveTabTimeline } from '../../../../timelines/store/actions'; +import { useDocumentDetailsContext } from '../../shared/context'; +import { useIsInvestigateInResolverActionEnabled } from '../../../../detections/components/alerts_table/timeline_actions/investigate_in_resolver'; +import { AnalyzerPreview } from './analyzer_preview'; +import { ANALYZER_PREVIEW_TEST_ID } from './test_ids'; +import { useNavigateToAnalyzer } from '../../shared/hooks/use_navigate_to_analyzer'; +import { ExpandablePanel } from '../../../shared/components/expandable_panel'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; + +const timelineId = 'timeline-1'; + +/** + * Analyzer preview under Overview, Visualizations. It shows a tree representation of analyzer. + */ +export const AnalyzerPreviewContainer: React.FC = () => { + const { dataAsNestedObject, isPreview, eventId, indexName, scopeId, isPreviewMode } = + useDocumentDetailsContext(); + + const [visualizationInFlyoutEnabled] = useUiSetting$<boolean>( + ENABLE_VISUALIZATIONS_IN_FLYOUT_SETTING + ); + const isNewNavigationEnabled = useIsExperimentalFeatureEnabled( + 'newExpandableFlyoutNavigationEnabled' + ); + // decide whether to show the analyzer preview or not + const isEnabled = useIsInvestigateInResolverActionEnabled(dataAsNestedObject); + + const dispatch = useDispatch(); + const { startTransaction } = useStartTransaction(); + const { investigateInTimelineAlertClick } = useInvestigateInTimeline({ + ecsRowData: dataAsNestedObject, + }); + + // open timeline to the analyzer tab because the expandable flyout left panel Visualize => Analyzer tab is not ready + const goToAnalyzerTab = useCallback(async () => { + // open timeline + await investigateInTimelineAlertClick(); + + // open analyzer tab + startTransaction({ name: ALERTS_ACTIONS.OPEN_ANALYZER }); + const scopedActions = getScopedActions(timelineId); + if (scopedActions && dataAsNestedObject) { + dispatch( + scopedActions.updateGraphEventId({ id: timelineId, graphEventId: dataAsNestedObject._id }) + ); + } + dispatch(setActiveTabTimeline({ id: timelineId, activeTab: TimelineTabs.graph })); + }, [dataAsNestedObject, dispatch, investigateInTimelineAlertClick, startTransaction]); + + const { navigateToAnalyzer } = useNavigateToAnalyzer({ + eventId, + indexName, + isFlyoutOpen: true, + scopeId, + isPreviewMode, + }); + + const iconType = useMemo(() => { + const icon = visualizationInFlyoutEnabled ? 'arrowStart' : 'timeline'; + return !isPreviewMode ? icon : undefined; + }, [visualizationInFlyoutEnabled, isPreviewMode]); + + const isNavigationEnabled = useMemo(() => { + // if the analyzer is not enabled or in rule preview mode, the navigation is not enabled + if (!isEnabled || isPreview) { + return false; + } + // if the new navigation is enabled, the navigation is enabled (flyout or timeline) + if (isNewNavigationEnabled) { + return true; + } + // if the new navigation is not enabled, the navigation is enabled if the flyout is not in preview mode + return !isPreviewMode; + }, [isNewNavigationEnabled, isPreviewMode, isEnabled, isPreview]); + + return ( + <ExpandablePanel + header={{ + title: ( + <FormattedMessage + id="xpack.securitySolution.flyout.right.visualizations.analyzerPreview.analyzerPreviewTitle" + defaultMessage="Analyzer preview" + /> + ), + iconType, + ...(isNavigationEnabled && { + link: { + callback: visualizationInFlyoutEnabled ? navigateToAnalyzer : goToAnalyzerTab, + tooltip: visualizationInFlyoutEnabled ? ( + <FormattedMessage + id="xpack.securitySolution.flyout.right.visualizations.analyzerPreview.analyzerPreviewOpenAnalyzerTooltip" + defaultMessage="Open analyzer graph" + /> + ) : ( + <FormattedMessage + id="xpack.securitySolution.flyout.right.visualizations.analyzerPreview.analyzerPreviewInvestigateTooltip" + defaultMessage="Investigate in timeline" + /> + ), + }, + }), + }} + data-test-subj={ANALYZER_PREVIEW_TEST_ID} + > + {isEnabled ? ( + <AnalyzerPreview /> + ) : ( + <FormattedMessage + id="xpack.securitySolution.flyout.right.visualizations.analyzerPreview.noDataDescription" + defaultMessage="You can only visualize events triggered by hosts configured with the Elastic Defend integration or any {sysmon} data from {winlogbeat}. Refer to {link} for more information." + values={{ + sysmon: <EuiMark>{'sysmon'}</EuiMark>, + winlogbeat: <EuiMark>{'winlogbeat'}</EuiMark>, + link: ( + <EuiLink + href="https://www.elastic.co/guide/en/security/current/visual-event-analyzer.html" + target="_blank" + > + <FormattedMessage + id="xpack.securitySolution.flyout.right.visualizations.analyzerPreview.noDataLinkText" + defaultMessage="Visual event analyzer" + /> + </EuiLink> + ), + }} + /> + )} + </ExpandablePanel> + ); +}; + +AnalyzerPreviewContainer.displayName = 'AnalyzerPreviewContainer'; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/assignees.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/assignees.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/assignees.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/assignees.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/assignees.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/assignees.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/assignees.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/assignees.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/correlations_overview.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/correlations_overview.test.tsx similarity index 86% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/correlations_overview.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/correlations_overview.test.tsx index ff8961a087801..fe8a2c9e7160b 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/correlations_overview.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/correlations_overview.test.tsx @@ -7,14 +7,9 @@ import React from 'react'; import { render } from '@testing-library/react'; -import type { ExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; import { DocumentDetailsContext } from '../../shared/context'; import { TestProviders } from '../../../../common/mock'; import { CorrelationsOverview } from './correlations_overview'; -import { CORRELATIONS_TAB_ID } from '../../left/components/correlations_details'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; -import { LeftPanelInsightsTab } from '../../left'; import { CORRELATIONS_RELATED_ALERTS_BY_ANCESTRY_TEST_ID, CORRELATIONS_RELATED_ALERTS_BY_SAME_SOURCE_EVENT_TEST_ID, @@ -35,6 +30,7 @@ import { useFetchRelatedAlertsBySameSourceEvent } from '../../shared/hooks/use_f import { useFetchRelatedAlertsBySession } from '../../shared/hooks/use_fetch_related_alerts_by_session'; import { useTimelineDataFilters } from '../../../../timelines/containers/use_timeline_data_filters'; import { useFetchRelatedCases } from '../../shared/hooks/use_fetch_related_cases'; +import { useNavigateToLeftPanel } from '../../shared/hooks/use_navigate_to_left_panel'; import { EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID, EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID, @@ -53,6 +49,7 @@ jest.mock('../../shared/hooks/use_fetch_related_alerts_by_session'); jest.mock('../../shared/hooks/use_fetch_related_alerts_by_ancestry'); jest.mock('../../shared/hooks/use_fetch_related_alerts_by_same_source_event'); jest.mock('../../shared/hooks/use_fetch_related_cases'); +jest.mock('../../shared/hooks/use_navigate_to_left_panel'); const TOGGLE_ICON_TEST_ID = EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(CORRELATIONS_TEST_ID); const TITLE_LINK_TEST_ID = EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(CORRELATIONS_TEST_ID); @@ -104,12 +101,6 @@ const renderCorrelationsOverview = (contextValue: DocumentDetailsContext) => ( const NO_DATA_MESSAGE = 'No correlations data available.'; -const flyoutContextValue = { - openLeftPanel: jest.fn(), -} as unknown as ExpandableFlyoutApi; - -jest.mock('@kbn/expandable-flyout'); - jest.mock('../../../../timelines/containers/use_timeline_data_filters', () => ({ useTimelineDataFilters: jest.fn(), })); @@ -120,10 +111,10 @@ jest.mock('../../../../common/components/guided_onboarding_tour', () => ({ })); const originalEventId = 'originalEventId'; +const mockNavigateToLeftPanel = jest.fn(); describe('<CorrelationsOverview />', () => { - beforeAll(() => { - jest.mocked(useExpandableFlyoutApi).mockReturnValue(flyoutContextValue); + beforeEach(() => { jest.mocked(useTourContext).mockReturnValue({ hidden: false, setAllTourStepsHidden: jest.fn(), @@ -133,10 +124,6 @@ describe('<CorrelationsOverview />', () => { isTourShown: jest.fn(), setStep: jest.fn(), }); - mockUseTimelineDataFilters.mockReturnValue({ selectedPatterns: ['index'] }); - }); - - it('should render wrapper component', () => { jest .mocked(useShowRelatedAlertsByAncestry) .mockReturnValue({ show: false, documentId: 'event-id' }); @@ -146,7 +133,14 @@ describe('<CorrelationsOverview />', () => { jest.mocked(useShowRelatedAlertsBySession).mockReturnValue({ show: false }); jest.mocked(useShowRelatedCases).mockReturnValue(false); jest.mocked(useShowSuppressedAlerts).mockReturnValue({ show: false, alertSuppressionCount: 0 }); + mockUseTimelineDataFilters.mockReturnValue({ selectedPatterns: ['index'] }); + (useNavigateToLeftPanel as jest.Mock).mockReturnValue({ + navigateToLeftPanel: mockNavigateToLeftPanel, + isEnabled: true, + }); + }); + it('should render wrapper component', () => { const { getByTestId, queryByTestId } = render(renderCorrelationsOverview(panelContextValue)); expect(queryByTestId(TOGGLE_ICON_TEST_ID)).not.toBeInTheDocument(); expect(getByTestId(TITLE_LINK_TEST_ID)).toBeInTheDocument(); @@ -154,23 +148,23 @@ describe('<CorrelationsOverview />', () => { expect(queryByTestId(TITLE_TEXT_TEST_ID)).not.toBeInTheDocument(); }); - it('should not render link when isPreviewMode is true', () => { - jest - .mocked(useShowRelatedAlertsByAncestry) - .mockReturnValue({ show: false, documentId: 'event-id' }); - jest - .mocked(useShowRelatedAlertsBySameSourceEvent) - .mockReturnValue({ show: false, originalEventId }); - jest.mocked(useShowRelatedAlertsBySession).mockReturnValue({ show: false }); - jest.mocked(useShowRelatedCases).mockReturnValue(false); - jest.mocked(useShowSuppressedAlerts).mockReturnValue({ show: false, alertSuppressionCount: 0 }); - + it('should render link without icon if in preview mode', () => { const { getByTestId, queryByTestId } = render( renderCorrelationsOverview({ ...panelContextValue, isPreviewMode: true }) ); + expect(getByTestId(TITLE_LINK_TEST_ID)).toBeInTheDocument(); + expect(queryByTestId(TITLE_ICON_TEST_ID)).not.toBeInTheDocument(); + }); + + it('should not render link when navigation is disabled', () => { + (useNavigateToLeftPanel as jest.Mock).mockReturnValue({ + navigateToLeftPanel: mockNavigateToLeftPanel, + isEnabled: false, + }); + + const { getByTestId, queryByTestId } = render(renderCorrelationsOverview(panelContextValue)); expect(queryByTestId(TOGGLE_ICON_TEST_ID)).not.toBeInTheDocument(); expect(queryByTestId(TITLE_LINK_TEST_ID)).not.toBeInTheDocument(); - expect(queryByTestId(TITLE_ICON_TEST_ID)).not.toBeInTheDocument(); expect(getByTestId(TITLE_TEXT_TEST_ID)).toBeInTheDocument(); }); @@ -261,15 +255,7 @@ describe('<CorrelationsOverview />', () => { ); getByTestId(TITLE_LINK_TEST_ID).click(); - expect(flyoutContextValue.openLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { tab: LeftPanelInsightsTab, subTab: CORRELATIONS_TAB_ID }, - params: { - id: panelContextValue.eventId, - indexName: panelContextValue.indexName, - scopeId: panelContextValue.scopeId, - }, - }); + expect(mockNavigateToLeftPanel).toHaveBeenCalled(); }); it('should navigate to the left section Insights tab automatically when active step is "view case"', () => { @@ -280,15 +266,6 @@ describe('<CorrelationsOverview />', () => { </DocumentDetailsContext.Provider> </TestProviders> ); - - expect(flyoutContextValue.openLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { tab: LeftPanelInsightsTab, subTab: CORRELATIONS_TAB_ID }, - params: { - id: panelContextValue.eventId, - indexName: panelContextValue.indexName, - scopeId: panelContextValue.scopeId, - }, - }); + expect(mockNavigateToLeftPanel).toHaveBeenCalled(); }); }); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/correlations_overview.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/correlations_overview.tsx similarity index 86% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/correlations_overview.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/correlations_overview.tsx index 4043230d5269e..9de274388a836 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/correlations_overview.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/correlations_overview.tsx @@ -6,12 +6,10 @@ */ import { get } from 'lodash'; -import React, { useCallback, useEffect, useMemo } from 'react'; +import React, { useEffect, useMemo } from 'react'; import { EuiFlexGroup } from '@elastic/eui'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; import { FormattedMessage } from '@kbn/i18n-react'; import { ALERT_RULE_TYPE } from '@kbn/rule-data-utils'; - import type { Type } from '@kbn/securitysolution-io-ts-alerting-types'; import { ExpandablePanel } from '../../../shared/components/expandable_panel'; import { useShowRelatedAlertsBySession } from '../../shared/hooks/use_show_related_alerts_by_session'; @@ -26,7 +24,6 @@ import { RelatedCases } from './related_cases'; import { useShowRelatedCases } from '../../shared/hooks/use_show_related_cases'; import { CORRELATIONS_TEST_ID } from './test_ids'; import { useDocumentDetailsContext } from '../../shared/context'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; import { LeftPanelInsightsTab } from '../../left'; import { CORRELATIONS_TAB_ID } from '../../left/components/correlations_details'; import { useTimelineDataFilters } from '../../../../timelines/containers/use_timeline_data_filters'; @@ -36,6 +33,7 @@ import { AlertsCasesTourSteps, SecurityStepId, } from '../../../../common/components/guided_onboarding_tour/tour_config'; +import { useNavigateToLeftPanel } from '../../shared/hooks/use_navigate_to_left_panel'; /** * Correlations section under Insights section, overview tab. @@ -43,34 +41,17 @@ import { * and the SummaryPanel component for data rendering. */ export const CorrelationsOverview: React.FC = () => { - const { - dataAsNestedObject, - eventId, - indexName, - getFieldsData, - scopeId, - isPreview, - isPreviewMode, - } = useDocumentDetailsContext(); - const { openLeftPanel } = useExpandableFlyoutApi(); + const { dataAsNestedObject, eventId, getFieldsData, scopeId, isPreview, isPreviewMode } = + useDocumentDetailsContext(); const { isTourShown, activeStep } = useTourContext(); const { selectedPatterns } = useTimelineDataFilters(isActiveTimeline(scopeId)); - const goToCorrelationsTab = useCallback(() => { - openLeftPanel({ - id: DocumentDetailsLeftPanelKey, - path: { - tab: LeftPanelInsightsTab, - subTab: CORRELATIONS_TAB_ID, - }, - params: { - id: eventId, - indexName, - scopeId, - }, + const { navigateToLeftPanel: goToCorrelationsTab, isEnabled: isLinkEnabled } = + useNavigateToLeftPanel({ + tab: LeftPanelInsightsTab, + subTab: CORRELATIONS_TAB_ID, }); - }, [eventId, openLeftPanel, indexName, scopeId]); useEffect(() => { if (isTourShown(SecurityStepId.alertsCases) && activeStep === AlertsCasesTourSteps.createCase) { @@ -105,7 +86,7 @@ export const CorrelationsOverview: React.FC = () => { const link = useMemo( () => - !isPreviewMode + isLinkEnabled ? { callback: goToCorrelationsTab, tooltip: ( @@ -116,7 +97,7 @@ export const CorrelationsOverview: React.FC = () => { ), } : undefined, - [isPreviewMode, goToCorrelationsTab] + [goToCorrelationsTab, isLinkEnabled] ); return ( diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/entities_overview.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/entities_overview.test.tsx similarity index 87% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/entities_overview.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/entities_overview.test.tsx index 92248c6de2828..e04acb5103ab9 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/entities_overview.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/entities_overview.test.tsx @@ -18,7 +18,7 @@ import { TestProviders } from '../../../../common/mock'; import { useFirstLastSeen } from '../../../../common/containers/use_first_last_seen'; import { useObservedUserDetails } from '../../../../explore/users/containers/users/observed_details'; import { useHostDetails } from '../../../../explore/hosts/containers/hosts/details'; -import { mockGetFieldsData } from '../../shared/mocks/mock_get_fields_data'; +import { mockContextValue } from '../../shared/mocks/mock_context'; import { EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID, EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID, @@ -26,11 +26,14 @@ import { EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID, } from '../../../shared/components/test_ids'; import { useRiskScore } from '../../../../entity_analytics/api/hooks/use_risk_score'; +import { useNavigateToLeftPanel } from '../../shared/hooks/use_navigate_to_left_panel'; const from = '2022-04-05T12:00:00.000Z'; const to = '2022-04-08T12:00:00.;000Z'; const selectedPatterns = 'alerts'; +jest.mock('../../shared/hooks/use_navigate_to_left_panel'); + const mockUseGlobalTime = jest.fn().mockReturnValue({ from, to }); jest.mock('../../../../common/containers/use_global_time', () => { return { @@ -62,12 +65,7 @@ const TITLE_LINK_TEST_ID = EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(INSIGHTS_E const TITLE_ICON_TEST_ID = EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(INSIGHTS_ENTITIES_TEST_ID); const TITLE_TEXT_TEST_ID = EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(INSIGHTS_ENTITIES_TEST_ID); -const mockContextValue = { - eventId: 'event id', - indexName: 'index', - scopeId: 'scopeId', - getFieldsData: mockGetFieldsData, -} as unknown as DocumentDetailsContext; +const mockNavigateToLeftPanel = jest.fn(); const renderEntitiesOverview = (contextValue: DocumentDetailsContext) => render( @@ -86,6 +84,10 @@ describe('<EntitiesOverview />', () => { mockUseRiskScore.mockReturnValue({ data: null, isAuthorized: false }); mockUseHostDetails.mockReturnValue([false, { hostDetails: null }]); mockUseFirstLastSeen.mockReturnValue([false, { lastSeen: null }]); + (useNavigateToLeftPanel as jest.Mock).mockReturnValue({ + navigateToLeftPanel: mockNavigateToLeftPanel, + isEnabled: true, + }); }); it('should render wrapper component', () => { const { getByTestId, queryByTestId } = renderEntitiesOverview(mockContextValue); @@ -97,15 +99,25 @@ describe('<EntitiesOverview />', () => { expect(queryByTestId(TITLE_TEXT_TEST_ID)).not.toBeInTheDocument(); }); - it('should not render link if isPreviewMode is true', () => { + it('should render link without icon if in preview mode', () => { const { getByTestId, queryByTestId } = renderEntitiesOverview({ ...mockContextValue, isPreviewMode: true, }); - expect(queryByTestId(TOGGLE_ICON_TEST_ID)).not.toBeInTheDocument(); - expect(queryByTestId(TITLE_LINK_TEST_ID)).not.toBeInTheDocument(); + expect(getByTestId(TITLE_LINK_TEST_ID)).toBeInTheDocument(); + expect(getByTestId(TITLE_LINK_TEST_ID)).toHaveTextContent('Entities'); expect(queryByTestId(TITLE_ICON_TEST_ID)).not.toBeInTheDocument(); + }); + + it('should not render link if navigation is disabled', () => { + (useNavigateToLeftPanel as jest.Mock).mockReturnValue({ + navigateToLeftPanel: mockNavigateToLeftPanel, + isEnabled: false, + }); + const { getByTestId, queryByTestId } = renderEntitiesOverview(mockContextValue); + + expect(queryByTestId(TITLE_LINK_TEST_ID)).not.toBeInTheDocument(); expect(getByTestId(TITLE_TEXT_TEST_ID)).toBeInTheDocument(); }); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/entities_overview.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/entities_overview.tsx similarity index 77% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/entities_overview.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/entities_overview.tsx index 16fe6cbe1c1e0..6e0de2b902ac4 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/entities_overview.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/entities_overview.tsx @@ -5,9 +5,8 @@ * 2.0. */ -import React, { useCallback, useMemo } from 'react'; +import React, { useMemo } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; import { FormattedMessage } from '@kbn/i18n-react'; import { INSIGHTS_ENTITIES_TEST_ID } from './test_ids'; import { ExpandablePanel } from '../../../shared/components/expandable_panel'; @@ -15,39 +14,28 @@ import { useDocumentDetailsContext } from '../../shared/context'; import { getField } from '../../shared/utils'; import { HostEntityOverview } from './host_entity_overview'; import { UserEntityOverview } from './user_entity_overview'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; import { LeftPanelInsightsTab } from '../../left'; import { ENTITIES_TAB_ID } from '../../left/components/entities_details'; +import { useNavigateToLeftPanel } from '../../shared/hooks/use_navigate_to_left_panel'; /** * Entities section under Insights section, overview tab. It contains a preview of host and user information. */ export const EntitiesOverview: React.FC = () => { - const { eventId, getFieldsData, indexName, scopeId, isPreviewMode } = useDocumentDetailsContext(); - const { openLeftPanel } = useExpandableFlyoutApi(); + const { getFieldsData, isPreviewMode } = useDocumentDetailsContext(); const hostName = getField(getFieldsData('host.name')); const userName = getField(getFieldsData('user.name')); - const goToEntitiesTab = useCallback(() => { - openLeftPanel({ - id: DocumentDetailsLeftPanelKey, - path: { - tab: LeftPanelInsightsTab, - subTab: ENTITIES_TAB_ID, - }, - params: { - id: eventId, - indexName, - scopeId, - }, - }); - }, [eventId, openLeftPanel, indexName, scopeId]); + const { navigateToLeftPanel, isEnabled: isLinkEnabled } = useNavigateToLeftPanel({ + tab: LeftPanelInsightsTab, + subTab: ENTITIES_TAB_ID, + }); const link = useMemo( () => - !isPreviewMode + isLinkEnabled ? { - callback: goToEntitiesTab, + callback: navigateToLeftPanel, tooltip: ( <FormattedMessage id="xpack.securitySolution.flyout.right.insights.entities.entitiesTooltip" @@ -56,7 +44,7 @@ export const EntitiesOverview: React.FC = () => { ), } : undefined, - [goToEntitiesTab, isPreviewMode] + [navigateToLeftPanel, isLinkEnabled] ); return ( diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/event_category_description.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/event_category_description.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/event_category_description.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/event_category_description.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/event_category_description.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/event_category_description.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/event_category_description.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/event_category_description.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/event_header_title.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/event_header_title.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/event_header_title.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/event_header_title.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/event_header_title.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/event_header_title.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/event_header_title.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/event_header_title.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/event_kind_description.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/event_kind_description.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/event_kind_description.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/event_kind_description.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/event_kind_description.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/event_kind_description.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/event_kind_description.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/event_kind_description.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/event_renderer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/event_renderer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/event_renderer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/event_renderer.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/event_renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/event_renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/event_renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/event_renderer.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/expandable_section.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/expandable_section.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/expandable_section.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/expandable_section.stories.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/expandable_section.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/expandable_section.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/expandable_section.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/expandable_section.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/expandable_section.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/expandable_section.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/expandable_section.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/expandable_section.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/graph_preview.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/graph_preview.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/graph_preview.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/graph_preview.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/graph_preview_container.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/graph_preview_container.test.tsx new file mode 100644 index 0000000000000..9965c5300e71f --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/graph_preview_container.test.tsx @@ -0,0 +1,441 @@ +/* + * 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 { render } from '@testing-library/react'; +import { useFetchGraphData } from '@kbn/cloud-security-posture-graph/src/hooks'; +import { TestProviders } from '../../../../common/mock'; +import React from 'react'; +import { DocumentDetailsContext } from '../../shared/context'; +import { mockContextValue } from '../../shared/mocks/mock_context'; +import { GraphPreviewContainer } from './graph_preview_container'; +import { GRAPH_PREVIEW_TEST_ID } from './test_ids'; +import { useGraphPreview } from '../../shared/hooks/use_graph_preview'; +import { + EXPANDABLE_PANEL_CONTENT_TEST_ID, + EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID, + EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID, + EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID, + EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID, +} from '../../../shared/components/test_ids'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; + +const mockUseUiSetting = jest.fn().mockReturnValue([true]); +jest.mock('@kbn/kibana-react-plugin/public', () => { + const original = jest.requireActual('@kbn/kibana-react-plugin/public'); + return { + ...original, + useUiSetting$: () => mockUseUiSetting(), + }; +}); + +jest.mock('../../../../common/hooks/use_experimental_features', () => ({ + useIsExperimentalFeatureEnabled: jest.fn(), +})); + +const useIsExperimentalFeatureEnabledMock = useIsExperimentalFeatureEnabled as jest.Mock; + +jest.mock('../../shared/hooks/use_graph_preview'); +jest.mock('@kbn/cloud-security-posture-graph/src/hooks', () => ({ + useFetchGraphData: jest.fn(), +})); +const mockUseFetchGraphData = useFetchGraphData as jest.Mock; + +const mockGraph = () => <div data-test-subj={GRAPH_PREVIEW_TEST_ID} />; + +jest.mock('@kbn/cloud-security-posture-graph', () => { + return { Graph: mockGraph }; +}); + +const renderGraphPreview = (context = mockContextValue) => + render( + <TestProviders> + <DocumentDetailsContext.Provider value={context}> + <GraphPreviewContainer /> + </DocumentDetailsContext.Provider> + </TestProviders> + ); + +const DEFAULT_NODES = [ + { + id: '1', + color: 'primary', + shape: 'ellipse', + }, +]; + +describe('<GraphPreviewContainer />', () => { + beforeEach(() => { + jest.clearAllMocks(); + useIsExperimentalFeatureEnabledMock.mockReturnValue(true); + }); + + it('should render component and link in header', async () => { + mockUseFetchGraphData.mockReturnValue({ + isLoading: false, + isError: false, + data: { nodes: DEFAULT_NODES, edges: [] }, + }); + + const timestamp = new Date().toISOString(); + + (useGraphPreview as jest.Mock).mockReturnValue({ + timestamp, + eventIds: [], + hasGraphRepresentation: true, + isAlert: true, + }); + + const { getByTestId, queryByTestId, findByTestId } = renderGraphPreview(); + + // Using findByTestId to wait for the component to be rendered because it is a lazy loaded component + expect(await findByTestId(GRAPH_PREVIEW_TEST_ID)).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect(mockUseFetchGraphData).toHaveBeenCalled(); + expect(mockUseFetchGraphData.mock.calls[0][0]).toEqual({ + req: { + query: { + originEventIds: [], + start: `${timestamp}||-30m`, + end: `${timestamp}||+30m`, + }, + }, + options: { + enabled: true, + refetchOnWindowFocus: false, + }, + }); + }); + + it('should render component for alert', async () => { + mockUseFetchGraphData.mockReturnValue({ + isLoading: false, + isError: false, + data: { nodes: DEFAULT_NODES, edges: [] }, + }); + + const timestamp = new Date().toISOString(); + + (useGraphPreview as jest.Mock).mockReturnValue({ + timestamp, + eventIds: ['eventId'], + isAlert: true, + hasGraphRepresentation: true, + }); + + const { getByTestId, queryByTestId, findByTestId } = renderGraphPreview(); + + // Using findByTestId to wait for the component to be rendered because it is a lazy loaded component + expect(await findByTestId(GRAPH_PREVIEW_TEST_ID)).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect(mockUseFetchGraphData).toHaveBeenCalled(); + expect(mockUseFetchGraphData.mock.calls[0][0]).toEqual({ + req: { + query: { + originEventIds: [{ id: 'eventId', isAlert: true }], + start: `${timestamp}||-30m`, + end: `${timestamp}||+30m`, + }, + }, + options: { + enabled: true, + refetchOnWindowFocus: false, + }, + }); + }); + + it('should render component for event', async () => { + mockUseFetchGraphData.mockReturnValue({ + isLoading: false, + isError: false, + data: { nodes: DEFAULT_NODES, edges: [] }, + }); + + const timestamp = new Date().toISOString(); + + (useGraphPreview as jest.Mock).mockReturnValue({ + timestamp, + eventIds: ['eventId'], + isAlert: false, + hasGraphRepresentation: true, + }); + + const { getByTestId, queryByTestId, findByTestId } = renderGraphPreview(); + + // Using findByTestId to wait for the component to be rendered because it is a lazy loaded component + expect(await findByTestId(GRAPH_PREVIEW_TEST_ID)).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect(mockUseFetchGraphData).toHaveBeenCalled(); + expect(mockUseFetchGraphData.mock.calls[0][0]).toEqual({ + req: { + query: { + originEventIds: [{ id: 'eventId', isAlert: false }], + start: `${timestamp}||-30m`, + end: `${timestamp}||+30m`, + }, + }, + options: { + enabled: true, + refetchOnWindowFocus: false, + }, + }); + }); + + it('should render component and without link in header in preview panel', async () => { + mockUseFetchGraphData.mockReturnValue({ + isLoading: false, + isError: false, + data: { nodes: DEFAULT_NODES, edges: [] }, + }); + + const timestamp = new Date().toISOString(); + + (useGraphPreview as jest.Mock).mockReturnValue({ + timestamp, + eventIds: [], + hasGraphRepresentation: true, + isAlert: true, + }); + + const { getByTestId, queryByTestId, findByTestId } = renderGraphPreview({ + ...mockContextValue, + isPreviewMode: true, + }); + + // Using findByTestId to wait for the component to be rendered because it is a lazy loaded component + expect(await findByTestId(GRAPH_PREVIEW_TEST_ID)).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect(mockUseFetchGraphData).toHaveBeenCalled(); + expect(mockUseFetchGraphData.mock.calls[0][0]).toEqual({ + req: { + query: { + originEventIds: [], + start: `${timestamp}||-30m`, + end: `${timestamp}||+30m`, + }, + }, + options: { + enabled: true, + refetchOnWindowFocus: false, + }, + }); + }); + + it('should render component and without link in header in rule preview', async () => { + mockUseFetchGraphData.mockReturnValue({ + isLoading: false, + isError: false, + data: { nodes: DEFAULT_NODES, edges: [] }, + }); + + const timestamp = new Date().toISOString(); + + (useGraphPreview as jest.Mock).mockReturnValue({ + timestamp, + eventIds: [], + hasGraphRepresentation: true, + isAlert: true, + }); + + const { getByTestId, queryByTestId, findByTestId } = renderGraphPreview({ + ...mockContextValue, + isPreview: true, + }); + + // Using findByTestId to wait for the component to be rendered because it is a lazy loaded component + expect(await findByTestId(GRAPH_PREVIEW_TEST_ID)).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect(mockUseFetchGraphData).toHaveBeenCalled(); + expect(mockUseFetchGraphData.mock.calls[0][0]).toEqual({ + req: { + query: { + originEventIds: [], + start: `${timestamp}||-30m`, + end: `${timestamp}||+30m`, + }, + }, + options: { + enabled: true, + refetchOnWindowFocus: false, + }, + }); + }); + + it('should render component and without link in header when expanding flyout feature is disabled', async () => { + mockUseUiSetting.mockReturnValue([false]); + mockUseFetchGraphData.mockReturnValue({ + isLoading: false, + isError: false, + data: { nodes: DEFAULT_NODES, edges: [] }, + }); + + const timestamp = new Date().toISOString(); + + (useGraphPreview as jest.Mock).mockReturnValue({ + timestamp, + eventIds: [], + hasGraphRepresentation: true, + isAlert: true, + }); + + const { getByTestId, queryByTestId, findByTestId } = renderGraphPreview(); + + // Using findByTestId to wait for the component to be rendered because it is a lazy loaded component + expect(await findByTestId(GRAPH_PREVIEW_TEST_ID)).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect(mockUseFetchGraphData).toHaveBeenCalled(); + expect(mockUseFetchGraphData.mock.calls[0][0]).toEqual({ + req: { + query: { + originEventIds: [], + start: `${timestamp}||-30m`, + end: `${timestamp}||+30m`, + }, + }, + options: { + enabled: true, + refetchOnWindowFocus: false, + }, + }); + }); + + it('should not render when graph data is not available', async () => { + mockUseFetchGraphData.mockReturnValue({ + isLoading: false, + isError: false, + data: undefined, + }); + + const timestamp = new Date().toISOString(); + + (useGraphPreview as jest.Mock).mockReturnValue({ + timestamp, + eventIds: [], + hasGraphRepresentation: false, + isAlert: true, + }); + + const { getByTestId, queryByTestId, findByTestId } = renderGraphPreview(); + + // Using findByTestId to wait for the component to be rendered because it is a lazy loaded component + expect( + await findByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect(mockUseFetchGraphData).toHaveBeenCalled(); + expect(mockUseFetchGraphData.mock.calls[0][0]).toEqual({ + req: { + query: { + originEventIds: [], + start: `${timestamp}||-30m`, + end: `${timestamp}||+30m`, + }, + }, + options: { + enabled: false, + refetchOnWindowFocus: false, + }, + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview_container.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/graph_preview_container.tsx similarity index 96% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview_container.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/graph_preview_container.tsx index 90a0218778549..b4626f93e823d 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview_container.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/graph_preview_container.tsx @@ -31,6 +31,7 @@ export const GraphPreviewContainer: React.FC = () => { scopeId, isPreview, isPreviewMode, + dataFormattedForFieldBrowser, } = useDocumentDetailsContext(); const [visualizationInFlyoutEnabled] = useUiSetting$<boolean>( @@ -49,16 +50,18 @@ export const GraphPreviewContainer: React.FC = () => { eventIds, timestamp = new Date().toISOString(), hasGraphRepresentation, + isAlert, } = useGraphPreview({ getFieldsData, ecsData: dataAsNestedObject, + dataFormattedForFieldBrowser, }); // TODO: default start and end might not capture the original event const { isLoading, isError, data } = useFetchGraphData({ req: { query: { - eventIds, + originEventIds: eventIds.map((id) => ({ id, isAlert })), start: `${timestamp}||-30m`, end: `${timestamp}||+30m`, }, diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/header_actions.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/header_actions.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/header_actions.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/header_actions.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/header_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/header_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/header_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/header_actions.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields_cell.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields_cell.test.tsx similarity index 80% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields_cell.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields_cell.test.tsx index ff003813f260d..e6f88498b2605 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields_cell.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields_cell.test.tsx @@ -14,11 +14,7 @@ import { } from './test_ids'; import { HighlightedFieldsCell } from './highlighted_fields_cell'; import { DocumentDetailsContext } from '../../shared/context'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; -import { LeftPanelInsightsTab } from '../../left'; import { TestProviders } from '../../../../common/mock'; -import { ENTITIES_TAB_ID } from '../../left/components/entities_details'; -import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; import { useGetAgentStatus } from '../../../../management/hooks/agents/use_get_agent_status'; import { mockFlyoutApi } from '../../shared/mocks/mock_flyout_context'; import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; @@ -47,9 +43,6 @@ jest.mock('../../../../common/lib/kibana', () => { const useGetAgentStatusMock = useGetAgentStatus as jest.Mock; -jest.mock('../../../../common/hooks/use_experimental_features'); -const mockUseIsExperimentalFeatureEnabled = useIsExperimentalFeatureEnabled as jest.Mock; - const panelContextValue = { eventId: 'event id', indexName: 'indexName', @@ -68,7 +61,6 @@ const renderHighlightedFieldsCell = (values: string[], field: string) => describe('<HighlightedFieldsCell />', () => { beforeAll(() => { jest.mocked(useExpandableFlyoutApi).mockReturnValue(mockFlyoutApi); - mockUseIsExperimentalFeatureEnabled.mockReturnValue(true); }); it('should render a basic cell', () => { @@ -83,23 +75,7 @@ describe('<HighlightedFieldsCell />', () => { expect(getByTestId(HIGHLIGHTED_FIELDS_BASIC_CELL_TEST_ID)).toBeInTheDocument(); }); - it('should open left panel when clicking on the link within a a link cell when preview is disabled', () => { - const { getByTestId } = renderHighlightedFieldsCell(['value'], 'user.name'); - - getByTestId(HIGHLIGHTED_FIELDS_LINKED_CELL_TEST_ID).click(); - expect(mockFlyoutApi.openLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { tab: LeftPanelInsightsTab, subTab: ENTITIES_TAB_ID }, - params: { - id: panelContextValue.eventId, - indexName: panelContextValue.indexName, - scopeId: panelContextValue.scopeId, - }, - }); - }); - - it('should open host preview when click on host when preview is not disabled', () => { - mockUseIsExperimentalFeatureEnabled.mockReturnValue(false); + it('should open host preview when click on host', () => { const { getByTestId } = renderHighlightedFieldsCell(['test host'], 'host.name'); expect(getByTestId(HIGHLIGHTED_FIELDS_LINKED_CELL_TEST_ID)).toBeInTheDocument(); @@ -114,8 +90,7 @@ describe('<HighlightedFieldsCell />', () => { }); }); - it('should open user preview when click on user when preview is not disabled', () => { - mockUseIsExperimentalFeatureEnabled.mockReturnValue(false); + it('should open user preview when click on user', () => { const { getByTestId } = renderHighlightedFieldsCell(['test user'], 'user.name'); expect(getByTestId(HIGHLIGHTED_FIELDS_LINKED_CELL_TEST_ID)).toBeInTheDocument(); @@ -130,8 +105,7 @@ describe('<HighlightedFieldsCell />', () => { }); }); - it('should open ip preview when click on ip when preview is not disabled', () => { - mockUseIsExperimentalFeatureEnabled.mockReturnValue(false); + it('should open ip preview when click on ip', () => { const { getByTestId } = renderHighlightedFieldsCell(['100:XXX:XXX'], 'source.ip'); expect(getByTestId(HIGHLIGHTED_FIELDS_LINKED_CELL_TEST_ID)).toBeInTheDocument(); @@ -204,6 +178,7 @@ describe('<HighlightedFieldsCell />', () => { expect(getByTestId(HIGHLIGHTED_FIELDS_AGENT_STATUS_CELL_TEST_ID)).toBeInTheDocument(); }); + it('should not render if values is null', () => { const { container } = render( <TestProviders> diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields_cell.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields_cell.tsx new file mode 100644 index 0000000000000..b6fc98653f896 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields_cell.tsx @@ -0,0 +1,84 @@ +/* + * 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 { FC } from 'react'; +import React, { useMemo } from 'react'; +import { EuiFlexItem } from '@elastic/eui'; +import { getAgentTypeForAgentIdField } from '../../../../common/lib/endpoint/utils/get_agent_type_for_agent_id_field'; +import type { ResponseActionAgentType } from '../../../../../common/endpoint/service/response_actions/constants'; +import { AgentStatus } from '../../../../common/components/endpoint/agents/agent_status'; +import { useDocumentDetailsContext } from '../../shared/context'; +import { AGENT_STATUS_FIELD_NAME } from '../../../../timelines/components/timeline/body/renderers/constants'; +import { + HIGHLIGHTED_FIELDS_AGENT_STATUS_CELL_TEST_ID, + HIGHLIGHTED_FIELDS_BASIC_CELL_TEST_ID, + HIGHLIGHTED_FIELDS_CELL_TEST_ID, + HIGHLIGHTED_FIELDS_LINKED_CELL_TEST_ID, +} from './test_ids'; +import { hasPreview, PreviewLink } from '../../../shared/components/preview_link'; + +export interface HighlightedFieldsCellProps { + /** + * Highlighted field's name used to know what component to display + */ + field: string; + /** + * Highlighted field's original name, when the field is overridden + */ + originalField?: string; + /** + * Highlighted field's value to display + */ + values: string[] | null | undefined; +} + +/** + * Renders a component in the highlighted fields table cell based on the field name + */ +export const HighlightedFieldsCell: FC<HighlightedFieldsCellProps> = ({ + values, + field, + originalField = '', +}) => { + const { scopeId } = useDocumentDetailsContext(); + + const agentType: ResponseActionAgentType = useMemo(() => { + return getAgentTypeForAgentIdField(originalField); + }, [originalField]); + + return ( + <> + {values != null && + values.map((value, i) => { + return ( + <EuiFlexItem + grow={false} + key={`${i}-${value}`} + data-test-subj={`${value}-${HIGHLIGHTED_FIELDS_CELL_TEST_ID}`} + > + {hasPreview(field) ? ( + <PreviewLink + field={field} + value={value} + scopeId={scopeId} + data-test-subj={HIGHLIGHTED_FIELDS_LINKED_CELL_TEST_ID} + /> + ) : field === AGENT_STATUS_FIELD_NAME ? ( + <AgentStatus + agentId={String(value ?? '')} + agentType={agentType} + data-test-subj={HIGHLIGHTED_FIELDS_AGENT_STATUS_CELL_TEST_ID} + /> + ) : ( + <span data-test-subj={HIGHLIGHTED_FIELDS_BASIC_CELL_TEST_ID}>{value}</span> + )} + </EuiFlexItem> + ); + })} + </> + ); +}; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/host_entity_overview.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/host_entity_overview.test.tsx similarity index 88% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/host_entity_overview.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/host_entity_overview.test.tsx index 4c29a84d431ae..0d98dccc91bfe 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/host_entity_overview.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/host_entity_overview.test.tsx @@ -26,11 +26,7 @@ import { DocumentDetailsContext } from '../../shared/context'; import { mockContextValue } from '../../shared/mocks/mock_context'; import { mockDataFormattedForFieldBrowser } from '../../shared/mocks/mock_data_formatted_for_field_browser'; import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; import { HostPreviewPanelKey } from '../../../entity_details/host_right'; -import { LeftPanelInsightsTab } from '../../left'; -import { ENTITIES_TAB_ID } from '../../left/components/entities_details'; import { useRiskScore } from '../../../../entity_analytics/api/hooks/use_risk_score'; import { mockFlyoutApi } from '../../shared/mocks/mock_flyout_context'; import { createTelemetryServiceMock } from '../../../../common/lib/telemetry/telemetry_service.mock'; @@ -86,9 +82,6 @@ jest.mock('../../../../common/lib/kibana', () => { }; }); -jest.mock('../../../../common/hooks/use_experimental_features'); -const mockUseIsExperimentalFeatureEnabled = useIsExperimentalFeatureEnabled as jest.Mock; - const mockUseGlobalTime = jest.fn().mockReturnValue({ from, to }); jest.mock('../../../../common/containers/use_global_time', () => { return { @@ -124,7 +117,6 @@ const renderHostEntityContent = () => describe('<HostEntityContent />', () => { beforeAll(() => { jest.mocked(useExpandableFlyoutApi).mockReturnValue(mockFlyoutApi); - mockUseIsExperimentalFeatureEnabled.mockReturnValue(true); (useMisconfigurationPreview as jest.Mock).mockReturnValue({}); (useVulnerabilitiesPreview as jest.Mock).mockReturnValue({}); (useAlertsByStatus as jest.Mock).mockReturnValue({ isLoading: false, items: {} }); @@ -204,28 +196,9 @@ describe('<HostEntityContent />', () => { expect(getByTestId(ENTITIES_HOST_OVERVIEW_LAST_SEEN_TEST_ID)).toHaveTextContent('—'); }); - it('should navigate to left panel entities tab when clicking on title when feature flag is off', () => { - mockUseHostDetails.mockReturnValue([false, { hostDetails: hostData }]); - mockUseRiskScore.mockReturnValue({ data: riskLevel, isAuthorized: true }); - - const { getByTestId } = renderHostEntityContent(); - - getByTestId(ENTITIES_HOST_OVERVIEW_LINK_TEST_ID).click(); - expect(mockFlyoutApi.openLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { tab: LeftPanelInsightsTab, subTab: ENTITIES_TAB_ID }, - params: { - id: panelContextValue.eventId, - indexName: panelContextValue.indexName, - scopeId: panelContextValue.scopeId, - }, - }); - }); - - it('should open host preview when clicking on title when feature flag is on', () => { + it('should open host preview when clicking on title', () => { mockUseHostDetails.mockReturnValue([false, { hostDetails: hostData }]); mockUseRiskScore.mockReturnValue({ data: riskLevel, isAuthorized: true }); - mockUseIsExperimentalFeatureEnabled.mockReturnValue(false); const { getByTestId } = renderHostEntityContent(); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/host_entity_overview.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/host_entity_overview.tsx similarity index 82% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/host_entity_overview.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/host_entity_overview.tsx index 9b60eefbb5f61..eb1ca093fbb03 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/host_entity_overview.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/host_entity_overview.tsx @@ -5,11 +5,10 @@ * 2.0. */ -import React, { useCallback, useMemo } from 'react'; +import React, { useMemo } from 'react'; import { EuiFlexGroup, EuiFlexItem, - EuiLink, EuiText, EuiIcon, useEuiTheme, @@ -19,8 +18,6 @@ import { import { css } from '@emotion/css'; import { getOr } from 'lodash/fp'; import { i18n } from '@kbn/i18n'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; import { HOST_NAME_FIELD_NAME } from '../../../../timelines/components/timeline/body/renderers/constants'; import { useRiskScore } from '../../../../entity_analytics/api/hooks/use_risk_score'; import { useDocumentDetailsContext } from '../../shared/context'; @@ -44,7 +41,6 @@ import { LAST_SEEN, HOST_RISK_LEVEL, } from '../../../../overview/components/host_overview/translations'; -import { ENTITIES_TAB_ID } from '../../left/components/entities_details'; import { ENTITIES_HOST_OVERVIEW_TEST_ID, ENTITIES_HOST_OVERVIEW_OS_FAMILY_TEST_ID, @@ -56,8 +52,6 @@ import { ENTITIES_HOST_OVERVIEW_MISCONFIGURATIONS_TEST_ID, ENTITIES_HOST_OVERVIEW_VULNERABILITIES_TEST_ID, } from './test_ids'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; -import { LeftPanelInsightsTab } from '../../left'; import { RiskScoreDocTooltip } from '../../../../overview/components/common'; import { PreviewLink } from '../../../shared/components/preview_link'; import { MisconfigurationsInsight } from '../../shared/components/misconfiguration_insight'; @@ -85,21 +79,7 @@ export const HOST_PREVIEW_BANNER = { * Host preview content for the entities preview in right flyout. It contains ip addresses and risk level */ export const HostEntityOverview: React.FC<HostEntityOverviewProps> = ({ hostName }) => { - const { eventId, indexName, scopeId } = useDocumentDetailsContext(); - const { openLeftPanel } = useExpandableFlyoutApi(); - const isPreviewEnabled = !useIsExperimentalFeatureEnabled('entityAlertPreviewDisabled'); - - const goToEntitiesTab = useCallback(() => { - openLeftPanel({ - id: DocumentDetailsLeftPanelKey, - path: { tab: LeftPanelInsightsTab, subTab: ENTITIES_TAB_ID }, - params: { - id: eventId, - indexName, - scopeId, - }, - }); - }, [eventId, openLeftPanel, indexName, scopeId]); + const { scopeId } = useDocumentDetailsContext(); const { from, to } = useGlobalTime(); const { selectedPatterns } = useSourcererDataView(); @@ -212,34 +192,21 @@ export const HostEntityOverview: React.FC<HostEntityOverviewProps> = ({ hostName <EuiIcon type={HOST_ICON} /> </EuiFlexItem> <EuiFlexItem grow={false}> - {isPreviewEnabled ? ( - <PreviewLink - field={HOST_NAME_FIELD_NAME} - value={hostName} - scopeId={scopeId} - data-test-subj={ENTITIES_HOST_OVERVIEW_LINK_TEST_ID} - > - <EuiText - css={css` - font-size: ${xsFontSize}; - font-weight: ${euiTheme.font.weight.bold}; - `} - > - {hostName} - </EuiText> - </PreviewLink> - ) : ( - <EuiLink - data-test-subj={ENTITIES_HOST_OVERVIEW_LINK_TEST_ID} + <PreviewLink + field={HOST_NAME_FIELD_NAME} + value={hostName} + scopeId={scopeId} + data-test-subj={ENTITIES_HOST_OVERVIEW_LINK_TEST_ID} + > + <EuiText css={css` font-size: ${xsFontSize}; font-weight: ${euiTheme.font.weight.bold}; `} - onClick={goToEntitiesTab} > {hostName} - </EuiLink> - )} + </EuiText> + </PreviewLink> </EuiFlexItem> </EuiFlexGroup> </EuiFlexItem> diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/insights_section.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/insights_section.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/insights_section.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/insights_section.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/insights_section.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/insights_section.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/insights_section.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/insights_section.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/insights_summary_row.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/insights_summary_row.test.tsx new file mode 100644 index 0000000000000..6f5b82200772d --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/insights_summary_row.test.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. + */ + +import React from 'react'; +import { render } from '@testing-library/react'; +import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; +import { InsightsSummaryRow } from './insights_summary_row'; +import { useNavigateToLeftPanel } from '../../shared/hooks/use_navigate_to_left_panel'; + +const mockNavigateToLeftPanel = jest.fn(); +jest.mock('../../shared/hooks/use_navigate_to_left_panel'); + +const testId = 'test'; +const textTestId = `${testId}Text`; +const buttonTestId = `${testId}Button`; +const valueTestId = `${testId}Value`; +const loadingTestId = `${testId}Loading`; + +describe('<InsightsSummaryRow />', () => { + beforeEach(() => { + jest.clearAllMocks(); + + (useNavigateToLeftPanel as jest.Mock).mockReturnValue({ + navigateToLeftPanel: mockNavigateToLeftPanel, + isEnabled: true, + }); + }); + + it('should render loading skeleton if loading is true', () => { + const { getByTestId } = render( + <InsightsSummaryRow + loading={true} + text={'text'} + value={<div>{'value for this'}</div>} + data-test-subj={testId} + /> + ); + + expect(getByTestId(loadingTestId)).toBeInTheDocument(); + }); + + it('should only render null when error is true', () => { + const { container } = render( + <InsightsSummaryRow error={true} text={'text'} value={<div>{'value for this'}</div>} /> + ); + + expect(container).toBeEmptyDOMElement(); + }); + + it('should render the value component', () => { + const { getByTestId, queryByTestId } = render( + <IntlProvider locale="en"> + <InsightsSummaryRow + text={'this is a test for red'} + value={<div>{'value for this'}</div>} + data-test-subj={testId} + /> + </IntlProvider> + ); + + expect(getByTestId(textTestId)).toHaveTextContent('this is a test for red'); + expect(getByTestId(valueTestId)).toHaveTextContent('value for this'); + expect(queryByTestId(buttonTestId)).not.toBeInTheDocument(); + }); + + it('should render the value as EuiBadge and EuiButtonEmpty', () => { + const { getByTestId, queryByTestId } = render( + <IntlProvider locale="en"> + <InsightsSummaryRow text={'this is a test for red'} value={2} data-test-subj={testId} /> + </IntlProvider> + ); + + expect(getByTestId(textTestId)).toHaveTextContent('this is a test for red'); + expect(getByTestId(buttonTestId)).toHaveTextContent('2'); + expect(queryByTestId(valueTestId)).not.toBeInTheDocument(); + }); + + it('should render big numbers formatted correctly', () => { + const { getByTestId } = render( + <IntlProvider locale="en"> + <InsightsSummaryRow text={'this is a test for red'} value={2000} data-test-subj={testId} /> + </IntlProvider> + ); + + expect(getByTestId(buttonTestId)).toHaveTextContent('2k'); + }); + + it('should open the expanded section to the correct tab when the number is clicked', () => { + const { getByTestId } = render( + <IntlProvider locale="en"> + <InsightsSummaryRow + text={'this is a test for red'} + value={2} + expandedSubTab={'subTab'} + data-test-subj={testId} + /> + </IntlProvider> + ); + getByTestId(buttonTestId).click(); + + expect(mockNavigateToLeftPanel).toHaveBeenCalled(); + }); + + it('should disabled the click when navigation is disabled', () => { + (useNavigateToLeftPanel as jest.Mock).mockReturnValue({ + navigateToLeftPanel: undefined, + isEnabled: false, + }); + + const { getByTestId } = render( + <IntlProvider locale="en"> + <InsightsSummaryRow + text={'this is a test for red'} + value={2} + expandedSubTab={'subTab'} + data-test-subj={testId} + /> + </IntlProvider> + ); + const button = getByTestId(buttonTestId); + + expect(button).toHaveAttribute('disabled'); + + button.click(); + expect(mockNavigateToLeftPanel).not.toHaveBeenCalled(); + }); +}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/insights_summary_row.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/insights_summary_row.tsx similarity index 81% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/insights_summary_row.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/insights_summary_row.tsx index 56a19d2eca965..18e75651c6a86 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/insights_summary_row.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/insights_summary_row.tsx @@ -6,15 +6,13 @@ */ import type { ReactElement, VFC } from 'react'; -import React, { useMemo, useCallback } from 'react'; +import React, { useMemo } from 'react'; import { css } from '@emotion/react'; import { i18n } from '@kbn/i18n'; import { EuiBadge, EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiSkeletonText } from '@elastic/eui'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { useDocumentDetailsContext } from '../../shared/context'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; import { LeftPanelInsightsTab } from '../../left'; import { FormattedCount } from '../../../../common/components/formatted_number'; +import { useNavigateToLeftPanel } from '../../shared/hooks/use_navigate_to_left_panel'; const LOADING = i18n.translate( 'xpack.securitySolution.flyout.right.insights.insightSummaryLoadingAriaLabel', @@ -66,23 +64,10 @@ export const InsightsSummaryRow: VFC<InsightsSummaryRowProps> = ({ expandedSubTab, 'data-test-subj': dataTestSubj, }) => { - const { eventId, indexName, scopeId, isPreviewMode } = useDocumentDetailsContext(); - const { openLeftPanel } = useExpandableFlyoutApi(); - - const onClick = useCallback(() => { - openLeftPanel({ - id: DocumentDetailsLeftPanelKey, - path: { - tab: LeftPanelInsightsTab, - subTab: expandedSubTab, - }, - params: { - id: eventId, - indexName, - scopeId, - }, - }); - }, [eventId, expandedSubTab, indexName, openLeftPanel, scopeId]); + const { navigateToLeftPanel: onClick, isEnabled: isLinkEnabled } = useNavigateToLeftPanel({ + tab: LeftPanelInsightsTab, + subTab: expandedSubTab, + }); const textDataTestSubj = useMemo(() => `${dataTestSubj}Text`, [dataTestSubj]); const loadingDataTestSubj = useMemo(() => `${dataTestSubj}Loading`, [dataTestSubj]); @@ -100,7 +85,7 @@ export const InsightsSummaryRow: VFC<InsightsSummaryRowProps> = ({ onClick={onClick} flush={'both'} size="xs" - disabled={isPreviewMode} + disabled={!isLinkEnabled} data-test-subj={buttonDataTestSubj} > <FormattedCount count={value} /> @@ -111,7 +96,7 @@ export const InsightsSummaryRow: VFC<InsightsSummaryRowProps> = ({ )} </> ); - }, [dataTestSubj, isPreviewMode, onClick, value]); + }, [dataTestSubj, onClick, value, isLinkEnabled]); if (loading) { return ( diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/investigation_guide.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/investigation_guide.test.tsx similarity index 84% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/investigation_guide.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/investigation_guide.test.tsx index f70039230cc45..2b465c793c766 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/investigation_guide.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/investigation_guide.test.tsx @@ -16,16 +16,13 @@ import { INVESTIGATION_GUIDE_TEST_ID, } from './test_ids'; import { mockContextValue } from '../../shared/mocks/mock_context'; -import type { ExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; import { useInvestigationGuide } from '../../shared/hooks/use_investigation_guide'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; -import { LeftPanelInvestigationTab } from '../../left'; +import { useNavigateToLeftPanel } from '../../shared/hooks/use_navigate_to_left_panel'; jest.mock('../../shared/hooks/use_investigation_guide'); -jest.mock('@kbn/expandable-flyout'); +jest.mock('../../shared/hooks/use_navigate_to_left_panel'); -const mockFlyoutContextValue = { openLeftPanel: jest.fn() }; +const mockNavigateToLeftPanel = jest.fn(); const NO_DATA_MESSAGE = "Investigation guideThere's no investigation guide for this rule."; const PREVIEW_MESSAGE = 'Investigation guide is not available in alert preview.'; @@ -42,10 +39,11 @@ const renderInvestigationGuide = () => ); describe('<InvestigationGuide />', () => { - beforeAll(() => { - jest.mocked(useExpandableFlyoutApi).mockReturnValue({ - openLeftPanel: mockFlyoutContextValue.openLeftPanel, - } as unknown as ExpandableFlyoutApi); + beforeEach(() => { + jest.mocked(useNavigateToLeftPanel).mockReturnValue({ + navigateToLeftPanel: mockNavigateToLeftPanel, + isEnabled: true, + }); }); it('should render investigation guide button correctly', () => { @@ -126,10 +124,14 @@ describe('<InvestigationGuide />', () => { expect(getByTestId(INVESTIGATION_GUIDE_TEST_ID)).toHaveTextContent(PREVIEW_MESSAGE); }); - it('should render open flyout message if isPreviewMode is true', () => { + it('should render open flyout message if navigation is disabled', () => { + (useNavigateToLeftPanel as jest.Mock).mockReturnValue({ + navigateToLeftPanel: undefined, + isEnabled: false, + }); const { queryByTestId, getByTestId } = render( <IntlProvider locale="en"> - <DocumentDetailsContext.Provider value={{ ...mockContextValue, isPreviewMode: true }}> + <DocumentDetailsContext.Provider value={mockContextValue}> <InvestigationGuide /> </DocumentDetailsContext.Provider> </IntlProvider> @@ -150,16 +152,6 @@ describe('<InvestigationGuide />', () => { const { getByTestId } = renderInvestigationGuide(); getByTestId(INVESTIGATION_GUIDE_BUTTON_TEST_ID).click(); - expect(mockFlyoutContextValue.openLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { - tab: LeftPanelInvestigationTab, - }, - params: { - id: mockContextValue.eventId, - indexName: mockContextValue.indexName, - scopeId: mockContextValue.scopeId, - }, - }); + expect(mockNavigateToLeftPanel).toHaveBeenCalled(); }); }); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/investigation_guide.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/investigation_guide.tsx similarity index 85% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/investigation_guide.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/investigation_guide.tsx index f490266113533..599c0a73a0dab 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/investigation_guide.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/investigation_guide.tsx @@ -4,47 +4,35 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import React, { useCallback, useMemo } from 'react'; +import React, { useMemo } from 'react'; import { EuiButton, EuiSkeletonText, EuiCallOut } from '@elastic/eui'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { useInvestigationGuide } from '../../shared/hooks/use_investigation_guide'; import { useDocumentDetailsContext } from '../../shared/context'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; import { LeftPanelInvestigationTab } from '../../left'; import { INVESTIGATION_GUIDE_BUTTON_TEST_ID, INVESTIGATION_GUIDE_LOADING_TEST_ID, INVESTIGATION_GUIDE_TEST_ID, } from './test_ids'; +import { useNavigateToLeftPanel } from '../../shared/hooks/use_navigate_to_left_panel'; /** * Render either the investigation guide button that opens Investigation section in the left panel, * or a no-data message if investigation guide hasn't been set up on the rule */ export const InvestigationGuide: React.FC = () => { - const { openLeftPanel } = useExpandableFlyoutApi(); - const { eventId, indexName, scopeId, dataFormattedForFieldBrowser, isPreview, isPreviewMode } = - useDocumentDetailsContext(); + const { dataFormattedForFieldBrowser, isPreview } = useDocumentDetailsContext(); const { loading, error, basicAlertData, ruleNote } = useInvestigationGuide({ dataFormattedForFieldBrowser, }); - const goToInvestigationsTab = useCallback(() => { - openLeftPanel({ - id: DocumentDetailsLeftPanelKey, - path: { - tab: LeftPanelInvestigationTab, - }, - params: { - id: eventId, - indexName, - scopeId, - }, + const { navigateToLeftPanel: goToInvestigationsTab, isEnabled: isLinkEnabled } = + useNavigateToLeftPanel({ + tab: LeftPanelInvestigationTab, }); - }, [eventId, indexName, openLeftPanel, scopeId]); const hasInvestigationGuide = useMemo( () => !error && basicAlertData && basicAlertData.ruleId && ruleNote, @@ -88,7 +76,7 @@ export const InvestigationGuide: React.FC = () => { ); } - if (hasInvestigationGuide && isPreviewMode) { + if (hasInvestigationGuide && !isLinkEnabled) { return ( <EuiCallOut iconType="documentation" @@ -154,7 +142,7 @@ export const InvestigationGuide: React.FC = () => { /> </EuiCallOut> ); - }, [loading, isPreview, isPreviewMode, goToInvestigationsTab, hasInvestigationGuide]); + }, [isPreview, loading, hasInvestigationGuide, isLinkEnabled, goToInvestigationsTab]); return <div data-test-subj={INVESTIGATION_GUIDE_TEST_ID}>{content}</div>; }; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/investigation_section.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/investigation_section.test.tsx similarity index 94% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/investigation_section.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/investigation_section.test.tsx index d97821428745f..9a25043abbdf4 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/investigation_section.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/investigation_section.test.tsx @@ -22,10 +22,12 @@ import { TestProvider } from '@kbn/expandable-flyout/src/test/provider'; import { mockContextValue } from '../../shared/mocks/mock_context'; import { useExpandSection } from '../hooks/use_expand_section'; import { useHighlightedFields } from '../../shared/hooks/use_highlighted_fields'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; jest.mock('../../../../detection_engine/rule_management/logic/use_rule_with_fallback'); jest.mock('../hooks/use_expand_section'); jest.mock('../../shared/hooks/use_highlighted_fields'); +jest.mock('../../../../common/hooks/use_experimental_features'); const panelContextValue = { ...mockContextValue, @@ -49,6 +51,7 @@ describe('<InvestigationSection />', () => { beforeEach(() => { jest.clearAllMocks(); (useRuleWithFallback as jest.Mock).mockReturnValue({ rule: { note: 'test note' } }); + (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(false); }); it('should render investigation component', () => { diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/investigation_section.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/investigation_section.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/investigation_section.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/investigation_section.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/mitre_attack.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/mitre_attack.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/mitre_attack.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/mitre_attack.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/mitre_attack.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/mitre_attack.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/mitre_attack.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/mitre_attack.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/notes.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/notes.test.tsx similarity index 80% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/notes.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/notes.test.tsx index 7ccc3477a9d5d..3e07d9df1f79d 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/notes.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/notes.test.tsx @@ -21,15 +21,15 @@ import { mockContextValue } from '../../shared/mocks/mock_context'; import { createMockStore, mockGlobalState, TestProviders } from '../../../../common/mock'; import { ReqStatus } from '../../../../notes'; import type { Note } from '../../../../../common/api/timeline'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; -import { LeftPanelNotesTab } from '../../left'; import { getEmptyValue } from '../../../../common/components/empty_value'; import { useUserPrivileges } from '../../../../common/components/user_privileges'; +import { useNavigateToLeftPanel } from '../../shared/hooks/use_navigate_to_left_panel'; -jest.mock('@kbn/expandable-flyout'); jest.mock('../../../../common/components/user_privileges'); +const mockNavigateToLeftPanel = jest.fn(); +jest.mock('../../shared/hooks/use_navigate_to_left_panel'); + const mockAddError = jest.fn(); jest.mock('../../../../common/hooks/use_app_toasts', () => ({ useAppToasts: () => ({ @@ -48,15 +48,17 @@ jest.mock('react-redux', () => { describe('<Notes />', () => { beforeEach(() => { + jest.clearAllMocks(); (useUserPrivileges as jest.Mock).mockReturnValue({ kibanaSecuritySolutionsPrivileges: { crud: true }, }); - jest.clearAllMocks(); + (useNavigateToLeftPanel as jest.Mock).mockReturnValue({ + navigateToLeftPanel: mockNavigateToLeftPanel, + isEnabled: true, + }); }); it('should render loading spinner', () => { - (useExpandableFlyoutApi as jest.Mock).mockReturnValue({ openLeftPanel: jest.fn() }); - const store = createMockStore({ ...mockGlobalState, notes: { @@ -83,9 +85,6 @@ describe('<Notes />', () => { }); it('should render Add note button if no notes are present', () => { - const mockOpenLeftPanel = jest.fn(); - (useExpandableFlyoutApi as jest.Mock).mockReturnValue({ openLeftPanel: mockOpenLeftPanel }); - const { getByTestId } = render( <TestProviders> <DocumentDetailsContext.Provider value={mockContextValue}> @@ -99,29 +98,17 @@ describe('<Notes />', () => { button.click(); - expect(mockOpenLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { tab: LeftPanelNotesTab }, - params: { - id: mockContextValue.eventId, - indexName: mockContextValue.indexName, - scopeId: mockContextValue.scopeId, - }, - }); + expect(mockNavigateToLeftPanel).toHaveBeenCalled(); }); it('should disabled the Add note button if in preview mode', () => { - const contextValue = { - ...mockContextValue, - isPreviewMode: true, - }; - - const mockOpenLeftPanel = jest.fn(); - (useExpandableFlyoutApi as jest.Mock).mockReturnValue({ openLeftPanel: mockOpenLeftPanel }); - + (useNavigateToLeftPanel as jest.Mock).mockReturnValue({ + navigateToLeftPanel: undefined, + isEnabled: false, + }); const { getByTestId } = render( <TestProviders> - <DocumentDetailsContext.Provider value={contextValue}> + <DocumentDetailsContext.Provider value={mockContextValue}> <Notes /> </DocumentDetailsContext.Provider> </TestProviders> @@ -135,13 +122,10 @@ describe('<Notes />', () => { button.click(); - expect(mockOpenLeftPanel).not.toHaveBeenCalled(); + expect(mockNavigateToLeftPanel).not.toHaveBeenCalled(); }); it('should render number of notes and plus button', () => { - const mockOpenLeftPanel = jest.fn(); - (useExpandableFlyoutApi as jest.Mock).mockReturnValue({ openLeftPanel: mockOpenLeftPanel }); - const contextValue = { ...mockContextValue, eventId: '1', @@ -163,25 +147,17 @@ describe('<Notes />', () => { expect(button).toBeInTheDocument(); button.click(); - expect(mockOpenLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { tab: LeftPanelNotesTab }, - params: { - id: contextValue.eventId, - indexName: mockContextValue.indexName, - scopeId: mockContextValue.scopeId, - }, - }); + expect(mockNavigateToLeftPanel).toHaveBeenCalled(); }); - it('should disable the plus button if in preview mode', () => { - const mockOpenLeftPanel = jest.fn(); - (useExpandableFlyoutApi as jest.Mock).mockReturnValue({ openLeftPanel: mockOpenLeftPanel }); - + it('should disable the plus button if navigation is disabled', () => { + (useNavigateToLeftPanel as jest.Mock).mockReturnValue({ + navigateToLeftPanel: undefined, + isEnabled: false, + }); const contextValue = { ...mockContextValue, eventId: '1', - isPreviewMode: true, }; const { getByTestId } = render( @@ -203,7 +179,7 @@ describe('<Notes />', () => { button.click(); expect(button).toBeDisabled(); - expect(mockOpenLeftPanel).not.toHaveBeenCalled(); + expect(mockNavigateToLeftPanel).not.toHaveBeenCalled(); }); it('should render number of notes in scientific notation for big numbers', () => { @@ -257,8 +233,6 @@ describe('<Notes />', () => { isPreview: true, }; - (useExpandableFlyoutApi as jest.Mock).mockReturnValue({ openLeftPanel: jest.fn() }); - const { getByText, queryByTestId } = render( <TestProviders> <DocumentDetailsContext.Provider value={contextValue}> @@ -309,9 +283,6 @@ describe('<Notes />', () => { kibanaSecuritySolutionsPrivileges: { crud: false }, }); - const mockOpenLeftPanel = jest.fn(); - (useExpandableFlyoutApi as jest.Mock).mockReturnValue({ openLeftPanel: mockOpenLeftPanel }); - const contextValue = { ...mockContextValue, eventId: '1', @@ -337,15 +308,7 @@ describe('<Notes />', () => { button.click(); - expect(mockOpenLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { tab: LeftPanelNotesTab }, - params: { - id: contextValue.eventId, - indexName: mockContextValue.indexName, - scopeId: mockContextValue.scopeId, - }, - }); + expect(mockNavigateToLeftPanel).toHaveBeenCalled(); }); it('should show a - if user does not have the correct privileges and no notes have been created', () => { diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/notes.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/notes.tsx similarity index 83% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/notes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/notes.tsx index e10a1ff23919f..46377ee6db628 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/notes.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/notes.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { memo, useCallback, useEffect, useMemo } from 'react'; +import React, { memo, useEffect, useMemo } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; @@ -18,10 +18,8 @@ import { useEuiTheme, } from '@elastic/eui'; import { css } from '@emotion/react'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; import { useUserPrivileges } from '../../../../common/components/user_privileges'; import { getEmptyTagValue } from '../../../../common/components/empty_value'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; import { FormattedCount } from '../../../../common/components/formatted_number'; import { useDocumentDetailsContext } from '../../shared/context'; import { @@ -44,6 +42,7 @@ import { import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; import { AlertHeaderBlock } from './alert_header_block'; import { LeftPanelNotesTab } from '../../left'; +import { useNavigateToLeftPanel } from '../../shared/hooks/use_navigate_to_left_panel'; export const FETCH_NOTES_ERROR = i18n.translate( 'xpack.securitySolution.flyout.right.notes.fetchNotesErrorLabel', @@ -70,31 +69,23 @@ export const VIEW_NOTES_BUTTON_ARIA_LABEL = i18n.translate( export const Notes = memo(() => { const { euiTheme } = useEuiTheme(); const dispatch = useDispatch(); - const { eventId, indexName, scopeId, isPreview, isPreviewMode } = useDocumentDetailsContext(); + const { eventId, isPreview } = useDocumentDetailsContext(); const { addError: addErrorToast } = useAppToasts(); const { kibanaSecuritySolutionsPrivileges } = useUserPrivileges(); - const { openLeftPanel } = useExpandableFlyoutApi(); - const openExpandedFlyoutNotesTab = useCallback( - () => - openLeftPanel({ - id: DocumentDetailsLeftPanelKey, - path: { tab: LeftPanelNotesTab }, - params: { - id: eventId, - indexName, - scopeId, - }, - }), - [eventId, indexName, openLeftPanel, scopeId] - ); + const { navigateToLeftPanel: openExpandedFlyoutNotesTab, isEnabled: isLinkEnabled } = + useNavigateToLeftPanel({ + tab: LeftPanelNotesTab, + }); + + const isNotesDisabled = !isLinkEnabled || isPreview; useEffect(() => { // only fetch notes if we are not in a preview panel, or not in a rule preview workflow - if (!isPreviewMode && !isPreview) { + if (!isNotesDisabled) { dispatch(fetchNotesByDocumentIds({ documentIds: [eventId] })); } - }, [dispatch, eventId, isPreview, isPreviewMode]); + }, [dispatch, eventId, isNotesDisabled]); const fetchStatus = useSelector((state: State) => selectFetchNotesByDocumentIdsStatus(state)); const fetchError = useSelector((state: State) => selectFetchNotesByDocumentIdsError(state)); @@ -115,7 +106,7 @@ export const Notes = memo(() => { <EuiButtonEmpty onClick={openExpandedFlyoutNotesTab} size="s" - disabled={isPreviewMode || isPreview} + disabled={isNotesDisabled} aria-label={VIEW_NOTES_BUTTON_ARIA_LABEL} data-test-subj={NOTES_VIEW_NOTES_BUTTON_TEST_ID} > @@ -126,7 +117,7 @@ export const Notes = memo(() => { /> </EuiButtonEmpty> ), - [isPreview, isPreviewMode, notes.length, openExpandedFlyoutNotesTab] + [isNotesDisabled, notes.length, openExpandedFlyoutNotesTab] ); const addNoteButton = useMemo( () => ( @@ -134,21 +125,21 @@ export const Notes = memo(() => { iconType="plusInCircle" onClick={openExpandedFlyoutNotesTab} size="s" - disabled={isPreviewMode || isPreview} + disabled={isNotesDisabled} aria-label={ADD_NOTE_BUTTON} data-test-subj={NOTES_ADD_NOTE_BUTTON_TEST_ID} > {ADD_NOTE_BUTTON} </EuiButtonEmpty> ), - [isPreview, isPreviewMode, openExpandedFlyoutNotesTab] + [isNotesDisabled, openExpandedFlyoutNotesTab] ); const addNoteButtonIcon = useMemo( () => ( <EuiButtonIcon onClick={openExpandedFlyoutNotesTab} iconType="plusInCircle" - disabled={isPreviewMode || isPreview || !kibanaSecuritySolutionsPrivileges.crud} + disabled={isNotesDisabled || !kibanaSecuritySolutionsPrivileges.crud} css={css` margin-left: ${euiTheme.size.xs}; `} @@ -158,8 +149,7 @@ export const Notes = memo(() => { ), [ euiTheme.size.xs, - isPreview, - isPreviewMode, + isNotesDisabled, kibanaSecuritySolutionsPrivileges.crud, openExpandedFlyoutNotesTab, ] diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/prevalence_overview.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/prevalence_overview.test.tsx similarity index 83% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/prevalence_overview.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/prevalence_overview.test.tsx index 57770b58e2fcb..ddf55daef882c 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/prevalence_overview.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/prevalence_overview.test.tsx @@ -13,11 +13,8 @@ import { SUMMARY_ROW_TEXT_TEST_ID, SUMMARY_ROW_VALUE_TEST_ID, } from './test_ids'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; -import { LeftPanelInsightsTab } from '../../left'; import React from 'react'; import { PrevalenceOverview } from './prevalence_overview'; -import { PREVALENCE_TAB_ID } from '../../left/components/prevalence_details'; import { EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID, EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID, @@ -27,10 +24,13 @@ import { } from '../../../shared/components/test_ids'; import { usePrevalence } from '../../shared/hooks/use_prevalence'; import { mockContextValue } from '../../shared/mocks/mock_context'; -import { type ExpandableFlyoutApi, useExpandableFlyoutApi } from '@kbn/expandable-flyout'; +import { useNavigateToLeftPanel } from '../../shared/hooks/use_navigate_to_left_panel'; jest.mock('../../shared/hooks/use_prevalence'); +const mockNavigateToLeftPanel = jest.fn(); +jest.mock('../../shared/hooks/use_navigate_to_left_panel'); + const TOGGLE_ICON_TEST_ID = EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(PREVALENCE_TEST_ID); const TITLE_LINK_TEST_ID = EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(PREVALENCE_TEST_ID); const TITLE_ICON_TEST_ID = EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(PREVALENCE_TEST_ID); @@ -38,15 +38,6 @@ const TITLE_TEXT_TEST_ID = EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(PREVALENCE const NO_DATA_MESSAGE = 'No prevalence data available.'; -const flyoutContextValue = { - openLeftPanel: jest.fn(), -} as unknown as ExpandableFlyoutApi; - -jest.mock('@kbn/expandable-flyout', () => ({ - useExpandableFlyoutApi: jest.fn(), - ExpandableFlyoutProvider: ({ children }: React.PropsWithChildren<{}>) => <>{children}</>, -})); - const renderPrevalenceOverview = (contextValue: DocumentDetailsContext = mockContextValue) => render( <TestProviders> @@ -57,17 +48,19 @@ const renderPrevalenceOverview = (contextValue: DocumentDetailsContext = mockCon ); describe('<PrevalenceOverview />', () => { - beforeAll(() => { - jest.mocked(useExpandableFlyoutApi).mockReturnValue(flyoutContextValue); - }); - - it('should render wrapper component', () => { + beforeEach(() => { (usePrevalence as jest.Mock).mockReturnValue({ loading: false, error: false, data: [], }); + (useNavigateToLeftPanel as jest.Mock).mockReturnValue({ + navigateToLeftPanel: mockNavigateToLeftPanel, + isEnabled: true, + }); + }); + it('should render wrapper component', () => { const { getByTestId, queryByTestId } = renderPrevalenceOverview(); expect(queryByTestId(TOGGLE_ICON_TEST_ID)).not.toBeInTheDocument(); expect(getByTestId(TITLE_LINK_TEST_ID)).toBeInTheDocument(); @@ -76,20 +69,23 @@ describe('<PrevalenceOverview />', () => { expect(queryByTestId(TITLE_TEXT_TEST_ID)).not.toBeInTheDocument(); }); - it('should not render link and icon if isPreviewMode is true', () => { - (usePrevalence as jest.Mock).mockReturnValue({ - loading: false, - error: false, - data: [], - }); - + it('should render link without icon if isPreviewMode is true', () => { const { getByTestId, queryByTestId } = renderPrevalenceOverview({ ...mockContextValue, isPreviewMode: true, }); - expect(queryByTestId(TOGGLE_ICON_TEST_ID)).not.toBeInTheDocument(); - expect(queryByTestId(TITLE_LINK_TEST_ID)).not.toBeInTheDocument(); + expect(getByTestId(TITLE_LINK_TEST_ID)).toBeInTheDocument(); expect(queryByTestId(TITLE_ICON_TEST_ID)).not.toBeInTheDocument(); + }); + + it('should not render link if navigation is disabled', () => { + (useNavigateToLeftPanel as jest.Mock).mockReturnValue({ + navigateToLeftPanel: mockNavigateToLeftPanel, + isEnabled: false, + }); + + const { getByTestId, queryByTestId } = renderPrevalenceOverview(mockContextValue); + expect(queryByTestId(TITLE_LINK_TEST_ID)).not.toBeInTheDocument(); expect(getByTestId(TITLE_TEXT_TEST_ID)).toBeInTheDocument(); }); @@ -193,14 +189,6 @@ describe('<PrevalenceOverview />', () => { const { getByTestId } = renderPrevalenceOverview(); getByTestId(TITLE_LINK_TEST_ID).click(); - expect(flyoutContextValue.openLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { tab: LeftPanelInsightsTab, subTab: PREVALENCE_TAB_ID }, - params: { - id: 'eventId', - indexName: 'index', - scopeId: 'scopeId', - }, - }); + expect(mockNavigateToLeftPanel).toHaveBeenCalled(); }); }); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/prevalence_overview.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/prevalence_overview.tsx similarity index 80% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/prevalence_overview.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/prevalence_overview.tsx index 966df0293db77..b24c22e5ebbd1 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/prevalence_overview.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/prevalence_overview.tsx @@ -6,18 +6,17 @@ */ import type { FC } from 'react'; -import React, { useCallback, useMemo } from 'react'; +import React, { useMemo } from 'react'; import { EuiBadge, EuiFlexGroup } from '@elastic/eui'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; import { FormattedMessage } from '@kbn/i18n-react'; import { ExpandablePanel } from '../../../shared/components/expandable_panel'; import { usePrevalence } from '../../shared/hooks/use_prevalence'; import { PREVALENCE_TEST_ID } from './test_ids'; import { useDocumentDetailsContext } from '../../shared/context'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; import { LeftPanelInsightsTab } from '../../left'; import { PREVALENCE_TAB_ID } from '../../left/components/prevalence_details'; import { InsightsSummaryRow } from './insights_summary_row'; +import { useNavigateToLeftPanel } from '../../shared/hooks/use_navigate_to_left_panel'; const UNCOMMON = ( <FormattedMessage @@ -35,30 +34,14 @@ const DEFAULT_TO = 'now'; * The component fetches the necessary data at once. The loading and error states are handled by the ExpandablePanel component. */ export const PrevalenceOverview: FC = () => { - const { - eventId, - indexName, - dataFormattedForFieldBrowser, - scopeId, - investigationFields, - isPreviewMode, - } = useDocumentDetailsContext(); - const { openLeftPanel } = useExpandableFlyoutApi(); + const { dataFormattedForFieldBrowser, investigationFields, isPreviewMode } = + useDocumentDetailsContext(); - const goPrevalenceTab = useCallback(() => { - openLeftPanel({ - id: DocumentDetailsLeftPanelKey, - path: { - tab: LeftPanelInsightsTab, - subTab: PREVALENCE_TAB_ID, - }, - params: { - id: eventId, - indexName, - scopeId, - }, + const { navigateToLeftPanel: goToPrevalenceTab, isEnabled: isLinkEnabled } = + useNavigateToLeftPanel({ + tab: LeftPanelInsightsTab, + subTab: PREVALENCE_TAB_ID, }); - }, [eventId, openLeftPanel, indexName, scopeId]); const { loading, error, data } = usePrevalence({ dataFormattedForFieldBrowser, @@ -82,9 +65,9 @@ export const PrevalenceOverview: FC = () => { ); const link = useMemo( () => - !isPreviewMode + isLinkEnabled ? { - callback: goPrevalenceTab, + callback: goToPrevalenceTab, tooltip: ( <FormattedMessage id="xpack.securitySolution.flyout.right.insights.prevalence.prevalenceTooltip" @@ -93,7 +76,7 @@ export const PrevalenceOverview: FC = () => { ), } : undefined, - [goPrevalenceTab, isPreviewMode] + [goToPrevalenceTab, isLinkEnabled] ); return ( diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/reason.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/reason.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/reason.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/reason.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/reason.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/reason.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/reason.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/reason.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_ancestry.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_ancestry.test.tsx similarity index 76% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_ancestry.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_ancestry.test.tsx index 38efe27b16ea9..93f470331e352 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_ancestry.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_ancestry.test.tsx @@ -16,22 +16,16 @@ import { } from './test_ids'; import { RelatedAlertsByAncestry } from './related_alerts_by_ancestry'; import { useFetchRelatedAlertsByAncestry } from '../../shared/hooks/use_fetch_related_alerts_by_ancestry'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; -import { LeftPanelInsightsTab } from '../../left'; -import { CORRELATIONS_TAB_ID } from '../../left/components/correlations_details'; -import { useDocumentDetailsContext } from '../../shared/context'; - -jest.mock('@kbn/expandable-flyout'); -jest.mock('../../shared/context'); +import { useNavigateToLeftPanel } from '../../shared/hooks/use_navigate_to_left_panel'; + jest.mock('../../shared/hooks/use_fetch_related_alerts_by_ancestry'); -const mockOpenLeftPanel = jest.fn(); +const mockNavigateToLeftPanel = jest.fn(); +jest.mock('../../shared/hooks/use_navigate_to_left_panel'); + const documentId = 'documentId'; const indices = ['indices']; const scopeId = 'scopeId'; -const eventId = 'eventId'; -const indexName = 'indexName'; const TEXT_TEST_ID = SUMMARY_ROW_TEXT_TEST_ID(CORRELATIONS_RELATED_ALERTS_BY_ANCESTRY_TEST_ID); const BUTTON_TEST_ID = SUMMARY_ROW_BUTTON_TEST_ID(CORRELATIONS_RELATED_ALERTS_BY_ANCESTRY_TEST_ID); @@ -49,14 +43,10 @@ const renderRelatedAlertsByAncestry = () => describe('<RelatedAlertsByAncestry />', () => { beforeEach(() => { jest.clearAllMocks(); - - (useDocumentDetailsContext as jest.Mock).mockReturnValue({ - eventId, - indexName, - scopeId, - isPreviewMode: false, + (useNavigateToLeftPanel as jest.Mock).mockReturnValue({ + navigateToLeftPanel: mockNavigateToLeftPanel, + isEnabled: true, }); - (useExpandableFlyoutApi as jest.Mock).mockReturnValue({ openLeftPanel: mockOpenLeftPanel }); }); it('should render single related alert correctly', () => { @@ -112,17 +102,6 @@ describe('<RelatedAlertsByAncestry />', () => { const { getByTestId } = renderRelatedAlertsByAncestry(); getByTestId(BUTTON_TEST_ID).click(); - expect(mockOpenLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { - tab: LeftPanelInsightsTab, - subTab: CORRELATIONS_TAB_ID, - }, - params: { - id: eventId, - indexName, - scopeId, - }, - }); + expect(mockNavigateToLeftPanel).toHaveBeenCalled(); }); }); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_ancestry.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_ancestry.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_ancestry.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_ancestry.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_same_source_event.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_same_source_event.test.tsx similarity index 77% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_same_source_event.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_same_source_event.test.tsx index 80e7c99a60917..c3e646a2c1cdf 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_same_source_event.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_same_source_event.test.tsx @@ -16,21 +16,15 @@ import { } from './test_ids'; import { useFetchRelatedAlertsBySameSourceEvent } from '../../shared/hooks/use_fetch_related_alerts_by_same_source_event'; import { RelatedAlertsBySameSourceEvent } from './related_alerts_by_same_source_event'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; -import { LeftPanelInsightsTab } from '../../left'; -import { CORRELATIONS_TAB_ID } from '../../left/components/correlations_details'; -import { useDocumentDetailsContext } from '../../shared/context'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; - -jest.mock('@kbn/expandable-flyout'); -jest.mock('../../shared/context'); +import { useNavigateToLeftPanel } from '../../shared/hooks/use_navigate_to_left_panel'; + jest.mock('../../shared/hooks/use_fetch_related_alerts_by_same_source_event'); -const mockOpenLeftPanel = jest.fn(); +const mockNavigateToLeftPanel = jest.fn(); +jest.mock('../../shared/hooks/use_navigate_to_left_panel'); + const originalEventId = 'originalEventId'; const scopeId = 'scopeId'; -const eventId = 'eventId'; -const indexName = 'indexName'; const TEXT_TEST_ID = SUMMARY_ROW_TEXT_TEST_ID( CORRELATIONS_RELATED_ALERTS_BY_SAME_SOURCE_EVENT_TEST_ID @@ -53,13 +47,10 @@ describe('<RelatedAlertsBySameSourceEvent />', () => { beforeEach(() => { jest.clearAllMocks(); - (useDocumentDetailsContext as jest.Mock).mockReturnValue({ - eventId, - indexName, - scopeId, - isPreviewMode: false, + (useNavigateToLeftPanel as jest.Mock).mockReturnValue({ + navigateToLeftPanel: mockNavigateToLeftPanel, + isEnabled: true, }); - (useExpandableFlyoutApi as jest.Mock).mockReturnValue({ openLeftPanel: mockOpenLeftPanel }); }); it('should render single related alert correctly', () => { @@ -117,17 +108,6 @@ describe('<RelatedAlertsBySameSourceEvent />', () => { const { getByTestId } = renderRelatedAlertsBySameSourceEvent(); getByTestId(BUTTON_TEST_ID).click(); - expect(mockOpenLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { - tab: LeftPanelInsightsTab, - subTab: CORRELATIONS_TAB_ID, - }, - params: { - id: eventId, - indexName, - scopeId, - }, - }); + expect(mockNavigateToLeftPanel).toHaveBeenCalled(); }); }); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_same_source_event.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_same_source_event.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_same_source_event.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_same_source_event.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_session.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_session.test.tsx similarity index 75% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_session.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_session.test.tsx index 4aeeef1feb8b1..8328099e1b316 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_session.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_session.test.tsx @@ -16,19 +16,13 @@ import { } from './test_ids'; import { RelatedAlertsBySession } from './related_alerts_by_session'; import { useFetchRelatedAlertsBySession } from '../../shared/hooks/use_fetch_related_alerts_by_session'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; -import { LeftPanelInsightsTab } from '../../left'; -import { CORRELATIONS_TAB_ID } from '../../left/components/correlations_details'; -import { useDocumentDetailsContext } from '../../shared/context'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; - -jest.mock('@kbn/expandable-flyout'); -jest.mock('../../shared/context'); +import { useNavigateToLeftPanel } from '../../shared/hooks/use_navigate_to_left_panel'; + jest.mock('../../shared/hooks/use_fetch_related_alerts_by_session'); -const mockOpenLeftPanel = jest.fn(); -const eventId = 'eventId'; -const indexName = 'indexName'; +const mockNavigateToLeftPanel = jest.fn(); +jest.mock('../../shared/hooks/use_navigate_to_left_panel'); + const entityId = 'entityId'; const scopeId = 'scopeId'; @@ -47,13 +41,10 @@ describe('<RelatedAlertsBySession />', () => { beforeEach(() => { jest.clearAllMocks(); - (useDocumentDetailsContext as jest.Mock).mockReturnValue({ - eventId, - indexName, - scopeId, - isPreviewMode: false, + (useNavigateToLeftPanel as jest.Mock).mockReturnValue({ + navigateToLeftPanel: mockNavigateToLeftPanel, + isEnabled: true, }); - (useExpandableFlyoutApi as jest.Mock).mockReturnValue({ openLeftPanel: mockOpenLeftPanel }); }); it('should render single related alerts correctly', () => { @@ -109,17 +100,6 @@ describe('<RelatedAlertsBySession />', () => { const { getByTestId } = renderRelatedAlertsBySession(); getByTestId(BUTTON_TEST_ID).click(); - expect(mockOpenLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { - tab: LeftPanelInsightsTab, - subTab: CORRELATIONS_TAB_ID, - }, - params: { - id: eventId, - indexName, - scopeId, - }, - }); + expect(mockNavigateToLeftPanel).toHaveBeenCalled(); }); }); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_session.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_session.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_session.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/related_alerts_by_session.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/related_cases.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/related_cases.test.tsx new file mode 100644 index 0000000000000..3d4b42e275368 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/related_cases.test.tsx @@ -0,0 +1,104 @@ +/* + * 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 { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; +import { render } from '@testing-library/react'; +import { + CORRELATIONS_RELATED_CASES_TEST_ID, + SUMMARY_ROW_TEXT_TEST_ID, + SUMMARY_ROW_LOADING_TEST_ID, + SUMMARY_ROW_BUTTON_TEST_ID, +} from './test_ids'; +import { RelatedCases } from './related_cases'; +import { useFetchRelatedCases } from '../../shared/hooks/use_fetch_related_cases'; +import { useNavigateToLeftPanel } from '../../shared/hooks/use_navigate_to_left_panel'; + +jest.mock('../../shared/hooks/use_fetch_related_cases'); + +const mockNavigateToLeftPanel = jest.fn(); +jest.mock('../../shared/hooks/use_navigate_to_left_panel'); + +const eventId = 'eventId'; + +const TEXT_TEST_ID = SUMMARY_ROW_TEXT_TEST_ID(CORRELATIONS_RELATED_CASES_TEST_ID); +const BUTTON_TEST_ID = SUMMARY_ROW_BUTTON_TEST_ID(CORRELATIONS_RELATED_CASES_TEST_ID); +const LOADING_TEST_ID = SUMMARY_ROW_LOADING_TEST_ID(CORRELATIONS_RELATED_CASES_TEST_ID); + +const renderRelatedCases = () => + render( + <IntlProvider locale="en"> + <RelatedCases eventId={eventId} /> + </IntlProvider> + ); + +describe('<RelatedCases />', () => { + beforeEach(() => { + jest.clearAllMocks(); + + (useNavigateToLeftPanel as jest.Mock).mockReturnValue({ + navigateToLeftPanel: mockNavigateToLeftPanel, + isEnabled: true, + }); + }); + + it('should render single related case correctly', () => { + (useFetchRelatedCases as jest.Mock).mockReturnValue({ + loading: false, + error: false, + dataCount: 1, + }); + + const { getByTestId } = renderRelatedCases(); + expect(getByTestId(TEXT_TEST_ID)).toHaveTextContent('Related case'); + expect(getByTestId(BUTTON_TEST_ID)).toHaveTextContent('1'); + }); + + it('should render multiple related cases correctly', () => { + (useFetchRelatedCases as jest.Mock).mockReturnValue({ + loading: false, + error: false, + dataCount: 2, + }); + + const { getByTestId } = renderRelatedCases(); + expect(getByTestId(TEXT_TEST_ID)).toHaveTextContent('Related cases'); + expect(getByTestId(BUTTON_TEST_ID)).toHaveTextContent('2'); + }); + + it('should render loading skeleton', () => { + (useFetchRelatedCases as jest.Mock).mockReturnValue({ + loading: true, + }); + + const { getByTestId } = renderRelatedCases(); + expect(getByTestId(LOADING_TEST_ID)).toBeInTheDocument(); + }); + + it('should render null if error', () => { + (useFetchRelatedCases as jest.Mock).mockReturnValue({ + loading: false, + error: true, + }); + + const { container } = renderRelatedCases(); + expect(container).toBeEmptyDOMElement(); + }); + + it('should open the expanded section to the correct tab when the number is clicked', () => { + (useFetchRelatedCases as jest.Mock).mockReturnValue({ + loading: false, + error: false, + dataCount: 1, + }); + + const { getByTestId } = renderRelatedCases(); + getByTestId(BUTTON_TEST_ID).click(); + + expect(mockNavigateToLeftPanel).toHaveBeenCalled(); + }); +}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_cases.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/related_cases.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/related_cases.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/related_cases.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/response_button.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/response_button.test.tsx similarity index 88% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/response_button.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/response_button.test.tsx index 3765daec05496..7e01abfd2002f 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/response_button.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/response_button.test.tsx @@ -14,6 +14,9 @@ import { mockContextValue } from '../../shared/mocks/mock_context'; import { ResponseButton } from './response_button'; import type { SearchHit } from '../../../../../common/search_strategy'; import { TestProvider } from '@kbn/expandable-flyout/src/test/provider'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; + +jest.mock('../../../../common/hooks/use_experimental_features'); const mockValidSearchHit = { fields: { @@ -42,6 +45,7 @@ const renderResponseButton = (panelContextValue: DocumentDetailsContext = mockCo ); describe('<ResponseButton />', () => { it('should render response button correctly', () => { + (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(false); const panelContextValue = { ...mockContextValue, searchHit: mockValidSearchHit }; const { getByTestId, queryByTestId } = renderResponseButton(panelContextValue); expect(getByTestId(RESPONSE_BUTTON_TEST_ID)).toBeInTheDocument(); diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/response_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/response_button.tsx new file mode 100644 index 0000000000000..eb744a22158de --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/response_button.tsx @@ -0,0 +1,39 @@ +/* + * 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 { EuiButton } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { LeftPanelResponseTab } from '../../left'; +import { RESPONSE_BUTTON_TEST_ID } from './test_ids'; +import { useNavigateToLeftPanel } from '../../shared/hooks/use_navigate_to_left_panel'; + +/** + * Response button that opens Response section in the left panel + */ +export const ResponseButton: React.FC = () => { + const { navigateToLeftPanel: goToResponseTab } = useNavigateToLeftPanel({ + tab: LeftPanelResponseTab, + }); + + return ( + <> + <EuiButton + onClick={goToResponseTab} + iconType="documentation" + data-test-subj={RESPONSE_BUTTON_TEST_ID} + size="s" + > + <FormattedMessage + id="xpack.securitySolution.flyout.right.response.responseButtonLabel" + defaultMessage="Response" + /> + </EuiButton> + </> + ); +}; + +ResponseButton.displayName = 'ResponseButton'; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/response_section.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/response_section.test.tsx similarity index 76% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/response_section.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/response_section.test.tsx index 5ae2e2741f5bf..d3201d37fa060 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/response_section.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/response_section.test.tsx @@ -18,8 +18,18 @@ import { mockContextValue } from '../../shared/mocks/mock_context'; import { ResponseSection } from './response_section'; import { TestProvider } from '@kbn/expandable-flyout/src/test/provider'; import { useExpandSection } from '../hooks/use_expand_section'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; +import { useKibana as mockUseKibana } from '../../../../common/lib/kibana/__mocks__'; +import { useKibana } from '../../../../common/lib/kibana'; jest.mock('../hooks/use_expand_section'); +jest.mock('../../../../common/lib/kibana'); +jest.mock('../../../../common/hooks/use_experimental_features'); + +const mockedUseKibana = mockUseKibana(); +(useKibana as jest.Mock).mockReturnValue(mockedUseKibana); + +const mockUseIsExperimentalFeatureEnabled = useIsExperimentalFeatureEnabled as jest.Mock; const PREVIEW_MESSAGE = 'Response is not available in alert preview.'; const OPEN_FLYOUT_MESSAGE = 'Open alert details to access response actions.'; @@ -36,6 +46,10 @@ const renderResponseSection = () => ); describe('<ResponseSection />', () => { + beforeEach(() => { + mockUseIsExperimentalFeatureEnabled.mockReturnValue(false); + }); + it('should render response component', () => { const { getByTestId } = renderResponseSection(); @@ -100,7 +114,7 @@ describe('<ResponseSection />', () => { expect(getByTestId(RESPONSE_SECTION_CONTENT_TEST_ID)).toHaveTextContent(PREVIEW_MESSAGE); }); - it('should render open details flyout message if flyout is in preview', () => { + it('should render open details flyout message if flyout is in preview mode', () => { (useExpandSection as jest.Mock).mockReturnValue(true); const { getByTestId } = render( @@ -140,4 +154,25 @@ describe('<ResponseSection />', () => { ); expect(container).toBeEmptyDOMElement(); }); + + describe('newExpandableFlyoutNavigationEnabled', () => { + beforeEach(() => { + mockUseIsExperimentalFeatureEnabled.mockReturnValue(true); + }); + + it('should render if isPreviewMode is true', () => { + const { getByTestId } = render( + <IntlProvider locale="en"> + <TestProvider> + <DocumentDetailsContext.Provider value={{ ...mockContextValue, isPreviewMode: true }}> + <ResponseSection /> + </DocumentDetailsContext.Provider> + </TestProvider> + </IntlProvider> + ); + expect(getByTestId(RESPONSE_SECTION_HEADER_TEST_ID)).toBeInTheDocument(); + expect(getByTestId(RESPONSE_SECTION_HEADER_TEST_ID)).toHaveTextContent('Response'); + expect(getByTestId(RESPONSE_SECTION_CONTENT_TEST_ID)).toBeInTheDocument(); + }); + }); }); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/response_section.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/response_section.tsx similarity index 90% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/response_section.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/response_section.tsx index 168e5b05357b5..6e4a52f61559e 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/response_section.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/response_section.tsx @@ -16,6 +16,7 @@ import { useDocumentDetailsContext } from '../../shared/context'; import { getField } from '../../shared/utils'; import { EventKind } from '../../shared/constants/event_kinds'; import { RESPONSE_SECTION_TEST_ID } from './test_ids'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; const KEY = 'response'; @@ -28,6 +29,10 @@ export const ResponseSection = memo(() => { const expanded = useExpandSection({ title: KEY, defaultValue: false }); const eventKind = getField(getFieldsData('event.kind')); + const isNewNavigationEnabled = useIsExperimentalFeatureEnabled( + 'newExpandableFlyoutNavigationEnabled' + ); + const content = useMemo(() => { if (isPreview) { return ( @@ -53,7 +58,7 @@ export const ResponseSection = memo(() => { ); } - if (isPreviewMode) { + if (!isNewNavigationEnabled && isPreviewMode) { return ( <EuiCallOut iconType="documentation" @@ -78,7 +83,7 @@ export const ResponseSection = memo(() => { } return <ResponseButton />; - }, [isPreview, isPreviewMode]); + }, [isPreview, isPreviewMode, isNewNavigationEnabled]); if (eventKind !== EventKind.signal) { return null; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/risk_score.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/risk_score.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/risk_score.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/risk_score.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/risk_score.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/risk_score.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/risk_score.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/risk_score.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/session_preview.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/session_preview.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/session_preview.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/session_preview.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/session_preview.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/session_preview.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/session_preview.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/session_preview.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/session_preview_container.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/session_preview_container.test.tsx new file mode 100644 index 0000000000000..73cf7202b50c1 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/session_preview_container.test.tsx @@ -0,0 +1,349 @@ +/* + * 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 { render, screen } from '@testing-library/react'; +import { TestProviders } from '../../../../common/mock'; +import React from 'react'; +import { DocumentDetailsContext } from '../../shared/context'; +import { SessionPreviewContainer } from './session_preview_container'; +import { useSessionPreview } from '../hooks/use_session_preview'; +import { useLicense } from '../../../../common/hooks/use_license'; +import { SESSION_PREVIEW_TEST_ID } from './test_ids'; +import { + EXPANDABLE_PANEL_CONTENT_TEST_ID, + EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID, + EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID, + EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID, + EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID, +} from '../../../shared/components/test_ids'; +import { mockContextValue } from '../../shared/mocks/mock_context'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; +import { useInvestigateInTimeline } from '../../../../detections/components/alerts_table/timeline_actions/use_investigate_in_timeline'; + +jest.mock('../hooks/use_session_preview'); +jest.mock('../../../../common/hooks/use_license'); +jest.mock('../../../../common/hooks/use_experimental_features'); +jest.mock( + '../../../../detections/components/alerts_table/timeline_actions/use_investigate_in_timeline' +); + +const mockNavigateToSessionView = jest.fn(); +jest.mock('../../shared/hooks/use_navigate_to_session_view', () => { + return { useNavigateToSessionView: () => ({ navigateToSessionView: mockNavigateToSessionView }) }; +}); + +const mockUseUiSetting = jest.fn().mockReturnValue([false]); +jest.mock('@kbn/kibana-react-plugin/public', () => { + const original = jest.requireActual('@kbn/kibana-react-plugin/public'); + return { + ...original, + useUiSetting$: () => mockUseUiSetting(), + }; +}); + +jest.mock('react-redux', () => { + const original = jest.requireActual('react-redux'); + + return { + ...original, + useDispatch: () => jest.fn(), + }; +}); + +const NO_DATA_MESSAGE = + 'You can only view Linux session details if you’ve enabled the Include session data setting in your Elastic Defend integration policy. Refer to Enable Session View data(external, opens in a new tab or window) for more information.'; + +const UPSELL_TEXT = 'This feature requires an Enterprise subscription'; + +const sessionViewConfig = { + index: {}, + sessionEntityId: 'sessionEntityId', + sessionStartTime: 'sessionStartTime', +}; + +const renderSessionPreview = (context = mockContextValue) => + render( + <TestProviders> + <DocumentDetailsContext.Provider value={context}> + <SessionPreviewContainer /> + </DocumentDetailsContext.Provider> + </TestProviders> + ); + +describe('SessionPreviewContainer', () => { + beforeEach(() => { + jest.clearAllMocks(); + (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(false); + (useInvestigateInTimeline as jest.Mock).mockReturnValue({ + investigateInTimelineAlertClick: jest.fn(), + }); + }); + + it('should render component and link in header', () => { + (useSessionPreview as jest.Mock).mockReturnValue(sessionViewConfig); + (useLicense as jest.Mock).mockReturnValue({ isEnterprise: () => true }); + + const { getByTestId } = renderSessionPreview(); + + expect(getByTestId(SESSION_PREVIEW_TEST_ID)).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + + expect( + screen.queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + screen.getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + screen.getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + screen.queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + screen.queryByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).not.toHaveTextContent(NO_DATA_MESSAGE); + expect( + screen.queryByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).not.toHaveTextContent(UPSELL_TEXT); + }); + + it('should render error message and text in header if no sessionConfig', () => { + (useSessionPreview as jest.Mock).mockReturnValue(null); + (useLicense as jest.Mock).mockReturnValue({ isEnterprise: () => true }); + + const { getByTestId, queryByTestId } = renderSessionPreview(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + screen.getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).toHaveTextContent(NO_DATA_MESSAGE); + + expect( + screen.queryByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).not.toHaveTextContent(UPSELL_TEXT); + expect(queryByTestId(SESSION_PREVIEW_TEST_ID)).not.toBeInTheDocument(); + }); + + it('should render upsell message in header if no correct license', () => { + (useSessionPreview as jest.Mock).mockReturnValue(sessionViewConfig); + (useLicense as jest.Mock).mockReturnValue({ isEnterprise: () => false }); + + const { getByTestId, queryByTestId } = renderSessionPreview(); + + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + screen.getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).toHaveTextContent(UPSELL_TEXT); + + expect( + screen.queryByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).not.toHaveTextContent(NO_DATA_MESSAGE); + expect(queryByTestId(SESSION_PREVIEW_TEST_ID)).not.toBeInTheDocument(); + }); + + it('should not render link to session viewer if flyout is open in preview', () => { + (useSessionPreview as jest.Mock).mockReturnValue(sessionViewConfig); + (useLicense as jest.Mock).mockReturnValue({ isEnterprise: () => true }); + + const { getByTestId, queryByTestId } = renderSessionPreview({ + ...mockContextValue, + isPreview: true, + }); + + expect(getByTestId(SESSION_PREVIEW_TEST_ID)).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + }); + + it('should not render link to session viewer if flyout is open in preview mode', () => { + (useSessionPreview as jest.Mock).mockReturnValue(sessionViewConfig); + (useLicense as jest.Mock).mockReturnValue({ isEnterprise: () => true }); + + const { getByTestId, queryByTestId } = renderSessionPreview({ + ...mockContextValue, + isPreviewMode: true, + }); + + expect(getByTestId(SESSION_PREVIEW_TEST_ID)).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + }); + + describe('when visualization in flyout flag is enabled', () => { + it('should open left panel vizualization tab when visualization in flyout flag is on', () => { + mockUseUiSetting.mockReturnValue([true]); + (useSessionPreview as jest.Mock).mockReturnValue(sessionViewConfig); + (useLicense as jest.Mock).mockReturnValue({ isEnterprise: () => true }); + + const { getByTestId } = renderSessionPreview(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)).click(); + + expect(mockNavigateToSessionView).toHaveBeenCalled(); + }); + + it('should not render link to session viewer if flyout is open in rule preview', () => { + (useSessionPreview as jest.Mock).mockReturnValue(sessionViewConfig); + (useLicense as jest.Mock).mockReturnValue({ isEnterprise: () => true }); + + const { getByTestId, queryByTestId } = renderSessionPreview({ + ...mockContextValue, + isPreview: true, + }); + + expect(getByTestId(SESSION_PREVIEW_TEST_ID)).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + }); + + it('should not render link to session viewer if flyout is open in preview mode', () => { + (useSessionPreview as jest.Mock).mockReturnValue(sessionViewConfig); + (useLicense as jest.Mock).mockReturnValue({ isEnterprise: () => true }); + + const { getByTestId, queryByTestId } = renderSessionPreview({ + ...mockContextValue, + isPreview: true, + }); + + expect(getByTestId(SESSION_PREVIEW_TEST_ID)).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + }); + }); + + describe('when new navigation is enabled', () => { + describe('when visualization in flyout flag is enabled', () => { + beforeEach(() => { + jest.clearAllMocks(); + mockUseUiSetting.mockReturnValue([true]); + (useSessionPreview as jest.Mock).mockReturnValue(sessionViewConfig); + (useLicense as jest.Mock).mockReturnValue({ isEnterprise: () => true }); + (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(true); + }); + + it('should open left panel vizualization tab when visualization in flyout flag is on', () => { + const { getByTestId } = renderSessionPreview(); + + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)).click(); + + expect(mockNavigateToSessionView).toHaveBeenCalled(); + }); + + it('should not render link to session viewer if flyout is open in rule preview', () => { + const { getByTestId, queryByTestId } = renderSessionPreview({ + ...mockContextValue, + isPreview: true, + }); + + expect(getByTestId(SESSION_PREVIEW_TEST_ID)).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + }); + + it('should render link to session viewer if flyout is open in preview mode', () => { + const { getByTestId } = renderSessionPreview({ + ...mockContextValue, + isPreviewMode: true, + }); + + expect(getByTestId(SESSION_PREVIEW_TEST_ID)).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)).click(); + expect(mockNavigateToSessionView).toHaveBeenCalled(); + }); + }); + + describe('when visualization in flyout flag is not enabled', () => { + beforeEach(() => { + jest.clearAllMocks(); + mockUseUiSetting.mockReturnValue([false]); + (useSessionPreview as jest.Mock).mockReturnValue(sessionViewConfig); + (useLicense as jest.Mock).mockReturnValue({ isEnterprise: () => true }); + (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(true); + }); + + it('should open session viewer in timeline', () => { + const { getByTestId } = renderSessionPreview(); + const { investigateInTimelineAlertClick } = useInvestigateInTimeline({}); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)).click(); + + expect(investigateInTimelineAlertClick).toHaveBeenCalled(); + }); + + it('should not render link to session viewer if flyout is open in rule preview', () => { + const { getByTestId, queryByTestId } = renderSessionPreview({ + ...mockContextValue, + isPreview: true, + }); + + expect(getByTestId(SESSION_PREVIEW_TEST_ID)).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + }); + + it('should render link to open session viewer in timeline if flyout is open in preview mode', () => { + const { getByTestId } = renderSessionPreview({ + ...mockContextValue, + isPreviewMode: true, + }); + const { investigateInTimelineAlertClick } = useInvestigateInTimeline({}); + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(SESSION_PREVIEW_TEST_ID)).click(); + expect(investigateInTimelineAlertClick).toHaveBeenCalled(); + }); + }); + }); +}); diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/session_preview_container.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/session_preview_container.tsx new file mode 100644 index 0000000000000..2b9ffc32b871e --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/session_preview_container.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, { type FC, useCallback, useMemo } from 'react'; +import { TimelineTabs } from '@kbn/securitysolution-data-table'; +import { useDispatch } from 'react-redux'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { useUiSetting$ } from '@kbn/kibana-react-plugin/public'; +import { ENABLE_VISUALIZATIONS_IN_FLYOUT_SETTING } from '../../../../../common/constants'; +import { useLicense } from '../../../../common/hooks/use_license'; +import { SessionPreview } from './session_preview'; +import { useSessionPreview } from '../hooks/use_session_preview'; +import { useInvestigateInTimeline } from '../../../../detections/components/alerts_table/timeline_actions/use_investigate_in_timeline'; +import { useDocumentDetailsContext } from '../../shared/context'; +import { ALERTS_ACTIONS } from '../../../../common/lib/apm/user_actions'; +import { ExpandablePanel } from '../../../shared/components/expandable_panel'; +import { SESSION_PREVIEW_TEST_ID } from './test_ids'; +import { useStartTransaction } from '../../../../common/lib/apm/use_start_transaction'; +import { setActiveTabTimeline } from '../../../../timelines/store/actions'; +import { getScopedActions } from '../../../../helpers'; +import { useNavigateToSessionView } from '../../shared/hooks/use_navigate_to_session_view'; +import { SessionViewNoDataMessage } from '../../shared/components/session_view_no_data_message'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; + +const timelineId = 'timeline-1'; + +/** + * Checks if the SessionView component is available, if so render it or else render an error message + */ +export const SessionPreviewContainer: FC = () => { + const { + eventId, + indexName, + scopeId, + dataAsNestedObject, + getFieldsData, + isPreview, + isPreviewMode, + dataFormattedForFieldBrowser, + } = useDocumentDetailsContext(); + + const [visualizationInFlyoutEnabled] = useUiSetting$<boolean>( + ENABLE_VISUALIZATIONS_IN_FLYOUT_SETTING + ); + + // decide whether to show the session view or not + const sessionViewConfig = useSessionPreview({ getFieldsData, dataFormattedForFieldBrowser }); + const isEnterprisePlus = useLicense().isEnterprise(); + const isEnabled = sessionViewConfig && isEnterprisePlus; + + const isNewNavigationEnabled = useIsExperimentalFeatureEnabled( + 'newExpandableFlyoutNavigationEnabled' + ); + + const dispatch = useDispatch(); + const { startTransaction } = useStartTransaction(); + const scopedActions = getScopedActions(timelineId); + const { investigateInTimelineAlertClick } = useInvestigateInTimeline({ + ecsRowData: dataAsNestedObject, + }); + + const goToSessionViewTab = useCallback(async () => { + // open timeline + await investigateInTimelineAlertClick(); + + // open session view tab + startTransaction({ name: ALERTS_ACTIONS.OPEN_SESSION_VIEW }); + if (sessionViewConfig !== null) { + dispatch(setActiveTabTimeline({ id: timelineId, activeTab: TimelineTabs.session })); + if (scopedActions) { + dispatch(scopedActions.updateSessionViewConfig({ id: timelineId, sessionViewConfig })); + } + } + }, [ + dispatch, + investigateInTimelineAlertClick, + scopedActions, + sessionViewConfig, + startTransaction, + ]); + + const { navigateToSessionView } = useNavigateToSessionView({ + eventId, + indexName, + isFlyoutOpen: true, + scopeId, + }); + + const iconType = useMemo(() => { + const icon = visualizationInFlyoutEnabled ? 'arrowStart' : 'timeline'; + return !isPreviewMode ? icon : undefined; + }, [visualizationInFlyoutEnabled, isPreviewMode]); + + const isNavigationEnabled = useMemo(() => { + // if the session view is not enabled or in rule preview mode, the navigation is not enabled + if (!isEnabled || isPreview) { + return false; + } + // if the new navigation is enabled, the navigation is enabled (flyout or timeline) + if (isNewNavigationEnabled) { + return true; + } + // if the new navigation is not enabled, the navigation is enabled if the flyout is not in preview mode + return !isPreviewMode; + }, [isNewNavigationEnabled, isPreviewMode, isEnabled, isPreview]); + + return ( + <ExpandablePanel + header={{ + title: ( + <FormattedMessage + id="xpack.securitySolution.flyout.right.visualizations.sessionPreview.sessionPreviewTitle" + defaultMessage="Session viewer preview" + /> + ), + iconType, + ...(isNavigationEnabled && { + link: { + callback: visualizationInFlyoutEnabled ? navigateToSessionView : goToSessionViewTab, + tooltip: ( + <FormattedMessage + id="xpack.securitySolution.flyout.right.visualizations.sessionPreview.sessionPreviewTooltip" + defaultMessage="Investigate in timeline" + /> + ), + }, + }), + }} + data-test-subj={SESSION_PREVIEW_TEST_ID} + > + {isEnabled ? ( + <SessionPreview /> + ) : ( + <SessionViewNoDataMessage + isEnterprisePlus={isEnterprisePlus} + hasSessionViewConfig={sessionViewConfig !== null} + /> + )} + </ExpandablePanel> + ); +}; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/severity.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/severity.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/severity.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/severity.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/severity.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/severity.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/severity.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/severity.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/status.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/status.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/status.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/status.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/status.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/status.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/status.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/status.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/status_popover_button.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/status_popover_button.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/status_popover_button.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/status_popover_button.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/status_popover_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/status_popover_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/status_popover_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/status_popover_button.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/suppressed_alerts.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/suppressed_alerts.test.tsx new file mode 100644 index 0000000000000..17b351690ba0f --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/suppressed_alerts.test.tsx @@ -0,0 +1,83 @@ +/* + * 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 { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; +import { render } from '@testing-library/react'; +import { + SUMMARY_ROW_TEXT_TEST_ID, + CORRELATIONS_SUPPRESSED_ALERTS_TEST_ID, + CORRELATIONS_SUPPRESSED_ALERTS_TECHNICAL_PREVIEW_TEST_ID, + SUMMARY_ROW_BUTTON_TEST_ID, +} from './test_ids'; +import { SuppressedAlerts } from './suppressed_alerts'; +import { isSuppressionRuleInGA } from '../../../../../common/detection_engine/utils'; +import { useNavigateToLeftPanel } from '../../shared/hooks/use_navigate_to_left_panel'; + +jest.mock('../../shared/context'); +jest.mock('../../../../../common/detection_engine/utils', () => ({ + isSuppressionRuleInGA: jest.fn().mockReturnValue(false), +})); + +const mockNavigateToLeftPanel = jest.fn(); +jest.mock('../../shared/hooks/use_navigate_to_left_panel'); + +const TEXT_TEST_ID = SUMMARY_ROW_TEXT_TEST_ID(CORRELATIONS_SUPPRESSED_ALERTS_TEST_ID); +const BUTTON_TEST_ID = SUMMARY_ROW_BUTTON_TEST_ID(CORRELATIONS_SUPPRESSED_ALERTS_TEST_ID); + +const renderSuppressedAlerts = (alertSuppressionCount: number) => + render( + <IntlProvider locale="en"> + <SuppressedAlerts alertSuppressionCount={alertSuppressionCount} ruleType="query" /> + </IntlProvider> + ); + +const isSuppressionRuleInGAMock = isSuppressionRuleInGA as jest.Mock; + +describe('<SuppressedAlerts />', () => { + beforeEach(() => { + jest.clearAllMocks(); + + (useNavigateToLeftPanel as jest.Mock).mockReturnValue({ + navigateToLeftPanel: mockNavigateToLeftPanel, + isEnabled: true, + }); + }); + + it('should render single suppressed alert correctly', () => { + const { getByTestId } = renderSuppressedAlerts(1); + + expect(getByTestId(TEXT_TEST_ID)).toHaveTextContent('Suppressed alert'); + expect(getByTestId(BUTTON_TEST_ID)).toHaveTextContent('1'); + expect( + getByTestId(CORRELATIONS_SUPPRESSED_ALERTS_TECHNICAL_PREVIEW_TEST_ID) + ).toBeInTheDocument(); + }); + + it('should render multiple suppressed alerts row correctly', () => { + const { getByTestId } = renderSuppressedAlerts(2); + + expect(getByTestId(TEXT_TEST_ID)).toHaveTextContent('Suppressed alerts'); + expect(getByTestId(BUTTON_TEST_ID)).toHaveTextContent('2'); + }); + + it('should not render Technical Preview badge if rule type is in GA', () => { + isSuppressionRuleInGAMock.mockReturnValueOnce(true); + const { queryByTestId } = renderSuppressedAlerts(2); + + expect( + queryByTestId(CORRELATIONS_SUPPRESSED_ALERTS_TECHNICAL_PREVIEW_TEST_ID) + ).not.toBeInTheDocument(); + }); + + it('should open the expanded section to the correct tab when the number is clicked', () => { + const { getByTestId } = renderSuppressedAlerts(1); + getByTestId(BUTTON_TEST_ID).click(); + + expect(mockNavigateToLeftPanel).toHaveBeenCalled(); + }); +}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/suppressed_alerts.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/suppressed_alerts.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/suppressed_alerts.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/suppressed_alerts.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_name_cell.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/table_field_name_cell.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_name_cell.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/table_field_name_cell.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_name_cell.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/table_field_name_cell.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_name_cell.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/table_field_name_cell.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.test.tsx similarity index 94% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.test.tsx index eec53dbe3d262..2c7abe5bb1d27 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.test.tsx @@ -9,7 +9,6 @@ import { render, screen } from '@testing-library/react'; import React from 'react'; import type { FieldSpec } from '@kbn/data-plugin/common'; import { DocumentDetailsContext } from '../../shared/context'; -import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; import type { EventFieldsData } from '../../../../common/components/event_details/types'; import { TableFieldValueCell } from './table_field_value_cell'; @@ -35,9 +34,6 @@ jest.mock('../../../../common/lib/kibana', () => { }; }); -jest.mock('../../../../common/hooks/use_experimental_features'); -const mockUseIsExperimentalFeatureEnabled = useIsExperimentalFeatureEnabled as jest.Mock; - const panelContextValue = { eventId: 'event id', indexName: 'indexName', @@ -66,7 +62,6 @@ describe('TableFieldValueCell', () => { beforeAll(() => { jest.clearAllMocks(); jest.mocked(useExpandableFlyoutApi).mockReturnValue(mockFlyoutApi); - mockUseIsExperimentalFeatureEnabled.mockReturnValue(false); }); describe('common behavior', () => { @@ -213,7 +208,7 @@ describe('TableFieldValueCell', () => { }); }); - it('should open preview when preview is not disabled', () => { + it('should open preview', () => { screen.getByTestId(`${FLYOUT_TABLE_PREVIEW_LINK_FIELD_TEST_ID}-0`).click(); expect(mockFlyoutApi.openPreviewPanel).toHaveBeenCalledWith({ diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.tsx similarity index 93% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.tsx index a0095bb8eadf0..17ea9980f1ee0 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.tsx @@ -8,7 +8,6 @@ import React, { memo } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; import type { FieldSpec } from '@kbn/data-plugin/common'; -import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; import { getFieldFormat } from '../utils/get_field_format'; import type { EventFieldsData } from '../../../../common/components/event_details/types'; import { OverflowField } from '../../../../common/components/tables/helpers'; @@ -66,7 +65,6 @@ export const TableFieldValueCell = memo( values, isPreview, }: FieldValueCellProps) => { - const isPreviewEnabled = !useIsExperimentalFeatureEnabled('entityAlertPreviewDisabled'); if (values == null) { return null; } @@ -92,7 +90,7 @@ export const TableFieldValueCell = memo( <EuiFlexItem grow={false} key={`${i}-${value}`}> {data.field === MESSAGE_FIELD_NAME ? ( <OverflowField value={value} /> - ) : isPreviewEnabled && hasPreview(data.field) ? ( + ) : hasPreview(data.field) ? ( <PreviewLink field={data.field} value={value} diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/test_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/test_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/test_ids.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/threat_intelligence_overview.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/threat_intelligence_overview.test.tsx similarity index 79% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/threat_intelligence_overview.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/threat_intelligence_overview.test.tsx index 1d19dacc39d42..1a48713701761 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/threat_intelligence_overview.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/threat_intelligence_overview.test.tsx @@ -8,13 +8,9 @@ import React from 'react'; import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { render } from '@testing-library/react'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; import { useDocumentDetailsContext } from '../../shared/context'; import { ThreatIntelligenceOverview } from './threat_intelligence_overview'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; -import { LeftPanelInsightsTab } from '../../left'; import { useFetchThreatIntelligence } from '../hooks/use_fetch_threat_intelligence'; -import { THREAT_INTELLIGENCE_TAB_ID } from '../../left/components/threat_intelligence_details'; import { INSIGHTS_THREAT_INTELLIGENCE_ENRICHED_WITH_THREAT_INTELLIGENCE_TEST_ID, INSIGHTS_THREAT_INTELLIGENCE_TEST_ID, @@ -29,11 +25,14 @@ import { EXPANDABLE_PANEL_LOADING_TEST_ID, EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID, } from '../../../shared/components/test_ids'; +import { useNavigateToLeftPanel } from '../../shared/hooks/use_navigate_to_left_panel'; -jest.mock('@kbn/expandable-flyout'); jest.mock('../../shared/context'); jest.mock('../hooks/use_fetch_threat_intelligence'); +const mockNavigateToLeftPanel = jest.fn(); +jest.mock('../../shared/hooks/use_navigate_to_left_panel'); + const TOGGLE_ICON_TEST_ID = EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID( INSIGHTS_THREAT_INTELLIGENCE_TEST_ID ); @@ -60,10 +59,6 @@ const ENRICHED_WITH_THREAT_INTELLIGENCE_BUTTON_TEST_ID = SUMMARY_ROW_BUTTON_TEST INSIGHTS_THREAT_INTELLIGENCE_ENRICHED_WITH_THREAT_INTELLIGENCE_TEST_ID ); -const mockOpenLeftPanel = jest.fn(); -const eventId = 'eventId'; -const indexName = 'indexName'; -const scopeId = 'scopeId'; const dataFormattedForFieldBrowser = ['scopeId']; const renderThreatIntelligenceOverview = () => @@ -76,22 +71,20 @@ const renderThreatIntelligenceOverview = () => describe('<ThreatIntelligenceOverview />', () => { beforeEach(() => { jest.clearAllMocks(); - (useDocumentDetailsContext as jest.Mock).mockReturnValue({ - eventId, - indexName, - scopeId, dataFormattedForFieldBrowser, isPreviewMode: false, }); - (useExpandableFlyoutApi as jest.Mock).mockReturnValue({ openLeftPanel: mockOpenLeftPanel }); - }); - - it('should render wrapper component', () => { (useFetchThreatIntelligence as jest.Mock).mockReturnValue({ loading: false, }); + (useNavigateToLeftPanel as jest.Mock).mockReturnValue({ + navigateToLeftPanel: mockNavigateToLeftPanel, + isEnabled: true, + }); + }); + it('should render wrapper component', () => { const { getByTestId, queryByTestId } = renderThreatIntelligenceOverview(); expect(queryByTestId(TOGGLE_ICON_TEST_ID)).not.toBeInTheDocument(); @@ -100,22 +93,28 @@ describe('<ThreatIntelligenceOverview />', () => { expect(queryByTestId(TITLE_TEXT_TEST_ID)).not.toBeInTheDocument(); }); - it('should not render link if isPreviewMode is true', () => { + it('should render link without icon if in preview mode', () => { (useDocumentDetailsContext as jest.Mock).mockReturnValue({ - eventId, - indexName, - scopeId, dataFormattedForFieldBrowser, isPreviewMode: true, }); - (useFetchThreatIntelligence as jest.Mock).mockReturnValue({ - loading: false, + (useNavigateToLeftPanel as jest.Mock).mockReturnValue({ + navigateToLeftPanel: mockNavigateToLeftPanel, + isEnabled: true, + }); + const { getByTestId, queryByTestId } = renderThreatIntelligenceOverview(); + expect(queryByTestId(TITLE_ICON_TEST_ID)).not.toBeInTheDocument(); + expect(getByTestId(TITLE_LINK_TEST_ID)).toBeInTheDocument(); + }); + + it('should not render link if navigation is not enabled', () => { + (useNavigateToLeftPanel as jest.Mock).mockReturnValue({ + navigateToLeftPanel: mockNavigateToLeftPanel, + isEnabled: false, }); const { getByTestId, queryByTestId } = renderThreatIntelligenceOverview(); - expect(queryByTestId(TOGGLE_ICON_TEST_ID)).not.toBeInTheDocument(); - expect(queryByTestId(TITLE_ICON_TEST_ID)).not.toBeInTheDocument(); expect(queryByTestId(TITLE_LINK_TEST_ID)).not.toBeInTheDocument(); expect(getByTestId(TITLE_TEXT_TEST_ID)).toBeInTheDocument(); }); @@ -175,18 +174,7 @@ describe('<ThreatIntelligenceOverview />', () => { const { getByTestId } = renderThreatIntelligenceOverview(); getByTestId(TITLE_LINK_TEST_ID).click(); - expect(mockOpenLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { - tab: LeftPanelInsightsTab, - subTab: THREAT_INTELLIGENCE_TAB_ID, - }, - params: { - id: eventId, - indexName, - scopeId, - }, - }); + expect(mockNavigateToLeftPanel).toHaveBeenCalled(); }); it('should open the expanded section to the correct tab when the number is clicked', () => { @@ -199,32 +187,10 @@ describe('<ThreatIntelligenceOverview />', () => { const { getByTestId } = renderThreatIntelligenceOverview(); getByTestId(THREAT_MATCHES_BUTTON_TEST_ID).click(); - expect(mockOpenLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { - tab: LeftPanelInsightsTab, - subTab: THREAT_INTELLIGENCE_TAB_ID, - }, - params: { - id: eventId, - indexName, - scopeId, - }, - }); + expect(mockNavigateToLeftPanel).toHaveBeenCalled(); getByTestId(ENRICHED_WITH_THREAT_INTELLIGENCE_BUTTON_TEST_ID).click(); - expect(mockOpenLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { - tab: LeftPanelInsightsTab, - subTab: THREAT_INTELLIGENCE_TAB_ID, - }, - params: { - id: eventId, - indexName, - scopeId, - }, - }); + expect(mockNavigateToLeftPanel).toHaveBeenCalled(); }); }); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/threat_intelligence_overview.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/threat_intelligence_overview.tsx similarity index 82% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/threat_intelligence_overview.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/threat_intelligence_overview.tsx index 73dfc62520c32..0399ddbd5466c 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/threat_intelligence_overview.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/threat_intelligence_overview.tsx @@ -6,9 +6,8 @@ */ import type { FC } from 'react'; -import React, { useCallback, useMemo } from 'react'; +import React, { useMemo } from 'react'; import { EuiFlexGroup } from '@elastic/eui'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; import { FormattedMessage } from '@kbn/i18n-react'; import { ExpandablePanel } from '../../../shared/components/expandable_panel'; import { useFetchThreatIntelligence } from '../hooks/use_fetch_threat_intelligence'; @@ -19,9 +18,9 @@ import { INSIGHTS_THREAT_INTELLIGENCE_TEST_ID, INSIGHTS_THREAT_INTELLIGENCE_THREAT_MATCHES_TEST_ID, } from './test_ids'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; import { LeftPanelInsightsTab } from '../../left'; import { THREAT_INTELLIGENCE_TAB_ID } from '../../left/components/threat_intelligence_details'; +import { useNavigateToLeftPanel } from '../../shared/hooks/use_navigate_to_left_panel'; const TITLE = ( <FormattedMessage @@ -42,24 +41,13 @@ const TOOLTIP = ( * and the SummaryPanel component for data rendering. */ export const ThreatIntelligenceOverview: FC = () => { - const { eventId, indexName, scopeId, dataFormattedForFieldBrowser, isPreviewMode } = - useDocumentDetailsContext(); - const { openLeftPanel } = useExpandableFlyoutApi(); + const { dataFormattedForFieldBrowser, isPreviewMode } = useDocumentDetailsContext(); - const goToThreatIntelligenceTab = useCallback(() => { - openLeftPanel({ - id: DocumentDetailsLeftPanelKey, - path: { - tab: LeftPanelInsightsTab, - subTab: THREAT_INTELLIGENCE_TAB_ID, - }, - params: { - id: eventId, - indexName, - scopeId, - }, + const { navigateToLeftPanel: goToThreatIntelligenceTab, isEnabled: isLinkEnabled } = + useNavigateToLeftPanel({ + tab: LeftPanelInsightsTab, + subTab: THREAT_INTELLIGENCE_TAB_ID, }); - }, [eventId, openLeftPanel, indexName, scopeId]); const { loading, threatMatchesCount, threatEnrichmentsCount } = useFetchThreatIntelligence({ dataFormattedForFieldBrowser, @@ -67,13 +55,13 @@ export const ThreatIntelligenceOverview: FC = () => { const link = useMemo( () => - !isPreviewMode + isLinkEnabled ? { callback: goToThreatIntelligenceTab, tooltip: TOOLTIP, } : undefined, - [isPreviewMode, goToThreatIntelligenceTab] + [goToThreatIntelligenceTab, isLinkEnabled] ); const threatMatchCountText = useMemo( diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/user_entity_overview.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/user_entity_overview.test.tsx similarity index 86% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/user_entity_overview.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/user_entity_overview.test.tsx index 5df159c2e5a29..ad09269a6103e 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/user_entity_overview.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/user_entity_overview.test.tsx @@ -23,12 +23,8 @@ import { useObservedUserDetails } from '../../../../explore/users/containers/use import { mockContextValue } from '../../shared/mocks/mock_context'; import { mockDataFormattedForFieldBrowser } from '../../shared/mocks/mock_data_formatted_for_field_browser'; import { DocumentDetailsContext } from '../../shared/context'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; -import { LeftPanelInsightsTab } from '../../left'; -import { ENTITIES_TAB_ID } from '../../left/components/entities_details'; import { useRiskScore } from '../../../../entity_analytics/api/hooks/use_risk_score'; import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; import { mockFlyoutApi } from '../../shared/mocks/mock_flyout_context'; import { UserPreviewPanelKey } from '../../../entity_details/user_right'; import { useAlertsByStatus } from '../../../../overview/components/detection_response/alerts_by_status/use_alerts_by_status'; @@ -71,9 +67,6 @@ const mockAlertData = { }, }; -jest.mock('../../../../common/hooks/use_experimental_features'); -const mockUseIsExperimentalFeatureEnabled = useIsExperimentalFeatureEnabled as jest.Mock; - const mockUseGlobalTime = jest.fn().mockReturnValue({ from, to }); jest.mock('../../../../common/containers/use_global_time', () => { return { @@ -109,7 +102,6 @@ const renderUserEntityOverview = () => describe('<UserEntityOverview />', () => { beforeAll(() => { jest.mocked(useExpandableFlyoutApi).mockReturnValue(mockFlyoutApi); - mockUseIsExperimentalFeatureEnabled.mockReturnValue(true); (useMisconfigurationPreview as jest.Mock).mockReturnValue({}); (useAlertsByStatus as jest.Mock).mockReturnValue({ isLoading: false, items: {} }); }); @@ -190,34 +182,9 @@ describe('<UserEntityOverview />', () => { expect(queryByTestId(ENTITIES_USER_OVERVIEW_DOMAIN_TEST_ID)).not.toBeInTheDocument(); }); - it('should navigate to left panel entities tab when clicking on title when feature flag is off', () => { - mockUseUserDetails.mockReturnValue([false, { userDetails: userData }]); - mockUseRiskScore.mockReturnValue({ data: riskLevel, isAuthorized: true }); - - const { getByTestId } = render( - <TestProviders> - <DocumentDetailsContext.Provider value={panelContextValue}> - <UserEntityOverview userName={userName} /> - </DocumentDetailsContext.Provider> - </TestProviders> - ); - - getByTestId(ENTITIES_USER_OVERVIEW_LINK_TEST_ID).click(); - expect(mockFlyoutApi.openLeftPanel).toHaveBeenCalledWith({ - id: DocumentDetailsLeftPanelKey, - path: { tab: LeftPanelInsightsTab, subTab: ENTITIES_TAB_ID }, - params: { - id: panelContextValue.eventId, - indexName: panelContextValue.indexName, - scopeId: panelContextValue.scopeId, - }, - }); - }); - - it('should open user preview if feature flag is true', () => { + it('should open user preview', () => { mockUseUserDetails.mockReturnValue([false, { userDetails: userData }]); mockUseRiskScore.mockReturnValue({ data: riskLevel, isAuthorized: true }); - mockUseIsExperimentalFeatureEnabled.mockReturnValue(false); const { getByTestId } = render( <TestProviders> diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/user_entity_overview.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/user_entity_overview.tsx similarity index 82% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/user_entity_overview.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/user_entity_overview.tsx index 1008f6139cd67..22f889a61c54e 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/user_entity_overview.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/user_entity_overview.tsx @@ -5,13 +5,12 @@ * 2.0. */ -import React, { useCallback, useMemo } from 'react'; +import React, { useMemo } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiText, - EuiLink, useEuiTheme, useEuiFontSize, EuiSkeletonText, @@ -19,11 +18,6 @@ import { import { css } from '@emotion/css'; import { getOr } from 'lodash/fp'; import { i18n } from '@kbn/i18n'; -import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; -import { DocumentDetailsLeftPanelKey } from '../../shared/constants/panel_keys'; -import { LeftPanelInsightsTab } from '../../left'; -import { ENTITIES_TAB_ID } from '../../left/components/entities_details'; import { useDocumentDetailsContext } from '../../shared/context'; import type { DescriptionList } from '../../../../../common/utility_types'; import { USER_NAME_FIELD_NAME } from '../../../../timelines/components/timeline/body/renderers/constants'; @@ -83,22 +77,7 @@ export const USER_PREVIEW_BANNER = { * User preview content for the entities preview in right flyout. It contains ip addresses and risk level */ export const UserEntityOverview: React.FC<UserEntityOverviewProps> = ({ userName }) => { - const { eventId, indexName, scopeId } = useDocumentDetailsContext(); - const { openLeftPanel } = useExpandableFlyoutApi(); - - const isPreviewEnabled = !useIsExperimentalFeatureEnabled('entityAlertPreviewDisabled'); - - const goToEntitiesTab = useCallback(() => { - openLeftPanel({ - id: DocumentDetailsLeftPanelKey, - path: { tab: LeftPanelInsightsTab, subTab: ENTITIES_TAB_ID }, - params: { - id: eventId, - indexName, - scopeId, - }, - }); - }, [eventId, openLeftPanel, indexName, scopeId]); + const { scopeId } = useDocumentDetailsContext(); const { from, to } = useGlobalTime(); const { selectedPatterns } = useSourcererDataView(); @@ -210,34 +189,21 @@ export const UserEntityOverview: React.FC<UserEntityOverviewProps> = ({ userName <EuiIcon type={USER_ICON} /> </EuiFlexItem> <EuiFlexItem grow={false}> - {isPreviewEnabled ? ( - <PreviewLink - field={USER_NAME_FIELD_NAME} - value={userName} - scopeId={scopeId} - data-test-subj={ENTITIES_USER_OVERVIEW_LINK_TEST_ID} - > - <EuiText - css={css` - font-size: ${xsFontSize}; - font-weight: ${euiTheme.font.weight.bold}; - `} - > - {userName} - </EuiText> - </PreviewLink> - ) : ( - <EuiLink - data-test-subj={ENTITIES_USER_OVERVIEW_LINK_TEST_ID} + <PreviewLink + field={USER_NAME_FIELD_NAME} + value={userName} + scopeId={scopeId} + data-test-subj={ENTITIES_USER_OVERVIEW_LINK_TEST_ID} + > + <EuiText css={css` font-size: ${xsFontSize}; font-weight: ${euiTheme.font.weight.bold}; `} - onClick={goToEntitiesTab} > {userName} - </EuiLink> - )} + </EuiText> + </PreviewLink> </EuiFlexItem> </EuiFlexGroup> </EuiFlexItem> diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/visualizations_section.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/visualizations_section.test.tsx similarity index 99% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/visualizations_section.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/visualizations_section.test.tsx index 6fb4d5d30b897..dc3b1f00e0d50 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/visualizations_section.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/visualizations_section.test.tsx @@ -106,6 +106,7 @@ describe('<VisualizationsSection />', () => { }); mockUseGraphPreview.mockReturnValue({ hasGraphRepresentation: true, + eventIds: [], }); mockUseFetchGraphData.mockReturnValue({ isLoading: false, diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/visualizations_section.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/visualizations_section.tsx similarity index 94% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/visualizations_section.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/visualizations_section.tsx index 23bea1f8fecdd..467171cd49f2a 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/visualizations_section.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/components/visualizations_section.tsx @@ -28,7 +28,8 @@ const KEY = 'visualizations'; */ export const VisualizationsSection = memo(() => { const expanded = useExpandSection({ title: KEY, defaultValue: false }); - const { dataAsNestedObject, getFieldsData } = useDocumentDetailsContext(); + const { dataAsNestedObject, getFieldsData, dataFormattedForFieldBrowser } = + useDocumentDetailsContext(); const [visualizationInFlyoutEnabled] = useUiSetting$<boolean>( ENABLE_VISUALIZATIONS_IN_FLYOUT_SETTING @@ -42,6 +43,7 @@ export const VisualizationsSection = memo(() => { const { hasGraphRepresentation } = useGraphPreview({ getFieldsData, ecsData: dataAsNestedObject, + dataFormattedForFieldBrowser, }); const shouldShowGraphPreview = diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/content.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/content.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/footer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/footer.test.tsx new file mode 100644 index 0000000000000..026abf135e3ee --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/footer.test.tsx @@ -0,0 +1,70 @@ +/* + * 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 { render } from '@testing-library/react'; +import { PanelFooter } from './footer'; +import { TestProviders } from '../../../common/mock'; +import { mockContextValue } from '../shared/mocks/mock_context'; +import { DocumentDetailsContext } from '../shared/context'; +import { FLYOUT_FOOTER_TEST_ID } from './test_ids'; +import { FLYOUT_FOOTER_DROPDOWN_BUTTON_TEST_ID } from '../shared/components/test_ids'; +import { useKibana } from '../../../common/lib/kibana'; +import { useAlertExceptionActions } from '../../../detections/components/alerts_table/timeline_actions/use_add_exception_actions'; +import { useInvestigateInTimeline } from '../../../detections/components/alerts_table/timeline_actions/use_investigate_in_timeline'; +import { useAddToCaseActions } from '../../../detections/components/alerts_table/timeline_actions/use_add_to_case_actions'; + +jest.mock('../../../common/lib/kibana'); +jest.mock('react-router-dom', () => { + const original = jest.requireActual('react-router-dom'); + return { + ...original, + useLocation: jest.fn().mockReturnValue({ search: '' }), + }; +}); +jest.mock('../../../detections/components/alerts_table/timeline_actions/use_add_exception_actions'); +jest.mock( + '../../../detections/components/alerts_table/timeline_actions/use_investigate_in_timeline' +); +jest.mock('../../../detections/components/alerts_table/timeline_actions/use_add_to_case_actions'); + +describe('PanelFooter', () => { + it('should not render the take action dropdown if preview mode', () => { + const { queryByTestId } = render( + <TestProviders> + <DocumentDetailsContext.Provider value={mockContextValue}> + <PanelFooter isPreview={true} /> + </DocumentDetailsContext.Provider> + </TestProviders> + ); + + expect(queryByTestId(FLYOUT_FOOTER_TEST_ID)).not.toBeInTheDocument(); + }); + + it('should render the take action dropdown', () => { + (useKibana as jest.Mock).mockReturnValue({ + services: { + osquery: { isOsqueryAvailable: jest.fn() }, + cases: { hooks: { useIsAddToCaseOpen: jest.fn().mockReturnValue(false) } }, + }, + }); + (useAlertExceptionActions as jest.Mock).mockReturnValue({ exceptionActionItems: [] }); + (useInvestigateInTimeline as jest.Mock).mockReturnValue({ + investigateInTimelineActionItems: [{ name: 'test', onClick: jest.fn() }], + }); + (useAddToCaseActions as jest.Mock).mockReturnValue({ addToCaseActionItems: [] }); + + const wrapper = render( + <TestProviders> + <DocumentDetailsContext.Provider value={mockContextValue}> + <PanelFooter isPreview={false} /> + </DocumentDetailsContext.Provider> + </TestProviders> + ); + expect(wrapper.getByTestId(FLYOUT_FOOTER_TEST_ID)).toBeInTheDocument(); + expect(wrapper.getByTestId(FLYOUT_FOOTER_DROPDOWN_BUTTON_TEST_ID)).toBeInTheDocument(); + }); +}); diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/footer.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/footer.tsx new file mode 100644 index 0000000000000..ce955a0b87ddc --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/footer.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 type { FC } from 'react'; +import React from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiFlyoutFooter, EuiPanel } from '@elastic/eui'; +import { FLYOUT_FOOTER_TEST_ID } from './test_ids'; +import { TakeActionButton } from '../shared/components/take_action_button'; + +interface PanelFooterProps { + /** + * Boolean that indicates whether flyout is in preview and action should be hidden + */ + isPreview: boolean; +} + +/** + * Bottom section of the flyout that contains the take action button + */ +export const PanelFooter: FC<PanelFooterProps> = ({ isPreview }) => { + if (isPreview) return null; + + return ( + <EuiFlyoutFooter data-test-subj={FLYOUT_FOOTER_TEST_ID}> + <EuiPanel color="transparent"> + <EuiFlexGroup justifyContent="flexEnd" alignItems="center"> + <EuiFlexItem grow={false}> + <TakeActionButton /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiPanel> + </EuiFlyoutFooter> + ); +}; + +PanelFooter.displayName = 'PanelFooter'; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/header.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/header.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/header.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/header.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/header.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/header.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_accordion_state.test.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_accordion_state.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_accordion_state.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_accordion_state.test.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_accordion_state.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_accordion_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_accordion_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_accordion_state.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_assistant.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_assistant.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_assistant.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_assistant.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_assistant.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_assistant.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_assistant.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_assistant.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_expand_section.test.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_expand_section.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_expand_section.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_expand_section.test.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_expand_section.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_expand_section.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_expand_section.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_expand_section.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_fetch_threat_intelligence.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_fetch_threat_intelligence.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_fetch_threat_intelligence.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_fetch_threat_intelligence.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_fetch_threat_intelligence.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_fetch_threat_intelligence.ts similarity index 96% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_fetch_threat_intelligence.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_fetch_threat_intelligence.ts index 7f9f26cb89da1..323540ce33d37 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_fetch_threat_intelligence.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_fetch_threat_intelligence.ts @@ -58,7 +58,7 @@ export const useFetchThreatIntelligence = ({ const { isAlert } = useBasicDataFromDetailsData(dataFormattedForFieldBrowser); // retrieve the threat enrichment fields with value for the current document - // (see https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/common/cti/constants.ts#L35) + // (see https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/common/cti/constants.ts#L35) const eventFields = useMemo( () => getEnrichmentFields(dataFormattedForFieldBrowser || []), [dataFormattedForFieldBrowser] diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_flyout_is_expandable.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_flyout_is_expandable.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_flyout_is_expandable.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_flyout_is_expandable.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_flyout_is_expandable.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_flyout_is_expandable.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_flyout_is_expandable.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_flyout_is_expandable.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_get_flyout_link.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_get_flyout_link.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_get_flyout_link.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_get_flyout_link.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_get_flyout_link.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_get_flyout_link.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_get_flyout_link.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_get_flyout_link.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_process_data.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_process_data.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_process_data.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_process_data.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_process_data.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_process_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_process_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_process_data.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_refetch_by_scope.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_refetch_by_scope.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_refetch_by_scope.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_refetch_by_scope.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_session_preview.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_session_preview.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_session_preview.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_session_preview.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_session_preview.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_session_preview.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_session_preview.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_session_preview.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_tabs.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_tabs.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_tabs.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_tabs.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_tabs.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_tabs.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_tabs.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/hooks/use_tabs.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/index.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/mocks/mock_analyzer_data.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/mocks/mock_analyzer_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/mocks/mock_analyzer_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/mocks/mock_analyzer_data.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/navigation.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/navigation.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/navigation.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/navigation.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/tabs.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/tabs/json_tab.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/tabs/json_tab.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/tabs/json_tab.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/tabs/json_tab.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/tabs/json_tab.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/tabs/json_tab.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/tabs/json_tab.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/tabs/json_tab.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/tabs/overview_tab.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/tabs/overview_tab.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/tabs/overview_tab.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/tabs/overview_tab.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/tabs/table_tab.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/tabs/table_tab.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/tabs/table_tab.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/tabs/table_tab.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/tabs/table_tab.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/tabs/table_tab.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/tabs/table_tab.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/tabs/table_tab.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/tabs/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/tabs/test_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/tabs/test_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/tabs/test_ids.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/test_ids.ts new file mode 100644 index 0000000000000..ebfb197b319a3 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/test_ids.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 { PREFIX } from '../../shared/test_ids'; + +export const FLYOUT_BODY_TEST_ID = `${PREFIX}Body` as const; +export const FLYOUT_FOOTER_TEST_ID = `${PREFIX}Footer` as const; +export const OVERVIEW_TAB_TEST_ID = `${PREFIX}OverviewTab` as const; +export const TABLE_TAB_TEST_ID = `${PREFIX}TableTab` as const; +export const JSON_TAB_TEST_ID = `${PREFIX}JsonTab` as const; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/utils/analyzer_helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/utils/analyzer_helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/utils/analyzer_helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/utils/analyzer_helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/utils/analyzer_helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/utils/analyzer_helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/utils/analyzer_helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/utils/analyzer_helpers.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/utils/enriched_field_info.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/utils/enriched_field_info.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/utils/enriched_field_info.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/utils/enriched_field_info.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/utils/event_utils.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/utils/event_utils.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/utils/event_utils.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/utils/event_utils.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/utils/event_utils.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/utils/event_utils.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/utils/event_utils.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/utils/event_utils.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/utils/get_field_format.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/utils/get_field_format.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/utils/get_field_format.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/right/utils/get_field_format.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/components/alert_count_insight.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/alert_count_insight.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/components/alert_count_insight.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/alert_count_insight.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/components/alert_count_insight.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/alert_count_insight.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/components/alert_count_insight.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/alert_count_insight.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/components/cell_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/cell_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/components/cell_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/cell_actions.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/components/cell_tooltip_wrapper.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/cell_tooltip_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/components/cell_tooltip_wrapper.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/cell_tooltip_wrapper.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/components/cell_tooltip_wrapper.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/cell_tooltip_wrapper.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/components/cell_tooltip_wrapper.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/cell_tooltip_wrapper.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/components/insight_distribution_bar.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/insight_distribution_bar.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/components/insight_distribution_bar.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/insight_distribution_bar.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/components/insight_distribution_bar.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/insight_distribution_bar.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/components/insight_distribution_bar.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/insight_distribution_bar.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/components/misconfiguration_insight.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/misconfiguration_insight.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/components/misconfiguration_insight.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/misconfiguration_insight.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/components/misconfiguration_insight.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/misconfiguration_insight.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/components/misconfiguration_insight.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/misconfiguration_insight.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/components/session_view_no_data_message.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/session_view_no_data_message.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/components/session_view_no_data_message.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/session_view_no_data_message.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/components/session_view_no_data_message.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/session_view_no_data_message.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/components/session_view_no_data_message.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/session_view_no_data_message.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/take_action_button.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/take_action_button.test.tsx new file mode 100644 index 0000000000000..4326a60c4a0cf --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/take_action_button.test.tsx @@ -0,0 +1,74 @@ +/* + * 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 { render } from '@testing-library/react'; +import type { EcsSecurityExtension as Ecs } from '@kbn/securitysolution-ecs'; +import { TakeActionButton } from './take_action_button'; +import { TestProviders } from '../../../../common/mock'; +import { mockContextValue } from '../mocks/mock_context'; +import { DocumentDetailsContext } from '../context'; +import { FLYOUT_FOOTER_DROPDOWN_BUTTON_TEST_ID } from './test_ids'; +import { useKibana } from '../../../../common/lib/kibana'; +import { useAlertExceptionActions } from '../../../../detections/components/alerts_table/timeline_actions/use_add_exception_actions'; +import { useInvestigateInTimeline } from '../../../../detections/components/alerts_table/timeline_actions/use_investigate_in_timeline'; +import { useAddToCaseActions } from '../../../../detections/components/alerts_table/timeline_actions/use_add_to_case_actions'; + +jest.mock('../../../../common/lib/kibana'); +jest.mock('react-router-dom', () => { + const original = jest.requireActual('react-router-dom'); + return { + ...original, + useLocation: jest.fn().mockReturnValue({ search: '' }), + }; +}); +jest.mock( + '../../../../detections/components/alerts_table/timeline_actions/use_add_exception_actions' +); +jest.mock( + '../../../../detections/components/alerts_table/timeline_actions/use_investigate_in_timeline' +); +jest.mock( + '../../../../detections/components/alerts_table/timeline_actions/use_add_to_case_actions' +); + +describe('TakeActionButton', () => { + it('should render the take action button', () => { + (useKibana as jest.Mock).mockReturnValue({ + services: { + osquery: { isOsqueryAvailable: jest.fn() }, + cases: { hooks: { useIsAddToCaseOpen: jest.fn().mockReturnValue(false) } }, + }, + }); + (useAlertExceptionActions as jest.Mock).mockReturnValue({ exceptionActionItems: [] }); + (useInvestigateInTimeline as jest.Mock).mockReturnValue({ + investigateInTimelineActionItems: [{ name: 'test', onClick: jest.fn() }], + }); + (useAddToCaseActions as jest.Mock).mockReturnValue({ addToCaseActionItems: [] }); + + const { getByTestId } = render( + <TestProviders> + <DocumentDetailsContext.Provider value={mockContextValue}> + <TakeActionButton /> + </DocumentDetailsContext.Provider> + </TestProviders> + ); + expect(getByTestId(FLYOUT_FOOTER_DROPDOWN_BUTTON_TEST_ID)).toBeInTheDocument(); + }); + + it('should not render the take action button if dataAsNestedObject is null', () => { + const { queryByTestId } = render( + <TestProviders> + <DocumentDetailsContext.Provider + value={{ ...mockContextValue, dataAsNestedObject: null as unknown as Ecs }} + > + <TakeActionButton /> + </DocumentDetailsContext.Provider> + </TestProviders> + ); + expect(queryByTestId(FLYOUT_FOOTER_DROPDOWN_BUTTON_TEST_ID)).not.toBeInTheDocument(); + }); +}); diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/take_action_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/take_action_button.tsx new file mode 100644 index 0000000000000..10595f732fcda --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/take_action_button.tsx @@ -0,0 +1,220 @@ +/* + * 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 { FC } from 'react'; +import React, { useCallback, useMemo, useState } from 'react'; +import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; +import { useEuiTheme } from '@elastic/eui'; +import { find } from 'lodash/fp'; +import type { Status } from '../../../../../common/api/detection_engine'; +import { getAlertDetailsFieldValue } from '../../../../common/lib/endpoint/utils/get_event_details_field_values'; +import { TakeActionDropdown } from './take_action_dropdown'; +import { AddExceptionFlyoutWrapper } from '../../../../detections/components/alerts_table/timeline_actions/alert_context_menu'; +import { EventFiltersFlyout } from '../../../../management/pages/event_filters/view/components/event_filters_flyout'; +import { OsqueryFlyout } from '../../../../detections/components/osquery/osquery_flyout'; +import { useDocumentDetailsContext } from '../context'; +import { useHostIsolation } from '../hooks/use_host_isolation'; +import { DocumentDetailsIsolateHostPanelKey } from '../constants/panel_keys'; +import { useRefetchByScope } from '../../right/hooks/use_refetch_by_scope'; +import { useExceptionFlyout } from '../../../../detections/components/alerts_table/timeline_actions/use_add_exception_flyout'; +import { isActiveTimeline } from '../../../../helpers'; +import { useEventFilterModal } from '../../../../detections/components/alerts_table/timeline_actions/use_event_filter_modal'; + +interface AlertSummaryData { + /** + * Status of the alert (open, closed...) + */ + alertStatus: Status; + /** + * Id of the document + */ + eventId: string; + /** + * Id of the rule + */ + ruleId: string; + /** + * Property ruleId on the rule + */ + ruleRuleId: string; + /** + * Name of the rule + */ + ruleName: string; +} + +/** + * Take action button in the panel footer + */ +export const TakeActionButton: FC = () => { + const { euiTheme } = useEuiTheme(); + // we need this flyout to be above the timeline flyout (which has a z-index of 1002) + const flyoutZIndex = useMemo( + () => ({ style: `z-index: ${(euiTheme.levels.flyout as number) + 3}` }), + [euiTheme] + ); + + const { closeFlyout, openRightPanel } = useExpandableFlyoutApi(); + const { + eventId, + indexName, + dataFormattedForFieldBrowser, + dataAsNestedObject, + refetchFlyoutData, + scopeId, + } = useDocumentDetailsContext(); + + // host isolation interaction + const { isHostIsolationPanelOpen, showHostIsolationPanel } = useHostIsolation(); + const showHostIsolationPanelCallback = useCallback( + (action: 'isolateHost' | 'unisolateHost' | undefined) => { + showHostIsolationPanel(action); + openRightPanel({ + id: DocumentDetailsIsolateHostPanelKey, + params: { + id: eventId, + indexName, + scopeId, + isolateAction: action, + }, + }); + }, + [eventId, indexName, openRightPanel, scopeId, showHostIsolationPanel] + ); + + const { refetch: refetchAll } = useRefetchByScope({ scopeId }); + + // exception interaction + const ruleIndexRaw = useMemo( + () => + find({ category: 'signal', field: 'signal.rule.index' }, dataFormattedForFieldBrowser) + ?.values ?? + find( + { category: 'kibana', field: 'kibana.alert.rule.parameters.index' }, + dataFormattedForFieldBrowser + )?.values, + [dataFormattedForFieldBrowser] + ); + const ruleIndex = useMemo( + (): string[] | undefined => (Array.isArray(ruleIndexRaw) ? ruleIndexRaw : undefined), + [ruleIndexRaw] + ); + const ruleDataViewIdRaw = useMemo( + () => + find({ category: 'signal', field: 'signal.rule.data_view_id' }, dataFormattedForFieldBrowser) + ?.values ?? + find( + { category: 'kibana', field: 'kibana.alert.rule.parameters.data_view_id' }, + dataFormattedForFieldBrowser + )?.values, + [dataFormattedForFieldBrowser] + ); + const ruleDataViewId = useMemo( + (): string | undefined => (Array.isArray(ruleDataViewIdRaw) ? ruleDataViewIdRaw[0] : undefined), + [ruleDataViewIdRaw] + ); + const alertSummaryData = useMemo( + () => + [ + { category: 'signal', field: 'signal.rule.id', name: 'ruleId' }, + { category: 'signal', field: 'signal.rule.rule_id', name: 'ruleRuleId' }, + { category: 'signal', field: 'signal.rule.name', name: 'ruleName' }, + { category: 'signal', field: 'kibana.alert.workflow_status', name: 'alertStatus' }, + { category: '_id', field: '_id', name: 'eventId' }, + ].reduce<AlertSummaryData>( + (acc, curr) => ({ + ...acc, + [curr.name]: getAlertDetailsFieldValue( + { category: curr.category, field: curr.field }, + dataFormattedForFieldBrowser + ), + }), + {} as AlertSummaryData + ), + [dataFormattedForFieldBrowser] + ); + const { + exceptionFlyoutType, + openAddExceptionFlyout, + onAddExceptionTypeClick, + onAddExceptionCancel, + onAddExceptionConfirm, + } = useExceptionFlyout({ + refetch: refetchAll, + isActiveTimelines: isActiveTimeline(scopeId), + }); + + // event filter interaction + const { closeAddEventFilterModal, isAddEventFilterModalOpen, onAddEventFilterClick } = + useEventFilterModal(); + + // osquery interaction + const [isOsqueryFlyoutOpenWithAgentId, setOsqueryFlyoutOpenWithAgentId] = useState<null | string>( + null + ); + const closeOsqueryFlyout = useCallback(() => { + setOsqueryFlyoutOpenWithAgentId(null); + }, [setOsqueryFlyoutOpenWithAgentId]); + const alertId = useMemo( + () => (dataAsNestedObject?.kibana?.alert ? dataAsNestedObject?._id : null), + [dataAsNestedObject?._id, dataAsNestedObject?.kibana?.alert] + ); + + return ( + <> + {dataAsNestedObject && ( + <TakeActionDropdown + dataFormattedForFieldBrowser={dataFormattedForFieldBrowser} + dataAsNestedObject={dataAsNestedObject} + handleOnEventClosed={closeFlyout} + isHostIsolationPanelOpen={isHostIsolationPanelOpen} + onAddEventFilterClick={onAddEventFilterClick} + onAddExceptionTypeClick={onAddExceptionTypeClick} + onAddIsolationStatusClick={showHostIsolationPanelCallback} + refetchFlyoutData={refetchFlyoutData} + refetch={refetchAll} + scopeId={scopeId} + onOsqueryClick={setOsqueryFlyoutOpenWithAgentId} + /> + )} + + {openAddExceptionFlyout && + alertSummaryData.ruleId != null && + alertSummaryData.ruleRuleId != null && + alertSummaryData.eventId != null && ( + <AddExceptionFlyoutWrapper + {...alertSummaryData} + ruleIndices={ruleIndex} + ruleDataViewId={ruleDataViewId} + exceptionListType={exceptionFlyoutType} + onCancel={onAddExceptionCancel} + onConfirm={onAddExceptionConfirm} + /> + )} + + {isAddEventFilterModalOpen && dataAsNestedObject != null && ( + <EventFiltersFlyout + data={dataAsNestedObject} + onCancel={closeAddEventFilterModal} + // EUI TODO: This z-index override of EuiOverlayMask is a workaround, and ideally should be resolved with a cleaner UI/UX flow long-term + maskProps={flyoutZIndex} // we need this flyout to be above the timeline flyout (which has a z-index of 1002) + /> + )} + + {isOsqueryFlyoutOpenWithAgentId && dataAsNestedObject != null && ( + <OsqueryFlyout + agentId={isOsqueryFlyoutOpenWithAgentId} + defaultValues={alertId ? { alertIds: [alertId] } : undefined} + onClose={closeOsqueryFlyout} + ecsData={dataAsNestedObject} + /> + )} + </> + ); +}; + +TakeActionButton.displayName = 'TakeActionButton'; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/take_action_dropdown.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/take_action_dropdown.test.tsx similarity index 97% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/take_action_dropdown.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/take_action_dropdown.test.tsx index 6189f1b353ec8..ffed3e064d7f5 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/take_action_dropdown.test.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/take_action_dropdown.test.tsx @@ -27,7 +27,7 @@ import { ALERT_ASSIGNEES_CONTEXT_MENU_ITEM_TITLE, ALERT_TAGS_CONTEXT_MENU_ITEM_TITLE, } from '../../../../common/components/toolbar/bulk_actions/translations'; -import { FLYOUT_FOOTER_DEOPDOEN_BUTTON_TEST_ID } from '../test_ids'; +import { FLYOUT_FOOTER_DROPDOWN_BUTTON_TEST_ID } from './test_ids'; jest.mock('../../../../common/components/endpoint/host_isolation'); jest.mock('../../../../common/components/endpoint/responder'); @@ -128,7 +128,7 @@ describe('take action dropdown', () => { </TestProviders> ); expect( - wrapper.find(`[data-test-subj="${FLYOUT_FOOTER_DEOPDOEN_BUTTON_TEST_ID}"]`).exists() + wrapper.find(`[data-test-subj="${FLYOUT_FOOTER_DROPDOWN_BUTTON_TEST_ID}"]`).exists() ).toBeTruthy(); }); @@ -139,7 +139,7 @@ describe('take action dropdown', () => { </TestProviders> ); expect( - wrapper.find(`[data-test-subj="${FLYOUT_FOOTER_DEOPDOEN_BUTTON_TEST_ID}"]`).first().text() + wrapper.find(`[data-test-subj="${FLYOUT_FOOTER_DROPDOWN_BUTTON_TEST_ID}"]`).first().text() ).toEqual('Take action'); }); @@ -153,7 +153,7 @@ describe('take action dropdown', () => { </TestProviders> ); wrapper - .find(`button[data-test-subj="${FLYOUT_FOOTER_DEOPDOEN_BUTTON_TEST_ID}"]`) + .find(`button[data-test-subj="${FLYOUT_FOOTER_DROPDOWN_BUTTON_TEST_ID}"]`) .simulate('click'); }); test('should render "Add to existing case"', async () => { @@ -325,7 +325,7 @@ describe('take action dropdown', () => { </TestProviders> ); wrapper - .find(`button[data-test-subj="${FLYOUT_FOOTER_DEOPDOEN_BUTTON_TEST_ID}"]`) + .find(`button[data-test-subj="${FLYOUT_FOOTER_DROPDOWN_BUTTON_TEST_ID}"]`) .simulate('click'); return wrapper; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/take_action_dropdown.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/take_action_dropdown.tsx similarity index 99% rename from x-pack/plugins/security_solution/public/flyout/document_details/right/components/take_action_dropdown.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/take_action_dropdown.tsx index dbc21e82220de..da94ec6e02e99 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/take_action_dropdown.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/take_action_dropdown.tsx @@ -12,7 +12,7 @@ import type { EcsSecurityExtension as Ecs } from '@kbn/securitysolution-ecs'; import { TableId } from '@kbn/securitysolution-data-table'; import type { TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common'; import { i18n } from '@kbn/i18n'; -import { FLYOUT_FOOTER_DEOPDOEN_BUTTON_TEST_ID } from '../test_ids'; +import { FLYOUT_FOOTER_DROPDOWN_BUTTON_TEST_ID } from './test_ids'; import { getAlertDetailsFieldValue } from '../../../../common/lib/endpoint/utils/get_event_details_field_values'; import { GuidedOnboardingTourStep } from '../../../../common/components/guided_onboarding_tour/tour_step'; import { @@ -362,7 +362,7 @@ export const TakeActionDropdown = memo( tourId={SecurityStepId.alertsCases} > <EuiButton - data-test-subj={FLYOUT_FOOTER_DEOPDOEN_BUTTON_TEST_ID} + data-test-subj={FLYOUT_FOOTER_DROPDOWN_BUTTON_TEST_ID} fill iconSide="right" iconType="arrowDown" diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/test_ids.ts new file mode 100644 index 0000000000000..5895386d43dc1 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/test_ids.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 { PREFIX } from '../../../shared/test_ids'; + +export const FLYOUT_PREVIEW_LINK_TEST_ID = `${PREFIX}PreviewLink` as const; + +export const SESSION_VIEW_UPSELL_TEST_ID = `${PREFIX}SessionViewUpsell` as const; +export const SESSION_VIEW_NO_DATA_TEST_ID = `${PREFIX}SessionViewNoData` as const; + +export const MISCONFIGURATIONS_TEST_ID = `${PREFIX}Misconfigurations` as const; +export const VULNERABILITIES_TEST_ID = `${PREFIX}Vulnerabilities` as const; + +export const FLYOUT_FOOTER_DROPDOWN_BUTTON_TEST_ID = `${PREFIX}FooterDropdownButton` as const; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/components/vulnerabilities_insight.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/vulnerabilities_insight.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/components/vulnerabilities_insight.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/vulnerabilities_insight.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/components/vulnerabilities_insight.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/vulnerabilities_insight.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/components/vulnerabilities_insight.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/components/vulnerabilities_insight.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/constants/event_kinds.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/constants/event_kinds.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/constants/event_kinds.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/constants/event_kinds.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/constants/experimental_features.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/constants/experimental_features.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/constants/experimental_features.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/constants/experimental_features.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/constants/field_names.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/constants/field_names.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/constants/field_names.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/constants/field_names.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/constants/flyouts.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/constants/flyouts.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/constants/flyouts.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/constants/flyouts.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/constants/local_storage.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/constants/local_storage.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/constants/local_storage.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/constants/local_storage.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/constants/panel_keys.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/constants/panel_keys.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/constants/panel_keys.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/constants/panel_keys.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/context.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/context.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/url/expandable_flyout_state_from_event_meta.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/url/expandable_flyout_state_from_event_meta.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/url/expandable_flyout_state_from_event_meta.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/url/expandable_flyout_state_from_event_meta.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_document_analyzer_schema.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_document_analyzer_schema.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_document_analyzer_schema.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_document_analyzer_schema.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_document_analyzer_schema.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_document_analyzer_schema.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_document_analyzer_schema.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_document_analyzer_schema.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_prevalence.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_prevalence.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_prevalence.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_prevalence.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_prevalence.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_prevalence.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_prevalence.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_prevalence.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_prevalence_from_process_tree.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_prevalence_from_process_tree.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_prevalence_from_process_tree.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_prevalence_from_process_tree.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_prevalence_from_process_tree.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_prevalence_from_process_tree.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_prevalence_from_process_tree.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_alert_prevalence_from_process_tree.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_basic_data_from_details_data.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_basic_data_from_details_data.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_basic_data_from_details_data.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_basic_data_from_details_data.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_basic_data_from_details_data.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_basic_data_from_details_data.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_basic_data_from_details_data.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_basic_data_from_details_data.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_event_details.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_event_details.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_event_details.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_event_details.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_event_details.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_event_details.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_event_details.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_event_details.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_prevalence.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_prevalence.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_prevalence.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_prevalence.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_ancestry.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_ancestry.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_ancestry.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_ancestry.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_ancestry.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_ancestry.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_ancestry.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_ancestry.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_same_source_event.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_same_source_event.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_same_source_event.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_same_source_event.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_same_source_event.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_same_source_event.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_same_source_event.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_same_source_event.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_session.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_session.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_session.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_session.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_session.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_session.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_session.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_alerts_by_session.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_cases.test.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_cases.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_cases.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_cases.test.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_cases.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_cases.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_cases.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_fetch_related_cases.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_get_fields_data.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_get_fields_data.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_get_fields_data.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_get_fields_data.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_get_fields_data.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_get_fields_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_get_fields_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_get_fields_data.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_graph_preview.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_graph_preview.test.tsx new file mode 100644 index 0000000000000..cf1ee82078395 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_graph_preview.test.tsx @@ -0,0 +1,329 @@ +/* + * 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 { TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common'; +import { renderHook } from '@testing-library/react'; +import type { UseGraphPreviewParams } from './use_graph_preview'; +import { useGraphPreview } from './use_graph_preview'; +import type { GetFieldsData } from './use_get_fields_data'; +import { mockFieldData } from '../mocks/mock_get_fields_data'; +import { mockDataFormattedForFieldBrowser } from '../mocks/mock_data_formatted_for_field_browser'; + +const alertMockGetFieldsData: GetFieldsData = (field: string) => { + if (field === 'kibana.alert.uuid') { + return 'alertId'; + } else if (field === 'kibana.alert.original_event.id') { + return 'eventId'; + } else if (field === 'actor.entity.id') { + return 'actorId'; + } else if (field === 'target.entity.id') { + return 'targetId'; + } + + return mockFieldData[field]; +}; + +const alertMockDataFormattedForFieldBrowser = mockDataFormattedForFieldBrowser; + +const eventMockGetFieldsData: GetFieldsData = (field: string) => { + if (field === 'kibana.alert.uuid') { + return; + } else if (field === 'kibana.alert.original_event.id') { + return; + } else if (field === 'event.id') { + return 'eventId'; + } else if (field === 'actor.entity.id') { + return 'actorId'; + } else if (field === 'target.entity.id') { + return 'targetId'; + } + + return mockFieldData[field]; +}; + +const eventMockDataFormattedForFieldBrowser: TimelineEventsDetailsItem[] = []; + +describe('useGraphPreview', () => { + it(`should return false when missing actor`, () => { + const getFieldsData: GetFieldsData = (field: string) => { + if (field === 'actor.entity.id') { + return; + } + return alertMockGetFieldsData(field); + }; + + const hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { + initialProps: { + getFieldsData, + ecsData: { + _id: 'id', + event: { + action: ['action'], + }, + }, + dataFormattedForFieldBrowser: alertMockDataFormattedForFieldBrowser, + }, + }); + + expect(hookResult.result.current).toStrictEqual({ + hasGraphRepresentation: false, + timestamp: mockFieldData['@timestamp'][0], + eventIds: ['eventId'], + actorIds: [], + action: ['action'], + targetIds: ['targetId'], + isAlert: true, + }); + }); + + it(`should return false when missing event.action`, () => { + const hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { + initialProps: { + getFieldsData: alertMockGetFieldsData, + ecsData: { + _id: 'id', + }, + dataFormattedForFieldBrowser: alertMockDataFormattedForFieldBrowser, + }, + }); + + expect(hookResult.result.current).toStrictEqual({ + hasGraphRepresentation: false, + timestamp: mockFieldData['@timestamp'][0], + eventIds: ['eventId'], + actorIds: ['actorId'], + action: undefined, + targetIds: ['targetId'], + isAlert: true, + }); + }); + + it(`should return false when missing target`, () => { + const getFieldsData: GetFieldsData = (field: string) => { + if (field === 'target.entity.id') { + return; + } + return alertMockGetFieldsData(field); + }; + + const hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { + initialProps: { + getFieldsData, + ecsData: { + _id: 'id', + }, + dataFormattedForFieldBrowser: alertMockDataFormattedForFieldBrowser, + }, + }); + + expect(hookResult.result.current).toStrictEqual({ + hasGraphRepresentation: false, + timestamp: mockFieldData['@timestamp'][0], + eventIds: ['eventId'], + actorIds: ['actorId'], + action: undefined, + targetIds: [], + isAlert: true, + }); + }); + + it(`should return false when missing original_event.id`, () => { + const getFieldsData: GetFieldsData = (field: string) => { + if (field === 'kibana.alert.original_event.id') { + return; + } + + return alertMockGetFieldsData(field); + }; + + const hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { + initialProps: { + getFieldsData, + ecsData: { + _id: 'id', + event: { + action: ['action'], + }, + }, + dataFormattedForFieldBrowser: alertMockDataFormattedForFieldBrowser, + }, + }); + + expect(hookResult.result.current).toStrictEqual({ + hasGraphRepresentation: false, + timestamp: mockFieldData['@timestamp'][0], + eventIds: [], + actorIds: ['actorId'], + action: ['action'], + targetIds: ['targetId'], + isAlert: true, + }); + }); + + it(`should return false when timestamp is missing`, () => { + const getFieldsData: GetFieldsData = (field: string) => { + if (field === '@timestamp') { + return; + } + + return alertMockGetFieldsData(field); + }; + + const hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { + initialProps: { + getFieldsData, + ecsData: { + _id: 'id', + event: { + action: ['action'], + }, + }, + dataFormattedForFieldBrowser: alertMockDataFormattedForFieldBrowser, + }, + }); + + expect(hookResult.result.current).toStrictEqual({ + hasGraphRepresentation: false, + timestamp: null, + eventIds: ['eventId'], + actorIds: ['actorId'], + action: ['action'], + targetIds: ['targetId'], + isAlert: true, + }); + }); + + it(`should return true when event has graph graph preview`, () => { + const hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { + initialProps: { + getFieldsData: eventMockGetFieldsData, + ecsData: { + _id: 'id', + event: { + action: ['action'], + }, + }, + dataFormattedForFieldBrowser: eventMockDataFormattedForFieldBrowser, + }, + }); + + expect(hookResult.result.current).toStrictEqual({ + hasGraphRepresentation: true, + timestamp: mockFieldData['@timestamp'][0], + eventIds: ['eventId'], + actorIds: ['actorId'], + action: ['action'], + targetIds: ['targetId'], + isAlert: false, + }); + }); + + it(`should return true when event has graph preview with multiple values`, () => { + const getFieldsData: GetFieldsData = (field: string) => { + if (field === 'kibana.alert.uuid') { + return; + } else if (field === 'kibana.alert.original_event.id') { + return; + } else if (field === 'event.id') { + return ['id1', 'id2']; + } else if (field === 'actor.entity.id') { + return ['actorId1', 'actorId2']; + } else if (field === 'target.entity.id') { + return ['targetId1', 'targetId2']; + } + + return mockFieldData[field]; + }; + + const hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { + initialProps: { + getFieldsData, + ecsData: { + _id: 'id', + event: { + action: ['action1', 'action2'], + }, + }, + dataFormattedForFieldBrowser: eventMockDataFormattedForFieldBrowser, + }, + }); + + expect(hookResult.result.current).toStrictEqual({ + hasGraphRepresentation: true, + timestamp: mockFieldData['@timestamp'][0], + eventIds: ['id1', 'id2'], + actorIds: ['actorId1', 'actorId2'], + action: ['action1', 'action2'], + targetIds: ['targetId1', 'targetId2'], + isAlert: false, + }); + }); + + it(`should return true when alert has graph preview`, () => { + const hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { + initialProps: { + getFieldsData: alertMockGetFieldsData, + ecsData: { + _id: 'id', + event: { + action: ['action'], + }, + }, + dataFormattedForFieldBrowser: alertMockDataFormattedForFieldBrowser, + }, + }); + + expect(hookResult.result.current).toStrictEqual({ + hasGraphRepresentation: true, + timestamp: mockFieldData['@timestamp'][0], + eventIds: ['eventId'], + actorIds: ['actorId'], + action: ['action'], + targetIds: ['targetId'], + isAlert: true, + }); + }); + + it(`should return true when alert has graph preview with multiple values`, () => { + const getFieldsData: GetFieldsData = (field: string) => { + if (field === 'kibana.alert.uuid') { + return 'alertId'; + } else if (field === 'kibana.alert.original_event.id') { + return ['id1', 'id2']; + } else if (field === 'actor.entity.id') { + return ['actorId1', 'actorId2']; + } else if (field === 'target.entity.id') { + return ['targetId1', 'targetId2']; + } + + return mockFieldData[field]; + }; + + const hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { + initialProps: { + getFieldsData, + ecsData: { + _id: 'id', + event: { + action: ['action1', 'action2'], + }, + }, + dataFormattedForFieldBrowser: alertMockDataFormattedForFieldBrowser, + }, + }); + + expect(hookResult.result.current).toStrictEqual({ + hasGraphRepresentation: true, + timestamp: mockFieldData['@timestamp'][0], + eventIds: ['id1', 'id2'], + actorIds: ['actorId1', 'actorId2'], + action: ['action1', 'action2'], + targetIds: ['targetId1', 'targetId2'], + isAlert: true, + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_graph_preview.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_graph_preview.ts similarity index 81% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_graph_preview.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_graph_preview.ts index 48233afab02df..8f05b87844fb2 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_graph_preview.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_graph_preview.ts @@ -5,10 +5,12 @@ * 2.0. */ +import type { TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common'; import type { EcsSecurityExtension as Ecs } from '@kbn/securitysolution-ecs'; import { get } from 'lodash/fp'; import type { GetFieldsData } from './use_get_fields_data'; import { getField, getFieldArray } from '../utils'; +import { useBasicDataFromDetailsData } from './use_basic_data_from_details_data'; export interface UseGraphPreviewParams { /** @@ -20,6 +22,11 @@ export interface UseGraphPreviewParams { * An object with top level fields from the ECS object */ ecsData: Ecs; + + /** + * An array of field objects with category and value + */ + dataFormattedForFieldBrowser: TimelineEventsDetailsItem[]; } /** * Interface for the result of the useGraphPreview hook @@ -54,6 +61,11 @@ export interface UseGraphPreviewResult { * Boolean indicating if the event is has a graph representation (contains event ids, actor ids and action) */ hasGraphRepresentation: boolean; + + /** + * Boolean indicating if the event is an alert or not + */ + isAlert: boolean; } /** @@ -62,6 +74,7 @@ export interface UseGraphPreviewResult { export const useGraphPreview = ({ getFieldsData, ecsData, + dataFormattedForFieldBrowser, }: UseGraphPreviewParams): UseGraphPreviewResult => { const timestamp = getField(getFieldsData('@timestamp')); const originalEventId = getFieldsData('kibana.alert.original_event.id'); @@ -77,6 +90,7 @@ export const useGraphPreview = ({ actorIds.length > 0 && eventIds.length > 0 && targetIds.length > 0; + const { isAlert } = useBasicDataFromDetailsData(dataFormattedForFieldBrowser); - return { timestamp, eventIds, actorIds, action, targetIds, hasGraphRepresentation }; + return { timestamp, eventIds, actorIds, action, targetIds, hasGraphRepresentation, isAlert }; }; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_highlighted_fields.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_highlighted_fields.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_highlighted_fields.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_highlighted_fields.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_highlighted_fields.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_highlighted_fields.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_highlighted_fields.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_highlighted_fields.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_host_isolation.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_host_isolation.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_host_isolation.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_host_isolation.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_investigation_enrichment.test.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_investigation_enrichment.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_investigation_enrichment.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_investigation_enrichment.test.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_investigation_enrichment.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_investigation_enrichment.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_investigation_enrichment.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_investigation_enrichment.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_investigation_guide.test.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_investigation_guide.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_investigation_guide.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_investigation_guide.test.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_investigation_guide.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_investigation_guide.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_investigation_guide.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_investigation_guide.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_analyzer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_analyzer.test.tsx new file mode 100644 index 0000000000000..f73d154ff7dba --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_analyzer.test.tsx @@ -0,0 +1,357 @@ +/* + * 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 { renderHook } from '@testing-library/react'; +import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; +import { useNavigateToAnalyzer } from './use_navigate_to_analyzer'; +import { mockFlyoutApi } from '../mocks/mock_flyout_context'; +import { useWhichFlyout } from './use_which_flyout'; +import { useKibana as mockUseKibana } from '../../../../common/lib/kibana/__mocks__'; +import { useKibana } from '../../../../common/lib/kibana'; +import { + DocumentDetailsRightPanelKey, + DocumentDetailsLeftPanelKey, + DocumentDetailsAnalyzerPanelKey, +} from '../constants/panel_keys'; +import { ANALYZE_GRAPH_ID, ANALYZER_PREVIEW_BANNER } from '../../left/components/analyze_graph'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; + +jest.mock('@kbn/expandable-flyout'); +jest.mock('../../../../common/lib/kibana'); +jest.mock('./use_which_flyout'); +jest.mock('../../../../common/hooks/use_experimental_features'); + +const mockedUseKibana = mockUseKibana(); +(useKibana as jest.Mock).mockReturnValue(mockedUseKibana); + +const mockUseWhichFlyout = useWhichFlyout as jest.Mock; +const FLYOUT_KEY = 'SecuritySolution'; +const TIMELINE_FLYOUT_KEY = 'Timeline'; + +const eventId = 'eventId1'; +const indexName = 'index1'; +const scopeId = 'scopeId1'; + +describe('useNavigateToAnalyzer', () => { + beforeEach(() => { + jest.clearAllMocks(); + jest.mocked(useExpandableFlyoutApi).mockReturnValue(mockFlyoutApi); + (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(false); + }); + + it('when isFlyoutOpen is true and not in preview mode, should return callback that opens left and preview panels', () => { + mockUseWhichFlyout.mockReturnValue(FLYOUT_KEY); + const hookResult = renderHook(() => + useNavigateToAnalyzer({ + isFlyoutOpen: true, + eventId, + indexName, + scopeId, + isPreviewMode: false, + }) + ); + hookResult.result.current.navigateToAnalyzer(); + + expect(mockFlyoutApi.openLeftPanel).toHaveBeenCalledWith({ + id: DocumentDetailsLeftPanelKey, + path: { + tab: 'visualize', + subTab: ANALYZE_GRAPH_ID, + }, + params: { + id: eventId, + indexName, + scopeId, + }, + }); + + expect(mockFlyoutApi.openPreviewPanel).toHaveBeenCalledWith({ + id: DocumentDetailsAnalyzerPanelKey, + params: { + resolverComponentInstanceID: `${FLYOUT_KEY}-${scopeId}`, + banner: ANALYZER_PREVIEW_BANNER, + }, + }); + }); + + it('when isFlyoutOpen is true and in preview mode, navigation is not enabled', () => { + mockUseWhichFlyout.mockReturnValue(FLYOUT_KEY); + const hookResult = renderHook(() => + useNavigateToAnalyzer({ + isFlyoutOpen: true, + eventId, + indexName, + scopeId, + isPreviewMode: true, + }) + ); + hookResult.result.current.navigateToAnalyzer(); + expect(mockFlyoutApi.openLeftPanel).not.toHaveBeenCalled(); + expect(mockFlyoutApi.openPreviewPanel).not.toHaveBeenCalled(); + }); + + it('when isFlyoutOpen is false and scopeId is not timeline, should return callback that opens a new flyout', () => { + mockUseWhichFlyout.mockReturnValue(null); + + const hookResult = renderHook(() => + useNavigateToAnalyzer({ + isFlyoutOpen: false, + eventId, + indexName, + scopeId, + isPreviewMode: true, + }) + ); + hookResult.result.current.navigateToAnalyzer(); + expect(mockFlyoutApi.openFlyout).toHaveBeenCalledWith({ + right: { + id: DocumentDetailsRightPanelKey, + params: { + id: eventId, + indexName, + scopeId, + }, + }, + left: { + id: DocumentDetailsLeftPanelKey, + path: { + tab: 'visualize', + subTab: ANALYZE_GRAPH_ID, + }, + params: { + id: eventId, + indexName, + scopeId, + }, + }, + preview: { + id: DocumentDetailsAnalyzerPanelKey, + params: { + resolverComponentInstanceID: `${FLYOUT_KEY}-${scopeId}`, + banner: ANALYZER_PREVIEW_BANNER, + }, + }, + }); + }); + + it('when isFlyoutOpen is false and scopeId is current timeline, should return callback that opens a new flyout in timeline', () => { + mockUseWhichFlyout.mockReturnValue(null); + const timelineId = 'timeline-1'; + const hookResult = renderHook(() => + useNavigateToAnalyzer({ + isFlyoutOpen: false, + eventId, + indexName, + scopeId: timelineId, + isPreviewMode: true, + }) + ); + hookResult.result.current.navigateToAnalyzer(); + expect(mockFlyoutApi.openFlyout).toHaveBeenCalledWith({ + right: { + id: DocumentDetailsRightPanelKey, + params: { + id: eventId, + indexName, + scopeId: timelineId, + }, + }, + left: { + id: DocumentDetailsLeftPanelKey, + path: { + tab: 'visualize', + subTab: ANALYZE_GRAPH_ID, + }, + params: { + id: eventId, + indexName, + scopeId: timelineId, + }, + }, + preview: { + id: DocumentDetailsAnalyzerPanelKey, + params: { + resolverComponentInstanceID: `${TIMELINE_FLYOUT_KEY}-${timelineId}`, + banner: ANALYZER_PREVIEW_BANNER, + }, + }, + }); + }); + + describe('when new navigation is enabled', () => { + beforeEach(() => { + (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(true); + }); + + it('when isFlyoutOpen is true and not in preview mode, should return callback that opens left and preview panels', () => { + mockUseWhichFlyout.mockReturnValue(FLYOUT_KEY); + const hookResult = renderHook(() => + useNavigateToAnalyzer({ + isFlyoutOpen: true, + eventId, + indexName, + scopeId, + isPreviewMode: false, + }) + ); + hookResult.result.current.navigateToAnalyzer(); + + expect(mockFlyoutApi.openLeftPanel).toHaveBeenCalledWith({ + id: DocumentDetailsLeftPanelKey, + path: { + tab: 'visualize', + subTab: ANALYZE_GRAPH_ID, + }, + params: { + id: eventId, + indexName, + scopeId, + }, + }); + + expect(mockFlyoutApi.openPreviewPanel).toHaveBeenCalledWith({ + id: DocumentDetailsAnalyzerPanelKey, + params: { + resolverComponentInstanceID: `${FLYOUT_KEY}-${scopeId}`, + banner: ANALYZER_PREVIEW_BANNER, + }, + }); + }); + + it('when isFlyoutOpen is true and in preview mode, should return callback that opens new flyout', () => { + mockUseWhichFlyout.mockReturnValue(FLYOUT_KEY); + const hookResult = renderHook(() => + useNavigateToAnalyzer({ + isFlyoutOpen: true, + eventId, + indexName, + scopeId, + isPreviewMode: true, + }) + ); + hookResult.result.current.navigateToAnalyzer(); + + expect(mockFlyoutApi.openFlyout).toHaveBeenCalledWith({ + right: { + id: DocumentDetailsRightPanelKey, + params: { + id: eventId, + indexName, + scopeId, + }, + }, + left: { + id: DocumentDetailsLeftPanelKey, + path: { + tab: 'visualize', + subTab: ANALYZE_GRAPH_ID, + }, + params: { + id: eventId, + indexName, + scopeId, + }, + }, + preview: { + id: DocumentDetailsAnalyzerPanelKey, + params: { + resolverComponentInstanceID: `${FLYOUT_KEY}-${scopeId}`, + banner: ANALYZER_PREVIEW_BANNER, + }, + }, + }); + }); + + it('when isFlyoutOpen is false and scopeId is not timeline, should return callback that opens a new flyout', () => { + mockUseWhichFlyout.mockReturnValue(null); + + const hookResult = renderHook(() => + useNavigateToAnalyzer({ + isFlyoutOpen: false, + eventId, + indexName, + scopeId, + isPreviewMode: true, + }) + ); + hookResult.result.current.navigateToAnalyzer(); + expect(mockFlyoutApi.openFlyout).toHaveBeenCalledWith({ + right: { + id: DocumentDetailsRightPanelKey, + params: { + id: eventId, + indexName, + scopeId, + }, + }, + left: { + id: DocumentDetailsLeftPanelKey, + path: { + tab: 'visualize', + subTab: ANALYZE_GRAPH_ID, + }, + params: { + id: eventId, + indexName, + scopeId, + }, + }, + preview: { + id: DocumentDetailsAnalyzerPanelKey, + params: { + resolverComponentInstanceID: `${FLYOUT_KEY}-${scopeId}`, + banner: ANALYZER_PREVIEW_BANNER, + }, + }, + }); + }); + + it('when isFlyoutOpen is false and scopeId is current timeline, should return callback that opens a new flyout in timeline', () => { + mockUseWhichFlyout.mockReturnValue(null); + const timelineId = 'timeline-1'; + const hookResult = renderHook(() => + useNavigateToAnalyzer({ + isFlyoutOpen: false, + eventId, + indexName, + scopeId: timelineId, + isPreviewMode: true, + }) + ); + hookResult.result.current.navigateToAnalyzer(); + expect(mockFlyoutApi.openFlyout).toHaveBeenCalledWith({ + right: { + id: DocumentDetailsRightPanelKey, + params: { + id: eventId, + indexName, + scopeId: timelineId, + }, + }, + left: { + id: DocumentDetailsLeftPanelKey, + path: { + tab: 'visualize', + subTab: ANALYZE_GRAPH_ID, + }, + params: { + id: eventId, + indexName, + scopeId: timelineId, + }, + }, + preview: { + id: DocumentDetailsAnalyzerPanelKey, + params: { + resolverComponentInstanceID: `${TIMELINE_FLYOUT_KEY}-${timelineId}`, + banner: ANALYZER_PREVIEW_BANNER, + }, + }, + }); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_analyzer.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_analyzer.tsx similarity index 83% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_analyzer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_analyzer.tsx index 2137ce83527a8..0a075a1d792b8 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_analyzer.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_analyzer.tsx @@ -20,6 +20,7 @@ import { import { Flyouts } from '../constants/flyouts'; import { isTimelineScope } from '../../../../helpers'; import { DocumentEventTypes } from '../../../../common/lib/telemetry'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; export interface UseNavigateToAnalyzerParams { /** @@ -39,6 +40,10 @@ export interface UseNavigateToAnalyzerParams { * Scope id of the page */ scopeId: string; + /** + * Whether the preview mode is enabled + */ + isPreviewMode?: boolean; } export interface UseNavigateToAnalyzerResult { @@ -56,9 +61,14 @@ export const useNavigateToAnalyzer = ({ eventId, indexName, scopeId, + isPreviewMode, }: UseNavigateToAnalyzerParams): UseNavigateToAnalyzerResult => { const { telemetry } = useKibana().services; const { openLeftPanel, openPreviewPanel, openFlyout } = useExpandableFlyoutApi(); + + const isNewNavigationEnabled = useIsExperimentalFeatureEnabled( + 'newExpandableFlyoutNavigationEnabled' + ); let key = useWhichFlyout() ?? 'memory'; if (!isFlyoutOpen) { @@ -105,7 +115,8 @@ export const useNavigateToAnalyzer = ({ ); const navigateToAnalyzer = useCallback(() => { - if (isFlyoutOpen) { + // open left panel and preview panel if not in preview mode + if (isFlyoutOpen && !isPreviewMode) { openLeftPanel(left); openPreviewPanel(preview); telemetry.reportEvent(DocumentEventTypes.DetailsFlyoutTabClicked, { @@ -113,7 +124,10 @@ export const useNavigateToAnalyzer = ({ panel: 'left', tabId: 'visualize', }); - } else { + } + // if flyout is not currently open, open flyout with right, left and preview panel + // if new navigation is enabled and in preview mode, open flyout with right, left and preview panel + else if (!isFlyoutOpen || (isNewNavigationEnabled && isPreviewMode)) { openFlyout({ right, left, @@ -134,6 +148,8 @@ export const useNavigateToAnalyzer = ({ scopeId, telemetry, isFlyoutOpen, + isNewNavigationEnabled, + isPreviewMode, ]); return useMemo(() => ({ navigateToAnalyzer }), [navigateToAnalyzer]); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_graph_visualization.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_graph_visualization.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_graph_visualization.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_graph_visualization.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_graph_visualization.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_graph_visualization.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_graph_visualization.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_graph_visualization.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_left_panel.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_left_panel.test.tsx new file mode 100644 index 0000000000000..41c0d85fa660f --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_left_panel.test.tsx @@ -0,0 +1,156 @@ +/* + * 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 { useNavigateToLeftPanel } from './use_navigate_to_left_panel'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; +import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; +import { renderHook } from '@testing-library/react-hooks'; +import { useDocumentDetailsContext } from '../context'; +import { mockFlyoutApi } from '../mocks/mock_flyout_context'; +import { DocumentDetailsRightPanelKey, DocumentDetailsLeftPanelKey } from '../constants/panel_keys'; +import { useKibana as mockUseKibana } from '../../../../common/lib/kibana/__mocks__'; +import { useKibana } from '../../../../common/lib/kibana'; + +const mockUseIsExperimentalFeatureEnabled = useIsExperimentalFeatureEnabled as jest.Mock; +jest.mock('../../../../common/hooks/use_experimental_features'); + +jest.mock('../../../../common/lib/kibana'); + +const mockedUseKibana = mockUseKibana(); +(useKibana as jest.Mock).mockReturnValue(mockedUseKibana); + +jest.mock('@kbn/expandable-flyout'); +jest.mock('../context'); + +const eventId = 'eventId'; +const indexName = 'indexName'; +const scopeId = 'scopeId'; + +describe('useNavigateToLeftPanel', () => { + describe('newExpandableFlyoutNavigationEnabled is not enabled', () => { + beforeEach(() => { + jest.clearAllMocks(); + mockUseIsExperimentalFeatureEnabled.mockReturnValue(false); + jest.mocked(useExpandableFlyoutApi).mockReturnValue(mockFlyoutApi); + }); + + it('should enable navigation if isPreviewMode is false', () => { + (useDocumentDetailsContext as jest.Mock).mockReturnValue({ + eventId, + indexName, + scopeId, + isPreviewMode: false, + }); + const hookResult = renderHook(() => useNavigateToLeftPanel({ tab: 'tab', subTab: 'subTab' })); + expect(hookResult.result.current.isEnabled).toEqual(true); + + hookResult.result.current.navigateToLeftPanel(); + + expect(mockFlyoutApi.openLeftPanel).toHaveBeenCalledWith({ + id: DocumentDetailsLeftPanelKey, + path: { + tab: 'tab', + subTab: 'subTab', + }, + params: { + id: eventId, + indexName, + scopeId, + }, + }); + expect(mockFlyoutApi.openFlyout).not.toHaveBeenCalled(); + }); + + it('should disable navigation if isPreviewMode is true', () => { + (useDocumentDetailsContext as jest.Mock).mockReturnValue({ + eventId, + indexName, + scopeId, + isPreviewMode: true, + }); + + const hookResult = renderHook(() => useNavigateToLeftPanel({ tab: 'tab', subTab: 'subTab' })); + expect(hookResult.result.current.isEnabled).toEqual(false); + + hookResult.result.current.navigateToLeftPanel(); + + expect(mockFlyoutApi.openLeftPanel).not.toHaveBeenCalled(); + expect(mockFlyoutApi.openFlyout).not.toHaveBeenCalled(); + }); + }); + + describe('newExpandableFlyoutNavigationEnabled', () => { + beforeEach(() => { + jest.clearAllMocks(); + mockUseIsExperimentalFeatureEnabled.mockReturnValue(true); + }); + + it('should enable navigation if isPreviewMode is false', () => { + (useDocumentDetailsContext as jest.Mock).mockReturnValue({ + eventId, + indexName, + scopeId, + isPreviewMode: false, + }); + const hookResult = renderHook(() => useNavigateToLeftPanel({ tab: 'tab', subTab: 'subTab' })); + expect(hookResult.result.current.isEnabled).toEqual(true); + + hookResult.result.current.navigateToLeftPanel(); + + expect(mockFlyoutApi.openLeftPanel).toHaveBeenCalledWith({ + id: DocumentDetailsLeftPanelKey, + path: { + tab: 'tab', + subTab: 'subTab', + }, + params: { + id: eventId, + indexName, + scopeId, + }, + }); + expect(mockFlyoutApi.openFlyout).not.toHaveBeenCalled(); + }); + + it('should open new flyout if isPreviewMode is true', () => { + (useDocumentDetailsContext as jest.Mock).mockReturnValue({ + eventId, + indexName, + scopeId, + isPreviewMode: true, + }); + const hookResult = renderHook(() => useNavigateToLeftPanel({ tab: 'tab', subTab: 'subTab' })); + expect(hookResult.result.current.isEnabled).toEqual(true); + + hookResult.result.current.navigateToLeftPanel(); + + expect(mockFlyoutApi.openLeftPanel).not.toHaveBeenCalled(); + expect(mockFlyoutApi.openFlyout).toHaveBeenCalledWith({ + right: { + id: DocumentDetailsRightPanelKey, + params: { + id: eventId, + indexName, + scopeId, + }, + }, + left: { + id: DocumentDetailsLeftPanelKey, + path: { + tab: 'tab', + subTab: 'subTab', + }, + params: { + id: eventId, + indexName, + scopeId, + }, + }, + }); + }); + }); +}); diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_left_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_left_panel.tsx new file mode 100644 index 0000000000000..59c5c20d36213 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_left_panel.tsx @@ -0,0 +1,114 @@ +/* + * 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 type { FlyoutPanelProps } from '@kbn/expandable-flyout'; +import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; +import { DocumentEventTypes } from '../../../../common/lib/telemetry/types'; +import { useKibana } from '../../../../common/lib/kibana'; +import { DocumentDetailsLeftPanelKey, DocumentDetailsRightPanelKey } from '../constants/panel_keys'; +import { useDocumentDetailsContext } from '../context'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; +export interface UseNavigateToLeftPanelParams { + /** + * The tab to navigate to + */ + tab: string; + /** + * Optional sub tab to navigate to + */ + subTab?: string; +} + +export interface UseNavigateToLeftPanelResult { + /** + * Callback to open analyzer in visualize tab + */ + navigateToLeftPanel: () => void; + /** + * Whether the button should be disabled + */ + isEnabled: boolean; +} + +/** + * Hook that returns the a callback to navigate to the analyzer in the flyout + */ +export const useNavigateToLeftPanel = ({ + tab, + subTab, +}: UseNavigateToLeftPanelParams): UseNavigateToLeftPanelResult => { + const { telemetry } = useKibana().services; + const { openLeftPanel, openFlyout } = useExpandableFlyoutApi(); + const { eventId, indexName, scopeId, isPreviewMode } = useDocumentDetailsContext(); + + const isNewNavigationEnabled = useIsExperimentalFeatureEnabled( + 'newExpandableFlyoutNavigationEnabled' + ); + + const isEnabled = isNewNavigationEnabled || (!isNewNavigationEnabled && !isPreviewMode); + + const right: FlyoutPanelProps = useMemo( + () => ({ + id: DocumentDetailsRightPanelKey, + params: { + id: eventId, + indexName, + scopeId, + }, + }), + [eventId, indexName, scopeId] + ); + + const left: FlyoutPanelProps = useMemo( + () => ({ + id: DocumentDetailsLeftPanelKey, + params: { + id: eventId, + indexName, + scopeId, + }, + path: { + tab, + subTab, + }, + }), + [eventId, indexName, scopeId, tab, subTab] + ); + + const navigateToLeftPanel = useCallback(() => { + if (!isPreviewMode) { + openLeftPanel(left); + telemetry.reportEvent(DocumentEventTypes.DetailsFlyoutTabClicked, { + location: scopeId, + panel: 'left', + tabId: tab, + }); + } else if (isNewNavigationEnabled && isPreviewMode) { + openFlyout({ + right, + left, + }); + telemetry.reportEvent(DocumentEventTypes.DetailsFlyoutOpened, { + location: scopeId, + panel: 'left', + }); + } + }, [ + openFlyout, + openLeftPanel, + right, + left, + scopeId, + telemetry, + isPreviewMode, + tab, + isNewNavigationEnabled, + ]); + + return useMemo(() => ({ navigateToLeftPanel, isEnabled }), [navigateToLeftPanel, isEnabled]); +}; diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_session_view.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_session_view.test.tsx new file mode 100644 index 0000000000000..b655badf2beeb --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_session_view.test.tsx @@ -0,0 +1,193 @@ +/* + * 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 { renderHook } from '@testing-library/react'; +import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; +import { useNavigateToSessionView } from './use_navigate_to_session_view'; +import { mockFlyoutApi } from '../mocks/mock_flyout_context'; +import { useKibana as mockUseKibana } from '../../../../common/lib/kibana/__mocks__'; +import { useKibana } from '../../../../common/lib/kibana'; +import { DocumentDetailsRightPanelKey, DocumentDetailsLeftPanelKey } from '../constants/panel_keys'; +import { SESSION_VIEW_ID } from '../../left/components/session_view'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; + +jest.mock('@kbn/expandable-flyout'); +jest.mock('../../../../common/lib/kibana'); +jest.mock('../../../../common/hooks/use_experimental_features'); + +const mockedUseKibana = mockUseKibana(); +(useKibana as jest.Mock).mockReturnValue(mockedUseKibana); + +const eventId = 'eventId1'; +const indexName = 'index1'; +const scopeId = 'scopeId1'; + +describe('useNavigateToSessionView', () => { + beforeEach(() => { + jest.clearAllMocks(); + jest.mocked(useExpandableFlyoutApi).mockReturnValue(mockFlyoutApi); + (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(false); + }); + + it('when isFlyoutOpen is true, should return callback that opens left panel', () => { + const hookResult = renderHook(() => + useNavigateToSessionView({ isFlyoutOpen: true, eventId, indexName, scopeId }) + ); + hookResult.result.current.navigateToSessionView(); + expect(mockFlyoutApi.openFlyout).not.toHaveBeenCalled(); + expect(mockFlyoutApi.openLeftPanel).toHaveBeenCalledWith({ + id: DocumentDetailsLeftPanelKey, + path: { + tab: 'visualize', + subTab: SESSION_VIEW_ID, + }, + params: { + id: eventId, + indexName, + scopeId, + }, + }); + }); + + it('when isFlyoutOpen is true and in preview mode, navigation is disabled', () => { + const hookResult = renderHook(() => + useNavigateToSessionView({ + isFlyoutOpen: true, + eventId, + indexName, + scopeId, + isPreviewMode: true, + }) + ); + hookResult.result.current.navigateToSessionView(); + + expect(mockFlyoutApi.openLeftPanel).not.toHaveBeenCalled(); + expect(mockFlyoutApi.openFlyout).not.toHaveBeenCalled(); + }); + + it('when isFlyoutOpen is false, should return callback that opens a new flyout', () => { + const hookResult = renderHook(() => + useNavigateToSessionView({ isFlyoutOpen: false, eventId, indexName, scopeId }) + ); + hookResult.result.current.navigateToSessionView(); + expect(mockFlyoutApi.openLeftPanel).not.toHaveBeenCalled(); + expect(mockFlyoutApi.openFlyout).toHaveBeenCalledWith({ + right: { + id: DocumentDetailsRightPanelKey, + params: { + id: eventId, + indexName, + scopeId, + }, + }, + left: { + id: DocumentDetailsLeftPanelKey, + path: { + tab: 'visualize', + subTab: SESSION_VIEW_ID, + }, + params: { + id: eventId, + indexName, + scopeId, + }, + }, + }); + }); + + describe('when new navigation is enabled', () => { + beforeEach(() => { + (useIsExperimentalFeatureEnabled as jest.Mock).mockReturnValue(true); + }); + it('when isFlyoutOpen is true, should return callback that opens left panel', () => { + const hookResult = renderHook(() => + useNavigateToSessionView({ isFlyoutOpen: true, eventId, indexName, scopeId }) + ); + hookResult.result.current.navigateToSessionView(); + expect(mockFlyoutApi.openFlyout).not.toHaveBeenCalled(); + expect(mockFlyoutApi.openLeftPanel).toHaveBeenCalledWith({ + id: DocumentDetailsLeftPanelKey, + path: { + tab: 'visualize', + subTab: SESSION_VIEW_ID, + }, + params: { + id: eventId, + indexName, + scopeId, + }, + }); + }); + + it('when isFlyoutOpen is true and in preview mode, should return callback that opens a new flyout', () => { + const hookResult = renderHook(() => + useNavigateToSessionView({ + isFlyoutOpen: true, + eventId, + indexName, + scopeId, + isPreviewMode: true, + }) + ); + hookResult.result.current.navigateToSessionView(); + + expect(mockFlyoutApi.openLeftPanel).not.toHaveBeenCalled(); + expect(mockFlyoutApi.openFlyout).toHaveBeenCalledWith({ + right: { + id: DocumentDetailsRightPanelKey, + params: { + id: eventId, + indexName, + scopeId, + }, + }, + left: { + id: DocumentDetailsLeftPanelKey, + path: { + tab: 'visualize', + subTab: SESSION_VIEW_ID, + }, + params: { + id: eventId, + indexName, + scopeId, + }, + }, + }); + }); + + it('when isFlyoutOpen is false, should return callback that opens a new flyout', () => { + const hookResult = renderHook(() => + useNavigateToSessionView({ isFlyoutOpen: false, eventId, indexName, scopeId }) + ); + hookResult.result.current.navigateToSessionView(); + expect(mockFlyoutApi.openLeftPanel).not.toHaveBeenCalled(); + expect(mockFlyoutApi.openFlyout).toHaveBeenCalledWith({ + right: { + id: DocumentDetailsRightPanelKey, + params: { + id: eventId, + indexName, + scopeId, + }, + }, + left: { + id: DocumentDetailsLeftPanelKey, + path: { + tab: 'visualize', + subTab: SESSION_VIEW_ID, + }, + params: { + id: eventId, + indexName, + scopeId, + }, + }, + }); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_session_view.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_session_view.tsx similarity index 77% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_session_view.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_session_view.tsx index d98ce5f489e38..21171c1393c65 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_session_view.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_session_view.tsx @@ -13,6 +13,7 @@ import { useKibana } from '../../../../common/lib/kibana'; import { SESSION_VIEW_ID } from '../../left/components/session_view'; import { DocumentDetailsLeftPanelKey, DocumentDetailsRightPanelKey } from '../constants/panel_keys'; import { DocumentEventTypes } from '../../../../common/lib/telemetry'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; export interface UseNavigateToSessionViewParams { /** @@ -32,6 +33,10 @@ export interface UseNavigateToSessionViewParams { * Scope id of the page */ scopeId: string; + /** + * Whether the preview mode is enabled + */ + isPreviewMode?: boolean; } export interface UseNavigateToSessionViewResult { @@ -49,10 +54,15 @@ export const useNavigateToSessionView = ({ eventId, indexName, scopeId, + isPreviewMode, }: UseNavigateToSessionViewParams): UseNavigateToSessionViewResult => { const { telemetry } = useKibana().services; const { openLeftPanel, openFlyout } = useExpandableFlyoutApi(); + const isNewNavigationEnabled = useIsExperimentalFeatureEnabled( + 'newExpandableFlyoutNavigationEnabled' + ); + const right: FlyoutPanelProps = useMemo( () => ({ id: DocumentDetailsRightPanelKey, @@ -82,14 +92,18 @@ export const useNavigateToSessionView = ({ ); const navigateToSessionView = useCallback(() => { - if (isFlyoutOpen) { + // open left panel if not in preview mode + if (isFlyoutOpen && !isPreviewMode) { openLeftPanel(left); telemetry.reportEvent(DocumentEventTypes.DetailsFlyoutTabClicked, { location: scopeId, panel: 'left', tabId: 'visualize', }); - } else { + } + // if flyout is not currently open, open flyout with right and left panels + // if new navigation is enabled and in preview mode, open flyout with right and left panels + else if (!isFlyoutOpen || (isNewNavigationEnabled && isPreviewMode)) { openFlyout({ right, left, @@ -99,7 +113,17 @@ export const useNavigateToSessionView = ({ panel: 'left', }); } - }, [openFlyout, openLeftPanel, right, left, scopeId, telemetry, isFlyoutOpen]); + }, [ + openFlyout, + openLeftPanel, + right, + left, + scopeId, + telemetry, + isFlyoutOpen, + isNewNavigationEnabled, + isPreviewMode, + ]); return useMemo(() => ({ navigateToSessionView }), [navigateToSessionView]); }; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_prevalence.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_prevalence.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_prevalence.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_prevalence.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_prevalence.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_prevalence.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_prevalence.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_prevalence.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_rule_details_link.test.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_rule_details_link.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_rule_details_link.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_rule_details_link.test.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_rule_details_link.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_rule_details_link.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_rule_details_link.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_rule_details_link.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_ancestry.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_ancestry.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_ancestry.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_ancestry.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_ancestry.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_ancestry.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_ancestry.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_ancestry.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_same_source_event.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_same_source_event.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_same_source_event.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_same_source_event.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_same_source_event.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_same_source_event.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_same_source_event.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_same_source_event.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_session.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_session.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_session.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_session.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_session.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_session.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_session.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_alerts_by_session.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_cases.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_cases.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_cases.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_cases.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_cases.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_cases.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_cases.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_related_cases.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_suppressed_alerts.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_suppressed_alerts.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_suppressed_alerts.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_suppressed_alerts.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_suppressed_alerts.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_suppressed_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_suppressed_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_show_suppressed_alerts.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_which_flyout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_which_flyout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_which_flyout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_which_flyout.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_which_flyout.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_which_flyout.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_which_flyout.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_which_flyout.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_browser_fields.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_browser_fields.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_browser_fields.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_browser_fields.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_context.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_context.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_context.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_context.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_data_as_nested_object.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_data_as_nested_object.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_data_as_nested_object.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_data_as_nested_object.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_data_formatted_for_field_browser.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_data_formatted_for_field_browser.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_data_formatted_for_field_browser.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_data_formatted_for_field_browser.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_flyout_context.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_flyout_context.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_flyout_context.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_flyout_context.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_get_fields_data.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_get_fields_data.ts similarity index 89% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_get_fields_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_get_fields_data.ts index bf8b8cbeae422..00e4385bf7f25 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_get_fields_data.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_get_fields_data.ts @@ -30,7 +30,7 @@ export const mockFieldData: Record<string, string[]> = { }; /** - * Returns mocked data for field (mock this method: x-pack/plugins/security_solution/public/common/hooks/use_get_fields_data.ts) + * Returns mocked data for field (mock this method: x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_get_fields_data.ts) * @param field * @returns string[] */ diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_search_hit.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_search_hit.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_search_hit.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/mocks/mock_search_hit.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/services/threat_intelligence.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/services/threat_intelligence.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/services/threat_intelligence.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/services/threat_intelligence.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/types.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/types.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/types.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/types.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/utils.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/utils.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/utils.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/utils.tsx similarity index 94% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/utils.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/utils.tsx index 9953fa0fbbfb1..e200519184b53 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/utils.tsx @@ -9,7 +9,7 @@ import { startCase } from 'lodash'; import type { GetFieldsData } from './hooks/use_get_fields_data'; /** - * Helper function to retrieve a field's value (used in combination with the custom hook useGetFieldsData (https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/public/common/hooks/use_get_fields_data.ts) + * Helper function to retrieve a field's value (used in combination with the custom hook useGetFieldsData (x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/hooks/use_get_fields_data.ts) * @param field type unknown or unknown[] * @param emptyValue optional parameter to return if field is incorrect * @return the field's value, or null/emptyValue diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils/build_requests.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/utils/build_requests.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/utils/build_requests.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/utils/build_requests.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils/fetch_data.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/utils/fetch_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/utils/fetch_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/utils/fetch_data.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils/highlighted_fields_helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/utils/highlighted_fields_helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/utils/highlighted_fields_helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/utils/highlighted_fields_helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils/highlighted_fields_helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/utils/highlighted_fields_helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/utils/highlighted_fields_helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/utils/highlighted_fields_helpers.ts diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils/threat_intelligence.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/utils/threat_intelligence.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/utils/threat_intelligence.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/utils/threat_intelligence.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils/threat_intelligence.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/utils/threat_intelligence.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/document_details/shared/utils/threat_intelligence.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/utils/threat_intelligence.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/host_details_left/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_details_left/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/host_details_left/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_details_left/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/host_details_left/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_details_left/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/host_details_left/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_details_left/index.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/host_preview/footer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_preview/footer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/host_preview/footer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_preview/footer.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/host_preview/footer.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_preview/footer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/host_preview/footer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_preview/footer.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/content.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/content.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/host_right/content.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/content.stories.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/content.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/host_right/content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/content.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/fields/basic_host_fields.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/fields/basic_host_fields.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/host_right/fields/basic_host_fields.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/fields/basic_host_fields.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/fields/cloud_fields.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/fields/cloud_fields.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/host_right/fields/cloud_fields.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/fields/cloud_fields.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/fields/endpoint_policy_fields.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/fields/endpoint_policy_fields.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/host_right/fields/endpoint_policy_fields.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/fields/endpoint_policy_fields.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/fields/endpoint_policy_fields.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/fields/endpoint_policy_fields.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/host_right/fields/endpoint_policy_fields.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/fields/endpoint_policy_fields.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/fields/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/fields/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/host_right/fields/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/fields/translations.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/header.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/header.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/host_right/header.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/header.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/header.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/host_right/header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/header.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/hooks/use_observed_host.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/hooks/use_observed_host.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/host_right/hooks/use_observed_host.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/hooks/use_observed_host.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/hooks/use_observed_host_fields.test.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/hooks/use_observed_host_fields.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/host_right/hooks/use_observed_host_fields.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/hooks/use_observed_host_fields.test.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/hooks/use_observed_host_fields.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/hooks/use_observed_host_fields.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/host_right/hooks/use_observed_host_fields.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/hooks/use_observed_host_fields.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/host_right/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/host_right/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/host_right/index.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/mocks/index.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/mocks/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/mocks/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/mocks/index.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/shared/common.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/common.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/shared/common.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/common.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/shared/common.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/common.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/shared/common.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/common.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/anomalies_field.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/anomalies_field.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/anomalies_field.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/anomalies_field.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/anomalies_field.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/anomalies_field.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/anomalies_field.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/anomalies_field.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/entity_table/columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/entity_table/columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/entity_table/columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/entity_table/columns.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/entity_table/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/entity_table/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/entity_table/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/entity_table/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/entity_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/entity_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/entity_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/entity_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/entity_table/types.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/entity_table/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/entity_table/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/entity_table/types.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/left_panel/left_panel_content.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/left_panel/left_panel_content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/left_panel/left_panel_content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/left_panel/left_panel_content.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/left_panel/left_panel_header.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/left_panel/left_panel_header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/left_panel/left_panel_header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/left_panel/left_panel_header.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/observed_entity/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/observed_entity/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/observed_entity/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/observed_entity/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/observed_entity/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/observed_entity/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/observed_entity/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/observed_entity/index.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/observed_entity/types.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/observed_entity/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/shared/components/observed_entity/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/components/observed_entity/types.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/shared/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/shared/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/constants.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/shared/hooks/use_managed_user.test.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/hooks/use_managed_user.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/shared/hooks/use_managed_user.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/hooks/use_managed_user.test.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/shared/hooks/use_managed_user.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/hooks/use_managed_user.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/shared/hooks/use_managed_user.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/hooks/use_managed_user.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/shared/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/shared/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/shared/translations.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_details_left/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_details_left/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_details_left/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_details_left/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_details_left/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_details_left/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_details_left/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_details_left/index.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_details_left/tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_details_left/tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_details_left/tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_details_left/tabs.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_details_left/tabs/asset_document.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_details_left/tabs/asset_document.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_details_left/tabs/asset_document.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_details_left/tabs/asset_document.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_details_left/tabs/asset_document.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_details_left/tabs/asset_document.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_details_left/tabs/asset_document.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_details_left/tabs/asset_document.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_details_left/tabs/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_details_left/tabs/test_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_details_left/tabs/test_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_details_left/tabs/test_ids.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_details_left/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_details_left/test_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_details_left/test_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_details_left/test_ids.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_preview/footer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_preview/footer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_preview/footer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_preview/footer.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_preview/footer.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_preview/footer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_preview/footer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_preview/footer.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/components/managed_user.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/components/managed_user.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/components/managed_user.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/components/managed_user.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/components/managed_user.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/components/managed_user.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/components/managed_user.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/components/managed_user.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/components/managed_user_accordion.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/components/managed_user_accordion.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/components/managed_user_accordion.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/components/managed_user_accordion.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/components/managed_user_accordion.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/components/managed_user_accordion.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/components/managed_user_accordion.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/components/managed_user_accordion.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/constants.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/content.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/content.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/content.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/content.stories.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/content.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/content.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/header.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/header.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/header.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/header.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/header.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/header.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/hooks/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/hooks/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/hooks/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/hooks/translations.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/hooks/use_managed_user_items.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/hooks/use_managed_user_items.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/hooks/use_managed_user_items.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/hooks/use_managed_user_items.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/hooks/use_managed_user_items.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/hooks/use_managed_user_items.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/hooks/use_managed_user_items.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/hooks/use_managed_user_items.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/hooks/use_observed_user.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/hooks/use_observed_user.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/hooks/use_observed_user.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/hooks/use_observed_user.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/hooks/use_observed_user_items.test.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/hooks/use_observed_user_items.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/hooks/use_observed_user_items.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/hooks/use_observed_user_items.test.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/hooks/use_observed_user_items.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/hooks/use_observed_user_items.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/hooks/use_observed_user_items.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/hooks/use_observed_user_items.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/index.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/mocks/index.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/mocks/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/mocks/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/mocks/index.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/translations.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/types.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/types.ts diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/utils/columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/utils/columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/entity_details/user_right/utils/columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/entity_details/user_right/utils/columns.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/index.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/flyout/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/flyout/jest.config.js new file mode 100644 index 0000000000000..be8045c6b5af1 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/flyout'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/flyout', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/flyout/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/flyout/network_details/components/network_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/network_details/components/network_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/network_details/components/network_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/network_details/components/network_details.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/network_details/content.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/network_details/content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/network_details/content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/network_details/content.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/network_details/header.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/network_details/header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/network_details/header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/network_details/header.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/network_details/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/network_details/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/network_details/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/network_details/index.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/rule_details/hooks/use_rule_details.test.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/hooks/use_rule_details.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/rule_details/hooks/use_rule_details.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/hooks/use_rule_details.test.ts diff --git a/x-pack/plugins/security_solution/public/flyout/rule_details/hooks/use_rule_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/hooks/use_rule_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/rule_details/hooks/use_rule_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/hooks/use_rule_details.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/rule_details/preview/footer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/preview/footer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/rule_details/preview/footer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/preview/footer.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/rule_details/preview/footer.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/preview/footer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/rule_details/preview/footer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/preview/footer.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/rule_details/preview/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/preview/test_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/rule_details/preview/test_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/preview/test_ids.ts diff --git a/x-pack/plugins/security_solution/public/flyout/rule_details/right/content.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/right/content.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/rule_details/right/content.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/right/content.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/rule_details/right/content.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/right/content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/rule_details/right/content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/right/content.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/rule_details/right/header.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/right/header.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/rule_details/right/header.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/right/header.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/rule_details/right/header.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/right/header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/rule_details/right/header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/right/header.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/rule_details/right/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/right/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/rule_details/right/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/right/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/rule_details/right/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/right/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/rule_details/right/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/right/index.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/rule_details/right/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/right/test_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/rule_details/right/test_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/rule_details/right/test_ids.ts diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/alert_preview_button.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/alert_preview_button.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/alert_preview_button.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/alert_preview_button.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/alert_preview_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/alert_preview_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/alert_preview_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/alert_preview_button.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/expandable_panel.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/expandable_panel.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/expandable_panel.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/expandable_panel.stories.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/expandable_panel.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/expandable_panel.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/expandable_panel.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/expandable_panel.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/expandable_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/expandable_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/expandable_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/expandable_panel.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_body.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_body.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_body.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_body.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_body.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_body.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_body.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_error.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_error.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_error.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_error.stories.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_error.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_error.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_error.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_error.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_error.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_error.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_error.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_error.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_footer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_footer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_footer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_footer.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_footer.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_footer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_footer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_footer.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_header.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_header.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_header.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_header.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_header.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_header.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_header_tabs.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_header_tabs.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_header_tabs.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_header_tabs.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_header_tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_header_tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_header_tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_header_tabs.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_history.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_history.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_history.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_history.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_history.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_history.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_history.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_history.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_history_row.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_history_row.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_history_row.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_history_row.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_history_row.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_history_row.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_history_row.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_history_row.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_loading.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_loading.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_loading.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_loading.stories.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_loading.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_loading.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_loading.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_loading.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_loading.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_loading.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_loading.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_loading.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_navigation.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_navigation.stories.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_navigation.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_navigation.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_navigation.tsx similarity index 97% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_navigation.tsx index 89798687c3e62..63fc411c347b0 100644 --- a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_navigation.tsx @@ -63,12 +63,12 @@ export const FlyoutNavigation: FC<FlyoutNavigationProps> = memo( const { euiTheme } = useEuiTheme(); const history = useExpandableFlyoutHistory(); - const isFlyoutHistoryEnabled = useIsExperimentalFeatureEnabled( + const isNewNavigationEnabled = useIsExperimentalFeatureEnabled( 'newExpandableFlyoutNavigationEnabled' ); const historyArray = useMemo(() => getProcessedHistory({ history, maxCount: 10 }), [history]); // Don't show history in rule preview - const hasHistory = !isPreview && isFlyoutHistoryEnabled; + const hasHistory = !isPreview && isNewNavigationEnabled; const panels = useExpandableFlyoutState(); const isExpanded: boolean = !!panels.left; diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_title.stories.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_title.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_title.stories.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_title.stories.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_title.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_title.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_title.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_title.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_title.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_title.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/flyout_title.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/flyout_title.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/preview_link.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/preview_link.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/preview_link.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/preview_link.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/preview_link.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/preview_link.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/preview_link.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/preview_link.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/test_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/components/test_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/components/test_ids.ts diff --git a/x-pack/plugins/security_solution/public/flyout/shared/hooks/use_on_expandable_flyout_close.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/hooks/use_on_expandable_flyout_close.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/hooks/use_on_expandable_flyout_close.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/hooks/use_on_expandable_flyout_close.test.tsx diff --git a/x-pack/plugins/security_solution/public/flyout/shared/hooks/use_on_expandable_flyout_close.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/hooks/use_on_expandable_flyout_close.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/hooks/use_on_expandable_flyout_close.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/hooks/use_on_expandable_flyout_close.ts diff --git a/x-pack/plugins/security_solution/public/flyout/shared/mocks/index.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/mocks/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/mocks/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/mocks/index.ts diff --git a/x-pack/plugins/security_solution/public/flyout/shared/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/test_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/test_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/test_ids.ts diff --git a/x-pack/plugins/security_solution/public/flyout/shared/utils/history_utils.test.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/utils/history_utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/utils/history_utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/utils/history_utils.test.ts diff --git a/x-pack/plugins/security_solution/public/flyout/shared/utils/history_utils.ts b/x-pack/solutions/security/plugins/security_solution/public/flyout/shared/utils/history_utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/flyout/shared/utils/history_utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/flyout/shared/utils/history_utils.ts diff --git a/x-pack/plugins/security_solution/public/helper_hooks.tsx b/x-pack/solutions/security/plugins/security_solution/public/helper_hooks.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/helper_hooks.tsx rename to x-pack/solutions/security/plugins/security_solution/public/helper_hooks.tsx diff --git a/x-pack/plugins/security_solution/public/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/index.ts b/x-pack/solutions/security/plugins/security_solution/public/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/index.ts diff --git a/x-pack/plugins/security_solution/public/investigations/index.ts b/x-pack/solutions/security/plugins/security_solution/public/investigations/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/investigations/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/investigations/index.ts diff --git a/x-pack/plugins/security_solution/public/investigations/investigations.tsx b/x-pack/solutions/security/plugins/security_solution/public/investigations/investigations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/investigations/investigations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/investigations/investigations.tsx diff --git a/x-pack/plugins/security_solution/public/investigations/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/investigations/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/investigations/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/investigations/routes.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/jest.config.js new file mode 100644 index 0000000000000..322cf3147f2bc --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/jest.config.js @@ -0,0 +1,31 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../..', + /** all nested directories have their own Jest config file */ + testMatch: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/*.test.{js,mjs,ts,tsx}', + ], + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/**/*.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution/public/*.test.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution/public/{__test__,__snapshots__,__examples__,*mock*,tests,test_helpers,integration_tests,types}/**/*', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution/public/*mock*.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution/public/*.test.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution/public/*.d.ts', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution/public/*.config.ts', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution/public/index.{js,ts,tsx}', + ], + + moduleNameMapper: require('../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/kubernetes/index.ts b/x-pack/solutions/security/plugins/security_solution/public/kubernetes/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/kubernetes/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/kubernetes/index.ts diff --git a/x-pack/plugins/security_solution/public/kubernetes/links.ts b/x-pack/solutions/security/plugins/security_solution/public/kubernetes/links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/kubernetes/links.ts rename to x-pack/solutions/security/plugins/security_solution/public/kubernetes/links.ts diff --git a/x-pack/plugins/security_solution/public/kubernetes/pages/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/kubernetes/pages/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/kubernetes/pages/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/kubernetes/pages/constants.ts diff --git a/x-pack/plugins/security_solution/public/kubernetes/pages/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/kubernetes/pages/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/kubernetes/pages/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/kubernetes/pages/index.tsx diff --git a/x-pack/plugins/security_solution/public/kubernetes/pages/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/kubernetes/pages/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/kubernetes/pages/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/kubernetes/pages/translations.ts diff --git a/x-pack/plugins/security_solution/public/kubernetes/pages/utils/breadcrumbs.ts b/x-pack/solutions/security/plugins/security_solution/public/kubernetes/pages/utils/breadcrumbs.ts similarity index 100% rename from x-pack/plugins/security_solution/public/kubernetes/pages/utils/breadcrumbs.ts rename to x-pack/solutions/security/plugins/security_solution/public/kubernetes/pages/utils/breadcrumbs.ts diff --git a/x-pack/plugins/security_solution/public/kubernetes/pages/utils/data_view_spec_to_index_pattern.ts b/x-pack/solutions/security/plugins/security_solution/public/kubernetes/pages/utils/data_view_spec_to_index_pattern.ts similarity index 100% rename from x-pack/plugins/security_solution/public/kubernetes/pages/utils/data_view_spec_to_index_pattern.ts rename to x-pack/solutions/security/plugins/security_solution/public/kubernetes/pages/utils/data_view_spec_to_index_pattern.ts diff --git a/x-pack/plugins/security_solution/public/kubernetes/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/kubernetes/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/kubernetes/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/kubernetes/routes.tsx diff --git a/x-pack/plugins/security_solution/public/lazy_actions.ts b/x-pack/solutions/security/plugins/security_solution/public/lazy_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/lazy_actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/lazy_actions.ts diff --git a/x-pack/plugins/security_solution/public/lazy_application_dependencies.tsx b/x-pack/solutions/security/plugins/security_solution/public/lazy_application_dependencies.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/lazy_application_dependencies.tsx rename to x-pack/solutions/security/plugins/security_solution/public/lazy_application_dependencies.tsx diff --git a/x-pack/plugins/security_solution/public/lazy_assistant_settings_management.tsx b/x-pack/solutions/security/plugins/security_solution/public/lazy_assistant_settings_management.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/lazy_assistant_settings_management.tsx rename to x-pack/solutions/security/plugins/security_solution/public/lazy_assistant_settings_management.tsx diff --git a/x-pack/plugins/security_solution/public/lazy_sub_plugins.tsx b/x-pack/solutions/security/plugins/security_solution/public/lazy_sub_plugins.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/lazy_sub_plugins.tsx rename to x-pack/solutions/security/plugins/security_solution/public/lazy_sub_plugins.tsx diff --git a/x-pack/plugins/security_solution/public/machine_learning/index.ts b/x-pack/solutions/security/plugins/security_solution/public/machine_learning/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/machine_learning/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/machine_learning/index.ts diff --git a/x-pack/plugins/security_solution/public/machine_learning/machine_learning.tsx b/x-pack/solutions/security/plugins/security_solution/public/machine_learning/machine_learning.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/machine_learning/machine_learning.tsx rename to x-pack/solutions/security/plugins/security_solution/public/machine_learning/machine_learning.tsx diff --git a/x-pack/plugins/security_solution/public/machine_learning/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/machine_learning/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/machine_learning/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/machine_learning/routes.tsx diff --git a/x-pack/plugins/security_solution/public/management/common/breadcrumbs.ts b/x-pack/solutions/security/plugins/security_solution/public/management/common/breadcrumbs.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/common/breadcrumbs.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/common/breadcrumbs.ts diff --git a/x-pack/plugins/security_solution/public/management/common/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/management/common/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/common/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/common/constants.ts diff --git a/x-pack/plugins/security_solution/public/management/common/hooks.ts b/x-pack/solutions/security/plugins/security_solution/public/management/common/hooks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/common/hooks.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/common/hooks.ts diff --git a/x-pack/plugins/security_solution/public/management/common/routing.ts b/x-pack/solutions/security/plugins/security_solution/public/management/common/routing.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/common/routing.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/common/routing.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/management/common/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/management/common/translations.ts new file mode 100644 index 0000000000000..50885a9db6b6a --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/management/common/translations.ts @@ -0,0 +1,323 @@ +/* + * 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 { OperatingSystem } from '@kbn/securitysolution-utils'; +import type { ServerApiError } from '../../common/types'; + +export const ENDPOINTS_TAB = i18n.translate('xpack.securitySolution.endpointsTab', { + defaultMessage: 'Endpoints', +}); + +export const POLICIES_TAB = i18n.translate('xpack.securitySolution.policiesTab', { + defaultMessage: 'Policies', +}); + +export const TRUSTED_APPS_TAB = i18n.translate('xpack.securitySolution.trustedAppsTab', { + defaultMessage: 'Trusted applications', +}); + +export const EVENT_FILTERS_TAB = i18n.translate('xpack.securitySolution.eventFiltersTab', { + defaultMessage: 'Event filters', +}); + +export const OS_TITLES: Readonly<{ [K in OperatingSystem]: string }> = { + [OperatingSystem.WINDOWS]: i18n.translate('xpack.securitySolution.administration.os.windows', { + defaultMessage: 'Windows', + }), + [OperatingSystem.MAC]: i18n.translate('xpack.securitySolution.administration.os.macos', { + defaultMessage: 'Mac', + }), + [OperatingSystem.LINUX]: i18n.translate('xpack.securitySolution.administration.os.linux', { + defaultMessage: 'Linux', + }), +}; + +export const getLoadPoliciesError = (error: ServerApiError) => { + return i18n.translate('xpack.securitySolution.exceptions.failedLoadPolicies', { + defaultMessage: 'There was an error loading policies: "{error}"', + values: { error: error.message }, + }); +}; + +export const CONSOLE_COMMANDS = { + isolate: { + title: i18n.translate('xpack.securitySolution.endpointConsoleCommands.isolate.title', { + defaultMessage: 'Isolate', + }), + about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.isolate.about', { + defaultMessage: 'Isolate the host', + }), + privileges: i18n.translate( + 'xpack.securitySolution.endpointConsoleCommands.isolate.privileges', + { + defaultMessage: + 'Insufficient privileges to isolate hosts. Contact your Kibana administrator if you think you should have this permission.', + } + ), + }, + release: { + about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.release.about', { + defaultMessage: 'Release the host', + }), + }, + killProcess: { + title: i18n.translate('xpack.securitySolution.endpointConsoleCommands.killProcess.title', { + defaultMessage: 'Kill process', + }), + about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.killProcess.about', { + defaultMessage: 'Kill/terminate a process', + }), + privileges: i18n.translate( + 'xpack.securitySolution.endpointConsoleCommands.killProcess.privileges', + { + defaultMessage: + 'Insufficient privileges to kill process. Contact your Kibana administrator if you think you should have this permission.', + } + ), + args: { + pid: { + about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.pid.arg.comment', { + defaultMessage: 'A PID representing the process to kill', + }), + }, + entityId: { + about: i18n.translate( + 'xpack.securitySolution.endpointConsoleCommands.entityId.arg.comment', + { + defaultMessage: 'An entity id representing the process to kill', + } + ), + }, + processName: { + about: i18n.translate( + 'xpack.securitySolution.endpointConsoleCommands.processName.arg.comment', + { defaultMessage: 'The process name to kill' } + ), + }, + }, + }, + suspendProcess: { + title: i18n.translate('xpack.securitySolution.endpointConsoleCommands.suspendProcess.title', { + defaultMessage: 'Suspend process', + }), + about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.suspendProcess.about', { + defaultMessage: 'Temporarily suspend a process', + }), + privileges: i18n.translate( + 'xpack.securitySolution.endpointConsoleCommands.suspendProcess.privileges', + { + defaultMessage: + 'Insufficient privileges to supend process. Contact your Kibana administrator if you think you should have this permission.', + } + ), + args: { + pid: { + about: i18n.translate( + 'xpack.securitySolution.endpointConsoleCommands.suspendProcess.pid.arg.comment', + { + defaultMessage: 'A PID representing the process to suspend', + } + ), + }, + entityId: { + about: i18n.translate( + 'xpack.securitySolution.endpointConsoleCommands.suspendProcess.entityId.arg.comment', + { + defaultMessage: 'An entity id representing the process to suspend', + } + ), + }, + }, + }, + status: { + about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.status.about', { + defaultMessage: 'Show host status information', + }), + }, + processes: { + about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.processes.about', { + defaultMessage: 'Show all running processes', + }), + }, + getFile: { + about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.getFile.about', { + defaultMessage: 'Retrieve a file from the host', + }), + args: { + path: { + about: i18n.translate( + 'xpack.securitySolution.endpointConsoleCommands.getFile.pathArgAbout', + { + defaultMessage: 'The full file path to be retrieved', + } + ), + }, + }, + }, + execute: { + about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.execute.about', { + defaultMessage: 'Execute a command on the host', + }), + args: { + timeout: { + about: i18n.translate( + 'xpack.securitySolution.endpointConsoleCommands.execute.args.timeout.about', + { + defaultMessage: + 'The timeout in units of time (h for hours, m for minutes, s for seconds) for the endpoint to wait for the script to complete. Example: 37m. If not given, it defaults to 4 hours.', + } + ), + }, + }, + }, + upload: { + about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.upload.about', { + defaultMessage: 'Upload a file to the host', + }), + args: { + file: { + about: i18n.translate( + 'xpack.securitySolution.endpointConsoleCommands.upload.args.file.about', + { + defaultMessage: 'The file that will be sent to the host', + } + ), + }, + overwrite: { + about: i18n.translate( + 'xpack.securitySolution.endpointConsoleCommands.upload.args.overwrite.about', + { + defaultMessage: 'Overwrite the file on the host if it already exists', + } + ), + }, + }, + }, + scan: { + about: i18n.translate('xpack.securitySolution.endpointConsoleCommands.scan.about', { + defaultMessage: 'Scan the host for malware', + }), + args: { + path: { + about: i18n.translate( + 'xpack.securitySolution.endpointConsoleCommands.scan.args.path.about', + { + defaultMessage: 'The absolute path to a file or directory to be scanned', + } + ), + }, + }, + }, +}; + +export const CROWDSTRIKE_CONSOLE_COMMANDS = { + runscript: { + args: { + raw: { + about: i18n.translate( + 'xpack.securitySolution.crowdStrikeConsoleCommands.runscript.args.raw.about', + { + defaultMessage: 'Raw script content', + } + ), + }, + cloudFile: { + about: i18n.translate( + 'xpack.securitySolution.crowdStrikeConsoleCommands.runscript.args.cloudFile.about', + { + defaultMessage: 'Script name in cloud storage', + } + ), + }, + commandLine: { + about: i18n.translate( + 'xpack.securitySolution.crowdStrikeConsoleCommands.runscript.args.commandLine.about', + { + defaultMessage: 'Command line arguments', + } + ), + }, + hostPath: { + about: i18n.translate( + 'xpack.securitySolution.crowdStrikeConsoleCommands.runscript.args.hostPath.about', + { + defaultMessage: 'Absolute or relative path of script on host machine', + } + ), + }, + timeout: { + about: i18n.translate( + 'xpack.securitySolution.crowdStrikeConsoleCommands.runscript.args.timeout.about', + { + defaultMessage: 'Timeout in seconds', + } + ), + }, + }, + title: i18n.translate('xpack.securitySolution.crowdStrikeConsoleCommands.runscript.title', { + defaultMessage: 'Isolate', + }), + about: i18n.translate('xpack.securitySolution.crowdStrikeConsoleCommands.runscript.about', { + defaultMessage: 'Run a script on the host', + }), + helpUsage: i18n.translate('xpack.securitySolution.crowdStrikeConsoleCommands.runscript.about', { + defaultMessage: ` +Command Examples for Running Scripts: + +1. Executes a script saved in the CrowdStrike cloud with the specified command-line arguments. + + runscript --CloudFile="CloudScript1.ps1" --CommandLine="-Verbose true" + +2. Executes a script saved in the CrowdStrike cloud with the specified command-line arguments and a 180-second timeout. + + runscript --CloudFile="CloudScript1.ps1" --CommandLine="-Verbose true" -Timeout=180 + +3. Executes a raw script provided entirely within the "--Raw" flag. + + runscript --Raw=\`\`\`Get-ChildItem.\`\`\` + +4. Executes a script located on the remote host at the specified path with the provided command-line arguments. + + runscript --HostPath="C:\\temp\\LocalScript.ps1" --CommandLine="-Verbose true" + +`, + }), + privileges: i18n.translate( + 'xpack.securitySolution.crowdStrikeConsoleCommands.runscript.privileges', + { + defaultMessage: + 'Insufficient privileges to run script. Contact your Kibana administrator if you think you should have this permission.', + } + ), + }, +}; + +export const CONFIRM_WARNING_MODAL_LABELS = (entryType: string) => { + return { + title: i18n.translate('xpack.securitySolution.artifacts.confirmWarningModal.title', { + defaultMessage: `Confirm {type}`, + values: { type: entryType }, + }), + body: i18n.translate('xpack.securitySolution.artifacts.confirmWarningModal.body', { + defaultMessage: + 'Using a "*" or a "?" in the value with the "is" operator can make the entry ineffective. Change the operator to "matches" to ensure wildcards run properly. Select “Cancel” to revise your entry, or "Add" to continue with the entry in its current state.', + }), + confirmButton: i18n.translate( + 'xpack.securitySolution.artifacts.confirmWarningModal.confirmButtonText', + { + defaultMessage: 'Add', + } + ), + cancelButton: i18n.translate( + 'xpack.securitySolution.trustedapps.confirmWarningModal.cancelButtonText', + { + defaultMessage: 'Cancel', + } + ), + }; +}; diff --git a/x-pack/plugins/security_solution/public/management/common/url_routing/artifact_list_page_routing.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/common/url_routing/artifact_list_page_routing.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/common/url_routing/artifact_list_page_routing.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/common/url_routing/artifact_list_page_routing.test.ts diff --git a/x-pack/plugins/security_solution/public/management/common/url_routing/artifact_list_page_routing.ts b/x-pack/solutions/security/plugins/security_solution/public/management/common/url_routing/artifact_list_page_routing.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/common/url_routing/artifact_list_page_routing.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/common/url_routing/artifact_list_page_routing.ts diff --git a/x-pack/plugins/security_solution/public/management/common/url_routing/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/common/url_routing/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/common/url_routing/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/common/url_routing/index.ts diff --git a/x-pack/plugins/security_solution/public/management/common/url_routing/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/management/common/url_routing/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/common/url_routing/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/common/url_routing/utils.ts diff --git a/x-pack/plugins/security_solution/public/management/common/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/common/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/common/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/common/utils.test.ts diff --git a/x-pack/plugins/security_solution/public/management/common/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/management/common/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/common/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/common/utils.ts diff --git a/x-pack/plugins/security_solution/public/management/components/actions_context_menu/actions_context_menu.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/actions_context_menu/actions_context_menu.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/actions_context_menu/actions_context_menu.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/actions_context_menu/actions_context_menu.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/actions_context_menu/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/actions_context_menu/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/actions_context_menu/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/actions_context_menu/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/administration_list_page.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/administration_list_page.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/administration_list_page.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/administration_list_page.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_card_grid/artifact_card_grid.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_card_grid/artifact_card_grid.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_card_grid/artifact_card_grid.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_card_grid/artifact_card_grid.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_card_grid/artifact_card_grid.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_card_grid/artifact_card_grid.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_card_grid/artifact_card_grid.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_card_grid/artifact_card_grid.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_card_grid/components/grid_header.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_card_grid/components/grid_header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_card_grid/components/grid_header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_card_grid/components/grid_header.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_card_grid/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_card_grid/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_card_grid/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_card_grid/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_card.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_card_minified.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_card_minified.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_card_minified.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_card_minified.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_card_minified.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_card_minified.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_card_minified.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_card_minified.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_collapsible_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_collapsible_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_collapsible_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_collapsible_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_collapsible_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_collapsible_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_collapsible_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/artifact_entry_collapsible_card.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/card_actions_flex_item.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/card_actions_flex_item.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/card_actions_flex_item.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/card_actions_flex_item.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/card_comments.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/card_comments.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/card_comments.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/card_comments.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/card_compressed_header.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/card_compressed_header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/card_compressed_header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/card_compressed_header.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/card_container_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/card_container_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/card_container_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/card_container_panel.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/card_decorators/event_filters_process_descendant_indicator.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/card_decorators/event_filters_process_descendant_indicator.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/card_decorators/event_filters_process_descendant_indicator.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/card_decorators/event_filters_process_descendant_indicator.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/card_decorators/event_filters_process_descendant_indicator.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/card_decorators/event_filters_process_descendant_indicator.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/card_decorators/event_filters_process_descendant_indicator.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/card_decorators/event_filters_process_descendant_indicator.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/card_expand_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/card_expand_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/card_expand_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/card_expand_button.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/card_header.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/card_header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/card_header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/card_header.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/card_section_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/card_section_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/card_section_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/card_section_panel.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/card_sub_header.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/card_sub_header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/card_sub_header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/card_sub_header.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/criteria_conditions.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/criteria_conditions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/criteria_conditions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/criteria_conditions.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/date_field_value.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/date_field_value.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/date_field_value.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/date_field_value.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/description_field.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/description_field.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/description_field.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/description_field.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/effect_scope.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/effect_scope.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/effect_scope.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/effect_scope.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/text_value_display.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/text_value_display.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/text_value_display.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/text_value_display.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/touched_by_users.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/touched_by_users.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/touched_by_users.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/touched_by_users.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/components/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/components/translations.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/hooks/use_collapsed_css_class_names.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/hooks/use_collapsed_css_class_names.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/hooks/use_collapsed_css_class_names.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/hooks/use_collapsed_css_class_names.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/hooks/use_endpoint_policies_to_artifact_policies.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/hooks/use_endpoint_policies_to_artifact_policies.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/hooks/use_endpoint_policies_to_artifact_policies.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/hooks/use_endpoint_policies_to_artifact_policies.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/hooks/use_normalized_artifact.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/hooks/use_normalized_artifact.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/hooks/use_normalized_artifact.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/hooks/use_normalized_artifact.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/hooks/use_policy_nav_links.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/hooks/use_policy_nav_links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/hooks/use_policy_nav_links.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/hooks/use_policy_nav_links.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/test_utils.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/test_utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/test_utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/test_utils.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/types.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/types.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/utils/get_formatted_comments.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/utils/get_formatted_comments.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/utils/get_formatted_comments.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/utils/get_formatted_comments.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/utils/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/utils/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/utils/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/utils/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/utils/is_trusted_app.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/utils/is_trusted_app.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/utils/is_trusted_app.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/utils/is_trusted_app.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_entry_card/utils/map_to_artifact_info.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/utils/map_to_artifact_info.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_entry_card/utils/map_to_artifact_info.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_entry_card/utils/map_to_artifact_info.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/artifact_list_page.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/artifact_list_page.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/artifact_list_page.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/artifact_list_page.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_confirm_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_confirm_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_confirm_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_confirm_modal.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_delete_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_delete_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_delete_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_delete_modal.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/integration_tests/artifact_delete_modal.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/components/integration_tests/artifact_delete_modal.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/integration_tests/artifact_delete_modal.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/components/integration_tests/artifact_delete_modal.test.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/no_data_empty_state.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/components/no_data_empty_state.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/no_data_empty_state.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/components/no_data_empty_state.test.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/no_data_empty_state.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/components/no_data_empty_state.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/no_data_empty_state.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/components/no_data_empty_state.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_artifact_card_props_provider.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_artifact_card_props_provider.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_artifact_card_props_provider.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_artifact_card_props_provider.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_is_artifact_allowed_per_policy_usage.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_is_artifact_allowed_per_policy_usage.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_is_artifact_allowed_per_policy_usage.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_is_artifact_allowed_per_policy_usage.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_is_flyout_opened.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_is_flyout_opened.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_is_flyout_opened.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_is_flyout_opened.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_kuery_from_exceptions_search_filter.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_kuery_from_exceptions_search_filter.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_kuery_from_exceptions_search_filter.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_kuery_from_exceptions_search_filter.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_mark_workflow_insight_as_remediated.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_mark_workflow_insight_as_remediated.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_mark_workflow_insight_as_remediated.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_mark_workflow_insight_as_remediated.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_set_url_params.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_set_url_params.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_set_url_params.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_set_url_params.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_delete_item.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_delete_item.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_delete_item.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_delete_item.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_list_data.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_list_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_list_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_list_data.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_submit_data.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_submit_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_submit_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/hooks/use_with_artifact_submit_data.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/integration_tests/artifact_list_page.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/integration_tests/artifact_list_page.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/integration_tests/artifact_list_page.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/integration_tests/artifact_list_page.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/mocks.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/mocks.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/mocks.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/mocks.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/translations.ts diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/types.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/artifact_list_page/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/types.ts diff --git a/x-pack/plugins/security_solution/public/management/components/back_to_external_app_button/back_to_external_app_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/back_to_external_app_button/back_to_external_app_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/back_to_external_app_button/back_to_external_app_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/back_to_external_app_button/back_to_external_app_button.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/back_to_external_app_button/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/back_to_external_app_button/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/back_to_external_app_button/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/back_to_external_app_button/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/back_to_external_app_secondary_button/back_to_external_app_secondary_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/back_to_external_app_secondary_button/back_to_external_app_secondary_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/back_to_external_app_secondary_button/back_to_external_app_secondary_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/back_to_external_app_secondary_button/back_to_external_app_secondary_button.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/back_to_external_app_secondary_button/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/back_to_external_app_secondary_button/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/back_to_external_app_secondary_button/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/back_to_external_app_secondary_button/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/README.md b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/README.md similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/README.md rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/README.md diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/bad_argument.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/bad_argument.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/bad_argument.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/bad_argument.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/bad_argument.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/bad_argument.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/bad_argument.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/bad_argument.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/builtin_commands/clear_command.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/builtin_commands/clear_command.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/builtin_commands/clear_command.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/builtin_commands/clear_command.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/builtin_commands/help_command.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/builtin_commands/help_command.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/builtin_commands/help_command.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/builtin_commands/help_command.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/builtin_commands/help_command_argument.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/builtin_commands/help_command_argument.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/builtin_commands/help_command_argument.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/builtin_commands/help_command_argument.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/command_execution_output.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_execution_output.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/command_execution_output.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_execution_output.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/command_execution_output.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_execution_output.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/command_execution_output.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_execution_output.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/command_execution_result.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_execution_result.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/command_execution_result.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_execution_result.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/command_input/command_input.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/command_input.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/command_input/command_input.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/command_input.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/command_input/components/argument_selector_wrapper.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/components/argument_selector_wrapper.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/command_input/components/argument_selector_wrapper.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/components/argument_selector_wrapper.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/command_input/components/command_input_clear_history.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/components/command_input_clear_history.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/command_input/components/command_input_clear_history.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/components/command_input_clear_history.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/command_input/components/command_input_history.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/components/command_input_history.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/command_input/components/command_input_history.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/components/command_input_history.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/command_input/components/input_area_popover.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/components/input_area_popover.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/command_input/components/input_area_popover.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/components/input_area_popover.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/command_input/components/input_capture.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/components/input_capture.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/command_input/components/input_capture.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/components/input_capture.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/command_input/components/input_display.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/components/input_display.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/command_input/components/input_display.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/components/input_display.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/command_input/components/input_placeholder.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/components/input_placeholder.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/command_input/components/input_placeholder.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/components/input_placeholder.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/command_input/hooks/use_input_hints.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/hooks/use_input_hints.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/command_input/hooks/use_input_hints.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/hooks/use_input_hints.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/command_input/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/command_input/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/command_input/integration_tests/command_input.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/integration_tests/command_input.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/command_input/integration_tests/command_input.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/integration_tests/command_input.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/command_input/lib/entered_input.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/lib/entered_input.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/command_input/lib/entered_input.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/lib/entered_input.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/command_input/lib/entered_input.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/lib/entered_input.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/command_input/lib/entered_input.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_input/lib/entered_input.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/command_list.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_list.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/command_list.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_list.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/command_list.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_list.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/command_list.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_list.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/command_usage.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_usage.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/command_usage.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/command_usage.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_code_block.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_code_block.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_code_block.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_code_block.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_footer.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_footer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_footer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_footer.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_header.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_header.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_header.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_header.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_header.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_header.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_manager/components/console_page_overlay.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_manager/components/console_page_overlay.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_manager/components/console_page_overlay.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_manager/components/console_page_overlay.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_manager/components/page_layout.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_manager/components/page_layout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_manager/components/page_layout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_manager/components/page_layout.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_manager/console_manager.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_manager/console_manager.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_manager/console_manager.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_manager/console_manager.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_manager/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_manager/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_manager/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_manager/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_manager/integration_tests/console_manager.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_manager/integration_tests/console_manager.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_manager/integration_tests/console_manager.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_manager/integration_tests/console_manager.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_manager/mocks.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_manager/mocks.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_manager/mocks.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_manager/mocks.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_manager/types.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_manager/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_manager/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_manager/types.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_state/console_state.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/console_state.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_state/console_state.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/console_state.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_state/hooks/use_stored_input_history.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/hooks/use_stored_input_history.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_state/hooks/use_stored_input_history.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/hooks/use_stored_input_history.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_state/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_state/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_state/state_reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/state_reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_state/state_reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/state_reducer.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/handle_execute_command.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/handle_execute_command.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/handle_execute_command.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/handle_execute_command.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/handle_execute_command.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/handle_execute_command.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/handle_execute_command.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/handle_execute_command.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/handle_input_area_state.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/handle_input_area_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/handle_input_area_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/handle_input_area_state.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/handle_side_panel.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/handle_side_panel.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/handle_side_panel.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/handle_side_panel.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/handle_update_command_state.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/handle_update_command_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/handle_update_command_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/handle_update_command_state.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/state_update_handlers/translations.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_state/types.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_state/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_state/types.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/console_text.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_text.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/console_text.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/console_text.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/help_output.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/help_output.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/help_output.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/help_output.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/history_item.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/history_item.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/history_item.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/history_item.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/history_output.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/history_output.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/history_output.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/history_output.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/long_running_command_hint.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/long_running_command_hint.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/long_running_command_hint.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/long_running_command_hint.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/side_panel/side_panel_content_layout.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/side_panel/side_panel_content_layout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/side_panel/side_panel_content_layout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/side_panel/side_panel_content_layout.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/side_panel/side_panel_content_manager.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/side_panel/side_panel_content_manager.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/side_panel/side_panel_content_manager.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/side_panel/side_panel_content_manager.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/side_panel/side_panel_content_manager.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/side_panel/side_panel_content_manager.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/side_panel/side_panel_content_manager.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/side_panel/side_panel_content_manager.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/side_panel/side_panel_flex_item.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/side_panel/side_panel_flex_item.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/side_panel/side_panel_flex_item.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/side_panel/side_panel_flex_item.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/unknown_comand.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/unknown_comand.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/unknown_comand.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/unknown_comand.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/unsupported_message_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/unsupported_message_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/unsupported_message_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/unsupported_message_callout.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/user_command_input.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/user_command_input.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/user_command_input.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/user_command_input.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/validation_error.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/validation_error.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/validation_error.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/validation_error.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/components/validation_error.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/validation_error.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/components/validation_error.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/components/validation_error.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/console.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/console.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/console.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/console.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/console.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/console.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/console.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/console.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_command_history.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_command_history.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_command_history.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_command_history.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_console_state_dispatch.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_console_state_dispatch.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_console_state_dispatch.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_console_state_dispatch.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_data_test_subj.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_data_test_subj.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_data_test_subj.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_data_test_subj.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_command_argument_state.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_command_argument_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_command_argument_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_command_argument_state.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_command_list.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_command_list.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_command_list.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_command_list.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_custom_help_component.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_custom_help_component.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_custom_help_component.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_custom_help_component.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_footer_content.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_footer_content.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_footer_content.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_footer_content.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_command_entered.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_command_entered.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_command_entered.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_command_entered.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_history.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_history.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_history.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_history.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_placeholder.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_placeholder.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_placeholder.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_placeholder.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_show_popover.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_show_popover.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_show_popover.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_show_popover.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_text_entered.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_text_entered.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_text_entered.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_text_entered.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_visible_state.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_visible_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_visible_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_input_visible_state.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_side_panel.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_side_panel.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_side_panel.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/state_selectors/use_with_side_panel.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/hooks/use_storage_key.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/use_storage_key.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/hooks/use_storage_key.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/hooks/use_storage_key.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/mocks.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/mocks.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/mocks.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/mocks.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/service/builtin_commands.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/service/builtin_commands.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/service/builtin_commands.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/service/builtin_commands.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console/service/parse_command_input.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/service/parse_command_input.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/service/parse_command_input.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/service/parse_command_input.test.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/service/parsed_command_input.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/service/parsed_command_input.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/service/parsed_command_input.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/service/parsed_command_input.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/service/types.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/service/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/service/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/service/types.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/service/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/service/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/service/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/service/utils.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console/types.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console/types.ts diff --git a/x-pack/plugins/security_solution/public/management/components/console_argument_selectors/file_selector.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/console_argument_selectors/file_selector.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console_argument_selectors/file_selector.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console_argument_selectors/file_selector.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/console_argument_selectors/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/console_argument_selectors/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/console_argument_selectors/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/console_argument_selectors/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/context_menu_with_router_support/context_menu_item_nav_by_router.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/context_menu_with_router_support/context_menu_item_nav_by_router.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/context_menu_with_router_support/context_menu_item_nav_by_router.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/context_menu_with_router_support/context_menu_item_nav_by_router.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/context_menu_with_router_support/context_menu_with_router_support.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/context_menu_with_router_support/context_menu_with_router_support.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/context_menu_with_router_support/context_menu_with_router_support.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/context_menu_with_router_support/context_menu_with_router_support.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/context_menu_with_router_support/context_menu_with_router_support.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/context_menu_with_router_support/context_menu_with_router_support.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/context_menu_with_router_support/context_menu_with_router_support.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/context_menu_with_router_support/context_menu_with_router_support.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/context_menu_with_router_support/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/context_menu_with_router_support/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/context_menu_with_router_support/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/context_menu_with_router_support/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/effected_policy_select/effected_policy_select.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/effected_policy_select/effected_policy_select.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/effected_policy_select/effected_policy_select.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/effected_policy_select/effected_policy_select.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/effected_policy_select/effected_policy_select.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/effected_policy_select/effected_policy_select.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/effected_policy_select/effected_policy_select.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/effected_policy_select/effected_policy_select.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/effected_policy_select/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/effected_policy_select/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/effected_policy_select/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/effected_policy_select/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/effected_policy_select/test_utils.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/effected_policy_select/test_utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/effected_policy_select/test_utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/effected_policy_select/test_utils.ts diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_action_failure_message/endpoint_action_failure_message.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_action_failure_message/endpoint_action_failure_message.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_action_failure_message/endpoint_action_failure_message.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_action_failure_message/endpoint_action_failure_message.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_action_failure_message/endpoint_action_failure_message.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_action_failure_message/endpoint_action_failure_message.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_action_failure_message/endpoint_action_failure_message.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_action_failure_message/endpoint_action_failure_message.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_action_failure_message/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_action_failure_message/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_action_failure_message/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_action_failure_message/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_execute_action/execute_action_host_response.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_execute_action/execute_action_host_response.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_execute_action/execute_action_host_response.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_execute_action/execute_action_host_response.test.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_execute_action/execute_action_host_response.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_execute_action/execute_action_host_response.tsx new file mode 100644 index 0000000000000..09d1e45f24c45 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_execute_action/execute_action_host_response.tsx @@ -0,0 +1,80 @@ +/* + * 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 { EuiFlexItem, EuiSpacer } from '@elastic/eui'; +import React, { memo, useMemo } from 'react'; +import type { + ActionDetails, + MaybeImmutable, + ResponseActionExecuteOutputContent, + ResponseActionRunScriptOutputContent, + ResponseActionRunScriptParameters, + ResponseActionsExecuteParameters, +} from '../../../../common/endpoint/types'; +import { EXECUTE_FILE_LINK_TITLE } from '../endpoint_response_actions_list/translations'; +import { ResponseActionFileDownloadLink } from '../response_action_file_download_link'; +import { ExecuteActionHostResponseOutput } from './execute_action_host_response_output'; + +export interface ExecuteActionHostResponseProps { + action: MaybeImmutable< + | ActionDetails<ResponseActionExecuteOutputContent, ResponseActionsExecuteParameters> + | ActionDetails<ResponseActionRunScriptOutputContent, ResponseActionRunScriptParameters> + >; + agentId?: string; + canAccessFileDownloadLink: boolean; + 'data-test-subj'?: string; + textSize?: 'xs' | 's'; + hideFile?: boolean; + hideContext?: boolean; +} + +// Note: also used for RunScript command +export const ExecuteActionHostResponse = memo<ExecuteActionHostResponseProps>( + ({ + action, + agentId = action.agents[0], + canAccessFileDownloadLink, + textSize = 's', + 'data-test-subj': dataTestSubj, + hideFile, + hideContext, + }) => { + const outputContent = useMemo( + () => + action.outputs && + action.outputs[agentId] && + (action.outputs[agentId].content as ResponseActionExecuteOutputContent), + [action.outputs, agentId] + ); + + return ( + <> + {!hideFile && ( + <EuiFlexItem> + <ResponseActionFileDownloadLink + action={action} + buttonTitle={EXECUTE_FILE_LINK_TITLE} + canAccessFileDownloadLink={canAccessFileDownloadLink} + data-test-subj={`${dataTestSubj}-getExecuteLink`} + textSize={textSize} + /> + <EuiSpacer size="xxl" /> + </EuiFlexItem> + )} + {outputContent && ( + <ExecuteActionHostResponseOutput + outputContent={outputContent} + data-test-subj={`${dataTestSubj}-executeResponseOutput`} + textSize={textSize} + hideContext={hideContext} + /> + )} + </> + ); + } +); + +ExecuteActionHostResponse.displayName = 'ExecuteActionHostResponse'; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_execute_action/execute_action_host_response_output.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_execute_action/execute_action_host_response_output.tsx similarity index 94% rename from x-pack/plugins/security_solution/public/management/components/endpoint_execute_action/execute_action_host_response_output.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_execute_action/execute_action_host_response_output.tsx index f24f18e149393..4e6161b8767d9 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_execute_action/execute_action_host_response_output.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_execute_action/execute_action_host_response_output.tsx @@ -98,6 +98,7 @@ interface ShellInfoContentProps { textSize?: 's' | 'xs'; title: string; } + const ShellInfoContent = memo<ShellInfoContentProps>(({ content, textSize, title }) => ( <StyledEuiText size={textSize}> <strong> @@ -178,10 +179,12 @@ export interface ExecuteActionHostResponseOutputProps { outputContent: ResponseActionExecuteOutputContent; 'data-test-subj'?: string; textSize?: 's' | 'xs'; + hideContext?: boolean; } +// Note: also used for RunScript command export const ExecuteActionHostResponseOutput = memo<ExecuteActionHostResponseOutputProps>( - ({ outputContent, 'data-test-subj': dataTestSubj, textSize = 'xs' }) => { + ({ outputContent, 'data-test-subj': dataTestSubj, textSize = 'xs', hideContext }) => { const contextContent = useMemo( () => ( <> @@ -216,14 +219,16 @@ export const ExecuteActionHostResponseOutput = memo<ExecuteActionHostResponseOut return ( <> - <EuiFlexItem> - <ExecutionActionOutputAccordion - content={contextContent} - data-test-subj={`${dataTestSubj}-context`} - textSize={textSize} - type="context" - /> - </EuiFlexItem> + {!hideContext && ( + <EuiFlexItem> + <ExecutionActionOutputAccordion + content={contextContent} + data-test-subj={`${dataTestSubj}-context`} + textSize={textSize} + type="context" + /> + </EuiFlexItem> + )} <EuiFlexItem> {outputContent.stderr.length > 0 && ( <> diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_execute_action/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_execute_action/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_execute_action/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_execute_action/index.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_policy_link.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_policy_link.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_policy_link.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_policy_link.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_policy_link.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_policy_link.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_policy_link.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_policy_link.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/execute_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/execute_action.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/execute_action.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/execute_action.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_file_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_file_action.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_file_action.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_file_action.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_processes_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_processes_action.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_processes_action.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/get_processes_action.tsx 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/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/execute_action.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/execute_action.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/execute_action.test.tsx 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/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_file_action.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_file_action.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_file_action.test.tsx 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/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_processes_action.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_processes_action.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/get_processes_action.test.tsx 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/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/isolate_action.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/isolate_action.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/isolate_action.test.tsx 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/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/kill_process_action.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/kill_process_action.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/kill_process_action.test.tsx 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/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/release_action.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/release_action.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/release_action.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/scan_action.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/scan_action.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/scan_action.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/scan_action.test.tsx 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/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/status_action.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/status_action.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/status_action.test.tsx 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/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/suspend_process_action.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/suspend_process_action.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/suspend_process_action.test.tsx 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/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/upload_action.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/upload_action.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/integration_tests/upload_action.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/isolate_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/isolate_action.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/isolate_action.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/isolate_action.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/kill_process_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/kill_process_action.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/kill_process_action.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/kill_process_action.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/release_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/release_action.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/release_action.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/release_action.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/run_script_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/run_script_action.tsx new file mode 100644 index 0000000000000..e2ed358455027 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/run_script_action.tsx @@ -0,0 +1,96 @@ +/* + * 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, useMemo } from 'react'; + +import { i18n } from '@kbn/i18n'; +import { ExecuteActionHostResponse } from '../../endpoint_execute_action'; +import { useSendRunScriptEndpoint } from '../../../hooks/response_actions/use_send_run_script_endpoint_request'; +import type { RunScriptActionRequestBody } from '../../../../../common/api/endpoint'; +import { useConsoleActionSubmitter } from '../hooks/use_console_action_submitter'; +import type { + ResponseActionRunScriptOutputContent, + ResponseActionRunScriptParameters, +} from '../../../../../common/endpoint/types'; +import type { ActionRequestComponentProps } from '../types'; + +export const RunScriptActionResult = memo< + ActionRequestComponentProps< + { + Raw?: string; + HostPath?: string; + CloudFile?: string; + CommandLine?: string; + Timeout?: number; + comment?: string; + }, + ResponseActionRunScriptOutputContent, + ResponseActionRunScriptParameters + > +>(({ command, setStore, store, status, setStatus, ResultComponent }) => { + const actionCreator = useSendRunScriptEndpoint(); + const actionRequestBody = useMemo<undefined | RunScriptActionRequestBody>(() => { + const { endpointId, agentType } = command.commandDefinition?.meta ?? {}; + + if (!endpointId) { + return; + } + return { + agent_type: agentType, + endpoint_ids: [endpointId], + parameters: { + raw: command.args.args.Raw?.[0], + hostPath: command.args.args.HostPath?.[0], + cloudFile: command.args.args.CloudFile?.[0], + commandLine: command.args.args.CommandLine?.[0], + timeout: command.args.args.Timeout?.[0], + }, + comment: command.args.args?.comment?.[0], + }; + }, [command]); + + const { result, actionDetails: completedActionDetails } = useConsoleActionSubmitter< + RunScriptActionRequestBody, + ResponseActionRunScriptOutputContent, + ResponseActionRunScriptParameters + >({ + ResultComponent, + setStore, + store, + status, + setStatus, + actionCreator, + actionRequestBody, + dataTestSubj: 'runscript', + }); + + if (!completedActionDetails || !completedActionDetails.wasSuccessful) { + return result; + } + + return ( + <ResultComponent + data-test-subj="executeSuccess" + showAs="success" + title={i18n.translate( + 'xpack.securitySolution.endpointResponseActions.runScriptAction.successTitle', + { defaultMessage: 'RunScript was successful.' } + )} + > + <ExecuteActionHostResponse + action={completedActionDetails} + canAccessFileDownloadLink={true} + agentId={command.commandDefinition?.meta?.endpointId} + textSize="s" + data-test-subj="console" + hideFile={true} + hideContext={true} + /> + </ResultComponent> + ); +}); +RunScriptActionResult.displayName = 'RunScriptActionResult'; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/scan_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/scan_action.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/scan_action.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/scan_action.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/status_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/status_action.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/status_action.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/status_action.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/suspend_process_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/suspend_process_action.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/suspend_process_action.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/suspend_process_action.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/upload_action.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/upload_action.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/upload_action.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/command_render_components/upload_action.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_error.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/action_error.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_error.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/action_error.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_log_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/action_log_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_log_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/action_log_button.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_success.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/action_success.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/action_success.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/action_success.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/agent_info/agent_info.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/agent_info/agent_info.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/agent_info/agent_info.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/agent_info/agent_info.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/agent_info/agent_info.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/agent_info/agent_info.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/agent_info/agent_info.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/agent_info/agent_info.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/endpoint/header_endpoint_info.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/endpoint/header_endpoint_info.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/endpoint/header_endpoint_info.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/endpoint/header_endpoint_info.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/endpoint/header_endpoint_info.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/endpoint/header_endpoint_info.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/endpoint/header_endpoint_info.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/endpoint/header_endpoint_info.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/header_agent_info.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/header_agent_info.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/header_agent_info.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/header_agent_info.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/platforms/index.tsx b/x-pack/solutions/security/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/header_info/platforms/index.tsx rename to x-pack/solutions/security/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/header_info/platforms/logos/linux.svg b/x-pack/solutions/security/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/header_info/platforms/logos/linux.svg rename to x-pack/solutions/security/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/header_info/platforms/logos/macos.svg b/x-pack/solutions/security/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/header_info/platforms/logos/macos.svg rename to x-pack/solutions/security/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/header_info/platforms/logos/windows.svg b/x-pack/solutions/security/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/header_info/platforms/logos/windows.svg rename to x-pack/solutions/security/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/header_info/platforms/platform_icon.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/platforms/platform_icon.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/platforms/platform_icon.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/platforms/platform_icon.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/header_info/platforms/platform_icon.tsx b/x-pack/solutions/security/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/header_info/platforms/platform_icon.tsx rename to x-pack/solutions/security/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/offline_callout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/offline_callout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/offline_callout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/offline_callout.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/offline_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/offline_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/components/offline_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/components/offline_callout.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/hooks/use_console_action_submitter.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/hooks/use_console_action_submitter.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/hooks/use_console_action_submitter.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/hooks/use_console_action_submitter.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/hooks/use_console_action_submitter.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/hooks/use_console_action_submitter.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/hooks/use_console_action_submitter.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/hooks/use_console_action_submitter.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/console_commands_definition.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/lib/console_commands_definition.ts similarity index 99% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/console_commands_definition.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/lib/console_commands_definition.ts index 8c99186f69d93..22d138dea3586 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/console_commands_definition.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/lib/console_commands_definition.ts @@ -6,6 +6,7 @@ */ import { i18n } from '@kbn/i18n'; +import { RunScriptActionResult } from '../command_render_components/run_script_action'; import type { CommandArgDefinition } from '../../console/types'; import { isAgentTypeAndActionSupported } from '../../../../common/lib/endpoint'; import { getRbacControl } from '../../../../../common/endpoint/service/response_actions/utils'; @@ -531,14 +532,14 @@ export const getEndpointConsoleCommands = ({ aboutInfo: CROWDSTRIKE_CONSOLE_COMMANDS.runscript.about, isSupported: doesEndpointSupportCommand('runscript'), }), - RenderComponent: () => null, + RenderComponent: RunScriptActionResult, meta: { agentType, endpointId: endpointAgentId, capabilities: endpointCapabilities, privileges: endpointPrivileges, }, - exampleUsage: `runscript --Raw="Get-ChildItem ." --CommandLine=""`, + exampleUsage: `runscript --Raw=\`\`\`Get-ChildItem .\`\`\` --CommandLine=""`, helpUsage: CROWDSTRIKE_CONSOLE_COMMANDS.runscript.helpUsage, exampleInstruction: CROWDSTRIKE_CONSOLE_COMMANDS.runscript.about, validate: capabilitiesAndPrivilegesValidator(agentType), diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/constants.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/lib/constants.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/constants.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/lib/constants.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/endpoint_action_response_codes.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/lib/endpoint_action_response_codes.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/endpoint_action_response_codes.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/lib/endpoint_action_response_codes.ts diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/get_command_about_info.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/lib/get_command_about_info.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/get_command_about_info.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/lib/get_command_about_info.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/integration_tests/console_commands_definition.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/lib/integration_tests/console_commands_definition.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/integration_tests/console_commands_definition.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/lib/integration_tests/console_commands_definition.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/lib/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/lib/utils.test.ts diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/lib/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/lib/utils.ts diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/types.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_responder/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_responder/types.ts diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/action_log_expanded_tray.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/action_log_expanded_tray.tsx similarity index 92% rename from x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/action_log_expanded_tray.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/action_log_expanded_tray.tsx index cba1d0aee41b4..53f2c89ac84fc 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/action_log_expanded_tray.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/action_log_expanded_tray.tsx @@ -23,6 +23,7 @@ import { isExecuteAction, isGetFileAction, isProcessesAction, + isRunScriptAction, isUploadAction, } from '../../../../../common/endpoint/service/response_actions/type_guards'; import { EndpointUploadActionResult } from '../../endpoint_upload_action_result'; @@ -209,6 +210,30 @@ const OutputContent = memo<{ ); } + if (isRunScriptAction(action)) { + return ( + <EuiFlexGroup direction="column" data-test-subj={getTestId('runScriptDetails')}> + {action.agents.map((agentId) => ( + <div key={agentId}> + {OUTPUT_MESSAGES.wasSuccessful(command)} + <ExecuteActionHostResponse + action={action} + agentId={agentId} + canAccessFileDownloadLink={ + canAccessEndpointActionsLogManagement || canReadActionsLogManagement + } + textSize="xs" + data-test-subj={getTestId('actionsLogTray')} + hideFile={true} + hideContext={true} + /> + </div> + ))} + </EuiFlexGroup> + ); + } + + // CrowdStrike Isolate/Release actions if (action.agentType === 'crowdstrike') { return <>{OUTPUT_MESSAGES.submittedSuccessfully(command)}</>; } diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_date_range_picker.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_date_range_picker.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_date_range_picker.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_date_range_picker.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_empty_state.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_empty_state.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_empty_state.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_empty_state.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_filter.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_filter.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_filter.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_filter.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_filter_popover.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_filter_popover.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_filter_popover.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_filter_popover.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_filters.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_filters.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_filters.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_filters.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_table.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_users_filter.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_users_filter.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_users_filter.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_users_filter.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_users_filter.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_users_filter.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_users_filter.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/actions_log_users_filter.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/clear_all_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/clear_all_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/clear_all_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/clear_all_button.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/hooks.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/hooks.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/hooks.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/hooks.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/response_action_status_badge.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/response_action_status_badge.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/response_action_status_badge.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/response_action_status_badge.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/use_action_history_url_params.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/use_action_history_url_params.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/use_action_history_url_params.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/use_action_history_url_params.test.ts diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/use_action_history_url_params.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/use_action_history_url_params.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/use_action_history_url_params.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/components/use_action_history_url_params.ts 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/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/integration_tests/response_actions_log.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/integration_tests/response_actions_log.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/integration_tests/response_actions_log.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/mocks.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/mocks.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/mocks.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/mocks.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/response_actions_log.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_response_actions_list/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_response_actions_list/translations.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_upload_action_result/endpoint_upload_action_result.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_upload_action_result/endpoint_upload_action_result.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_upload_action_result/endpoint_upload_action_result.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_upload_action_result/endpoint_upload_action_result.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_upload_action_result/endpoint_upload_action_result.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_upload_action_result/endpoint_upload_action_result.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_upload_action_result/endpoint_upload_action_result.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_upload_action_result/endpoint_upload_action_result.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_upload_action_result/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_upload_action_result/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/endpoint_upload_action_result/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/endpoint_upload_action_result/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/formatted_error/formatted_error.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/formatted_error/formatted_error.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/formatted_error/formatted_error.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/formatted_error/formatted_error.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/formatted_error/formatted_error.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/formatted_error/formatted_error.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/formatted_error/formatted_error.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/formatted_error/formatted_error.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/formatted_error/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/formatted_error/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/formatted_error/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/formatted_error/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/key_value_display/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/key_value_display/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/key_value_display/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/key_value_display/index.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/key_value_display/key_value_display.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/key_value_display/key_value_display.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/key_value_display/key_value_display.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/key_value_display/key_value_display.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/management_empty_state.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/management_empty_state.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/management_empty_state.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/management_empty_state.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/management_empty_state_wrapper.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/management_empty_state_wrapper.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/management_empty_state_wrapper.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/management_empty_state_wrapper.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/management_page_loader.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/management_page_loader.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/management_page_loader.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/management_page_loader.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/missing_encryption_key_callout/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/missing_encryption_key_callout/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/missing_encryption_key_callout/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/missing_encryption_key_callout/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/missing_encryption_key_callout/missing_encryption_key_callout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/missing_encryption_key_callout/missing_encryption_key_callout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/missing_encryption_key_callout/missing_encryption_key_callout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/missing_encryption_key_callout/missing_encryption_key_callout.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/missing_encryption_key_callout/missing_encryption_key_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/missing_encryption_key_callout/missing_encryption_key_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/missing_encryption_key_callout/missing_encryption_key_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/missing_encryption_key_callout/missing_encryption_key_callout.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/package_action_item/package_action.formatter.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/package_action_item/package_action.formatter.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/package_action_item/package_action.formatter.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/package_action_item/package_action.formatter.test.ts diff --git a/x-pack/plugins/security_solution/public/management/components/package_action_item/package_action_formatter.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/package_action_item/package_action_formatter.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/package_action_item/package_action_formatter.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/package_action_item/package_action_formatter.ts diff --git a/x-pack/plugins/security_solution/public/management/components/package_action_item/package_action_item_error.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/package_action_item/package_action_item_error.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/package_action_item/package_action_item_error.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/package_action_item/package_action_item_error.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/page_overlay/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/page_overlay/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/page_overlay/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/page_overlay/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/page_overlay/page_overlay.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/page_overlay/page_overlay.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/page_overlay/page_overlay.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/page_overlay/page_overlay.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/page_overlay/page_overlay.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/page_overlay/page_overlay.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/page_overlay/page_overlay.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/page_overlay/page_overlay.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/paginated_content/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/paginated_content/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/paginated_content/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/paginated_content/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/paginated_content/paginated_content.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/paginated_content/paginated_content.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/paginated_content/paginated_content.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/paginated_content/paginated_content.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/paginated_content/paginated_content.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/paginated_content/paginated_content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/paginated_content/paginated_content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/paginated_content/paginated_content.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/policies_selector/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/policies_selector/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/policies_selector/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/policies_selector/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/policies_selector/policies_selector.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/policies_selector/policies_selector.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/policies_selector/policies_selector.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/policies_selector/policies_selector.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/policies_selector/policies_selector.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/policies_selector/policies_selector.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/policies_selector/policies_selector.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/policies_selector/policies_selector.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/policy_response/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/policy_response/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/policy_response/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/policy_response/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/policy_response/integration_tests/policy_response_wrapper.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/policy_response/integration_tests/policy_response_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/policy_response/integration_tests/policy_response_wrapper.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/policy_response/integration_tests/policy_response_wrapper.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/policy_response/policy_response.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/policy_response/policy_response.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/policy_response/policy_response.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/policy_response/policy_response.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/policy_response/policy_response_action_item.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/policy_response/policy_response_action_item.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/policy_response/policy_response_action_item.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/policy_response/policy_response_action_item.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/policy_response/policy_response_artifact_item.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/policy_response/policy_response_artifact_item.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/policy_response/policy_response_artifact_item.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/policy_response/policy_response_artifact_item.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/policy_response/policy_response_friendly_names.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/policy_response/policy_response_friendly_names.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/policy_response/policy_response_friendly_names.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/policy_response/policy_response_friendly_names.ts diff --git a/x-pack/plugins/security_solution/public/management/components/policy_response/policy_response_wrapper.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/policy_response/policy_response_wrapper.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/policy_response/policy_response_wrapper.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/policy_response/policy_response_wrapper.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/privileged_route/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/privileged_route/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/privileged_route/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/privileged_route/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/privileged_route/privileged_route.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/privileged_route/privileged_route.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/privileged_route/privileged_route.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/privileged_route/privileged_route.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/privileged_route/privileged_route.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/privileged_route/privileged_route.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/privileged_route/privileged_route.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/privileged_route/privileged_route.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/response_action_file_download_link/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/response_action_file_download_link/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/response_action_file_download_link/response_action_file_download_link.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/running_processes_action_results/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/running_processes_action_results/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/running_processes_action_results/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/running_processes_action_results/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/running_processes_action_results/running_processes_action_results.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/running_processes_action_results/running_processes_action_results.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/running_processes_action_results/running_processes_action_results.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/running_processes_action_results/running_processes_action_results.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/running_processes_action_results/running_processes_action_results.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/running_processes_action_results/running_processes_action_results.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/running_processes_action_results/running_processes_action_results.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/running_processes_action_results/running_processes_action_results.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/search_exceptions/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/components/search_exceptions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/search_exceptions/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/components/search_exceptions/index.ts diff --git a/x-pack/plugins/security_solution/public/management/components/search_exceptions/search_exceptions.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/search_exceptions/search_exceptions.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/search_exceptions/search_exceptions.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/search_exceptions/search_exceptions.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/components/search_exceptions/search_exceptions.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/components/search_exceptions/search_exceptions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/components/search_exceptions/search_exceptions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/components/search_exceptions/search_exceptions.tsx diff --git a/x-pack/plugins/security_solution/public/management/cypress/.eslintrc.json b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/.eslintrc.json similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/.eslintrc.json rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/.eslintrc.json diff --git a/x-pack/solutions/security/plugins/security_solution/public/management/cypress/README.md b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/README.md new file mode 100644 index 0000000000000..f6bac6d11618a --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/README.md @@ -0,0 +1,202 @@ +# Cypress Tests + +The `solutions/security/plugins/security_solution/public/management/cypress` directory contains functional UI tests that execute +using [Cypress](https://www.cypress.io/). + +## Pre-requisites + +Good to have before you run the tests: + +- Docker CLI, as Docker desktop doesn't install it by default. Install using `brew`: + +```shell +brew install docker +``` + +- [Multipass](https://multipass.run/) for running the tests against real endpoint. Install using `brew`: + +```shell +brew install multipass +``` + +If you also want to run the tests against real endpoints as on the CI pipeline, then you need to have the following: + +- [Vagrant](https://developer.hashicorp.com/vagrant/docs/installation) +- [Vagrant provider for VMware](https://developer.hashicorp.com/vagrant/docs/providers/vmware/installation) +- [Vagrant VMware Utility](https://developer.hashicorp.com/vagrant/docs/providers/vmware/vagrant-vmware-utility) +- [VMware Fusion](https://www.vmware.com/products/fusion/fusion-evaluation.html) + +See [running interactive tests on real endpoint with vagrant](#cypress-interactive-with-real-endpoints-using-vagrant) +for more information. + +## Adding new tests - tagging for ESS vs Serverless + +Similarly to Security Solution cypress tests, we use tags in order to select which tests we want to execute on which environment: + +- `@serverless` includes a test in the Serverless test suite. You need to explicitly add this tag to any test you want to run against a Serverless environment. +- `@serverlessQA` includes a test in the Serverless test suite for the Kibana release process of serverless. You need to explicitly add this tag to any test you want you run in CI for the Kibana QA quality gate. These tests should be stable, otherwise they will be blocking the release pipeline. They should be also critical enough, so that when they fail, there's a high chance of an SDH or blocker issue to be reported. +- `@ess` includes a test in the normal, non-Serverless test suite. You need to explicitly add this tag to any test you want to run against a non-Serverless environment. +- `@brokenInServerless` excludes a test from the Serverless test suite (even if it's tagged as `@serverless`). Indicates that a test should run in Serverless, but currently is broken. +- `@skipInServerless` excludes a test from the Serverless test suite (even if it's tagged as `@serverless`). Indicates that we don't want to run the given test in Serverless. +- `@skipInServerlessMKI` excludes a test from any MKI environment, but it will continue being executed as part of the PR process if the `@serverless` tag is present. + +Important: if you don't provide any tag, your test won't be executed. + +## Running the tests + +There are currently three ways to run the tests, comprised of two execution modes and two target environments, which +will be detailed below. + +### Environment Variables + +The test suites are set up with defaults for Kibana and Elasticsearch. The following environment variables can be set to +changes those defaults and target a run against different instances of the stack: + +``` +CYPRESS_KIBANA_URL +CYPRESS_KIBANA_USERNAME +CYPRESS_KIBANA_PASSWORD +CYPRESS_ELASTICSEARCH_URL +CYPRESS_ELASTICSEARCH_USERNAME +CYPRESS_ELASTICSEARCH_PASSWORD +CYPRESS_BASE_URL +``` + +Some notes: + +- The `ELASTICSEARCH_USERNAME` and `ELASTICSEARCH_PASSWORD` should have sufficient privileges to CRUD on restricted indices. +- Both URL variables should **NOT** include credentials in the url +- `KIBANA_URL` and `BASE_URL` will almost always be the same + +Example: + +```shell +yarn --cwd x-pack/solutions/security/plugins/security_solution +CYPRESS_BASE_URL=http://localhost:5601 \ +CYPRESS_KIBANA_URL=http://localhost:5601 \ +CYPRESS_KIBANA_USERNAME=elastic \ +CYPRESS_KIBANA_PASSWORD=changeme \ +CYPRESS_ELASTICSEARCH_USERNAME=system_indices_superuser \ +CYPRESS_ELASTICSEARCH_PASSWORD=changeme \ +CYPRESS_ELASTICSEARCH_URL=http://localhost:9200 cypress:dw:open +``` + +### Execution modes + +#### Interactive mode + +When you run Cypress in interactive mode, an interactive runner is displayed that allows you to see commands as they +execute while also viewing the application under test. For more information, please +see [cypress documentation](https://docs.cypress.io/guides/core-concepts/test-runner.html#Overview). + +#### Headless mode + +A headless browser is a browser simulation program that does not have a user interface. These programs operate like any +other browser but do not display any UI. So when you are executing the tests on this mode you are not +going to see the application under test. Just the output of the test is displayed on the terminal once the execution is +finished. + +### Target environments + +#### FTR (CI) + +This is the configuration used by CI. It uses the FTR to spawn both a Kibana instance (http://localhost:5620) and an +Elasticsearch instance (http://localhost:9220) with a preloaded minimum set of data (see preceding "Test data" section), +and then executes cypress against this stack. You can find this configuration in `x-pack/test/defend_workflows_cypress` + +### Test Execution: Examples + +#### Cypress + Headless (Chrome) + +Since this is how tests are run on CI, this will likely be the configuration you want to use in order to reproduce +failures locally, etc. + +```shell +# bootstrap kibana from the project root and build the plugins/assets that cypress will execute against +yarn kbn bootstrap && node scripts/build_kibana_platform_plugins + +# launch the cypress test runner against ESS +yarn --cwd x-pack/solutions/security/plugins/security_solution cypress:dw:run + +# or against Serverless +yarn --cwd x-pack/solutions/security/plugins/security_solution cypress:dw:serverless:run +``` + +#### Cypress + +This is the preferred mode for developing new tests against mocked data + +```shell +# bootstrap kibana from the project root and build the plugins/assets that cypress will execute against +yarn kbn bootstrap && node scripts/build_kibana_platform_plugins + +# launch the cypress test runner against ESS +yarn --cwd x-pack/solutions/security/plugins/security_solution cypress:dw:open + +# or against Serverless +yarn --cwd x-pack/solutions/security/plugins/security_solution cypress:dw:serverless:open +``` + +## Folder Structure + +### e2e/ + +Contains all the tests. Within it are two sub-folders: + +### integration/ + +Cypress convention. Contains the specs that are going to be executed. + +### fixtures/ + +Cypress convention. Fixtures are used as external pieces of static data when we stub responses. + +### support/ + +Cypress convention. As a convenience, by default Cypress will automatically include the plugins file +cypress/plugins/index.js before every single spec file it runs. +Directory also holds Cypress Plugins that are then initialized via `setupNodeEvents()` in the Cypress configuration. + +### screens/ + +Contains the elements we want to interact with within our tests. +Each file inside the screens folder represents a screen in our application. + +### tasks/ + +_Tasks_ are functions that may be reused across tests. + +Each file inside the tasks folder represents a screen of our application. + +## Test data + +The data the tests need: + +- Is generated on the fly using our application APIs (preferred way) + +## Development Best Practices + +### Clean up the state + +Remember to clean up the state of the test after its execution. Be mindful of failure scenarios, as well: if your test +fails, will it leave the environment in a recoverable state? + +### Minimize the use of es_archive + +When possible, create all the data that you need for executing the tests using the application APIS or the UI. + +### Speed up test execution time + +Loading the web page takes a big amount of time, in order to minimize that impact, the following points should be +taken into consideration until another solution is implemented: + +- Group the tests that are similar in different contexts. +- For every context login only once, and clean the state between tests if needed without reloading the page. +- All tests in a spec file must be order-independent. + +Remember that by minimizing the number of times the web page is loaded, we minimize the execution time as well. + +## Linting + +Optional linting rules for Cypress and linting setup can be +found [here](https://github.com/cypress-io/eslint-plugin-cypress#usage) diff --git a/x-pack/plugins/security_solution/public/management/cypress/common/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/common/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/common/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/common/constants.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/cypress.config.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/cypress.config.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/cypress.config.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/cypress.config.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/cypress.d.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/cypress.d.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/cypress.d.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/cypress.d.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/cypress_base.config.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/cypress_base.config.ts similarity index 98% rename from x-pack/plugins/security_solution/public/management/cypress/cypress_base.config.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/cypress_base.config.ts index c8aa2b347b82b..0b64db4c29801 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/cypress_base.config.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/cypress_base.config.ts @@ -24,7 +24,7 @@ export const getCypressBaseConfig = ( ): Cypress.ConfigOptions => { return merge( { - reporter: '../../../../node_modules/cypress-multi-reporters', + reporter: '../../../../../../node_modules/cypress-multi-reporters', reporterOptions: { configFile: './public/management/reporter_config.json', }, diff --git a/x-pack/plugins/security_solution/public/management/cypress/cypress_serverless.config.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/cypress_serverless.config.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/cypress_serverless.config.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/cypress_serverless.config.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/cypress_serverless_qa.config.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/cypress_serverless_qa.config.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/cypress_serverless_qa.config.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/cypress_serverless_qa.config.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/artifact_tabs_in_policy_details.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/artifacts/artifact_tabs_in_policy_details.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/artifact_tabs_in_policy_details.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/artifacts/artifact_tabs_in_policy_details.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/artifacts.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/artifacts/artifacts.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/artifacts.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/artifacts/artifacts.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/artifacts_mocked_data.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/artifacts/artifacts_mocked_data.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/artifacts_mocked_data.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/artifacts/artifacts_mocked_data.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/blocklist.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/artifacts/blocklist.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/blocklist.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/artifacts/blocklist.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/event_filters.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/artifacts/event_filters.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/event_filters.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/artifacts/event_filters.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/trusted_apps.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/artifacts/trusted_apps.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/trusted_apps.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/artifacts/trusted_apps.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/automated_response_actions.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/automated_response_actions.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/automated_response_actions.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/automated_response_actions.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/form.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/form.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/form.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/form.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/history_log.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/history_log.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/history_log.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/history_log.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/no_license.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/no_license.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/no_license.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/no_license.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/results.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/results.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/results.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/results.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_alerts.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/endpoint_alerts.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_alerts.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/endpoint_alerts.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints_mocked_data.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints_mocked_data.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints_mocked_data.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints_mocked_data.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints_rbac_mocked_data.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints_rbac_mocked_data.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints_rbac_mocked_data.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints_rbac_mocked_data.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/policy_response.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/endpoint_list/policy_response.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/policy_response.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/endpoint_list/policy_response.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/policy/policy_details.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/policy/policy_details.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/policy/policy_details.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/policy/policy_details.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/policy/policy_details_mocked_data.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/policy/policy_details_mocked_data.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/policy/policy_details_mocked_data.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/policy/policy_details_mocked_data.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/policy/policy_experimental_features_disabled.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/policy/policy_experimental_features_disabled.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/policy/policy_experimental_features_disabled.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/policy/policy_experimental_features_disabled.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/policy/policy_list.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/policy/policy_list.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/policy/policy_list.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/policy/policy_list.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/rbac/endpoint_role_rbac.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/rbac/endpoint_role_rbac.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/rbac/endpoint_role_rbac.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/rbac/endpoint_role_rbac.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/rbac/endpoint_role_rbac_with_space_awareness.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/rbac/endpoint_role_rbac_with_space_awareness.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/rbac/endpoint_role_rbac_with_space_awareness.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/rbac/endpoint_role_rbac_with_space_awareness.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/document_signing.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/document_signing.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/document_signing.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/document_signing.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/endpoints_list_response_console.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/endpoints_list_response_console.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/endpoints_list_response_console.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/endpoints_list_response_console.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/isolate.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/isolate.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/isolate.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/isolate.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/isolate_mocked_data.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/isolate_mocked_data.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/isolate_mocked_data.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/isolate_mocked_data.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/responder.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/responder.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/responder.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/responder.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_actions_history.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_actions_history.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_actions_history.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_actions_history.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/file_operations.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/file_operations.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/file_operations.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/file_operations.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/isolate.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/isolate.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/isolate.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/isolate.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/process_operations.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/process_operations.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/process_operations.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/process_operations.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/release.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/release.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/release.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/release.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/scan.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/scan.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/scan.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/scan.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/execute.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/execute.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/execute.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/execute.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/get_file.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/get_file.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/get_file.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/get_file.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/isolate.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/isolate.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/isolate.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/isolate.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/kill_process.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/kill_process.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/kill_process.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/kill_process.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/processes.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/processes.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/processes.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/processes.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/release.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/release.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/release.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/release.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/suspend_process.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/suspend_process.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/suspend_process.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/suspend_process.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/sentinelone/isolate.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/sentinelone/isolate.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/sentinelone/isolate.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/sentinelone/isolate.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/README.md b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/README.md similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/README.md rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/README.md diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/endpoint_list_with_security_essentials.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/endpoint_list_with_security_essentials.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/endpoint_list_with_security_essentials.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/endpoint_list_with_security_essentials.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/api/agent_policy_settings_complete.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/api/agent_policy_settings_complete.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/api/agent_policy_settings_complete.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/api/agent_policy_settings_complete.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/api/agent_policy_settings_essentials.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/api/agent_policy_settings_essentials.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/api/agent_policy_settings_essentials.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/api/agent_policy_settings_essentials.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/complete.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/complete.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/complete.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/complete.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/complete_with_endpoint.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/complete_with_endpoint.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/complete_with_endpoint.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/complete_with_endpoint.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/components/agent_policy_settings_complete.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/components/agent_policy_settings_complete.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/components/agent_policy_settings_complete.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/components/agent_policy_settings_complete.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/components/agent_policy_settings_essentials.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/components/agent_policy_settings_essentials.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/components/agent_policy_settings_essentials.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/components/agent_policy_settings_essentials.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/components/policy_details_endpoint_complete.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/components/policy_details_endpoint_complete.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/components/policy_details_endpoint_complete.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/components/policy_details_endpoint_complete.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/components/policy_details_endpoint_essentials.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/components/policy_details_endpoint_essentials.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/components/policy_details_endpoint_essentials.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/components/policy_details_endpoint_essentials.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/essentials.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/essentials.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/essentials.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/essentials.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/essentials_with_endpoint.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/essentials_with_endpoint.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/essentials_with_endpoint.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/feature_access/essentials_with_endpoint.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/metering.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/metering.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/metering.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/metering.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/policy_details_with_security_essentials.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/complete_with_endpoint_roles.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/roles/complete_with_endpoint_roles.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/complete_with_endpoint_roles.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/roles/complete_with_endpoint_roles.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/essentials_with_endpoint.roles.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/roles/essentials_with_endpoint.roles.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/essentials_with_endpoint.roles.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/serverless/roles/essentials_with_endpoint.roles.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/unenroll_agent_from_fleet.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/unenroll_agent_from_fleet.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/unenroll_agent_from_fleet.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/unenroll_agent_from_fleet.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/uninstall_agent_from_host.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/uninstall_agent_from_host.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/uninstall_agent_from_host.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/uninstall_agent_from_host.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/unenroll_agent_from_fleet.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/unenroll_agent_from_fleet.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/unenroll_agent_from_fleet.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/unenroll_agent_from_fleet.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/uninstall_agent_from_host.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/uninstall_agent_from_host.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/uninstall_agent_from_host.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/uninstall_agent_from_host.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_disabled_to_enabled.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_disabled_to_enabled.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_disabled_to_enabled.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_disabled_to_enabled.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_disabled.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_disabled.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_disabled.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_disabled.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_enabled.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_enabled.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_enabled.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_enabled.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_disabled_to_enabled.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_disabled_to_enabled.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_disabled_to_enabled.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_disabled_to_enabled.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_disabled.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_disabled.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_disabled.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_disabled.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_enabled.cy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_enabled.cy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_enabled.cy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_enabled.cy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/fixtures/artifacts_page.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/fixtures/artifacts_page.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/fixtures/artifacts_page.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/fixtures/artifacts_page.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/fixtures/example.json b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/fixtures/example.json similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/fixtures/example.json rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/fixtures/example.json diff --git a/x-pack/plugins/security_solution/public/management/cypress/fixtures/role_with_artifact_read_privilege.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/fixtures/role_with_artifact_read_privilege.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/fixtures/role_with_artifact_read_privilege.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/fixtures/role_with_artifact_read_privilege.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/screens/alerts.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/screens/alerts.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/alerts.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/screens/artifacts.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/artifacts.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/screens/artifacts.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/artifacts.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/screens/common.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/common.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/screens/common.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/common.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/screens/endpoint_list.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/endpoint_list.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/screens/endpoint_list.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/endpoint_list.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/screens/fleet/agent_details.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/fleet/agent_details.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/screens/fleet/agent_details.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/fleet/agent_details.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/screens/fleet/agent_list.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/fleet/agent_list.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/screens/fleet/agent_list.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/fleet/agent_list.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/screens/fleet/agent_settings.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/fleet/agent_settings.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/screens/fleet/agent_settings.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/fleet/agent_settings.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/screens/fleet/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/fleet/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/screens/fleet/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/fleet/index.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/screens/fleet/permission_denied.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/fleet/permission_denied.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/screens/fleet/permission_denied.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/fleet/permission_denied.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/screens/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/screens/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/index.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/screens/navigation.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/navigation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/screens/navigation.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/navigation.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/screens/page_reference.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/page_reference.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/screens/page_reference.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/page_reference.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/screens/policy_details.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/policy_details.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/screens/policy_details.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/policy_details.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/screens/policy_list.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/policy_list.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/screens/policy_list.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/policy_list.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/screens/responder.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/responder.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/screens/responder.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/responder.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/screens/stack_management/role_page.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/stack_management/role_page.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/screens/stack_management/role_page.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/stack_management/role_page.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/screens/types.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/screens/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/screens/types.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/support/agent_actions.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/agent_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/support/agent_actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/agent_actions.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/support/common.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/common.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/support/common.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/common.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/support/create_and_enroll_endpoint_host_ci.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/create_and_enroll_endpoint_host_ci.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/support/create_and_enroll_endpoint_host_ci.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/create_and_enroll_endpoint_host_ci.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/support/data_loaders.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/data_loaders.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/support/data_loaders.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/data_loaders.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/support/e2e.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/e2e.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/support/e2e.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/e2e.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/support/filter_videos.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/filter_videos.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/support/filter_videos.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/filter_videos.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/support/plugin_handlers/endpoint_data_loader.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/plugin_handlers/endpoint_data_loader.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/support/plugin_handlers/endpoint_data_loader.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/plugin_handlers/endpoint_data_loader.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/support/response_actions.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/response_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/support/response_actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/response_actions.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/support/saml_authentication.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/saml_authentication.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/support/saml_authentication.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/saml_authentication.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/support/setup_tooling_log_level.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/setup_tooling_log_level.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/support/setup_tooling_log_level.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/setup_tooling_log_level.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/support/transparent_api_proxy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/transparent_api_proxy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/support/transparent_api_proxy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/support/transparent_api_proxy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/add_alerts_to_case.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/add_alerts_to_case.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/add_alerts_to_case.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/add_alerts_to_case.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/alerts.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/alerts.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/alerts.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/api_fixtures.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/api_fixtures.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/api_fixtures.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/api_fixtures.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/artifacts.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/artifacts.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/artifacts.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/artifacts.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/common.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/common.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/common.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/common.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/create_endpoint_host.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/create_endpoint_host.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/create_endpoint_host.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/create_endpoint_host.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/delete_all_endpoint_data.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/delete_all_endpoint_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/delete_all_endpoint_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/delete_all_endpoint_data.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/endpoint_policy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/endpoint_policy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/endpoint_policy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/endpoint_policy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/fleet.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/fleet.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/fleet.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/fleet.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/index_endpoint_heartbeats.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/index_endpoint_heartbeats.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/index_endpoint_heartbeats.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/index_endpoint_heartbeats.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/index_endpoint_hosts.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/index_endpoint_hosts.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/index_endpoint_hosts.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/index_endpoint_hosts.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/index_endpoint_rule_alerts.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/index_endpoint_rule_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/index_endpoint_rule_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/index_endpoint_rule_alerts.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/index_new_case.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/index_new_case.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/index_new_case.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/index_new_case.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/isolate.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/isolate.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/isolate.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/isolate.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/logger.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/logger.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/logger.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/logger.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/login.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/login.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/login.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/login.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/navigation.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/navigation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/navigation.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/navigation.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/perform_user_actions.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/perform_user_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/perform_user_actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/perform_user_actions.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/response_actions.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/response_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/response_actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/response_actions.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/response_console.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/response_console.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/response_console.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/response_console.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/run_endpoint_loader.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/run_endpoint_loader.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/run_endpoint_loader.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/run_endpoint_loader.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/spaces.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/spaces.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/spaces.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/spaces.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/toasts.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/toasts.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/toasts.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/toasts.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/transparent_api_proxy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/transparent_api_proxy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/transparent_api_proxy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/transparent_api_proxy.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/tasks/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/tasks/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/tasks/utils.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tsconfig.json b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tsconfig.json new file mode 100644 index 0000000000000..690631e032d0a --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/tsconfig.json @@ -0,0 +1,39 @@ +{ + "extends": "../../../../../../../../tsconfig.base.json", + "include": [ + "**/*", + ], + "exclude": [ + "target/**/*" + ], + "compilerOptions": { + "outDir": "target/types", + "types": [ + "cypress", + "node", + ], + }, + "kbn_references": [ + // this cypress project uses code from the parent ts project + // in a way that can't be auto-matically deteceted at this time + // so we have to force the inclusion of this reference + { + "path": "../../../tsconfig.json", + "force": true + }, + "@kbn/security-plugin", + "@kbn/securitysolution-list-constants", + "@kbn/fleet-plugin", + "@kbn/securitysolution-io-ts-list-types", + "@kbn/cypress-config", + "@kbn/test-subj-selector", + "@kbn/cases-plugin", + "@kbn/test", + "@kbn/repo-info", + "@kbn/tooling-log", + "@kbn/security-solution-serverless", + "@kbn/dev-utils", + "@kbn/spaces-plugin", + "@kbn/test-suites-xpack/security_solution_cypress/cypress", + ] +} diff --git a/x-pack/plugins/security_solution/public/management/cypress/types.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/types.ts diff --git a/x-pack/plugins/security_solution/public/management/cypress/typings.d.ts b/x-pack/solutions/security/plugins/security_solution/public/management/cypress/typings.d.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/cypress/typings.d.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/cypress/typings.d.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/agents/__mocks__/use_get_agent_status.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/agents/__mocks__/use_get_agent_status.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/agents/__mocks__/use_get_agent_status.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/agents/__mocks__/use_get_agent_status.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/agents/use_get_agent_status.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/agents/use_get_agent_status.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/agents/use_get_agent_status.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/agents/use_get_agent_status.test.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/agents/use_get_agent_status.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/agents/use_get_agent_status.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/agents/use_get_agent_status.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/agents/use_get_agent_status.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/index.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_bulk_delete_artifact.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_bulk_update_artifact.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_create_artifact.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_delete_artifact.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_get_artifact.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_updated_tags.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_get_updated_tags.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_updated_tags.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_get_updated_tags.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_updated_tags.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_get_updated_tags.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/use_get_updated_tags.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_get_updated_tags.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_host_isolation_exceptions_access.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_host_isolation_exceptions_access.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/use_host_isolation_exceptions_access.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_host_isolation_exceptions_access.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_host_isolation_exceptions_access.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_host_isolation_exceptions_access.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/use_host_isolation_exceptions_access.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_host_isolation_exceptions_access.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_list_artifact.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_summary_artifact.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_summary_artifact.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/use_summary_artifact.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_summary_artifact.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_summary_artifact.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_summary_artifact.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/use_summary_artifact.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_summary_artifact.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/artifacts/use_update_artifact.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.test.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_details.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_policy_response.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_policy_response.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_policy_response.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_policy_response.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_policy_response.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_policy_response.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_policy_response.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoint_policy_response.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoints_list.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoints_list.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoints_list.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoints_list.test.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoints_list.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoints_list.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoints_list.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/endpoint/use_get_endpoints_list.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/index.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/policy/use_fetch_endpoint_policy.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/policy/use_fetch_endpoint_policy.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/policy/use_fetch_endpoint_policy.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/policy/use_fetch_endpoint_policy.test.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/policy/use_fetch_endpoint_policy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/policy/use_fetch_endpoint_policy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/policy/use_fetch_endpoint_policy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/policy/use_fetch_endpoint_policy.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/policy/use_fetch_endpoint_policy_agent_summary.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/policy/use_fetch_endpoint_policy_agent_summary.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/policy/use_fetch_endpoint_policy_agent_summary.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/policy/use_fetch_endpoint_policy_agent_summary.test.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/policy/use_fetch_endpoint_policy_agent_summary.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/policy/use_fetch_endpoint_policy_agent_summary.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/policy/use_fetch_endpoint_policy_agent_summary.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/policy/use_fetch_endpoint_policy_agent_summary.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/policy/use_update_endpoint_policy.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/policy/use_update_endpoint_policy.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/policy/use_update_endpoint_policy.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/policy/use_update_endpoint_policy.test.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/policy/use_update_endpoint_policy.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/policy/use_update_endpoint_policy.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/policy/use_update_endpoint_policy.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/policy/use_update_endpoint_policy.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_action_details.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_get_action_details.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_action_details.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_get_action_details.test.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_action_details.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_get_action_details.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_action_details.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_get_action_details.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_automated_action_list.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_get_automated_action_list.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_automated_action_list.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_get_automated_action_list.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_action_list.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_action_list.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_action_list.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_action_list.test.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_action_list.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_action_list.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_action_list.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_action_list.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_pending_actions_summary.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_pending_actions_summary.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_pending_actions_summary.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_pending_actions_summary.test.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_pending_actions_summary.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_pending_actions_summary.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_pending_actions_summary.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_get_endpoint_pending_actions_summary.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_file_info.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_get_file_info.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_file_info.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_get_file_info.test.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_file_info.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_get_file_info.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/response_actions/use_get_file_info.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_get_file_info.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_execute_endpoint_request.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_execute_endpoint_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_execute_endpoint_request.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_execute_endpoint_request.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_get_endpoint_processes_request.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_get_endpoint_processes_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_get_endpoint_processes_request.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_get_endpoint_processes_request.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_get_file_request.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_get_file_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_get_file_request.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_get_file_request.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_isolate_endpoint_request.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_isolate_endpoint_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_isolate_endpoint_request.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_isolate_endpoint_request.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_kill_process_endpoint_request.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_kill_process_endpoint_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_kill_process_endpoint_request.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_kill_process_endpoint_request.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_release_endpoint_request.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_release_endpoint_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_release_endpoint_request.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_release_endpoint_request.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_run_script_endpoint_request.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_run_script_endpoint_request.test.ts new file mode 100644 index 0000000000000..39eb3728162dc --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_run_script_endpoint_request.test.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 { useMutation as _useMutation } from '@tanstack/react-query'; +import type { AppContextTestRender } from '../../../common/mock/endpoint'; +import type { RenderHookResult } from '@testing-library/react'; +import { createAppRootMockRenderer } from '../../../common/mock/endpoint'; +import { responseActionsHttpMocks } from '../../mocks/response_actions_http_mocks'; +import { RUN_SCRIPT_ROUTE } from '../../../../common/endpoint/constants'; +import type { RunScriptActionRequestBody } from '../../../../common/api/endpoint'; +import type { + RunScriptRequestCustomOptions, + UseSendRunScriptRequestResult, +} from './use_send_run_script_endpoint_request'; +import { useSendRunScriptEndpoint } from './use_send_run_script_endpoint_request'; + +const useMutationMock = _useMutation as jest.Mock; + +jest.mock('@tanstack/react-query', () => { + const actualReactQueryModule = jest.requireActual('@tanstack/react-query'); + + return { + ...actualReactQueryModule, + useMutation: jest.fn((...args) => actualReactQueryModule.useMutation(...args)), + }; +}); + +const runScriptPayload: RunScriptActionRequestBody = { + endpoint_ids: ['test-endpoint-id'], + agent_type: 'crowdstrike', + parameters: { raw: 'ls' }, +}; + +describe('When using the `useSendRunScriptRequest()` hook', () => { + let customOptions: RunScriptRequestCustomOptions; + let http: AppContextTestRender['coreStart']['http']; + let apiMocks: ReturnType<typeof responseActionsHttpMocks>; + let renderHook: () => RenderHookResult< + UseSendRunScriptRequestResult, + RunScriptRequestCustomOptions + >; + + beforeEach(() => { + const testContext = createAppRootMockRenderer(); + + http = testContext.coreStart.http; + apiMocks = responseActionsHttpMocks(http); + customOptions = {}; + + renderHook = () => { + return testContext.renderHook(() => useSendRunScriptEndpoint(customOptions)); + }; + }); + + it('should call the `runScript` API with correct payload', async () => { + const { + result: { + current: { mutateAsync }, + }, + } = renderHook(); + await mutateAsync(runScriptPayload); + + expect(apiMocks.responseProvider.runscript).toHaveBeenCalledWith({ + body: JSON.stringify(runScriptPayload), + path: RUN_SCRIPT_ROUTE, + version: '2023-10-31', + }); + }); + + it('should allow custom options to be passed to ReactQuery', async () => { + customOptions.mutationKey = ['pqr-abc']; + customOptions.cacheTime = 10; + renderHook(); + + expect(useMutationMock).toHaveBeenCalledWith(expect.any(Function), customOptions); + }); +}); diff --git a/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_run_script_endpoint_request.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_run_script_endpoint_request.ts new file mode 100644 index 0000000000000..f4dd937fe3008 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_run_script_endpoint_request.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 type { UseMutationOptions, UseMutationResult } from '@tanstack/react-query'; +import type { IHttpFetchError } from '@kbn/core-http-browser'; +import { useMutation } from '@tanstack/react-query'; +import type { RunScriptActionRequestBody } from '../../../../common/api/endpoint'; +import { KibanaServices } from '../../../common/lib/kibana'; +import { RUN_SCRIPT_ROUTE } from '../../../../common/endpoint/constants'; +import type { ResponseActionApiResponse } from '../../../../common/endpoint/types'; + +export type RunScriptRequestCustomOptions = UseMutationOptions< + ResponseActionApiResponse, + IHttpFetchError, + RunScriptActionRequestBody +>; + +export type UseSendRunScriptRequestResult = UseMutationResult< + ResponseActionApiResponse, + IHttpFetchError, + RunScriptActionRequestBody +>; + +export const useSendRunScriptEndpoint = ( + options?: RunScriptRequestCustomOptions +): UseSendRunScriptRequestResult => { + return useMutation<ResponseActionApiResponse, IHttpFetchError, RunScriptActionRequestBody>( + (runScriptActionReqBody) => { + return KibanaServices.get().http.post<ResponseActionApiResponse>(RUN_SCRIPT_ROUTE, { + body: JSON.stringify(runScriptActionReqBody), + version: '2023-10-31', + }); + }, + options + ); +}; diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_scan_request.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_scan_request.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_scan_request.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_scan_request.test.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_scan_request.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_scan_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_scan_request.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_scan_request.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_suspend_process_endpoint_request.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_suspend_process_endpoint_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_suspend_process_endpoint_request.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_suspend_process_endpoint_request.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_upload_endpoint_request.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_upload_endpoint_request.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/response_actions/use_send_upload_endpoint_request.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/response_actions/use_send_upload_endpoint_request.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/test_utils.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/test_utils.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/test_utils.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/test_utils.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/translations.tsx diff --git a/x-pack/plugins/security_solution/public/management/hooks/use_get_action_state.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/use_get_action_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/use_get_action_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/use_get_action_state.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/use_old_url_search_pagination_replace.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/use_old_url_search_pagination_replace.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/use_old_url_search_pagination_replace.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/use_old_url_search_pagination_replace.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/use_suggestions.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/use_suggestions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/use_suggestions.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/use_suggestions.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/use_test_id_generator.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/use_test_id_generator.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/use_test_id_generator.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/use_test_id_generator.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/use_url_pagination.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/use_url_pagination.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/use_url_pagination.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/use_url_pagination.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/use_url_params.ts b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/use_url_params.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/use_url_params.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/use_url_params.ts diff --git a/x-pack/plugins/security_solution/public/management/hooks/use_with_show_responder.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/hooks/use_with_show_responder.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/hooks/use_with_show_responder.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/hooks/use_with_show_responder.tsx diff --git a/x-pack/plugins/security_solution/public/management/images/security_administration_onboarding.svg b/x-pack/solutions/security/plugins/security_solution/public/management/images/security_administration_onboarding.svg similarity index 100% rename from x-pack/plugins/security_solution/public/management/images/security_administration_onboarding.svg rename to x-pack/solutions/security/plugins/security_solution/public/management/images/security_administration_onboarding.svg diff --git a/x-pack/plugins/security_solution/public/management/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/management/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/management/jest.config.js new file mode 100644 index 0000000000000..59646de5f8996 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/management/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/management'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/management', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/management/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/management/links.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/links.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/links.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/links.test.ts diff --git a/x-pack/plugins/security_solution/public/management/links.ts b/x-pack/solutions/security/plugins/security_solution/public/management/links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/links.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/links.ts diff --git a/x-pack/plugins/security_solution/public/management/mocks/agent_status_http_mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/management/mocks/agent_status_http_mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/mocks/agent_status_http_mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/mocks/agent_status_http_mocks.ts diff --git a/x-pack/plugins/security_solution/public/management/mocks/exceptions_list_http_mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/management/mocks/exceptions_list_http_mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/mocks/exceptions_list_http_mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/mocks/exceptions_list_http_mocks.ts diff --git a/x-pack/plugins/security_solution/public/management/mocks/fleet_mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/management/mocks/fleet_mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/mocks/fleet_mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/mocks/fleet_mocks.ts diff --git a/x-pack/plugins/security_solution/public/management/mocks/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/mocks/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/mocks/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/mocks/index.ts diff --git a/x-pack/plugins/security_solution/public/management/mocks/response_actions_http_mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/management/mocks/response_actions_http_mocks.ts similarity index 92% rename from x-pack/plugins/security_solution/public/management/mocks/response_actions_http_mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/mocks/response_actions_http_mocks.ts index 256484f8d0e92..e8307895c3c4c 100644 --- a/x-pack/plugins/security_solution/public/management/mocks/response_actions_http_mocks.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/management/mocks/response_actions_http_mocks.ts @@ -17,6 +17,7 @@ import { GET_PROCESSES_ROUTE, ISOLATE_HOST_ROUTE_V2, KILL_PROCESS_ROUTE, + RUN_SCRIPT_ROUTE, SCAN_ROUTE, SUSPEND_PROCESS_ROUTE, UNISOLATE_HOST_ROUTE_V2, @@ -42,6 +43,8 @@ import type { ResponseActionScanParameters, ResponseActionUploadOutputContent, ResponseActionUploadParameters, + ResponseActionRunScriptOutputContent, + ResponseActionRunScriptParameters, } from '../../../common/endpoint/types'; export type ResponseActionsHttpMocksInterface = ResponseProvidersInterface<{ @@ -73,6 +76,8 @@ export type ResponseActionsHttpMocksInterface = ResponseProvidersInterface<{ >; scan: () => ActionDetailsApiResponse<ResponseActionScanOutputContent>; + + runscript: () => ActionDetailsApiResponse<ResponseActionRunScriptOutputContent>; }>; export const responseActionsHttpMocks = httpHandlerMockFactory<ResponseActionsHttpMocksInterface>([ @@ -273,6 +278,25 @@ export const responseActionsHttpMocks = httpHandlerMockFactory<ResponseActionsHt command: 'scan', }); + return { data: response }; + }, + }, + { + id: 'runscript', + path: RUN_SCRIPT_ROUTE, + method: 'post', + handler: (): ActionDetailsApiResponse< + ResponseActionRunScriptOutputContent, + ResponseActionRunScriptParameters + > => { + const generator = new EndpointActionGenerator('seed'); + const response = generator.generateActionDetails< + ResponseActionRunScriptOutputContent, + ResponseActionRunScriptParameters + >({ + command: 'runscript', + }); + return { data: response }; }, }, diff --git a/x-pack/plugins/security_solution/public/management/mocks/trusted_apps_http_mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/management/mocks/trusted_apps_http_mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/mocks/trusted_apps_http_mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/mocks/trusted_apps_http_mocks.ts diff --git a/x-pack/plugins/security_solution/public/management/mocks/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/management/mocks/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/mocks/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/mocks/utils.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/blocklist/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/blocklist/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/constants.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/blocklist/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/blocklist/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/index.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/blocklist/services/blocklists_api_client.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/services/blocklists_api_client.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/blocklist/services/blocklists_api_client.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/services/blocklists_api_client.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/blocklist/services/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/services/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/blocklist/services/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/services/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/blocklist/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/blocklist/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/translations.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/blocklist/view/blocklist.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/view/blocklist.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/blocklist/view/blocklist.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/view/blocklist.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/blocklist/view/blocklist.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/view/blocklist.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/blocklist/view/blocklist.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/view/blocklist.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/blocklist/view/components/blocklist_form.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/view/components/blocklist_form.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/blocklist/view/components/blocklist_form.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/view/components/blocklist_form.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/blocklist/view/components/blocklist_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/view/components/blocklist_form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/blocklist/view/components/blocklist_form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/view/components/blocklist_form.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/blocklist/view/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/view/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/blocklist/view/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/view/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/index.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/mocks.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/models/index_pattern.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/action.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/builders.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/builders.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/builders.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/builders.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/endpoint_pagination.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/endpoint_pagination.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/endpoint_pagination.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/endpoint_pagination.test.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/index.test.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.test.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/middleware.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/mock_endpoint_result_list.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/mock_endpoint_result_list.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/mock_endpoint_result_list.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/mock_endpoint_result_list.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/reducer.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/selectors.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/store/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/store/utils.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/types.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/utils.test.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/utils.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/back_to_policy_list_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/back_to_policy_list_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/back_to_policy_list_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/back_to_policy_list_button.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/endpoint_list_nav_link.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/endpoint_list_nav_link.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/endpoint_list_nav_link.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/endpoint_list_nav_link.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/integration_tests/search_bar.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/integration_tests/search_bar.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/integration_tests/search_bar.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/integration_tests/search_bar.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/search_bar.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/search_bar.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/search_bar.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/search_bar.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/table_row_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/table_row_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/table_row_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/table_row_actions.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/transform_failed_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/transform_failed_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/transform_failed_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/components/transform_failed_callout.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/actions_menu.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/actions_menu.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/actions_menu.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/actions_menu.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/actions_menu.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/actions_menu.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/actions_menu.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/actions_menu.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/back_to_endpoint_details_flyout_subheader.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/back_to_endpoint_details_flyout_subheader.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/back_to_endpoint_details_flyout_subheader.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/back_to_endpoint_details_flyout_subheader.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/endpoint_details_tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/endpoint_details_tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/endpoint_details_tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/endpoint_details_tabs.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/endpoint_isolate_flyout_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/endpoint_isolate_flyout_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/endpoint_isolate_flyout_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/endpoint_isolate_flyout_panel.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/flyout_header.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/flyout_header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/flyout_header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/flyout_header.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/insights/workflow_insights.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/insights/workflow_insights.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/insights/workflow_insights.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/insights/workflow_insights.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/insights/workflow_insights_results.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/insights/workflow_insights_results.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/insights/workflow_insights_results.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/insights/workflow_insights_results.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/insights/workflow_insights_scan.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/insights/workflow_insights_scan.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/insights/workflow_insights_scan.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/components/insights/workflow_insights_scan.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/endpoint_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/endpoint_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/endpoint_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/endpoint_details.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/endpoint_details_content.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/endpoint_details_content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/endpoint_details_content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/endpoint_details_content.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/details/index.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/hooks.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/hooks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/hooks.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/hooks.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_fetch_insights.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_fetch_insights.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_fetch_insights.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_fetch_insights.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_fetch_ongoing_tasks.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_fetch_ongoing_tasks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_fetch_ongoing_tasks.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_fetch_ongoing_tasks.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_trigger_scan.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_trigger_scan.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_trigger_scan.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/insights/use_trigger_scan.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/use_endpoint_action_items.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/use_endpoint_action_items.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/use_endpoint_action_items.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/hooks/use_endpoint_action_items.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/host_constants.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/host_constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/host_constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/host_constants.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/index.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/translations.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/url_from_query_params.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/url_from_query_params.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/endpoint_hosts/view/url_from_query_params.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/endpoint_hosts/view/url_from_query_params.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/event_filters/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/constants.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/event_filters/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/index.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/service/api_client.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/service/api_client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/event_filters/service/api_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/service/api_client.test.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/service/api_client.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/service/api_client.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/event_filters/service/api_client.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/service/api_client.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/service/service_actions.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/service/service_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/event_filters/service/service_actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/service/service_actions.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/test_utils/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/test_utils/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/event_filters/test_utils/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/test_utils/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/event_filters_flyout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/components/event_filters_flyout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/event_filters_flyout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/components/event_filters_flyout.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/event_filters_flyout.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/components/event_filters_flyout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/event_filters_flyout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/components/event_filters_flyout.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/components/form.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/components/form.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/components/form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/components/form.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/process_descendant_tooltip.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/components/process_descendant_tooltip.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/event_filters/view/components/process_descendant_tooltip.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/components/process_descendant_tooltip.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/event_filters_list.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/event_filters_list.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/event_filters/view/event_filters_list.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/event_filters_list.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/integration_tests/event_filters_list.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/integration_tests/event_filters_list.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/event_filters/view/integration_tests/event_filters_list.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/integration_tests/event_filters_list.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/event_filters/view/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/translations.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/event_filters/view/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/event_filters/view/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/event_filters/view/utils.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/constants.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/host_isolation_exceptions_api_client.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/host_isolation_exceptions_api_client.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/host_isolation_exceptions_api_client.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/host_isolation_exceptions_api_client.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/index.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/form.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/form.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/integration_tests/form.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/integration_tests/form.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/integration_tests/form.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/integration_tests/form.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/components/translations.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/host_isolation_exceptions_list.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/host_isolation_exceptions_list.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/host_isolation_exceptions_list.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/host_isolation_exceptions_list.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/integration_tests/host_isolation_exceptions_list.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/integration_tests/host_isolation_exceptions_list.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/integration_tests/host_isolation_exceptions_list.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/host_isolation_exceptions/view/integration_tests/host_isolation_exceptions_list.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/index.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/integration_tests/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/integration_tests/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/integration_tests/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/integration_tests/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/landing.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/landing.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/landing.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/landing.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/notes/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/notes/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/notes/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/notes/index.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/index.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/models/advanced_policy_schema.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/models/advanced_policy_schema.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/models/advanced_policy_schema.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/models/advanced_policy_schema.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/action/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/action/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/action/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/action/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/action/policy_settings_action.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/action/policy_settings_action.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/action/policy_settings_action.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/action/policy_settings_action.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/policy_settings_middleware.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/policy_settings_middleware.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/policy_settings_middleware.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/middleware/policy_settings_middleware.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/reducer/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/reducer/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/reducer/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/reducer/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/reducer/initial_policy_details_state.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/reducer/initial_policy_details_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/reducer/initial_policy_details_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/reducer/initial_policy_details_state.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/reducer/policy_settings_reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/reducer/policy_settings_reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/reducer/policy_settings_reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/reducer/policy_settings_reducer.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/selectors/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/selectors/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/selectors/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/selectors/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/selectors/policy_common_selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/selectors/policy_common_selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/selectors/policy_common_selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/selectors/policy_common_selectors.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/selectors/policy_settings_selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/selectors/policy_settings_selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/selectors/policy_settings_selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/policy_details/selectors/policy_settings_selectors.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/store/test_mock_utils.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/test_mock_utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/store/test_mock_utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/store/test_mock_utils.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/test_utils/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/test_utils/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/test_utils/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/test_utils/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/test_utils/mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/test_utils/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/test_utils/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/test_utils/mocks.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/types.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/types.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/assignable/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/assignable/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/assignable/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/assignable/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/assignable/policy_artifacts_assignable_list.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/assignable/policy_artifacts_assignable_list.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/assignable/policy_artifacts_assignable_list.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/assignable/policy_artifacts_assignable_list.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/assignable/policy_artifacts_assignable_list.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/assignable/policy_artifacts_assignable_list.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/assignable/policy_artifacts_assignable_list.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/assignable/policy_artifacts_assignable_list.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/policy_artifacts_delete_modal.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/delete_modal/translations.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/empty/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/empty/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/empty/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/empty/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/empty/policy_artifacts_empty_unassigned.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/empty/policy_artifacts_empty_unassigned.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/empty/policy_artifacts_empty_unassigned.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/empty/policy_artifacts_empty_unassigned.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/empty/policy_artifacts_empty_unexisting.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/empty/policy_artifacts_empty_unexisting.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/empty/policy_artifacts_empty_unexisting.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/empty/policy_artifacts_empty_unexisting.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/empty/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/empty/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/empty/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/empty/translations.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/empty/use_policy_artifacts_empty_hooks.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/empty/use_policy_artifacts_empty_hooks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/empty/use_policy_artifacts_empty_hooks.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/empty/use_policy_artifacts_empty_hooks.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/policy_artifacts_flyout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/policy_artifacts_flyout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/policy_artifacts_flyout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/policy_artifacts_flyout.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/policy_artifacts_flyout.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/policy_artifacts_flyout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/policy_artifacts_flyout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/policy_artifacts_flyout.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/flyout/translations.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/layout/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/layout/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/layout/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/layout/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/layout/policy_artifacts_layout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/layout/policy_artifacts_layout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/layout/policy_artifacts_layout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/layout/policy_artifacts_layout.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/layout/policy_artifacts_layout.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/layout/policy_artifacts_layout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/layout/policy_artifacts_layout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/layout/policy_artifacts_layout.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/layout/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/layout/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/layout/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/layout/translations.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/list/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/list/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/list/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/list/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/list/policy_artifacts_list.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/list/policy_artifacts_list.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/list/policy_artifacts_list.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/list/policy_artifacts_list.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/list/policy_artifacts_list.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/list/policy_artifacts_list.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/list/policy_artifacts_list.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/list/policy_artifacts_list.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/list/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/list/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/list/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/list/translations.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/artifacts/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/artifacts/translations.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/components/agents_summary.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/components/agents_summary.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/components/agents_summary.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/components/agents_summary.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/components/policy_endpoint_count.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/components/policy_endpoint_count.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/components/policy_endpoint_count.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/components/policy_endpoint_count.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/components/exception_items_summary.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/components/exception_items_summary.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/components/exception_items_summary.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/components/exception_items_summary.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/components/exception_items_summary.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/components/exception_items_summary.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/components/exception_items_summary.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/components/exception_items_summary.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/components/link_with_icon.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/components/link_with_icon.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/components/link_with_icon.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/components/link_with_icon.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_agent_tamper_protection_extension.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_agent_tamper_protection_extension.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_agent_tamper_protection_extension.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_agent_tamper_protection_extension.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_custom_assets_extension.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_custom_assets_extension.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_custom_assets_extension.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_custom_assets_extension.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_generic_errors_list.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_generic_errors_list.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_generic_errors_list.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_generic_errors_list.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_artifacts_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_artifacts_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_artifacts_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_artifacts_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_artifacts_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_artifacts_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_artifacts_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/fleet_artifacts_card.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/styled_components.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/styled_components.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/styled_components.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/components/styled_components.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/endpoint_package_custom_extension.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/endpoint_package_custom_extension.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/endpoint_package_custom_extension.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/endpoint_package_custom_extension.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/endpoint_package_custom_extension.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/endpoint_package_custom_extension.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/endpoint_package_custom_extension.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/endpoint_package_custom_extension.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/index.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_package_custom_extension/translations.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/components/endpoint_event_collection_preset.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/components/endpoint_event_collection_preset.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/components/endpoint_event_collection_preset.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/components/endpoint_event_collection_preset.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/components/help_text_with_padding.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/components/help_text_with_padding.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/components/help_text_with_padding.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/components/help_text_with_padding.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/constants.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/endpoint_policy_create_extension.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/endpoint_policy_create_extension.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/endpoint_policy_create_extension.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/endpoint_policy_create_extension.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/endpoint_policy_create_extension.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/endpoint_policy_create_extension.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/endpoint_policy_create_extension.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/endpoint_policy_create_extension.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/index.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_extension/translations.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_multi_step_extension.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_multi_step_extension.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_multi_step_extension.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_create_multi_step_extension.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/components/endpoint_policy_artifact_cards.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/components/endpoint_policy_artifact_cards.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/components/endpoint_policy_artifact_cards.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/components/endpoint_policy_artifact_cards.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/components/fleet_integration_artifacts_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/components/fleet_integration_artifacts_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/components/fleet_integration_artifacts_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/components/fleet_integration_artifacts_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/components/fleet_integration_artifacts_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/components/fleet_integration_artifacts_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/components/fleet_integration_artifacts_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/components/fleet_integration_artifacts_card.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/endpoint_policy_edit_extension.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/endpoint_policy_edit_extension.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/endpoint_policy_edit_extension.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/endpoint_policy_edit_extension.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/endpoint_policy_edit_extension.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/endpoint_policy_edit_extension.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/endpoint_policy_edit_extension.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/endpoint_policy_edit_extension.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_edit_extension/translations.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_response_extension.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_response_extension.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_response_extension.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/endpoint_policy_response_extension.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/hooks/use_can_access_some_artifacts.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/hooks/use_can_access_some_artifacts.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/hooks/use_can_access_some_artifacts.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/hooks/use_can_access_some_artifacts.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_agent_tamper_protection_extension.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_agent_tamper_protection_extension.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_agent_tamper_protection_extension.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_agent_tamper_protection_extension.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_custom_assets_extension.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_custom_assets_extension.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_custom_assets_extension.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_custom_assets_extension.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_generic_errors_list.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_generic_errors_list.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_generic_errors_list.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_generic_errors_list.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_package_custom_extension.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_package_custom_extension.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_package_custom_extension.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_package_custom_extension.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_policy_create_extension.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_policy_create_extension.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_policy_create_extension.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_policy_create_extension.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_policy_create_multi_step_extension.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_policy_create_multi_step_extension.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_policy_create_multi_step_extension.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_policy_create_multi_step_extension.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_policy_edit_extension.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_policy_edit_extension.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_policy_edit_extension.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_policy_edit_extension.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_policy_response_extension.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_policy_response_extension.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_policy_response_extension.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/lazy_endpoint_policy_response_extension.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/mocks.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/mocks.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/mocks.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/ingest_manager_integration/mocks.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/integration_tests/policy_list.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/integration_tests/policy_list.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/integration_tests/policy_list.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/integration_tests/policy_list.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_details.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_details.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_details.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_hooks.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_list.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_list.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/advanced_section.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/advanced_section.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/advanced_section.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/advanced_section.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/advanced_section.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/advanced_section.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/advanced_section.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/advanced_section.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/antivirus_registration_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/antivirus_registration_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/antivirus_registration_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/antivirus_registration_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/antivirus_registration_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/antivirus_registration_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/antivirus_registration_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/antivirus_registration_card.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/attack_surface_reduction_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/attack_surface_reduction_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/attack_surface_reduction_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/attack_surface_reduction_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/attack_surface_reduction_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/attack_surface_reduction_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/attack_surface_reduction_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/attack_surface_reduction_card.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/behaviour_protection_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/behaviour_protection_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/behaviour_protection_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/behaviour_protection_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/linux_event_collection_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/linux_event_collection_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/linux_event_collection_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/linux_event_collection_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/linux_event_collection_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/linux_event_collection_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/linux_event_collection_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/linux_event_collection_card.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/mac_event_collection_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/mac_event_collection_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/mac_event_collection_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/mac_event_collection_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/mac_event_collection_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/mac_event_collection_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/mac_event_collection_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/mac_event_collection_card.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/malware_protections_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/malware_protections_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/malware_protections_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/malware_protections_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/malware_protections_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/malware_protections_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/malware_protections_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/malware_protections_card.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/memory_protection_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/memory_protection_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/memory_protection_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/memory_protection_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/memory_protection_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/memory_protection_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/memory_protection_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/memory_protection_card.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/protection_seetings_card/behaviour_protection_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/protection_seetings_card/behaviour_protection_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/protection_seetings_card/behaviour_protection_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/protection_seetings_card/behaviour_protection_card.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/protection_seetings_card/components/reputation_service.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/protection_seetings_card/components/reputation_service.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/protection_seetings_card/components/reputation_service.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/protection_seetings_card/components/reputation_service.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/ransomware_protection_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/ransomware_protection_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/ransomware_protection_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/ransomware_protection_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/ransomware_protection_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/ransomware_protection_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/ransomware_protection_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/ransomware_protection_card.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/windows_event_collection_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/windows_event_collection_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/windows_event_collection_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/windows_event_collection_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/windows_event_collection_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/windows_event_collection_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/windows_event_collection_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/cards/windows_event_collection_card.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/detect_prevent_protection_level.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/detect_prevent_protection_level.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/detect_prevent_protection_level.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/detect_prevent_protection_level.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/detect_prevent_protection_level.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/detect_prevent_protection_level.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/detect_prevent_protection_level.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/detect_prevent_protection_level.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/event_collection_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/event_collection_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/event_collection_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/event_collection_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/event_collection_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/event_collection_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/event_collection_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/event_collection_card.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/event_merging_banner.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/event_merging_banner.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/event_merging_banner.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/event_merging_banner.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/event_merging_banner.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/event_merging_banner.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/event_merging_banner.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/event_merging_banner.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/notify_user_option.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/notify_user_option.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/notify_user_option.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/notify_user_option.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/notify_user_option.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/notify_user_option.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/notify_user_option.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/notify_user_option.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/protection_setting_card_switch.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/protection_setting_card_switch.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/protection_setting_card_switch.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/protection_setting_card_switch.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/protection_setting_card_switch.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/protection_setting_card_switch.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/protection_setting_card_switch.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/protection_setting_card_switch.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/related_detection_rules_callout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/related_detection_rules_callout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/related_detection_rules_callout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/related_detection_rules_callout.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/related_detection_rules_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/related_detection_rules_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/related_detection_rules_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/related_detection_rules_callout.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/setting_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/setting_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/setting_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/setting_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/setting_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/setting_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/setting_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/setting_card.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/setting_locked_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/setting_locked_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/setting_locked_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/setting_locked_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/setting_locked_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/setting_locked_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/setting_locked_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/setting_locked_card.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/constants.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/hooks/use_get_custom_notification_unavailable_component.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/hooks/use_get_custom_notification_unavailable_component.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/hooks/use_get_custom_notification_unavailable_component.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/hooks/use_get_custom_notification_unavailable_component.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/hooks/use_get_protections_unavailable_component.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/hooks/use_get_protections_unavailable_component.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/hooks/use_get_protections_unavailable_component.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/hooks/use_get_protections_unavailable_component.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/mocks.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/policy_settings_form.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/policy_settings_form.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/policy_settings_form.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/policy_settings_form.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/policy_settings_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/policy_settings_form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/policy_settings_form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/policy_settings_form.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/protection_notice_supported_endpoint_version.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/protection_notice_supported_endpoint_version.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/protection_notice_supported_endpoint_version.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/protection_notice_supported_endpoint_version.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/types.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/types.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_layout/components/policy_form_confirm_update.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_layout/components/policy_form_confirm_update.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_layout/components/policy_form_confirm_update.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_layout/components/policy_form_confirm_update.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_layout/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_layout/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_layout/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_layout/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_layout/policy_settings_layout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_layout/policy_settings_layout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_layout/policy_settings_layout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_layout/policy_settings_layout.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_layout/policy_settings_layout.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_layout/policy_settings_layout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_layout/policy_settings_layout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/policy_settings_layout/policy_settings_layout.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/protection_updates/components/protection_updates_bottom_bar.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/protection_updates/components/protection_updates_bottom_bar.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/protection_updates/components/protection_updates_bottom_bar.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/protection_updates/components/protection_updates_bottom_bar.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/protection_updates/components/protection_updates_warning_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/protection_updates/components/protection_updates_warning_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/protection_updates/components/protection_updates_warning_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/protection_updates/components/protection_updates_warning_panel.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/protection_updates/hooks/use_get_protection_updates_note.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/protection_updates/hooks/use_get_protection_updates_note.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/protection_updates/hooks/use_get_protection_updates_note.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/protection_updates/hooks/use_get_protection_updates_note.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/protection_updates/hooks/use_get_protection_updates_unavailable_component.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/protection_updates/hooks/use_get_protection_updates_unavailable_component.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/protection_updates/hooks/use_get_protection_updates_unavailable_component.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/protection_updates/hooks/use_get_protection_updates_unavailable_component.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/protection_updates/hooks/use_post_protection_updates_note.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/protection_updates/hooks/use_post_protection_updates_note.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/protection_updates/hooks/use_post_protection_updates_note.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/protection_updates/hooks/use_post_protection_updates_note.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/protection_updates/protection_updates_layout.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/protection_updates/protection_updates_layout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/protection_updates/protection_updates_layout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/protection_updates/protection_updates_layout.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/tabs/blocklists_translations.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/tabs/blocklists_translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/tabs/blocklists_translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/tabs/blocklists_translations.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/tabs/event_filters_translations.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/tabs/event_filters_translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/tabs/event_filters_translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/tabs/event_filters_translations.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/tabs/host_isolation_exceptions_translations.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/tabs/host_isolation_exceptions_translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/tabs/host_isolation_exceptions_translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/tabs/host_isolation_exceptions_translations.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/tabs/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/tabs/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/tabs/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/tabs/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/tabs/policy_tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/tabs/policy_tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/tabs/policy_tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/tabs/policy_tabs.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/tabs/trusted_apps_translations.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/tabs/trusted_apps_translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/tabs/trusted_apps_translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/tabs/trusted_apps_translations.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/tabs/unsaved_changes_confirm_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/tabs/unsaved_changes_confirm_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/policy/view/tabs/unsaved_changes_confirm_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/policy/view/tabs/unsaved_changes_confirm_modal.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/response_actions/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/response_actions/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/response_actions/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/response_actions/index.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/response_actions/view/response_actions_list_page.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/response_actions/view/response_actions_list_page.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/response_actions/view/response_actions_list_page.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/response_actions/view/response_actions_list_page.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/response_actions/view/response_actions_list_page.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/response_actions/view/response_actions_list_page.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/response_actions/view/response_actions_list_page.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/response_actions/view/response_actions_list_page.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/trusted_apps/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/constants.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/trusted_apps/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/index.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/api_client.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/service/api_client.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/api_client.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/service/api_client.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/service/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/service/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/mappers.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/service/mappers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/trusted_apps/service/mappers.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/service/mappers.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/state/type_guards.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/state/type_guards.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/trusted_apps/state/type_guards.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/state/type_guards.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/artifacts_docs_link.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/components/artifacts_docs_link.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/artifacts_docs_link.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/components/artifacts_docs_link.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/condition_entry_input/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/components/condition_entry_input/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/condition_entry_input/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/components/condition_entry_input/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/condition_entry_input/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/components/condition_entry_input/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/condition_entry_input/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/components/condition_entry_input/index.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/condition_group/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/components/condition_group/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/condition_group/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/components/condition_group/index.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/empty_state.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/components/empty_state.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/empty_state.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/components/empty_state.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/form.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/components/form.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/form.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/components/form.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/form.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/components/form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/components/form.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/logical_condition/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/components/logical_condition/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/logical_condition/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/components/logical_condition/index.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/logical_condition/logical_condition_builder.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/components/logical_condition/logical_condition_builder.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/logical_condition/logical_condition_builder.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/components/logical_condition/logical_condition_builder.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/translations.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_list.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_list.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_list.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_list.test.tsx diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_list.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_list.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_list.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_list.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/management/reporter_config.json b/x-pack/solutions/security/plugins/security_solution/public/management/reporter_config.json new file mode 100644 index 0000000000000..6155a3bbd802a --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/management/reporter_config.json @@ -0,0 +1,16 @@ +{ + "reporterEnabled": "mochawesome, mocha-junit-reporter, buildkite-test-collector/mocha/reporter", + "buildkiteTestCollectorMochaReporterReporterOptions": { + "token_name": "BK_ANALYTICS_API_KEY", + "follow-symlinks": true, + "timeout": 120, + "upload-concurrency": 50 + }, + "reporterOptions": { + "html": false, + "json": true, + "mochaFile": "../../../../../target/kibana-security-solution/cypress/results/TEST-security-solution-cypress-[hash].xml", + "overwrite": false, + "reportDir": "../../../../../target/kibana-security-solution/cypress/results" + } +} diff --git a/x-pack/plugins/security_solution/public/management/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/management/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/management/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/management/routes.tsx diff --git a/x-pack/plugins/security_solution/public/management/services/exceptions_list/check_artifact_has_data.ts b/x-pack/solutions/security/plugins/security_solution/public/management/services/exceptions_list/check_artifact_has_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/services/exceptions_list/check_artifact_has_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/services/exceptions_list/check_artifact_has_data.ts diff --git a/x-pack/plugins/security_solution/public/management/services/exceptions_list/exceptions_list_api_client.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/services/exceptions_list/exceptions_list_api_client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/services/exceptions_list/exceptions_list_api_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/services/exceptions_list/exceptions_list_api_client.test.ts diff --git a/x-pack/plugins/security_solution/public/management/services/exceptions_list/exceptions_list_api_client.ts b/x-pack/solutions/security/plugins/security_solution/public/management/services/exceptions_list/exceptions_list_api_client.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/services/exceptions_list/exceptions_list_api_client.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/services/exceptions_list/exceptions_list_api_client.ts diff --git a/x-pack/plugins/security_solution/public/management/services/policies/hooks.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/services/policies/hooks.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/services/policies/hooks.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/services/policies/hooks.test.ts diff --git a/x-pack/plugins/security_solution/public/management/services/policies/hooks.ts b/x-pack/solutions/security/plugins/security_solution/public/management/services/policies/hooks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/services/policies/hooks.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/services/policies/hooks.ts diff --git a/x-pack/plugins/security_solution/public/management/services/policies/ingest.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/services/policies/ingest.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/services/policies/ingest.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/services/policies/ingest.test.ts diff --git a/x-pack/plugins/security_solution/public/management/services/policies/ingest.ts b/x-pack/solutions/security/plugins/security_solution/public/management/services/policies/ingest.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/services/policies/ingest.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/services/policies/ingest.ts diff --git a/x-pack/plugins/security_solution/public/management/services/policies/policies.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/services/policies/policies.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/services/policies/policies.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/services/policies/policies.test.ts diff --git a/x-pack/plugins/security_solution/public/management/services/policies/policies.ts b/x-pack/solutions/security/plugins/security_solution/public/management/services/policies/policies.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/services/policies/policies.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/services/policies/policies.ts diff --git a/x-pack/plugins/security_solution/public/management/services/policies/test_mock_utils.ts b/x-pack/solutions/security/plugins/security_solution/public/management/services/policies/test_mock_utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/services/policies/test_mock_utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/services/policies/test_mock_utils.ts diff --git a/x-pack/plugins/security_solution/public/management/state/README.md b/x-pack/solutions/security/plugins/security_solution/public/management/state/README.md similarity index 100% rename from x-pack/plugins/security_solution/public/management/state/README.md rename to x-pack/solutions/security/plugins/security_solution/public/management/state/README.md diff --git a/x-pack/plugins/security_solution/public/management/state/async_resource_builders.ts b/x-pack/solutions/security/plugins/security_solution/public/management/state/async_resource_builders.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/state/async_resource_builders.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/state/async_resource_builders.ts diff --git a/x-pack/plugins/security_solution/public/management/state/async_resource_state.test.ts b/x-pack/solutions/security/plugins/security_solution/public/management/state/async_resource_state.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/state/async_resource_state.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/state/async_resource_state.test.ts diff --git a/x-pack/plugins/security_solution/public/management/state/async_resource_state.ts b/x-pack/solutions/security/plugins/security_solution/public/management/state/async_resource_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/state/async_resource_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/state/async_resource_state.ts diff --git a/x-pack/plugins/security_solution/public/management/state/index.ts b/x-pack/solutions/security/plugins/security_solution/public/management/state/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/state/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/state/index.ts diff --git a/x-pack/plugins/security_solution/public/management/store/middleware.ts b/x-pack/solutions/security/plugins/security_solution/public/management/store/middleware.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/store/middleware.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/store/middleware.ts diff --git a/x-pack/plugins/security_solution/public/management/store/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/management/store/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/store/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/store/reducer.ts diff --git a/x-pack/plugins/security_solution/public/management/types.ts b/x-pack/solutions/security/plugins/security_solution/public/management/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/management/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/management/types.ts diff --git a/x-pack/plugins/security_solution/public/mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/mocks.ts diff --git a/x-pack/plugins/security_solution/public/notes/api/api.test.ts b/x-pack/solutions/security/plugins/security_solution/public/notes/api/api.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/notes/api/api.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/notes/api/api.test.ts diff --git a/x-pack/plugins/security_solution/public/notes/api/api.ts b/x-pack/solutions/security/plugins/security_solution/public/notes/api/api.ts similarity index 94% rename from x-pack/plugins/security_solution/public/notes/api/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/notes/api/api.ts index 5f380d0ae3044..b09398054a04d 100644 --- a/x-pack/plugins/security_solution/public/notes/api/api.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/notes/api/api.ts @@ -16,7 +16,7 @@ import { NOTE_URL } from '../../../common/constants'; /** * Adds a new note. - * This code is very close to the persistNote found in x-pack/plugins/security_solution/public/timelines/containers/notes/api.ts. + * This code is very close to the persistNote found in x-pack/solutions/security/plugins/security_solution/public/timelines/containers/notes/api.ts. * // TODO remove the old method when the transition to the new notes system is complete */ export const createNote = async ({ note }: { note: BareNote }) => { diff --git a/x-pack/plugins/security_solution/public/notes/components/add_note.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/notes/components/add_note.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/notes/components/add_note.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/notes/components/add_note.test.tsx diff --git a/x-pack/plugins/security_solution/public/notes/components/add_note.tsx b/x-pack/solutions/security/plugins/security_solution/public/notes/components/add_note.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/notes/components/add_note.tsx rename to x-pack/solutions/security/plugins/security_solution/public/notes/components/add_note.tsx diff --git a/x-pack/plugins/security_solution/public/notes/components/created_by_filter_dropdown.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/notes/components/created_by_filter_dropdown.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/notes/components/created_by_filter_dropdown.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/notes/components/created_by_filter_dropdown.test.tsx diff --git a/x-pack/plugins/security_solution/public/notes/components/created_by_filter_dropdown.tsx b/x-pack/solutions/security/plugins/security_solution/public/notes/components/created_by_filter_dropdown.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/notes/components/created_by_filter_dropdown.tsx rename to x-pack/solutions/security/plugins/security_solution/public/notes/components/created_by_filter_dropdown.tsx diff --git a/x-pack/plugins/security_solution/public/notes/components/delete_confirm_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/notes/components/delete_confirm_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/notes/components/delete_confirm_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/notes/components/delete_confirm_modal.tsx diff --git a/x-pack/plugins/security_solution/public/notes/components/delete_note_button.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/notes/components/delete_note_button.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/notes/components/delete_note_button.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/notes/components/delete_note_button.test.tsx diff --git a/x-pack/plugins/security_solution/public/notes/components/delete_note_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/notes/components/delete_note_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/notes/components/delete_note_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/notes/components/delete_note_button.tsx diff --git a/x-pack/plugins/security_solution/public/notes/components/note_content.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/notes/components/note_content.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/notes/components/note_content.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/notes/components/note_content.test.tsx diff --git a/x-pack/plugins/security_solution/public/notes/components/note_content.tsx b/x-pack/solutions/security/plugins/security_solution/public/notes/components/note_content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/notes/components/note_content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/notes/components/note_content.tsx diff --git a/x-pack/plugins/security_solution/public/notes/components/notes_list.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/notes/components/notes_list.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/notes/components/notes_list.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/notes/components/notes_list.test.tsx diff --git a/x-pack/plugins/security_solution/public/notes/components/notes_list.tsx b/x-pack/solutions/security/plugins/security_solution/public/notes/components/notes_list.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/notes/components/notes_list.tsx rename to x-pack/solutions/security/plugins/security_solution/public/notes/components/notes_list.tsx diff --git a/x-pack/plugins/security_solution/public/notes/components/open_flyout_button.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/notes/components/open_flyout_button.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/notes/components/open_flyout_button.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/notes/components/open_flyout_button.test.tsx diff --git a/x-pack/plugins/security_solution/public/notes/components/open_flyout_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/notes/components/open_flyout_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/notes/components/open_flyout_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/notes/components/open_flyout_button.tsx diff --git a/x-pack/plugins/security_solution/public/notes/components/open_timeline_button.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/notes/components/open_timeline_button.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/notes/components/open_timeline_button.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/notes/components/open_timeline_button.test.tsx diff --git a/x-pack/plugins/security_solution/public/notes/components/open_timeline_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/notes/components/open_timeline_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/notes/components/open_timeline_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/notes/components/open_timeline_button.tsx diff --git a/x-pack/plugins/security_solution/public/notes/components/search_row.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/notes/components/search_row.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/notes/components/search_row.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/notes/components/search_row.test.tsx diff --git a/x-pack/plugins/security_solution/public/notes/components/search_row.tsx b/x-pack/solutions/security/plugins/security_solution/public/notes/components/search_row.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/notes/components/search_row.tsx rename to x-pack/solutions/security/plugins/security_solution/public/notes/components/search_row.tsx diff --git a/x-pack/plugins/security_solution/public/notes/components/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/notes/components/test_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/notes/components/test_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/notes/components/test_ids.ts diff --git a/x-pack/plugins/security_solution/public/notes/components/utility_bar.tsx b/x-pack/solutions/security/plugins/security_solution/public/notes/components/utility_bar.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/notes/components/utility_bar.tsx rename to x-pack/solutions/security/plugins/security_solution/public/notes/components/utility_bar.tsx diff --git a/x-pack/plugins/security_solution/public/notes/hooks/use_fetch_notes.test.ts b/x-pack/solutions/security/plugins/security_solution/public/notes/hooks/use_fetch_notes.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/notes/hooks/use_fetch_notes.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/notes/hooks/use_fetch_notes.test.ts diff --git a/x-pack/plugins/security_solution/public/notes/hooks/use_fetch_notes.ts b/x-pack/solutions/security/plugins/security_solution/public/notes/hooks/use_fetch_notes.ts similarity index 100% rename from x-pack/plugins/security_solution/public/notes/hooks/use_fetch_notes.ts rename to x-pack/solutions/security/plugins/security_solution/public/notes/hooks/use_fetch_notes.ts diff --git a/x-pack/plugins/security_solution/public/notes/index.ts b/x-pack/solutions/security/plugins/security_solution/public/notes/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/notes/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/notes/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/notes/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/notes/jest.config.js new file mode 100644 index 0000000000000..c3f3cd3b77735 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/notes/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/notes'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/notes', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/notes/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/notes/links.ts b/x-pack/solutions/security/plugins/security_solution/public/notes/links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/notes/links.ts rename to x-pack/solutions/security/plugins/security_solution/public/notes/links.ts diff --git a/x-pack/plugins/security_solution/public/notes/pages/note_management_page.tsx b/x-pack/solutions/security/plugins/security_solution/public/notes/pages/note_management_page.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/notes/pages/note_management_page.tsx rename to x-pack/solutions/security/plugins/security_solution/public/notes/pages/note_management_page.tsx diff --git a/x-pack/plugins/security_solution/public/notes/pages/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/notes/pages/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/notes/pages/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/notes/pages/translations.ts diff --git a/x-pack/plugins/security_solution/public/notes/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/notes/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/notes/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/notes/routes.tsx diff --git a/x-pack/plugins/security_solution/public/notes/store/normalize.ts b/x-pack/solutions/security/plugins/security_solution/public/notes/store/normalize.ts similarity index 100% rename from x-pack/plugins/security_solution/public/notes/store/normalize.ts rename to x-pack/solutions/security/plugins/security_solution/public/notes/store/normalize.ts diff --git a/x-pack/plugins/security_solution/public/notes/store/notes.slice.test.ts b/x-pack/solutions/security/plugins/security_solution/public/notes/store/notes.slice.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/notes/store/notes.slice.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/notes/store/notes.slice.test.ts diff --git a/x-pack/plugins/security_solution/public/notes/store/notes.slice.ts b/x-pack/solutions/security/plugins/security_solution/public/notes/store/notes.slice.ts similarity index 100% rename from x-pack/plugins/security_solution/public/notes/store/notes.slice.ts rename to x-pack/solutions/security/plugins/security_solution/public/notes/store/notes.slice.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/__mocks__/mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/__mocks__/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/__mocks__/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/__mocks__/mocks.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/__mocks__/onboarding_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/__mocks__/onboarding_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/__mocks__/onboarding_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/__mocks__/onboarding_context.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/__snapshots__/onboarding_context.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/__snapshots__/onboarding_context.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/__snapshots__/onboarding_context.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/__snapshots__/onboarding_context.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/onboarding/components/hooks/use_onboarding_service.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/hooks/use_onboarding_service.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/hooks/use_onboarding_service.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/hooks/use_onboarding_service.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/hooks/use_stored_state.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/hooks/use_stored_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/hooks/use_stored_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/hooks/use_stored_state.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/hooks/use_topic_id.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/hooks/use_topic_id.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/hooks/use_topic_id.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/hooks/use_topic_id.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/hooks/use_url_detail.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/hooks/use_url_detail.ts similarity index 86% rename from x-pack/plugins/security_solution/public/onboarding/components/hooks/use_url_detail.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/hooks/use_url_detail.ts index 387e9d66865b3..444aa7831802d 100644 --- a/x-pack/plugins/security_solution/public/onboarding/components/hooks/use_url_detail.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/hooks/use_url_detail.ts @@ -28,7 +28,7 @@ const getCardHash = (cardId: OnboardingCardId | null) => (cardId ? `#${cardId}` * This hook manages the expanded card id state in the LocalStorage and the hash in the URL. */ export const useUrlDetail = () => { - const { spaceId, telemetry } = useOnboardingContext(); + const { config, spaceId, telemetry } = useOnboardingContext(); const topicId = useTopicId(); const [storedUrlDetail, setStoredUrlDetail] = useStoredUrlDetails(spaceId); @@ -56,6 +56,14 @@ export const useUrlDetail = () => { const syncUrlDetails = useCallback( (pathTopicId: OnboardingTopicId | null, hashCardId: OnboardingCardId | null) => { + if (storedUrlDetail) { + // If the stored topic is not valid, clear it + const [storedTopicId] = storedUrlDetail.split('#'); + if (storedTopicId && !config.has(storedTopicId as OnboardingTopicId)) { + setStoredUrlDetail(null); + return; + } + } const urlDetail = `${pathTopicId || ''}${hashCardId ? `#${hashCardId}` : ''}`; if (urlDetail && urlDetail !== storedUrlDetail) { if (hashCardId) { @@ -67,7 +75,7 @@ export const useUrlDetail = () => { navigateTo({ deepLinkId: SecurityPageName.landing, path: storedUrlDetail }); } }, - [navigateTo, setStoredUrlDetail, storedUrlDetail, telemetry] + [config, navigateTo, setStoredUrlDetail, storedUrlDetail, telemetry] ); return { setTopicDetail, setCardDetail, syncUrlDetails }; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/lib/__mocks__/telemetry.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/lib/__mocks__/telemetry.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/lib/__mocks__/telemetry.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/lib/__mocks__/telemetry.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/lib/telemetry.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/lib/telemetry.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/lib/telemetry.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/lib/telemetry.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_banner/index.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_banner/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_banner/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_banner/index.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_banner/onboarding_banner.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_banner/onboarding_banner.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_banner/onboarding_banner.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_banner/onboarding_banner.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/body_config.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/body_config.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/body_config.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/body_config.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/alerts_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/alerts_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/alerts_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/alerts_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/alerts_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/alerts_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/alerts_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/alerts_card.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/images/alerts.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/images/alerts.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/images/alerts.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/images/alerts.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/images/alerts_icon.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/images/alerts_icon.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/images/alerts_icon.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/images/alerts_icon.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/index.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/index.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/alerts/translations.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/assistant_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/assistant_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/assistant_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/assistant_card.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/assistant_check_complete.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/assistant_check_complete.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/assistant_check_complete.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/assistant_check_complete.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/index.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/index.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/translations.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/types.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/assistant/types.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/attack_discover_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/attack_discover_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/attack_discover_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/attack_discover_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/attack_discovery_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/attack_discovery_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/attack_discovery_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/attack_discovery_card.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/images/attack_discovery.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/images/attack_discovery.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/images/attack_discovery.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/images/attack_discovery.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/images/attack_discovery_icon.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/images/attack_discovery_icon.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/images/attack_discovery_icon.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/images/attack_discovery_icon.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/index.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/index.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/attack_discovery/translations.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_callout.styles.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_callout.styles.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_callout.styles.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_callout.styles.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_callout.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_content_image_panel.styles.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_content_image_panel.styles.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_content_image_panel.styles.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_content_image_panel.styles.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_content_image_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_content_image_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_content_image_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_content_image_panel.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_content_panel.styles.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_content_panel.styles.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_content_panel.styles.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_content_panel.styles.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_content_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_content_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_content_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_content_panel.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_link_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_link_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_link_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_link_button.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_subdued_text.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_subdued_text.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_subdued_text.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/card_subdued_text.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/connector_cards.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/connector_cards.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/connector_cards.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/connector_cards.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/connector_setup.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/connector_setup.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/connector_setup.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/connector_setup.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/constants.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/create_connector_popover.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/create_connector_popover.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/create_connector_popover.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/create_connector_popover.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/hooks/use_load_action_types.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/hooks/use_load_action_types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/hooks/use_load_action_types.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/hooks/use_load_action_types.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/missing_privileges.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/missing_privileges.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/missing_privileges.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/missing_privileges.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/common/connectors/translations.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/dashboards_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/dashboards_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/dashboards_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/dashboards_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/dashboards_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/dashboards_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/dashboards_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/dashboards_card.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/images/dashboards.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/images/dashboards.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/images/dashboards.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/images/dashboards.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/images/dashboards_icon.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/images/dashboards_icon.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/images/dashboards_icon.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/images/dashboards_icon.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/index.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/index.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/dashboards/translations.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/__mocks__/integration_card_grid_tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/__mocks__/integration_card_grid_tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/__mocks__/integration_card_grid_tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/__mocks__/integration_card_grid_tabs.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/__mocks__/package_list_grid.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/__mocks__/package_list_grid.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/__mocks__/package_list_grid.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/__mocks__/package_list_grid.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/agent_required_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/agent_required_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/agent_required_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/agent_required_callout.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/agentless_available_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/agentless_available_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/agentless_available_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/agentless_available_callout.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/endpoint_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/endpoint_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/endpoint_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/endpoint_callout.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/installed_integrations_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/installed_integrations_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/installed_integrations_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/installed_integrations_callout.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/integration_card_top_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/integration_card_top_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/integration_card_top_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/integration_card_top_callout.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/manage_integrations_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/manage_integrations_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/manage_integrations_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/__mocks__/manage_integrations_callout.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/agent_required_callout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/agent_required_callout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/agent_required_callout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/agent_required_callout.test.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/agent_required_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/agent_required_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/agent_required_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/agent_required_callout.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/agentless_available_callout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/agentless_available_callout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/agentless_available_callout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/agentless_available_callout.test.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/agentless_available_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/agentless_available_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/agentless_available_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/agentless_available_callout.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/endpoint_callout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/endpoint_callout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/endpoint_callout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/endpoint_callout.test.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/endpoint_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/endpoint_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/endpoint_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/endpoint_callout.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/installed_integrations_callout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/installed_integrations_callout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/installed_integrations_callout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/installed_integrations_callout.test.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/installed_integrations_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/installed_integrations_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/installed_integrations_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/installed_integrations_callout.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/integration_card_top_callout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/integration_card_top_callout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/integration_card_top_callout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/integration_card_top_callout.test.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/integration_card_top_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/integration_card_top_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/integration_card_top_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/integration_card_top_callout.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/manage_integrations_callout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/manage_integrations_callout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/manage_integrations_callout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/manage_integrations_callout.test.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/manage_integrations_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/manage_integrations_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/manage_integrations_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/callouts/manage_integrations_callout.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/constants.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/images/integrations_icon.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/images/integrations_icon.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/images/integrations_icon.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/images/integrations_icon.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/index.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/index.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integration_card_grid_tabs.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integration_card_grid_tabs.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integration_card_grid_tabs.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integration_card_grid_tabs.test.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integration_card_grid_tabs.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integration_card_grid_tabs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integration_card_grid_tabs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integration_card_grid_tabs.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integration_tabs_configs.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integration_tabs_configs.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integration_tabs_configs.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integration_tabs_configs.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integrations_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integrations_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integrations_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integrations_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integrations_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integrations_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integrations_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integrations_card.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integrations_check_complete.test.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integrations_check_complete.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integrations_check_complete.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integrations_check_complete.test.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integrations_check_complete.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integrations_check_complete.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integrations_check_complete.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/integrations_check_complete.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/types.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/types.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/use_integration_card_list.test.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/use_integration_card_list.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/use_integration_card_list.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/use_integration_card_list.test.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/use_integration_card_list.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/use_integration_card_list.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/use_integration_card_list.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/integrations/use_integration_card_list.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/images/rules.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/images/rules.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/images/rules.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/images/rules.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/images/rules_icon.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/images/rules_icon.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/images/rules_icon.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/images/rules_icon.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/index.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/index.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/rules_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/rules_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/rules_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/rules_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/rules_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/rules_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/rules_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/rules_card.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/rules_check_complete.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/rules_check_complete.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/rules_check_complete.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/rules_check_complete.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/rules/translations.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/ai_connector_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/ai_connector_card.tsx similarity index 86% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/ai_connector_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/ai_connector_card.tsx index e42834e85d488..1786c9cbee85c 100644 --- a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/ai_connector_card.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/ai_connector_card.tsx @@ -7,6 +7,7 @@ import React, { useCallback } from 'react'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { CenteredLoadingSpinner } from '../../../../../../common/components/centered_loading_spinner'; import { useKibana } from '../../../../../../common/lib/kibana/kibana_react'; import { useDefinedLocalStorage } from '../../../../hooks/use_stored_state'; import type { OnboardingCardComponent } from '../../../../../types'; @@ -35,9 +36,15 @@ export const AIConnectorCard: OnboardingCardComponent<AIConnectorCardMetadata> = [setComplete, setStoredConnectorId] ); - const connectors = checkCompleteMetadata?.connectors; - const canExecuteConnectors = checkCompleteMetadata?.canExecuteConnectors; - const canCreateConnectors = checkCompleteMetadata?.canCreateConnectors; + if (!checkCompleteMetadata) { + return ( + <OnboardingCardContentPanel> + <CenteredLoadingSpinner /> + </OnboardingCardContentPanel> + ); + } + + const { connectors, canExecuteConnectors, canCreateConnectors } = checkCompleteMetadata; return ( <OnboardingCardContentPanel> diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/connectors_check_complete.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/connectors_check_complete.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/connectors_check_complete.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/connectors_check_complete.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/index.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/index.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/translations.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/types.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/ai_connector/types.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/images/card_header_icon.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/images/card_header_icon.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/images/card_header_icon.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/images/card_header_icon.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/index.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/index.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/missing_ai_connector_callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/missing_ai_connector_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/missing_ai_connector_callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/missing_ai_connector_callout.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/rule_migrations_panels.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/rule_migrations_panels.tsx new file mode 100644 index 0000000000000..1dae4d523c953 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/rule_migrations_panels.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 { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { SiemMigrationTaskStatus } from '../../../../../../../common/siem_migrations/constants'; +import type { RuleMigrationStats } from '../../../../../../siem_migrations/rules/types'; +import { UploadRulesPanel } from './upload_rules_panel'; +import { MigrationProgressPanel } from '../../../../../../siem_migrations/rules/components/migration_status_panels/migration_progress_panel'; +import { MigrationResultPanel } from '../../../../../../siem_migrations/rules/components/migration_status_panels/migration_result_panel'; +import { MigrationReadyPanel } from '../../../../../../siem_migrations/rules/components/migration_status_panels/migration_ready_panel'; +import { MissingAIConnectorCallout } from './missing_ai_connector_callout'; + +export interface RuleMigrationsPanelsProps { + migrationsStats: RuleMigrationStats[]; + isConnectorsCardComplete: boolean; + expandConnectorsCard: () => void; +} +export const RuleMigrationsPanels = React.memo<RuleMigrationsPanelsProps>( + ({ migrationsStats, isConnectorsCardComplete, expandConnectorsCard }) => { + if (migrationsStats.length === 0) { + return isConnectorsCardComplete ? ( + <UploadRulesPanel /> + ) : ( + <MissingAIConnectorCallout onExpandAiConnectorsCard={expandConnectorsCard} /> + ); + } + + return ( + <EuiFlexGroup direction="column" gutterSize="m"> + <EuiFlexItem grow={false}> + {isConnectorsCardComplete ? ( + <UploadRulesPanel isUploadMore /> + ) : ( + <MissingAIConnectorCallout onExpandAiConnectorsCard={expandConnectorsCard} /> + )} + </EuiFlexItem> + {migrationsStats.map((migrationStats) => ( + <EuiFlexItem grow={false} key={migrationStats.id}> + {migrationStats.status === SiemMigrationTaskStatus.READY && ( + <MigrationReadyPanel migrationStats={migrationStats} /> + )} + {migrationStats.status === SiemMigrationTaskStatus.RUNNING && ( + <MigrationProgressPanel migrationStats={migrationStats} /> + )} + {migrationStats.status === SiemMigrationTaskStatus.FINISHED && ( + <MigrationResultPanel migrationStats={migrationStats} /> + )} + </EuiFlexItem> + ))} + </EuiFlexGroup> + ); + } +); +RuleMigrationsPanels.displayName = 'RuleMigrationsPanels'; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.styles.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.styles.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.styles.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.styles.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.tsx new file mode 100644 index 0000000000000..baebbde53b4cf --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.tsx @@ -0,0 +1,69 @@ +/* + * 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, useEffect, useMemo } from 'react'; +import { EuiSpacer } from '@elastic/eui'; +import { PanelText } from '../../../../../../common/components/panel_text'; +import { RuleMigrationDataInputWrapper } from '../../../../../../siem_migrations/rules/components/data_input_flyout/data_input_wrapper'; +import { SiemMigrationTaskStatus } from '../../../../../../../common/siem_migrations/constants'; +import { OnboardingCardId } from '../../../../../constants'; +import { useLatestStats } from '../../../../../../siem_migrations/rules/service/hooks/use_latest_stats'; +import { CenteredLoadingSpinner } from '../../../../../../common/components/centered_loading_spinner'; +import type { OnboardingCardComponent } from '../../../../../types'; +import { OnboardingCardContentPanel } from '../../common/card_content_panel'; +import { RuleMigrationsPanels } from './rule_migrations_panels'; +import { useStyles } from './start_migration_card.styles'; +import * as i18n from './translations'; + +export const StartMigrationCard: OnboardingCardComponent = React.memo( + ({ setComplete, isCardComplete, setExpandedCardId }) => { + const styles = useStyles(); + const { data: migrationsStats, isLoading, refreshStats } = useLatestStats(); + + useEffect(() => { + // Set card complete if any migration is finished + if (!isCardComplete(OnboardingCardId.siemMigrationsStart) && migrationsStats) { + if (migrationsStats.some(({ status }) => status === SiemMigrationTaskStatus.FINISHED)) { + setComplete(true); + } + } + }, [isCardComplete, migrationsStats, setComplete]); + + const isConnectorsCardComplete = useMemo( + () => isCardComplete(OnboardingCardId.siemMigrationsAiConnectors), + [isCardComplete] + ); + + const expandConnectorsCard = useCallback(() => { + setExpandedCardId(OnboardingCardId.siemMigrationsAiConnectors); + }, [setExpandedCardId]); + + return ( + <RuleMigrationDataInputWrapper onFlyoutClosed={refreshStats}> + <OnboardingCardContentPanel paddingSize="none" className={styles}> + {isLoading ? ( + <CenteredLoadingSpinner /> + ) : ( + <RuleMigrationsPanels + migrationsStats={migrationsStats} + isConnectorsCardComplete={isConnectorsCardComplete} + expandConnectorsCard={expandConnectorsCard} + /> + )} + <EuiSpacer size="m" /> + <PanelText size="xs" subdued> + <p>{i18n.START_MIGRATION_CARD_FOOTER_NOTE}</p> + </PanelText> + </OnboardingCardContentPanel> + </RuleMigrationDataInputWrapper> + ); + } +); +StartMigrationCard.displayName = 'StartMigrationCard'; + +// eslint-disable-next-line import/no-default-export +export default StartMigrationCard; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_check_complete.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_check_complete.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_check_complete.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_check_complete.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/translations.ts new file mode 100644 index 0000000000000..4073423f1f8ae --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/translations.ts @@ -0,0 +1,57 @@ +/* + * 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'; + +export const START_MIGRATION_CARD_TITLE = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.title', + { defaultMessage: 'Translate your existing SIEM Rules to Elastic' } +); +export const START_MIGRATION_CARD_FOOTER_NOTE = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.footerNote', + { + defaultMessage: + 'Splunk and related marks are trademarks or registered trademarks of Splunk LLC in the United States and other countries.', + } +); +export const START_MIGRATION_CARD_CONNECTOR_MISSING_TEXT = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.connectorMissingText', + { + defaultMessage: 'Rule migrations require an AI connector to be configured.', + } +); +export const START_MIGRATION_CARD_CONNECTOR_MISSING_BUTTON = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.connectorMissingText', + { defaultMessage: 'AI provider step' } +); + +export const START_MIGRATION_CARD_UPLOAD_TITLE = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.upload.title', + { defaultMessage: 'Export your Splunk® SIEM rules to start translation.' } +); + +export const START_MIGRATION_CARD_UPLOAD_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.upload.description', + { + defaultMessage: + 'Upload your rules before importing data to identify the integrations, data streams, and available details of your SIEM rules. Click “Upload Rules” to view step-by-step instructions to export and uploading the rules.', + } +); + +export const START_MIGRATION_CARD_UPLOAD_BUTTON = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.upload.button', + { defaultMessage: 'Upload rules' } +); + +export const START_MIGRATION_CARD_UPLOAD_MORE_TITLE = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.uploadMore.title', + { defaultMessage: 'Need to migrate more rules?' } +); +export const START_MIGRATION_CARD_UPLOAD_MORE_BUTTON = i18n.translate( + 'xpack.securitySolution.onboarding.startMigration.uploadMore.button', + { defaultMessage: 'Upload more rules' } +); diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/upload_rules_panel.styles.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/upload_rules_panel.styles.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/upload_rules_panel.styles.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/upload_rules_panel.styles.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/upload_rules_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/upload_rules_panel.tsx similarity index 82% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/upload_rules_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/upload_rules_panel.tsx index edcff3646c5aa..1a9bd2d17b945 100644 --- a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/panels/upload_rules_panel.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/upload_rules_panel.tsx @@ -15,10 +15,11 @@ import { EuiButtonEmpty, EuiPanel, } from '@elastic/eui'; -import { SiemMigrationsIcon } from '../../../../../../../siem_migrations/common/icon'; -import * as i18n from '../translations'; -import { useStartMigrationContext } from '../context'; -import { TITLE_CLASS_NAME } from '../start_migration_card.styles'; +import { RuleMigrationsReadMore } from '../../../../../../siem_migrations/rules/components/migration_status_panels/read_more'; +import { SiemMigrationsIcon } from '../../../../../../siem_migrations/common/icon'; +import * as i18n from './translations'; +import { TITLE_CLASS_NAME } from './start_migration_card.styles'; +import { useRuleMigrationDataInputContext } from '../../../../../../siem_migrations/rules/components/data_input_flyout/context'; import { useStyles } from './upload_rules_panel.styles'; export interface UploadRulesPanelProps { @@ -26,7 +27,7 @@ export interface UploadRulesPanelProps { } export const UploadRulesPanel = React.memo<UploadRulesPanelProps>(({ isUploadMore = false }) => { const styles = useStyles(isUploadMore); - const { openFlyout } = useStartMigrationContext(); + const { openFlyout } = useRuleMigrationDataInputContext(); const onOpenFlyout = useCallback<React.MouseEventHandler>(() => { openFlyout(); }, [openFlyout]); @@ -55,9 +56,7 @@ export const UploadRulesPanel = React.memo<UploadRulesPanelProps>(({ isUploadMor </EuiText> </EuiFlexItem> <EuiFlexItem grow={false}> - <EuiText size="xs"> - <p>{i18n.START_MIGRATION_CARD_UPLOAD_READ_MORE}</p> - </EuiText> + <RuleMigrationsReadMore /> </EuiFlexItem> </EuiFlexGroup> )} diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_body_config.test.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_body_config.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_body_config.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_body_config.test.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_body_config.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_body_config.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_body_config.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_body_config.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_completed_cards.test.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_completed_cards.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_completed_cards.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_completed_cards.test.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_completed_cards.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_completed_cards.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_completed_cards.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_completed_cards.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_expanded_card.test.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_expanded_card.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_expanded_card.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_expanded_card.test.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_expanded_card.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_expanded_card.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_expanded_card.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/hooks/use_expanded_card.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/index.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/index.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_body.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_body.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_body.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_body.test.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_body.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_body.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_body.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_card_group.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_card_group.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_card_group.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_card_group.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_card_panel.styles.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_card_panel.styles.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_card_panel.styles.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_card_panel.styles.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_card_panel.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_card_panel.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_card_panel.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_card_panel.test.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_card_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_card_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_card_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/onboarding_card_panel.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_body/translations.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_context.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_context.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_context.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_context.test.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_context.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/constants.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/footer_items.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/footer_items.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/footer_items.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/footer_items.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/images/demo.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/images/demo.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/images/demo.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/images/demo.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/images/demo_dark.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/images/demo_dark.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/images/demo_dark.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/images/demo_dark.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/images/documentation.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/images/documentation.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/images/documentation.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/images/documentation.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/images/documentation_dark.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/images/documentation_dark.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/images/documentation_dark.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/images/documentation_dark.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/images/forum.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/images/forum.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/images/forum.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/images/forum.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/images/forum_dark.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/images/forum_dark.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/images/forum_dark.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/images/forum_dark.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/images/labs.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/images/labs.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/images/labs.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/images/labs.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/images/labs_dark.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/images/labs_dark.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/images/labs_dark.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/images/labs_dark.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/index.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/index.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/onboarding_footer.styles.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/onboarding_footer.styles.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/onboarding_footer.styles.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/onboarding_footer.styles.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/onboarding_footer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/onboarding_footer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/onboarding_footer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/onboarding_footer.test.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/onboarding_footer.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/onboarding_footer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_footer/onboarding_footer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_footer/onboarding_footer.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/common/link_card.styles.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/common/link_card.styles.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/common/link_card.styles.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/common/link_card.styles.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/common/link_card.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/common/link_card.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/common/link_card.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/common/link_card.test.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/common/link_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/common/link_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/common/link_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/common/link_card.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/demo_card/demo_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/demo_card/demo_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/demo_card/demo_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/demo_card/demo_card.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/demo_card/images/demo_card.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/demo_card/images/demo_card.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/demo_card/images/demo_card.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/demo_card/images/demo_card.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/demo_card/images/demo_card_dark.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/demo_card/images/demo_card_dark.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/demo_card/images/demo_card_dark.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/demo_card/images/demo_card_dark.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/demo_card/index.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/demo_card/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/demo_card/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/demo_card/index.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/demo_card/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/demo_card/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/demo_card/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/demo_card/translations.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/teammates_card/images/teammates_card.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/teammates_card/images/teammates_card.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/teammates_card/images/teammates_card.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/teammates_card/images/teammates_card.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/teammates_card/images/teammates_card_dark.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/teammates_card/images/teammates_card_dark.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/teammates_card/images/teammates_card_dark.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/teammates_card/images/teammates_card_dark.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/teammates_card/index.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/teammates_card/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/teammates_card/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/teammates_card/index.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/teammates_card/teammates_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/teammates_card/teammates_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/teammates_card/teammates_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/teammates_card/teammates_card.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/teammates_card/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/teammates_card/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/teammates_card/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/teammates_card/translations.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/images/video_card.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/images/video_card.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/images/video_card.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/images/video_card.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/images/video_card_dark.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/images/video_card_dark.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/images/video_card_dark.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/images/video_card_dark.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/index.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/index.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/translations.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/video_card.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/video_card.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/video_card.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/video_card.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/video_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/video_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/video_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/cards/video_card/video_modal.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/constants.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/images/header_rocket.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/images/header_rocket.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/images/header_rocket.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/images/header_rocket.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/images/header_rocket_dark.png b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/images/header_rocket_dark.png similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/images/header_rocket_dark.png rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/images/header_rocket_dark.png diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/index.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/index.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/onboarding_header.styles.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/onboarding_header.styles.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/onboarding_header.styles.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/onboarding_header.styles.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/onboarding_header.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/onboarding_header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/onboarding_header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/onboarding_header.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/onboarding_header_topic_selector.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/onboarding_header_topic_selector.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/onboarding_header_topic_selector.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/onboarding_header_topic_selector.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_header/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_header/translations.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_route.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_route.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/components/onboarding_route.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/components/onboarding_route.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/config.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/config.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/config.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/config.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/constants.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/index.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/onboarding/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/onboarding/jest.config.js new file mode 100644 index 0000000000000..fcee8bbf04e00 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/onboarding/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/onboarding'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/onboarding', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/onboarding/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/onboarding/links.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/links.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/links.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/onboarding/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/routes.tsx diff --git a/x-pack/plugins/security_solution/public/onboarding/service/index.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/service/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/service/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/service/index.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/service/onboarding_service.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/service/onboarding_service.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/service/onboarding_service.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/service/onboarding_service.ts diff --git a/x-pack/plugins/security_solution/public/onboarding/types.ts b/x-pack/solutions/security/plugins/security_solution/public/onboarding/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/onboarding/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/onboarding/types.ts diff --git a/x-pack/plugins/security_solution/public/one_discover/app_wrapper/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/one_discover/app_wrapper/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/one_discover/app_wrapper/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/one_discover/app_wrapper/index.tsx diff --git a/x-pack/plugins/security_solution/public/one_discover/cell_renderers/cell_renderer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/one_discover/cell_renderers/cell_renderer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/one_discover/cell_renderers/cell_renderer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/one_discover/cell_renderers/cell_renderer.test.tsx diff --git a/x-pack/plugins/security_solution/public/one_discover/cell_renderers/cell_renderers.tsx b/x-pack/solutions/security/plugins/security_solution/public/one_discover/cell_renderers/cell_renderers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/one_discover/cell_renderers/cell_renderers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/one_discover/cell_renderers/cell_renderers.tsx diff --git a/x-pack/plugins/security_solution/public/one_discover/cell_renderers/index.ts b/x-pack/solutions/security/plugins/security_solution/public/one_discover/cell_renderers/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/one_discover/cell_renderers/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/one_discover/cell_renderers/index.ts diff --git a/x-pack/plugins/security_solution/public/one_discover/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/one_discover/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/one_discover/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/one_discover/constants.ts diff --git a/x-pack/plugins/security_solution/public/one_discover/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/one_discover/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/one_discover/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/one_discover/index.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/one_discover/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/one_discover/jest.config.js new file mode 100644 index 0000000000000..0e60495a03ccf --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/one_discover/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/one_discover'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/one_discover', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/one_discover/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/overview/components/common.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/common.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/common.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/common.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/alerts_by_status.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/alerts_by_status.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/alerts_by_status.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/alerts_by_status.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/alerts_by_status.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/alerts_by_status.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/alerts_by_status.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/alerts_by_status.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/chart_label.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/chart_label.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/chart_label.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/chart_label.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/index.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/index.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/mock_data.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/mock_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/mock_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/mock_data.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/types.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/types.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/use_alerts_by_status.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/use_alerts_by_status.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/use_alerts_by_status.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/use_alerts_by_status.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/use_alerts_by_status.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/use_alerts_by_status.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/use_alerts_by_status.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/use_alerts_by_status.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/use_alerts_by_status_visualization_data.test.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/use_alerts_by_status_visualization_data.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/use_alerts_by_status_visualization_data.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/use_alerts_by_status_visualization_data.test.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/use_alerts_by_status_visualization_data.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/use_alerts_by_status_visualization_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/use_alerts_by_status_visualization_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/alerts_by_status/use_alerts_by_status_visualization_data.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_by_status/cases_by_status.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_by_status/cases_by_status.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/cases_by_status/cases_by_status.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_by_status/cases_by_status.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_by_status/cases_by_status.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_by_status/cases_by_status.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/cases_by_status/cases_by_status.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_by_status/cases_by_status.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_by_status/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_by_status/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/cases_by_status/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_by_status/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_by_status/use_cases_by_status.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_by_status/use_cases_by_status.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/cases_by_status/use_cases_by_status.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_by_status/use_cases_by_status.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_by_status/use_cases_by_status.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_by_status/use_cases_by_status.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/cases_by_status/use_cases_by_status.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_by_status/use_cases_by_status.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/cases_table.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_table/cases_table.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/cases_table.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_table/cases_table.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/cases_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_table/cases_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/cases_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_table/cases_table.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/index.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_table/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_table/index.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/mock_data.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_table/mock_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/mock_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_table/mock_data.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/status_badge.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_table/status_badge.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/status_badge.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_table/status_badge.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/use_case_items.test.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_table/use_case_items.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/use_case_items.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_table/use_case_items.test.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/use_case_items.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_table/use_case_items.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/cases_table/use_case_items.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/cases_table/use_case_items.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/hooks/mock_data.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/hooks/mock_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/hooks/mock_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/hooks/mock_data.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/hooks/use_navigate_to_timeline.test.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/hooks/use_navigate_to_timeline.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/hooks/use_navigate_to_timeline.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/hooks/use_navigate_to_timeline.test.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/hooks/use_navigate_to_timeline.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/hooks/use_navigate_to_timeline.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/hooks/use_navigate_to_timeline.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/hooks/use_navigate_to_timeline.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/host_alerts_table.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/index.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/index.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/mock_data.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/mock_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/mock_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/mock_data.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/use_host_alerts_items.test.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/use_host_alerts_items.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/use_host_alerts_items.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/use_host_alerts_items.test.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/use_host_alerts_items.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/use_host_alerts_items.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/use_host_alerts_items.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/host_alerts_table/use_host_alerts_items.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/mock_data.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/mock_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/mock_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/mock_data.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/rule_alerts_table.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/use_rule_alerts_items.test.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/use_rule_alerts_items.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/use_rule_alerts_items.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/use_rule_alerts_items.test.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/use_rule_alerts_items.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/use_rule_alerts_items.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/use_rule_alerts_items.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/rule_alerts_table/use_rule_alerts_items.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/date_picker_lock/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/date_picker_lock/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/date_picker_lock/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/date_picker_lock/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/date_picker_lock/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/date_picker_lock/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/date_picker_lock/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/date_picker_lock/translations.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/helpers.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/stat_reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/stat_reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/stat_reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/stat_reducer.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_cases_mttr.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_cases_mttr.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_cases_mttr.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_cases_mttr.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_cases_mttr.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_cases_mttr.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_cases_mttr.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_cases_mttr.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_critical_alerts.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_critical_alerts.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_critical_alerts.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_critical_alerts.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_critical_alerts.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_critical_alerts.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_critical_alerts.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_critical_alerts.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_soc_trends.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_soc_trends.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_soc_trends.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_soc_trends.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_soc_trends.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_soc_trends.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_soc_trends.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/hooks/use_soc_trends.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/soc_trends.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/soc_trends.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/soc_trends.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/soc_trends.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/soc_trends/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/soc_trends/translations.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/translations.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/index.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/index.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/mock_data.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/mock_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/mock_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/mock_data.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/use_user_alerts_items.test.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/use_user_alerts_items.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/use_user_alerts_items.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/use_user_alerts_items.test.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/use_user_alerts_items.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/use_user_alerts_items.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/use_user_alerts_items.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/use_user_alerts_items.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/user_alerts_table/user_alerts_table.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/detection_response/utils.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/utils.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/detection_response/utils.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/detection_response/utils.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/endpoint_notice/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/endpoint_notice/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/endpoint_notice/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/endpoint_notice/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/event_counts/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/event_counts/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/event_counts/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/event_counts/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/event_counts/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/event_counts/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/event_counts/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/events_by_dataset/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/host_overview/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/overview/components/host_overview/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/host_overview/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/host_overview/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/overview/components/host_overview/endpoint_overview/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/host_overview/endpoint_overview/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/host_overview/endpoint_overview/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/host_overview/endpoint_overview/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/host_overview/endpoint_overview/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/host_overview/endpoint_overview/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/host_overview/endpoint_overview/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/host_overview/endpoint_overview/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/host_overview/endpoint_overview/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/host_overview/endpoint_overview/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/host_overview/endpoint_overview/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/host_overview/endpoint_overview/translations.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/host_overview/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/host_overview/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/host_overview/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/host_overview/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/host_overview/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/host_overview/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/host_overview/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/host_overview/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/host_overview/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/host_overview/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/host_overview/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/host_overview/mock.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/host_overview/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/host_overview/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/host_overview/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/host_overview/translations.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/link_panel/disabled_link_panel.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/disabled_link_panel.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/link_panel/disabled_link_panel.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/disabled_link_panel.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/link_panel/disabled_link_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/disabled_link_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/link_panel/disabled_link_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/disabled_link_panel.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/link_panel/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/link_panel/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/helpers.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/link_panel/index.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/link_panel/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/index.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/link_panel/inner_link_panel.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/inner_link_panel.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/link_panel/inner_link_panel.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/inner_link_panel.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/link_panel/inner_link_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/inner_link_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/link_panel/inner_link_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/inner_link_panel.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/link_panel/link.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/link.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/link_panel/link.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/link.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/link_panel/link.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/link.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/link_panel/link.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/link.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/link_panel/link_panel.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/link_panel.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/link_panel/link_panel.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/link_panel.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/link_panel/link_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/link_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/link_panel/link_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/link_panel.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/link_panel/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/link_panel/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/translations.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/link_panel/types.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/link_panel/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/link_panel/types.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/loading_placeholders/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/loading_placeholders/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/loading_placeholders/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/loading_placeholders/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_disabled_module.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_cti_links/cti_disabled_module.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_disabled_module.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_cti_links/cti_disabled_module.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_disabled_module.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_cti_links/cti_disabled_module.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_disabled_module.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_cti_links/cti_disabled_module.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_enabled_module.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_cti_links/cti_enabled_module.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_enabled_module.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_cti_links/cti_enabled_module.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_enabled_module.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_cti_links/cti_enabled_module.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_cti_links/cti_enabled_module.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_cti_links/cti_enabled_module.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_cti_links/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_cti_links/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_cti_links/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_cti_links/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_cti_links/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_cti_links/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_cti_links/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_cti_links/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_cti_links/mock.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/threat_intel_panel_view.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_cti_links/threat_intel_panel_view.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_cti_links/threat_intel_panel_view.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_cti_links/threat_intel_panel_view.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_cti_links/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_cti_links/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_cti_links/translations.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/use_integrations_page_link.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_cti_links/use_integrations_page_link.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_cti_links/use_integrations_page_link.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_cti_links/use_integrations_page_link.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_host/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_host/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_host/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_host/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_host/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_host/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_host/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_host/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_host_stats/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_host_stats/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_host_stats/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_host_stats/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_host_stats/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_host_stats/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_host_stats/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_host_stats/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_host_stats/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_host_stats/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_host_stats/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_host_stats/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_host_stats/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_host_stats/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_host_stats/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_host_stats/mock.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_network/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_network/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_network/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_network/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_network/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_network/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_network/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_network/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_network_stats/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_network_stats/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_network_stats/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_network_stats/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_network_stats/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_network_stats/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_network_stats/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_network_stats/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_network_stats/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_network_stats/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_network_stats/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_network_stats/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_network_stats/mock.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_network_stats/mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/overview_network_stats/mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/overview_network_stats/mock.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/recent_cases/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/recent_cases/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/recent_cases/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/recent_cases/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/recent_timelines/counts/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/recent_timelines/counts/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/recent_timelines/counts/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/recent_timelines/counts/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/recent_timelines/filters/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/recent_timelines/filters/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/recent_timelines/filters/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/recent_timelines/filters/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/recent_timelines/header/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/recent_timelines/header/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/recent_timelines/header/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/recent_timelines/header/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/recent_timelines/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/recent_timelines/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/recent_timelines/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/recent_timelines/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/recent_timelines/recent_timelines.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/recent_timelines/recent_timelines.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/recent_timelines/recent_timelines.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/recent_timelines/recent_timelines.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/recent_timelines/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/recent_timelines/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/recent_timelines/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/recent_timelines/translations.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/recent_timelines/types.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/recent_timelines/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/recent_timelines/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/recent_timelines/types.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/sidebar/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/sidebar/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/sidebar/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/sidebar/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/sidebar/sidebar.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/sidebar/sidebar.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/sidebar/sidebar.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/sidebar/sidebar.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/sidebar/sidebar.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/sidebar/sidebar.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/sidebar/sidebar.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/sidebar/sidebar.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/signals_by_category/index.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/signals_by_category/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/signals_by_category/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/signals_by_category/index.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/signals_by_category/signals_by_category.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/signals_by_category/signals_by_category.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/signals_by_category/signals_by_category.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/signals_by_category/signals_by_category.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/signals_by_category/signals_by_category.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/signals_by_category/signals_by_category.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/signals_by_category/signals_by_category.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/signals_by_category/signals_by_category.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/signals_by_category/use_filters_for_signals_by_category.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/signals_by_category/use_filters_for_signals_by_category.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/signals_by_category/use_filters_for_signals_by_category.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/signals_by_category/use_filters_for_signals_by_category.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/stat_value.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/stat_value.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/stat_value.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/stat_value.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/translations.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/types.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/types.ts diff --git a/x-pack/plugins/security_solution/public/overview/components/user_overview/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/overview/components/user_overview/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/user_overview/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/user_overview/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/overview/components/user_overview/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/user_overview/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/user_overview/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/user_overview/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/user_overview/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/components/user_overview/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/user_overview/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/user_overview/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/components/user_overview/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/components/user_overview/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/components/user_overview/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/components/user_overview/translations.ts diff --git a/x-pack/plugins/security_solution/public/overview/containers/overview_cti_links/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_cti_links/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/containers/overview_cti_links/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_cti_links/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/containers/overview_cti_links/use_all_ti_data_sources.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_cti_links/use_all_ti_data_sources.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/containers/overview_cti_links/use_all_ti_data_sources.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_cti_links/use_all_ti_data_sources.ts diff --git a/x-pack/plugins/security_solution/public/overview/containers/overview_cti_links/use_ti_data_sources.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_cti_links/use_ti_data_sources.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/containers/overview_cti_links/use_ti_data_sources.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_cti_links/use_ti_data_sources.ts diff --git a/x-pack/plugins/security_solution/public/overview/containers/overview_host/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_host/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/containers/overview_host/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_host/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/containers/overview_host/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_host/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/containers/overview_host/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_host/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/containers/overview_host/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_host/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/containers/overview_host/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_host/translations.ts diff --git a/x-pack/plugins/security_solution/public/overview/containers/overview_network/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_network/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/containers/overview_network/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_network/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/containers/overview_network/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_network/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/containers/overview_network/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_network/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/containers/overview_network/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_network/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/containers/overview_network/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/containers/overview_network/translations.ts diff --git a/x-pack/plugins/security_solution/public/overview/index.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/overview/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/overview/jest.config.js new file mode 100644 index 0000000000000..b7348132cd6af --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/overview/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/overview'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/overview', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/overview/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/overview/links.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/links.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/links.ts diff --git a/x-pack/plugins/security_solution/public/overview/pages/data_quality.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/pages/data_quality.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/pages/data_quality.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/pages/data_quality.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/pages/data_quality.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/pages/data_quality.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/pages/data_quality.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/pages/data_quality.tsx diff --git a/x-pack/plugins/security_solution/public/overview/pages/detection_response.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/pages/detection_response.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/pages/detection_response.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/pages/detection_response.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/pages/detection_response.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/pages/detection_response.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/pages/detection_response.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/pages/detection_response.tsx diff --git a/x-pack/plugins/security_solution/public/overview/pages/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/pages/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/pages/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/pages/index.tsx diff --git a/x-pack/plugins/security_solution/public/overview/pages/overview.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/pages/overview.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/pages/overview.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/pages/overview.test.tsx diff --git a/x-pack/plugins/security_solution/public/overview/pages/overview.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/pages/overview.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/pages/overview.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/pages/overview.tsx diff --git a/x-pack/plugins/security_solution/public/overview/pages/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/overview/pages/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/overview/pages/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/overview/pages/translations.ts diff --git a/x-pack/plugins/security_solution/public/overview/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/overview/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/overview/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/overview/routes.tsx diff --git a/x-pack/plugins/security_solution/public/plugin.tsx b/x-pack/solutions/security/plugins/security_solution/public/plugin.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/plugin.tsx rename to x-pack/solutions/security/plugins/security_solution/public/plugin.tsx diff --git a/x-pack/plugins/security_solution/public/plugin_contract.ts b/x-pack/solutions/security/plugins/security_solution/public/plugin_contract.ts similarity index 100% rename from x-pack/plugins/security_solution/public/plugin_contract.ts rename to x-pack/solutions/security/plugins/security_solution/public/plugin_contract.ts diff --git a/x-pack/plugins/security_solution/public/plugin_services.ts b/x-pack/solutions/security/plugins/security_solution/public/plugin_services.ts similarity index 100% rename from x-pack/plugins/security_solution/public/plugin_services.ts rename to x-pack/solutions/security/plugins/security_solution/public/plugin_services.ts diff --git a/x-pack/plugins/security_solution/public/resolver/data_access_layer/factory.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/data_access_layer/factory.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/data_access_layer/factory.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/data_access_layer/factory.ts diff --git a/x-pack/plugins/security_solution/public/resolver/data_access_layer/mocks/emptify_mock.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/data_access_layer/mocks/emptify_mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/data_access_layer/mocks/emptify_mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/data_access_layer/mocks/emptify_mock.ts diff --git a/x-pack/plugins/security_solution/public/resolver/data_access_layer/mocks/generator_tree.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/data_access_layer/mocks/generator_tree.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/data_access_layer/mocks/generator_tree.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/data_access_layer/mocks/generator_tree.ts diff --git a/x-pack/plugins/security_solution/public/resolver/data_access_layer/mocks/no_ancestors_two_children.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/data_access_layer/mocks/no_ancestors_two_children.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/data_access_layer/mocks/no_ancestors_two_children.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/data_access_layer/mocks/no_ancestors_two_children.ts diff --git a/x-pack/plugins/security_solution/public/resolver/data_access_layer/mocks/no_ancestors_two_children_in_index_called_awesome_index.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/data_access_layer/mocks/no_ancestors_two_children_in_index_called_awesome_index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/data_access_layer/mocks/no_ancestors_two_children_in_index_called_awesome_index.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/data_access_layer/mocks/no_ancestors_two_children_in_index_called_awesome_index.ts diff --git a/x-pack/plugins/security_solution/public/resolver/data_access_layer/mocks/no_ancestors_two_children_with_related_events_on_origin.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/data_access_layer/mocks/no_ancestors_two_children_with_related_events_on_origin.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/data_access_layer/mocks/no_ancestors_two_children_with_related_events_on_origin.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/data_access_layer/mocks/no_ancestors_two_children_with_related_events_on_origin.ts diff --git a/x-pack/plugins/security_solution/public/resolver/data_access_layer/mocks/one_node_with_paginated_related_events.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/data_access_layer/mocks/one_node_with_paginated_related_events.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/data_access_layer/mocks/one_node_with_paginated_related_events.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/data_access_layer/mocks/one_node_with_paginated_related_events.ts diff --git a/x-pack/plugins/security_solution/public/resolver/data_access_layer/mocks/pausify_mock.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/data_access_layer/mocks/pausify_mock.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/data_access_layer/mocks/pausify_mock.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/data_access_layer/mocks/pausify_mock.ts diff --git a/x-pack/plugins/security_solution/public/resolver/documentation/camera.md b/x-pack/solutions/security/plugins/security_solution/public/resolver/documentation/camera.md similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/documentation/camera.md rename to x-pack/solutions/security/plugins/security_solution/public/resolver/documentation/camera.md diff --git a/x-pack/plugins/security_solution/public/resolver/documentation/loading_node_data.md b/x-pack/solutions/security/plugins/security_solution/public/resolver/documentation/loading_node_data.md similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/documentation/loading_node_data.md rename to x-pack/solutions/security/plugins/security_solution/public/resolver/documentation/loading_node_data.md diff --git a/x-pack/plugins/security_solution/public/resolver/documentation/schema.md b/x-pack/solutions/security/plugins/security_solution/public/resolver/documentation/schema.md similarity index 95% rename from x-pack/plugins/security_solution/public/resolver/documentation/schema.md rename to x-pack/solutions/security/plugins/security_solution/public/resolver/documentation/schema.md index 61b923d25d3e3..30149ec218f9c 100644 --- a/x-pack/plugins/security_solution/public/resolver/documentation/schema.md +++ b/x-pack/solutions/security/plugins/security_solution/public/resolver/documentation/schema.md @@ -12,7 +12,7 @@ for the elastic endpoint and winlogbeat's sysmon data. ## Schema Format -The predefined schemas are located here <https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/endpoint/routes/resolver/entity.ts#L34> +The predefined schemas are located here <https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/entity.ts#L34> ```typescript const supportedSchemas: SupportedSchema[] = [ diff --git a/x-pack/plugins/security_solution/public/resolver/index.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/resolver/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/resolver/jest.config.js new file mode 100644 index 0000000000000..20362b9254459 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/resolver/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/resolver'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/resolver', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/resolver/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/resolver/lib/date.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/lib/date.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/lib/date.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/lib/date.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/lib/date.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/lib/date.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/lib/date.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/lib/date.ts diff --git a/x-pack/plugins/security_solution/public/resolver/lib/math.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/lib/math.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/lib/math.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/lib/math.ts diff --git a/x-pack/plugins/security_solution/public/resolver/lib/transformation.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/lib/transformation.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/lib/transformation.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/lib/transformation.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/lib/transformation.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/lib/transformation.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/lib/transformation.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/lib/transformation.ts diff --git a/x-pack/plugins/security_solution/public/resolver/lib/tree_sequencers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/lib/tree_sequencers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/lib/tree_sequencers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/lib/tree_sequencers.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/lib/tree_sequencers.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/lib/tree_sequencers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/lib/tree_sequencers.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/lib/tree_sequencers.ts diff --git a/x-pack/plugins/security_solution/public/resolver/mocks/endpoint_event.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/mocks/endpoint_event.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/mocks/endpoint_event.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/mocks/endpoint_event.ts diff --git a/x-pack/plugins/security_solution/public/resolver/mocks/generator.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/mocks/generator.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/mocks/generator.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/mocks/generator.ts diff --git a/x-pack/plugins/security_solution/public/resolver/mocks/resolver_node.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/mocks/resolver_node.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/mocks/resolver_node.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/mocks/resolver_node.ts diff --git a/x-pack/plugins/security_solution/public/resolver/mocks/resolver_tree.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/mocks/resolver_tree.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/mocks/resolver_tree.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/mocks/resolver_tree.ts diff --git a/x-pack/plugins/security_solution/public/resolver/mocks/tree_fetcher_parameters.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/mocks/tree_fetcher_parameters.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/mocks/tree_fetcher_parameters.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/mocks/tree_fetcher_parameters.ts diff --git a/x-pack/plugins/security_solution/public/resolver/mocks/tree_schema.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/mocks/tree_schema.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/mocks/tree_schema.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/mocks/tree_schema.ts diff --git a/x-pack/plugins/security_solution/public/resolver/mocks/ui_setting.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/mocks/ui_setting.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/mocks/ui_setting.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/mocks/ui_setting.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/aabb.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/aabb.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/aabb.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/aabb.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/aabb.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/aabb.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/aabb.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/aabb.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/__snapshots__/isometric_taxi_layout.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/indexed_process_tree/__snapshots__/isometric_taxi_layout.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/__snapshots__/isometric_taxi_layout.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/indexed_process_tree/__snapshots__/isometric_taxi_layout.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/indexed_process_tree/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/indexed_process_tree/index.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/index.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/indexed_process_tree/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/indexed_process_tree/index.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/isometric_taxi_layout.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/indexed_process_tree/isometric_taxi_layout.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/isometric_taxi_layout.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/indexed_process_tree/isometric_taxi_layout.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/isometric_taxi_layout.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/indexed_process_tree/isometric_taxi_layout.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/indexed_process_tree/isometric_taxi_layout.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/indexed_process_tree/isometric_taxi_layout.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/location_search.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/location_search.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/location_search.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/location_search.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/matrix3.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/matrix3.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/matrix3.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/matrix3.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/matrix3.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/matrix3.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/matrix3.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/matrix3.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/node_data.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/node_data.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/node_data.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/node_data.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/node_data.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/node_data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/node_data.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/node_data.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/process_event.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/process_event.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/process_event.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/process_event.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/process_event.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/process_event.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/process_event.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/process_event.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/process_event_test_helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/process_event_test_helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/process_event_test_helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/process_event_test_helpers.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/resolver_tree.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/resolver_tree.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/resolver_tree.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/resolver_tree.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/schema.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/schema.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/schema.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/schema.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/schema.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/schema.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/schema.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/schema.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/time_range.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/time_range.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/time_range.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/time_range.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/time_range.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/time_range.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/time_range.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/time_range.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/tree_fetcher_parameters.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/tree_fetcher_parameters.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/tree_fetcher_parameters.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/tree_fetcher_parameters.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/tree_fetcher_parameters.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/tree_fetcher_parameters.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/tree_fetcher_parameters.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/tree_fetcher_parameters.ts diff --git a/x-pack/plugins/security_solution/public/resolver/models/vector2.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/models/vector2.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/models/vector2.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/models/vector2.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/actions.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/actions.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/camera/action.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/action.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/camera/action.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/action.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/camera/animation.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/animation.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/camera/animation.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/animation.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/camera/index.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/camera/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/index.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/camera/inverse_projection_matrix.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/inverse_projection_matrix.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/camera/inverse_projection_matrix.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/inverse_projection_matrix.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/camera/methods.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/methods.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/camera/methods.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/methods.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/camera/panning.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/panning.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/camera/panning.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/panning.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/camera/projection_matrix.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/projection_matrix.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/camera/projection_matrix.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/projection_matrix.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/camera/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/camera/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/reducer.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/camera/scale_to_zoom.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/scale_to_zoom.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/camera/scale_to_zoom.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/scale_to_zoom.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/camera/scaling_constants.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/scaling_constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/camera/scaling_constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/scaling_constants.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/camera/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/camera/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/selectors.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/camera/test_helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/test_helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/camera/test_helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/test_helpers.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/camera/zooming.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/zooming.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/camera/zooming.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/camera/zooming.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/data/action.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/data/action.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/data/action.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/data/action.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/data/node_events_in_category_model.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/data/node_events_in_category_model.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/data/node_events_in_category_model.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/data/node_events_in_category_model.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/data/reducer.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/data/reducer.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/data/reducer.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/data/reducer.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/data/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/data/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/data/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/data/reducer.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/data/selectors.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/data/selectors.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/data/selectors.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/data/selectors.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/data/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/data/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/data/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/data/selectors.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/data/visible_entities.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/data/visible_entities.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/data/visible_entities.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/data/visible_entities.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/helpers.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/index.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/index.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/middleware/current_related_event_fetcher.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/middleware/current_related_event_fetcher.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/middleware/current_related_event_fetcher.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/middleware/current_related_event_fetcher.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/middleware/index.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/middleware/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/middleware/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/middleware/index.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/middleware/node_data_fetcher.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/middleware/node_data_fetcher.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/middleware/node_data_fetcher.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/middleware/node_data_fetcher.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/middleware/related_events_fetcher.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/middleware/related_events_fetcher.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/middleware/related_events_fetcher.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/middleware/related_events_fetcher.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/middleware/resolver_tree_fetcher.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/middleware/resolver_tree_fetcher.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/middleware/resolver_tree_fetcher.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/middleware/resolver_tree_fetcher.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/panel_view_and_parameters.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/panel_view_and_parameters.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/panel_view_and_parameters.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/panel_view_and_parameters.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/parameter_name.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/parameter_name.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/parameter_name.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/parameter_name.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/reducer.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/selectors.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/selectors.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/selectors.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/selectors.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/selectors.ts diff --git a/x-pack/plugins/security_solution/public/resolver/store/ui/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/store/ui/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/store/ui/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/store/ui/selectors.ts diff --git a/x-pack/plugins/security_solution/public/resolver/test_utilities/extend_jest.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/test_utilities/extend_jest.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/test_utilities/extend_jest.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/test_utilities/extend_jest.ts diff --git a/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/test_utilities/simulator/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/test_utilities/simulator/index.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/mock_resolver.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/test_utilities/simulator/mock_resolver.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/test_utilities/simulator/mock_resolver.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/test_utilities/simulator/mock_resolver.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/test_utilities/spy_middleware_factory.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/test_utilities/spy_middleware_factory.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/test_utilities/spy_middleware_factory.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/test_utilities/spy_middleware_factory.ts diff --git a/x-pack/plugins/security_solution/public/resolver/test_utilities/url_search.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/test_utilities/url_search.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/test_utilities/url_search.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/test_utilities/url_search.ts diff --git a/x-pack/plugins/security_solution/public/resolver/types.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/types.ts diff --git a/x-pack/plugins/security_solution/public/resolver/view/clickthrough.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/clickthrough.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/clickthrough.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/clickthrough.test.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/controls/date_picker.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/controls/date_picker.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/controls/date_picker.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/controls/date_picker.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/controls/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/controls/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/controls/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/controls/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/controls/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/controls/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/controls/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/controls/index.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/controls/legend.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/controls/legend.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/controls/legend.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/controls/legend.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/controls/schema.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/controls/schema.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/controls/schema.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/controls/schema.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/controls/show_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/controls/show_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/controls/show_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/controls/show_panel.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/controls/sourcerer_selection.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/controls/sourcerer_selection.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/controls/sourcerer_selection.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/controls/sourcerer_selection.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/controls/styles.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/controls/styles.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/controls/styles.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/controls/styles.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/details_panel.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/details_panel.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/details_panel.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/details_panel.test.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/details_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/details_panel.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/details_panel.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/details_panel.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/edge_line.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/edge_line.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/edge_line.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/edge_line.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/font_size.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/font_size.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/font_size.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/font_size.ts diff --git a/x-pack/plugins/security_solution/public/resolver/view/generated_text.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/generated_text.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/generated_text.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/generated_text.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/index.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/limit_warnings.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/limit_warnings.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/limit_warnings.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/limit_warnings.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/node.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/node.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/node.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/node.test.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/panel.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/panel.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/panel.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/panel.test.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/breadcrumbs.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/breadcrumbs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/panels/breadcrumbs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/breadcrumbs.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/cube_for_process.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/cube_for_process.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/panels/cube_for_process.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/cube_for_process.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/deep_object_entries.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/deep_object_entries.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/panels/deep_object_entries.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/deep_object_entries.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/deep_object_entries.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/deep_object_entries.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/panels/deep_object_entries.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/deep_object_entries.ts diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/descriptive_name.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/descriptive_name.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/panels/descriptive_name.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/descriptive_name.test.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/descriptive_name.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/descriptive_name.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/panels/descriptive_name.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/descriptive_name.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/event_detail.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/event_detail.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/panels/event_detail.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/event_detail.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/panels/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/index.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/node_detail.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/node_detail.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/panels/node_detail.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/node_detail.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/node_events.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/node_events.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/panels/node_events.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/node_events.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/node_events_of_type.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/node_events_of_type.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/panels/node_events_of_type.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/node_events_of_type.test.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/node_events_of_type.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/node_events_of_type.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/panels/node_events_of_type.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/node_events_of_type.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/node_list.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/node_list.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/panels/node_list.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/node_list.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/panel_content_error.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/panel_content_error.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/panels/panel_content_error.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/panel_content_error.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/panel_loading.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/panel_loading.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/panels/panel_loading.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/panel_loading.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/panel_states.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/panel_states.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/panels/panel_states.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/panel_states.test.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/styles.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/styles.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/panels/styles.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/styles.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/use_formatted_date.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/use_formatted_date.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/panels/use_formatted_date.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/use_formatted_date.test.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/panels/use_formatted_date.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/use_formatted_date.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/panels/use_formatted_date.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/panels/use_formatted_date.ts diff --git a/x-pack/plugins/security_solution/public/resolver/view/process_event_dot.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/process_event_dot.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/process_event_dot.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/process_event_dot.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/query_params.test.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/query_params.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/query_params.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/query_params.test.ts diff --git a/x-pack/plugins/security_solution/public/resolver/view/resolver_loading_state.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/resolver_loading_state.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/resolver_loading_state.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/resolver_loading_state.test.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/resolver_no_process_events.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/resolver_no_process_events.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/resolver_no_process_events.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/resolver_no_process_events.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/resolver_without_providers.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/resolver_without_providers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/resolver_without_providers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/resolver_without_providers.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/side_effect_context.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/side_effect_context.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/side_effect_context.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/side_effect_context.ts diff --git a/x-pack/plugins/security_solution/public/resolver/view/side_effect_simulator_factory.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/side_effect_simulator_factory.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/side_effect_simulator_factory.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/side_effect_simulator_factory.ts diff --git a/x-pack/plugins/security_solution/public/resolver/view/styles.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/styles.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/styles.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/styles.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/submenu.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/submenu.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/submenu.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/submenu.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/symbol_definitions.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/symbol_definitions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/symbol_definitions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/symbol_definitions.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/use_autotune_timerange.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_autotune_timerange.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/use_autotune_timerange.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_autotune_timerange.ts diff --git a/x-pack/plugins/security_solution/public/resolver/view/use_camera.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_camera.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/use_camera.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_camera.test.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/use_camera.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_camera.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/use_camera.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_camera.ts diff --git a/x-pack/plugins/security_solution/public/resolver/view/use_colors.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_colors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/use_colors.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_colors.ts diff --git a/x-pack/plugins/security_solution/public/resolver/view/use_cube_assets.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_cube_assets.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/use_cube_assets.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_cube_assets.ts diff --git a/x-pack/plugins/security_solution/public/resolver/view/use_link_props.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_link_props.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/use_link_props.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_link_props.ts diff --git a/x-pack/plugins/security_solution/public/resolver/view/use_navigate_or_replace.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_navigate_or_replace.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/use_navigate_or_replace.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_navigate_or_replace.ts diff --git a/x-pack/plugins/security_solution/public/resolver/view/use_paint_server_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_paint_server_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/use_paint_server_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_paint_server_ids.ts diff --git a/x-pack/plugins/security_solution/public/resolver/view/use_resolver_query_params_cleaner.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_resolver_query_params_cleaner.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/use_resolver_query_params_cleaner.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_resolver_query_params_cleaner.ts diff --git a/x-pack/plugins/security_solution/public/resolver/view/use_state_syncing_actions.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_state_syncing_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/use_state_syncing_actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_state_syncing_actions.ts diff --git a/x-pack/plugins/security_solution/public/resolver/view/use_symbol_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_symbol_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/use_symbol_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_symbol_ids.ts diff --git a/x-pack/plugins/security_solution/public/resolver/view/use_sync_selected_node.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_sync_selected_node.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/use_sync_selected_node.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_sync_selected_node.test.tsx diff --git a/x-pack/plugins/security_solution/public/resolver/view/use_sync_selected_node.ts b/x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_sync_selected_node.ts similarity index 100% rename from x-pack/plugins/security_solution/public/resolver/view/use_sync_selected_node.ts rename to x-pack/solutions/security/plugins/security_solution/public/resolver/view/use_sync_selected_node.ts diff --git a/x-pack/plugins/security_solution/public/rules/index.ts b/x-pack/solutions/security/plugins/security_solution/public/rules/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/rules/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/rules/index.ts diff --git a/x-pack/plugins/security_solution/public/rules/landing.tsx b/x-pack/solutions/security/plugins/security_solution/public/rules/landing.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/rules/landing.tsx rename to x-pack/solutions/security/plugins/security_solution/public/rules/landing.tsx diff --git a/x-pack/plugins/security_solution/public/rules/links.ts b/x-pack/solutions/security/plugins/security_solution/public/rules/links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/rules/links.ts rename to x-pack/solutions/security/plugins/security_solution/public/rules/links.ts diff --git a/x-pack/plugins/security_solution/public/rules/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/rules/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/rules/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/rules/routes.tsx diff --git a/x-pack/plugins/security_solution/public/rules/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/rules/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/rules/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/rules/translations.ts diff --git a/x-pack/plugins/security_solution/public/security_integrations/cribl/api/api.ts b/x-pack/solutions/security/plugins/security_solution/public/security_integrations/cribl/api/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/security_integrations/cribl/api/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/security_integrations/cribl/api/api.ts diff --git a/x-pack/plugins/security_solution/public/security_integrations/cribl/components/custom_cribl_form.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/security_integrations/cribl/components/custom_cribl_form.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/security_integrations/cribl/components/custom_cribl_form.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/security_integrations/cribl/components/custom_cribl_form.test.tsx diff --git a/x-pack/plugins/security_solution/public/security_integrations/cribl/components/custom_cribl_form.tsx b/x-pack/solutions/security/plugins/security_solution/public/security_integrations/cribl/components/custom_cribl_form.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/security_integrations/cribl/components/custom_cribl_form.tsx rename to x-pack/solutions/security/plugins/security_solution/public/security_integrations/cribl/components/custom_cribl_form.tsx diff --git a/x-pack/plugins/security_solution/public/security_integrations/cribl/components/lazy_custom_cribl_extension.tsx b/x-pack/solutions/security/plugins/security_solution/public/security_integrations/cribl/components/lazy_custom_cribl_extension.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/security_integrations/cribl/components/lazy_custom_cribl_extension.tsx rename to x-pack/solutions/security/plugins/security_solution/public/security_integrations/cribl/components/lazy_custom_cribl_extension.tsx diff --git a/x-pack/plugins/security_solution/public/security_integrations/cribl/components/util/validator.test.ts b/x-pack/solutions/security/plugins/security_solution/public/security_integrations/cribl/components/util/validator.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/security_integrations/cribl/components/util/validator.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/security_integrations/cribl/components/util/validator.test.ts diff --git a/x-pack/plugins/security_solution/public/security_integrations/cribl/components/util/validator.ts b/x-pack/solutions/security/plugins/security_solution/public/security_integrations/cribl/components/util/validator.ts similarity index 100% rename from x-pack/plugins/security_solution/public/security_integrations/cribl/components/util/validator.ts rename to x-pack/solutions/security/plugins/security_solution/public/security_integrations/cribl/components/util/validator.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/security_integrations/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/security_integrations/jest.config.js new file mode 100644 index 0000000000000..f71f00e8dfd4f --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/security_integrations/jest.config.js @@ -0,0 +1,21 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/security_integrations', + ], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/security_integrations', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/security_integrations/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/shared_imports.ts b/x-pack/solutions/security/plugins/security_solution/public/shared_imports.ts similarity index 100% rename from x-pack/plugins/security_solution/public/shared_imports.ts rename to x-pack/solutions/security/plugins/security_solution/public/shared_imports.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/common/icon/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/common/icon/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/common/icon/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/common/icon/index.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/common/icon/siem_migrations.svg b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/common/icon/siem_migrations.svg similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/common/icon/siem_migrations.svg rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/common/icon/siem_migrations.svg diff --git a/x-pack/plugins/security_solution/public/siem_migrations/index.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/jest.config.js new file mode 100644 index 0000000000000..f3adf88b73019 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/siem_migrations'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/siem_migrations', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/links.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/links.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/links.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/routes.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/api/index.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/api/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/api/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/api/index.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/constants.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/context.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/context.tsx new file mode 100644 index 0000000000000..bc37df49415c0 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/context.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, { createContext, useContext, useMemo, type PropsWithChildren } from 'react'; +import type { RuleMigrationTaskStats } from '../../../../../common/siem_migrations/model/rule_migration.gen'; + +interface RuleMigrationDataInputContextValue { + openFlyout: (migrationStats?: RuleMigrationTaskStats) => void; + closeFlyout: () => void; +} + +const RuleMigrationDataInputContext = createContext<RuleMigrationDataInputContextValue | null>( + null +); + +export const RuleMigrationDataInputContextProvider: React.FC< + PropsWithChildren<RuleMigrationDataInputContextValue> +> = React.memo(({ children, openFlyout, closeFlyout }) => { + const value = useMemo<RuleMigrationDataInputContextValue>( + () => ({ openFlyout, closeFlyout }), + [openFlyout, closeFlyout] + ); + return ( + <RuleMigrationDataInputContext.Provider value={value}> + {children} + </RuleMigrationDataInputContext.Provider> + ); +}); +RuleMigrationDataInputContextProvider.displayName = 'RuleMigrationDataInputContextProvider'; + +export const useRuleMigrationDataInputContext = (): RuleMigrationDataInputContextValue => { + const context = useContext(RuleMigrationDataInputContext); + if (context == null) { + throw new Error( + 'useRuleMigrationDataInputContext must be used within a RuleMigrationDataInputContextProvider' + ); + } + return context; +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/data_input_flyout.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/data_input_flyout.tsx similarity index 89% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/data_input_flyout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/data_input_flyout.tsx index ffc40c59d495a..9062e3a6b21e8 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/data_input_flyout.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/data_input_flyout.tsx @@ -15,6 +15,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiButton, + EuiButtonEmpty, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import type { @@ -23,8 +24,9 @@ import type { } from '../../../../../common/siem_migrations/model/rule_migration.gen'; import { RulesDataInput } from './steps/rules/rules_data_input'; import { useStartMigration } from '../../service/hooks/use_start_migration'; -import { DataInputStep } from './types'; +import { DataInputStep } from './steps/constants'; import { MacrosDataInput } from './steps/macros/macros_data_input'; +import { LookupsDataInput } from './steps/lookups/lookups_data_input'; interface MissingResourcesIndexed { macros: string[]; @@ -84,8 +86,8 @@ export const MigrationDataInputFlyout = React.memo<MigrationDataInputFlyoutProps [] ); - const onMacrosCreated = useCallback(() => { - setDataInputStep(DataInputStep.Lookups); + const onAllLookupsCreated = useCallback(() => { + setDataInputStep(DataInputStep.End); }, []); return ( @@ -121,21 +123,28 @@ export const MigrationDataInputFlyout = React.memo<MigrationDataInputFlyoutProps dataInputStep={dataInputStep} missingMacros={missingResourcesIndexed?.macros} migrationStats={migrationStats} - onMacrosCreated={onMacrosCreated} onMissingResourcesFetched={onMissingResourcesFetched} /> </EuiFlexItem> + <EuiFlexItem> + <LookupsDataInput + dataInputStep={dataInputStep} + missingLookups={missingResourcesIndexed?.lookups} + migrationStats={migrationStats} + onAllLookupsCreated={onAllLookupsCreated} + /> + </EuiFlexItem> </EuiFlexGroup> </EuiFlyoutBody> <EuiFlyoutFooter> <EuiFlexGroup justifyContent="spaceBetween"> <EuiFlexItem grow={false}> - <EuiButton fill onClick={onClose}> + <EuiButtonEmpty onClick={onClose}> <FormattedMessage id="xpack.securitySolution.siemMigrations.rules.dataInputFlyout.closeButton" defaultMessage="Close" /> - </EuiButton> + </EuiButtonEmpty> </EuiFlexItem> <EuiFlexItem grow={false}> <EuiButton diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/data_input_wrapper.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/data_input_wrapper.tsx new file mode 100644 index 0000000000000..e1adf10816006 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/data_input_wrapper.tsx @@ -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 type { PropsWithChildren } from 'react'; +import React, { useCallback, useState } from 'react'; +import type { RuleMigrationTaskStats } from '../../../../../common/siem_migrations/model/rule_migration.gen'; +import { RuleMigrationDataInputContextProvider } from './context'; +import { MigrationDataInputFlyout } from './data_input_flyout'; + +interface RuleMigrationDataInputWrapperProps { + onFlyoutClosed: () => void; +} +export const RuleMigrationDataInputWrapper = React.memo< + PropsWithChildren<RuleMigrationDataInputWrapperProps> +>(({ children, onFlyoutClosed }) => { + const [isFlyoutOpen, setIsFlyoutOpen] = useState<boolean>(); + const [flyoutMigrationStats, setFlyoutMigrationStats] = useState< + RuleMigrationTaskStats | undefined + >(); + + const closeFlyout = useCallback(() => { + setIsFlyoutOpen(false); + setFlyoutMigrationStats(undefined); + onFlyoutClosed?.(); + }, [onFlyoutClosed]); + + const openFlyout = useCallback((migrationStats?: RuleMigrationTaskStats) => { + setFlyoutMigrationStats(migrationStats); + setIsFlyoutOpen(true); + }, []); + + return ( + <RuleMigrationDataInputContextProvider openFlyout={openFlyout} closeFlyout={closeFlyout}> + {children} + {isFlyoutOpen && ( + <MigrationDataInputFlyout onClose={closeFlyout} migrationStats={flyoutMigrationStats} /> + )} + </RuleMigrationDataInputContextProvider> + ); +}); +RuleMigrationDataInputWrapper.displayName = 'RuleMigrationDataInputWrapper'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/index.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/index.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/get_status.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/get_status.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/get_status.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/get_status.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/sub_step.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/sub_step.tsx new file mode 100644 index 0000000000000..bb76ea749e15a --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/sub_step.tsx @@ -0,0 +1,25 @@ +/* + * 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 { EuiPanel, EuiSteps, type EuiStepProps } from '@elastic/eui'; +import { css } from '@emotion/css'; +import React from 'react'; + +const style = css` + .euiStep__title { + font-size: 14px; + } +`; + +export const SubSteps = React.memo<{ steps: EuiStepProps[] }>(({ steps }) => { + return ( + <EuiPanel hasShadow={false} paddingSize="xs" className={style}> + <EuiSteps titleSize="xxs" steps={steps} /> + </EuiPanel> + ); +}); +SubSteps.displayName = 'SubSteps'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/use_parse_file_input.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/use_parse_file_input.ts similarity index 97% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/use_parse_file_input.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/use_parse_file_input.ts index b99cf826194f9..54622191b6d68 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/use_parse_file_input.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/use_parse_file_input.ts @@ -26,7 +26,7 @@ export const useParseFileInput = (onFileParsed: OnFileParsed) => { setError(undefined); - const rulesFile = files[0]; + const file = files[0]; const reader = new FileReader(); reader.onloadstart = () => setIsParsing(true); @@ -68,7 +68,7 @@ export const useParseFileInput = (onFileParsed: OnFileParsed) => { reader.onerror = handleReaderError; reader.onabort = handleReaderError; - reader.readAsText(rulesFile); + reader.readAsText(file); }, [onFileParsed] ); diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/constants.ts new file mode 100644 index 0000000000000..c0586108b0a19 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/constants.ts @@ -0,0 +1,13 @@ +/* + * 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. + */ + +export enum DataInputStep { + Rules = 1, + Macros = 2, + Lookups = 3, + End = 10, +} diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/lookups_data_input.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/lookups_data_input.tsx new file mode 100644 index 0000000000000..a8fca750ce5da --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/lookups_data_input.tsx @@ -0,0 +1,143 @@ +/* + * 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 { EuiStepProps } from '@elastic/eui'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiPanel, + EuiStepNumber, + EuiText, + EuiTitle, +} from '@elastic/eui'; +import React, { useCallback, useEffect, useMemo, useState } from 'react'; +import { EMPTY_RESOURCE_PLACEHOLDER } from '../../../../../../../common/siem_migrations/constants'; +import type { + RuleMigrationResourceData, + RuleMigrationTaskStats, +} from '../../../../../../../common/siem_migrations/model/rule_migration.gen'; +import type { OnResourcesCreated } from '../../types'; +import { getStatus } from '../common/get_status'; +import * as i18n from './translations'; +import { DataInputStep } from '../constants'; +import { SubSteps } from '../common/sub_step'; +import { useMissingLookupsListStep } from './sub_steps/missing_lookups_list'; +import { useLookupsFileUploadStep } from './sub_steps/lookups_file_upload'; + +export type UploadedLookups = Record<string, string>; +export type AddUploadedLookups = (lookups: RuleMigrationResourceData[]) => void; + +interface LookupsDataInputSubStepsProps { + migrationStats: RuleMigrationTaskStats; + missingLookups: string[]; + onAllLookupsCreated: OnResourcesCreated; +} +interface LookupsDataInputProps + extends Omit<LookupsDataInputSubStepsProps, 'migrationStats' | 'missingLookups'> { + dataInputStep: DataInputStep; + migrationStats?: RuleMigrationTaskStats; + missingLookups?: string[]; +} +export const LookupsDataInput = React.memo<LookupsDataInputProps>( + ({ dataInputStep, migrationStats, missingLookups, onAllLookupsCreated }) => { + const dataInputStatus = useMemo( + () => getStatus(DataInputStep.Lookups, dataInputStep), + [dataInputStep] + ); + + return ( + <EuiPanel hasShadow={false} hasBorder> + <EuiFlexGroup direction="column"> + <EuiFlexItem> + <EuiFlexGroup direction="row" justifyContent="center" gutterSize="m"> + <EuiFlexItem grow={false}> + <EuiStepNumber + titleSize="xs" + number={DataInputStep.Lookups} + status={dataInputStatus} + /> + </EuiFlexItem> + <EuiFlexItem> + <EuiTitle size="xs"> + <b>{i18n.LOOKUPS_DATA_INPUT_TITLE}</b> + </EuiTitle> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + {dataInputStatus === 'current' && migrationStats && missingLookups && ( + <> + <EuiFlexItem> + <EuiText size="s" color="subdued"> + {i18n.LOOKUPS_DATA_INPUT_DESCRIPTION} + </EuiText> + </EuiFlexItem> + <EuiFlexItem> + <LookupsDataInputSubSteps + migrationStats={migrationStats} + missingLookups={missingLookups} + onAllLookupsCreated={onAllLookupsCreated} + /> + </EuiFlexItem> + </> + )} + </EuiFlexGroup> + </EuiPanel> + ); + } +); +LookupsDataInput.displayName = 'LookupsDataInput'; + +const END = 10 as const; +type SubStep = 1 | 2 | typeof END; +export const LookupsDataInputSubSteps = React.memo<LookupsDataInputSubStepsProps>( + ({ migrationStats, missingLookups, onAllLookupsCreated }) => { + const [subStep, setSubStep] = useState<SubStep>(1); + const [uploadedLookups, setUploadedLookups] = useState<UploadedLookups>({}); + + const addUploadedLookups = useCallback<AddUploadedLookups>((lookups) => { + setUploadedLookups((prevUploadedLookups) => ({ + ...prevUploadedLookups, + ...Object.fromEntries( + lookups.map((lookup) => [lookup.name, lookup.content ?? EMPTY_RESOURCE_PLACEHOLDER]) + ), + })); + }, []); + + useEffect(() => { + if (missingLookups.every((lookupName) => uploadedLookups[lookupName])) { + setSubStep(END); + onAllLookupsCreated(); + } + }, [uploadedLookups, missingLookups, onAllLookupsCreated]); + + // Copy query step + const onCopied = useCallback(() => { + setSubStep(2); + }, []); + const copyStep = useMissingLookupsListStep({ + status: getStatus(1, subStep), + migrationStats, + missingLookups, + uploadedLookups, + addUploadedLookups, + onCopied, + }); + + // Upload macros step + const uploadStep = useLookupsFileUploadStep({ + status: getStatus(2, subStep), + migrationStats, + missingLookups, + addUploadedLookups, + }); + + const steps = useMemo<EuiStepProps[]>(() => [copyStep, uploadStep], [copyStep, uploadStep]); + + return <SubSteps steps={steps} />; + } +); +LookupsDataInputSubSteps.displayName = 'LookupsDataInputActive'; diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/sub_steps/lookups_file_upload/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/sub_steps/lookups_file_upload/index.tsx new file mode 100644 index 0000000000000..f15413768b9a7 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/sub_steps/lookups_file_upload/index.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, useMemo } from 'react'; +import type { EuiStepProps, EuiStepStatus } from '@elastic/eui'; +import { useUpsertResources } from '../../../../../../service/hooks/use_upsert_resources'; +import type { + RuleMigrationResourceData, + RuleMigrationTaskStats, +} from '../../../../../../../../../common/siem_migrations/model/rule_migration.gen'; +import type { AddUploadedLookups } from '../../lookups_data_input'; +import * as i18n from './translations'; +import { LookupsFileUpload } from './lookups_file_upload'; + +export interface RulesFileUploadStepProps { + status: EuiStepStatus; + migrationStats: RuleMigrationTaskStats; + missingLookups: string[]; + addUploadedLookups: AddUploadedLookups; +} +export const useLookupsFileUploadStep = ({ + status, + migrationStats, + addUploadedLookups, +}: RulesFileUploadStepProps): EuiStepProps => { + const { upsertResources, isLoading, error } = useUpsertResources(addUploadedLookups); + + const upsertMigrationResources = useCallback( + (lookupsFromFile: RuleMigrationResourceData[]) => { + if (lookupsFromFile.length === 0) { + return; // No lookups provided + } + upsertResources(migrationStats.id, lookupsFromFile); + }, + [upsertResources, migrationStats] + ); + + const uploadStepStatus = useMemo(() => { + if (isLoading) { + return 'loading'; + } + if (error) { + return 'danger'; + } + return status; + }, [isLoading, error, status]); + + return { + title: i18n.LOOKUPS_DATA_INPUT_FILE_UPLOAD_TITLE, + status: uploadStepStatus, + children: ( + <LookupsFileUpload + createResources={upsertMigrationResources} + isLoading={isLoading} + apiError={error?.message} + /> + ), + }; +}; diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/sub_steps/lookups_file_upload/lookups_file_upload.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/sub_steps/lookups_file_upload/lookups_file_upload.tsx new file mode 100644 index 0000000000000..6ea9562f24cce --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/sub_steps/lookups_file_upload/lookups_file_upload.tsx @@ -0,0 +1,163 @@ +/* + * 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, useMemo, useRef, useState } from 'react'; +import { + EuiButton, + EuiFilePicker, + EuiFlexGroup, + EuiFlexItem, + EuiFormRow, + EuiText, +} from '@elastic/eui'; +import type { + EuiFilePickerClass, + EuiFilePickerProps, +} from '@elastic/eui/src/components/form/file_picker/file_picker'; +import type { RuleMigrationResourceData } from '../../../../../../../../../common/siem_migrations/model/rule_migration.gen'; +import { FILE_UPLOAD_ERROR } from '../../../../translations'; +import * as i18n from './translations'; + +export interface LookupsFileUploadProps { + createResources: (resources: RuleMigrationResourceData[]) => void; + apiError?: string; + isLoading?: boolean; +} +export const LookupsFileUpload = React.memo<LookupsFileUploadProps>( + ({ createResources, apiError, isLoading }) => { + const [lookupResources, setLookupResources] = useState<RuleMigrationResourceData[]>([]); + const filePickerRef = useRef<EuiFilePickerClass>(null); + + const createLookups = useCallback(() => { + filePickerRef.current?.removeFiles(); + createResources(lookupResources); + }, [createResources, lookupResources]); + + const [isParsing, setIsParsing] = useState<boolean>(false); + const [fileErrors, setErrors] = useState<string[]>([]); + const addError = useCallback((error: string) => { + setErrors((current) => [...current, error]); + }, []); + + const parseFile = useCallback( + async (files: FileList | null) => { + setErrors([]); + setLookupResources([]); + + if (!files?.length) { + return; + } + + const lookups = await Promise.all( + Array.from(files).map((file) => { + return new Promise<RuleMigrationResourceData>((resolve) => { + const reader = new FileReader(); + + reader.onloadstart = () => setIsParsing(true); + reader.onloadend = () => setIsParsing(false); + + reader.onload = function (e) { + // We can safely cast to string since we call `readAsText` to load the file. + const content = e.target?.result as string | undefined; + + if (content == null) { + addError(FILE_UPLOAD_ERROR.CAN_NOT_READ); + return; + } + + if (content === '' && e.loaded > 100000) { + // V8-based browsers can't handle large files and return an empty string + // instead of an error; see https://stackoverflow.com/a/61316641 + addError(FILE_UPLOAD_ERROR.TOO_LARGE_TO_PARSE); + return; + } + + const name = file.name.replace(/\.[^/.]+$/, '').trim(); + resolve({ type: 'list', name, content }); + }; + + const handleReaderError = function () { + const message = reader.error?.message; + if (message) { + addError(FILE_UPLOAD_ERROR.CAN_NOT_READ_WITH_REASON(message)); + } else { + addError(FILE_UPLOAD_ERROR.CAN_NOT_READ); + } + }; + + reader.onerror = handleReaderError; + reader.onabort = handleReaderError; + + reader.readAsText(file); + }); + }) + ).catch((e) => { + addError(e.message); + return []; + }); + // Set the loaded lookups to the state + setLookupResources((current) => [...current, ...lookups]); + }, + [addError] + ); + + const errors = useMemo(() => { + if (apiError) { + return [apiError]; + } + return fileErrors; + }, [apiError, fileErrors]); + + return ( + <EuiFlexGroup direction="column"> + <EuiFlexItem> + <EuiFormRow + helpText={errors.map((error) => ( + <EuiText color="danger" size="xs"> + {error} + </EuiText> + ))} + isInvalid={errors.length > 0} + fullWidth + > + <EuiFilePicker + id="lookupsFilePicker" + ref={filePickerRef as React.Ref<Omit<EuiFilePickerProps, 'stylesMemoizer'>>} + fullWidth + initialPromptText={ + <> + <EuiText size="s" textAlign="center"> + {i18n.LOOKUPS_DATA_INPUT_FILE_UPLOAD_PROMPT} + </EuiText> + </> + } + accept="application/text" + onChange={parseFile} + multiple + display="large" + aria-label="Upload lookups files" + isLoading={isParsing || isLoading} + disabled={isParsing || isLoading} + data-test-subj="lookupsFilePicker" + data-loading={isParsing} + /> + </EuiFormRow> + </EuiFlexItem> + <EuiFlexItem> + <EuiFlexGroup justifyContent="flexEnd" gutterSize="none"> + <EuiFlexItem grow={false}> + <EuiButton onClick={createLookups} isLoading={isLoading} color="success"> + {i18n.LOOKUPS_DATA_INPUT_FILE_UPLOAD_BUTTON} + </EuiButton> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + </EuiFlexGroup> + ); + } +); +LookupsFileUpload.displayName = 'LookupsFileUpload'; diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/sub_steps/lookups_file_upload/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/sub_steps/lookups_file_upload/translations.ts new file mode 100644 index 0000000000000..492f51309ca53 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/sub_steps/lookups_file_upload/translations.ts @@ -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 { i18n } from '@kbn/i18n'; + +export const LOOKUPS_DATA_INPUT_FILE_UPLOAD_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.lookups.lookupsFileUpload.title', + { defaultMessage: 'Update your lookups export' } +); +export const LOOKUPS_DATA_INPUT_FILE_UPLOAD_PROMPT = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.lookups.lookupsFileUpload.prompt', + { defaultMessage: 'Select or drag and drop the exported lookup files' } +); +export const LOOKUPS_DATA_INPUT_FILE_UPLOAD_NOT_UPLOADED_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.lookups.lookupsFileUpload.notUploadedTitle', + { defaultMessage: 'Lookups not uploaded' } +); +export const LOOKUPS_DATA_INPUT_FILE_UPLOAD_NOT_UPLOADED = (lookupsNames: string) => + i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.lookups.lookupsFileUpload.notUploaded', + { + defaultMessage: 'The following files did not match any missing lookup: {lookupsNames}', + values: { lookupsNames }, + } + ); + +export const LOOKUPS_DATA_INPUT_FILE_UPLOAD_BUTTON = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.lookups.lookupsFileUpload.button', + { defaultMessage: 'Upload' } +); diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/sub_steps/missing_lookups_list/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/sub_steps/missing_lookups_list/index.tsx new file mode 100644 index 0000000000000..ae1dbc0a03b3c --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/sub_steps/missing_lookups_list/index.tsx @@ -0,0 +1,66 @@ +/* + * 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, useMemo } from 'react'; +import type { EuiStepProps, EuiStepStatus } from '@elastic/eui'; +import { EMPTY_RESOURCE_PLACEHOLDER } from '../../../../../../../../../common/siem_migrations/constants'; +import { useUpsertResources } from '../../../../../../service/hooks/use_upsert_resources'; +import type { RuleMigrationTaskStats } from '../../../../../../../../../common/siem_migrations/model/rule_migration.gen'; +import type { UploadedLookups, AddUploadedLookups } from '../../lookups_data_input'; +import * as i18n from './translations'; +import { MissingLookupsList } from './missing_lookups_list'; + +export interface MissingLookupsListStepProps { + status: EuiStepStatus; + migrationStats: RuleMigrationTaskStats; + missingLookups: string[]; + uploadedLookups: UploadedLookups; + addUploadedLookups: AddUploadedLookups; + onCopied: () => void; +} +export const useMissingLookupsListStep = ({ + status, + migrationStats, + missingLookups, + uploadedLookups, + addUploadedLookups, + onCopied, +}: MissingLookupsListStepProps): EuiStepProps => { + const { upsertResources, isLoading, error } = useUpsertResources(addUploadedLookups); + + const clearLookup = useCallback( + (lookupName: string) => { + upsertResources(migrationStats.id, [ + { type: 'list', name: lookupName, content: EMPTY_RESOURCE_PLACEHOLDER }, + ]); + }, + [upsertResources, migrationStats] + ); + + const listStepStatus = useMemo(() => { + if (isLoading) { + return 'loading'; + } + if (error) { + return 'danger'; + } + return status; + }, [isLoading, error, status]); + + return { + title: i18n.LOOKUPS_DATA_INPUT_COPY_TITLE, + status: listStepStatus, + children: ( + <MissingLookupsList + onCopied={onCopied} + missingLookups={missingLookups} + uploadedLookups={uploadedLookups} + clearLookup={clearLookup} + /> + ), + }; +}; diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/sub_steps/missing_lookups_list/missing_lookups_list.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/sub_steps/missing_lookups_list/missing_lookups_list.tsx new file mode 100644 index 0000000000000..cd462a41bb6c1 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/sub_steps/missing_lookups_list/missing_lookups_list.tsx @@ -0,0 +1,161 @@ +/* + * 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, useMemo, useState } from 'react'; +import { css } from '@emotion/css'; +import { + EuiButtonIcon, + EuiCopy, + EuiFlexGroup, + EuiFlexItem, + EuiIcon, + EuiPanel, + EuiSpacer, + EuiText, + EuiToolTip, + useEuiTheme, +} from '@elastic/eui'; +import { EMPTY_RESOURCE_PLACEHOLDER } from '../../../../../../../../../common/siem_migrations/constants'; +import type { UploadedLookups } from '../../lookups_data_input'; +import * as i18n from './translations'; + +const scrollPanelCss = css` + max-height: 200px; + overflow-y: auto; +`; + +interface MissingLookupsListProps { + missingLookups: string[]; + uploadedLookups: UploadedLookups; + clearLookup: (lookupsName: string) => void; + onCopied: () => void; +} +export const MissingLookupsList = React.memo<MissingLookupsListProps>( + ({ missingLookups, uploadedLookups, clearLookup, onCopied }) => { + const { euiTheme } = useEuiTheme(); + return ( + <> + <EuiPanel hasShadow={false} hasBorder className={scrollPanelCss}> + <EuiFlexGroup direction="column" gutterSize="s"> + {missingLookups.map((lookupName) => { + const isMarkedAsEmpty = uploadedLookups[lookupName] === EMPTY_RESOURCE_PLACEHOLDER; + return ( + <EuiFlexItem key={lookupName}> + <EuiFlexGroup + direction="row" + gutterSize="s" + alignItems="center" + justifyContent="flexStart" + > + <EuiFlexItem grow={false}> + {uploadedLookups[lookupName] ? ( + <EuiIcon type="checkInCircleFilled" color={euiTheme.colors.success} /> + ) : ( + <EuiIcon type="dot" /> + )} + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiText + size="s" + style={isMarkedAsEmpty ? { textDecoration: 'line-through' } : {}} + > + {lookupName} + </EuiText> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiCopy textToCopy={lookupName}> + {(copy) => ( + <CopyLookupNameButton + lookupName={lookupName} + onCopied={onCopied} + copy={copy} + /> + )} + </EuiCopy> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <ClearLookupButton + lookupName={lookupName} + clearLookup={clearLookup} + isDisabled={isMarkedAsEmpty} + /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + ); + })} + </EuiFlexGroup> + </EuiPanel> + <EuiSpacer size="s" /> + <EuiText size="s" color="subdued"> + {i18n.MISSING_LOOKUPS_DESCRIPTION} + </EuiText> + </> + ); + } +); +MissingLookupsList.displayName = 'MissingLookupsList'; + +interface CopyLookupNameButtonProps { + lookupName: string; + onCopied: () => void; + copy: () => void; +} +const CopyLookupNameButton = React.memo<CopyLookupNameButtonProps>( + ({ lookupName, onCopied, copy }) => { + const onClick = useCallback(() => { + copy(); + onCopied(); + }, [copy, onCopied]); + return ( + <EuiToolTip content={i18n.COPY_LOOKUP_NAME_TOOLTIP}> + <EuiButtonIcon + onClick={onClick} + iconType="copyClipboard" + color="text" + aria-label={`${i18n.COPY_LOOKUP_NAME_TOOLTIP} ${lookupName}`} + data-test-subj="lookupNameCopy" + /> + </EuiToolTip> + ); + } +); +CopyLookupNameButton.displayName = 'CopyLookupNameButton'; + +interface ClearLookupButtonProps { + lookupName: string; + clearLookup: (lookupName: string) => void; + isDisabled: boolean; +} +const ClearLookupButton = React.memo<ClearLookupButtonProps>( + ({ lookupName, clearLookup, isDisabled: isDisabledDefault }) => { + const [isDisabled, setIsDisabled] = useState(isDisabledDefault); + const onClick = useCallback(() => { + setIsDisabled(true); + clearLookup(lookupName); + }, [clearLookup, lookupName]); + + const button = useMemo( + () => ( + <EuiButtonIcon + onClick={onClick} + iconType="cross" + color="text" + aria-label={i18n.CLEAR_EMPTY_LOOKUP_TOOLTIP} + data-test-subj="lookupNameClear" + isDisabled={isDisabled} + /> + ), + [onClick, isDisabled] + ); + if (isDisabled) { + return button; + } + return <EuiToolTip content={i18n.CLEAR_EMPTY_LOOKUP_TOOLTIP}>{button}</EuiToolTip>; + } +); +ClearLookupButton.displayName = 'ClearLookupButton'; diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/sub_steps/missing_lookups_list/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/sub_steps/missing_lookups_list/translations.ts new file mode 100644 index 0000000000000..123e541182068 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/sub_steps/missing_lookups_list/translations.ts @@ -0,0 +1,30 @@ +/* + * 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'; + +export const LOOKUPS_DATA_INPUT_COPY_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.lookups.missingLookupsList.title', + { defaultMessage: 'Lookups found in your rules' } +); + +export const MISSING_LOOKUPS_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.lookups.missingLookupsList.description', + { + defaultMessage: + 'For your lookups, go to your admin Splunk account and the Search and Reporting app Lookups page. Download the following lookups individually and upload below.', + } +); + +export const COPY_LOOKUP_NAME_TOOLTIP = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.lookups.missingLookupsList.copyLookupNameTooltip', + { defaultMessage: 'Copy lookup name' } +); +export const CLEAR_EMPTY_LOOKUP_TOOLTIP = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.lookups.missingLookupsList.clearEmptyLookupTooltip', + { defaultMessage: 'Mark the lookup as empty' } +); diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/translations.ts new file mode 100644 index 0000000000000..970bff4785c82 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/lookups/translations.ts @@ -0,0 +1,19 @@ +/* + * 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'; + +export const LOOKUPS_DATA_INPUT_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.lookups.title', + { defaultMessage: 'Upload identified lookups' } +); +export const LOOKUPS_DATA_INPUT_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.lookups.description', + { + defaultMessage: `We've also found lookups within your rules. To fully translate those rules containing these lookups, follow the step-by-step guide to export and upload them all.`, + } +); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/macros_data_input.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/macros_data_input.tsx similarity index 80% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/macros_data_input.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/macros_data_input.tsx index f19e704b96710..ebbffb6d7f6d6 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/macros_data_input.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/macros_data_input.tsx @@ -6,30 +6,21 @@ */ import type { EuiStepProps } from '@elastic/eui'; -import { - EuiFlexGroup, - EuiFlexItem, - EuiPanel, - EuiStepNumber, - EuiSteps, - EuiTitle, -} from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiStepNumber, EuiTitle } from '@elastic/eui'; import React, { useCallback, useMemo, useState } from 'react'; import type { RuleMigrationTaskStats } from '../../../../../../../common/siem_migrations/model/rule_migration.gen'; -import { SubStepsWrapper } from '../common/sub_step_wrapper'; -import type { OnResourcesCreated, OnMissingResourcesFetched, DataInputStep } from '../../types'; +import type { OnResourcesCreated, OnMissingResourcesFetched } from '../../types'; import { getStatus } from '../common/get_status'; +import * as i18n from './translations'; +import { DataInputStep } from '../constants'; +import { SubSteps } from '../common/sub_step'; import { useCopyExportQueryStep } from './sub_steps/copy_export_query'; import { useMacrosFileUploadStep } from './sub_steps/macros_file_upload'; -import * as i18n from './translations'; import { useCheckResourcesStep } from './sub_steps/check_resources'; -const DataInputStepNumber: DataInputStep = 2; - interface MacrosDataInputSubStepsProps { migrationStats: RuleMigrationTaskStats; missingMacros: string[]; - onMacrosCreated: OnResourcesCreated; onMissingResourcesFetched: OnMissingResourcesFetched; } interface MacrosDataInputProps @@ -39,15 +30,9 @@ interface MacrosDataInputProps missingMacros?: string[]; } export const MacrosDataInput = React.memo<MacrosDataInputProps>( - ({ - dataInputStep, - migrationStats, - missingMacros, - onMacrosCreated, - onMissingResourcesFetched, - }) => { + ({ dataInputStep, migrationStats, missingMacros, onMissingResourcesFetched }) => { const dataInputStatus = useMemo( - () => getStatus(DataInputStepNumber, dataInputStep), + () => getStatus(DataInputStep.Macros, dataInputStep), [dataInputStep] ); @@ -59,7 +44,7 @@ export const MacrosDataInput = React.memo<MacrosDataInputProps>( <EuiFlexItem grow={false}> <EuiStepNumber titleSize="xs" - number={DataInputStepNumber} + number={DataInputStep.Macros} status={dataInputStatus} /> </EuiFlexItem> @@ -75,7 +60,6 @@ export const MacrosDataInput = React.memo<MacrosDataInputProps>( <MacrosDataInputSubSteps migrationStats={migrationStats} missingMacros={missingMacros} - onMacrosCreated={onMacrosCreated} onMissingResourcesFetched={onMissingResourcesFetched} /> </EuiFlexItem> @@ -90,7 +74,7 @@ MacrosDataInput.displayName = 'MacrosDataInput'; const END = 10 as const; type SubStep = 1 | 2 | 3 | typeof END; export const MacrosDataInputSubSteps = React.memo<MacrosDataInputSubStepsProps>( - ({ migrationStats, missingMacros, onMacrosCreated, onMissingResourcesFetched }) => { + ({ migrationStats, missingMacros, onMissingResourcesFetched }) => { const [subStep, setSubStep] = useState<SubStep>(missingMacros.length ? 1 : 3); // Copy query step @@ -101,9 +85,8 @@ export const MacrosDataInputSubSteps = React.memo<MacrosDataInputSubStepsProps>( // Upload macros step const onMacrosCreatedStep = useCallback<OnResourcesCreated>(() => { - onMacrosCreated(); setSubStep(3); - }, [onMacrosCreated]); + }, []); const uploadStep = useMacrosFileUploadStep({ status: getStatus(2, subStep), migrationStats, @@ -130,11 +113,7 @@ export const MacrosDataInputSubSteps = React.memo<MacrosDataInputSubStepsProps>( [copyStep, uploadStep, resourcesStep] ); - return ( - <SubStepsWrapper> - <EuiSteps titleSize="xxs" steps={steps} /> - </SubStepsWrapper> - ); + return <SubSteps steps={steps} />; } ); MacrosDataInputSubSteps.displayName = 'MacrosDataInputActive'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/check_resources/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/check_resources/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/check_resources/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/check_resources/index.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/check_resources/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/check_resources/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/check_resources/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/check_resources/translations.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/copy_export_query.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/copy_export_query.tsx similarity index 96% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/copy_export_query.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/copy_export_query.tsx index 93f2ce715184c..9988be28ee847 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/copy_export_query.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/copy_export_query.tsx @@ -42,7 +42,7 @@ export const CopyExportQuery = React.memo<CopyExportQueryProps>(({ onCopied }) = id="xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.copyExportQuery.description" defaultMessage="From you admin Splunk account, go to the {section} app and run the above query. Export your results as {format}." values={{ - section: <b>{i18n.RULES_DATA_INPUT_COPY_DESCRIPTION_SECTION}</b>, + section: <b>{i18n.MACROS_DATA_INPUT_COPY_DESCRIPTION_SECTION}</b>, format: <b>{'JSON'}</b>, }} /> diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/index.tsx new file mode 100644 index 0000000000000..ac8ff1521c5af --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/index.tsx @@ -0,0 +1,26 @@ +/* + * 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 { EuiStepProps, EuiStepStatus } from '@elastic/eui'; +import { CopyExportQuery } from './copy_export_query'; +import * as i18n from './translations'; + +export interface CopyExportQueryStepProps { + status: EuiStepStatus; + onCopied: () => void; +} +export const useCopyExportQueryStep = ({ + status, + onCopied, +}: CopyExportQueryStepProps): EuiStepProps => { + return { + title: i18n.MACROS_DATA_INPUT_COPY_TITLE, + status, + children: <CopyExportQuery onCopied={onCopied} />, + }; +}; diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/translations.ts new file mode 100644 index 0000000000000..89364dbfefd3b --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/translations.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 { i18n } from '@kbn/i18n'; + +export const MACROS_DATA_INPUT_COPY_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.macros.copyExportQuery.title', + { defaultMessage: 'Copy macros query' } +); + +export const MACROS_DATA_INPUT_COPY_DESCRIPTION_SECTION = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.macros.copyExportQuery.description.section', + { defaultMessage: 'Search and Reporting' } +); diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/index.tsx new file mode 100644 index 0000000000000..3906ac6ca8a09 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/index.tsx @@ -0,0 +1,94 @@ +/* + * 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, useMemo } from 'react'; +import type { EuiStepProps, EuiStepStatus } from '@elastic/eui'; +import { ResourceIdentifier } from '../../../../../../../../../common/siem_migrations/rules/resources'; +import { useUpsertResources } from '../../../../../../service/hooks/use_upsert_resources'; +import type { + RuleMigrationResourceData, + RuleMigrationTaskStats, +} from '../../../../../../../../../common/siem_migrations/model/rule_migration.gen'; +import type { OnResourcesCreated } from '../../../../types'; +import { MacrosFileUpload } from './macros_file_upload'; +import * as i18n from './translations'; + +export interface RulesFileUploadStepProps { + status: EuiStepStatus; + migrationStats: RuleMigrationTaskStats; + missingMacros: string[]; + onMacrosCreated: OnResourcesCreated; +} +export const useMacrosFileUploadStep = ({ + status, + migrationStats, + missingMacros, + onMacrosCreated, +}: RulesFileUploadStepProps): EuiStepProps => { + const { upsertResources, isLoading, error } = useUpsertResources(onMacrosCreated); + + const upsertMigrationResources = useCallback( + (macrosFromFile: RuleMigrationResourceData[]) => { + const macrosIndexed: Record<string, RuleMigrationResourceData> = Object.fromEntries( + macrosFromFile.map((macro) => [macro.name, macro]) + ); + const resourceIdentifier = new ResourceIdentifier('splunk'); + const macrosToUpsert: RuleMigrationResourceData[] = []; + let missingMacrosIt: string[] = missingMacros; + + while (missingMacrosIt.length > 0) { + const macros: RuleMigrationResourceData[] = []; + missingMacrosIt.forEach((macroName) => { + const macro = macrosIndexed[macroName]; + if (macro) { + macros.push(macro); + } else { + // Macro missing from file + } + }); + macrosToUpsert.push(...macros); + + missingMacrosIt = resourceIdentifier + .fromResources(macros) + .reduce<string[]>((acc, resource) => { + if (resource.type === 'macro') { + acc.push(resource.name); + } + return acc; + }, []); + } + + if (macrosToUpsert.length === 0) { + return; // No missing macros provided + } + upsertResources(migrationStats.id, macrosToUpsert); + }, + [upsertResources, migrationStats, missingMacros] + ); + + const uploadStepStatus = useMemo(() => { + if (isLoading) { + return 'loading'; + } + if (error) { + return 'danger'; + } + return status; + }, [isLoading, error, status]); + + return { + title: i18n.MACROS_DATA_INPUT_FILE_UPLOAD_TITLE, + status: uploadStepStatus, + children: ( + <MacrosFileUpload + createResources={upsertMigrationResources} + isLoading={isLoading} + apiError={error?.message} + /> + ), + }; +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/macros_file_upload.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/macros_file_upload.tsx similarity index 93% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/macros_file_upload.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/macros_file_upload.tsx index b8d7022d9b454..5cea4afdb8537 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/macros_file_upload.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/macros_file_upload.tsx @@ -25,8 +25,8 @@ export const MacrosFileUpload = React.memo<MacrosFileUploadProps>( ({ createResources, apiError, isLoading }) => { const onFileParsed = useCallback( (content: Array<SplunkRow<SplunkMacroResult>>) => { - const rules = content.map(formatMacroRow); - createResources(rules); + const macros = content.map(formatMacroRow); + createResources(macros); }, [createResources] ); @@ -56,14 +56,14 @@ export const MacrosFileUpload = React.memo<MacrosFileUploadProps>( initialPromptText={ <> <EuiText size="s" textAlign="center"> - {i18n.RULES_DATA_INPUT_FILE_UPLOAD_PROMPT} + {i18n.MACROS_DATA_INPUT_FILE_UPLOAD_PROMPT} </EuiText> </> } accept="application/json, application/x-ndjson" onChange={parseFile} display="large" - aria-label="Upload logs sample file" + aria-label="Upload macros file" isLoading={isParsing || isLoading} disabled={isParsing || isLoading} data-test-subj="macrosFilePicker" diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/translations.ts new file mode 100644 index 0000000000000..6625b271d0f4e --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/translations.ts @@ -0,0 +1,17 @@ +/* + * 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'; + +export const MACROS_DATA_INPUT_FILE_UPLOAD_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.macros.macrosFileUpload.title', + { defaultMessage: 'Update your macros export' } +); +export const MACROS_DATA_INPUT_FILE_UPLOAD_PROMPT = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.macros.macrosFileUpload.prompt', + { defaultMessage: 'Select or drag and drop the exported JSON file' } +); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/translations.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/rules_data_input.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/rules_data_input.tsx similarity index 87% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/rules_data_input.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/rules_data_input.tsx index acc22a030b02f..0c919a2db7a5d 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/rules_data_input.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/rules_data_input.tsx @@ -6,25 +6,17 @@ */ import type { EuiStepProps } from '@elastic/eui'; -import { - EuiFlexGroup, - EuiFlexItem, - EuiPanel, - EuiStepNumber, - EuiSteps, - EuiTitle, -} from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiStepNumber, EuiTitle } from '@elastic/eui'; import React, { useCallback, useMemo, useState } from 'react'; import type { RuleMigrationTaskStats } from '../../../../../../../common/siem_migrations/model/rule_migration.gen'; -import { SubStepsWrapper } from '../common/sub_step_wrapper'; -import type { OnMigrationCreated, OnMissingResourcesFetched, DataInputStep } from '../../types'; +import type { OnMigrationCreated, OnMissingResourcesFetched } from '../../types'; +import * as i18n from './translations'; +import { DataInputStep } from '../constants'; +import { getStatus } from '../common/get_status'; +import { SubSteps } from '../common/sub_step'; import { useCopyExportQueryStep } from './sub_steps/copy_export_query'; import { useRulesFileUploadStep } from './sub_steps/rules_file_upload'; -import * as i18n from './translations'; import { useCheckResourcesStep } from './sub_steps/check_resources'; -import { getStatus } from '../common/get_status'; - -const DataInputStepNumber: DataInputStep = 1; interface RulesDataInputSubStepsProps { migrationStats?: RuleMigrationTaskStats; @@ -37,7 +29,7 @@ interface RulesDataInputProps extends RulesDataInputSubStepsProps { export const RulesDataInput = React.memo<RulesDataInputProps>( ({ dataInputStep, migrationStats, onMigrationCreated, onMissingResourcesFetched }) => { const dataInputStatus = useMemo( - () => getStatus(DataInputStepNumber, dataInputStep), + () => getStatus(DataInputStep.Rules, dataInputStep), [dataInputStep] ); @@ -49,7 +41,7 @@ export const RulesDataInput = React.memo<RulesDataInputProps>( <EuiFlexItem grow={false}> <EuiStepNumber titleSize="xs" - number={DataInputStepNumber} + number={DataInputStep.Rules} status={dataInputStatus} /> </EuiFlexItem> @@ -121,11 +113,7 @@ export const RulesDataInputSubSteps = React.memo<RulesDataInputSubStepsProps>( [copyStep, uploadStep, resourcesStep] ); - return ( - <SubStepsWrapper> - <EuiSteps titleSize="xxs" steps={steps} /> - </SubStepsWrapper> - ); + return <SubSteps steps={steps} />; } ); RulesDataInputSubSteps.displayName = 'RulesDataInputActive'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/check_resources/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/check_resources/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/check_resources/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/check_resources/index.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/check_resources/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/check_resources/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/check_resources/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/check_resources/translations.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/copy_export_query.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/copy_export_query.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/copy_export_query.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/copy_export_query.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/index.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/translations.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/index.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/rules_file_upload.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/rules_file_upload.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/rules_file_upload.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/rules_file_upload.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/translations.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/translations.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/translations.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/types.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/types.ts new file mode 100644 index 0000000000000..1e5a8a0f7028c --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/types.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 type { + RuleMigrationResourceData, + RuleMigrationTaskStats, +} from '../../../../../common/siem_migrations/model/rule_migration.gen'; + +export type OnMigrationCreated = (migrationStats: RuleMigrationTaskStats) => void; +export type OnResourcesCreated = () => void; +export type OnMissingResourcesFetched = (missingResources: RuleMigrationResourceData[]) => void; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/header_buttons/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/header_buttons/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/header_buttons/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/header_buttons/index.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/header_buttons/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/header_buttons/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/header_buttons/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/header_buttons/translations.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/migration_status_panels/migration_progress_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/migration_status_panels/migration_progress_panel.tsx new file mode 100644 index 0000000000000..0be6fa7b75f5a --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/migration_status_panels/migration_progress_panel.tsx @@ -0,0 +1,86 @@ +/* + * 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 { + EuiFlexGroup, + EuiFlexItem, + EuiText, + EuiPanel, + EuiProgress, + EuiLoadingSpinner, + EuiIcon, + EuiSpacer, +} from '@elastic/eui'; +import { AssistantIcon } from '@kbn/ai-assistant-icon'; +import { PanelText } from '../../../../common/components/panel_text'; +import type { RuleMigrationStats } from '../../types'; +import * as i18n from './translations'; +import { RuleMigrationsReadMore } from './read_more'; + +export interface MigrationProgressPanelProps { + migrationStats: RuleMigrationStats; +} +export const MigrationProgressPanel = React.memo<MigrationProgressPanelProps>( + ({ migrationStats }) => { + const finishedCount = migrationStats.rules.completed + migrationStats.rules.failed; + const progressValue = (finishedCount / migrationStats.rules.total) * 100; + + const preparing = migrationStats.rules.pending === migrationStats.rules.total; + + return ( + <EuiPanel hasShadow={false} hasBorder paddingSize="m"> + <EuiFlexGroup direction="column" gutterSize="m"> + <EuiFlexItem grow={false}> + <PanelText size="s" semiBold> + <p>{i18n.RULE_MIGRATION_TITLE(migrationStats.number)}</p> + </PanelText> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiText size="s"> + {i18n.RULE_MIGRATION_PROGRESS_DESCRIPTION(migrationStats.rules.total)} + </EuiText> + </EuiFlexItem> + + <EuiFlexItem grow={false}> + <EuiFlexGroup + direction="row" + justifyContent="flexStart" + alignItems="center" + gutterSize="s" + > + <EuiFlexItem grow={false}> + <EuiIcon size="m" type={AssistantIcon} /> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <PanelText size="s" subdued> + {preparing ? i18n.RULE_MIGRATION_PREPARING : i18n.RULE_MIGRATION_TRANSLATING} + </PanelText> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiLoadingSpinner size="s" /> + </EuiFlexItem> + </EuiFlexGroup> + {!preparing && ( + <> + <EuiProgress + value={progressValue} + valueText={`${Math.floor(progressValue)}%`} + max={100} + color="success" + /> + <EuiSpacer size="xs" /> + <RuleMigrationsReadMore /> + </> + )} + </EuiFlexItem> + </EuiFlexGroup> + </EuiPanel> + ); + } +); +MigrationProgressPanel.displayName = 'MigrationProgressPanel'; diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/migration_status_panels/migration_ready_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/migration_status_panels/migration_ready_panel.tsx new file mode 100644 index 0000000000000..3c230cba4c34f --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/migration_status_panels/migration_ready_panel.tsx @@ -0,0 +1,88 @@ +/* + * 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, useEffect } from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiButton, EuiPanel } from '@elastic/eui'; +import { CenteredLoadingSpinner } from '../../../../common/components/centered_loading_spinner'; +import type { RuleMigrationResourceData } from '../../../../../common/siem_migrations/model/rule_migration.gen'; +import { PanelText } from '../../../../common/components/panel_text'; +import { useStartMigration } from '../../service/hooks/use_start_migration'; +import type { RuleMigrationStats } from '../../types'; +import { useRuleMigrationDataInputContext } from '../data_input_flyout/context'; +import * as i18n from './translations'; +import { useGetMissingResources } from '../../service/hooks/use_get_missing_resources'; + +export interface MigrationReadyPanelProps { + migrationStats: RuleMigrationStats; +} +export const MigrationReadyPanel = React.memo<MigrationReadyPanelProps>(({ migrationStats }) => { + const { openFlyout } = useRuleMigrationDataInputContext(); + const [missingResources, setMissingResources] = React.useState<RuleMigrationResourceData[]>([]); + const { getMissingResources, isLoading } = useGetMissingResources(setMissingResources); + + useEffect(() => { + getMissingResources(migrationStats.id); + }, [getMissingResources, migrationStats.id]); + + const onOpenFlyout = useCallback<React.MouseEventHandler>(() => { + openFlyout(migrationStats); + }, [openFlyout, migrationStats]); + + return ( + <EuiPanel hasShadow={false} hasBorder paddingSize="m"> + <EuiFlexGroup direction="row" gutterSize="m" alignItems="flexEnd"> + <EuiFlexItem> + <EuiFlexGroup direction="column" gutterSize="s"> + <EuiFlexItem> + <PanelText size="s" semiBold> + <p>{i18n.RULE_MIGRATION_TITLE(migrationStats.number)}</p> + </PanelText> + </EuiFlexItem> + <EuiFlexItem> + <PanelText size="s" subdued> + {i18n.RULE_MIGRATION_READY_DESCRIPTION( + migrationStats.rules.total, + !isLoading && missingResources.length > 0 + ? i18n.RULE_MIGRATION_READY_MISSING_RESOURCES + : '' + )} + </PanelText> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + {isLoading ? ( + <CenteredLoadingSpinner /> + ) : ( + <EuiFlexItem grow={false}> + {missingResources.length > 0 ? ( + <EuiButton fill iconType="download" iconSide="right" onClick={onOpenFlyout} size="s"> + {i18n.RULE_MIGRATION_UPLOAD_BUTTON} + </EuiButton> + ) : ( + <StartTranslationButton migrationId={migrationStats.id} /> + )} + </EuiFlexItem> + )} + </EuiFlexGroup> + </EuiPanel> + ); +}); +MigrationReadyPanel.displayName = 'MigrationReadyPanel'; + +const StartTranslationButton = React.memo<{ migrationId: string }>(({ migrationId }) => { + const { startMigration, isLoading } = useStartMigration(); + const onStartMigration = useCallback(() => { + startMigration(migrationId); + }, [migrationId, startMigration]); + + return ( + <EuiButton fill onClick={onStartMigration} isLoading={isLoading} size="s"> + {i18n.RULE_MIGRATION_START_TRANSLATION_BUTTON} + </EuiButton> + ); +}); +StartTranslationButton.displayName = 'StartTranslationButton'; diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/migration_status_panels/migration_result_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/migration_status_panels/migration_result_panel.tsx new file mode 100644 index 0000000000000..cce11abcd8eb7 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/migration_status_panels/migration_result_panel.tsx @@ -0,0 +1,227 @@ +/* + * 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, { useMemo } from 'react'; +import moment from 'moment'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiPanel, + EuiHorizontalRule, + EuiIcon, + EuiBasicTable, + EuiHealth, + EuiText, + useEuiTheme, +} from '@elastic/eui'; +import { Chart, BarSeries, Settings, ScaleType, DARK_THEME, LIGHT_THEME } from '@elastic/charts'; +import { SecurityPageName } from '@kbn/security-solution-navigation'; +import { AssistantIcon } from '@kbn/ai-assistant-icon'; +import { PanelText } from '../../../../common/components/panel_text'; +import { + convertTranslationResultIntoText, + useResultVisColors, +} from '../../utils/translation_results'; +import type { RuleMigrationTranslationStats } from '../../../../../common/siem_migrations/model/rule_migration.gen'; +import { useGetMigrationTranslationStats } from '../../logic/use_get_migration_translation_stats'; +import { CenteredLoadingSpinner } from '../../../../common/components/centered_loading_spinner'; +import { SecuritySolutionLinkButton } from '../../../../common/components/links'; +import type { RuleMigrationStats } from '../../types'; +import { RuleTranslationResult } from '../../../../../common/siem_migrations/constants'; +import * as i18n from './translations'; + +export interface MigrationResultPanelProps { + migrationStats: RuleMigrationStats; +} +export const MigrationResultPanel = React.memo<MigrationResultPanelProps>(({ migrationStats }) => { + const { data: translationStats, isLoading: isLoadingTranslationStats } = + useGetMigrationTranslationStats(migrationStats.id); + return ( + <EuiPanel hasShadow={false} hasBorder paddingSize="none"> + <EuiPanel hasShadow={false} hasBorder={false} paddingSize="m"> + <EuiFlexGroup direction="column" alignItems="flexStart" gutterSize="xs"> + <EuiFlexItem grow={false}> + <PanelText size="s" semiBold> + <p>{i18n.RULE_MIGRATION_COMPLETE_TITLE(migrationStats.number)}</p> + </PanelText> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <PanelText size="s" subdued> + <p> + {i18n.RULE_MIGRATION_COMPLETE_DESCRIPTION( + moment(migrationStats.created_at).format('MMMM Do YYYY, h:mm:ss a'), + moment(migrationStats.last_updated_at).fromNow() + )} + </p> + </PanelText> + </EuiFlexItem> + </EuiFlexGroup> + </EuiPanel> + <EuiHorizontalRule margin="none" /> + <EuiPanel hasShadow={false} hasBorder={false} paddingSize="m"> + <EuiFlexGroup direction="column" alignItems="stretch" gutterSize="m"> + <EuiFlexItem grow={false}> + <EuiFlexGroup direction="row" alignItems="center" gutterSize="s"> + <EuiFlexItem grow={false}> + <EuiIcon type={AssistantIcon} size="m" /> + </EuiFlexItem> + <EuiFlexItem> + <PanelText size="s" semiBold> + <p>{i18n.RULE_MIGRATION_SUMMARY_TITLE}</p> + </PanelText> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + <EuiFlexItem> + <EuiPanel hasShadow={false} hasBorder paddingSize="m"> + <EuiFlexGroup direction="column" alignItems="stretch" justifyContent="center"> + <EuiFlexItem> + {isLoadingTranslationStats ? ( + <CenteredLoadingSpinner /> + ) : ( + translationStats && ( + <> + <EuiText size="m" style={{ textAlign: 'center' }}> + <b>{i18n.RULE_MIGRATION_SUMMARY_CHART_TITLE}</b> + </EuiText> + <TranslationResultsChart translationStats={translationStats} /> + <TranslationResultsTable translationStats={translationStats} /> + </> + ) + )} + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiFlexGroup direction="column" alignItems="center"> + <EuiFlexItem> + <SecuritySolutionLinkButton + deepLinkId={SecurityPageName.siemMigrationsRules} + path={migrationStats.id} + > + {i18n.RULE_MIGRATION_VIEW_TRANSLATED_RULES_BUTTON} + </SecuritySolutionLinkButton> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + </EuiFlexGroup> + </EuiPanel> + </EuiFlexItem> + </EuiFlexGroup> + {/* TODO: uncomment when retry API is ready <RuleMigrationsUploadMissingPanel migrationStats={migrationStats} spacerSizeTop="s" /> */} + </EuiPanel> + </EuiPanel> + ); +}); +MigrationResultPanel.displayName = 'MigrationResultPanel'; + +const TranslationResultsChart = React.memo<{ + translationStats: RuleMigrationTranslationStats; +}>(({ translationStats }) => { + const { colorMode } = useEuiTheme(); + const translationResultColors = useResultVisColors(); + const data = [ + { + category: 'Results', + type: convertTranslationResultIntoText(RuleTranslationResult.FULL), + value: translationStats.rules.success.result.full, + }, + { + category: 'Results', + type: convertTranslationResultIntoText(RuleTranslationResult.PARTIAL), + value: translationStats.rules.success.result.partial, + }, + { + category: 'Results', + type: convertTranslationResultIntoText(RuleTranslationResult.UNTRANSLATABLE), + value: translationStats.rules.success.result.untranslatable, + }, + { + category: 'Results', + type: i18n.RULE_MIGRATION_TRANSLATION_FAILED, + value: translationStats.rules.failed, + }, + ]; + + const colors = [ + translationResultColors[RuleTranslationResult.FULL], + translationResultColors[RuleTranslationResult.PARTIAL], + translationResultColors[RuleTranslationResult.UNTRANSLATABLE], + translationResultColors.error, + ]; + + return ( + <Chart size={{ height: 130 }}> + <Settings + showLegend={false} + rotation={90} + baseTheme={colorMode === 'DARK' ? DARK_THEME : LIGHT_THEME} + /> + <BarSeries + id="results" + name="Results" + data={data} + xAccessor="category" + yAccessors={['value']} + splitSeriesAccessors={['type']} + stackAccessors={['category']} + xScaleType={ScaleType.Ordinal} + yScaleType={ScaleType.Linear} + color={colors} + /> + </Chart> + ); +}); +TranslationResultsChart.displayName = 'TranslationResultsChart'; + +const TranslationResultsTable = React.memo<{ + translationStats: RuleMigrationTranslationStats; +}>(({ translationStats }) => { + const translationResultColors = useResultVisColors(); + const items = useMemo(() => { + return [ + { + title: convertTranslationResultIntoText(RuleTranslationResult.FULL), + value: translationStats.rules.success.result.full, + color: translationResultColors[RuleTranslationResult.FULL], + }, + { + title: convertTranslationResultIntoText(RuleTranslationResult.PARTIAL), + value: translationStats.rules.success.result.partial, + color: translationResultColors[RuleTranslationResult.PARTIAL], + }, + { + title: convertTranslationResultIntoText(RuleTranslationResult.UNTRANSLATABLE), + value: translationStats.rules.success.result.untranslatable, + color: translationResultColors[RuleTranslationResult.UNTRANSLATABLE], + }, + { + title: i18n.RULE_MIGRATION_TRANSLATION_FAILED, + value: translationStats.rules.failed, + color: translationResultColors.error, + }, + ]; + }, [translationStats, translationResultColors]); + + return ( + <EuiBasicTable + items={items} + compressed + columns={[ + { + field: 'title', + name: i18n.RULE_MIGRATION_TABLE_COLUMN_RESULT, + render: (value: string, { color }) => <EuiHealth color={color}>{value}</EuiHealth>, + }, + { + field: 'value', + name: i18n.RULE_MIGRATION_TABLE_COLUMN_RULES, + align: 'right', + }, + ]} + /> + ); +}); +TranslationResultsTable.displayName = 'TranslationResultsTable'; diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/migration_status_panels/read_more.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/migration_status_panels/read_more.tsx new file mode 100644 index 0000000000000..4567026f3cc08 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/migration_status_panels/read_more.tsx @@ -0,0 +1,37 @@ +/* + * 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 { EuiLink } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { PanelText } from '../../../../common/components/panel_text'; +import { useKibana } from '../../../../common/lib/kibana/kibana_react'; + +export const RuleMigrationsReadMore = React.memo(() => { + const docLink = useKibana().services.docLinks.links.siem.gettingStarted; + return ( + <PanelText size="xs" subdued> + <p> + <FormattedMessage + id="xpack.securitySolution.siemMigrations.rules.panel.help.readMore" + defaultMessage="Read more about our AI powered translations and other features. {readMore}" + values={{ + readMore: ( + <EuiLink href={docLink} target="_blank"> + <FormattedMessage + id="xpack.securitySolution.siemMigrations.rules.panel.help.readDocs" + defaultMessage="Read AI docs" + /> + </EuiLink> + ), + }} + /> + </p> + </PanelText> + ); +}); +RuleMigrationsReadMore.displayName = 'RuleMigrationsReadMore'; diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/migration_status_panels/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/migration_status_panels/translations.ts new file mode 100644 index 0000000000000..55e73bca32b5d --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/migration_status_panels/translations.ts @@ -0,0 +1,101 @@ +/* + * 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'; + +export const RULE_MIGRATION_READY_DESCRIPTION = ( + totalRules: number, + missingResourcesText: string +) => + i18n.translate('xpack.securitySolution.siemMigrations.rules.panel.ready.description', { + defaultMessage: + 'Migration of {totalRules} rules is created but the translation has not started yet. {missingResourcesText}', + values: { totalRules, missingResourcesText }, + }); +export const RULE_MIGRATION_READY_MISSING_RESOURCES = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.panel.ready.missingResources', + { defaultMessage: 'Upload macros & lookups and start the translation process' } +); + +export const RULE_MIGRATION_START_TRANSLATION_BUTTON = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.panel.translate.button', + { defaultMessage: 'Start translation' } +); +export const RULE_MIGRATION_TITLE = (number: number) => + i18n.translate('xpack.securitySolution.siemMigrations.rules.panel.migrationTitle', { + defaultMessage: 'SIEM rules migration #{number}', + values: { number }, + }); + +export const RULE_MIGRATION_PROGRESS_DESCRIPTION = (totalRules: number) => + i18n.translate('xpack.securitySolution.siemMigrations.rules.panel.progress.description', { + defaultMessage: `Processing migration of {totalRules} rules.`, + values: { totalRules }, + }); +export const RULE_MIGRATION_PREPARING = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.panel.preparing', + { defaultMessage: `Preparing environment for the AI powered translation.` } +); +export const RULE_MIGRATION_TRANSLATING = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.panel.translating', + { defaultMessage: `Translating rules` } +); + +export const RULE_MIGRATION_COMPLETE_TITLE = (number: number) => + i18n.translate('xpack.securitySolution.siemMigrations.rules.panel.result.title', { + defaultMessage: 'SIEM rules migration #{number} complete', + values: { number }, + }); + +export const RULE_MIGRATION_COMPLETE_DESCRIPTION = (createdAt: string, finishedAt: string) => + i18n.translate('xpack.securitySolution.siemMigrations.rules.panel.result.description', { + defaultMessage: 'Export uploaded on {createdAt} and translation finished {finishedAt}.', + values: { createdAt, finishedAt }, + }); + +export const RULE_MIGRATION_SUMMARY_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.panel.result.summary.title', + { defaultMessage: 'Translation Summary' } +); + +export const RULE_MIGRATION_SUMMARY_CHART_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.panel.result.summary.chartTitle', + { defaultMessage: 'Rules by translation status' } +); + +export const RULE_MIGRATION_VIEW_TRANSLATED_RULES_BUTTON = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.panel.result.summary.button', + { defaultMessage: 'View translated rules' } +); + +export const RULE_MIGRATION_TRANSLATION_FAILED = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.panel.result.summary.failed', + { defaultMessage: 'Failed' } +); + +export const RULE_MIGRATION_TABLE_COLUMN_RESULT = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.panel.result.summary.tableColumn.result', + { defaultMessage: 'Result' } +); +export const RULE_MIGRATION_TABLE_COLUMN_RULES = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.panel.result.summary.tableColumn.rules', + { defaultMessage: 'Rules' } +); + +export const RULE_MIGRATION_UPLOAD_MISSING_RESOURCES_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.panel.uploadMissingResources', + { defaultMessage: 'Upload missing Macros and Lookups.' } +); +export const RULE_MIGRATION_UPLOAD_MISSING_RESOURCES_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.panel.uploadMissingResourcesDescription', + { defaultMessage: 'Click upload for step-by-step guidance to finish partially translated rules.' } +); + +export const RULE_MIGRATION_UPLOAD_BUTTON = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.panel.uploadMacros.button', + { defaultMessage: 'Upload' } +); diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/migration_status_panels/upload_missing_panel.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/migration_status_panels/upload_missing_panel.tsx new file mode 100644 index 0000000000000..f1c6bdd71613a --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/migration_status_panels/upload_missing_panel.tsx @@ -0,0 +1,89 @@ +/* + * 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, useEffect } from 'react'; +import { + EuiButton, + EuiFlexGroup, + EuiFlexItem, + EuiPanel, + EuiSpacer, + useEuiTheme, +} from '@elastic/eui'; +import { AssistantIcon } from '@kbn/ai-assistant-icon'; +import type { SpacerSize } from '@elastic/eui/src/components/spacer/spacer'; +import type { RuleMigrationResourceData } from '../../../../../common/siem_migrations/model/rule_migration.gen'; +import { PanelText } from '../../../../common/components/panel_text'; +import { useGetMissingResources } from '../../service/hooks/use_get_missing_resources'; +import * as i18n from './translations'; +import { useRuleMigrationDataInputContext } from '../data_input_flyout/context'; +import type { RuleMigrationStats } from '../../types'; + +interface RuleMigrationsUploadMissingPanelProps { + migrationStats: RuleMigrationStats; + spacerSizeTop?: SpacerSize; +} +export const RuleMigrationsUploadMissingPanel = React.memo<RuleMigrationsUploadMissingPanelProps>( + ({ migrationStats, spacerSizeTop }) => { + const { euiTheme } = useEuiTheme(); + const { openFlyout } = useRuleMigrationDataInputContext(); + const [missingResources, setMissingResources] = React.useState<RuleMigrationResourceData[]>([]); + const { getMissingResources, isLoading } = useGetMissingResources(setMissingResources); + + useEffect(() => { + getMissingResources(migrationStats.id); + }, [getMissingResources, migrationStats.id]); + + const onOpenFlyout = useCallback(() => { + openFlyout(migrationStats); + }, [migrationStats, openFlyout]); + + if (isLoading || missingResources.length === 0) { + return null; + } + return ( + <> + {spacerSizeTop && <EuiSpacer size={spacerSizeTop} />} + <EuiPanel + hasShadow={false} + hasBorder + paddingSize="s" + style={{ backgroundColor: euiTheme.colors.backgroundBasePrimary }} + > + <EuiFlexGroup direction="row" gutterSize="s" alignItems="center"> + <EuiFlexItem grow={false}> + <AssistantIcon /> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <PanelText size="s" semiBold> + {i18n.RULE_MIGRATION_UPLOAD_MISSING_RESOURCES_TITLE} + </PanelText> + </EuiFlexItem> + <EuiFlexItem> + <PanelText size="s" subdued> + {i18n.RULE_MIGRATION_UPLOAD_MISSING_RESOURCES_DESCRIPTION} + </PanelText> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiButton + fill + color="primary" + onClick={onOpenFlyout} + iconType="download" + iconSide="right" + size="s" + > + {i18n.RULE_MIGRATION_UPLOAD_BUTTON} + </EuiButton> + </EuiFlexItem> + </EuiFlexGroup> + </EuiPanel> + </> + ); + } +); +RuleMigrationsUploadMissingPanel.displayName = 'RuleMigrationsUploadMissingPanel'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/constants.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/index.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/index.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/summary/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/summary/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/summary/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/summary/index.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/summary/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/summary/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/summary/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/summary/translations.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/callout.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/callout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/callout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/callout.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/header.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/header.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/header.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/header.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/index.tsx new file mode 100644 index 0000000000000..9184c48ff75b3 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/index.tsx @@ -0,0 +1,132 @@ +/* + * 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, { useMemo } from 'react'; +import { + EuiAccordion, + EuiBadge, + EuiFlexGroup, + EuiFlexItem, + EuiSpacer, + EuiSplitPanel, + EuiTitle, + useEuiTheme, +} from '@elastic/eui'; +import { css } from '@emotion/css'; +import { FormattedMessage } from '@kbn/i18n-react'; +import type { RuleResponse } from '../../../../../../../common/api/detection_engine'; +import type { RuleMigration } from '../../../../../../../common/siem_migrations/model/rule_migration.gen'; +import { TranslationTabHeader } from './header'; +import { MigrationRuleQuery } from './migration_rule_query'; +import * as i18n from './translations'; +import { + convertTranslationResultIntoColor, + convertTranslationResultIntoText, +} from '../../../../utils/translation_results'; +import { TranslationCallOut } from './callout'; + +interface TranslationTabProps { + ruleMigration: RuleMigration; + matchedPrebuiltRule?: RuleResponse; + onTranslationUpdate?: (ruleName: string, ruleQuery: string) => Promise<void>; +} + +export const TranslationTab: React.FC<TranslationTabProps> = React.memo( + ({ ruleMigration, matchedPrebuiltRule, onTranslationUpdate }) => { + const { euiTheme } = useEuiTheme(); + + const isInstalled = !!ruleMigration.elastic_rule?.id; + const canEdit = !matchedPrebuiltRule && !isInstalled; + + const ruleName = matchedPrebuiltRule?.name ?? ruleMigration.elastic_rule?.title; + const originalQuery = ruleMigration.original_rule.query; + const elasticQuery = useMemo(() => { + let query = ruleMigration.elastic_rule?.query; + if (matchedPrebuiltRule && matchedPrebuiltRule.type !== 'machine_learning') { + query = matchedPrebuiltRule.query; + } + return query ?? ''; + }, [matchedPrebuiltRule, ruleMigration.elastic_rule?.query]); + + return ( + <> + <EuiSpacer size="m" /> + {ruleMigration.translation_result && !isInstalled && ( + <> + <TranslationCallOut translationResult={ruleMigration.translation_result} /> + <EuiSpacer size="m" /> + </> + )} + <EuiAccordion + id="translationQueryItem" + buttonContent={<TranslationTabHeader />} + initialIsOpen={true} + > + <EuiFlexItem> + <EuiSpacer size="s" /> + <EuiSplitPanel.Outer grow hasShadow={false} hasBorder={true}> + <EuiSplitPanel.Inner grow={false} color="subdued" paddingSize="s"> + <EuiFlexGroup justifyContent="flexEnd"> + <EuiFlexItem grow={false}> + <EuiTitle size="xxs"> + <h2> + <FormattedMessage + id="xpack.securitySolution.detectionEngine.translationDetails.translationTab.statusTitle" + defaultMessage="Translation status" + /> + </h2> + </EuiTitle> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiBadge + color={convertTranslationResultIntoColor(ruleMigration.translation_result)} + onClick={() => {}} + onClickAriaLabel={'Click to update translation status'} + > + {isInstalled + ? i18n.INSTALLED_LABEL + : convertTranslationResultIntoText(ruleMigration.translation_result)} + </EuiBadge> + </EuiFlexItem> + </EuiFlexGroup> + </EuiSplitPanel.Inner> + <EuiSplitPanel.Inner grow> + <EuiFlexGroup gutterSize="s" alignItems="flexStart"> + <EuiFlexItem grow={1}> + <MigrationRuleQuery + title={i18n.SPLUNK_QUERY_TITLE} + ruleName={ruleMigration.original_rule.title} + query={originalQuery} + canEdit={false} + /> + </EuiFlexItem> + <EuiFlexItem + grow={0} + css={css` + align-self: stretch; + border-right: ${euiTheme.border.thin}; + `} + /> + <EuiFlexItem grow={1}> + <MigrationRuleQuery + title={i18n.ESQL_TRANSLATION_TITLE} + ruleName={ruleName} + query={elasticQuery} + canEdit={canEdit} + onTranslationUpdate={onTranslationUpdate} + /> + </EuiFlexItem> + </EuiFlexGroup> + </EuiSplitPanel.Inner> + </EuiSplitPanel.Outer> + </EuiFlexItem> + </EuiAccordion> + </> + ); + } +); +TranslationTab.displayName = 'TranslationTab'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/migration_rule_query.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/migration_rule_query.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/migration_rule_query.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/migration_rule_query.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/schema.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/schema.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/schema.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/schema.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/translations.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/types.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/tabs/translation/types.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translations.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table/bulk_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table/bulk_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table/bulk_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table/bulk_actions.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table/empty_migration.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table/empty_migration.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table/empty_migration.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table/empty_migration.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table/index.tsx new file mode 100644 index 0000000000000..b883934a0bdcb --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table/index.tsx @@ -0,0 +1,299 @@ +/* + * 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 { CriteriaWithPagination, EuiTableSelectionType } from '@elastic/eui'; +import { + EuiSkeletonLoading, + EuiSkeletonTitle, + EuiSkeletonText, + EuiFlexGroup, + EuiFlexItem, + EuiSpacer, + EuiBasicTable, + EuiButton, +} from '@elastic/eui'; +import React, { useCallback, useMemo, useState } from 'react'; + +import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; +import type { RuleMigration } from '../../../../../common/siem_migrations/model/rule_migration.gen'; +import { EmptyMigration } from './empty_migration'; +import { useMigrationRulesTableColumns } from '../../hooks/use_migration_rules_table_columns'; +import { useMigrationRuleDetailsFlyout } from '../../hooks/use_migration_rule_preview_flyout'; +import { useInstallMigrationRules } from '../../logic/use_install_migration_rules'; +import { useGetMigrationRules } from '../../logic/use_get_migration_rules'; +import { useInstallTranslatedMigrationRules } from '../../logic/use_install_translated_migration_rules'; +import { useGetMigrationTranslationStats } from '../../logic/use_get_migration_translation_stats'; +import { useGetMigrationPrebuiltRules } from '../../logic/use_get_migration_prebuilt_rules'; +import * as logicI18n from '../../logic/translations'; +import { BulkActions } from './bulk_actions'; +import { SearchField } from './search_field'; +import { RuleTranslationResult } from '../../../../../common/siem_migrations/constants'; +import * as i18n from './translations'; + +const DEFAULT_PAGE_SIZE = 10; +const DEFAULT_SORT_FIELD = 'translation_result'; +const DEFAULT_SORT_DIRECTION = 'desc'; + +export interface MigrationRulesTableProps { + /** + * Selected rule migration id + */ + migrationId: string; +} + +/** + * Table Component for displaying SIEM rules migrations + */ +export const MigrationRulesTable: React.FC<MigrationRulesTableProps> = React.memo( + ({ migrationId }) => { + const { addError } = useAppToasts(); + + const [pageIndex, setPageIndex] = useState(0); + const [pageSize, setPageSize] = useState(DEFAULT_PAGE_SIZE); + const [sortField, setSortField] = useState<keyof RuleMigration>(DEFAULT_SORT_FIELD); + const [sortDirection, setSortDirection] = useState<'asc' | 'desc'>(DEFAULT_SORT_DIRECTION); + const [searchTerm, setSearchTerm] = useState<string | undefined>(); + + const { data: translationStats, isLoading: isStatsLoading } = + useGetMigrationTranslationStats(migrationId); + + const { data: prebuiltRules = {}, isLoading: isPrebuiltRulesLoading } = + useGetMigrationPrebuiltRules(migrationId); + + const { + data: { ruleMigrations, total } = { ruleMigrations: [], total: 0 }, + isLoading: isDataLoading, + } = useGetMigrationRules({ + migrationId, + page: pageIndex, + perPage: pageSize, + sortField, + sortDirection, + searchTerm, + }); + + const [selectedRuleMigrations, setSelectedRuleMigrations] = useState<RuleMigration[]>([]); + const tableSelection: EuiTableSelectionType<RuleMigration> = useMemo( + () => ({ + selectable: (item: RuleMigration) => { + return !item.elastic_rule?.id && item.translation_result === RuleTranslationResult.FULL; + }, + selectableMessage: (selectable: boolean, item: RuleMigration) => { + if (selectable) { + return ''; + } + return item.elastic_rule?.id + ? i18n.ALREADY_TRANSLATED_RULE_TOOLTIP + : i18n.NOT_FULLY_TRANSLATED_RULE_TOOLTIP; + }, + onSelectionChange: setSelectedRuleMigrations, + selected: selectedRuleMigrations, + }), + [selectedRuleMigrations] + ); + + const pagination = useMemo(() => { + return { + pageIndex, + pageSize, + totalItemCount: total, + }; + }, [pageIndex, pageSize, total]); + + const sorting = useMemo(() => { + return { + sort: { + field: sortField, + direction: sortDirection, + }, + }; + }, [sortDirection, sortField]); + + const onTableChange = useCallback(({ page, sort }: CriteriaWithPagination<RuleMigration>) => { + if (page) { + setPageIndex(page.index); + setPageSize(page.size); + } + if (sort) { + const { field, direction } = sort; + setSortField(field); + setSortDirection(direction); + } + }, []); + + const handleOnSearch = useCallback((value: string) => { + setSearchTerm(value.trim()); + }, []); + + const { mutateAsync: installMigrationRules } = useInstallMigrationRules(migrationId); + const { mutateAsync: installTranslatedMigrationRules } = + useInstallTranslatedMigrationRules(migrationId); + + const [isTableLoading, setTableLoading] = useState(false); + const installSingleRule = useCallback( + async (migrationRule: RuleMigration, enabled = false) => { + setTableLoading(true); + try { + await installMigrationRules({ ids: [migrationRule.id], enabled }); + } catch (error) { + addError(error, { title: logicI18n.INSTALL_MIGRATION_RULES_FAILURE }); + } finally { + setTableLoading(false); + } + }, + [addError, installMigrationRules] + ); + + const installSelectedRule = useCallback( + async (enabled = false) => { + setTableLoading(true); + try { + await installMigrationRules({ + ids: selectedRuleMigrations.map((rule) => rule.id), + enabled, + }); + } catch (error) { + addError(error, { title: logicI18n.INSTALL_MIGRATION_RULES_FAILURE }); + } finally { + setTableLoading(false); + setSelectedRuleMigrations([]); + } + }, + [addError, installMigrationRules, selectedRuleMigrations] + ); + + const installTranslatedRules = useCallback( + async (enable?: boolean) => { + setTableLoading(true); + try { + await installTranslatedMigrationRules(); + } catch (error) { + addError(error, { title: logicI18n.INSTALL_MIGRATION_RULES_FAILURE }); + } finally { + setTableLoading(false); + } + }, + [addError, installTranslatedMigrationRules] + ); + + const isLoading = isStatsLoading || isPrebuiltRulesLoading || isDataLoading || isTableLoading; + + const ruleActionsFactory = useCallback( + (ruleMigration: RuleMigration, closeRulePreview: () => void) => { + const canMigrationRuleBeInstalled = + !isLoading && + !ruleMigration.elastic_rule?.id && + ruleMigration.translation_result === RuleTranslationResult.FULL; + return ( + <EuiFlexGroup> + <EuiFlexItem> + <EuiButton + disabled={!canMigrationRuleBeInstalled} + onClick={() => { + installSingleRule(ruleMigration); + closeRulePreview(); + }} + data-test-subj="installMigrationRuleFromFlyoutButton" + > + {i18n.INSTALL_WITHOUT_ENABLING_BUTTON_LABEL} + </EuiButton> + </EuiFlexItem> + <EuiFlexItem> + <EuiButton + disabled={!canMigrationRuleBeInstalled} + onClick={() => { + installSingleRule(ruleMigration, true); + closeRulePreview(); + }} + fill + data-test-subj="installAndEnableMigrationRuleFromFlyoutButton" + > + {i18n.INSTALL_AND_ENABLE_BUTTON_LABEL} + </EuiButton> + </EuiFlexItem> + </EuiFlexGroup> + ); + }, + [installSingleRule, isLoading] + ); + + const getMigrationRule = useCallback( + (ruleId: string) => { + if (!isLoading && ruleMigrations.length) { + return ruleMigrations.find((item) => item.id === ruleId); + } + }, + [isLoading, ruleMigrations] + ); + + const { + migrationRuleDetailsFlyout: rulePreviewFlyout, + openMigrationRuleDetails: openRulePreview, + } = useMigrationRuleDetailsFlyout({ + isLoading, + prebuiltRules, + getMigrationRule, + ruleActionsFactory, + }); + + const rulesColumns = useMigrationRulesTableColumns({ + disableActions: isTableLoading, + openMigrationRuleDetails: openRulePreview, + installMigrationRule: installSingleRule, + }); + + return ( + <> + <EuiSkeletonLoading + isLoading={isDataLoading} + loadingContent={ + <> + <EuiSkeletonTitle /> + <EuiSkeletonText /> + </> + } + loadedContent={ + !translationStats?.rules.total ? ( + <EmptyMigration /> + ) : ( + <> + <EuiFlexGroup gutterSize="m" justifyContent="flexEnd" wrap> + <EuiFlexItem> + <SearchField initialValue={searchTerm} onSearch={handleOnSearch} /> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <BulkActions + isTableLoading={isLoading} + numberOfTranslatedRules={translationStats?.rules.success.installable ?? 0} + numberOfSelectedRules={selectedRuleMigrations.length} + installTranslatedRule={installTranslatedRules} + installSelectedRule={installSelectedRule} + /> + </EuiFlexItem> + </EuiFlexGroup> + <EuiSpacer size="m" /> + <EuiBasicTable<RuleMigration> + loading={isTableLoading} + items={ruleMigrations} + pagination={pagination} + sorting={sorting} + onChange={onTableChange} + selection={tableSelection} + itemId={'id'} + data-test-subj={'rules-translation-table'} + columns={rulesColumns} + /> + </> + ) + } + /> + {rulePreviewFlyout} + </> + ); + } +); +MigrationRulesTable.displayName = 'MigrationRulesTable'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table/search_field.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table/search_field.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table/search_field.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table/search_field.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/actions.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/author.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/author.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/author.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/author.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/constants.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/constants.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/constants.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/constants.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/index.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/name.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/name.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/name.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/name.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/risk_score.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/risk_score.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/risk_score.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/risk_score.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/severity.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/severity.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/severity.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/severity.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/status.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/status.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/status.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/status.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/translations.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/updated.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/updated.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/updated.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/updated.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/status_badge/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/status_badge/index.tsx new file mode 100644 index 0000000000000..867c5034ba9eb --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/status_badge/index.tsx @@ -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 React from 'react'; + +import { EuiFlexGroup, EuiFlexItem, EuiHealth, EuiIcon, EuiToolTip } from '@elastic/eui'; +import { css } from '@emotion/css'; +import { RuleTranslationResult } from '../../../../../common/siem_migrations/constants'; +import { + convertTranslationResultIntoText, + useResultVisColors, +} from '../../utils/translation_results'; +import { + RuleMigrationStatusEnum, + type RuleMigration, +} from '../../../../../common/siem_migrations/model/rule_migration.gen'; +import * as i18n from './translations'; + +const statusTextWrapperClassName = css` + width: 100%; + display: inline-grid; +`; + +interface StatusBadgeProps { + migrationRule: RuleMigration; + 'data-test-subj'?: string; +} + +export const StatusBadge: React.FC<StatusBadgeProps> = React.memo( + ({ migrationRule, 'data-test-subj': dataTestSubj = 'translation-result' }) => { + const colors = useResultVisColors(); + // Installed + if (migrationRule.elastic_rule?.id) { + return ( + <EuiToolTip content={i18n.RULE_STATUS_INSTALLED}> + <EuiFlexGroup gutterSize="xs" alignItems="center"> + <EuiFlexItem grow={false}> + <EuiIcon type="check" color={colors[RuleTranslationResult.FULL]} /> + </EuiFlexItem> + <EuiFlexItem grow={false}>{i18n.RULE_STATUS_INSTALLED}</EuiFlexItem> + </EuiFlexGroup> + </EuiToolTip> + ); + } + + // Failed + if (migrationRule.status === RuleMigrationStatusEnum.failed) { + return ( + <EuiToolTip content={i18n.RULE_STATUS_FAILED}> + <EuiFlexGroup gutterSize="xs" alignItems="center"> + <EuiFlexItem grow={false}> + <EuiIcon type="warningFilled" color="danger" /> + </EuiFlexItem> + <EuiFlexItem grow={false}>{i18n.RULE_STATUS_FAILED}</EuiFlexItem> + </EuiFlexGroup> + </EuiToolTip> + ); + } + + const translationResult = migrationRule.translation_result ?? 'untranslatable'; + const displayValue = convertTranslationResultIntoText(translationResult); + const color = colors[translationResult]; + + return ( + <EuiToolTip content={displayValue}> + <EuiHealth color={color} data-test-subj={dataTestSubj}> + <div className={statusTextWrapperClassName}> + <span className="eui-textTruncate">{displayValue}</span> + </div> + </EuiHealth> + </EuiToolTip> + ); + } +); +StatusBadge.displayName = 'StatusBadge'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/status_badge/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/status_badge/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/status_badge/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/status_badge/translations.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/unknown_migration/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/unknown_migration/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/unknown_migration/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/unknown_migration/index.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/unknown_migration/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/unknown_migration/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/components/unknown_migration/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/components/unknown_migration/translations.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/hooks/use_migration_rule_preview_flyout.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/hooks/use_migration_rule_preview_flyout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/hooks/use_migration_rule_preview_flyout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/hooks/use_migration_rule_preview_flyout.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/hooks/use_migration_rules_table_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/hooks/use_migration_rules_table_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/hooks/use_migration_rules_table_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/hooks/use_migration_rules_table_columns.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/logic/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/logic/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/logic/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/logic/constants.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/logic/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/logic/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/logic/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/logic/translations.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/logic/use_get_migration_prebuilt_rules.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/logic/use_get_migration_prebuilt_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/logic/use_get_migration_prebuilt_rules.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/logic/use_get_migration_prebuilt_rules.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/logic/use_get_migration_rules.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/logic/use_get_migration_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/logic/use_get_migration_rules.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/logic/use_get_migration_rules.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/logic/use_get_migration_translation_stats.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/logic/use_get_migration_translation_stats.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/logic/use_get_migration_translation_stats.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/logic/use_get_migration_translation_stats.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/logic/use_install_migration_rules.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/logic/use_install_migration_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/logic/use_install_migration_rules.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/logic/use_install_migration_rules.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/logic/use_install_translated_migration_rules.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/logic/use_install_translated_migration_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/logic/use_install_translated_migration_rules.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/logic/use_install_translated_migration_rules.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/logic/use_update_migration_rules.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/logic/use_update_migration_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/logic/use_update_migration_rules.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/logic/use_update_migration_rules.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/pages/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/pages/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/pages/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/pages/index.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/pages/translations.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/pages/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/pages/translations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/pages/translations.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/common/api_request_reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/common/api_request_reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/common/api_request_reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/common/api_request_reducer.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/translations.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_create_migration.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_create_migration.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_create_migration.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_create_migration.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_get_missing_resources.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_get_missing_resources.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_get_missing_resources.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_get_missing_resources.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_start_migration.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_start_migration.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_start_migration.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_start_migration.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_upsert_resources.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_upsert_resources.ts similarity index 94% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_upsert_resources.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_upsert_resources.ts index eab3888422bae..5ed8541a4af49 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_upsert_resources.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_upsert_resources.ts @@ -20,7 +20,7 @@ export type UpsertResources = ( migrationId: string, data: UpsertRuleMigrationResourcesRequestBody ) => void; -export type OnSuccess = () => void; +export type OnSuccess = (data: UpsertRuleMigrationResourcesRequestBody) => void; export const useUpsertResources = (onSuccess: OnSuccess) => { const { siemMigrations, notifications } = useKibana().services; @@ -33,7 +33,7 @@ export const useUpsertResources = (onSuccess: OnSuccess) => { dispatch({ type: 'start' }); await siemMigrations.rules.upsertMigrationResources(migrationId, data); - onSuccess(); + onSuccess(data); dispatch({ type: 'success' }); } catch (err) { const apiError = err.body ?? err; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/rule_migrations_service.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/rule_migrations_service.ts similarity index 98% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/service/rule_migrations_service.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/rule_migrations_service.ts index 75b7887db6525..83ead556b09cc 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/rule_migrations_service.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/rule_migrations_service.ts @@ -45,7 +45,7 @@ import * as i18n from './translations'; const NAMESPACE_TRACE_OPTIONS_SESSION_STORAGE_KEY = `${DEFAULT_ASSISTANT_NAMESPACE}.${TRACE_OPTIONS_SESSION_STORAGE_KEY}` as const; -const REQUEST_POLLING_INTERVAL_MS = 5000 as const; +const REQUEST_POLLING_INTERVAL_SECONDS = 10 as const; const CREATE_MIGRATION_BODY_BATCH_SIZE = 50 as const; export class SiemRulesMigrationsService { @@ -213,7 +213,7 @@ export class SiemRulesMigrationsService { } } - await new Promise((resolve) => setTimeout(resolve, REQUEST_POLLING_INTERVAL_MS)); + await new Promise((resolve) => setTimeout(resolve, REQUEST_POLLING_INTERVAL_SECONDS * 1000)); } while (pendingMigrationIds.length > 0); } } diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/storage.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/storage.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/service/storage.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/storage.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/success_notification.tsx b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/success_notification.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/service/success_notification.tsx rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/success_notification.tsx diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/service/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/service/translations.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/types.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/rules/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/types.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/utils/translation_results/index.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/utils/translation_results/index.ts new file mode 100644 index 0000000000000..d25c252fb8fec --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/utils/translation_results/index.ts @@ -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 { useEuiTheme } from '@elastic/eui'; +import { RuleTranslationResult } from '../../../../../common/siem_migrations/constants'; +import type { RuleMigrationTranslationResult } from '../../../../../common/siem_migrations/model/rule_migration.gen'; +import * as i18n from './translations'; + +export const useResultVisColors = () => { + const { euiTheme } = useEuiTheme(); + return { + [RuleTranslationResult.FULL]: euiTheme.colors.vis.euiColorVis0, + [RuleTranslationResult.PARTIAL]: euiTheme.colors.vis.euiColorVis5, + [RuleTranslationResult.UNTRANSLATABLE]: euiTheme.colors.vis.euiColorVis7, + error: euiTheme.colors.vis.euiColorVis9, + }; +}; + +export const convertTranslationResultIntoColor = (status?: RuleMigrationTranslationResult) => { + switch (status) { + case RuleTranslationResult.FULL: + return 'primary'; + case RuleTranslationResult.PARTIAL: + return 'warning'; + case RuleTranslationResult.UNTRANSLATABLE: + return 'danger'; + default: + return 'subdued'; + } +}; + +export const convertTranslationResultIntoText = (status?: RuleMigrationTranslationResult) => { + switch (status) { + case RuleTranslationResult.FULL: + return i18n.SIEM_TRANSLATION_RESULT_FULL_LABEL; + case RuleTranslationResult.PARTIAL: + return i18n.SIEM_TRANSLATION_RESULT_PARTIAL_LABEL; + case RuleTranslationResult.UNTRANSLATABLE: + return i18n.SIEM_TRANSLATION_RESULT_UNTRANSLATABLE_LABEL; + default: + return i18n.SIEM_TRANSLATION_RESULT_UNKNOWN_LABEL; + } +}; diff --git a/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/utils/translation_results/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/utils/translation_results/translations.ts new file mode 100644 index 0000000000000..f0f38cfc61481 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/rules/utils/translation_results/translations.ts @@ -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 { i18n } from '@kbn/i18n'; + +export const SIEM_TRANSLATION_RESULT_FULL_LABEL = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.translationResult.full', + { + defaultMessage: 'Translated', + } +); + +export const SIEM_TRANSLATION_RESULT_PARTIAL_LABEL = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.translationResult.partially', + { + defaultMessage: 'Partially translated', + } +); + +export const SIEM_TRANSLATION_RESULT_UNTRANSLATABLE_LABEL = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.translationResult.untranslatable', + { + defaultMessage: 'Needs manual translation', + } +); + +export const SIEM_TRANSLATION_RESULT_UNKNOWN_LABEL = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.translationResult.unknown', + { + defaultMessage: 'Unknown', + } +); + +export const SIEM_TRANSLATION_RESULT_UNKNOWN_ERROR = (status?: string) => { + return i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.translationResult.unknownError', + { + defaultMessage: 'Unknown translation result status: ({status})', + values: { status }, + } + ); +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/service/index.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/service/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/service/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/service/index.ts diff --git a/x-pack/plugins/security_solution/public/siem_migrations/service/siem_migrations_service.ts b/x-pack/solutions/security/plugins/security_solution/public/siem_migrations/service/siem_migrations_service.ts similarity index 100% rename from x-pack/plugins/security_solution/public/siem_migrations/service/siem_migrations_service.ts rename to x-pack/solutions/security/plugins/security_solution/public/siem_migrations/service/siem_migrations_service.ts diff --git a/x-pack/plugins/security_solution/public/sourcerer/components/alerts_sourcerer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/alerts_sourcerer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/components/alerts_sourcerer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/alerts_sourcerer.test.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/components/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/components/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/components/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/components/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/components/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/components/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/index.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/components/misc.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/misc.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/components/misc.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/misc.test.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/components/readme.md b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/readme.md similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/components/readme.md rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/readme.md diff --git a/x-pack/plugins/security_solution/public/sourcerer/components/refresh_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/refresh_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/components/refresh_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/refresh_button.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/components/sourcerer_integration.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/sourcerer_integration.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/components/sourcerer_integration.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/sourcerer_integration.test.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/components/sub_components.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/sub_components.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/components/sub_components.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/sub_components.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/components/temporary.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/temporary.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/components/temporary.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/temporary.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/components/timeline_sourcerer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/timeline_sourcerer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/components/timeline_sourcerer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/timeline_sourcerer.test.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/components/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/components/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/translations.ts diff --git a/x-pack/plugins/security_solution/public/sourcerer/components/trigger.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/trigger.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/components/trigger.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/trigger.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/components/update_default_data_view_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/update_default_data_view_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/components/update_default_data_view_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/update_default_data_view_modal.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/components/use_get_sourcerer_data_view.test.ts b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/use_get_sourcerer_data_view.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/components/use_get_sourcerer_data_view.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/use_get_sourcerer_data_view.test.ts diff --git a/x-pack/plugins/security_solution/public/sourcerer/components/use_get_sourcerer_data_view.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/use_get_sourcerer_data_view.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/components/use_get_sourcerer_data_view.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/use_get_sourcerer_data_view.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/components/use_pick_index_patterns.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/use_pick_index_patterns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/components/use_pick_index_patterns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/use_pick_index_patterns.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/components/use_update_data_view.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/use_update_data_view.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/components/use_update_data_view.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/use_update_data_view.test.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/components/use_update_data_view.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/use_update_data_view.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/components/use_update_data_view.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/use_update_data_view.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/components/utils.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/utils.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/components/utils.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/components/utils.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts diff --git a/x-pack/plugins/security_solution/public/sourcerer/containers/get_sourcerer_data_view.test.ts b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/get_sourcerer_data_view.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/containers/get_sourcerer_data_view.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/get_sourcerer_data_view.test.ts diff --git a/x-pack/plugins/security_solution/public/sourcerer/containers/get_sourcerer_data_view.ts b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/get_sourcerer_data_view.ts similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/containers/get_sourcerer_data_view.ts rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/get_sourcerer_data_view.ts diff --git a/x-pack/plugins/security_solution/public/sourcerer/containers/hooks.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/hooks.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/containers/hooks.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/hooks.test.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/containers/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/containers/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/index.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/containers/mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/containers/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/mocks.ts diff --git a/x-pack/plugins/security_solution/public/sourcerer/containers/readme.md b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/readme.md similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/containers/readme.md rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/readme.md diff --git a/x-pack/plugins/security_solution/public/sourcerer/containers/sourcerer_paths.ts b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/sourcerer_paths.ts similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/containers/sourcerer_paths.ts rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/sourcerer_paths.ts diff --git a/x-pack/plugins/security_solution/public/sourcerer/containers/use_init_sourcerer.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/use_init_sourcerer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/containers/use_init_sourcerer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/use_init_sourcerer.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/containers/use_signal_helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/use_signal_helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/containers/use_signal_helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/use_signal_helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/sourcerer/containers/use_signal_helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/use_signal_helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/containers/use_signal_helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/containers/use_signal_helpers.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/sourcerer/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/jest.config.js new file mode 100644 index 0000000000000..087e58a095847 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/sourcerer'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/sourcerer', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/sourcerer/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/sourcerer/store/actions.ts b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/store/actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/actions.ts diff --git a/x-pack/plugins/security_solution/public/sourcerer/store/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/store/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/sourcerer/store/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/store/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/helpers.ts diff --git a/x-pack/plugins/security_solution/public/sourcerer/store/index.ts b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/store/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/index.ts diff --git a/x-pack/plugins/security_solution/public/sourcerer/store/model.ts b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/model.ts similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/store/model.ts rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/model.ts diff --git a/x-pack/plugins/security_solution/public/sourcerer/store/readme.md b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/readme.md similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/store/readme.md rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/readme.md diff --git a/x-pack/plugins/security_solution/public/sourcerer/store/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/store/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/reducer.ts diff --git a/x-pack/plugins/security_solution/public/sourcerer/store/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/sourcerer/store/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/sourcerer/store/selectors.ts diff --git a/x-pack/plugins/security_solution/public/threat_intelligence/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/threat_intelligence/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/threat_intelligence/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/threat_intelligence/index.tsx diff --git a/x-pack/plugins/security_solution/public/threat_intelligence/links.ts b/x-pack/solutions/security/plugins/security_solution/public/threat_intelligence/links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/threat_intelligence/links.ts rename to x-pack/solutions/security/plugins/security_solution/public/threat_intelligence/links.ts diff --git a/x-pack/plugins/security_solution/public/threat_intelligence/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/threat_intelligence/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/threat_intelligence/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/threat_intelligence/routes.tsx diff --git a/x-pack/plugins/security_solution/public/threat_intelligence/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/threat_intelligence/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/threat_intelligence/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/threat_intelligence/translations.ts diff --git a/x-pack/plugins/security_solution/public/threat_intelligence/use_investigate_in_timeline.ts b/x-pack/solutions/security/plugins/security_solution/public/threat_intelligence/use_investigate_in_timeline.ts similarity index 95% rename from x-pack/plugins/security_solution/public/threat_intelligence/use_investigate_in_timeline.ts rename to x-pack/solutions/security/plugins/security_solution/public/threat_intelligence/use_investigate_in_timeline.ts index f840e65497cc4..7ae6c41ebd124 100644 --- a/x-pack/plugins/security_solution/public/threat_intelligence/use_investigate_in_timeline.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/threat_intelligence/use_investigate_in_timeline.ts @@ -34,7 +34,7 @@ interface UseInvestigateInTimelineActionProps { /** * Hook passed down to the Threat Intelligence plugin, via context. - * This code is closely duplicated from here: https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_investigate_in_timeline.tsx, + * This code is closely duplicated from here: https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/use_investigate_in_timeline.tsx, * the main changes being: * - no exceptions are handled at the moment * - we use dataProviders, from and to directly instead of consuming ecsData diff --git a/x-pack/plugins/security_solution/public/timelines/components/add_to_favorites/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/add_to_favorites/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/add_to_favorites/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/add_to_favorites/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/add_to_favorites/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/add_to_favorites/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/add_to_favorites/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/add_to_favorites/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/bottom_bar/add_timeline_button.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/bottom_bar/add_timeline_button.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/bottom_bar/add_timeline_button.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/bottom_bar/add_timeline_button.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/bottom_bar/add_timeline_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/bottom_bar/add_timeline_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/bottom_bar/add_timeline_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/bottom_bar/add_timeline_button.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/bottom_bar/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/bottom_bar/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/bottom_bar/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/bottom_bar/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/bottom_bar/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/bottom_bar/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/bottom_bar/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/bottom_bar/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/bottom_bar/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/bottom_bar/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/bottom_bar/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/bottom_bar/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/certificate_fingerprint/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/certificate_fingerprint/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/certificate_fingerprint/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/certificate_fingerprint/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/certificate_fingerprint/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/certificate_fingerprint/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/certificate_fingerprint/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/certificate_fingerprint/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/certificate_fingerprint/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/certificate_fingerprint/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/certificate_fingerprint/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/certificate_fingerprint/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/duration/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/duration/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/duration/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/duration/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/duration/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/duration/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/duration/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/duration/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/components/components.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/components/components.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/components/components.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/components/components.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/components/controlled_combobox_input.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/components/controlled_combobox_input.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/components/controlled_combobox_input.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/components/controlled_combobox_input.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/components/controlled_default_input.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/components/controlled_default_input.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/components/controlled_default_input.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/components/controlled_default_input.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/components/index.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/components/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/components/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/components/index.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/edit_data_provider/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/edit_data_provider/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/field_renderers/__snapshots__/field_renderers.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/field_renderers/__snapshots__/field_renderers.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/field_renderers/__snapshots__/field_renderers.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/field_renderers/__snapshots__/field_renderers.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/field_renderers/default_renderer/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/field_renderers/default_renderer/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/field_renderers/default_renderer/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/field_renderers/default_renderer/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/field_renderers/default_renderer/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/field_renderers/default_renderer/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/field_renderers/default_renderer/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/field_renderers/default_renderer/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/field_renderers/field_renderers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/field_renderers/field_renderers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/field_renderers/field_renderers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/field_renderers/field_renderers.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/field_renderers/field_renderers.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/field_renderers/field_renderers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/field_renderers/field_renderers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/field_renderers/field_renderers.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/field_renderers/more_container/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/field_renderers/more_container/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/field_renderers/more_container/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/field_renderers/more_container/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/field_renderers/more_container/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/field_renderers/more_container/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/field_renderers/more_container/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/field_renderers/more_container/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/fields_browser/create_field_button/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/fields_browser/create_field_button/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/fields_browser/create_field_button/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/fields_browser/create_field_button/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/fields_browser/create_field_button/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/fields_browser/create_field_button/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/fields_browser/create_field_button/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/fields_browser/create_field_button/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/fields_browser/create_field_button/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/fields_browser/create_field_button/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/fields_browser/create_field_button/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/fields_browser/create_field_button/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/fields_browser/field_table_columns/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/fields_browser/field_table_columns/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/fields_browser/field_table_columns/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/fields_browser/field_table_columns/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/fields_browser/field_table_columns/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/fields_browser/field_table_columns/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/fields_browser/field_table_columns/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/fields_browser/field_table_columns/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/fields_browser/field_table_columns/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/fields_browser/field_table_columns/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/fields_browser/field_table_columns/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/fields_browser/field_table_columns/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/fields_browser/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/fields_browser/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/fields_browser/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/fields_browser/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/fields_browser/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/fields_browser/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/fields_browser/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/fields_browser/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/formatted_duration/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/formatted_duration/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/formatted_duration/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/formatted_duration/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/formatted_duration/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/formatted_duration/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/formatted_duration/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/formatted_duration/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/formatted_duration/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/formatted_duration/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/formatted_duration/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/formatted_duration/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/formatted_duration/tooltip/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/formatted_duration/tooltip/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/formatted_duration/tooltip/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/formatted_duration/tooltip/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/formatted_duration/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/formatted_duration/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/formatted_duration/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/formatted_duration/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/formatted_ip/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/formatted_ip/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/formatted_ip/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/formatted_ip/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/graph_overlay/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/graph_overlay/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/graph_overlay/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/graph_overlay/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/graph_overlay/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/graph_overlay/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/graph_overlay/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/graph_overlay/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/ja3_fingerprint/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/ja3_fingerprint/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/ja3_fingerprint/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/ja3_fingerprint/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/ja3_fingerprint/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/ja3_fingerprint/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/ja3_fingerprint/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/ja3_fingerprint/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/ja3_fingerprint/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/ja3_fingerprint/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/ja3_fingerprint/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/ja3_fingerprint/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/lazy_accordion/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/lazy_accordion/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/lazy_accordion/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/lazy_accordion/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/loading/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/loading/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/loading/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/loading/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/modal/actions/attach_to_case_button.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/attach_to_case_button.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/modal/actions/attach_to_case_button.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/attach_to_case_button.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/modal/actions/attach_to_case_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/attach_to_case_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/modal/actions/attach_to_case_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/attach_to_case_button.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/modal/actions/new_timeline_button.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/new_timeline_button.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/modal/actions/new_timeline_button.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/new_timeline_button.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/modal/actions/new_timeline_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/new_timeline_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/modal/actions/new_timeline_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/new_timeline_button.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/modal/actions/open_timeline_button.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/open_timeline_button.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/modal/actions/open_timeline_button.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/open_timeline_button.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/modal/actions/open_timeline_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/open_timeline_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/modal/actions/open_timeline_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/open_timeline_button.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/modal/actions/save_timeline_button.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/save_timeline_button.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/modal/actions/save_timeline_button.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/save_timeline_button.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/modal/actions/save_timeline_button.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/save_timeline_button.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/modal/actions/save_timeline_button.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/save_timeline_button.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/modal/actions/save_timeline_modal.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/save_timeline_modal.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/modal/actions/save_timeline_modal.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/save_timeline_modal.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/modal/actions/save_timeline_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/save_timeline_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/modal/actions/save_timeline_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/save_timeline_modal.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/modal/actions/schema.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/schema.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/modal/actions/schema.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/schema.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/modal/actions/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/modal/actions/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/actions/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/modal/custom_portal.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/custom_portal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/modal/custom_portal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/custom_portal.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/modal/header/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/header/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/modal/header/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/header/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/modal/header/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/header/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/modal/header/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/header/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/modal/index.styles.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/index.styles.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/modal/index.styles.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/index.styles.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/modal/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/modal/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/modal/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/modal/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/modal/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/modal/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/modal/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/netflow/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/netflow/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/netflow/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/netflow/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/netflow/fingerprints/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/netflow/fingerprints/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/netflow/fingerprints/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/netflow/fingerprints/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/netflow/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/netflow/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/netflow/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/netflow/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/netflow/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/netflow/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/netflow/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/netflow/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/netflow/netflow_columns/duration_event_start_end.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/netflow/netflow_columns/duration_event_start_end.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/netflow/netflow_columns/duration_event_start_end.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/netflow/netflow_columns/duration_event_start_end.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/netflow/netflow_columns/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/netflow/netflow_columns/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/netflow/netflow_columns/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/netflow/netflow_columns/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/netflow/netflow_columns/types.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/netflow/netflow_columns/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/netflow/netflow_columns/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/netflow/netflow_columns/types.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/netflow/netflow_columns/user_process.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/netflow/netflow_columns/user_process.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/netflow/netflow_columns/user_process.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/netflow/netflow_columns/user_process.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/netflow/types.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/netflow/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/netflow/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/netflow/types.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/new_timeline/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/new_timeline/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/new_timeline/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/new_timeline/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/new_timeline/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/new_timeline/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/new_timeline/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/new_timeline/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/notes/add_note/__snapshots__/new_note.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/add_note/__snapshots__/new_note.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/notes/add_note/__snapshots__/new_note.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/add_note/__snapshots__/new_note.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/notes/add_note/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/add_note/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/notes/add_note/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/add_note/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/notes/add_note/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/add_note/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/notes/add_note/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/add_note/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/notes/add_note/new_note.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/add_note/new_note.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/notes/add_note/new_note.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/add_note/new_note.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/notes/add_note/new_note.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/add_note/new_note.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/notes/add_note/new_note.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/add_note/new_note.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/notes/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/notes/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/notes/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/notes/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/notes/note_cards/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/note_cards/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/notes/note_cards/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/note_cards/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/notes/note_cards/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/note_cards/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/notes/note_cards/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/note_cards/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/notes/old_notes.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/old_notes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/notes/old_notes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/old_notes.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/notes/participants.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/participants.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/notes/participants.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/participants.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/notes/participants.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/participants.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/notes/participants.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/participants.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/notes/save_timeline.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/save_timeline.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/notes/save_timeline.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/save_timeline.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/notes/save_timeline.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/save_timeline.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/notes/save_timeline.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/save_timeline.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/notes/test_ids.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/test_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/notes/test_ids.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/test_ids.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/notes/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/notes/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/notes/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/constants.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/delete_timeline_modal.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/delete_timeline_modal.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/delete_timeline_modal.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/delete_timeline_modal.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/delete_timeline_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/delete_timeline_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/delete_timeline_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/delete_timeline_modal.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/delete_timeline_modal/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/edit_timeline_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/edit_timeline_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/edit_timeline_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/edit_timeline_actions.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/edit_timeline_batch_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/edit_timeline_batch_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/edit_timeline_batch_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/edit_timeline_batch_actions.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/export_timeline.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/export_timeline.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/export_timeline.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/export_timeline.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/export_timeline.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/export_timeline.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/export_timeline.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/export_timeline.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/export_timeline/mocks.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/helpers.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/note_previews/hooks/use_delete_note.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/note_previews/hooks/use_delete_note.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/note_previews/hooks/use_delete_note.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/note_previews/hooks/use_delete_note.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/note_previews/hooks/use_delete_note.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/note_previews/hooks/use_delete_note.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/note_previews/hooks/use_delete_note.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/note_previews/hooks/use_delete_note.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/note_previews/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/note_previews/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/note_previews/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/note_previews/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/note_previews/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/note_previews/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/note_previews/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/note_previews/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/note_previews/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/note_previews/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/note_previews/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/note_previews/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/open_timeline.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/open_timeline.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/open_timeline.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/open_timeline.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/open_timeline_modal_body.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/open_timeline_modal_body.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/open_timeline_modal_body.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/open_timeline_modal_body.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/open_timeline_modal_body.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/open_timeline_modal_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/open_timeline_modal_body.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/open_timeline_modal/open_timeline_modal_body.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/search_row/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/search_row/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/search_row/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/search_row/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/search_row/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/search_row/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/search_row/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/search_row/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/actions_columns.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/actions_columns.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/actions_columns.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/actions_columns.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/actions_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/actions_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/actions_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/actions_columns.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_columns.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_styles.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_styles.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_styles.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/common_styles.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/extended_columns.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/extended_columns.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/extended_columns.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/extended_columns.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/extended_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/extended_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/extended_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/extended_columns.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/icon_header_columns.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/icon_header_columns.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/icon_header_columns.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/icon_header_columns.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/icon_header_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/icon_header_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/icon_header_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/icon_header_columns.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/mocks.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/timelines_table/mocks.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/types.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/types.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/use_timeline_status.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/use_timeline_status.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/use_timeline_status.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/use_timeline_status.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/use_timeline_types.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/use_timeline_types.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/use_timeline_types.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/use_timeline_types.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/use_timeline_types.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/use_timeline_types.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/use_timeline_types.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/use_timeline_types.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/use_update_timeline.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/use_update_timeline.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/use_update_timeline.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/use_update_timeline.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/open_timeline/use_update_timeline.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/use_update_timeline.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/open_timeline/use_update_timeline.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/open_timeline/use_update_timeline.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderer_switch/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderer_switch/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderer_switch/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderer_switch/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderer_switch/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderer_switch/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderer_switch/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderer_switch/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderer_switch/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderer_switch/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderer_switch/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderer_switch/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/catalog/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/catalog/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/catalog/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/catalog/constants.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/catalog/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/catalog/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/catalog/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/catalog/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/catalog/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/catalog/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/catalog/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/catalog/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/constants.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/alerts.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/alerts.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/alerts.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/alerts.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/auditd.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/auditd.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/auditd.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/auditd.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/auditd_file.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/auditd_file.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/auditd_file.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/auditd_file.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/library.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/library.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/library.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/library.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/netflow.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/netflow.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/netflow.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/netflow.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/registry.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/registry.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/registry.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/registry.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/suricata.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/suricata.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/suricata.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/suricata.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_dns.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_dns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_dns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_dns.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_endgame_process.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_endgame_process.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_endgame_process.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_endgame_process.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_file.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_file.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_file.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_file.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_fim.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_fim.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_fim.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_fim.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_security_event.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_security_event.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_security_event.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_security_event.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_socket.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_socket.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_socket.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/system_socket.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/threat_match.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/threat_match.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/threat_match.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/threat_match.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/zeek.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/zeek.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/zeek.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/examples/zeek.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/row_renderers_browser.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/row_renderers_browser.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/row_renderers_browser.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/row_renderers_browser.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/row_renderers_browser/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/row_renderers_browser/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/save_status/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/save_status/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/save_status/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/save_status/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/save_status/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/save_status/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/save_status/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/save_status/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/default_headers.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_headers/default_headers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/default_headers.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_headers/default_headers.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/events_select/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_headers/events_select/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/events_select/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_headers/events_select/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/events_select/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_headers/events_select/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/events_select/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_headers/events_select/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/events_select/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_headers/events_select/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/events_select/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_headers/events_select/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_headers/helpers.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_headers/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_headers/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_headers/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_id.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_id.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/column_id.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/column_id.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/constants.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/constants.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/constants.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/control_columns/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/control_columns/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/control_columns/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/control_columns/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/control_columns/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/control_columns/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/control_columns/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/control_columns/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/stateful_row_renderer/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/events/stateful_row_renderer/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/stateful_row_renderer/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/events/stateful_row_renderer/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/stateful_row_renderer/use_stateful_row_renderer.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/events/stateful_row_renderer/use_stateful_row_renderer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/stateful_row_renderer/use_stateful_row_renderer.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/events/stateful_row_renderer/use_stateful_row_renderer.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/events/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/events/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/use_stateful_event_focus/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/events/use_stateful_event_focus/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/events/use_stateful_event_focus/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/events/use_stateful_event_focus/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/args.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/args.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/args.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/args.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/empty_column_renderer.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/empty_column_renderer.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/empty_column_renderer.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/empty_column_renderer.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/formatted_field.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/formatted_field.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/formatted_field.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/formatted_field.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/get_column_renderer.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/get_column_renderer.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/get_column_renderer.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/get_column_renderer.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/get_row_renderer.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/get_row_renderer.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/get_row_renderer.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/get_row_renderer.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/host_working_dir.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/host_working_dir.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/host_working_dir.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/host_working_dir.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/plain_column_renderer.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/plain_column_renderer.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/plain_column_renderer.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/plain_column_renderer.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/plain_row_renderer.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/plain_row_renderer.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/plain_row_renderer.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/plain_row_renderer.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/process_draggable.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/process_draggable.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/process_draggable.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/process_draggable.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/unknown_column_renderer.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/unknown_column_renderer.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/unknown_column_renderer.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/unknown_column_renderer.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/user_host_working_dir.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/user_host_working_dir.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/user_host_working_dir.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/__snapshots__/user_host_working_dir.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/alert_field/alert_field_badge/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/alert_field/alert_field_badge/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/alert_field/alert_field_badge/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/alert_field/alert_field_badge/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/alert_field/alert_field_badge/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/alert_field/alert_field_badge/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/alert_field/alert_field_badge/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/alert_field/alert_field_badge/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/alert_field/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/alert_field/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/alert_field/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/alert_field/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/alert_field/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/alert_field/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/alert_field/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/alert_field/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/helpers/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/helpers/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/helpers/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/helpers/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/helpers/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/helpers/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/helpers/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/helpers/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/alert_renderer/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/args.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/args.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/args.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/args.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/args.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/args.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/args.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/args.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/asset_criticality_level.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/asset_criticality_level.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/asset_criticality_level.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/asset_criticality_level.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/asset_criticality_level.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/asset_criticality_level.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/asset_criticality_level.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/asset_criticality_level.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/__snapshots__/generic_details.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/__snapshots__/generic_details.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/__snapshots__/generic_details.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/__snapshots__/generic_details.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/__snapshots__/generic_file_details.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/__snapshots__/generic_file_details.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/__snapshots__/generic_file_details.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/__snapshots__/generic_file_details.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/__snapshots__/generic_row_renderer.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/__snapshots__/generic_row_renderer.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/__snapshots__/generic_row_renderer.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/__snapshots__/generic_row_renderer.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/__snapshots__/primary_secondary_user_info.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/__snapshots__/primary_secondary_user_info.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/__snapshots__/primary_secondary_user_info.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/__snapshots__/primary_secondary_user_info.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/__snapshots__/session_user_host_working_dir.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/__snapshots__/session_user_host_working_dir.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/__snapshots__/session_user_host_working_dir.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/__snapshots__/session_user_host_working_dir.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_details.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_details.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_details.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_details.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_details.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_file_details.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_file_details.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_file_details.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_file_details.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_file_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_file_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_file_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_file_details.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_row_renderer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_row_renderer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_row_renderer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_row_renderer.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_row_renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_row_renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_row_renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/generic_row_renderer.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/primary_secondary_user_info.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/primary_secondary_user_info.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/primary_secondary_user_info.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/primary_secondary_user_info.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/primary_secondary_user_info.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/primary_secondary_user_info.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/primary_secondary_user_info.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/primary_secondary_user_info.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/session_user_host_working_dir.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/session_user_host_working_dir.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/session_user_host_working_dir.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/session_user_host_working_dir.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/session_user_host_working_dir.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/session_user_host_working_dir.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/session_user_host_working_dir.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/session_user_host_working_dir.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/auditd/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/bytes/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/bytes/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/bytes/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/bytes/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/bytes/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/bytes/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/bytes/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/bytes/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/column_renderer.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/column_renderer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/column_renderer.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/column_renderer.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/combine_renderers/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/combine_renderers/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/combine_renderers/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/combine_renderers/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/combine_renderers/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/combine_renderers/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/combine_renderers/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/combine_renderers/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/constants.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/constants.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/constants.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/constants.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/__snapshots__/threat_match_row.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/__snapshots__/threat_match_row.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/__snapshots__/threat_match_row.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/__snapshots__/threat_match_row.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/helpers.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/indicator_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/indicator_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/indicator_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/indicator_details.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/match_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/match_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/match_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/match_details.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/threat_match_row.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/threat_match_row.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/threat_match_row.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/threat_match_row.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/threat_match_row.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/threat_match_row.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/threat_match_row.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/threat_match_row.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/threat_match_row_renderer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/threat_match_row_renderer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/threat_match_row_renderer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/threat_match_row_renderer.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/threat_match_row_renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/threat_match_row_renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/threat_match_row_renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/threat_match_row_renderer.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/threat_match_rows.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/threat_match_rows.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/threat_match_rows.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/cti/threat_match_rows.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/dns/dns_request_event_details.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/dns/dns_request_event_details.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/dns/dns_request_event_details.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/dns/dns_request_event_details.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/dns/dns_request_event_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/dns/dns_request_event_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/dns/dns_request_event_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/dns/dns_request_event_details.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/dns/dns_request_event_details_line.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/dns/dns_request_event_details_line.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/dns/dns_request_event_details_line.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/dns/dns_request_event_details_line.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/dns/dns_request_event_details_line.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/dns/dns_request_event_details_line.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/dns/dns_request_event_details_line.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/dns/dns_request_event_details_line.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/dns/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/dns/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/dns/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/dns/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/empty_column_renderer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/empty_column_renderer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/empty_column_renderer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/empty_column_renderer.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/empty_column_renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/empty_column_renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/empty_column_renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/empty_column_renderer.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/endgame_security_event_details.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/endgame_security_event_details.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/endgame_security_event_details.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/endgame_security_event_details.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/endgame_security_event_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/endgame_security_event_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/endgame_security_event_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/endgame_security_event_details.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/endgame_security_event_details_line.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/endgame_security_event_details_line.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/endgame_security_event_details_line.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/endgame_security_event_details_line.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/endgame_security_event_details_line.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/endgame_security_event_details_line.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/endgame_security_event_details_line.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/endgame_security_event_details_line.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/helpers.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/endgame/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/event_summary_column_renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/event_summary_column_renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/event_summary_column_renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/event_summary_column_renderer.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/exit_code_draggable.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/exit_code_draggable.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/exit_code_draggable.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/exit_code_draggable.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/exit_code_draggable.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/exit_code_draggable.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/exit_code_draggable.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/exit_code_draggable.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/file_draggable.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/file_draggable.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/file_draggable.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/file_draggable.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/file_draggable.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/file_draggable.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/file_draggable.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/file_draggable.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/file_hash.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/file_hash.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/file_hash.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/file_hash.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/file_hash.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/file_hash.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/file_hash.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/file_hash.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field_helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field_helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field_helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field_helpers.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field_udt.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field_udt.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field_udt.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field_udt.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field_udt.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field_udt.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field_udt.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field_udt.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_column_renderer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_column_renderer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_column_renderer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_column_renderer.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_column_renderer.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_column_renderer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_column_renderer.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_column_renderer.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_row_renderer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_row_renderer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_row_renderer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_row_renderer.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_row_renderer.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_row_renderer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_row_renderer.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/get_row_renderer.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_name.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_name.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_name.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_name.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_name.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_name.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_name.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_name.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_working_dir.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_working_dir.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_working_dir.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_working_dir.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_working_dir.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_working_dir.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_working_dir.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_working_dir.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/index.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/index.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/__snapshots__/netflow_row_renderer.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/netflow_row_renderer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/netflow_row_renderer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/netflow_row_renderer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/netflow_row_renderer.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/netflow_row_renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/netflow_row_renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/netflow_row_renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/netflow/netflow_row_renderer.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/parent_process_draggable.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/parent_process_draggable.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/parent_process_draggable.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/parent_process_draggable.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/parent_process_draggable.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/parent_process_draggable.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/parent_process_draggable.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/parent_process_draggable.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/parse_query_value.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/parse_query_value.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/parse_query_value.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/parse_query_value.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/parse_query_value.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/parse_query_value.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/parse_query_value.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/parse_query_value.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/parse_value.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/parse_value.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/parse_value.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/parse_value.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/parse_value.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/parse_value.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/parse_value.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/parse_value.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/plain_column_renderer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/plain_column_renderer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/plain_column_renderer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/plain_column_renderer.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/plain_column_renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/plain_column_renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/plain_column_renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/plain_column_renderer.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/plain_row_renderer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/plain_row_renderer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/plain_row_renderer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/plain_row_renderer.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/plain_row_renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/plain_row_renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/plain_row_renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/plain_row_renderer.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/process_draggable.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/process_draggable.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/process_draggable.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/process_draggable.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/process_draggable.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/process_draggable.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/process_draggable.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/process_draggable.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/process_hash.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/process_hash.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/process_hash.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/process_hash.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/process_hash.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/process_hash.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/process_hash.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/process_hash.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/reason_column_renderer.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/registry/registry_event_details.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/registry/registry_event_details.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/registry/registry_event_details.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/registry/registry_event_details.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/registry/registry_event_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/registry/registry_event_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/registry/registry_event_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/registry/registry_event_details.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/registry/registry_event_details_line.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/registry/registry_event_details_line.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/registry/registry_event_details_line.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/registry/registry_event_details_line.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/registry/registry_event_details_line.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/registry/registry_event_details_line.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/registry/registry_event_details_line.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/registry/registry_event_details_line.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/registry/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/registry/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/registry/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/registry/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/row_renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/row_renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/row_renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/row_renderer.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/rule_status.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/rule_status.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/rule_status.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/rule_status.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/__snapshots__/suricata_details.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/__snapshots__/suricata_details.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/__snapshots__/suricata_details.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/__snapshots__/suricata_details.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/__snapshots__/suricata_row_renderer.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/__snapshots__/suricata_row_renderer.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/__snapshots__/suricata_row_renderer.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/__snapshots__/suricata_row_renderer.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/__snapshots__/suricata_signature.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/__snapshots__/suricata_signature.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/__snapshots__/suricata_signature.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/__snapshots__/suricata_signature.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_details.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_details.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_details.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_details.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_details.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_links.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_links.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_links.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_links.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_links.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_links.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_links.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_refs.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_refs.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_refs.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_refs.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_row_renderer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_row_renderer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_row_renderer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_row_renderer.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_row_renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_row_renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_row_renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_row_renderer.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_signature.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_signature.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_signature.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_signature.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_signature.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_signature.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_signature.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/suricata/suricata_signature.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/__snapshots__/auth_ssh.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/__snapshots__/auth_ssh.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/__snapshots__/auth_ssh.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/__snapshots__/auth_ssh.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/__snapshots__/generic_details.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/__snapshots__/generic_details.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/__snapshots__/generic_details.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/__snapshots__/generic_details.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/__snapshots__/generic_file_details.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/__snapshots__/generic_file_details.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/__snapshots__/generic_file_details.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/__snapshots__/generic_file_details.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/__snapshots__/generic_row_renderer.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/__snapshots__/generic_row_renderer.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/__snapshots__/generic_row_renderer.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/__snapshots__/generic_row_renderer.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/__snapshots__/package.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/__snapshots__/package.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/__snapshots__/package.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/__snapshots__/package.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/auth_ssh.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/auth_ssh.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/auth_ssh.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/auth_ssh.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/auth_ssh.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/auth_ssh.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/auth_ssh.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/auth_ssh.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_details.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_details.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_details.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_details.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_details.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_row_renderer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_row_renderer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_row_renderer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_row_renderer.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_row_renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_row_renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_row_renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_row_renderer.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/package.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/package.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/package.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/package.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/package.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/package.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/package.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/package.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/unknown_column_renderer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/unknown_column_renderer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/unknown_column_renderer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/unknown_column_renderer.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/unknown_column_renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/unknown_column_renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/unknown_column_renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/unknown_column_renderer.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_host_working_dir.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_host_working_dir.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_host_working_dir.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_host_working_dir.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_host_working_dir.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_host_working_dir.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_host_working_dir.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_host_working_dir.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_name.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_name.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_name.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_name.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_name.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_name.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_name.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_name.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_profile_renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_profile_renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_profile_renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_profile_renderer.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/__snapshots__/zeek_details.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/__snapshots__/zeek_details.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/__snapshots__/zeek_details.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/__snapshots__/zeek_details.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/__snapshots__/zeek_row_renderer.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/__snapshots__/zeek_row_renderer.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/__snapshots__/zeek_row_renderer.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/__snapshots__/zeek_row_renderer.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/__snapshots__/zeek_signature.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/__snapshots__/zeek_signature.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/__snapshots__/zeek_signature.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/__snapshots__/zeek_signature.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_details.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_details.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_details.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_details.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_details.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_details.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_details.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_details.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_row_renderer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_row_renderer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_row_renderer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_row_renderer.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_row_renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_row_renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_row_renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_row_renderer.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_signature.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_signature.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_signature.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_signature.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_signature.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_signature.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_signature.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/renderers/zeek/zeek_signature.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/selectors/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/selectors/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/selectors/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/selectors/index.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/selectors/index.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/selectors/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/selectors/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/selectors/index.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/unified_timeline_body.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/unified_timeline_body.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/unified_timeline_body.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/unified_timeline_body.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/unified_timeline_body.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/unified_timeline_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/body/unified_timeline_body.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/unified_timeline_body.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/cell_rendering/default_cell_renderer.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/cell_rendering/default_cell_renderer.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/cell_rendering/default_cell_renderer.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/cell_rendering/default_cell_renderer.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/cell_rendering/default_cell_renderer.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/cell_rendering/default_cell_renderer.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/cell_rendering/default_cell_renderer.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/cell_rendering/default_cell_renderer.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/cell_rendering/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/cell_rendering/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/cell_rendering/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/cell_rendering/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/__snapshots__/empty.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/__snapshots__/empty.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/__snapshots__/empty.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/__snapshots__/empty.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/__snapshots__/provider.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/__snapshots__/provider.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/__snapshots__/provider.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/__snapshots__/provider.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/__snapshots__/providers.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/__snapshots__/providers.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/__snapshots__/providers.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/__snapshots__/providers.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/__tests__/add_data_provider_popover.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/__tests__/add_data_provider_popover.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/__tests__/add_data_provider_popover.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/__tests__/add_data_provider_popover.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/add_data_provider_popover.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/add_data_provider_popover.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/add_data_provider_popover.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/add_data_provider_popover.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/data_provider.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/data_provider.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/data_provider.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/data_provider.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/empty.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/empty.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/empty.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/empty.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/empty.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/empty.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/empty.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/empty.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/mock/mock_and_providers.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/mock/mock_and_providers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/mock/mock_and_providers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/mock/mock_and_providers.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/mock/mock_data_providers.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/mock/mock_data_providers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/mock/mock_data_providers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/mock/mock_data_providers.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/provider.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/provider.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/provider.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/provider.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_badge.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_badge.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_badge.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_badge.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_actions.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_actions.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_actions.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_badge.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_badge.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_badge.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/provider_item_badge.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/providers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/providers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/providers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/providers.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/providers.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/providers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/providers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/providers.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/data_providers/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/date_picker_lock/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/date_picker_lock/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/date_picker_lock/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/date_picker_lock/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/date_picker_lock/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/date_picker_lock/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/date_picker_lock/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/date_picker_lock/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/events.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/events.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/events.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/events.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/footer/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/footer/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/footer/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/footer/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/footer/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/footer/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/footer/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/footer/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/footer/last_updated.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/footer/last_updated.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/footer/last_updated.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/footer/last_updated.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/footer/last_updated.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/footer/last_updated.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/footer/last_updated.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/footer/last_updated.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/footer/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/footer/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/footer/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/footer/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/kpi/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/kpi/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/kpi/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/kpi/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/kpi/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/kpi/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/kpi/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/kpi/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/kpi/kpi_container.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/kpi/kpi_container.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/kpi/kpi_container.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/kpi/kpi_container.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/kpi/kpis.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/kpi/kpis.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/kpi/kpis.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/kpi/kpis.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/kpi/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/kpi/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/kpi/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/kpi/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/pin/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/pin/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/pin/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/pin/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/pin/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/pin/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/pin/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/pin/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/properties/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/properties/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/properties/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/properties/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/properties/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/properties/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/notes_flyout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/properties/notes_flyout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/properties/notes_flyout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/properties/notes_flyout.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/notes_flyout.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/properties/notes_flyout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/properties/notes_flyout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/properties/notes_flyout.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/notes_size.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/properties/notes_size.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/properties/notes_size.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/properties/notes_size.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/properties/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/properties/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/properties/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/use_notes_in_flyout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/properties/use_notes_in_flyout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/properties/use_notes_in_flyout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/properties/use_notes_in_flyout.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/properties/use_notes_in_flyout.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/properties/use_notes_in_flyout.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/properties/use_notes_in_flyout.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/properties/use_notes_in_flyout.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/eql/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/query_bar/eql/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/eql/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/query_bar/eql/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/eql/selectors.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/query_bar/eql/selectors.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/eql/selectors.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/query_bar/eql/selectors.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/query_bar/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/query_bar/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/query_bar/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/query_bar/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/query_bar/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/query_bar/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/refetch_timeline.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/refetch_timeline.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/refetch_timeline.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/refetch_timeline.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/helpers.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/search_or_filter/helpers.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/helpers.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/search_or_filter/helpers.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/helpers.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/search_or_filter/helpers.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/helpers.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/search_or_filter/helpers.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/search_or_filter/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/search_or_filter/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/search_or_filter.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/search_or_filter/search_or_filter.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/search_or_filter.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/search_or_filter/search_or_filter.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/search_or_filter/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/search_or_filter/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/search_or_filter/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/search_super_select/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/search_super_select/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/search_super_select/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/search_super_select/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/selectable_timeline/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/selectable_timeline/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/selectable_timeline/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/selectable_timeline/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/selectable_timeline/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/selectable_timeline/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/selectable_timeline/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/selectable_timeline/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/styles.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/styles.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/styles.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/styles.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/eql/header/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/eql/header/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/eql/header/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/eql/header/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/eql/header/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/eql/header/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/eql/header/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/eql/header/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/eql/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/eql/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/eql/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/eql/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/eql/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/eql/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/eql/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/eql/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/__mocks__/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/__mocks__/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/__mocks__/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/__mocks__/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/customizations/mock.data.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/customizations/mock.data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/customizations/mock.data.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/customizations/mock.data.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/customizations/use_histogram_customizations.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/customizations/use_histogram_customizations.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/customizations/use_histogram_customizations.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/customizations/use_histogram_customizations.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/customizations/use_histogram_customizations.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/customizations/use_histogram_customizations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/customizations/use_histogram_customizations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/customizations/use_histogram_customizations.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/customizations/use_search_bar_customizations.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/customizations/use_search_bar_customizations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/customizations/use_search_bar_customizations.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/customizations/use_search_bar_customizations.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/customizations/use_set_discover_customizations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/customizations/use_set_discover_customizations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/customizations/use_set_discover_customizations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/customizations/use_set_discover_customizations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/mocks/esql_tab_content.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/mocks/esql_tab_content.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/mocks/esql_tab_content.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/mocks/esql_tab_content.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/mocks/index.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/mocks/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/mocks/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/mocks/index.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/styles.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/styles.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/styles.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/styles.tsx diff --git a/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/translations.ts new file mode 100644 index 0000000000000..bffd2db6cd731 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/translations.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 { i18n } from '@kbn/i18n'; + +export const GET_TIMELINE_DISCOVER_SAVED_SEARCH_TITLE = (title: string) => + i18n.translate('xpack.securitySolution.timelines.discoverInTimeline.discoverSessionTitle', { + defaultMessage: 'Saved Discover session for timeline - {title}', + values: { title }, + }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/use_discover_state.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/use_discover_state.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/use_discover_state.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/use_discover_state.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/use_get_stateful_query_bar.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/use_get_stateful_query_bar.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/use_get_stateful_query_bar.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/use_get_stateful_query_bar.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/use_get_stateful_query_bar.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/use_get_stateful_query_bar.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/use_get_stateful_query_bar.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/use_get_stateful_query_bar.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/utils/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/utils/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/utils/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/utils/index.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/utils/index.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/utils/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/utils/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/utils/index.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/utils/test_utils.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/utils/test_utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/esql/utils/test_utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/esql/utils/test_utils.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/graph/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/graph/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/graph/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/graph/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/notes/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/notes/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/notes/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/notes/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/notes/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/notes/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/notes/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/notes/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/notes/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/notes/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/notes/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/notes/selectors.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/pinned/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/pinned/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/pinned/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/pinned/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/pinned/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/pinned/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/pinned/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/pinned/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/query/header/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/query/header/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/query/header/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/query/header/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/query/header/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/query/header/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/query/header/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/query/header/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/query/header/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/query/header/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/query/header/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/query/header/translations.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/query/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/query/index.test.tsx new file mode 100644 index 0000000000000..eb13527385739 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/query/index.test.tsx @@ -0,0 +1,1327 @@ +/* + * 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 { ComponentProps, FunctionComponent } from 'react'; +import React, { useEffect } from 'react'; +import QueryTabContent from '.'; +import { defaultRowRenderers } from '../../body/renderers'; +import { TimelineId } from '../../../../../../common/types/timeline'; +import { useTimelineEvents } from '../../../../containers'; +import { useTimelineEventsDetails } from '../../../../containers/details'; +import { useSourcererDataView } from '../../../../../sourcerer/containers'; +import { mockSourcererScope } from '../../../../../sourcerer/containers/mocks'; +import { + createMockStore, + createSecuritySolutionStorageMock, + mockGlobalState, + mockTimelineData, + TestProviders, +} from '../../../../../common/mock'; +import { DefaultCellRenderer } from '../../cell_rendering/default_cell_renderer'; +import { render, screen, waitFor, fireEvent, within, cleanup } from '@testing-library/react'; +import { createStartServicesMock } from '../../../../../common/lib/kibana/kibana_react.mock'; +import type { StartServices } from '../../../../../types'; +import { useKibana } from '../../../../../common/lib/kibana'; +import { useDispatch } from 'react-redux'; +import type { ExperimentalFeatures } from '../../../../../../common'; +import { allowedExperimentalValues } from '../../../../../../common'; +import { useIsExperimentalFeatureEnabled } from '../../../../../common/hooks/use_experimental_features'; +import { + defaultUdtHeaders, + defaultColumnHeaderType, +} from '../../body/column_headers/default_headers'; +import { useUserPrivileges } from '../../../../../common/components/user_privileges'; +import { getEndpointPrivilegesInitialStateMock } from '../../../../../common/components/user_privileges/endpoint/mocks'; +import * as timelineActions from '../../../../store/actions'; +import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; +import { createExpandableFlyoutApiMock } from '../../../../../common/mock/expandable_flyout'; +import { OPEN_FLYOUT_BUTTON_TEST_ID } from '../../../../../notes/components/test_ids'; +import { userEvent } from '@testing-library/user-event'; +import * as notesApi from '../../../../../notes/api/api'; + +jest.mock('../../../../../common/components/user_privileges'); + +jest.mock('../../../../containers', () => ({ + useTimelineEvents: jest.fn(), +})); + +jest.mock('../../../../containers/details'); + +jest.mock('../../../fields_browser', () => ({ + useFieldBrowserOptions: jest.fn(), +})); + +jest.mock('../../../../../sourcerer/containers'); +jest.mock('../../../../../sourcerer/containers/use_signal_helpers', () => ({ + useSignalHelpers: () => ({ signalIndexNeedsInit: false }), +})); + +jest.mock('../../../../../common/lib/kuery'); + +jest.mock('../../../../../common/hooks/use_experimental_features'); + +jest.mock('react-router-dom', () => ({ + ...jest.requireActual('react-router-dom'), + useLocation: jest.fn(() => ({ + pathname: '', + search: '', + })), +})); + +// These tests can take more than standard timeout of 5s +// that is why we are increasing it. +const SPECIAL_TEST_TIMEOUT = 50000; + +const useIsExperimentalFeatureEnabledMock = jest.fn((feature: keyof ExperimentalFeatures) => { + return allowedExperimentalValues[feature]; +}); + +jest.mock('../../../../../common/lib/kibana'); + +// unified-field-list is reporting multiple analytics events +jest.mock(`@elastic/ebt/client`); + +const mockOpenFlyout = jest.fn(); +const mockCloseFlyout = jest.fn(); +jest.mock('@kbn/expandable-flyout'); + +const TestComponent = (props: Partial<ComponentProps<typeof QueryTabContent>>) => { + const testComponentDefaultProps: ComponentProps<typeof QueryTabContent> = { + timelineId: TimelineId.test, + renderCellValue: DefaultCellRenderer, + rowRenderers: defaultRowRenderers, + }; + + const dispatch = useDispatch(); + + useEffect(() => { + // Unified field list can be a culprit for long load times, so we wait for the timeline to be interacted with to load + dispatch(timelineActions.showTimeline({ id: TimelineId.test, show: true })); + + // populating timeline so that it is not blank + dispatch( + timelineActions.applyKqlFilterQuery({ + id: TimelineId.test, + filterQuery: { + kuery: { + kind: 'kuery', + expression: '*', + }, + serializedQuery: '*', + }, + }) + ); + }, [dispatch]); + + return <QueryTabContent {...testComponentDefaultProps} {...props} />; +}; + +const customColumnOrder = [ + ...defaultUdtHeaders, + { + columnHeaderType: defaultColumnHeaderType, + id: 'event.severity', + }, +]; + +const mockState = { + ...structuredClone(mockGlobalState), +}; + +mockState.timeline.timelineById[TimelineId.test].columns = customColumnOrder; + +const TestWrapper: FunctionComponent<React.PropsWithChildren<{}>> = ({ children }) => { + return <TestProviders store={createMockStore(mockState)}>{children}</TestProviders>; +}; + +const renderTestComponents = (props?: Partial<ComponentProps<typeof TestComponent>>) => { + return render(<TestComponent {...props} />, { + wrapper: TestWrapper, + }); +}; + +const loadPageMock = jest.fn(); + +const useSourcererDataViewMocked = jest.fn().mockReturnValue({ + ...mockSourcererScope, +}); + +const { storage: storageMock } = createSecuritySolutionStorageMock(); + +let useTimelineEventsMock = jest.fn(); + +describe('query tab with unified timeline', () => { + const fetchNotesMock = jest.spyOn(notesApi, 'fetchNotesByDocumentIds'); + beforeAll(() => { + fetchNotesMock.mockImplementation(jest.fn()); + jest.mocked(useExpandableFlyoutApi).mockImplementation(() => ({ + ...createExpandableFlyoutApiMock(), + openFlyout: mockOpenFlyout, + closeFlyout: mockCloseFlyout, + })); + + // https://github.com/atlassian/react-beautiful-dnd/blob/4721a518356f72f1dac45b5fd4ee9d466aa2996b/docs/guides/setup-problem-detection-and-error-recovery.md#disable-logging + Object.defineProperty(window, '__@hello-pangea/dnd-disable-dev-warnings', { + get() { + return true; + }, + }); + }); + const kibanaServiceMock: StartServices = { + ...createStartServicesMock(), + storage: storageMock, + }; + + afterEach(() => { + jest.clearAllMocks(); + storageMock.clear(); + fetchNotesMock.mockClear(); + cleanup(); + localStorage.clear(); + }); + + beforeEach(() => { + useTimelineEventsMock = jest.fn(() => [ + false, + { + events: structuredClone(mockTimelineData.slice(0, 1)), + pageInfo: { + activePage: 0, + totalPages: 3, + }, + refreshedAt: Date.now(), + totalCount: 3, + loadPage: loadPageMock, + }, + ]); + + HTMLElement.prototype.getBoundingClientRect = jest.fn(() => { + return { + width: 1000, + height: 1000, + x: 0, + y: 0, + } as DOMRect; + }); + + (useKibana as jest.Mock).mockImplementation(() => { + return { + services: kibanaServiceMock, + }; + }); + + (useTimelineEvents as jest.Mock).mockImplementation(useTimelineEventsMock); + + (useTimelineEventsDetails as jest.Mock).mockImplementation(() => [false, {}]); + + (useSourcererDataView as jest.Mock).mockImplementation(useSourcererDataViewMocked); + + (useIsExperimentalFeatureEnabled as jest.Mock).mockImplementation( + useIsExperimentalFeatureEnabledMock + ); + + (useUserPrivileges as jest.Mock).mockReturnValue({ + kibanaSecuritySolutionsPrivileges: { crud: true, read: true }, + endpointPrivileges: getEndpointPrivilegesInitialStateMock(), + detectionEnginePrivileges: { loading: false, error: undefined, result: undefined }, + }); + }); + + describe('render', () => { + it( + 'should render unifiedDataTable in timeline', + async () => { + renderTestComponents(); + await waitFor(() => { + expect(screen.getByTestId('discoverDocTable')).toBeVisible(); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + + it( + 'should render unified-field-list in timeline', + async () => { + renderTestComponents(); + await waitFor(() => { + expect(screen.getByTestId('timeline-sidebar')).toBeVisible(); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + it( + 'should show row-renderers correctly by default', + async () => { + renderTestComponents(); + await waitFor(() => { + expect(screen.getByTestId('discoverDocTable')).toBeVisible(); + }); + + expect(screen.getByTestId('timeline-row-renderer-0')).toBeVisible(); + }, + + SPECIAL_TEST_TIMEOUT + ); + + it( + 'should hide row-renderers when disabled', + async () => { + renderTestComponents(); + await waitFor(() => { + expect(screen.getByTestId('discoverDocTable')).toBeVisible(); + }); + + expect(screen.getByTestId('timeline-row-renderer-0')).toBeVisible(); + + fireEvent.click(screen.getByTestId('show-row-renderers-gear')); + expect(screen.getByTestId('row-renderers-modal')).toBeVisible(); + + fireEvent.click(screen.getByTestId('disable-all')); + + expect( + within(screen.getAllByTestId('renderer-checkbox')[0]).getByRole('checkbox') + ).not.toBeChecked(); + + fireEvent.click(screen.getByLabelText('Closes this modal window')); + + expect(screen.queryByTestId('row-renderers-modal')).not.toBeInTheDocument(); + + expect(screen.queryByTestId('timeline-row-renderer-0')).not.toBeInTheDocument(); + }, + SPECIAL_TEST_TIMEOUT + ); + }); + + describe('pagination', () => { + beforeEach(() => { + // pagination tests need more than 1 record so here + // we return 5 records instead of just 1. + useTimelineEventsMock = jest.fn(() => [ + false, + { + events: structuredClone(mockTimelineData.slice(0, 5)), + pageInfo: { + activePage: 0, + totalPages: 5, + }, + refreshedAt: Date.now(), + /* + * `totalCount` could be any number w.r.t this test + * and actually means total hits on elastic search + * and not the fecthed number of records. + * + * This helps in testing `sampleSize` and `loadMore` + */ + totalCount: 50, + loadPage: loadPageMock, + }, + ]); + + (useTimelineEvents as jest.Mock).mockImplementation(useTimelineEventsMock); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + it( + 'should paginate correctly', + async () => { + const mockStateWithNoteInTimeline = { + ...mockGlobalState, + timeline: { + ...mockGlobalState.timeline, + timelineById: { + [TimelineId.test]: { + ...mockGlobalState.timeline.timelineById[TimelineId.test], + /* 1 record for each page */ + itemsPerPage: 1, + itemsPerPageOptions: [1, 2, 3, 4, 5], + savedObjectId: 'timeline-1', // match timelineId in mocked notes data + pinnedEventIds: { '1': true }, + }, + }, + }, + }; + + render( + <TestProviders + store={createMockStore({ + ...structuredClone(mockStateWithNoteInTimeline), + })} + > + <TestComponent /> + </TestProviders> + ); + + expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); + expect(screen.getByTestId('pagination-button-previous')).toBeVisible(); + + expect(screen.getByTestId('tablePaginationPopoverButton')).toHaveTextContent( + 'Rows per page: 1' + ); + + expect(screen.getByTestId('pagination-button-0')).toHaveAttribute('aria-current', 'true'); + expect(screen.getByTestId('pagination-button-4')).toBeVisible(); + expect(screen.queryByTestId('pagination-button-5')).toBeNull(); + + fireEvent.click(screen.getByTestId('pagination-button-4')); + + await waitFor(() => { + expect(screen.getByTestId('pagination-button-4')).toHaveAttribute('aria-current', 'true'); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + + it( + 'should load more records according to sample size correctly', + async () => { + const mockStateWithNoteInTimeline = { + ...mockGlobalState, + timeline: { + ...mockGlobalState.timeline, + timelineById: { + [TimelineId.test]: { + ...mockGlobalState.timeline.timelineById[TimelineId.test], + itemsPerPage: 1, + /* + * `sampleSize` is the max number of records that are fetched from elasticsearch + * in one request. If hits > sampleSize, you can fetch more records ( <= sampleSize) + */ + sampleSize: 5, + itemsPerPageOptions: [1, 2, 3, 4, 5], + savedObjectId: 'timeline-1', // match timelineId in mocked notes data + pinnedEventIds: { '1': true }, + }, + }, + }, + }; + + render( + <TestProviders + store={createMockStore({ + ...structuredClone(mockStateWithNoteInTimeline), + })} + > + <TestComponent /> + </TestProviders> + ); + + expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); + + await waitFor(() => { + expect(screen.getByTestId('pagination-button-0')).toHaveAttribute('aria-current', 'true'); + expect(screen.getByTestId('pagination-button-4')).toBeVisible(); + }); + // Go to last page + fireEvent.click(screen.getByTestId('pagination-button-4')); + await waitFor(() => { + expect(screen.getByTestId('dscGridSampleSizeFetchMoreLink')).toBeVisible(); + }); + fireEvent.click(screen.getByTestId('dscGridSampleSizeFetchMoreLink')); + expect(loadPageMock).toHaveBeenNthCalledWith(1, 1); + }, + SPECIAL_TEST_TIMEOUT + ); + + it( + 'should load notes for current page only', + async () => { + const mockStateWithNoteInTimeline = { + ...mockGlobalState, + timeline: { + ...mockGlobalState.timeline, + timelineById: { + [TimelineId.test]: { + ...mockGlobalState.timeline.timelineById[TimelineId.test], + /* 1 record for each page */ + itemsPerPage: 1, + pageIndex: 0, + itemsPerPageOptions: [1, 2, 3, 4, 5], + savedObjectId: 'timeline-1', // match timelineId in mocked notes data + pinnedEventIds: { '1': true }, + }, + }, + }, + }; + + render( + <TestProviders + store={createMockStore({ + ...structuredClone(mockStateWithNoteInTimeline), + })} + > + <TestComponent /> + </TestProviders> + ); + + expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); + + expect(screen.getByTestId('pagination-button-previous')).toBeVisible(); + + expect(screen.getByTestId('pagination-button-0')).toHaveAttribute('aria-current', 'true'); + expect(fetchNotesMock).toHaveBeenCalledWith(['1']); + + // Page : 2 + + fetchNotesMock.mockClear(); + expect(screen.getByTestId('pagination-button-1')).toBeVisible(); + + fireEvent.click(screen.getByTestId('pagination-button-1')); + + await waitFor(() => { + expect(screen.getByTestId('pagination-button-1')).toHaveAttribute('aria-current', 'true'); + + expect(fetchNotesMock).toHaveBeenNthCalledWith(1, [mockTimelineData[1]._id]); + }); + + // Page : 3 + + fetchNotesMock.mockClear(); + expect(screen.getByTestId('pagination-button-2')).toBeVisible(); + fireEvent.click(screen.getByTestId('pagination-button-2')); + + await waitFor(() => { + expect(screen.getByTestId('pagination-button-2')).toHaveAttribute('aria-current', 'true'); + + expect(fetchNotesMock).toHaveBeenNthCalledWith(1, [mockTimelineData[2]._id]); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + + it( + 'should load notes for correct page size', + async () => { + const mockStateWithNoteInTimeline = { + ...mockGlobalState, + timeline: { + ...mockGlobalState.timeline, + timelineById: { + [TimelineId.test]: { + ...mockGlobalState.timeline.timelineById[TimelineId.test], + /* 1 record for each page */ + itemsPerPage: 1, + pageIndex: 0, + itemsPerPageOptions: [1, 2, 3, 4, 5], + savedObjectId: 'timeline-1', // match timelineId in mocked notes data + pinnedEventIds: { '1': true }, + }, + }, + }, + }; + + render( + <TestProviders + store={createMockStore({ + ...structuredClone(mockStateWithNoteInTimeline), + })} + > + <TestComponent /> + </TestProviders> + ); + + expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); + + expect(screen.getByTestId('pagination-button-previous')).toBeVisible(); + + expect(screen.getByTestId('pagination-button-0')).toHaveAttribute('aria-current', 'true'); + expect(screen.getByTestId('tablePaginationPopoverButton')).toHaveTextContent( + 'Rows per page: 1' + ); + fireEvent.click(screen.getByTestId('tablePaginationPopoverButton')); + + await waitFor(() => { + expect(screen.getByTestId('tablePagination-2-rows')).toBeVisible(); + }); + + fetchNotesMock.mockClear(); + fireEvent.click(screen.getByTestId('tablePagination-2-rows')); + + await waitFor(() => { + expect(fetchNotesMock).toHaveBeenNthCalledWith(1, [ + mockTimelineData[0]._id, + mockTimelineData[1]._id, + ]); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + }); + + describe('columns', () => { + it( + 'should move column left/right correctly ', + async () => { + const { container } = renderTestComponents(); + + await waitFor(() => { + expect(screen.getByTestId('discoverDocTable')).toBeVisible(); + }); + + const messageColumnIndex = + customColumnOrder.findIndex((header) => header.id === 'message') + 3; + // 3 is the offset for additional leading columns on left + + expect(container.querySelector('[data-gridcell-column-id="message"]')).toHaveAttribute( + 'data-gridcell-column-index', + String(messageColumnIndex) + ); + + expect(container.querySelector('[data-gridcell-column-id="message"]')).toBeInTheDocument(); + + fireEvent.click(screen.getByTestId('dataGridHeaderCellActionButton-message')); + + await waitFor(() => { + expect(screen.getByTitle('Move left')).toBeEnabled(); + }); + + fireEvent.click(screen.getByTitle('Move left')); + + await waitFor(() => { + expect(container.querySelector('[data-gridcell-column-id="message"]')).toHaveAttribute( + 'data-gridcell-column-index', + String(messageColumnIndex - 1) + ); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + + it( + 'should remove column', + async () => { + const { container } = renderTestComponents(); + + await waitFor(() => { + expect(screen.getByTestId('discoverDocTable')).toBeVisible(); + }); + + expect(container.querySelector('[data-gridcell-column-id="message"]')).toBeInTheDocument(); + + fireEvent.click(screen.getByTestId('dataGridHeaderCellActionButton-message')); + + await waitFor(() => { + expect(screen.getByTitle('Remove column')).toBeVisible(); + }); + + fireEvent.click(screen.getByTitle('Remove column')); + + await waitFor(() => { + expect( + container.querySelector('[data-gridcell-column-id="message"]') + ).not.toBeInTheDocument(); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + + it( + 'should sort date column', + async () => { + const { container } = renderTestComponents(); + await waitFor(() => { + expect(screen.getByTestId('discoverDocTable')).toBeVisible(); + }); + + expect( + container.querySelector('[data-gridcell-column-id="@timestamp"]') + ).toBeInTheDocument(); + + fireEvent.click(screen.getByTestId('dataGridHeaderCellActionButton-@timestamp')); + + await waitFor(() => { + expect(screen.getByTitle('Sort Old-New')).toBeVisible(); + }); + expect(screen.getByTitle('Unsort New-Old')).toBeVisible(); + + useTimelineEventsMock.mockClear(); + + fireEvent.click(screen.getByTitle('Sort Old-New')); + + await waitFor(() => { + expect(useTimelineEventsMock).toHaveBeenNthCalledWith( + 1, + expect.objectContaining({ + sort: [ + { + direction: 'asc', + esTypes: ['date'], + field: '@timestamp', + type: 'date', + }, + ], + }) + ); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + + it( + 'should sort string column correctly', + async () => { + const { container } = renderTestComponents(); + await waitFor(() => { + expect(screen.getByTestId('discoverDocTable')).toBeVisible(); + }); + + expect( + container.querySelector('[data-gridcell-column-id="host.name"]') + ).toBeInTheDocument(); + + fireEvent.click(screen.getByTestId('dataGridHeaderCellActionButton-host.name')); + + await waitFor(() => { + expect(screen.getByTestId('dataGridHeaderCellActionGroup-host.name')).toBeVisible(); + }); + + expect(screen.getByTitle('Sort A-Z')).toBeVisible(); + expect(screen.getByTitle('Sort Z-A')).toBeVisible(); + + useTimelineEventsMock.mockClear(); + + fireEvent.click(screen.getByTitle('Sort A-Z')); + + await waitFor(() => { + expect(useTimelineEventsMock).toHaveBeenNthCalledWith( + 1, + expect.objectContaining({ + sort: [ + { + direction: 'desc', + esTypes: ['date'], + field: '@timestamp', + type: 'date', + }, + { + direction: 'asc', + esTypes: [], + field: 'host.name', + type: 'string', + }, + ], + }) + ); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + + it( + 'should sort number column', + async () => { + const field = { + name: 'event.severity', + type: 'number', + }; + + const { container } = renderTestComponents(); + await waitFor(() => { + expect(screen.getByTestId('discoverDocTable')).toBeVisible(); + }); + + expect( + container.querySelector(`[data-gridcell-column-id="${field.name}"]`) + ).toBeInTheDocument(); + + fireEvent.click(screen.getByTestId(`dataGridHeaderCellActionButton-${field.name}`)); + + await waitFor(() => { + expect(screen.getByTestId(`dataGridHeaderCellActionGroup-${field.name}`)).toBeVisible(); + }); + + expect(screen.getByTitle('Sort Low-High')).toBeVisible(); + expect(screen.getByTitle('Sort High-Low')).toBeVisible(); + + useTimelineEventsMock.mockClear(); + + fireEvent.click(screen.getByTitle('Sort Low-High')); + + await waitFor(() => { + expect(useTimelineEventsMock).toHaveBeenNthCalledWith( + 1, + expect.objectContaining({ + sort: [ + { + direction: 'desc', + esTypes: ['date'], + field: '@timestamp', + type: 'date', + }, + { + direction: 'asc', + esTypes: [], + field: field.name, + type: field.type, + }, + ], + }) + ); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + }); + + describe('left controls', () => { + it( + 'should clear all sorting', + async () => { + renderTestComponents(); + expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); + + expect(screen.getByTestId('dataGridColumnSortingButton')).toBeVisible(); + expect( + within(screen.getByTestId('dataGridColumnSortingButton')).getByRole('marquee') + ).toHaveTextContent('1'); + + fireEvent.click(screen.getByTestId('dataGridColumnSortingButton')); + + // // timestamp sorting indicators + expect( + await screen.findByTestId('euiDataGridColumnSorting-sortColumn-@timestamp') + ).toBeInTheDocument(); + + expect(screen.getByTestId('dataGridHeaderCellSortingIcon-@timestamp')).toBeInTheDocument(); + + fireEvent.click(screen.getByTestId('dataGridColumnSortingClearButton')); + + await waitFor(() => { + expect(screen.queryByTestId('dataGridHeaderCellSortingIcon-@timestamp')).toBeNull(); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + + it( + 'should be able to sort by multiple columns', + async () => { + renderTestComponents(); + expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); + + expect(screen.getByTestId('dataGridColumnSortingButton')).toBeVisible(); + expect( + within(screen.getByTestId('dataGridColumnSortingButton')).getByRole('marquee') + ).toHaveTextContent('1'); + + fireEvent.click(screen.getByTestId('dataGridColumnSortingButton')); + + // // timestamp sorting indicators + expect( + await screen.findByTestId('euiDataGridColumnSorting-sortColumn-@timestamp') + ).toBeInTheDocument(); + + expect(screen.getByTestId('dataGridHeaderCellSortingIcon-@timestamp')).toBeInTheDocument(); + + // add more columns to sorting + fireEvent.click(screen.getByText(/Pick fields to sort by/)); + + await waitFor(() => { + expect( + screen.getByTestId('dataGridColumnSortingPopoverColumnSelection-event.severity') + ).toBeInTheDocument(); + }); + + fireEvent.click( + screen.getByTestId('dataGridColumnSortingPopoverColumnSelection-event.severity') + ); + + // check new columns for sorting validity + await waitFor(() => { + expect( + screen.getByTestId('dataGridHeaderCellSortingIcon-event.severity') + ).toBeInTheDocument(); + }); + expect( + screen.getByTestId('euiDataGridColumnSorting-sortColumn-event.severity') + ).toBeInTheDocument(); + + expect(screen.getByTestId('dataGridHeaderCellSortingIcon-@timestamp')).toBeInTheDocument(); + }, + SPECIAL_TEST_TIMEOUT + ); + }); + + describe('unified fields list', () => { + it( + 'should remove the column when clicked on X sign', + async () => { + const field = { + name: 'event.severity', + }; + + renderTestComponents(); + expect(await screen.findByTestId('timeline-sidebar')).toBeVisible(); + + await waitFor(() => { + expect(screen.getByTestId('fieldListGroupedSelectedFields-count')).toHaveTextContent( + String(customColumnOrder.length) + ); + }); + + // column exists in the table + expect(screen.getByTestId(`dataGridHeaderCell-${field.name}`)).toBeVisible(); + + fireEvent.click(screen.getAllByTestId(`fieldToggle-${field.name}`)[0]); + + // column not longer exists in the table + await waitFor(() => { + expect(screen.getByTestId('fieldListGroupedSelectedFields-count')).toHaveTextContent( + String(customColumnOrder.length - 1) + ); + }); + expect(screen.queryAllByTestId(`dataGridHeaderCell-${field.name}`)).toHaveLength(0); + }, + SPECIAL_TEST_TIMEOUT + ); + + it( + 'should add the column when clicked on ⊕ sign', + async () => { + const field = { + name: 'agent.id', + }; + + renderTestComponents(); + expect(await screen.findByTestId('timeline-sidebar')).toBeVisible(); + + await waitFor(() => { + expect(screen.getByTestId('fieldListGroupedSelectedFields-count')).toHaveTextContent( + String(customColumnOrder.length) + ); + }); + + expect(screen.queryAllByTestId(`dataGridHeaderCell-${field.name}`)).toHaveLength(0); + + // column exists in the table + const availableFields = screen.getByTestId('fieldListGroupedAvailableFields'); + + fireEvent.click(within(availableFields).getByTestId(`fieldToggle-${field.name}`)); + + await waitFor(() => { + expect(screen.getByTestId('fieldListGroupedSelectedFields-count')).toHaveTextContent( + String(customColumnOrder.length + 1) + ); + }); + expect(screen.queryAllByTestId(`dataGridHeaderCell-${field.name}`)).toHaveLength(1); + }, + SPECIAL_TEST_TIMEOUT + ); + + it( + 'should should show callout when field search does not matches any field', + async () => { + renderTestComponents(); + expect(await screen.findByTestId('timeline-sidebar')).toBeVisible(); + + await waitFor(() => { + expect(screen.getByTestId('fieldListGroupedAvailableFields-count')).toHaveTextContent( + '37' + ); + }); + + fireEvent.change(screen.getByTestId('fieldListFiltersFieldSearch'), { + target: { value: 'fake_field' }, + }); + + await waitFor(() => { + expect( + screen.getByTestId('fieldListGroupedAvailableFieldsNoFieldsCallout-noFieldsMatch') + ).toBeVisible(); + }); + + expect(screen.getByTestId('fieldListGroupedAvailableFields-count')).toHaveTextContent('0'); + }, + SPECIAL_TEST_TIMEOUT + ); + + it( + 'should toggle side bar correctly', + async () => { + renderTestComponents(); + expect(await screen.findByTestId('timeline-sidebar')).toBeVisible(); + + expect(screen.getByTestId('fieldListGroupedFieldGroups')).toBeVisible(); + + fireEvent.click(screen.getByTitle('Hide sidebar')); + + await waitFor(() => { + expect(screen.queryByTestId('fieldListGroupedFieldGroups')).not.toBeInTheDocument(); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + }); + + describe('Leading actions - expand event', () => { + it( + 'should expand and collapse event correctly', + async () => { + renderTestComponents(); + expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); + + expect(screen.getByTestId('docTableExpandToggleColumn').firstChild).toHaveAttribute( + 'data-euiicon-type', + 'expand' + ); + + // Open Flyout + fireEvent.click(screen.getByTestId('docTableExpandToggleColumn')); + + await waitFor(() => { + expect(mockOpenFlyout).toHaveBeenNthCalledWith(1, { + right: { + id: 'document-details-right', + params: { + id: '1', + indexName: '', + scopeId: TimelineId.test, + }, + }, + }); + }); + + expect(screen.getByTestId('docTableExpandToggleColumn').firstChild).toHaveAttribute( + 'data-euiicon-type', + 'minimize' + ); + + // Close Flyout + fireEvent.click(screen.getByTestId('docTableExpandToggleColumn')); + + await waitFor(() => { + expect(mockCloseFlyout).toHaveBeenNthCalledWith(1); + expect(screen.getByTestId('docTableExpandToggleColumn').firstChild).toHaveAttribute( + 'data-euiicon-type', + 'expand' + ); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + }); + + describe('Leading actions - notes', () => { + describe('securitySolutionNotesDisabled = false', () => { + beforeEach(() => { + (useIsExperimentalFeatureEnabled as jest.Mock).mockImplementation( + jest.fn((feature: keyof ExperimentalFeatures) => { + if (feature === 'securitySolutionNotesDisabled') { + return false; + } + return allowedExperimentalValues[feature]; + }) + ); + }); + + // Flaky: https://github.com/elastic/kibana/issues/189794 + it.skip( + 'should have the notification dot & correct tooltip', + async () => { + renderTestComponents(); + expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); + + expect(screen.getAllByTestId('timeline-notes-button-small')).toHaveLength(1); + expect(screen.getByTestId('timeline-notes-button-small')).not.toBeDisabled(); + + expect(screen.getByTestId('timeline-notes-notification-dot')).toBeVisible(); + + userEvent.hover(screen.getByTestId('timeline-notes-button-small')); + + await waitFor(() => { + expect(screen.getByTestId('timeline-notes-tool-tip')).toBeInTheDocument(); + expect(screen.getByTestId('timeline-notes-tool-tip')).toHaveTextContent( + '1 Note available. Click to view it & add more.' + ); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + it( + 'should be able to add notes through expandable flyout', + async () => { + renderTestComponents(); + expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); + + await waitFor(() => { + expect(screen.getByTestId('timeline-notes-button-small')).not.toBeDisabled(); + }); + + fireEvent.click(screen.getByTestId('timeline-notes-button-small')); + + await waitFor(() => { + expect(mockOpenFlyout).toHaveBeenCalled(); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + }); + + describe('securitySolutionNotesDisabled = true', () => { + beforeEach(() => { + (useIsExperimentalFeatureEnabled as jest.Mock).mockImplementation( + jest.fn((feature: keyof ExperimentalFeatures) => { + if (feature === 'securitySolutionNotesDisabled') { + return true; + } + return allowedExperimentalValues[feature]; + }) + ); + }); + + // Flaky: https://github.com/elastic/kibana/issues/189794 + it.skip( + 'should have the notification dot & correct tooltip', + async () => { + renderTestComponents(); + expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); + + expect(screen.getAllByTestId('timeline-notes-button-small')).toHaveLength(1); + expect(screen.getByTestId('timeline-notes-button-small')).not.toBeDisabled(); + + expect(screen.getByTestId('timeline-notes-notification-dot')).toBeVisible(); + + fireEvent.mouseOver(screen.getByTestId('timeline-notes-button-small')); + + await waitFor(() => { + expect(screen.getByTestId('timeline-notes-tool-tip')).toBeVisible(); + expect(screen.getByTestId('timeline-notes-tool-tip')).toHaveTextContent( + '1 Note available. Click to view it & add more.' + ); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + it( + 'should be able to add notes using EuiFlyout', + async () => { + renderTestComponents(); + expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); + + await waitFor(() => { + expect(screen.getByTestId('timeline-notes-button-small')).not.toBeDisabled(); + }); + + fireEvent.click(screen.getByTestId('timeline-notes-button-small')); + + await waitFor(() => { + expect(screen.getByTestId('add-note-container')).toBeVisible(); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + + it( + 'should cancel adding notes', + async () => { + renderTestComponents(); + expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); + + await waitFor(() => { + expect(screen.getByTestId('timeline-notes-button-small')).not.toBeDisabled(); + }); + + fireEvent.click(screen.getByTestId('timeline-notes-button-small')); + + await waitFor(() => { + expect(screen.getByTestId('add-note-container')).toBeVisible(); + }); + + expect(screen.getByTestId('cancel')).not.toBeDisabled(); + + fireEvent.click(screen.getByTestId('cancel')); + + await waitFor(() => { + expect(screen.queryByTestId('add-note-container')).not.toBeInTheDocument(); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + + it( + 'should be able to delete notes', + async () => { + renderTestComponents(); + expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); + + await waitFor(() => { + expect(screen.getByTestId('timeline-notes-button-small')).not.toBeDisabled(); + }); + + fireEvent.click(screen.getByTestId('timeline-notes-button-small')); + + await waitFor(() => { + expect(screen.getByTestId('delete-note')).toBeVisible(); + }); + + const noteDeleteSpy = jest.spyOn(timelineActions, 'setConfirmingNoteId'); + + fireEvent.click(screen.getByTestId('delete-note')); + + await waitFor(() => { + expect(noteDeleteSpy).toHaveBeenCalled(); + expect(noteDeleteSpy).toHaveBeenCalledWith({ + confirmingNoteId: '1', + id: TimelineId.test, + }); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + + it( + 'should not show toggle event details action', + async () => { + renderTestComponents(); + expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); + + await waitFor(() => { + expect(screen.getByTestId('timeline-notes-button-small')).not.toBeDisabled(); + }); + + fireEvent.click(screen.getByTestId('timeline-notes-button-small')); + + await waitFor(() => { + expect(screen.queryByTestId(OPEN_FLYOUT_BUTTON_TEST_ID)).not.toBeInTheDocument(); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + }); + }); + + describe('Leading actions - pin', () => { + describe('securitySolutionNotesDisabled = false', () => { + beforeEach(() => { + (useIsExperimentalFeatureEnabled as jest.Mock).mockImplementation( + jest.fn((feature: keyof ExperimentalFeatures) => { + if (feature === 'securitySolutionNotesDisabled') { + return false; + } + return allowedExperimentalValues[feature]; + }) + ); + }); + it( + 'should disable pinning when event has notes attached in timeline', + async () => { + const mockStateWithNoteInTimeline = { + ...mockGlobalState, + timeline: { + ...mockGlobalState.timeline, + timelineById: { + [TimelineId.test]: { + ...mockGlobalState.timeline.timelineById[TimelineId.test], + savedObjectId: 'timeline-1', // match timelineId in mocked notes data + pinnedEventIds: { '1': true }, + }, + }, + }, + }; + + render( + <TestProviders + store={createMockStore({ + ...structuredClone(mockStateWithNoteInTimeline), + })} + > + <TestComponent /> + </TestProviders> + ); + + expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); + + expect(screen.getAllByTestId('pin')).toHaveLength(1); + // disabled because it is already pinned + expect(screen.getByTestId('pin')).toBeDisabled(); + + fireEvent.mouseOver(screen.getByTestId('pin')); + + await waitFor(() => { + expect(screen.getByTestId('timeline-action-pin-tool-tip')).toBeVisible(); + expect(screen.getByTestId('timeline-action-pin-tool-tip')).toHaveTextContent( + 'This event cannot be unpinned because it has notes in Timeline' + ); + /* + * Above event is alert and not an event but `getEventType` in + * x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/helpers.tsx + * returns it has event and not an alert even though, it has event.kind as signal. + * Need to see if it is okay + * + * */ + }); + }, + SPECIAL_TEST_TIMEOUT + ); + + it( + 'should allow pinning when event has notes but notes are not attached in current timeline', + async () => { + renderTestComponents(); + expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); + + expect(screen.getAllByTestId('pin')).toHaveLength(1); + expect(screen.getByTestId('pin')).not.toBeDisabled(); + + fireEvent.mouseOver(screen.getByTestId('pin')); + await waitFor(() => { + expect(screen.getByTestId('timeline-action-pin-tool-tip')).toBeVisible(); + expect(screen.getByTestId('timeline-action-pin-tool-tip')).toHaveTextContent( + 'Pin event' + ); + }); + }, + SPECIAL_TEST_TIMEOUT + ); + }); + + describe('securitySolutionNotesDisabled = true', () => { + beforeEach(() => { + (useIsExperimentalFeatureEnabled as jest.Mock).mockImplementation( + jest.fn((feature: keyof ExperimentalFeatures) => { + if (feature === 'securitySolutionNotesDisabled') { + return true; + } + return allowedExperimentalValues[feature]; + }) + ); + }); + + it( + 'should have the pin button with correct tooltip', + async () => { + renderTestComponents(); + + expect(await screen.findByTestId('discoverDocTable')).toBeVisible(); + + expect(screen.getAllByTestId('pin')).toHaveLength(1); + // disabled because it is already pinned + expect(screen.getByTestId('pin')).toBeDisabled(); + + fireEvent.mouseOver(screen.getByTestId('pin')); + + await waitFor(() => { + expect(screen.getByTestId('timeline-action-pin-tool-tip')).toBeVisible(); + expect(screen.getByTestId('timeline-action-pin-tool-tip')).toHaveTextContent( + 'This event cannot be unpinned because it has notes' + ); + /* + * Above event is alert and not an event but `getEventType` in + * x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/body/helpers.tsx + * returns it has event and not an alert even though, it has event.kind as signal. + * Need to see if it is okay + * + * */ + }); + }, + SPECIAL_TEST_TIMEOUT + ); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/query/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/query/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/query/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/query/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/selectors.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/session/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/session/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/session/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/session/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/session/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/session/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/session/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/session/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/session/use_session_view.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/session/use_session_view.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/session/use_session_view.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/session/use_session_view.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/session/use_session_view.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/session/use_session_view.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/session/use_session_view.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/session/use_session_view.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/__snapshots__/use_timeline_columns.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/__snapshots__/use_timeline_columns.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/__snapshots__/use_timeline_columns.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/__snapshots__/use_timeline_columns.test.ts.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/__snapshots__/use_timeline_control_columns.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/__snapshots__/use_timeline_control_columns.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/__snapshots__/use_timeline_control_columns.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/__snapshots__/use_timeline_control_columns.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/layout.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/layout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/layout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/layout.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/types.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/types.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/use_timeline_columns.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/use_timeline_columns.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/use_timeline_columns.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/use_timeline_columns.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/use_timeline_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/use_timeline_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/use_timeline_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/use_timeline_columns.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/use_timeline_control_columns.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/use_timeline_control_columns.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/use_timeline_control_columns.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/use_timeline_control_columns.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/use_timeline_control_columns.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/use_timeline_control_columns.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/use_timeline_control_columns.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/use_timeline_control_columns.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/shared/utils.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/tabs/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/types.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/types.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/__snapshots__/custom_timeline_data_grid_body.test.tsx.snap b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/__snapshots__/custom_timeline_data_grid_body.test.tsx.snap similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/__snapshots__/custom_timeline_data_grid_body.test.tsx.snap rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/__snapshots__/custom_timeline_data_grid_body.test.tsx.snap diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/control_column_cell_render.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/control_column_cell_render.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/control_column_cell_render.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/control_column_cell_render.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/custom_timeline_data_grid_body.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/custom_timeline_data_grid_body.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/custom_timeline_data_grid_body.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/custom_timeline_data_grid_body.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/custom_timeline_data_grid_body.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/custom_timeline_data_grid_body.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/custom_timeline_data_grid_body.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/custom_timeline_data_grid_body.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/get_event_type_row_classname.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/get_event_type_row_classname.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/get_event_type_row_classname.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/get_event_type_row_classname.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/get_event_type_row_classname.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/get_event_type_row_classname.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/get_event_type_row_classname.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/get_event_type_row_classname.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/timeline_event_detail_row.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/timeline_event_detail_row.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/timeline_event_detail_row.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/timeline_event_detail_row.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/timeline_event_detail_row.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/timeline_event_detail_row.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/timeline_event_detail_row.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/timeline_event_detail_row.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/toolbar_additional_controls.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/toolbar_additional_controls.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/toolbar_additional_controls.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/toolbar_additional_controls.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/use_timeline_unified_data_table_context.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/use_timeline_unified_data_table_context.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/use_timeline_unified_data_table_context.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/data_table/use_timeline_unified_data_table_context.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/get_fields_list_creation_options.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/get_fields_list_creation_options.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/get_fields_list_creation_options.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/get_fields_list_creation_options.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/resizable_layout.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/resizable_layout.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/resizable_layout.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/resizable_layout.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/resizable_layout.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/resizable_layout.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/resizable_layout.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/resizable_layout.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/styles.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/styles.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/styles.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/styles.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/utils.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/utils.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/components/timeline/unified_components/utils.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/components/timeline/unified_components/utils.ts diff --git a/x-pack/plugins/security_solution/public/timelines/containers/active_timeline_context.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/active_timeline_context.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/active_timeline_context.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/active_timeline_context.ts diff --git a/x-pack/plugins/security_solution/public/timelines/containers/all/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/all/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/all/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/all/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/containers/api.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/api.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/api.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/api.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/containers/api.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/api.ts diff --git a/x-pack/plugins/security_solution/public/timelines/containers/details/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/details/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/details/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/details/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/containers/details/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/details/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/details/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/details/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/containers/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/containers/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/helpers.ts diff --git a/x-pack/plugins/security_solution/public/timelines/containers/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/containers/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/containers/kpis/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/kpis/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/kpis/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/kpis/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/containers/kpis/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/kpis/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/kpis/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/kpis/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/containers/local_storage/index.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/local_storage/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/local_storage/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/local_storage/index.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/containers/local_storage/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/local_storage/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/local_storage/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/local_storage/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/containers/local_storage/migrate_alert_page_contorls.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/local_storage/migrate_alert_page_contorls.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/local_storage/migrate_alert_page_contorls.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/local_storage/migrate_alert_page_contorls.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/containers/local_storage/migrate_alert_page_controls.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/local_storage/migrate_alert_page_controls.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/local_storage/migrate_alert_page_controls.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/local_storage/migrate_alert_page_controls.ts diff --git a/x-pack/plugins/security_solution/public/timelines/containers/local_storage/migrates_risk_level_title.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/local_storage/migrates_risk_level_title.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/local_storage/migrates_risk_level_title.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/local_storage/migrates_risk_level_title.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/containers/local_storage/migrates_risk_level_title.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/local_storage/migrates_risk_level_title.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/local_storage/migrates_risk_level_title.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/local_storage/migrates_risk_level_title.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/containers/local_storage/test.data.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/local_storage/test.data.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/local_storage/test.data.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/local_storage/test.data.ts diff --git a/x-pack/plugins/security_solution/public/timelines/containers/local_storage/types.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/local_storage/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/local_storage/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/local_storage/types.ts diff --git a/x-pack/plugins/security_solution/public/timelines/containers/notes/api.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/notes/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/notes/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/notes/api.ts diff --git a/x-pack/plugins/security_solution/public/timelines/containers/pinned_event/api.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/pinned_event/api.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/pinned_event/api.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/pinned_event/api.ts diff --git a/x-pack/plugins/security_solution/public/timelines/containers/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/containers/use_timeline_data_filters.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/use_timeline_data_filters.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/use_timeline_data_filters.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/use_timeline_data_filters.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/containers/use_timeline_data_filters.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/containers/use_timeline_data_filters.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/containers/use_timeline_data_filters.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/containers/use_timeline_data_filters.ts diff --git a/x-pack/plugins/security_solution/public/timelines/hooks/use_create_timeline.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/hooks/use_create_timeline.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/hooks/use_create_timeline.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/hooks/use_create_timeline.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/hooks/use_create_timeline.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/hooks/use_create_timeline.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/hooks/use_create_timeline.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/hooks/use_create_timeline.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/index.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/public/timelines/jest.config.js b/x-pack/solutions/security/plugins/security_solution/public/timelines/jest.config.js new file mode 100644 index 0000000000000..51ce8fb028b76 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/public/timelines/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/public/timelines'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/public/timelines', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/public/timelines/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../../server/__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/public/timelines/links.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/links.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/links.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/links.ts diff --git a/x-pack/plugins/security_solution/public/timelines/pages/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/pages/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/pages/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/pages/index.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/pages/timelines_page.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/pages/timelines_page.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/pages/timelines_page.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/pages/timelines_page.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/pages/timelines_page.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/pages/timelines_page.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/pages/timelines_page.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/pages/timelines_page.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/pages/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/pages/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/pages/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/pages/translations.ts diff --git a/x-pack/plugins/security_solution/public/timelines/routes.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/routes.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/routes.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/routes.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/store/actions.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/actions.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/actions.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/actions.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/defaults.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/defaults.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/defaults.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/defaults.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/helpers.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/index.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/index.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/index.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/middlewares/create_timeline_middlewares.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/create_timeline_middlewares.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/middlewares/create_timeline_middlewares.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/create_timeline_middlewares.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/middlewares/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/middlewares/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/helpers.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/middlewares/helpers.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/middlewares/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/helpers.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_changed.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_changed.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_changed.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_changed.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_changed.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_changed.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_changed.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_changed.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_favorite.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_favorite.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_favorite.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_favorite.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_favorite.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_favorite.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_favorite.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_favorite.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_note.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_note.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_note.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_note.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_note.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_note.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_note.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_note.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_pinned_event.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_pinned_event.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_pinned_event.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_pinned_event.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_pinned_event.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_pinned_event.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_pinned_event.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_pinned_event.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_save.test.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_save.test.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_save.test.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_save.test.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_save.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_save.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/middlewares/timeline_save.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/middlewares/timeline_save.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/model.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/model.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/model.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/reducer.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/reducer.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/reducer.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/reducer.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/selectors.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/selectors.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/selectors.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/selectors.ts diff --git a/x-pack/plugins/security_solution/public/timelines/store/types.ts b/x-pack/solutions/security/plugins/security_solution/public/timelines/store/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/store/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/timelines/store/types.ts diff --git a/x-pack/plugins/security_solution/public/timelines/wrapper/index.test.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/wrapper/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/wrapper/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/wrapper/index.test.tsx diff --git a/x-pack/plugins/security_solution/public/timelines/wrapper/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/timelines/wrapper/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/timelines/wrapper/index.tsx rename to x-pack/solutions/security/plugins/security_solution/public/timelines/wrapper/index.tsx diff --git a/x-pack/plugins/security_solution/public/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/translations.ts diff --git a/x-pack/plugins/security_solution/public/types.ts b/x-pack/solutions/security/plugins/security_solution/public/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/types.ts diff --git a/x-pack/plugins/security_solution/public/use_readonly_header.ts b/x-pack/solutions/security/plugins/security_solution/public/use_readonly_header.ts similarity index 100% rename from x-pack/plugins/security_solution/public/use_readonly_header.ts rename to x-pack/solutions/security/plugins/security_solution/public/use_readonly_header.ts diff --git a/x-pack/plugins/security_solution/public/value_list/components/add_list_item_popover.tsx b/x-pack/solutions/security/plugins/security_solution/public/value_list/components/add_list_item_popover.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/value_list/components/add_list_item_popover.tsx rename to x-pack/solutions/security/plugins/security_solution/public/value_list/components/add_list_item_popover.tsx diff --git a/x-pack/plugins/security_solution/public/value_list/components/delete_list_item.tsx b/x-pack/solutions/security/plugins/security_solution/public/value_list/components/delete_list_item.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/value_list/components/delete_list_item.tsx rename to x-pack/solutions/security/plugins/security_solution/public/value_list/components/delete_list_item.tsx diff --git a/x-pack/plugins/security_solution/public/value_list/components/info.tsx b/x-pack/solutions/security/plugins/security_solution/public/value_list/components/info.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/value_list/components/info.tsx rename to x-pack/solutions/security/plugins/security_solution/public/value_list/components/info.tsx diff --git a/x-pack/plugins/security_solution/public/value_list/components/inline_edit_list_item_value.tsx b/x-pack/solutions/security/plugins/security_solution/public/value_list/components/inline_edit_list_item_value.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/value_list/components/inline_edit_list_item_value.tsx rename to x-pack/solutions/security/plugins/security_solution/public/value_list/components/inline_edit_list_item_value.tsx diff --git a/x-pack/plugins/security_solution/public/value_list/components/list_item_table.tsx b/x-pack/solutions/security/plugins/security_solution/public/value_list/components/list_item_table.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/value_list/components/list_item_table.tsx rename to x-pack/solutions/security/plugins/security_solution/public/value_list/components/list_item_table.tsx diff --git a/x-pack/plugins/security_solution/public/value_list/components/show_value_list_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/value_list/components/show_value_list_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/value_list/components/show_value_list_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/value_list/components/show_value_list_modal.tsx diff --git a/x-pack/plugins/security_solution/public/value_list/components/upload_list_item.tsx b/x-pack/solutions/security/plugins/security_solution/public/value_list/components/upload_list_item.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/value_list/components/upload_list_item.tsx rename to x-pack/solutions/security/plugins/security_solution/public/value_list/components/upload_list_item.tsx diff --git a/x-pack/plugins/security_solution/public/value_list/components/value_list_modal.tsx b/x-pack/solutions/security/plugins/security_solution/public/value_list/components/value_list_modal.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/value_list/components/value_list_modal.tsx rename to x-pack/solutions/security/plugins/security_solution/public/value_list/components/value_list_modal.tsx diff --git a/x-pack/plugins/security_solution/public/value_list/translations.ts b/x-pack/solutions/security/plugins/security_solution/public/value_list/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/public/value_list/translations.ts rename to x-pack/solutions/security/plugins/security_solution/public/value_list/translations.ts diff --git a/x-pack/plugins/security_solution/public/value_list/types.ts b/x-pack/solutions/security/plugins/security_solution/public/value_list/types.ts similarity index 100% rename from x-pack/plugins/security_solution/public/value_list/types.ts rename to x-pack/solutions/security/plugins/security_solution/public/value_list/types.ts diff --git a/x-pack/plugins/security_solution/scripts/beat_docs/build.js b/x-pack/solutions/security/plugins/security_solution/scripts/beat_docs/build.js similarity index 99% rename from x-pack/plugins/security_solution/scripts/beat_docs/build.js rename to x-pack/solutions/security/plugins/security_solution/scripts/beat_docs/build.js index db766e6f738a6..f3a1c7c224b6e 100644 --- a/x-pack/plugins/security_solution/scripts/beat_docs/build.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/beat_docs/build.js @@ -5,7 +5,7 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); // eslint-disable-next-line import/no-extraneous-dependencies const extract = require('extract-zip'); diff --git a/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/README.md b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/README.md new file mode 100644 index 0000000000000..253b0b296e7e1 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/README.md @@ -0,0 +1,18 @@ +# Resolver Generator Script + +This script makes it easy to create the endpoint metadata, alert, and event documents needed to test Resolver in Kibana. +The default behavior is to create 1 endpoint with 1 alert and a moderate number of events (random, typically on the order of 20). +A seed value can be provided as a string for the random number generator for repeatable behavior, useful for demos etc. +Use the `-d` option if you want to delete and remake the indices, otherwise it will add documents to existing indices. + +Example command sequence to get ES and kibana running with sample data after installing ts-node: + +`yarn es snapshot` -> starts ES + +`npx yarn start --no-base-path` -> starts kibana. Note: you may need other configurations steps to start the security solution with endpoint support. + +`cd x-pack/solutions/security/plugins/security_solution/scripts/endpoint` + +`yarn test:generate` -> run the resolver_generator.ts script + +To see Resolver generator CLI options, run `yarn test:generate --help`. diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_downloader.js b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_downloader.js similarity index 85% rename from x-pack/plugins/security_solution/scripts/endpoint/agent_downloader.js rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_downloader.js index 050be8e0cf071..37512b9ddab26 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/agent_downloader.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_downloader.js @@ -5,5 +5,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./agent_downloader_cli').cli(); diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_downloader_cli/agent_downloader.test.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_downloader_cli/agent_downloader.test.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/agent_downloader_cli/agent_downloader.test.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_downloader_cli/agent_downloader.test.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_downloader_cli/agent_downloader.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_downloader_cli/agent_downloader.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/agent_downloader_cli/agent_downloader.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_downloader_cli/agent_downloader.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_downloader_cli/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_downloader_cli/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/agent_downloader_cli/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_downloader_cli/index.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/agent_emulator.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/agent_emulator.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/agent_emulator.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/agent_emulator.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/constants.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/constants.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/constants.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/index.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/screens/actions_responder.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/screens/actions_responder.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/screens/actions_responder.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/screens/actions_responder.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/screens/components/run_service_status_formatter.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/screens/components/run_service_status_formatter.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/screens/components/run_service_status_formatter.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/screens/components/run_service_status_formatter.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/screens/load_endpoints.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/screens/load_endpoints.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/screens/load_endpoints.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/screens/load_endpoints.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/screens/main.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/screens/main.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/screens/main.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/screens/main.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/screens/policy_responder.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/screens/policy_responder.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/screens/policy_responder.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/screens/policy_responder.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/action_responder.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/services/action_responder.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/action_responder.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/services/action_responder.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/agent_keep_alive.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/services/agent_keep_alive.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/agent_keep_alive.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/services/agent_keep_alive.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/emulator_run_context.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/services/emulator_run_context.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/emulator_run_context.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/services/emulator_run_context.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/endpoint_loader.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/services/endpoint_loader.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/endpoint_loader.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/services/endpoint_loader.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/endpoint_response_actions.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/services/endpoint_response_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/services/endpoint_response_actions.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/services/endpoint_response_actions.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/types.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/types.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/agent_emulator/types.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_emulator/types.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/agent_policy_generator/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_policy_generator/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/agent_policy_generator/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/agent_policy_generator/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/README.md b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/README.md new file mode 100644 index 0000000000000..e104b4c7c07c7 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/README.md @@ -0,0 +1,67 @@ +# API Emulator + +API Emulator is a framework wrapped around [Hapi](https://hapi.dev/) that enables developer to quickly create API interfaces for development and testing purposes. Emulator plugins (a wrapper around [Hapi plugins](https://hapi.dev/api/?v=21.3.3#plugins)) is the mechanism used to create an given set of APIs for emulation, and these are then added to the server framework which makes them available via the server's routes. + +The following script can be used to start the External EDR Server Emulator from the command line: + +```shell +node x-pack/solutions/security/plugins/security_solution/scripts/endpoint/start_external_edr_server_emulator.js +``` + +Use the `--help` option to view what arguments can be used + +For usages other than the command line, see the Development section below. + + + +## Development + +### Adding an new Plugin + +Plugins are the mechanism for adding API emulators into this framework. Each plugin is defined via an object that includes at a minimum the `name` and a `register()` callback. This callback for registering the plugin will be provided with an interface that allows the plugin to interact with the HTTP server and provide access to "core" services available at the server level for use by all plugins. + +Example: A method that returns the definition for a plugin + +```typescript + +export const getFooPluginRegistration = () => { + return { + name: 'foo', // [1] + register(server) { + // register routes + server.router.route({ + path: '/api/get', // [2] + method: 'GET', + handler: async (req, h) => { + return 'alive!'; + } + }) + } + } +} +``` + +In the above example: + +1. a plugin with the name `foo` [1] will be registered. The name of the plugin will also be the default `prefix` to all API routes (an optional attributed named `prefix` is also available if wanting to use a different value for the namespacing the routes). +2. the `register()` callback will be given a `server` argument that provides access to server level services like the HTTP `router` +3. a new route is registered [2], which will be mounted at `/foo/api/get` - note the use of the plugin name as the route prefix + + +#### Plugin HTTP routes + +HTTP route handlers work very similar to the route handlers in Kibana today. You are given a `Request` and a Response Factory by the Hapi framework - see the [HAPI docs on Lifecycle Methods](https://hapi.dev/api/?v=21.3.3#lifecycle-methods) for more details. + +This emulator framework will expose the core services (ex. for the EDR server emulator, this would include Kibana and Elasticsearch clients) to each route under `request.pre` (pre-handler methods). + +Example: a route handler under the EDR server emulator that returns the version of kibana + +```typescript + +const handler = async (req, h) => { + const kbnStatus = await req.pre.services.kbnClient.status.get(); + + return kbnStatus.version.number; +} + +``` diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/index.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/mocks.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/mocks.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/batch_init_rtr_route.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/batch_init_rtr_route.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/batch_init_rtr_route.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/batch_init_rtr_route.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/batch_refresh_rtr_session_route.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/batch_refresh_rtr_session_route.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/batch_refresh_rtr_session_route.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/batch_refresh_rtr_session_route.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/batch_rtr_command_route.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/batch_rtr_command_route.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/batch_rtr_command_route.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/batch_rtr_command_route.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_agent_details_route.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_agent_details_route.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_agent_details_route.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_agent_details_route.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_agent_online_status_route.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_agent_online_status_route.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_agent_online_status_route.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_agent_online_status_route.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_rtr_command_details_route.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_rtr_command_details_route.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_rtr_command_details_route.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_rtr_command_details_route.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_scripts_details_route.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_scripts_details_route.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_scripts_details_route.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_scripts_details_route.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_scripts_ids_route.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_scripts_ids_route.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_scripts_ids_route.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_scripts_ids_route.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_token_route.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_token_route.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_token_route.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/get_token_route.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/host_actions_route.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/host_actions_route.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/host_actions_route.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/host_actions_route.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/index.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/init_rtr_route.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/init_rtr_route.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/init_rtr_route.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/init_rtr_route.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/refresh_rtr_session_route.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/refresh_rtr_session_route.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/refresh_rtr_session_route.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/refresh_rtr_session_route.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/rtr_admin_route.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/rtr_admin_route.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/rtr_admin_route.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/rtr_admin_route.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/rtr_command_route.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/rtr_command_route.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/rtr_command_route.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/rtr_command_route.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/utils.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/utils.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/crowdstrike/routes/utils.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/index.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/activities_route.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/activities_route.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/activities_route.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/activities_route.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/agent_action_connect_route.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/agent_action_connect_route.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/agent_action_connect_route.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/agent_action_connect_route.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/agent_action_disconnect_route.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/agent_action_disconnect_route.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/agent_action_disconnect_route.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/agent_action_disconnect_route.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/agents_route.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/agents_route.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/agents_route.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/agents_route.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/index.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/utils.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/utils.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/emulator_plugins/sentinelone/routes/utils.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/external_edr_server_emulator.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/external_edr_server_emulator.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/external_edr_server_emulator.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/external_edr_server_emulator.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/external_edr_server_emulator.types.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/external_edr_server_emulator.types.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/external_edr_server_emulator.types.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/external_edr_server_emulator.types.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/index.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/lib/emulator_server.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/lib/emulator_server.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/lib/emulator_server.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/lib/emulator_server.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/api_emulator/lib/emulator_server.types.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/lib/emulator_server.types.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/api_emulator/lib/emulator_server.types.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/api_emulator/lib/emulator_server.types.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/blocklists/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/blocklists/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/blocklists/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/blocklists/index.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/agent_downloads_service.test.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/agent_downloads_service.test.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/agent_downloads_service.test.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/agent_downloads_service.test.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/agent_downloads_service.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/agent_downloads_service.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/agent_downloads_service.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/agent_downloads_service.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/base_running_service.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/base_running_service.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/base_running_service.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/base_running_service.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/connectors_services.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/connectors_services.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/connectors_services.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/connectors_services.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/constants.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/constants.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/constants.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/delete_all_endpoint_data.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/delete_all_endpoint_data.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/delete_all_endpoint_data.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/delete_all_endpoint_data.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/detection_rules_services.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/detection_rules_services.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/detection_rules_services.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/detection_rules_services.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/elastic_agent_service.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/elastic_agent_service.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/elastic_agent_service.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/elastic_agent_service.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/endpoint_artifact_services.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/endpoint_artifact_services.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/endpoint_artifact_services.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/endpoint_artifact_services.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/endpoint_host_services.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/endpoint_host_services.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/endpoint_host_services.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/endpoint_host_services.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/endpoint_metadata_services.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/endpoint_metadata_services.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/endpoint_metadata_services.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/endpoint_metadata_services.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/execution_throttler.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/execution_throttler.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/execution_throttler.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/execution_throttler.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_server/fleet_server.yml b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/fleet_server/fleet_server.yml similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/fleet_server/fleet_server.yml rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/fleet_server/fleet_server.yml diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_server/fleet_server_services.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/fleet_server/fleet_server_services.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/fleet_server/fleet_server_services.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/fleet_server/fleet_server_services.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/fleet_services.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/fleet_services.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/is_localhost.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/is_localhost.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/is_localhost.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/is_localhost.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/network_services.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/network_services.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/network_services.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/network_services.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/nodejs_utils.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/nodejs_utils.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/nodejs_utils.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/nodejs_utils.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/random_policy_id_generator.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/random_policy_id_generator.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/random_policy_id_generator.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/random_policy_id_generator.ts diff --git a/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/response_actions.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/response_actions.ts new file mode 100644 index 0000000000000..d54df140b3b4c --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/response_actions.ts @@ -0,0 +1,395 @@ +/* + * 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. + */ + +/* eslint-disable complexity */ + +import type { Client } from '@elastic/elasticsearch'; +import type { SearchHit } from '@elastic/elasticsearch/lib/api/types'; +import { basename } from 'path'; +import { encode } from '@kbn/cbor'; +import { AGENT_ACTIONS_INDEX, AGENT_ACTIONS_RESULTS_INDEX } from '@kbn/fleet-plugin/common'; +import { FleetActionGenerator } from '../../../common/endpoint/data_generators/fleet_action_generator'; +import { EndpointActionGenerator } from '../../../common/endpoint/data_generators/endpoint_action_generator'; +import type { + ActionDetails, + EndpointAction, + EndpointActionData, + EndpointActionResponse, + FileUploadMetadata, + GetProcessesActionOutputContent, + LogsEndpointActionResponse, + ResponseActionExecuteOutputContent, + ResponseActionGetFileOutputContent, + ResponseActionGetFileParameters, + EndpointActionResponseDataOutput, + ResponseActionScanOutputContent, + ResponseActionRunScriptOutputContent, +} from '../../../common/endpoint/types'; +import { getFileDownloadId } from '../../../common/endpoint/service/response_actions/get_file_download_id'; +import { + ENDPOINT_ACTION_RESPONSES_INDEX, + FILE_STORAGE_DATA_INDEX, + FILE_STORAGE_METADATA_INDEX, +} from '../../../common/endpoint/constants'; +import { sendEndpointMetadataUpdate } from './endpoint_metadata_services'; +import { checkInFleetAgent } from './fleet_services'; +import { generateFileMetadataDocumentMock } from '../../../server/endpoint/services/actions/mocks'; + +const ES_INDEX_OPTIONS = { headers: { 'X-elastic-product-origin': 'fleet' } }; +export const fleetActionGenerator = new FleetActionGenerator(); +export const endpointActionGenerator = new EndpointActionGenerator(); +export const sleep = (ms: number = 1000) => new Promise((r) => setTimeout(r, ms)); + +export const sendFleetActionResponse = async ( + esClient: Client, + action: ActionDetails, + { state }: { state?: 'success' | 'failure' } = {} +): Promise<EndpointActionResponse> => { + let fleetResponse: EndpointActionResponse; + + for (const agentId of action.agents) { + fleetResponse = fleetActionGenerator.generateResponse({ + action_id: action.id, + agent_id: agentId, + action_response: { endpoint: { ack: true } }, + }); + + // 20% of the time we generate an error + if (state === 'failure' || (!state && fleetActionGenerator.randomFloat() < 0.2)) { + fleetResponse.action_response = {}; + fleetResponse.error = 'Agent failed to deliver message to endpoint due to unknown error'; + } else { + // show it as success (generator currently always generates a `error`, so delete it) + delete fleetResponse.error; + } + + await esClient.index( + { + index: AGENT_ACTIONS_RESULTS_INDEX, + body: fleetResponse, + refresh: 'wait_for', + }, + ES_INDEX_OPTIONS + ); + } + + // @ts-expect-error + return fleetResponse; +}; +export const sendEndpointActionResponse = async ( + esClient: Client, + action: ActionDetails, + { state }: { state?: 'success' | 'failure' } = {} +): Promise<LogsEndpointActionResponse> => { + let endpointResponse: LogsEndpointActionResponse; + + for (const actionAgentId of action.agents) { + endpointResponse = endpointActionGenerator.generateResponse<EndpointActionResponseDataOutput>({ + agent: { id: actionAgentId }, + EndpointActions: { + action_id: action.id, + data: { + command: action.command as EndpointActionData['command'], + comment: '', + ...getOutputDataIfNeeded(action), + }, + started_at: action.startedAt, + }, + }); + + // 20% of the time we generate an error + if ( + state === 'failure' || + (state !== 'success' && endpointActionGenerator.randomFloat() < 0.2) + ) { + endpointResponse.error = { + message: 'Endpoint encountered an error and was unable to apply action to host', + }; + + if ( + endpointResponse.EndpointActions.data.command === 'get-file' && + endpointResponse.EndpointActions.data.output + ) { + ( + endpointResponse.EndpointActions.data.output + .content as unknown as ResponseActionGetFileOutputContent + ).code = endpointActionGenerator.randomGetFileFailureCode(); + } + + if ( + endpointResponse.EndpointActions.data.command === 'scan' && + endpointResponse.EndpointActions.data.output + ) { + ( + endpointResponse.EndpointActions.data.output + .content as unknown as ResponseActionScanOutputContent + ).code = endpointActionGenerator.randomScanFailureCode(); + } + + if ( + endpointResponse.EndpointActions.data.command === 'execute' && + endpointResponse.EndpointActions.data.output + ) { + ( + endpointResponse.EndpointActions.data.output + .content as unknown as ResponseActionExecuteOutputContent + ).stderr = 'execute command timed out'; + } + if ( + endpointResponse.EndpointActions.data.command === 'runscript' && + endpointResponse.EndpointActions.data.output + ) { + ( + endpointResponse.EndpointActions.data.output + .content as unknown as ResponseActionRunScriptOutputContent + ).stderr = 'runscript command timed out'; + } + } + + await esClient.index({ + index: ENDPOINT_ACTION_RESPONSES_INDEX, + body: endpointResponse, + refresh: 'wait_for', + }); + + // ------------------------------------------ + // Post Action Response tasks + // ------------------------------------------ + + // For isolate, If the response is not an error, then also send a metadata update + if (action.command === 'isolate' && !endpointResponse.error) { + await Promise.all([ + sendEndpointMetadataUpdate(esClient, actionAgentId, { + Endpoint: { state: { isolation: true } }, + }), + + checkInFleetAgent(esClient, actionAgentId), + ]); + } + + // For UnIsolate, if response is not an Error, then also send metadata update + if (action.command === 'unisolate' && !endpointResponse.error) { + await Promise.all([ + sendEndpointMetadataUpdate(esClient, actionAgentId, { + Endpoint: { state: { isolation: false } }, + }), + + checkInFleetAgent(esClient, actionAgentId), + ]); + } + + // For `get-file`, upload a file to ES + if ( + (action.command === 'execute' || action.command === 'get-file') && + !endpointResponse.error + ) { + const filePath = + action.command === 'execute' + ? '/execute/file/path' + : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + ( + action as unknown as ActionDetails< + ResponseActionGetFileOutputContent, + ResponseActionGetFileParameters + > + )?.parameters?.path!; + + const fileName = basename(filePath.replace(/\\/g, '/')); + const fileMetaDoc: FileUploadMetadata = generateFileMetadataDocumentMock({ + action_id: action.id, + agent_id: actionAgentId, + upload_start: Date.now(), + contents: [ + { + sha256: '8d61673c9d782297b3c774ded4e3d88f31a8869a8f25cf5cdd402ba6822d1d28', + file_name: fileName ?? 'bad_file.txt', + path: filePath, + size: 4, + type: 'file', + }, + ], + file: { + attributes: ['archive', 'compressed'], + ChunkSize: 4194304, + compression: 'deflate', + hash: { + sha256: '8d61673c9d782297b3c774ded4e3d88f31a8869a8f25cf5cdd402ba6822d1d28', + }, + mime_type: 'application/zip', + name: action.command === 'execute' ? 'full-output.zip' : 'upload.zip', + extension: 'zip', + size: 125, + Status: 'READY', + type: 'file', + }, + src: 'endpoint', + }); + + // Index the file's metadata + const fileMeta = await esClient.index({ + index: FILE_STORAGE_METADATA_INDEX, + id: getFileDownloadId(action, actionAgentId), + op_type: 'create', + refresh: 'wait_for', + body: fileMetaDoc, + }); + + // Index the file content (just one chunk) + // call to `.index()` copied from File plugin here: + // https://github.com/elastic/kibana/blob/main/src/plugins/files/server/blob_storage_service/adapters/es/content_stream/content_stream.ts#L195 + await esClient + .index( + { + index: FILE_STORAGE_DATA_INDEX, + id: `${fileMeta._id}.0`, + document: encode({ + bid: fileMeta._id, + last: true, + '@timestamp': new Date().toISOString(), + data: Buffer.from( + 'UEsDBAoACQAAAFZeRFWpAsDLHwAAABMAAAAMABwAYmFkX2ZpbGUudHh0VVQJAANTVjxjU1Y8Y3V4CwABBPUBAAAEFAAAAMOcoyEq/Q4VyG02U9O0LRbGlwP/y5SOCfRKqLz1rsBQSwcIqQLAyx8AAAATAAAAUEsBAh4DCgAJAAAAVl5EVakCwMsfAAAAEwAAAAwAGAAAAAAAAQAAAKSBAAAAAGJhZF9maWxlLnR4dFVUBQADU1Y8Y3V4CwABBPUBAAAEFAAAAFBLBQYAAAAAAQABAFIAAAB1AAAAAAA=', + 'base64' + ), + }), + refresh: 'wait_for', + op_type: 'create', + }, + { + headers: { + 'content-type': 'application/cbor', + accept: 'application/json', + }, + } + ) + .then(() => sleep(2000)); + } + } + + // @ts-expect-error + return endpointResponse as unknown as LogsEndpointActionResponse; +}; + +type ResponseOutput< + TOutputContent extends EndpointActionResponseDataOutput = EndpointActionResponseDataOutput +> = Pick<LogsEndpointActionResponse<TOutputContent>['EndpointActions']['data'], 'output'>; + +const getOutputDataIfNeeded = (action: ActionDetails): ResponseOutput => { + const commentUppercase = (action?.comment ?? '').toUpperCase(); + + switch (action.command) { + case 'running-processes': + return { + output: { + type: 'json', + content: { + entries: endpointActionGenerator.randomResponseActionProcesses(100), + }, + }, + } as unknown as ResponseOutput<GetProcessesActionOutputContent>; + + case 'get-file': + return { + output: { + type: 'json', + content: { + code: 'ra_get-file_success_done', + zip_size: 123, + contents: [ + { + type: 'file', + path: ( + action as unknown as ActionDetails< + ResponseActionGetFileOutputContent, + ResponseActionGetFileParameters + > + ).parameters?.path, + size: 1234, + file_name: 'bad_file.txt', + sha256: '9558c5cb39622e9b3653203e772b129d6c634e7dbd7af1b244352fc1d704601f', + }, + ], + }, + }, + } as unknown as ResponseOutput<ResponseActionGetFileOutputContent>; + + case 'execute': + const executeOutput: Partial<ResponseActionExecuteOutputContent> = { + output_file_id: getFileDownloadId(action, action.agents[0]), + }; + + // Error? + if (commentUppercase.indexOf('EXECUTE:FAILURE') > -1) { + executeOutput.stdout = ''; + executeOutput.stdout_truncated = false; + executeOutput.output_file_stdout_truncated = false; + } else { + executeOutput.stderr = ''; + executeOutput.stderr_truncated = false; + executeOutput.output_file_stderr_truncated = false; + } + + return { + output: endpointActionGenerator.generateExecuteActionResponseOutput({ + content: executeOutput, + }), + } as unknown as ResponseOutput<ResponseActionExecuteOutputContent>; + + default: + return { output: undefined }; + } +}; + +export async function getLatestActionDoc( + esClient: Client +): Promise<SearchHit<EndpointAction> | undefined> { + return ( + await esClient.search<EndpointAction>({ + index: AGENT_ACTIONS_INDEX, + ignore_unavailable: true, + query: { + match: { + type: 'INPUT_ACTION', + }, + }, + sort: { + '@timestamp': { + order: 'desc', + }, + }, + size: 1, + }) + ).hits.hits.at(0); +} + +export async function waitForNewActionDoc( + esClient: Client, + previousActionDoc?: SearchHit<EndpointAction>, + options: { + maxAttempts: number; + interval: number; + } = { maxAttempts: 3, interval: 10000 } +): Promise<SearchHit<EndpointAction> | undefined> { + const { maxAttempts, interval } = options; + let attempts = 1; + let latestDoc = await getLatestActionDoc(esClient); + while ((!latestDoc || latestDoc._id === previousActionDoc?._id) && attempts <= maxAttempts) { + await new Promise((res) => setTimeout(res, interval)); + latestDoc = await getLatestActionDoc(esClient); + attempts++; + } + + return latestDoc; +} + +export function updateActionDoc<T = unknown>(esClient: Client, id: string, doc: T) { + return esClient.update({ + index: AGENT_ACTIONS_INDEX, + id, + doc, + refresh: 'wait_for', + }); +} diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/role_and_user_loader.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/role_and_user_loader.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/role_and_user_loader.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/role_and_user_loader.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/detections_engineer.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/detections_engineer.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/detections_engineer.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/detections_engineer.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/endpoint_operations_analyst.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/endpoint_operations_analyst.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/endpoint_operations_analyst.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/endpoint_operations_analyst.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/endpoint_security_policy_manager.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/endpoint_security_policy_manager.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/endpoint_security_policy_manager.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/endpoint_security_policy_manager.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/hunter.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/hunter.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/hunter.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/hunter.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/index.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/platform_engineer.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/platform_engineer.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/platform_engineer.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/platform_engineer.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/rule_author.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/rule_author.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/rule_author.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/rule_author.ts diff --git a/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/README.md b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/README.md new file mode 100644 index 0000000000000..c99105e60862d --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/README.md @@ -0,0 +1,47 @@ +# Security Solution Serverless Resources + +Directory contains ES serverless resources that can be used to override the defaults that are loaded when ES is started in serverless mode. For more information on how these are used [packages/kbn-es/src/serverless_resources/README.md](https://github.com/elastic/kibana/blob/main/packages/kbn-es/src/serverless_resources/README.md) + +> **ℹ️ NOTE** +> +> The files referenced via `--resources` argument will be bound and mounted to the ES docker containers that are running ES. This means that any changes to the files done on the host machine will be automatically (after a delay - 5s by default) picked up by Elasticsearch and applied to the ES docker nodes. + +## Usage + +Example executed from the root directory of Kibana: + +```shell +yarn es serverless \ +--clean \ +--kill \ +-E xpack.security.authc.api_key.enabled=true \ +-E http.host=0.0.0.0 \ +--resources=./x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/roles.yml \ +--resources=./x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/users \ +--resources=./x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/users_roles +``` + +> **💡️TIP** +> +> If needing to make custom changes to any of the ES resources for personal dev. purposes, copy the files located in this folder to your own local directly, make changes there and then use those file paths when starting ES + + + +## Files + +### `roles.yml` + +The list of Roles that are loaded into security serverless projects. The values in this file should match those in the [project controller](https://github.com/elastic/project-controller/blob/main/internal/project/security/config/roles.yml) and should remain in sync. + +### `users` + +List of users that are loaded into ES for serverless. This file currently includes a user for each of the Security Project roles (same name as the role). All users in this file have their password set to `changeme` + +Format: `user:encrypted_password` + +### `users_roles` + +A map of role names (should match those define in the `roles.yml`) to list of users (values found in the `users` file). All Security serverless roles are listed in this file along with one user by the same name. + +Format: `role_name:username,username,username` + diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/roles.yml b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/roles.yml similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/roles.yml rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/roles.yml diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/users b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/users similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/users rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/users diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/users_roles b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/users_roles similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/users_roles rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/es_serverless_resources/users_roles diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/serverless/index.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/soc_manager.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/soc_manager.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/soc_manager.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/soc_manager.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/t1_analyst.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/t1_analyst.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/t1_analyst.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/t1_analyst.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/t2_analyst.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/t2_analyst.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/t2_analyst.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/t2_analyst.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/t3_analyst.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/t3_analyst.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/t3_analyst.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/t3_analyst.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/threat_intelligence_analyst.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/threat_intelligence_analyst.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/threat_intelligence_analyst.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/threat_intelligence_analyst.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/with_artifact_read_privileges_role.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/with_artifact_read_privileges_role.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/with_artifact_read_privileges_role.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/with_artifact_read_privileges_role.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/with_response_actions_role.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/with_response_actions_role.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/with_response_actions_role.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/with_response_actions_role.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/without_response_actions_role.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/without_response_actions_role.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/roles_users/without_response_actions_role.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/roles_users/without_response_actions_role.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/screen/choice_menu_formatter.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/choice_menu_formatter.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/screen/choice_menu_formatter.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/choice_menu_formatter.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/screen/column_layout_formatter.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/column_layout_formatter.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/screen/column_layout_formatter.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/column_layout_formatter.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/screen/common_choices.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/common_choices.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/screen/common_choices.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/common_choices.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/screen/constants.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/screen/constants.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/constants.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/screen/data_formatter.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/data_formatter.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/screen/data_formatter.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/data_formatter.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/screen/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/screen/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/index.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/screen/layout.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/layout.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/screen/layout.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/layout.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/screen/progress_formatter.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/progress_formatter.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/screen/progress_formatter.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/progress_formatter.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/screen/screen_base_class.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/screen_base_class.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/screen/screen_base_class.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/screen_base_class.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/screen/type_gards.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/type_gards.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/screen/type_gards.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/type_gards.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/screen/types.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/types.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/screen/types.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/screen/types.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/security_user_services.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/security_user_services.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/security_user_services.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/security_user_services.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/settings_storage.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/settings_storage.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/settings_storage.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/settings_storage.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/spaces.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/spaces.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/spaces.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/spaces.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/stack_services.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/stack_services.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/stack_services.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/stack_services.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/types.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/types.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/types.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/types.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/utils.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/utils.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/utils.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/vagrant/Vagrantfile b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/vagrant/Vagrantfile similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/common/vagrant/Vagrantfile rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/vagrant/Vagrantfile diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/vm_services.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/vm_services.ts similarity index 99% rename from x-pack/plugins/security_solution/scripts/endpoint/common/vm_services.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/vm_services.ts index fc1301c9fed9a..9e133c69700c6 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/common/vm_services.ts +++ b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/vm_services.ts @@ -231,7 +231,7 @@ interface CreateVagrantVmOptions extends BaseVmCreateOptions { agentDownload: DownloadedAgentInfo; /** * The path to the Vagrantfile to use to provision the VM. Defaults to Vagrantfile under: - * `x-pack/plugins/security_solution/scripts/endpoint/common/vagrant/Vagrantfile` + * `x-pack/solutions/security/plugins/security_solution/scripts/endpoint/common/vagrant/Vagrantfile` */ vagrantFile?: string; log?: ToolingLog; diff --git a/x-pack/plugins/security_solution/scripts/endpoint/endpoint_agent_emulator.js b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/endpoint_agent_emulator.js similarity index 84% rename from x-pack/plugins/security_solution/scripts/endpoint/endpoint_agent_emulator.js rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/endpoint_agent_emulator.js index 9eacefa57a2b9..a259d98a78f93 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/endpoint_agent_emulator.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/endpoint_agent_emulator.js @@ -5,5 +5,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./agent_emulator').cli(); diff --git a/x-pack/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/elastic_endpoint.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/elastic_endpoint.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/elastic_endpoint.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/elastic_endpoint.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/index.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/pre_check.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/pre_check.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/pre_check.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/pre_check.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/runtime.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/runtime.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/runtime.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/runtime.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/setup.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/setup.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/setup.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/setup.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/types.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/types.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/types.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/endpoint_agent_runner/types.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/endpoint_policies/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/endpoint_policies/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/endpoint_policies/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/endpoint_policies/index.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/env_data_loader/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/env_data_loader/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/env_data_loader/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/env_data_loader/index.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/env_data_loader/src/create_artifacts.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/env_data_loader/src/create_artifacts.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/env_data_loader/src/create_artifacts.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/env_data_loader/src/create_artifacts.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/env_data_loader/src/create_policies.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/env_data_loader/src/create_policies.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/env_data_loader/src/create_policies.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/env_data_loader/src/create_policies.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/env_data_loader/src/load.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/env_data_loader/src/load.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/env_data_loader/src/load.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/env_data_loader/src/load.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/env_data_loader/src/progress_reporter.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/env_data_loader/src/progress_reporter.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/env_data_loader/src/progress_reporter.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/env_data_loader/src/progress_reporter.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/env_data_loader/src/types.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/env_data_loader/src/types.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/env_data_loader/src/types.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/env_data_loader/src/types.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/env_data_loader/src/utils.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/env_data_loader/src/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/env_data_loader/src/utils.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/env_data_loader/src/utils.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/es_serverless/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/es_serverless/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/es_serverless/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/es_serverless/index.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/event_filters/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/event_filters/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/event_filters/index.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/fleet_server/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/fleet_server/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/fleet_server/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/fleet_server/index.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/host_isolation_exceptions/index.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/load_agent_policies.js b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_agent_policies.js similarity index 85% rename from x-pack/plugins/security_solution/scripts/endpoint/load_agent_policies.js rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_agent_policies.js index 0ead7ec978eda..2647a83288ec8 100755 --- a/x-pack/plugins/security_solution/scripts/endpoint/load_agent_policies.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_agent_policies.js @@ -7,5 +7,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./agent_policy_generator').cli(); diff --git a/x-pack/plugins/security_solution/scripts/endpoint/load_blocklists.js b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_blocklists.js similarity index 85% rename from x-pack/plugins/security_solution/scripts/endpoint/load_blocklists.js rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_blocklists.js index 46777ae8ccf7f..912f1743bfb45 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/load_blocklists.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_blocklists.js @@ -7,5 +7,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./blocklists').cli(); diff --git a/x-pack/plugins/security_solution/scripts/endpoint/load_endpoint_policies.js b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_endpoint_policies.js similarity index 84% rename from x-pack/plugins/security_solution/scripts/endpoint/load_endpoint_policies.js rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_endpoint_policies.js index b982fa4eaeaa3..1b7482fbcb75f 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/load_endpoint_policies.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_endpoint_policies.js @@ -5,5 +5,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./endpoint_policies').cli(); diff --git a/x-pack/plugins/security_solution/scripts/endpoint/load_env_data.js b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_env_data.js similarity index 84% rename from x-pack/plugins/security_solution/scripts/endpoint/load_env_data.js rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_env_data.js index 6568d3465432f..3f012e59ecdde 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/load_env_data.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_env_data.js @@ -5,5 +5,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./env_data_loader').cli(); diff --git a/x-pack/plugins/security_solution/scripts/endpoint/load_event_filters.js b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_event_filters.js similarity index 85% rename from x-pack/plugins/security_solution/scripts/endpoint/load_event_filters.js rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_event_filters.js index ca0f4ff9365c5..e7645ecb35a78 100755 --- a/x-pack/plugins/security_solution/scripts/endpoint/load_event_filters.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_event_filters.js @@ -7,5 +7,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./event_filters').cli(); diff --git a/x-pack/plugins/security_solution/scripts/endpoint/load_host_isolation_exceptions.js b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_host_isolation_exceptions.js similarity index 86% rename from x-pack/plugins/security_solution/scripts/endpoint/load_host_isolation_exceptions.js rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_host_isolation_exceptions.js index 13fedecb690ca..a8edbd96686ea 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/load_host_isolation_exceptions.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_host_isolation_exceptions.js @@ -7,5 +7,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./host_isolation_exceptions').cli(); diff --git a/x-pack/plugins/security_solution/scripts/endpoint/load_trusted_apps.js b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_trusted_apps.js similarity index 85% rename from x-pack/plugins/security_solution/scripts/endpoint/load_trusted_apps.js rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_trusted_apps.js index 2b5f63bba8d3d..eec61b588483a 100755 --- a/x-pack/plugins/security_solution/scripts/endpoint/load_trusted_apps.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/load_trusted_apps.js @@ -7,5 +7,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./trusted_apps').cli(); diff --git a/x-pack/plugins/security_solution/scripts/endpoint/resolver_generator.js b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/resolver_generator.js similarity index 84% rename from x-pack/plugins/security_solution/scripts/endpoint/resolver_generator.js rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/resolver_generator.js index 5a43286ae144e..fda2fd4d4d935 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/resolver_generator.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/resolver_generator.js @@ -5,5 +5,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./resolver_generator_script'); diff --git a/x-pack/plugins/security_solution/scripts/endpoint/resolver_generator_script.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/resolver_generator_script.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/resolver_generator_script.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/resolver_generator_script.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/run_endpoint_agent.js b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/run_endpoint_agent.js similarity index 85% rename from x-pack/plugins/security_solution/scripts/endpoint/run_endpoint_agent.js rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/run_endpoint_agent.js index 1a79b1456b9c6..2398bffe1b694 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/run_endpoint_agent.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/run_endpoint_agent.js @@ -5,5 +5,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./endpoint_agent_runner').cli(); diff --git a/x-pack/plugins/security_solution/scripts/endpoint/run_sentinelone_host.js b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/run_sentinelone_host.js similarity index 84% rename from x-pack/plugins/security_solution/scripts/endpoint/run_sentinelone_host.js rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/run_sentinelone_host.js index 56847abe9a920..5eeb6392ca012 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/run_sentinelone_host.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/run_sentinelone_host.js @@ -5,5 +5,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./sentinelone_host').cli(); diff --git a/x-pack/plugins/security_solution/scripts/endpoint/sentinelone_host/common.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/sentinelone_host/common.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/sentinelone_host/common.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/sentinelone_host/common.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/sentinelone_host/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/sentinelone_host/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/sentinelone_host/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/sentinelone_host/index.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/sentinelone_host/types.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/sentinelone_host/types.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/sentinelone_host/types.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/sentinelone_host/types.ts diff --git a/x-pack/plugins/security_solution/scripts/endpoint/start_es_serverless_with_security_users.js b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/start_es_serverless_with_security_users.js similarity index 84% rename from x-pack/plugins/security_solution/scripts/endpoint/start_es_serverless_with_security_users.js rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/start_es_serverless_with_security_users.js index 14169bc43ed08..3ef76c2c55797 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/start_es_serverless_with_security_users.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/start_es_serverless_with_security_users.js @@ -5,5 +5,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./es_serverless').cli(); diff --git a/x-pack/plugins/security_solution/scripts/endpoint/start_external_edr_server_emulator.js b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/start_external_edr_server_emulator.js similarity index 84% rename from x-pack/plugins/security_solution/scripts/endpoint/start_external_edr_server_emulator.js rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/start_external_edr_server_emulator.js index 5874264a85e2b..9003e614a6c3b 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/start_external_edr_server_emulator.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/start_external_edr_server_emulator.js @@ -5,5 +5,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./api_emulator').cli(); diff --git a/x-pack/plugins/security_solution/scripts/endpoint/start_fleet_server.js b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/start_fleet_server.js similarity index 84% rename from x-pack/plugins/security_solution/scripts/endpoint/start_fleet_server.js rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/start_fleet_server.js index d83c8a350f9e9..640944f27fb47 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/start_fleet_server.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/start_fleet_server.js @@ -5,5 +5,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./fleet_server').cli(); diff --git a/x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/endpoint/trusted_apps/index.ts diff --git a/x-pack/plugins/security_solution/scripts/extract_tactics_techniques_mitre.js b/x-pack/solutions/security/plugins/security_solution/scripts/extract_tactics_techniques_mitre.js similarity index 99% rename from x-pack/plugins/security_solution/scripts/extract_tactics_techniques_mitre.js rename to x-pack/solutions/security/plugins/security_solution/scripts/extract_tactics_techniques_mitre.js index 6bb1b52a92043..9ce8fbb72cff6 100644 --- a/x-pack/plugins/security_solution/scripts/extract_tactics_techniques_mitre.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/extract_tactics_techniques_mitre.js @@ -5,7 +5,7 @@ * 2.0. */ -require('../../../../src/setup_node_env'); +require('../../../../../../src/setup_node_env'); const fs = require('fs'); // eslint-disable-next-line import/no-extraneous-dependencies diff --git a/x-pack/solutions/security/plugins/security_solution/scripts/jest.config.js b/x-pack/solutions/security/plugins/security_solution/scripts/jest.config.js new file mode 100644 index 0000000000000..a5a3c19eee9e0 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/scripts/jest.config.js @@ -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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/scripts'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/scripts', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/scripts/**/*.{ts,tsx}', + ], +}; diff --git a/x-pack/plugins/security_solution/scripts/junit_transformer/README.md b/x-pack/solutions/security/plugins/security_solution/scripts/junit_transformer/README.md similarity index 100% rename from x-pack/plugins/security_solution/scripts/junit_transformer/README.md rename to x-pack/solutions/security/plugins/security_solution/scripts/junit_transformer/README.md diff --git a/x-pack/plugins/security_solution/scripts/junit_transformer/__snapshots__/junit_transformer.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/scripts/junit_transformer/__snapshots__/junit_transformer.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/scripts/junit_transformer/__snapshots__/junit_transformer.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/scripts/junit_transformer/__snapshots__/junit_transformer.test.ts.snap diff --git a/x-pack/plugins/security_solution/scripts/junit_transformer/fixtures/suite_with_failing_test.xml b/x-pack/solutions/security/plugins/security_solution/scripts/junit_transformer/fixtures/suite_with_failing_test.xml similarity index 100% rename from x-pack/plugins/security_solution/scripts/junit_transformer/fixtures/suite_with_failing_test.xml rename to x-pack/solutions/security/plugins/security_solution/scripts/junit_transformer/fixtures/suite_with_failing_test.xml diff --git a/x-pack/plugins/security_solution/scripts/junit_transformer/index.js b/x-pack/solutions/security/plugins/security_solution/scripts/junit_transformer/index.js similarity index 84% rename from x-pack/plugins/security_solution/scripts/junit_transformer/index.js rename to x-pack/solutions/security/plugins/security_solution/scripts/junit_transformer/index.js index f1b0280c4ede8..ed880f3f8bc83 100644 --- a/x-pack/plugins/security_solution/scripts/junit_transformer/index.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/junit_transformer/index.js @@ -5,5 +5,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./junit_transformer'); diff --git a/x-pack/plugins/security_solution/scripts/junit_transformer/junit_transformer.test.ts b/x-pack/solutions/security/plugins/security_solution/scripts/junit_transformer/junit_transformer.test.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/junit_transformer/junit_transformer.test.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/junit_transformer/junit_transformer.test.ts diff --git a/x-pack/plugins/security_solution/scripts/junit_transformer/junit_transformer.ts b/x-pack/solutions/security/plugins/security_solution/scripts/junit_transformer/junit_transformer.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/junit_transformer/junit_transformer.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/junit_transformer/junit_transformer.ts diff --git a/x-pack/plugins/security_solution/scripts/junit_transformer/lib.ts b/x-pack/solutions/security/plugins/security_solution/scripts/junit_transformer/lib.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/junit_transformer/lib.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/junit_transformer/lib.ts diff --git a/x-pack/plugins/security_solution/scripts/loop_cypress_tests.js b/x-pack/solutions/security/plugins/security_solution/scripts/loop_cypress_tests.js similarity index 100% rename from x-pack/plugins/security_solution/scripts/loop_cypress_tests.js rename to x-pack/solutions/security/plugins/security_solution/scripts/loop_cypress_tests.js diff --git a/x-pack/solutions/security/plugins/security_solution/scripts/mappings/README.md b/x-pack/solutions/security/plugins/security_solution/scripts/mappings/README.md new file mode 100644 index 0000000000000..f4bff842fb603 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/scripts/mappings/README.md @@ -0,0 +1,37 @@ +# Huge Indices with Unmapped Fields Generator/Loader Scripts + +This script makes it easy to generate and load big amount of indices with huge amount of fields. +It is also easy to specify what portion of those fields should be unmapped across various indices. +The purpose of this scripts is to be able to test `_field_caps` APIs which we use to fetch fields, +especially with `include_unmapped` options set. + +There are two different scripts: +1. `mappings_generator.js` which generates indices +2. `mappings_loader.js` which loads all generated indices to ES + +## Examples. + +### Generate 1k indices (split into 10 buckets with 100 indices each) with 10k fields (with 20% randomly unmapped fields within each index) + +> `node mappings_generator.js --fieldsCount=10000 --indexCount=1000 --indexPrefix='.ds-huge' --unmappedRate=.2 --buckets=10 --outputDirectory='test_unmapped'` + +The result of this operation will be 10 separate bucket folders within `test_unmapped`. Each bucket folder will contain a `mappings.json` file describing 100 indices. + +Available attributes: +* `--fieldsCount` (*required*): the number of fields in generated index +* `--indexCount` (*required*): the number of indices to be generated +* `--indexPrefix` (*required*): the prefix for the generated indices +* `--unmappedRate` (*required*): the percentage of unmapped fields in each index (value ranges from 0.0 to 1.0) +* `--buckets` (*optional, default value is 1*): it is possible to split the generated indices mappings into the smaller chunks +* `--outputDirectory` (*required*): the output folder +* `--purgeOutputDirectory` (*optional, default value is false*): the flag indicating whether we should purge output folder before generating new mappings + +### Load all generated buckets generated via previous command + +> `node mappings_loader.js --mappings-dir='test_unmapped' --es-url=http://elastic:changeme@localhost:9200 --kibana-url=http://elastic:changeme@localhost:5601/kbn/app` + + +This script will go through each folder in the provided root folder (via `--mappings-dir`) and load each folder with mappings inside using `es_archiver` tool. + + +**NOTE:** The path to `es_archiver` is adjusted for the call of this script using `x-pack/solutions/security/plugins/security_solution/package.json`. If you call this script directly, you will need to adjust it accordingly. diff --git a/x-pack/plugins/security_solution/scripts/mappings/mappings_generator.js b/x-pack/solutions/security/plugins/security_solution/scripts/mappings/mappings_generator.js similarity index 84% rename from x-pack/plugins/security_solution/scripts/mappings/mappings_generator.js rename to x-pack/solutions/security/plugins/security_solution/scripts/mappings/mappings_generator.js index a97b2e707f07b..5fe455148f16a 100644 --- a/x-pack/plugins/security_solution/scripts/mappings/mappings_generator.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/mappings/mappings_generator.js @@ -5,5 +5,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./mappings_generator_script'); diff --git a/x-pack/plugins/security_solution/scripts/mappings/mappings_generator_script.ts b/x-pack/solutions/security/plugins/security_solution/scripts/mappings/mappings_generator_script.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/mappings/mappings_generator_script.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/mappings/mappings_generator_script.ts diff --git a/x-pack/plugins/security_solution/scripts/mappings/mappings_loader.js b/x-pack/solutions/security/plugins/security_solution/scripts/mappings/mappings_loader.js similarity index 84% rename from x-pack/plugins/security_solution/scripts/mappings/mappings_loader.js rename to x-pack/solutions/security/plugins/security_solution/scripts/mappings/mappings_loader.js index 8e54207074d0e..62beb5c0aaccb 100644 --- a/x-pack/plugins/security_solution/scripts/mappings/mappings_loader.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/mappings/mappings_loader.js @@ -5,5 +5,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./mappings_loader_script'); diff --git a/x-pack/plugins/security_solution/scripts/mappings/mappings_loader_script.ts b/x-pack/solutions/security/plugins/security_solution/scripts/mappings/mappings_loader_script.ts similarity index 92% rename from x-pack/plugins/security_solution/scripts/mappings/mappings_loader_script.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/mappings/mappings_loader_script.ts index d8767d21a677c..a8150f25ca4c9 100644 --- a/x-pack/plugins/security_solution/scripts/mappings/mappings_loader_script.ts +++ b/x-pack/solutions/security/plugins/security_solution/scripts/mappings/mappings_loader_script.ts @@ -17,8 +17,8 @@ if (requireMain) { appDir = path.dirname(requireMain.filename); } -const CONFIG_PATH = path.resolve(appDir, '../../../../../test/functional/config.base.js'); -const ES_ARCHIVER_PATH = path.resolve(appDir, '../../../../../scripts/es_archiver'); +const CONFIG_PATH = path.resolve(appDir, '../../../../../../../test/functional/config.base.js'); +const ES_ARCHIVER_PATH = path.resolve(appDir, '../../../../../../../scripts/es_archiver'); const loadAllIndices = (esUrl: string, kibanaUrl: string, mappingsDir: string) => { const exec = (cmd: string) => execSync(cmd, { stdio: 'inherit' }); diff --git a/x-pack/plugins/security_solution/scripts/openapi/bundle_detections.js b/x-pack/solutions/security/plugins/security_solution/scripts/openapi/bundle_detections.js similarity index 96% rename from x-pack/plugins/security_solution/scripts/openapi/bundle_detections.js rename to x-pack/solutions/security/plugins/security_solution/scripts/openapi/bundle_detections.js index 7bfd659927ec3..fe17772f5ffbc 100644 --- a/x-pack/plugins/security_solution/scripts/openapi/bundle_detections.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/openapi/bundle_detections.js @@ -5,7 +5,7 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); const { bundle } = require('@kbn/openapi-bundler'); const { join, resolve } = require('path'); diff --git a/x-pack/plugins/security_solution/scripts/openapi/bundle_detections_info/detections_ess.info.yaml b/x-pack/solutions/security/plugins/security_solution/scripts/openapi/bundle_detections_info/detections_ess.info.yaml similarity index 100% rename from x-pack/plugins/security_solution/scripts/openapi/bundle_detections_info/detections_ess.info.yaml rename to x-pack/solutions/security/plugins/security_solution/scripts/openapi/bundle_detections_info/detections_ess.info.yaml diff --git a/x-pack/plugins/security_solution/scripts/openapi/bundle_detections_info/detections_serverless.info.yaml b/x-pack/solutions/security/plugins/security_solution/scripts/openapi/bundle_detections_info/detections_serverless.info.yaml similarity index 100% rename from x-pack/plugins/security_solution/scripts/openapi/bundle_detections_info/detections_serverless.info.yaml rename to x-pack/solutions/security/plugins/security_solution/scripts/openapi/bundle_detections_info/detections_serverless.info.yaml diff --git a/x-pack/plugins/security_solution/scripts/openapi/bundle_endpoint_management.js b/x-pack/solutions/security/plugins/security_solution/scripts/openapi/bundle_endpoint_management.js similarity index 97% rename from x-pack/plugins/security_solution/scripts/openapi/bundle_endpoint_management.js rename to x-pack/solutions/security/plugins/security_solution/scripts/openapi/bundle_endpoint_management.js index 481e3df4803d5..52c82ab7bd067 100644 --- a/x-pack/plugins/security_solution/scripts/openapi/bundle_endpoint_management.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/openapi/bundle_endpoint_management.js @@ -5,7 +5,7 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); const { bundle } = require('@kbn/openapi-bundler'); const { join, resolve } = require('path'); diff --git a/x-pack/plugins/security_solution/scripts/openapi/bundle_entity_analytics.js b/x-pack/solutions/security/plugins/security_solution/scripts/openapi/bundle_entity_analytics.js similarity index 97% rename from x-pack/plugins/security_solution/scripts/openapi/bundle_entity_analytics.js rename to x-pack/solutions/security/plugins/security_solution/scripts/openapi/bundle_entity_analytics.js index 89a60e1a8a0bb..21d8c6d397ae0 100644 --- a/x-pack/plugins/security_solution/scripts/openapi/bundle_entity_analytics.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/openapi/bundle_entity_analytics.js @@ -5,7 +5,7 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); const { bundle } = require('@kbn/openapi-bundler'); const { join, resolve } = require('path'); diff --git a/x-pack/plugins/security_solution/scripts/openapi/bundle_timeline.js b/x-pack/solutions/security/plugins/security_solution/scripts/openapi/bundle_timeline.js similarity index 97% rename from x-pack/plugins/security_solution/scripts/openapi/bundle_timeline.js rename to x-pack/solutions/security/plugins/security_solution/scripts/openapi/bundle_timeline.js index e2a439b81b322..a6e9655cbb091 100644 --- a/x-pack/plugins/security_solution/scripts/openapi/bundle_timeline.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/openapi/bundle_timeline.js @@ -5,7 +5,7 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); const { bundle } = require('@kbn/openapi-bundler'); const { join, resolve } = require('path'); diff --git a/x-pack/plugins/security_solution/scripts/openapi/generate.js b/x-pack/solutions/security/plugins/security_solution/scripts/openapi/generate.js similarity index 90% rename from x-pack/plugins/security_solution/scripts/openapi/generate.js rename to x-pack/solutions/security/plugins/security_solution/scripts/openapi/generate.js index bab9fa5f36cc6..8192f7ca6131f 100644 --- a/x-pack/plugins/security_solution/scripts/openapi/generate.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/openapi/generate.js @@ -5,7 +5,7 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); const { generate } = require('@kbn/openapi-generator'); const { REPO_ROOT } = require('@kbn/repo-info'); const { resolve, join } = require('path'); @@ -42,7 +42,7 @@ const SECURITY_SOLUTION_ROOT = resolve(__dirname, '../..'); bundle: { outFile: join( REPO_ROOT, - 'x-pack/plugins/security_solution/common/api/quickstart_client.gen.ts' + 'x-pack/solutions/security/plugins/security_solution/common/api/quickstart_client.gen.ts' ), }, }); diff --git a/x-pack/solutions/security/plugins/security_solution/scripts/quickstart/README.md b/x-pack/solutions/security/plugins/security_solution/scripts/quickstart/README.md new file mode 100644 index 0000000000000..2225f5e18a87d --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/scripts/quickstart/README.md @@ -0,0 +1,136 @@ +# Quickstart for Developers + +These tools make it fast and easy to create detection rules, exceptions, value lists, and source data for testing. + +## Usage + +`node x-pack/solutions/security/plugins/security_solution/scripts/quickstart/run.js`: Runs the script defined in `scratchpad.ts` +Options: +--username: User name to be used for auth against elasticsearch and kibana (Default: elastic). +--password: User name Password (Default: changeme) +--kibana: The url to Kibana (Default: http://127.0.0.1:5601). In most cases you'll want to set this URL to include the basepath as well. +--apikey: The API key for authentication, overrides username/password - use for serverless projects + +`scratchpad.ts` already contains code to set up clients for Elasticsearch and Kibana. In addition it provides clients for Security Solution, Lists, and Exceptions APIs, built on top of the Kibana client. However, it does not create any rules/exceptions/lists/data - it's a blank slate for you to immediately begin creating the resources you want for testing. Please don't commit data-generating code to `scratchpad.ts`! Instead, when you have built a data-generating script that might be useful to others, please extract the useful components to the `quickstart/modules` folder and leave `scratchpad.ts` empty for the next developer. + +### Environments + +The API clients are designed to work with any delivery method - local, cloud, or serverless deployments. For deployments that do not allow username/password auth, use an API key. + +## Modules + +Extracting data-generating logic into reusable modules that other people will actually use is the hardest part of sharing these scripts. To that end, it's crucial that the modules are organized as neatly as possible and extremely clear about what they do. If the modules are even slightly confusing, it will be faster for people to rebuild the same logic than to figure out how the existing scripts work. + +### Data + +Functions to create documents with various properties. This initial implementation has a function to create a document with an arbitrary number of fields and arbitrary amount of data in each field, but should be extended with more functions to create sets of documents with specific relationships such as X total documents with Y number of unique hosts etc. + +### Entity Analytics + +Functions to help install fake entity analytics data. Useful for testing alert enrichment based on entity analytics. + +### Exceptions + +Functions to help create exceptions with various properties. For example, one helper takes an array of values and automatically creates a value list exception item from that array - internally, it creates the value list and an exception item that references the list. + +### Frozen (TODO) + +Functions to help create frozen tier data quickly. These functions (once implemented) will take existing data and immediately move it to frozen for test purposes. + +### Lists + +Functions to help interact with the Lists APIs. The initial helper function makes it easy to import a value list from an array, since the process of attaching a file to a request (as the API expects) is not that intuitive. + +### Mappings + +Functions to help setup mappings. Provides the ECS mapping as well as helpers to generate mappings with tons of fields. + +### Rules + +Functions to help create rules along with data specific to each rule (WIP). Each sample rule defined in this folder should have an associated function to generate data that triggers alerts for the rule. + +## Speed + +To run a number of API requests in parallel, use `concurrentlyExec` from @kbn/securitysolution-utils. + +## Examples + +### Create a Rule + +``` +// Extra imports +import { concurrentlyExec } from '@kbn/securitysolution-utils/src/client_concurrency'; +import { basicRule } from './modules/rules/new_terms/basic_rule'; +import { duplicateRuleParams } from './modules/rules'; + +// ... omitted client setup stuff + +// Core logic +const ruleCopies = duplicateRuleParams(basicRule, 200); +const functions = ruleCopies.map((rule) => () => detectionsClient.createRule({ body: rule })); +const responses = await concurrentlyExec(functions); +``` + +### Create 200 Rules and an Exception for each one + +``` +// Extra imports +import { concurrentlyExec } from '@kbn/securitysolution-utils/src/client_concurrency'; +import { basicRule } from './modules/rules/new_terms/basic_rule'; +import { duplicateRuleParams } from './modules/rules'; +import { buildCreateRuleExceptionListItemsProps } from './modules/exceptions'; + +// ... omitted client setup stuff + +// Core logic +const ruleCopies = duplicateRuleParams(basicRule, 200); +const response = await detectionsClient.bulkCreateRules({ body: ruleCopies }); +const createdRules: RuleResponse[] = response.data.filter( +(r) => r.id != null +) as RuleResponse[]; + +// This map looks a bit confusing, but the concept is simple: take the rules we just created and +// create a *function* per rule to create an exception for that rule. We want a function to call later instead of just +// calling the API immediately to limit the number of requests in flight (with `concurrentlyExec`) +const exceptionsFunctions = createdRules.map( +(r) => () => + exceptionsClient.createRuleExceptionListItems( + buildCreateRuleExceptionListItemsProps({ id: r.id }) + ) +); +const exceptionsResponses = await concurrentlyExec(exceptionsFunctions); +``` + +### Run 10 Rule Preview Requests Simultaneously + +``` +const previewPromises = range(50).map( + (idx) => () => + detectionsClient.rulePreview({ + body: { + ...getBasicRuleMetadata(), + type: 'query', + timeframeEnd: '2024-08-21T20:37:37.114Z', + invocationCount: 1, + from: 'now-6m', + interval: '5m', + index: [index], + query: '*', + }, + }) +); + +const results = (await concurrentlyExec(previewPromises, 50)).map( + (result) => result.data.logs +); +``` + +## Future Work + +### Interactive Mode + +It may be useful to have a mode where the CLI waits for input from the user and creates resources selected from a predefined list. + +### Resource Tracking/Cleanup + +It may also be useful to have the tooling automatically keep track of the created resources so they can be deleted automatically when finished. diff --git a/x-pack/plugins/security_solution/scripts/quickstart/modules/data/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/quickstart/modules/data/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/quickstart/modules/data/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/quickstart/modules/data/index.ts diff --git a/x-pack/plugins/security_solution/scripts/quickstart/modules/entity_analytics/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/quickstart/modules/entity_analytics/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/quickstart/modules/entity_analytics/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/quickstart/modules/entity_analytics/index.ts diff --git a/x-pack/plugins/security_solution/scripts/quickstart/modules/exceptions/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/quickstart/modules/exceptions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/quickstart/modules/exceptions/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/quickstart/modules/exceptions/index.ts diff --git a/x-pack/plugins/security_solution/scripts/quickstart/modules/lists/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/quickstart/modules/lists/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/quickstart/modules/lists/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/quickstart/modules/lists/index.ts diff --git a/x-pack/plugins/security_solution/scripts/quickstart/modules/mappings/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/quickstart/modules/mappings/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/quickstart/modules/mappings/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/quickstart/modules/mappings/index.ts diff --git a/x-pack/plugins/security_solution/scripts/quickstart/modules/rules/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/quickstart/modules/rules/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/quickstart/modules/rules/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/quickstart/modules/rules/index.ts diff --git a/x-pack/plugins/security_solution/scripts/quickstart/modules/rules/new_terms/basic_rule.ts b/x-pack/solutions/security/plugins/security_solution/scripts/quickstart/modules/rules/new_terms/basic_rule.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/quickstart/modules/rules/new_terms/basic_rule.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/quickstart/modules/rules/new_terms/basic_rule.ts diff --git a/x-pack/plugins/security_solution/scripts/quickstart/modules/rules/query/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/quickstart/modules/rules/query/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/quickstart/modules/rules/query/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/quickstart/modules/rules/query/index.ts diff --git a/x-pack/plugins/security_solution/scripts/quickstart/modules/rules/threat_match/index.ts b/x-pack/solutions/security/plugins/security_solution/scripts/quickstart/modules/rules/threat_match/index.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/quickstart/modules/rules/threat_match/index.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/quickstart/modules/rules/threat_match/index.ts diff --git a/x-pack/plugins/security_solution/scripts/quickstart/modules/rules/utils.ts b/x-pack/solutions/security/plugins/security_solution/scripts/quickstart/modules/rules/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/quickstart/modules/rules/utils.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/quickstart/modules/rules/utils.ts diff --git a/x-pack/plugins/security_solution/scripts/quickstart/run.js b/x-pack/solutions/security/plugins/security_solution/scripts/quickstart/run.js similarity index 84% rename from x-pack/plugins/security_solution/scripts/quickstart/run.js rename to x-pack/solutions/security/plugins/security_solution/scripts/quickstart/run.js index ba2cb48a06cf9..cefed62e07972 100644 --- a/x-pack/plugins/security_solution/scripts/quickstart/run.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/quickstart/run.js @@ -5,5 +5,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./scratchpad').cli(); diff --git a/x-pack/plugins/security_solution/scripts/quickstart/scratchpad.ts b/x-pack/solutions/security/plugins/security_solution/scripts/quickstart/scratchpad.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/quickstart/scratchpad.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/quickstart/scratchpad.ts diff --git a/x-pack/plugins/security_solution/scripts/run_cypress/get_ftr_config.ts b/x-pack/solutions/security/plugins/security_solution/scripts/run_cypress/get_ftr_config.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/run_cypress/get_ftr_config.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/run_cypress/get_ftr_config.ts diff --git a/x-pack/plugins/security_solution/scripts/run_cypress/parallel.ts b/x-pack/solutions/security/plugins/security_solution/scripts/run_cypress/parallel.ts similarity index 99% rename from x-pack/plugins/security_solution/scripts/run_cypress/parallel.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/run_cypress/parallel.ts index 77c01622a5df4..ef3f6093ea452 100644 --- a/x-pack/plugins/security_solution/scripts/run_cypress/parallel.ts +++ b/x-pack/solutions/security/plugins/security_solution/scripts/run_cypress/parallel.ts @@ -67,7 +67,7 @@ ${JSON.stringify(argv, null, 2)} `); const isOpen = argv._.includes('open'); - const cypressConfigFilePath = require.resolve(`../../${argv.configFile}`) as string; + const cypressConfigFilePath = require.resolve(`../../../../${argv.configFile}`) as string; const cypressConfigFile = await import(cypressConfigFilePath); // Adjust tooling log level based on the `TOOLING_LOG_LEVEL` property, which can be diff --git a/x-pack/plugins/security_solution/scripts/run_cypress/parallel_serverless.ts b/x-pack/solutions/security/plugins/security_solution/scripts/run_cypress/parallel_serverless.ts similarity index 99% rename from x-pack/plugins/security_solution/scripts/run_cypress/parallel_serverless.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/run_cypress/parallel_serverless.ts index 7a68b596ea5d1..90ea733edd552 100644 --- a/x-pack/plugins/security_solution/scripts/run_cypress/parallel_serverless.ts +++ b/x-pack/solutions/security/plugins/security_solution/scripts/run_cypress/parallel_serverless.ts @@ -357,7 +357,7 @@ ${JSON.stringify(argv, null, 2)} `); const isOpen = argv._.includes('open'); - const cypressConfigFilePath = require.resolve(`../../${argv.configFile}`) as string; + const cypressConfigFilePath = require.resolve(`../../../../${argv.configFile}`) as string; const cypressConfigFile = await import(cypressConfigFilePath); // if KIBANA_MKI_QUALITY_GATE exists and has a value, we are running the tests against the Kibana QA quality gate. diff --git a/x-pack/plugins/security_solution/scripts/run_cypress/print_run.ts b/x-pack/solutions/security/plugins/security_solution/scripts/run_cypress/print_run.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/run_cypress/print_run.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/run_cypress/print_run.ts diff --git a/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/cloud_project_handler.ts b/x-pack/solutions/security/plugins/security_solution/scripts/run_cypress/project_handler/cloud_project_handler.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/run_cypress/project_handler/cloud_project_handler.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/run_cypress/project_handler/cloud_project_handler.ts diff --git a/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/project_handler.ts b/x-pack/solutions/security/plugins/security_solution/scripts/run_cypress/project_handler/project_handler.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/run_cypress/project_handler/project_handler.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/run_cypress/project_handler/project_handler.ts diff --git a/x-pack/plugins/security_solution/scripts/run_cypress/project_handler/proxy_project_handler.ts b/x-pack/solutions/security/plugins/security_solution/scripts/run_cypress/project_handler/proxy_project_handler.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/run_cypress/project_handler/proxy_project_handler.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/run_cypress/project_handler/proxy_project_handler.ts diff --git a/x-pack/solutions/security/plugins/security_solution/scripts/run_cypress/utils.ts b/x-pack/solutions/security/plugins/security_solution/scripts/run_cypress/utils.ts new file mode 100644 index 0000000000000..56a9463ecc698 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/scripts/run_cypress/utils.ts @@ -0,0 +1,179 @@ +/* + * 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 _ from 'lodash'; +import * as fs from 'fs'; +import * as parser from '@babel/parser'; +import generate from '@babel/generator'; +import type { ExpressionStatement, ObjectExpression, ObjectProperty } from '@babel/types'; +import { schema, type TypeOf } from '@kbn/config-schema'; +import chalk from 'chalk'; +import type { ToolingLogTextWriterConfig } from '@kbn/tooling-log'; +import { createToolingLogger } from '../../common/endpoint/data_loaders/utils'; + +/** + * Retrieve test files using a glob pattern. + * If process.env.RUN_ALL_TESTS is true, returns all matching files, otherwise, return files that should be run by this job based on process.env.BUILDKITE_PARALLEL_JOB_COUNT and process.env.BUILDKITE_PARALLEL_JOB + */ +export const retrieveIntegrations = (integrationsPaths: string[]) => { + const nonSkippedSpecs = integrationsPaths.filter((filePath) => !isSkipped(filePath)); + + if (process.env.RUN_ALL_TESTS === 'true') { + return nonSkippedSpecs; + } else { + // The number of instances of this job were created + const chunksTotal: number = process.env.BUILDKITE_PARALLEL_JOB_COUNT + ? parseInt(process.env.BUILDKITE_PARALLEL_JOB_COUNT, 10) + : 1; + // An index which uniquely identifies this instance of the job + const chunkIndex: number = process.env.BUILDKITE_PARALLEL_JOB + ? parseInt(process.env.BUILDKITE_PARALLEL_JOB, 10) + : 0; + + const nonSkippedSpecsForChunk: string[] = []; + + for (let i = chunkIndex; i < nonSkippedSpecs.length; i += chunksTotal) { + nonSkippedSpecsForChunk.push(nonSkippedSpecs[i]); + } + + return nonSkippedSpecsForChunk; + } +}; + +export const isSkipped = (filePath: string): boolean => { + const testFile = fs.readFileSync(filePath, { encoding: 'utf8' }); + + const ast = parser.parse(testFile, { + sourceType: 'module', + plugins: ['typescript'], + }); + + const expressionStatement = _.find(ast.program.body, ['type', 'ExpressionStatement']) as + | ExpressionStatement + | undefined; + + const callExpression = expressionStatement?.expression; + + // @ts-expect-error + return callExpression?.callee?.property?.name === 'skip'; +}; + +export const parseTestFileConfig = (filePath: string): SecuritySolutionDescribeBlockFtrConfig => { + const testFile = fs.readFileSync(filePath, { encoding: 'utf8' }); + + const ast = parser.parse(testFile, { + sourceType: 'module', + plugins: ['typescript'], + }); + + const expressionStatement = _.find(ast.program.body, { + type: 'ExpressionStatement', + expression: { callee: { name: 'describe' } }, + }) as ExpressionStatement | undefined; + + const callExpression = expressionStatement?.expression; + // @ts-expect-error + if (expressionStatement?.expression?.arguments?.length === 3) { + // @ts-expect-error + const callExpressionArguments = _.find(callExpression?.arguments, [ + 'type', + 'ObjectExpression', + ]) as ObjectExpression | undefined; + + const callExpressionProperties = _.find(callExpressionArguments?.properties, [ + 'key.name', + 'env', + ]) as ObjectProperty[] | undefined; + // @ts-expect-error + const ftrConfig = _.find(callExpressionProperties?.value?.properties, [ + 'key.name', + 'ftrConfig', + ]); + + if (!ftrConfig) { + return {}; + } + + const ftrConfigCode = generate(ftrConfig.value, { jsonCompatibleStrings: true }).code; + + try { + // TODO:PT need to assess implication of using this approach to get the JSON back out + // eslint-disable-next-line no-new-func + const ftrConfigJson = new Function(`return ${ftrConfigCode}`)(); + return TestFileFtrConfigSchema.validate(ftrConfigJson); + } catch (err) { + throw new Error( + `Failed to parse 'ftrConfig' value defined in 'describe()' at ${filePath}. ${err.message}\nCode: ${ftrConfigCode}` + ); + } + } + + return {}; +}; + +const TestFileFtrConfigSchema = schema.object( + { + license: schema.maybe(schema.string()), + kbnServerArgs: schema.maybe(schema.arrayOf(schema.string())), + productTypes: schema.maybe( + // TODO:PT write validate function to ensure that only the correct combinations are used + schema.arrayOf( + schema.object({ + product_line: schema.oneOf([ + schema.literal('security'), + schema.literal('endpoint'), + schema.literal('cloud'), + ]), + + product_tier: schema.oneOf([schema.literal('essentials'), schema.literal('complete')]), + }) + ) + ), + }, + { defaultValue: {}, unknowns: 'forbid' } +); + +export type SecuritySolutionDescribeBlockFtrConfig = TypeOf<typeof TestFileFtrConfigSchema>; + +export const getOnBeforeHook = (module: unknown, beforeSpecFilePath: string): Function => { + if (typeof module !== 'object' || module === null) { + throw new Error( + `${chalk.bold( + beforeSpecFilePath + )} expected to explicitly export function member named "onBeforeHook"` + ); + } + + if (!('onBeforeHook' in module) || typeof module.onBeforeHook !== 'function') { + throw new Error( + `${chalk.bold('onBeforeHook')} exported from ${chalk.bold( + beforeSpecFilePath + )} is not a function` + ); + } + + return module.onBeforeHook; +}; + +/** + * Sets the default log level for `ToolingLog` instances created by `createToolingLogger()`: + * `x-pack/solutions/security/plugins/security_solution/common/endpoint/data_loaders/utils.ts:148`. + * It will first check the NodeJs `process.env` to see if an Environment Variable was set + * and then, if provided, it will use the value defined in the Cypress Config. file. + */ +export const setDefaultToolingLoggingLevel = (defaultFallbackLoggingLevel?: string) => { + const logLevel = + process.env.TOOLING_LOG_LEVEL || + process.env.CYPRESS_TOOLING_LOG_LEVEL || + defaultFallbackLoggingLevel || + ''; + + if (logLevel) { + createToolingLogger('info').info(`Setting tooling log level to [${logLevel}]`); + createToolingLogger.defaultLogLevel = logLevel as ToolingLogTextWriterConfig['level']; + } +}; diff --git a/x-pack/plugins/security_solution/scripts/run_playwright/playwright.ts b/x-pack/solutions/security/plugins/security_solution/scripts/run_playwright/playwright.ts similarity index 97% rename from x-pack/plugins/security_solution/scripts/run_playwright/playwright.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/run_playwright/playwright.ts index 3b51cf7c67a49..351a6572392ff 100644 --- a/x-pack/plugins/security_solution/scripts/run_playwright/playwright.ts +++ b/x-pack/solutions/security/plugins/security_solution/scripts/run_playwright/playwright.ts @@ -324,7 +324,7 @@ ${JSON.stringify(playwrightConfigFile, null, 2)} if (isOpen) { await execa.command( - `../../../node_modules/.bin/playwright test --config ${playwrightConfigFilePath} --ui --project ${project}`, + `../../../../../node_modules/.bin/playwright test --config ${playwrightConfigFilePath} --ui --project ${project}`, { env: { ...playwrightCustomEnv, @@ -334,7 +334,7 @@ ${JSON.stringify(playwrightConfigFile, null, 2)} ); } else { await execa.command( - `../../../node_modules/.bin/playwright test --config ${playwrightConfigFilePath} --project ${project} --grep @${project}`, + `../../../../../node_modules/.bin/playwright test --config ${playwrightConfigFilePath} --project ${project} --grep @${project}`, { env: { ...playwrightCustomEnv, diff --git a/x-pack/plugins/security_solution/scripts/run_playwright/start_playwright.js b/x-pack/solutions/security/plugins/security_solution/scripts/run_playwright/start_playwright.js similarity index 84% rename from x-pack/plugins/security_solution/scripts/run_playwright/start_playwright.js rename to x-pack/solutions/security/plugins/security_solution/scripts/run_playwright/start_playwright.js index e69f8aa37a89d..d1cf01a6669e5 100644 --- a/x-pack/plugins/security_solution/scripts/run_playwright/start_playwright.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/run_playwright/start_playwright.js @@ -5,5 +5,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./playwright').cli(); diff --git a/x-pack/plugins/security_solution/scripts/siem_migration/draw_graphs.js b/x-pack/solutions/security/plugins/security_solution/scripts/siem_migration/draw_graphs.js similarity index 84% rename from x-pack/plugins/security_solution/scripts/siem_migration/draw_graphs.js rename to x-pack/solutions/security/plugins/security_solution/scripts/siem_migration/draw_graphs.js index 010b6c15f323c..9d6101cf5c8ae 100644 --- a/x-pack/plugins/security_solution/scripts/siem_migration/draw_graphs.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/siem_migration/draw_graphs.js @@ -5,5 +5,5 @@ * 2.0. */ -require('../../../../../src/setup_node_env'); +require('../../../../../../../src/setup_node_env'); require('./draw_graphs_script').draw(); diff --git a/x-pack/plugins/security_solution/scripts/siem_migration/draw_graphs_script.ts b/x-pack/solutions/security/plugins/security_solution/scripts/siem_migration/draw_graphs_script.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/siem_migration/draw_graphs_script.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/siem_migration/draw_graphs_script.ts diff --git a/x-pack/plugins/security_solution/scripts/start_cypress_parallel.js b/x-pack/solutions/security/plugins/security_solution/scripts/start_cypress_parallel.js similarity index 85% rename from x-pack/plugins/security_solution/scripts/start_cypress_parallel.js rename to x-pack/solutions/security/plugins/security_solution/scripts/start_cypress_parallel.js index 7054754bc79c1..4bcb0fdeb2f0a 100644 --- a/x-pack/plugins/security_solution/scripts/start_cypress_parallel.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/start_cypress_parallel.js @@ -5,5 +5,5 @@ * 2.0. */ -require('../../../../src/setup_node_env'); +require('../../../../../../src/setup_node_env'); require('./run_cypress/parallel').cli(); diff --git a/x-pack/plugins/security_solution/scripts/start_cypress_parallel_serverless.js b/x-pack/solutions/security/plugins/security_solution/scripts/start_cypress_parallel_serverless.js similarity index 86% rename from x-pack/plugins/security_solution/scripts/start_cypress_parallel_serverless.js rename to x-pack/solutions/security/plugins/security_solution/scripts/start_cypress_parallel_serverless.js index ab8850323536d..88b7ddbc1a828 100644 --- a/x-pack/plugins/security_solution/scripts/start_cypress_parallel_serverless.js +++ b/x-pack/solutions/security/plugins/security_solution/scripts/start_cypress_parallel_serverless.js @@ -5,5 +5,5 @@ * 2.0. */ -require('../../../../src/setup_node_env'); +require('../../../../../../src/setup_node_env'); require('./run_cypress/parallel_serverless').cli(); diff --git a/x-pack/plugins/security_solution/scripts/storybook.js b/x-pack/solutions/security/plugins/security_solution/scripts/storybook.js similarity index 100% rename from x-pack/plugins/security_solution/scripts/storybook.js rename to x-pack/solutions/security/plugins/security_solution/scripts/storybook.js diff --git a/x-pack/solutions/security/plugins/security_solution/scripts/telemetry/README.md b/x-pack/solutions/security/plugins/security_solution/scripts/telemetry/README.md new file mode 100644 index 0000000000000..a8a47ace8439e --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/scripts/telemetry/README.md @@ -0,0 +1,38 @@ +## Telemetry data view generation script + +The purpose of the script is to map telemetry fields to runtime fields on the appropriate security solution ebt data views on the staging cluster. This can be used to automate the addition of new fields to the data views. + +### Events +- The browser ebt events come from `telemetryEvents` imported from `x-pack/solutions/security/plugins/security_solution/public/common/lib/telemetry/events/telemetry_events` +- The server ebt events come from: + - `events` imported from `x-pack/plugins/elastic-assistant/server/lib/telemetry/event_based_telemetry` + - `telemetryEvents` imported from `x-pack/solutions/security/plugins/security_solution_serverless/server/telemetry/event_based_telemetry` + - `events` imported from `x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/event_based/events` + +If you have further events to be included in the data views, please update the script to include the event schema. + +### Usage + +1. Login with Vault (`vault login -method oidc`), ensure you have siem-team access. If you have never accessed Vault before, follow [these instructions](https://github.com/elastic/infra/blob/master/docs/vault/README.md) +2. cd into this directory +3. Run the script with the appropriate arguments. By default, the script will run for the `security-solution-ebt-kibana-browser` data view in the `securitysolution` space. If you want to run the script for the server data view, pass the `--telemetry_type` argument with the value `server`. + +```bash +# Run the script for the security-solution-ebt-kibana-browser data view +./build_ebt_data_view.sh + +# Run the script for the security-solution-ebt-server data view +./build_ebt_data_view.sh --telemetry_type=server +``` + +### Data view recovery + +If a security solution ebt data view is for some reason deleted, upload the saved object that is committed in this directory to the staging cluster. This will recreate the data view with the correct mappings. Then you can run this script to ensure any new fields get added. + +#### Why upload the saved object? Why not just run this script? + +There are some fields not covered by this script, at least for the security-solution-ebt-kibana-browser data view (ex: `day_of_week`). I'm not sure where they came from. In order to be on the safe side, the data view saved objects will be updated per minor release to ensure that all fields are covered. + +### Production data views + +This script manages the staging data views. To make updates to the production data views, export the saved objects from staging and upload them to production. diff --git a/x-pack/plugins/security_solution/scripts/telemetry/build_ebt_data_view.sh b/x-pack/solutions/security/plugins/security_solution/scripts/telemetry/build_ebt_data_view.sh similarity index 100% rename from x-pack/plugins/security_solution/scripts/telemetry/build_ebt_data_view.sh rename to x-pack/solutions/security/plugins/security_solution/scripts/telemetry/build_ebt_data_view.sh diff --git a/x-pack/plugins/security_solution/scripts/telemetry/build_ebt_data_view.ts b/x-pack/solutions/security/plugins/security_solution/scripts/telemetry/build_ebt_data_view.ts similarity index 100% rename from x-pack/plugins/security_solution/scripts/telemetry/build_ebt_data_view.ts rename to x-pack/solutions/security/plugins/security_solution/scripts/telemetry/build_ebt_data_view.ts diff --git a/x-pack/plugins/security_solution/scripts/telemetry/saved_objects/security_solution_ebt_kibana_browser.ndjson b/x-pack/solutions/security/plugins/security_solution/scripts/telemetry/saved_objects/security_solution_ebt_kibana_browser.ndjson similarity index 100% rename from x-pack/plugins/security_solution/scripts/telemetry/saved_objects/security_solution_ebt_kibana_browser.ndjson rename to x-pack/solutions/security/plugins/security_solution/scripts/telemetry/saved_objects/security_solution_ebt_kibana_browser.ndjson diff --git a/x-pack/plugins/security_solution/scripts/telemetry/saved_objects/security_solution_ebt_kibana_server.ndjson b/x-pack/solutions/security/plugins/security_solution/scripts/telemetry/saved_objects/security_solution_ebt_kibana_server.ndjson similarity index 100% rename from x-pack/plugins/security_solution/scripts/telemetry/saved_objects/security_solution_ebt_kibana_server.ndjson rename to x-pack/solutions/security/plugins/security_solution/scripts/telemetry/saved_objects/security_solution_ebt_kibana_server.ndjson diff --git a/x-pack/plugins/security_solution/server/__mocks__/action.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/__mocks__/action.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/__mocks__/action.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/__mocks__/action.mock.ts diff --git a/x-pack/plugins/security_solution/server/__mocks__/alert.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/__mocks__/alert.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/__mocks__/alert.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/__mocks__/alert.mock.ts diff --git a/x-pack/plugins/security_solution/server/__mocks__/core.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/__mocks__/core.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/__mocks__/core.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/__mocks__/core.mock.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/__mocks__/module_name_map.js b/x-pack/solutions/security/plugins/security_solution/server/__mocks__/module_name_map.js new file mode 100644 index 0000000000000..eb94f64d51305 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/__mocks__/module_name_map.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +// See: https://github.com/elastic/kibana/issues/117255, this moduleNameMapper creates +// mocks to avoid memory leaks from kibana core. +module.exports = { + '^@kbn/core/server$': + '<rootDir>/x-pack/solutions/security/plugins/security_solution/server/__mocks__/core.mock.ts', + '^@kbn/task-manager-plugin/server$': + '<rootDir>/x-pack/solutions/security/plugins/security_solution/server/__mocks__/task_manager.mock.ts', + '^@kbn/alerting-plugin/server$': + '<rootDir>/x-pack/solutions/security/plugins/security_solution/server/__mocks__/alert.mock.ts', + '^@kbn/actions-plugin/server$': + '<rootDir>/x-pack/solutions/security/plugins/security_solution/server/__mocks__/action.mock.ts', +}; diff --git a/x-pack/plugins/security_solution/server/__mocks__/task_manager.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/__mocks__/task_manager.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/__mocks__/task_manager.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/__mocks__/task_manager.mock.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/assistant/jest.config.js b/x-pack/solutions/security/plugins/security_solution/server/assistant/jest.config.js new file mode 100644 index 0000000000000..a81358134a905 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/assistant/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/server/assistant'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/server/assistant', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/server/assistant/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/server/assistant/tools/alert_counts/alert_counts_tool.test.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/alert_counts/alert_counts_tool.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/alert_counts/alert_counts_tool.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/alert_counts/alert_counts_tool.test.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/alert_counts/alert_counts_tool.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/alert_counts/alert_counts_tool.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/alert_counts/alert_counts_tool.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/alert_counts/alert_counts_tool.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/alert_counts/get_alert_counts_query.test.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/alert_counts/get_alert_counts_query.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/alert_counts/get_alert_counts_query.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/alert_counts/get_alert_counts_query.test.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/alert_counts/get_alert_counts_query.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/alert_counts/get_alert_counts_query.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/alert_counts/get_alert_counts_query.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/alert_counts/get_alert_counts_query.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/defend_insights/errors.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights/errors.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/defend_insights/errors.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights/errors.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/defend_insights/get_events/get_file_events_query.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights/get_events/get_file_events_query.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/defend_insights/get_events/get_file_events_query.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights/get_events/get_file_events_query.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/defend_insights/get_events/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights/get_events/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/defend_insights/get_events/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights/get_events/index.test.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/defend_insights/get_events/index.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights/get_events/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/defend_insights/get_events/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights/get_events/index.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/defend_insights/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/defend_insights/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights/index.test.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/defend_insights/index.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/defend_insights/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights/index.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/defend_insights/output_parsers/incompatible_antivirus.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights/output_parsers/incompatible_antivirus.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/defend_insights/output_parsers/incompatible_antivirus.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights/output_parsers/incompatible_antivirus.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/defend_insights/output_parsers/index.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights/output_parsers/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/defend_insights/output_parsers/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights/output_parsers/index.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/defend_insights/prompts/incompatible_antivirus.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights/prompts/incompatible_antivirus.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/defend_insights/prompts/incompatible_antivirus.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights/prompts/incompatible_antivirus.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/defend_insights/prompts/index.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights/prompts/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/defend_insights/prompts/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/defend_insights/prompts/index.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/esql/common.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/esql/common.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/esql/common.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/esql/common.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/esql/nl_to_esql_tool.test.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/esql/nl_to_esql_tool.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/esql/nl_to_esql_tool.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/esql/nl_to_esql_tool.test.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/esql/nl_to_esql_tool.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/esql/nl_to_esql_tool.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/esql/nl_to_esql_tool.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/esql/nl_to_esql_tool.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/index.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/index.ts new file mode 100644 index 0000000000000..dd2aa8e54ebdf --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/index.ts @@ -0,0 +1,28 @@ +/* + * 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 { PRODUCT_DOCUMENTATION_TOOL } from './product_docs/product_documentation_tool'; +import { NL_TO_ESQL_TOOL } from './esql/nl_to_esql_tool'; +import { ALERT_COUNTS_TOOL } from './alert_counts/alert_counts_tool'; +import { OPEN_AND_ACKNOWLEDGED_ALERTS_TOOL } from './open_and_acknowledged_alerts/open_and_acknowledged_alerts_tool'; +import { DEFEND_INSIGHTS_TOOL } from './defend_insights'; +import { KNOWLEDGE_BASE_RETRIEVAL_TOOL } from './knowledge_base/knowledge_base_retrieval_tool'; +import { KNOWLEDGE_BASE_WRITE_TOOL } from './knowledge_base/knowledge_base_write_tool'; +import { SECURITY_LABS_KNOWLEDGE_BASE_TOOL } from './security_labs/security_labs_tool'; + +// any new tool should also be added to telemetry schema in +// x-pack/solutions/security/plugins/elastic_assistant/server/lib/telemetry/event_based_telemetry.ts +export const assistantTools = [ + ALERT_COUNTS_TOOL, + DEFEND_INSIGHTS_TOOL, + KNOWLEDGE_BASE_RETRIEVAL_TOOL, + KNOWLEDGE_BASE_WRITE_TOOL, + NL_TO_ESQL_TOOL, + OPEN_AND_ACKNOWLEDGED_ALERTS_TOOL, + PRODUCT_DOCUMENTATION_TOOL, + SECURITY_LABS_KNOWLEDGE_BASE_TOOL, +]; diff --git a/x-pack/plugins/security_solution/server/assistant/tools/knowledge_base/knowledge_base_retrieval_tool.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/knowledge_base/knowledge_base_retrieval_tool.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/knowledge_base/knowledge_base_retrieval_tool.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/knowledge_base/knowledge_base_retrieval_tool.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/knowledge_base/knowledge_base_write_tool.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/knowledge_base/knowledge_base_write_tool.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/knowledge_base/knowledge_base_write_tool.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/knowledge_base/knowledge_base_write_tool.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/open_and_acknowledged_alerts/open_and_acknowledged_alerts_tool.test.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/open_and_acknowledged_alerts/open_and_acknowledged_alerts_tool.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/open_and_acknowledged_alerts/open_and_acknowledged_alerts_tool.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/open_and_acknowledged_alerts/open_and_acknowledged_alerts_tool.test.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/open_and_acknowledged_alerts/open_and_acknowledged_alerts_tool.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/open_and_acknowledged_alerts/open_and_acknowledged_alerts_tool.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/open_and_acknowledged_alerts/open_and_acknowledged_alerts_tool.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/open_and_acknowledged_alerts/open_and_acknowledged_alerts_tool.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/product_docs/product_documentation_tool.test.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/product_docs/product_documentation_tool.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/product_docs/product_documentation_tool.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/product_docs/product_documentation_tool.test.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/product_docs/product_documentation_tool.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/product_docs/product_documentation_tool.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/product_docs/product_documentation_tool.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/product_docs/product_documentation_tool.ts diff --git a/x-pack/plugins/security_solution/server/assistant/tools/security_labs/security_labs_tool.ts b/x-pack/solutions/security/plugins/security_solution/server/assistant/tools/security_labs/security_labs_tool.ts similarity index 100% rename from x-pack/plugins/security_solution/server/assistant/tools/security_labs/security_labs_tool.ts rename to x-pack/solutions/security/plugins/security_solution/server/assistant/tools/security_labs/security_labs_tool.ts diff --git a/x-pack/plugins/security_solution/server/client/client.test.ts b/x-pack/solutions/security/plugins/security_solution/server/client/client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/client/client.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/client/client.test.ts diff --git a/x-pack/plugins/security_solution/server/client/client.ts b/x-pack/solutions/security/plugins/security_solution/server/client/client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/client/client.ts rename to x-pack/solutions/security/plugins/security_solution/server/client/client.ts diff --git a/x-pack/plugins/security_solution/server/client/factory.test.ts b/x-pack/solutions/security/plugins/security_solution/server/client/factory.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/client/factory.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/client/factory.test.ts diff --git a/x-pack/plugins/security_solution/server/client/factory.ts b/x-pack/solutions/security/plugins/security_solution/server/client/factory.ts similarity index 100% rename from x-pack/plugins/security_solution/server/client/factory.ts rename to x-pack/solutions/security/plugins/security_solution/server/client/factory.ts diff --git a/x-pack/plugins/security_solution/server/client/index.ts b/x-pack/solutions/security/plugins/security_solution/server/client/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/client/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/client/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/client/jest.config.js b/x-pack/solutions/security/plugins/security_solution/server/client/jest.config.js new file mode 100644 index 0000000000000..5b769a23ecb63 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/client/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/server/client'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/server/client', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/server/client/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/server/config.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/config.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/config.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/config.mock.ts diff --git a/x-pack/plugins/security_solution/server/config.test.ts b/x-pack/solutions/security/plugins/security_solution/server/config.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/config.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/config.test.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/config.ts b/x-pack/solutions/security/plugins/security_solution/server/config.ts new file mode 100644 index 0000000000000..8b31a21f1e221 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/config.ts @@ -0,0 +1,229 @@ +/* + * 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 { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; +import type { PluginInitializerContext } from '@kbn/core/server'; +import { SIGNALS_INDEX_KEY, DEFAULT_SIGNALS_INDEX } from '../common/constants'; +import type { ExperimentalFeatures } from '../common/experimental_features'; +import { parseExperimentalConfigValue } from '../common/experimental_features'; +import { parseConfigSettings, type ConfigSettings } from '../common/config_settings'; + +/** + * Validates if the value provided is a valid duration for use with Task Manager (ex. 5m, 4s) + */ +const isValidTaskManagerDuration = (value: string): string | undefined => { + if (/^\d+[s,m]{1}$/.test(value)) { + return `Invalid duration [${value}]. Value must be a number followed by either 's' for seconds or 'm' for minutes `; + } +}; + +export const configSchema = schema.object({ + maxRuleImportExportSize: schema.number({ defaultValue: 10000 }), + maxRuleImportPayloadBytes: schema.number({ defaultValue: 10485760 }), + maxTimelineImportExportSize: schema.number({ defaultValue: 10000 }), + maxTimelineImportPayloadBytes: schema.number({ defaultValue: 10485760 }), + + /** + * This is used within the merge strategies: + * server/lib/detection_engine/rule_types/utils/source_fields_merging + * + * For determining which strategy for merging "fields" and "_source" together to get + * runtime fields, constant keywords, etc... + * + * "missingFields" (default) This will only merge fields that are missing from the _source and exist in the fields. + * "noFields" This will turn off all merging of runtime fields, constant keywords from fields. + * "allFields" This will merge and overwrite anything found within "fields" into "_source" before indexing the data. + */ + alertMergeStrategy: schema.oneOf( + [schema.literal('allFields'), schema.literal('missingFields'), schema.literal('noFields')], + { + defaultValue: 'missingFields', + } + ), + + /** + * This is used within the merge strategies: + * server/lib/detection_engine/rule_types/utils/source_fields_merging + * + * For determining if we need to ignore particular "fields" and not merge them with "_source" such as + * runtime fields, constant keywords, etc... + * + * This feature and functionality is mostly as "safety feature" meaning that we have had bugs in the past + * where something down the stack unexpectedly ends up in the fields API which causes documents to not + * be indexable. Rather than changing alertMergeStrategy to be "noFields", you can use this array to add + * any problematic values. + * + * You can use plain dotted notation strings such as "host.name" or a regular expression such as "/host\..+/" + */ + alertIgnoreFields: schema.arrayOf(schema.string(), { + defaultValue: [], + validate(ignoreFields) { + const errors = ignoreFields.flatMap((ignoreField, index) => { + if (ignoreField.startsWith('/') && ignoreField.endsWith('/')) { + try { + new RegExp(ignoreField.slice(1, -1)); + return []; + } catch (error) { + return [`"${error.message}" at array position ${index}`]; + } + } else { + return []; + } + }); + if (errors.length !== 0) { + return errors.join('. '); + } else { + return undefined; + } + }, + }), + [SIGNALS_INDEX_KEY]: schema.string({ defaultValue: DEFAULT_SIGNALS_INDEX }), + + /** + * For internal use. A list of string values (comma delimited) that will enable experimental + * type of functionality that is not yet released. Valid values for this settings need to + * be defined in: + * `x-pack/solutions/security/plugins/security_solution/common/experimental_features.ts` + * under the `allowedExperimentalValues` object + * + * @example + * xpack.securitySolution.enableExperimental: + * - someCrazyFeature + * - someEvenCrazierFeature + */ + enableExperimental: schema.arrayOf(schema.string(), { + defaultValue: () => [], + }), + + /** + * Endpoint Artifacts Configuration: the interval between runs of the task that builds the + * artifacts and associated manifest. + */ + packagerTaskInterval: schema.string({ defaultValue: '60s' }), + + /** + * Endpoint Artifacts Configuration: timeout value for how long the task should run. + */ + packagerTaskTimeout: schema.string({ defaultValue: '20m' }), + + /** + * Artifacts Configuration for package policy update concurrency + */ + packagerTaskPackagePolicyUpdateBatchSize: schema.number({ defaultValue: 25, max: 50, min: 1 }), + + /** + * Complete External Response Actions task: interval duration + */ + completeExternalResponseActionsTaskInterval: schema.string({ + defaultValue: '60s', + validate: isValidTaskManagerDuration, + }), + + /** + * Complete External Response Actions task: Timeout value for how long the task should run + */ + completeExternalResponseActionsTaskTimeout: schema.string({ + defaultValue: '5m', + validate: isValidTaskManagerDuration, + }), + + /** + * For internal use. Specify which version of the Detection Rules fleet package to install + * when upgrading rules. If not provided, the latest compatible package will be installed, + * or if running from a dev environment or -SNAPSHOT build, the latest pre-release package + * will be used (if fleet is available or not within an airgapped environment). + * + * Note: This is for `upgrade only`, which occurs by means of the `useUpgradeSecurityPackages` + * hook when navigating to a Security Solution page. The package version specified in + * `fleet_packages.json` in project root will always be installed first on Kibana start if + * the package is not already installed. + */ + prebuiltRulesPackageVersion: schema.maybe(schema.string()), + enabled: schema.boolean({ defaultValue: true }), + enableUiSettingsValidations: schema.boolean({ defaultValue: false }), + + /** + * The Max number of Bytes allowed for the `upload` endpoint response action + */ + maxUploadResponseActionFileBytes: schema.number({ + defaultValue: 26214400, // 25MB, + max: 104857600, // 100MB, + }), + /** + * Defines the settings for a specific offering of the Security Solution app. + * They override the default values. + * @example + * xpack.securitySolution.offeringSettings: { + * "ILMEnabled": false, + * } + */ + offeringSettings: schema.recordOf(schema.string(), schema.boolean(), { + defaultValue: {}, + }), + entityAnalytics: schema.object({ + riskEngine: schema.object({ + alertSampleSizePerShard: schema.number({ defaultValue: 10_000 }), + }), + assetCriticality: schema.object({ + csvUpload: schema.object({ + errorRetries: schema.number({ defaultValue: 1 }), + maxBulkRequestBodySizeBytes: schema.number({ defaultValue: 100_000 }), // 100KB + }), + }), + entityStore: schema.object({ + syncDelay: schema.duration({ defaultValue: '60s' }), + frequency: schema.duration({ defaultValue: '60s' }), + developer: schema.object({ + pipelineDebugMode: schema.boolean({ defaultValue: false }), + }), + }), + }), +}); + +export type ConfigSchema = TypeOf<typeof configSchema>; + +export type ConfigType = Omit<ConfigSchema, 'offeringSettings'> & { + experimentalFeatures: ExperimentalFeatures; + settings: ConfigSettings; + enableUiSettingsValidations: boolean; +}; + +export const createConfig = (context: PluginInitializerContext): ConfigType => { + const pluginConfig = context.config.get<TypeOf<typeof configSchema>>(); + const logger = context.logger.get('config'); + + const { invalid, features: experimentalFeatures } = parseExperimentalConfigValue( + pluginConfig.enableExperimental + ); + + if (invalid.length) { + logger.warn(`Unsupported "xpack.securitySolution.enableExperimental" values detected. +The following configuration values are no longer supported and should be removed from the kibana configuration file: + + xpack.securitySolution.enableExperimental: +${invalid.map((key) => ` - ${key}`).join('\n')} +`); + } + + const { invalid: invalidConfigSettings, settings } = parseConfigSettings( + pluginConfig.offeringSettings + ); + + if (invalidConfigSettings.length) { + logger.warn(`Unsupported "xpack.securitySolution.offeringSettings" values detected. +The following configuration values are no longer supported and should be removed from the kibana configuration file: +${invalidConfigSettings.map((key) => ` - ${key}`).join('\n')} +`); + } + + return { + ...pluginConfig, + experimentalFeatures, + settings, + }; +}; diff --git a/x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/endpoint_app_context_services.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/endpoint_app_context_services.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/errors.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/errors.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/errors.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/errors.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/endpoint/jest.config.js b/x-pack/solutions/security/plugins/security_solution/server/endpoint/jest.config.js new file mode 100644 index 0000000000000..558473988dc0b --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/endpoint/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/server/endpoint'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/server/endpoint', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/server/endpoint/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/common.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/common.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/artifacts/common.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/common.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/artifacts/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/lists.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/manifest.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/manifest.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/manifest.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/manifest.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest_entry.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/manifest_entry.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest_entry.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/manifest_entry.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest_entry.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/manifest_entry.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/artifacts/manifest_entry.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/manifest_entry.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/migrations.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/migrations.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/artifacts/migrations.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/migrations.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/migrations.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/migrations.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/artifacts/migrations.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/migrations.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/artifacts/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/mocks.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/saved_object_mappings.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/saved_object_mappings.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/artifacts/saved_object_mappings.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/saved_object_mappings.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/task.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/task.mock.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/task.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/task.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/task.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/artifacts/task.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/artifacts/task.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/metadata/check_metadata_transforms_task.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/metadata/check_metadata_transforms_task.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/metadata/check_metadata_transforms_task.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/metadata/check_metadata_transforms_task.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/metadata/check_metadata_transforms_task.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/metadata/check_metadata_transforms_task.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/metadata/check_metadata_transforms_task.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/metadata/check_metadata_transforms_task.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/metadata/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/metadata/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/metadata/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/metadata/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/metadata/task_state.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/metadata/task_state.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/metadata/task_state.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/metadata/task_state.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/metadata/task_state.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/metadata/task_state.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/metadata/task_state.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/metadata/task_state.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/policy/license_watch.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/policy/license_watch.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/protection_updates_note/saved_object_mappings.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/protection_updates_note/saved_object_mappings.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/protection_updates_note/saved_object_mappings.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/protection_updates_note/saved_object_mappings.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/response_actions/complete_external_actions_task.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/response_actions/complete_external_actions_task.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/response_actions/complete_external_actions_task.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/response_actions/complete_external_actions_task.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/response_actions/complete_external_actions_task.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/response_actions/complete_external_actions_task.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/response_actions/complete_external_actions_task.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/response_actions/complete_external_actions_task.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/response_actions/complete_external_actions_task_runner.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/response_actions/complete_external_actions_task_runner.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/response_actions/complete_external_actions_task_runner.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/response_actions/complete_external_actions_task_runner.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/response_actions/complete_external_actions_task_runner.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/response_actions/complete_external_actions_task_runner.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/response_actions/complete_external_actions_task_runner.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/response_actions/complete_external_actions_task_runner.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/response_actions/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/response_actions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/response_actions/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/response_actions/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/simple_mem_cache.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/simple_mem_cache.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/simple_mem_cache.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/simple_mem_cache.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/lib/simple_mem_cache.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/simple_mem_cache.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/lib/simple_mem_cache.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/lib/simple_mem_cache.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/migrations/ensure_indices_exists_for_policies.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/migrations/ensure_indices_exists_for_policies.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/migrations/ensure_indices_exists_for_policies.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/migrations/ensure_indices_exists_for_policies.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/migrations/ensure_indices_exists_for_policies.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/migrations/ensure_indices_exists_for_policies.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/migrations/ensure_indices_exists_for_policies.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/migrations/ensure_indices_exists_for_policies.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/migrations/turn_off_agent_policy_features.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/migrations/turn_off_agent_policy_features.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/migrations/turn_off_agent_policy_features.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/migrations/turn_off_agent_policy_features.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/migrations/turn_off_agent_policy_features.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/migrations/turn_off_agent_policy_features.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/migrations/turn_off_agent_policy_features.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/migrations/turn_off_agent_policy_features.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/migrations/turn_off_policy_protections.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/migrations/turn_off_policy_protections.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/migrations/turn_off_policy_protections.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/migrations/turn_off_policy_protections.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/migrations/turn_off_policy_protections.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/migrations/turn_off_policy_protections.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/migrations/turn_off_policy_protections.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/migrations/turn_off_policy_protections.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/mocks/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/mocks/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/mocks/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/mocks/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/mocks/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/mocks/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/mocks/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/mocks/mocks.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/mocks/utils.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/mocks/utils.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/mocks/utils.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/mocks/utils.mock.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/details.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/details.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/actions/details.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/details.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/details.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/details.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/actions/details.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/details.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/file_download_handler.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/file_download_handler.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/actions/file_download_handler.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/file_download_handler.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/file_download_handler.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/file_download_handler.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/actions/file_download_handler.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/file_download_handler.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/actions/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/list.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/list.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/actions/list.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/list.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/list.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/list.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/actions/list.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/list.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/list_handler.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/list_handler.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/actions/list_handler.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/list_handler.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/list_handler.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/list_handler.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/actions/list_handler.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/list_handler.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/actions/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/mocks.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/state.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/state.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/actions/state.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/state.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/state.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/state.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/actions/state.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/state.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/status.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/status.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/actions/status.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/status.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/status.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/status.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/actions/status.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/status.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/actions/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/utils.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/actions/utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/actions/utils.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/agent/agent_status_handler.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/agent/agent_status_handler.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/agent/agent_status_handler.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/agent/agent_status_handler.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/agent/agent_status_handler.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/agent/agent_status_handler.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/agent/agent_status_handler.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/agent/agent_status_handler.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/agent/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/agent/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/agent/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/agent/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/error_handler.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/error_handler.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/error_handler.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/error_handler.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/handlers.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/handlers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/metadata/handlers.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/handlers.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/metadata.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/metadata.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/metadata/metadata.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/metadata.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.fixtures.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/query_builders.fixtures.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.fixtures.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/query_builders.fixtures.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/query_builders.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/query_builders.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/query_builders.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/query_builders.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/route_schema_test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/route_schema_test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/metadata/route_schema_test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/route_schema_test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/agent_status.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/support/agent_status.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/agent_status.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/support/agent_status.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/agent_status.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/support/agent_status.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/agent_status.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/support/agent_status.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/query_strategies.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/support/query_strategies.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/query_strategies.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/support/query_strategies.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/test_support.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/support/test_support.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/test_support.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/support/test_support.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/policy/handlers.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/policy/handlers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/policy/handlers.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/policy/handlers.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/policy/handlers.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/policy/handlers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/policy/handlers.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/policy/handlers.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/policy/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/policy/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/policy/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/policy/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/policy/service.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/policy/service.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/policy/service.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/policy/service.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/policy/service.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/policy/service.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/policy/service.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/policy/service.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/protection_updates_note/handlers.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/protection_updates_note/handlers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/protection_updates_note/handlers.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/protection_updates_note/handlers.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/protection_updates_note/handlers.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/protection_updates_note/handlers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/protection_updates_note/handlers.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/protection_updates_note/handlers.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/docs/README.md b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/docs/README.md similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/docs/README.md rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/docs/README.md diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/docs/resolver_tree_ancestry.png b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/docs/resolver_tree_ancestry.png similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/docs/resolver_tree_ancestry.png rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/docs/resolver_tree_ancestry.png diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/docs/resolver_tree_children_loop.png b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/docs/resolver_tree_children_loop.png similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/docs/resolver_tree_children_loop.png rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/docs/resolver_tree_children_loop.png diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/docs/resolver_tree_children_pagination.png b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/docs/resolver_tree_children_pagination.png similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/docs/resolver_tree_children_pagination.png rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/docs/resolver_tree_children_pagination.png diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/docs/resolver_tree_children_pagination_with_after.png b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/docs/resolver_tree_children_pagination_with_after.png similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/docs/resolver_tree_children_pagination_with_after.png rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/docs/resolver_tree_children_pagination_with_after.png diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/docs/resolver_tree_children_simple.png b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/docs/resolver_tree_children_simple.png similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/docs/resolver_tree_children_simple.png rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/docs/resolver_tree_children_simple.png diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/entity/handler.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/entity/handler.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/entity/handler.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/entity/handler.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/entity/utils/build_resolver_entity.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/entity/utils/build_resolver_entity.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/entity/utils/build_resolver_entity.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/entity/utils/build_resolver_entity.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/entity/utils/supported_schemas.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/entity/utils/supported_schemas.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/entity/utils/supported_schemas.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/entity/utils/supported_schemas.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/events.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/events.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/events.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/events.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/events.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/queries/events.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/queries/events.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/queries/events.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/tree/handler.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/tree/handler.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/tree/handler.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/tree/handler.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/tree/queries/base.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/tree/queries/base.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/tree/queries/base.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/tree/queries/base.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/tree/queries/descendants.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/tree/queries/descendants.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/tree/queries/descendants.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/tree/queries/descendants.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/tree/queries/lifecycle.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/tree/queries/lifecycle.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/tree/queries/lifecycle.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/tree/queries/lifecycle.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/tree/queries/stats.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/tree/queries/stats.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/tree/queries/stats.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/tree/queries/stats.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/tree/utils/fetch.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/tree/utils/fetch.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/tree/utils/fetch.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/tree/utils/fetch.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/tree/utils/fetch.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/tree/utils/fetch.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/tree/utils/fetch.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/tree/utils/fetch.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/tree/utils/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/tree/utils/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/tree/utils/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/tree/utils/index.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/tree/utils/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/tree/utils/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/tree/utils/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/tree/utils/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/utils/pagination.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/utils/pagination.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/utils/pagination.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/utils/pagination.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/utils/pagination.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/utils/pagination.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/utils/pagination.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/utils/pagination.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/resolver/utils/shared_filters.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/utils/shared_filters.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/resolver/utils/shared_filters.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/resolver/utils/shared_filters.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/suggestions/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/suggestions/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/suggestions/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/suggestions/index.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/suggestions/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/suggestions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/suggestions/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/suggestions/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/with_endpoint_authz.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/with_endpoint_authz.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/with_endpoint_authz.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/with_endpoint_authz.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/with_endpoint_authz.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/with_endpoint_authz.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/with_endpoint_authz.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/with_endpoint_authz.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/get_insights.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/workflow_insights/get_insights.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/get_insights.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/workflow_insights/get_insights.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/get_insights.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/workflow_insights/get_insights.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/get_insights.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/workflow_insights/get_insights.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/workflow_insights/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/workflow_insights/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/update_insight.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/workflow_insights/update_insight.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/update_insight.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/workflow_insights/update_insight.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/update_insight.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/workflow_insights/update_insight.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/update_insight.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/workflow_insights/update_insight.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/common.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/schemas/artifacts/common.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/common.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/schemas/artifacts/common.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/schemas/artifacts/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/schemas/artifacts/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/lists.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/schemas/artifacts/lists.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/lists.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/schemas/artifacts/lists.mock.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/lists.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/schemas/artifacts/lists.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/lists.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/schemas/artifacts/lists.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/manifest.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/schemas/artifacts/manifest.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/manifest.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/schemas/artifacts/manifest.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/saved_objects.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/schemas/artifacts/saved_objects.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/saved_objects.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/schemas/artifacts/saved_objects.mock.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/saved_objects.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/schemas/artifacts/saved_objects.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/schemas/artifacts/saved_objects.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/schemas/artifacts/saved_objects.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/schemas/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/schemas/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/schemas/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/schemas/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/action_details_by_id.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/action_details_by_id.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/action_details_by_id.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/action_details_by_id.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/action_details_by_id.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/action_details_by_id.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/action_details_by_id.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/action_details_by_id.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/action_list.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/action_list.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/action_list.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/action_list.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/action_list.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/action_list.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/action_list.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/action_list.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/crowdstrike_actions_client.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/crowdstrike_actions_client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/crowdstrike_actions_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/crowdstrike_actions_client.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/crowdstrike_actions_client.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/crowdstrike_actions_client.ts similarity index 77% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/crowdstrike_actions_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/crowdstrike_actions_client.ts index 0c505b12c129d..25fcb30be4949 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/crowdstrike_actions_client.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/crowdstrike_actions_client.ts @@ -11,8 +11,13 @@ import { CROWDSTRIKE_CONNECTOR_ID, } from '@kbn/stack-connectors-plugin/common/crowdstrike/constants'; import type { SearchResponse } from '@elastic/elasticsearch/lib/api/types'; -import type { CrowdstrikeBaseApiResponse } from '@kbn/stack-connectors-plugin/common/crowdstrike/types'; +import type { + CrowdstrikeBaseApiResponse, + CrowdStrikeExecuteRTRResponse, +} from '@kbn/stack-connectors-plugin/common/crowdstrike/types'; import { v4 as uuidv4 } from 'uuid'; + +import { mapParametersToCrowdStrikeArguments } from './utils'; import type { CrowdstrikeActionRequestCommonMeta } from '../../../../../../common/endpoint/types/crowdstrike'; import type { CommonResponseActionMethodOptions, @@ -305,15 +310,99 @@ export class CrowdstrikeActionsClient extends ResponseActionsClientImpl { ): Promise< ActionDetails<ResponseActionRunScriptOutputContent, ResponseActionRunScriptParameters> > { - // TODO: just a placeholder for now - return Promise.resolve({ output: 'runscript', code: 200 }) as never as ActionDetails< - ResponseActionRunScriptOutputContent, - ResponseActionRunScriptParameters - >; + const reqIndexOptions: ResponseActionsClientWriteActionRequestToEndpointIndexOptions = { + ...actionRequest, + ...this.getMethodOptions(options), + command: 'runscript', + }; + + let actionResponse: ActionTypeExecutorResult<CrowdStrikeExecuteRTRResponse> | undefined; + if (!reqIndexOptions.error) { + let error = (await this.validateRequest(reqIndexOptions)).error; + if (!error) { + if (!reqIndexOptions.actionId) { + reqIndexOptions.actionId = uuidv4(); + } + + try { + actionResponse = (await this.sendAction(SUB_ACTION.EXECUTE_ADMIN_RTR, { + actionParameters: { comment: this.buildExternalComment(reqIndexOptions) }, + command: mapParametersToCrowdStrikeArguments('runscript', actionRequest.parameters), + endpoint_ids: actionRequest.endpoint_ids, + })) as ActionTypeExecutorResult<CrowdStrikeExecuteRTRResponse>; + } catch (err) { + error = err; + } + } + + reqIndexOptions.error = error?.message; + + if (!this.options.isAutomated && error) { + throw error; + } + } + + const actionRequestDoc = await this.writeActionRequestToEndpointIndex(reqIndexOptions); + + // Ensure actionResponse is assigned before using it + if (actionResponse) { + await this.completeCrowdstrikeBatchAction(actionResponse, actionRequestDoc); + } + + await this.updateCases({ + command: reqIndexOptions.command, + caseIds: reqIndexOptions.case_ids, + alertIds: reqIndexOptions.alert_ids, + actionId: actionRequestDoc.EndpointActions.action_id, + hosts: actionRequest.endpoint_ids.map((agentId) => { + return { + hostId: agentId, + hostname: actionRequestDoc.EndpointActions.data.hosts?.[agentId].name ?? '', + }; + }), + comment: reqIndexOptions.comment, + }); + + return this.fetchActionDetails(actionRequestDoc.EndpointActions.action_id); + } + + private async completeCrowdstrikeBatchAction( + actionResponse: ActionTypeExecutorResult<CrowdStrikeExecuteRTRResponse>, + doc: LogsEndpointAction + ): Promise<void> { + const agentId = doc.agent.id as string; + const stdout = actionResponse.data?.combined.resources[agentId].stdout || ''; + const stderr = actionResponse.data?.combined.resources[agentId].stderr || ''; + const error = actionResponse.data?.combined.resources[agentId].errors?.[0]; + const options = { + actionId: doc.EndpointActions.action_id, + agentId, + data: { + ...doc.EndpointActions.data, + output: { + content: { + stdout, + stderr, + code: '200', + }, + type: 'text' as const, + }, + }, + ...(error + ? { + error: { + code: error.code, + message: `Crowdstrike action failed: ${error.message}`, + }, + } + : {}), + }; + + await this.writeActionResponseToEndpointIndex(options); } private async completeCrowdstrikeAction( - actionResponse: ActionTypeExecutorResult<CrowdstrikeBaseApiResponse> | undefined, + actionResponse: ActionTypeExecutorResult<CrowdstrikeBaseApiResponse>, doc: LogsEndpointAction ): Promise<void> { const options = { diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/mocks.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/utils.test.ts new file mode 100644 index 0000000000000..f961c7a3d1d6b --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/utils.test.ts @@ -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 { mapParametersToCrowdStrikeArguments } from './utils'; + +describe('mapParametersToCrowdStrikeArguments', () => { + it('returns command with single word parameter as is', () => { + const result = mapParametersToCrowdStrikeArguments('runscript', { raw: 'echo Hello' }); + expect(result).toBe('runscript --Raw=```echo Hello```'); + }); + + it('wraps multi-word parameter in triple backticks', () => { + const result = mapParametersToCrowdStrikeArguments('runscript', { + commandLine: 'echo Hello World', + }); + expect(result).toBe('runscript --CommandLine=```echo Hello World```'); + }); + + it('leaves parameter already wrapped in triple backticks unchanged', () => { + const result = mapParametersToCrowdStrikeArguments('runscript', { + commandLine: '```echo Hello World```', + }); + expect(result).toBe('runscript --CommandLine=```echo Hello World```'); + }); + + it('trims spaces from parameter values', () => { + const result = mapParametersToCrowdStrikeArguments('runscript', { raw: ' echo Hello ' }); + expect(result).toBe('runscript --Raw=```echo Hello```'); + }); + + it('handles multiple parameters correctly', () => { + const result = mapParametersToCrowdStrikeArguments('runscript', { + raw: 'echo Hello', + commandLine: 'echo Hello World', + hostPath: '/home/user', + cloudFile: 'file.txt', + }); + expect(result).toBe( + 'runscript --Raw=```echo Hello``` --CommandLine=```echo Hello World``` --HostPath=/home/user --CloudFile=file.txt' + ); + }); + + it('returns command with no parameters correctly', () => { + const result = mapParametersToCrowdStrikeArguments('runscript', {}); + expect(result).toBe('runscript '); + }); +}); diff --git a/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/utils.ts new file mode 100644 index 0000000000000..2ec2ec2bb0cf8 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/utils.ts @@ -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 { upperFirst } from 'lodash'; +import type { RunScriptActionRequestBody } from '../../../../../../common/api/endpoint'; + +export const mapParametersToCrowdStrikeArguments = ( + commandName: string, + parameters: RunScriptActionRequestBody['parameters'] +): string => { + // Map each parameter to the required syntax and join them with spaces + // In short: this function has to transform the parameters object into a string that can be used as a CS command + // One word commands eg. 'ls' can go as it is, but if there are more elements eg. 'ls -l', they have to be wrapped in triple backticks + const commandParts = Object.entries(parameters).map(([key, value]) => { + // Check and process the parameter value + let sanitizedValue; + if (typeof value === 'string') { + if (/^```.*```$/.test(value)) { + // If already wrapped in triple backticks, leave unchanged + sanitizedValue = value; + } else { + const strippedValue = value.trim(); // Remove spaces at the beginning and end + if (strippedValue.split(/\s+/).length === 1) { + // If it's a single element (no spaces), use it as-is + sanitizedValue = strippedValue; + } else { + // If it contains multiple elements (spaces), wrap in ``` + sanitizedValue = `\`\`\`${strippedValue}\`\`\``; + } + } + } else { + sanitizedValue = value; + } + return `--${upperFirst(key)}=${sanitizedValue}`; + }); + + // Combine the base command with the constructed parameters + return `${commandName} ${commandParts.join(' ')}`; +}; diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/endpoint/endpoint_actions_client.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/endpoint/endpoint_actions_client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/clients/endpoint/endpoint_actions_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/endpoint/endpoint_actions_client.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/endpoint/endpoint_actions_client.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/endpoint/endpoint_actions_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/clients/endpoint/endpoint_actions_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/endpoint/endpoint_actions_client.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/endpoint/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/endpoint/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/clients/endpoint/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/endpoint/mocks.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/errors.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/errors.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/clients/errors.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/errors.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/get_response_actions_client.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/get_response_actions_client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/clients/get_response_actions_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/get_response_actions_client.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/get_response_actions_client.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/get_response_actions_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/clients/get_response_actions_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/get_response_actions_client.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/clients/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/normalized_external_connector_client.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/normalized_external_connector_client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/normalized_external_connector_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/normalized_external_connector_client.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/normalized_external_connector_client.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/normalized_external_connector_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/normalized_external_connector_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/normalized_external_connector_client.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/types.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/lib/types.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/mocks.ts new file mode 100644 index 0000000000000..00b4774d9489c --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/mocks.ts @@ -0,0 +1,344 @@ +/* + * 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 { ActionsClientMock } from '@kbn/actions-plugin/server/actions_client/actions_client.mock'; +import { actionsClientMock } from '@kbn/actions-plugin/server/actions_client/actions_client.mock'; +import type { ConnectorWithExtraFindData } from '@kbn/actions-plugin/server/application/connector/types'; +import type { DeepPartial } from 'utility-types'; +import type { ActionTypeExecutorResult } from '@kbn/actions-plugin/common'; +import type { ElasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; +import type { CasesClientMock } from '@kbn/cases-plugin/server/client/mocks'; +import { createCasesClientMock } from '@kbn/cases-plugin/server/client/mocks'; +import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; +import { merge } from 'lodash'; +import type * as esTypes from '@elastic/elasticsearch/lib/api/types'; +import type { TransportResult } from '@elastic/elasticsearch'; +import type { AttachmentsSubClient } from '@kbn/cases-plugin/server/client/attachments/client'; +import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; +import type { DeeplyMockedKeys } from '@kbn/utility-types-jest'; + +import type { ResponseActionsClient } from '../..'; +import { NormalizedExternalConnectorClient } from '../..'; +import type { KillOrSuspendProcessRequestBody } from '../../../../../common/endpoint/types'; +import { BaseDataGenerator } from '../../../../../common/endpoint/data_generators/base_data_generator'; +import { + createActionRequestsEsSearchResultsMock, + createActionResponsesEsSearchResultsMock, + createHapiReadableStreamMock, +} from '../mocks'; +import { + ENDPOINT_ACTION_RESPONSES_INDEX, + ENDPOINT_ACTIONS_INDEX, +} from '../../../../../common/endpoint/constants'; +import type { DeepMutable } from '../../../../../common/endpoint/types/utility_types'; +import { EndpointAppContextService } from '../../../endpoint_app_context_services'; +import { + createMockEndpointAppContextServiceSetupContract, + createMockEndpointAppContextServiceStartContract, +} from '../../../mocks'; +import type { ResponseActionsClientOptions } from './lib/base_response_actions_client'; +import { ACTION_RESPONSE_INDICES } from '../constants'; +import type { + ExecuteActionRequestBody, + GetProcessesRequestBody, + IsolationRouteRequestBody, + ResponseActionGetFileRequestBody, + UploadActionApiRequestBody, + ScanActionRequestBody, + RunScriptActionRequestBody, +} from '../../../../../common/api/endpoint'; + +export interface ResponseActionsClientOptionsMock extends ResponseActionsClientOptions { + esClient: ElasticsearchClientMock; + casesClient?: CasesClientMock; +} + +const createResponseActionClientMock = (): jest.Mocked<ResponseActionsClient> => { + return { + suspendProcess: jest.fn().mockReturnValue(Promise.resolve()), + upload: jest.fn().mockReturnValue(Promise.resolve()), + getFile: jest.fn().mockReturnValue(Promise.resolve()), + execute: jest.fn().mockReturnValue(Promise.resolve()), + killProcess: jest.fn().mockReturnValue(Promise.resolve()), + isolate: jest.fn().mockReturnValue(Promise.resolve()), + release: jest.fn().mockReturnValue(Promise.resolve()), + runningProcesses: jest.fn().mockReturnValue(Promise.resolve()), + processPendingActions: jest.fn().mockReturnValue(Promise.resolve()), + getFileInfo: jest.fn().mockReturnValue(Promise.resolve()), + getFileDownload: jest.fn().mockReturnValue(Promise.resolve()), + scan: jest.fn().mockReturnValue(Promise.resolve()), + runscript: jest.fn().mockReturnValue(Promise.resolve()), + }; +}; + +const createConstructorOptionsMock = (): Required<ResponseActionsClientOptionsMock> => { + const esClient = elasticsearchServiceMock.createScopedClusterClient().asInternalUser; + const casesClient = createCasesClientMock(); + const endpointService = new EndpointAppContextService(); + + esClient.index.mockImplementation((async (payload) => { + switch (payload.index) { + case ENDPOINT_ACTIONS_INDEX: + case ENDPOINT_ACTION_RESPONSES_INDEX: + return createEsIndexTransportResponseMock({ body: { _index: payload.index } }); + default: + throw new Error(`no esClient.index() mock defined for index ${payload.index}`); + } + }) as typeof esClient.index); + + esClient.search.mockImplementation(async (payload) => { + if (payload) { + switch (payload.index) { + case ENDPOINT_ACTIONS_INDEX: + return createActionRequestsEsSearchResultsMock(); + case ACTION_RESPONSE_INDICES: + return createActionResponsesEsSearchResultsMock(); + } + } + + return BaseDataGenerator.toEsSearchResponse([]); + }); + + (casesClient.attachments.bulkCreate as jest.Mock).mockImplementation( + (async () => {}) as unknown as jest.Mocked<AttachmentsSubClient>['bulkCreate'] + ); + + endpointService.setup(createMockEndpointAppContextServiceSetupContract()); + endpointService.start({ + ...createMockEndpointAppContextServiceStartContract(), + esClient, + }); + + return { + esClient, + casesClient, + endpointService, + username: 'foo', + isAutomated: false, + }; +}; + +const createEsIndexTransportResponseMock = ( + overrides: DeepPartial<TransportResult<esTypes.IndexResponse, unknown>> = {} +): TransportResult<esTypes.IndexResponse, unknown> => { + const responseDoc: TransportResult<esTypes.IndexResponse, unknown> = { + body: { + _id: 'indexed-1-2-3', + _index: 'some-index', + _primary_term: 1, + result: 'created', + _seq_no: 1, + _shards: { + failed: 0, + successful: 1, + total: 1, + }, + _version: 1, + }, + statusCode: 201, + headers: {}, + warnings: null, + meta: { + context: {}, + name: 'foo', + request: { + params: { + method: 'GET', + path: 'some/path', + }, + options: {}, + id: 'some-id', + }, + connection: null, + attempts: 1, + aborted: false, + }, + }; + + return merge(responseDoc, overrides); +}; + +const createNoParamsResponseActionOptionsMock = ( + overrides: Partial<IsolationRouteRequestBody> = {} +): DeepMutable<IsolationRouteRequestBody> => { + const isolateOptions: IsolationRouteRequestBody = { + agent_type: 'endpoint', + endpoint_ids: ['1-2-3'], + comment: 'test comment', + }; + + return merge(isolateOptions, overrides); +}; + +const createKillOrSuspendProcessOptionsMock = ( + overrides: Partial<KillOrSuspendProcessRequestBody> = {} +): KillOrSuspendProcessRequestBody => { + const parameters = overrides.parameters ?? { pid: 999 }; + const options: KillOrSuspendProcessRequestBody = { + ...createNoParamsResponseActionOptionsMock(), + parameters, + }; + return merge(options, overrides); +}; + +const createRunningProcessesOptionsMock = ( + overrides: Partial<GetProcessesRequestBody> = {} +): GetProcessesRequestBody => { + return createNoParamsResponseActionOptionsMock(overrides); +}; + +const createGetFileOptionsMock = ( + overrides: Partial<ResponseActionGetFileRequestBody> = {} +): ResponseActionGetFileRequestBody => { + const options: ResponseActionGetFileRequestBody = { + ...createNoParamsResponseActionOptionsMock(), + parameters: { + path: '/some/file', + }, + }; + return merge(options, overrides); +}; + +const createExecuteOptionsMock = ( + overrides: Partial<ExecuteActionRequestBody> = {} +): ExecuteActionRequestBody => { + const options: ExecuteActionRequestBody = { + ...createNoParamsResponseActionOptionsMock(), + parameters: { + command: 'ls -ltr', + }, + }; + + return merge(options, overrides); +}; + +const createUploadOptionsMock = ( + overrides: Partial<UploadActionApiRequestBody> = {} +): UploadActionApiRequestBody => { + const options: UploadActionApiRequestBody = { + ...createNoParamsResponseActionOptionsMock(), + parameters: { + overwrite: true, + }, + file: createHapiReadableStreamMock(), + }; + + return merge(options, overrides); +}; + +const createScanOptionsMock = ( + overrides: Partial<ScanActionRequestBody> = {} +): ScanActionRequestBody => { + const options: ScanActionRequestBody = { + ...createNoParamsResponseActionOptionsMock(), + parameters: { + path: '/scan/folder', + }, + }; + return merge(options, overrides); +}; + +const createRunScriptOptionsMock = ( + overrides: Partial<RunScriptActionRequestBody> = {} +): RunScriptActionRequestBody => { + const options: RunScriptActionRequestBody = { + ...createNoParamsResponseActionOptionsMock(), + parameters: { + raw: 'ls', + }, + }; + return merge(options, overrides); +}; + +const createConnectorMock = ( + overrides: DeepPartial<ConnectorWithExtraFindData> = {} +): ConnectorWithExtraFindData => { + return merge( + { + id: 'connector-mock-id-1', + actionTypeId: '.some-type', + name: 'some mock name', + isMissingSecrets: false, + config: {}, + isPreconfigured: false, + isDeprecated: false, + isSystemAction: false, + referencedByCount: 0, + }, + overrides + ); +}; + +const createConnectorActionExecuteResponseMock = <TData>( + overrides: DeepPartial<ActionTypeExecutorResult<TData>> = {} +): ActionTypeExecutorResult<{}> => { + const result: ActionTypeExecutorResult<TData> = { + actionId: 'execute-response-mock-1', + data: undefined, + message: 'some mock message', + serviceMessage: 'some mock service message', + retry: true, + status: 'ok', + }; + + // @ts-expect-error upgrade typescript v4.9.5 + return merge(result, overrides); +}; + +const createConnectorActionsClientMock = ({ + getAllResponse, +}: { + getAllResponse?: ConnectorWithExtraFindData[]; +} = {}): ActionsClientMock => { + const client = actionsClientMock.create(); + + (client.getAll as jest.Mock).mockImplementation(async () => { + return getAllResponse ?? []; + }); + + return client; +}; + +const createNormalizedExternalConnectorClientMock = ( + connectorActionsClientMock: ActionsClientMock = createConnectorActionsClientMock() +): DeeplyMockedKeys<NormalizedExternalConnectorClient> => { + const normalizedClient = new NormalizedExternalConnectorClient( + connectorActionsClientMock, + loggingSystemMock.createLogger() + ); + + jest.spyOn(normalizedClient, 'execute'); + jest.spyOn(normalizedClient, 'setup'); + + return normalizedClient as DeeplyMockedKeys<NormalizedExternalConnectorClient>; +}; + +export const responseActionsClientMock = Object.freeze({ + create: createResponseActionClientMock, + createConstructorOptions: createConstructorOptionsMock, + + createIsolateOptions: createNoParamsResponseActionOptionsMock, + createReleaseOptions: createNoParamsResponseActionOptionsMock, + createKillProcessOptions: createKillOrSuspendProcessOptionsMock, + createSuspendProcessOptions: createKillOrSuspendProcessOptionsMock, + createRunningProcessesOptions: createRunningProcessesOptionsMock, + createGetFileOptions: createGetFileOptionsMock, + createExecuteOptions: createExecuteOptionsMock, + createUploadOptions: createUploadOptionsMock, + createScanOptions: createScanOptionsMock, + createRunScriptOptions: createRunScriptOptionsMock, + + createIndexedResponse: createEsIndexTransportResponseMock, + + createNormalizedExternalConnectorClient: createNormalizedExternalConnectorClientMock, + + // Some common mocks when working with connector actions client (actions plugin) + createConnectorActionsClient: createConnectorActionsClientMock, + /** Create a mock connector instance */ + createConnector: createConnectorMock, + createConnectorActionExecuteResponse: createConnectorActionExecuteResponseMock, +}); diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/mocks.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/sentinel_one_actions_client.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/types.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/clients/sentinelone/types.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/constants.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/constants.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/constants.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/mocks.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/pending_actions_summary.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/pending_actions_summary.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/pending_actions_summary.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/pending_actions_summary.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/utils/fetch_action_request_by_id.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/utils/fetch_action_request_by_id.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/utils/fetch_action_request_by_id.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/utils/fetch_action_request_by_id.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/utils/fetch_action_requests.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/utils/fetch_action_requests.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/utils/fetch_action_requests.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/utils/fetch_action_requests.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/utils/fetch_action_requests.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/utils/fetch_action_requests.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/utils/fetch_action_requests.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/utils/fetch_action_requests.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/utils/fetch_action_responses.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/utils/fetch_action_responses.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/utils/fetch_action_responses.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/utils/fetch_action_responses.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/utils/fetch_action_responses.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/utils/fetch_action_responses.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/utils/fetch_action_responses.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/utils/fetch_action_responses.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/utils/get_action_agent_type.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/utils/get_action_agent_type.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/utils/get_action_agent_type.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/utils/get_action_agent_type.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/utils/get_action_agent_type.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/utils/get_action_agent_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/utils/get_action_agent_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/utils/get_action_agent_type.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/utils/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/utils/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/utils/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/utils/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/utils/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/utils/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/utils/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/utils/utils.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/utils/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/utils/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/actions/utils/utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/actions/utils/utils.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/agent/clients/crowdstrike/crowdstrike_agent_status_client.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/crowdstrike/crowdstrike_agent_status_client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/agent/clients/crowdstrike/crowdstrike_agent_status_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/crowdstrike/crowdstrike_agent_status_client.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/agent/clients/crowdstrike/crowdstrike_agent_status_client.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/crowdstrike/crowdstrike_agent_status_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/agent/clients/crowdstrike/crowdstrike_agent_status_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/crowdstrike/crowdstrike_agent_status_client.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/agent/clients/crowdstrike/types.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/crowdstrike/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/agent/clients/crowdstrike/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/crowdstrike/types.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/agent/clients/endpoint/endpoint_agent_status_client.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/endpoint/endpoint_agent_status_client.test.ts similarity index 97% rename from x-pack/plugins/security_solution/server/endpoint/services/agent/clients/endpoint/endpoint_agent_status_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/endpoint/endpoint_agent_status_client.test.ts index 821f7e6a43d42..15d5157cd9ede 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/agent/clients/endpoint/endpoint_agent_status_client.test.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/endpoint/endpoint_agent_status_client.test.ts @@ -53,7 +53,7 @@ describe('EndpointAgentStatusClient', () => { // FIXME:PT need to remove the need for this mock. It appears in several test files on our side. // Its currently needed due to the direct use of Fleet's `buildAgentStatusRuntimeField()` in - // `x-pack/plugins/security_solution/server/endpoint/routes/metadata/query_builders.ts:239` + // `x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/query_builders.ts:239` (soClient.find as jest.Mock).mockResolvedValue({ saved_objects: [] }); fleetAppContextService.start( fleetCreateAppContextStartContractMock({}, false, { diff --git a/x-pack/plugins/security_solution/server/endpoint/services/agent/clients/endpoint/endpoint_agent_status_client.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/endpoint/endpoint_agent_status_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/agent/clients/endpoint/endpoint_agent_status_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/endpoint/endpoint_agent_status_client.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/agent/clients/errors.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/errors.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/agent/clients/errors.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/errors.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/agent/clients/get_agent_status_client.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/get_agent_status_client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/agent/clients/get_agent_status_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/get_agent_status_client.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/agent/clients/get_agent_status_client.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/get_agent_status_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/agent/clients/get_agent_status_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/get_agent_status_client.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/agent/clients/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/agent/clients/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/agent/clients/lib/base_agent_status_client.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/lib/base_agent_status_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/agent/clients/lib/base_agent_status_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/lib/base_agent_status_client.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/agent/clients/lib/types.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/lib/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/agent/clients/lib/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/lib/types.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/agent/clients/sentinel_one/sentinel_one_agent_status_client.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/sentinel_one/sentinel_one_agent_status_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/agent/clients/sentinel_one/sentinel_one_agent_status_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/sentinel_one/sentinel_one_agent_status_client.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/agent/clients/sentinel_one/types.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/sentinel_one/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/agent/clients/sentinel_one/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/clients/sentinel_one/types.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/agent/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/agent/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/agent/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/agent/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/agent/mocks.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/artifact_client.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/artifact_client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/artifacts/artifact_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/artifact_client.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/artifact_client.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/artifact_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/artifacts/artifact_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/artifact_client.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/errors.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/errors.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/artifacts/errors.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/errors.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/artifacts/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_client.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/manifest_client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/manifest_client.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_client.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/manifest_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/manifest_client.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.mock.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/manifest_manager/manifest_manager.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/artifacts/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/mocks.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/unified_manifes_client.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/unified_manifes_client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/artifacts/unified_manifes_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/unified_manifes_client.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/unified_manifest_client.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/unified_manifest_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/artifacts/unified_manifest_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/unified_manifest_client.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/artifacts/utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts/utils.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts_exception_list/does_artifact_have_data.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts_exception_list/does_artifact_have_data.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/artifacts_exception_list/does_artifact_have_data.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts_exception_list/does_artifact_have_data.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/artifacts_exception_list/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts_exception_list/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/artifacts_exception_list/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/artifacts_exception_list/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/feature_usage/feature_keys.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/feature_usage/feature_keys.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/feature_usage/feature_keys.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/feature_usage/feature_keys.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/feature_usage/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/feature_usage/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/feature_usage/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/feature_usage/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/feature_usage/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/feature_usage/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/feature_usage/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/feature_usage/mocks.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/feature_usage/service.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/feature_usage/service.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/feature_usage/service.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/feature_usage/service.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/fleet/endpoint_fleet_services_factory.mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/fleet/endpoint_fleet_services_factory.mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/fleet/endpoint_fleet_services_factory.mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/fleet/endpoint_fleet_services_factory.mocks.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/fleet/endpoint_fleet_services_factory.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/fleet/endpoint_fleet_services_factory.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/fleet/endpoint_fleet_services_factory.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/fleet/endpoint_fleet_services_factory.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/fleet/endpoint_fleet_services_factory.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/fleet/endpoint_fleet_services_factory.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/fleet/endpoint_fleet_services_factory.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/fleet/endpoint_fleet_services_factory.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/fleet/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/fleet/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/fleet/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/fleet/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/metadata/errors.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/metadata/errors.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/metadata/errors.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/metadata/errors.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/metadata/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/metadata/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/metadata/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/metadata/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/metadata/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/metadata/mocks.ts new file mode 100644 index 0000000000000..18c5f53f32c0c --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/metadata/mocks.ts @@ -0,0 +1,189 @@ +/* + * 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 { SavedObjectsServiceStart } from '@kbn/core/server'; +import { coreMock, type ElasticsearchClientMock, loggingSystemMock } from '@kbn/core/server/mocks'; +import type { createPackagePolicyServiceMock } from '@kbn/fleet-plugin/server/mocks'; +import type { AgentPolicyServiceInterface, AgentService } from '@kbn/fleet-plugin/server'; +import type { Agent, GetAgentPoliciesResponseItem } from '@kbn/fleet-plugin/common'; +import type { + PolicyData, + UnitedAgentMetadataPersistedData, +} from '../../../../common/endpoint/types'; +import { FleetAgentPolicyGenerator } from '../../../../common/endpoint/data_generators/fleet_agent_policy_generator'; +import { FleetAgentGenerator } from '../../../../common/endpoint/data_generators/fleet_agent_generator'; +import { FleetPackagePolicyGenerator } from '../../../../common/endpoint/data_generators/fleet_package_policy_generator'; +import { applyEsClientSearchMock } from '../../mocks/utils.mock'; +import type { EndpointInternalFleetServicesInterfaceMocked } from '../fleet/endpoint_fleet_services_factory.mocks'; +import { createEndpointFleetServicesFactoryMock } from '../fleet/endpoint_fleet_services_factory.mocks'; +import { createMockEndpointAppContextServiceStartContract } from '../../mocks'; +import { EndpointMetadataService } from './endpoint_metadata_service'; +import { SavedObjectsClientFactory } from '../saved_objects'; +import { + METADATA_UNITED_INDEX, + metadataCurrentIndexPattern, +} from '../../../../common/endpoint/constants'; +import { EndpointMetadataGenerator } from '../../../../common/endpoint/data_generators/endpoint_metadata_generator'; + +/** + * Endpoint Metadata Service test context. Includes an instance of `EndpointMetadataService` along with the + * dependencies that were used to initialize that instance. + */ +export interface EndpointMetadataServiceTestContextMock { + savedObjectsStart: jest.Mocked<SavedObjectsServiceStart>; + agentService: jest.Mocked<AgentService>; + agentPolicyService: jest.Mocked<AgentPolicyServiceInterface>; + packagePolicyService: ReturnType<typeof createPackagePolicyServiceMock>; + endpointMetadataService: EndpointMetadataService; + fleetServices: EndpointInternalFleetServicesInterfaceMocked; + logger: ReturnType<ReturnType<typeof loggingSystemMock.create>['get']>; + esClient: ElasticsearchClientMock; + applyMetadataMocks: typeof applyMetadataMocks; +} + +export const createEndpointMetadataServiceTestContextMock = + (): EndpointMetadataServiceTestContextMock => { + const logger = loggingSystemMock.create().get(); + const { esClient, fleetStartServices, savedObjectsServiceStart } = + createMockEndpointAppContextServiceStartContract(); + const savedObjectsServiceFactory = new SavedObjectsClientFactory( + savedObjectsServiceStart, + coreMock.createSetup().http + ); + const fleetServices = createEndpointFleetServicesFactoryMock({ + fleetDependencies: fleetStartServices, + savedObjects: savedObjectsServiceFactory, + }).service.asInternalUser(); + const endpointMetadataService = new EndpointMetadataService( + esClient, + savedObjectsServiceFactory.createInternalScopedSoClient({ readonly: false }), + fleetServices, + logger + ); + + fleetServices.packagePolicy.list.mockImplementation(async (_, options) => { + return { + items: [], + total: 0, + page: options.page ?? 1, + perPage: options.perPage ?? 10, + }; + }); + + return { + savedObjectsStart: savedObjectsServiceStart, + agentService: { + asInternalUser: fleetServices.agent, + asScoped: jest.fn().mockReturnValue(fleetServices.agent), + asInternalScopedUser: jest.fn().mockReturnValue(fleetServices.agent), + }, + agentPolicyService: fleetServices.agentPolicy, + packagePolicyService: fleetServices.packagePolicy, + logger, + endpointMetadataService, + fleetServices, + applyMetadataMocks, + esClient: esClient as ElasticsearchClientMock, + }; + }; + +export interface ApplyMetadataMocksResponse { + unitedMetadata: UnitedAgentMetadataPersistedData; + integrationPolicies: PolicyData[]; + agentPolicies: GetAgentPoliciesResponseItem[]; + agents: Agent[]; +} + +/** + * Apply mocks to the various services used to retrieve metadata via the EndpointMetadataService. + * Returns the data that is used in the mocks, thus allowing manipulation of it before running the + * test. + * @param esClientMock + * @param fleetServices + */ +export const applyMetadataMocks = ( + esClientMock: ElasticsearchClientMock, + fleetServices: EndpointInternalFleetServicesInterfaceMocked +): ApplyMetadataMocksResponse => { + const metadataGenerator = new EndpointMetadataGenerator('seed'); + const fleetIntegrationPolicyGenerator = new FleetPackagePolicyGenerator('seed'); + const fleetAgentGenerator = new FleetAgentGenerator('seed'); + const fleetAgentPolicyGenerator = new FleetAgentPolicyGenerator('seed'); + + const unitedMetadata = metadataGenerator.generateUnitedAgentMetadata(); + const integrationPolicies = [ + fleetIntegrationPolicyGenerator.generateEndpointPackagePolicy({ + id: unitedMetadata.united.endpoint.Endpoint.policy.applied.id, + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + policy_ids: [unitedMetadata.united.agent.policy_id!], + }), + ]; + const agentPolicies = [ + fleetAgentPolicyGenerator.generate({ id: unitedMetadata.united.agent.policy_id }), + ]; + const agents = [ + fleetAgentGenerator.generate({ + id: unitedMetadata.agent.id, + policy_id: agentPolicies[0].id, + }), + ]; + + applyEsClientSearchMock({ + esClientMock, + index: METADATA_UNITED_INDEX, + response: metadataGenerator.toEsSearchResponse([ + metadataGenerator.toEsSearchHit(unitedMetadata, METADATA_UNITED_INDEX), + ]), + }); + + applyEsClientSearchMock({ + esClientMock, + index: metadataCurrentIndexPattern, + response: metadataGenerator.toEsSearchResponse([ + metadataGenerator.toEsSearchHit(unitedMetadata.united.endpoint, metadataCurrentIndexPattern), + ]), + }); + + fleetServices.packagePolicy.list.mockImplementation(async (_, { page = 1 }) => { + // FYI: need to implement returning an empty list of items after page 1 due to how + // `getAllEndpointPackagePolicies()` is currently looping through all policies + // See `x-pack/solutions/security/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.ts` + return { + items: page === 1 ? integrationPolicies : [], + page: 1, + total: 1, + perPage: 20, + }; + }); + + fleetServices.packagePolicy.get.mockImplementation(async () => { + return integrationPolicies[0]; + }); + + fleetServices.agentPolicy.getByIds.mockImplementation(async () => { + return agentPolicies; + }); + + fleetServices.agentPolicy.get.mockImplementation(async () => { + return agentPolicies[0]; + }); + + fleetServices.agent.getByIds.mockImplementation(async () => { + return agents; + }); + + fleetServices.agent.getAgent.mockImplementation(async () => { + return agents[0]; + }); + + return { + unitedMetadata, + integrationPolicies, + agentPolicies, + agents, + }; +}; diff --git a/x-pack/plugins/security_solution/server/endpoint/services/saved_objects/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/saved_objects/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/saved_objects/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/saved_objects/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/saved_objects/saved_objects_client_factory.mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/saved_objects/saved_objects_client_factory.mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/saved_objects/saved_objects_client_factory.mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/saved_objects/saved_objects_client_factory.mocks.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/saved_objects/saved_objects_client_factory.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/saved_objects/saved_objects_client_factory.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/saved_objects/saved_objects_client_factory.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/saved_objects/saved_objects_client_factory.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/builders/incompatible_antivirus.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/builders/incompatible_antivirus.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/builders/incompatible_antivirus.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/builders/incompatible_antivirus.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/builders/incompatible_antivirus.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/builders/incompatible_antivirus.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/builders/incompatible_antivirus.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/builders/incompatible_antivirus.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/builders/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/builders/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/builders/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/builders/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/constants.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/constants.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/constants.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/errors.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/errors.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/errors.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/errors.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/field_map_configurations.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/field_map_configurations.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/services/workflow_insights/field_map_configurations.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/field_map_configurations.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/helpers.test.ts new file mode 100644 index 0000000000000..50184413063cf --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/helpers.test.ts @@ -0,0 +1,265 @@ +/* + * 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 moment from 'moment'; +import { merge } from 'lodash'; + +import type { ElasticsearchClient } from '@kbn/core/server'; + +import { DataStreamSpacesAdapter } from '@kbn/data-stream-adapter'; +import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; +import { kibanaPackageJson } from '@kbn/repo-info'; +import { DefendInsightType } from '@kbn/elastic-assistant-common'; + +import type { HostMetadata } from '../../../../common/endpoint/types'; +import type { + SearchParams, + SecurityWorkflowInsight, +} from '../../../../common/endpoint/types/workflow_insights'; + +import { + ActionType, + Category, + SourceType, + TargetType, +} from '../../../../common/endpoint/types/workflow_insights'; +import type { EndpointMetadataService } from '../metadata'; +import { + buildEsQueryParams, + createDatastream, + createPipeline, + generateInsightId, + groupEndpointIdsByOS, +} from './helpers'; +import { + COMPONENT_TEMPLATE_NAME, + DATA_STREAM_PREFIX, + INDEX_TEMPLATE_NAME, + INGEST_PIPELINE_NAME, + TOTAL_FIELDS_LIMIT, +} from './constants'; +import { securityWorkflowInsightsFieldMap } from './field_map_configurations'; +import { createMockEndpointAppContext } from '../../mocks'; + +jest.mock('@kbn/data-stream-adapter', () => ({ + DataStreamSpacesAdapter: jest.fn().mockImplementation(() => ({ + setComponentTemplate: jest.fn(), + setIndexTemplate: jest.fn(), + })), +})); + +function getDefaultInsight(overrides?: Partial<SecurityWorkflowInsight>): SecurityWorkflowInsight { + const defaultInsight = { + '@timestamp': moment(), + message: 'This is a test message', + category: Category.Endpoint, + type: DefendInsightType.Enum.incompatible_antivirus, + source: { + type: SourceType.LlmConnector, + id: 'openai-connector-id', + data_range_start: moment(), + data_range_end: moment(), + }, + target: { + type: TargetType.Endpoint, + ids: ['endpoint-1', 'endpoint-2'], + }, + action: { + type: ActionType.Refreshed, + timestamp: moment(), + }, + value: 'unique-key', + remediation: { + exception_list_items: [ + { + list_id: 'example-list-id', + name: 'Example List Name', + description: 'Example description', + entries: [ + { + field: 'example-field', + operator: 'included', + type: 'match', + value: 'example-value', + }, + ], + tags: ['example-tag'], + os_types: ['windows', 'linux'], + }, + ], + }, + metadata: { + notes: { + key1: 'value1', + key2: 'value2', + }, + message_variables: ['variable1', 'variable2'], + }, + }; + return merge(defaultInsight, overrides); +} + +describe('helpers', () => { + describe('createDatastream', () => { + it('should create a DataStreamSpacesAdapter with the correct configuration', () => { + const kibanaVersion = kibanaPackageJson.version; + const ds = createDatastream(kibanaVersion); + + expect(DataStreamSpacesAdapter).toHaveBeenCalledTimes(1); + expect(DataStreamSpacesAdapter).toHaveBeenCalledWith(DATA_STREAM_PREFIX, { + kibanaVersion, + totalFieldsLimit: TOTAL_FIELDS_LIMIT, + }); + expect(ds.setComponentTemplate).toHaveBeenCalledTimes(1); + expect(ds.setComponentTemplate).toHaveBeenCalledWith({ + name: COMPONENT_TEMPLATE_NAME, + fieldMap: securityWorkflowInsightsFieldMap, + }); + expect(ds.setIndexTemplate).toHaveBeenCalledTimes(1); + expect(ds.setIndexTemplate).toHaveBeenCalledWith({ + name: INDEX_TEMPLATE_NAME, + componentTemplateRefs: [COMPONENT_TEMPLATE_NAME], + template: { + settings: { + default_pipeline: INGEST_PIPELINE_NAME, + }, + }, + hidden: true, + }); + }); + }); + + describe('createPipeline', () => { + let esClient: ElasticsearchClient; + + beforeEach(() => { + esClient = elasticsearchServiceMock.createElasticsearchClient(); + }); + + it('should create an ingest pipeline with the correct configuration', async () => { + await createPipeline(esClient); + + expect(esClient.ingest.putPipeline).toHaveBeenCalledTimes(1); + expect(esClient.ingest.putPipeline).toHaveBeenCalledWith({ + id: INGEST_PIPELINE_NAME, + processors: [], + _meta: { + managed: true, + }, + }); + }); + }); + + describe('buildEsQueryParams', () => { + it('should build query with valid keys', () => { + const searchParams: SearchParams = { + ids: ['id1', 'id2'], + categories: [Category.Endpoint], + types: ['incompatible_antivirus'], + sourceTypes: [SourceType.LlmConnector], + sourceIds: ['source1'], + targetIds: ['target1'], + actionTypes: [ActionType.Refreshed], + }; + const result = buildEsQueryParams(searchParams); + expect(result).toEqual([ + { terms: { _id: ['id1', 'id2'] } }, + { terms: { categories: ['endpoint'] } }, + { terms: { types: ['incompatible_antivirus'] } }, + { nested: { path: 'source', query: { terms: { 'source.type': ['llm-connector'] } } } }, + { nested: { path: 'source', query: { terms: { 'source.id': ['source1'] } } } }, + { nested: { path: 'target', query: { terms: { 'target.ids': ['target1'] } } } }, + { nested: { path: 'action', query: { terms: { 'action.type': ['refreshed'] } } } }, + ]); + }); + + it('should ignore invalid keys', () => { + const searchParams = { + invalidKey: 'invalidValue', + ids: ['id1'], + } as unknown as SearchParams; + const result = buildEsQueryParams(searchParams); + expect(result).toEqual([{ terms: { _id: ['id1'] } }]); + }); + + it('should handle empty searchParams', () => { + const searchParams: SearchParams = {}; + const result = buildEsQueryParams(searchParams); + expect(result).toEqual([]); + }); + + it('should handle nested query for actionTypes', () => { + const searchParams: SearchParams = { + actionTypes: [ActionType.Refreshed], + }; + const result = buildEsQueryParams(searchParams); + expect(result).toEqual([ + { nested: { path: 'action', query: { terms: { 'action.type': ['refreshed'] } } } }, + ]); + }); + + it('should handle nested query for targetIds', () => { + const searchParams: SearchParams = { + targetIds: ['target1'], + }; + const result = buildEsQueryParams(searchParams); + expect(result).toEqual([ + { nested: { path: 'target', query: { terms: { 'target.ids': ['target1'] } } } }, + ]); + }); + }); + + describe('groupEndpointIdsByOS', () => { + let endpointMetadataService: jest.Mocked<EndpointMetadataService>; + + beforeEach(() => { + const mockEndpointAppContextService = createMockEndpointAppContext().service; + mockEndpointAppContextService.getEndpointMetadataService = jest.fn().mockReturnValue({ + getMetadataForEndpoints: jest.fn(), + }); + endpointMetadataService = + mockEndpointAppContextService.getEndpointMetadataService() as jest.Mocked<EndpointMetadataService>; + }); + + it('should correctly group endpoint IDs by OS type', async () => { + const endpointIds = ['endpoint1', 'endpoint2', 'endpoint3']; + const metadata = [ + { + host: { os: { name: 'Windows' } }, + agent: { id: 'agent1' }, + }, + { + host: { os: { name: 'Linux' } }, + agent: { id: 'agent2' }, + }, + { + host: { os: { name: 'MacOS' } }, + agent: { id: 'agent3' }, + }, + ] as HostMetadata[]; + + endpointMetadataService.getMetadataForEndpoints.mockResolvedValue(metadata); + + const result = await groupEndpointIdsByOS(endpointIds, endpointMetadataService); + + expect(result).toEqual({ + windows: ['agent1'], + linux: ['agent2'], + macos: ['agent3'], + }); + }); + }); + + describe('generateInsightId', () => { + it('should generate the correct hashed id', () => { + const insight = getDefaultInsight(); + const result = generateInsightId(insight); + const expectedHash = '6b1a7a9625decbf899db4fbf78105a0eff9ef98e3f2dadc2781d59996b55445e'; + expect(result).toBe(expectedHash); + }); + }); +}); diff --git a/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/helpers.ts new file mode 100644 index 0000000000000..f7b477a17018d --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/helpers.ts @@ -0,0 +1,151 @@ +/* + * 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 { createHash } from 'crypto'; +import { get as _get } from 'lodash'; + +import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; +import type { ElasticsearchClient } from '@kbn/core/server'; + +import { DataStreamSpacesAdapter } from '@kbn/data-stream-adapter'; + +import type { + SearchParams, + SecurityWorkflowInsight, +} from '../../../../common/endpoint/types/workflow_insights'; +import type { SupportedHostOsType } from '../../../../common/endpoint/constants'; + +import type { EndpointMetadataService } from '../metadata'; +import { + COMPONENT_TEMPLATE_NAME, + DATA_STREAM_PREFIX, + INDEX_TEMPLATE_NAME, + INGEST_PIPELINE_NAME, + TOTAL_FIELDS_LIMIT, +} from './constants'; +import { securityWorkflowInsightsFieldMap } from './field_map_configurations'; + +export function createDatastream(kibanaVersion: string): DataStreamSpacesAdapter { + const ds = new DataStreamSpacesAdapter(DATA_STREAM_PREFIX, { + kibanaVersion, + totalFieldsLimit: TOTAL_FIELDS_LIMIT, + }); + ds.setComponentTemplate({ + name: COMPONENT_TEMPLATE_NAME, + fieldMap: securityWorkflowInsightsFieldMap, + }); + ds.setIndexTemplate({ + name: INDEX_TEMPLATE_NAME, + componentTemplateRefs: [COMPONENT_TEMPLATE_NAME], + template: { + settings: { + default_pipeline: INGEST_PIPELINE_NAME, + }, + }, + hidden: true, + }); + return ds; +} + +export async function createPipeline(esClient: ElasticsearchClient): Promise<boolean> { + const response = await esClient.ingest.putPipeline({ + id: INGEST_PIPELINE_NAME, + processors: [ + // requires @elastic/elasticsearch 8.16.0 + // { + // fingerprint: { + // fields: ['type', 'category', 'value', 'target.type', 'target.id'], + // target_field: '_id', + // method: 'SHA-256', + // if: 'ctx._id == null', + // }, + // }, + ], + _meta: { + managed: true, + }, + }); + return response.acknowledged; +} + +const validKeys = new Set([ + 'ids', + 'categories', + 'types', + 'sourceTypes', + 'sourceIds', + 'targetTypes', + 'targetIds', + 'actionTypes', +]); + +const paramFieldMap = { + ids: '_id', + sourceTypes: 'source.type', + sourceIds: 'source.id', + targetTypes: 'target.type', + targetIds: 'target.ids', + actionTypes: 'action.type', +}; +const nestedKeys = new Set(['source', 'target', 'action']); +export function buildEsQueryParams(searchParams: SearchParams): QueryDslQueryContainer[] { + return Object.entries(searchParams).reduce((acc: object[], [k, v]) => { + if (!validKeys.has(k)) { + return acc; + } + + const paramKey = _get(paramFieldMap, k, k); + + const topKey = paramKey.split('.')[0]; + if (nestedKeys.has(topKey)) { + const nestedQuery = { + nested: { + path: topKey, + query: { + terms: { [paramKey]: v }, + }, + }, + }; + return [...acc, nestedQuery]; + } + + const next = { terms: { [paramKey]: v } }; + return [...acc, next]; + }, []); +} + +export async function groupEndpointIdsByOS( + endpointIds: string[], + endpointMetadataService: EndpointMetadataService +): Promise<Record<SupportedHostOsType, string[]>> { + const metadata = await endpointMetadataService.getMetadataForEndpoints(endpointIds); + return metadata.reduce<Record<string, string[]>>((acc, m) => { + const os = m.host.os.name.toLowerCase() as SupportedHostOsType; + if (!acc[os]) { + acc[os] = []; + } + + acc[os].push(m.agent.id); + + return acc; + }, {}); +} + +export function generateInsightId(insight: SecurityWorkflowInsight): string { + const { type, category, value, target } = insight; + const targetType = target.type; + const targetIds = target.ids.join(','); + + const hash = createHash('sha256'); + hash.update(type); + hash.update(category); + hash.update(value); + hash.update(targetType); + hash.update(targetIds); + + return hash.digest('hex'); +} diff --git a/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/index.test.ts new file mode 100644 index 0000000000000..849c6431a09a8 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/index.test.ts @@ -0,0 +1,445 @@ +/* + * 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 { merge, cloneDeep } from 'lodash'; +import moment from 'moment'; +import { ReplaySubject } from 'rxjs'; + +import type { ElasticsearchClient, KibanaRequest, Logger } from '@kbn/core/server'; +import type { DefendInsight, DefendInsightsPostRequestBody } from '@kbn/elastic-assistant-common'; +import type { SearchHit, UpdateResponse } from '@elastic/elasticsearch/lib/api/types'; + +import { DataStreamSpacesAdapter } from '@kbn/data-stream-adapter'; +import { DefendInsightType } from '@kbn/elastic-assistant-common'; +import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; +import { kibanaPackageJson } from '@kbn/repo-info'; +import { loggerMock } from '@kbn/logging-mocks'; + +import type { + SearchParams, + SecurityWorkflowInsight, +} from '../../../../common/endpoint/types/workflow_insights'; +import type { EndpointAppContextService } from '../../endpoint_app_context_services'; + +import { + Category, + SourceType, + TargetType, + ActionType, +} from '../../../../common/endpoint/types/workflow_insights'; +import { createMockEndpointAppContext } from '../../mocks'; +import { createDatastream, createPipeline, generateInsightId } from './helpers'; +import { securityWorkflowInsightsService } from '.'; +import { DATA_STREAM_NAME } from './constants'; +import { buildWorkflowInsights } from './builders'; + +jest.mock('./helpers', () => { + const original = jest.requireActual('./helpers'); + return { + ...original, + createDatastream: jest.fn(), + createPipeline: jest.fn(), + }; +}); + +jest.mock('./builders', () => { + const original = jest.requireActual('./builders'); + return { + ...original, + buildWorkflowInsights: jest.fn(), + }; +}); + +function getDefaultInsight(overrides?: Partial<SecurityWorkflowInsight>): SecurityWorkflowInsight { + const defaultInsight = { + '@timestamp': moment(), + message: 'This is a test message', + category: Category.Endpoint, + type: DefendInsightType.Enum.incompatible_antivirus, + source: { + type: SourceType.LlmConnector, + id: 'openai-connector-id', + data_range_start: moment(), + data_range_end: moment(), + }, + target: { + type: TargetType.Endpoint, + ids: ['endpoint-1', 'endpoint-2'], + }, + action: { + type: ActionType.Refreshed, + timestamp: moment(), + }, + value: 'unique-key', + remediation: { + exception_list_items: [ + { + list_id: 'example-list-id', + name: 'Example List Name', + description: 'Example description', + entries: [ + { + field: 'example-field', + operator: 'included', + type: 'match', + value: 'example-value', + }, + ], + tags: ['example-tag'], + os_types: ['windows', 'linux'], + }, + ], + }, + metadata: { + notes: { + key1: 'value1', + key2: 'value2', + }, + message_variables: ['variable1', 'variable2'], + }, + }; + return merge(defaultInsight, overrides); +} + +describe('SecurityWorkflowInsightsService', () => { + let logger: Logger; + let esClient: ElasticsearchClient; + let mockEndpointAppContextService: jest.Mocked<EndpointAppContextService>; + let isInitializedSpy: jest.SpyInstance<Promise<[void, void]>, [], boolean>; + + beforeEach(() => { + logger = loggerMock.create(); + esClient = elasticsearchServiceMock.createElasticsearchClient(); + + mockEndpointAppContextService = createMockEndpointAppContext() + .service as jest.Mocked<EndpointAppContextService>; + + isInitializedSpy = jest + .spyOn(securityWorkflowInsightsService, 'isInitialized', 'get') + .mockResolvedValueOnce([undefined, undefined]); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + describe('setup', () => { + it('should set up the data stream', () => { + const createDatastreamMock = createDatastream as jest.Mock; + createDatastreamMock.mockReturnValueOnce( + new DataStreamSpacesAdapter(DATA_STREAM_NAME, { + kibanaVersion: kibanaPackageJson.version, + }) + ); + + securityWorkflowInsightsService.setup({ + kibanaVersion: kibanaPackageJson.version, + logger, + isFeatureEnabled: true, + endpointContext: mockEndpointAppContextService, + }); + + expect(createDatastreamMock).toHaveBeenCalledTimes(1); + expect(createDatastreamMock).toHaveBeenCalledWith(kibanaPackageJson.version); + }); + + it('should log a warning if createDatastream throws an error', () => { + const createDatastreamMock = createDatastream as jest.Mock; + createDatastreamMock.mockImplementation(() => { + throw new Error('test error'); + }); + + securityWorkflowInsightsService.setup({ + kibanaVersion: kibanaPackageJson.version, + logger, + isFeatureEnabled: true, + endpointContext: mockEndpointAppContextService, + }); + + expect(logger.warn).toHaveBeenCalledTimes(1); + expect(logger.warn).toHaveBeenCalledWith(expect.stringContaining('test error')); + }); + }); + + describe('start', () => { + it('should start the service', async () => { + const createDatastreamMock = createDatastream as jest.Mock; + const ds = new DataStreamSpacesAdapter(DATA_STREAM_NAME, { + kibanaVersion: kibanaPackageJson.version, + }); + const dsInstallSpy = jest.spyOn(ds, 'install'); + dsInstallSpy.mockResolvedValueOnce(); + createDatastreamMock.mockReturnValueOnce(ds); + const createPipelineMock = createPipeline as jest.Mock; + createPipelineMock.mockResolvedValueOnce(true); + const createDataStreamMock = esClient.indices.createDataStream as jest.Mock; + + securityWorkflowInsightsService.setup({ + kibanaVersion: kibanaPackageJson.version, + logger, + isFeatureEnabled: true, + endpointContext: mockEndpointAppContextService, + }); + expect(createDatastreamMock).toHaveBeenCalledTimes(1); + expect(createDatastreamMock).toHaveBeenCalledWith(kibanaPackageJson.version); + + await securityWorkflowInsightsService.start({ esClient }); + + expect(createPipelineMock).toHaveBeenCalledTimes(1); + expect(createPipelineMock).toHaveBeenCalledWith(esClient); + expect(dsInstallSpy).toHaveBeenCalledTimes(1); + expect(dsInstallSpy).toHaveBeenCalledWith({ + logger, + esClient, + pluginStop$: expect.any(ReplaySubject), + }); + expect(createDataStreamMock).toHaveBeenCalledTimes(1); + expect(createDataStreamMock).toHaveBeenCalledWith({ name: DATA_STREAM_NAME }); + }); + + it('should log a warning if createPipeline or ds.install throws an error', async () => { + securityWorkflowInsightsService.setup({ + kibanaVersion: kibanaPackageJson.version, + logger, + isFeatureEnabled: true, + endpointContext: mockEndpointAppContextService, + }); + + const createPipelineMock = createPipeline as jest.Mock; + createPipelineMock.mockImplementationOnce(() => { + throw new Error('test error'); + }); + + await securityWorkflowInsightsService.start({ esClient }); + + expect(logger.warn).toHaveBeenCalledTimes(2); + expect(logger.warn).toHaveBeenNthCalledWith(1, expect.stringContaining('test error')); + }); + }); + + describe('createFromDefendInsights', () => { + it('should create workflow insights from defend insights', async () => { + const defendInsights: DefendInsight[] = [ + { + group: 'AVGAntivirus', + events: [ + { + id: 'lqw5opMB9Ke6SNgnxRSZ', + endpointId: 'f6e2f338-6fb7-4c85-9c23-d20e9f96a051', + value: '/Applications/AVGAntivirus.app/Contents/Backend/services/com.avg.activity', + }, + ], + }, + ]; + + const request = {} as KibanaRequest<unknown, unknown, DefendInsightsPostRequestBody>; + const workflowInsights: SecurityWorkflowInsight[] = [getDefaultInsight()]; + + const buildWorkflowInsightsMock = buildWorkflowInsights as jest.Mock; + buildWorkflowInsightsMock.mockResolvedValueOnce(workflowInsights); + + const esClientIndexResp = { + _index: DATA_STREAM_NAME, + _id: '1', + result: 'created' as const, + _shards: { + total: 1, + successful: 1, + failed: 0, + }, + _version: 1, + }; + jest.spyOn(esClient, 'index').mockResolvedValue(esClientIndexResp); + await securityWorkflowInsightsService.start({ esClient }); + const result = await securityWorkflowInsightsService.createFromDefendInsights( + defendInsights, + request + ); + + // three since it calls securityWorkflowInsightsService.create + fetch + expect(isInitializedSpy).toHaveBeenCalledTimes(3); + expect(buildWorkflowInsightsMock).toHaveBeenCalledWith({ + defendInsights, + request, + endpointMetadataService: expect.any(Object), + }); + expect(result).toEqual(workflowInsights.map(() => esClientIndexResp)); + }); + }); + + describe('create', () => { + it('should index the doc correctly', async () => { + await securityWorkflowInsightsService.start({ esClient }); + const insight = getDefaultInsight(); + await securityWorkflowInsightsService.create(insight); + + // two since it calls fetch as well + expect(isInitializedSpy).toHaveBeenCalledTimes(2); + // indexes the doc + expect(esClient.index).toHaveBeenCalledTimes(1); + expect(esClient.index).toHaveBeenCalledWith({ + index: DATA_STREAM_NAME, + body: { ...insight, id: generateInsightId(insight) }, + refresh: 'wait_for', + }); + }); + + it('should call update instead if insight already exists', async () => { + const indexName = 'backing-index'; + const fetchSpy = jest + .spyOn(securityWorkflowInsightsService, 'fetch') + .mockResolvedValueOnce([{ _index: indexName }] as Array< + SearchHit<SecurityWorkflowInsight> + >); + const updateSpy = jest + .spyOn(securityWorkflowInsightsService, 'update') + .mockResolvedValueOnce({} as UpdateResponse); + await securityWorkflowInsightsService.start({ esClient }); + const insight = getDefaultInsight(); + await securityWorkflowInsightsService.create(insight); + + const expectedInsight = cloneDeep(insight); + expectedInsight['@timestamp'] = expect.any(moment); + expectedInsight.action.timestamp = expect.any(moment); + expectedInsight.source.data_range_start = expect.any(moment); + expectedInsight.source.data_range_end = expect.any(moment); + + // ensure it waits for initialization first + expect(isInitializedSpy).toHaveBeenCalledTimes(1); + expect(fetchSpy).toHaveBeenCalledTimes(1); + expect(updateSpy).toHaveBeenCalledTimes(1); + expect(updateSpy).toHaveBeenCalledWith( + generateInsightId(insight), + expect.objectContaining(insight), + indexName + ); + }); + }); + + describe('update', () => { + it('should update the doc correctly', async () => { + await securityWorkflowInsightsService.start({ esClient }); + const insightId = 'some-insight-id'; + const insight = getDefaultInsight(); + const indexName = 'backing-index-name'; + await securityWorkflowInsightsService.update(insightId, insight, indexName); + + // ensure it waits for initialization first + expect(isInitializedSpy).toHaveBeenCalledTimes(1); + // updates the doc + expect(esClient.update).toHaveBeenCalledTimes(1); + expect(esClient.update).toHaveBeenCalledWith({ + index: indexName, + id: insightId, + body: { doc: insight }, + refresh: 'wait_for', + }); + }); + }); + + describe('fetch', () => { + it('should fetch the docs with the correct params', async () => { + await securityWorkflowInsightsService.start({ esClient }); + const searchParams: SearchParams = { + size: 50, + from: 50, + ids: ['id1', 'id2'], + categories: [Category.Endpoint], + types: [DefendInsightType.Enum.incompatible_antivirus], + sourceTypes: [SourceType.LlmConnector], + sourceIds: ['source-id1', 'source-id2'], + targetTypes: [TargetType.Endpoint], + targetIds: ['target-id1', 'target-id2'], + actionTypes: [ActionType.Refreshed, ActionType.Remediated], + }; + await securityWorkflowInsightsService.fetch(searchParams); + + // ensure it waits for initialization first + expect(isInitializedSpy).toHaveBeenCalledTimes(1); + // fetches the doc + expect(esClient.search).toHaveBeenCalledTimes(1); + expect(esClient.search).toHaveBeenCalledWith({ + index: DATA_STREAM_NAME, + body: { + query: { + bool: { + must: [ + { + terms: { + _id: ['id1', 'id2'], + }, + }, + { + terms: { + categories: ['endpoint'], + }, + }, + { + terms: { + types: ['incompatible_antivirus'], + }, + }, + { + nested: { + path: 'source', + query: { + terms: { + 'source.type': ['llm-connector'], + }, + }, + }, + }, + { + nested: { + path: 'source', + query: { + terms: { + 'source.id': ['source-id1', 'source-id2'], + }, + }, + }, + }, + { + nested: { + path: 'target', + query: { + terms: { + 'target.type': ['endpoint'], + }, + }, + }, + }, + { + nested: { + path: 'target', + query: { + terms: { + 'target.ids': ['target-id1', 'target-id2'], + }, + }, + }, + }, + { + nested: { + path: 'action', + query: { + terms: { + 'action.type': ['refreshed', 'remediated'], + }, + }, + }, + }, + ], + }, + }, + size: searchParams.size, + from: searchParams.from, + }, + }); + }); + }); +}); diff --git a/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/index.ts new file mode 100644 index 0000000000000..1baeaf74e00f0 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/endpoint/services/workflow_insights/index.ts @@ -0,0 +1,230 @@ +/* + * 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 { ReplaySubject, firstValueFrom, combineLatest } from 'rxjs'; + +import type { + SearchHit, + UpdateResponse, + WriteResponseBase, +} from '@elastic/elasticsearch/lib/api/types'; +import type { ElasticsearchClient, KibanaRequest, Logger } from '@kbn/core/server'; +import type { DataStreamSpacesAdapter } from '@kbn/data-stream-adapter'; +import type { DefendInsight, DefendInsightsPostRequestBody } from '@kbn/elastic-assistant-common'; + +import type { + SearchParams, + SecurityWorkflowInsight, +} from '../../../../common/endpoint/types/workflow_insights'; +import type { EndpointAppContextService } from '../../endpoint_app_context_services'; + +import { SecurityWorkflowInsightsFailedInitialized } from './errors'; +import { buildEsQueryParams, createDatastream, createPipeline, generateInsightId } from './helpers'; +import { DATA_STREAM_NAME } from './constants'; +import { buildWorkflowInsights } from './builders'; + +const DEFAULT_PAGE_SIZE = 10; + +interface SetupInterface { + kibanaVersion: string; + logger: Logger; + isFeatureEnabled: boolean; + endpointContext: EndpointAppContextService; +} + +interface StartInterface { + esClient: ElasticsearchClient; +} + +class SecurityWorkflowInsightsService { + private setup$ = new ReplaySubject<void>(1); + private start$ = new ReplaySubject<void>(1); + private stop$ = new ReplaySubject<void>(1); + private ds: DataStreamSpacesAdapter | undefined; + private _esClient: ElasticsearchClient | undefined; + private _endpointContext: EndpointAppContextService | undefined; + private _logger: Logger | undefined; + private _isInitialized: Promise<[void, void]> = firstValueFrom( + combineLatest<[void, void]>([this.setup$, this.start$]) + ); + private isFeatureEnabled = false; + + public get isInitialized() { + return this._isInitialized; + } + + public setup({ kibanaVersion, logger, isFeatureEnabled, endpointContext }: SetupInterface) { + this.isFeatureEnabled = isFeatureEnabled; + if (!isFeatureEnabled) { + return; + } + + this._logger = logger; + this._endpointContext = endpointContext; + + try { + this.ds = createDatastream(kibanaVersion); + } catch (err) { + this.logger.warn(new SecurityWorkflowInsightsFailedInitialized(err.message).message); + return; + } + + this.setup$.next(); + } + + public async start({ esClient }: StartInterface) { + if (!this.isFeatureEnabled) { + return; + } + + this._esClient = esClient; + await firstValueFrom(this.setup$); + + try { + await createPipeline(esClient); + await this.ds?.install({ + logger: this.logger, + esClient, + pluginStop$: this.stop$, + }); + + try { + await esClient.indices.createDataStream({ name: DATA_STREAM_NAME }); + } catch (err) { + if (err?.body?.error?.type === 'resource_already_exists_exception') { + this.logger.debug(`Datastream ${DATA_STREAM_NAME} already exists`); + } else { + throw new SecurityWorkflowInsightsFailedInitialized(err.message); + } + } + } catch (err) { + this.logger.warn(err.message); + return; + } + + this.start$.next(); + } + + public stop() { + this.setup$.next(); + this.setup$.complete(); + this.start$.next(); + this.start$.complete(); + this.stop$.next(); + this.stop$.complete(); + } + + public async createFromDefendInsights( + defendInsights: DefendInsight[], + request: KibanaRequest<unknown, unknown, DefendInsightsPostRequestBody> + ): Promise<WriteResponseBase[]> { + await this.isInitialized; + + const workflowInsights = await buildWorkflowInsights({ + defendInsights, + request, + endpointMetadataService: this.endpointContext.getEndpointMetadataService(), + }); + return Promise.all(workflowInsights.map((insight) => this.create(insight))); + } + + public async create(insight: SecurityWorkflowInsight): Promise<WriteResponseBase> { + await this.isInitialized; + + const id = generateInsightId(insight); + + // if insight already exists, update instead + const existingInsights = await this.fetch({ ids: [id] }); + if (existingInsights.length) { + return this.update(id, insight, existingInsights[0]._index); + } + + const response = await this.esClient.index<SecurityWorkflowInsight>({ + index: DATA_STREAM_NAME, + body: { ...insight, id }, + refresh: 'wait_for', + }); + + return response; + } + + public async update( + id: string, + insight: Partial<SecurityWorkflowInsight>, + backingIndex?: string + ): Promise<UpdateResponse> { + await this.isInitialized; + + let index = backingIndex; + if (!index) { + const retrievedInsight = (await this.fetch({ ids: [id] }))[0]; + index = retrievedInsight?._index; + } + + if (!index) { + throw new Error('invalid backing index for updating workflow insight'); + } + + const response = await this.esClient.update<SecurityWorkflowInsight>({ + index, + id, + body: { doc: insight }, + refresh: 'wait_for', + }); + + return response; + } + + public async fetch(params?: SearchParams): Promise<Array<SearchHit<SecurityWorkflowInsight>>> { + await this.isInitialized; + + const size = params?.size ?? DEFAULT_PAGE_SIZE; + const from = params?.from ?? 0; + + const termFilters = params ? buildEsQueryParams(params) : []; + const response = await this.esClient.search<SecurityWorkflowInsight>({ + index: DATA_STREAM_NAME, + body: { + query: { + bool: { + must: termFilters, + }, + }, + size, + from, + }, + }); + + return response?.hits?.hits ?? []; + } + + private get esClient(): ElasticsearchClient { + if (!this._esClient) { + throw new SecurityWorkflowInsightsFailedInitialized('no elasticsearch client found'); + } + + return this._esClient; + } + + private get logger(): Logger { + if (!this._logger) { + throw new SecurityWorkflowInsightsFailedInitialized('no logger found'); + } + + return this._logger; + } + + private get endpointContext(): EndpointAppContextService { + if (!this._endpointContext) { + throw new SecurityWorkflowInsightsFailedInitialized('no endpoint context found'); + } + + return this._endpointContext; + } +} + +export const securityWorkflowInsightsService = new SecurityWorkflowInsightsService(); diff --git a/x-pack/plugins/security_solution/server/endpoint/types.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/types.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/utils/create_es_search_iterable.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/create_es_search_iterable.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/utils/create_es_search_iterable.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/create_es_search_iterable.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/utils/create_so_find_iterable.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/create_so_find_iterable.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/utils/create_so_find_iterable.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/create_so_find_iterable.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/utils/fleet_agent_status_to_endpoint_host_status.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/fleet_agent_status_to_endpoint_host_status.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/utils/fleet_agent_status_to_endpoint_host_status.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/fleet_agent_status_to_endpoint_host_status.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/utils/index.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/utils/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/index.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/utils/normalize_kuery.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/normalize_kuery.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/utils/normalize_kuery.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/normalize_kuery.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/utils/normalize_kuery.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/normalize_kuery.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/utils/normalize_kuery.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/normalize_kuery.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/utils/queue_processor.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/queue_processor.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/utils/queue_processor.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/queue_processor.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/utils/stringify.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/stringify.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/utils/stringify.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/stringify.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/utils/translations.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/utils/translations.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/translations.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/utils/wrap_errors.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/wrap_errors.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/utils/wrap_errors.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/wrap_errors.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/utils/yes_no_data_stream.test.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/yes_no_data_stream.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/utils/yes_no_data_stream.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/yes_no_data_stream.test.ts diff --git a/x-pack/plugins/security_solution/server/endpoint/utils/yes_no_data_stream.ts b/x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/yes_no_data_stream.ts similarity index 100% rename from x-pack/plugins/security_solution/server/endpoint/utils/yes_no_data_stream.ts rename to x-pack/solutions/security/plugins/security_solution/server/endpoint/utils/yes_no_data_stream.ts diff --git a/x-pack/plugins/security_solution/server/fixtures.ts b/x-pack/solutions/security/plugins/security_solution/server/fixtures.ts similarity index 100% rename from x-pack/plugins/security_solution/server/fixtures.ts rename to x-pack/solutions/security/plugins/security_solution/server/fixtures.ts diff --git a/x-pack/plugins/security_solution/server/fleet_integration/constants.ts b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/server/fleet_integration/constants.ts rename to x-pack/solutions/security/plugins/security_solution/server/fleet_integration/constants.ts diff --git a/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/fleet_integration/fleet_integration.test.ts diff --git a/x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.ts b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/fleet_integration.ts similarity index 100% rename from x-pack/plugins/security_solution/server/fleet_integration/fleet_integration.ts rename to x-pack/solutions/security/plugins/security_solution/server/fleet_integration/fleet_integration.ts diff --git a/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.test.ts diff --git a/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.ts b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.ts similarity index 100% rename from x-pack/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.ts rename to x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_default_policy.ts diff --git a/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts similarity index 100% rename from x-pack/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts rename to x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_event_filters.ts diff --git a/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_policy_artifact_manifest.ts b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_policy_artifact_manifest.ts similarity index 100% rename from x-pack/plugins/security_solution/server/fleet_integration/handlers/create_policy_artifact_manifest.ts rename to x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_policy_artifact_manifest.ts diff --git a/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_policy_datastreams.test.ts b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_policy_datastreams.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/fleet_integration/handlers/create_policy_datastreams.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_policy_datastreams.test.ts diff --git a/x-pack/plugins/security_solution/server/fleet_integration/handlers/create_policy_datastreams.ts b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_policy_datastreams.ts similarity index 100% rename from x-pack/plugins/security_solution/server/fleet_integration/handlers/create_policy_datastreams.ts rename to x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/create_policy_datastreams.ts diff --git a/x-pack/plugins/security_solution/server/fleet_integration/handlers/install_prepackaged_rules.ts b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/install_prepackaged_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/server/fleet_integration/handlers/install_prepackaged_rules.ts rename to x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/install_prepackaged_rules.ts diff --git a/x-pack/plugins/security_solution/server/fleet_integration/handlers/remove_policy_from_artifacts.ts b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/remove_policy_from_artifacts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/fleet_integration/handlers/remove_policy_from_artifacts.ts rename to x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/remove_policy_from_artifacts.ts diff --git a/x-pack/plugins/security_solution/server/fleet_integration/handlers/remove_protection_updates_note.ts b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/remove_protection_updates_note.ts similarity index 100% rename from x-pack/plugins/security_solution/server/fleet_integration/handlers/remove_protection_updates_note.ts rename to x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/remove_protection_updates_note.ts diff --git a/x-pack/plugins/security_solution/server/fleet_integration/handlers/validate_endpoint_package_policy.ts b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/validate_endpoint_package_policy.ts similarity index 100% rename from x-pack/plugins/security_solution/server/fleet_integration/handlers/validate_endpoint_package_policy.ts rename to x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/validate_endpoint_package_policy.ts diff --git a/x-pack/plugins/security_solution/server/fleet_integration/handlers/validate_integration_config.ts b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/validate_integration_config.ts similarity index 100% rename from x-pack/plugins/security_solution/server/fleet_integration/handlers/validate_integration_config.ts rename to x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/validate_integration_config.ts diff --git a/x-pack/plugins/security_solution/server/fleet_integration/handlers/validate_policy_against_license.ts b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/validate_policy_against_license.ts similarity index 100% rename from x-pack/plugins/security_solution/server/fleet_integration/handlers/validate_policy_against_license.ts rename to x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/validate_policy_against_license.ts diff --git a/x-pack/plugins/security_solution/server/fleet_integration/handlers/validate_policy_against_product_features.ts b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/validate_policy_against_product_features.ts similarity index 100% rename from x-pack/plugins/security_solution/server/fleet_integration/handlers/validate_policy_against_product_features.ts rename to x-pack/solutions/security/plugins/security_solution/server/fleet_integration/handlers/validate_policy_against_product_features.ts diff --git a/x-pack/plugins/security_solution/server/fleet_integration/index.ts b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/fleet_integration/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/fleet_integration/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/jest.config.js b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/jest.config.js new file mode 100644 index 0000000000000..a8580071e50e2 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/server/fleet_integration'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/server/fleet_integration', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/server/fleet_integration/notify_protection_feature_usage.ts b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/notify_protection_feature_usage.ts similarity index 100% rename from x-pack/plugins/security_solution/server/fleet_integration/notify_protection_feature_usage.ts rename to x-pack/solutions/security/plugins/security_solution/server/fleet_integration/notify_protection_feature_usage.ts diff --git a/x-pack/plugins/security_solution/server/fleet_integration/types.ts b/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/fleet_integration/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/fleet_integration/types.ts diff --git a/x-pack/plugins/security_solution/server/index.ts b/x-pack/solutions/security/plugins/security_solution/server/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/index.ts diff --git a/x-pack/plugins/security_solution/server/integration_tests/__mocks__/alerts-detections-request.json b/x-pack/solutions/security/plugins/security_solution/server/integration_tests/__mocks__/alerts-detections-request.json similarity index 100% rename from x-pack/plugins/security_solution/server/integration_tests/__mocks__/alerts-detections-request.json rename to x-pack/solutions/security/plugins/security_solution/server/integration_tests/__mocks__/alerts-detections-request.json diff --git a/x-pack/plugins/security_solution/server/integration_tests/__mocks__/endpoint-alert.json b/x-pack/solutions/security/plugins/security_solution/server/integration_tests/__mocks__/endpoint-alert.json similarity index 100% rename from x-pack/plugins/security_solution/server/integration_tests/__mocks__/endpoint-alert.json rename to x-pack/solutions/security/plugins/security_solution/server/integration_tests/__mocks__/endpoint-alert.json diff --git a/x-pack/plugins/security_solution/server/integration_tests/__mocks__/endpoint-meta-telemetry-request.json b/x-pack/solutions/security/plugins/security_solution/server/integration_tests/__mocks__/endpoint-meta-telemetry-request.json similarity index 100% rename from x-pack/plugins/security_solution/server/integration_tests/__mocks__/endpoint-meta-telemetry-request.json rename to x-pack/solutions/security/plugins/security_solution/server/integration_tests/__mocks__/endpoint-meta-telemetry-request.json diff --git a/x-pack/plugins/security_solution/server/integration_tests/__mocks__/endpoint-metadata.json b/x-pack/solutions/security/plugins/security_solution/server/integration_tests/__mocks__/endpoint-metadata.json similarity index 100% rename from x-pack/plugins/security_solution/server/integration_tests/__mocks__/endpoint-metadata.json rename to x-pack/solutions/security/plugins/security_solution/server/integration_tests/__mocks__/endpoint-metadata.json diff --git a/x-pack/plugins/security_solution/server/integration_tests/__mocks__/endpoint-metrics.json b/x-pack/solutions/security/plugins/security_solution/server/integration_tests/__mocks__/endpoint-metrics.json similarity index 100% rename from x-pack/plugins/security_solution/server/integration_tests/__mocks__/endpoint-metrics.json rename to x-pack/solutions/security/plugins/security_solution/server/integration_tests/__mocks__/endpoint-metrics.json diff --git a/x-pack/plugins/security_solution/server/integration_tests/__mocks__/endpoint-policy.json b/x-pack/solutions/security/plugins/security_solution/server/integration_tests/__mocks__/endpoint-policy.json similarity index 100% rename from x-pack/plugins/security_solution/server/integration_tests/__mocks__/endpoint-policy.json rename to x-pack/solutions/security/plugins/security_solution/server/integration_tests/__mocks__/endpoint-policy.json diff --git a/x-pack/plugins/security_solution/server/integration_tests/__mocks__/fleet-agents.json b/x-pack/solutions/security/plugins/security_solution/server/integration_tests/__mocks__/fleet-agents.json similarity index 100% rename from x-pack/plugins/security_solution/server/integration_tests/__mocks__/fleet-agents.json rename to x-pack/solutions/security/plugins/security_solution/server/integration_tests/__mocks__/fleet-agents.json diff --git a/x-pack/plugins/security_solution/server/integration_tests/__mocks__/prebuilt-rules-events.json b/x-pack/solutions/security/plugins/security_solution/server/integration_tests/__mocks__/prebuilt-rules-events.json similarity index 100% rename from x-pack/plugins/security_solution/server/integration_tests/__mocks__/prebuilt-rules-events.json rename to x-pack/solutions/security/plugins/security_solution/server/integration_tests/__mocks__/prebuilt-rules-events.json diff --git a/x-pack/plugins/security_solution/server/integration_tests/__mocks__/rule.json b/x-pack/solutions/security/plugins/security_solution/server/integration_tests/__mocks__/rule.json similarity index 100% rename from x-pack/plugins/security_solution/server/integration_tests/__mocks__/rule.json rename to x-pack/solutions/security/plugins/security_solution/server/integration_tests/__mocks__/rule.json diff --git a/x-pack/plugins/security_solution/server/integration_tests/configuration.test.ts b/x-pack/solutions/security/plugins/security_solution/server/integration_tests/configuration.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/integration_tests/configuration.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/integration_tests/configuration.test.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/integration_tests/lib/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/integration_tests/lib/helpers.ts new file mode 100644 index 0000000000000..3f25322b9e017 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/integration_tests/lib/helpers.ts @@ -0,0 +1,175 @@ +/* + * 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 { v4 as uuidGen } from 'uuid'; +import Fs from 'fs'; +import Util from 'util'; +import type { ElasticsearchClient } from '@kbn/core/server'; +import deepmerge from 'deepmerge'; +import { createTestServers, createRootWithCorePlugins } from '@kbn/core-test-helpers-kbn-server'; + +export const DEFAULT_GET_ROUTES: Array<[RegExp, unknown]> = [ + [new RegExp('.*/ping$'), { status: 200 }], + [ + /.*kibana\/manifest\/artifacts.*/, + { + status: 200, + data: 'x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip', + }, + ], +]; + +export const DEFAULT_POST_ROUTES: Array<[RegExp, unknown]> = [[/.*/, { status: 200 }]]; + +const asyncUnlink = Util.promisify(Fs.unlink); + +/** + * Eventually runs a callback until it succeeds or times out. + * Inspired in https://kotest.io/docs/assertions/eventually.html + * + * @param cb The callback to run/retry + * @param duration The maximum duration to run the callback, default 10000 millisecs + * @param interval The interval between each run, default 100 millisecs + */ +export async function eventually<T>( + cb: () => Promise<T>, + duration: number = 120000, + interval: number = 3000 +) { + let elapsed = 0; + + while (true) { + const startedAt: number = performance.now(); + try { + return await cb(); + } catch (e) { + if (elapsed >= duration) { + throw e; + } + } + await new Promise((resolve) => setTimeout(resolve, interval)); + elapsed += performance.now() - startedAt; + } +} + +export async function setupTestServers(logFilePath: string, settings = {}) { + const { startES } = createTestServers({ + adjustTimeout: (t) => jest.setTimeout(t), + settings: { + es: { + license: 'trial', + }, + }, + }); + + const esServer = await startES(); + + const root = createRootWithCorePlugins( + deepmerge( + { + logging: { + appenders: { + file: { + type: 'file', + fileName: logFilePath, + layout: { + type: 'json', + }, + }, + }, + root: { + level: 'warn', + }, + loggers: [ + { + name: 'plugins.taskManager', + level: 'warn', + appenders: ['file'], + }, + { + name: 'plugins.securitySolution.telemetry_events', + level: 'all', + appenders: ['file'], + }, + ], + }, + }, + settings + ), + { oss: false } + ); + + await root.preboot(); + const coreSetup = await root.setup(); + const coreStart = await root.start(); + + return { + esServer, + kibanaServer: { + root, + coreSetup, + coreStart, + stop: async () => root.shutdown(), + }, + }; +} + +export async function removeFile(path: string) { + await asyncUnlink(path).catch(() => void 0); +} + +export async function bulkInsert( + esClient: ElasticsearchClient, + index: string, + data: unknown[], + ids: string[] = [] +): Promise<void> { + const bulk = data.flatMap((d, i) => { + const _id = ids[i] ?? uuidGen(); + return [{ create: { _index: index, _id } }, d]; + }); + await esClient.bulk({ body: bulk, refresh: 'wait_for' }).catch(() => {}); +} + +export function updateTimestamps(data: object[]): object[] { + const currentTimeMillis = new Date().getTime(); + return data.map((d, i) => { + // wait a couple of millisecs to not make timestamps overlap + return { ...d, '@timestamp': new Date(currentTimeMillis + (i + 1) * 100) }; + }); +} + +export function mockAxiosPost( + postSpy: jest.SpyInstance, + routes: Array<[RegExp, unknown]> = DEFAULT_POST_ROUTES +) { + postSpy.mockImplementation(async (url: string) => { + for (const [route, returnValue] of routes) { + if (route.test(url)) { + return returnValue; + } + } + return { status: 404 }; + }); +} + +export function mockAxiosGet( + getSpy: jest.SpyInstance, + routes: Array<[RegExp, unknown]> = DEFAULT_GET_ROUTES +) { + getSpy.mockImplementation(async (url: string) => { + for (const [route, returnValue] of routes) { + if (route.test(url)) { + return returnValue; + } + } + return { status: 404 }; + }); +} + +export function getRandomInt(min: number, max: number): number { + return Math.floor(Math.random() * (max - min + 1)) + min; +} diff --git a/x-pack/plugins/security_solution/server/integration_tests/lib/telemetry_helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/integration_tests/lib/telemetry_helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/integration_tests/lib/telemetry_helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/integration_tests/lib/telemetry_helpers.ts diff --git a/x-pack/plugins/security_solution/server/integration_tests/receiver.test.ts b/x-pack/solutions/security/plugins/security_solution/server/integration_tests/receiver.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/integration_tests/receiver.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/integration_tests/receiver.test.ts diff --git a/x-pack/plugins/security_solution/server/integration_tests/telemetry.test.ts b/x-pack/solutions/security/plugins/security_solution/server/integration_tests/telemetry.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/integration_tests/telemetry.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/integration_tests/telemetry.test.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/jest.config.js b/x-pack/solutions/security/plugins/security_solution/server/jest.config.js new file mode 100644 index 0000000000000..8709a95766831 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/jest.config.js @@ -0,0 +1,23 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../..', + /** all nested directories have their own Jest config file */ + testMatch: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/server/*.test.{js,mjs,ts,tsx}', + ], + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/server'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/server', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/server/**/*.{ts,tsx}', + ], + moduleNameMapper: require('./__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/server/lib/dashboards/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/dashboards/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/dashboards/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/dashboards/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/dashboards/routes/get_dashboards_by_tags.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/dashboards/routes/get_dashboards_by_tags.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/dashboards/routes/get_dashboards_by_tags.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/dashboards/routes/get_dashboards_by_tags.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/dashboards/routes/get_dashboards_by_tags.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/dashboards/routes/get_dashboards_by_tags.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/dashboards/routes/get_dashboards_by_tags.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/dashboards/routes/get_dashboards_by_tags.ts diff --git a/x-pack/plugins/security_solution/server/lib/dashboards/routes/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/dashboards/routes/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/dashboards/routes/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/dashboards/routes/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/README.md b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/README.md new file mode 100644 index 0000000000000..b60033b731778 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/README.md @@ -0,0 +1,176 @@ +README.md for developers working on the backend detection engine on how to get started +using the CURL scripts in the scripts folder. + +The scripts rely on CURL and jq: + +- [CURL](https://curl.haxx.se) +- [jq](https://stedolan.github.io/jq/) + +Install curl and jq + +```sh +brew update +brew install curl +brew install jq +``` + +Open `$HOME/.zshrc` or `${HOME}.bashrc` depending on your SHELL output from `echo $SHELL` +and add these environment variables: + +```sh +export ELASTICSEARCH_USERNAME=${user} +export ELASTICSEARCH_PASSWORD=${password} +export ELASTICSEARCH_URL=https://${ip}:9200 +export KIBANA_URL=http://localhost:5601 +export TASK_MANAGER_INDEX=.kibana-task-manager-${your user id} +export KIBANA_INDEX=.kibana-${your user id} +``` + +source `$HOME/.zshrc` or `${HOME}.bashrc` to ensure variables are set: + +```sh +source ~/.zshrc +``` + +Open your `kibana.dev.yml` file and add these lines: + +```sh +xpack.securitySolution.signalsIndex: .siem-signals-${your user id} +``` + +Restart Kibana and ensure that you are using `--no-base-path` as changing the base path is a feature but will +get in the way of the CURL scripts written as is. You should see alerting and actions starting up like so afterwards + +```sh +server log [22:05:22.277] [info][status][plugin:alerting@8.0.0] Status changed from uninitialized to green - Ready +server log [22:05:22.270] [info][status][plugin:actions@8.0.0] Status changed from uninitialized to green - Ready +``` + +Go to the scripts folder `cd kibana/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts` and run: + +```sh +./hard_reset.sh +./post_rule.sh +``` + +which will: + +- Delete any existing actions you have +- Delete any existing alerts you have +- Delete any existing alert tasks you have +- Delete any existing signal mapping, policies, and template, you might have previously had. +- Add the latest signal index and its mappings using your settings from `kibana.dev.yml` environment variable of `xpack.securitySolution.signalsIndex`. +- Posts the sample rule from `./rules/queries/query_with_rule_id.json` +- The sample rule checks for root or admin every 5 minutes and reports that as a signal if it is a positive hit + +Now you can run + +```sh +./find_rules.sh +``` + +You should see the new rules created like so: + +```sh +{ + "page": 1, + "perPage": 20, + "total": 1, + "data": [ + { + "created_by": "elastic", + "description": "Detecting root and admin users", + "enabled": true, + "false_positives": [], + "from": "now-6m", + "id": "a556065c-0656-4ba1-ad64-a77ca9d2013b", + "immutable": false, + "index": [ + "auditbeat-*", + "filebeat-*", + "packetbeat-*", + "winlogbeat-*" + ], + "interval": "5m", + "rule_id": "rule-1", + "language": "kuery", + "output_index": ".siem-signals-some-name", + "max_signals": 100, + "risk_score": 1, + "name": "Detect Root/Admin Users", + "query": "user.name: root or user.name: admin", + "references": [ + "http://www.example.com", + "https://ww.example.com" + ], + "severity": "high", + "updated_by": "elastic", + "tags": [], + "to": "now", + "type": "query" + } + ] +} +``` + +Every 5 minutes if you get positive hits you will see messages on info like so: + +```sh +server log [09:54:59.013] [info][plugins][siem] Total signals found from signal rule "id: a556065c-0656-4ba1-ad64-a77ca9d2013b", "ruleId: rule-1": 10000 +``` + +Rules are [space aware](https://www.elastic.co/guide/en/kibana/master/xpack-spaces.html) and default +to the "default" (empty) URL space if you do not export the variable of `SPACE_URL`. Example, if you want to +post rules to `test-space` you set `SPACE_URL` to be: + +```sh +export SPACE_URL=/s/test-space +``` + +The `${SPACE_URL}` is in front of all the APIs to correctly create, modify, delete, and update +them from within the defined space. If this variable is not defined the default which is the url of an +empty string will be used. + +Add the `.siem-signals-${your user id}` to your advanced SIEM settings to see any signals +created which should update once every 5 minutes at this point. + +Also add the `.siem-signals-${your user id}` as a kibana index for Maps to be able to see the +signals + +Optionally you can add these debug statements to your `kibana.dev.yml` to see more information when running the detection +engine + +```sh +logging.verbose: true +logging.events: + { + log: ['security_solution', 'info', 'warning', 'error', 'fatal'], + request: ['info', 'warning', 'error', 'fatal'], + error: '*', + ops: __no-ops__, + } +``` + +See these two README.md's pages for more references on the alerting and actions API: +https://github.com/elastic/kibana/blob/main/x-pack/plugins/alerting/README.md +https://github.com/elastic/kibana/tree/main/x-pack/plugins/actions + +### Signals API + +To update the status of a signal or group of signals, the following scripts provide an example of how to +go about doing so. +`cd x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts` +`./signals/put_signal_doc.sh` will post a sample signal doc into the signals index to play with +`./signals/set_status_with_id.sh closed` will update the status of the sample signal to closed +`./signals/set_status_with_id.sh open` will update the status of the sample signal to open +`./signals/set_status_with_query.sh closed` will update the status of the signals in the result of the query to closed. +`./signals/set_status_with_query.sh open` will update the status of the signals in the result of the query to open. + +### Large List Exceptions + +To test out the functionality of large lists with rules, the user will need to import a list and post a rule with a reference to that exception list. The following outlines an example using the sample json rule provided in the repo. + +* First, set the appropriate env var in order to enable exceptions features`export ELASTIC_XPACK_SECURITY_SOLUTION_LISTS_FEATURE=true` and `export ELASTIC_XPACK_SECURITY_SOLUTION_EXCEPTIONS_LISTS=true` and start kibana +* Second, import a list of ips from a file called `ci-badguys.txt`. The command should look like this: +`cd $HOME/kibana/x-pack/solutions/security/plugins/lists/server/scripts && ./import_list_items_by_filename.sh ip ~/ci-badguys.txt` +* Then, from the detection engine scripts folder (`cd kibana/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts`) run `./post_rule.sh rules/queries/lists/query_with_list_plugin.json` diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/sort_integrations_by_status.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/sort_integrations_by_status.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/sort_integrations_by_status.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/sort_integrations_by_status.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/sort_packages_by_security_category.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/sort_packages_by_security_category.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/sort_packages_by_security_category.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/sort_packages_by_security_category.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_installed_integrations/installed_integration_set.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_installed_integrations/installed_integration_set.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_installed_integrations/installed_integration_set.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_installed_integrations/installed_integration_set.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_installed_integrations/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_installed_integrations/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_installed_integrations/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_installed_integrations/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/register_routes.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/register_routes.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/register_routes.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/register_routes.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/fleet_integrations/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/create_migration.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/create_migration.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/create_migration.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/create_migration.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/create_migration.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/create_migration.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/create_migration.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/create_migration.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/create_migration_index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/create_migration_index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/create_migration_index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/create_migration_index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/create_migration_index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/create_migration_index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/create_migration_index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/create_migration_index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/create_migration_saved_object.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/create_migration_saved_object.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/create_migration_saved_object.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/create_migration_saved_object.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/create_migration_saved_object.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/create_migration_saved_object.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/create_migration_saved_object.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/create_migration_saved_object.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/delete_migration.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/delete_migration.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/delete_migration.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/delete_migration.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/delete_migration.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/delete_migration.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/delete_migration.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/delete_migration.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/delete_migration_saved_object.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/delete_migration_saved_object.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/delete_migration_saved_object.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/delete_migration_saved_object.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/finalize_migration.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/finalize_migration.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/finalize_migration.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/finalize_migration.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/finalize_migration.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/finalize_migration.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/finalize_migration.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/finalize_migration.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/find_migration_saved_objects.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/find_migration_saved_objects.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/find_migration_saved_objects.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/find_migration_saved_objects.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/find_migration_saved_objects.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/find_migration_saved_objects.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/find_migration_saved_objects.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/find_migration_saved_objects.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_index_alias_per_space.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_index_alias_per_space.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_index_alias_per_space.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_index_alias_per_space.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_index_alias_per_space.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_index_alias_per_space.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_index_alias_per_space.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_index_alias_per_space.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_index_versions_by_index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_index_versions_by_index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_index_versions_by_index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_index_versions_by_index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_index_versions_by_index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_index_versions_by_index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_index_versions_by_index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_index_versions_by_index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_latest_index_template_version.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_latest_index_template_version.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_latest_index_template_version.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_latest_index_template_version.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_latest_index_template_version.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_latest_index_template_version.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_latest_index_template_version.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_latest_index_template_version.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_migration_saved_objects_by_id.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_migration_saved_objects_by_id.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_migration_saved_objects_by_id.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_migration_saved_objects_by_id.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_migration_saved_objects_by_id.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_migration_saved_objects_by_id.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_migration_saved_objects_by_id.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_migration_saved_objects_by_id.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_migration_saved_objects_by_index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_migration_saved_objects_by_index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_migration_saved_objects_by_index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_migration_saved_objects_by_index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_migration_saved_objects_by_index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_migration_saved_objects_by_index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_migration_saved_objects_by_index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_migration_saved_objects_by_index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_non_migrated_signals_info.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_non_migrated_signals_info.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_non_migrated_signals_info.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_non_migrated_signals_info.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_non_migrated_signals_info.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_non_migrated_signals_info.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_non_migrated_signals_info.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_non_migrated_signals_info.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_signal_versions_by_index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_signal_versions_by_index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_signal_versions_by_index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_signal_versions_by_index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_signal_versions_by_index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_signal_versions_by_index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_signal_versions_by_index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_signal_versions_by_index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_signals_indices_in_range.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_signals_indices_in_range.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_signals_indices_in_range.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_signals_indices_in_range.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_signals_indices_in_range.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_signals_indices_in_range.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_signals_indices_in_range.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/get_signals_indices_in_range.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/helpers.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/helpers.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/migration_cleanup.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/migration_cleanup.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/migration_cleanup.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/migration_cleanup.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/migration_cleanup_policy.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/migration_cleanup_policy.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/migration_cleanup_policy.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/migration_cleanup_policy.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/migration_service.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/migration_service.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/migration_service.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/migration_service.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/replace_signals_index_alias.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/replace_signals_index_alias.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/replace_signals_index_alias.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/replace_signals_index_alias.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/saved_objects.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/saved_objects.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/saved_objects.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/saved_objects.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/saved_objects_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/saved_objects_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/saved_objects_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/saved_objects_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/saved_objects_schema.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/saved_objects_schema.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/saved_objects_schema.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/saved_objects_schema.mock.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/saved_objects_schema.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/saved_objects_schema.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/saved_objects_schema.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/saved_objects_schema.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/update_migration_saved_object.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/update_migration_saved_object.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/update_migration_saved_object.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/update_migration_saved_object.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/update_migration_saved_object.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/update_migration_saved_object.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/migrations/update_migration_saved_object.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/migrations/update_migration_saved_object.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/bootstrap_prebuilt_rules/bootstrap_prebuilt_rules.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/bootstrap_prebuilt_rules/bootstrap_prebuilt_rules.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/bootstrap_prebuilt_rules/bootstrap_prebuilt_rules.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/bootstrap_prebuilt_rules/bootstrap_prebuilt_rules.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/bootstrap_prebuilt_rules/bootstrap_prebuilt_rules.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/bootstrap_prebuilt_rules/bootstrap_prebuilt_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/bootstrap_prebuilt_rules/bootstrap_prebuilt_rules.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/bootstrap_prebuilt_rules/bootstrap_prebuilt_rules.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_and_timelines_status/get_prebuilt_rules_and_timelines_status_route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_and_timelines_status/get_prebuilt_rules_and_timelines_status_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_and_timelines_status/get_prebuilt_rules_and_timelines_status_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_and_timelines_status/get_prebuilt_rules_and_timelines_status_route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_and_timelines_status/get_prebuilt_rules_and_timelines_status_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_and_timelines_status/get_prebuilt_rules_and_timelines_status_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_and_timelines_status/get_prebuilt_rules_and_timelines_status_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_and_timelines_status/get_prebuilt_rules_and_timelines_status_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_status/get_prebuilt_rules_status_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_status/get_prebuilt_rules_status_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_status/get_prebuilt_rules_status_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/get_prebuilt_rules_status/get_prebuilt_rules_status_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_and_timelines_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_package.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_package.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_package.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_package.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_installation/perform_rule_installation_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_installation/perform_rule_installation_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_installation/perform_rule_installation_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_installation/perform_rule_installation_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/assert_diffable_fields_match_rule_type.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/assert_diffable_fields_match_rule_type.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/assert_diffable_fields_match_rule_type.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/assert_diffable_fields_match_rule_type.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/assert_diffable_fields_match_rule_type.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/assert_diffable_fields_match_rule_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/assert_diffable_fields_match_rule_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/assert_diffable_fields_match_rule_type.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/assert_pick_version_is_target.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/assert_pick_version_is_target.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/assert_pick_version_is_target.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/assert_pick_version_is_target.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/assert_pick_version_is_target.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/assert_pick_version_is_target.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/assert_pick_version_is_target.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/assert_pick_version_is_target.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/create_field_upgrade_specifier.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/create_field_upgrade_specifier.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/create_field_upgrade_specifier.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/create_field_upgrade_specifier.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/create_field_upgrade_specifier.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/create_field_upgrade_specifier.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/create_field_upgrade_specifier.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/create_field_upgrade_specifier.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/create_props_to_rule_type_map.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/create_props_to_rule_type_map.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/create_props_to_rule_type_map.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/create_props_to_rule_type_map.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/create_upgradeable_rules_payload.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/create_upgradeable_rules_payload.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/create_upgradeable_rules_payload.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/create_upgradeable_rules_payload.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/diffable_rule_fields_mappings.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/diffable_rule_fields_mappings.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/diffable_rule_fields_mappings.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/diffable_rule_fields_mappings.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/diffable_rule_fields_mappings.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/diffable_rule_fields_mappings.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/diffable_rule_fields_mappings.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/diffable_rule_fields_mappings.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_field_predefined_value.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_field_predefined_value.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_field_predefined_value.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_field_predefined_value.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_field_predefined_value.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_field_predefined_value.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_field_predefined_value.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_field_predefined_value.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_upgradeable_rules.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_upgradeable_rules.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_upgradeable_rules.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_upgradeable_rules.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_upgradeable_rules.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_upgradeable_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_upgradeable_rules.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_upgradeable_rules.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_value_for_field.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_value_for_field.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_value_for_field.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_value_for_field.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_value_from_rule_version.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_value_from_rule_version.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_value_from_rule_version.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/get_value_from_rule_version.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/perform_rule_upgrade_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/perform_rule_upgrade_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/perform_rule_upgrade_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/perform_rule_upgrade/perform_rule_upgrade_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/register_routes.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/register_routes.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/register_routes.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/register_routes.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_installation/review_rule_installation_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_installation/review_rule_installation_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_installation/review_rule_installation_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_installation/review_rule_installation_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_upgrade/review_rule_upgrade_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_upgrade/review_rule_upgrade_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_upgrade/review_rule_upgrade_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/review_rule_upgrade/review_rule_upgrade_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/constants.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/constants.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/constants.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/README.md b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/README.md new file mode 100644 index 0000000000000..102e762422d0b --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/README.md @@ -0,0 +1,184 @@ + + +### How to on board a new prepackage timelines: + + + +1. [Have the env params set up](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/README.md) + +2. Create a new timelines template into `x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines` + + ##### 2.a : Create a new template from UI and export it. + + 1. Go to Security Solution app in Kibana + 2. Go to timelines > templates > custom templates (a filter on the right) + 3. Click `Create new timeline template` + 4. Edit your template + 5. Export only **one** timeline template each time and put that in `x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines`. (For potential update requirement in the future, we put one timeline in each file to keep nice and clear) + 6. Rename the file extension to `.json` + 7. Check the chapter of `Fields to hightlight for on boarding a new prepackaged timeline` in this readme and update your template + + + + + ##### 2.b : Create a new template from scratch + Please note that below template is just an example, please replace all your fields with whatever makes sense. Do check `Fields to hightlight for on boarding a new prepackaged timeline` to make sure the template can be created as expected. + + + cd x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines + + + + echo '{"savedObjectId":null,"version":null,"columns":[{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"@timestamp","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"kibana.alert.rule.description","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"event.action","searchable":null},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.name","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"The working directory of the process.","columnHeaderType":"not-filtered","id":"process.working_directory","category":"process","type":"string","searchable":null,"example":"/home/alice"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments, starting with the absolute path to\nthe executable.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.args","category":"process","type":"string","searchable":null,"example":"[\"/usr/bin/ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"name":null,"columnHeaderType":"not-filtered","id":"process.pid","searchable":null},{"indexes":null,"aggregatable":true,"name":null,"description":"Absolute path to the process executable.","columnHeaderType":"not-filtered","id":"process.parent.executable","category":"process","type":"string","searchable":null,"example":"/usr/bin/ssh"},{"indexes":null,"aggregatable":true,"name":null,"description":"Array of process arguments.\n\nMay be filtered to protect sensitive information.","columnHeaderType":"not-filtered","id":"process.parent.args","category":"process","type":"string","searchable":null,"example":"[\"ssh\",\"-l\",\"user\",\"10.0.0.16\"]"},{"indexes":null,"aggregatable":true,"name":null,"description":"Process id.","columnHeaderType":"not-filtered","id":"process.parent.pid","category":"process","type":"number","searchable":null,"example":"4242"},{"indexes":null,"aggregatable":true,"name":null,"description":"Short name or login of the user.","columnHeaderType":"not-filtered","id":"user.name","category":"user","type":"string","searchable":null,"example":"albert"},{"indexes":null,"aggregatable":true,"name":null,"description":"Name of the host.\n\nIt can contain what `hostname` returns on Unix systems, the fully qualified\ndomain name, or a name specified by the user. The sender decides which value\nto use.","columnHeaderType":"not-filtered","id":"host.name","category":"host","type":"string","searchable":null}],"dataProviders":[{"excluded":false,"and":[],"kqlQuery":"","name":"590eb946a7fdbacaa587ed0f6b1a16f5ad3d659ec47ef35ad0826c47af133bde","queryMatch":{"displayValue":null,"field":"_id","displayField":null,"value":"590eb946a7fdbacaa587ed0f6b1a16f5ad3d659ec47ef35ad0826c47af133bde","operator":":"},"id":"send-signal-to-timeline-action-default-draggable-event-details-value-formatted-field-value-timeline-1-signal-id-590eb946a7fdbacaa587ed0f6b1a16f5ad3d659ec47ef35ad0826c47af133bde","enabled":true}],"description":"","eventType":"all","filters":[],"kqlMode":"filter","kqlQuery":{"filterQuery":{"kuery":{"kind":"kuery","expression":""},"serializedQuery":""}},"title":"Generic Process Timeline","dateRange":{"start":1588161020848,"end":1588162280848},"savedQueryId":null,"sort":{"columnId":"@timestamp","sortDirection":"desc"},"created":1588162404153,"createdBy":"Elastic","updated":1588604767818,"updatedBy":"Elastic","eventNotes":[],"globalNotes":[],"pinnedEventIds":[],"timelineType":"template","status":"immutable","templateTimelineId":"2c7e0663-5a91-0004-aa15-26bf756d2c40","templateTimelineVersion":1}' > my_new_template.json``` + + #### Note that the json has to be minified. + #### Fields to hightlight for on boarding a new prepackaged timeline: + + - savedObjectId: null + + - version: null + + - templateTimelineId: Specify an unique uuid e.g.: `2c7e0663-5a91-0004-aa15-26bf756d2c40` + + - templateTimelineVersion: start from `1`, bump it on update + + - timelineType: `template` + + - status: `immutable` + + - indexNames: [] + + + +3. ```cd x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts``` + +4. ```sh ./timelines/regen_prepackage_timelines_index.sh``` + +(this will update `x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/index.ndjson`) + + + +5. Go to `http://localhost:5601/app/security#/detections/rules` and click on `Install Elastic prebuild rules` + +or run + +``` +cd x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts + +sh ./timelines/add_prepackaged_timelines.sh + +``` + + + +6. Check in UI or run the script below to see if prepackaged timelines on-boarded correctly. + +``` + +sh ./timelines/find_timeline_by_filter.sh immutable template elastic + +``` + + + +### How to update an existing prepackage timeline: + +1. ```cd x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines``` + +2. Open the json file you wish to update, and remember to bump the `templateTimelineVersion` + +3. Go to ```cd x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts```, run ```sh ./timelines/regen_prepackage_timelines_index.sh``` + +4. Go to `http://localhost:5601/app/security#/detections/rules` and click on `Install Elastic prebuild rules` + +or run + +``` + +sh ./timelines/add_prepackaged_timelines.sh + +``` + + + +5. Check in UI or run the script below to see if the prepackaged timeline updated correctly. + +``` + +sh ./timelines/find_timeline_by_filter.sh immutable template elastic + +``` + + + + +### How to install prepackaged timelines: + +1. ```cd x-pack/plugins/siem/server/lib/detection_engine/scripts``` + +2. ```sh ./timelines/add_prepackaged_timelines.sh``` + +3. ```sh ./timelines/find_timeline_by_filter.sh immutable template elastic``` + + + +### Get timeline by id: + +``` + +cd x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts + +sh ./timelines/get_timeline_by_id.sh {id} + +``` + + + + +### Get timeline by templateTimelineId: + +``` + +cd x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts + +sh ./timelines/get_timeline_by_template_timeline_id.sh {template_timeline_id} + +``` + + + + +### Get all custom timelines: + +``` + +cd x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts + +sh ./timelines/get_all_timelines.sh + +``` + + + + +### Delete all timelines: + +``` + +cd x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts + +sh ./timelines/delete_all_timelines.sh + +``` + + + +### Delete timeline by timeline id: + +``` + +cd x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts + +./timelines/delete_all_alerts.sh {timeline_id} + +``` diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/alerts_host.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/alerts_host.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/alerts_host.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/alerts_host.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/alerts_user.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/alerts_user.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/alerts_user.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/alerts_user.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/endpoint.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/endpoint.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/endpoint.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/endpoint.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/file_ex.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/file_ex.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/file_ex.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/file_ex.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/index.ndjson b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/index.ndjson similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/index.ndjson rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/index.ndjson diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/network.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/network.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/network.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/network.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/network_ex.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/network_ex.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/network_ex.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/network_ex.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/process.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/process.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/process.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/process.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/process_ex.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/process_ex.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/process_ex.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/process_ex.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/registry_ex.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/registry_ex.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/registry_ex.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/registry_ex.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/threat.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/threat.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/threat.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/content/prepackaged_timelines/threat.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/aggregate_prebuilt_rule_errors.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/aggregate_prebuilt_rule_errors.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/aggregate_prebuilt_rule_errors.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/aggregate_prebuilt_rule_errors.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculate_rule_diff.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculate_rule_diff.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculate_rule_diff.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculate_rule_diff.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/data_source_diff_algorithm.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/data_source_diff_algorithm.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/data_source_diff_algorithm.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/data_source_diff_algorithm.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/data_source_diff_algorithm.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/data_source_diff_algorithm.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/data_source_diff_algorithm.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/data_source_diff_algorithm.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/eql_query_diff_algorithm.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/eql_query_diff_algorithm.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/eql_query_diff_algorithm.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/eql_query_diff_algorithm.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/eql_query_diff_algorithm.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/eql_query_diff_algorithm.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/eql_query_diff_algorithm.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/eql_query_diff_algorithm.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/esql_query_diff_algorithm.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/esql_query_diff_algorithm.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/esql_query_diff_algorithm.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/esql_query_diff_algorithm.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/esql_query_diff_algorithm.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/esql_query_diff_algorithm.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/esql_query_diff_algorithm.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/esql_query_diff_algorithm.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/force_target_version_diff_algorithm.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/force_target_version_diff_algorithm.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/force_target_version_diff_algorithm.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/force_target_version_diff_algorithm.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/force_target_version_diff_algorithm.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/force_target_version_diff_algorithm.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/force_target_version_diff_algorithm.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/force_target_version_diff_algorithm.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/helpers.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/kql_query_diff_algorithm.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/kql_query_diff_algorithm.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/kql_query_diff_algorithm.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/kql_query_diff_algorithm.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/kql_query_diff_algorithm.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/kql_query_diff_algorithm.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/kql_query_diff_algorithm.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/kql_query_diff_algorithm.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/multi_line_string_diff_algorithm.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/multi_line_string_diff_algorithm.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/multi_line_string_diff_algorithm.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/multi_line_string_diff_algorithm.mock.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/multi_line_string_diff_algorithm.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/multi_line_string_diff_algorithm.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/multi_line_string_diff_algorithm.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/multi_line_string_diff_algorithm.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/multi_line_string_diff_algorithm.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/multi_line_string_diff_algorithm.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/multi_line_string_diff_algorithm.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/multi_line_string_diff_algorithm.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/number_diff_algorithm.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/number_diff_algorithm.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/number_diff_algorithm.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/number_diff_algorithm.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/number_diff_algorithm.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/number_diff_algorithm.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/number_diff_algorithm.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/number_diff_algorithm.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/rule_type_diff_algorithm.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/rule_type_diff_algorithm.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/rule_type_diff_algorithm.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/rule_type_diff_algorithm.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/rule_type_diff_algorithm.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/rule_type_diff_algorithm.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/rule_type_diff_algorithm.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/rule_type_diff_algorithm.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/scalar_array_diff_algorithm.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/scalar_array_diff_algorithm.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/scalar_array_diff_algorithm.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/scalar_array_diff_algorithm.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/scalar_array_diff_algorithm.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/scalar_array_diff_algorithm.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/scalar_array_diff_algorithm.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/scalar_array_diff_algorithm.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/simple_diff_algorithm.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/simple_diff_algorithm.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/simple_diff_algorithm.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/simple_diff_algorithm.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/single_line_string_diff_algorithm.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/single_line_string_diff_algorithm.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/single_line_string_diff_algorithm.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/single_line_string_diff_algorithm.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/single_line_string_diff_algorithm.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/single_line_string_diff_algorithm.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/single_line_string_diff_algorithm.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/algorithms/single_line_string_diff_algorithm.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/calculate_rule_fields_diff.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/calculate_rule_fields_diff.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/calculate_rule_fields_diff.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/calculate_rule_fields_diff.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/diff_calculation_helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/diff_calculation_helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/diff_calculation_helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/diff/calculation/diff_calculation_helpers.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/ensure_latest_rules_package_installed.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/ensure_latest_rules_package_installed.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/ensure_latest_rules_package_installed.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/ensure_latest_rules_package_installed.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/get_rules_to_install.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/get_rules_to_install.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/get_rules_to_install.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/get_rules_to_install.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/get_rules_to_install.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/get_rules_to_install.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/get_rules_to_install.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/get_rules_to_install.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/get_rules_to_update.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/get_rules_to_update.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/get_rules_to_update.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/get_rules_to_update.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/get_rules_to_update.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/get_rules_to_update.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/get_rules_to_update.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/get_rules_to_update.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/perform_timelines_installation.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/perform_timelines_installation.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/perform_timelines_installation.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/perform_timelines_installation.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_assets/__mocks__/prebuilt_rule_assets_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_assets/__mocks__/prebuilt_rule_assets_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_assets/__mocks__/prebuilt_rule_assets_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_assets/__mocks__/prebuilt_rule_assets_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_assets/prebuilt_rule_assets_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_assets/prebuilt_rule_assets_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_assets/prebuilt_rule_assets_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_assets/prebuilt_rule_assets_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_assets/prebuilt_rule_assets_type.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_assets/prebuilt_rule_assets_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_assets/prebuilt_rule_assets_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_assets/prebuilt_rule_assets_type.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_assets/prebuilt_rule_assets_validation.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_assets/prebuilt_rule_assets_validation.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_assets/prebuilt_rule_assets_validation.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_assets/prebuilt_rule_assets_validation.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_objects/create_prebuilt_rules.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_objects/create_prebuilt_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_objects/create_prebuilt_rules.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_objects/create_prebuilt_rules.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_objects/prebuilt_rule_objects_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_objects/prebuilt_rule_objects_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_objects/prebuilt_rule_objects_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_objects/prebuilt_rule_objects_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_objects/upgrade_prebuilt_rules.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_objects/upgrade_prebuilt_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_objects/upgrade_prebuilt_rules.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_objects/upgrade_prebuilt_rules.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_versions/fetch_rule_versions_triad.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_versions/fetch_rule_versions_triad.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_versions/fetch_rule_versions_triad.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_versions/fetch_rule_versions_triad.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_versions/rule_version_specifier.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_versions/rule_version_specifier.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_versions/rule_version_specifier.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_versions/rule_version_specifier.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_versions/zip_rule_versions.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_versions/zip_rule_versions.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_versions/zip_rule_versions.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/rule_versions/zip_rule_versions.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/logic/utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/mocks.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset.mock.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset_validate_type_dependents.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset_validate_type_dependents.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset_validate_type_dependents.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset_validate_type_dependents.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset_validate_type_dependents.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset_validate_type_dependents.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset_validate_type_dependents.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_assets/prebuilt_rule_asset_validate_type_dependents.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_groups/get_rule_groups.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_groups/get_rule_groups.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_groups/get_rule_groups.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/model/rule_groups/get_rule_groups.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_context.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_context.ts similarity index 97% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_context.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_context.ts index 3c99cebbbe8fb..e8a1e915f43dd 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_context.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_context.ts @@ -15,7 +15,7 @@ import type { AlertingApiRequestHandlerContext } from '@kbn/alerting-plugin/serv import { rulesClientMock } from '@kbn/alerting-plugin/server/mocks'; // See: https://github.com/elastic/kibana/issues/117255, the moduleNameMapper creates mocks to avoid memory leaks from kibana core. -// We cannot import from "../../../../../../actions/server" directly here or we have a really bad memory issue. We cannot add this to the existing mocks we created, this fix must be here. +// We cannot import from "../../../../../../../../actions/server" directly here or we have a really bad memory issue. We cannot add this to the existing mocks we created, this fix must be here. import { actionsClientMock } from '@kbn/actions-plugin/server/actions_client/actions_client.mock'; import { licensingMock } from '@kbn/licensing-plugin/server/mocks'; import { listMock } from '@kbn/lists-plugin/server/mocks'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_responses.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_responses.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_responses.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/request_responses.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/response_factory.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/response_factory.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/response_factory.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/response_factory.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/server.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/server.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/server.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/server.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/test_adapters.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/test_adapters.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/test_adapters.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/test_adapters.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/__snapshots__/get_signals_template.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/__snapshots__/get_signals_template.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/__snapshots__/get_signals_template.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/__snapshots__/get_signals_template.test.ts.snap diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/check_template_version.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/check_template_version.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/check_template_version.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/check_template_version.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/create_index_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/create_index_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/create_index_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/create_index_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/delete_index_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/delete_index_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/delete_index_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/delete_index_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/ecs_mapping.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/ecs_mapping.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/ecs_mapping.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/ecs_mapping.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_index_version.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/get_index_version.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_index_version.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/get_index_version.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/get_signals_template.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/other_mappings.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/other_mappings.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/other_mappings.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/other_mappings.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/preview_policy.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/preview_policy.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/preview_policy.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/preview_policy.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/read_alerts_index_exists_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/read_alerts_index_exists_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/read_alerts_index_exists_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/read_alerts_index_exists_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/read_index_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/read_index_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/read_index_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/read_index_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/signal_aad_mapping.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/signal_aad_mapping.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/signal_aad_mapping.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/signal_aad_mapping.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/signal_extra_fields.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/signal_extra_fields.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/signal_extra_fields.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/signal_extra_fields.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/signals_mapping.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/signals_mapping.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/signals_mapping.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/signals_mapping.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/signals_policy.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/signals_policy.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/index/signals_policy.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/index/signals_policy.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/privileges/read_privileges_route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/privileges/read_privileges_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/privileges/read_privileges_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/privileges/read_privileges_route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/privileges/read_privileges_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/privileges/read_privileges_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/privileges/read_privileges_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/privileges/read_privileges_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/create_signals_migration_route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/create_signals_migration_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/create_signals_migration_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/create_signals_migration_route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/create_signals_migration_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/create_signals_migration_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/create_signals_migration_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/create_signals_migration_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/delete_signals_migration_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/delete_signals_migration_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/delete_signals_migration_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/delete_signals_migration_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/get_signals_migration_status_route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/get_signals_migration_status_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/get_signals_migration_status_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/get_signals_migration_status_route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/get_signals_migration_status_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/get_signals_migration_status_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/get_signals_migration_status_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/get_signals_migration_status_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/helpers.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/open_close_signals.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/open_close_signals.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/open_close_signals.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/open_close_signals.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/open_close_signals_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/open_close_signals_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/open_close_signals_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/open_close_signals_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/query_signals_route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/query_signals_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/query_signals_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/query_signals_route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/query_signals_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/query_signals_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/query_signals_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/query_signals_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_assignees_route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_assignees_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_assignees_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_assignees_route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_assignees_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_assignees_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_assignees_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_assignees_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_tags_route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_tags_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_tags_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_tags_route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_tags_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_tags_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_tags_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_tags_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/translations.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/translations.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/signals/translations.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/telemetry/telemetry_detection_rules_preview_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/telemetry/telemetry_detection_rules_preview_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/telemetry/telemetry_detection_rules_preview_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/telemetry/telemetry_detection_rules_preview_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/get_detecton_rules_preview.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/get_detecton_rules_preview.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/get_detecton_rules_preview.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/get_detecton_rules_preview.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/get_diagnostics_preview.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/get_diagnostics_preview.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/get_diagnostics_preview.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/get_diagnostics_preview.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/get_endpoint_preview.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/get_endpoint_preview.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/get_endpoint_preview.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/get_endpoint_preview.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/get_indices_metadata_preview.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/get_indices_metadata_preview.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/get_indices_metadata_preview.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/get_indices_metadata_preview.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/get_security_lists_preview.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/get_security_lists_preview.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/get_security_lists_preview.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/get_security_lists_preview.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/parse_ndjson.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/parse_ndjson.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/parse_ndjson.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/telemetry/utils/parse_ndjson.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/users/suggest_user_profiles_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/api/create_legacy_notification/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/api/create_legacy_notification/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/api/create_legacy_notification/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/api/create_legacy_notification/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/api/register_routes.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/api/register_routes.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/api/register_routes.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/api/register_routes.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/build_signals_query.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/build_signals_query.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/build_signals_query.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/build_signals_query.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/build_signals_query.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/build_signals_query.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/build_signals_query.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/build_signals_query.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/get_signals.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/get_signals.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/get_signals.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/get_signals.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_create_notifications.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_create_notifications.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_create_notifications.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_create_notifications.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_create_notifications.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_create_notifications.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_create_notifications.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_create_notifications.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_find_notifications.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_find_notifications.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_find_notifications.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_find_notifications.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_find_notifications.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_find_notifications.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_find_notifications.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_find_notifications.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_read_notifications.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_read_notifications.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_read_notifications.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_read_notifications.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_read_notifications.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_read_notifications.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_read_notifications.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_read_notifications.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_rules_notification_rule_type.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_rules_notification_rule_type.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_rules_notification_rule_type.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_rules_notification_rule_type.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_rules_notification_rule_type.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_rules_notification_rule_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_rules_notification_rule_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_rules_notification_rule_type.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/README.md b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/README.md similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/README.md rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/README.md diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_extract_references.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_extract_references.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_extract_references.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_extract_references.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_extract_references.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_extract_references.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_extract_references.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_extract_references.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_extract_rule_id.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_extract_rule_id.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_extract_rule_id.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_extract_rule_id.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_extract_rule_id.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_extract_rule_id.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_extract_rule_id.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_extract_rule_id.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_inject_references.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_inject_references.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_inject_references.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_inject_references.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_inject_references.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_inject_references.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_inject_references.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_inject_references.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_inject_rule_id_references.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_inject_rule_id_references.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_inject_rule_id_references.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_inject_rule_id_references.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_inject_rule_id_references.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_inject_rule_id_references.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_inject_rule_id_references.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_saved_object_references/legacy_inject_rule_id_references.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/legacy_types.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/schedule_notification_actions.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/schedule_notification_actions.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/schedule_notification_actions.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/schedule_notification_actions.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/schedule_notification_actions.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/schedule_notification_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/schedule_notification_actions.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/schedule_notification_actions.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/schedule_throttle_notification_actions.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/schedule_throttle_notification_actions.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/schedule_throttle_notification_actions.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/schedule_throttle_notification_actions.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/schedule_throttle_notification_actions.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/schedule_throttle_notification_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/schedule_throttle_notification_actions.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/schedule_throttle_notification_actions.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/utils.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/notifications/utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_create_rule_actions_saved_object.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_create_rule_actions_saved_object.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_create_rule_actions_saved_object.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_create_rule_actions_saved_object.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_create_rule_actions_saved_object.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_create_rule_actions_saved_object.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_create_rule_actions_saved_object.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_create_rule_actions_saved_object.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_get_rule_actions_saved_object.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_get_rule_actions_saved_object.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_get_rule_actions_saved_object.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_get_rule_actions_saved_object.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_get_rule_actions_saved_object.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_get_rule_actions_saved_object.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_get_rule_actions_saved_object.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_get_rule_actions_saved_object.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_saved_object_mappings.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_saved_object_mappings.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_saved_object_mappings.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_saved_object_mappings.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_update_or_create_rule_actions_saved_object.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_update_or_create_rule_actions_saved_object.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_update_or_create_rule_actions_saved_object.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_update_or_create_rule_actions_saved_object.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_update_rule_actions_saved_object.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_update_rule_actions_saved_object.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_update_rule_actions_saved_object.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_update_rule_actions_saved_object.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_utils.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_utils.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/create_rule_exceptions/route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/create_rule_exceptions/route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/create_rule_exceptions/route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/create_rule_exceptions/route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/create_rule_exceptions/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/create_rule_exceptions/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/create_rule_exceptions/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/create_rule_exceptions/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/find_exception_references/route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/find_exception_references/route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/find_exception_references/route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/find_exception_references/route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/find_exception_references/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/find_exception_references/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/find_exception_references/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/find_exception_references/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/register_routes.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/register_routes.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/register_routes.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_exceptions/api/register_routes.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_exceptions/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_exceptions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_exceptions/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_exceptions/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/deprecation.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/deprecation.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/deprecation.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/deprecation.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/register_routes.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/register_routes.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/register_routes.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/register_routes.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/bulk_actions_response.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/bulk_actions_response.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/bulk_actions_response.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/bulk_actions_response.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/bulk_enable_disable_rules.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/bulk_enable_disable_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/bulk_enable_disable_rules.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/bulk_enable_disable_rules.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/bulk_schedule_rule_run.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/bulk_schedule_rule_run.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/bulk_schedule_rule_run.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/bulk_schedule_rule_run.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/fetch_rules_by_query_or_ids.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/fetch_rules_by_query_or_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/fetch_rules_by_query_or_ids.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/fetch_rules_by_query_or_ids.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_actions/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_create_rules/get_duplicates.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_create_rules/get_duplicates.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_create_rules/get_duplicates.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_create_rules/get_duplicates.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_create_rules/get_duplicates.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_create_rules/get_duplicates.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_create_rules/get_duplicates.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_create_rules/get_duplicates.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_create_rules/route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_create_rules/route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_create_rules/route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_create_rules/route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_create_rules/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_create_rules/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_create_rules/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_create_rules/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_delete_rules/route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_delete_rules/route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_delete_rules/route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_delete_rules/route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_delete_rules/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_delete_rules/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_delete_rules/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_delete_rules/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_patch_rules/route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_patch_rules/route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_patch_rules/route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_patch_rules/route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_patch_rules/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_patch_rules/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_patch_rules/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_patch_rules/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_update_rules/route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_update_rules/route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_update_rules/route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_update_rules/route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_update_rules/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_update_rules/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_update_rules/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_update_rules/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/coverage_overview/handle_coverage_overview_request.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/coverage_overview/handle_coverage_overview_request.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/coverage_overview/handle_coverage_overview_request.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/coverage_overview/handle_coverage_overview_request.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/coverage_overview/handle_coverage_overview_request.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/coverage_overview/handle_coverage_overview_request.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/coverage_overview/handle_coverage_overview_request.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/coverage_overview/handle_coverage_overview_request.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/coverage_overview/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/coverage_overview/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/coverage_overview/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/coverage_overview/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/create_rule/route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/create_rule/route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/create_rule/route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/create_rule/route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/create_rule/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/create_rule/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/create_rule/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/create_rule/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/delete_rule/route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/delete_rule/route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/delete_rule/route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/delete_rule/route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/delete_rule/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/delete_rule/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/delete_rule/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/delete_rule/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/export_rules/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/export_rules/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/export_rules/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/export_rules/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/filters/route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/filters/route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/filters/route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/filters/route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/filters/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/filters/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/filters/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/filters/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/find_rules/route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/find_rules/route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/find_rules/route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/find_rules/route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/find_rules/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/find_rules/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/find_rules/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/find_rules/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/import_rules/route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/import_rules/route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/import_rules/route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/import_rules/route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/import_rules/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/import_rules/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/import_rules/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/import_rules/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/patch_rule/route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/patch_rule/route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/patch_rule/route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/patch_rule/route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/patch_rule/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/patch_rule/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/patch_rule/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/patch_rule/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/read_rule/route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/read_rule/route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/read_rule/route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/read_rule/route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/read_rule/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/read_rule/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/read_rule/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/read_rule/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/update_rule/route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/update_rule/route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/update_rule/route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/update_rule/route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/update_rule/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/update_rule/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/update_rule/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/update_rule/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/tags/read_tags/read_tags.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/tags/read_tags/read_tags.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/tags/read_tags/read_tags.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/tags/read_tags/read_tags.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/tags/read_tags/read_tags.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/tags/read_tags/read_tags.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/tags/read_tags/read_tags.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/tags/read_tags/read_tags.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/tags/read_tags/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/tags/read_tags/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/tags/read_tags/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/tags/read_tags/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/timeouts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/timeouts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/timeouts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/api/timeouts.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/actions/duplicate_exceptions.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/actions/duplicate_exceptions.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/actions/duplicate_exceptions.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/actions/duplicate_exceptions.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/actions/duplicate_exceptions.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/actions/duplicate_exceptions.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/actions/duplicate_exceptions.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/actions/duplicate_exceptions.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/actions/duplicate_rule.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/actions/duplicate_rule.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/actions/duplicate_rule.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/actions/duplicate_rule.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/actions/duplicate_rule.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/actions/duplicate_rule.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/actions/duplicate_rule.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/actions/duplicate_rule.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/action_to_rules_client_operation.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/action_to_rules_client_operation.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/action_to_rules_client_operation.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/action_to_rules_client_operation.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/action_to_rules_client_operation.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/action_to_rules_client_operation.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/action_to_rules_client_operation.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/action_to_rules_client_operation.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/bulk_edit_rules.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/bulk_edit_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/bulk_edit_rules.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/bulk_edit_rules.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/dry_run.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/dry_run.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/dry_run.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/dry_run.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/rule_params_modifier.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/rule_params_modifier.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/rule_params_modifier.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/rule_params_modifier.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/rule_params_modifier.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/rule_params_modifier.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/rule_params_modifier.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/rule_params_modifier.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/split_bulk_edit_actions.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/split_bulk_edit_actions.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/split_bulk_edit_actions.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/split_bulk_edit_actions.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/split_bulk_edit_actions.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/split_bulk_edit_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/split_bulk_edit_actions.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/split_bulk_edit_actions.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/validations.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/validations.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/validations.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/bulk_actions/validations.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/__mocks__/detection_rules_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/__mocks__/detection_rules_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/__mocks__/detection_rules_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/__mocks__/detection_rules_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/__mocks__/read_rules.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/__mocks__/read_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/__mocks__/read_rules.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/__mocks__/read_rules.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/common_params_camel_to_snake.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/common_params_camel_to_snake.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/common_params_camel_to_snake.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/common_params_camel_to_snake.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/common_params_camel_to_snake.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/common_params_camel_to_snake.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/common_params_camel_to_snake.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/common_params_camel_to_snake.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/convert_alerting_rule_to_rule_response.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/convert_alerting_rule_to_rule_response.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/convert_alerting_rule_to_rule_response.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/convert_alerting_rule_to_rule_response.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/convert_prebuilt_rule_asset_to_rule_response.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/convert_prebuilt_rule_asset_to_rule_response.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/convert_prebuilt_rule_asset_to_rule_response.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/convert_prebuilt_rule_asset_to_rule_response.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/convert_prebuilt_rule_asset_to_rule_response.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/convert_prebuilt_rule_asset_to_rule_response.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/convert_prebuilt_rule_asset_to_rule_response.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/convert_prebuilt_rule_asset_to_rule_response.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/convert_rule_response_to_alerting_rule.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/convert_rule_response_to_alerting_rule.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/convert_rule_response_to_alerting_rule.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/convert_rule_response_to_alerting_rule.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/internal_rule_to_api_response.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/internal_rule_to_api_response.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/internal_rule_to_api_response.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/internal_rule_to_api_response.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/normalize_rule_params.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/normalize_rule_params.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/normalize_rule_params.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/normalize_rule_params.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/normalize_rule_params.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/normalize_rule_params.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/normalize_rule_params.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/normalize_rule_params.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/type_specific_camel_to_snake.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/type_specific_camel_to_snake.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/type_specific_camel_to_snake.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/type_specific_camel_to_snake.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/type_specific_camel_to_snake.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/type_specific_camel_to_snake.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/type_specific_camel_to_snake.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/converters/type_specific_camel_to_snake.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.create_custom_rule.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.create_custom_rule.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.create_custom_rule.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.create_custom_rule.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.create_prebuilt_rule.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.create_prebuilt_rule.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.create_prebuilt_rule.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.create_prebuilt_rule.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.delete_rule.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.delete_rule.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.delete_rule.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.delete_rule.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.import_rule.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.import_rule.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.import_rule.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.import_rule.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.import_rules.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.import_rules.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.import_rules.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.import_rules.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.patch_rule.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.patch_rule.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.patch_rule.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.patch_rule.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.update_rule.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.update_rule.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.update_rule.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.update_rule.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.upgrade_prebuilt_rule.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.upgrade_prebuilt_rule.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.upgrade_prebuilt_rule.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client.upgrade_prebuilt_rule.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client_interface.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client_interface.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client_interface.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/detection_rules_client_interface.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_defaults.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_defaults.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_defaults.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_defaults.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_patch.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_patch.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_patch.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_patch.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_patch.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_patch.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_patch.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_patch.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_update.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_update.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_update.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/apply_rule_update.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/rule_source/calculate_is_customized.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/rule_source/calculate_is_customized.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/rule_source/calculate_is_customized.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/rule_source/calculate_is_customized.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/rule_source/calculate_rule_source.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/rule_source/calculate_rule_source.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/rule_source/calculate_rule_source.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/rule_source/calculate_rule_source.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/rule_source/calculate_rule_source.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/rule_source/calculate_rule_source.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/rule_source/calculate_rule_source.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/mergers/rule_source/calculate_rule_source.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/__mocks__/get_rule_by_rule_id.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/__mocks__/get_rule_by_rule_id.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/__mocks__/get_rule_by_rule_id.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/__mocks__/get_rule_by_rule_id.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/create_rule.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/create_rule.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/create_rule.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/create_rule.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/delete_rule.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/delete_rule.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/delete_rule.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/delete_rule.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/get_rule_by_id.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/get_rule_by_id.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/get_rule_by_id.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/get_rule_by_id.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/get_rule_by_id_or_rule_id.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/get_rule_by_id_or_rule_id.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/get_rule_by_id_or_rule_id.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/get_rule_by_id_or_rule_id.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/get_rule_by_rule_id.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/get_rule_by_rule_id.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/get_rule_by_rule_id.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/get_rule_by_rule_id.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/import_rule.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/import_rule.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/import_rule.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/import_rule.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/import_rules.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/import_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/import_rules.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/import_rules.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/patch_rule.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/patch_rule.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/patch_rule.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/patch_rule.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/update_rule.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/update_rule.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/update_rule.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/update_rule.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/upgrade_prebuilt_rule.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/upgrade_prebuilt_rule.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/upgrade_prebuilt_rule.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/methods/upgrade_prebuilt_rule.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/read_rules.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/read_rules.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/read_rules.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/read_rules.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/read_rules.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/read_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/read_rules.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/read_rules.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/detection_rules_client/utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/check_for_default_rule_exception_list.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/check_for_default_rule_exception_list.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/check_for_default_rule_exception_list.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/check_for_default_rule_exception_list.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/check_for_default_rule_exception_list.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/check_for_default_rule_exception_list.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/check_for_default_rule_exception_list.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/check_for_default_rule_exception_list.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/validate_rule_default_exception_list.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/validate_rule_default_exception_list.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/validate_rule_default_exception_list.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/validate_rule_default_exception_list.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/validate_rule_default_exception_list.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/validate_rule_default_exception_list.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/validate_rule_default_exception_list.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/validate_rule_default_exception_list.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/validate_rules_with_duplicated_default_exceptions_list.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/validate_rules_with_duplicated_default_exceptions_list.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/validate_rules_with_duplicated_default_exceptions_list.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/validate_rules_with_duplicated_default_exceptions_list.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/validate_rules_with_duplicated_default_exceptions_list.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/validate_rules_with_duplicated_default_exceptions_list.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/validate_rules_with_duplicated_default_exceptions_list.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/exceptions/validate_rules_with_duplicated_default_exceptions_list.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/exportable_rule.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/exportable_rule.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/exportable_rule.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/exportable_rule.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_all.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_all.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_all.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_all.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_all.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_all.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_all.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_all.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_by_object_ids.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_by_object_ids.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_by_object_ids.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_by_object_ids.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_by_object_ids.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_by_object_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_by_object_ids.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_by_object_ids.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_details_ndjson.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_details_ndjson.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_details_ndjson.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_details_ndjson.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_details_ndjson.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_details_ndjson.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_details_ndjson.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_details_ndjson.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_rule_action_connectors.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_rule_action_connectors.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_rule_action_connectors.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_rule_action_connectors.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_rule_exceptions.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_rule_exceptions.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_rule_exceptions.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_rule_exceptions.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_rule_exceptions.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_rule_exceptions.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_rule_exceptions.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/get_export_rule_exceptions.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/transform_rule_to_exportable_format.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/transform_rule_to_exportable_format.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/transform_rule_to_exportable_format.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/export/transform_rule_to_exportable_format.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/action_connectors/import_rule_action_connectors.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/action_connectors/import_rule_action_connectors.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/action_connectors/import_rule_action_connectors.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/action_connectors/import_rule_action_connectors.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/action_connectors/import_rule_action_connectors.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/action_connectors/import_rule_action_connectors.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/action_connectors/import_rule_action_connectors.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/action_connectors/import_rule_action_connectors.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/action_connectors/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/action_connectors/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/action_connectors/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/action_connectors/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/action_connectors/utils/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/action_connectors/utils/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/action_connectors/utils/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/action_connectors/utils/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/calculate_rule_source_for_import.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/calculate_rule_source_for_import.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/calculate_rule_source_for_import.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/calculate_rule_source_for_import.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/calculate_rule_source_for_import.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/calculate_rule_source_for_import.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/calculate_rule_source_for_import.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/calculate_rule_source_for_import.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/calculate_rule_source_from_asset.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/calculate_rule_source_from_asset.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/calculate_rule_source_from_asset.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/calculate_rule_source_from_asset.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/calculate_rule_source_from_asset.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/calculate_rule_source_from_asset.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/calculate_rule_source_from_asset.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/calculate_rule_source_from_asset.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/check_rule_exception_references.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/check_rule_exception_references.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/check_rule_exception_references.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/check_rule_exception_references.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/check_rule_exception_references.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/check_rule_exception_references.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/check_rule_exception_references.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/check_rule_exception_references.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/converters/convert_rule_to_import_to_rule_response.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/converters/convert_rule_to_import_to_rule_response.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/converters/convert_rule_to_import_to_rule_response.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/converters/convert_rule_to_import_to_rule_response.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/converters/convert_rule_to_import_to_rule_response.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/converters/convert_rule_to_import_to_rule_response.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/converters/convert_rule_to_import_to_rule_response.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/converters/convert_rule_to_import_to_rule_response.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/create_promise_from_rule_import_stream.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/create_promise_from_rule_import_stream.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/create_promise_from_rule_import_stream.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/create_promise_from_rule_import_stream.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/create_promise_from_rule_import_stream.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/create_promise_from_rule_import_stream.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/create_promise_from_rule_import_stream.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/create_promise_from_rule_import_stream.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/create_rules_stream_from_ndjson.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/create_rules_stream_from_ndjson.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/create_rules_stream_from_ndjson.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/create_rules_stream_from_ndjson.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/errors.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/errors.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/errors.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/errors.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/gather_referenced_exceptions.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/gather_referenced_exceptions.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/gather_referenced_exceptions.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/gather_referenced_exceptions.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/gather_referenced_exceptions.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/gather_referenced_exceptions.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/gather_referenced_exceptions.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/gather_referenced_exceptions.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rule_exceptions.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rule_exceptions.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rule_exceptions.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rule_exceptions.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rule_exceptions.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rule_exceptions.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rule_exceptions.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rule_exceptions.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rules.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rules.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rules.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rules.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rules.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rules.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rules.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rules_legacy.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rules_legacy.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rules_legacy.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rules_legacy.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rules_legacy.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rules_legacy.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rules_legacy.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/import_rules_legacy.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/rule_source_importer/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/rule_source_importer/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/rule_source_importer/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/rule_source_importer/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/rule_source_importer/rule_source_importer.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/rule_source_importer/rule_source_importer.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/rule_source_importer/rule_source_importer.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/rule_source_importer/rule_source_importer.mock.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/rule_source_importer/rule_source_importer.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/rule_source_importer/rule_source_importer.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/rule_source_importer/rule_source_importer.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/rule_source_importer/rule_source_importer.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/rule_source_importer/rule_source_importer.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/rule_source_importer/rule_source_importer.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/rule_source_importer/rule_source_importer.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/rule_source_importer/rule_source_importer.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/rule_source_importer/rule_source_importer_interface.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/rule_source_importer/rule_source_importer_interface.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/rule_source_importer/rule_source_importer_interface.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/rule_source_importer/rule_source_importer_interface.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/import/utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/enrich_filter_with_rule_type_mappings.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/enrich_filter_with_rule_type_mappings.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/enrich_filter_with_rule_type_mappings.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/enrich_filter_with_rule_type_mappings.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/enrich_filter_with_rule_type_mappings.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/enrich_filter_with_rule_type_mappings.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/enrich_filter_with_rule_type_mappings.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/enrich_filter_with_rule_type_mappings.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/find_rules.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/find_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/find_rules.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/find_rules.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/get_existing_prepackaged_rules.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/get_existing_prepackaged_rules.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/get_existing_prepackaged_rules.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/get_existing_prepackaged_rules.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/get_existing_prepackaged_rules.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/get_existing_prepackaged_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/get_existing_prepackaged_rules.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/get_existing_prepackaged_rules.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/transform_sort_field.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/transform_sort_field.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/transform_sort_field.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/logic/search/transform_sort_field.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_actions.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_actions.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_actions.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_actions.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_actions.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_actions.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/normalization/rule_actions.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/utils/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/utils/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/utils/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/utils/utils.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/utils/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/utils/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/utils/utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/utils/utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/utils/validate.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/utils/validate.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/utils/validate.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/utils/validate.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/utils/validate.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/utils/validate.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/utils/validate.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/utils/validate.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/README.md b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/README.md similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/README.md rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/README.md diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_request.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_request.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_request.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_request.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_rule_health/get_rule_health_request.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_rule_health/get_rule_health_request.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_rule_health/get_rule_health_request.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_rule_health/get_rule_health_request.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_rule_health/get_rule_health_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_rule_health/get_rule_health_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_rule_health/get_rule_health_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_rule_health/get_rule_health_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_space_health/get_space_health_request.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_space_health/get_space_health_request.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_space_health/get_space_health_request.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_space_health/get_space_health_request.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_space_health/get_space_health_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_space_health/get_space_health_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_space_health/get_space_health_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_space_health/get_space_health_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/health_interval.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/health_interval.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/health_interval.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/health_interval.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/health_timings.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/health_timings.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/health_timings.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/health_timings.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/setup/setup_health_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/setup/setup_health_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/setup/setup_health_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/setup/setup_health_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/register_routes.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/register_routes.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/register_routes.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/register_routes.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_events/get_rule_execution_events_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/rule_execution_logs/get_rule_execution_results/get_rule_execution_results_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/README.md b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/README.md new file mode 100644 index 0000000000000..7e5022d6cbbd4 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/README.md @@ -0,0 +1,48 @@ +# Detection Engine health logic + +See [README](../../../../../../common/api/detection_engine/rule_monitoring/detection_engine_health/README.md) in the common folder for info about the Detection Engine health API. + +This logic provides the following functionality via the `IDetectionEngineHealthClient` interface: + +- Calculating health snapshots for different "slices" of rules in the cluster: + - the whole cluster: all detection rules in all Kibana spaces + - a given space: all rules in the current Kibana space + - a given rule: an individual rule specified by id +- Installing assets for monitoring health, such as Kibana dashboards, etc. + +## Assets for monitoring health + +The assets' sources are located in the repo under `x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets`. + +### Assets are installed on behalf of the internal user + +The important aspect to know about is that we install these assets via the saved objects `import()` method, and do it on behalf of the internal Kibana user (which is `kibana_system` by default). This user has privileges for writing saved objects out of the box, which allows our users to be able to install the assets without configuring any additional RBAC. + +See `createDetectionEngineHealthClient` and `installAssetsForMonitoringHealth` for the implementation details. + +### Assets' source files are JSON + +Another thing to consider is that the assets are stored as `.json` files in the repo. This has pros and cons, but the important benefit here is that it allows you to make changes in the assets faster. Especially it applies to Kibana dashboards, which are large objects, and it's hard to construct a dashboard manually in the code. + +### Updating the rule monitoring dashboard + +For example, let's talk about updating the `dashboard_rule_monitoring.json`. It is very convenient to be able to install this dashboard via calling the `_setup` endpoint, and then go edit it in Kibana, save it, export it, and update the source file based on the exported `.ndjson` file. + +Only a few adjustments would need to be done after that manually in the source file: + +- obviously, formatting to JSON +- the dashboard's id has to be updated to `security-detection-rule-monitoring-<spaceId>` +- you have to make sure the references to tags are specified correctly: + + ```json + { + "id": "fleet-managed-<spaceId>", + "name": "tag-ref-fleet-managed", + "type": "tag" + }, + { + "id": "security-solution-<spaceId>", + "name": "tag-ref-security-solution", + "type": "tag" + } + ``` diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/assets.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/assets.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/assets.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/assets.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/dashboard_rule_monitoring.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/dashboard_rule_monitoring.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/dashboard_rule_monitoring.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/dashboard_rule_monitoring.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/data_view_kibana_event_log.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/data_view_kibana_event_log.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/data_view_kibana_event_log.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/data_view_kibana_event_log.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/install_assets_for_rule_monitoring.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/install_assets_for_rule_monitoring.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/install_assets_for_rule_monitoring.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/install_assets_for_rule_monitoring.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/tag_managed.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/tag_managed.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/tag_managed.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/tag_managed.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/tag_security_solution.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/tag_security_solution.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/tag_security_solution.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/assets/tag_security_solution.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/detection_engine_health_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/detection_engine_health_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/detection_engine_health_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/detection_engine_health_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/detection_engine_health_client_interface.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/detection_engine_health_client_interface.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/detection_engine_health_client_interface.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/detection_engine_health_client_interface.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/event_log/aggregations/health_stats_for_rule.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/event_log/aggregations/health_stats_for_rule.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/event_log/aggregations/health_stats_for_rule.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/event_log/aggregations/health_stats_for_rule.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/event_log/aggregations/rule_execution_stats.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/event_log/aggregations/rule_execution_stats.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/event_log/aggregations/rule_execution_stats.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/event_log/aggregations/rule_execution_stats.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/event_log/event_log_health_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/event_log/event_log_health_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/event_log/event_log_health_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/event_log/event_log_health_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/aggregations/health_stats_for_cluster.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/aggregations/health_stats_for_cluster.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/aggregations/health_stats_for_cluster.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/aggregations/health_stats_for_cluster.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/aggregations/health_stats_for_space.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/aggregations/health_stats_for_space.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/aggregations/health_stats_for_space.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/aggregations/health_stats_for_space.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/aggregations/rule_stats.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/aggregations/rule_stats.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/aggregations/rule_stats.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/aggregations/rule_stats.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/fetch_rule_by_id.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/fetch_rule_by_id.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/fetch_rule_by_id.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/fetch_rule_by_id.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/filters.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/filters.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/filters.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/filters.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/rule_objects_health_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/rule_objects_health_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/rule_objects_health_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_objects/rule_objects_health_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_spaces/aggregations/spaces.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_spaces/aggregations/spaces.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_spaces/aggregations/spaces.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_spaces/aggregations/spaces.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_spaces/rule_spaces_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_spaces/rule_spaces_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_spaces/rule_spaces_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/detection_engine_health/rule_spaces/rule_spaces_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/event_log/event_log_constants.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/event_log/event_log_constants.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/event_log/event_log_constants.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/event_log/event_log_constants.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/event_log/event_log_fields.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/event_log/event_log_fields.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/event_log/event_log_fields.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/event_log/event_log_fields.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/event_log/register_event_log_provider.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/event_log/register_event_log_provider.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/event_log/register_event_log_provider.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/event_log/register_event_log_provider.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/README.md b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/README.md similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/README.md rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/README.md diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_executors/client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_executors/client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_executors/client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_executors/client.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_executors/client_interface.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_executors/client_interface.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_executors/client_interface.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_executors/client_interface.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_executors/correlation_ids.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_executors/correlation_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_executors/correlation_ids.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_executors/correlation_ids.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_routes/client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_routes/client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_routes/client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_routes/client.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_routes/client_interface.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_routes/client_interface.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_routes/client_interface.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_routes/client_interface.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/create_rule_execution_summary.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/create_rule_execution_summary.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/create_rule_execution_summary.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/create_rule_execution_summary.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/event_log/aggregations/execution_results/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/event_log/aggregations/execution_results/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/event_log/aggregations/execution_results/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/event_log/aggregations/execution_results/index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/event_log/aggregations/execution_results/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/event_log/aggregations/execution_results/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/event_log/aggregations/execution_results/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/event_log/aggregations/execution_results/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/event_log/aggregations/execution_results/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/event_log/aggregations/execution_results/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/event_log/aggregations/execution_results/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/event_log/aggregations/execution_results/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/event_log/event_log_reader.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/event_log/event_log_reader.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/event_log/event_log_reader.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/event_log/event_log_reader.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/event_log/event_log_writer.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/event_log/event_log_writer.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/event_log/event_log_writer.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/event_log/event_log_writer.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/execution_settings/fetch_rule_execution_settings.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/execution_settings/fetch_rule_execution_settings.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/execution_settings/fetch_rule_execution_settings.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/execution_settings/fetch_rule_execution_settings.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/service.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/service.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/service.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/service.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/service_interface.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/service_interface.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/service_interface.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/service_interface.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/utils/console_logging.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/utils/console_logging.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/utils/console_logging.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/utils/console_logging.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/utils/es_aggregations.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/utils/es_aggregations.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/utils/es_aggregations.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/utils/es_aggregations.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/utils/kql.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/utils/kql.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/utils/kql.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/utils/kql.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/utils/normalization.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/utils/normalization.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/utils/normalization.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/utils/normalization.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_monitoring/mocks.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/alert_instance_factory_stub.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/alert_instance_factory_stub.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/alert_instance_factory_stub.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/alert_instance_factory_stub.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/preview_rule_execution_logger.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/preview_rule_execution_logger.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/preview_rule_execution_logger.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/preview_rule_execution_logger.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_scoped_cluster_client.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_scoped_cluster_client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_scoped_cluster_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_scoped_cluster_client.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_scoped_cluster_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_scoped_cluster_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_scoped_cluster_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_scoped_cluster_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/preview_rules/wrap_search_source_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/register_routes.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/register_routes.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/api/register_routes.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/api/register_routes.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_preview/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_preview/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/endpoint_response_action.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_response_actions/endpoint_response_action.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/endpoint_response_action.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_response_actions/endpoint_response_action.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/osquery_response_action.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_response_actions/osquery_response_action.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/osquery_response_action.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_response_actions/osquery_response_action.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/schedule_notification_response_actions.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_response_actions/schedule_notification_response_actions.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/schedule_notification_response_actions.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_response_actions/schedule_notification_response_actions.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/schedule_notification_response_actions.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_response_actions/schedule_notification_response_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/schedule_notification_response_actions.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_response_actions/schedule_notification_response_actions.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_response_actions/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_response_actions/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_response_actions/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_response_actions/utils.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_response_actions/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_response_actions/utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_response_actions/utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_schema/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_schema/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_schema/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_schema/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_schema/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_schema/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_schema/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_schema/mocks.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_alert_type.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_alert_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_alert_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_alert_type.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_schemas.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_schemas.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_schemas.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_schemas.mock.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_schemas.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_schemas.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_schemas.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_schemas.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/empty_signal_source_hit.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/empty_signal_source_hit.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/empty_signal_source_hit.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/empty_signal_source_hit.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/es_results.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/es_results.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/es_results.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/es_results.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/rule.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/rule.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/rule.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/rule.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/rule_type.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/rule_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/rule_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/rule_type.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/threshold.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/threshold.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/threshold.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/__mocks__/threshold.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/constants.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/constants.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/constants.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_wrapper.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_wrapper.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_wrapper.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_wrapper.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_alert_group_from_sequence.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_alert_group_from_sequence.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_alert_group_from_sequence.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_alert_group_from_sequence.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_alert_group_from_sequence.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_alert_group_from_sequence.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_alert_group_from_sequence.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_alert_group_from_sequence.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_eql_search_request.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_eql_search_request.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_eql_search_request.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_eql_search_request.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_eql_search_request.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_eql_search_request.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_eql_search_request.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_eql_search_request.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/create_eql_alert_type.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/eql/create_eql_alert_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/create_eql_alert_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/eql/create_eql_alert_type.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/eql.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/eql/eql.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/eql.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/eql/eql.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/eql.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/eql/eql.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/eql.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/eql/eql.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/wrap_sequences_factory.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/eql/wrap_sequences_factory.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/wrap_sequences_factory.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/eql/wrap_sequences_factory.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/build_esql_search_request.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/build_esql_search_request.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/build_esql_search_request.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/build_esql_search_request.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/create_esql_alert_type.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/create_esql_alert_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/create_esql_alert_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/create_esql_alert_type.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/esql.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/esql.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/esql.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/esql.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/esql_request.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/esql_request.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/esql_request.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/esql_request.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/fetch_source_documents.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/fetch_source_documents.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/fetch_source_documents.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/fetch_source_documents.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/utils/generate_alert_id.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/utils/generate_alert_id.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/utils/generate_alert_id.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/utils/generate_alert_id.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/utils/generate_alert_id.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/utils/generate_alert_id.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/utils/generate_alert_id.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/utils/generate_alert_id.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/utils/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/utils/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/utils/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/utils/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/utils/row_to_document.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/utils/row_to_document.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/utils/row_to_document.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/utils/row_to_document.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/utils/row_to_document.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/utils/row_to_document.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/utils/row_to_document.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/utils/row_to_document.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/wrap_esql_alerts.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/wrap_esql_alerts.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/wrap_esql_alerts.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/wrap_esql_alerts.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/wrap_esql_alerts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/wrap_esql_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/wrap_esql_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/wrap_esql_alerts.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/wrap_suppressed_esql_alerts.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/wrap_suppressed_esql_alerts.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/wrap_suppressed_esql_alerts.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/wrap_suppressed_esql_alerts.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/wrap_suppressed_esql_alerts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/wrap_suppressed_esql_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/esql/wrap_suppressed_esql_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/esql/wrap_suppressed_esql_alerts.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/bulk_create_factory.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/bulk_create_factory.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/bulk_create_factory.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/bulk_create_factory.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/__snapshots__/build_alert.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/__snapshots__/build_alert.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/__snapshots__/build_alert.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/__snapshots__/build_alert.test.ts.snap diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/build_alert.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_boolean_type.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_boolean_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_boolean_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_boolean_type.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_date_type.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_date_type.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_date_type.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_date_type.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_date_type.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_date_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_date_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_date_type.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_ip_type.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_ip_type.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_ip_type.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_ip_type.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_ip_type.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_ip_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_ip_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_ip_type.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_long_type.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_long_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_long_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_long_type.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_numeric_type.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_numeric_type.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_numeric_type.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_numeric_type.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_numeric_type.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_numeric_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_numeric_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/ecs_types_validators/is_valid_numeric_type.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/generate_building_block_ids.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/generate_building_block_ids.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/generate_building_block_ids.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/generate_building_block_ids.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/transform_hit_to_alert.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/transform_hit_to_alert.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/transform_hit_to_alert.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/transform_hit_to_alert.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/transform_hit_to_alert.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/transform_hit_to_alert.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/transform_hit_to_alert.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/transform_hit_to_alert.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/traverse_and_mutate_doc.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/traverse_and_mutate_doc.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/traverse_and_mutate_doc.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/traverse_and_mutate_doc.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/traverse_and_mutate_doc.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/traverse_and_mutate_doc.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/traverse_and_mutate_doc.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/utils/traverse_and_mutate_doc.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_hits_factory.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_hits_factory.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_hits_factory.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/factories/wrap_hits_factory.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/create_indicator_match_alert_type.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/create_indicator_match_alert_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/create_indicator_match_alert_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/create_indicator_match_alert_type.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/indicator_match.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/indicator_match.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/indicator_match.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/indicator_match.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/build_threat_enrichment.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/build_threat_enrichment.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/build_threat_enrichment.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/build_threat_enrichment.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/build_threat_mapping_filter.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/build_threat_mapping_filter.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/build_threat_mapping_filter.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/build_threat_mapping_filter.mock.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/build_threat_mapping_filter.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/build_threat_mapping_filter.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/build_threat_mapping_filter.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/build_threat_mapping_filter.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/build_threat_mapping_filter.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/build_threat_mapping_filter.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/build_threat_mapping_filter.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/build_threat_mapping_filter.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/create_event_signal.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/create_event_signal.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/create_event_signal.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/create_event_signal.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/create_threat_signal.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/create_threat_signal.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/create_threat_signal.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/create_threat_signal.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/create_threat_signals.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/create_threat_signals.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/create_threat_signals.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/create_threat_signals.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/enrich_signal_threat_matches.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/enrich_signal_threat_matches.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/enrich_signal_threat_matches.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/enrich_signal_threat_matches.mock.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/enrich_signal_threat_matches.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/enrich_signal_threat_matches.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/enrich_signal_threat_matches.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/enrich_signal_threat_matches.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/enrich_signal_threat_matches.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/enrich_signal_threat_matches.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/enrich_signal_threat_matches.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/enrich_signal_threat_matches.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_allowed_fields_for_terms_query.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_allowed_fields_for_terms_query.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_allowed_fields_for_terms_query.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_allowed_fields_for_terms_query.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_allowed_fields_for_terms_query.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_allowed_fields_for_terms_query.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_allowed_fields_for_terms_query.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_allowed_fields_for_terms_query.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_event_count.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_event_count.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_event_count.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_event_count.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_event_count.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_event_count.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_event_count.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_event_count.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_mapping_filters.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_mapping_filters.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_mapping_filters.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_mapping_filters.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_mapping_filters.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_mapping_filters.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_mapping_filters.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_mapping_filters.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_signals_map_from_threat_index.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_signals_map_from_threat_index.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_signals_map_from_threat_index.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_signals_map_from_threat_index.mock.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_signals_map_from_threat_index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_signals_map_from_threat_index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_signals_map_from_threat_index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_signals_map_from_threat_index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_signals_map_from_threat_index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_signals_map_from_threat_index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_signals_map_from_threat_index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_signals_map_from_threat_index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_threat_list.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_threat_list.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_threat_list.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_threat_list.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_threat_list.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_threat_list.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_threat_list.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/get_threat_list.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/threat_enrichment_factory.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/threat_enrichment_factory.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/threat_enrichment_factory.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/threat_enrichment_factory.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/threat_enrichment_factory.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/threat_enrichment_factory.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/threat_enrichment_factory.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/threat_enrichment_factory.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/utils.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/indicator_match/threat_mapping/utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml/bulk_create_ml_signals.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/ml/bulk_create_ml_signals.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml/bulk_create_ml_signals.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/ml/bulk_create_ml_signals.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml/bulk_create_ml_signals.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/ml/bulk_create_ml_signals.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml/bulk_create_ml_signals.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/ml/bulk_create_ml_signals.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml/create_ml_alert_type.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/ml/create_ml_alert_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml/create_ml_alert_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/ml/create_ml_alert_type.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml/find_ml_signals.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/ml/find_ml_signals.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml/find_ml_signals.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/ml/find_ml_signals.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml/ml.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/ml/ml.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml/ml.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/ml/ml.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml/ml.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/ml/ml.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/ml/ml.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/ml/ml.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/README.md b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/README.md similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/README.md rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/README.md diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/__snapshots__/build_new_terms_aggregation.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/__snapshots__/build_new_terms_aggregation.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/__snapshots__/build_new_terms_aggregation.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/__snapshots__/build_new_terms_aggregation.test.ts.snap diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/build_new_terms_aggregation.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/build_new_terms_aggregation.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/build_new_terms_aggregation.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/build_new_terms_aggregation.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/build_new_terms_aggregation.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/build_new_terms_aggregation.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/build_new_terms_aggregation.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/build_new_terms_aggregation.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/bulk_create_suppressed_alerts_in_memory.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/bulk_create_suppressed_alerts_in_memory.ts similarity index 95% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/bulk_create_suppressed_alerts_in_memory.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/bulk_create_suppressed_alerts_in_memory.ts index efa8e95c522a5..a2db4a5981412 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/bulk_create_suppressed_alerts_in_memory.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/bulk_create_suppressed_alerts_in_memory.ts @@ -59,7 +59,7 @@ export interface BulkCreateSuppressedAlertsParams /** * wraps, bulk create and suppress alerts in memory, also takes care of missing fields logic. * If parameter alertSuppression.missingFieldsStrategy configured not to be suppressed, regular alerts will be created for such events without suppression - * This function is similar to x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/bulk_create_suppressed_alerts_in_memory.ts, but + * This function is similar to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/bulk_create_suppressed_alerts_in_memory.ts, but * it operates with new terms specific eventsAndTerms{@link EventsAndTerms} parameter property, instead of regular events as common utility */ export const bulkCreateSuppressedNewTermsAlertsInMemory = async ({ diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/create_new_terms_alert_type.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/create_new_terms_alert_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/create_new_terms_alert_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/create_new_terms_alert_type.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/multi_terms_composite.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/multi_terms_composite.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/multi_terms_composite.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/multi_terms_composite.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/utils.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/wrap_new_terms_alerts.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/wrap_new_terms_alerts.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/wrap_new_terms_alerts.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/wrap_new_terms_alerts.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/wrap_new_terms_alerts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/wrap_new_terms_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/wrap_new_terms_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/wrap_new_terms_alerts.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/wrap_suppressed_new_terms_alerts.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/wrap_suppressed_new_terms_alerts.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/wrap_suppressed_new_terms_alerts.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/wrap_suppressed_new_terms_alerts.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/wrap_suppressed_new_terms_alerts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/wrap_suppressed_new_terms_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/wrap_suppressed_new_terms_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/new_terms/wrap_suppressed_new_terms_alerts.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/__snapshots__/build_group_by_field_aggregation.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/__snapshots__/build_group_by_field_aggregation.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/__snapshots__/build_group_by_field_aggregation.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/__snapshots__/build_group_by_field_aggregation.test.ts.snap diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/__snapshots__/group_and_bulk_create.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/__snapshots__/group_and_bulk_create.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/__snapshots__/group_and_bulk_create.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/__snapshots__/group_and_bulk_create.test.ts.snap diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/build_group_by_field_aggregation.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/build_group_by_field_aggregation.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/build_group_by_field_aggregation.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/build_group_by_field_aggregation.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/build_group_by_field_aggregation.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/build_group_by_field_aggregation.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/build_group_by_field_aggregation.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/build_group_by_field_aggregation.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/bulk_create_unsuppressed_alerts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/bulk_create_unsuppressed_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/bulk_create_unsuppressed_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/bulk_create_unsuppressed_alerts.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/group_and_bulk_create.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/group_and_bulk_create.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/group_and_bulk_create.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/group_and_bulk_create.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/group_and_bulk_create.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/group_and_bulk_create.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/group_and_bulk_create.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/group_and_bulk_create.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/wrap_suppressed_alerts.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/wrap_suppressed_alerts.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/wrap_suppressed_alerts.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/wrap_suppressed_alerts.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/wrap_suppressed_alerts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/wrap_suppressed_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/wrap_suppressed_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/alert_suppression/wrap_suppressed_alerts.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/create_query_alert_type.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/create_query_alert_type.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/create_query_alert_type.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/create_query_alert_type.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/create_query_alert_type.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/create_query_alert_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/create_query_alert_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/create_query_alert_type.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/query.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/query.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/query/query.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/query/query.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/README.md b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/README.md similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/README.md rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/README.md diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_data_view.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_data_view.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_data_view.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_data_view.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_data_view.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_data_view.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_data_view.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_data_view.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_exceptions_list.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_exceptions_list.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_exceptions_list.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_exceptions_list.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_exceptions_list.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_exceptions_list.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_exceptions_list.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_exceptions_list.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_references.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_references.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_references.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_references.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_references.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_references.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_references.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/extract_references.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_data_view.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_data_view.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_data_view.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_data_view.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_data_view.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_data_view.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_data_view.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_data_view.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_exceptions_list.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_exceptions_list.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_exceptions_list.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_exceptions_list.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_exceptions_list.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_exceptions_list.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_exceptions_list.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_exceptions_list.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_references.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_references.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_references.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_references.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_references.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_references.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_references.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_references.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/constants.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/constants.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/constants.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_name_pattern.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_name_pattern.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_name_pattern.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_name_pattern.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_name_pattern.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_name_pattern.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_name_pattern.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_name_pattern.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_name_pattern_for_exception_list.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_name_pattern_for_exception_list.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_name_pattern_for_exception_list.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_name_pattern_for_exception_list.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_name_pattern_for_exception_list.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_name_pattern_for_exception_list.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_name_pattern_for_exception_list.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_name_pattern_for_exception_list.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference_for_data_view.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference_for_data_view.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference_for_data_view.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference_for_data_view.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference_for_data_view.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference_for_data_view.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference_for_data_view.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference_for_data_view.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference_for_exceptions_list.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference_for_exceptions_list.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference_for_exceptions_list.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference_for_exceptions_list.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference_for_exceptions_list.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference_for_exceptions_list.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference_for_exceptions_list.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/get_saved_object_reference_for_exceptions_list.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/log_missing_saved_object_error.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/log_missing_saved_object_error.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/log_missing_saved_object_error.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/log_missing_saved_object_error.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/log_missing_saved_object_error.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/log_missing_saved_object_error.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/log_missing_saved_object_error.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/utils/log_missing_saved_object_error.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_eql.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_eql.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_eql.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_eql.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_indicator_match.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_indicator_match.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_indicator_match.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_indicator_match.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_ml.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_ml.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_ml.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_ml.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_query.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_query.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_query.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_query.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_threshold.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_threshold.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_threshold.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/scripts/create_rule_threshold.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/__snapshots__/get_threshold_signal_history.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/__snapshots__/get_threshold_signal_history.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/__snapshots__/get_threshold_signal_history.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/__snapshots__/get_threshold_signal_history.test.ts.snap diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/build_signal_history.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/build_signal_history.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/build_signal_history.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/build_signal_history.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/build_signal_history.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/build_signal_history.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/build_signal_history.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/build_signal_history.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/build_threshold_aggregation.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/build_threshold_aggregation.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/build_threshold_aggregation.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/build_threshold_aggregation.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/build_threshold_aggregation.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/build_threshold_aggregation.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/build_threshold_aggregation.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/build_threshold_aggregation.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/bulk_create_suppressed_threshold_alerts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/bulk_create_suppressed_threshold_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/bulk_create_suppressed_threshold_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/bulk_create_suppressed_threshold_alerts.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/bulk_create_threshold_signals.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/bulk_create_threshold_signals.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/bulk_create_threshold_signals.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/bulk_create_threshold_signals.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/bulk_create_threshold_signals.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/bulk_create_threshold_signals.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/bulk_create_threshold_signals.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/bulk_create_threshold_signals.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/create_threshold_alert_type.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/create_threshold_alert_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/create_threshold_alert_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/create_threshold_alert_type.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/find_threshold_signals.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/find_threshold_signals.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/find_threshold_signals.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/find_threshold_signals.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/find_threshold_signals.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/find_threshold_signals.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/find_threshold_signals.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/find_threshold_signals.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/get_threshold_bucket_filters.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/get_threshold_bucket_filters.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/get_threshold_bucket_filters.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/get_threshold_bucket_filters.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/get_threshold_bucket_filters.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/get_threshold_bucket_filters.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/get_threshold_bucket_filters.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/get_threshold_bucket_filters.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/get_threshold_signal_history.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/get_threshold_signal_history.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/get_threshold_signal_history.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/get_threshold_signal_history.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/get_threshold_signal_history.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/get_threshold_signal_history.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/get_threshold_signal_history.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/get_threshold_signal_history.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/threshold.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/threshold.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/threshold.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/threshold.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/threshold.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/threshold.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/threshold.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/threshold.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/utils.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/wrap_suppressed_threshold_alerts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/wrap_suppressed_threshold_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/wrap_suppressed_threshold_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/threshold/wrap_suppressed_threshold_alerts.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/translations.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/translations.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/translations.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/__snapshots__/build_timestamp_runtime_mapping.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/__snapshots__/build_timestamp_runtime_mapping.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/__snapshots__/build_timestamp_runtime_mapping.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/__snapshots__/build_timestamp_runtime_mapping.test.ts.snap diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/build_events_query.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/build_events_query.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/build_events_query.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/build_events_query.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/build_events_query.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/build_events_query.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/build_events_query.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/build_events_query.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/build_timestamp_runtime_mapping.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/build_timestamp_runtime_mapping.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/build_timestamp_runtime_mapping.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/build_timestamp_runtime_mapping.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/build_timestamp_runtime_mapping.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/build_timestamp_runtime_mapping.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/build_timestamp_runtime_mapping.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/build_timestamp_runtime_mapping.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/bulk_create_suppressed_alerts_in_memory.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/bulk_create_suppressed_alerts_in_memory.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/bulk_create_suppressed_alerts_in_memory.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/bulk_create_suppressed_alerts_in_memory.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/bulk_create_with_suppression.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/bulk_create_with_suppression.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/bulk_create_with_suppression.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/bulk_create_with_suppression.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/__mocks__/alerts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/__mocks__/alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/__mocks__/alerts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/__mocks__/alerts.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/create_single_field_match_enrichment.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/create_single_field_match_enrichment.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/create_single_field_match_enrichment.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/create_single_field_match_enrichment.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/create_single_field_match_enrichment.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/create_single_field_match_enrichment.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/create_single_field_match_enrichment.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/create_single_field_match_enrichment.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/enrichment_by_type/asset_criticality.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/enrichment_by_type/asset_criticality.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/enrichment_by_type/asset_criticality.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/enrichment_by_type/asset_criticality.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/enrichment_by_type/host_risk.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/enrichment_by_type/host_risk.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/enrichment_by_type/host_risk.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/enrichment_by_type/host_risk.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/enrichment_by_type/user_risk.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/enrichment_by_type/user_risk.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/enrichment_by_type/user_risk.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/enrichment_by_type/user_risk.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/search_enrichments.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/search_enrichments.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/search_enrichments.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/search_enrichments.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/events.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/events.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/events.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/events.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/events.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/events.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/events.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/events.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/is_index_exist.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/is_index_exist.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/is_index_exist.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/is_index_exist.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/requests.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/requests.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/requests.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/requests.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/requests.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/requests.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/requests.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/requests.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/transforms.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/transforms.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/transforms.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/transforms.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/transforms.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/transforms.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/transforms.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/enrichments/utils/transforms.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_data_tier_filter.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_data_tier_filter.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_data_tier_filter.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_data_tier_filter.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_data_tier_filter.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_data_tier_filter.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_data_tier_filter.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_data_tier_filter.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_filter.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_filter.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_filter.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_filter.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_filter.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_filter.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_filter.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_filter.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_input_output_index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_input_output_index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_input_output_index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_input_output_index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_input_output_index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_input_output_index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_input_output_index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_input_output_index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_is_alert_suppression_active.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_list_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_list_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_list_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_list_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_number_of_suppressed_alerts.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_number_of_suppressed_alerts.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_number_of_suppressed_alerts.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_number_of_suppressed_alerts.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_number_of_suppressed_alerts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_number_of_suppressed_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_number_of_suppressed_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_number_of_suppressed_alerts.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_fields.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_fields.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_fields.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_fields.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter_load_fields.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter_load_fields.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter_load_fields.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/get_query_filter_load_fields.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/create_field_and_set_tuples.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/create_field_and_set_tuples.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/create_field_and_set_tuples.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/create_field_and_set_tuples.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/create_field_and_set_tuples.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/create_field_and_set_tuples.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/create_field_and_set_tuples.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/create_field_and_set_tuples.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/create_set_to_filter_against.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/create_set_to_filter_against.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/create_set_to_filter_against.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/create_set_to_filter_against.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/create_set_to_filter_against.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/create_set_to_filter_against.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/create_set_to_filter_against.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/create_set_to_filter_against.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/filter_events.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/filter_events.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/filter_events.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/filter_events.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/filter_events.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/filter_events.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/filter_events.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/filter_events.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/filter_events_against_list.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/filter_events_against_list.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/filter_events_against_list.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/filter_events_against_list.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/filter_events_against_list.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/filter_events_against_list.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/filter_events_against_list.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/filter_events_against_list.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/large_list_filters/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/logged_requests/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/logged_requests/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/logged_requests/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/logged_requests/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/logged_requests/log_eql.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/logged_requests/log_eql.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/logged_requests/log_eql.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/logged_requests/log_eql.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/logged_requests/log_esql.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/logged_requests/log_esql.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/logged_requests/log_esql.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/logged_requests/log_esql.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/logged_requests/log_query.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/logged_requests/log_query.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/logged_requests/log_query.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/logged_requests/log_query.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_risk_score_from_mapping.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_risk_score_from_mapping.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_risk_score_from_mapping.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_risk_score_from_mapping.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_risk_score_from_mapping.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_risk_score_from_mapping.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_risk_score_from_mapping.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_risk_score_from_mapping.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_rule_name_from_mapping.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_rule_name_from_mapping.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_rule_name_from_mapping.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_rule_name_from_mapping.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_rule_name_from_mapping.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_rule_name_from_mapping.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_rule_name_from_mapping.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_rule_name_from_mapping.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_severity_from_mapping.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_severity_from_mapping.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_severity_from_mapping.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_severity_from_mapping.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_severity_from_mapping.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_severity_from_mapping.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_severity_from_mapping.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/mappings/build_severity_from_mapping.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/partition_missing_fields_events.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/partition_missing_fields_events.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/partition_missing_fields_events.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/partition_missing_fields_events.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/partition_missing_fields_events.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/partition_missing_fields_events.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/partition_missing_fields_events.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/partition_missing_fields_events.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/reason_formatter.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/reason_formatter.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/reason_formatter.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/reason_formatter.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/reason_formatters.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/reason_formatters.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/reason_formatters.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/reason_formatters.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/search_after_bulk_create.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/search_after_bulk_create.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/search_after_bulk_create.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/search_after_bulk_create.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/search_after_bulk_create.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/search_after_bulk_create.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/search_after_bulk_create.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/search_after_bulk_create.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/search_after_bulk_create_factory.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/search_after_bulk_create_factory.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/search_after_bulk_create_factory.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/search_after_bulk_create_factory.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/search_after_bulk_create_suppressed_alerts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/search_after_bulk_create_suppressed_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/search_after_bulk_create_suppressed_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/search_after_bulk_create_suppressed_alerts.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/send_telemetry_events.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/send_telemetry_events.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/send_telemetry_events.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/send_telemetry_events.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/send_telemetry_events.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/send_telemetry_events.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/send_telemetry_events.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/send_telemetry_events.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/siem_rule_action_groups.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/siem_rule_action_groups.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/siem_rule_action_groups.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/siem_rule_action_groups.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/single_search_after.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/single_search_after.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/single_search_after.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/single_search_after.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/single_search_after.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/single_search_after.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/single_search_after.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/single_search_after.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/README.md b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/README.md similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/README.md rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/README.md diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/get_strategy.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/get_strategy.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/get_strategy.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/get_strategy.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/merge_all_fields_with_source.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/merge_all_fields_with_source.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/merge_all_fields_with_source.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/merge_all_fields_with_source.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/merge_all_fields_with_source.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/merge_all_fields_with_source.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/merge_all_fields_with_source.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/merge_all_fields_with_source.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/merge_missing_fields_with_source.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/merge_missing_fields_with_source.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/merge_missing_fields_with_source.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/merge_missing_fields_with_source.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/merge_missing_fields_with_source.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/merge_missing_fields_with_source.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/merge_missing_fields_with_source.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/merge_missing_fields_with_source.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/merge_no_fields.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/merge_no_fields.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/merge_no_fields.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/strategies/merge_no_fields.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/array_in_path_exists.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/array_in_path_exists.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/array_in_path_exists.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/array_in_path_exists.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/array_in_path_exists.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/array_in_path_exists.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/array_in_path_exists.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/array_in_path_exists.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/filter_field_entry.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/filter_field_entry.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/filter_field_entry.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/filter_field_entry.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/filter_field_entry.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/filter_field_entry.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/filter_field_entry.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/filter_field_entry.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_array_of_primitives.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_array_of_primitives.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_array_of_primitives.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_array_of_primitives.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_array_of_primitives.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_array_of_primitives.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_array_of_primitives.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_array_of_primitives.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_eql_bug_77152.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_eql_bug_77152.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_eql_bug_77152.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_eql_bug_77152.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_eql_bug_77152.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_eql_bug_77152.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_eql_bug_77152.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_eql_bug_77152.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_ignored.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_ignored.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_ignored.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_ignored.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_ignored.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_ignored.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_ignored.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_ignored.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_invalid_key.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_invalid_key.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_invalid_key.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_invalid_key.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_invalid_key.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_invalid_key.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_invalid_key.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_invalid_key.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_multifield.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_multifield.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_multifield.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_multifield.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_multifield.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_multifield.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_multifield.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_multifield.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_nested_object.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_nested_object.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_nested_object.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_nested_object.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_nested_object.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_nested_object.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_nested_object.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_nested_object.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_objectlike_or_array_of_objectlikes.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_objectlike_or_array_of_objectlikes.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_objectlike_or_array_of_objectlikes.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_objectlike_or_array_of_objectlikes.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_objectlike_or_array_of_objectlikes.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_objectlike_or_array_of_objectlikes.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_objectlike_or_array_of_objectlikes.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_objectlike_or_array_of_objectlikes.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_path_valid.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_path_valid.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_path_valid.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_path_valid.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_path_valid.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_path_valid.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_path_valid.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_path_valid.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_primitive.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_primitive.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_primitive.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_primitive.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_primitive.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_primitive.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_primitive.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_primitive.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_type_object.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_type_object.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_type_object.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_type_object.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_type_object.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_type_object.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_type_object.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/is_type_object.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/recursive_unboxing_fields.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/recursive_unboxing_fields.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/recursive_unboxing_fields.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/recursive_unboxing_fields.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/recursive_unboxing_fields.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/recursive_unboxing_fields.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/recursive_unboxing_fields.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/recursive_unboxing_fields.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/robust_field_access.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/robust_field_access.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/robust_field_access.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/robust_field_access.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/robust_field_access.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/robust_field_access.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/robust_field_access.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/source_fields_merging/utils/robust_field_access.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/suppression_utils.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/suppression_utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/suppression_utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/suppression_utils.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/suppression_utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/suppression_utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/suppression_utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/suppression_utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/telemetry/send_alert_suppression_telemetry_event.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/utils.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/validate_mutated_params.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/validate_mutated_params.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/validate_mutated_params.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/validate_mutated_params.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/wrap_suppressed_alerts.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/wrap_suppressed_alerts.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/wrap_suppressed_alerts.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/wrap_suppressed_alerts.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/wrap_suppressed_alerts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/wrap_suppressed_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/utils/wrap_suppressed_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/utils/wrap_suppressed_alerts.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/add_prepackaged_rules.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/add_prepackaged_rules.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/add_prepackaged_rules.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/add_prepackaged_rules.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/check_env_variables.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/check_env_variables.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/check_env_variables.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/check_env_variables.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/create_threat_data.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/create_threat_data.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/create_threat_data.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/create_threat_data.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/create_threat_mapping.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/create_threat_mapping.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/create_threat_mapping.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/create_threat_mapping.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_all_actions.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_all_actions.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_all_actions.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_all_actions.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_all_alert_tasks.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_all_alert_tasks.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_all_alert_tasks.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_all_alert_tasks.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_all_alerts.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_all_alerts.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_all_alerts.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_all_alerts.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_all_api_keys.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_all_api_keys.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_all_api_keys.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_all_api_keys.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_all_rule_execution_data.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_all_rule_execution_data.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_all_rule_execution_data.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_all_rule_execution_data.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_bulk.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_bulk.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_bulk.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_bulk.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_rule_by_id.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_rule_by_id.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_rule_by_id.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_rule_by_id.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_rule_by_rule_id.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_rule_by_rule_id.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_rule_by_rule_id.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_rule_by_rule_id.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_rules_by_query.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_rules_by_query.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_rules_by_query.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_rules_by_query.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_signal_index.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_signal_index.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_signal_index.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_signal_index.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_threat_list.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_threat_list.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/delete_threat_list.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/delete_threat_list.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/disable_rules_by_query.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/disable_rules_by_query.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/disable_rules_by_query.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/disable_rules_by_query.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/duplicate_rules_by_query.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/duplicate_rules_by_query.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/duplicate_rules_by_query.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/duplicate_rules_by_query.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/enable_rules_by_query.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/enable_rules_by_query.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/enable_rules_by_query.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/enable_rules_by_query.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/export_rules.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/export_rules.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/export_rules.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/export_rules.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/export_rules_by_query.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/export_rules_by_query.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/export_rules_by_query.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/export_rules_by_query.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/export_rules_by_rule_id.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/export_rules_by_rule_id.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/export_rules_by_rule_id.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/export_rules_by_rule_id.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/export_rules_by_rule_id_to_file.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/export_rules_by_rule_id_to_file.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/export_rules_by_rule_id_to_file.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/export_rules_by_rule_id_to_file.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/export_rules_to_file.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/export_rules_to_file.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/export_rules_to_file.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/export_rules_to_file.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/export_timelines_to_file.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/export_timelines_to_file.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/export_timelines_to_file.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/export_timelines_to_file.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/find_alerting_rules.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/find_alerting_rules.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/find_alerting_rules.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/find_alerting_rules.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/find_rule_by_filter.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/find_rule_by_filter.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/find_rule_by_filter.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/find_rule_by_filter.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/find_rules.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/find_rules.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/find_rules.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/find_rules.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/find_rules_sort.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/find_rules_sort.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/find_rules_sort.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/find_rules_sort.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/find_saved_object.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/find_saved_object.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/find_saved_object.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/find_saved_object.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_action_instances.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_action_instances.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_action_instances.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_action_instances.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_action_types.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_action_types.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_action_types.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_action_types.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_alert_tasks.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_alert_tasks.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_alert_tasks.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_alert_tasks.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_alerting_rule_types.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_alerting_rule_types.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_alerting_rule_types.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_alerting_rule_types.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_prepackaged_rules_status.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_prepackaged_rules_status.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_prepackaged_rules_status.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_prepackaged_rules_status.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_privileges.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_privileges.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_privileges.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_privileges.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_rule_by_id.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_rule_by_id.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_rule_by_id.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_rule_by_id.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_rule_by_rule_id.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_rule_by_rule_id.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_rule_by_rule_id.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_rule_by_rule_id.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_saved_objects.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_saved_objects.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_saved_objects.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_saved_objects.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_signal_index.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_signal_index.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_signal_index.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_signal_index.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_tags.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_tags.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/get_tags.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/get_tags.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/hard_reset.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/hard_reset.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/hard_reset.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/hard_reset.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/import_rules.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/import_rules.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/import_rules.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/import_rules.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/import_rules_no_overwrite.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/import_rules_no_overwrite.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/import_rules_no_overwrite.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/import_rules_no_overwrite.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/legacy_notifications/one_action.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/legacy_notifications/one_action.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/legacy_notifications/one_action.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/legacy_notifications/one_action.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/patch_rule.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/patch_rule.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/patch_rule.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/patch_rule.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/patch_rule_bulk.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/patch_rule_bulk.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/patch_rule_bulk.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/patch_rule_bulk.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/post_legacy_notification.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/post_legacy_notification.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/post_legacy_notification.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/post_legacy_notification.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/post_rule.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/post_rule.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/post_rule.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/post_rule.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/post_rule_bulk.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/post_rule_bulk.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/post_rule_bulk.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/post_rule_bulk.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/post_rule_preview.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/post_rule_preview.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/post_rule_preview.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/post_rule_preview.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/post_signal_index.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/post_signal_index.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/post_signal_index.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/post_signal_index.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/post_x_rules.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/post_x_rules.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/post_x_rules.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/post_x_rules.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/roles_users/README.md b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/roles_users/README.md similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/roles_users/README.md rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/roles_users/README.md diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/roles_users/create_role_and_user.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/roles_users/create_role_and_user.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/roles_users/create_role_and_user.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/roles_users/create_role_and_user.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/roles_users/create_role_and_user.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/roles_users/create_role_and_user.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/roles_users/create_role_and_user.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/roles_users/create_role_and_user.ts diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/bulk/delete_by_rule_id.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/bulk/delete_by_rule_id.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/bulk/delete_by_rule_id.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/bulk/delete_by_rule_id.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/bulk/multiple_ruleid_queries.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/bulk/multiple_ruleid_queries.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/bulk/multiple_ruleid_queries.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/bulk/multiple_ruleid_queries.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/bulk/multiple_simplest_queries.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/bulk/multiple_simplest_queries.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/bulk/multiple_simplest_queries.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/bulk/multiple_simplest_queries.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/bulk/patch_names.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/bulk/patch_names.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/bulk/patch_names.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/bulk/patch_names.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/export/ruleid_queries.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/export/ruleid_queries.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/export/ruleid_queries.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/export/ruleid_queries.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/import/multiple_ruleid_queries.ndjson b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/import/multiple_ruleid_queries.ndjson similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/import/multiple_ruleid_queries.ndjson rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/import/multiple_ruleid_queries.ndjson diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/README.md b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/README.md similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/README.md rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/README.md diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/disable_rule.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/disable_rule.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/disable_rule.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/disable_rule.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/enabled_rule.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/enabled_rule.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/enabled_rule.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/enabled_rule.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/simplest_update_risk_score_by_id.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/simplest_update_risk_score_by_id.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/simplest_update_risk_score_by_id.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/simplest_update_risk_score_by_id.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/simplest_update_risk_score_by_rule_id.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/simplest_update_risk_score_by_rule_id.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/simplest_update_risk_score_by_rule_id.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/simplest_update_risk_score_by_rule_id.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/simplest_updated_name.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/simplest_updated_name.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/simplest_updated_name.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/simplest_updated_name.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_interval.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_interval.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_interval.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_interval.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_list.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_list.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_list.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_list.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_machine_learning.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_machine_learning.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_machine_learning.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_machine_learning.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_note.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_note.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_note.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_note.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_query_everything.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_query_everything.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_query_everything.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_query_everything.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_tags.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_tags.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_tags.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_tags.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_timelineid.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_timelineid.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_timelineid.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_timelineid.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_version.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_version.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_version.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/patches/update_version.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/README.md b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/README.md similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/README.md rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/README.md diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_disabled.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_disabled.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_disabled.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_disabled.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_eql.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_eql.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_eql.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_eql.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_lucene.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_lucene.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_lucene.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_lucene.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_mitre_attack.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_mitre_attack.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_mitre_attack.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_mitre_attack.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_preview_threat_match.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_preview_threat_match.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_preview_threat_match.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_preview_threat_match.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_timelineid.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_timelineid.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_timelineid.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_timelineid.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_everything.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_everything.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_everything.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_everything.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_filter.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_filter.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_filter.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_filter.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_list.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_list.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_list.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_list.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_machine_learning.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_machine_learning.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_machine_learning.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_machine_learning.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_mappings.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_mappings.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_mappings.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_mappings.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_max_signals.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_max_signals.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_max_signals.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_max_signals.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_meta_data.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_meta_data.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_meta_data.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_meta_data.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_note.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_note.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_note.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_note.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_rule_id.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_rule_id.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_rule_id.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_rule_id.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_tags.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_tags.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_tags.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_tags.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_threat_mapping.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_threat_mapping.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_threat_mapping.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_threat_mapping.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_threat_mapping_perf.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_threat_mapping_perf.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_threat_mapping_perf.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/query_with_threat_mapping_perf.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/references/query_with_multiple_exception_lists.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/references/query_with_multiple_exception_lists.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/references/query_with_multiple_exception_lists.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/references/query_with_multiple_exception_lists.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/references/query_with_single_exception_list.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/references/query_with_single_exception_list.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/references/query_with_single_exception_list.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/references/query_with_single_exception_list.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/sequence_eql_query.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/sequence_eql_query.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/sequence_eql_query.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/sequence_eql_query.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/sequence_eql_query_no_duration.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/sequence_eql_query_no_duration.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/sequence_eql_query_no_duration.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/sequence_eql_query_no_duration.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/simplest_filters.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/simplest_filters.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/simplest_filters.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/simplest_filters.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/simplest_query.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/simplest_query.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/simplest_query.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/queries/simplest_query.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/README.md b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/README.md similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/README.md rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/README.md diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_by_rule_id.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_by_rule_id.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_by_rule_id.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_by_rule_id.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_everything.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_everything.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_everything.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_everything.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_filters.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_filters.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_filters.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_filters.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_query.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_query.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_query.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_query.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_query_filter.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_query_filter.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_query_filter.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_query_filter.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/simplest_saved_query.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/simplest_saved_query.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/simplest_saved_query.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/saved_queries/simplest_saved_query.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/README.md b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/README.md similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/README.md rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/README.md diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/imports/multiple_ruleid_queries_corrupted.ndjson b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/imports/multiple_ruleid_queries_corrupted.ndjson similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/imports/multiple_ruleid_queries_corrupted.ndjson rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/imports/multiple_ruleid_queries_corrupted.ndjson diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/action_without_meta.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/action_without_meta.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/action_without_meta.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/action_without_meta.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/filter_with_empty_query.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/filter_with_empty_query.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/filter_with_empty_query.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/filter_with_empty_query.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/filter_without_query.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/filter_without_query.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/filter_without_query.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/filter_without_query.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/query_filter_ui_meatadata_lucene.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/query_filter_ui_meatadata_lucene.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/query_filter_ui_meatadata_lucene.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/query_filter_ui_meatadata_lucene.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/query_filter_ui_metadata.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/query_filter_ui_metadata.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/query_filter_ui_metadata.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/query_filter_ui_metadata.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/query_with_errors.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/query_with_errors.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/query_with_errors.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/query_with_errors.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/saved_query_ui_meta_empty_query.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/saved_query_ui_meta_empty_query.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/saved_query_ui_meta_empty_query.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/queries/saved_query_ui_meta_empty_query.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/README.md b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/README.md similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/README.md rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/README.md diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/query_single_id.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/query_single_id.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/query_single_id.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/query_single_id.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/signal_on_signal_depth_1.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/signal_on_signal_depth_1.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/signal_on_signal_depth_1.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/signal_on_signal_depth_1.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/signal_on_signal_depth_2.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/signal_on_signal_depth_2.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/signal_on_signal_depth_2.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/signal_on_signal_depth_2.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/README.md b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/README.md similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/README.md rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/README.md diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/query_single_id.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/query_single_id.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/query_single_id.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/query_single_id.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/signal_on_signal.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/signal_on_signal.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/signal_on_signal.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/signal_on_signal.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/README.md b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/README.md similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/README.md rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/README.md diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/disable_rule.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/disable_rule.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/disable_rule.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/disable_rule.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/enabled_rule.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/enabled_rule.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/enabled_rule.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/enabled_rule.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/simplest_update_risk_score_by_id.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/simplest_update_risk_score_by_id.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/simplest_update_risk_score_by_id.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/simplest_update_risk_score_by_id.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/simplest_update_risk_score_by_rule_id.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/simplest_update_risk_score_by_rule_id.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/simplest_update_risk_score_by_rule_id.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/simplest_update_risk_score_by_rule_id.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/simplest_updated_name.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/simplest_updated_name.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/simplest_updated_name.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/simplest_updated_name.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_interval.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_interval.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_interval.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_interval.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_list.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_list.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_list.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_list.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_machine_learning.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_machine_learning.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_machine_learning.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_machine_learning.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_note.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_note.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_note.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_note.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_query_everything.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_query_everything.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_query_everything.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_query_everything.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_tags.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_tags.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_tags.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_tags.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_timelineid.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_timelineid.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_timelineid.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_timelineid.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_version.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_version.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_version.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/rules/updates/update_version.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signal_index_exists.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signal_index_exists.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signal_index_exists.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signal_index_exists.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signals/aggs_signals.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signals/aggs_signals.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signals/aggs_signals.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signals/aggs_signals.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signals/create_signals_migration.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signals/create_signals_migration.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signals/create_signals_migration.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signals/create_signals_migration.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signals/delete_signals_migration.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signals/delete_signals_migration.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signals/delete_signals_migration.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signals/delete_signals_migration.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signals/finalize_signals_migration.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signals/finalize_signals_migration.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signals/finalize_signals_migration.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signals/finalize_signals_migration.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signals/get_migration_status.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signals/get_migration_status.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signals/get_migration_status.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signals/get_migration_status.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signals/put_signal_doc.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signals/put_signal_doc.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signals/put_signal_doc.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signals/put_signal_doc.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signals/query_signals.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signals/query_signals.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signals/query_signals.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signals/query_signals.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signals/sample_signal.json b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signals/sample_signal.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signals/sample_signal.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signals/sample_signal.json diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signals/set_status_with_id.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signals/set_status_with_id.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signals/set_status_with_id.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signals/set_status_with_id.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signals/set_status_with_query.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signals/set_status_with_query.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/signals/set_status_with_query.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/signals/set_status_with_query.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/timelines/add_prepackaged_timelines.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/timelines/add_prepackaged_timelines.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/timelines/add_prepackaged_timelines.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/timelines/add_prepackaged_timelines.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/timelines/delete_all_timelines.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/timelines/delete_all_timelines.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/timelines/delete_all_timelines.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/timelines/delete_all_timelines.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/timelines/delete_timeline_by_timeline_id.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/timelines/delete_timeline_by_timeline_id.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/timelines/delete_timeline_by_timeline_id.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/timelines/delete_timeline_by_timeline_id.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/timelines/find_timeline_by_filter.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/timelines/find_timeline_by_filter.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/timelines/find_timeline_by_filter.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/timelines/find_timeline_by_filter.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/timelines/get_all_timelines.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/timelines/get_all_timelines.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/timelines/get_all_timelines.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/timelines/get_all_timelines.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/timelines/get_timeline_by_id.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/timelines/get_timeline_by_id.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/timelines/get_timeline_by_id.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/timelines/get_timeline_by_id.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/timelines/get_timeline_by_template_timeline_id.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/timelines/get_timeline_by_template_timeline_id.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/timelines/get_timeline_by_template_timeline_id.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/timelines/get_timeline_by_template_timeline_id.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/timelines/regen_prepackage_timelines_index.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/timelines/regen_prepackage_timelines_index.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/timelines/regen_prepackage_timelines_index.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/timelines/regen_prepackage_timelines_index.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/update_rule.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/update_rule.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/update_rule.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/update_rule.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/scripts/update_rule_bulk.sh b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/update_rule_bulk.sh similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/scripts/update_rule_bulk.sh rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/scripts/update_rule_bulk.sh diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/detection_engine/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_data_client.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_data_client.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_data_client.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_data_client.mock.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_data_client.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_data_client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_data_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_data_client.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_data_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_data_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_data_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_data_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_migration_client.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_migration_client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_migration_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_migration_client.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_migration_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_migration_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_migration_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_migration_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_service.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_service.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_service.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_service.mock.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_service.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_service.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_service.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_service.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_service.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_service.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_service.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/asset_criticality_service.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/audit.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/audit.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/audit.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/audit.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/check_and_init_asset_criticality_resources.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/check_and_init_asset_criticality_resources.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/check_and_init_asset_criticality_resources.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/check_and_init_asset_criticality_resources.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/check_and_init_asset_criticality_resources.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/check_and_init_asset_criticality_resources.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/check_and_init_asset_criticality_resources.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/check_and_init_asset_criticality_resources.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/constants.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/constants.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/constants.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/get_user_asset_criticality_privileges.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/get_user_asset_criticality_privileges.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/get_user_asset_criticality_privileges.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/get_user_asset_criticality_privileges.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/helpers.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/helpers.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/migrations/schedule_ecs_compliancy_migration.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/migrations/schedule_ecs_compliancy_migration.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/migrations/schedule_ecs_compliancy_migration.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/migrations/schedule_ecs_compliancy_migration.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/migrations/schedule_ecs_compliancy_migration.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/migrations/schedule_ecs_compliancy_migration.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/migrations/schedule_ecs_compliancy_migration.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/migrations/schedule_ecs_compliancy_migration.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/bulk_upload.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/bulk_upload.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/bulk_upload.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/bulk_upload.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/delete.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/delete.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/delete.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/delete.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/get.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/get.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/get.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/get.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/list.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/list.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/list.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/list.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/privileges.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/privileges.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/privileges.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/privileges.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/register_asset_criticality_routes.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/register_asset_criticality_routes.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/register_asset_criticality_routes.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/register_asset_criticality_routes.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/status.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/status.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/status.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/status.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upload_csv.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upload_csv.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upload_csv.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upload_csv.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upsert.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upsert.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upsert.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/routes/upsert.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/transform_csv_to_upsert_records.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/transform_csv_to_upsert_records.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/transform_csv_to_upsert_records.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/transform_csv_to_upsert_records.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/transform_csv_to_upsert_records.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/transform_csv_to_upsert_records.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/asset_criticality/transform_csv_to_upsert_records.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/asset_criticality/transform_csv_to_upsert_records.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/audit.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/audit.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/audit.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/audit.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/__snapshots__/entity_store_data_client.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/__snapshots__/entity_store_data_client.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/__snapshots__/entity_store_data_client.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/__snapshots__/entity_store_data_client.test.ts.snap diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/auditing/actions.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/auditing/actions.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/auditing/actions.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/auditing/actions.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/constants.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/constants.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/constants.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/component_template.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/component_template.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/component_template.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/component_template.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/enrich_policy.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/enrich_policy.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/enrich_policy.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/enrich_policy.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/entity_index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/entity_index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/entity_index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/entity_index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_pipeline.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_pipeline.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_pipeline.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_pipeline.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/debug_deep_copy_context_step.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/debug_deep_copy_context_step.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/debug_deep_copy_context_step.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/debug_deep_copy_context_step.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/get_dot_expander_steps.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/get_dot_expander_steps.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/get_dot_expander_steps.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/get_dot_expander_steps.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/get_remove_empty_field_steps.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/get_remove_empty_field_steps.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/get_remove_empty_field_steps.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/get_remove_empty_field_steps.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/remove_entity_definition_fields_step.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/remove_entity_definition_fields_step.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/remove_entity_definition_fields_step.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/remove_entity_definition_fields_step.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/retention_definition_to_ingest_processor_steps.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/retention_definition_to_ingest_processor_steps.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/retention_definition_to_ingest_processor_steps.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/elasticsearch_assets/ingest_processor_steps/retention_definition_to_ingest_processor_steps.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.mock.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.test.ts new file mode 100644 index 0000000000000..b7cacea3c3757 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.test.ts @@ -0,0 +1,330 @@ +/* + * 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 { + loggingSystemMock, + elasticsearchServiceMock, + savedObjectsClientMock, +} from '@kbn/core/server/mocks'; +import { EntityStoreDataClient } from './entity_store_data_client'; +import type { SortOrder } from '@elastic/elasticsearch/lib/api/types'; +import type { EntityType } from '../../../../common/api/entity_analytics/entity_store/common.gen'; +import type { DataViewsService } from '@kbn/data-views-plugin/common'; +import type { AppClient } from '../../..'; +import type { EntityStoreConfig } from './types'; +import { mockGlobalState } from '../../../../public/common/mock'; +import type { EntityDefinition } from '@kbn/entities-schema'; +import { getUnitedEntityDefinition } from './united_entity_definitions'; + +const unitedDefinition = getUnitedEntityDefinition({ + entityType: 'host', + namespace: 'test', + fieldHistoryLength: 10, + indexPatterns: [], + syncDelay: '1m', + frequency: '1m', +}); +const definition: EntityDefinition = unitedDefinition.entityManagerDefinition; + +describe('EntityStoreDataClient', () => { + const mockSavedObjectClient = savedObjectsClientMock.create(); + const clusterClientMock = elasticsearchServiceMock.createScopedClusterClient(); + const esClientMock = clusterClientMock.asCurrentUser; + const loggerMock = loggingSystemMock.createLogger(); + const dataClient = new EntityStoreDataClient({ + clusterClient: clusterClientMock, + logger: loggerMock, + namespace: 'default', + soClient: mockSavedObjectClient, + kibanaVersion: '9.0.0', + dataViewsService: {} as DataViewsService, + appClient: {} as AppClient, + config: {} as EntityStoreConfig, + experimentalFeatures: mockGlobalState.app.enableExperimental, + }); + + const defaultSearchParams = { + entityTypes: ['host'] as EntityType[], + page: 1, + perPage: 10, + sortField: 'hostName', + sortOrder: 'asc' as SortOrder, + }; + + const emptySearchResponse = { + took: 0, + timed_out: false, + _shards: { + total: 0, + successful: 0, + skipped: 0, + failed: 0, + }, + hits: { + total: 0, + hits: [], + }, + }; + + describe('search entities', () => { + beforeEach(() => { + jest.resetAllMocks(); + esClientMock.search.mockResolvedValue(emptySearchResponse); + }); + + it('searches in the entities store indices', async () => { + await dataClient.searchEntities({ + ...defaultSearchParams, + entityTypes: ['host', 'user'], + }); + + expect(esClientMock.search).toHaveBeenCalledWith( + expect.objectContaining({ + index: [ + '.entities.v1.latest.security_host_default', + '.entities.v1.latest.security_user_default', + ], + }) + ); + }); + + it('should filter by filterQuery param', async () => { + await dataClient.searchEntities({ + ...defaultSearchParams, + filterQuery: '{"match_all":{}}', + }); + + expect(esClientMock.search).toHaveBeenCalledWith( + expect.objectContaining({ query: { match_all: {} } }) + ); + }); + + it('should paginate', async () => { + await dataClient.searchEntities({ + ...defaultSearchParams, + page: 3, + perPage: 7, + }); + + expect(esClientMock.search).toHaveBeenCalledWith( + expect.objectContaining({ from: 14, size: 7 }) + ); + }); + + it('should sort', async () => { + await dataClient.searchEntities({ + ...defaultSearchParams, + sortField: '@timestamp', + sortOrder: 'asc', + }); + + expect(esClientMock.search).toHaveBeenCalledWith( + expect.objectContaining({ sort: [{ '@timestamp': 'asc' }] }) + ); + }); + + it('caps the size to the maximum query size', async () => { + await dataClient.searchEntities({ + ...defaultSearchParams, + perPage: 999_999, + }); + + const maxSize = 10_000; + + expect(esClientMock.search).toHaveBeenCalledWith(expect.objectContaining({ size: maxSize })); + }); + + it('ignores an index_not_found_exception if the entity index does not exist', async () => { + await dataClient.searchEntities(defaultSearchParams); + + expect(esClientMock.search).toHaveBeenCalledWith( + expect.objectContaining({ ignore_unavailable: true }) + ); + }); + + it('returns inspect query params', async () => { + const response = await dataClient.searchEntities(defaultSearchParams); + + expect(response.inspect).toMatchSnapshot(); + }); + + it('returns searched entity record', async () => { + const fakeEntityRecord = { entity_record: true, asset: { criticality: 'low' } }; + + esClientMock.search.mockResolvedValue({ + ...emptySearchResponse, + hits: { + total: 1, + hits: [ + { + _index: '.entities.v1.latest.security_host_default', + _source: fakeEntityRecord, + }, + ], + }, + }); + + const response = await dataClient.searchEntities(defaultSearchParams); + + expect(response.records[0]).toEqual(fakeEntityRecord); + }); + + it("returns empty asset criticality when criticality value is 'deleted'", async () => { + const fakeEntityRecord = { entity_record: true }; + + esClientMock.search.mockResolvedValue({ + ...emptySearchResponse, + hits: { + total: 1, + hits: [ + { + _index: '.entities.v1.latest.security_host_default', + _source: { asset: { criticality: 'deleted' }, ...fakeEntityRecord }, + }, + ], + }, + }); + + const response = await dataClient.searchEntities(defaultSearchParams); + + expect(response.records[0]).toEqual(fakeEntityRecord); + }); + }); + + describe('getComponentFromEntityDefinition', () => { + it('returns installed false if no definition is provided', () => { + const result = dataClient.getComponentFromEntityDefinition('security_host_test', undefined); + expect(result).toEqual([ + { + id: 'security_host_test', + installed: false, + resource: 'entity_definition', + }, + ]); + }); + + it('returns correct components for EntityDefinitionWithState', () => { + const definitionWithState = { + ...definition, + state: { + installed: true, + running: true, + components: { + transforms: [ + { + id: 'transforms_id', + installed: true, + running: true, + }, + ], + ingestPipelines: [ + { + id: 'pipeline-1', + installed: true, + }, + ], + indexTemplates: [ + { + id: 'indexTemplates_id', + installed: true, + }, + ], + }, + }, + }; + + const result = dataClient.getComponentFromEntityDefinition( + 'security_host_test', + definitionWithState + ); + expect(result).toEqual([ + { + id: 'security_host_test', + installed: true, + resource: 'entity_definition', + }, + { + id: 'security_host_test', + resource: 'transform', + installed: true, + health: 'unknown', + errors: undefined, + }, + { + resource: 'ingest_pipeline', + id: 'pipeline-1', + installed: true, + }, + { + id: 'security_host_test', + installed: true, + resource: 'index_template', + }, + ]); + }); + + it('returns empty array for EntityDefinition without state', () => { + const result = dataClient.getComponentFromEntityDefinition('security_host_test', definition); + expect(result).toEqual([]); + }); + + it('handles transform health issues correctly', () => { + const definitionWithState = { + ...definition, + state: { + installed: true, + components: { + transforms: [ + { + installed: true, + stats: { + health: { + status: 'yellow', + issues: [ + { + type: 'issue-type', + issue: 'issue-message', + details: 'issue-details', + count: 1, + }, + ], + }, + }, + }, + ], + ingestPipelines: [], + indexTemplates: [], + }, + }, + }; + + const result = dataClient.getComponentFromEntityDefinition( + 'security_host_test', + definitionWithState + ); + expect(result).toEqual([ + { + id: 'security_host_test', + installed: true, + resource: 'entity_definition', + }, + { + id: 'security_host_test', + resource: 'transform', + installed: true, + health: 'yellow', + errors: [ + { + title: 'issue-message', + message: 'issue-details', + }, + ], + }, + ]); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.ts similarity index 98% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.ts index c18dc1863a8d1..faf2edc154192 100644 --- a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/entity_store_data_client.ts @@ -15,7 +15,7 @@ import type { AnalyticsServiceSetup, } from '@kbn/core/server'; import { EntityClient } from '@kbn/entityManager-plugin/server/lib/entity_client'; -import type { SortOrder } from '@elastic/elasticsearch/lib/api/types'; +import type { HealthStatus, SortOrder } from '@elastic/elasticsearch/lib/api/types'; import type { TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; import type { DataViewsService } from '@kbn/data-views-plugin/common'; import { isEqual } from 'lodash/fp'; @@ -465,7 +465,7 @@ export class EntityStoreDataClient { public getComponentFromEntityDefinition( id: string, - definition: EntityDefinitionWithState | EntityDefinition + definition: EntityDefinitionWithState | EntityDefinition | undefined ): EngineComponentStatus[] { if (!definition) { return [ @@ -478,16 +478,22 @@ export class EntityStoreDataClient { } if ('state' in definition) { + const transformHealthToComponentHealth = ( + health: HealthStatus | undefined + ): EngineComponentStatus['health'] => + health ? (health.toLowerCase() as Lowercase<HealthStatus>) : 'unknown'; + return [ { id: definition.id, installed: definition.state.installed, resource: EngineComponentResourceEnum.entity_definition, }, - ...definition.state.components.transforms.map(({ installed, running, stats }) => ({ + ...definition.state.components.transforms.map(({ installed, stats }) => ({ id, resource: EngineComponentResourceEnum.transform, installed, + health: transformHealthToComponentHealth(stats?.health?.status), errors: (stats?.health as TransformHealth)?.issues?.map(({ issue, details }) => ({ title: issue, message: details, diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/collect_values.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/collect_values.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/collect_values.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/collect_values.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/operator_to_ingest_processor.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/operator_to_ingest_processor.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/operator_to_ingest_processor.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/operator_to_ingest_processor.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/prefer_newest_value.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/prefer_newest_value.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/prefer_newest_value.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/prefer_newest_value.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/prefer_oldest_value.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/prefer_oldest_value.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/prefer_oldest_value.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/prefer_oldest_value.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/field_retention_definition/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/painless/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/painless/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/painless/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/painless/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/painless/is_field_missing_or_empty.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/painless/is_field_missing_or_empty.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/painless/is_field_missing_or_empty.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/painless/is_field_missing_or_empty.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/painless/path_utils.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/painless/path_utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/painless/path_utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/painless/path_utils.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/painless/path_utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/painless/path_utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/painless/path_utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/painless/path_utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/apply_dataview_indices.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/apply_dataview_indices.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/apply_dataview_indices.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/apply_dataview_indices.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/delete.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/delete.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/delete.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/delete.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/enablement.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/enablement.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/enablement.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/enablement.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/entities/list.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/entities/list.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/entities/list.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/entities/list.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/get.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/get.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/get.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/get.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/init.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/init.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/init.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/init.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/list.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/list.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/list.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/list.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/privileges.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/privileges.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/privileges.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/privileges.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/register_entity_store_routes.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/register_entity_store_routes.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/register_entity_store_routes.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/register_entity_store_routes.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/start.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/start.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/start.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/start.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/status.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/status.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/status.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/status.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/stop.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/stop.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/stop.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/stop.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/saved_object/engine_descriptor.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/saved_object/engine_descriptor.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/saved_object/engine_descriptor.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/saved_object/engine_descriptor.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/saved_object/engine_descriptor_type.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/saved_object/engine_descriptor_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/saved_object/engine_descriptor_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/saved_object/engine_descriptor_type.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/saved_object/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/saved_object/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/saved_object/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/saved_object/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/task/constants.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/task/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/task/constants.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/task/constants.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/task/field_retention_enrichment_task.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/task/field_retention_enrichment_task.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/task/field_retention_enrichment_task.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/task/field_retention_enrichment_task.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/task/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/task/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/task/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/task/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/task/state.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/task/state.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/task/state.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/task/state.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/constants.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/constants.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/constants.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/definition_utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/definition_utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/definition_utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/definition_utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/common.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/common.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/common.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/common.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/host.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/host.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/host.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/host.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/service.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/service.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/service.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/service.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/user.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/user.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/user.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/entity_types/user.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/get_united_definition.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/get_united_definition.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/get_united_definition.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/get_united_definition.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/get_united_definition.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/get_united_definition.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/get_united_definition.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/get_united_definition.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/united_entity_definition.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/united_entity_definition.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/united_entity_definition.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/united_entity_definitions/united_entity_definition.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/utils/entity_utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/utils/entity_utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/utils/entity_utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/utils/entity_utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/utils/get_entity_store_privileges.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/utils/get_entity_store_privileges.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/utils/get_entity_store_privileges.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/utils/get_entity_store_privileges.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/utils/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/utils/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/utils/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/entity_store/utils/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/migrations/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/migrations/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/migrations/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/migrations/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/register_entity_analytics_routes.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/register_entity_analytics_routes.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/register_entity_analytics_routes.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/register_entity_analytics_routes.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/audit.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/audit.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/audit.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/audit.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_data_client.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_data_client.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_data_client.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_data_client.mock.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_data_client.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_data_client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_data_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_data_client.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_data_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_data_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_data_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_data_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_privileges.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_privileges.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_privileges.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_privileges.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_privileges.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_privileges.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_privileges.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_privileges.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/configure_saved_object.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/configure_saved_object.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/configure_saved_object.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/configure_saved_object.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/configure_saved_object.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/configure_saved_object.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/configure_saved_object.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/configure_saved_object.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/delete.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/delete.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/delete.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/delete.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/delete.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/delete.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/delete.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/delete.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/disable.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/disable.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/disable.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/disable.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/disable.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/disable.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/disable.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/disable.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/enable.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/enable.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/enable.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/enable.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/enable.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/enable.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/enable.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/enable.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/init.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/init.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/init.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/init.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/privileges.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/privileges.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/privileges.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/privileges.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/register_risk_engine_routes.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/register_risk_engine_routes.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/register_risk_engine_routes.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/register_risk_engine_routes.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/risk_engine_privileges.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/risk_engine_privileges.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/risk_engine_privileges.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/risk_engine_privileges.mock.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/schedule_now.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/schedule_now.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/schedule_now.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/schedule_now.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/settings.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/settings.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/settings.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/settings.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/status.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/status.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/status.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/status.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/translations.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/translations.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/translations.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/translations.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/saved_object/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/saved_object/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/saved_object/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/saved_object/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/saved_object/risk_engine_configuration_type.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/saved_object/risk_engine_configuration_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/saved_object/risk_engine_configuration_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/saved_object/risk_engine_configuration_type.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/utils/saved_object_configuration.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/utils/saved_object_configuration.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/utils/saved_object_configuration.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_engine/utils/saved_object_configuration.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/audit.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/audit.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/audit.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/audit.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_and_persist_risk_scores.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_and_persist_risk_scores.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_and_persist_risk_scores.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_and_persist_risk_scores.mock.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_and_persist_risk_scores.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_and_persist_risk_scores.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_and_persist_risk_scores.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_and_persist_risk_scores.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_and_persist_risk_scores.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_and_persist_risk_scores.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_and_persist_risk_scores.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_and_persist_risk_scores.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_risk_scores.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_risk_scores.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_risk_scores.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_risk_scores.mock.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_risk_scores.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_risk_scores.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_risk_scores.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_risk_scores.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_risk_scores.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_risk_scores.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_risk_scores.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_risk_scores.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/configurations.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/configurations.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/configurations.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/configurations.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/configurations.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/configurations.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/configurations.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/configurations.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/constants.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/constants.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/constants.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/get_risk_inputs_index.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/get_risk_inputs_index.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/get_risk_inputs_index.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/get_risk_inputs_index.mock.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/get_risk_inputs_index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/get_risk_inputs_index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/get_risk_inputs_index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/get_risk_inputs_index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/get_risk_inputs_index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/get_risk_inputs_index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/get_risk_inputs_index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/get_risk_inputs_index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/helpers.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/helpers.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/index.test.ts new file mode 100644 index 0000000000000..5936f75339e30 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/index.test.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 { getPainlessScripts } from '.'; + +describe('getPainlessScripts', () => { + // to update snapshot run `yarn test:jest x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/index.test.ts -u` + test('Scripts should not have changed. If this change is intentional, ensure that Serverless scripted metric allowlists are updated', async () => { + const scripts = await getPainlessScripts(); + + expect(scripts).toMatchInlineSnapshot(` + Object { + "combine": "return state;", + "init": "state.inputs = []", + "map": "Map fields = new HashMap();fields.put('id', doc['kibana.alert.uuid'].value);fields.put('index', doc['_index'].value);fields.put('time', doc['@timestamp'].value);fields.put('rule_name', doc['kibana.alert.rule.name'].value);fields.put('category', doc['event.kind'].value);fields.put('score', doc['kibana.alert.risk_score'].value);state.inputs.add(fields); ", + "reduce": "Map results = new HashMap();results['notes'] = [];results['category_1_score'] = 0.0;results['category_1_count'] = 0;results['risk_inputs'] = [];results['score'] = 0.0;def inputs = states[0].inputs;Collections.sort(inputs, (a, b) -> b.get('score').compareTo(a.get('score')));for (int i = 0; i < inputs.length; i++) { double current_score = inputs[i].score / Math.pow(i + 1, params.p); if (i < 10) { inputs[i]['contribution'] = current_score / params.risk_cap; results['risk_inputs'].add(inputs[i]); } results['category_1_score'] += current_score; results['category_1_count'] += 1; results['score'] += current_score;}results['score'] *= params.global_identifier_type_weight;results['normalized_score'] = results['score'] / params.risk_cap;return results;", + } + `); + }); +}); diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/risk_scoring_combine.painless b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/risk_scoring_combine.painless similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/risk_scoring_combine.painless rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/risk_scoring_combine.painless diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/risk_scoring_init.painless b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/risk_scoring_init.painless similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/risk_scoring_init.painless rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/risk_scoring_init.painless diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/risk_scoring_map.painless b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/risk_scoring_map.painless similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/risk_scoring_map.painless rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/risk_scoring_map.painless diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/risk_scoring_reduce.painless b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/risk_scoring_reduce.painless similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/risk_scoring_reduce.painless rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/painless/risk_scoring_reduce.painless diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_engine_data_writer.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_engine_data_writer.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_engine_data_writer.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_engine_data_writer.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_engine_data_writer.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_engine_data_writer.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_engine_data_writer.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_engine_data_writer.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_score_data_client.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_score_data_client.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_score_data_client.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_score_data_client.mock.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_score_data_client.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_score_data_client.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_score_data_client.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_score_data_client.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_score_data_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_score_data_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_score_data_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_score_data_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_score_service.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_score_service.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_score_service.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_score_service.mock.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_score_service.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_score_service.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_score_service.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/risk_score_service.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/entity_calculation.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/entity_calculation.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/entity_calculation.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/entity_calculation.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/entity_calculation.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/entity_calculation.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/entity_calculation.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/entity_calculation.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/helpers.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/preview.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/preview.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/preview.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/preview.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/preview.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/preview.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/preview.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/preview.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/register_risk_score_routes.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/register_risk_score_routes.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/register_risk_score_routes.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/register_risk_score_routes.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/constants.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/constants.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/constants.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/helpers.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/helpers.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.mock.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/state.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/state.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/state.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/state.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/utils/assert_advanced_setting_enabled.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/utils/assert_advanced_setting_enabled.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/utils/assert_advanced_setting_enabled.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/utils/assert_advanced_setting_enabled.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/utils/check_and_format_privileges.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/utils/check_and_format_privileges.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/utils/check_and_format_privileges.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/utils/check_and_format_privileges.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/utils/check_and_format_privileges.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/utils/check_and_format_privileges.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/utils/check_and_format_privileges.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/utils/check_and_format_privileges.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/utils/create_datastream.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/utils/create_datastream.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/utils/create_datastream.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/utils/create_datastream.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/utils/create_or_update_index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/utils/create_or_update_index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/utils/create_or_update_index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/utils/create_or_update_index.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/utils/retry_transient_es_errors.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/utils/retry_transient_es_errors.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/utils/retry_transient_es_errors.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/utils/retry_transient_es_errors.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/utils/retry_transient_es_errors.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/utils/retry_transient_es_errors.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/utils/retry_transient_es_errors.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/utils/retry_transient_es_errors.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/utils/transforms.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/utils/transforms.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/utils/transforms.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/utils/transforms.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/utils/transforms.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/utils/transforms.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/entity_analytics/utils/transforms.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/entity_analytics/utils/transforms.ts diff --git a/x-pack/plugins/security_solution/server/lib/exceptions/api/manage_exceptions/route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/exceptions/api/manage_exceptions/route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/exceptions/api/manage_exceptions/route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/exceptions/api/manage_exceptions/route.ts diff --git a/x-pack/plugins/security_solution/server/lib/exceptions/api/register_routes.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/exceptions/api/register_routes.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/exceptions/api/register_routes.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/exceptions/api/register_routes.ts diff --git a/x-pack/plugins/security_solution/server/lib/framework/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/framework/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/framework/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/framework/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/framework/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/framework/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/framework/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/framework/types.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/lib/jest.config.js b/x-pack/solutions/security/plugins/security_solution/server/lib/jest.config.js new file mode 100644 index 0000000000000..e9dc836a6a47c --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/server/lib'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/server/lib', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/server/lib/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/server/lib/license/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/license/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/license/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/license/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/machine_learning/__mocks__/authz.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/__mocks__/authz.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/machine_learning/__mocks__/authz.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/__mocks__/authz.ts diff --git a/x-pack/plugins/security_solution/server/lib/machine_learning/__mocks__/validation.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/__mocks__/validation.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/machine_learning/__mocks__/validation.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/__mocks__/validation.ts diff --git a/x-pack/plugins/security_solution/server/lib/machine_learning/authz.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/authz.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/machine_learning/authz.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/authz.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/machine_learning/authz.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/authz.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/machine_learning/authz.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/authz.ts diff --git a/x-pack/plugins/security_solution/server/lib/machine_learning/cache.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/cache.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/machine_learning/cache.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/cache.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/machine_learning/cache.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/cache.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/machine_learning/cache.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/cache.ts diff --git a/x-pack/plugins/security_solution/server/lib/machine_learning/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/machine_learning/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/machine_learning/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/machine_learning/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/machine_learning/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/machine_learning/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/mocks.ts diff --git a/x-pack/plugins/security_solution/server/lib/machine_learning/validation.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/validation.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/machine_learning/validation.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/validation.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/machine_learning/validation.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/validation.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/machine_learning/validation.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/machine_learning/validation.ts diff --git a/x-pack/plugins/security_solution/server/lib/product_features_service/cases_privileges.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/cases_privileges.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/product_features_service/cases_privileges.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/cases_privileges.ts diff --git a/x-pack/plugins/security_solution/server/lib/product_features_service/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/product_features_service/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/product_features_service/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/product_features_service/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/mocks.ts diff --git a/x-pack/plugins/security_solution/server/lib/product_features_service/product_features.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/product_features.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/product_features_service/product_features.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/product_features.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/product_features_service/product_features.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/product_features.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/product_features_service/product_features.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/product_features.ts diff --git a/x-pack/plugins/security_solution/server/lib/product_features_service/product_features_config_merger.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/product_features_config_merger.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/product_features_service/product_features_config_merger.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/product_features_config_merger.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/product_features_service/product_features_config_merger.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/product_features_config_merger.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/product_features_service/product_features_config_merger.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/product_features_config_merger.ts diff --git a/x-pack/plugins/security_solution/server/lib/product_features_service/product_features_service.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/product_features_service.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/product_features_service/product_features_service.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/product_features_service.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/product_features_service/product_features_service.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/product_features_service.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/product_features_service/product_features_service.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/product_features_service.ts diff --git a/x-pack/plugins/security_solution/server/lib/product_features_service/security_saved_objects.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/security_saved_objects.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/product_features_service/security_saved_objects.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/security_saved_objects.ts diff --git a/x-pack/plugins/security_solution/server/lib/product_features_service/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/product_features_service/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/product_features_service/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/index_status/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/index_status/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/index_status/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/index_status/index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/index_status/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/index_status/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/index_status/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/index_status/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/indices/create_index_route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/indices/create_index_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/indices/create_index_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/indices/create_index_route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/indices/create_index_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/indices/create_index_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/indices/create_index_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/indices/create_index_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/indices/delete_indices_route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/indices/delete_indices_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/indices/delete_indices_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/indices/delete_indices_route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/indices/delete_indices_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/indices/delete_indices_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/indices/delete_indices_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/indices/delete_indices_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/indices/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/indices/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/indices/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/indices/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/indices/lib/create_index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/indices/lib/create_index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/indices/lib/create_index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/indices/lib/create_index.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/indices/lib/delete_indices.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/indices/lib/delete_indices.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/indices/lib/delete_indices.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/indices/lib/delete_indices.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/onboarding/helpers/ingest_pipeline.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/onboarding/helpers/ingest_pipeline.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/onboarding/helpers/ingest_pipeline.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/onboarding/helpers/ingest_pipeline.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/onboarding/helpers/install_risk_score_module.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/onboarding/helpers/install_risk_score_module.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/onboarding/helpers/install_risk_score_module.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/onboarding/helpers/install_risk_score_module.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/onboarding/routes/__snapshots__/install_risk_scores.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/onboarding/routes/__snapshots__/install_risk_scores.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/onboarding/routes/__snapshots__/install_risk_scores.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/onboarding/routes/__snapshots__/install_risk_scores.test.ts.snap diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/onboarding/routes/install_risk_scores.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/onboarding/routes/install_risk_scores.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/onboarding/routes/install_risk_scores.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/onboarding/routes/install_risk_scores.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/onboarding/routes/install_risk_scores.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/onboarding/routes/install_risk_scores.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/onboarding/routes/install_risk_scores.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/onboarding/routes/install_risk_scores.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/console_mappings.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/console_mappings.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/console_mappings.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/console_mappings.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/console_templates/enable_host_risk_score.mustache b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/console_templates/enable_host_risk_score.mustache similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/console_templates/enable_host_risk_score.mustache rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/console_templates/enable_host_risk_score.mustache diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/console_templates/enable_user_risk_score.mustache b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/console_templates/enable_user_risk_score.mustache similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/console_templates/enable_user_risk_score.mustache rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/console_templates/enable_user_risk_score.mustache diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/routes/__snapshots__/read_prebuilt_dev_tool_content_route.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/routes/__snapshots__/read_prebuilt_dev_tool_content_route.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/routes/__snapshots__/read_prebuilt_dev_tool_content_route.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/routes/__snapshots__/read_prebuilt_dev_tool_content_route.test.ts.snap diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/routes/read_prebuilt_dev_tool_content_route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/routes/read_prebuilt_dev_tool_content_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/routes/read_prebuilt_dev_tool_content_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/routes/read_prebuilt_dev_tool_content_route.test.ts 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/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/routes/read_prebuilt_dev_tool_content_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/routes/read_prebuilt_dev_tool_content_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/routes/read_prebuilt_dev_tool_content_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/schema.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/schema.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/schema.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/schema.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_dev_tool_content/utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/helpers/bulk_create_saved_objects.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/helpers/bulk_create_saved_objects.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/helpers/bulk_create_saved_objects.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/helpers/bulk_create_saved_objects.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/helpers/bulk_delete_saved_objects.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/helpers/bulk_delete_saved_objects.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/helpers/bulk_delete_saved_objects.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/helpers/bulk_delete_saved_objects.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/helpers/create_risk_score_tag.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/helpers/create_risk_score_tag.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/helpers/create_risk_score_tag.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/helpers/create_risk_score_tag.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/helpers/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/helpers/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/helpers/utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/helpers/utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/__snapshots__/create_prebuilt_saved_objects.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/__snapshots__/create_prebuilt_saved_objects.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/__snapshots__/create_prebuilt_saved_objects.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/__snapshots__/create_prebuilt_saved_objects.test.ts.snap diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/create_prebuilt_saved_objects.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/create_prebuilt_saved_objects.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/create_prebuilt_saved_objects.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/create_prebuilt_saved_objects.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/create_prebuilt_saved_objects.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/create_prebuilt_saved_objects.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/create_prebuilt_saved_objects.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/create_prebuilt_saved_objects.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/delete_prebuilt_saved_objects.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/delete_prebuilt_saved_objects.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/delete_prebuilt_saved_objects.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/delete_prebuilt_saved_objects.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/delete_prebuilt_saved_objects.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/delete_prebuilt_saved_objects.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/delete_prebuilt_saved_objects.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/routes/delete_prebuilt_saved_objects.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/user_risk_score_dashboards.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/readme.md b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/readme.md similarity index 99% rename from x-pack/plugins/security_solution/server/lib/risk_score/readme.md rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/readme.md index 17087d447e630..98768753bd9e3 100644 --- a/x-pack/plugins/security_solution/server/lib/risk_score/readme.md +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/readme.md @@ -4,7 +4,7 @@ |-------|------|-------|----------------|----------|----|----| |8.3`deprecated`|host|1.ml_hostriskscore_levels_script_{spacename} 2.ml_hostriskscore_map_script_{spacename} 3.ml_hostriskscore_reduce_script_{spacename} 4.ml_hostriskscore_init_script_{spacename}|ml_hostriskscore_ingest_pipeline_{spacename}|1.ml_hostriskscore_pivot_transform_{spacename} Destination Index: `ml_host_risk_score_{spacename}` 2.ml_hostriskscore_latest_transform_{spacename} Destination Index: `ml_host_risk_score_latest_{spacename}`| Yes|https://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/host-risk-score.md| |8.3`deprecated`|user|1.ml_userriskscore_levels_script_{spacename} 2.ml_userriskscore_map_script_{spacename} 3.ml_userriskscore_reduce_script_{spacename}|ml_userriskscore_ingest_pipeline_{spacename}|1.ml_userriskscore_pivot_transform_{spacename} Destination index: `ml_user_risk_score_{spacename}` 2.ml_userriskscore_latest_transform_{spacename} Destination index: `ml_user_risk_score_latest_{spacename}`|Yes|https://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/user-risk-score.md| -|8.4`deprecated`|host|1.ml_hostriskscore_levels_script 2.ml_hostriskscore_map_script 3.ml_hostriskscore_reduce_script 4.ml_hostriskscore_init_script|ml_hostriskscore_ingest_pipeline|1.ml_hostriskscore_pivot_transform_{spacename} Destination Index: `ml_host_risk_score_{spacename}` 2.ml_hostriskscore_latest_transform_{spacename} Destination Index: `ml_host_risk_score_latest_{spacename}`|Yes|Installation via dev tools releasesd. https://github.com/elastic/kibana/blob/8.4/x-pack/plugins/security_solution/server/lib/prebuilt_dev_tool_content/console_templates/enable_host_risk_score.console| +|8.4`deprecated`|host|1.ml_hostriskscore_levels_script 2.ml_hostriskscore_map_script 3.ml_hostriskscore_reduce_script 4.ml_hostriskscore_init_script|ml_hostriskscore_ingest_pipeline|1.ml_hostriskscore_pivot_transform_{spacename} Destination Index: `ml_host_risk_score_{spacename}` 2.ml_hostriskscore_latest_transform_{spacename} Destination Index: `ml_host_risk_score_latest_{spacename}`|Yes|Installation via dev tools releasesd. https://github.com/elastic/kibana/blob/8.4/x-pack/solutions/security/plugins/security_solution/server/lib/prebuilt_dev_tool_content/console_templates/enable_host_risk_score.console| |8.4`deprecated`|user|1.ml_userriskscore_levels_script_{spacename} 2.ml_userriskscore_map_script_{spacename} 3.ml_userriskscore_reduce_script_{spacename}|ml_userriskscore_ingest_pipeline_{spacename}|1.ml_userriskscore_pivot_transform_{spacename} Destination index: `ml_user_risk_score_{spacename}` 2.ml_userriskscore_latest_transform_{spacename} Destination index: `ml_user_risk_score_latest_{spacename}`|Yes|Installation via dev tools not available yet (Installation via dev tools is availble in 8.5). |8.5+|host|1.ml_hostriskscore_levels_script_{spacename} 2.ml_hostriskscore_map_script_{spacename} 3.ml_hostriskscore_reduce_script_{spacename} 4.ml_hostriskscore_init_script_{spacename}|ml_hostriskscore_ingest_pipeline_{spacename}|1.ml_hostriskscore_pivot_transform_{spacename} Destination Index: `ml_host_risk_score_{spacename}` 2.ml_hostriskscore_latest_transform_{spacename} Destination Index: `ml_host_risk_score_latest_{spacename}`| No|`Breaking Chang`: New schema for Destination indices| |8.5+|user|1.ml_userriskscore_levels_script_{spacename} 2.ml_userriskscore_map_script_{spacename} 3.ml_userriskscore_reduce_script_{spacename}|ml_userriskscore_ingest_pipeline_{spacename}|1.ml_userriskscore_pivot_transform_{spacename} Destination index: `ml_user_risk_score_{spacename}` 2.ml_userriskscore_latest_transform_{spacename} Destination index: `ml_user_risk_score_latest_{spacename}`|No|`Breaking Chang`: New schema for Destination indices| diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/routes/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/routes/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/routes/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/routes/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/create_script_route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/stored_scripts/create_script_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/create_script_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/stored_scripts/create_script_route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/create_script_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/stored_scripts/create_script_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/create_script_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/stored_scripts/create_script_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/delete_script_route.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/stored_scripts/delete_script_route.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/delete_script_route.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/stored_scripts/delete_script_route.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/delete_script_route.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/stored_scripts/delete_script_route.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/delete_script_route.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/stored_scripts/delete_script_route.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/lib/create_script.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/stored_scripts/lib/create_script.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/lib/create_script.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/stored_scripts/lib/create_script.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/lib/delete_script.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/stored_scripts/lib/delete_script.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/stored_scripts/lib/delete_script.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/stored_scripts/lib/delete_script.ts diff --git a/x-pack/plugins/security_solution/server/lib/risk_score/transform/helpers/transforms.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/transform/helpers/transforms.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/risk_score/transform/helpers/transforms.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/risk_score/transform/helpers/transforms.ts diff --git a/x-pack/plugins/security_solution/server/lib/security_integrations/cribl/routes/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/security_integrations/cribl/routes/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/security_integrations/cribl/routes/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/security_integrations/cribl/routes/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/security_integrations/cribl/util/pipeline_builder.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/security_integrations/cribl/util/pipeline_builder.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/security_integrations/cribl/util/pipeline_builder.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/security_integrations/cribl/util/pipeline_builder.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/security_integrations/cribl/util/pipeline_builder.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/security_integrations/cribl/util/pipeline_builder.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/security_integrations/cribl/util/pipeline_builder.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/security_integrations/cribl/util/pipeline_builder.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/__mocks__/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/__mocks__/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/__mocks__/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/__mocks__/mocks.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/__mocks__/siem_migrations_service.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/__mocks__/siem_migrations_service.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/__mocks__/siem_migrations_service.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/__mocks__/siem_migrations_service.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/routes.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/routes.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/routes.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/routes.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/__mocks__/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/__mocks__/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/__mocks__/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/__mocks__/mocks.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/__mocks__/siem_rule_migrations_service.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/__mocks__/siem_rule_migrations_service.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/__mocks__/siem_rule_migrations_service.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/__mocks__/siem_rule_migrations_service.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/constants.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/constants.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/constants.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/create.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/create.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/create.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/create.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/get.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/get.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/get.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/get.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/get_prebuilt_rules.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/get_prebuilt_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/get_prebuilt_rules.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/get_prebuilt_rules.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/install.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/install.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/install.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/install.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/install_translated.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/install_translated.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/install_translated.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/install_translated.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/get.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/get.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/get.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/get.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/missing.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/missing.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/missing.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/missing.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/upsert.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/upsert.ts similarity index 97% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/upsert.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/upsert.ts index 9557c5cfd652f..fde332aefbd3f 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/upsert.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/upsert.ts @@ -27,6 +27,7 @@ export const registerSiemRuleMigrationsResourceUpsertRoute = ( path: SIEM_RULE_MIGRATION_RESOURCES_PATH, access: 'internal', security: { authz: { requiredPrivileges: ['securitySolution'] } }, + options: { body: { maxBytes: 26214400 } }, // rise payload limit to 25MB }) .addVersion( { diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/retry.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/retry.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/retry.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/retry.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/start.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/start.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/start.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/start.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/stats.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/stats.ts similarity index 95% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/stats.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/stats.ts index 5fb7d9e0525c1..4657f2516181c 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/stats.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/stats.ts @@ -41,6 +41,9 @@ export const registerSiemRuleMigrationsStatsRoute = ( const stats = await ruleMigrationsClient.task.getStats(migrationId); + if (stats.rules.total === 0) { + return res.noContent(); + } return res.ok({ body: stats }); } catch (err) { logger.error(err); diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/stats_all.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/stats_all.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/stats_all.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/stats_all.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/stop.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/stop.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/stop.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/stop.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/translation_stats.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/translation_stats.ts similarity index 95% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/translation_stats.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/translation_stats.ts index 4f9d12385e32d..ede4ccbeaa6d7 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/translation_stats.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/translation_stats.ts @@ -45,6 +45,9 @@ export const registerSiemRuleMigrationsTranslationStatsRoute = ( const stats = await ruleMigrationsClient.data.rules.getTranslationStats(migrationId); + if (stats.rules.total === 0) { + return res.noContent(); + } return res.ok({ body: stats }); } catch (err) { logger.error(err); diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/update.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/update.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/update.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/update.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/util/installation.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/util/installation.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/util/installation.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/util/installation.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/util/prebuilt_rules.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/util/prebuilt_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/util/prebuilt_rules.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/util/prebuilt_rules.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/util/with_license.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/util/with_license.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/util/with_license.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/api/util/with_license.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/mocks.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/rule_migrations_data_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/rule_migrations_data_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/rule_migrations_data_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/rule_migrations_data_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/rule_migrations_data_resources_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/rule_migrations_data_resources_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/rule_migrations_data_resources_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/rule_migrations_data_resources_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/rule_migrations_data_rules_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/rule_migrations_data_rules_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/rule_migrations_data_rules_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/rule_migrations_data_rules_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/rule_migrations_data_service.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/rule_migrations_data_service.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/rule_migrations_data_service.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/rule_migrations_data_service.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/integrations_temp.json b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/integrations_temp.json similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/integrations_temp.json rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/integrations_temp.json diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_base_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_base_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_base_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_base_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_integrations_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_integrations_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_integrations_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_integrations_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_prebuilt_rules_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_prebuilt_rules_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_prebuilt_rules_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_prebuilt_rules_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_resources_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_resources_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_resources_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_resources_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_rules_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_rules_client.ts similarity index 80% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_rules_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_rules_client.ts index b483b3bdd4fbb..47bcd56e6433e 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_rules_client.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_rules_client.ts @@ -16,7 +16,10 @@ import type { Duration, } from '@elastic/elasticsearch/lib/api/types'; import type { StoredRuleMigration } from '../types'; -import { SiemMigrationStatus } from '../../../../../common/siem_migrations/constants'; +import { + SiemMigrationStatus, + RuleTranslationResult, +} from '../../../../../common/siem_migrations/constants'; import { type RuleMigration, type RuleMigrationTaskStats, @@ -128,19 +131,14 @@ export class RuleMigrationsDataRulesClient extends RuleMigrationsDataBaseClient /** Retrieves an array of rule documents of a specific migrations */ async get( migrationId: string, - { filters = {}, sort = {}, from, size }: RuleMigrationGetOptions = {} + { filters = {}, sort: sortParam = {}, from, size }: RuleMigrationGetOptions = {} ): Promise<{ total: number; data: StoredRuleMigration[] }> { const index = await this.getIndexName(); const query = this.getFilterQuery(migrationId, filters); + const sort = sortParam.sortField ? getSortingOptions(sortParam) : undefined; const result = await this.esClient - .search<RuleMigration>({ - index, - query, - sort: sort.sortField ? getSortingOptions(sort) : undefined, - from, - size, - }) + .search<RuleMigration>({ index, query, sort, from, size }) .catch((error) => { this.logger.error(`Error searching rule migrations: ${error.message}`); throw error; @@ -268,8 +266,15 @@ export class RuleMigrationsDataRulesClient extends RuleMigrationsDataBaseClient const query = this.getFilterQuery(migrationId); const aggregations = { - prebuilt: { filter: searchConditions.isPrebuilt() }, - installable: { filter: { bool: { must: searchConditions.isInstallable() } } }, + success: { + filter: { term: { status: SiemMigrationStatus.COMPLETED } }, + aggs: { + result: { terms: { field: 'translation_result' } }, + installable: { filter: { bool: { must: searchConditions.isInstallable() } } }, + prebuilt: { filter: searchConditions.isPrebuilt() }, + }, + }, + failed: { filter: { term: { status: SiemMigrationStatus.FAILED } } }, }; const result = await this.esClient .search({ index, query, aggregations, _source: false }) @@ -278,16 +283,22 @@ export class RuleMigrationsDataRulesClient extends RuleMigrationsDataBaseClient throw error; }); - const bucket = result.aggregations ?? {}; + const aggs = result.aggregations ?? {}; const total = this.getTotalHits(result); - const prebuilt = (bucket.prebuilt as AggregationsFilterAggregate)?.doc_count ?? 0; + const successAgg = aggs.success as AggregationsFilterAggregate; + const translationResultsAgg = successAgg.result as AggregationsStringTermsAggregate; + return { id: migrationId, rules: { total, - prebuilt, - custom: total - prebuilt, - installable: (bucket.installable as AggregationsFilterAggregate)?.doc_count ?? 0, + success: { + total: (successAgg as AggregationsFilterAggregate)?.doc_count ?? 0, + result: this.translationResultAggCount(translationResultsAgg), + installable: (successAgg.installable as AggregationsFilterAggregate)?.doc_count ?? 0, + prebuilt: (successAgg.prebuilt as AggregationsFilterAggregate)?.doc_count ?? 0, + }, + failed: (aggs.failed as AggregationsFilterAggregate)?.doc_count ?? 0, }, }; } @@ -297,10 +308,7 @@ export class RuleMigrationsDataRulesClient extends RuleMigrationsDataBaseClient const index = await this.getIndexName(); const query = this.getFilterQuery(migrationId); const aggregations = { - pending: { filter: { term: { status: SiemMigrationStatus.PENDING } } }, - processing: { filter: { term: { status: SiemMigrationStatus.PROCESSING } } }, - completed: { filter: { term: { status: SiemMigrationStatus.COMPLETED } } }, - failed: { filter: { term: { status: SiemMigrationStatus.FAILED } } }, + status: { terms: { field: 'status' } }, createdAt: { min: { field: '@timestamp' } }, lastUpdatedAt: { max: { field: 'updated_at' } }, }; @@ -311,18 +319,16 @@ export class RuleMigrationsDataRulesClient extends RuleMigrationsDataBaseClient throw error; }); - const bucket = result.aggregations ?? {}; + const aggs = result.aggregations ?? {}; + return { id: migrationId, rules: { total: this.getTotalHits(result), - pending: (bucket.pending as AggregationsFilterAggregate)?.doc_count ?? 0, - processing: (bucket.processing as AggregationsFilterAggregate)?.doc_count ?? 0, - completed: (bucket.completed as AggregationsFilterAggregate)?.doc_count ?? 0, - failed: (bucket.failed as AggregationsFilterAggregate)?.doc_count ?? 0, + ...this.statusAggCounts(aggs.status as AggregationsStringTermsAggregate), }, - created_at: (bucket.createdAt as AggregationsMinAggregate)?.value_as_string ?? '', - last_updated_at: (bucket.lastUpdatedAt as AggregationsMaxAggregate)?.value_as_string ?? '', + created_at: (aggs.createdAt as AggregationsMinAggregate)?.value_as_string ?? '', + last_updated_at: (aggs.lastUpdatedAt as AggregationsMaxAggregate)?.value_as_string ?? '', }; } @@ -331,12 +337,9 @@ export class RuleMigrationsDataRulesClient extends RuleMigrationsDataBaseClient const index = await this.getIndexName(); const aggregations: { migrationIds: AggregationsAggregationContainer } = { migrationIds: { - terms: { field: 'migration_id', order: { createdAt: 'asc' } }, + terms: { field: 'migration_id', order: { createdAt: 'asc' }, size: 10000 }, aggregations: { - pending: { filter: { term: { status: SiemMigrationStatus.PENDING } } }, - processing: { filter: { term: { status: SiemMigrationStatus.PROCESSING } } }, - completed: { filter: { term: { status: SiemMigrationStatus.COMPLETED } } }, - failed: { filter: { term: { status: SiemMigrationStatus.FAILED } } }, + status: { terms: { field: 'status' } }, createdAt: { min: { field: '@timestamp' } }, lastUpdatedAt: { max: { field: 'updated_at' } }, }, @@ -355,16 +358,43 @@ export class RuleMigrationsDataRulesClient extends RuleMigrationsDataBaseClient id: bucket.key, rules: { total: bucket.doc_count, - pending: bucket.pending?.doc_count ?? 0, - processing: bucket.processing?.doc_count ?? 0, - completed: bucket.completed?.doc_count ?? 0, - failed: bucket.failed?.doc_count ?? 0, + ...this.statusAggCounts(bucket.status), }, created_at: bucket.createdAt?.value_as_string, last_updated_at: bucket.lastUpdatedAt?.value_as_string, })); } + private statusAggCounts( + statusAgg: AggregationsStringTermsAggregate + ): Record<SiemMigrationStatus, number> { + const buckets = statusAgg.buckets as AggregationsStringTermsBucket[]; + return { + [SiemMigrationStatus.PENDING]: + buckets.find(({ key }) => key === SiemMigrationStatus.PENDING)?.doc_count ?? 0, + [SiemMigrationStatus.PROCESSING]: + buckets.find(({ key }) => key === SiemMigrationStatus.PROCESSING)?.doc_count ?? 0, + [SiemMigrationStatus.COMPLETED]: + buckets.find(({ key }) => key === SiemMigrationStatus.COMPLETED)?.doc_count ?? 0, + [SiemMigrationStatus.FAILED]: + buckets.find(({ key }) => key === SiemMigrationStatus.FAILED)?.doc_count ?? 0, + }; + } + + private translationResultAggCount( + resultAgg: AggregationsStringTermsAggregate + ): Record<RuleTranslationResult, number> { + const buckets = resultAgg.buckets as AggregationsStringTermsBucket[]; + return { + [RuleTranslationResult.FULL]: + buckets.find(({ key }) => key === RuleTranslationResult.FULL)?.doc_count ?? 0, + [RuleTranslationResult.PARTIAL]: + buckets.find(({ key }) => key === RuleTranslationResult.PARTIAL)?.doc_count ?? 0, + [RuleTranslationResult.UNTRANSLATABLE]: + buckets.find(({ key }) => key === RuleTranslationResult.UNTRANSLATABLE)?.doc_count ?? 0, + }; + } + private getFilterQuery( migrationId: string, { status, ids, installable, prebuilt, searchTerm }: RuleMigrationFilters = {} diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_service.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_service.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_service.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_service.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_service.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_service.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_service.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_service.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_field_maps.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_field_maps.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_field_maps.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_field_maps.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/search.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/search.ts similarity index 85% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/search.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/search.ts index 282f783671fdc..3bd8da066a45f 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/search.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/search.ts @@ -6,11 +6,11 @@ */ import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; -import { SiemMigrationRuleTranslationResult } from '../../../../../common/siem_migrations/constants'; +import { RuleTranslationResult } from '../../../../../common/siem_migrations/constants'; export const conditions = { isFullyTranslated(): QueryDslQueryContainer { - return { term: { translation_result: SiemMigrationRuleTranslationResult.FULL } }; + return { term: { translation_result: RuleTranslationResult.FULL } }; }, isNotInstalled(): QueryDslQueryContainer { return { diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/sort.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/sort.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/sort.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/sort.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/data/utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/siem_rule_migrations_service.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/siem_rule_migrations_service.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/siem_rule_migrations_service.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/siem_rule_migrations_service.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/siem_rule_migrations_service.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/siem_rule_migrations_service.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/siem_rule_migrations_service.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/siem_rule_migrations_service.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/__mocks__/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/__mocks__/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/__mocks__/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/__mocks__/mocks.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/__mocks__/rule_migrations_task_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/__mocks__/rule_migrations_task_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/__mocks__/rule_migrations_task_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/__mocks__/rule_migrations_task_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/__mocks__/rule_migrations_task_service.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/__mocks__/rule_migrations_task_service.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/__mocks__/rule_migrations_task_service.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/__mocks__/rule_migrations_task_service.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/graph.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/graph.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/graph.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/graph.test.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/graph.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/graph.ts new file mode 100644 index 0000000000000..b1165ce982293 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/graph.ts @@ -0,0 +1,69 @@ +/* + * 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 { END, START, StateGraph } from '@langchain/langgraph'; +import { RuleTranslationResult } from '../../../../../../common/siem_migrations/constants'; +import { getCreateSemanticQueryNode } from './nodes/create_semantic_query'; +import { getMatchPrebuiltRuleNode } from './nodes/match_prebuilt_rule'; +import { getProcessQueryNode } from './nodes/process_query'; + +import { migrateRuleState } from './state'; +import { getTranslateRuleGraph } from './sub_graphs/translate_rule'; +import type { MigrateRuleGraphParams, MigrateRuleState } from './types'; + +export function getRuleMigrationAgent({ + model, + inferenceClient, + ruleMigrationsRetriever, + connectorId, + logger, +}: MigrateRuleGraphParams) { + const matchPrebuiltRuleNode = getMatchPrebuiltRuleNode({ + model, + logger, + ruleMigrationsRetriever, + }); + const translationSubGraph = getTranslateRuleGraph({ + model, + inferenceClient, + ruleMigrationsRetriever, + connectorId, + logger, + }); + const createSemanticQueryNode = getCreateSemanticQueryNode({ model }); + const processQueryNode = getProcessQueryNode({ model, ruleMigrationsRetriever }); + + const siemMigrationAgentGraph = new StateGraph(migrateRuleState) + // Nodes + .addNode('processQuery', processQueryNode) + .addNode('createSemanticQuery', createSemanticQueryNode) + .addNode('matchPrebuiltRule', matchPrebuiltRuleNode) + .addNode('translationSubGraph', translationSubGraph) + // Edges + .addEdge(START, 'createSemanticQuery') + .addEdge('createSemanticQuery', 'matchPrebuiltRule') + .addConditionalEdges('matchPrebuiltRule', matchedPrebuiltRuleConditional, ['processQuery', END]) + .addEdge('processQuery', 'translationSubGraph') + .addEdge('translationSubGraph', END); + + const graph = siemMigrationAgentGraph.compile(); + graph.name = 'Rule Migration Graph'; // Customizes the name displayed in LangSmith + return graph; +} + +/* + * If the original splunk rule has no prebuilt rule match, we will start processing the query, unless it is related to input/outputlookups. + */ +const matchedPrebuiltRuleConditional = (state: MigrateRuleState) => { + if (state.elastic_rule?.prebuilt_rule_id) { + return END; + } + if (state.translation_result === RuleTranslationResult.UNTRANSLATABLE) { + return END; + } + return 'processQuery'; +}; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/create_semantic_query/create_semantic_query.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/create_semantic_query/create_semantic_query.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/create_semantic_query/create_semantic_query.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/create_semantic_query/create_semantic_query.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/create_semantic_query/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/create_semantic_query/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/create_semantic_query/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/create_semantic_query/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/create_semantic_query/prompts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/create_semantic_query/prompts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/create_semantic_query/prompts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/create_semantic_query/prompts.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/match_prebuilt_rule.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/match_prebuilt_rule.ts similarity index 91% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/match_prebuilt_rule.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/match_prebuilt_rule.ts index e4b2162249cae..d7537fdc72dd0 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/match_prebuilt_rule.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/match_prebuilt_rule.ts @@ -7,7 +7,7 @@ import type { Logger } from '@kbn/core/server'; import { JsonOutputParser } from '@langchain/core/output_parsers'; -import { SiemMigrationRuleTranslationResult } from '../../../../../../../../common/siem_migrations/constants'; +import { RuleTranslationResult } from '../../../../../../../../common/siem_migrations/constants'; import type { RuleMigrationsRetriever } from '../../../retrievers'; import type { ChatModel } from '../../../util/actions_client_chat'; import type { GraphNode } from '../../types'; @@ -68,7 +68,7 @@ export const getMatchPrebuiltRuleNode = ({ id: matchedRule.installedRuleId, prebuilt_rule_id: matchedRule.rule_id, }, - translation_result: SiemMigrationRuleTranslationResult.FULL, + translation_result: RuleTranslationResult.FULL, }; } } @@ -80,7 +80,7 @@ export const getMatchPrebuiltRuleNode = ({ logger.debug( `Rule: ${state.original_rule?.title} did not match any prebuilt rule, but contains inputlookup, dropping` ); - return { translation_result: SiemMigrationRuleTranslationResult.UNTRANSLATABLE }; + return { translation_result: RuleTranslationResult.UNTRANSLATABLE }; } return {}; }; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/prompts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/prompts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/prompts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/prompts.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/process_query/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/process_query/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/process_query/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/process_query/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/process_query/process_query.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/process_query/process_query.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/process_query/process_query.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/process_query/process_query.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/process_query/prompts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/process_query/prompts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/process_query/prompts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/process_query/prompts.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/state.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/state.ts new file mode 100644 index 0000000000000..66b3c0c8e7a71 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/state.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 type { BaseMessage } from '@langchain/core/messages'; +import { Annotation, messagesStateReducer } from '@langchain/langgraph'; +import type { RuleTranslationResult } from '../../../../../../common/siem_migrations/constants'; +import type { + ElasticRule, + OriginalRule, + RuleMigration, +} from '../../../../../../common/siem_migrations/model/rule_migration.gen'; + +export const migrateRuleState = Annotation.Root({ + messages: Annotation<BaseMessage[]>({ + reducer: messagesStateReducer, + default: () => [], + }), + original_rule: Annotation<OriginalRule>(), + elastic_rule: Annotation<ElasticRule>({ + reducer: (state, action) => ({ ...state, ...action }), + }), + semantic_query: Annotation<string>({ + reducer: (current, value) => value ?? current, + default: () => '', + }), + inline_query: Annotation<string>({ + reducer: (current, value) => value ?? current, + default: () => '', + }), + translation_result: Annotation<RuleTranslationResult>(), + comments: Annotation<RuleMigration['comments']>({ + reducer: (current, value) => (value ? (current ?? []).concat(value) : current), + default: () => [], + }), + response: Annotation<string>(), +}); diff --git a/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/graph.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/graph.ts new file mode 100644 index 0000000000000..99d7d1439d63e --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/graph.ts @@ -0,0 +1,80 @@ +/* + * 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 { END, START, StateGraph } from '@langchain/langgraph'; +import { isEmpty } from 'lodash/fp'; +import { RuleTranslationResult } from '../../../../../../../../common/siem_migrations/constants'; +import { getEcsMappingNode } from './nodes/ecs_mapping'; +import { getFilterIndexPatternsNode } from './nodes/filter_index_patterns'; +import { getFixQueryErrorsNode } from './nodes/fix_query_errors'; +import { getRetrieveIntegrationsNode } from './nodes/retrieve_integrations'; +import { getTranslateRuleNode } from './nodes/translate_rule'; +import { getValidationNode } from './nodes/validation'; +import { translateRuleState } from './state'; +import type { TranslateRuleGraphParams, TranslateRuleState } from './types'; + +// How many times we will try to self-heal when validation fails, to prevent infinite graph recursions +const MAX_VALIDATION_ITERATIONS = 3; + +export function getTranslateRuleGraph({ + model, + inferenceClient, + connectorId, + ruleMigrationsRetriever, + logger, +}: TranslateRuleGraphParams) { + const translateRuleNode = getTranslateRuleNode({ + inferenceClient, + connectorId, + logger, + }); + const validationNode = getValidationNode({ logger }); + const fixQueryErrorsNode = getFixQueryErrorsNode({ inferenceClient, connectorId, logger }); + const retrieveIntegrationsNode = getRetrieveIntegrationsNode({ model, ruleMigrationsRetriever }); + const ecsMappingNode = getEcsMappingNode({ inferenceClient, connectorId, logger }); + const filterIndexPatternsNode = getFilterIndexPatternsNode({ logger }); + + const translateRuleGraph = new StateGraph(translateRuleState) + // Nodes + .addNode('translateRule', translateRuleNode) + .addNode('validation', validationNode) + .addNode('fixQueryErrors', fixQueryErrorsNode) + .addNode('retrieveIntegrations', retrieveIntegrationsNode) + .addNode('ecsMapping', ecsMappingNode) + .addNode('filterIndexPatterns', filterIndexPatternsNode) + // Edges + .addEdge(START, 'retrieveIntegrations') + .addEdge('retrieveIntegrations', 'translateRule') + .addEdge('translateRule', 'validation') + .addEdge('fixQueryErrors', 'validation') + .addEdge('ecsMapping', 'validation') + .addConditionalEdges('validation', validationRouter, [ + 'fixQueryErrors', + 'ecsMapping', + 'filterIndexPatterns', + ]) + .addEdge('filterIndexPatterns', END); + + const graph = translateRuleGraph.compile(); + graph.name = 'Translate Rule Graph'; + return graph; +} + +const validationRouter = (state: TranslateRuleState) => { + if ( + state.validation_errors.iterations <= MAX_VALIDATION_ITERATIONS && + state.translation_result === RuleTranslationResult.FULL + ) { + if (!isEmpty(state.validation_errors?.esql_errors)) { + return 'fixQueryErrors'; + } + if (!state.translation_finalized) { + return 'ecsMapping'; + } + } + return 'filterIndexPatterns'; +}; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/cim_ecs_map.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/cim_ecs_map.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/cim_ecs_map.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/cim_ecs_map.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/ecs_mapping.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/ecs_mapping.ts similarity index 86% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/ecs_mapping.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/ecs_mapping.ts index 6acc45a95d17b..07753432e5dbc 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/ecs_mapping.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/ecs_mapping.ts @@ -7,7 +7,7 @@ import type { Logger } from '@kbn/core/server'; import type { InferenceClient } from '@kbn/inference-plugin/server'; -import { SiemMigrationRuleTranslationResult } from '../../../../../../../../../../common/siem_migrations/constants'; +import { RuleTranslationResult } from '../../../../../../../../../../common/siem_migrations/constants'; import { getEsqlKnowledgeBase } from '../../../../../util/esql_knowledge_base_caller'; import type { GraphNode } from '../../types'; import { SIEM_RULE_MIGRATION_CIM_ECS_MAP } from './cim_ecs_map'; @@ -58,9 +58,9 @@ export const getEcsMappingNode = ({ }; }; -const getTranslationResult = (esqlQuery: string): SiemMigrationRuleTranslationResult => { +const getTranslationResult = (esqlQuery: string): RuleTranslationResult => { if (esqlQuery.match(/\[(macro):[\s\S]*\]/)) { - return SiemMigrationRuleTranslationResult.PARTIAL; + return RuleTranslationResult.PARTIAL; } - return SiemMigrationRuleTranslationResult.FULL; + return RuleTranslationResult.FULL; }; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/prompts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/prompts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/prompts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/prompts.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/filter_index_patterns/filter_index_patterns.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/filter_index_patterns/filter_index_patterns.ts similarity index 85% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/filter_index_patterns/filter_index_patterns.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/filter_index_patterns/filter_index_patterns.ts index bb1e086bf4937..b7cbcabff2ca2 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/filter_index_patterns/filter_index_patterns.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/filter_index_patterns/filter_index_patterns.ts @@ -6,7 +6,7 @@ */ import type { Logger } from '@kbn/core/server'; -import { SiemMigrationRuleTranslationResult } from '../../../../../../../../../../common/siem_migrations/constants'; +import { RuleTranslationResult } from '../../../../../../../../../../common/siem_migrations/constants'; import type { GraphNode } from '../../types'; interface GetFilterIndexPatternsNodeParams { @@ -30,7 +30,7 @@ export const getFilterIndexPatternsNode = ({ elastic_rule: { ...state.elastic_rule, query: newQuery, - translation_result: SiemMigrationRuleTranslationResult.PARTIAL, + translation_result: RuleTranslationResult.PARTIAL, }, }; } diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/filter_index_patterns/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/filter_index_patterns/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/filter_index_patterns/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/filter_index_patterns/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/fix_query_errors/fix_query_errors.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/fix_query_errors/fix_query_errors.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/fix_query_errors/fix_query_errors.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/fix_query_errors/fix_query_errors.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/fix_query_errors/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/fix_query_errors/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/fix_query_errors/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/fix_query_errors/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/fix_query_errors/prompts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/fix_query_errors/prompts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/fix_query_errors/prompts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/fix_query_errors/prompts.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/retrieve_integrations/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/retrieve_integrations/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/retrieve_integrations/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/retrieve_integrations/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/retrieve_integrations/prompts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/retrieve_integrations/prompts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/retrieve_integrations/prompts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/retrieve_integrations/prompts.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/retrieve_integrations/retrieve_integrations.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/retrieve_integrations/retrieve_integrations.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/retrieve_integrations/retrieve_integrations.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/retrieve_integrations/retrieve_integrations.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/cim_ecs_map.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/cim_ecs_map.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/cim_ecs_map.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/cim_ecs_map.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/prompts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/prompts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/prompts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/prompts.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/translate_rule.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/translate_rule.ts similarity index 87% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/translate_rule.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/translate_rule.ts index d613da223038c..346df02714b67 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/translate_rule.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/translate_rule.ts @@ -7,7 +7,7 @@ import type { Logger } from '@kbn/core/server'; import type { InferenceClient } from '@kbn/inference-plugin/server'; -import { SiemMigrationRuleTranslationResult } from '../../../../../../../../../../common/siem_migrations/constants'; +import { RuleTranslationResult } from '../../../../../../../../../../common/siem_migrations/constants'; import { getEsqlKnowledgeBase } from '../../../../../util/esql_knowledge_base_caller'; import type { GraphNode } from '../../types'; import { ESQL_SYNTAX_TRANSLATION_PROMPT } from './prompts'; @@ -63,9 +63,9 @@ export const getTranslateRuleNode = ({ }; }; -const getTranslationResult = (esqlQuery: string): SiemMigrationRuleTranslationResult => { +const getTranslationResult = (esqlQuery: string): RuleTranslationResult => { if (esqlQuery.match(/\[(macro):[\s\S]*\]/)) { - return SiemMigrationRuleTranslationResult.PARTIAL; + return RuleTranslationResult.PARTIAL; } - return SiemMigrationRuleTranslationResult.FULL; + return RuleTranslationResult.FULL; }; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/validation/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/validation/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/validation/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/validation/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/validation/validation.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/validation/validation.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/validation/validation.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/validation/validation.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/state.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/state.ts new file mode 100644 index 0000000000000..873f1880d2252 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/state.ts @@ -0,0 +1,61 @@ +/* + * 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 { BaseMessage } from '@langchain/core/messages'; +import { Annotation, messagesStateReducer } from '@langchain/langgraph'; +import { RuleTranslationResult } from '../../../../../../../../common/siem_migrations/constants'; +import type { + ElasticRule, + OriginalRule, + RuleMigration, +} from '../../../../../../../../common/siem_migrations/model/rule_migration.gen'; +import type { Integration } from '../../../../types'; +import type { TranslateRuleValidationErrors } from './types'; + +export const translateRuleState = Annotation.Root({ + messages: Annotation<BaseMessage[]>({ + reducer: messagesStateReducer, + default: () => [], + }), + original_rule: Annotation<OriginalRule>(), + integration: Annotation<Integration>({ + reducer: (current, value) => value ?? current, + default: () => ({} as Integration), + }), + translation_finalized: Annotation<boolean>({ + reducer: (current, value) => value ?? current, + default: () => false, + }), + inline_query: Annotation<string>({ + reducer: (current, value) => value ?? current, + default: () => '', + }), + semantic_query: Annotation<string>({ + reducer: (current, value) => value ?? current, + default: () => '', + }), + elastic_rule: Annotation<ElasticRule>({ + reducer: (state, action) => ({ ...state, ...action }), + default: () => ({} as ElasticRule), + }), + validation_errors: Annotation<TranslateRuleValidationErrors>({ + reducer: (current, value) => value ?? current, + default: () => ({ iterations: 0 } as TranslateRuleValidationErrors), + }), + translation_result: Annotation<RuleTranslationResult>({ + reducer: (current, value) => value ?? current, + default: () => RuleTranslationResult.UNTRANSLATABLE, + }), + comments: Annotation<RuleMigration['comments']>({ + reducer: (current, value) => (value ? (current ?? []).concat(value) : current), + default: () => [], + }), + response: Annotation<string>({ + reducer: (current, value) => value ?? current, + default: () => '', + }), +}); diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/integration_retriever.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/integration_retriever.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/integration_retriever.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/integration_retriever.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/integration_retriever.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/integration_retriever.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/integration_retriever.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/integration_retriever.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/prebuilt_rules_retriever.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/prebuilt_rules_retriever.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/prebuilt_rules_retriever.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/prebuilt_rules_retriever.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_migrations_retriever.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_migrations_retriever.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_migrations_retriever.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_migrations_retriever.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_resource_retriever.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_resource_retriever.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_resource_retriever.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_resource_retriever.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_resource_retriever.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_resource_retriever.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_resource_retriever.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_resource_retriever.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/rule_migrations_task_client.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/rule_migrations_task_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/rule_migrations_task_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/rule_migrations_task_client.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/rule_migrations_task_service.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/rule_migrations_task_service.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/rule_migrations_task_service.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/rule_migrations_task_service.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/util/actions_client_chat.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/util/actions_client_chat.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/util/actions_client_chat.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/util/actions_client_chat.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/util/esql_knowledge_base_caller.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/util/esql_knowledge_base_caller.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/util/esql_knowledge_base_caller.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/task/util/esql_knowledge_base_caller.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/rules/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/rules/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/siem_migrations_service.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/siem_migrations_service.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/siem_migrations_service.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/siem_migrations_service.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/siem_migrations_service.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/siem_migrations_service.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/siem_migrations_service.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/siem_migrations_service.ts diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/siem_migrations/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/tags/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/tags/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/tags/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/tags/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/tags/routes/create_tag.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/tags/routes/create_tag.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/tags/routes/create_tag.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/tags/routes/create_tag.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/tags/routes/create_tag.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/tags/routes/create_tag.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/tags/routes/create_tag.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/tags/routes/create_tag.ts diff --git a/x-pack/plugins/security_solution/server/lib/tags/routes/get_tags_by_name.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/tags/routes/get_tags_by_name.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/tags/routes/get_tags_by_name.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/tags/routes/get_tags_by_name.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/tags/routes/get_tags_by_name.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/tags/routes/get_tags_by_name.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/tags/routes/get_tags_by_name.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/tags/routes/get_tags_by_name.ts diff --git a/x-pack/plugins/security_solution/server/lib/tags/routes/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/tags/routes/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/tags/routes/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/tags/routes/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/tags/saved_objects/create_tag.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/tags/saved_objects/create_tag.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/tags/saved_objects/create_tag.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/tags/saved_objects/create_tag.ts diff --git a/x-pack/plugins/security_solution/server/lib/tags/saved_objects/find_tags_by_name.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/tags/saved_objects/find_tags_by_name.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/tags/saved_objects/find_tags_by_name.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/tags/saved_objects/find_tags_by_name.ts diff --git a/x-pack/plugins/security_solution/server/lib/tags/saved_objects/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/tags/saved_objects/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/tags/saved_objects/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/tags/saved_objects/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/fleet_agent_response.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/__mocks__/fleet_agent_response.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/fleet_agent_response.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/__mocks__/fleet_agent_response.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/metrics.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/__mocks__/metrics.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/metrics.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/__mocks__/metrics.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/prebuilt_rule_alerts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/__mocks__/prebuilt_rule_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/prebuilt_rule_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/__mocks__/prebuilt_rule_alerts.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/staging_indices.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/__mocks__/staging_indices.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/staging_indices.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/__mocks__/staging_indices.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/timeline.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/__mocks__/timeline.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/timeline.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/__mocks__/timeline.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/artifact.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/artifact.test.ts similarity index 93% rename from x-pack/plugins/security_solution/server/lib/telemetry/artifact.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/artifact.test.ts index d3aabc5b28d41..af7d96b6ac311 100644 --- a/x-pack/plugins/security_solution/server/lib/telemetry/artifact.test.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/artifact.test.ts @@ -66,7 +66,7 @@ describe('telemetry artifact test', () => { await artifact.start(mockTelemetryReceiver); const axiosResponse = { status: 200, - data: 'x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip', + data: 'x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip', }; mockedAxios.get.mockImplementationOnce(() => Promise.resolve(axiosResponse)); await expect(async () => artifact.getArtifact('artifactThatDoesNotExist')).rejects.toThrow( @@ -80,7 +80,7 @@ describe('telemetry artifact test', () => { await artifact.start(mockTelemetryReceiver); const axiosResponse = { status: 200, - data: 'x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip', + data: 'x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip', }; mockedAxios.get .mockImplementationOnce(() => Promise.resolve(axiosResponse)) @@ -111,7 +111,7 @@ describe('telemetry artifact test', () => { const fakeEtag = '123'; const axiosResponse = { status: 200, - data: 'x-pack/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip', + data: 'x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/__mocks__/kibana-artifacts.zip', headers: { etag: fakeEtag }, }; const artifact = new Artifact(); diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/artifact.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/artifact.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/artifact.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/artifact.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/async_sender.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/async_sender.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/async_sender.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/async_sender.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/async_sender.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/async_sender.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/async_sender.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/async_sender.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/async_sender.types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/async_sender.types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/async_sender.types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/async_sender.types.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/collections_helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/collections_helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/collections_helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/collections_helpers.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/collections_helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/collections_helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/collections_helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/collections_helpers.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/configuration.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/configuration.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/configuration.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/configuration.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/constants.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/constants.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/constants.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/event_based/events.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/event_based/events.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/event_based/events.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/event_based/events.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/filterlists/endpoint_alerts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/filterlists/endpoint_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/filterlists/endpoint_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/filterlists/endpoint_alerts.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/filterlists/exception_lists.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/filterlists/exception_lists.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/filterlists/exception_lists.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/filterlists/exception_lists.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/filterlists/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/filterlists/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/filterlists/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/filterlists/index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/filterlists/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/filterlists/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/filterlists/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/filterlists/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/filterlists/prebuilt_rules_alerts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/filterlists/prebuilt_rules_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/filterlists/prebuilt_rules_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/filterlists/prebuilt_rules_alerts.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/filterlists/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/filterlists/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/filterlists/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/filterlists/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/helpers.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/helpers.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/indices.metadata.types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/indices.metadata.types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/indices.metadata.types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/indices.metadata.types.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/insights/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/insights/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/insights/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/insights/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/insights/insights.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/insights/insights.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/insights/insights.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/insights/insights.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/preview_sender.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/preview_sender.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/preview_sender.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/preview_sender.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/preview_task_metrics.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/preview_task_metrics.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/preview_task_metrics.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/preview_task_metrics.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/receiver.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/receiver.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/receiver.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/receiver.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/rxjs_helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/rxjs_helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/rxjs_helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/rxjs_helpers.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/rxjs_helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/rxjs_helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/rxjs_helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/rxjs_helpers.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/sender.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/sender.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/sender.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/sender.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/sender.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/sender.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/sender.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/sender.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/sender_helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/sender_helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/sender_helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/sender_helpers.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/task.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/task.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/task.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/task.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/task.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/task.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/task.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/task.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/task_metrics.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/task_metrics.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/task_metrics.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/task_metrics.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/task_metrics.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/task_metrics.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/task_metrics.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/task_metrics.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/task_metrics.types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/task_metrics.types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/task_metrics.types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/task_metrics.types.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/task_state.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/task_state.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/task_state.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/task_state.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/task_state.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/task_state.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/task_state.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/task_state.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/configuration.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/configuration.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/tasks/configuration.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/configuration.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/configuration.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/configuration.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/tasks/configuration.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/configuration.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/detection_rule.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/detection_rule.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/tasks/detection_rule.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/detection_rule.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/detection_rule.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/detection_rule.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/tasks/detection_rule.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/detection_rule.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/diagnostic.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/diagnostic.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/tasks/diagnostic.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/diagnostic.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/diagnostic.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/diagnostic.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/tasks/diagnostic.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/diagnostic.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/endpoint.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/endpoint.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/tasks/endpoint.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/endpoint.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/endpoint.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/endpoint.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/tasks/endpoint.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/endpoint.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/filterlists.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/filterlists.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/tasks/filterlists.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/filterlists.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/tasks/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/indices.metadata.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/indices.metadata.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/tasks/indices.metadata.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/indices.metadata.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/prebuilt_rule_alerts.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/prebuilt_rule_alerts.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/tasks/prebuilt_rule_alerts.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/prebuilt_rule_alerts.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/prebuilt_rule_alerts.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/prebuilt_rule_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/tasks/prebuilt_rule_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/prebuilt_rule_alerts.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/security_lists.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/security_lists.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/tasks/security_lists.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/security_lists.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/security_lists.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/security_lists.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/tasks/security_lists.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/security_lists.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/tasks.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/tasks.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/tasks/tasks.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/tasks.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/timelines.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/timelines.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/tasks/timelines.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/timelines.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/timelines.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/timelines.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/tasks/timelines.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/timelines.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/timelines_diagnostic.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/timelines_diagnostic.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/tasks/timelines_diagnostic.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/timelines_diagnostic.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/tasks/timelines_diagnostic.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/timelines_diagnostic.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/tasks/timelines_diagnostic.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/tasks/timelines_diagnostic.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/telemetry_logger.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/telemetry_logger.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/telemetry_logger.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/telemetry_logger.ts diff --git a/x-pack/plugins/security_solution/server/lib/telemetry/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/telemetry/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/telemetry/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/__mocks__/create_timelines.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/__mocks__/create_timelines.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/__mocks__/create_timelines.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/__mocks__/create_timelines.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/__mocks__/import_timelines.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/__mocks__/import_timelines.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/__mocks__/import_timelines.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/__mocks__/import_timelines.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/__mocks__/prepackaged_timelines.ndjson b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/__mocks__/prepackaged_timelines.ndjson similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/__mocks__/prepackaged_timelines.ndjson rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/__mocks__/prepackaged_timelines.ndjson diff --git a/x-pack/plugins/security_solution/server/lib/timeline/__mocks__/request_responses.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/__mocks__/request_responses.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/__mocks__/request_responses.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/__mocks__/request_responses.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/__mocks__/resolve_timeline.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/__mocks__/resolve_timeline.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/__mocks__/resolve_timeline.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/__mocks__/resolve_timeline.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/constants.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/constants.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/constants.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/draft_timelines/clean_draft_timelines/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/draft_timelines/clean_draft_timelines/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/draft_timelines/clean_draft_timelines/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/draft_timelines/clean_draft_timelines/index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/draft_timelines/clean_draft_timelines/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/draft_timelines/clean_draft_timelines/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/draft_timelines/clean_draft_timelines/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/draft_timelines/clean_draft_timelines/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/draft_timelines/get_draft_timelines/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/draft_timelines/get_draft_timelines/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/draft_timelines/get_draft_timelines/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/draft_timelines/get_draft_timelines/index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/draft_timelines/get_draft_timelines/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/draft_timelines/get_draft_timelines/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/draft_timelines/get_draft_timelines/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/draft_timelines/get_draft_timelines/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/notes/delete_note.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/notes/delete_note.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/notes/delete_note.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/notes/delete_note.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.ts similarity index 98% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.ts index dc8fffbc0a86d..7211db1f6cdd5 100644 --- a/x-pack/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/notes/get_notes.ts @@ -148,7 +148,7 @@ export const getNotesRoute = ( const createdByFilter = queryParams?.createdByFilter; // now uuid if (createdByFilter) { // because the notes createdBy property can be either full_name, email or username - // see pickSaveNote (https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/saved_object.ts#L302) + // see pickSaveNote (https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/notes/saved_object.ts#L302) // which uses the getUserDisplayName (https://github.com/elastic/kibana/blob/main/packages/kbn-user-profile-components/src/user_profile.ts#L138) const [_, { security }] = await startServices(); const users: UserProfile[] = await security.userProfiles.bulkGet({ diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/notes/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/notes/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/notes/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/notes/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/notes/persist_note.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/notes/persist_note.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/notes/persist_note.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/notes/persist_note.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/pinned_events/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/pinned_events/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/pinned_events/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/pinned_events/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/pinned_events/persist_pinned_event.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/pinned_events/persist_pinned_event.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/pinned_events/persist_pinned_event.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/pinned_events/persist_pinned_event.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/helpers.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/helpers.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/prepackaged_timelines/install_prepackaged_timelines/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/copy_timeline/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/copy_timeline/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/copy_timeline/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/copy_timeline/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/helpers.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/helpers.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/create_timelines/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/delete_timelines/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/delete_timelines/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/delete_timelines/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/delete_timelines/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/export_timelines/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/export_timelines/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/export_timelines/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/export_timelines/helpers.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/export_timelines/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/export_timelines/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/export_timelines/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/export_timelines/index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/export_timelines/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/export_timelines/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/export_timelines/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/export_timelines/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/get_timeline/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/get_timeline/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/get_timeline/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/get_timeline/index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/get_timeline/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/get_timeline/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/get_timeline/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/get_timeline/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/get_timelines/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/get_timelines/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/get_timelines/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/get_timelines/index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/get_timelines/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/get_timelines/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/get_timelines/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/get_timelines/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/create_timelines_stream_from_ndjson.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/create_timelines_stream_from_ndjson.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/create_timelines_stream_from_ndjson.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/create_timelines_stream_from_ndjson.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/get_timelines_from_stream.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/get_timelines_from_stream.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/get_timelines_from_stream.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/get_timelines_from_stream.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/helpers.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/import_timelines/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/patch_timelines/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/patch_timelines/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/patch_timelines/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/patch_timelines/index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/patch_timelines/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/patch_timelines/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/patch_timelines/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/patch_timelines/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/persist_favorite/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/persist_favorite/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/persist_favorite/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/persist_favorite/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/resolve_timeline/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/resolve_timeline/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/routes/timelines/resolve_timeline/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/routes/timelines/resolve_timeline/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/field_migrator.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/notes/field_migrator.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/field_migrator.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/notes/field_migrator.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/get_overridable_note.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/notes/get_overridable_note.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/get_overridable_note.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/notes/get_overridable_note.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/notes/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/notes/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/persist_notes.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/notes/persist_notes.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/persist_notes.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/notes/persist_notes.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/saved_object.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/notes/saved_object.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/saved_object.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/notes/saved_object.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/saved_object.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/notes/saved_object.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object/notes/saved_object.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/notes/saved_object.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/pinned_events/field_migrator.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/pinned_events/field_migrator.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object/pinned_events/field_migrator.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/pinned_events/field_migrator.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/pinned_events/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/pinned_events/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object/pinned_events/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/pinned_events/index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/pinned_events/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/pinned_events/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object/pinned_events/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/pinned_events/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/saved_search/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/saved_search/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object/saved_search/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/saved_search/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/convert_saved_object_to_savedtimeline.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/timelines/convert_saved_object_to_savedtimeline.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/convert_saved_object_to_savedtimeline.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/timelines/convert_saved_object_to_savedtimeline.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/field_migrator.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/timelines/field_migrator.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/field_migrator.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/timelines/field_migrator.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/timelines/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/timelines/index.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/timelines/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/timelines/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/pick_saved_timeline.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/timelines/pick_saved_timeline.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/pick_saved_timeline.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/timelines/pick_saved_timeline.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/pick_saved_timeline.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/timelines/pick_saved_timeline.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object/timelines/pick_saved_timeline.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/timelines/pick_saved_timeline.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/index.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/notes.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/notes.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/notes.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/notes.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/pinned_events.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/pinned_events.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/pinned_events.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/pinned_events.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/timelines.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/timelines.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/timelines.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/timelines.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/timelines.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/timelines.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/timelines.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/timelines.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/types.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/utils.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/utils.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/utils.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/utils.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/utils.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/utils.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/migrations/utils.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/notes.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/notes.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/notes.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/notes.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/pinned_events.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/pinned_events.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/pinned_events.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/pinned_events.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/utils/check_timelines_status.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/check_timelines_status.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/utils/check_timelines_status.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/check_timelines_status.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/utils/common.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/common.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/utils/common.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/common.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/utils/compare_timelines_status.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/compare_timelines_status.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/utils/compare_timelines_status.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/compare_timelines_status.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/utils/compare_timelines_status.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/compare_timelines_status.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/utils/compare_timelines_status.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/compare_timelines_status.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/utils/default_timeline.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/default_timeline.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/utils/default_timeline.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/default_timeline.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/utils/default_timeline_headers.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/default_timeline_headers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/utils/default_timeline_headers.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/default_timeline_headers.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/utils/failure_cases.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/failure_cases.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/utils/failure_cases.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/failure_cases.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/utils/failure_cases.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/failure_cases.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/utils/failure_cases.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/failure_cases.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/utils/migrator.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/migrator.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/utils/migrator.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/migrator.test.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/utils/migrator.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/migrator.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/utils/migrator.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/migrator.ts diff --git a/x-pack/plugins/security_solution/server/lib/timeline/utils/timeline_object.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/timeline_object.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/timeline/utils/timeline_object.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/timeline/utils/timeline_object.ts diff --git a/x-pack/plugins/security_solution/server/lib/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lib/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lib/types.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_create_handler.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_create_handler.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_create_handler.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_create_handler.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_delete_item_handler.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_delete_item_handler.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_delete_item_handler.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_delete_item_handler.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_export_handler.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_export_handler.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_export_handler.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_export_handler.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_get_one_handler.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_get_one_handler.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_get_one_handler.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_get_one_handler.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_import_handler.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_import_handler.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_import_handler.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_import_handler.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_multi_list_find_handler.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_multi_list_find_handler.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_multi_list_find_handler.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_multi_list_find_handler.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_single_list_find_handler.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_single_list_find_handler.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_single_list_find_handler.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_single_list_find_handler.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_summary_handler.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_summary_handler.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_summary_handler.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_summary_handler.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_update_handler.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_update_handler.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_update_handler.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_update_handler.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/register_endpoint_extension_points.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/register_endpoint_extension_points.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/register_endpoint_extension_points.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/register_endpoint_extension_points.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/types.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/types.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.test.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.test.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/base_validator.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/blocklist_validator.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/blocklist_validator.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/blocklist_validator.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/blocklist_validator.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/endpoint_exception_errors.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/endpoint_exception_errors.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/endpoint_exception_errors.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/endpoint_exception_errors.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/endpoint_exceptions_validator.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/endpoint_exceptions_validator.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/endpoint_exceptions_validator.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/endpoint_exceptions_validator.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/errors.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/errors.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/errors.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/errors.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/event_filter_validator.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/event_filter_validator.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/event_filter_validator.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/event_filter_validator.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/host_isolation_exceptions_validator.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/host_isolation_exceptions_validator.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/host_isolation_exceptions_validator.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/host_isolation_exceptions_validator.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/index.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/mocks.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/trusted_app_validator.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/trusted_app_validator.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/endpoint/validators/trusted_app_validator.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/validators/trusted_app_validator.ts diff --git a/x-pack/plugins/security_solution/server/lists_integration/index.ts b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/lists_integration/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/lists_integration/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/lists_integration/jest.config.js b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/jest.config.js new file mode 100644 index 0000000000000..8a9fc57682cad --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/lists_integration/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/server/lists_integration'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/server/lists_integration', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/server/lists_integration/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/server/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/mocks.ts diff --git a/x-pack/plugins/security_solution/server/plugin.ts b/x-pack/solutions/security/plugins/security_solution/server/plugin.ts similarity index 100% rename from x-pack/plugins/security_solution/server/plugin.ts rename to x-pack/solutions/security/plugins/security_solution/server/plugin.ts diff --git a/x-pack/plugins/security_solution/server/plugin_contract.ts b/x-pack/solutions/security/plugins/security_solution/server/plugin_contract.ts similarity index 100% rename from x-pack/plugins/security_solution/server/plugin_contract.ts rename to x-pack/solutions/security/plugins/security_solution/server/plugin_contract.ts diff --git a/x-pack/plugins/security_solution/server/request_context_factory.mock.ts b/x-pack/solutions/security/plugins/security_solution/server/request_context_factory.mock.ts similarity index 100% rename from x-pack/plugins/security_solution/server/request_context_factory.mock.ts rename to x-pack/solutions/security/plugins/security_solution/server/request_context_factory.mock.ts diff --git a/x-pack/plugins/security_solution/server/request_context_factory.ts b/x-pack/solutions/security/plugins/security_solution/server/request_context_factory.ts similarity index 100% rename from x-pack/plugins/security_solution/server/request_context_factory.ts rename to x-pack/solutions/security/plugins/security_solution/server/request_context_factory.ts diff --git a/x-pack/plugins/security_solution/server/routes/index.ts b/x-pack/solutions/security/plugins/security_solution/server/routes/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/routes/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/routes/index.ts diff --git a/x-pack/plugins/security_solution/server/routes/limited_concurrency.ts b/x-pack/solutions/security/plugins/security_solution/server/routes/limited_concurrency.ts similarity index 100% rename from x-pack/plugins/security_solution/server/routes/limited_concurrency.ts rename to x-pack/solutions/security/plugins/security_solution/server/routes/limited_concurrency.ts diff --git a/x-pack/plugins/security_solution/server/saved_objects.ts b/x-pack/solutions/security/plugins/security_solution/server/saved_objects.ts similarity index 100% rename from x-pack/plugins/security_solution/server/saved_objects.ts rename to x-pack/solutions/security/plugins/security_solution/server/saved_objects.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint/factory/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint/factory/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/actions/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/actions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/actions/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/actions/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/actions/query.all_actions.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/actions/query.all_actions.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/actions/query.all_actions.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/actions/query.all_actions.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/results/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/results/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/results/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/results/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/results/query.action_results.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/results/query.action_results.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/results/query.action_results.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint/factory/response_actions/results/query.action_results.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/types.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint/factory/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/endpoint/factory/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint/factory/types.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/endpoint/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/endpoint/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/parse_request.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/parse_request.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/parse_request.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_fields/parse_request.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/endpoint_package_policies_stats/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_package_policies_stats/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/endpoint_package_policies_stats/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_package_policies_stats/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/endpoint_package_policies_stats/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_package_policies_stats/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/endpoint_package_policies_stats/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/endpoint_package_policies_stats/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/helpers/format_response_object_values.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/helpers/format_response_object_values.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/helpers/format_response_object_values.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/helpers/format_response_object_values.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/helpers/format_response_object_values.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/helpers/format_response_object_values.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/helpers/format_response_object_values.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/helpers/format_response_object_values.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/helpers/get_flattened_fields.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/helpers/get_flattened_fields.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/helpers/get_flattened_fields.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/helpers/get_flattened_fields.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/search_strategy/jest.config.js b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/jest.config.js new file mode 100644 index 0000000000000..f6d5aafd60dda --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/server/search_strategy'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/server/search_strategy', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/server/search_strategy/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/asset_criticality/query.asset_criticality.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/asset_criticality/query.asset_criticality.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/asset_criticality/query.asset_criticality.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/asset_criticality/query.asset_criticality.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/factory.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/factory.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/factory.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/factory.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/helpers.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/helpers.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/query.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/query.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/query.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/query.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/query.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/query.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/query.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/query.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/response.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/response.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/response.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/response.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/response.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/response.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/response.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/event_enrichment/response.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/threat_intel_source/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/threat_intel_source/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/threat_intel_source/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/threat_intel_source/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/threat_intel_source/query.threat_intel_source.dsl.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/threat_intel_source/query.threat_intel_source.dsl.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/threat_intel_source/query.threat_intel_source.dsl.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/threat_intel_source/query.threat_intel_source.dsl.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/threat_intel_source/query.threat_intel_source.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/threat_intel_source/query.threat_intel_source.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/cti/threat_intel_source/query.threat_intel_source.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/cti/threat_intel_source/query.threat_intel_source.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/helpers.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/helpers.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/query.all_hosts.dsl.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/query.all_hosts.dsl.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/query.all_hosts.dsl.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/query.all_hosts.dsl.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/query.all_hosts.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/query.all_hosts.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/query.all_hosts.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/all/query.all_hosts.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/helper.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/helper.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/helper.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/helper.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/helpers.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/query.host_details.dsl.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/query.host_details.dsl.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/query.host_details.dsl.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/query.host_details.dsl.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/query.host_details.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/query.host_details.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/query.host_details.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/details/query.host_details.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/query.overview_host.dsl.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/query.overview_host.dsl.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/query.overview_host.dsl.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/query.overview_host.dsl.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/query.overview_host.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/query.overview_host.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/query.overview_host.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/overview/query.overview_host.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/dsl/query.dsl.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/dsl/query.dsl.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/dsl/query.dsl.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/dsl/query.dsl.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/dsl/query.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/dsl/query.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/dsl/query.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/dsl/query.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/helpers.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/helpers.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/hosts/uncommon_processes/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/query.first_or_last_seen.dsl.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/query.first_or_last_seen.dsl.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/query.first_or_last_seen.dsl.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/query.first_or_last_seen.dsl.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/query.first_or_last_seen.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/query.first_or_last_seen.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/query.first_or_last_seen.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/last_first_seen/query.first_or_last_seen.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/helpers.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/helpers.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/query.details_network.dsl.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/query.details_network.dsl.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/query.details_network.dsl.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/query.details_network.dsl.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/query.details_network.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/query.details_network.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/query.details_network.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/details/query.details_network.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/helpers.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/query.dns_network.dsl.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/query.dns_network.dsl.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/query.dns_network.dsl.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/query.dns_network.dsl.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/query.dns_network.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/query.dns_network.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/query.dns_network.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/dns/query.dns_network.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/helpers.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/helpers.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/query.http_network.dsl.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/query.http_network.dsl.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/query.http_network.dsl.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/query.http_network.dsl.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/query.http_network.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/query.http_network.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/query.http_network.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/http/query.http_network.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/query.overview_network.dsl.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/query.overview_network.dsl.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/query.overview_network.dsl.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/query.overview_network.dsl.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/query.overview_network.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/query.overview_network.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/query.overview_network.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/overview/query.overview_network.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/helpers.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/query.tls_network.dsl.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/query.tls_network.dsl.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/query.tls_network.dsl.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/query.tls_network.dsl.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/query.tls_network.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/query.tls_network.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/query.tls_network.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/tls/query.tls_network.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/helpers.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/query.top_countries_network.dsl.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/query.top_countries_network.dsl.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/query.top_countries_network.dsl.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/query.top_countries_network.dsl.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/query.top_countries_network.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/query.top_countries_network.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/query.top_countries_network.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_countries/query.top_countries_network.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/helpers.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/query.top_n_flow_network.dsl.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/query.top_n_flow_network.dsl.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/query.top_n_flow_network.dsl.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/query.top_n_flow_network.dsl.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/query.top_n_flow_network.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/query.top_n_flow_network.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/query.top_n_flow_network.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/top_n_flow/query.top_n_flow_network.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/helpers.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/helpers.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/query.users_network.dsl.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/query.users_network.dsl.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/query.users_network.dsl.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/query.users_network.dsl.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/query.users_network.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/query.users_network.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/query.users_network.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/network/users/query.users_network.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/query.related_hosts.dsl.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/query.related_hosts.dsl.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/query.related_hosts.dsl.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/query.related_hosts.dsl.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/query.related_hosts.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/query.related_hosts.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/query.related_hosts.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_hosts/query.related_hosts.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/query.related_users.dsl.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/query.related_users.dsl.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/query.related_users.dsl.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/query.related_users.dsl.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/query.related_users.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/query.related_users.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/query.related_users.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/related_entities/related_users/query.related_users.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/query.risk_score.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/query.risk_score.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/query.risk_score.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/all/query.risk_score.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/kpi/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/kpi/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/kpi/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/kpi/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/kpi/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/kpi/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/kpi/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/kpi/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/kpi/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/kpi/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/kpi/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/kpi/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/kpi/query.kpi_risk_score.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/kpi/query.kpi_risk_score.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/kpi/query.kpi_risk_score.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/risk_score/kpi/query.kpi_risk_score.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/types.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/types.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/index.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/index.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/index.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/index.test.ts.snap diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/query.all_users.dsl.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/query.all_users.dsl.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/query.all_users.dsl.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/__snapshots__/query.all_users.dsl.test.ts.snap diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/all/query.all_users.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/dsl/query.dsl.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/dsl/query.dsl.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/dsl/query.dsl.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/dsl/query.dsl.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/dsl/query.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/dsl/query.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/dsl/query.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/dsl/query.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/helpers.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/index.tsx b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/index.tsx similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/index.tsx rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/authentications/index.tsx diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/__snapshots__/index.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/__snapshots__/index.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/__snapshots__/index.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/__snapshots__/index.test.ts.snap diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/__snapshots__/query.managed_user_details.dsl.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/__snapshots__/query.managed_user_details.dsl.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/__snapshots__/query.managed_user_details.dsl.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/__snapshots__/query.managed_user_details.dsl.test.ts.snap diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/query.managed_user_details.dsl.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/query.managed_user_details.dsl.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/query.managed_user_details.dsl.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/query.managed_user_details.dsl.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/query.managed_user_details.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/query.managed_user_details.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/query.managed_user_details.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/managed_details/query.managed_user_details.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/__mocks__/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/__mocks__/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/__mocks__/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/__snapshots__/index.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/__snapshots__/index.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/__snapshots__/index.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/__snapshots__/index.test.ts.snap diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/__snapshots__/query.observed_user_details.dsl.test.ts.snap b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/__snapshots__/query.observed_user_details.dsl.test.ts.snap similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/__snapshots__/query.observed_user_details.dsl.test.ts.snap rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/__snapshots__/query.observed_user_details.dsl.test.ts.snap diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/helper.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/helper.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/helper.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/helper.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/helpers.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/index.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/index.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/index.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/index.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/index.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/query.observed_user_details.dsl.test.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/query.observed_user_details.dsl.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/query.observed_user_details.dsl.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/query.observed_user_details.dsl.test.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/query.observed_user_details.dsl.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/query.observed_user_details.dsl.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/query.observed_user_details.dsl.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/factory/users/observed_details/query.observed_user_details.dsl.ts diff --git a/x-pack/plugins/security_solution/server/search_strategy/security_solution/index.ts b/x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/search_strategy/security_solution/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/search_strategy/security_solution/index.ts diff --git a/x-pack/plugins/security_solution/server/security_integrations/handlers/put_cribl_routing_pipeline.ts b/x-pack/solutions/security/plugins/security_solution/server/security_integrations/handlers/put_cribl_routing_pipeline.ts similarity index 100% rename from x-pack/plugins/security_solution/server/security_integrations/handlers/put_cribl_routing_pipeline.ts rename to x-pack/solutions/security/plugins/security_solution/server/security_integrations/handlers/put_cribl_routing_pipeline.ts diff --git a/x-pack/plugins/security_solution/server/security_integrations/index.ts b/x-pack/solutions/security/plugins/security_solution/server/security_integrations/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/security_integrations/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/security_integrations/index.ts diff --git a/x-pack/plugins/security_solution/server/security_integrations/security_integrations.ts b/x-pack/solutions/security/plugins/security_solution/server/security_integrations/security_integrations.ts similarity index 100% rename from x-pack/plugins/security_solution/server/security_integrations/security_integrations.ts rename to x-pack/solutions/security/plugins/security_solution/server/security_integrations/security_integrations.ts diff --git a/x-pack/plugins/security_solution/server/types.ts b/x-pack/solutions/security/plugins/security_solution/server/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/types.ts diff --git a/x-pack/plugins/security_solution/server/ui_settings.ts b/x-pack/solutions/security/plugins/security_solution/server/ui_settings.ts similarity index 100% rename from x-pack/plugins/security_solution/server/ui_settings.ts rename to x-pack/solutions/security/plugins/security_solution/server/ui_settings.ts diff --git a/x-pack/plugins/security_solution/server/usage/collector.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/collector.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/collector.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/collector.ts diff --git a/x-pack/plugins/security_solution/server/usage/constants.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/constants.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/constants.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/constants.ts diff --git a/x-pack/plugins/security_solution/server/usage/dashboards/get_dashboards_metrics.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/dashboards/get_dashboards_metrics.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/dashboards/get_dashboards_metrics.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/dashboards/get_dashboards_metrics.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/dashboards/get_dashboards_metrics.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/dashboards/get_dashboards_metrics.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/dashboards/get_dashboards_metrics.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/dashboards/get_dashboards_metrics.ts diff --git a/x-pack/plugins/security_solution/server/usage/dashboards/mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/dashboards/mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/dashboards/mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/dashboards/mocks.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/get_initial_usage.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/get_initial_usage.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/get_initial_usage.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/get_initial_usage.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/get_metrics.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/get_metrics.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/get_metrics.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/get_metrics.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/get_metrics.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/get_metrics.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/get_metrics.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/get_metrics.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/legacy_siem_signals/get_initial_usage.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/legacy_siem_signals/get_initial_usage.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/legacy_siem_signals/get_initial_usage.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/legacy_siem_signals/get_initial_usage.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/legacy_siem_signals/get_legacy_siem_signals_metrics.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/legacy_siem_signals/get_legacy_siem_signals_metrics.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/legacy_siem_signals/get_legacy_siem_signals_metrics.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/legacy_siem_signals/get_legacy_siem_signals_metrics.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/legacy_siem_signals/types.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/legacy_siem_signals/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/legacy_siem_signals/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/legacy_siem_signals/types.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/ml_jobs/get_initial_usage.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/ml_jobs/get_initial_usage.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/ml_jobs/get_initial_usage.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/ml_jobs/get_initial_usage.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/ml_jobs/get_metrics.mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/ml_jobs/get_metrics.mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/ml_jobs/get_metrics.mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/ml_jobs/get_metrics.mocks.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/ml_jobs/get_metrics.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/ml_jobs/get_metrics.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/ml_jobs/get_metrics.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/ml_jobs/get_metrics.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/ml_jobs/transform_utils/get_job_correlations.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/ml_jobs/transform_utils/get_job_correlations.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/ml_jobs/transform_utils/get_job_correlations.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/ml_jobs/transform_utils/get_job_correlations.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/ml_jobs/types.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/ml_jobs/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/ml_jobs/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/ml_jobs/types.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/ml_jobs/update_usage.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/ml_jobs/update_usage.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/ml_jobs/update_usage.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/ml_jobs/update_usage.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/ml_jobs/update_usage.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/ml_jobs/update_usage.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/ml_jobs/update_usage.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/ml_jobs/update_usage.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/rules/get_initial_usage.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/get_initial_usage.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/rules/get_initial_usage.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/get_initial_usage.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/rules/get_metrics.mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/get_metrics.mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/rules/get_metrics.mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/get_metrics.mocks.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/rules/get_metrics.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/get_metrics.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/rules/get_metrics.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/get_metrics.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/rules/transform_utils/get_alert_id_to_count_map.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/transform_utils/get_alert_id_to_count_map.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/rules/transform_utils/get_alert_id_to_count_map.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/transform_utils/get_alert_id_to_count_map.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/rules/transform_utils/get_rule_id_to_cases_map.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/transform_utils/get_rule_id_to_cases_map.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/rules/transform_utils/get_rule_id_to_cases_map.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/transform_utils/get_rule_id_to_cases_map.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/rules/transform_utils/get_rule_id_to_enabled_map.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/transform_utils/get_rule_id_to_enabled_map.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/rules/transform_utils/get_rule_id_to_enabled_map.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/transform_utils/get_rule_id_to_enabled_map.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/rules/transform_utils/get_rule_object_correlations.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/transform_utils/get_rule_object_correlations.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/rules/transform_utils/get_rule_object_correlations.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/transform_utils/get_rule_object_correlations.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/rules/types.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/rules/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/types.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/rules/update_usage.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/update_usage.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/rules/update_usage.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/update_usage.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/rules/update_usage.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/update_usage.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/rules/update_usage.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/update_usage.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/rules/usage_utils/get_alert_suppression_usage.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/usage_utils/get_alert_suppression_usage.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/rules/usage_utils/get_alert_suppression_usage.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/usage_utils/get_alert_suppression_usage.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/rules/usage_utils/get_notifications_enabled_disabled.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/usage_utils/get_notifications_enabled_disabled.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/rules/usage_utils/get_notifications_enabled_disabled.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/usage_utils/get_notifications_enabled_disabled.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/rules/usage_utils/update_alert_suppression_usage.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/usage_utils/update_alert_suppression_usage.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/rules/usage_utils/update_alert_suppression_usage.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/usage_utils/update_alert_suppression_usage.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/rules/usage_utils/update_query_usage.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/usage_utils/update_query_usage.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/rules/usage_utils/update_query_usage.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/usage_utils/update_query_usage.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/rules/usage_utils/update_total_usage.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/usage_utils/update_total_usage.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/rules/usage_utils/update_total_usage.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/rules/usage_utils/update_total_usage.ts diff --git a/x-pack/plugins/security_solution/server/usage/detections/types.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/detections/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/detections/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/detections/types.ts diff --git a/x-pack/plugins/security_solution/server/usage/endpoint/get_metrics.mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/endpoint/get_metrics.mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/endpoint/get_metrics.mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/endpoint/get_metrics.mocks.ts diff --git a/x-pack/plugins/security_solution/server/usage/endpoint/get_metrics.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/endpoint/get_metrics.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/endpoint/get_metrics.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/endpoint/get_metrics.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/endpoint/get_metrics.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/endpoint/get_metrics.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/endpoint/get_metrics.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/endpoint/get_metrics.ts diff --git a/x-pack/plugins/security_solution/server/usage/endpoint/types.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/endpoint/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/endpoint/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/endpoint/types.ts diff --git a/x-pack/plugins/security_solution/server/usage/get_internal_saved_objects_client.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/get_internal_saved_objects_client.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/get_internal_saved_objects_client.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/get_internal_saved_objects_client.ts diff --git a/x-pack/plugins/security_solution/server/usage/index.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/usage/jest.config.js b/x-pack/solutions/security/plugins/security_solution/server/usage/jest.config.js new file mode 100644 index 0000000000000..be2b9bb6736b8 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/usage/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/server/usage'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/server/usage', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/server/usage/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/server/usage/queries/get_alerts.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/get_alerts.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/get_alerts.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/get_alerts.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/get_case_comments.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/get_case_comments.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/get_case_comments.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/get_case_comments.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/get_detection_rules.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/get_detection_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/get_detection_rules.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/get_detection_rules.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/get_event_log_by_type_and_status.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/get_event_log_by_type_and_status.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/get_event_log_by_type_and_status.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/get_event_log_by_type_and_status.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/legacy_get_rule_actions.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/legacy_get_rule_actions.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/legacy_get_rule_actions.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/legacy_get_rule_actions.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/count_totals.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/count_totals.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/count_totals.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/count_totals.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/count_totals.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/count_totals.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/count_totals.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/count_totals.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_type.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_type.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_type.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_type.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_type.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_type.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_type.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_type.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_type_metrics.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_type_metrics.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_type_metrics.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_type_metrics.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_type_metrics.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_type_metrics.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_type_metrics.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_type_metrics.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_types.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_types.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_types.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_types.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_types.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_types.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_types.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_types_metrics.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_types_metrics.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_types_metrics.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_types_metrics.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_types_metrics.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_types_metrics.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_types_metrics.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_rule_types_metrics.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_status.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_status.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_status.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_status.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_status.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_status.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_status.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_status.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_statuses.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_statuses.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_statuses.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_statuses.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_statuses.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_statuses.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_statuses.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_agg_by_statuses.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_by_type_and_status.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_by_type_and_status.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/get_event_log_by_type_and_status.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_event_log_by_type_and_status.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/get_search_for_all_rules.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_search_for_all_rules.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/get_search_for_all_rules.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_search_for_all_rules.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/get_search_for_all_rules.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_search_for_all_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/get_search_for_all_rules.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_search_for_all_rules.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/get_search_for_custom_rules.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_search_for_custom_rules.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/get_search_for_custom_rules.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_search_for_custom_rules.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/get_search_for_custom_rules.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_search_for_custom_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/get_search_for_custom_rules.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_search_for_custom_rules.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/get_search_for_elastic_rules.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_search_for_elastic_rules.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/get_search_for_elastic_rules.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_search_for_elastic_rules.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/get_search_for_elastic_rules.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_search_for_elastic_rules.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/get_search_for_elastic_rules.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/get_search_for_elastic_rules.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/transform_categories.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/transform_categories.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/transform_categories.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/transform_categories.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/transform_categories.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/transform_categories.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/transform_categories.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/transform_categories.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/transform_category_bucket.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/transform_category_bucket.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/transform_category_bucket.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/transform_category_bucket.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/transform_category_bucket.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/transform_category_bucket.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/transform_category_bucket.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/transform_category_bucket.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/transform_event_log_type_status.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/transform_event_log_type_status.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/transform_event_log_type_status.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/transform_event_log_type_status.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/transform_event_log_type_status.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/transform_event_log_type_status.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/transform_event_log_type_status.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/transform_event_log_type_status.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/transform_single_rule_metric.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/transform_single_rule_metric.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/transform_single_rule_metric.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/transform_single_rule_metric.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/queries/utils/transform_single_rule_metric.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/transform_single_rule_metric.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/queries/utils/transform_single_rule_metric.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/queries/utils/transform_single_rule_metric.ts diff --git a/x-pack/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.mocks.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.mocks.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.mocks.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.mocks.ts diff --git a/x-pack/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.test.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.test.ts diff --git a/x-pack/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/risk_engine/get_risk_engine_metrics.ts diff --git a/x-pack/plugins/security_solution/server/usage/risk_engine/schema.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/risk_engine/schema.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/risk_engine/schema.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/risk_engine/schema.ts diff --git a/x-pack/plugins/security_solution/server/usage/risk_engine/types.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/risk_engine/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/risk_engine/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/risk_engine/types.ts diff --git a/x-pack/plugins/security_solution/server/usage/types.ts b/x-pack/solutions/security/plugins/security_solution/server/usage/types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/usage/types.ts rename to x-pack/solutions/security/plugins/security_solution/server/usage/types.ts diff --git a/x-pack/plugins/security_solution/server/utils/build_query/calculate_timeseries_interval.ts b/x-pack/solutions/security/plugins/security_solution/server/utils/build_query/calculate_timeseries_interval.ts similarity index 100% rename from x-pack/plugins/security_solution/server/utils/build_query/calculate_timeseries_interval.ts rename to x-pack/solutions/security/plugins/security_solution/server/utils/build_query/calculate_timeseries_interval.ts diff --git a/x-pack/plugins/security_solution/server/utils/build_query/filters.ts b/x-pack/solutions/security/plugins/security_solution/server/utils/build_query/filters.ts similarity index 100% rename from x-pack/plugins/security_solution/server/utils/build_query/filters.ts rename to x-pack/solutions/security/plugins/security_solution/server/utils/build_query/filters.ts diff --git a/x-pack/plugins/security_solution/server/utils/build_query/index.ts b/x-pack/solutions/security/plugins/security_solution/server/utils/build_query/index.ts similarity index 100% rename from x-pack/plugins/security_solution/server/utils/build_query/index.ts rename to x-pack/solutions/security/plugins/security_solution/server/utils/build_query/index.ts diff --git a/x-pack/plugins/security_solution/server/utils/build_query/merge_fields_with_hits.test.ts b/x-pack/solutions/security/plugins/security_solution/server/utils/build_query/merge_fields_with_hits.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/utils/build_query/merge_fields_with_hits.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/utils/build_query/merge_fields_with_hits.test.ts diff --git a/x-pack/plugins/security_solution/server/utils/build_query/merge_fields_with_hits.ts b/x-pack/solutions/security/plugins/security_solution/server/utils/build_query/merge_fields_with_hits.ts similarity index 100% rename from x-pack/plugins/security_solution/server/utils/build_query/merge_fields_with_hits.ts rename to x-pack/solutions/security/plugins/security_solution/server/utils/build_query/merge_fields_with_hits.ts diff --git a/x-pack/plugins/security_solution/server/utils/build_query/reduce_fields.test.ts b/x-pack/solutions/security/plugins/security_solution/server/utils/build_query/reduce_fields.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/utils/build_query/reduce_fields.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/utils/build_query/reduce_fields.test.ts diff --git a/x-pack/plugins/security_solution/server/utils/build_query/reduce_fields.ts b/x-pack/solutions/security/plugins/security_solution/server/utils/build_query/reduce_fields.ts similarity index 100% rename from x-pack/plugins/security_solution/server/utils/build_query/reduce_fields.ts rename to x-pack/solutions/security/plugins/security_solution/server/utils/build_query/reduce_fields.ts diff --git a/x-pack/plugins/security_solution/server/utils/build_validation/route_validation.test.ts b/x-pack/solutions/security/plugins/security_solution/server/utils/build_validation/route_validation.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/utils/build_validation/route_validation.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/utils/build_validation/route_validation.test.ts diff --git a/x-pack/plugins/security_solution/server/utils/build_validation/route_validation.ts b/x-pack/solutions/security/plugins/security_solution/server/utils/build_validation/route_validation.ts similarity index 100% rename from x-pack/plugins/security_solution/server/utils/build_validation/route_validation.ts rename to x-pack/solutions/security/plugins/security_solution/server/utils/build_validation/route_validation.ts diff --git a/x-pack/plugins/security_solution/server/utils/custom_http_request_error.ts b/x-pack/solutions/security/plugins/security_solution/server/utils/custom_http_request_error.ts similarity index 100% rename from x-pack/plugins/security_solution/server/utils/custom_http_request_error.ts rename to x-pack/solutions/security/plugins/security_solution/server/utils/custom_http_request_error.ts diff --git a/x-pack/plugins/security_solution/server/utils/error_helpers.ts b/x-pack/solutions/security/plugins/security_solution/server/utils/error_helpers.ts similarity index 100% rename from x-pack/plugins/security_solution/server/utils/error_helpers.ts rename to x-pack/solutions/security/plugins/security_solution/server/utils/error_helpers.ts diff --git a/x-pack/solutions/security/plugins/security_solution/server/utils/jest.config.js b/x-pack/solutions/security/plugins/security_solution/server/utils/jest.config.js new file mode 100644 index 0000000000000..aac14976a7e7f --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/server/utils/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution/server/utils'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution/server/utils', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution/server/utils/**/*.{ts,tsx}', + ], + moduleNameMapper: require('../__mocks__/module_name_map'), +}; diff --git a/x-pack/plugins/security_solution/server/utils/object_case_converters.ts b/x-pack/solutions/security/plugins/security_solution/server/utils/object_case_converters.ts similarity index 100% rename from x-pack/plugins/security_solution/server/utils/object_case_converters.ts rename to x-pack/solutions/security/plugins/security_solution/server/utils/object_case_converters.ts diff --git a/x-pack/plugins/security_solution/server/utils/promise_pool.test.ts b/x-pack/solutions/security/plugins/security_solution/server/utils/promise_pool.test.ts similarity index 100% rename from x-pack/plugins/security_solution/server/utils/promise_pool.test.ts rename to x-pack/solutions/security/plugins/security_solution/server/utils/promise_pool.test.ts diff --git a/x-pack/plugins/security_solution/server/utils/promise_pool.ts b/x-pack/solutions/security/plugins/security_solution/server/utils/promise_pool.ts similarity index 100% rename from x-pack/plugins/security_solution/server/utils/promise_pool.ts rename to x-pack/solutions/security/plugins/security_solution/server/utils/promise_pool.ts diff --git a/x-pack/plugins/security_solution/server/utils/read_stream/create_stream_from_ndjson.ts b/x-pack/solutions/security/plugins/security_solution/server/utils/read_stream/create_stream_from_ndjson.ts similarity index 100% rename from x-pack/plugins/security_solution/server/utils/read_stream/create_stream_from_ndjson.ts rename to x-pack/solutions/security/plugins/security_solution/server/utils/read_stream/create_stream_from_ndjson.ts diff --git a/x-pack/plugins/security_solution/server/utils/route_limited_concurrency_tag.ts b/x-pack/solutions/security/plugins/security_solution/server/utils/route_limited_concurrency_tag.ts similarity index 100% rename from x-pack/plugins/security_solution/server/utils/route_limited_concurrency_tag.ts rename to x-pack/solutions/security/plugins/security_solution/server/utils/route_limited_concurrency_tag.ts diff --git a/x-pack/plugins/security_solution/server/utils/runtime_types.ts b/x-pack/solutions/security/plugins/security_solution/server/utils/runtime_types.ts similarity index 100% rename from x-pack/plugins/security_solution/server/utils/runtime_types.ts rename to x-pack/solutions/security/plugins/security_solution/server/utils/runtime_types.ts diff --git a/x-pack/plugins/security_solution/server/utils/serialized_query.ts b/x-pack/solutions/security/plugins/security_solution/server/utils/serialized_query.ts similarity index 100% rename from x-pack/plugins/security_solution/server/utils/serialized_query.ts rename to x-pack/solutions/security/plugins/security_solution/server/utils/serialized_query.ts diff --git a/x-pack/plugins/security_solution/server/utils/typed_elasticsearch_mappings.ts b/x-pack/solutions/security/plugins/security_solution/server/utils/typed_elasticsearch_mappings.ts similarity index 100% rename from x-pack/plugins/security_solution/server/utils/typed_elasticsearch_mappings.ts rename to x-pack/solutions/security/plugins/security_solution/server/utils/typed_elasticsearch_mappings.ts diff --git a/x-pack/plugins/security_solution/server/utils/with_security_span.ts b/x-pack/solutions/security/plugins/security_solution/server/utils/with_security_span.ts similarity index 100% rename from x-pack/plugins/security_solution/server/utils/with_security_span.ts rename to x-pack/solutions/security/plugins/security_solution/server/utils/with_security_span.ts diff --git a/x-pack/solutions/security/plugins/security_solution/tsconfig.json b/x-pack/solutions/security/plugins/security_solution/tsconfig.json new file mode 100644 index 0000000000000..7729f14bca7e9 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution/tsconfig.json @@ -0,0 +1,240 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*", + "scripts/**/*", + // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 + "common/**/*.json", + "server/**/*.json", + "scripts/**/*.json", + "public/**/*.json", + "../../../../../typings/**/*" + ], + "exclude": [ + "target/**/*", + "**/cypress/**", + "public/management/cypress.config.ts" + ], + "kbn_references": [ + "@kbn/core", + { + "path": "../../../../../src/setup_node_env/tsconfig.json" + }, + "@kbn/data-plugin", + "@kbn/embeddable-plugin", + "@kbn/files-plugin", + "@kbn/home-plugin", + "@kbn/inspector-plugin", + "@kbn/ui-actions-plugin", + "@kbn/newsfeed-plugin", + "@kbn/usage-collection-plugin", + "@kbn/telemetry-plugin", + "@kbn/data-view-field-editor-plugin", + "@kbn/unified-search-plugin", + "@kbn/actions-plugin", + "@kbn/alerting-plugin", + "@kbn/cases-plugin", + "@kbn/cloud-security-posture-plugin", + "@kbn/encrypted-saved-objects-plugin", + "@kbn/features-plugin", + "@kbn/fleet-plugin", + "@kbn/kubernetes-security-plugin", + "@kbn/licensing-plugin", + "@kbn/lists-plugin", + "@kbn/maps-plugin", + "@kbn/ml-plugin", + "@kbn/osquery-plugin", + "@kbn/session-view-plugin", + "@kbn/security-plugin", + "@kbn/spaces-plugin", + "@kbn/threat-intelligence-plugin", + "@kbn/timelines-plugin", + "@kbn/es-query", + "@kbn/utility-types", + "@kbn/securitysolution-list-utils", + "@kbn/securitysolution-io-ts-list-types", + "@kbn/securitysolution-io-ts-alerting-types", + "@kbn/test", + "@kbn/std", + "@kbn/rule-data-utils", + "@kbn/securitysolution-t-grid", + "@kbn/rule-registry-plugin", + "@kbn/securitysolution-utils", + "@kbn/securitysolution-list-constants", + "@kbn/config-schema", + "@kbn/triggers-actions-ui-plugin", + "@kbn/securitysolution-io-ts-types", + "@kbn/securitysolution-io-ts-utils", + "@kbn/osquery-io-ts-types", + "@kbn/core-capabilities-common", + "@kbn/es-ui-shared-plugin", + "@kbn/i18n", + "@kbn/kibana-utils-plugin", + "@kbn/lens-plugin", + "@kbn/dashboard-plugin", + "@kbn/saved-objects-tagging-oss-plugin", + "@kbn/guided-onboarding-plugin", + "@kbn/i18n-react", + "@kbn/kibana-react-plugin", + "@kbn/ecs-data-quality-dashboard", + "@kbn/elastic-assistant", + "@kbn/elastic-assistant-plugin", + "@kbn/data-views-plugin", + "@kbn/datemath", + "@kbn/ui-theme", + "@kbn/securitysolution-list-api", + "@kbn/core-http-browser", + "@kbn/core-http-browser-mocks", + "@kbn/securitysolution-list-hooks", + "@kbn/securitysolution-exception-list-components", + "@kbn/securitysolution-exceptions-common", + "@kbn/rison", + "@kbn/shared-ux-page-kibana-template", + "@kbn/securitysolution-hook-utils", + "@kbn/test-jest-helpers", + "@kbn/safer-lodash-set", + "@kbn/securitysolution-autocomplete", + "@kbn/core-application-browser", + "@kbn/expect", + "@kbn/share-plugin", + "@kbn/analytics", + "@kbn/core-notifications-browser", + "@kbn/doc-links", + "@kbn/react-field", + "@kbn/field-types", + "@kbn/securitysolution-rules", + "@kbn/cases-components", + "@kbn/event-log-plugin", + "@kbn/task-manager-plugin", + "@kbn/cloud-plugin", + "@kbn/core-saved-objects-utils-server", + "@kbn/core-http-router-server-mocks", + "@kbn/core-elasticsearch-client-server-mocks", + "@kbn/apm-utils", + "@kbn/core-saved-objects-server", + "@kbn/es-types", + "@kbn/utils", + "@kbn/logging-mocks", + "@kbn/securitysolution-es-utils", + "@kbn/logging", + "@kbn/utility-types-jest", + "@kbn/core-elasticsearch-server", + "@kbn/core-saved-objects-api-server", + "@kbn/core-http-server", + "@kbn/dev-cli-runner", + "@kbn/dev-cli-errors", + "@kbn/dev-utils", + "@kbn/tooling-log", + "@kbn/core-status-common", + "@kbn/repo-info", + "@kbn/storybook", + "@kbn/controls-plugin", + "@kbn/core-saved-objects-common", + "@kbn/core-saved-objects-import-export-server-mocks", + "@kbn/user-profile-components", + "@kbn/guided-onboarding", + "@kbn/securitysolution-ecs", + "@kbn/cell-actions", + "@kbn/shared-ux-router", + "@kbn/charts-plugin", + "@kbn/alerts-as-data-utils", + "@kbn/cloud-defend-plugin", + "@kbn/expandable-flyout", + "@kbn/grouping", + "@kbn/securitysolution-data-table", + "@kbn/core-analytics-server", + "@kbn/security-solution-side-nav", + "@kbn/ml-anomaly-utils", + "@kbn/discover-plugin", + "@kbn/field-formats-plugin", + "@kbn/expressions-plugin", + "@kbn/dev-proc-runner", + "@kbn/alerts-ui-shared", + "@kbn/security-solution-navigation", + "@kbn/security-solution-upselling", + "@kbn/discover-plugin", + "@kbn/data-view-editor-plugin", + "@kbn/alerts-ui-shared", + "@kbn/saved-search-plugin", + "@kbn/unified-histogram-plugin", + "@kbn/navigation-plugin", + "@kbn/core-logging-server-mocks", + "@kbn/core-lifecycle-browser", + "@kbn/security-solution-features", + "@kbn/content-management-plugin", + "@kbn/discover-utils", + "@kbn/core-application-common", + "@kbn/openapi-generator", + "@kbn/openapi-bundler", + "@kbn/es", + "@kbn/react-kibana-mount", + "@kbn/react-kibana-context-styled", + "@kbn/unified-doc-viewer-plugin", + "@kbn/openapi-generator", + "@kbn/unified-data-table", + "@kbn/unified-doc-viewer", + "@kbn/dom-drag-drop", + "@kbn/unified-field-list", + "@kbn/resizable-layout", + "@kbn/zod-helpers", + "@kbn/core-http-common", + "@kbn/search-errors", + "@kbn/stack-connectors-plugin", + "@kbn/elastic-assistant-common", + "@kbn/core-elasticsearch-server-mocks", + "@kbn/lens-embeddable-utils", + "@kbn/esql-utils", + "@kbn/core-test-helpers-kbn-server", + "@kbn/core-ui-settings-server", + "@kbn/core-http-request-handler-context-server", + "@kbn/core-http-server-mocks", + "@kbn/data-service", + "@kbn/core-chrome-browser", + "@kbn/shared-ux-chrome-navigation", + "@kbn/core-ui-settings-browser-mocks", + "@kbn/management-plugin", + "@kbn/security-plugin-types-server", + "@kbn/deeplinks-security", + "@kbn/react-kibana-context-render", + "@kbn/search-types", + "@kbn/field-utils", + "@kbn/core-saved-objects-api-server-mocks", + "@kbn/core-analytics-browser", + "@kbn/core-i18n-browser", + "@kbn/core-theme-browser", + "@kbn/integration-assistant-plugin", + "@kbn/avc-banner", + "@kbn/config", + "@kbn/openapi-common", + "@kbn/securitysolution-lists-common", + "@kbn/cbor", + "@kbn/zod", + "@kbn/cloud-security-posture", + "@kbn/security-solution-distribution-bar", + "@kbn/cloud-security-posture-common", + "@kbn/cloud-security-posture-graph", + "@kbn/presentation-publishing", + "@kbn/entityManager-plugin", + "@kbn/entities-schema", + "@kbn/inference-plugin", + "@kbn/core-saved-objects-server-mocks", + "@kbn/core-security-server-mocks", + "@kbn/serverless", + "@kbn/core-user-profile-browser", + "@kbn/data-stream-adapter", + "@kbn/core-lifecycle-server", + "@kbn/core-user-profile-common", + "@kbn/langchain", + "@kbn/discover-shared-plugin", + "@kbn/react-hooks", + "@kbn/index-adapter", + "@kbn/core-http-server-utils", + "@kbn/llm-tasks-plugin", + "@kbn/ai-assistant-icon" + ] +} diff --git a/x-pack/plugins/security_solution_ess/.gitignore b/x-pack/solutions/security/plugins/security_solution_ess/.gitignore similarity index 100% rename from x-pack/plugins/security_solution_ess/.gitignore rename to x-pack/solutions/security/plugins/security_solution_ess/.gitignore diff --git a/x-pack/solutions/security/plugins/security_solution_ess/README.md b/x-pack/solutions/security/plugins/security_solution_ess/README.md new file mode 100755 index 0000000000000..e2d5bdcb699f3 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution_ess/README.md @@ -0,0 +1,76 @@ +# **Security Solution ESS Plugin** + +## **Table of Contents** +- [Introduction](#introduction) +- [Purpose](#purpose) +- [Architecture](#architecture) +- [Contributing](#contributing) +- [License](#license) + +## **Introduction** +The `security_solution_ess` plugin is an internal plugin for Kibana's Security Solution, designed to encapsulate ESS-specific logic. +This plugin is only enabled when the application is built for stateful deployments (ESS or on-prem), keeping the main `security_solution` plugin clean and agnostic of the offering model. + +> The term ESS used by this plugin is not strictly referring to Cloud deployments, it's used to refer to all stateful deployments (non-serverless), including on-prem instances. + +## **Purpose** +The primary goal of the `security_solution_ess` plugin is to: +- Isolate ess-specific code and configuration from the main `security_solution` plugin. +- Enable seamless integration with the non-serverless environment without affecting the serverless build of the Security Solution. +- Provide a modular approach by encapsulating ess-related functionality, thereby maintaining the codebase's cleanliness and modularity. + +## **Architecture** +The `security_solution_ess` plugin depends on the main `security_solution` plugin, it can import code from it though the use of agnostic packages is preferred, and they interact through the plugin lifecycle contract. +This architecture allows the `security_solution_ess` plugin to: +- Modify the behavior of the main plugin by providing ess-specific content. +- Ensure that the `security_solution` plugin remains offering-agnostic by using APIs for ess-specific behavior only when necessary. + +### **Plugin Interaction** +- **Generic Plugin (`security_solution`)**: Exposes an API in its plugin lifecycle contract for components and configurations that depend on the offering. +- **ESS Plugin (`security_solution_ess`)**: Utilizes the exposed API to inject or modify the application according to ess-specific content and logic. +- **Other Plugins**: Other plugins may also expose contract APIs to configure ess-specific content for Security. + +#### **Example** + +The following example demonstrates how the `security_solution_ess` plugin interacts with the main `security_solution` plugin via a contract API. + +It exposes a setter to the contract API for `usersUrl`, which is an offering-specific value. The `security_solution_ess` plugin uses these APIs to inject the ess-specific URL into the main plugin. + +The `PluginContract` class in the main Security Solution plugin simplifies the usage of contract APIs, storing the values and providing a getter to the application using the Kibana services context. + +___security_solution/public/plugin_contract.ts___ +```typescript +export class PluginContract { + usersUrl: string; + + public getStartContract() { + return { + setUsersUrl: (url: string) => { + this.usersUrl = url; + } + }; + } + + public getStartServices() { + return { + getUsersUrl: () => this.usersUrl; // available via useKibana().services.getUsersUrl() + }; + } +} +``` + +___security_solution_ess/public/plugin.ts___ +```typescript +export class Plugin { + + public start(core: CoreStart, deps: SecuritySolutionEssStartDeps) { + deps.securitySolution.setUsersUrl(deps.application.getUrlForApp('management', { path: 'security/users' })); + } +} +``` + +## **Contributing** +If you're looking to contribute to this plugin, please follow the standard contribution guidelines of the Security Solution plugin. Ensure that all changes are tested in a ESS environment. + +## **License** +This plugin is licensed under the Elastic License. See the [LICENSE](../../../../../LICENSE.txt) file for more details. diff --git a/x-pack/plugins/security_solution_ess/common/index.ts b/x-pack/solutions/security/plugins/security_solution_ess/common/index.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/common/index.ts rename to x-pack/solutions/security/plugins/security_solution_ess/common/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution_ess/jest.config.dev.js b/x-pack/solutions/security/plugins/security_solution_ess/jest.config.dev.js new file mode 100644 index 0000000000000..7a6d250e65f6d --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution_ess/jest.config.dev.js @@ -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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../', + projects: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution_ess/public/jest.config.js', + ], +}; diff --git a/x-pack/plugins/security_solution_ess/kibana.jsonc b/x-pack/solutions/security/plugins/security_solution_ess/kibana.jsonc similarity index 100% rename from x-pack/plugins/security_solution_ess/kibana.jsonc rename to x-pack/solutions/security/plugins/security_solution_ess/kibana.jsonc diff --git a/x-pack/solutions/security/plugins/security_solution_ess/package.json b/x-pack/solutions/security/plugins/security_solution_ess/package.json new file mode 100644 index 0000000000000..c37b45313f1cc --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution_ess/package.json @@ -0,0 +1,11 @@ +{ + "name": "@kbn/security-solution-ess", + "version": "1.0.0", + "license": "Elastic License 2.0", + "private": true, + "scripts": { + "build": "yarn plugin-helpers build", + "plugin-helpers": "node ../../../../../scripts/plugin_helpers", + "kbn": "node ../../../../../scripts/kbn" + } +} diff --git a/x-pack/plugins/security_solution_ess/public/common/__mocks__/services.mock.ts b/x-pack/solutions/security/plugins/security_solution_ess/public/common/__mocks__/services.mock.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/public/common/__mocks__/services.mock.ts rename to x-pack/solutions/security/plugins/security_solution_ess/public/common/__mocks__/services.mock.ts diff --git a/x-pack/plugins/security_solution_ess/public/common/__mocks__/services.tsx b/x-pack/solutions/security/plugins/security_solution_ess/public/common/__mocks__/services.tsx similarity index 100% rename from x-pack/plugins/security_solution_ess/public/common/__mocks__/services.tsx rename to x-pack/solutions/security/plugins/security_solution_ess/public/common/__mocks__/services.tsx diff --git a/x-pack/plugins/security_solution_ess/public/common/services.tsx b/x-pack/solutions/security/plugins/security_solution_ess/public/common/services.tsx similarity index 100% rename from x-pack/plugins/security_solution_ess/public/common/services.tsx rename to x-pack/solutions/security/plugins/security_solution_ess/public/common/services.tsx diff --git a/x-pack/plugins/security_solution_ess/public/index.ts b/x-pack/solutions/security/plugins/security_solution_ess/public/index.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/public/index.ts rename to x-pack/solutions/security/plugins/security_solution_ess/public/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution_ess/public/jest.config.js b/x-pack/solutions/security/plugins/security_solution_ess/public/jest.config.js new file mode 100644 index 0000000000000..81d13b77725ca --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution_ess/public/jest.config.js @@ -0,0 +1,28 @@ +/* + * 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. + */ +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../..', + /** all nested directories have their own Jest config file */ + testMatch: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution_ess/public/**/*.test.{js,mjs,ts,tsx}', + ], + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution_ess/public'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution_ess/public', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution_ess/public/**/*.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_ess/public/*.test.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_ess/public/{__test__,__snapshots__,__examples__,*mock*,tests,test_helpers,integration_tests,types}/**/*', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_ess/public/*mock*.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_ess/public/*.test.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_ess/public/*.d.ts', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_ess/public/*.config.ts', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_ess/public/index.{js,ts,tsx}', + ], +}; diff --git a/x-pack/plugins/security_solution_ess/public/navigation/breadcrumbs.ts b/x-pack/solutions/security/plugins/security_solution_ess/public/navigation/breadcrumbs.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/public/navigation/breadcrumbs.ts rename to x-pack/solutions/security/plugins/security_solution_ess/public/navigation/breadcrumbs.ts diff --git a/x-pack/plugins/security_solution_ess/public/navigation/index.ts b/x-pack/solutions/security/plugins/security_solution_ess/public/navigation/index.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/public/navigation/index.ts rename to x-pack/solutions/security/plugins/security_solution_ess/public/navigation/index.ts diff --git a/x-pack/plugins/security_solution_ess/public/navigation/side_navigation.ts b/x-pack/solutions/security/plugins/security_solution_ess/public/navigation/side_navigation.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/public/navigation/side_navigation.ts rename to x-pack/solutions/security/plugins/security_solution_ess/public/navigation/side_navigation.ts diff --git a/x-pack/plugins/security_solution_ess/public/onboarding/index.ts b/x-pack/solutions/security/plugins/security_solution_ess/public/onboarding/index.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/public/onboarding/index.ts rename to x-pack/solutions/security/plugins/security_solution_ess/public/onboarding/index.ts diff --git a/x-pack/plugins/security_solution_ess/public/onboarding/onboarding.ts b/x-pack/solutions/security/plugins/security_solution_ess/public/onboarding/onboarding.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/public/onboarding/onboarding.ts rename to x-pack/solutions/security/plugins/security_solution_ess/public/onboarding/onboarding.ts diff --git a/x-pack/plugins/security_solution_ess/public/plugin.ts b/x-pack/solutions/security/plugins/security_solution_ess/public/plugin.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/public/plugin.ts rename to x-pack/solutions/security/plugins/security_solution_ess/public/plugin.ts diff --git a/x-pack/plugins/security_solution_ess/public/types.ts b/x-pack/solutions/security/plugins/security_solution_ess/public/types.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/public/types.ts rename to x-pack/solutions/security/plugins/security_solution_ess/public/types.ts diff --git a/x-pack/plugins/security_solution_ess/public/upselling/lazy_upselling.tsx b/x-pack/solutions/security/plugins/security_solution_ess/public/upselling/lazy_upselling.tsx similarity index 100% rename from x-pack/plugins/security_solution_ess/public/upselling/lazy_upselling.tsx rename to x-pack/solutions/security/plugins/security_solution_ess/public/upselling/lazy_upselling.tsx diff --git a/x-pack/plugins/security_solution_ess/public/upselling/pages/attack_discovery/index.test.tsx b/x-pack/solutions/security/plugins/security_solution_ess/public/upselling/pages/attack_discovery/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution_ess/public/upselling/pages/attack_discovery/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution_ess/public/upselling/pages/attack_discovery/index.test.tsx diff --git a/x-pack/plugins/security_solution_ess/public/upselling/pages/attack_discovery/index.tsx b/x-pack/solutions/security/plugins/security_solution_ess/public/upselling/pages/attack_discovery/index.tsx similarity index 100% rename from x-pack/plugins/security_solution_ess/public/upselling/pages/attack_discovery/index.tsx rename to x-pack/solutions/security/plugins/security_solution_ess/public/upselling/pages/attack_discovery/index.tsx diff --git a/x-pack/plugins/security_solution_ess/public/upselling/pages/attack_discovery/translations.ts b/x-pack/solutions/security/plugins/security_solution_ess/public/upselling/pages/attack_discovery/translations.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/public/upselling/pages/attack_discovery/translations.ts rename to x-pack/solutions/security/plugins/security_solution_ess/public/upselling/pages/attack_discovery/translations.ts diff --git a/x-pack/plugins/security_solution_ess/public/upselling/pages/attack_discovery/upgrade_actions/index.test.tsx b/x-pack/solutions/security/plugins/security_solution_ess/public/upselling/pages/attack_discovery/upgrade_actions/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution_ess/public/upselling/pages/attack_discovery/upgrade_actions/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution_ess/public/upselling/pages/attack_discovery/upgrade_actions/index.test.tsx diff --git a/x-pack/plugins/security_solution_ess/public/upselling/pages/attack_discovery/upgrade_actions/index.tsx b/x-pack/solutions/security/plugins/security_solution_ess/public/upselling/pages/attack_discovery/upgrade_actions/index.tsx similarity index 100% rename from x-pack/plugins/security_solution_ess/public/upselling/pages/attack_discovery/upgrade_actions/index.tsx rename to x-pack/solutions/security/plugins/security_solution_ess/public/upselling/pages/attack_discovery/upgrade_actions/index.tsx diff --git a/x-pack/plugins/security_solution_ess/public/upselling/pages/attack_discovery/upgrade_actions/translations.ts b/x-pack/solutions/security/plugins/security_solution_ess/public/upselling/pages/attack_discovery/upgrade_actions/translations.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/public/upselling/pages/attack_discovery/upgrade_actions/translations.ts rename to x-pack/solutions/security/plugins/security_solution_ess/public/upselling/pages/attack_discovery/upgrade_actions/translations.ts diff --git a/x-pack/plugins/security_solution_ess/public/upselling/pages/entity_analytics_upselling.tsx b/x-pack/solutions/security/plugins/security_solution_ess/public/upselling/pages/entity_analytics_upselling.tsx similarity index 100% rename from x-pack/plugins/security_solution_ess/public/upselling/pages/entity_analytics_upselling.tsx rename to x-pack/solutions/security/plugins/security_solution_ess/public/upselling/pages/entity_analytics_upselling.tsx diff --git a/x-pack/plugins/security_solution_ess/public/upselling/register_upsellings.test.tsx b/x-pack/solutions/security/plugins/security_solution_ess/public/upselling/register_upsellings.test.tsx similarity index 100% rename from x-pack/plugins/security_solution_ess/public/upselling/register_upsellings.test.tsx rename to x-pack/solutions/security/plugins/security_solution_ess/public/upselling/register_upsellings.test.tsx diff --git a/x-pack/plugins/security_solution_ess/public/upselling/register_upsellings.tsx b/x-pack/solutions/security/plugins/security_solution_ess/public/upselling/register_upsellings.tsx similarity index 100% rename from x-pack/plugins/security_solution_ess/public/upselling/register_upsellings.tsx rename to x-pack/solutions/security/plugins/security_solution_ess/public/upselling/register_upsellings.tsx diff --git a/x-pack/plugins/security_solution_ess/public/upselling/sections/entity_analytics_upselling.tsx b/x-pack/solutions/security/plugins/security_solution_ess/public/upselling/sections/entity_analytics_upselling.tsx similarity index 100% rename from x-pack/plugins/security_solution_ess/public/upselling/sections/entity_analytics_upselling.tsx rename to x-pack/solutions/security/plugins/security_solution_ess/public/upselling/sections/entity_analytics_upselling.tsx diff --git a/x-pack/plugins/security_solution_ess/public/upselling/translations.ts b/x-pack/solutions/security/plugins/security_solution_ess/public/upselling/translations.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/public/upselling/translations.ts rename to x-pack/solutions/security/plugins/security_solution_ess/public/upselling/translations.ts diff --git a/x-pack/plugins/security_solution_ess/server/config.ts b/x-pack/solutions/security/plugins/security_solution_ess/server/config.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/server/config.ts rename to x-pack/solutions/security/plugins/security_solution_ess/server/config.ts diff --git a/x-pack/plugins/security_solution_ess/server/constants.ts b/x-pack/solutions/security/plugins/security_solution_ess/server/constants.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/server/constants.ts rename to x-pack/solutions/security/plugins/security_solution_ess/server/constants.ts diff --git a/x-pack/plugins/security_solution_ess/server/index.ts b/x-pack/solutions/security/plugins/security_solution_ess/server/index.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/server/index.ts rename to x-pack/solutions/security/plugins/security_solution_ess/server/index.ts diff --git a/x-pack/plugins/security_solution_ess/server/plugin.ts b/x-pack/solutions/security/plugins/security_solution_ess/server/plugin.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/server/plugin.ts rename to x-pack/solutions/security/plugins/security_solution_ess/server/plugin.ts diff --git a/x-pack/plugins/security_solution_ess/server/product_features/assistant_product_features_config.ts b/x-pack/solutions/security/plugins/security_solution_ess/server/product_features/assistant_product_features_config.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/server/product_features/assistant_product_features_config.ts rename to x-pack/solutions/security/plugins/security_solution_ess/server/product_features/assistant_product_features_config.ts diff --git a/x-pack/plugins/security_solution_ess/server/product_features/attack_discovery_product_features_config.ts b/x-pack/solutions/security/plugins/security_solution_ess/server/product_features/attack_discovery_product_features_config.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/server/product_features/attack_discovery_product_features_config.ts rename to x-pack/solutions/security/plugins/security_solution_ess/server/product_features/attack_discovery_product_features_config.ts diff --git a/x-pack/plugins/security_solution_ess/server/product_features/cases_product_features_config.ts b/x-pack/solutions/security/plugins/security_solution_ess/server/product_features/cases_product_features_config.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/server/product_features/cases_product_features_config.ts rename to x-pack/solutions/security/plugins/security_solution_ess/server/product_features/cases_product_features_config.ts diff --git a/x-pack/plugins/security_solution_ess/server/product_features/index.ts b/x-pack/solutions/security/plugins/security_solution_ess/server/product_features/index.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/server/product_features/index.ts rename to x-pack/solutions/security/plugins/security_solution_ess/server/product_features/index.ts diff --git a/x-pack/plugins/security_solution_ess/server/product_features/security_product_features_config.ts b/x-pack/solutions/security/plugins/security_solution_ess/server/product_features/security_product_features_config.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/server/product_features/security_product_features_config.ts rename to x-pack/solutions/security/plugins/security_solution_ess/server/product_features/security_product_features_config.ts diff --git a/x-pack/plugins/security_solution_ess/server/types.ts b/x-pack/solutions/security/plugins/security_solution_ess/server/types.ts similarity index 100% rename from x-pack/plugins/security_solution_ess/server/types.ts rename to x-pack/solutions/security/plugins/security_solution_ess/server/types.ts diff --git a/x-pack/solutions/security/plugins/security_solution_ess/tsconfig.json b/x-pack/solutions/security/plugins/security_solution_ess/tsconfig.json new file mode 100644 index 0000000000000..e3bba4e78f9c9 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution_ess/tsconfig.json @@ -0,0 +1,30 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "index.ts", + "common/**/*.ts", + "public/**/*.ts", + "public/**/*.tsx", + "server/**/*.ts", + "../../../../../typings/**/*" + ], + "exclude": ["target/**/*"], + "kbn_references": [ + "@kbn/core", + "@kbn/config-schema", + "@kbn/security-solution-plugin", + "@kbn/kibana-react-plugin", + "@kbn/security-solution-features", + "@kbn/cases-plugin", + "@kbn/security-solution-navigation", + "@kbn/licensing-plugin", + "@kbn/security-solution-upselling", + "@kbn/i18n", + "@kbn/navigation-plugin", + "@kbn/management-plugin", + "@kbn/core-chrome-browser", + ] +} diff --git a/x-pack/plugins/security_solution_serverless/.gitignore b/x-pack/solutions/security/plugins/security_solution_serverless/.gitignore similarity index 100% rename from x-pack/plugins/security_solution_serverless/.gitignore rename to x-pack/solutions/security/plugins/security_solution_serverless/.gitignore diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/README.md b/x-pack/solutions/security/plugins/security_solution_serverless/README.md new file mode 100755 index 0000000000000..68dded9c003d6 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution_serverless/README.md @@ -0,0 +1,78 @@ +# **Security Solution Serverless Plugin** + +## **Table of Contents** +- [Introduction](#introduction) +- [Purpose](#purpose) +- [Architecture](#architecture) +- [Contributing](#contributing) +- [License](#license) + +## **Introduction** +The `security_solution_serverless` plugin is an internal plugin for Kibana's Security Solution, designed to encapsulate serverless-specific logic. +This plugin is only enabled when the application is built for serverless project, keeping the main `security_solution` plugin clean and agnostic of the offering model. + +This plugin contains configuration and code used to create a Serverless Security project. +It leverages universal configuration and other APIs in the [`serverless`](../serverless/README.mdx) plugin to configure Kibana. + +## **Purpose** +The primary goal of the `security_solution_serverless` plugin is to: +- Isolate serverless-specific code and configuration from the main `security_solution` plugin. +- Enable seamless integration with the serverless environment without affecting the non-serverless build of the Security Solution. +- Provide a modular approach by encapsulating serverless-related functionality, thereby maintaining the codebase's cleanliness and modularity. + +## **Architecture** +The `security_solution_serverless` plugin depends on the main `security_solution` plugin, it can import code from it thought the use of agnostic packages is preferred, +and they interact through the plugin lifecycle contract. +This architecture allows the `security_solution_serverless` plugin to: +- Modify the behavior of the main plugin by providing serverless-specific content. +- Ensure that the `security_solution` plugin remains offering-agnostic by using APIs for serverless-specific behavior only when necessary. + +### **Plugin Interaction** +- **Generic Plugin (`security_solution`)**: Exposes an API in its plugin lifecycle contract for components and configurations that depend on the offering. +- **Serverless Plugin (`security_solution_serverless`)**: Utilizes the exposed API to inject or modify the application according to serverless-specific content and logic. +- **Other Plugins**: Other plugins may also expose contract APIs to configure serverless-specific content for Security. + +#### **Example** + +The following example demonstrates how the `security_solution_serverless` plugin interacts with the main `security_solution` plugin via a contract API. + +It exposes a setter to the contract API for `usersUrl`, which is an offering-specific value. The `security_solution_serverless` plugin uses these APIs to inject the serverless-specific URL into the main plugin. + +The `PluginContract` class in the main Security Solution plugin simplifies the usage of contract APIs, storing the values and providing a getter to the application using the Kibana services context. + +___security_solution/public/plugin_contract.ts___ +```typescript +export class PluginContract { + usersUrl: string; + + public getStartContract() { + return { + setUsersUrl: (url: string) => { + this.usersUrl = url; + } + }; + } + + public getStartServices() { + return { + getUsersUrl: () => this.usersUrl; // available via useKibana().services.getUsersUrl() + }; + } +} +``` + +___security_solution_serverless/public/plugin.ts___ +```typescript +export class Plugin { + + public start(core: CoreStart, deps: SecuritySolutionServerlessStartDeps) { + deps.securitySolution.setUsersUrl(deps.cloud.usersAndRolesUrl); + } +} +``` + +## **Contributing** +If you're looking to contribute to this plugin, please follow the standard contribution guidelines of the Security Solution plugin. Ensure that all changes are tested in a serverless environment. + +## **License** +This plugin is licensed under the Elastic License. See the [LICENSE](../../../../../LICENSE.txt) file for more details. diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/common/config.ts b/x-pack/solutions/security/plugins/security_solution_serverless/common/config.ts new file mode 100644 index 0000000000000..2f0cc03ccb320 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution_serverless/common/config.ts @@ -0,0 +1,56 @@ +/* + * 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 { schema, type TypeOf } from '@kbn/config-schema'; +import { ProductLine, ProductTier } from './product'; + +export const productLine = schema.oneOf([ + schema.literal(ProductLine.security), + schema.literal(ProductLine.endpoint), + schema.literal(ProductLine.cloud), +]); + +export type SecurityProductLine = TypeOf<typeof productLine>; + +export const productTier = schema.oneOf([ + schema.literal(ProductTier.essentials), + schema.literal(ProductTier.complete), +]); +export type SecurityProductTier = TypeOf<typeof productTier>; + +export const productType = schema.object({ + product_line: productLine, + product_tier: productTier, +}); +export type SecurityProductType = TypeOf<typeof productType>; + +export const productTypes = schema.arrayOf<SecurityProductType>(productType, { + defaultValue: [], +}); +export type SecurityProductTypes = TypeOf<typeof productTypes>; + +export const configSchema = schema.object({ + enabled: schema.boolean({ defaultValue: false }), + productTypes, + /** + * For internal use. A list of string values (comma delimited) that will enable experimental + * type of functionality that is not yet released. Valid values for this settings need to + * be defined in: + * `x-pack/solutions/security/plugins/security_solution_serverless/common/experimental_features.ts` + * under the `allowedExperimentalValues` object + * + * @example + * xpack.securitySolutionServerless.enableExperimental: + * - someCrazyFeature + * - someEvenCrazierFeature + */ + enableExperimental: schema.arrayOf(schema.string(), { + defaultValue: () => [], + }), +}); + +export type ServerlessSecurityConfigSchema = TypeOf<typeof configSchema>; diff --git a/x-pack/plugins/security_solution_serverless/common/experimental_features.ts b/x-pack/solutions/security/plugins/security_solution_serverless/common/experimental_features.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/common/experimental_features.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/common/experimental_features.ts diff --git a/x-pack/plugins/security_solution_serverless/common/index.ts b/x-pack/solutions/security/plugins/security_solution_serverless/common/index.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/common/index.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/common/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/common/jest.config.js b/x-pack/solutions/security/plugins/security_solution_serverless/common/jest.config.js new file mode 100644 index 0000000000000..fb7f353ad2f94 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution_serverless/common/jest.config.js @@ -0,0 +1,28 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/common'], + testMatch: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/common/**/*.test.{js,mjs,ts,tsx}', + ], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution_serverless/common', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/common/**/*.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/common/*.test.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/common/{__test__,__snapshots__,__examples__,*mock*,tests,test_helpers,integration_tests,types}/**/*', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/common/*mock*.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/common/*.test.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/common/*.d.ts', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/common/*.config.ts', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/common/index.{js,ts,tsx}', + ], +}; diff --git a/x-pack/plugins/security_solution_serverless/common/pli/pli_config.ts b/x-pack/solutions/security/plugins/security_solution_serverless/common/pli/pli_config.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/common/pli/pli_config.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/common/pli/pli_config.ts diff --git a/x-pack/plugins/security_solution_serverless/common/pli/pli_features.test.ts b/x-pack/solutions/security/plugins/security_solution_serverless/common/pli/pli_features.test.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/common/pli/pli_features.test.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/common/pli/pli_features.test.ts diff --git a/x-pack/plugins/security_solution_serverless/common/pli/pli_features.ts b/x-pack/solutions/security/plugins/security_solution_serverless/common/pli/pli_features.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/common/pli/pli_features.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/common/pli/pli_features.ts diff --git a/x-pack/plugins/security_solution_serverless/common/product.ts b/x-pack/solutions/security/plugins/security_solution_serverless/common/product.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/common/product.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/common/product.ts diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/jest.config.dev.js b/x-pack/solutions/security/plugins/security_solution_serverless/jest.config.dev.js new file mode 100644 index 0000000000000..326469a6e7bbb --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution_serverless/jest.config.dev.js @@ -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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../', + projects: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/public/jest.config.js', + ], +}; diff --git a/x-pack/plugins/security_solution_serverless/kibana.jsonc b/x-pack/solutions/security/plugins/security_solution_serverless/kibana.jsonc similarity index 100% rename from x-pack/plugins/security_solution_serverless/kibana.jsonc rename to x-pack/solutions/security/plugins/security_solution_serverless/kibana.jsonc diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/package.json b/x-pack/solutions/security/plugins/security_solution_serverless/package.json new file mode 100644 index 0000000000000..7ac83f5c8f5d5 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution_serverless/package.json @@ -0,0 +1,11 @@ +{ + "name": "@kbn/security-solution-serverless", + "version": "1.0.0", + "license": "Elastic License 2.0", + "private": true, + "scripts": { + "build": "yarn plugin-helpers build", + "plugin-helpers": "node ../../../../../scripts/plugin_helpers", + "kbn": "node ../../../../../scripts/kbn" + } +} \ No newline at end of file diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/chart_arrow.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/chart_arrow.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/chart_arrow.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/chart_arrow.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/dashboard.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/dashboard.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/dashboard.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/dashboard.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/data_view.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/data_view.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/data_view.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/data_view.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/ecctl.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/ecctl.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/ecctl.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/ecctl.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/endpoint.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/endpoint.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/endpoint.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/endpoint.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/filebeat.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/filebeat.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/filebeat.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/filebeat.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/filebeat_chart.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/filebeat_chart.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/filebeat_chart.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/filebeat_chart.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/fleet.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/fleet.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/fleet.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/fleet.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/infra.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/infra.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/infra.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/infra.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/intuitive.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/intuitive.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/intuitive.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/intuitive.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/jobs.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/jobs.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/jobs.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/jobs.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/keyword.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/keyword.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/keyword.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/keyword.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/lens.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/lens.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/lens.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/lens.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/manager.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/manager.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/manager.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/manager.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/marketing.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/marketing.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/marketing.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/marketing.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/osquery.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/osquery.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/osquery.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/osquery.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/rapid_bar_graph.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/rapid_bar_graph.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/rapid_bar_graph.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/rapid_bar_graph.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/replication.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/replication.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/replication.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/replication.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/settings.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/settings.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/settings.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/settings.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/timeline.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/timeline.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/timeline.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/timeline.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/icons/visualization.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/visualization.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/icons/visualization.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/icons/visualization.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/lazy_icons.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/lazy_icons.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/lazy_icons.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/lazy_icons.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/lib/__mocks__/storage.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/lib/__mocks__/storage.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/lib/__mocks__/storage.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/lib/__mocks__/storage.ts diff --git a/x-pack/plugins/security_solution_serverless/public/common/lib/storage.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/lib/storage.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/lib/storage.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/lib/storage.ts diff --git a/x-pack/plugins/security_solution_serverless/public/common/services/__mocks__/index.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/services/__mocks__/index.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/services/__mocks__/index.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/services/__mocks__/index.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/services/__mocks__/services.mock.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/services/__mocks__/services.mock.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/services/__mocks__/services.mock.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/services/__mocks__/services.mock.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/services/create_services.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/services/create_services.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/services/create_services.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/services/create_services.ts diff --git a/x-pack/plugins/security_solution_serverless/public/common/services/index.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/services/index.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/services/index.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/services/index.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/services/services.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/services/services.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/services/services.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/services/services.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/common/services/types.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/common/services/types.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/common/services/types.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/common/services/types.ts diff --git a/x-pack/plugins/security_solution_serverless/public/components/dashboards_landing_callout/dashboard_landing_callout.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/components/dashboards_landing_callout/dashboard_landing_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/components/dashboards_landing_callout/dashboard_landing_callout.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/components/dashboards_landing_callout/dashboard_landing_callout.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/components/dashboards_landing_callout/index.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/components/dashboards_landing_callout/index.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/components/dashboards_landing_callout/index.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/components/dashboards_landing_callout/index.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/components/dashboards_landing_callout/lazy.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/components/dashboards_landing_callout/lazy.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/components/dashboards_landing_callout/lazy.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/components/dashboards_landing_callout/lazy.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/components/enablement_modal_callout/enablement_modal_callout.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/components/enablement_modal_callout/enablement_modal_callout.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/components/enablement_modal_callout/enablement_modal_callout.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/components/enablement_modal_callout/enablement_modal_callout.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/components/enablement_modal_callout/index.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/components/enablement_modal_callout/index.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/components/enablement_modal_callout/index.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/components/enablement_modal_callout/index.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/components/enablement_modal_callout/lazy.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/components/enablement_modal_callout/lazy.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/components/enablement_modal_callout/lazy.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/components/enablement_modal_callout/lazy.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/index.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/index.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/index.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/public/jest.config.js b/x-pack/solutions/security/plugins/security_solution_serverless/public/jest.config.js new file mode 100644 index 0000000000000..f9c3f86ffddb5 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution_serverless/public/jest.config.js @@ -0,0 +1,29 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../..', + /** all nested directories have their own Jest config file */ + testMatch: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/public/**/*.test.{js,mjs,ts,tsx}', + ], + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/public'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/security_solution_serverless/public', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/public/**/*.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/public/*.test.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/public/{__test__,__snapshots__,__examples__,*mock*,tests,test_helpers,integration_tests,types}/**/*', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/public/*mock*.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/public/*.test.{ts,tsx}', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/public/*.d.ts', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/public/*.config.ts', + '!<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/public/index.{js,ts,tsx}', + ], +}; diff --git a/x-pack/plugins/security_solution_serverless/public/navigation/breadcrumbs.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/navigation/breadcrumbs.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/navigation/breadcrumbs.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/navigation/breadcrumbs.ts diff --git a/x-pack/plugins/security_solution_serverless/public/navigation/index.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/navigation/index.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/navigation/index.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/navigation/index.ts diff --git a/x-pack/plugins/security_solution_serverless/public/navigation/management_cards.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/navigation/management_cards.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/navigation/management_cards.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/navigation/management_cards.ts diff --git a/x-pack/plugins/security_solution_serverless/public/navigation/side_navigation.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/navigation/side_navigation.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/navigation/side_navigation.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/navigation/side_navigation.ts diff --git a/x-pack/plugins/security_solution_serverless/public/navigation/util.test.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/navigation/util.test.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/navigation/util.test.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/navigation/util.test.ts diff --git a/x-pack/plugins/security_solution_serverless/public/navigation/util.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/navigation/util.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/navigation/util.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/navigation/util.ts diff --git a/x-pack/plugins/security_solution_serverless/public/onboarding/index.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/onboarding/index.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/onboarding/index.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/onboarding/index.ts diff --git a/x-pack/plugins/security_solution_serverless/public/onboarding/onboarding.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/onboarding/onboarding.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/onboarding/onboarding.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/onboarding/onboarding.ts diff --git a/x-pack/plugins/security_solution_serverless/public/plugin.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/plugin.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/plugin.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/plugin.ts diff --git a/x-pack/plugins/security_solution_serverless/public/types.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/types.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/types.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/types.ts diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/hooks/use_product_type_by_pli.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/hooks/use_product_type_by_pli.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/hooks/use_product_type_by_pli.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/hooks/use_product_type_by_pli.ts diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/index.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/index.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/index.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/index.ts diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/lazy_upselling.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/lazy_upselling.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/lazy_upselling.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/lazy_upselling.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/pages/attack_discovery/index.test.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/pages/attack_discovery/index.test.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/pages/attack_discovery/index.test.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/pages/attack_discovery/index.test.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/pages/attack_discovery/index.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/pages/attack_discovery/index.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/pages/attack_discovery/index.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/pages/attack_discovery/index.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/pages/attack_discovery/translations.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/pages/attack_discovery/translations.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/pages/attack_discovery/translations.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/pages/attack_discovery/translations.ts diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/pages/endpoint_management/endpoint_exceptions_details.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/pages/endpoint_management/endpoint_exceptions_details.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/pages/endpoint_management/endpoint_exceptions_details.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/pages/endpoint_management/endpoint_exceptions_details.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/pages/osquery_automated_response_actions.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/pages/osquery_automated_response_actions.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/pages/osquery_automated_response_actions.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/pages/osquery_automated_response_actions.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/pages/threat_intelligence_paywall.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/pages/threat_intelligence_paywall.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/pages/threat_intelligence_paywall.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/pages/threat_intelligence_paywall.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/register_upsellings.test.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/register_upsellings.test.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/register_upsellings.test.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/register_upsellings.test.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/register_upsellings.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/register_upsellings.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/register_upsellings.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/register_upsellings.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/sections/cloud_security_posture/cloud_security_posture_integration_pli_block.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/cloud_security_posture/cloud_security_posture_integration_pli_block.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/sections/cloud_security_posture/cloud_security_posture_integration_pli_block.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/cloud_security_posture/cloud_security_posture_integration_pli_block.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/sections/cloud_security_posture/index.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/cloud_security_posture/index.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/sections/cloud_security_posture/index.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/cloud_security_posture/index.ts diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/endpoint_agent_tamper_protection.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/endpoint_agent_tamper_protection.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/endpoint_agent_tamper_protection.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/endpoint_agent_tamper_protection.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/endpoint_custom_notification.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/endpoint_custom_notification.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/endpoint_custom_notification.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/endpoint_custom_notification.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/endpoint_policy_protections.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/endpoint_policy_protections.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/endpoint_policy_protections.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/endpoint_policy_protections.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/endpoint_protection_updates.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/endpoint_protection_updates.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/endpoint_protection_updates.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/endpoint_protection_updates.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/index.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/index.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/index.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/index.ts diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/rule_details_endpoint_exceptions.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/rule_details_endpoint_exceptions.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/rule_details_endpoint_exceptions.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/endpoint_management/rule_details_endpoint_exceptions.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/sections/integration_assistant/index.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/integration_assistant/index.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/sections/integration_assistant/index.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/integration_assistant/index.ts diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/sections/integration_assistant/integration_assistant.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/integration_assistant/integration_assistant.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/sections/integration_assistant/integration_assistant.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/sections/integration_assistant/integration_assistant.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/translations.ts b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/translations.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/translations.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/translations.ts diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/upsellings.test.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/upsellings.test.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/upsellings.test.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/upsellings.test.tsx diff --git a/x-pack/plugins/security_solution_serverless/public/upselling/upsellings.tsx b/x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/upsellings.tsx similarity index 100% rename from x-pack/plugins/security_solution_serverless/public/upselling/upsellings.tsx rename to x-pack/solutions/security/plugins/security_solution_serverless/public/upselling/upsellings.tsx diff --git a/x-pack/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering.ts similarity index 79% rename from x-pack/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering.ts index 1a5fb8e64a265..08d5b0d088aaa 100644 --- a/x-pack/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering.ts +++ b/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering.ts @@ -7,11 +7,10 @@ import type { Logger } from '@kbn/core/server'; import { ProductLine } from '../../common/product'; import { getCloudSecurityUsageRecord } from './cloud_security_metering_task'; -import { CLOUD_DEFEND, CNVM, CSPM, KSPM } from './constants'; +import { CNVM, CSPM, KSPM } from './constants'; import type { CloudSecuritySolutions } from './types'; import type { MeteringCallBackResponse, MeteringCallbackInput, Tier, UsageRecord } from '../types'; import type { ServerlessSecurityConfig } from '../config'; -import { getCloudDefendUsageRecords } from './defend_for_containers_metering'; export const cloudSecurityMetringCallback = async ({ esClient, @@ -35,24 +34,11 @@ export const cloudSecurityMetringCallback = async ({ const tier: Tier = getCloudProductTier(config, logger); try { - const cloudSecuritySolutions: CloudSecuritySolutions[] = [CSPM, KSPM, CNVM, CLOUD_DEFEND]; + const cloudSecuritySolutions: CloudSecuritySolutions[] = [CSPM, KSPM, CNVM]; const promiseResults = await Promise.allSettled( cloudSecuritySolutions.map((cloudSecuritySolution) => { - if (cloudSecuritySolution !== CLOUD_DEFEND) { - return getCloudSecurityUsageRecord({ - esClient, - projectId, - logger, - taskId, - lastSuccessfulReport, - cloudSecuritySolution, - tier, - }); - } - - // since lastSuccessfulReport is not used by getCloudSecurityUsageRecord, we want to verify if it is used by getCloudDefendUsageRecords before getCloudSecurityUsageRecord. - return getCloudDefendUsageRecords({ + return getCloudSecurityUsageRecord({ esClient, projectId, logger, diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering_task.test.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering_task.test.ts new file mode 100644 index 0000000000000..423b26b5f7e98 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering_task.test.ts @@ -0,0 +1,330 @@ +/* + * 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 Chance from 'chance'; +import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; + +import { getCloudProductTier } from './cloud_security_metering'; +import { + getCloudSecurityUsageRecord, + getSearchQueryByCloudSecuritySolution, +} from './cloud_security_metering_task'; + +import type { ServerlessSecurityConfig } from '../config'; + +import type { ProductTier } from '../../common/product'; +import { CLOUD_SECURITY_TASK_TYPE, CSPM, KSPM, CNVM, BILLABLE_ASSETS_CONFIG } from './constants'; + +const mockEsClient = elasticsearchServiceMock.createStart().client.asInternalUser; +const logger: ReturnType<typeof loggingSystemMock.createLogger> = loggingSystemMock.createLogger(); +const chance = new Chance(); + +const cloudSecuritySolutions: Array<typeof CSPM | typeof KSPM> = [CSPM, KSPM]; + +describe('getCloudSecurityUsageRecord', () => { + beforeEach(() => { + jest.resetAllMocks(); + }); + + it('should return undefined if cloudSecuritySolution is missing', async () => { + // Mock Elasticsearch search to throw an error + mockEsClient.search.mockRejectedValue({}); + + const projectId = chance.guid(); + const taskId = chance.guid(); + const cloudSecuritySolution = CSPM; + + const tier = 'essentials' as ProductTier; + + const result = await getCloudSecurityUsageRecord({ + esClient: mockEsClient, + projectId, + logger, + taskId, + lastSuccessfulReport: new Date(), + cloudSecuritySolution, + tier, + }); + + expect(result).toBeUndefined(); + }); + + test.each(cloudSecuritySolutions)( + 'should return usageRecords with correct values for cspm and kspm when Elasticsearch response has aggregations', + async (cloudSecuritySolution) => { + // @ts-ignore + mockEsClient.search.mockResolvedValueOnce({ + hits: { hits: [{ _id: 'someRecord', _index: 'mockIndex' }] }, // mocking for indexHasDataInDateRange + }); + const randomIndex = Math.floor( + Math.random() * BILLABLE_ASSETS_CONFIG[cloudSecuritySolution].values.length + ); + const randomBillableAsset = BILLABLE_ASSETS_CONFIG[cloudSecuritySolution].values[randomIndex]; + + // @ts-ignore + mockEsClient.search.mockResolvedValueOnce({ + aggregations: { + resource_sub_type: { + buckets: [ + { + key: randomBillableAsset, + doc_count: 100, + unique_assets: { value: 10 }, + }, + { + key: 'not_billable_asset', + doc_count: 50, + unique_assets: { value: 11 }, + }, + ], + }, + min_timestamp: { + value_as_string: '2023-07-30T15:11:41.738Z', + }, + }, + }); + + const projectId = chance.guid(); + const taskId = chance.guid(); + + const tier = 'essentials' as ProductTier; + + const result = await getCloudSecurityUsageRecord({ + esClient: mockEsClient, + projectId, + logger, + taskId, + lastSuccessfulReport: new Date(), + cloudSecuritySolution, + tier, + }); + + expect(result).toEqual([ + { + id: expect.stringContaining( + `${CLOUD_SECURITY_TASK_TYPE}_${cloudSecuritySolution}_${projectId}` + ), + usage_timestamp: '2023-07-30T15:11:41.738Z', + creation_timestamp: expect.any(String), // Expect a valid ISO string + usage: { + type: CLOUD_SECURITY_TASK_TYPE, + sub_type: cloudSecuritySolution, + quantity: 10, + period_seconds: expect.any(Number), + metadata: { + [randomBillableAsset]: '10', + not_billable_asset: '11', + }, + }, + source: { + id: taskId, + instance_group_id: projectId, + metadata: { + tier: 'essentials', + }, + }, + }, + ]); + } + ); + + it('should return usageRecords with correct values for cnvm when Elasticsearch response has aggregations', async () => { + const cloudSecuritySolution = CNVM; + + // @ts-ignore + mockEsClient.search.mockResolvedValueOnce({ + hits: { hits: [{ _id: 'someRecord', _index: 'mockIndex' }] }, // mocking for indexHasDataInDateRange + }); + + // @ts-ignore + mockEsClient.search.mockResolvedValueOnce({ + aggregations: { + unique_assets: { + value: 10, + }, + min_timestamp: { + value_as_string: '2023-07-30T15:11:41.738Z', + }, + }, + }); + + const projectId = chance.guid(); + const taskId = chance.guid(); + + const tier = 'essentials' as ProductTier; + const result = await getCloudSecurityUsageRecord({ + esClient: mockEsClient, + projectId, + logger, + taskId, + lastSuccessfulReport: new Date(), + cloudSecuritySolution, + tier, + }); + + expect(result).toEqual([ + { + id: expect.stringContaining(`${CLOUD_SECURITY_TASK_TYPE}_cnvm_${projectId}`), + usage_timestamp: '2023-07-30T15:11:41.738Z', + creation_timestamp: expect.any(String), // Expect a valid ISO string + usage: { + type: CLOUD_SECURITY_TASK_TYPE, + sub_type: CNVM, + quantity: 10, + period_seconds: expect.any(Number), + }, + source: { + id: taskId, + instance_group_id: projectId, + metadata: { + tier: 'essentials', + }, + }, + }, + ]); + }); + + it('should return undefined when Elasticsearch response does not have aggregations', async () => { + // @ts-ignore + mockEsClient.search.mockResolvedValue({}); + + const projectId = chance.guid(); + const taskId = chance.guid(); + const cloudSecuritySolution = CSPM; + + const tier = 'essentials' as ProductTier; + + const result = await getCloudSecurityUsageRecord({ + esClient: mockEsClient, + projectId, + logger, + taskId, + lastSuccessfulReport: new Date(), + cloudSecuritySolution, + tier, + }); + + expect(result).toBeUndefined(); + }); + + it('should return undefined if an error occurs during Elasticsearch search', async () => { + // Mock Elasticsearch search to throw an error + mockEsClient.search.mockRejectedValue(new Error('Elasticsearch search error')); + + const projectId = chance.guid(); + const taskId = chance.guid(); + const cloudSecuritySolution = CSPM; + + const tier = 'essentials' as ProductTier; + + const result = await getCloudSecurityUsageRecord({ + esClient: mockEsClient, + projectId, + logger, + taskId, + lastSuccessfulReport: new Date(), + cloudSecuritySolution, + tier, + }); + + expect(result).toBeUndefined(); + }); +}); + +describe('getSearchQueryByCloudSecuritySolution', () => { + it('should return the correct search query for CSPM', () => { + const result = getSearchQueryByCloudSecuritySolution('cspm'); + + expect(result).toEqual({ + bool: { + must: [ + { + range: { + '@timestamp': { + gte: 'now-24h', + }, + }, + }, + { + term: { + 'rule.benchmark.posture_type': 'cspm', + }, + }, + ], + }, + }); + }); + + it('should return the correct search query for KSPM', () => { + const result = getSearchQueryByCloudSecuritySolution('kspm'); + + expect(result).toEqual({ + bool: { + must: [ + { + range: { + '@timestamp': { + gte: 'now-24h', + }, + }, + }, + { + term: { + 'rule.benchmark.posture_type': 'kspm', + }, + }, + ], + }, + }); + }); + + it('should return the correct search query for CNVM', () => { + const result = getSearchQueryByCloudSecuritySolution(CNVM); + + expect(result).toEqual({ + bool: { + must: [ + { + range: { + '@timestamp': { + gte: 'now-24h', + }, + }, + }, + ], + }, + }); + }); +}); + +describe('should return the relevant product tier', () => { + it('should return the relevant product tier for cloud product line', async () => { + const serverlessSecurityConfig = { + enabled: true, + developer: {}, + productTypes: [ + { product_line: 'endpoint', product_tier: 'essentials' }, + { product_line: 'cloud', product_tier: 'complete' }, + ], + } as unknown as ServerlessSecurityConfig; + + const tier = getCloudProductTier(serverlessSecurityConfig, logger); + + expect(tier).toBe('complete'); + }); + + it('should return none tier in case cloud product line is missing ', async () => { + const serverlessSecurityConfig = { + enabled: true, + developer: {}, + productTypes: [{ product_line: 'endpoint', product_tier: 'complete' }], + } as unknown as ServerlessSecurityConfig; + + const tier = getCloudProductTier(serverlessSecurityConfig, logger); + + expect(tier).toBe('none'); + }); +}); diff --git a/x-pack/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering_task.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering_task.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering_task.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering_task.ts diff --git a/x-pack/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering_task_config.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering_task_config.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering_task_config.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/cloud_security_metering_task_config.ts diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/constants.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/constants.ts new file mode 100644 index 0000000000000..774f7e7fd2ae7 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/constants.ts @@ -0,0 +1,69 @@ +/* + * 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 { + CSPM_POLICY_TEMPLATE, + KSPM_POLICY_TEMPLATE, + CDR_LATEST_NATIVE_MISCONFIGURATIONS_INDEX_PATTERN, + CDR_LATEST_NATIVE_VULNERABILITIES_INDEX_PATTERN, +} from '@kbn/cloud-security-posture-common'; +import { CNVM_POLICY_TEMPLATE } from '@kbn/cloud-security-posture-plugin/common/constants'; + +export const CLOUD_SECURITY_TASK_TYPE = 'cloud_security'; +export const AGGREGATION_PRECISION_THRESHOLD = 40000; +export const ASSETS_SAMPLE_GRANULARITY = '24h'; +export const THRESHOLD_MINUTES = 30; + +export const CSPM = CSPM_POLICY_TEMPLATE; +export const KSPM = KSPM_POLICY_TEMPLATE; +export const CNVM = CNVM_POLICY_TEMPLATE; + +export const METERING_CONFIGS = { + [CSPM]: { + index: CDR_LATEST_NATIVE_MISCONFIGURATIONS_INDEX_PATTERN, + assets_identifier: 'resource.id', + }, + [KSPM]: { + index: CDR_LATEST_NATIVE_MISCONFIGURATIONS_INDEX_PATTERN, + assets_identifier: 'agent.id', + }, + [CNVM]: { + index: CDR_LATEST_NATIVE_VULNERABILITIES_INDEX_PATTERN, + assets_identifier: 'cloud.instance.id', + }, +}; + +// see https://github.com/elastic/security-team/issues/8970 for billable asset definition +export const BILLABLE_ASSETS_CONFIG = { + [CSPM]: { + filter_attribute: 'resource.sub_type', + values: [ + // 'aws-ebs', we can't include EBS volumes until https://github.com/elastic/security-team/issues/9283 is resolved + // 'aws-ec2', we can't include EC2 instances until https://github.com/elastic/security-team/issues/9254 is resolved + 'aws-s3', + 'aws-rds', + 'azure-disk', + 'azure-document-db-database-account', + 'azure-flexible-mysql-server-db', + 'azure-flexible-postgresql-server-db', + 'azure-mysql-server-db', + 'azure-postgresql-server-db', + 'azure-sql-server', + 'azure-storage-account', + 'azure-vm', + 'gcp-bigquery-dataset', + 'gcp-compute-disk', + 'gcp-compute-instance', + 'gcp-sqladmin-instance', + 'gcp-storage-bucket', + ], + }, + [KSPM]: { + filter_attribute: 'resource.sub_type', + values: ['Node', 'node'], + }, +}; diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/types.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/types.ts new file mode 100644 index 0000000000000..c8149e75b720a --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution_serverless/server/cloud_security/types.ts @@ -0,0 +1,49 @@ +/* + * 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 { CSPM, KSPM, CNVM } from './constants'; +import type { MeteringCallbackInput, Tier } from '../types'; + +export interface CloudDefendAssetCountAggregation { + asset_count_groups: AssetCountAggregationBucket; +} +export interface AssetCountAggregationBucket { + buckets: AssetCountAggregation[]; +} + +export interface ResourceSubtypeAggregationBucket { + key: string; + doc_count: number; + unique_assets: { + value: number; + }; +} + +export interface AssetCountAggregation { + key_as_string: string; + min_timestamp: MinTimestamp; + unique_assets: { + value: number; + }; + resource_sub_type: { + buckets: ResourceSubtypeAggregationBucket[]; + }; +} + +export interface MinTimestamp { + value: number; + value_as_string: string; +} + +export type CloudSecuritySolutions = typeof CSPM | typeof KSPM | typeof CNVM; + +export interface CloudSecurityMeteringCallbackInput + extends Omit<MeteringCallbackInput, 'cloudSetup' | 'abortController' | 'config'> { + projectId: string; + cloudSecuritySolution: CloudSecuritySolutions; + tier: Tier; +} diff --git a/x-pack/plugins/security_solution_serverless/server/common/services/usage_reporting_service.test.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/common/services/usage_reporting_service.test.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/common/services/usage_reporting_service.test.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/common/services/usage_reporting_service.test.ts diff --git a/x-pack/plugins/security_solution_serverless/server/common/services/usage_reporting_service.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/common/services/usage_reporting_service.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/common/services/usage_reporting_service.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/common/services/usage_reporting_service.ts diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/server/config.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/config.ts new file mode 100644 index 0000000000000..b47df2f29795b --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution_serverless/server/config.ts @@ -0,0 +1,127 @@ +/* + * 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 { TypeOf } from '@kbn/config-schema'; +import type { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; +import type { SecuritySolutionPluginSetup } from '@kbn/security-solution-plugin/server/plugin_contract'; + +import { schema } from '@kbn/config-schema'; + +import type { ExperimentalFeatures } from '../common/experimental_features'; + +import { productTypes } from '../common/config'; +import { parseExperimentalConfigValue } from '../common/experimental_features'; + +const tlsConfig = schema.object({ + certificate: schema.string(), + key: schema.string(), + ca: schema.string(), +}); +export type TlsConfigSchema = TypeOf<typeof tlsConfig>; + +const usageApiConfig = schema.object({ + enabled: schema.boolean({ defaultValue: false }), + url: schema.maybe(schema.string()), + tls: schema.maybe(tlsConfig), +}); +export type UsageApiConfigSchema = TypeOf<typeof usageApiConfig>; + +export const configSchema = schema.object({ + enabled: schema.boolean({ defaultValue: false }), + productTypes, + /** + * Usage Reporting: the interval between runs of the endpoint task + */ + + usageReportingTaskInterval: schema.string({ defaultValue: '5m' }), + + /** + * Usage Reporting: the interval between runs of the cloud security task + */ + + cloudSecurityUsageReportingTaskInterval: schema.string({ defaultValue: '30m' }), + + /** + * Usage Reporting: timeout value for how long the task should run. + */ + usageReportingTaskTimeout: schema.string({ defaultValue: '1m' }), + + /** + * For internal use. A list of string values (comma delimited) that will enable experimental + * type of functionality that is not yet released. Valid values for this settings need to + * be defined in: + * `x-pack/solutions/security/plugins/security_solution_serverless/common/experimental_features.ts` + * under the `allowedExperimentalValues` object + * + * @example + * xpack.securitySolutionServerless.enableExperimental: + * - someCrazyServerlessFeature + * - someEvenCrazierServerlessFeature + */ + enableExperimental: schema.arrayOf(schema.string(), { + defaultValue: () => [], + }), + + usageApi: usageApiConfig, +}); +export type ServerlessSecuritySchema = TypeOf<typeof configSchema>; + +export const config: PluginConfigDescriptor<ServerlessSecuritySchema> = { + exposeToBrowser: { + enableExperimental: true, + productTypes: true, + }, + schema: configSchema, + deprecations: ({ renameFromRoot }) => [ + renameFromRoot( + 'xpack.serverless.security.productTypes', + 'xpack.securitySolutionServerless.productTypes', + { silent: true, level: 'warning' } + ), + ], +}; + +export type ServerlessSecurityConfig = Omit<ServerlessSecuritySchema, 'enableExperimental'> & { + experimentalFeatures: ExperimentalFeatures; +}; + +export const createConfig = ( + context: PluginInitializerContext, + securitySolution: SecuritySolutionPluginSetup +): ServerlessSecurityConfig => { + const { enableExperimental, ...pluginConfig } = context.config.get<ServerlessSecuritySchema>(); + const logger = context.logger.get('config'); + + const { + invalid, + duplicated, + features: experimentalFeatures, + } = parseExperimentalConfigValue(enableExperimental, securitySolution.experimentalFeatures); + + if (invalid.length) { + logger.warn(`Unsupported "xpack.securitySolutionServerless.enableExperimental" values detected. +The following configuration values are not supported and should be removed from the configuration: + + xpack.securitySolutionServerless.enableExperimental: +${invalid.map((key) => ` - ${key}`).join('\n')} +`); + } + + if (duplicated.length) { + logger.warn(`Duplicated "xpack.securitySolutionServerless.enableExperimental" values detected. +The following configuration values are should only be defined using the generic "xpack.securitySolution.enableExperimental": + + xpack.securitySolutionServerless.enableExperimental: +${duplicated.map((key) => ` - ${key}`).join('\n')} +`); + } + + return { + ...pluginConfig, + experimentalFeatures, + }; +}; diff --git a/x-pack/plugins/security_solution_serverless/server/constants.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/constants.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/constants.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/constants.ts diff --git a/x-pack/plugins/security_solution_serverless/server/endpoint/constants/metering.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/endpoint/constants/metering.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/endpoint/constants/metering.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/endpoint/constants/metering.ts diff --git a/x-pack/plugins/security_solution_serverless/server/endpoint/services/index.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/endpoint/services/index.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/endpoint/services/index.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/endpoint/services/index.ts diff --git a/x-pack/plugins/security_solution_serverless/server/endpoint/services/metering_service.test.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/endpoint/services/metering_service.test.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/endpoint/services/metering_service.test.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/endpoint/services/metering_service.test.ts diff --git a/x-pack/plugins/security_solution_serverless/server/endpoint/services/metering_service.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/endpoint/services/metering_service.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/endpoint/services/metering_service.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/endpoint/services/metering_service.ts diff --git a/x-pack/plugins/security_solution_serverless/server/endpoint/services/set_package_policy_flag.test.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/endpoint/services/set_package_policy_flag.test.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/endpoint/services/set_package_policy_flag.test.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/endpoint/services/set_package_policy_flag.test.ts diff --git a/x-pack/plugins/security_solution_serverless/server/endpoint/services/set_package_policy_flag.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/endpoint/services/set_package_policy_flag.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/endpoint/services/set_package_policy_flag.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/endpoint/services/set_package_policy_flag.ts diff --git a/x-pack/plugins/security_solution_serverless/server/index.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/index.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/index.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/index.ts diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/server/jest.config.js b/x-pack/solutions/security/plugins/security_solution_serverless/server/jest.config.js new file mode 100644 index 0000000000000..8d59fc2802cf4 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution_serverless/server/jest.config.js @@ -0,0 +1,13 @@ +/* + * 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. + */ + +/** @type {import('@jest/types').Config.InitialOptions} */ +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/security_solution_serverless/server/'], +}; diff --git a/x-pack/plugins/security_solution_serverless/server/plugin.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/plugin.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/plugin.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/plugin.ts diff --git a/x-pack/plugins/security_solution_serverless/server/product_features/assistant_product_features_config.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/product_features/assistant_product_features_config.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/product_features/assistant_product_features_config.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/product_features/assistant_product_features_config.ts diff --git a/x-pack/plugins/security_solution_serverless/server/product_features/attack_discovery_product_features_config.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/product_features/attack_discovery_product_features_config.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/product_features/attack_discovery_product_features_config.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/product_features/attack_discovery_product_features_config.ts diff --git a/x-pack/plugins/security_solution_serverless/server/product_features/cases_product_features_config.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/product_features/cases_product_features_config.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/product_features/cases_product_features_config.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/product_features/cases_product_features_config.ts diff --git a/x-pack/plugins/security_solution_serverless/server/product_features/index.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/product_features/index.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/product_features/index.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/product_features/index.ts diff --git a/x-pack/plugins/security_solution_serverless/server/product_features/security_product_features_config.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/product_features/security_product_features_config.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/product_features/security_product_features_config.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/product_features/security_product_features_config.ts diff --git a/x-pack/plugins/security_solution_serverless/server/rules/enable_rule_actions.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/rules/enable_rule_actions.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/rules/enable_rule_actions.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/rules/enable_rule_actions.ts diff --git a/x-pack/plugins/security_solution_serverless/server/task_manager/nlp_cleanup_task/nlp_cleanup_task.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/task_manager/nlp_cleanup_task/nlp_cleanup_task.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/task_manager/nlp_cleanup_task/nlp_cleanup_task.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/task_manager/nlp_cleanup_task/nlp_cleanup_task.ts diff --git a/x-pack/plugins/security_solution_serverless/server/task_manager/task_state.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/task_manager/task_state.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/task_manager/task_state.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/task_manager/task_state.ts diff --git a/x-pack/plugins/security_solution_serverless/server/task_manager/usage_reporting_task.test.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/task_manager/usage_reporting_task.test.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/task_manager/usage_reporting_task.test.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/task_manager/usage_reporting_task.test.ts diff --git a/x-pack/plugins/security_solution_serverless/server/task_manager/usage_reporting_task.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/task_manager/usage_reporting_task.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/task_manager/usage_reporting_task.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/task_manager/usage_reporting_task.ts diff --git a/x-pack/plugins/security_solution_serverless/server/telemetry/event_based_telemetry.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/telemetry/event_based_telemetry.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/telemetry/event_based_telemetry.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/telemetry/event_based_telemetry.ts diff --git a/x-pack/plugins/security_solution_serverless/server/types.ts b/x-pack/solutions/security/plugins/security_solution_serverless/server/types.ts similarity index 100% rename from x-pack/plugins/security_solution_serverless/server/types.ts rename to x-pack/solutions/security/plugins/security_solution_serverless/server/types.ts diff --git a/x-pack/solutions/security/plugins/security_solution_serverless/tsconfig.json b/x-pack/solutions/security/plugins/security_solution_serverless/tsconfig.json new file mode 100644 index 0000000000000..6b082dea68d86 --- /dev/null +++ b/x-pack/solutions/security/plugins/security_solution_serverless/tsconfig.json @@ -0,0 +1,51 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "index.ts", + "common/**/*.ts", + "public/**/*.ts", + "public/**/*.tsx", + "server/**/*.ts", + "../../../../../typings/**/*" + ], + "exclude": ["target/**/*"], + "kbn_references": [ + "@kbn/core", + "@kbn/config-schema", + "@kbn/management-plugin", + "@kbn/security-plugin", + "@kbn/security-solution-ess", + "@kbn/security-solution-plugin", + "@kbn/server-http-tools", + "@kbn/serverless", + "@kbn/security-solution-navigation", + "@kbn/security-solution-upselling", + "@kbn/kibana-react-plugin", + "@kbn/core-chrome-browser", + "@kbn/i18n-react", + "@kbn/i18n", + "@kbn/shared-ux-page-kibana-template", + "@kbn/features-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/task-manager-plugin", + "@kbn/cloud-plugin", + "@kbn/cloud-security-posture-plugin", + "@kbn/security-solution-features", + "@kbn/cases-plugin", + "@kbn/fleet-plugin", + "@kbn/serverless-security-settings", + "@kbn/core-elasticsearch-server", + "@kbn/core-logging-server-mocks", + "@kbn/stack-connectors-plugin", + "@kbn/actions-plugin", + "@kbn/management-cards-navigation", + "@kbn/discover-plugin", + "@kbn/logging", + "@kbn/integration-assistant-plugin", + "@kbn/cloud-security-posture-common", + "@kbn/dev-utils" + ] +} diff --git a/x-pack/plugins/session_view/.eslintrc.json b/x-pack/solutions/security/plugins/session_view/.eslintrc.json similarity index 100% rename from x-pack/plugins/session_view/.eslintrc.json rename to x-pack/solutions/security/plugins/session_view/.eslintrc.json diff --git a/x-pack/solutions/security/plugins/session_view/README.md b/x-pack/solutions/security/plugins/session_view/README.md new file mode 100644 index 0000000000000..7c83a3dcf42ac --- /dev/null +++ b/x-pack/solutions/security/plugins/session_view/README.md @@ -0,0 +1,36 @@ +# Session View + +Session View is meant to provide a visualization into what is going on in a particular Linux environment where the agent is running. It looks likes a terminal emulator; however, it is a tool for introspecting process activity and understanding user and service behaviour in your Linux servers and infrastructure. It is a time-ordered series of process executions displayed in a tree over time. + +It provides an audit trail of: + +- Interactive processes being entered by a user into the terminal - User Input +- Processes and services which do not have a controlling tty (ie are not interactive) +- Output which is generated as a result of process activity - Output +- Nested sessions inside the entry session - Nested session (Note: For now nested sessions will display as they did at Cmd with no special handling for TMUX) +- Full telemetry about the process initiated event. This will include the information specified in the Linux logical event model +- Who executed the session or process, even if the user changes. + +## Development + +## Tests + +### Unit tests + +From kibana path in your terminal go to this plugin root: + +```bash +cd x-pack/solutions/security/plugins/session_view +``` + +Then run jest with: + +```bash +yarn test:jest +``` + +Or if running from kibana root, you can specify the `-i` to specify the path: + +```bash +yarn test:jest -i x-pack/solutions/security/plugins/session_view/ +``` diff --git a/x-pack/plugins/session_view/common/constants.ts b/x-pack/solutions/security/plugins/session_view/common/constants.ts similarity index 100% rename from x-pack/plugins/session_view/common/constants.ts rename to x-pack/solutions/security/plugins/session_view/common/constants.ts diff --git a/x-pack/plugins/session_view/common/index.ts b/x-pack/solutions/security/plugins/session_view/common/index.ts similarity index 100% rename from x-pack/plugins/session_view/common/index.ts rename to x-pack/solutions/security/plugins/session_view/common/index.ts diff --git a/x-pack/plugins/session_view/common/mocks/constants/session_view_process.mock.ts b/x-pack/solutions/security/plugins/session_view/common/mocks/constants/session_view_process.mock.ts similarity index 100% rename from x-pack/plugins/session_view/common/mocks/constants/session_view_process.mock.ts rename to x-pack/solutions/security/plugins/session_view/common/mocks/constants/session_view_process.mock.ts diff --git a/x-pack/plugins/session_view/common/mocks/responses/session_view_io_events.mock.ts b/x-pack/solutions/security/plugins/session_view/common/mocks/responses/session_view_io_events.mock.ts similarity index 100% rename from x-pack/plugins/session_view/common/mocks/responses/session_view_io_events.mock.ts rename to x-pack/solutions/security/plugins/session_view/common/mocks/responses/session_view_io_events.mock.ts diff --git a/x-pack/plugins/session_view/common/mocks/responses/session_view_process_events.mock.ts b/x-pack/solutions/security/plugins/session_view/common/mocks/responses/session_view_process_events.mock.ts similarity index 100% rename from x-pack/plugins/session_view/common/mocks/responses/session_view_process_events.mock.ts rename to x-pack/solutions/security/plugins/session_view/common/mocks/responses/session_view_process_events.mock.ts diff --git a/x-pack/plugins/session_view/common/mocks/responses/session_view_process_events_merged.mock.ts b/x-pack/solutions/security/plugins/session_view/common/mocks/responses/session_view_process_events_merged.mock.ts similarity index 100% rename from x-pack/plugins/session_view/common/mocks/responses/session_view_process_events_merged.mock.ts rename to x-pack/solutions/security/plugins/session_view/common/mocks/responses/session_view_process_events_merged.mock.ts diff --git a/x-pack/plugins/session_view/common/translations.ts b/x-pack/solutions/security/plugins/session_view/common/translations.ts similarity index 100% rename from x-pack/plugins/session_view/common/translations.ts rename to x-pack/solutions/security/plugins/session_view/common/translations.ts diff --git a/x-pack/plugins/session_view/common/types/latest.ts b/x-pack/solutions/security/plugins/session_view/common/types/latest.ts similarity index 100% rename from x-pack/plugins/session_view/common/types/latest.ts rename to x-pack/solutions/security/plugins/session_view/common/types/latest.ts diff --git a/x-pack/plugins/session_view/common/types/v1.ts b/x-pack/solutions/security/plugins/session_view/common/types/v1.ts similarity index 100% rename from x-pack/plugins/session_view/common/types/v1.ts rename to x-pack/solutions/security/plugins/session_view/common/types/v1.ts diff --git a/x-pack/plugins/session_view/common/utils/alert_icon_tooltip_content.test.ts b/x-pack/solutions/security/plugins/session_view/common/utils/alert_icon_tooltip_content.test.ts similarity index 100% rename from x-pack/plugins/session_view/common/utils/alert_icon_tooltip_content.test.ts rename to x-pack/solutions/security/plugins/session_view/common/utils/alert_icon_tooltip_content.test.ts diff --git a/x-pack/plugins/session_view/common/utils/alert_icon_tooltip_content.ts b/x-pack/solutions/security/plugins/session_view/common/utils/alert_icon_tooltip_content.ts similarity index 100% rename from x-pack/plugins/session_view/common/utils/alert_icon_tooltip_content.ts rename to x-pack/solutions/security/plugins/session_view/common/utils/alert_icon_tooltip_content.ts diff --git a/x-pack/plugins/session_view/common/utils/expand_dotted_object.test.ts b/x-pack/solutions/security/plugins/session_view/common/utils/expand_dotted_object.test.ts similarity index 100% rename from x-pack/plugins/session_view/common/utils/expand_dotted_object.test.ts rename to x-pack/solutions/security/plugins/session_view/common/utils/expand_dotted_object.test.ts diff --git a/x-pack/plugins/session_view/common/utils/expand_dotted_object.ts b/x-pack/solutions/security/plugins/session_view/common/utils/expand_dotted_object.ts similarity index 100% rename from x-pack/plugins/session_view/common/utils/expand_dotted_object.ts rename to x-pack/solutions/security/plugins/session_view/common/utils/expand_dotted_object.ts diff --git a/x-pack/plugins/session_view/common/utils/sort_processes.test.ts b/x-pack/solutions/security/plugins/session_view/common/utils/sort_processes.test.ts similarity index 100% rename from x-pack/plugins/session_view/common/utils/sort_processes.test.ts rename to x-pack/solutions/security/plugins/session_view/common/utils/sort_processes.test.ts diff --git a/x-pack/plugins/session_view/common/utils/sort_processes.ts b/x-pack/solutions/security/plugins/session_view/common/utils/sort_processes.ts similarity index 100% rename from x-pack/plugins/session_view/common/utils/sort_processes.ts rename to x-pack/solutions/security/plugins/session_view/common/utils/sort_processes.ts diff --git a/x-pack/solutions/security/plugins/session_view/jest.config.js b/x-pack/solutions/security/plugins/session_view/jest.config.js new file mode 100644 index 0000000000000..b4881f48bbf6a --- /dev/null +++ b/x-pack/solutions/security/plugins/session_view/jest.config.js @@ -0,0 +1,19 @@ +/* + * 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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/solutions/security/plugins/session_view'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/solutions/security/plugins/session_view', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/x-pack/solutions/security/plugins/session_view/{common,public,server}/**/*.{ts,tsx}', + ], + setupFiles: ['jest-canvas-mock'], +}; diff --git a/x-pack/plugins/session_view/kibana.jsonc b/x-pack/solutions/security/plugins/session_view/kibana.jsonc similarity index 100% rename from x-pack/plugins/session_view/kibana.jsonc rename to x-pack/solutions/security/plugins/session_view/kibana.jsonc diff --git a/x-pack/solutions/security/plugins/session_view/package.json b/x-pack/solutions/security/plugins/session_view/package.json new file mode 100644 index 0000000000000..a9e4ab1ca6236 --- /dev/null +++ b/x-pack/solutions/security/plugins/session_view/package.json @@ -0,0 +1,11 @@ +{ + "author": "Elastic", + "name": "@kbn/session-view-plugin", + "version": "1.0.0", + "private": true, + "license": "Elastic License 2.0", + "scripts": { + "test:jest": "node ../../../../scripts/jest", + "test:coverage": "node ../../../../scripts/jest --coverage" + } +} diff --git a/x-pack/plugins/session_view/public/components/back_to_investigated_alert/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/back_to_investigated_alert/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/back_to_investigated_alert/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/back_to_investigated_alert/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/back_to_investigated_alert/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/back_to_investigated_alert/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/back_to_investigated_alert/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/back_to_investigated_alert/index.tsx diff --git a/x-pack/plugins/session_view/public/components/back_to_investigated_alert/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/back_to_investigated_alert/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/back_to_investigated_alert/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/back_to_investigated_alert/styles.ts diff --git a/x-pack/plugins/session_view/public/components/detail_panel_accordion/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_accordion/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_accordion/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_accordion/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/detail_panel_accordion/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_accordion/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_accordion/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_accordion/index.tsx diff --git a/x-pack/plugins/session_view/public/components/detail_panel_accordion/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_accordion/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_accordion/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_accordion/styles.ts diff --git a/x-pack/plugins/session_view/public/components/detail_panel_alert_actions/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_alert_actions/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_alert_actions/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_alert_actions/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/detail_panel_alert_actions/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_alert_actions/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_alert_actions/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_alert_actions/index.tsx diff --git a/x-pack/plugins/session_view/public/components/detail_panel_alert_actions/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_alert_actions/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_alert_actions/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_alert_actions/styles.ts diff --git a/x-pack/plugins/session_view/public/components/detail_panel_alert_group_item/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_alert_group_item/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_alert_group_item/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_alert_group_item/index.tsx diff --git a/x-pack/plugins/session_view/public/components/detail_panel_alert_list_item/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_alert_list_item/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_alert_list_item/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_alert_list_item/index.tsx diff --git a/x-pack/plugins/session_view/public/components/detail_panel_alert_list_item/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_alert_list_item/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_alert_list_item/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_alert_list_item/styles.ts diff --git a/x-pack/plugins/session_view/public/components/detail_panel_alert_tab/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_alert_tab/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_alert_tab/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_alert_tab/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/detail_panel_alert_tab/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_alert_tab/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_alert_tab/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_alert_tab/index.tsx diff --git a/x-pack/plugins/session_view/public/components/detail_panel_alert_tab/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_alert_tab/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_alert_tab/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_alert_tab/styles.ts diff --git a/x-pack/plugins/session_view/public/components/detail_panel_copy/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_copy/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_copy/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_copy/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/session_view/public/components/detail_panel_copy/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_copy/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_copy/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_copy/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/detail_panel_copy/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_copy/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_copy/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_copy/index.tsx diff --git a/x-pack/plugins/session_view/public/components/detail_panel_copy/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_copy/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_copy/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_copy/styles.ts diff --git a/x-pack/plugins/session_view/public/components/detail_panel_description_list/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_description_list/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_description_list/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_description_list/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/detail_panel_description_list/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_description_list/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_description_list/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_description_list/index.tsx diff --git a/x-pack/plugins/session_view/public/components/detail_panel_description_list/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_description_list/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_description_list/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_description_list/styles.ts diff --git a/x-pack/plugins/session_view/public/components/detail_panel_list_item/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_list_item/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_list_item/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_list_item/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/detail_panel_list_item/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_list_item/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_list_item/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_list_item/index.tsx diff --git a/x-pack/plugins/session_view/public/components/detail_panel_list_item/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_list_item/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_list_item/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_list_item/styles.ts diff --git a/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/helpers.test.ts b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_metadata_tab/helpers.test.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/helpers.test.ts rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_metadata_tab/helpers.test.ts diff --git a/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/helpers.ts b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_metadata_tab/helpers.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/helpers.ts rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_metadata_tab/helpers.ts diff --git a/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_metadata_tab/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_metadata_tab/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_metadata_tab/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_metadata_tab/index.tsx diff --git a/x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_metadata_tab/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_metadata_tab/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_metadata_tab/styles.ts diff --git a/x-pack/plugins/session_view/public/components/detail_panel_process_tab/helpers.test.ts b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_process_tab/helpers.test.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_process_tab/helpers.test.ts rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_process_tab/helpers.test.ts diff --git a/x-pack/plugins/session_view/public/components/detail_panel_process_tab/helpers.ts b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_process_tab/helpers.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_process_tab/helpers.ts rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_process_tab/helpers.ts diff --git a/x-pack/plugins/session_view/public/components/detail_panel_process_tab/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_process_tab/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_process_tab/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_process_tab/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/detail_panel_process_tab/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_process_tab/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_process_tab/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_process_tab/index.tsx diff --git a/x-pack/plugins/session_view/public/components/detail_panel_process_tab/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/detail_panel_process_tab/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/detail_panel_process_tab/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/detail_panel_process_tab/styles.ts diff --git a/x-pack/plugins/session_view/public/components/process_tree/helpers.test.ts b/x-pack/solutions/security/plugins/session_view/public/components/process_tree/helpers.test.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree/helpers.test.ts rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree/helpers.test.ts diff --git a/x-pack/plugins/session_view/public/components/process_tree/helpers.ts b/x-pack/solutions/security/plugins/session_view/public/components/process_tree/helpers.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree/helpers.ts rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree/helpers.ts diff --git a/x-pack/plugins/session_view/public/components/process_tree/hooks.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/process_tree/hooks.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree/hooks.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree/hooks.test.tsx diff --git a/x-pack/plugins/session_view/public/components/process_tree/hooks.ts b/x-pack/solutions/security/plugins/session_view/public/components/process_tree/hooks.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree/hooks.ts rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree/hooks.ts diff --git a/x-pack/plugins/session_view/public/components/process_tree/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/process_tree/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/process_tree/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/process_tree/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree/index.tsx diff --git a/x-pack/plugins/session_view/public/components/process_tree/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/process_tree/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree/styles.ts diff --git a/x-pack/plugins/session_view/public/components/process_tree_alert/__snapshots__/index.test.tsx.snap b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_alert/__snapshots__/index.test.tsx.snap similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_alert/__snapshots__/index.test.tsx.snap rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_alert/__snapshots__/index.test.tsx.snap diff --git a/x-pack/plugins/session_view/public/components/process_tree_alert/helpers.ts b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_alert/helpers.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_alert/helpers.ts rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_alert/helpers.ts diff --git a/x-pack/plugins/session_view/public/components/process_tree_alert/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_alert/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_alert/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_alert/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/process_tree_alert/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_alert/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_alert/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_alert/index.tsx diff --git a/x-pack/plugins/session_view/public/components/process_tree_alert/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_alert/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_alert/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_alert/styles.ts diff --git a/x-pack/plugins/session_view/public/components/process_tree_alerts/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_alerts/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_alerts/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_alerts/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/process_tree_alerts/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_alerts/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_alerts/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_alerts/index.tsx diff --git a/x-pack/plugins/session_view/public/components/process_tree_alerts/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_alerts/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_alerts/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_alerts/styles.ts diff --git a/x-pack/plugins/session_view/public/components/process_tree_alerts_filter/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_alerts_filter/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_alerts_filter/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_alerts_filter/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/process_tree_alerts_filter/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_alerts_filter/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_alerts_filter/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_alerts_filter/index.tsx diff --git a/x-pack/plugins/session_view/public/components/process_tree_alerts_filter/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_alerts_filter/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_alerts_filter/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_alerts_filter/styles.ts diff --git a/x-pack/plugins/session_view/public/components/process_tree_alerts_filter/translations.ts b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_alerts_filter/translations.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_alerts_filter/translations.ts rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_alerts_filter/translations.ts diff --git a/x-pack/plugins/session_view/public/components/process_tree_load_more_button/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_load_more_button/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_load_more_button/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_load_more_button/index.tsx diff --git a/x-pack/plugins/session_view/public/components/process_tree_load_more_button/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_load_more_button/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_load_more_button/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_load_more_button/styles.ts diff --git a/x-pack/plugins/session_view/public/components/process_tree_node/buttons.tsx b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_node/buttons.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_node/buttons.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_node/buttons.tsx diff --git a/x-pack/plugins/session_view/public/components/process_tree_node/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_node/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_node/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_node/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/process_tree_node/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_node/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_node/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_node/index.tsx diff --git a/x-pack/plugins/session_view/public/components/process_tree_node/nbsp.tsx b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_node/nbsp.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_node/nbsp.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_node/nbsp.tsx diff --git a/x-pack/plugins/session_view/public/components/process_tree_node/split_text.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_node/split_text.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_node/split_text.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_node/split_text.test.tsx diff --git a/x-pack/plugins/session_view/public/components/process_tree_node/split_text.tsx b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_node/split_text.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_node/split_text.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_node/split_text.tsx diff --git a/x-pack/plugins/session_view/public/components/process_tree_node/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_node/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_node/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_node/styles.ts diff --git a/x-pack/plugins/session_view/public/components/process_tree_node/text_highlight.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_node/text_highlight.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_node/text_highlight.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_node/text_highlight.test.tsx diff --git a/x-pack/plugins/session_view/public/components/process_tree_node/text_highlight.tsx b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_node/text_highlight.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_node/text_highlight.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_node/text_highlight.tsx diff --git a/x-pack/plugins/session_view/public/components/process_tree_node/use_button_styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/process_tree_node/use_button_styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/process_tree_node/use_button_styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/process_tree_node/use_button_styles.ts diff --git a/x-pack/plugins/session_view/public/components/session_view/hooks.ts b/x-pack/solutions/security/plugins/session_view/public/components/session_view/hooks.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/session_view/hooks.ts rename to x-pack/solutions/security/plugins/session_view/public/components/session_view/hooks.ts diff --git a/x-pack/plugins/session_view/public/components/session_view/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/session_view/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/session_view/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/session_view/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/session_view/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/session_view/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/session_view/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/session_view/index.tsx diff --git a/x-pack/plugins/session_view/public/components/session_view/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/session_view/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/session_view/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/session_view/styles.ts diff --git a/x-pack/plugins/session_view/public/components/session_view/translations.ts b/x-pack/solutions/security/plugins/session_view/public/components/session_view/translations.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/session_view/translations.ts rename to x-pack/solutions/security/plugins/session_view/public/components/session_view/translations.ts diff --git a/x-pack/plugins/session_view/public/components/session_view_detail_panel/helpers.test.ts b/x-pack/solutions/security/plugins/session_view/public/components/session_view_detail_panel/helpers.test.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/session_view_detail_panel/helpers.test.ts rename to x-pack/solutions/security/plugins/session_view/public/components/session_view_detail_panel/helpers.test.ts diff --git a/x-pack/plugins/session_view/public/components/session_view_detail_panel/helpers.ts b/x-pack/solutions/security/plugins/session_view/public/components/session_view_detail_panel/helpers.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/session_view_detail_panel/helpers.ts rename to x-pack/solutions/security/plugins/session_view/public/components/session_view_detail_panel/helpers.ts diff --git a/x-pack/plugins/session_view/public/components/session_view_detail_panel/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/session_view_detail_panel/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/session_view_detail_panel/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/session_view_detail_panel/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/session_view_detail_panel/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/session_view_detail_panel/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/session_view_detail_panel/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/session_view_detail_panel/index.tsx diff --git a/x-pack/plugins/session_view/public/components/session_view_detail_panel/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/session_view_detail_panel/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/session_view_detail_panel/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/session_view_detail_panel/styles.ts diff --git a/x-pack/plugins/session_view/public/components/session_view_display_options/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/session_view_display_options/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/session_view_display_options/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/session_view_display_options/index.tsx diff --git a/x-pack/plugins/session_view/public/components/session_view_display_options/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/session_view_display_options/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/session_view_display_options/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/session_view_display_options/styles.ts diff --git a/x-pack/plugins/session_view/public/components/session_view_search_bar/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/session_view_search_bar/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/session_view_search_bar/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/session_view_search_bar/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/session_view_search_bar/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/session_view_search_bar/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/session_view_search_bar/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/session_view_search_bar/index.tsx diff --git a/x-pack/plugins/session_view/public/components/session_view_search_bar/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/session_view_search_bar/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/session_view_search_bar/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/session_view_search_bar/styles.ts diff --git a/x-pack/plugins/session_view/public/components/tty_player/ansi_helpers.ts b/x-pack/solutions/security/plugins/session_view/public/components/tty_player/ansi_helpers.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_player/ansi_helpers.ts rename to x-pack/solutions/security/plugins/session_view/public/components/tty_player/ansi_helpers.ts diff --git a/x-pack/plugins/session_view/public/components/tty_player/hooks.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/tty_player/hooks.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_player/hooks.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/tty_player/hooks.test.tsx diff --git a/x-pack/plugins/session_view/public/components/tty_player/hooks.ts b/x-pack/solutions/security/plugins/session_view/public/components/tty_player/hooks.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_player/hooks.ts rename to x-pack/solutions/security/plugins/session_view/public/components/tty_player/hooks.ts diff --git a/x-pack/plugins/session_view/public/components/tty_player/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/tty_player/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_player/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/tty_player/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/tty_player/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/tty_player/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_player/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/tty_player/index.tsx diff --git a/x-pack/plugins/session_view/public/components/tty_player/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/tty_player/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_player/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/tty_player/styles.ts diff --git a/x-pack/plugins/session_view/public/components/tty_player/translations.ts b/x-pack/solutions/security/plugins/session_view/public/components/tty_player/translations.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_player/translations.ts rename to x-pack/solutions/security/plugins/session_view/public/components/tty_player/translations.ts diff --git a/x-pack/plugins/session_view/public/components/tty_player/xterm_search.ts b/x-pack/solutions/security/plugins/session_view/public/components/tty_player/xterm_search.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_player/xterm_search.ts rename to x-pack/solutions/security/plugins/session_view/public/components/tty_player/xterm_search.ts diff --git a/x-pack/plugins/session_view/public/components/tty_player_controls/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/tty_player_controls/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_player_controls/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/tty_player_controls/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/tty_player_controls/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/tty_player_controls/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_player_controls/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/tty_player_controls/index.tsx diff --git a/x-pack/plugins/session_view/public/components/tty_player_controls/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/tty_player_controls/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_player_controls/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/tty_player_controls/styles.ts diff --git a/x-pack/plugins/session_view/public/components/tty_player_controls/translations.ts b/x-pack/solutions/security/plugins/session_view/public/components/tty_player_controls/translations.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_player_controls/translations.ts rename to x-pack/solutions/security/plugins/session_view/public/components/tty_player_controls/translations.ts diff --git a/x-pack/plugins/session_view/public/components/tty_player_controls/tty_player_controls_markers/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/tty_player_controls/tty_player_controls_markers/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_player_controls/tty_player_controls_markers/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/tty_player_controls/tty_player_controls_markers/index.tsx diff --git a/x-pack/plugins/session_view/public/components/tty_player_controls/tty_player_controls_markers/play_head.tsx b/x-pack/solutions/security/plugins/session_view/public/components/tty_player_controls/tty_player_controls_markers/play_head.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_player_controls/tty_player_controls_markers/play_head.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/tty_player_controls/tty_player_controls_markers/play_head.tsx diff --git a/x-pack/plugins/session_view/public/components/tty_player_controls/tty_player_controls_markers/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/tty_player_controls/tty_player_controls_markers/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_player_controls/tty_player_controls_markers/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/tty_player_controls/tty_player_controls_markers/styles.ts diff --git a/x-pack/plugins/session_view/public/components/tty_search_bar/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/tty_search_bar/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_search_bar/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/tty_search_bar/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/tty_search_bar/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/tty_search_bar/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_search_bar/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/tty_search_bar/index.tsx diff --git a/x-pack/plugins/session_view/public/components/tty_text_sizer/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/components/tty_text_sizer/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_text_sizer/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/tty_text_sizer/index.test.tsx diff --git a/x-pack/plugins/session_view/public/components/tty_text_sizer/index.tsx b/x-pack/solutions/security/plugins/session_view/public/components/tty_text_sizer/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_text_sizer/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/components/tty_text_sizer/index.tsx diff --git a/x-pack/plugins/session_view/public/components/tty_text_sizer/styles.ts b/x-pack/solutions/security/plugins/session_view/public/components/tty_text_sizer/styles.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_text_sizer/styles.ts rename to x-pack/solutions/security/plugins/session_view/public/components/tty_text_sizer/styles.ts diff --git a/x-pack/plugins/session_view/public/components/tty_text_sizer/translations.ts b/x-pack/solutions/security/plugins/session_view/public/components/tty_text_sizer/translations.ts similarity index 100% rename from x-pack/plugins/session_view/public/components/tty_text_sizer/translations.ts rename to x-pack/solutions/security/plugins/session_view/public/components/tty_text_sizer/translations.ts diff --git a/x-pack/plugins/session_view/public/constants.ts b/x-pack/solutions/security/plugins/session_view/public/constants.ts similarity index 100% rename from x-pack/plugins/session_view/public/constants.ts rename to x-pack/solutions/security/plugins/session_view/public/constants.ts diff --git a/x-pack/plugins/session_view/public/hooks/index.ts b/x-pack/solutions/security/plugins/session_view/public/hooks/index.ts similarity index 100% rename from x-pack/plugins/session_view/public/hooks/index.ts rename to x-pack/solutions/security/plugins/session_view/public/hooks/index.ts diff --git a/x-pack/plugins/session_view/public/hooks/use_date_format.ts b/x-pack/solutions/security/plugins/session_view/public/hooks/use_date_format.ts similarity index 100% rename from x-pack/plugins/session_view/public/hooks/use_date_format.ts rename to x-pack/solutions/security/plugins/session_view/public/hooks/use_date_format.ts diff --git a/x-pack/plugins/session_view/public/hooks/use_eui_theme.ts b/x-pack/solutions/security/plugins/session_view/public/hooks/use_eui_theme.ts similarity index 100% rename from x-pack/plugins/session_view/public/hooks/use_eui_theme.ts rename to x-pack/solutions/security/plugins/session_view/public/hooks/use_eui_theme.ts diff --git a/x-pack/plugins/session_view/public/hooks/use_scroll.ts b/x-pack/solutions/security/plugins/session_view/public/hooks/use_scroll.ts similarity index 100% rename from x-pack/plugins/session_view/public/hooks/use_scroll.ts rename to x-pack/solutions/security/plugins/session_view/public/hooks/use_scroll.ts diff --git a/x-pack/plugins/session_view/public/hooks/use_visible.ts b/x-pack/solutions/security/plugins/session_view/public/hooks/use_visible.ts similarity index 100% rename from x-pack/plugins/session_view/public/hooks/use_visible.ts rename to x-pack/solutions/security/plugins/session_view/public/hooks/use_visible.ts diff --git a/x-pack/plugins/session_view/public/index.ts b/x-pack/solutions/security/plugins/session_view/public/index.ts similarity index 100% rename from x-pack/plugins/session_view/public/index.ts rename to x-pack/solutions/security/plugins/session_view/public/index.ts diff --git a/x-pack/plugins/session_view/public/methods/index.test.tsx b/x-pack/solutions/security/plugins/session_view/public/methods/index.test.tsx similarity index 100% rename from x-pack/plugins/session_view/public/methods/index.test.tsx rename to x-pack/solutions/security/plugins/session_view/public/methods/index.test.tsx diff --git a/x-pack/plugins/session_view/public/methods/index.tsx b/x-pack/solutions/security/plugins/session_view/public/methods/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/methods/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/methods/index.tsx diff --git a/x-pack/plugins/session_view/public/plugin.ts b/x-pack/solutions/security/plugins/session_view/public/plugin.ts similarity index 100% rename from x-pack/plugins/session_view/public/plugin.ts rename to x-pack/solutions/security/plugins/session_view/public/plugin.ts diff --git a/x-pack/plugins/session_view/public/shared_imports.ts b/x-pack/solutions/security/plugins/session_view/public/shared_imports.ts similarity index 100% rename from x-pack/plugins/session_view/public/shared_imports.ts rename to x-pack/solutions/security/plugins/session_view/public/shared_imports.ts diff --git a/x-pack/plugins/session_view/public/test/index.tsx b/x-pack/solutions/security/plugins/session_view/public/test/index.tsx similarity index 100% rename from x-pack/plugins/session_view/public/test/index.tsx rename to x-pack/solutions/security/plugins/session_view/public/test/index.tsx diff --git a/x-pack/plugins/session_view/public/types.ts b/x-pack/solutions/security/plugins/session_view/public/types.ts similarity index 100% rename from x-pack/plugins/session_view/public/types.ts rename to x-pack/solutions/security/plugins/session_view/public/types.ts diff --git a/x-pack/plugins/session_view/public/utils/alert_category_display_test.test.ts b/x-pack/solutions/security/plugins/session_view/public/utils/alert_category_display_test.test.ts similarity index 100% rename from x-pack/plugins/session_view/public/utils/alert_category_display_test.test.ts rename to x-pack/solutions/security/plugins/session_view/public/utils/alert_category_display_test.test.ts diff --git a/x-pack/plugins/session_view/public/utils/alert_category_display_text.ts b/x-pack/solutions/security/plugins/session_view/public/utils/alert_category_display_text.ts similarity index 100% rename from x-pack/plugins/session_view/public/utils/alert_category_display_text.ts rename to x-pack/solutions/security/plugins/session_view/public/utils/alert_category_display_text.ts diff --git a/x-pack/plugins/session_view/public/utils/data_or_dash.test.ts b/x-pack/solutions/security/plugins/session_view/public/utils/data_or_dash.test.ts similarity index 100% rename from x-pack/plugins/session_view/public/utils/data_or_dash.test.ts rename to x-pack/solutions/security/plugins/session_view/public/utils/data_or_dash.test.ts diff --git a/x-pack/plugins/session_view/public/utils/data_or_dash.ts b/x-pack/solutions/security/plugins/session_view/public/utils/data_or_dash.ts similarity index 100% rename from x-pack/plugins/session_view/public/utils/data_or_dash.ts rename to x-pack/solutions/security/plugins/session_view/public/utils/data_or_dash.ts diff --git a/x-pack/plugins/session_view/server/index.ts b/x-pack/solutions/security/plugins/session_view/server/index.ts similarity index 100% rename from x-pack/plugins/session_view/server/index.ts rename to x-pack/solutions/security/plugins/session_view/server/index.ts diff --git a/x-pack/plugins/session_view/server/plugin.ts b/x-pack/solutions/security/plugins/session_view/server/plugin.ts similarity index 100% rename from x-pack/plugins/session_view/server/plugin.ts rename to x-pack/solutions/security/plugins/session_view/server/plugin.ts diff --git a/x-pack/plugins/session_view/server/routes/alert_status_route.test.ts b/x-pack/solutions/security/plugins/session_view/server/routes/alert_status_route.test.ts similarity index 100% rename from x-pack/plugins/session_view/server/routes/alert_status_route.test.ts rename to x-pack/solutions/security/plugins/session_view/server/routes/alert_status_route.test.ts diff --git a/x-pack/plugins/session_view/server/routes/alert_status_route.ts b/x-pack/solutions/security/plugins/session_view/server/routes/alert_status_route.ts similarity index 100% rename from x-pack/plugins/session_view/server/routes/alert_status_route.ts rename to x-pack/solutions/security/plugins/session_view/server/routes/alert_status_route.ts diff --git a/x-pack/plugins/session_view/server/routes/alerts_client_mock.test.ts b/x-pack/solutions/security/plugins/session_view/server/routes/alerts_client_mock.test.ts similarity index 100% rename from x-pack/plugins/session_view/server/routes/alerts_client_mock.test.ts rename to x-pack/solutions/security/plugins/session_view/server/routes/alerts_client_mock.test.ts diff --git a/x-pack/plugins/session_view/server/routes/alerts_route.test.ts b/x-pack/solutions/security/plugins/session_view/server/routes/alerts_route.test.ts similarity index 100% rename from x-pack/plugins/session_view/server/routes/alerts_route.test.ts rename to x-pack/solutions/security/plugins/session_view/server/routes/alerts_route.test.ts diff --git a/x-pack/plugins/session_view/server/routes/alerts_route.ts b/x-pack/solutions/security/plugins/session_view/server/routes/alerts_route.ts similarity index 100% rename from x-pack/plugins/session_view/server/routes/alerts_route.ts rename to x-pack/solutions/security/plugins/session_view/server/routes/alerts_route.ts diff --git a/x-pack/plugins/session_view/server/routes/get_total_io_bytes_route.ts b/x-pack/solutions/security/plugins/session_view/server/routes/get_total_io_bytes_route.ts similarity index 100% rename from x-pack/plugins/session_view/server/routes/get_total_io_bytes_route.ts rename to x-pack/solutions/security/plugins/session_view/server/routes/get_total_io_bytes_route.ts diff --git a/x-pack/plugins/session_view/server/routes/index.ts b/x-pack/solutions/security/plugins/session_view/server/routes/index.ts similarity index 100% rename from x-pack/plugins/session_view/server/routes/index.ts rename to x-pack/solutions/security/plugins/session_view/server/routes/index.ts diff --git a/x-pack/plugins/session_view/server/routes/io_events_route.test.ts b/x-pack/solutions/security/plugins/session_view/server/routes/io_events_route.test.ts similarity index 100% rename from x-pack/plugins/session_view/server/routes/io_events_route.test.ts rename to x-pack/solutions/security/plugins/session_view/server/routes/io_events_route.test.ts diff --git a/x-pack/plugins/session_view/server/routes/io_events_route.ts b/x-pack/solutions/security/plugins/session_view/server/routes/io_events_route.ts similarity index 100% rename from x-pack/plugins/session_view/server/routes/io_events_route.ts rename to x-pack/solutions/security/plugins/session_view/server/routes/io_events_route.ts diff --git a/x-pack/plugins/session_view/server/routes/process_events_route.test.ts b/x-pack/solutions/security/plugins/session_view/server/routes/process_events_route.test.ts similarity index 100% rename from x-pack/plugins/session_view/server/routes/process_events_route.test.ts rename to x-pack/solutions/security/plugins/session_view/server/routes/process_events_route.test.ts diff --git a/x-pack/plugins/session_view/server/routes/process_events_route.ts b/x-pack/solutions/security/plugins/session_view/server/routes/process_events_route.ts similarity index 100% rename from x-pack/plugins/session_view/server/routes/process_events_route.ts rename to x-pack/solutions/security/plugins/session_view/server/routes/process_events_route.ts diff --git a/x-pack/plugins/session_view/server/types.ts b/x-pack/solutions/security/plugins/session_view/server/types.ts similarity index 100% rename from x-pack/plugins/session_view/server/types.ts rename to x-pack/solutions/security/plugins/session_view/server/types.ts diff --git a/x-pack/solutions/security/plugins/session_view/tsconfig.json b/x-pack/solutions/security/plugins/session_view/tsconfig.json new file mode 100644 index 0000000000000..80cbd97282268 --- /dev/null +++ b/x-pack/solutions/security/plugins/session_view/tsconfig.json @@ -0,0 +1,46 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + }, + "include": [ + // add all the folders containg files to be compiled + "common/**/*", + "public/**/*", + "server/**/*", + "server/**/*.json", + "scripts/**/*", + "package.json", + "storybook/**/*", + "../../../../../typings/**/*" + ], + "kbn_references": [ + "@kbn/core", + // add references to other TypeScript projects the plugin depends on + + // requiredPlugins from ./kibana.json + + // optionalPlugins from ./kibana.json + "@kbn/security-plugin", + + // requiredBundles from ./kibana.json + "@kbn/kibana-react-plugin", + "@kbn/es-ui-shared-plugin", + "@kbn/rule-registry-plugin", + "@kbn/i18n", + "@kbn/std", + "@kbn/ui-theme", + "@kbn/i18n-react", + "@kbn/config-schema", + "@kbn/alerting-plugin", + "@kbn/rule-data-utils", + "@kbn/securitysolution-es-utils", + "@kbn/shared-ux-router", + "@kbn/usage-collection-plugin", + "@kbn/analytics", + "@kbn/securitysolution-rules", + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/x-pack/solutions/security/plugins/threat_intelligence/README.md b/x-pack/solutions/security/plugins/threat_intelligence/README.md index 033b065dcdd20..c8b5de6a0289c 100755 --- a/x-pack/solutions/security/plugins/threat_intelligence/README.md +++ b/x-pack/solutions/security/plugins/threat_intelligence/README.md @@ -74,8 +74,8 @@ Cypress tests are integrated with the Security Solution ones. Please refer to ht ### How is the Threat Intelligence code loaded in Kibana? -The Threat Intelligence plugin is loaded lazily within the [security_solution](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution) plugin, -from `x-pack/plugins/security_solution/public/threat_intelligence` owned by the Threat Hunting Investigations Team. +The Threat Intelligence plugin is loaded lazily within the [security_solution](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/security_solution) plugin, +from `x-pack/solutions/security/plugins/security_solution/public/threat_intelligence` owned by the Threat Hunting Investigations Team. ## QA and demo for implemented features diff --git a/x-pack/solutions/security/plugins/threat_intelligence/common/types/indicator.ts b/x-pack/solutions/security/plugins/threat_intelligence/common/types/indicator.ts index 81fa375c45301..b126275799151 100644 --- a/x-pack/solutions/security/plugins/threat_intelligence/common/types/indicator.ts +++ b/x-pack/solutions/security/plugins/threat_intelligence/common/types/indicator.ts @@ -52,7 +52,7 @@ export enum RawIndicatorFieldId { /** * Threat indicator field map to Enriched Event. - * (reverse of https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/common/cti/constants.ts#L35) + * (reverse of https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/common/cti/constants.ts#L35) */ export const IndicatorFieldEventEnrichmentMap: { [id: string]: string[] } = { [RawIndicatorFieldId.FileSha256]: ['file.hash.sha256'], diff --git a/x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/containers/flyout.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/containers/flyout.tsx index fd8c1a81fa02f..3c97a4c2c673a 100644 --- a/x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/containers/flyout.tsx +++ b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/containers/flyout.tsx @@ -25,8 +25,8 @@ export interface BlockListFlyoutProps { /** * Component calling the block list flyout (retrieved from the SecuritySolution plugin via context). * This reuses a lot of components passed down via context from the Security Solution plugin: - * - the flyout component: https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.tsx - * - the form component: https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/public/management/pages/blocklist/view/components/blocklist_form.tsx + * - the flyout component: x-pack/solutions/security/plugins/security_solution/public/management/components/artifact_list_page/components/artifact_flyout.tsx + * - the form component: x-pack/solutions/security/plugins/security_solution/public/management/pages/blocklist/view/components/blocklist_form.tsx */ export const BlockListFlyout: VFC<BlockListFlyoutProps> = ({ indicatorFileHash }) => { const { setBlockListIndicatorValue } = useBlockListContext(); diff --git a/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline.tsx index 2bd794c49adcd..e894fa99c9e6c 100644 --- a/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline.tsx +++ b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline.tsx @@ -28,7 +28,7 @@ export interface InvestigateInTimelineProps { } /** - * Investigate in timeline button, uses the InvestigateInTimelineAction component (x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_timeline_action.tsx) + * Investigate in timeline button, uses the InvestigateInTimelineAction component (x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_timeline_action.tsx) * retrieved from the SecuritySolutionContext. * * This component renders an {@link EuiContextMenu}. @@ -65,7 +65,7 @@ export const InvestigateInTimelineContextMenu: VFC<InvestigateInTimelineProps> = }; /** - * Investigate in timeline button uses the InvestigateInTimelineAction component (x-pack/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_timeline_action.tsx) + * Investigate in timeline button uses the InvestigateInTimelineAction component (x-pack/solutions/security/plugins/security_solution/public/detections/components/alerts_table/timeline_actions/investigate_in_timeline_action.tsx) * retrieved from the SecuritySolutionContext. * * This component renders an {@link EuiButtonIcon}. diff --git a/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.ts index f40df09a49830..9ee485ea7bf52 100644 --- a/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.ts +++ b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.ts @@ -33,7 +33,7 @@ export interface UseAddToTimelineValue { /** * Custom hook that gets an {@link Indicator}, retrieves the field (from the RawIndicatorFieldId.Name) * and value, then creates DataProviders used to do the Investigate in Timeline logic - * (see /kibana/x-pack/plugins/security_solution/public/threat_intelligence/use_investigate_in_timeline.ts) + * (see /kibana/x-pack/solutions/security/plugins/security_solution/public/threat_intelligence/use_investigate_in_timeline.ts) */ export const useAddToTimeline = ({ indicator, diff --git a/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.ts index 1166130b640cd..b59e932e0007d 100644 --- a/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.ts +++ b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.ts @@ -35,7 +35,7 @@ export interface UseInvestigateInTimelineValue { /** * Custom hook that gets an {@link Indicator}, retrieves the field (from the RawIndicatorFieldId.Name) * and value, then creates DataProviders used to do the Investigate in Timeline logic - * (see /kibana/x-pack/plugins/security_solution/public/threat_intelligence/use_investigate_in_timeline.ts) + * (see /kibana/x-pack/solutions/security/plugins/security_solution/public/threat_intelligence/use_investigate_in_timeline.ts) */ export const useInvestigateInTimeline = ({ indicator, diff --git a/x-pack/solutions/security/plugins/threat_intelligence/public/plugin.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/plugin.tsx index 09a0925577284..9db7fc34f3be0 100755 --- a/x-pack/solutions/security/plugins/threat_intelligence/public/plugin.tsx +++ b/x-pack/solutions/security/plugins/threat_intelligence/public/plugin.tsx @@ -32,7 +32,7 @@ const LazyIndicatorsPageWrapper = React.lazy(() => import('./containers/indicato /** * This is used here: - * x-pack/plugins/security_solution/public/threat_intelligence/routes.tsx + * x-pack/solutions/security/plugins/security_solution/public/threat_intelligence/routes.tsx */ export const createApp = (services: Services) => diff --git a/x-pack/solutions/security/plugins/threat_intelligence/public/types.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/types.ts index 13d6320ba10b5..aec8b52187131 100644 --- a/x-pack/solutions/security/plugins/threat_intelligence/public/types.ts +++ b/x-pack/solutions/security/plugins/threat_intelligence/public/types.ts @@ -174,7 +174,7 @@ export type TIPage = 'indicators'; /** * All the IDs for the threat intelligence pages. - * This needs to match the threat intelligence page entries in SecurityPageName` (x-pack/plugins/security_solution/common/constants.ts). + * This needs to match the threat intelligence page entries in SecurityPageName` (x-pack/solutions/security/plugins/security_solution/common/constants.ts). * * Example to add more IDs: * export type TIPageId = 'threat_intelligence' | 'threat_intelligence-feed'; diff --git a/x-pack/solutions/security/plugins/threat_intelligence/public/utils/security_solution_links.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/utils/security_solution_links.ts index 87d7c7239d533..598cd13ff562f 100644 --- a/x-pack/solutions/security/plugins/threat_intelligence/public/utils/security_solution_links.ts +++ b/x-pack/solutions/security/plugins/threat_intelligence/public/utils/security_solution_links.ts @@ -10,7 +10,7 @@ import { threatIntelligencePages } from '../constants/navigation'; /** * Properties used in the Security Solution plugin to add links to the navigation. - * The properties come from LinkItem (x-pack/plugins/security_solution/public/common/links/types.ts). + * The properties come from LinkItem (x-pack/solutions/security/plugins/security_solution/public/common/links/types.ts). * * If we want to control more from within the Threat Intelligence plugin, we can keep growing this interface. */ diff --git a/x-pack/solutions/security/plugins/timelines/common/types/timeline/cells/index.ts b/x-pack/solutions/security/plugins/timelines/common/types/timeline/cells/index.ts index 336bb2f01ff43..c8f0bedfa5852 100644 --- a/x-pack/solutions/security/plugins/timelines/common/types/timeline/cells/index.ts +++ b/x-pack/solutions/security/plugins/timelines/common/types/timeline/cells/index.ts @@ -14,7 +14,7 @@ import { BrowserFields, TimelineNonEcsData } from '../../../search_strategy'; /** * The following props are provided to the function called by `renderCellValue`. * Warning: This type might be outdated. Therefore, migrate to the new one from - * `plugins/security_solution/common/types/timeline/cells/index.ts`. + * `solutions/security/plugins/security_solution/common/types/timeline/cells/index.ts`. * @deprecated */ export type DeprecatedCellValueElementProps = EuiDataGridCellValueElementProps & { diff --git a/x-pack/solutions/security/plugins/timelines/common/types/timeline/rows/index.ts b/x-pack/solutions/security/plugins/timelines/common/types/timeline/rows/index.ts index 29919f59e1819..6c3449ad59d35 100644 --- a/x-pack/solutions/security/plugins/timelines/common/types/timeline/rows/index.ts +++ b/x-pack/solutions/security/plugins/timelines/common/types/timeline/rows/index.ts @@ -10,7 +10,7 @@ import { DeprecatedRowRendererId } from '..'; /** * This interface should not be used anymore. - * Use the one from `plugins/security_solution/common/types/timeline`. + * Use the one from `solutions/security/plugins/security_solution/common/types/timeline`. * @deprecated */ export interface DeprecatedRowRenderer { diff --git a/x-pack/solutions/security/plugins/timelines/public/hooks/use_app_toasts.ts b/x-pack/solutions/security/plugins/timelines/public/hooks/use_app_toasts.ts index decce2d6cec9e..3ef00461dbd40 100644 --- a/x-pack/solutions/security/plugins/timelines/public/hooks/use_app_toasts.ts +++ b/x-pack/solutions/security/plugins/timelines/public/hooks/use_app_toasts.ts @@ -80,7 +80,7 @@ export type MaybeESError = IEsError & { err?: Record<string, unknown> }; * supported in the future. However, for now, this is _hopefully_ temporary. * * Also see the file: - * x-pack/plugins/security_solution/public/app/home/setup.tsx + * x-pack/solutions/security/plugins/security_solution/public/app/home/setup.tsx * * Where this same technique of overriding and changing the stack is occurring. */ diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/transform_rule_types/transform_health/rule.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/transform_rule_types/transform_health/rule.ts index f760ac26f40c7..ca0ba9a92f64a 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/transform_rule_types/transform_health/rule.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/transform_rule_types/transform_health/rule.ts @@ -82,7 +82,6 @@ export default function ruleTests({ getService }: FtrProviderContext) { const objectRemover = new ObjectRemover(supertest); let connectorId: string; const transformId = 'test_transform_01'; - const destinationIndex = generateDestIndex(transformId); beforeEach(async () => { await esTestIndexTool.destroy(); @@ -98,8 +97,11 @@ export default function ruleTests({ getService }: FtrProviderContext) { connectorId = await createConnector(); - await transform.api.createIndices(destinationIndex); await createTransform(transformId); + + // Create additional transforms to exclude from the rule + await createTransform('exclude_transform_01'); + await createTransform('exclude_transform_02'); }); afterEach(async () => { @@ -112,10 +114,12 @@ export default function ruleTests({ getService }: FtrProviderContext) { it('runs correctly', async () => { await stopTransform(transformId); + await stopTransform('exclude_transform_01'); const ruleId = await createRule({ name: 'Test all transforms', includeTransforms: ['*'], + excludeTransforms: ['exclude_transform_*'], }); log.debug('Checking created alerts...'); @@ -160,6 +164,8 @@ export default function ruleTests({ getService }: FtrProviderContext) { } async function createTransform(id: string) { + const destinationIndex = generateDestIndex(id); + await transform.api.createIndices(destinationIndex); const config = generateTransformConfig(id); await transform.api.createAndRunTransform(id, config); } @@ -183,20 +189,20 @@ export default function ruleTests({ getService }: FtrProviderContext) { }, }; + const { name, ...transformHealthRuleParams } = params; + const { status, body: createdRule } = await supertest .post(`${getUrlPrefix(Spaces.space1.id)}/api/alerting/rule`) .set('kbn-xsrf', 'foo') .send({ - name: params.name, + name, consumer: 'alerts', enabled: true, rule_type_id: RULE_TYPE_ID, schedule: { interval: '1d' }, actions: [action], notify_when: 'onActiveAlert', - params: { - includeTransforms: params.includeTransforms, - }, + params: transformHealthRuleParams, }); // will print the error body, if an error occurred diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/index.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/index.ts index 1da03fbbcc54c..b2753cb17245d 100644 --- a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/index.ts +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/index.ts @@ -18,6 +18,7 @@ export default function alertingTests({ loadTestFile, getService }: FtrProviderC loadTestFile(require.resolve('./builtin_alert_types')); loadTestFile(require.resolve('./mustache_templates.ts')); loadTestFile(require.resolve('./notify_when')); + loadTestFile(require.resolve('./muted_alerts')); loadTestFile(require.resolve('./event_log_alerts')); loadTestFile(require.resolve('./snooze')); loadTestFile(require.resolve('./unsnooze')); diff --git a/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/muted_alerts.ts b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/muted_alerts.ts new file mode 100644 index 0000000000000..475a36872e8c7 --- /dev/null +++ b/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group4/muted_alerts.ts @@ -0,0 +1,122 @@ +/* + * 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 expect from '@kbn/expect'; +import { ES_TEST_INDEX_NAME } from '@kbn/alerting-api-integration-helpers'; +import { ALERT_INSTANCE_ID, ALERT_RULE_UUID, ALERT_STATUS } from '@kbn/rule-data-utils'; +import { nodeBuilder } from '@kbn/es-query'; +import { Spaces } from '../../../scenarios'; +import { FtrProviderContext } from '../../../../common/ftr_provider_context'; +import { getUrlPrefix, getTestRuleData, ObjectRemover } from '../../../../common/lib'; + +const alertAsDataIndex = '.internal.alerts-observability.test.alerts.alerts-default-000001'; + +// eslint-disable-next-line import/no-default-export +export default function createDisableRuleTests({ getService }: FtrProviderContext) { + const es = getService('es'); + const retry = getService('retry'); + const supertest = getService('supertest'); + + describe('mutedAlerts', () => { + const objectRemover = new ObjectRemover(supertest); + + const createRule = async () => { + const { body: createdRule } = await supertest + .post(`${getUrlPrefix(Spaces.space1.id)}/api/alerting/rule`) + .set('kbn-xsrf', 'foo') + .send( + getTestRuleData({ + rule_type_id: 'test.always-firing-alert-as-data', + schedule: { interval: '24h' }, + throttle: undefined, + notify_when: undefined, + params: { + index: ES_TEST_INDEX_NAME, + reference: 'test', + }, + }) + ) + .expect(200); + + objectRemover.add(Spaces.space1.id, createdRule.id, 'rule', 'alerting'); + return createdRule.id; + }; + + const getAlerts = async () => { + const { + hits: { hits: alerts }, + } = await es.search({ + index: alertAsDataIndex, + body: { query: { match_all: {} } }, + }); + + return alerts; + }; + + afterEach(async () => { + await es.deleteByQuery({ + index: alertAsDataIndex, + query: { + match_all: {}, + }, + conflicts: 'proceed', + ignore_unavailable: true, + }); + await objectRemover.removeAll(); + }); + + it('should reflect muted alert instance ids in rule', async () => { + const createdRule1 = await createRule(); + const createdRule2 = await createRule(); + + let alerts: any[] = []; + + await retry.try(async () => { + alerts = await getAlerts(); + + expect(alerts.length).greaterThan(2); + alerts.forEach((activeAlert: any) => { + expect(activeAlert._source[ALERT_STATUS]).eql('active'); + }); + }); + + const alertFromRule1 = alerts.find( + (alert: any) => + alert._source[ALERT_STATUS] === 'active' && + alert._source[ALERT_RULE_UUID] === createdRule1 + ); + + await supertest + .post( + `${getUrlPrefix(Spaces.space1.id)}/api/alerting/rule/${encodeURIComponent( + createdRule1 + )}/alert/${encodeURIComponent(alertFromRule1._source['kibana.alert.instance.id'])}/_mute` + ) + .set('kbn-xsrf', 'foo') + .expect(204); + + const ruleUuids = [createdRule1, createdRule2]; + + const filterNode = nodeBuilder.or( + ruleUuids.map((id) => nodeBuilder.is('alert.id', `alert:${id}`)) + ); + const { body: rules } = await supertest + .post(`${getUrlPrefix(Spaces.space1.id)}/internal/alerting/rules/_find`) + .set('kbn-xsrf', 'foo') + .send({ + filter: JSON.stringify(filterNode), + fields: ['id', 'mutedInstanceIds'], + page: 1, + per_page: ruleUuids.length, + }); + + expect(rules.data.length).to.be(2); + const mutedRule = rules.data.find((rule: { id: string }) => rule.id === createdRule1); + expect(mutedRule.muted_alert_ids).to.contain(alertFromRule1._source[ALERT_INSTANCE_ID]); + }); + }); +} diff --git a/x-pack/test/api_integration/apis/cloud_security_posture/graph.ts b/x-pack/test/api_integration/apis/cloud_security_posture/graph.ts index 4ff483bff343d..4823c500a3588 100644 --- a/x-pack/test/api_integration/apis/cloud_security_posture/graph.ts +++ b/x-pack/test/api_integration/apis/cloud_security_posture/graph.ts @@ -40,7 +40,7 @@ export default function (providerContext: FtrProviderContext) { it('should return 404 when feature flag is not toggled', async () => { await postGraph(supertest, { query: { - eventIds: [], + originEventIds: [], start: 'now-1d/d', end: 'now/d', }, diff --git a/x-pack/test/api_integration/apis/entity_manager/count.ts b/x-pack/test/api_integration/apis/entity_manager/count.ts index 79cce666c423a..710457651d732 100644 --- a/x-pack/test/api_integration/apis/entity_manager/count.ts +++ b/x-pack/test/api_integration/apis/entity_manager/count.ts @@ -20,8 +20,7 @@ export default function ({ getService }: FtrProviderContext) { const esClient = getService('es'); const supertest = getService('supertest'); - // Failing: See https://github.com/elastic/kibana/issues/204323 - describe.skip('_count API', () => { + describe('_count API', () => { let cleanup: Function[] = []; before(() => clearEntityDefinitions(esClient)); @@ -453,10 +452,10 @@ export default function ({ getService }: FtrProviderContext) { types: { chumble: 0, }, - errors: [ + errors: expect.arrayContaining([ 'No index found for source [source: source1-with-chumbles, type: chumble] with index patterns [index-1-with-chumbles]', 'No index found for source [source: source2-with-chumbles, type: chumble] with index patterns [index-2-with-chumbles]', - ], + ]), }); }); }); diff --git a/x-pack/test/api_integration/apis/management/index_management/component_templates.ts b/x-pack/test/api_integration/apis/management/index_management/component_templates.ts index fb57f0813d843..e325f4bbfa588 100644 --- a/x-pack/test/api_integration/apis/management/index_management/component_templates.ts +++ b/x-pack/test/api_integration/apis/management/index_management/component_templates.ts @@ -10,13 +10,11 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { componentTemplatesApi } from './lib/component_templates.api'; import { componentTemplateHelpers } from './lib/component_template.helpers'; -import { API_BASE_PATH } from './constants'; const CACHE_TEMPLATES = true; export default function ({ getService }: FtrProviderContext) { const log = getService('log'); - const supertest = getService('supertest'); const { createComponentTemplate, @@ -395,21 +393,6 @@ export default function ({ getService }: FtrProviderContext) { }); }); - describe('Privileges', () => { - it('should return privileges result', async () => { - const uri = `${API_BASE_PATH}/component_templates/privileges`; - - const { body } = await supertest.get(uri).set('kbn-xsrf', 'xxx').expect(200); - - expect(body).to.eql({ - hasAllPrivileges: true, - missingPrivileges: { - cluster: [], - }, - }); - }); - }); - describe('Get datastreams', () => { const COMPONENT_NAME = 'test_get_component_template_datastreams'; const COMPONENT = { diff --git a/x-pack/test/api_integration/apis/management/index_management/inference_endpoints.ts b/x-pack/test/api_integration/apis/management/index_management/inference_endpoints.ts index 586c546414850..f1e1a381fb3ba 100644 --- a/x-pack/test/api_integration/apis/management/index_management/inference_endpoints.ts +++ b/x-pack/test/api_integration/apis/management/index_management/inference_endpoints.ts @@ -17,7 +17,7 @@ export default function ({ getService }: FtrProviderContext) { const ml = getService('ml'); const inferenceId = 'my-elser-model'; const taskType = 'sparse_embedding'; - const service = 'elser'; + const service = 'elasticsearch'; const modelId = '.elser_model_2'; describe('Inference endpoints', function () { diff --git a/x-pack/test/api_integration/apis/upgrade_assistant/es_deprecation_logs.helpers.ts b/x-pack/test/api_integration/apis/upgrade_assistant/es_deprecation_logs.helpers.ts index 59077c9ac2167..ec2454fdea143 100644 --- a/x-pack/test/api_integration/apis/upgrade_assistant/es_deprecation_logs.helpers.ts +++ b/x-pack/test/api_integration/apis/upgrade_assistant/es_deprecation_logs.helpers.ts @@ -18,7 +18,7 @@ const CHARS_POOL = 'abcdefghijklmnopqrstuvwxyz'; const getRandomString = () => `${chance.string({ pool: CHARS_POOL })}-${Date.now()}`; const deprecationMock = { - 'event.dataset': 'deprecation.elasticsearch', + 'event.dataset': 'elasticsearch.deprecation', '@timestamp': '2021-12-06T16:28:11,104Z', 'log.level': 'CRITICAL', 'log.logger': @@ -30,7 +30,7 @@ const deprecationMock = { message: '[types removal] Specifying include_type_name in get index template requests is deprecated.', 'data_stream.type': 'logs', - 'data_stream.dataset': 'deprecation.elasticsearch', + 'data_stream.dataset': 'elasticsearch.deprecation', 'data_stream.namespace': 'default', 'ecs.version': '1.7', 'elasticsearch.event.category': 'types', diff --git a/x-pack/test/cloud_security_posture_api/config.ts b/x-pack/test/cloud_security_posture_api/config.ts index 4e0ecd1f26e43..212abc50fc9ae 100644 --- a/x-pack/test/cloud_security_posture_api/config.ts +++ b/x-pack/test/cloud_security_posture_api/config.ts @@ -5,7 +5,7 @@ * 2.0. */ import { resolve } from 'path'; -import type { FtrConfigProviderContext } from '@kbn/test'; +import { getKibanaCliLoggers, type FtrConfigProviderContext } from '@kbn/test'; import { CLOUD_SECURITY_PLUGIN_VERSION } from '@kbn/cloud-security-posture-plugin/common/constants'; export default async function ({ readConfigFile }: FtrConfigProviderContext) { @@ -21,6 +21,14 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { ...xPackAPITestsConfig.get('kbnTestServer'), serverArgs: [ ...xPackAPITestsConfig.get('kbnTestServer.serverArgs'), + `--logging.loggers=${JSON.stringify([ + ...getKibanaCliLoggers(xPackAPITestsConfig.get('kbnTestServer.serverArgs')), + { + name: 'plugins.cloudSecurityPosture', + level: 'all', + appenders: ['default'], + }, + ])}`, /** * Package version is fixed (not latest) so FTR won't suddenly break when package is changed. * diff --git a/x-pack/test/cloud_security_posture_api/routes/graph.ts b/x-pack/test/cloud_security_posture_api/routes/graph.ts index 08adf73839ea2..e2be81a7d40e5 100644 --- a/x-pack/test/cloud_security_posture_api/routes/graph.ts +++ b/x-pack/test/cloud_security_posture_api/routes/graph.ts @@ -48,7 +48,7 @@ export default function (providerContext: FtrProviderContext) { supertestWithoutAuth, { query: { - eventIds: [], + originEventIds: [], start: 'now-1d/d', end: 'now/d', }, @@ -88,7 +88,7 @@ export default function (providerContext: FtrProviderContext) { it('should return 400 when missing `esQuery` field is not of type bool', async () => { await postGraph(supertest, { query: { - eventIds: [], + originEventIds: [], start: 'now-1d/d', end: 'now/d', esQuery: { @@ -102,7 +102,7 @@ export default function (providerContext: FtrProviderContext) { it('should return 400 with unsupported `esQuery`', async () => { await postGraph(supertest, { query: { - eventIds: [], + originEventIds: [], start: 'now-1d/d', end: 'now/d', esQuery: { @@ -122,7 +122,7 @@ export default function (providerContext: FtrProviderContext) { it('should return an empty graph / should return 200 when missing `esQuery` field', async () => { const response = await postGraph(supertest, { query: { - eventIds: [], + originEventIds: [], start: 'now-1d/d', end: 'now/d', }, @@ -136,7 +136,7 @@ export default function (providerContext: FtrProviderContext) { it('should return a graph with nodes and edges by actor', async () => { const response = await postGraph(supertest, { query: { - eventIds: [], + originEventIds: [], start: '2024-09-01T00:00:00Z', end: '2024-09-02T00:00:00Z', esQuery: { @@ -177,7 +177,7 @@ export default function (providerContext: FtrProviderContext) { it('should return a graph with nodes and edges by alert', async () => { const response = await postGraph(supertest, { query: { - eventIds: ['kabcd1234efgh5678'], + originEventIds: [{ id: 'kabcd1234efgh5678', isAlert: true }], start: '2024-09-01T00:00:00Z', end: '2024-09-02T00:00:00Z', }, @@ -204,10 +204,40 @@ export default function (providerContext: FtrProviderContext) { }); }); + it('should return a graph with nodes and edges by origin event', async () => { + const response = await postGraph(supertest, { + query: { + originEventIds: [{ id: 'kabcd1234efgh5678', isAlert: false }], + start: '2024-09-01T00:00:00Z', + end: '2024-09-02T00:00:00Z', + }, + }).expect(result(200)); + + expect(response.body).to.have.property('nodes').length(3); + expect(response.body).to.have.property('edges').length(2); + expect(response.body).not.to.have.property('messages'); + + response.body.nodes.forEach((node: any) => { + expect(node).to.have.property('color'); + expect(node.color).equal( + 'primary', + `node color mismatched [node: ${node.id}] [actual: ${node.color}]` + ); + }); + + response.body.edges.forEach((edge: any) => { + expect(edge).to.have.property('color'); + expect(edge.color).equal( + 'primary', + `edge color mismatched [edge: ${edge.id}] [actual: ${edge.color}]` + ); + }); + }); + it('color of alert of failed event should be danger', async () => { const response = await postGraph(supertest, { query: { - eventIds: ['failed-event'], + originEventIds: [{ id: 'failed-event', isAlert: true }], start: '2024-09-01T00:00:00Z', end: '2024-09-02T00:00:00Z', }, @@ -237,7 +267,7 @@ export default function (providerContext: FtrProviderContext) { it('color of event of failed event should be warning', async () => { const response = await postGraph(supertest, { query: { - eventIds: [], + originEventIds: [], start: '2024-09-01T00:00:00Z', end: '2024-09-02T00:00:00Z', esQuery: { @@ -279,7 +309,7 @@ export default function (providerContext: FtrProviderContext) { it('2 grouped events, 1 failed, 1 success', async () => { const response = await postGraph(supertest, { query: { - eventIds: [], + originEventIds: [], start: '2024-09-01T00:00:00Z', end: '2024-09-02T00:00:00Z', esQuery: { @@ -327,7 +357,10 @@ export default function (providerContext: FtrProviderContext) { it('should support more than 1 eventIds', async () => { const response = await postGraph(supertest, { query: { - eventIds: ['kabcd1234efgh5678', 'failed-event'], + originEventIds: [ + { id: 'kabcd1234efgh5678', isAlert: true }, + { id: 'failed-event', isAlert: true }, + ], start: '2024-09-01T00:00:00Z', end: '2024-09-02T00:00:00Z', }, @@ -357,7 +390,7 @@ export default function (providerContext: FtrProviderContext) { it('should return a graph with nodes and edges by alert and actor', async () => { const response = await postGraph(supertest, { query: { - eventIds: ['kabcd1234efgh5678'], + originEventIds: [{ id: 'kabcd1234efgh5678', isAlert: true }], start: '2024-09-01T00:00:00Z', end: '2024-09-02T00:00:00Z', esQuery: { @@ -402,7 +435,7 @@ export default function (providerContext: FtrProviderContext) { it('should filter unknown targets', async () => { const response = await postGraph(supertest, { query: { - eventIds: [], + originEventIds: [], start: '2024-09-01T00:00:00Z', end: '2024-09-02T00:00:00Z', esQuery: { @@ -428,7 +461,7 @@ export default function (providerContext: FtrProviderContext) { const response = await postGraph(supertest, { showUnknownTarget: true, query: { - eventIds: [], + originEventIds: [], start: '2024-09-01T00:00:00Z', end: '2024-09-02T00:00:00Z', esQuery: { @@ -454,7 +487,7 @@ export default function (providerContext: FtrProviderContext) { const response = await postGraph(supertest, { nodesLimit: 1, query: { - eventIds: [], + originEventIds: [], start: '2024-09-01T00:00:00Z', end: '2024-09-02T00:00:00Z', esQuery: { @@ -480,7 +513,7 @@ export default function (providerContext: FtrProviderContext) { it('should support date math', async () => { const response = await postGraph(supertest, { query: { - eventIds: ['kabcd1234efgh5678'], + originEventIds: [{ id: 'kabcd1234efgh5678', isAlert: true }], start: '2024-09-01T12:30:00.000Z||-30m', end: '2024-09-01T12:30:00.000Z||+30m', }, diff --git a/x-pack/test/functional/apps/ml/data_frame_analytics/classification_creation.ts b/x-pack/test/functional/apps/ml/data_frame_analytics/classification_creation.ts index d042371951182..11333741acf48 100644 --- a/x-pack/test/functional/apps/ml/data_frame_analytics/classification_creation.ts +++ b/x-pack/test/functional/apps/ml/data_frame_analytics/classification_creation.ts @@ -281,9 +281,10 @@ export default function ({ getService }: FtrProviderContext) { await ml.dataFrameAnalyticsCreation.setScatterplotMatrixRandomizeQueryCheckState(true); await ml.testExecution.logTestStep('displays the scatterplot matrix'); - await ml.dataFrameAnalyticsCreation.assertScatterplotMatrix( - testData.expected.scatterplotMatrixColorStats - ); + // TODO Revisit after Borealis update is fully done + // await ml.dataFrameAnalyticsCreation.assertScatterplotMatrix( + // testData.expected.scatterplotMatrixColorStats + // ); await ml.testExecution.logTestStep('continues to the additional options step'); await ml.dataFrameAnalyticsCreation.continueToAdditionalOptionsStep(); @@ -464,16 +465,17 @@ export default function ({ getService }: FtrProviderContext) { await ml.dataFrameAnalyticsResults.assertResultsTableNotEmpty(); await ml.testExecution.logTestStep('displays the ROC curve chart'); - await ml.commonUI.assertColorsInCanvasElement( - 'mlDFAnalyticsClassificationExplorationRocCurveChart', - testData.expected.rocCurveColorState, - ['#000000'], - undefined, - undefined, - // increased tolerance for ROC curve chart up from 10 to 20 - // since the returned colors vary quite a bit on each run. - 20 - ); + // TODO Revisit after Borealis update is fully done + // await ml.commonUI.assertColorsInCanvasElement( + // 'mlDFAnalyticsClassificationExplorationRocCurveChart', + // testData.expected.rocCurveColorState, + // ['#000000'], + // undefined, + // undefined, + // // increased tolerance for ROC curve chart up from 10 to 20 + // // since the returned colors vary quite a bit on each run. + // 20 + // ); await ml.testExecution.logTestStep( 'sets the sample size to 10000 for the scatterplot matrix' @@ -486,9 +488,10 @@ export default function ({ getService }: FtrProviderContext) { await ml.dataFrameAnalyticsResults.setScatterplotMatrixRandomizeQueryCheckState(true); await ml.testExecution.logTestStep('displays the scatterplot matrix'); - await ml.dataFrameAnalyticsResults.assertScatterplotMatrix( - testData.expected.scatterplotMatrixColorStats - ); + // TODO Revisit after Borealis update is fully done + // await ml.dataFrameAnalyticsResults.assertScatterplotMatrix( + // testData.expected.scatterplotMatrixColorStats + // ); await ml.commonUI.resetAntiAliasing(); }); diff --git a/x-pack/test/functional/apps/ml/data_frame_analytics/outlier_detection_creation.ts b/x-pack/test/functional/apps/ml/data_frame_analytics/outlier_detection_creation.ts index b06cb628d21f4..52d81d2663cc5 100644 --- a/x-pack/test/functional/apps/ml/data_frame_analytics/outlier_detection_creation.ts +++ b/x-pack/test/functional/apps/ml/data_frame_analytics/outlier_detection_creation.ts @@ -272,9 +272,10 @@ export default function ({ getService }: FtrProviderContext) { await ml.dataFrameAnalyticsCreation.setScatterplotMatrixRandomizeQueryCheckState(true); await ml.testExecution.logTestStep('displays the scatterplot matrix'); - await ml.dataFrameAnalyticsCreation.assertScatterplotMatrix( - testData.expected.scatterplotMatrixColorsWizard - ); + // TODO Revisit after Borealis update is fully done + // await ml.dataFrameAnalyticsCreation.assertScatterplotMatrix( + // testData.expected.scatterplotMatrixColorsWizard + // ); await ml.testExecution.logTestStep('continues to the additional options step'); await ml.dataFrameAnalyticsCreation.continueToAdditionalOptionsStep(); @@ -459,9 +460,10 @@ export default function ({ getService }: FtrProviderContext) { await ml.dataFrameAnalyticsResults.setScatterplotMatrixRandomizeQueryCheckState(true); await ml.testExecution.logTestStep('displays the scatterplot matrix'); - await ml.dataFrameAnalyticsResults.assertScatterplotMatrix( - testData.expected.scatterplotMatrixColorStatsResults - ); + // TODO Revisit after Borealis update is fully done + // await ml.dataFrameAnalyticsResults.assertScatterplotMatrix( + // testData.expected.scatterplotMatrixColorStatsResults + // ); await ml.commonUI.resetAntiAliasing(); }); diff --git a/x-pack/test/functional/services/ml/data_frame_analytics_creation.ts b/x-pack/test/functional/services/ml/data_frame_analytics_creation.ts index 4292480c9c61c..034c3e4aefd37 100644 --- a/x-pack/test/functional/services/ml/data_frame_analytics_creation.ts +++ b/x-pack/test/functional/services/ml/data_frame_analytics_creation.ts @@ -422,11 +422,12 @@ export function MachineLearningDataFrameAnalyticsCreationProvider( async assertScatterplotMatrix(expectedValue: CanvasElementColorStats) { await this.assertScatterplotMatrixLoaded(); await this.scrollScatterplotMatrixIntoView(); - await mlCommonUI.assertColorsInCanvasElement( - 'mlAnalyticsCreateJobWizardScatterplotMatrixPanel', - expectedValue, - ['#000000'] - ); + // TODO Revisit after Borealis update is fully done + // await mlCommonUI.assertColorsInCanvasElement( + // 'mlAnalyticsCreateJobWizardScatterplotMatrixPanel', + // expectedValue, + // ['#000000'] + // ); }, async setScatterplotMatrixSampleSizeSelectValue(selectValue: string) { diff --git a/x-pack/test/functional/services/ml/data_frame_analytics_results.ts b/x-pack/test/functional/services/ml/data_frame_analytics_results.ts index 7773a5b9186f1..2270f535ee541 100644 --- a/x-pack/test/functional/services/ml/data_frame_analytics_results.ts +++ b/x-pack/test/functional/services/ml/data_frame_analytics_results.ts @@ -284,16 +284,17 @@ export function MachineLearningDataFrameAnalyticsResultsProvider( async assertScatterplotMatrix(expectedValue: CanvasElementColorStats) { await this.assertScatterplotMatrixLoaded(); await this.scrollScatterplotMatrixIntoView(); - await mlCommonUI.assertColorsInCanvasElement( - 'mlDFExpandableSection-splom', - expectedValue, - ['#000000'], - undefined, - undefined, - // increased tolerance up from 10 to 20 - // since the returned randomized colors vary quite a bit on each run. - 20 - ); + // TODO Revisit after Borealis update is fully done + // await mlCommonUI.assertColorsInCanvasElement( + // 'mlDFExpandableSection-splom', + // expectedValue, + // ['#000000'], + // undefined, + // undefined, + // // increased tolerance up from 10 to 20 + // // since the returned randomized colors vary quite a bit on each run. + // 20 + // ); }, async assertFeatureImportanceDecisionPathChartElementsExists() { diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/eql/trial_license_complete_tier/eql_alert_suppression.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/eql/trial_license_complete_tier/eql_alert_suppression.ts index 71403ad7a3728..2cf9c439b21c4 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/eql/trial_license_complete_tier/eql_alert_suppression.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/eql/trial_license_complete_tier/eql_alert_suppression.ts @@ -1965,7 +1965,7 @@ export default ({ getService }: FtrProviderContext) => { // the second sequence alert will have null as the value for // suppression field host.name because of logic defined in the // objectPairIntersection function defined in - // x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_alert_group_from_sequence.ts + // x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_alert_group_from_sequence.ts await indexListOfSourceDocuments([ doc1, @@ -2064,7 +2064,7 @@ export default ({ getService }: FtrProviderContext) => { // sequence alert 2 will be doc1WithLaterTimestamp and doc2WithNoHost // sequence alert 3 will be doc2WithNoHost and doc3WithNoHost // This logic is defined in objectPairIntersection - // x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_alert_group_from_sequence.ts + // x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_alert_group_from_sequence.ts // Any sequence comprised of events where one field contains a value, followed by any number of // events in the sequence where the value is null or undefined will have that field // stripped from the sequence alert. So given that, we expect three alerts here @@ -2275,7 +2275,7 @@ export default ({ getService }: FtrProviderContext) => { it('does not suppress alerts when "doNotSuppress" is set and suppression field value is undefined for a sequence alert in a given rule execution', async () => { // This logic should be understood within the confines of the // objectPairIntersection function defined in - // x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_alert_group_from_sequence.ts + // x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_types/eql/build_alert_group_from_sequence.ts // Any sequence comprised of events where one field contains a value, followed by any number of // events in the sequence where the value is null or undefined will have that field // stripped from the sequence alert. So given that, we expect three alerts here diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/conversations.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/conversations.cy.ts index a97fa8ab9f6e3..42bb91650c5b3 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/conversations.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant/conversations.cy.ts @@ -47,6 +47,7 @@ import { } from '../../screens/ai_assistant'; import { visit, visitGetStartedPage } from '../../tasks/navigation'; +// Failing: See https://github.com/elastic/kibana/issues/204167 // Failing: See https://github.com/elastic/kibana/issues/204167 describe.skip('AI Assistant Conversations', { tags: ['@ess', '@serverless'] }, () => { beforeEach(() => { diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules.cy.ts index 5583842ca9449..dcc0cebc32ca3 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/bulk_actions/bulk_edit_rules.cy.ts @@ -240,7 +240,7 @@ describe( // user can proceed with custom rule editing cy.get(MODAL_CONFIRMATION_BTN) - .should('have.text', `Edit ${existedRulesRows.length} custom rules`) + .should('have.text', `Edit ${existedRulesRows.length} rules`) .click(); // action should finish diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/export_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/export_rule.cy.ts index 855c4e17afe04..7f313793866ad 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/export_rule.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/export_rule.cy.ts @@ -127,7 +127,7 @@ describe('Export rules', { tags: ['@ess', '@serverless', '@skipInServerlessMKI'] // proceed with exporting only custom rules cy.get(MODAL_CONFIRMATION_BTN) - .should('have.text', `Export ${expectedNumberCustomRulesToBeExported} custom rule`) + .should('have.text', `Export ${expectedNumberCustomRulesToBeExported} rule`) .click(); getAvailablePrebuiltRulesCount().then((availablePrebuiltRulesCount) => { @@ -175,7 +175,7 @@ describe('Export rules', { tags: ['@ess', '@serverless', '@skipInServerlessMKI'] // should display correct number of custom rules when one of them has exceptions cy.get(MODAL_CONFIRMATION_BTN) - .should('have.text', `Export ${expectedNumberCustomRulesToBeExported} custom rules`) + .should('have.text', `Export ${expectedNumberCustomRulesToBeExported} rules`) .click(); cy.get(TOASTER_BODY).should( diff --git a/x-pack/test/security_solution_cypress/cypress/screens/create_new_rule.ts b/x-pack/test/security_solution_cypress/cypress/screens/create_new_rule.ts index 903b463d6f585..483cbf06b6256 100644 --- a/x-pack/test/security_solution_cypress/cypress/screens/create_new_rule.ts +++ b/x-pack/test/security_solution_cypress/cypress/screens/create_new_rule.ts @@ -275,10 +275,10 @@ export const ESQL_QUERY_BAR = '[data-test-subj="ruleEsqlQueryBar"]'; export const NEW_TERMS_INPUT_AREA = '[data-test-subj="newTermsInput"]'; export const NEW_TERMS_HISTORY_SIZE = - '[data-test-subj="detectionEngineStepDefineRuleHistoryWindowSize"] [data-test-subj="interval"]'; + '[data-test-subj="historyWindowSize"] [data-test-subj="interval"]'; export const NEW_TERMS_HISTORY_TIME_TYPE = - '[data-test-subj="detectionEngineStepDefineRuleHistoryWindowSize"] [data-test-subj="timeType"]'; + '[data-test-subj="historyWindowSize"] [data-test-subj="timeType"]'; export const LOAD_QUERY_DYNAMICALLY_CHECKBOX = '[data-test-subj="detectionEngineStepDefineRuleShouldLoadQueryDynamically"] input'; diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/rules_bulk_actions.ts b/x-pack/test/security_solution_cypress/cypress/tasks/rules_bulk_actions.ts index c551054fbc6c7..501989f6c5b69 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/rules_bulk_actions.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/rules_bulk_actions.ts @@ -417,20 +417,20 @@ export const checkPrebuiltRulesCannotBeModified = (rulesCount: number) => { export const checkMachineLearningRulesCannotBeModified = (rulesCount: number) => { cy.get(MODAL_CONFIRMATION_BODY).contains( - `${rulesCount} custom machine learning rule (these rules don't have index patterns)` + `${rulesCount} machine learning rule (these rules don't have index patterns)` ); }; export const checkEsqlRulesCannotBeModified = (rulesCount: number) => { cy.get(MODAL_CONFIRMATION_BODY).contains( - `${rulesCount} custom ES|QL rule (these rules don't have index patterns)` + `${rulesCount} ES|QL rule (these rules don't have index patterns)` ); }; -export const waitForMixedRulesBulkEditModal = (customRulesCount: number) => { +export const waitForMixedRulesBulkEditModal = (rulesCount: number) => { cy.get(MODAL_CONFIRMATION_TITLE).should( 'have.text', - `This action can only be applied to ${customRulesCount} custom rules` + `This action can only be applied to ${rulesCount} rules` ); }; @@ -445,7 +445,7 @@ export const scheduleManualRuleRunForSelectedRules = ( if (disabledCount > 0) { cy.get(BULK_MANUAL_RULE_RUN_WARNING_MODAL).should( 'have.text', - `This action can only be applied to ${enabledCount} custom rulesThis action can't be applied to the following rules in your selection:${disabledCount} rules (Cannot schedule manual rule run for disabled rules)CancelSchedule ${enabledCount} custom rules` + `This action can only be applied to ${enabledCount} rulesThis action can't be applied to the following rules in your selection:${disabledCount} rules (Cannot schedule manual rule run for disabled rules)CancelSchedule ${enabledCount} rules` ); cy.get(CONFIRM_MANUAL_RULE_RUN_WARNING_BTN).click(); } diff --git a/x-pack/test/security_solution_cypress/cypress/tsconfig.json b/x-pack/test/security_solution_cypress/cypress/tsconfig.json index b117f42efceae..35779da01ac6d 100644 --- a/x-pack/test/security_solution_cypress/cypress/tsconfig.json +++ b/x-pack/test/security_solution_cypress/cypress/tsconfig.json @@ -14,7 +14,7 @@ // in a way that can't be auto-matically deteceted at this time // so we have to force the inclusion of this reference { - "path": "../../../plugins/security_solution/tsconfig.json", + "path": "../../../solutions/security/plugins/security_solution/tsconfig.json", "force": true }, "@kbn/rison", diff --git a/x-pack/test/security_solution_cypress/package.json b/x-pack/test/security_solution_cypress/package.json index 68d7454b62e51..79f07c2d07a60 100644 --- a/x-pack/test/security_solution_cypress/package.json +++ b/x-pack/test/security_solution_cypress/package.json @@ -6,24 +6,24 @@ "license": "Elastic License 2.0", "scripts": { "cypress": "NODE_OPTIONS=--openssl-legacy-provider ../../../node_modules/.bin/cypress", - "cypress:open:ess": "TZ=UTC NODE_OPTIONS=--openssl-legacy-provider node ../../plugins/security_solution/scripts/start_cypress_parallel open --spec './cypress/e2e/**/*.cy.ts' --config-file ../../test/security_solution_cypress/cypress/cypress.config.ts --ftr-config-file ../../test/security_solution_cypress/cli_config", + "cypress:open:ess": "TZ=UTC NODE_OPTIONS=--openssl-legacy-provider node ../../solutions/security/plugins/security_solution/scripts/start_cypress_parallel open --spec './cypress/e2e/**/*.cy.ts' --config-file ../../test/security_solution_cypress/cypress/cypress.config.ts --ftr-config-file ../../test/security_solution_cypress/cli_config", "cypress:entity_analytics:run:ess": "yarn cypress:ess --spec './cypress/e2e/entity_analytics/**/*.cy.ts'", "cypress:run:cases:ess": "yarn cypress:ess --spec './cypress/e2e/explore/cases/*.cy.ts'", - "cypress:ess": "TZ=UTC NODE_OPTIONS=--openssl-legacy-provider node ../../plugins/security_solution/scripts/start_cypress_parallel run --config-file ../../test/security_solution_cypress/cypress/cypress_ci.config.ts --ftr-config-file ../../test/security_solution_cypress/cli_config", - "cypress:rule_management:run:ess":"yarn cypress:ess --spec './cypress/e2e/detection_response/rule_management/!(prebuilt_rules)/**/*.cy.ts'", + "cypress:ess": "TZ=UTC NODE_OPTIONS=--openssl-legacy-provider node ../../solutions/security/plugins/security_solution/scripts/start_cypress_parallel run --config-file ../../test/security_solution_cypress/cypress/cypress_ci.config.ts --ftr-config-file ../../test/security_solution_cypress/cli_config", + "cypress:rule_management:run:ess": "yarn cypress:ess --spec './cypress/e2e/detection_response/rule_management/!(prebuilt_rules)/**/*.cy.ts'", "cypress:rule_management:prebuilt_rules:run:ess": "yarn cypress:ess --spec './cypress/e2e/detection_response/rule_management/prebuilt_rules/**/*.cy.ts'", - "cypress:detection_engine:run:ess":"yarn cypress:ess --spec './cypress/e2e/detection_response/detection_engine/!(exceptions)/**/*.cy.ts'", + "cypress:detection_engine:run:ess": "yarn cypress:ess --spec './cypress/e2e/detection_response/detection_engine/!(exceptions)/**/*.cy.ts'", "cypress:detection_engine:exceptions:run:ess": "yarn cypress:ess --spec './cypress/e2e/detection_response/detection_engine/exceptions/**/*.cy.ts'", - "cypress:ai_assistant:run:ess":"yarn cypress:ess --spec './cypress/e2e/ai_assistant/**/*.cy.ts'", + "cypress:ai_assistant:run:ess": "yarn cypress:ess --spec './cypress/e2e/ai_assistant/**/*.cy.ts'", "cypress:run:respops:ess": "yarn cypress:ess --spec './cypress/e2e/detection_response/**/*.cy.ts'", "cypress:investigations:run:ess": "yarn cypress:ess --spec './cypress/e2e/investigations/**/*.cy.ts'", "cypress:explore:run:ess": "yarn cypress:ess --spec './cypress/e2e/explore/**/*.cy.ts'", "cypress:changed-specs-only:ess": "yarn cypress:ess --changed-specs-only --env burn=5", "cypress:cloud_security_posture:run:ess": "yarn cypress:ess --spec './cypress/e2e/cloud_security_posture/**/*.cy.ts'", "cypress:burn:ess": "yarn cypress:ess --env burn=5", - "junit:merge": "../../../node_modules/.bin/mochawesome-merge ../../../target/kibana-security-solution/cypress/results/mochawesome*.json > ../../../target/kibana-security-solution/cypress/results/output.json && ../../../node_modules/.bin/marge ../../../target/kibana-security-solution/cypress/results/output.json --reportDir ../../../target/kibana-security-solution/cypress/results && yarn junit:transform && mkdir -p ../../../target/junit && cp ../../../target/kibana-security-solution/cypress/results/*.xml ../../../target/junit/", - "junit:transform": "node ../../plugins/security_solution/scripts/junit_transformer --pathPattern '../../../target/kibana-security-solution/cypress/results/*.xml' --rootDirectory ../../../ --reportName 'Security Solution Cypress' --writeInPlace", - "cypress:serverless": "TZ=UTC NODE_OPTIONS=--openssl-legacy-provider node ../../plugins/security_solution/scripts/start_cypress_parallel --config-file ../../test/security_solution_cypress/cypress/cypress_ci_serverless.config.ts --ftr-config-file ../../test/security_solution_cypress/serverless_config", + "junit:merge": "../../../node_modules/.bin/mochawesome-merge ../../../../../target/kibana-security-solution/cypress/results/mochawesome*.json > ../../../../../target/kibana-security-solution/cypress/results/output.json && ../../../node_modules/.bin/marge ../../../../../target/kibana-security-solution/cypress/results/output.json --reportDir ../../../../../target/kibana-security-solution/cypress/results && yarn junit:transform && mkdir -p ../../../../../target/junit && cp ../../../../../target/kibana-security-solution/cypress/results/*.xml ../../../../../target/junit/", + "junit:transform": "node ../../solutions/security/plugins/security_solution/scripts/junit_transformer --pathPattern '../../../target/kibana-security-solution/cypress/results/*.xml' --rootDirectory ../../../ --reportName 'Security Solution Cypress' --writeInPlace", + "cypress:serverless": "TZ=UTC NODE_OPTIONS=--openssl-legacy-provider node ../../solutions/security/plugins/security_solution/scripts/start_cypress_parallel --config-file ../../test/security_solution_cypress/cypress/cypress_ci_serverless.config.ts --ftr-config-file ../../test/security_solution_cypress/serverless_config", "cypress:cloud:serverless": "TZ=UTC NODE_OPTIONS=--openssl-legacy-provider NODE_TLS_REJECT_UNAUTHORIZED=0 ../../../node_modules/.bin/cypress", "cypress:open:cloud:serverless": "yarn cypress:cloud:serverless open --config-file ./cypress/cypress_serverless.config.ts --env CLOUD_SERVERLESS=true", "cypress:open:serverless": "yarn cypress:serverless open --config-file ../../test/security_solution_cypress/cypress/cypress_serverless.config.ts --spec './cypress/e2e/**/*.cy.ts'", @@ -39,7 +39,7 @@ "cypress:changed-specs-only:serverless": "yarn cypress:serverless --changed-specs-only --env burn=5", "cypress:cloud_security_posture:run:serverless": "yarn cypress:serverless --spec './cypress/e2e/cloud_security_posture/**/*.cy.ts'", "cypress:burn:serverless": "yarn cypress:serverless --env burn=2", - "cypress:qa:serverless": "TZ=UTC NODE_OPTIONS=--openssl-legacy-provider node ../../plugins/security_solution/scripts/start_cypress_parallel_serverless --config-file ../../test/security_solution_cypress/cypress/cypress_ci_serverless_qa.config.ts", + "cypress:qa:serverless": "TZ=UTC NODE_OPTIONS=--openssl-legacy-provider node ../../solutions/security/plugins/security_solution/scripts/start_cypress_parallel_serverless --config-file ../../test/security_solution_cypress/cypress/cypress_ci_serverless_qa.config.ts", "cypress:open:qa:serverless": "yarn cypress:qa:serverless open", "cypress:run:qa:serverless:entity_analytics": "yarn cypress:qa:serverless --spec './cypress/e2e/entity_analytics/**/*.cy.ts'", "cypress:run:qa:serverless:investigations": "yarn cypress:qa:serverless --spec './cypress/e2e/investigations/**/*.cy.ts'", @@ -51,4 +51,4 @@ "cypress:run:qa:serverless:ai_assistant": "yarn cypress:qa:serverless --spec './cypress/e2e/ai_assistant/**/*.cy.ts'", "cypress:run:qa:serverless:cloud_security_posture": "yarn cypress:qa:serverless --spec './cypress/e2e/cloud_security_posture/**/*.cy.ts" } -} \ No newline at end of file +} diff --git a/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts b/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts index a18a5110bb7aa..2785d0efbfaec 100644 --- a/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts +++ b/x-pack/test/security_solution_endpoint/page_objects/policy_page.ts @@ -108,7 +108,7 @@ export function EndpointPolicyPageProvider({ getService, getPageObjects }: FtrPr await this.ensureIsOnDetailsPage(); // Sometimes, data retrieval errors may have been encountered by other security solution processes - // (ex. index fields search here: `x-pack/plugins/security_solution/public/common/containers/source/index.tsx:181`) + // (ex. index fields search here: `x-pack/solutions/security/plugins/security_solution/public/common/containers/source/index.tsx:181`) // which are displayed using one or more Toast messages. This in turn prevents the user from // actually clicking the Save button. Because those errors are not associated with Policy details, // we'll first check that all toasts are cleared diff --git a/x-pack/test/security_solution_playwright/package.json b/x-pack/test/security_solution_playwright/package.json index 10b1c01fb8fb3..a974a43ae2335 100644 --- a/x-pack/test/security_solution_playwright/package.json +++ b/x-pack/test/security_solution_playwright/package.json @@ -5,8 +5,8 @@ "private": true, "license": "Elastic License 2.0", "scripts": { - "playwright:open": "node ../../plugins/security_solution/scripts/run_playwright/start_playwright open --config-file ../../test/security_solution_playwright/playwright.config.ts", - "playwright:run": "node ../../plugins/security_solution/scripts/run_playwright/start_playwright run --config-file ../../test/security_solution_playwright/playwright.config.ts", + "playwright:open": "node ../../solutions/security/plugins/security_solution/scripts/run_playwright/start_playwright open --config-file ../../test/security_solution_playwright/playwright.config.ts", + "playwright:run": "node ../../solutions/security/plugins/security_solution/scripts/run_playwright/start_playwright run --config-file ../../test/security_solution_playwright/playwright.config.ts", "open:ess": "npm run playwright:open -- --ftr-config-file ../security_solution_cypress/cli_config", "run:ess": "npm run playwright:run -- --ftr-config-file ../security_solution_cypress/cli_config", "open:serverless": "npm run playwright:open -- --ftr-config-file ../security_solution_cypress/serverless_config", diff --git a/x-pack/test/security_solution_playwright/tsconfig.json b/x-pack/test/security_solution_playwright/tsconfig.json index bd7a213584195..ec4474cbef181 100644 --- a/x-pack/test/security_solution_playwright/tsconfig.json +++ b/x-pack/test/security_solution_playwright/tsconfig.json @@ -7,7 +7,7 @@ "include": ["index.d.ts"], "kbn_references": [ { - "path": "../../plugins/security_solution/tsconfig.json", + "path": "../../solutions/security/plugins/security_solution/tsconfig.json", "force": true }, ], diff --git a/x-pack/test/upgrade_assistant_integration/config.ts b/x-pack/test/upgrade_assistant_integration/config.ts index 0794f4d0b9ada..df798a701b6b4 100644 --- a/x-pack/test/upgrade_assistant_integration/config.ts +++ b/x-pack/test/upgrade_assistant_integration/config.ts @@ -38,8 +38,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { }, esTestCluster: { ...xPackFunctionalTestsConfig.get('esTestCluster'), - // this archive can not be loaded into 8.0+ - // dataArchive: path.resolve(__dirname, './fixtures/data_archives/upgrade_assistant.zip'), + dataArchive: path.resolve(__dirname, './fixtures/data_archives/upgrade_assistant.zip'), }, }; } diff --git a/x-pack/test/upgrade_assistant_integration/fixtures/data_archives/upgrade_assistant.zip b/x-pack/test/upgrade_assistant_integration/fixtures/data_archives/upgrade_assistant.zip index bf2104fc59953..bc0208152dae4 100644 Binary files a/x-pack/test/upgrade_assistant_integration/fixtures/data_archives/upgrade_assistant.zip and b/x-pack/test/upgrade_assistant_integration/fixtures/data_archives/upgrade_assistant.zip differ diff --git a/x-pack/test/upgrade_assistant_integration/upgrade_assistant/reindexing.js b/x-pack/test/upgrade_assistant_integration/upgrade_assistant/reindexing.js deleted file mode 100644 index b8f689edb6a31..0000000000000 --- a/x-pack/test/upgrade_assistant_integration/upgrade_assistant/reindexing.js +++ /dev/null @@ -1,252 +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 expect from '@kbn/expect'; - -import { ReindexStatus, REINDEX_OP_TYPE } from '@kbn/upgrade-assistant-plugin/common/types'; -import { generateNewIndexName } from '@kbn/upgrade-assistant-plugin/server/lib/reindexing/index_settings'; -import { getIndexState } from '@kbn/upgrade-assistant-plugin/common/get_index_state'; - -export default function ({ getService }) { - const supertest = getService('supertest'); - const esArchiver = getService('esArchiver'); - const es = getService('es'); - - // Utility function that keeps polling API until reindex operation has completed or failed. - const waitForReindexToComplete = async (indexName) => { - console.log(`Waiting for reindex to complete...`); - let lastState; - - while (true) { - lastState = (await supertest.get(`/api/upgrade_assistant/reindex/${indexName}`).expect(200)) - .body.reindexOp; - // Once the operation is completed or failed and unlocked, stop polling. - if (lastState.status !== ReindexStatus.inProgress && lastState.locked === null) { - break; - } - await new Promise((resolve) => setTimeout(resolve, 1000)); - } - - return lastState; - }; - - describe.skip('reindexing', () => { - afterEach(() => { - // Cleanup saved objects - return es.deleteByQuery({ - index: '.kibana', - refresh: true, - body: { - query: { - simple_query_string: { - query: REINDEX_OP_TYPE, - fields: ['type'], - }, - }, - }, - }); - }); - - it('should create a new index with the same documents', async () => { - await esArchiver.load('x-pack/test/functional/es_archives/upgrade_assistant/reindex'); - const { body } = await supertest - .post(`/api/upgrade_assistant/reindex/dummydata`) - .set('kbn-xsrf', 'xxx') - .expect(200); - - expect(body.indexName).to.equal('dummydata'); - expect(body.status).to.equal(ReindexStatus.inProgress); - - const lastState = await waitForReindexToComplete('dummydata'); - expect(lastState.errorMessage).to.equal(null); - expect(lastState.status).to.equal(ReindexStatus.completed); - - const { newIndexName } = lastState; - const indexSummary = await es.indices.get({ index: 'dummydata' }); - - // The new index was created - expect(indexSummary[newIndexName]).to.be.an('object'); - // The original index name is aliased to the new one - expect(indexSummary[newIndexName].aliases.dummydata).to.be.an('object'); - // Verify mappings exist on new index - expect(indexSummary[newIndexName].mappings.properties).to.be.an('object'); - // The number of documents in the new index matches what we expect - expect((await es.count({ index: lastState.newIndexName })).count).to.be(3); - - // Cleanup newly created index - await es.indices.delete({ - index: lastState.newIndexName, - }); - }); - - it('can resume after reindexing was stopped right after creating the new index', async () => { - await esArchiver.load('x-pack/test/functional/es_archives/upgrade_assistant/reindex'); - - // This new index is the new soon to be created reindexed index. We create it - // upfront to simulate a situation in which the user restarted kibana half - // way through the reindex process and ended up with an extra index. - await es.indices.create({ index: 'reindexed-v7-dummydata' }); - - const { body } = await supertest - .post(`/api/upgrade_assistant/reindex/dummydata`) - .set('kbn-xsrf', 'xxx') - .expect(200); - - expect(body.indexName).to.equal('dummydata'); - expect(body.status).to.equal(ReindexStatus.inProgress); - - const lastState = await waitForReindexToComplete('dummydata'); - expect(lastState.errorMessage).to.equal(null); - expect(lastState.status).to.equal(ReindexStatus.completed); - - // Cleanup newly created index - await es.indices.delete({ - index: lastState.newIndexName, - }); - }); - - it('should update any aliases', async () => { - await esArchiver.load('x-pack/test/functional/es_archives/upgrade_assistant/reindex'); - - // Add aliases and ensure each returns the right number of docs - await es.indices.updateAliases({ - body: { - actions: [ - { add: { index: 'dummydata', alias: 'myAlias' } }, - { add: { index: 'dummy*', alias: 'wildcardAlias' } }, - { - add: { index: 'dummydata', alias: 'myHttpsAlias', filter: { term: { https: true } } }, - }, - ], - }, - }); - expect((await es.count({ index: 'myAlias' })).count).to.be(3); - expect((await es.count({ index: 'wildcardAlias' })).count).to.be(3); - expect((await es.count({ index: 'myHttpsAlias' })).count).to.be(2); - - // Reindex - await supertest - .post(`/api/upgrade_assistant/reindex/dummydata`) - .set('kbn-xsrf', 'xxx') - .expect(200); - const lastState = await waitForReindexToComplete('dummydata'); - - // The regular aliases should still return 3 docs - expect((await es.count({ index: 'myAlias' })).count).to.be(3); - expect((await es.count({ index: 'wildcardAlias' })).count).to.be(3); - // The filtered alias should still return 2 docs - expect((await es.count({ index: 'myHttpsAlias' })).count).to.be(2); - - // Cleanup newly created index - await es.indices.delete({ - index: lastState.newIndexName, - }); - }); - - it('shows no warnings', async () => { - const resp = await supertest.get(`/api/upgrade_assistant/reindex/7.0-data`); - // By default all reindexing operations will replace an index with an alias (with the same name) - // pointing to a newly created "reindexed" index. - expect(resp.body.warnings.length).to.be(1); - expect(resp.body.warnings[0].warningType).to.be('replaceIndexWithAlias'); - }); - - it('reindexes old 7.0 index', async () => { - const { body } = await supertest - .post(`/api/upgrade_assistant/reindex/7.0-data`) - .set('kbn-xsrf', 'xxx') - .expect(200); - - expect(body.indexName).to.equal('7.0-data'); - expect(body.status).to.equal(ReindexStatus.inProgress); - - const lastState = await waitForReindexToComplete('7.0-data'); - expect(lastState.errorMessage).to.equal(null); - expect(lastState.status).to.equal(ReindexStatus.completed); - }); - - it('should reindex a batch in order and report queue state', async () => { - const assertQueueState = async (firstInQueueIndexName, queueLength) => { - const response = await supertest - .get(`/api/upgrade_assistant/reindex/batch/queue`) - .set('kbn-xsrf', 'xxx') - .expect(200); - - const { queue } = response.body; - - const [firstInQueue] = queue; - - if (!firstInQueueIndexName) { - expect(firstInQueueIndexName).to.be(undefined); - } else { - expect(firstInQueue.indexName).to.be(firstInQueueIndexName); - } - - expect(queue.length).to.be(queueLength); - }; - - const test1 = 'batch-reindex-test1'; - const test2 = 'batch-reindex-test2'; - const test3 = 'batch-reindex-test3'; - - const cleanupReindex = async (indexName) => { - try { - await es.indices.delete({ index: generateNewIndexName(indexName) }); - } catch (e) { - try { - await es.indices.delete({ index: indexName }); - } catch (e) { - // Ignore - } - } - }; - - try { - // Set up indices for the batch - await es.indices.create({ index: test1 }); - await es.indices.create({ index: test2 }); - await es.indices.create({ index: test3 }); - - await es.indices.close({ index: test1 }); - - const result = await supertest - .post(`/api/upgrade_assistant/reindex/batch`) - .set('kbn-xsrf', 'xxx') - .send({ indexNames: [test1, test2, test3] }) - .expect(200); - - expect(result.body.enqueued.length).to.equal(3); - expect(result.body.errors.length).to.equal(0); - - const [{ newIndexName: nameOfIndexThatShouldBeClosed }] = result.body.enqueued; - - await assertQueueState(test1, 3); - await waitForReindexToComplete(test1); - - await assertQueueState(test2, 2); - await waitForReindexToComplete(test2); - - await assertQueueState(test3, 1); - await waitForReindexToComplete(test3); - - await assertQueueState(undefined, 0); - - // Check that the closed index is still closed after reindexing - const resolvedIndices = await es.indices.resolveIndex({ - name: nameOfIndexThatShouldBeClosed, - }); - - const test1ReindexedState = getIndexState(nameOfIndexThatShouldBeClosed, resolvedIndices); - expect(test1ReindexedState).to.be('closed'); - } finally { - await cleanupReindex(test1); - await cleanupReindex(test2); - await cleanupReindex(test3); - } - }); - }); -} diff --git a/x-pack/test/upgrade_assistant_integration/upgrade_assistant/reindexing.ts b/x-pack/test/upgrade_assistant_integration/upgrade_assistant/reindexing.ts new file mode 100644 index 0000000000000..f78ac7cb2521d --- /dev/null +++ b/x-pack/test/upgrade_assistant_integration/upgrade_assistant/reindexing.ts @@ -0,0 +1,262 @@ +/* + * 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 expect from '@kbn/expect'; + +import { + ReindexStatus, + REINDEX_OP_TYPE, + type ResolveIndexResponseFromES, +} from '@kbn/upgrade-assistant-plugin/common/types'; +import { generateNewIndexName } from '@kbn/upgrade-assistant-plugin/server/lib/reindexing/index_settings'; +import { getIndexState } from '@kbn/upgrade-assistant-plugin/common/get_index_state'; +import { FtrProviderContext } from '../../common/ftr_provider_context'; + +export default function ({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + const esArchiver = getService('esArchiver'); + const es = getService('es'); + + // Utility function that keeps polling API until reindex operation has completed or failed. + const waitForReindexToComplete = async (indexName: string) => { + let lastState; + + while (true) { + lastState = (await supertest.get(`/api/upgrade_assistant/reindex/${indexName}`).expect(200)) + .body.reindexOp; + // Once the operation is completed or failed and unlocked, stop polling. + if (lastState.status !== ReindexStatus.inProgress && lastState.locked === null) { + break; + } + await new Promise((resolve) => setTimeout(resolve, 1000)); + } + + return lastState; + }; + + describe('reindexing', () => { + afterEach(() => { + // Cleanup saved objects + return es.deleteByQuery({ + index: '.kibana', + refresh: true, + body: { + query: { + simple_query_string: { + query: REINDEX_OP_TYPE, + fields: ['type'], + }, + }, + }, + }); + }); + + it('should create a new index with the same documents', async () => { + await esArchiver.load('x-pack/test/functional/es_archives/upgrade_assistant/reindex'); + const { body } = await supertest + .post(`/api/upgrade_assistant/reindex/dummydata`) + .set('kbn-xsrf', 'xxx') + .expect(200); + + expect(body.indexName).to.equal('dummydata'); + expect(body.status).to.equal(ReindexStatus.inProgress); + + const lastState = await waitForReindexToComplete('dummydata'); + expect(lastState.errorMessage).to.equal(null); + expect(lastState.status).to.equal(ReindexStatus.completed); + + const { newIndexName } = lastState; + const indexSummary = await es.indices.get({ index: 'dummydata' }); + + // The new index was created + expect(indexSummary[newIndexName]).to.be.an('object'); + // The original index name is aliased to the new one + expect(indexSummary[newIndexName].aliases?.dummydata).to.be.an('object'); + // Verify mappings exist on new index + expect(indexSummary[newIndexName].mappings?.properties).to.be.an('object'); + // The number of documents in the new index matches what we expect + expect((await es.count({ index: lastState.newIndexName })).count).to.be(3); + + // Cleanup newly created index + await es.indices.delete({ + index: lastState.newIndexName, + }); + }); + + it('can resume after reindexing was stopped right after creating the new index', async () => { + await esArchiver.load('x-pack/test/functional/es_archives/upgrade_assistant/reindex'); + + // This new index is the new soon to be created reindexed index. We create it + // upfront to simulate a situation in which the user restarted kibana half + // way through the reindex process and ended up with an extra index. + await es.indices.create({ index: 'reindexed-v9-dummydata' }); + + const { body } = await supertest + .post(`/api/upgrade_assistant/reindex/dummydata`) + .set('kbn-xsrf', 'xxx') + .expect(200); + + expect(body.indexName).to.equal('dummydata'); + expect(body.status).to.equal(ReindexStatus.inProgress); + + const lastState = await waitForReindexToComplete('dummydata'); + expect(lastState.errorMessage).to.equal(null); + expect(lastState.status).to.equal(ReindexStatus.completed); + + // Cleanup newly created index + await es.indices.delete({ + index: lastState.newIndexName, + }); + }); + + it('should update any aliases', async () => { + await esArchiver.load('x-pack/test/functional/es_archives/upgrade_assistant/reindex'); + + // Add aliases and ensure each returns the right number of docs + await es.indices.updateAliases({ + body: { + actions: [ + { add: { index: 'dummydata', alias: 'myAlias' } }, + { add: { index: 'dummy*', alias: 'wildcardAlias' } }, + { + add: { index: 'dummydata', alias: 'myHttpsAlias', filter: { term: { https: true } } }, + }, + ], + }, + }); + expect((await es.count({ index: 'myAlias' })).count).to.be(3); + expect((await es.count({ index: 'wildcardAlias' })).count).to.be(3); + expect((await es.count({ index: 'myHttpsAlias' })).count).to.be(2); + + // Reindex + await supertest + .post(`/api/upgrade_assistant/reindex/dummydata`) + .set('kbn-xsrf', 'xxx') + .expect(200); + const lastState = await waitForReindexToComplete('dummydata'); + + // The regular aliases should still return 3 docs + expect((await es.count({ index: 'myAlias' })).count).to.be(3); + expect((await es.count({ index: 'wildcardAlias' })).count).to.be(3); + // The filtered alias should still return 2 docs + expect((await es.count({ index: 'myHttpsAlias' })).count).to.be(2); + + // Cleanup newly created index + await es.indices.delete({ + index: lastState.newIndexName, + }); + }); + + it('shows no warnings', async () => { + const resp = await supertest.get(`/api/upgrade_assistant/reindex/reindexed-v8-6.0-data`); // reusing the index previously migrated in v8->v9 UA tests + // By default, all reindexing operations will replace an index with an alias (with the same name) + // pointing to a newly created "reindexed" index. + expect(resp.body.warnings.length).to.be(1); + expect(resp.body.warnings[0].warningType).to.be('replaceIndexWithAlias'); + }); + + it('reindexes old 7.0 index', async () => { + const { body } = await supertest + .post(`/api/upgrade_assistant/reindex/reindexed-v8-6.0-data`) // reusing the index previously migrated in v8->v9 UA tests + .set('kbn-xsrf', 'xxx') + .expect(200); + + expect(body.indexName).to.equal('reindexed-v8-6.0-data'); + expect(body.status).to.equal(ReindexStatus.inProgress); + + const lastState = await waitForReindexToComplete('reindexed-v8-6.0-data'); + expect(lastState.errorMessage).to.equal(null); + expect(lastState.status).to.equal(ReindexStatus.completed); + }); + + it('should reindex a batch in order and report queue state', async () => { + const assertQueueState = async ( + firstInQueueIndexName: string | undefined, + queueLength: number + ) => { + const response = await supertest + .get(`/api/upgrade_assistant/reindex/batch/queue`) + .set('kbn-xsrf', 'xxx') + .expect(200); + + const { queue } = response.body; + + const [firstInQueue] = queue; + + if (!firstInQueueIndexName) { + expect(firstInQueueIndexName).to.be(undefined); + } else { + expect(firstInQueue.indexName).to.be(firstInQueueIndexName); + } + + expect(queue.length).to.be(queueLength); + }; + + const test1 = 'batch-reindex-test1'; + const test2 = 'batch-reindex-test2'; + const test3 = 'batch-reindex-test3'; + + const cleanupReindex = async (indexName: string) => { + try { + await es.indices.delete({ index: generateNewIndexName(indexName) }); + } catch (e) { + try { + await es.indices.delete({ index: indexName }); + } catch (_err) { + // Ignore + } + } + }; + + try { + // Set up indices for the batch + await es.indices.create({ index: test1 }); + await es.indices.create({ index: test2 }); + await es.indices.create({ index: test3 }); + + await es.indices.close({ index: test1 }); + + const result = await supertest + .post(`/api/upgrade_assistant/reindex/batch`) + .set('kbn-xsrf', 'xxx') + .send({ indexNames: [test1, test2, test3] }) + .expect(200); + + expect(result.body.enqueued.length).to.equal(3); + expect(result.body.errors.length).to.equal(0); + + const [{ newIndexName: nameOfIndexThatShouldBeClosed }] = result.body.enqueued; + + await assertQueueState(test1, 3); + await waitForReindexToComplete(test1); + + await assertQueueState(test2, 2); + await waitForReindexToComplete(test2); + + await assertQueueState(test3, 1); + await waitForReindexToComplete(test3); + + await assertQueueState(undefined, 0); + + // Check that the closed index is still closed after reindexing + const resolvedIndices = await es.indices.resolveIndex({ + name: nameOfIndexThatShouldBeClosed, + }); + + const test1ReindexedState = getIndexState( + nameOfIndexThatShouldBeClosed, + resolvedIndices as ResolveIndexResponseFromES + ); + expect(test1ReindexedState).to.be('closed'); + } finally { + await cleanupReindex(test1); + await cleanupReindex(test2); + await cleanupReindex(test3); + } + }); + }); +} diff --git a/x-pack/test_serverless/api_integration/test_suites/observability/ai_assistant/tests/complete/functions/summarize.spec.ts b/x-pack/test_serverless/api_integration/test_suites/observability/ai_assistant/tests/complete/functions/summarize.spec.ts index f949268aa730a..823dd15f46b64 100644 --- a/x-pack/test_serverless/api_integration/test_suites/observability/ai_assistant/tests/complete/functions/summarize.spec.ts +++ b/x-pack/test_serverless/api_integration/test_suites/observability/ai_assistant/tests/complete/functions/summarize.spec.ts @@ -11,6 +11,13 @@ import { LlmProxy, createLlmProxy, } from '@kbn/test-suites-xpack/observability_ai_assistant_api_integration/common/create_llm_proxy'; +import { + clearKnowledgeBase, + createKnowledgeBaseModel, + deleteInferenceEndpoint, + deleteKnowledgeBaseModel, + TINY_ELSER, +} from '@kbn/test-suites-xpack/observability_ai_assistant_api_integration/tests/knowledge_base/helpers'; import { FtrProviderContext } from '../../../common/ftr_provider_context'; import { invokeChatCompleteWithFunctionRequest } from './helpers'; import { @@ -22,12 +29,15 @@ import type { InternalRequestHeader, RoleCredentials } from '../../../../../../. export default function ApiTest({ getService }: FtrProviderContext) { const supertest = getService('supertest'); const log = getService('log'); + const ml = getService('ml'); + const es = getService('es'); const observabilityAIAssistantAPIClient = getService('observabilityAIAssistantAPIClient'); const svlUserManager = getService('svlUserManager'); const svlCommonApi = getService('svlCommonApi'); - // Skipped until Elser is available in tests - describe.skip('when calling summarize function', () => { + describe('when calling summarize function', function () { + // TODO: https://github.com/elastic/kibana/issues/192751 + this.tags(['skipMKI']); let roleAuthc: RoleCredentials; let internalReqHeader: InternalRequestHeader; let proxy: LlmProxy; @@ -36,6 +46,19 @@ export default function ApiTest({ getService }: FtrProviderContext) { before(async () => { roleAuthc = await svlUserManager.createM2mApiKeyWithRoleScope('editor'); internalReqHeader = svlCommonApi.getInternalRequestHeader(); + + await createKnowledgeBaseModel(ml); + await observabilityAIAssistantAPIClient + .slsAdmin({ + endpoint: 'POST /internal/observability_ai_assistant/kb/setup', + params: { + query: { + model_id: TINY_ELSER.id, + }, + }, + }) + .expect(200); + proxy = await createLlmProxy(log); connectorId = await createProxyActionConnector({ supertest, @@ -57,10 +80,10 @@ export default function ApiTest({ getService }: FtrProviderContext) { name: 'summarize', trigger: MessageRole.User, arguments: JSON.stringify({ - id: 'my-id', + title: 'My Title', text: 'Hello world', is_correction: false, - confidence: 1, + confidence: 'high', public: false, }), }, @@ -72,6 +95,9 @@ export default function ApiTest({ getService }: FtrProviderContext) { after(async () => { proxy.close(); await deleteActionConnector({ supertest, connectorId, log, roleAuthc, internalReqHeader }); + await deleteKnowledgeBaseModel(ml); + await clearKnowledgeBase(es); + await deleteInferenceEndpoint({ es }); }); it('persists entry in knowledge base', async () => { @@ -80,12 +106,20 @@ export default function ApiTest({ getService }: FtrProviderContext) { params: { query: { query: '', - sortBy: 'doc_id', + sortBy: 'title', sortDirection: 'asc', }, }, }); + const { role, public: isPublic, text, type, user, title } = res.body.entries[0]; + + expect(role).to.eql('assistant_summarization'); + expect(isPublic).to.eql(false); + expect(text).to.eql('Hello world'); + expect(type).to.eql('contextual'); + expect(user?.name).to.eql('elastic_editor'); // "editor" in stateful + expect(title).to.eql('My Title'); expect(res.body.entries).to.have.length(1); }); }); diff --git a/x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/graph.ts b/x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/graph.ts index aaccdd0e9a41c..2cbe40e945492 100644 --- a/x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/graph.ts +++ b/x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/graph.ts @@ -49,7 +49,7 @@ export default function ({ getService }: FtrProviderContext) { it('should return an empty graph', async () => { const response = await postGraph(supertestViewer, { query: { - eventIds: [], + originEventIds: [], start: 'now-1d/d', end: 'now/d', }, @@ -63,7 +63,7 @@ export default function ({ getService }: FtrProviderContext) { it('should return a graph with nodes and edges by actor', async () => { const response = await postGraph(supertestViewer, { query: { - eventIds: [], + originEventIds: [], start: '2024-09-01T00:00:00Z', end: '2024-09-02T00:00:00Z', esQuery: { diff --git a/x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/serverless_metering/cloud_security_metering.ts b/x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/serverless_metering/cloud_security_metering.ts index b57dace68c4da..13ac5f96347c0 100644 --- a/x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/serverless_metering/cloud_security_metering.ts +++ b/x-pack/test_serverless/api_integration/test_suites/security/cloud_security_posture/serverless_metering/cloud_security_metering.ts @@ -9,18 +9,13 @@ import expect from '@kbn/expect'; import { CDR_LATEST_NATIVE_VULNERABILITIES_INDEX_PATTERN } from '@kbn/cloud-security-posture-common'; import { LATEST_FINDINGS_INDEX_DEFAULT_NS } from '@kbn/cloud-security-posture-plugin/common/constants'; import * as http from 'http'; -import { - createPackagePolicy, - createCloudDefendPackagePolicy, -} from '@kbn/test-suites-xpack/api_integration/apis/cloud_security_posture/helper'; +import { createPackagePolicy } from '@kbn/test-suites-xpack/api_integration/apis/cloud_security_posture/helper'; import { EsIndexDataProvider } from '@kbn/test-suites-xpack/cloud_security_posture_api/utils'; import { RoleCredentials } from '../../../../../shared/services'; -import { getMockFindings, getMockDefendForContainersHeartbeats } from './mock_data'; +import { getMockFindings } from './mock_data'; import type { FtrProviderContext } from '../../../../ftr_provider_context'; import { UsageRecord, getInterceptedRequestPayload, setupMockServer } from './mock_usage_server'; -const CLOUD_DEFEND_HEARTBEAT_INDEX_DEFAULT_NS = 'metrics-cloud_defend.heartbeat-default'; - export default function (providerContext: FtrProviderContext) { const mockUsageApiApp = setupMockServer(); const { getService } = providerContext; @@ -32,7 +27,6 @@ export default function (providerContext: FtrProviderContext) { const svlUserManager = getService('svlUserManager'); const supertestWithoutAuth = getService('supertestWithoutAuth'); const findingsIndex = new EsIndexDataProvider(es, LATEST_FINDINGS_INDEX_DEFAULT_NS); - const cloudDefinedIndex = new EsIndexDataProvider(es, CLOUD_DEFEND_HEARTBEAT_INDEX_DEFAULT_NS); const vulnerabilitiesIndex = new EsIndexDataProvider( es, CDR_LATEST_NATIVE_VULNERABILITIES_INDEX_PATTERN @@ -74,7 +68,6 @@ export default function (providerContext: FtrProviderContext) { await findingsIndex.deleteAll(); await vulnerabilitiesIndex.deleteAll(); - await cloudDefinedIndex.deleteAll(); }); afterEach(async () => { @@ -82,7 +75,6 @@ export default function (providerContext: FtrProviderContext) { await esArchiver.unload('x-pack/test/functional/es_archives/fleet/empty_fleet_server'); await findingsIndex.deleteAll(); await vulnerabilitiesIndex.deleteAll(); - await cloudDefinedIndex.deleteAll(); }); after(async () => { await svlUserManager.invalidateM2mApiKeyWithRoleScope(roleAuthc); @@ -202,43 +194,6 @@ export default function (providerContext: FtrProviderContext) { }); }); - it('Should intercept usage API request for Defend for Containers', async () => { - await createCloudDefendPackagePolicy( - supertestWithoutAuth, - agentPolicyId, - roleAuthc, - internalRequestHeader - ); - - const blockActionEnabledHeartbeats = getMockDefendForContainersHeartbeats({ - isBlockActionEnables: true, - numberOfHearbeats: 2, - }); - - const blockActionDisabledHeartbeats = getMockDefendForContainersHeartbeats({ - isBlockActionEnables: false, - numberOfHearbeats: 2, - }); - - await cloudDefinedIndex.addBulk([ - ...blockActionEnabledHeartbeats, - ...blockActionDisabledHeartbeats, - ]); - - let interceptedRequestBody: UsageRecord[] = []; - - await retry.try(async () => { - interceptedRequestBody = getInterceptedRequestPayload(); - expect(interceptedRequestBody.length).to.greaterThan(0); - if (interceptedRequestBody.length > 0) { - const usageSubTypes = interceptedRequestBody.map((record) => record.usage.sub_type); - expect(usageSubTypes).to.contain('cloud_defend'); - expect(interceptedRequestBody.length).to.be(blockActionEnabledHeartbeats.length); - expect(interceptedRequestBody[0].usage.type).to.be('cloud_security'); - } - }); - }); - it('Should intercept usage API request with all integrations usage records', async () => { // Create one package policy - it takes care forCSPM, KSMP and CNVM await createPackagePolicy( @@ -253,13 +208,6 @@ export default function (providerContext: FtrProviderContext) { internalRequestHeader ); - // Create Defend for Containers package policy - await createCloudDefendPackagePolicy( - supertestWithoutAuth, - agentPolicyId, - roleAuthc, - internalRequestHeader - ); const billableFindingsCSPM = getMockFindings({ postureType: 'cspm', isBillableAsset: true, @@ -289,16 +237,6 @@ export default function (providerContext: FtrProviderContext) { numberOfFindings: 11, }); - const blockActionEnabledHeartbeats = getMockDefendForContainersHeartbeats({ - isBlockActionEnables: true, - numberOfHearbeats: 2, - }); - - const blockActionDisabledHeartbeats = getMockDefendForContainersHeartbeats({ - isBlockActionEnables: false, - numberOfHearbeats: 2, - }); - await Promise.all([ findingsIndex.addBulk([ ...billableFindingsCSPM, @@ -307,10 +245,6 @@ export default function (providerContext: FtrProviderContext) { ...notBillableFindingsKSPM, ]), vulnerabilitiesIndex.addBulk([...billableFindingsCNVM]), - cloudDefinedIndex.addBulk([ - ...blockActionEnabledHeartbeats, - ...blockActionDisabledHeartbeats, - ]), ]); // Intercept and verify usage API request @@ -323,16 +257,12 @@ export default function (providerContext: FtrProviderContext) { expect(usageSubTypes).to.contain('cspm'); expect(usageSubTypes).to.contain('kspm'); expect(usageSubTypes).to.contain('cnvm'); - expect(usageSubTypes).to.contain('cloud_defend'); const totalUsageQuantity = interceptedRequestBody.reduce( (acc, record) => acc + record.usage.quantity, 0 ); expect(totalUsageQuantity).to.be( - billableFindingsCSPM.length + - billableFindingsKSPM.length + - billableFindingsCNVM.length + - blockActionEnabledHeartbeats.length + billableFindingsCSPM.length + billableFindingsKSPM.length + billableFindingsCNVM.length ); }); }); diff --git a/x-pack/test_serverless/functional/test_suites/common/management/index_management/component_templates.ts b/x-pack/test_serverless/functional/test_suites/common/management/index_management/component_templates.ts index d72aadd9dbb1a..66a0a0f33d545 100644 --- a/x-pack/test_serverless/functional/test_suites/common/management/index_management/component_templates.ts +++ b/x-pack/test_serverless/functional/test_suites/common/management/index_management/component_templates.ts @@ -13,94 +13,125 @@ import { FtrProviderContext } from '../../../../ftr_provider_context'; export default ({ getPageObjects, getService }: FtrProviderContext) => { const pageObjects = getPageObjects(['svlCommonPage', 'common', 'indexManagement', 'header']); const browser = getService('browser'); - const security = getService('security'); + const samlAuth = getService('samlAuth'); const testSubjects = getService('testSubjects'); const es = getService('es'); const TEST_COMPONENT_TEMPLATE = '.a_test_component_template'; describe('Index component templates', function () { - before(async () => { - await security.testUser.setRoles(['index_management_user']); - await pageObjects.svlCommonPage.loginAsAdmin(); - }); + describe('with access', () => { + before(async () => { + await pageObjects.svlCommonPage.loginAsAdmin(); + }); - beforeEach(async () => { - await pageObjects.common.navigateToApp('indexManagement'); - // Navigate to the index templates tab - await pageObjects.indexManagement.changeTabs('component_templatesTab'); - await pageObjects.header.waitUntilLoadingHasFinished(); - }); + beforeEach(async () => { + await pageObjects.common.navigateToApp('indexManagement'); + // Navigate to the index templates tab + await pageObjects.indexManagement.changeTabs('component_templatesTab'); + await pageObjects.header.waitUntilLoadingHasFinished(); + }); - it('renders the component templates tab', async () => { - const url = await browser.getCurrentUrl(); - expect(url).to.contain(`/component_templates`); - }); + it('renders the component templates tab', async () => { + const url = await browser.getCurrentUrl(); + expect(url).to.contain(`/component_templates`); + }); - describe('Component templates list', () => { - before(async () => { - await es.cluster.putComponentTemplate({ - name: TEST_COMPONENT_TEMPLATE, - body: { - template: { - settings: { - index: { - number_of_shards: 1, + describe('Component templates list', () => { + before(async () => { + await es.cluster.putComponentTemplate({ + name: TEST_COMPONENT_TEMPLATE, + body: { + template: { + settings: { + index: { + number_of_shards: 1, + }, }, }, }, - }, + }); }); - }); - after(async () => { - await es.cluster.deleteComponentTemplate( - { name: TEST_COMPONENT_TEMPLATE }, - { ignore: [404] } - ); + after(async () => { + await es.cluster.deleteComponentTemplate( + { name: TEST_COMPONENT_TEMPLATE }, + { ignore: [404] } + ); + }); + + it('Displays the test component template in the list', async () => { + const templates = await testSubjects.findAll('componentTemplateTableRow'); + + const getTemplateName = async (template: WebElementWrapper) => { + const templateNameElement = await template.findByTestSubject('templateDetailsLink'); + return await templateNameElement.getVisibleText(); + }; + + const componentTemplateList = await Promise.all( + templates.map((template) => getTemplateName(template)) + ); + + const newComponentTemplateExists = Boolean( + componentTemplateList.find((templateName) => templateName === TEST_COMPONENT_TEMPLATE) + ); + + expect(newComponentTemplateExists).to.be(true); + }); }); - it('Displays the test component template in the list', async () => { - const templates = await testSubjects.findAll('componentTemplateTableRow'); + describe('Create component template', () => { + after(async () => { + await es.cluster.deleteComponentTemplate( + { name: TEST_COMPONENT_TEMPLATE }, + { ignore: [404] } + ); + }); - const getTemplateName = async (template: WebElementWrapper) => { - const templateNameElement = await template.findByTestSubject('templateDetailsLink'); - return await templateNameElement.getVisibleText(); - }; + it('Creates component template', async () => { + await testSubjects.click('createPipelineButton'); - const componentTemplateList = await Promise.all( - templates.map((template) => getTemplateName(template)) - ); + await testSubjects.setValue('nameField', TEST_COMPONENT_TEMPLATE); - const newComponentTemplateExists = Boolean( - componentTemplateList.find((templateName) => templateName === TEST_COMPONENT_TEMPLATE) - ); + // Finish wizard flow + await testSubjects.click('nextButton'); + await testSubjects.click('nextButton'); + await testSubjects.click('nextButton'); + await testSubjects.click('nextButton'); + await testSubjects.click('nextButton'); - expect(newComponentTemplateExists).to.be(true); + expect(await testSubjects.getVisibleText('title')).to.contain(TEST_COMPONENT_TEMPLATE); + }); }); }); - describe('Create component template', () => { - after(async () => { - await es.cluster.deleteComponentTemplate( - { name: TEST_COMPONENT_TEMPLATE }, - { ignore: [404] } - ); + describe('no access', () => { + this.tags(['skipSvlOblt', 'skipMKI']); + before(async () => { + await samlAuth.setCustomRole({ + elasticsearch: { + cluster: ['monitor'], + indices: [{ names: ['*'], privileges: ['all'] }], + }, + kibana: [ + { + base: ['all'], + feature: {}, + spaces: ['*'], + }, + ], + }); + await pageObjects.svlCommonPage.loginWithCustomRole(); + await pageObjects.common.navigateToApp('indexManagement'); + await pageObjects.header.waitUntilLoadingHasFinished(); }); - it('Creates component template', async () => { - await testSubjects.click('createPipelineButton'); - - await testSubjects.setValue('nameField', TEST_COMPONENT_TEMPLATE); - - // Finish wizard flow - await testSubjects.click('nextButton'); - await testSubjects.click('nextButton'); - await testSubjects.click('nextButton'); - await testSubjects.click('nextButton'); - await testSubjects.click('nextButton'); + after(async () => { + await samlAuth.deleteCustomRole(); + }); - expect(await testSubjects.getVisibleText('title')).to.contain(TEST_COMPONENT_TEMPLATE); + it('hides the component templates tab', async () => { + await testSubjects.missingOrFail('component_templatesTab'); }); }); }); diff --git a/x-pack/test_serverless/functional/test_suites/search/inference_management.ts b/x-pack/test_serverless/functional/test_suites/search/inference_management.ts index ecb49911edb18..fce97e3bbf475 100644 --- a/x-pack/test_serverless/functional/test_suites/search/inference_management.ts +++ b/x-pack/test_serverless/functional/test_suites/search/inference_management.ts @@ -23,13 +23,16 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const ml = getService('ml'); describe('Serverless Inference Management UI', function () { + // see details: https://github.com/elastic/kibana/issues/204539 + this.tags(['failsOnMKI']); const endpoint = 'endpoint-1'; const taskType = 'sparse_embedding'; const modelConfig = { - service: 'elser', + service: 'elasticsearch', service_settings: { num_allocations: 1, num_threads: 1, + model_id: '.elser_model_2', }, }; diff --git a/yarn.lock b/yarn.lock index c2c2aa526ea31..839171e5f7134 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4013,7 +4013,7 @@ version "0.0.0" uid "" -"@kbn/asset-inventory-plugin@link:x-pack/plugins/asset_inventory": +"@kbn/asset-inventory-plugin@link:x-pack/solutions/security/plugins/asset_inventory": version "0.0.0" uid "" @@ -4053,10 +4053,6 @@ version "0.0.0" uid "" -"@kbn/bfetch-explorer-plugin@link:examples/bfetch_explorer": - version "0.0.0" - uid "" - "@kbn/bfetch-plugin@link:src/plugins/bfetch": version "0.0.0" uid "" @@ -4145,7 +4141,7 @@ version "0.0.0" uid "" -"@kbn/cloud-defend-plugin@link:x-pack/plugins/cloud_defend": +"@kbn/cloud-defend-plugin@link:x-pack/solutions/security/plugins/cloud_defend": version "0.0.0" uid "" @@ -4169,19 +4165,19 @@ version "0.0.0" uid "" -"@kbn/cloud-security-posture-common@link:x-pack/packages/kbn-cloud-security-posture/common": +"@kbn/cloud-security-posture-common@link:x-pack/platform/packages/shared/kbn-cloud-security-posture/common": version "0.0.0" uid "" -"@kbn/cloud-security-posture-graph@link:x-pack/packages/kbn-cloud-security-posture/graph": +"@kbn/cloud-security-posture-graph@link:x-pack/solutions/security/packages/kbn-cloud-security-posture/graph": version "0.0.0" uid "" -"@kbn/cloud-security-posture-plugin@link:x-pack/plugins/cloud_security_posture": +"@kbn/cloud-security-posture-plugin@link:x-pack/solutions/security/plugins/cloud_security_posture": version "0.0.0" uid "" -"@kbn/cloud-security-posture@link:x-pack/packages/kbn-cloud-security-posture/public": +"@kbn/cloud-security-posture@link:x-pack/solutions/security/packages/kbn-cloud-security-posture/public": version "0.0.0" uid "" @@ -5313,7 +5309,7 @@ version "0.0.0" uid "" -"@kbn/deeplinks-security@link:packages/deeplinks/security": +"@kbn/deeplinks-security@link:src/platform/packages/shared/deeplinks/security": version "0.0.0" uid "" @@ -5965,7 +5961,7 @@ version "0.0.0" uid "" -"@kbn/ingest-pipelines-plugin@link:x-pack/plugins/ingest_pipelines": +"@kbn/ingest-pipelines-plugin@link:x-pack/platform/plugins/shared/ingest_pipelines": version "0.0.0" uid "" @@ -6085,7 +6081,7 @@ version "0.0.0" uid "" -"@kbn/kubernetes-security-plugin@link:x-pack/plugins/kubernetes_security": +"@kbn/kubernetes-security-plugin@link:x-pack/solutions/security/plugins/kubernetes_security": version "0.0.0" uid "" @@ -6141,7 +6137,7 @@ version "0.0.0" uid "" -"@kbn/lists-plugin@link:x-pack/plugins/lists": +"@kbn/lists-plugin@link:x-pack/solutions/security/plugins/lists": version "0.0.0" uid "" @@ -6549,7 +6545,7 @@ version "0.0.0" uid "" -"@kbn/openapi-common@link:packages/kbn-openapi-common": +"@kbn/openapi-common@link:src/platform/packages/shared/kbn-openapi-common": version "0.0.0" uid "" @@ -6957,7 +6953,7 @@ version "0.0.0" uid "" -"@kbn/screenshotting-plugin@link:x-pack/plugins/screenshotting": +"@kbn/screenshotting-plugin@link:x-pack/platform/plugins/shared/screenshotting": version "0.0.0" uid "" @@ -7089,7 +7085,7 @@ version "0.0.0" uid "" -"@kbn/security-solution-ess@link:x-pack/plugins/security_solution_ess": +"@kbn/security-solution-ess@link:x-pack/solutions/security/plugins/security_solution_ess": version "0.0.0" uid "" @@ -7105,11 +7101,11 @@ version "0.0.0" uid "" -"@kbn/security-solution-plugin@link:x-pack/plugins/security_solution": +"@kbn/security-solution-plugin@link:x-pack/solutions/security/plugins/security_solution": version "0.0.0" uid "" -"@kbn/security-solution-serverless@link:x-pack/plugins/security_solution_serverless": +"@kbn/security-solution-serverless@link:x-pack/solutions/security/plugins/security_solution_serverless": version "0.0.0" uid "" @@ -7133,7 +7129,7 @@ version "0.0.0" uid "" -"@kbn/securitysolution-autocomplete@link:packages/kbn-securitysolution-autocomplete": +"@kbn/securitysolution-autocomplete@link:x-pack/solutions/security/packages/kbn-securitysolution-autocomplete": version "0.0.0" uid "" @@ -7145,71 +7141,71 @@ version "0.0.0" uid "" -"@kbn/securitysolution-endpoint-exceptions-common@link:packages/kbn-securitysolution-endpoint-exceptions-common": +"@kbn/securitysolution-endpoint-exceptions-common@link:x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common": version "0.0.0" uid "" -"@kbn/securitysolution-es-utils@link:packages/kbn-securitysolution-es-utils": +"@kbn/securitysolution-es-utils@link:src/platform/packages/shared/kbn-securitysolution-es-utils": version "0.0.0" uid "" -"@kbn/securitysolution-exception-list-components@link:packages/kbn-securitysolution-exception-list-components": +"@kbn/securitysolution-exception-list-components@link:x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components": version "0.0.0" uid "" -"@kbn/securitysolution-exceptions-common@link:packages/kbn-securitysolution-exceptions-common": +"@kbn/securitysolution-exceptions-common@link:x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common": version "0.0.0" uid "" -"@kbn/securitysolution-hook-utils@link:packages/kbn-securitysolution-hook-utils": +"@kbn/securitysolution-hook-utils@link:x-pack/solutions/security/packages/kbn-securitysolution-hook-utils": version "0.0.0" uid "" -"@kbn/securitysolution-io-ts-alerting-types@link:packages/kbn-securitysolution-io-ts-alerting-types": +"@kbn/securitysolution-io-ts-alerting-types@link:x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types": version "0.0.0" uid "" -"@kbn/securitysolution-io-ts-list-types@link:packages/kbn-securitysolution-io-ts-list-types": +"@kbn/securitysolution-io-ts-list-types@link:x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types": version "0.0.0" uid "" -"@kbn/securitysolution-io-ts-types@link:packages/kbn-securitysolution-io-ts-types": +"@kbn/securitysolution-io-ts-types@link:src/platform/packages/shared/kbn-securitysolution-io-ts-types": version "0.0.0" uid "" -"@kbn/securitysolution-io-ts-utils@link:packages/kbn-securitysolution-io-ts-utils": +"@kbn/securitysolution-io-ts-utils@link:src/platform/packages/shared/kbn-securitysolution-io-ts-utils": version "0.0.0" uid "" -"@kbn/securitysolution-list-api@link:packages/kbn-securitysolution-list-api": +"@kbn/securitysolution-list-api@link:x-pack/solutions/security/packages/kbn-securitysolution-list-api": version "0.0.0" uid "" -"@kbn/securitysolution-list-constants@link:packages/kbn-securitysolution-list-constants": +"@kbn/securitysolution-list-constants@link:x-pack/solutions/security/packages/kbn-securitysolution-list-constants": version "0.0.0" uid "" -"@kbn/securitysolution-list-hooks@link:packages/kbn-securitysolution-list-hooks": +"@kbn/securitysolution-list-hooks@link:x-pack/solutions/security/packages/kbn-securitysolution-list-hooks": version "0.0.0" uid "" -"@kbn/securitysolution-list-utils@link:packages/kbn-securitysolution-list-utils": +"@kbn/securitysolution-list-utils@link:x-pack/solutions/security/packages/kbn-securitysolution-list-utils": version "0.0.0" uid "" -"@kbn/securitysolution-lists-common@link:packages/kbn-securitysolution-lists-common": +"@kbn/securitysolution-lists-common@link:x-pack/solutions/security/packages/kbn-securitysolution-lists-common": version "0.0.0" uid "" -"@kbn/securitysolution-rules@link:packages/kbn-securitysolution-rules": +"@kbn/securitysolution-rules@link:src/platform/packages/shared/kbn-securitysolution-rules": version "0.0.0" uid "" -"@kbn/securitysolution-t-grid@link:packages/kbn-securitysolution-t-grid": +"@kbn/securitysolution-t-grid@link:x-pack/solutions/security/packages/kbn-securitysolution-t-grid": version "0.0.0" uid "" -"@kbn/securitysolution-utils@link:packages/kbn-securitysolution-utils": +"@kbn/securitysolution-utils@link:x-pack/solutions/security/packages/kbn-securitysolution-utils": version "0.0.0" uid "" @@ -7253,7 +7249,7 @@ version "0.0.0" uid "" -"@kbn/serverless-security-settings@link:packages/serverless/settings/security_project": +"@kbn/serverless-security-settings@link:src/platform/packages/shared/serverless/settings/security_project": version "0.0.0" uid "" @@ -7273,7 +7269,7 @@ version "0.0.0" uid "" -"@kbn/session-view-plugin@link:x-pack/plugins/session_view": +"@kbn/session-view-plugin@link:x-pack/solutions/security/plugins/session_view": version "0.0.0" uid "" @@ -7493,7 +7489,7 @@ version "0.0.0" uid "" -"@kbn/slo-plugin@link:x-pack/plugins/observability_solution/slo": +"@kbn/slo-plugin@link:x-pack/solutions/observability/plugins/slo": version "0.0.0" uid "" @@ -7969,7 +7965,7 @@ version "0.0.0" uid "" -"@kbn/zod-helpers@link:packages/kbn-zod-helpers": +"@kbn/zod-helpers@link:src/platform/packages/shared/kbn-zod-helpers": version "0.0.0" uid "" @@ -9188,12 +9184,12 @@ require-from-string "^2.0.2" uri-js-replace "^1.0.1" -"@redocly/cli@^1.25.15": - version "1.25.15" - resolved "https://registry.yarnpkg.com/@redocly/cli/-/cli-1.25.15.tgz#12e487dd7a45ceda38655f2a93721ac15868f4e6" - integrity sha512-ZD743CJX4FpMJvGNE9Cm3gNn8LNRzRjyrYNVPi1C4iIEtrFkr5Zq791qv6gUFehWns71svbVyzWD9ftVTdfqYg== +"@redocly/cli@^1.26.0": + version "1.26.0" + resolved "https://registry.yarnpkg.com/@redocly/cli/-/cli-1.26.0.tgz#0f5707f55d833993ffc9644fed7d85fcafe37877" + integrity sha512-yUsrTmEPHaBDQf16jSFGi2n+AJabHacLpr7La92Dseo0tRkgLKsUWiaVEEyqm79POBytD87mVTi3THitqnSyZQ== dependencies: - "@redocly/openapi-core" "1.25.15" + "@redocly/openapi-core" "1.26.0" abort-controller "^3.0.0" chokidar "^3.5.1" colorette "^1.2.0" @@ -9218,10 +9214,10 @@ resolved "https://registry.yarnpkg.com/@redocly/config/-/config-0.17.1.tgz#2def04cecf440dd78c0f102f53f3444fac050768" integrity sha512-CEmvaJuG7pm2ylQg53emPmtgm4nW2nxBgwXzbVEHpGas/lGnMyN8Zlkgiz6rPw0unASg6VW3wlz27SOL5XFHYQ== -"@redocly/openapi-core@1.25.15", "@redocly/openapi-core@^1.4.0": - version "1.25.15" - resolved "https://registry.yarnpkg.com/@redocly/openapi-core/-/openapi-core-1.25.15.tgz#61d82b054340e080998efc3f701ca55c20f7fdb8" - integrity sha512-/dpr5zpGj2t1Bf7EIXEboRZm1hsJZBQfv3Q1pkivtdAEg3if2khv+b9gY68aquC6cM/2aQY2kMLy8LlY2tn+Og== +"@redocly/openapi-core@1.26.0", "@redocly/openapi-core@^1.4.0": + version "1.26.0" + resolved "https://registry.yarnpkg.com/@redocly/openapi-core/-/openapi-core-1.26.0.tgz#ffd6c3d9f7e98c4b61584d5c0511cf953d1cfade" + integrity sha512-8Ofu6WpBp7eoLmf1qQ4+T0W4LRr8es+4Drw/RJG+acPXmaT2TmHk2B2v+3+1R9GqSIj6kx3N7JmQkxAPCnvDLw== dependencies: "@redocly/ajv" "^8.11.2" "@redocly/config" "^0.17.0"